/* ============================================================================
   themes.css — the dark theme: Ant Design's dark algorithm.
   ============================================================================
   Light is the :root baseline in style.css. Dark overrides it here: Ant's dark
   palettes (presetDarkPalettes) and the map tokens its dark algorithm derives
   from the same seed. The theme lands on <html data-theme> before first paint
   (shell/theme-init.js).

   The neutrals are Ant's dark greys warmed to the shared paper ramp (see the
   website's css/warm-ramp.css): each keeps Ant's OKLCH lightness and takes
   the ramp's chroma and hue (~80°) at that lightness. White inks and fills
   are the paper, #fcf8f0, at Ant's alphas. The layout is lifted off pure
   black to #080706 so it can carry the warmth. */


/* ─── Dark ─────────────────────────────────────────────────────────────────── */
html[data-theme="dark"],
.settings-theme-swatch[data-theme="dark"] {
    color-scheme: dark;

    /* Ant's dark palettes. */
    --blue-1: #111a2c;   --blue-2: #112545;   --blue-3: #15325b;   --blue-4: #15417e;   --blue-5: #1554ad;
    --blue-6: #1668dc;   --blue-7: #3c89e8;   --blue-8: #65a9f3;   --blue-9: #8dc5f8;   --blue-10: #b7dcfa;

    --cyan-1: #112123;   --cyan-2: #113536;   --cyan-3: #144848;   --cyan-4: #146262;   --cyan-5: #138585;
    --cyan-6: #13a8a8;   --cyan-7: #33bcb7;   --cyan-8: #58d1c9;   --cyan-9: #84e2d8;   --cyan-10: #b2f1e8;

    --green-1: #162312;  --green-2: #1d3712;  --green-3: #274916;  --green-4: #306317;  --green-5: #3c8618;
    --green-6: #49aa19;  --green-7: #6abe39;  --green-8: #8fd460;  --green-9: #b2e58b;  --green-10: #d5f2bb;

    --gold-1: #2b2111;   --gold-2: #443111;   --gold-3: #594214;   --gold-4: #7c5914;   --gold-5: #aa7714;
    --gold-6: #d89614;   --gold-7: #e8b339;   --gold-8: #f3cc62;   --gold-9: #f8df8b;   --gold-10: #faedb5;

    --orange-1: #2b1d11; --orange-2: #442a11; --orange-3: #593815; --orange-4: #7c4a15; --orange-5: #aa6215;
    --orange-6: #d87a16; --orange-7: #e89a3c; --orange-8: #f3b765; --orange-9: #f8cf8d; --orange-10: #fae4b6;

    --red-1: #2a1215;    --red-2: #431418;    --red-3: #58181c;    --red-4: #791a1f;    --red-5: #a61d24;
    --red-6: #d32029;    --red-7: #e84749;    --red-8: #f37370;    --red-9: #f89f9a;    --red-10: #fac8c3;

    --purple-1: #1a1325; --purple-2: #24163a; --purple-3: #301c4d; --purple-4: #3e2069; --purple-5: #51258f;
    --purple-6: #642ab5; --purple-7: #854eca; --purple-8: #ab7ae0; --purple-9: #cda8f0; --purple-10: #ebd7fa;

    --magenta-1: #291321; --magenta-2: #40162f; --magenta-3: #551c3b; --magenta-4: #75204f; --magenta-5: #a02669;
    --magenta-6: #cb2b83; --magenta-7: #e0529c; --magenta-8: #f37fb7; --magenta-9: #f8a8cc; --magenta-10: #fad2e3;

    /* Text and icons. Tertiary is 0.5 (Ant: 0.45) for 4.5:1 on the cards. */
    --color-text:            rgba(252, 248, 240, 0.85);
    --color-text-secondary:  rgba(252, 248, 240, 0.65);
    --color-text-tertiary:   rgba(252, 248, 240, 0.5);
    --color-text-quaternary: rgba(252, 248, 240, 0.25);
    --color-text-disabled:   rgba(252, 248, 240, 0.25);
    --color-icon:            rgba(252, 248, 240, 0.45);
    --color-icon-hover:      rgba(252, 248, 240, 0.85);

    --color-bg-layout:             #080706;
    --color-bg-container:          #161411;
    --color-bg-elevated:           #211f1a;
    --color-bg-spotlight:          #46423a;
    --color-bg-mask:               rgba(0, 0, 0, 0.45);
    --color-bg-container-disabled: rgba(252, 248, 240, 0.08);
    --color-bg-text-hover:         rgba(252, 248, 240, 0.12);
    --color-bg-text-active:        rgba(252, 248, 240, 0.18);

    --color-border:           #46423a;
    --color-border-secondary: #33302a;
    --color-split:            rgba(252, 248, 240, 0.12);
    --color-fill:             rgba(252, 248, 240, 0.18);
    --color-fill-secondary:   rgba(252, 248, 240, 0.12);
    --color-fill-tertiary:    rgba(252, 248, 240, 0.08);
    --color-fill-quaternary:  rgba(252, 248, 240, 0.04);
    --color-fill-alter:       rgba(252, 248, 240, 0.04);

    /* The primary and status tokens re-resolve against the dark palettes
       above; only the steps that differ from light are restated. */
    --color-primary-hover:  var(--blue-7);
    --color-primary-active: var(--blue-5);
    --color-primary-text:   var(--blue-7);
    --color-link-hover:     var(--blue-7);
    --color-success-text:   var(--green-7);
    --color-warning-text:   var(--gold-6);
    --color-error:          #dc4446;
    --color-error-hover:    #e86e6b;
    --color-error-active:   #ad393a;
    --color-error-bg:       #2c1618;
    --color-error-border:   #5b2526;
    --color-error-text:     var(--red-7);
    --color-info-text:      var(--blue-7);

    --control-item-bg-hover:  rgba(252, 248, 240, 0.08);
    --control-outline:        rgba(0, 60, 180, 0.15);
    --color-error-outline:    rgba(238, 38, 56, 0.11);
    --color-warning-outline:  rgba(173, 107, 0, 0.15);
    --button-primary-shadow:  0 2px 0 rgba(0, 60, 180, 0.15);
    --button-danger-shadow:   0 2px 0 rgba(238, 38, 56, 0.11);

    --canvas-dot: rgba(252, 248, 240, 0.12);

    /* Roles re-picked from Ant's dark palettes against the dark card (style.css
       §3): cyan-7, blue-6, gold-6, red-6, purple-8. (Since moved: Income to green-7, 7.9:1, and Modifiers
       to cyan-7. Green-7 against gold-6 is only ΔE 2.7 under simulated
       protan/deutan vision.) The original five clear CVD 9.6 and
       normal 19.0, and every one 3.5:1. Cyan and gold sit at OKLCH L 0.72, past
       the chart band's 0.67, as the earlier dark roles did (gold at 0.75): a role
       marks an avatar or a port, not a wide area, so there is no glare to fear. */
    --role-source:   var(--green-7);
    --role-account:  var(--blue-6);
    --role-expense:  var(--gold-6);
    --role-debt:     var(--red-6);
    --role-modifier: var(--cyan-7);
    --role-group:    #aca698;
    --role-none:     #7f7a6e;

    --medal-silver: #c5bfb1;
    --medal-bronze: var(--orange-6);

    --link-line: var(--blue-7);
    --link-twoway: var(--purple-7);

    /* Net worth bands: the roles a step brighter, so the stacked bands hold up
       on the dark surface (the modules keep their own colours). */
    --chart-account-1: var(--blue-7);
    --chart-account-2: color-mix(in srgb, var(--blue-7) 75%, white);
    --chart-account-3: color-mix(in srgb, var(--blue-7) 80%, black);
    --chart-account-4: color-mix(in srgb, var(--blue-7) 55%, white);
    --chart-account-5: color-mix(in srgb, var(--blue-7) 62%, black);
    --chart-account-6: color-mix(in srgb, var(--blue-7) 38%, white);

    --chart-debt-1: var(--red-7);
    --chart-debt-2: color-mix(in srgb, var(--red-7) 75%, white);
    --chart-debt-3: color-mix(in srgb, var(--red-7) 80%, black);
    --chart-debt-4: color-mix(in srgb, var(--red-7) 55%, white);
    --chart-debt-5: color-mix(in srgb, var(--red-7) 62%, black);
    --chart-debt-6: color-mix(in srgb, var(--red-7) 38%, white);

    --chart-asset-1: var(--green-7);
    --chart-asset-2: color-mix(in srgb, var(--green-7) 75%, white);
    --chart-asset-3: color-mix(in srgb, var(--green-7) 80%, black);
    --chart-asset-4: color-mix(in srgb, var(--green-7) 55%, white);
    --chart-asset-5: color-mix(in srgb, var(--green-7) 62%, black);
    --chart-asset-6: color-mix(in srgb, var(--green-7) 38%, white);

    --chart-in:       var(--green-6);
    --chart-out:      var(--gold-6);
    --chart-growth:   var(--blue-7);
    --chart-interest: var(--red-7);
    --chart-plan-a:   var(--blue-7);
    --chart-plan-b:   var(--orange-6);
    --chart-plan-c:   var(--cyan-7);
    --chart-plan-d:   var(--purple-7);

    /* The Sankey: Ant's dark green and gold ramps, deepest first. */
    --chart-inflow-1: var(--green-5);
    --chart-inflow-2: var(--green-6);
    --chart-inflow-3: var(--green-7);
    --chart-inflow-4: var(--green-8);
    --chart-inflow-5: var(--green-9);
    --chart-inflow-6: var(--green-10);
    --chart-outflow-1: var(--gold-5);
    --chart-outflow-2: var(--gold-6);
    --chart-outflow-3: var(--gold-7);
    --chart-outflow-4: var(--gold-8);
    --chart-outflow-5: var(--gold-9);
    --chart-hub:       var(--purple-7);
}
