/* Paper Trader: bright white canvas, purple / blue / yellow brand, soft gradients, rounded cards, gentle motion.
   Colour tokens are plain hex so tests/test_themes.py can check every mode and accent for contrast. */
:root {
  --bg: #ffffff; --bg-2: #fbfaff; --card: #ffffff; --surface-2: #f7f5ff; --text: #17133a; --muted: #57537a; --line: #ece8f8;
  --accent: #6d28d9; --accent-deco: #7c3aed; --accent-2: #2563eb; --navy: #1e1b4b; --on-accent: #ffffff; --on-status: #ffffff;
  --brand-purple: #7c3aed; --brand-blue: #2563eb; --brand-yellow: #facc15; --on-yellow: #2a1f00;
  --good: #15803d; --bad: #b91c1c; --warn: #b45309; --chip: #f3f0ff; --side: #ffffff;
  --live: #15803d; --stale: #b45309; --down: #b91c1c; --sim: #1d4ed8;
  --sim-bg: #eef4ff; --sim-line: #d5e3ff; --sim-text: #1e40af; --good-bg: #e8f7ee; --bad-bg: #fdecec; --warn-bg: #fff8d6;
  --chart-1: #7c3aed; --chart-2: #60a5fa; --chart-3: #f59e0b; --chart-4: #16a34a; --chart-5: #dc2626; --chart-6: #2563eb;
  --shadow: 0 1px 2px rgba(30, 27, 75, .04), 0 10px 30px -12px rgba(76, 29, 149, .14);
  --shadow-lg: 0 30px 60px -20px rgba(76, 29, 149, .28), 0 8px 20px -8px rgba(30, 64, 175, .12);
  --glow-purple: rgba(124, 58, 237, .13); --glow-blue: rgba(37, 99, 235, .11); --glow-yellow: rgba(250, 204, 21, .16);
  --glass: rgba(255, 255, 255, .78);
  color-scheme: light;
}
/* dark: chosen explicitly, or "system" on a device set to dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --bg: #0d0b1f; --bg-2: #0d0b1f; --card: #17142e; --surface-2: #1e1a3a; --text: #eeeafd; --muted: #aaa4cd; --line: #2b2650;
    --accent: #b79cff; --accent-deco: #a78bfa; --accent-2: #7fb0ff; --navy: #e4dcff; --on-accent: #0d0b1f; --on-status: #0d0b1f;
    --brand-purple: #a78bfa; --brand-blue: #7fb0ff; --brand-yellow: #fde047; --on-yellow: #2a1f00;
    --good: #4ade80; --bad: #f87171; --warn: #fbbf24; --chip: #221d42; --side: #110e26;
    --live: #4ade80; --stale: #fbbf24; --down: #f87171; --sim: #93c5fd;
    --sim-bg: #13203f; --sim-line: #23376a; --sim-text: #c3d9ff; --good-bg: #11301f; --bad-bg: #3a1517; --warn-bg: #3a2c0a;
    --chart-1: #b79cff; --chart-2: #93c5fd; --chart-3: #fbbf24; --chart-4: #4ade80; --chart-5: #f87171; --chart-6: #7fb0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .65);
    --glow-purple: rgba(124, 58, 237, .22); --glow-blue: rgba(37, 99, 235, .16); --glow-yellow: rgba(250, 204, 21, .06);
    --glass: rgba(13, 11, 31, .72);
    color-scheme: dark;
  }
}
:root[data-mode="dark"] {
  --bg: #0d0b1f; --bg-2: #0d0b1f; --card: #17142e; --surface-2: #1e1a3a; --text: #eeeafd; --muted: #aaa4cd; --line: #2b2650;
  --accent: #b79cff; --accent-deco: #a78bfa; --accent-2: #7fb0ff; --navy: #e4dcff; --on-accent: #0d0b1f; --on-status: #0d0b1f;
  --brand-purple: #a78bfa; --brand-blue: #7fb0ff; --brand-yellow: #fde047; --on-yellow: #2a1f00;
  --good: #4ade80; --bad: #f87171; --warn: #fbbf24; --chip: #221d42; --side: #110e26;
  --live: #4ade80; --stale: #fbbf24; --down: #f87171; --sim: #93c5fd;
  --sim-bg: #13203f; --sim-line: #23376a; --sim-text: #c3d9ff; --good-bg: #11301f; --bad-bg: #3a1517; --warn-bg: #3a2c0a;
  --chart-1: #b79cff; --chart-2: #93c5fd; --chart-3: #fbbf24; --chart-4: #4ade80; --chart-5: #f87171; --chart-6: #7fb0ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .65);
  --glow-purple: rgba(124, 58, 237, .22); --glow-blue: rgba(37, 99, 235, .16); --glow-yellow: rgba(250, 204, 21, .06);
  --glass: rgba(13, 11, 31, .72);
  color-scheme: dark;
}
/* accent palettes: a deep shade for light mode, a light shade for dark mode (both >= 4.5:1, see test_themes).
   "aurora" (purple into blue) is the base palette above; the others swap the accent and flatten the gradient. */
:root[data-accent="ocean"] { --accent: #2867db; }
:root[data-accent="emerald"] { --accent: #047857; }
:root[data-accent="violet"] { --accent: #6d28d9; }
:root[data-accent="sunset"] { --accent: #c2410c; }
:root[data-accent="rose"] { --accent: #be123c; }
:root[data-accent="mono"] { --accent: #334155; }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"])[data-accent="ocean"] { --accent: #6aa2ff; }
  :root:not([data-mode="light"])[data-accent="emerald"] { --accent: #34d399; }
  :root:not([data-mode="light"])[data-accent="violet"] { --accent: #a78bfa; }
  :root:not([data-mode="light"])[data-accent="sunset"] { --accent: #fb923c; }
  :root:not([data-mode="light"])[data-accent="rose"] { --accent: #fb7185; }
  :root:not([data-mode="light"])[data-accent="mono"] { --accent: #cbd5e1; }
}
:root[data-mode="dark"][data-accent="ocean"] { --accent: #6aa2ff; }
:root[data-mode="dark"][data-accent="emerald"] { --accent: #34d399; }
:root[data-mode="dark"][data-accent="violet"] { --accent: #a78bfa; }
:root[data-mode="dark"][data-accent="sunset"] { --accent: #fb923c; }
:root[data-mode="dark"][data-accent="rose"] { --accent: #fb7185; }
:root[data-mode="dark"][data-accent="mono"] { --accent: #cbd5e1; }
:root[data-accent]:not([data-accent="aurora"]) { --accent-deco: var(--accent); --accent-2: color-mix(in srgb, var(--accent) 78%, var(--text)); }
/* derived from the accent, so every palette above follows automatically */
:root {
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent); --accent-ring: color-mix(in srgb, var(--accent) 40%, transparent);
  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  --grad-soft: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--card)) 0%, color-mix(in srgb, var(--accent-2) 9%, var(--card)) 100%);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
}

/* Inter, self-hosted (Latin subset, variable weight). SIL Open Font License: /static/fonts/OFL.txt */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/InterVariable-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* base */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14.5px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { min-height: 100vh; position: relative; isolation: isolate; }
/* soft colour washes behind everything: purple top left, blue top right, a warm yellow glow in the middle */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42rem 26rem at 8% -6%, var(--glow-purple), transparent 70%),
    radial-gradient(40rem 24rem at 96% -4%, var(--glow-blue), transparent 70%),
    radial-gradient(34rem 18rem at 55% 4%, var(--glow-yellow), transparent 70%),
    linear-gradient(180deg, var(--bg) 0, var(--bg-2) 100%); }
h1 { font-size: 22px; margin: 0; font-weight: 750; letter-spacing: -.025em; }
h2 { font-size: 16px; margin: 0; font-weight: 680; letter-spacing: -.015em; }
h3 { font-weight: 650; letter-spacing: -.01em; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 0;
  border-color: var(--accent) !important; }
input, select, textarea { transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.hidden { display: none !important; }
.num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
::selection { background: color-mix(in srgb, var(--brand-yellow) 55%, transparent); color: var(--text); }

/* motion: views and cards rise in softly; nothing moves for people who ask for less motion */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; } }
.view > *, .login-card, .hero-copy, .hero-visual, .site-section, .legal { animation: rise .6s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .05s; } .view > *:nth-child(3) { animation-delay: .1s; }
.view > *:nth-child(4) { animation-delay: .15s; } .view > *:nth-child(n+5) { animation-delay: .2s; }
.hero-visual { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* app shell: glass top bar, sidebar on desktop, floating tab bar on phones */
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; padding: 14px 28px; padding-top: max(14px, env(safe-area-inset-top));
  background: var(--glass); backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line); }
.brand, .top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top h1 { font-size: 24px; }
.top-right #worker { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); }
main { max-width: 1280px; margin: 0 auto; padding: 24px 28px 36px; display: grid; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; min-width: 0;
  box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 12px; flex-wrap: wrap;
  margin-bottom: 14px; }
.card-head .muted.small { max-width: 70ch; }
.grid2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.tabs { display: flex; background: var(--side); border-bottom: 1px solid var(--line); overflow-x: auto;
  scrollbar-width: none; z-index: 4; gap: 4px; padding: 8px 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--muted); text-decoration: none;
  font-weight: 600; white-space: nowrap; border-radius: var(--r-sm); transition: background-color .2s var(--ease), color .2s var(--ease); }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a.on { color: var(--accent); background: var(--accent-soft); }
.tabs .ico { font-size: 14px; line-height: 1; width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 9px;
  flex: none; transition: background .25s var(--ease), color .25s var(--ease); }
.tabs .more-tab { display: none; }
.side-brand, .side-foot, .tabs .side-brand { display: none; }
.count { background: var(--bad); color: var(--on-status); border-radius: 999px; font-size: 11px; padding: 0 6px; min-width: 18px;
  text-align: center; line-height: 18px; font-weight: 700; }

@media (min-width: 1024px) {
  body.app { padding-left: 260px; }
  body.app .tabs { position: fixed; top: 0; bottom: 0; left: 0; width: 260px; flex-direction: column; overflow-y: auto;
    border-bottom: 0; border-right: 1px solid var(--line); padding: 22px 16px; gap: 3px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, var(--side)) 0, var(--side) 280px); }
  body.app .tabs a { padding: 8px 10px; }
  body.app .tabs a.on { color: var(--text); background: var(--card); box-shadow: var(--shadow); }
  body.app .tabs a.on .ico { color: #ffffff; background: var(--grad); box-shadow: 0 6px 14px -6px var(--accent-ring); }
  body.app .tabs .count { margin-left: auto; }
  body.app .side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 26px; color: var(--text);
    text-decoration: none; font-weight: 750; font-size: 17px; letter-spacing: -.02em; }
  body.app .side-brand img { border-radius: 10px; box-shadow: 0 8px 18px -8px var(--accent-ring); }
  body.app .side-foot { display: grid; gap: 4px; margin-top: auto; padding: 14px; border-radius: var(--r-md);
    background: var(--grad-soft); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
  body.app .side-foot strong { color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.app .app-logo { display: none; }
  body.app .top { padding-left: 36px; padding-right: 36px; }
  body.app main { padding: 28px 36px 40px; }
}

/* status pills: one shape for data mode, feed status, strategy health and requests */
.badge, .st, .health { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; line-height: 18px; white-space: nowrap; }
.badge { background: var(--chip); color: var(--text); }
.badge.paper { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.badge.mode-sim { background: var(--sim-bg); color: var(--sim-text); box-shadow: inset 0 0 0 1px var(--sim-line); }
.badge.mode-live { background: var(--good-bg); color: var(--good); }
.badge.test { background: var(--brand-yellow); color: var(--on-yellow); }
a.badge { text-decoration: none; }
.st, .health { color: var(--on-status); }
.st::before, .health::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.st.LIVE { background: var(--live); } .st.STALE { background: var(--stale); }
.st.UNAVAILABLE { background: var(--down); } .st.SIMULATED { background: var(--sim); }
.health { text-transform: uppercase; }
.health.running { background: var(--live); } .health.paused { background: var(--stale); }
.health.degraded { background: var(--sim); } .health.stopped { background: var(--down); }
.health.off { background: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; flex: none;
  animation: pulse-ring 1.8s ease-out infinite; }
.pulse.bad { background: var(--bad); animation: none; }

/* banners: the emergency stop stays loud, the simulation notice is a slim strip */
.banner { padding: 10px 16px; font-weight: 600; text-align: center; }
.banner.danger { background: var(--bad); color: var(--on-status); }
.banner.warn { background: var(--warn-bg); color: var(--text); border-bottom: 1px solid var(--line); font-weight: 500; }
#stopBanner { font-weight: 700; letter-spacing: .01em; }
#simBanner { background: var(--sim-bg); color: var(--sim-text); border-bottom: 1px solid var(--sim-line); font-weight: 500;
  font-size: 13px; padding: 9px 16px; }
.banner a { color: inherit; font-weight: 700; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); border-radius: 999px; padding: 8px 18px; font: inherit; font-weight: 650;
  cursor: pointer; min-height: 40px; letter-spacing: -.005em;
  transition: transform .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .25s var(--ease); }
.btn:hover { border-color: var(--accent-ring); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--accent); background-image: var(--grad); color: var(--on-accent); border-color: transparent; min-height: 44px;
  box-shadow: 0 8px 20px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn.primary:hover { box-shadow: 0 14px 28px -12px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--on-status); }
.btn.danger:hover { box-shadow: 0 10px 22px -10px var(--bad); }
.btn.small { padding: 4px 12px; min-height: 30px; font-size: 12px; }
.btn.small.primary { min-height: 30px; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; transform: none; }
a.btn { text-decoration: none; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); box-shadow: none; }
.btn.big { min-height: 52px; padding: 12px 26px; font-size: 15.5px; }
#estop.danger { min-height: 40px; padding: 8px 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

/* segmented controls */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 14px; cursor: pointer; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 650; transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--card); color: var(--accent); box-shadow: 0 2px 8px -2px rgba(76, 29, 149, .22); }
.seg.big button { min-height: 42px; padding: 8px 18px; font-size: 14px; }

/* KPIs: each tile gets a thin brand stripe, cycling purple, blue and yellow */
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px 16px; box-shadow: var(--shadow);
  display: grid; gap: 3px; align-content: start; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand-purple); }
.kpi:nth-child(3n+2)::before { background: var(--brand-blue); }
.kpi:nth-child(3n)::before { background: var(--brand-yellow); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.kpi .value { font-size: 24px; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.kpi .sub { color: var(--muted); font-size: 12px; }
.equity-card { position: relative; overflow: hidden; }
.equity-card::before { content: ""; position: absolute; width: 360px; height: 360px; right: -120px; top: -180px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-yellow), transparent); pointer-events: none; }
.equity-card > * { position: relative; }
.equity-head { display: grid; gap: 2px; }
.equity-value { font-size: 44px; font-weight: 780; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 6px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 520px) { .equity-value { font-size: 34px; } }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-sm); border: 1px solid var(--line); }
.table-wrap.tall { max-height: 360px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 650; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.table tbody tr { transition: background-color .15s var(--ease); }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.wrap { white-space: normal; min-width: 220px; }
.table tr.dim td { color: var(--muted); }
.table tr.dim td .st { opacity: 1; }
.table td.empty { color: var(--muted); text-align: center; padding: 26px 10px; }
.table details summary { cursor: pointer; color: var(--text); }
.table details[open] summary { margin-bottom: 4px; }
.table details p { margin: 0; color: var(--muted); }

/* charts and their loading, empty and error states */
.chart-box { position: relative; height: 320px; }
.chart-box.short { height: 240px; }
.chart-box[data-state]::after { content: attr(data-msg); position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 13px; pointer-events: none; text-align: center; padding: 0 16px; }
.chart-box[data-state="loading"]::before { content: ""; position: absolute; inset: 12px 0 28px;
  border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 0, var(--chip) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.chart-box[data-state="error"]::after { color: var(--bad); }
.chart-box[data-state] canvas { visibility: hidden; }
.chart-note { margin: 12px 0 0; }
.chart-note .key { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; white-space: nowrap; }
.chart-note .key i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.explain { margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 16px; }
.explain summary { cursor: pointer; font-weight: 650; }
.explain ol { margin: 8px 0 4px; padding-left: 20px; display: grid; gap: 4px; }

/* risk usage bars (show the existing numbers, nothing new) */
.meter { display: block; width: 100%; min-width: 90px; height: 6px; border-radius: 99px; background: var(--chip); margin-top: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--good); transition: width .6s var(--ease); }
.meter i.warn { background: var(--warn); } .meter i.bad { background: var(--bad); }

/* strategies */
.strat { transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.strat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.strat h3 { margin: 0 0 4px; font-size: 16px; }
.strat dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 14px 0 0; }
.strat dt { color: var(--muted); } .strat dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.status { margin: 10px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-sm); font-size: 12px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; font-weight: 650; color: var(--muted); }
.switch input { width: 38px; height: 22px; appearance: none; -webkit-appearance: none; background: var(--line); border-radius: 99px;
  position: relative; cursor: pointer; margin: 0; transition: background .25s var(--ease); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch input:checked { background: var(--accent); background-image: var(--grad); }
.switch input:checked::after { transform: translateX(16px); }
.uploads { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.upload { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters select { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); min-height: 36px; }

footer { padding: 8px 0 24px; }

/* sign-in */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; display: grid; gap: 10px; padding: 34px 32px; box-shadow: var(--shadow-lg);
  border-radius: 28px; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; border-radius: 28px 28px 0 0;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue) 60%, var(--brand-yellow)); }
.login-card h1 { margin-top: 6px; font-size: 30px; letter-spacing: -.035em; }
.login-card label { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-weight: 550; }
.login-card input, .approval-form input { font: inherit; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); min-height: 46px; width: 100%; }
.login-card input:focus, .approval-form input:focus { background: var(--card); }
.login-card .btn.primary { margin-top: 6px; min-height: 50px; }
.login-links { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.login-card .badge.paper, .login-card .badge.test, .login-card .logo { justify-self: start; }

/* approvals */
.approvals { display: grid; gap: 16px; margin-top: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.approval { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: grid; gap: 8px; background: var(--card);
  scroll-margin-top: 80px; }
.approval dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; font-size: 12px; }
.approval dt { color: var(--muted); } .approval dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.approval-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.approval-form input { flex: 1 1 160px; width: auto; }
.approval.is-pending { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.approval.focus { box-shadow: 0 0 0 3px var(--accent); }
.approval-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.approval .impact { margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-sm); }
.approval-buttons { display: flex; gap: 8px; flex: 1 1 100%; }
.approval-buttons .btn { flex: 1; min-height: 48px; font-size: 16px; }
.st.pending { background: var(--warn); } .st.approved, .st.running { background: var(--accent); color: var(--on-accent); }
.st.completed { background: var(--good); } .st.rejected, .st.failed { background: var(--bad); }
.st.expired { background: var(--muted); }
.steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0; font-size: 11px; }
.steps li { padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.steps li.done { background: var(--good); color: var(--on-status); } .steps li.now { background: var(--accent); color: var(--on-accent); }
.steps li.end.rejected, .steps li.end.failed { background: var(--bad); color: var(--on-status); }
.steps li.end.expired { background: var(--muted); color: var(--on-status); }

/* views */
.view { display: grid; gap: 20px; min-width: 0; }
.view[hidden] { display: none; }
.callout { display: block; background: var(--warn); color: var(--on-status); padding: 14px 18px; border-radius: var(--r-md);
  font-weight: 700; text-decoration: none; }
.card.mini { color: inherit; text-decoration: none; display: grid; gap: 6px;
  transition: border-color .25s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease); }
.card.mini:hover { border-color: var(--accent-ring); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card.mini h3 { font-size: 13.5px; margin: 0; }
.card.mini .value { font-size: 26px; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.card.mini .card-head { margin-bottom: 4px; }
.sim-note { background: var(--grad-soft); border-color: var(--line); }
.sim-note p { margin: 0; color: var(--text); }
.sim-note .card-head { margin-bottom: 6px; }
.more-list { display: grid; gap: 10px; }
.more-list a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px; color: var(--text); text-decoration: none; font-weight: 650; box-shadow: var(--shadow);
  transition: transform .25s var(--ease), border-color .25s var(--ease); }
.more-list a:hover, .more-list a:active { transform: translateX(2px); border-color: var(--accent-ring); }
.more-list a::after { content: "›"; float: right; color: var(--accent); font-weight: 700; }

/* checks */
.checks { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); margin-top: 4px; flex: none; }
.dot.ok { background: var(--good); } .dot.fail { background: var(--bad); }

/* alerts centre */
.alert-list { display: grid; gap: 8px; }
.alert-item { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.alert-item .sev { margin-top: 1px; }
.alert-item .msg { overflow-wrap: anywhere; }
.alert-item time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sev { display: inline-flex; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.sev.error { background: var(--bad-bg); color: var(--bad); } .sev.warning { background: var(--warn-bg); color: var(--warn); }
.notify-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 4px; }
.notify-grid > div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface-2); }

/* limits form */
form.limits { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; background: var(--surface-2); }
form.limits h3 { margin: 0; font-size: 14px; }
form.limits label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
form.limits input { font: inherit; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card);
  color: var(--text); min-height: 44px; font-size: 16px; }

/* confirmation dialog */
dialog.ask { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: min(440px, calc(100vw - 32px));
  background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.ask[open] { animation: rise .35s var(--ease) both; }
dialog.ask::backdrop { background: rgba(23, 19, 58, .4); backdrop-filter: blur(4px); }
dialog.ask form { padding: 24px; display: grid; gap: 12px; margin: 0; }
dialog.ask h2 { font-size: 18px; }
dialog.ask p { margin: 0; color: var(--muted); white-space: pre-line; }
dialog.ask .row { justify-content: flex-end; margin-top: 6px; }

/* settings */
.settings-layout { display: grid; gap: 20px; }
.settings-nav { display: none; }
@media (min-width: 1200px) {
  .settings-layout { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
  .settings-nav { display: grid; gap: 2px; position: sticky; top: 92px; }
  .settings-nav button { text-align: left; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600;
    padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
  .settings-nav button:hover { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
  .settings-body { display: grid; gap: 20px; min-width: 0; }
}
.settings-body { display: grid; gap: 20px; min-width: 0; }
.settings-body > .card { scroll-margin-top: 92px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.danger-zone h2 { color: var(--bad); }
.danger-zone .zone { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.danger-zone .zone:first-of-type { border-top: 0; padding-top: 0; }
.danger-zone h3 { margin: 0; font-size: 14px; }
.danger-zone p { margin: 0; }
.trial-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--grad-soft); border: 1px solid var(--accent-ring); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; }
.trial-banner strong { font-size: 15px; }
.appearance { display: grid; gap: 14px; }
.appearance h3 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 650; }
.mode-tiles { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 150px)); }
.mode-tiles button { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card);
  color: var(--text); font: inherit; font-weight: 650; cursor: pointer; text-align: left; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.mode-tiles button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.mode-tiles .pv { display: block; height: 54px; border-radius: 10px; border: 1px solid #ece8f8; position: relative; overflow: hidden; }
.mode-tiles .pv::before { content: ""; position: absolute; left: 8px; top: 8px; width: 40%; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #7c3aed, #2563eb); }
.mode-tiles .pv::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 18px; border-radius: 6px; }
.mode-tiles .pv.light { background: #ffffff; } .mode-tiles .pv.light::after { background: #f7f5ff; }
.mode-tiles .pv.dark { background: #0d0b1f; border-color: #2b2650; } .mode-tiles .pv.dark::before { background: linear-gradient(90deg, #b79cff, #7fb0ff); }
.mode-tiles .pv.dark::after { background: #17142e; }
.mode-tiles .pv.system { background: linear-gradient(90deg, #ffffff 50%, #0d0b1f 50%); }
.mode-tiles .pv.system::after { background: linear-gradient(90deg, #f7f5ff 50%, #17142e 50%); }
.swatches { display: flex; flex-wrap: wrap; gap: 14px; }
.swatch { display: grid; justify-items: center; gap: 6px; padding: 4px; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; min-width: 64px; }
.swatch .dot { margin: 0; width: 34px; height: 34px; box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line); transition: transform .2s var(--ease); }
.swatch:hover .dot { transform: scale(1.08); }
.swatch[aria-pressed="true"] { color: var(--text); }
.swatch[aria-pressed="true"] .dot { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--text); }
.dot.aurora { background: conic-gradient(from 200deg, #7c3aed, #2563eb, #facc15, #7c3aed); }
.dot.ocean { background: #3478f6; } .dot.emerald { background: #059669; } .dot.violet { background: #7c3aed; }
.dot.sunset { background: #ea580c; } .dot.rose { background: #e11d48; } .dot.mono { background: #64748b; }

/* roles: the page starts with staff parts hidden until /api/session says who is signed in */
body:not([data-role]) .staff-only, body[data-role="customer"] .staff-only { display: none !important; }
body:not([data-role="customer"]) .customer-only { display: none !important; }
body[data-role="owner"] .customer-or-admin { display: none !important; }
body:not([data-role="owner"]) .owner-only { display: none !important; }
.pw-form { display: grid; gap: 10px; max-width: 440px; margin-top: 10px; }
.pw-form h3 { margin: 8px 0 0; font-size: 14px; }
.pw-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 550; }
.pw-form input, .pw-form select { font: inherit; font-size: 16px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); min-height: 44px; }

/* plans */
.plan-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 8px; }
.plan-grid > p { grid-column: 1 / -1; margin: 0; }
.plan-grid.compact { grid-template-columns: 1fr; gap: 6px; }
.plan { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: grid; gap: 6px; align-content: start; background: var(--card);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .2s var(--ease); }
.plan:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--grad-soft); }
.plan h4 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.plan .price { font-size: 22px; font-weight: 750; letter-spacing: -.025em; }
.plan .price small { font-size: 12px; font-weight: 400; color: var(--muted); }
.plan.compact-row { padding: 8px 12px; }
.plan .row { display: flex; gap: 6px; flex-wrap: wrap; }
.feature-list { margin: 4px 0; padding-left: 18px; }
.feature-list li.off { color: var(--muted); text-decoration: line-through; }
.plan-edit label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.plan-edit label.check { display: flex; gap: 6px; align-items: center; color: var(--text); }
.plan-edit input[type=number], .plan-edit input[type=text] { font: inherit; font-size: 16px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); width: 100%; box-sizing: border-box; }
.grant { display: inline-flex; gap: 4px; align-items: center; }
.grant select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.price-line { font-size: 18px; font-weight: 750; }

/* legal pages */
.legal { max-width: 760px; margin: 32px auto; padding: 36px 40px 52px; line-height: 1.7; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.legal h1 { font-size: 34px; letter-spacing: -.035em; } .legal h2 { font-size: 18px; margin-top: 30px; }
@media (max-width: 760px) { .legal { margin: 0; border-radius: 0; border: 0; padding: 22px 16px 40px; } }

/* public site (welcome page) */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 750; font-size: 17px;
  letter-spacing: -.02em; }
.logo img { border-radius: 9px; }
.site-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100% - 1160px) / 2)); background: var(--glass);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line); }
.site-nav { display: flex; gap: 6px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 6px 14px; border-radius: 999px;
  transition: background-color .2s var(--ease), color .2s var(--ease); }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-actions { display: flex; gap: 8px; }
.site-main { max-width: 1160px; margin: 0 auto; padding: 0 20px; display: block; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; padding: 88px 0 64px; }
.hero h1 { font-size: 64px; line-height: 1.02; margin: 20px 0 18px; letter-spacing: -.05em; color: var(--navy); font-weight: 800; }
.hero h1 .grad-text { padding-right: .04em; }
.hero h1 .mark { position: relative; white-space: nowrap; }
.hero h1 .mark::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: .06em; height: .26em; z-index: -1;
  border-radius: 6px; background: var(--brand-yellow); opacity: .75; }
.lead { font-size: 18.5px; line-height: 1.6; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.hero-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-visual { position: relative; }
.hero-visual::before { content: ""; position: absolute; inset: 8% -4% -6% 6%; border-radius: 40px; z-index: -1; filter: blur(40px);
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-blue) 55%, var(--brand-yellow)); opacity: .35; }
.mock { padding: 24px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; border-radius: 28px; animation: floaty 7s ease-in-out infinite; }
.mock-head { display: flex; justify-content: space-between; align-items: center; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-kpis div { display: grid; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.mock-kpis b { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mock-chart { width: 100%; height: 140px; }
.mock-chart polyline { fill: none; stroke: var(--accent-deco); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.mock-chart polyline.alt { stroke: var(--brand-blue); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; }
.mock-rows { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.mock-rows i { font-style: normal; margin-right: 6px; }
.site-section { padding: 64px 0; }
.site-section > h2, .section-head h2 { font-size: 40px; margin-bottom: 28px; letter-spacing: -.04em; color: var(--navy); font-weight: 780; line-height: 1.1; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.steps3 { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.steps3 .card { padding: 28px; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.steps3 .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.steps3 h3 { margin: 12px 0 8px; font-size: 18px; }
.steps3 p { margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-purple);
  color: #ffffff; font-weight: 750; font-size: 16px; box-shadow: 0 10px 20px -10px var(--brand-purple); }
.steps3 .card:nth-child(2) .step-n { background: var(--brand-blue); box-shadow: 0 10px 20px -10px var(--brand-blue); }
.steps3 .card:nth-child(3) .step-n { background: var(--brand-yellow); color: var(--on-yellow); box-shadow: 0 10px 20px -10px var(--brand-yellow); }
.facts { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
.facts div { display: grid; gap: 6px; padding: 20px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); border-top: 3px solid var(--brand-purple); }
.facts div:nth-child(2) { border-top-color: var(--brand-blue); }
.facts div:nth-child(3) { border-top-color: var(--brand-yellow); }
.facts div:nth-child(4) { border-top-color: var(--accent-2); }
.save { font-size: 11px; font-weight: 700; color: var(--on-yellow); margin-left: 6px; background: var(--brand-yellow); padding: 1px 7px; border-radius: 999px; }
.seg button.on .save { color: var(--on-yellow); }
.price-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 14px; }
.price-card { padding: 28px; display: grid; gap: 10px; align-content: start; position: relative;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.price-card.popular { border: 1px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, var(--brand-purple), var(--brand-blue) 60%, var(--brand-yellow)) border-box;
  box-shadow: var(--shadow-lg); }
.price-card .badge { justify-self: start; }
.price-card.popular > .badge.paper { position: absolute; top: -12px; left: 28px; background: var(--brand-yellow); color: var(--on-yellow); box-shadow: 0 6px 14px -6px rgba(180, 130, 0, .6); }
.price-card h3 { margin: 0; font-size: 19px; }
.price-card .amount { font-size: 42px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.price-card .amount small { font-size: 14px; font-weight: 450; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.price-card p { margin: 0; }
.price-card .btn { margin-top: 8px; }
.ticks { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 8px; }
.ticks li::before { content: "✓"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-right: 10px; }
.ticks li.off { color: var(--muted); }
.ticks li.off::before { content: "–"; background: var(--chip); color: var(--muted); }
.faq { display: grid; gap: 10px; max-width: 780px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease); }
.faq details[open] { box-shadow: var(--shadow); border-color: var(--accent-ring); }
.faq summary { font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 10px 0 0; }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 44px 48px;
  margin: 32px 0 16px; border: 0; border-radius: 32px; color: #ffffff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #6d28d9 0%, #4338ca 50%, #2563eb 100%); box-shadow: var(--shadow-lg); }
.cta-band::after { content: ""; position: absolute; width: 320px; height: 320px; right: -60px; bottom: -180px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(250, 204, 21, .55), transparent); pointer-events: none; }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { margin: 0 0 6px; font-size: 32px; color: #ffffff; letter-spacing: -.035em; }
.cta-band p, .cta-band .muted { margin: 0; color: rgba(255, 255, 255, .88); }
.cta-band .btn.primary { background: #ffffff; color: #4c1d95; box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .35); }
.site-foot { max-width: 1160px; margin: 0 auto; padding: 28px 20px 44px; border-top: 1px solid var(--line); }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.foot-links a { color: var(--muted); }
.app-logo { border-radius: 8px; flex: none; }

@media (max-width: 1100px) {
  .hero h1 { font-size: 52px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 44px 0 24px; gap: 36px; }
  .hero h1 { font-size: 42px; }
  .site-section { padding: 44px 0; }
  .site-section > h2, .section-head h2 { font-size: 30px; }
  .steps3 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .site-nav { display: none; }
  .cta-band { padding: 32px 26px; }
  .cta-band h2 { font-size: 26px; }
}
@media (max-width: 600px) {
  main { padding: 14px; gap: 16px; }
  .view { gap: 16px; }
  .card { padding: 18px; border-radius: 18px; }
  .kpis { gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 14px 12px; }
  .kpi .value { font-size: 19px; }
  .chart-box { height: 260px; }
  .mode-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .login-card { padding: 28px 22px; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 36px; }
  .lead { font-size: 16.5px; }
  .site-actions .btn.ghost { display: none; }
  .facts { grid-template-columns: 1fr; }
  .site-top .btn { min-height: 40px; padding: 6px 14px; }
  .mock { padding: 18px; }
  .mock-kpis { gap: 6px; } .mock-kpis div { padding: 6px 8px; } .mock-kpis b { font-size: 13px; }
}

/* tablets: one tidy header row, a centred pill row of sections, KPIs three across */
@media (min-width: 761px) and (max-width: 1023px) {
  .top { flex-wrap: nowrap; }
  .top-right #worker { display: none; }   /* the System screen carries it */
  .tabs { position: sticky; top: 0; z-index: 4; justify-content: center; background: var(--glass);
    backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); }
  .tabs a { padding: 6px 12px 6px 6px; gap: 6px; border-radius: 999px; }
  .tabs a.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
  .tabs a.on .ico { background: var(--grad); color: #ffffff; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* phones: floating tab bar at the bottom, thumb-sized targets */
@media (max-width: 760px) {
  .top { padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); flex-wrap: nowrap; gap: 8px; }
  .brand { flex-direction: column; align-items: flex-start; flex-wrap: nowrap; gap: 3px; min-width: 0; }
  .top h1 { font-size: 20px; max-width: 100%; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .badge.paper { font-size: 9.5px; padding: 0 7px; line-height: 16px; }
  .top-right #worker, #dataMode { display: none; }   /* the simulated-data notice and System screen carry these */
  .top-right { flex-wrap: nowrap; flex: none; }
  #estop, #estop.danger { min-height: 36px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
  .tabs { position: fixed; top: auto; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    justify-content: space-around; overflow: visible; border: 1px solid var(--line); border-radius: 24px; padding: 6px; gap: 2px;
    background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
    box-shadow: 0 16px 36px -14px rgba(30, 27, 75, .35); }
  .tabs a { flex: 1; flex-direction: column; gap: 2px; font-size: 11px; padding: 5px 2px; min-width: 0; border-radius: 18px; position: relative; }
  .tabs a.on { background: transparent; color: var(--accent); }
  .tabs a.on .ico { background: var(--grad); color: #ffffff; box-shadow: 0 6px 14px -6px var(--accent); }
  .tabs .ico { font-size: 16px; width: 40px; height: 28px; border-radius: 999px; }
  .tabs a:not(.primary):not(.more-tab) { display: none; }
  .tabs .more-tab { display: flex; }
  .tabs .count { position: absolute; top: 0; right: calc(50% - 26px); }
  main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .approvals { grid-template-columns: 1fr; }
  .approval dl { grid-template-columns: 1fr; }
  .approval dt { margin-top: 4px; }
  .approval-form input { font-size: 16px; } /* stops iOS zooming into the field */
  .btn { min-height: 44px; }
  .app-logo { display: none; }
  .alert-item { grid-template-columns: auto 1fr; }
  .alert-item time { grid-column: 2; }
}

/* ===== Bold layer: big colour panels, bento tiles, scroll reveals (the "Framer" feel) ===== */
:root {
  --mesh:
    radial-gradient(55% 75% at 12% 18%, rgba(167, 139, 250, .95) 0%, transparent 62%),
    radial-gradient(50% 70% at 88% 12%, rgba(59, 130, 246, .95) 0%, transparent 60%),
    radial-gradient(28% 45% at 92% 96%, rgba(250, 204, 21, .9) 0%, transparent 70%),
    radial-gradient(45% 60% at 30% 105%, rgba(99, 102, 241, .9) 0%, transparent 65%),
    linear-gradient(135deg, #5b21b6 0%, #4338ca 50%, #1d4ed8 100%);
}
@keyframes drift { 0%, 100% { background-position: 0% 0%, 100% 0%, 100% 100%, 0% 100%, 0 0; }
  50% { background-position: 6% 4%, 94% 6%, 96% 92%, 4% 96%, 0 0; } }

/* headings and page title read like a landing page */
.top h1 { font-size: 30px; letter-spacing: -.04em; font-weight: 800; }
.card-head h2 { font-size: 18px; letter-spacing: -.025em; font-weight: 750; }

/* dashboard hero: the equity card opens with a colour panel */
.equity-card { padding: 0; border: 0; box-shadow: var(--shadow-lg); }
.equity-card::before { display: none; }
.equity-card .card-head { margin: 0; padding: 30px 32px 34px; color: #ffffff; background: var(--mesh); background-size: 140% 140%, 140% 140%, 120% 120%, 140% 140%, 100% 100%;
  animation: drift 16s ease-in-out infinite; border-radius: var(--r-lg) var(--r-lg) 0 0; position: relative; overflow: hidden; }
.equity-card .card-head::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 40%); }
.equity-card .card-head h2 { color: rgba(255, 255, 255, .9); font-size: 15px; font-weight: 650; letter-spacing: 0; }
.equity-card .card-head .muted { color: rgba(255, 255, 255, .82); }
.equity-card .equity-value { font-size: 64px; font-weight: 800; letter-spacing: -.05em; background: none; color: #ffffff; -webkit-background-clip: border-box; background-clip: border-box; }
.equity-card .equity-head .small { color: rgba(255, 255, 255, .9); font-size: 13.5px; }
.equity-card .equity-head .good { color: #bbf7d0; } .equity-card .equity-head .bad { color: #fecaca; }
.equity-card .chart-box { margin: 22px 26px 0; }
.equity-card .chart-note { padding: 0 26px 22px; }
@media (max-width: 600px) {
  .equity-card .card-head { padding: 22px 20px 26px; }
  .equity-card .equity-value { font-size: 44px; }
  .equity-card .chart-box { margin: 16px 14px 0; }
  .equity-card .chart-note { padding: 0 16px 16px; }
}

/* KPIs as a bento grid: the profit tile is the big one */
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(118px, auto); }
.kpis .kpi:first-child { grid-column: span 2; grid-row: span 2; align-content: space-between; padding: 26px 28px;
  background: radial-gradient(70% 90% at 100% 0%, color-mix(in srgb, var(--brand-yellow) 30%, transparent), transparent 70%),
    radial-gradient(60% 80% at 0% 100%, color-mix(in srgb, var(--brand-purple) 14%, transparent), transparent 70%), var(--card); }
.kpis .kpi:first-child .value { font-size: 56px; letter-spacing: -.05em; font-weight: 800; line-height: 1.05; }
.kpis .kpi:first-child .label { font-size: 14px; }
.kpis .kpi:first-child .sub { font-size: 14px; }
.kpis .kpi:only-child { grid-row: auto; }
.kpi::before { height: 4px; }
@media (max-width: 1023px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis .kpi:first-child { grid-row: auto; } }
@media (max-width: 600px) { .kpis .kpi:first-child .value { font-size: 40px; } .kpis .kpi:first-child { padding: 20px; } }

/* strategy tiles: each wears one brand colour */
.grid3 > .card.mini { position: relative; overflow: hidden; padding-top: 26px; }
.grid3 > .card.mini::before { content: ""; position: absolute; width: 180px; height: 180px; right: -60px; top: -70px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-purple) 22%, transparent), transparent); pointer-events: none; }
.grid3 > .card.mini:nth-child(2)::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-blue) 22%, transparent), transparent); }
.grid3 > .card.mini:nth-child(3)::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-yellow) 40%, transparent), transparent); }
.grid3 > .card.mini .value { font-size: 34px; font-weight: 800; letter-spacing: -.04em; }

/* cards reveal as they scroll into view, where the browser supports it */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .site-section .card, .facts > div, .price-card, .faq details {
      animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  }
}

/* sign-in: the card floats on a colour field */
body.login-page::before { background: var(--mesh); background-size: 140% 140%, 140% 140%, 120% 120%, 140% 140%, 100% 100%; animation: drift 18s ease-in-out infinite; }
body.login-page .login-card { box-shadow: 0 40px 80px -24px rgba(30, 27, 75, .55); }
body.login-page .login-card::before { display: none; }

/* welcome page: the hero is a big rounded colour panel with white type */
.hero { position: relative; margin-top: 28px; padding: 84px 64px 72px; border-radius: 40px; color: #ffffff; overflow: hidden; isolation: isolate;
  background: var(--mesh); background-size: 140% 140%, 140% 140%, 120% 120%, 140% 140%, 100% 100%; animation: drift 18s ease-in-out infinite;
  box-shadow: 0 50px 100px -40px rgba(76, 29, 149, .6); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent); mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent); }
.hero h1 { color: #ffffff; font-size: 76px; letter-spacing: -.055em; }
.hero h1 .grad-text { background: linear-gradient(90deg, #fde68a, #facc15); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .mark::after { display: none; }
.hero .lead { color: rgba(255, 255, 255, .88); }
.hero .muted { color: rgba(255, 255, 255, .78); }
.hero .badge.paper { background: rgba(255, 255, 255, .16); color: #ffffff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hero .btn.primary { background: #ffffff; color: #4c1d95; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .4); }
.hero .btn.ghost { color: #ffffff; border-color: rgba(255, 255, 255, .4); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .7); }
.hero-visual::before { display: none; }
.hero .mock { color: var(--text); transform: perspective(1200px) rotateY(-8deg) rotateX(4deg); animation: none;
  box-shadow: 0 40px 80px -24px rgba(15, 10, 50, .55); transition: transform .6s var(--ease); }
.hero .mock:hover { transform: perspective(1200px) rotateY(0) rotateX(0); }
.site-section > h2, .section-head h2 { font-size: 52px; letter-spacing: -.05em; font-weight: 800; }

/* how it works: huge gradient numerals */
.step-n { width: auto; height: auto; background: none !important; box-shadow: none !important; border-radius: 0; font-size: 64px; font-weight: 800;
  letter-spacing: -.05em; line-height: 1; color: transparent !important; -webkit-background-clip: text !important; background-clip: text !important;
  background-image: linear-gradient(135deg, var(--brand-purple), var(--brand-blue)) !important; }
.steps3 .card:nth-child(3) .step-n { background-image: linear-gradient(135deg, #f59e0b, var(--brand-yellow)) !important; }

/* honest simulation: a bento of solid colour tiles */
.facts { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(150px, auto); }
.facts div { border: 0; padding: 28px; border-radius: 28px; align-content: end; font-size: 15px; }
.facts div b { font-size: 22px; letter-spacing: -.03em; }
.facts div:nth-child(1) { grid-column: span 2; background: var(--mesh); color: #ffffff; }
.facts div:nth-child(1) .muted { color: rgba(255, 255, 255, .85); }
.facts div:nth-child(2) { background: var(--brand-yellow); color: var(--on-yellow); }
.facts div:nth-child(2) .muted { color: rgba(42, 31, 0, .78); }
.facts div:nth-child(3) { background: var(--surface-2); border: 1px solid var(--line); }
.facts div:nth-child(4) { grid-column: span 2; background: linear-gradient(120deg, #1d4ed8, #2563eb 60%, #3b82f6); color: #ffffff; }
.facts div:nth-child(4) .muted { color: rgba(255, 255, 255, .85); }

@media (max-width: 1100px) { .hero h1 { font-size: 60px; } }
@media (max-width: 860px) {
  .hero { padding: 48px 28px 40px; border-radius: 32px; }
  .hero h1 { font-size: 48px; }
  .hero .mock { transform: none; }
  .site-section > h2, .section-head h2 { font-size: 38px; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .hero { margin-top: 14px; padding: 36px 20px 28px; border-radius: 28px; }
  .hero h1 { font-size: 40px; }
  .facts { grid-template-columns: 1fr; }
  .facts div:nth-child(1), .facts div:nth-child(4) { grid-column: auto; }
}
