html[data-theme="dark"]{
color-scheme:dark;
--ink:#e7efeb;
--muted:#98aaa2;
--line:#31423b;
--canvas:#101714;
--panel:#18221e;
--forest:#8fc4ad;
--sage:#557b6b;
--mint:#21382f;
--green:#5fc49a;
--red:#ef8588;
--amber:#e2ad5c;
--violet:#b49ada;
--blue:#79add0;
--shadow:0 12px 34px rgba(0,0,0,.24)
}
html[data-theme="dark"] body{background:var(--canvas);color:var(--ink)}
html[data-theme="dark"] .sidebar{background:#0d1d18}
html[data-theme="dark"] .topbar{background:rgba(16,23,20,.9)}
html[data-theme="dark"] .metric,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .portfolio-card,
html[data-theme="dark"] dialog,
html[data-theme="dark"] .auth-card{background:var(--panel);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .btn.secondary,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .settings-tabs,
html[data-theme="dark"] .changelog-filters,
html[data-theme="dark"] .column-picker,
html[data-theme="dark"] .column-info,
html[data-theme="dark"] .currency-issue-status,
html[data-theme="dark"] .import-summary div,
html[data-theme="dark"] .import-mapping{background:#1c2924;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus{border-color:#659982;box-shadow:0 0 0 3px rgba(95,196,154,.12)}
html[data-theme="dark"] textarea::placeholder{color:#81948b}
html[data-theme="dark"] .settings-tabs button.active,
html[data-theme="dark"] .changelog-filters button[aria-pressed=true],
html[data-theme="dark"] .admin-tabs button[aria-selected=true],
html[data-theme="dark"] .allocation-modes button.active{background:#294038;color:#85d2b1}
html[data-theme="dark"] .admin-tabs,
html[data-theme="dark"] .allocation-modes,
html[data-theme="dark"] .summary-pill,
html[data-theme="dark"] .as-of,
html[data-theme="dark"] .close-btn,
html[data-theme="dark"] .asset-icon,
html[data-theme="dark"] .quote-change,
html[data-theme="dark"] .performance-method-card,
html[data-theme="dark"] .performance-benchmark-summary,
html[data-theme="dark"] .position-bar-track{background:#24332d;color:#a9bbb3}
html[data-theme="dark"] th{color:#91a29a}
html[data-theme="dark"] td{border-bottom-color:#2a3933}
html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .position-row:hover,
html[data-theme="dark"] .position-row:focus,
html[data-theme="dark"] .portfolio-table .position-row:hover td:first-child,
html[data-theme="dark"] .column-picker label:hover,
html[data-theme="dark"] .symbol-suggestion:hover,
html[data-theme="dark"] .symbol-suggestion:focus{background:#1e2c27}
html[data-theme="dark"] .portfolio-table th:first-child,
html[data-theme="dark"] .portfolio-table td:first-child,
html[data-theme="dark"] .position-history th,
html[data-theme="dark"] .symbol-suggestions,
html[data-theme="dark"] .symbol-suggestion,
html[data-theme="dark"] .asset-logo{background:var(--panel)}
html[data-theme="dark"] .symbol-suggestion{border-bottom-color:var(--line)}
html[data-theme="dark"] .position-hero>div,
html[data-theme="dark"] .admin-user-summary>div,
html[data-theme="dark"] .admin-refresh-breakdown,
html[data-theme="dark"] .import-dropzone,
html[data-theme="dark"] .logo-preview-card,
html[data-theme="dark"] .exchange-fields,
html[data-theme="dark"] .performance-methods{background:#16211d}
html[data-theme="dark"] .performance-method-card-primary{background:#1b3028;border-color:#35644f}
html[data-theme="dark"] .performance-method-card-personal{background:#2a2921}
html[data-theme="dark"] .performance-method-name abbr{background:#30413a}
html[data-theme="dark"] .import-table-wrap th{background:#202d28}
html[data-theme="dark"] .form-grid input[readonly],
html[data-theme="dark"] .symbol-lookup input[readonly]{background:#222e29;color:#a7b8b0}
html[data-theme="dark"] .site-footer{background:rgba(24,34,30,.75);border-color:var(--line)}
html[data-theme="dark"] .site-footer strong{color:#b8d5c8}
html[data-theme="dark"] .settings-card label,
html[data-theme="dark"] .form-grid label,
html[data-theme="dark"] .small-dialog label,
html[data-theme="dark"] .danger-action label,
html[data-theme="dark"] .auth-card label,
html[data-theme="dark"] .symbol-lookup label{color:#b4c4bd}
html[data-theme="dark"] .changelog-card li{color:#aabbb3}
html[data-theme="dark"] .danger-zone{background:#241a1b;border-color:#5e383a}
html[data-theme="dark"] .danger-action{background:#1c2020;border-color:#5b383a}
html[data-theme="dark"] .danger-action h3{color:#ee9b9e}
html[data-theme="dark"] .btn.danger-secondary{background:#241a1b}
html[data-theme="dark"] .registration-closed-notice{background:#2b281d;border-color:#625638;color:#dbc896}
html[data-theme="dark"] .registration-closed-notice strong{color:#f0d99f}
html[data-theme="dark"] .lookup-status,
html[data-theme="dark"] .calculation-error{background:#252e2a}
html[data-theme="dark"] .metric-icon.green,
html[data-theme="dark"] .settings-icon,
html[data-theme="dark"] .background-status,
html[data-theme="dark"] .current-session-badge,
html[data-theme="dark"] .verification-badge.verified{background:#20382e}
html[data-theme="dark"] .metric-icon.amber{background:#3a3020}
html[data-theme="dark"] .metric-icon.violet{background:#30283d}
html[data-theme="dark"] .metric-icon.blue,
html[data-theme="dark"] .demo-icon{background:#233341}
html[data-theme="dark"] .tag.buy,
html[data-theme="dark"] .quote-change.return-positive,
html[data-theme="dark"] .performance-benchmark-summary.positive{background:#20372d}
html[data-theme="dark"] .tag.sell,
html[data-theme="dark"] .quote-change.return-negative,
html[data-theme="dark"] .performance-benchmark-summary.negative{background:#402729}
html[data-theme="dark"] .tag.dividend,
html[data-theme="dark"] .as-of.freshness-delayed{background:#3a3020}
html[data-theme="dark"] .tag.exchange,
html[data-theme="dark"] .as-of.freshness-closed{background:#243642}
html[data-theme="dark"] .auth-screen{background:linear-gradient(135deg,#091510,#172a23)}
html[data-theme="dark"] .hero-card{background:linear-gradient(130deg,#183a30,#0c211a)}
html[data-theme="dark"] ::selection{background:#376f5a;color:#fff}

/* La page d'accueil publique garde sa propre direction visuelle, quel que soit
   le thème enregistré lors de la dernière session authentifiée. */
html[data-theme="dark"] .auth-screen{background:#f3f1e9;color:#18332b}
html[data-theme="dark"] .auth-card{background:rgba(255,255,255,.92);border-color:rgba(24,59,50,.12);color:#18332b}
html[data-theme="dark"] .auth-card label{color:#52615b}
html[data-theme="dark"] .auth-card input{background:#fbfcfa;border-color:#dfe5e1;color:#18332b}
html[data-theme="dark"] .auth-card input:focus{border-color:#7fa497;box-shadow:0 0 0 3px rgba(68,121,101,.1)}
