/* agilitycms.com look for the Finance Dashboard (agility-dashboard-restyle, 2026-11-11).
   Loaded AFTER styles.css and only remaps it: no rule in styles.css is edited, so the two can change independently.
   Every --ag-* value is copied verbatim from the live agilitycms.com stylesheet (:root = light, .dark = dark),
   kept in Projects/agility-dashboard-restyle/work/source/agilitycms-tokens.css with the read time and file hash.
   Only the --*-bg status tints are derived (colour-mix of the site's status colour into its card colour): the site has none.
   Theme: html.dark (the default, as on agilitycms.com) or light; theme.js sets it before first paint and runs the toggle.
   Selectors are :root:not(.dark) / :root.dark (specificity 0,2,0) so they outrank styles.css's own :root and
   prefers-color-scheme rules whatever the device setting is. */

@font-face { font-family:Mulish; font-style:normal; font-weight:200 1000; font-display:swap; src:url(fonts/Mulish-200_1000-latin.woff2) format("woff2"); }
@font-face { font-family:"Fira Mono"; font-style:normal; font-weight:400; font-display:swap; src:url(fonts/FiraMono-400-latin.woff2) format("woff2"); }
@font-face { font-family:"Fira Mono"; font-style:normal; font-weight:500; font-display:swap; src:url(fonts/FiraMono-500-latin.woff2) format("woff2"); }
@font-face { font-family:"Fira Mono"; font-style:normal; font-weight:700; font-display:swap; src:url(fonts/FiraMono-700-latin.woff2) format("woff2"); }

:root:not(.dark) { color-scheme:light;
  --ag-background:#f1efe9; --ag-foreground:#181716; --ag-card:#fbf9f3; --ag-raised:#fefdf9; --ag-muted:#e3e0d8; --ag-muted-foreground:#5e5951;
  --ag-border:#e4e0d8; --ag-border-strong:#cfc9bc; --ag-input:#cfc9bc; --ag-text-2:#3b3935; --ag-faint:#6e685e;
  --ag-cta:#ffcb28; --ag-cta-bright:#ffd75b; --ag-cta-dim:#deae16; --ag-on-color:#0e0d0c;
  --ag-ocean:#027970; --ag-ocean-text:#027970; --ag-ocean-bright:#028d83; --ag-blue:#295bac; --ag-sunglo:#c0403c;
  --ag-ok:#1a6e36; --ag-warn:#836400; --ag-err:#c81e1e; --ag-info:#2f62c9; --ag-ring:#027970;
  /* AR-age ordinal ramp: unchanged from styles.css (validated 2026-09-27) */
  --b0:#86b6ef; --b1:#5598e7; --b2:#2a78d6; --b3:#1c5cab; --b4:#104281;
  --s1:var(--ag-blue); --s2:var(--ag-ocean-bright);   /* dataviz validator 2026-11-11: #027970 failed chroma (0.091) and normal-vision dE 14.9 vs blue; #028d83 passes all (dE 17.7) */
  --scrim:rgba(14,13,12,.45); --sheet-shadow:-12px 0 32px rgba(14,13,12,.16);
}
:root.dark { color-scheme:dark;
  --ag-background:#0e0d0c; --ag-foreground:#f1efe9; --ag-card:#171615; --ag-raised:#201f1d; --ag-muted:#201f1d; --ag-muted-foreground:#aaa49b;
  --ag-border:#302e2b; --ag-border-strong:#45423e; --ag-input:#45423e; --ag-text-2:#c4bfb5; --ag-faint:#989289;
  --ag-cta:#ffcb28; --ag-cta-bright:#ffd75b; --ag-cta-dim:#deae16; --ag-on-color:#0e0d0c;
  --ag-ocean:#028d83; --ag-ocean-text:#02a196; --ag-blue:#295bac; --ag-blue-bright:#5989d8; --ag-sunglo:#e06565;
  --ag-ok:#79c06b; --ag-warn:#f2c23e; --ag-err:#fa5252; --ag-info:#79bbf0; --ag-ring:#028d83;
  --b0:#184f95; --b1:#256abf; --b2:#3987e5; --b3:#6da7ec; --b4:#9ec5f4;
  --s1:var(--ag-blue-bright); --s2:var(--ag-ocean);   /* site --brand-blue-bright: #295bac is 2.6:1 on the dark card */
  --scrim:rgba(0,0,0,.6); --sheet-shadow:-12px 0 32px rgba(0,0,0,.5);
}
/* dashboard tokens -> site tokens (both themes) */
:root:not(.dark), :root.dark {
  --bg:var(--ag-background); --card:var(--ag-card); --ink:var(--ag-foreground); --muted:var(--ag-muted-foreground); --line:var(--ag-border);
  --green:var(--ag-ok); --amber:var(--ag-warn); --red:var(--ag-err); --grey:var(--ag-muted-foreground); --grey-bg:var(--ag-muted);
  --green-bg:color-mix(in srgb, var(--ag-ok) 10%, var(--ag-card)); --amber-bg:color-mix(in srgb, var(--ag-warn) 10%, var(--ag-card)); --red-bg:color-mix(in srgb, var(--ag-err) 10%, var(--ag-card));   /* 10%: chip text >= 4.6:1 in both themes (15% gave 4.26 light) */
  --accent:var(--ag-ocean-text);
  --r:.145rem; --r-card:calc(var(--r) * 1.8); --r-sm:calc(var(--r) * .8);
}

/* type: the site's fonts (Mulish body + headings, Fira Mono for code / ids) */
body { font-family:Mulish, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
code, pre, .ex-id, .tl-row .tl-t, .rc-key { font-family:"Fira Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { font-size:.92em; }
h1 { font-weight:700; letter-spacing:-.025em; }
.sheet-head h3, .viz-head, .an-head, .ex-area h3 { letter-spacing:-.01em; }

/* corners: the site's radius scale (rounded-lg = .145rem; cards use 1.8x) */
.tile, .card, .viz-card, .sheet, .me-tablewrap, .ex-stat, .ex-row, .rc-row { border-radius:var(--r-card); }
.me-kpi, .banner, .ranges, .me-views, .rc-secs, .cmt-in { border-radius:var(--r); }
button, .me-pick select, .ex-tools input, .ex-tools select, .rc-edit select, .rc-edit input { border-radius:var(--r); }
.range, .ex-head:focus-visible { border-radius:var(--r-sm); }
.legend .sw { border-radius:1px; }

/* controls: site buttons (outline = input border on the page colour; primary = the yellow CTA with near-black text) */
button { border-color:var(--ag-input); background:var(--card); color:var(--ink); font-weight:500; }
button:hover:not([disabled]) { border-color:var(--ag-border-strong); background:var(--ag-raised); }
.tab, .tab:hover:not([disabled]), .range, .range:hover:not([disabled]), .me-link, .me-tog, .cmt-x, .cmt-reply, .more.inline, .ex-head { background:transparent; }
.tab, .range { border-color:transparent; }
.tab:hover:not([disabled]) { color:var(--ink); border-color:transparent transparent var(--line); }
.tab.on, .tab.on:hover { border-bottom-color:var(--ag-cta); color:var(--ink); }
button.primary, .range.on, .cmt-go, .tab .count:not(:empty) { background:var(--ag-cta); color:var(--ag-on-color); border-color:var(--ag-cta); }
button.primary:hover:not([disabled]), .cmt-go:hover:not([disabled]) { background:var(--ag-cta-bright); border-color:var(--ag-cta-bright); }
.cmt-av { background:var(--ag-ocean); color:#fff; } :root.dark .cmt-av { color:var(--ag-on-color); }   /* the site pairs dark ocean with #0e0d0c (4.75:1); white was 4.09 */
:focus-visible { outline-color:var(--ag-ring); }
input, select, textarea { accent-color:var(--ag-ocean); }
.ex-tools input, .ex-tools select, .me-pick select, .rc-edit select, .rc-edit input, .cmt-in { border-color:var(--ag-input); }
a { color:var(--ag-ocean-text); }
.item-title a, .me-links a { color:inherit; }

/* surfaces */
.banner { border-color:color-mix(in srgb, var(--ag-warn) 35%, var(--card)); }
.modal { background:var(--scrim); }
#cmt-sheet { box-shadow:var(--sheet-shadow); background:var(--ag-raised); }
.sheet { background:var(--ag-raised); }

/* header theme toggle */
.hdr-r { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.theme-toggle { width:32px; height:32px; padding:0; display:inline-grid; place-items:center; color:var(--muted); }
.theme-toggle:hover:not([disabled]) { color:var(--ink); }
.theme-toggle svg { display:block; }
:root.dark .theme-toggle .i-moon, :root:not(.dark) .theme-toggle .i-sun { display:none; }

/* phone: the five tabs are wider than a phone screen and pushed the whole page sideways (448px on a 390px phone,
   seen in the before screenshots 2026-11-11) - the tab bar now scrolls on its own instead */
@media (max-width:640px) {
  .tabs { overflow-x:auto; overflow-y:hidden; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  .tabs::-webkit-scrollbar { display:none; }
  .tab { flex:none; white-space:nowrap; padding:8px 10px; margin-bottom:0; }
  .hdr-r { gap:6px; }
}

/* disabled controls keep looking disabled (the button colours above override the browser's own grey-out) */
button:disabled, button[disabled] { opacity:.5; cursor:default; }
