/* GrowViking's look (Ali, 2026-10-16: "Make everything, including GUI, Madgicx style. Same GUI style everywhere").
   A light grey canvas, flat white cards with thin borders and small corners, small page titles, one purple accent
   for buttons and the open page, green, amber and red only where a number is good, near or bad, and even-width
   digits everywhere. The dark theme is the same layout on navy. The menu is in shell.css; this file is loaded last
   (base.html, after every page's own styles) so every page follows it without per-page work.

   Selectors start with :root[data-theme] so they win over the older per-theme rules in style.css; colours are tokens,
   so a page that uses the shared classes (card, kpis/kpi, btn, chip, badge, table.data/audit, tabs, forms, charts)
   looks right in both themes. The front page keeps its own front.css (landing.html leaves this file out). */

/* ---------- Tokens ---------- */
:root[data-theme] {
  --font-display: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px; --radius-sm: 8px;
  --side: #10132b; --side-2: #1a1e3d; --side-fg: #c9cce6; --side-mute: #8a8fb3;
  --t-blue: radial-gradient(120% 120% at 100% 0%, #6d7cff, #3446f2 50%, #1e2bb8);
  --t-violet: radial-gradient(120% 120% at 0% 0%, #b794ff, #8b5cf6 45%, #4c1d95);
  --t-cyan: radial-gradient(120% 120% at 100% 100%, #a5f3fc, #22d3ee 40%, #0e7490);
  --t-sun: radial-gradient(120% 120% at 0% 100%, #ffd28a, #ff8a4c 45%, #e8395f);
  --t-ink: radial-gradient(120% 120% at 100% 0%, #2a2a3a, #0a0a0f 60%);
}
:root[data-theme="light"] {
  --bg: #f2f4f9; --surface: #ffffff; --surface-solid: #ffffff; --surface-2: #f6f7fb; --field: #ffffff;
  --line: #e2e6ef; --line-strong: #d0d5e2; --highlight: transparent;
  --text: #1b1e33; --text-2: #50556e; --text-3: #6b7088;
  --value: linear-gradient(#1b1e33, #1b1e33);
  --accent: #5a48f5; --accent-solid: #5a48f5; --accent-strong: #4532dc; --accent-soft: #ece9ff; --on-accent: #ffffff;
  --good: #0c8a52; --good-soft: #e3f6ec; --warn: #9a5f00; --warn-soft: #fff4dc; --bad: #d23a30; --bad-soft: #fde8e6;
  --info: #2f63c8; --info-soft: #e8effc;
  --aurora: linear-gradient(120deg, #5a48f5, #7c6cff);
  --aurora-soft: linear-gradient(120deg, rgba(90, 72, 245, .1), rgba(124, 108, 255, .06));
  --chart-a: #5a48f5; --chart-b: #c9cde0; --chart-c: #0e9f8e; --chart-cmp: #9aa0bd; --chart-grid: #eceff5;
  --chart-bar: #6a5af7; --chart-good: #11a566; --chart-warn: #e3a008; --chart-bad: #e0453a; --fb-value: var(--chart-bar);
  --shadow: 0 1px 2px rgba(16, 19, 43, .04); --shadow-lg: 0 16px 40px -16px rgba(16, 19, 43, .28);
  --glow: 0 0 0 3px rgba(90, 72, 245, .18);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0f1e; --surface: #161a2e; --surface-solid: #161a2e; --surface-2: #1c2037; --field: #12152a;
  --line: #262b45; --line-strong: #353b5c; --highlight: transparent;
  --text: #eceef8; --text-2: #b0b4cc; --text-3: #8d92ad;
  --value: linear-gradient(#eceef8, #eceef8);
  --accent: #9a8cff; --accent-solid: #6b5af7; --accent-strong: #b3a8ff; --accent-soft: rgba(154, 140, 255, .16); --on-accent: #ffffff;
  --good: #3fd39a; --good-soft: rgba(63, 211, 154, .13); --warn: #f1b44c; --warn-soft: rgba(241, 180, 76, .13);
  --bad: #ff7b7b; --bad-soft: rgba(255, 123, 123, .13); --info: #7fb2ff; --info-soft: rgba(127, 178, 255, .13);
  --aurora: linear-gradient(120deg, #6b5af7, #8f80ff);
  --aurora-soft: linear-gradient(120deg, rgba(107, 90, 247, .2), rgba(143, 128, 255, .1));
  --chart-a: #9a8cff; --chart-b: #3a405f; --chart-c: #3fd3c0; --chart-cmp: #7c82a3; --chart-grid: #232843;
  --chart-bar: #7d6dff; --chart-good: #3fd39a; --chart-warn: #f1b44c; --chart-bad: #ff7b7b; --fb-value: var(--chart-bar);
  --side: #080a17; --side-2: #151935;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 44px -16px rgba(0, 0, 0, .7);
  --glow: 0 0 0 3px rgba(154, 140, 255, .25);
  color-scheme: dark;
}

/* ---------- Canvas and type ---------- */
:root[data-theme] body { background: var(--bg); color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
:root[data-theme] body::before, :root[data-theme] body::after { display: none; }
:root[data-theme] ::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:root[data-theme] h1 { font: 700 1.4rem/1.2 var(--font-body); letter-spacing: -.015em; }
:root[data-theme] h2 { font: 650 1.02rem/1.3 var(--font-body); letter-spacing: -.005em; }
:root[data-theme] h3 { font: 650 .92rem/1.35 var(--font-body); letter-spacing: 0; }
:root[data-theme] h1 em, :root[data-theme] .gradient-text { background: none; color: var(--text-3); -webkit-text-fill-color: currentColor; }
:root[data-theme] .eyebrow { font-size: .68rem; letter-spacing: .1em; color: var(--accent); }
:root[data-theme] .eyebrow::before { display: none; }
:root[data-theme] .num, :root[data-theme] .mono { font-family: var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: 0; }
:root[data-theme] .muted { color: var(--text-2); }
:root[data-theme] .faint { color: var(--text-3); }
:root[data-theme] .content > *, :root[data-theme] .public-main > *, :root[data-theme] .kpis > .kpi { animation: none; }

/* ---------- Page frame ---------- */
:root[data-theme] .app.docked .content { padding: 16px 24px 40px; gap: 14px; max-width: 1440px; }
:root[data-theme] .page-head { gap: 10px 16px; padding-top: 0; align-items: flex-end; }
:root[data-theme] .page-head h1, :root[data-theme] .content > .card > h1:first-child, :root[data-theme] .content > .card > .row:first-child h1,
:root[data-theme] .content > .card > .card-head:first-child h1 { font: 700 1.35rem/1.2 var(--font-body); letter-spacing: -.015em; }
:root[data-theme] .page-head .sub { margin-top: 4px; font-size: .88rem; color: var(--text-2); }
:root[data-theme] .demo-banner { margin: 0; padding: 6px 6px 6px 12px; border-radius: 8px; font-size: .82rem; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
:root[data-theme] .demo-pill { border-radius: 5px; background: var(--accent-solid); }
:root[data-theme] .trial-line, :root[data-theme] .freeze-banner { border-radius: 8px; }
:root[data-theme] p.ok, :root[data-theme] p.error { border-radius: 8px; padding: 10px 14px; font-size: .9rem; }
:root[data-theme] .content > p.ok, :root[data-theme] .content > p.error { animation: none; }

/* ---------- Cards ---------- */
:root[data-theme] .card, :root[data-theme] .feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
:root[data-theme] .card::before, :root[data-theme] .kpi::before, :root[data-theme] .feature::before { display: none; }
:root[data-theme] .card:hover { border-color: var(--line); }
:root[data-theme] a.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: none; }
:root[data-theme] .card.flush { padding: 0; }
:root[data-theme] .card h2, :root[data-theme] .card-head h2 { font: 650 1rem/1.3 var(--font-body); letter-spacing: -.005em; }
:root[data-theme] .card-head { margin-bottom: 12px; gap: 8px 12px; }
:root[data-theme] .card.flush .card-head { padding: 14px 18px 0; }
:root[data-theme] .card-head p { font-size: .82rem; color: var(--text-3); }
:root[data-theme] .grid-2, :root[data-theme] .grid-even { gap: 14px; }
:root[data-theme] .col { gap: 14px; }
:root[data-theme] .tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
:root[data-theme] .tile:hover { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: none; transform: none; }
:root[data-theme] .tile .ico, :root[data-theme] .feature .ico { background: var(--accent-soft) !important; color: var(--accent); border: 0; box-shadow: none; border-radius: 8px; }
:root[data-theme] .stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
:root[data-theme] .stats > div::after { display: none; }
:root[data-theme] .chart-box { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }

/* ---------- KPI boxes: compact, white, a small trend line ---------- */
:root[data-theme] .kpis { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
:root[data-theme] .kpi, :root[data-theme] .kpis > .kpi, :root[data-theme] .kpis.glance > .kpi:first-child, :root[data-theme] .kpis.glance > .kpi:nth-child(4) {
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px 10px; min-height: 0; gap: 3px; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; }
:root[data-theme] .kpi::after { display: none; }
:root[data-theme] .kpi:hover { transform: none; box-shadow: none; border-color: var(--line-strong); }
:root[data-theme] .kpi .label { font-size: .76rem; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
:root[data-theme] .kpi .value, :root[data-theme] .kpis.glance > .kpi:first-child .value, :root[data-theme] .kpis.compact .kpi .value {
  font: 700 1.3rem/1.2 var(--font-body); letter-spacing: -.01em; font-variant-numeric: tabular-nums; background: none; color: var(--text); -webkit-text-fill-color: currentColor; white-space: nowrap; }
:root[data-theme] .kpi .value.small { font-size: 1rem; }
:root[data-theme] .kpi .value small { font: 500 .74rem var(--font-body); color: var(--text-3); -webkit-text-fill-color: currentColor; }
:root[data-theme] .kpi .value.error { color: var(--bad); }
:root[data-theme] .kpi .delta, :root[data-theme] .kpi .delta.up, :root[data-theme] .kpi .delta.down, :root[data-theme] .kpi .delta.flat {
  align-self: flex-start; padding: 0; border-radius: 0; background: none; font-size: .74rem; font-weight: 650; box-shadow: none; }
:root[data-theme] .kpi .delta.up { color: var(--good); }
:root[data-theme] .kpi .delta.down { color: var(--bad); }
:root[data-theme] .kpi .delta.flat { color: var(--text-3); }
:root[data-theme] .kpi svg.spark { height: 26px; margin-top: 4px; }
:root[data-theme] .kpi svg.spark polyline { stroke: var(--chart-a); }
:root[data-theme] .kpi.hero { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: inset 3px 0 0 var(--accent-solid); }
:root[data-theme] .kpi.hero::after { display: none; }
/* Boxes whose number means something: a coloured edge, never a coloured box */
:root[data-theme] .kpis > .kpi.kpi-bad.kpi-bad { background: var(--surface); box-shadow: inset 3px 0 0 var(--bad); }
:root[data-theme] .kpis > .kpi.kpi-warn.kpi-warn { background: var(--surface); box-shadow: inset 3px 0 0 var(--warn); }
:root[data-theme] .kpis > .kpi.kpi-good.kpi-good { background: var(--surface); box-shadow: inset 3px 0 0 var(--good); }
:root[data-theme] .kpis > .kpi.kpi-bad .value { color: var(--bad); }

/* ---------- Hero banners become a calm page head ---------- */
:root[data-theme] .hero-banner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 16px 18px; color: var(--text); gap: 12px 18px; overflow: hidden; }
:root[data-theme] .hero-banner::before, :root[data-theme] .hero-banner::after { display: none; }
:root[data-theme] .hero-banner h1 { color: var(--text); font: 700 1.35rem/1.2 var(--font-body); letter-spacing: -.015em; margin-top: 4px; }
:root[data-theme] .hero-banner .gradient-text { color: var(--text-3); -webkit-text-fill-color: currentColor; }
:root[data-theme] .hero-banner .sub { color: var(--text-2); font-size: .9rem; margin-top: 4px; }
:root[data-theme] .hero-banner .eyebrow { color: var(--accent); }
:root[data-theme] .hero-banner .actions { margin-top: 12px; }
:root[data-theme] .hero-banner .btn { min-height: 36px; padding: 0 14px; font-size: .86rem; }
:root[data-theme] .hero-banner .btn.secondary, :root[data-theme] .hero-banner select { background: var(--surface-solid); color: var(--text); border-color: var(--line-strong); }
:root[data-theme] .hero-banner .pods3d, :root[data-theme] .hero-banner .pods-visual { display: none; }
:root[data-theme] .live-dot { color: var(--good); }
:root[data-theme] .pod-card { background: var(--surface); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius); padding: 16px 18px; box-shadow: inset 3px 0 0 var(--accent-solid); }
:root[data-theme] .pod-card::before, :root[data-theme] .pod-card::after { display: none; }
:root[data-theme] .pod-card h2 { font-size: 1.05rem; color: var(--text); }
:root[data-theme] .pod-card p { color: var(--text-2); }
:root[data-theme] .pod-card .btn.light { background: var(--accent-solid); color: #fff; }
:root[data-theme] .pod-card .btn.secondary { background: var(--surface-solid); color: var(--text); border-color: var(--line-strong); }
:root[data-theme] .pod-orb { background: var(--accent-soft); box-shadow: none; animation: none; }

/* ---------- Buttons, chips, badges ---------- */
:root[data-theme] .btn, :root[data-theme] button, :root[data-theme] a.button {
  min-height: 36px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--accent-solid); background: var(--accent-solid); color: #fff;
  font: 600 .86rem var(--font-body); letter-spacing: 0; box-shadow: none; filter: none; animation: none; overflow: visible; }
:root[data-theme] .btn::after, :root[data-theme] button::after, :root[data-theme] a.button::after { display: none; }
:root[data-theme] .btn:hover, :root[data-theme] button:hover, :root[data-theme] a.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; box-shadow: none; filter: none; transform: none; }
:root[data-theme="dark"] .btn:hover, :root[data-theme="dark"] button:hover, :root[data-theme="dark"] a.button:hover { background: #7b6bff; border-color: #7b6bff; }
:root[data-theme] .btn:active, :root[data-theme] button:active { transform: translateY(1px); }
:root[data-theme] .btn.secondary, :root[data-theme] button.secondary, :root[data-theme] a.button.secondary {
  background: var(--surface-solid); color: var(--text); border-color: var(--line-strong); box-shadow: none; backdrop-filter: none; }
:root[data-theme] .btn.secondary:hover, :root[data-theme] button.secondary:hover, :root[data-theme] a.button.secondary:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); color: var(--text); }
:root[data-theme] .btn.ghost, :root[data-theme] button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
:root[data-theme] .btn.ghost:hover, :root[data-theme] button.ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
:root[data-theme] button.link { background: none; border: 0; min-height: 0; padding: 0; color: var(--accent); font-weight: 550; }
:root[data-theme] button.link:hover { background: none; color: var(--accent-strong); }
:root[data-theme] button.danger, :root[data-theme] .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
:root[data-theme] button.danger:hover, :root[data-theme] .btn.danger:hover { background: color-mix(in srgb, var(--bad) 85%, #000); border-color: transparent; }
/* "Ask GV Brain": the soft accent button, the same on every page */
:root[data-theme] .btn.glow { background: var(--accent-soft); color: var(--accent); border-color: transparent; box-shadow: none; animation: none; }
:root[data-theme] .btn.glow:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); border-color: transparent; }
:root[data-theme] .btn.sm, :root[data-theme] button.sm { min-height: 30px; padding: 0 10px; font-size: .8rem; border-radius: 6px; }
:root[data-theme] .icon-btn { border-radius: 7px; }
:root[data-theme] .chip { min-height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface-solid); color: var(--text-2); font: 550 .82rem var(--font-body); box-shadow: none; }
:root[data-theme] .chip:hover { border-color: var(--accent); background: var(--surface-solid); color: var(--text); box-shadow: none; }
:root[data-theme] .chip.on, :root[data-theme] .chip[aria-current], :root[data-theme] .chip[aria-pressed="true"] { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
:root[data-theme] .chip.on b, :root[data-theme] .chip[aria-current] b { color: inherit; }
:root[data-theme] .badge { border-radius: 5px; padding: 2px 7px; font-size: .7rem; font-weight: 650; border: 0; background: var(--surface-2); color: var(--text-2); }
:root[data-theme] .badge::before { box-shadow: none; width: 5px; height: 5px; }
:root[data-theme] .badge.good { background: var(--good-soft); color: var(--good); }
:root[data-theme] .badge.warn { background: var(--warn-soft); color: var(--warn); }
:root[data-theme] .badge.bad { background: var(--bad-soft); color: var(--bad); }
:root[data-theme] .badge.info { background: var(--info-soft); color: var(--info); }
:root[data-theme] .badge.accent { background: var(--accent-soft); color: var(--accent); }
:root[data-theme] .sample { border-radius: 5px; }

/* ---------- Tables: dense, thin lines, coloured cells for good, near and bad ---------- */
:root[data-theme] table.data, :root[data-theme] table.audit { font-size: .84rem; font-variant-numeric: tabular-nums; }
:root[data-theme] table.data th, :root[data-theme] table.audit th { font-size: .72rem; font-weight: 550; letter-spacing: 0; text-transform: none; color: var(--text-3); padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-radius: 0; }
:root[data-theme] table.data td, :root[data-theme] table.audit td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
:root[data-theme] table.data tbody tr:hover td, :root[data-theme] table.audit tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
:root[data-theme] .card.flush table.data th:first-child, :root[data-theme] .card.flush table.data td:first-child { padding-left: 18px; }
:root[data-theme] .card.flush table.data th:last-child, :root[data-theme] .card.flush table.data td:last-child { padding-right: 18px; }
:root[data-theme] .card > .scroll > table.audit, :root[data-theme] .card > table.audit { border-color: var(--line); background: var(--surface); }
:root[data-theme] .tbl-scroll { background: linear-gradient(90deg, var(--surface) 30%, transparent) left / 40px 100% no-repeat local, linear-gradient(270deg, var(--surface) 30%, transparent) right / 40px 100% no-repeat local, radial-gradient(farthest-side at 0 50%, rgba(10, 10, 30, .12), transparent) left / 12px 100% no-repeat scroll, radial-gradient(farthest-side at 100% 50%, rgba(10, 10, 30, .12), transparent) right / 12px 100% no-repeat scroll; }
:root[data-theme] .cell-title { font-weight: 600; }
:root[data-theme] .pos { color: var(--good); } :root[data-theme] .neg { color: var(--bad); }
:root[data-theme] td.error, :root[data-theme] td .error { color: var(--bad); }
/* Shared colour cells and thumbnails for every number table (good, near the limit, bad) */
.cell-good, .cell-mid, .cell-bad { display: inline-block; padding: 1px 6px; border-radius: 5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-good { background: var(--good-soft); color: var(--good); }
.cell-mid { background: var(--warn-soft); color: var(--warn); }
.cell-bad { background: var(--bad-soft); color: var(--bad); }
:root[data-theme] table .thumb, :root[data-theme] .thumb { border-radius: 6px; }
:root[data-theme] .minibar { border: 0; height: 5px; background: var(--surface-2); }
:root[data-theme] .minibar span { box-shadow: none; }

/* ---------- Tabs inside a page ---------- */
:root[data-theme] .tabs, :root[data-theme] .seg { border-radius: 8px; }
:root[data-theme] .tabbar a[aria-current="page"] .tab-ico { background: var(--accent-solid); }

/* ---------- Forms ---------- */
:root[data-theme] input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), :root[data-theme] select, :root[data-theme] textarea {
  border-radius: 7px; background-color: var(--field); border: 1px solid var(--line-strong); color: var(--text); min-height: 36px; font-size: .88rem; box-shadow: none; }
:root[data-theme] input:focus, :root[data-theme] select:focus, :root[data-theme] textarea:focus { border-color: var(--accent); box-shadow: var(--glow); outline: none; }
:root[data-theme] input[type=checkbox], :root[data-theme] input[type=radio], :root[data-theme] input[type=range] { accent-color: var(--accent-solid); }
:root[data-theme] label { font-size: .84rem; }
:root[data-theme] fieldset { border-color: var(--line); border-radius: var(--radius); }
:root[data-theme] .range-pop summary, :root[data-theme] .ins-sites summary { border-radius: 7px; }

/* ---------- Progress, meters ---------- */
:root[data-theme] .bar, :root[data-theme] .meter { background: var(--surface-2); border: 0; border-radius: 99px; }
:root[data-theme] .bar > span, :root[data-theme] .meter span { background: var(--accent-solid); box-shadow: none; }
:root[data-theme] .ring { background: conic-gradient(var(--accent-solid) calc(var(--p) * 1%), var(--surface-2) 0); box-shadow: none; }
:root[data-theme] ol.todo li::before { background: var(--accent-solid); box-shadow: none; }

/* ---------- Charts: one style everywhere ----------
   A faint grid, the accent for the main line or bars, a dashed grey line for the comparison (last year, a normal
   week, the forecast), the key under the chart (templates/_chart_key.html) and one line saying what it means
   (.key-note, or .chart-outcome). Glows and gradients are gone. */
:root[data-theme] .chart text { fill: var(--text-3); font: 11px var(--font-body); }
:root[data-theme] .chart .grid line, :root[data-theme] svg .grid line { stroke: var(--chart-grid); stroke-dasharray: none; }
:root[data-theme] .chart rect.bar-v:hover { filter: brightness(1.08); }
:root[data-theme] svg [stroke-dasharray] { stroke: var(--chart-cmp); }
:root[data-theme] svg polyline, :root[data-theme] svg path, :root[data-theme] svg circle { filter: none; }
:root[data-theme] .chart-key { gap: 4px 14px; margin-top: 10px; font-size: .76rem; color: var(--text-2); }
:root[data-theme] .key-sw { width: 10px; height: 10px; border-radius: 3px; }
:root[data-theme] .key-line { width: 14px; height: 3px; }
:root[data-theme] .key-dash { width: 14px; border-top-width: 2px; border-top-color: var(--key); }
:root[data-theme] .key-glow { box-shadow: none; outline: 2px solid color-mix(in srgb, var(--key) 35%, transparent); outline-offset: 1px; }
:root[data-theme] .key-note, .chart-outcome { flex: 1 1 100%; color: var(--text); font-size: .82rem; margin-top: 2px; }
:root[data-theme] .legend { font-size: .76rem; gap: 12px; }
:root[data-theme] .legend i { box-shadow: none; width: 10px; height: 3px; border-radius: 2px; }
:root[data-theme] .hour span, :root[data-theme] .ins-col span, :root[data-theme] .hub-bar, :root[data-theme] .ih-bar span { box-shadow: none; }
:root[data-theme] .ins-col span { opacity: 1; border-radius: 3px 3px 1px 1px; }

/* ---------- Pop-ups, search, menus ---------- */
:root[data-theme] .palette-box { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 12px; }
:root[data-theme] .palette-list li a { border-radius: 8px; }
:root[data-theme] .palette-list li a .pi { border-radius: 7px; }
:root[data-theme] .palette-list li[aria-selected="true"] a { background: var(--accent-soft); color: var(--text); box-shadow: none; }
:root[data-theme] .palette-list li[aria-selected="true"] a .pi { background: var(--accent-solid); color: #fff; }
:root[data-theme] .palette-list li[aria-selected="true"] a .pg { color: var(--text-3); }
:root[data-theme] .switcher-list { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
:root[data-theme] button.switch-item, :root[data-theme] a.switch-item { border-radius: 7px; background: transparent; color: var(--text); border: 0; min-height: 0; font-weight: 500; }
:root[data-theme] button.switch-item:hover, :root[data-theme] .switch-item[aria-current] { background: var(--surface-2); color: var(--text); }
:root[data-theme] button.switch-item.accent { color: var(--accent); }
:root[data-theme] .lc-pill { height: 36px; border-radius: 8px; box-shadow: none; border-color: var(--line-strong); font-size: .82rem; }
:root[data-theme] .lc-pop { border-radius: 12px; }
:root[data-theme] .lc-col { border-radius: 10px; }
:root[data-theme] .lc-row { border-radius: 8px; }
:root[data-theme] .lc-row.on, :root[data-theme] .lc-tile.on { background: var(--accent-solid); color: #fff; border-color: var(--accent-solid); box-shadow: none; }
:root[data-theme] .lc-row.on small, :root[data-theme] .lc-tile.on small { color: rgba(255, 255, 255, .78); }
:root[data-theme] .lc-tile { border-radius: 10px; }
:root[data-theme] .fresh summary { border-radius: 8px; padding: 6px 10px; font-size: .78rem; }
:root[data-theme] .fresh-pop { border-radius: 10px; }
:root[data-theme] .ck { border-radius: 12px; }
:root[data-theme] .ck .ck-btn { border-radius: 8px; }
:root[data-theme] .ck-row { border-radius: 8px; }
:root[data-theme] .onpage .chip { min-height: 28px; }
:root[data-theme] .avatar { background: var(--accent-solid); box-shadow: none; }
:root[data-theme] .avatar-sq { background: var(--t-blue); }
:root[data-theme] kbd { border-radius: 4px; }
:root[data-theme] .app button.top-search { min-height: 36px; border-radius: 8px; background: var(--surface-2); border-color: var(--line); font-size: .84rem; }

/* ---------- The admin area (admin_base.html): the same navy side menu and white top bar ---------- */
:root[data-theme] .app:not(.docked) { grid-template-columns: 228px minmax(0, 1fr); }
:root[data-theme] .app:not(.docked) .sidebar { background: var(--side); border-right: 0; color: var(--side-fg); backdrop-filter: none; -webkit-backdrop-filter: none; padding: 16px 12px; gap: 10px; }
:root[data-theme] .sidebar::after { display: none; }
:root[data-theme] .sidebar .brand-logo.for-dark { display: block; height: 26px; }
:root[data-theme] .sidebar .brand-logo.for-light { display: none; }
:root[data-theme] .sidebar .nav-label { color: var(--side-mute); }
:root[data-theme] .sidebar .nav a { color: var(--side-fg); border-radius: 7px; min-height: 34px; font-size: .86rem; padding: 0 10px; }
:root[data-theme] .sidebar .nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
:root[data-theme] .sidebar .nav a[aria-current="page"] { background: var(--accent-solid); color: #fff; box-shadow: none; }
:root[data-theme] .sidebar .nav a[aria-current="page"]::before { display: none; }
:root[data-theme] .sidebar .nav a[aria-current="page"] svg { color: #fff; filter: none; }
:root[data-theme] .app button.nav-search { background: var(--side-2); border-color: transparent; color: var(--side-mute); border-radius: 8px; }
:root[data-theme] .app button.nav-search:hover { color: #fff; background: var(--side-2); }
:root[data-theme] .sidebar .side-user { border-top-color: rgba(255, 255, 255, .1); }
:root[data-theme] .sidebar .side-user .who { color: #fff; }
:root[data-theme] .sidebar .side-user .who span { color: var(--side-mute); }
:root[data-theme] .sidebar .side-user button, :root[data-theme] .sidebar .side-user a.icon-btn { background: transparent; border: 1px solid rgba(255, 255, 255, .14); color: var(--side-fg); border-radius: 7px; min-height: 0; padding: 0; }
:root[data-theme] .admin-badge { border-radius: 8px; border-color: rgba(255, 255, 255, .12); background: var(--side-2); }
:root[data-theme] .app:not(.docked) .topbar { background: var(--surface-solid); border-bottom: 1px solid var(--line); padding: 10px 24px; min-height: 56px; backdrop-filter: none; -webkit-backdrop-filter: none; }
:root[data-theme] .app:not(.docked) .content { padding: 18px 24px 48px; gap: 14px; }
:root[data-theme] .app .topbar .icon-btn.top-theme { width: 36px; height: 36px; min-height: 36px; border-radius: 8px; }
:root[data-theme] .top-find { border-radius: 8px; min-height: 36px; }
:root[data-theme] .mod, :root[data-theme] .bento .kpi { border-radius: var(--radius); }
:root[data-theme] .mod.on::before { display: none; }
:root[data-theme] .cust .sq { border-radius: 7px; box-shadow: none; background: var(--t-blue); }
@media (max-width: 860px) {
  :root[data-theme] .app:not(.docked) { grid-template-columns: minmax(0, 1fr); }
  :root[data-theme] .app:not(.docked) .sidebar { width: min(300px, 86vw); }
  :root[data-theme] .app:not(.docked) .topbar { padding: 8px 14px; }
  :root[data-theme] .app:not(.docked) .content { padding: 14px 14px calc(100px + env(safe-area-inset-bottom)); }
  :root[data-theme] .tabbar { border-radius: 14px; background: var(--surface-solid); border-color: var(--line); }
}

/* ---------- Public pages that share the app's classes (log in, sign up, help) ---------- */
:root[data-theme] .public .site-nav { border-bottom: 1px solid var(--line); background: var(--surface-solid); }

/* ---------- Reports & projections overview (templates/reports_hub.html) ---------- */
.rp-group { display: grid; gap: 10px; }
.rp-group h2 { font-size: .74rem !important; font-weight: 700 !important; letter-spacing: .1em !important; text-transform: uppercase; color: var(--text-3); }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
:root[data-theme] a.card.rp-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; color: var(--text); text-decoration: none; min-width: 0; }
.rp-pic { display: block; width: 100%; height: 96px; border-radius: 7px; background: var(--surface-2); }
.rp-pic .rp-grid line { stroke: var(--chart-grid); stroke-width: 1; }
.rp-pic .rp-main { fill: none; stroke: var(--chart-a); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
:root[data-theme] .rp-pic .rp-cmp { fill: none; stroke: var(--chart-cmp); stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.rp-pic .rp-zone { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
.rp-pic .rp-band { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.rp-pic .rp-bar { fill: color-mix(in srgb, var(--chart-bar) 55%, transparent); }
.rp-pic .rp-bar.hi { fill: var(--chart-bar); }
.rp-pic .rp-day { fill: var(--surface-solid); stroke: var(--line-strong); }
.rp-pic .rp-day.good { fill: var(--good-soft); stroke: var(--good); }
.rp-pic .rp-day.weak { fill: var(--warn-soft); stroke: var(--warn); }
.rp-pic .rp-block { fill: var(--text-3); opacity: .55; }
.rp-pic .rp-line { fill: var(--line-strong); }
.rp-pic .rp-page { fill: var(--surface-solid); stroke: var(--line-strong); }
.rp-pic .rp-dot { fill: var(--chart-a); }
.rp-pic .rp-mark { stroke: var(--chart-cmp); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rp-body { display: grid; gap: 3px; min-width: 0; }
.rp-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.rp-title svg { flex: none; color: var(--accent); }
.rp-title b { font-size: .92rem; overflow-wrap: anywhere; }
.rp-text { font-size: .8rem; color: var(--text-2); line-height: 1.4; overflow-wrap: anywhere; }
.rp-open { margin-top: auto; font-size: .8rem; font-weight: 600; color: var(--accent); }

/* ---------- Phones ---------- */
@media (max-width: 899px) {
  :root[data-theme] .app.docked .content { padding: 12px 12px 24px; gap: 12px; }
}
@media (max-width: 600px) {
  :root[data-theme] .card, :root[data-theme] .card.flush .card-head { padding: 14px; }
  :root[data-theme] .card.flush { padding: 0; }
  :root[data-theme] .kpis, :root[data-theme] .kpis.glance { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  :root[data-theme] .kpis.glance > .kpi:first-child { grid-column: 1 / -1; }
  :root[data-theme] .kpi, :root[data-theme] .kpis > .kpi { padding: 10px 11px; border-radius: 9px; }
  :root[data-theme] .kpi .value, :root[data-theme] .kpis.glance > .kpi:first-child .value { font-size: 1.12rem; }
  :root[data-theme] .page-head h1, :root[data-theme] .hero-banner h1 { font-size: 1.2rem; }
  .rp-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Today's story (templates/_start_story.html): a calm card after the numbers, not a big banner ---------- */
:root[data-theme] .st { --st-accent: var(--accent-solid); --st-ring: color-mix(in srgb, var(--accent) 16%, transparent); gap: 14px; margin-bottom: 14px; }
:root[data-theme] .st-hero { grid-template-columns: minmax(0, 1fr); padding: 16px 18px; border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--accent-solid); gap: 10px; }
:root[data-theme] .st-hero-text { gap: 10px; }
:root[data-theme] .st-ring { display: none; }
:root[data-theme] .st-kicker { padding: 0; background: none; color: var(--accent); font-size: .68rem; }
:root[data-theme] .st-hero h1 { color: var(--text); font: 700 1.2rem/1.25 var(--font-body); letter-spacing: -.01em; }
:root[data-theme] .st-hero p { font-size: .9rem; color: var(--text-2); opacity: 1; }
:root[data-theme] .st-chapters a { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); border-radius: 7px; min-height: 30px; padding: 0 10px; font-size: .8rem; }
:root[data-theme] .st-chapters a i, :root[data-theme] .st-chapters a b { background: var(--accent-solid); color: #fff; }
:root[data-theme] .st-num { width: 34px; height: 34px; border-radius: 9px; font: 700 .95rem var(--font-body); }
:root[data-theme] .st-chap h2, :root[data-theme] .st-numbers-head h2 { font: 700 1.15rem/1.25 var(--font-body); letter-spacing: -.01em; }
:root[data-theme] .st-numbers-head { margin-bottom: 0; }
:root[data-theme] .st-card { border-radius: var(--radius); padding: 14px; box-shadow: none; }
:root[data-theme] .st-step { font-size: .68rem; }
:root[data-theme] .st-numbers-head { display: block; }

/* ---------- Ads pages (ads_tabs.css, meta_flow.css, google_flow.css) ---------- */
:root[data-theme] .ads-answer { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--accent-solid); padding: 12px 16px; border-radius: var(--radius); }
:root[data-theme] .ads-answer p { font-size: .92rem; }
:root[data-theme] .ads-answer-go { background: var(--accent-solid); color: #fff; border-radius: 7px; padding: 8px 12px; font-size: .84rem; }
:root[data-theme] .ads-answer-go:hover { background: var(--accent-strong); color: #fff; }
:root[data-theme] .ads-answer-ok { color: var(--good); }
:root[data-theme] .ads-tabs a { font-size: .88rem; padding: 8px 12px 9px; }
:root[data-theme] .ads-tabs a.on { border-bottom-color: var(--accent-solid); }
:root[data-theme] .kpis.hub-tiles .kpi { min-height: 0; }
:root[data-theme] .kpis.hub-tiles .value { font-size: 1.3rem; }
:root[data-theme] .mf-seg { border-radius: 8px; padding: 3px; background: var(--surface-solid); border-color: var(--line-strong); }
:root[data-theme] .mf-seg a { border-radius: 6px; padding: 5px 12px; font-size: .82rem; }
:root[data-theme] .mf-seg a.on { background: var(--accent-solid); color: #fff; box-shadow: none; }
:root[data-theme] .mf-goals .chip.on { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
:root[data-theme] .mf-tile { background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--tone, var(--accent-solid)); border-radius: var(--radius); color: var(--text); }

/* ---------- Leftovers of the colour-tile look, made calm ---------- */
:root[data-theme] .setup-ring { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 14px 18px; }
:root[data-theme] .setup-ring-inner { --size: 104px; }
:root[data-theme] .setup-ring-inner::before { background: var(--surface-solid); box-shadow: none; }
:root[data-theme] .setup-ring-inner b { font: 700 1.7rem/1 var(--font-body); }
:root[data-theme] .setup-ring-facts { color: var(--text-2); }
:root[data-theme] .setup-ring-facts b { font: 700 1rem var(--font-body); color: var(--text); }
:root[data-theme] .onpage a.on { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
:root[data-theme] input[type=file]::file-selector-button { padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface-solid); color: var(--text); font: 600 .82rem var(--font-body); }
:root[data-theme] .setup-ring-inner { background: conic-gradient(var(--accent-solid) calc(var(--p) * 1%), var(--line) 0); }
:root[data-theme] .chart rect.bar-v, :root[data-theme] .chart polyline.line-draw { animation: none; stroke-dashoffset: 0; stroke-dasharray: none; } /* charts show at once, no growing bars */
:root[data-theme] .fc-chart { max-width: 820px; } /* admin income forecast: text stays small on wide screens */
:root[data-theme] .sc-count { background: var(--surface-solid); color: var(--text); border: 1px solid var(--line); border-top: 3px solid var(--accent-solid); box-shadow: none; border-radius: var(--radius); } :root[data-theme] .sc-count b { font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.mod-tile.tone-brain:not(.fp-mt) > svg { width: calc(var(--s, 40px) * .86) !important; height: calc(var(--s, 40px) * .86) !important; } /* the brain stays inside its tile (a % height has nothing to measure against here) */

/* ---------- Help Center (help.css): flat cards, one search field ---------- */
:root[data-theme] .hc-search { height: 48px; border-radius: var(--radius); box-shadow: none; }
:root[data-theme] .hc-search #hc-q, :root[data-theme] .hc-search #hc-q:focus { border: 0; background: transparent; box-shadow: none; padding: 0; height: 100%; }
:root[data-theme] .hc-cell, :root[data-theme] .hc-sec, :root[data-theme] .hc-more, :root[data-theme] .hc-related a, :root[data-theme] .hc-steps li { border-radius: var(--radius); box-shadow: none; }
:root[data-theme] .hc-cell:hover { transform: none; border-color: var(--accent-solid); }
:root[data-theme] .hc-start { border-radius: var(--radius); background: var(--side, #10123a); box-shadow: none; }
:root[data-theme] .hc-start a { border-radius: 8px; }
:root[data-theme] .hc-shot img { border-radius: var(--radius-sm, 8px); box-shadow: none; }
:root[data-theme] .hc-tip, :root[data-theme] .hc-do { border-radius: var(--radius); }
:root[data-theme] .hc-cell span:last-child, :root[data-theme] .hc-meta, :root[data-theme] .hc-start em { font-family: var(--font-body); }
:root[data-theme] .hc-head h1, :root[data-theme] .hc-start h2 { letter-spacing: -.02em; }
:root[data-theme] .app:not(.docked) .admin-badge b { color: #fff; }
:root[data-theme] .top-find input:not(#gv-none), :root[data-theme] .top-find input:not(#gv-none):focus { border: 0; background: transparent; box-shadow: none; padding: 0; min-height: 0; height: 100%; }
:root[data-theme] .ft-find input:not(#gv-none) { border: 0; background: none; box-shadow: none; padding: 10px 0; }

/* "Spend frozen" in the top bar: on phones it shrinks to a dot-sized badge instead of pushing the bar sideways */
@media (max-width: 560px) {
  .gv-top-right > .badge.bad { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
