/* Shared controls, placed before FR / EN. The V1 archive keeps its original theme. */
html[data-theme=light]{color-scheme:light}
html[data-theme=dark]{color-scheme:dark}
.site-preferences{display:flex;align-items:center;gap:10px;flex-shrink:0}
.theme-toggle{width:40px;height:40px;min-width:40px;padding:10px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:#516784;cursor:pointer}
.theme-toggle svg{width:20px;height:20px;display:block;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle:hover{background:#dce7f3;color:#14234b}
.theme-toggle:focus-visible{outline:2px solid #3c74ad;outline-offset:3px}
.theme-toggle .theme-sun{display:none}
html[data-theme=dark] .theme-toggle .theme-sun{display:block}
html[data-theme=dark] .theme-toggle .theme-moon{display:none}
html[data-theme=dark] .theme-toggle{color:#b3cce4}
html[data-theme=dark] .theme-toggle:hover{background:#29425e;color:#edf3fa}
html[data-theme=dark] nav.lang a{color:#b3cce4}
html[data-theme=dark] nav.lang a[aria-current=page],html[data-theme=dark] nav.lang a:hover{color:#edf3fa}
html[data-theme=dark] :is(button,a,summary,input):focus-visible{outline-color:#91b8df}
@media(max-width:620px){.site-preferences{gap:4px}}

/* Satellite pages: retain the existing layout and semantic state colors. */
html[data-theme=dark][data-surface=satellite]{
  --bg:#101a30;--fg:#edf3fa;--fg-2:#c3d4e6;--fg-3:#aec4dd;
  --fg-hover:#b3cce4;--rule:#354d69;--field-border:#6c86a5;
  --accent:#91b8df;--accent-2:#91b8df;
  --pos:#8ec8ad;--pos-text:#8ec8ad;--neg:#ffb9a9;--neg-text:#ffb9a9;
}
html[data-theme=dark][data-surface=satellite] .logo-mark img{filter:brightness(1.5)}

/* V2 surfaces and text. Navy is retained as a brand primitive, not inverted. */
html[data-theme=dark][data-surface=landing]{
  --white:#101a30;--brume:#15243b;--ink:#edf3fa;--muted:#b3c7df;
  --blue:#91b8df;--line:#354d69;--soft-blue:#29435f;--mid-blue:#274562;
  --dark-surface:#1c304b;--dark-field:#172940;--dark-border:#607993;
}
html[data-theme=dark][data-surface=landing] .button{background:#b3cce4;color:#14234b}
html[data-theme=dark][data-surface=landing] .button:hover{background:#d3e3f2}
html[data-theme=dark][data-surface=landing] .button-light{background:#edf3fa;color:#14234b}
html[data-theme=dark][data-surface=landing] .button-light:hover{background:#d3e3f2}
html[data-theme=dark][data-surface=landing] .mobile-menu{background:#1c304b;box-shadow:0 10px 24px #00000033}
html[data-theme=dark][data-surface=landing] .menu-toggle span{background:#edf3fa}
html[data-theme=dark][data-surface=landing] .skip{background:#b3cce4;color:#14234b}
html[data-theme=dark][data-surface=landing] :is(.leaf-subscriptions,.leaf-budget){--navy:#edf3fa;color:#edf3fa}
html[data-theme=dark][data-surface=landing] .leaf-budget{background:#203951}
html[data-theme=dark][data-surface=landing] .leaf-projects{background:#2d5a84}
html[data-theme=dark][data-surface=landing] :is(.leaf-subscriptions,.leaf-budget) .leaf-description{color:#d3e3f2}
html[data-theme=dark][data-surface=landing] :is(.subscription-table-head,.mini-sub small,.rest-sub small,.budget-periods button,.budget-comparison caption span,.budget-comparison thead th){color:#c3d7eb}
html[data-theme=dark][data-surface=landing] .budget-periods button[aria-pressed=true]{color:#edf3fa;border-color:#edf3fa}
html[data-theme=dark][data-surface=landing] :is(.mini-sub,.budget-periods,.budget-comparison th,.budget-comparison td){border-color:#567592}
html[data-theme=dark][data-surface=landing] .service-icon{background:#355877}
html[data-theme=dark][data-surface=landing] .rest-sub span{background:#355877}
html[data-theme=dark][data-surface=landing] .rest-sub span:nth-child(2){background:#3d6384}
html[data-theme=dark][data-surface=landing] .rest-sub span:nth-child(3){background:#456c8d}
html[data-theme=dark][data-surface=landing] :is(.saving-preview-track,.provision-track){background:#1a3c5d}
html[data-theme=dark][data-surface=landing] .breathing-section{background:#20364e}
html[data-theme=dark][data-surface=landing] :is(.breathing-statement h2 span,.principle-icon){color:#91b8df}
html[data-theme=dark][data-surface=landing] .principles p{color:#c3d4e6}
html[data-theme=dark][data-surface=landing] .founder-avatar{background:#29435f}

/* The transaction demo uses real fields and separate search, error and saved states. */
html[data-theme=dark][data-surface=landing] :is(.copy-workspace,.transaction-entry){background:var(--dark-surface);box-shadow:0 10px 30px #00000026}
html[data-theme=dark][data-surface=landing] .copy-context{background:#29435f;color:#d3e3f2}
html[data-theme=dark][data-surface=landing] .transaction-type{background:#4a3535;color:#ffbfaa}
html[data-theme=dark][data-surface=landing] .copy-search-panel{background:#243b58;box-shadow:0 12px 35px #00000055}
html[data-theme=dark][data-surface=landing] :is(.copy-searchbox input,.copy-field input){border-color:var(--dark-border);background:var(--dark-field);color:#edf3fa}
html[data-theme=dark][data-surface=landing] .copy-field output{color:#b3c7df}
html[data-theme=dark][data-surface=landing] .copy-searchbox input::placeholder{color:#b3c7df;opacity:1}
html[data-theme=dark][data-surface=landing] :is(.copy-field>label,.field-label,.copy-searchbox>.icon){color:#c3d4e6}
html[data-theme=dark][data-surface=landing] :is(.has-copy .copy-field output,.account-field output){color:#edf3fa}
html[data-theme=dark][data-surface=landing] :is(.account-field output span,.saved-labels span){background:#29435f;color:#d3e3f2}
html[data-theme=dark][data-surface=landing] :is(.copy-trigger,.copy-date-row button){background:#29435f;border-color:var(--dark-border);color:#edf3fa}
html[data-theme=dark][data-surface=landing] :is(.copy-context>button,.faq-demo-link){color:#d3e3f2}
html[data-theme=dark][data-surface=landing] .copy-result{background:#243b58;color:#edf3fa}
html[data-theme=dark][data-surface=landing] :is(.copy-result:hover,.copy-result:focus-visible){background:#355574}
html[data-theme=dark][data-surface=landing] :is(.result-amount,.saved-transaction>strong,.copy-error){color:#ffb9a9}
html[data-theme=dark][data-surface=landing] .copy-field input[aria-invalid=true]{border-color:#ffb9a9}
html[data-theme=dark][data-surface=landing] .copy-success-title>.icon{color:#8ec8ad}
html[data-theme=dark][data-surface=landing] .copy-steps .step-number{border-color:#607993;color:#b3c7df}
html[data-theme=dark][data-surface=landing] :is(.copy-steps li[aria-current=step],.copy-steps li[data-done]) .step-number{background:#b3cce4;border-color:#b3cce4;color:#14234b}
html[data-theme=dark][data-surface=landing] .food-meter{background:#354d69}
html[data-theme=dark][data-surface=landing] .updated-heading{border-color:#354d69}

html[data-theme=dark][data-surface=landing] .copy-field input::placeholder{color:#b3c7df;opacity:1}
@media(max-width:370px){html[data-surface=landing] .nav{gap:8px}html[data-surface=landing] .nav .brand span{font-size:22px}}
