/* Shared theme controls. The saved/system theme is applied in <head> before paint. */
.brand .logo-dark{display:none}
.theme-toggle{display:grid;place-items:center;width:35px;height:35px;flex:0 0 35px;border:1px solid #dce3ee;border-radius:50%;background:#ffffffa8;color:var(--ink);padding:0;transition:background .2s,border-color .2s}
.theme-toggle .icon{width:16px;height:16px}
.theme-toggle:hover{background:#e8eefb;border-color:#bbcbed}
:root[data-theme="dark"]{color-scheme:dark;--ink:#e8eefb;--paper:#0b1220;--muted:#9baac2;--line:#28364c;--white:#121e31;--success:#79cdb3;--danger:#ff9b9f;--surface:#121e31;--surface-raised:#18263c;--surface-soft:#1b2c45;--accent:#95b2ff}
:root[data-theme="dark"] .logo-light{display:none}
:root[data-theme="dark"] .logo-dark{display:block}
:root[data-theme="dark"] body{background:var(--paper);color:var(--ink)}
:root[data-theme="dark"] :is(.panel,.flow-panel,.product-card,.catalog-card,.position-card,.metric-card,dialog){background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] :is(.nav-pill,.dropdown,.mobile-nav){background:#142238ee;border-color:var(--line);box-shadow:0 10px 30px #02081430}
:root[data-theme="dark"] :is(.nav-pill a:hover,.nav-trigger:hover,.nav-pill .active,.dropdown a:hover,.mobile-nav a,.docs-sidebar>a:hover){background:#203451;color:var(--ink)}
:root[data-theme="dark"] .theme-toggle{color:#c6d7fa;background:#1a2b46;border-color:#344664}
:root[data-theme="dark"] .theme-toggle:hover{background:#243958;border-color:#55719b}
:root[data-theme="dark"] .header-ca{border-color:#344664;color:#acbdd8}
:root[data-theme="dark"] .btn-dark{background:#203553;color:#f4f7ff;border-color:#344969}
:root[data-theme="dark"] .btn-dark:hover{background:#2b4467}
:root[data-theme="dark"] :is(.btn-secondary,.btn-outline){background:#18283f;border-color:#3c506f;color:#e0eafd}
:root[data-theme="dark"] :is(.btn-secondary:hover,.btn-outline:hover){background:#223858;border-color:#5f7ca8}
:root[data-theme="dark"] .hero h1 em{color:var(--accent)}
:root[data-theme="dark"] .hero-art:before{background:radial-gradient(ellipse,#244fe81d,transparent 68%)}
:root[data-theme="dark"] .scene-label{color:#869dc4}
:root[data-theme="dark"] .scene-label:before{background:#344b73}
:root[data-theme="dark"] .floating-card{background:#18273ee8;border-color:#4a5c7d;box-shadow:0 18px 38px #02071250;color:#eff4ff}
:root[data-theme="dark"] .floating-card .card-bottom{border-color:#34435d;color:#c0cde2}
:root[data-theme="dark"] .avatar-stack span{background:#2b4166;border-color:#19273f;color:#bdcfff}
:root[data-theme="dark"] .hero-foot{color:#93a4bf}
:root[data-theme="dark"] .ecosystem-strip{background:#111e3060}
:root[data-theme="dark"] .service-strip a:hover{color:var(--accent)}
:root[data-theme="dark"] :is(.text-link,.flow-controls .text-link,.product-bottom,.step a,.doc-section a,.max-button){color:var(--accent);border-color:#48628b}
:root[data-theme="dark"] .doc-section .btn-primary{color:#fff}
:root[data-theme="dark"] .product-card:hover{background:#182840;border-color:#526d98;box-shadow:0 10px 30px #01071126}
:root[data-theme="dark"] .product-icon{background:#22395e;color:#a9c1ff}
:root[data-theme="dark"] .principle .icon{color:var(--accent)}
:root[data-theme="dark"] .capital-visual{background:radial-gradient(ellipse at 48% 40%,#28436f,#182b4e 43%,#101e38 82%)}
:root[data-theme="dark"] .capital-card{color:#152445}
:root[data-theme="dark"] .capital-allocated{color:#fff}
:root[data-theme="dark"] .range-label strong{color:var(--accent)}
:root[data-theme="dark"] .flow-visual:not(.capital-visual){background:linear-gradient(135deg,#172a46,#122036)}
:root[data-theme="dark"] .cta-band{background:#142442;border:1px solid #2c4165;color:#f1f5ff}
:root[data-theme="dark"] .cta-band .btn{background:#e6efff;color:#152445;border-color:#e6efff}
:root[data-theme="dark"] .cta-band .btn:hover{background:#fff}
:root[data-theme="dark"] .section-alt{background:#101d2c18}
:root[data-theme="dark"] :is(.field-input,.field-select,.input-box){color:var(--ink);background:#0e1a2d;border-color:#2b3d59}
:root[data-theme="dark"] :is(input::placeholder,textarea::placeholder){color:#7185a5}
:root[data-theme="dark"] :is(.input-line select,.scenario-controls select){background:#1b2c45;color:var(--ink);border-color:#354a6a}
:root[data-theme="dark"] .input-line input{color:#edf3ff}
:root[data-theme="dark"] .scenario-bar{background:#111e31b5;border-color:var(--line)}
:root[data-theme="dark"] .app-nav a:hover{background:#1c2d47}
:root[data-theme="dark"] :is(.app-nav a.active,.filters button.active){background:#244fe8;border-color:#244fe8;color:#fff}
:root[data-theme="dark"] .badge{background:#20375e;border-color:#344e7b;color:#b0c8ff}
:root[data-theme="dark"] .segmented{background:#0c182a}
:root[data-theme="dark"] .segmented button{color:#a7b7d0}
:root[data-theme="dark"] .segmented button.selected{color:#a9c3ff;background:#243a5d;box-shadow:none}
:root[data-theme="dark"] .segmented .short.selected{color:var(--danger);background:#462b3b}
:root[data-theme="dark"] .leverage-buttons button.selected{background:#243a63;border-color:#587cba;color:#bad0ff}
:root[data-theme="dark"] .swap-switch{background:#243a63;color:#bfd1ff;border-color:var(--surface)}
:root[data-theme="dark"] :is(.panel-head,.chart-footer,.table td,.info-list-item,.history-item){border-color:#27364e}
:root[data-theme="dark"] .table th{background:#0f1b2d;color:#a3b2cc}
:root[data-theme="dark"] .chart-svg path[stroke="#e9edf3"]{stroke:#283b58}
:root[data-theme="dark"] .coin{background:#243b62;color:#b4caff}
:root[data-theme="dark"] .coin.btc{background:#3b3024;color:#edc47e}
:root[data-theme="dark"] .coin.usd{background:#1a3b36;color:#8dd3b8}
:root[data-theme="dark"] .coin.atlas{background:#342b50;color:#c4b0f2}
:root[data-theme="dark"] .metric-card:first-child{background:#1a3155;color:#f5f8ff;border-color:#36527d}
:root[data-theme="dark"] .catalog-card.selected{border-color:#6d93d9;box-shadow:0 0 0 1px #6d93d9}
:root[data-theme="dark"] .allocation-bar{background:#263650}
:root[data-theme="dark"] .empty-icon{color:#a6bddd;border-color:#344965}
:root[data-theme="dark"] :is(.disclosure,.status-note){background:#142641;border-color:#304a70;color:#aabbd6}
:root[data-theme="dark"] :is(.status-note.warning,.storage-warning){background:#30291f;border-color:#594b33;color:#e1c798}
:root[data-theme="dark"] .error-message{background:#3a2432;border-color:#654054;color:#ffb5b8}
:root[data-theme="dark"] dialog{color:var(--ink);box-shadow:0 35px 100px #0008}
:root[data-theme="dark"] dialog::backdrop{background:#020812a8}
:root[data-theme="dark"] :is(.modal-icon,.modal-close){color:#b4ccff;background:#243b60}
:root[data-theme="dark"] :is(.intro-progress,.hero-model-controls button){background:#21334f;border-color:#3a4f71;color:#adbfdd}
:root[data-theme="dark"] #toast{background:#223958;border:1px solid #3e577c;color:#f0f5ff}
:root[data-theme="dark"] .skip-link{background:#1c3151;color:#edf3ff}
:root[data-theme="dark"] .flow-stages{color:#9eafcb}
:root[data-theme="dark"] .particle-controls button{background:#1b2e4b;color:#a9c0e9;border-color:#3b557c}
:root[data-theme="dark"] .particle-controls button:hover:not(:disabled){background:#294367;color:#d8e5ff}
:root[data-theme="dark"] .hero .hero-art.particle-scene:before{background:radial-gradient(ellipse,#244fe819,transparent 65%)}
:root[data-theme="dark"] .hero-fallback[src*="particle"]{filter:brightness(1.4)}
@media(max-width:600px){.theme-toggle{width:32px;height:32px;flex-basis:32px}.theme-toggle .icon{width:15px;height:15px}.header-actions [data-wallet]{width:35px;height:35px;min-height:35px;padding:0;border-radius:50%;gap:0}.wallet-label{display:none}.header-actions [data-wallet] .icon{height:16px;width:16px}}
:root[data-theme="dark"] #header{background:rgba(11,18,32,.95);border-bottom-color:#2c3d55b3;box-shadow:0 4px 24px #00000018}
