/* ============================================================
   SCR — Supply Chain Resilience Command Center · Design System
   "Signal" — editorial ink on paper with one loud colour.

   · Type — Montserrat, semibold display with tight tracking,
     medium body. Numbers are tabular.
   · Colour — ink (#111013) leads, signal yellow (#fac400)
     answers: it marks what matters (highlighter under key
     phrases, the active item, focus, the agentic layer).
   · Surfaces — paper canvas, white cards on hairlines, dark
     "chrome" panels for the moments that set the scene.
   · Motion — things arrive as you reach them (reveal, count-up,
     highlighter sweep); controls answer with a yellow wipe and
     a ↗ that slips out and back; marquees carry live signals.

   Categorical chart palette (fixed order):
   ink → yellow → coral → slate → teal → violet → blue → sand
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

@property --ai-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  color-scheme: light;

  /* ---- Canvas & surfaces (light) ---- */
  --page: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --surface-3: #ececea;
  --border: rgba(17, 16, 19, 0.08);
  --border-strong: rgba(17, 16, 19, 0.16);
  --separator: rgba(17, 16, 19, 0.085);
  --fill: rgba(136, 135, 140, 0.17);
  --fill-2: rgba(136, 135, 140, 0.105);
  --fill-3: rgba(136, 135, 140, 0.06);
  --shadow: 0 0 0 1px rgba(17, 16, 19, 0.06), 0 1px 2px rgba(17, 16, 19, 0.04);
  --shadow-hover: 0 0 0 1px rgba(17, 16, 19, 0.09), 0 22px 44px -18px rgba(17, 16, 19, 0.24);
  --shadow-lg: 0 0 0 1px rgba(17, 16, 19, 0.07), 0 28px 64px -18px rgba(17, 16, 19, 0.30);

  /* ---- Ink ---- */
  --ink: #111013;
  --ink-2: #3a393f;
  --ink-3: #6b6970;
  --ink-4: #9c9aa2;
  --grid: rgba(17, 16, 19, 0.06);
  --axis: rgba(17, 16, 19, 0.16);

  /* ---- Signal yellow (the one loud colour) ---- */
  --brand: #fac400;
  --brand-deep: #e3ad00;
  --brand-soft: rgba(250, 196, 0, 0.18);
  --brand-wash: rgba(250, 196, 0, 0.09);
  --brand-text: #8a6500;          /* yellow-family text that passes on white */
  --on-brand: #111013;

  /* ---- Interaction: ink leads, yellow answers ---- */
  --accent: #111013;               /* selected fills (chips, tabs, hits) */
  --accent-strong: #111013;        /* link / emphasis text */
  --accent-deep: #000000;
  --accent-soft: rgba(250, 196, 0, 0.18);
  --accent-ink: #ffffff;           /* text on --accent */
  --cta-bg: #111013;               /* primary buttons */
  --cta-ink: #ffffff;
  --cta-wipe: #fac400;             /* the hover wipe */
  --cta-wipe-ink: #111013;
  --range: #111013;

  /* ---- Floating chrome ---- */
  --glass: rgba(255, 255, 255, 0.82);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --glass-thin: rgba(255, 255, 255, 0.6);
  --glass-edge: rgba(17, 16, 19, 0.08);
  --glass-hair: rgba(17, 16, 19, 0.07);
  --glass-filter: blur(18px) saturate(150%);
  --glass-shadow: 0 0 0 1px rgba(17, 16, 19, 0.07), 0 10px 30px -12px rgba(17, 16, 19, 0.22);

  /* ---- Sidebar (an ink rail in both themes) ---- */
  --side-bg: #111013;
  --side-ink: #f4f3f0;
  --side-muted: rgba(244, 243, 240, 0.56);
  --side-faint: rgba(244, 243, 240, 0.36);
  --side-hover: rgba(255, 255, 255, 0.06);
  --side-active: rgba(255, 255, 255, 0.09);
  --side-line: rgba(255, 255, 255, 0.08);

  /* ---- App bar ---- */
  --bar-bg: rgba(244, 244, 242, 0.84);
  --bar-ink: #111013;
  --bar-muted: #6b6970;
  --bar-border: rgba(17, 16, 19, 0.08);
  --bar-hover: rgba(136, 135, 140, 0.14);
  --bar-field-bg: #ffffff;
  --bar-field-border: rgba(17, 16, 19, 0.14);

  /* ---- Signature table header ---- */
  --thead-bg: #111013;
  --thead-ink: #ffffff;

  /* ---- Status / severity (warm ramp, kept apart from the brand yellow) ---- */
  --status-good: #1f9d5c;
  --status-warning: #f29e1f;
  --status-serious: #f2622e;
  --status-critical: #e0302b;
  --status-good-soft: rgba(31, 157, 92, 0.13);
  --status-warning-soft: rgba(242, 158, 31, 0.16);
  --status-serious-soft: rgba(242, 98, 46, 0.13);
  --status-critical-soft: rgba(224, 48, 43, 0.11);
  --good-text: #187a47;
  --warn-text: #9a5800;
  --serious-text: #b13c0b;
  --crit-text: #c0221b;

  /* ---- Categorical series (fixed order) ---- */
  --series-1: #111013;  /* ink    */
  --series-2: #fac400;  /* yellow */
  --series-3: #ff6b3d;  /* coral  */
  --series-4: #8a8791;  /* slate  */
  --series-5: #23a094;  /* teal   */
  --series-6: #7c5ce0;  /* violet */
  --series-7: #3478f6;  /* blue   */
  --series-8: #c4b185;  /* sand   */

  /* ---- Intelligence (the agentic layer wears the signal) ---- */
  --ai-c1: #fac400;
  --ai-c2: #ffe27a;
  --ai-c3: #ff9f1a;
  --ai-c4: #fff4c2;
  --ai-grad: linear-gradient(90deg, #fac400, #ffd84a 50%, #f5a400);
  --ai-conic: conic-gradient(from var(--ai-angle), rgba(250, 196, 0, 0) 0deg, rgba(250, 196, 0, 0) 210deg, #fac400 312deg, #fff1b0 336deg, rgba(250, 196, 0, 0) 360deg);
  --ai-wash: linear-gradient(115deg, rgba(250, 196, 0, 0.15), rgba(250, 196, 0, 0.06) 55%, rgba(250, 196, 0, 0.03));
  --ai-glow-opacity: 0.32;
  --orb-bg: #111013;
  --orb-ink: #fac400;

  /* ---- Shape & type ---- */
  --radius: 16px;
  --radius-lg: 22px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --font: "Montserrat", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Montserrat", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-rounded: "Montserrat", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---- Motion ---- */
  --ease: cubic-bezier(.645, .045, .355, 1);      /* in-out cubic — the house curve */
  --ease-out: cubic-bezier(.22, .8, .24, 1);
  --ease-hl: cubic-bezier(.25, .1, .25, 1);        /* highlighter sweep */
  --ease-rv: cubic-bezier(.16, .84, .3, 1);        /* arrivals */
  --spring: cubic-bezier(.34, 1.36, .64, 1);

  --appbar-h: 60px;
  --side-w: 256px;
  --content-w: 1560px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --page: #0a0a0b;
  --surface: #151417;
  --surface-2: #1b1a1e;
  --surface-3: #242328;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --separator: rgba(255, 255, 255, 0.085);
  --fill: rgba(160, 158, 170, 0.26);
  --fill-2: rgba(160, 158, 170, 0.16);
  --fill-3: rgba(160, 158, 170, 0.09);
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.065);
  --shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 24px 50px -16px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 30px 70px -16px rgba(0, 0, 0, 0.85);

  --ink: #f4f3f0;
  --ink-2: #d3d1d7;
  --ink-3: #9b99a2;
  --ink-4: #6d6b74;
  --grid: rgba(255, 255, 255, 0.07);
  --axis: rgba(255, 255, 255, 0.18);

  --brand-soft: rgba(250, 196, 0, 0.17);
  --brand-wash: rgba(250, 196, 0, 0.08);
  --brand-text: #fac400;

  --accent: #fac400;
  --accent-strong: #fac400;
  --accent-deep: #ffd84a;
  --accent-soft: rgba(250, 196, 0, 0.15);
  --accent-ink: #111013;
  --cta-bg: #fac400;
  --cta-ink: #111013;
  --cta-wipe: #ffffff;
  --cta-wipe-ink: #111013;
  --range: #fac400;

  --glass: rgba(21, 20, 23, 0.82);
  --glass-strong: rgba(24, 23, 27, 0.95);
  --glass-thin: rgba(36, 35, 40, 0.6);
  --glass-edge: rgba(255, 255, 255, 0.09);
  --glass-hair: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 36px -12px rgba(0, 0, 0, 0.7);

  --side-bg: #111013;
  --side-line: rgba(255, 255, 255, 0.07);

  --bar-bg: rgba(10, 10, 11, 0.82);
  --bar-ink: #f4f3f0;
  --bar-muted: #9b99a2;
  --bar-border: rgba(255, 255, 255, 0.08);
  --bar-hover: rgba(160, 158, 170, 0.2);
  --bar-field-bg: #151417;
  --bar-field-border: rgba(255, 255, 255, 0.14);

  --thead-bg: #26252a;
  --thead-ink: #f4f3f0;

  --status-good: #3cc47a;
  --status-warning: #ffb347;
  --status-serious: #ff7a45;
  --status-critical: #ff5a4e;
  --status-good-soft: rgba(60, 196, 122, 0.16);
  --status-warning-soft: rgba(255, 179, 71, 0.16);
  --status-serious-soft: rgba(255, 122, 69, 0.16);
  --status-critical-soft: rgba(255, 90, 78, 0.17);
  --good-text: #4fd08a;
  --warn-text: #ffbe5c;
  --serious-text: #ff8b5c;
  --crit-text: #ff7369;

  --series-1: #f2f1ee;
  --series-2: #fac400;
  --series-3: #ff7a50;
  --series-4: #9e9ba7;
  --series-5: #34bfaf;
  --series-6: #9a80f5;
  --series-7: #4c8dff;
  --series-8: #b8a57c;

  --ai-wash: linear-gradient(115deg, rgba(250, 196, 0, 0.14), rgba(250, 196, 0, 0.05) 55%, rgba(250, 196, 0, 0.02));
  --ai-glow-opacity: 0.45;
  --orb-bg: #fac400;
  --orb-ink: #111013;
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "lnum" 1;
  overflow: hidden;
}
svg { display: block; }
button { font-family: inherit; cursor: pointer; letter-spacing: inherit; font-weight: inherit; }
input, select, textarea { font-family: inherit; letter-spacing: inherit; }
::selection { background: var(--brand); color: #111013; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px rgba(250, 196, 0, 0.45); }
[data-theme="dark"] :focus-visible { outline-color: var(--brand); box-shadow: 0 0 0 6px rgba(250, 196, 0, 0.22); }

/* ============================================================
   Signal primitives — shared by the chooser, web and mobile
   ============================================================ */

/* Highlighter: a yellow bar under the phrase that matters. It sweeps in
   when it arrives (.hl-sweep → .in), and floods the word on hover. */
.hl, .ai-text {
  background-image: linear-gradient(var(--hl, var(--brand)), var(--hl, var(--brand)));
  background-repeat: no-repeat;
  background-position: 0 90%;
  background-size: 100% 0.3em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .6s var(--ease-hl);
  padding: 0 .04em;
}
.hl.hl-sweep:not(.in), .ai-text.hl-sweep:not(.in) { background-size: 0% 0.3em; }
.hl.hl-fill:hover { background-size: 100% 100%; transition-duration: .35s; }
.dot-y { color: var(--brand); }

/* Kicker: the small line above a heading */
.kicker { display: inline-block; font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }

/* Primary call to action — ink with a yellow wipe and a ↗ that slips out and back */
.neo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 18px 0 20px;
  border-radius: 8px; border: 1.5px solid transparent;
  background-color: var(--cta-bg); color: var(--cta-ink);
  background-image: linear-gradient(var(--cta-wipe), var(--cta-wipe));
  background-repeat: no-repeat; background-position: 0 0; background-size: 0% 100%;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  transition: background-size .5s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .2s var(--ease-out);
}
.neo-btn:hover { background-size: 100% 100%; color: var(--cta-wipe-ink); }
.neo-btn:active { transform: scale(.98); }
.neo-btn.ghost { background-color: transparent; color: var(--ink); border-color: var(--border-strong); }
.neo-btn.ghost:hover { color: #111013; border-color: var(--brand); background-image: linear-gradient(var(--brand), var(--brand)); }
.neo-btn.on-dark { background-color: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); background-image: linear-gradient(var(--brand), var(--brand)); }
.neo-btn.on-dark:hover { color: #111013; border-color: var(--brand); }
.neo-btn.yellow { background-color: var(--brand); color: #111013; background-image: linear-gradient(#fff, #fff); }
.neo-btn.sm { height: 38px; padding: 0 13px 0 15px; font-size: 13.5px; gap: 8px; }
.go-ic { width: 17px; height: 17px; flex-shrink: 0; overflow: hidden; display: inline-grid; place-items: center; }
.go-ic svg { width: 17px; height: 17px; }
.neo-btn:hover .go-ic svg, .btn:hover .go-ic svg, a:hover > .go-ic svg, button:hover > .go-ic svg { animation: goSlip .5s var(--ease-out); }
@keyframes goSlip {
  0% { transform: none; }
  32% { transform: translate(110%, -110%); opacity: 0; }
  33% { transform: translate(-110%, 110%); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* Marquee: live signals that never stop moving (pause on hover) */
.ticker {
  --dur: 48s;
  position: relative; overflow: hidden;
  background: #111013; color: #f4f3f0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
[data-theme="dark"] .ticker { background: #18171b; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.ticker-track { display: flex; width: max-content; animation: tickerMove var(--dur) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-seq { display: flex; align-items: center; flex-shrink: 0; }
.tk-item {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 0 20px; height: 44px; white-space: nowrap;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  background: none; border: none; color: inherit; cursor: pointer;
}
.tk-item:hover { color: var(--brand); }
.tk-item b { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.tk-item small { font-size: 12.5px; font-weight: 500; color: rgba(244, 243, 240, 0.58); }
.tk-sev { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tk-sep { width: 12px; height: 12px; color: var(--brand); flex-shrink: 0; }
.tk-label {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 2;
  display: inline-flex; align-items: center; gap: 9px; padding: 0 16px;
  background: #111013; box-shadow: 18px 0 18px -4px #111013, inset -1px 0 0 rgba(250, 196, 0, 0.35);
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
}
[data-theme="dark"] .tk-label { background: #18171b; box-shadow: 18px 0 18px -4px #18171b, inset -1px 0 0 rgba(250, 196, 0, 0.35); }
.ticker.has-label { -webkit-mask-image: linear-gradient(90deg, #000, #000 95%, transparent); mask-image: linear-gradient(90deg, #000, #000 95%, transparent); }

@keyframes tickerMove { to { transform: translate3d(-50%, 0, 0); } }

/* Arrivals: blocks rise into place as they reach the viewport (JS adds .rv) */
.rv { opacity: 0; }
.rv.rv-in { animation: rvIn .85s var(--ease-rv) var(--rv-d, 0s) both; }
@keyframes rvIn { from { opacity: 0; transform: translate3d(0, 26px, 0); } to { opacity: 1; transform: none; } }

/* The pointer companion: a dot that sticks and a ring that follows */
.cur { position: fixed; left: 0; top: 0; z-index: 10000; pointer-events: none; border-radius: 50%; opacity: 0; will-change: transform; }
.cur.on { opacity: 1; }
.cur-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--brand); transition: opacity .2s, width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease); }
.cur-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid color-mix(in srgb, var(--brand) 80%, transparent);
  transition: opacity .2s, width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background-color .3s, border-color .3s;
}
.cur-ring.is-link { width: 58px; height: 58px; margin: -29px 0 0 -29px; background-color: rgba(250, 196, 0, 0.16); border-color: rgba(250, 196, 0, 0.0); }
.cur-dot.is-link { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; opacity: .7; }
.cur-ring.is-chart { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-color: rgba(250, 196, 0, 0.7); }
.cur-dot.is-chart { opacity: 0; }
.cur.is-text, .cur.is-off { opacity: 0 !important; }
.cur-ring.is-touch {
  width: 42px; height: 42px; margin: -21px 0 0 -21px;
  background-color: rgba(120, 120, 128, 0.32); border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); transition: width .18s, height .18s, margin .18s, background-color .18s;
}
.cur-ring.is-touch.is-down { width: 34px; height: 34px; margin: -17px 0 0 -17px; background-color: rgba(120, 120, 128, 0.5); }
.cur-dot.is-touch { opacity: 0; }
html.cur-touch .screen, html.cur-touch .screen * { cursor: none !important; }

/* Route line: a yellow stroke across the top when a page changes */
.route-line { position: absolute; top: calc(var(--appbar-h) - 2px); left: 0; height: 2px; width: 0; background: var(--brand); z-index: 75; pointer-events: none; opacity: 0; }
.route-line.run { animation: routeRun .9s var(--ease) forwards; }
@keyframes routeRun { 0% { width: 0; opacity: 1; } 70% { width: 100%; opacity: 1; } 100% { width: 100%; opacity: 0; } }

/* Dark chrome: the scene-setting panels. Curved light ridges over ink read
   as folds of liquid metal; the whole field drifts very slowly. */
.chrome-field {
  position: absolute; inset: -18%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(42% 30% at 88% 24%, rgba(255, 255, 255, 0.16), transparent 72%),
    radial-gradient(86% 56% at 80% 112%, transparent 0 47%, rgba(255, 255, 255, 0.5) 52.5%, rgba(255, 255, 255, 0) 58%),
    radial-gradient(70% 46% at 102% 16%, transparent 0 49%, rgba(226, 226, 236, 0.38) 54%, transparent 60%),
    radial-gradient(56% 40% at 108% 64%, transparent 0 50%, rgba(250, 196, 0, 0.42) 55%, transparent 61%),
    radial-gradient(120% 74% at 36% 146%, transparent 0 55%, rgba(255, 255, 255, 0.2) 59.5%, transparent 66%),
    radial-gradient(64% 52% at 70% 40%, transparent 0 56%, rgba(255, 255, 255, 0.12) 60%, transparent 66%),
    radial-gradient(60% 70% at 92% 90%, rgba(250, 196, 0, 0.10), transparent 70%),
    #0b0b0c;
  filter: blur(7px);
  animation: chromeDrift 26s ease-in-out infinite alternate;
  transform-origin: 70% 50%;
}
@keyframes chromeDrift {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(4deg) scale(1.06) translate3d(-1.5%, 1%, 0); }
  100% { transform: rotate(-3deg) scale(1.03) translate3d(1.5%, -1%, 0); }
}

/* ============================================================
   App shell
   ============================================================ */
.shell { display: flex; height: 100vh; position: relative; background: var(--page); }

/* Floating surfaces share one material */
.global-search, .search-results, .persona-menu, .notif-panel, .refresh-tip, .drawer, .copilot, .toast {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
}

/* ============ Toolbar ============ */
.appbar {
  position: absolute; top: 0; left: 0; right: 0;
  height: var(--appbar-h);
  color: var(--bar-ink);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px 0 14px;
  z-index: 60;
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--bar-border);
}

/* Brand lives at the top of the sidebar */
.side-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; padding: 16px 16px 14px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; }
.brand-mark svg { width: 36px; height: 36px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; transition: opacity .2s ease; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; letter-spacing: -0.03em; white-space: nowrap; color: var(--side-ink); }
.brand-cap { font-size: 11.5px; color: var(--side-muted); font-weight: 500; white-space: nowrap; }

.global-search {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  border-radius: 8px;
  padding: 0 12px;
  width: min(360px, 30vw);
  height: 40px;
  color: var(--bar-muted);
  background: var(--bar-field-bg);
  border-color: var(--bar-field-border);
  box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: width .4s var(--ease), border-color .2s, box-shadow .2s;
}
.global-search:focus-within {
  width: min(460px, 38vw);
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(250, 196, 0, 0.35);
}
.global-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.global-search input { border: none; outline: none; background: transparent; color: var(--bar-ink); font-size: 14px; font-weight: 500; width: 100%; }
.global-search input::placeholder { color: var(--bar-muted); }
.global-search kbd, .kbd {
  font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--ink-3); background: var(--fill-2);
  border-radius: 5px; padding: 1px 6px; flex-shrink: 0;
}
.search-results {
  display: none;
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  min-width: 400px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  max-height: 440px; overflow-y: auto;
  z-index: 90;
  color: var(--ink);
  padding: 6px;
  transform-origin: top center;
}
.search-results.open { display: block; animation: popIn .3s var(--ease-out); }
.search-hit {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  background: none; border: none; border-radius: 9px;
  color: var(--ink); font-size: 14px; font-weight: 600; text-align: left;
  transition: background .15s, color .15s;
}
.search-hit:hover, .search-hit.kb { background: var(--brand); color: #111013; }
.search-hit:hover .cell-sub, .search-hit:hover .hit-type,
.search-hit.kb .cell-sub, .search-hit.kb .hit-type { color: rgba(17, 16, 19, 0.72); }
.search-hit .hit-type { font-size: 11.5px; font-weight: 600; color: var(--ink-3); width: 64px; flex-shrink: 0; }
.search-hit .cell-sub { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-top: 1px; }
.search-ask:not(:first-child) { margin-top: 4px; box-shadow: 0 -5px 0 -4px var(--separator); }
.search-ask .hit-type { color: var(--brand-text); font-weight: 700; }

.appbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; }
.tb-group { display: flex; align-items: center; gap: 2px; }
.refresh-ic { position: relative; }
.refresh-tip {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 270px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  color: var(--ink-2);
  font-size: 13px; line-height: 1.55;
  z-index: 96;
}
.refresh-tip strong { color: var(--ink); }
.refresh-ic:hover .refresh-tip { display: block; animation: popIn .22s var(--ease-out); }
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent; border: none;
  border-radius: 8px; color: var(--bar-ink);
  position: relative;
  transition: background .2s var(--ease), color .2s, transform .15s var(--ease-out);
}
.icon-btn:hover { background: var(--bar-hover); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 18px; height: 18px; }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--status-critical);
  box-shadow: 0 0 0 2px var(--page);
}

/* ============ Body: ink sidebar + main column ============ */
.body-row { display: contents; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

.side-handle {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px; border: none; background: none;
  color: var(--ink-2);
  transition: background .2s, color .15s, transform .15s var(--ease-out);
}
.side-handle:hover { background: var(--bar-hover); color: var(--ink); }
.side-handle:active { transform: scale(.92); }
.side-handle svg { width: 19px; height: 19px; }

/* ============ Sidebar (persona-mapped ink rail) ============ */
.sidebar {
  width: var(--side-w);
  flex-shrink: 0;
  background: var(--side-bg);
  color: var(--side-ink);
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative; z-index: 50;
  transition: width .45s var(--ease);
  border-right: 1px solid var(--side-line);
}
/* a faint signal glow in the rail's corner */
.sidebar::after {
  content: ""; position: absolute; left: -80px; bottom: -120px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 196, 0, 0.13), transparent 70%);
  pointer-events: none;
}
.side-nav { flex: 1; padding: 4px 10px 12px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; position: relative; z-index: 1; }
.side-nav::-webkit-scrollbar { display: none; }
.nav-item > span, .nav-section, .brand-text, .side-foot-text { transition: opacity .2s ease; white-space: nowrap; }
.shell.side-collapsed { --side-w: 72px; }
.shell.side-collapsed .brand-text,
.shell.side-collapsed .side-foot-text { opacity: 0; pointer-events: none; }
.shell.side-collapsed .side-brand { padding-left: 18px; }
.shell.side-collapsed .nav-section { opacity: 0; height: 12px; padding: 6px 0 0; overflow: hidden; }
.shell.side-collapsed .nav-item > span,
.shell.side-collapsed .nav-badge { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
.shell.side-collapsed .nav-item { justify-content: center; padding: 10px 8px; gap: 0; }
.shell.side-collapsed .side-foot { justify-content: center; padding-left: 0; padding-right: 0; }
.nav-section {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em;
  color: var(--side-faint); padding: 18px 12px 7px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 8px 11px;
  min-height: 38px;
  border: none; background: transparent;
  color: var(--side-muted);
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.012em;
  border-radius: 8px;
  margin-bottom: 2px;
  text-align: left;
  transition: background .2s var(--ease), color .2s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--side-faint); transition: color .2s, transform .3s var(--ease-out); }
.nav-item:hover { background: var(--side-hover); color: var(--side-ink); }
.nav-item:hover svg { color: var(--side-ink); }
.nav-item.active { background: var(--side-active); color: #fff; }
.nav-item.active svg { color: var(--brand); }
.nav-item::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand); transform: scaleY(0); transition: transform .35s var(--ease);
}
.nav-item.active::before { transform: scaleY(1); }
.nav-badge {
  margin-left: auto;
  font-size: 11px; font-weight: 700; line-height: 18px;
  min-width: 20px; height: 18px; text-align: center;
  background: var(--brand); color: #111013;
  border-radius: 5px; padding: 0 6px;
  font-variant-numeric: tabular-nums;
}
.side-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px 16px;
  border-top: 1px solid var(--side-line);
  font-size: 11.5px; color: var(--side-muted); line-height: 1.4;
  position: relative; z-index: 1;
}
.side-foot strong { color: var(--side-ink); font-weight: 600; display: block; font-size: 12.5px; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(250, 196, 0, 0.5);
  animation: livePulse 2.2s infinite;
}

/* ============ Persona switcher (Viewing-as) ============ */
.persona-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 11px 3px 3px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--bar-field-border);
  background: var(--bar-field-bg);
  color: var(--bar-ink);
  max-width: 300px;
  transition: transform .15s var(--ease-out), border-color .2s, box-shadow .2s;
}
.persona-pill:hover { border-color: var(--ink); }
.persona-pill:active { transform: scale(.98); }
.pp-avatar, .po-avatar, .av-chip {
  width: 32px; height: 32px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; letter-spacing: -0.01em;
  flex-shrink: 0;
  background: var(--av, var(--brand)); color: #111013;
}
.persona-pill .pp-meta { text-align: left; min-width: 0; line-height: 1.15; }
.persona-pill .pp-name { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona-pill .pp-cap { display: block; font-size: 11px; color: var(--bar-muted); font-weight: 500; }
.persona-pill svg { width: 12px; height: 12px; color: var(--bar-muted); flex-shrink: 0; }

.persona-menu {
  display: none;
  position: absolute;
  top: calc(var(--appbar-h) + 6px);
  width: 300px; max-width: 94vw;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 95;
  padding: 6px;
  color: var(--ink);
  transform-origin: top right;
}
.persona-menu.open { display: block; animation: popIn .3s var(--ease-out); }
.persona-opt {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 8px 10px;
  background: none; border: none; border-radius: 10px;
  text-align: left;
  transition: background .15s;
  cursor: pointer;
}
.persona-opt:hover { background: var(--fill-3); }
.persona-opt.on { background: var(--brand-wash); }
.persona-opt .po-meta { flex: 1; min-width: 0; }
.persona-opt .po-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona-opt .po-tag { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona-opt .po-check { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink); }

/* ============ Guide: the role's jobs + the explanation switch ============ */
a.icon-btn { text-decoration: none; }
.guide-btn.on { color: var(--ink); }
.guide-btn.on::after {
  content: ""; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 2px var(--page);
}
.guide-pop {
  display: none;
  position: absolute; top: calc(var(--appbar-h) + 6px);
  width: 370px; max-width: calc(100vw - 24px);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 96; padding: 16px 10px 10px; color: var(--ink);
  transform-origin: top right;
}
.guide-pop.open { display: block; animation: popIn .3s var(--ease-out); }
.gp-head { padding: 0 8px 12px; }
.gp-eyebrow { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.gp-head b { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.035em; }
.gp-lens { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.45; margin-top: 3px; }
.gp-tasks { list-style: none; display: grid; gap: 2px; margin: 0 0 8px; }
.gp-tasks button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 8px; border: none; background: none; border-radius: 10px; text-align: left; color: var(--ink);
  transition: background .15s;
}
.gp-tasks button:hover { background: var(--fill-3); }
.gp-tasks button:hover .gp-n { background: var(--brand); }
.gp-tasks svg { width: 14px; height: 14px; color: var(--ink-4); flex-shrink: 0; transition: transform .25s var(--ease-out); }
.gp-tasks button:hover svg { transform: translateX(3px); color: var(--ink); }
.gp-n {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0; color: #111013;
  background: var(--av, var(--brand));
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  transition: background .2s;
}
.gp-t { flex: 1; min-width: 0; }
.gp-t b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.gp-t small { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; margin-top: 1px; }
.gp-t em { display: inline-block; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--brand-text); margin-top: 3px; }
.gp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 2px 2px 8px; padding: 11px 12px; border-radius: 10px; background: var(--fill-3); cursor: pointer;
}
.gp-row b { display: block; font-size: 13.5px; font-weight: 600; }
.gp-row small { display: block; font-size: 12px; color: var(--ink-3); }
.gp-foot { display: flex; justify-content: space-between; gap: 10px; padding: 4px 10px 2px; }
.gp-foot a, .u-link {
  font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--brand), var(--brand)); background-repeat: no-repeat;
  background-position: 0 100%; background-size: 100% 2px; padding-bottom: 1px;
}
.gp-foot a:hover, .u-link:hover { animation: underlineRun .5s var(--ease) forwards; }
@keyframes underlineRun {
  0% { background-size: 100% 2px; background-position: 100% 100%; }
  49.9% { background-size: 0% 2px; background-position: 100% 100%; }
  50% { background-size: 0% 2px; background-position: 0 100%; }
  100% { background-size: 100% 2px; background-position: 0 100%; }
}

/* Switch (ink track, yellow when on) */
.ios-switch {
  -webkit-appearance: none; appearance: none; flex-shrink: 0;
  width: 46px; height: 26px; border-radius: 999px; position: relative; cursor: pointer;
  background: var(--fill); transition: background .3s var(--ease);
}
.ios-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform .35s var(--spring), background .3s;
}
.ios-switch:checked { background: #111013; }
.ios-switch:checked::after { transform: translateX(20px); background: var(--brand); }
[data-theme="dark"] .ios-switch:checked { background: var(--brand); }
[data-theme="dark"] .ios-switch:checked::after { background: #111013; }

/* ============ Breadcrumb ============ */
.crumbbar { flex: 1 1 auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.crumb-trail {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; min-width: 0;
  white-space: nowrap; overflow: hidden;
  padding: 6px 4px;
}
.crumb-link {
  color: var(--ink-3); font-weight: 600; background: none; border: none; font-size: 14px; padding: 0 0 1px; flex-shrink: 0;
  background-image: linear-gradient(var(--brand), var(--brand)); background-repeat: no-repeat;
  background-position: 0 100%; background-size: 0% 2px;
  transition: background-size .35s var(--ease), color .2s;
}
.crumb-link:hover { color: var(--ink); background-size: 100% 2px; }
.crumb-sep { color: var(--ink-4); flex-shrink: 0; }
.crumb-here { color: var(--ink); font-weight: 700; letter-spacing: -0.02em; flex-shrink: 0; }
.crumb-scope { color: var(--ink-3); margin-left: 2px; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 13px; }
.crumb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.crumb-stamp { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* ============ Page canvas ============ */
.page {
  flex: 1;
  overflow-y: auto;
  padding: calc(var(--appbar-h) + 22px) 32px 72px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--appbar-h) + 14px);
}
.page-inner { max-width: var(--content-w); margin: 0 auto; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: baseline; gap: 4px 12px; margin: 4px 0 22px; flex-wrap: wrap; }
.page-head h1 {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 600; letter-spacing: -0.045em; line-height: 1.12;
}
.page-head .ph-kicker {
  flex-basis: 100%;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  margin-bottom: 4px;
}
.page-head .ph-note { font-size: 13.5px; color: var(--ink-3); margin-left: auto; }
.page-head:has(.backbtn) .ph-kicker { flex-basis: auto; align-self: center; margin: 0; color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.page-head:has(.backbtn) h1 { flex-basis: 100%; margin-top: 6px; }
.backbtn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: var(--ink);
  margin-right: 2px; align-self: center;
  transition: background .2s, border-color .2s, transform .15s var(--ease-out);
}
.backbtn:hover { background: var(--brand); border-color: var(--brand); color: #111013; }
.backbtn:active { transform: scale(.92); }
.backbtn svg { width: 15px; height: 15px; }

/* ============ Filter bar ============ */
.filterbar {
  display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 10px 16px;
  margin: 0 0 20px;
}
.fb-lead { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink); padding-right: 2px; }
.fb-lead svg { width: 16px; height: 16px; color: var(--ink); }
.fb-field { display: inline-flex; align-items: center; gap: 8px; }
.fb-field > span { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.fb-field select, .fld-select {
  padding: 6px 32px 6px 12px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--ink);
  font-size: 13.5px; font-weight: 600;
  outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111013' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  transition: border-color .2s, box-shadow .2s;
}
[data-theme="dark"] .fb-field select, [data-theme="dark"] .fld-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fac400' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.fb-field select:hover, .fld-select:hover { border-color: var(--ink); }
.fb-field select:focus, .fld-select:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(250, 196, 0, 0.35); }
.fb-note { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.filter-row { margin: 4px 0 14px; }

/* ============ KPI tiles ============ */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.kpi-card {
  position: relative;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 15px 16px 15px;
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
  text-align: left;
}
.kpi-card.clickable { cursor: pointer; transition: transform .4s var(--ease-out), box-shadow .3s var(--ease); }
.kpi-card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.kpi-card.clickable:active { transform: scale(.985); }
.kc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; min-width: 0; }
.k-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.k-label {
  font-size: 12px; font-weight: 600; letter-spacing: -0.022em;
  color: var(--ink-2); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-glyph {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center; flex-shrink: 0;
  background: color-mix(in srgb, var(--kpi-accent, var(--ink)) 13%, transparent);
  color: color-mix(in srgb, var(--kpi-accent, var(--ink)) 55%, var(--ink));
  transition: background .3s var(--ease), color .3s;
}
.kpi-glyph svg { width: 15px; height: 15px; }
.kpi-card.clickable:hover .kpi-glyph { background: var(--brand); color: #111013; }
.k-chev { width: 13px; height: 13px; flex-shrink: 0; color: var(--ink-4); transition: transform .35s var(--ease-out), color .2s; }
.kpi-card.clickable:hover .k-chev { transform: translateX(3px); color: var(--ink); }
.k-value {
  font-family: var(--font-rounded);
  font-size: 28px; font-weight: 600; letter-spacing: -0.045em; line-height: 1.05;
  white-space: nowrap; font-variant-numeric: tabular-nums;
  align-self: flex-start;
  background-image: linear-gradient(var(--brand), var(--brand)); background-repeat: no-repeat;
  background-position: 0 92%; background-size: 0% 0.28em;
  transition: background-size .55s var(--ease-hl);
}
.kpi-card.clickable:hover .k-value { background-size: 100% 0.28em; }
.k-value small { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: -0.01em; }
.k-sub {
  font-size: 12.5px; color: var(--ink-3);
  margin-top: 8px; min-height: 18px;
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.k-sub.k-pill {
  align-self: flex-start; margin-top: 10px; max-width: 100%; display: block;
  padding: 2px 8px; border-radius: 5px;
  font-weight: 600; font-size: 12px;
}
.k-sub.k-pill.good { color: var(--good-text); background: var(--status-good-soft); }
.k-sub.k-pill.bad { color: var(--crit-text); background: var(--status-critical-soft); }
.progress { width: 100%; height: 5px; border-radius: 2px; background: var(--fill-2); overflow: hidden; margin-top: 11px; }
.progress i { display: block; height: 100%; border-radius: 2px; transform-origin: left; animation: barGrow 1.1s var(--ease-rv) both .15s; }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: none; } }

/* Intelligence tile ("Summarize this view") */
.bulb-card {
  align-items: flex-start; justify-content: space-between; gap: 12px;
  cursor: pointer; border: none;
  background: #111013; color: #fff;
  isolation: isolate;
  transition: transform .4s var(--ease-out), box-shadow .3s;
}
[data-theme="dark"] .bulb-card { background: #1d1c21; box-shadow: 0 0 0 1px rgba(250, 196, 0, 0.22); }
.bulb-card::after {
  content: ""; position: absolute; right: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(250, 196, 0, 0.32), transparent 68%);
  transition: transform .6s var(--ease);
}
.bulb-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.bulb-card:hover::after { transform: scale(1.35); }
.bulb-card:active { transform: scale(.985); }
.bulb-card .bulb {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; color: #111013;
  background: var(--brand);
  position: relative;
}
.bulb-card .bulb svg { width: 18px; height: 18px; animation: twinkle 3.2s var(--ease) infinite; }
.bulb-card .bulb-label { font-size: 14.5px; font-weight: 700; color: #fff; letter-spacing: -0.025em; line-height: 1.25; }
.bulb-card .bulb-sub { font-size: 12px; color: rgba(255, 255, 255, 0.62); display: block; font-weight: 500; margin-top: 3px; }
@keyframes twinkle { 0%, 100% { transform: none; } 45% { transform: rotate(18deg) scale(1.12); } 60% { transform: rotate(0deg) scale(.96); } }

/* ============ Grid & cards ============ */
.grid { display: grid; gap: 16px; }
.grid-12 { grid-template-columns: repeat(12, 1fr); }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
@media (max-width: 1280px) {
  .col-3, .col-4 { grid-column: span 6; }
  .col-5, .col-6, .col-7, .col-8, .col-9 { grid-column: span 12; }
}

.card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  min-width: 0;
  transition: box-shadow .3s var(--ease);
}
.card:hover { box-shadow: 0 0 0 1px var(--border-strong), 0 14px 34px -22px rgba(17, 16, 19, 0.28); }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 6px;
  flex-wrap: wrap;
}
.card-head > :first-child { min-width: 0; }
.card-title { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.3; }
.card-title .info-i {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px; border-radius: 4px;
  background: var(--fill-2); color: var(--ink-3);
  font-size: 11px; font-weight: 700; font-style: normal;
  vertical-align: 0; margin-left: 5px; cursor: help;
}
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-weight: 500; line-height: 1.45; }
.card-body { padding: 10px 20px 18px; flex: 1; min-width: 0; }
.card-body.flush { padding: 0 8px 8px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }

.chart { width: 100%; }
.chart-sm { height: 240px; }
.chart-md { height: 300px; }
.chart-lg { height: 370px; }
.chart-xl { height: 450px; }
.chart-xxl { height: 650px; }

/* ============ Badges, meters, buttons ============ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  border-radius: 5px; padding: 2px 8px;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.low       { color: var(--good-text); background: var(--status-good-soft); }
.badge.medium    { color: var(--warn-text); background: var(--status-warning-soft); }
.badge.high      { color: var(--serious-text); background: var(--status-serious-soft); }
.badge.critical  { color: var(--crit-text); background: var(--status-critical-soft); }
.badge.neutral   { color: var(--ink-2); background: var(--fill-2); }
.badge.accent    { color: var(--ink); background: var(--brand-soft); }
.badge.ai        { color: var(--ink); background: var(--ai-wash); }
.badge.plain::before { display: none; }

.risk-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.risk-score.low { color: var(--good-text); }
.risk-score.medium { color: var(--warn-text); }
.risk-score.high { color: var(--serious-text); }
.risk-score.critical { color: var(--crit-text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--ink);
  background-image: linear-gradient(var(--brand), var(--brand));
  background-repeat: no-repeat; background-position: 0 0; background-size: 0% 100%;
  transition: background-size .45s var(--ease), color .3s, border-color .3s, transform .18s var(--ease-out);
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background-color: var(--cta-bg); color: var(--cta-ink); border-color: var(--cta-bg);
  background-image: linear-gradient(var(--cta-wipe), var(--cta-wipe));
}
.btn-primary:hover { background-size: 100% 100%; color: var(--cta-wipe-ink); border-color: var(--cta-wipe); }
.btn-ghost { background-color: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background-color: var(--fill-2); border-color: transparent; color: var(--ink); }
.btn-sm { min-height: 30px; padding: 4px 11px; font-size: 12.5px; }
.btn-good { background-color: var(--status-good-soft); border-color: transparent; color: var(--good-text); background-image: linear-gradient(var(--status-good), var(--status-good)); }
.btn-good:hover { background-size: 100% 100%; color: #fff; border-color: transparent; }
.btn-danger { background-color: var(--status-critical-soft); border-color: transparent; color: var(--crit-text); background-image: linear-gradient(var(--status-critical), var(--status-critical)); }
.btn-danger:hover { background-size: 100% 100%; color: #fff; border-color: transparent; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* Segmented control — the active option is an ink tab */
.seg { display: inline-flex; background: var(--fill-2); border-radius: 9px; padding: 3px; gap: 2px; position: relative; }
.seg button {
  border: none; background: transparent;
  padding: 4px 13px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: background .25s var(--ease), color .2s, box-shadow .2s;
  position: relative;
}
.seg button:hover:not(.active) { color: var(--ink); background: var(--fill-2); }
.seg button.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 10px -4px rgba(17, 16, 19, 0.45); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  padding: 5px 12px;
  background: var(--fill-2); border: none;
  border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  transition: background .2s var(--ease), color .2s, transform .18s var(--ease-out);
}
.chip:hover { background: var(--fill); }
.chip:active { transform: scale(.96); }
.chip.active { background: var(--accent); color: var(--accent-ink); }

/* ============ Tables ============ */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl thead th {
  text-align: left;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  color: var(--ink-3);
  padding: 9px 11px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 2;
}
.tbl tbody td { padding: 10px 11px; border-bottom: 1px solid var(--separator); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.row-link { cursor: pointer; transition: background .15s; }
.tbl tbody tr.row-link:hover { background: var(--brand-wash); }
.tbl tbody tr.row-link:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.tbl tbody tr.row-sel { background: var(--accent-soft); }
.tbl tbody tr.row-sel td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .cell-main { font-weight: 600; color: var(--ink); }
.tbl .cell-sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; margin-top: 1px; }

/* Signature tables: an ink header row */
.tbl.tbl-teal thead th {
  background: var(--thead-bg);
  color: var(--thead-ink);
  border-bottom: none;
  font-size: 12px; font-weight: 600;
}
.tbl.tbl-teal thead th:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.tbl.tbl-teal thead th:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.tbl.tbl-teal tbody tr:nth-child(even) { background: var(--fill-3); }
.tbl.tbl-teal tbody td { border-bottom: none; }
.tbl.tbl-teal tbody tr:nth-child(even) td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.tbl.tbl-teal tbody tr:nth-child(even) td:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.tbl.tbl-teal tbody tr.row-link:hover { background: var(--brand-wash); }

/* In-cell measure bars */
.cellbar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.cellbar i { display: block; height: 9px; border-radius: 2px; min-width: 3px; transform-origin: left; animation: barGrow .9s var(--ease-rv) both; }
.cellbar span { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }

/* Risk-factor heat cells */
td.heat {
  text-align: center; font-weight: 700; font-size: 13px;
  color: #fff; font-variant-numeric: tabular-nums;
  border-left: 2px solid var(--surface);
  min-width: 64px;
}

.heat-pill {
  display: block; text-align: center; min-width: 52px; padding: 3px 0; border-radius: 5px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: #111013;
}
.heat-pill.h-crit { background: var(--status-critical); color: #fff; }
[data-theme="dark"] .heat-pill.h-crit { color: #111013; }
.heat-pill.h-high { background: var(--status-serious); }
.heat-pill.h-med { background: var(--status-warning-soft); color: var(--warn-text); }
.heat-pill.h-low { background: var(--status-good-soft); color: var(--good-text); }

.trend-up { color: var(--crit-text); font-weight: 700; }
.trend-down { color: var(--good-text); font-weight: 700; }

/* Inline meter */
.meter { display: inline-flex; align-items: center; gap: 8px; min-width: 104px; }
.meter-track { display: block; flex: 1; height: 6px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 2px; transform-origin: left; animation: barGrow .9s var(--ease-rv) both; }
.meter-val { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 33px; text-align: right; }

/* TTS vs TTR gap bars */
.gap-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13.5px; }
.gap-name { flex: 1 1 120px; min-width: 0; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap-name .cell-sub { font-weight: 500; }
.gap-track { flex: 2 1 60px; min-width: 40px; position: relative; height: 22px; }
.gap-bar { position: absolute; height: 7px; border-radius: 2px; transform-origin: left; animation: barGrow 1s var(--ease-rv) both; }
.gap-bar.tts { top: 3px; background: var(--series-1); }
.gap-bar.ttr { top: 12px; background: var(--status-serious); animation-delay: .1s; }
.gap-val { flex: 0 0 auto; text-align: right; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Dimension bars */
.dim-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.dim-label { width: 124px; font-size: 13.5px; color: var(--ink-2); flex-shrink: 0; }
.dim-track { flex: 1; height: 8px; background: var(--fill-2); border-radius: 2px; overflow: hidden; }
.dim-fill { display: block; height: 100%; border-radius: 2px; transform-origin: left; animation: barGrow 1s var(--ease-rv) both; }
.dim-val { width: 36px; text-align: right; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Data-quality bars */
.dq-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; font-size: 14px; }
.dq-label { width: 186px; flex-shrink: 0; color: var(--ink-2); font-weight: 600; }
.dq-track { flex: 1; height: 9px; background: var(--fill-2); border-radius: 2px; overflow: hidden; }
.dq-fill { display: block; height: 100%; border-radius: 2px; transform-origin: left; animation: barGrow 1s var(--ease-rv) both; }
.dq-val { width: 46px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============ Home: the dark chrome hero ============ */
.hero {
  border-radius: var(--radius-lg);
  background: #0b0b0c;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 30px 60px -36px rgba(17, 16, 19, 0.55);
  color: #fff;
  padding: 32px 34px 28px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hero::after {   /* keeps copy legible over the bright folds */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, rgba(11, 11, 12, 0.82) 0%, rgba(11, 11, 12, 0.5) 55%, rgba(11, 11, 12, 0.15) 100%);
}
.hero h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.045em; margin-bottom: 8px; line-height: 1.14; }
.hero p { font-size: 15px; color: rgba(255, 255, 255, 0.74); max-width: 860px; line-height: 1.6; }
.hero p strong { color: #fff; }
.hero .ai-text { background: none; color: var(--brand); padding: 0; }
.hero-stats { display: flex; gap: 0; margin-top: 22px; flex-wrap: wrap; row-gap: 14px; }
.hero-stat { padding: 0 22px; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.hero-stat:first-child { padding-left: 0; border-left: none; }
.hero-stat .hs-val { font-family: var(--font-rounded); font-size: 24px; font-weight: 600; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; line-height: 1.15; color: #fff; }
.hero-stat .hs-label { font-size: 12px; color: rgba(255, 255, 255, 0.6); font-weight: 500; }

/* "Today" — the greeting with the agents' briefing beside it */
.today {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 18px;
  align-items: stretch;
}
@media (max-width: 1280px) { .today { grid-template-columns: 1fr; } }
.today .hero { margin: 0; display: flex; flex-direction: column; justify-content: space-between; }
.today-eyebrow {
  font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.72);
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px;
}
.today-eyebrow .live-dot { width: 7px; height: 7px; }
.today-title { font-family: var(--font-display); font-size: 33px; font-weight: 600; letter-spacing: -0.048em; line-height: 1.13; max-width: 720px; }
.today-sub { margin-top: 12px; }
.today .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; margin-top: 24px; }
.today .hero-stat { padding: 0 18px; }
.today .hero-stat:nth-child(3n+1) { padding-left: 0; border-left: none; }
@media (max-width: 1280px) { .today .hero-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } .today .hero-stat:nth-child(3n+1) { padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, 0.14); } .today .hero-stat:first-child { padding-left: 0; border-left: none; } }

/* Tiles that open something: a ↗ that slips on hover */
.site-tile { transition: transform .45s var(--ease-out), box-shadow .3s var(--ease); }
.site-tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--ink), 0 22px 40px -24px rgba(17, 16, 19, 0.45); }
.site-tile .tile-name { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.25; margin-bottom: 3px; }
.tile-go { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; background: var(--fill-2); color: var(--ink); transition: background .3s, color .3s; }
.tile-go svg { width: 14px; height: 14px; }
.site-tile:hover .tile-go { background: var(--brand); color: #111013; }
.site-tile:hover .tile-go svg { animation: goSlip .5s var(--ease-out); }

/* Live-signal band (Executive) */
.signal-band { border-radius: var(--radius-sm); margin: 0 0 18px; }

.persona-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .persona-grid { grid-template-columns: repeat(2, 1fr); } }
.persona-card {
  border: none; text-align: left;
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .4s var(--ease-out), box-shadow .3s;
  position: relative; overflow: hidden;
}
.persona-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.persona-card .pc-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; color: var(--ink); }
.persona-card .pc-icon svg { width: 23px; height: 23px; }
.persona-card h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }
.persona-card .pc-q { font-size: 14px; color: var(--ink-2); line-height: 1.5; flex: 1; }
.persona-card .pc-stats { display: flex; gap: 14px; border-top: 1px solid var(--separator); padding-top: 10px; }
.persona-card .pc-stat b { display: block; font-size: 16px; }
.persona-card .pc-stat span { font-size: 12px; color: var(--ink-3); }
.persona-card .pc-go { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; border-radius: 6px; background: var(--fill-2); color: var(--ink); display: grid; place-items: center; }
.persona-card .pc-go svg { width: 13px; height: 13px; }

.linkpanel .lp-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none; border: none; border-bottom: 1px solid var(--separator);
  color: var(--ink); font-size: 14px; font-weight: 600;
  text-align: left;
  transition: background .15s;
}
.linkpanel .lp-item:last-child { border-bottom: none; }
.linkpanel .lp-item:hover { background: var(--brand-wash); }
.linkpanel .lp-item svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--ink-3); }
.linkpanel .lp-item span small { display: block; color: var(--ink-3); font-weight: 500; font-size: 12.5px; }

/* ============ List panel (product selector) ============ */
.list-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  max-height: 560px;
  padding: 6px;
}
.list-panel .lp-head { color: var(--ink-3); font-size: 12px; font-weight: 600; padding: 8px 10px 6px; flex-shrink: 0; }
.list-panel .lp-scroll { overflow-y: auto; }
.list-panel .lp-row {
  display: block; width: 100%;
  padding: 8px 10px;
  background: none; border: none; border-radius: 8px;
  color: var(--ink); font-size: 13.5px; font-weight: 500;
  text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .15s;
}
.list-panel .lp-row:hover { background: var(--fill-3); }
.list-panel .lp-row.sel { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ============ Drawer (inspector) ============ */
.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(17, 16, 19, 0.18);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
  z-index: 100;
}
[data-theme="dark"] .drawer-scrim { background: rgba(0, 0, 0, 0.5); }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px;
  width: min(660px, calc(100vw - 20px));
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  transform: translateX(calc(100% + 28px));
  transition: transform .6s var(--ease);
  z-index: 110;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 20px 20px 16px 24px;
  border-bottom: 1px solid var(--separator);
}
.drawer-titles { min-width: 0; }
.drawer-kicker { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; }
.drawer-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--brand); }
.drawer-head h2 { font-family: var(--font-display); font-size: 23px; font-weight: 600; margin-top: 4px; letter-spacing: -0.045em; line-height: 1.2; }
.drawer-head .icon-btn, .modal-head .icon-btn, .copilot-head .icon-btn {
  color: var(--ink-3); background: var(--fill-2); width: 32px; height: 32px; flex-shrink: 0;
}
.drawer-head .icon-btn:hover, .modal-head .icon-btn:hover { background: var(--brand); color: #111013; }
.drawer-head .icon-btn svg, .modal-head .icon-btn svg, .copilot-head .icon-btn svg { width: 14px; height: 14px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px 32px; }
.drawer-section { margin-bottom: 26px; }
.drawer-section h3, .sec-title {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.sec-title { margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; }
.fact {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--border);
  padding: 10px 13px;
  min-width: 0;
}
[data-theme="dark"] .fact { background: var(--fill-3); }
.fact .f-value, .fact .f-label { overflow-wrap: anywhere; }
.fact .f-label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.fact .f-value { font-family: var(--font-rounded); font-size: 19px; font-weight: 600; margin-top: 2px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.fact .f-value small { font-family: var(--font); font-size: 12px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }

/* ============ Intelligence material ============ */
@keyframes aiSpin { to { --ai-angle: 360deg; } }
/* a yellow arc sweeps round the edge, like a radar finding things */
.ai-ring { position: relative; isolation: isolate; }
.ai-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1.5px;
  background: var(--ai-conic);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: aiSpin 6s linear infinite;
  pointer-events: none; z-index: 2;
}
.ai-ring { box-shadow: 0 0 0 1px var(--border), 0 18px 40px -26px rgba(250, 196, 0, calc(var(--ai-glow-opacity) * 2)); }
.ai-mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--orb-ink);
  background: var(--orb-bg);
  position: relative;
}
.ai-mark svg { width: 16px; height: 16px; animation: twinkle 3.6s var(--ease) infinite; }

/* "For you today" briefing */
.ai-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 22px 22px 18px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.ai-card > * { position: relative; z-index: 3; }
.ai-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ai-titles { min-width: 0; flex: 1; }
.ai-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.2; }
.ai-cap { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ai-list { list-style: none; display: grid; gap: 4px; flex: 1; align-content: start; }
.ai-card.wide .ai-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1100px) { .ai-card.wide .ai-list { grid-template-columns: 1fr; } }
.ai-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 10px 11px 8px;
  border-radius: 10px;
  transition: background .2s;
}
.ai-card.wide .ai-item { background: var(--fill-3); flex-direction: column; gap: 8px; padding: 13px 14px; }
.ai-item:hover { background: var(--fill-3); }
.ai-card.wide .ai-item:hover { background: var(--fill-2); }
.ai-item-top { display: flex; align-items: center; gap: 8px; }
.ai-dot {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: color-mix(in srgb, var(--tone, var(--ink)) 50%, var(--ink));
  background: color-mix(in srgb, var(--tone, var(--ink)) 17%, transparent);
  margin-top: 1px;
}
.ai-item-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.ai-item-text strong { color: var(--ink); font-weight: 600; }
.ai-item-kicker { font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--tone, var(--ink)) 50%, var(--ink)); }
.ai-item .btn { flex-shrink: 0; align-self: center; }
.ai-card.wide .ai-item .btn { align-self: flex-start; margin-top: auto; }
.ai-ask {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface);
  color: var(--ink-3); font-size: 13.5px; text-align: left;
  transition: border-color .2s, color .2s, box-shadow .2s;
}
.ai-ask:hover { border-color: var(--ink); color: var(--ink-2); box-shadow: 0 0 0 4px rgba(250, 196, 0, 0.22); }
.ai-ask svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--brand-text); }
.ai-ask .kbd { margin-left: auto; }

/* ============ Copilot dock ============ */
.copilot-fab {
  position: fixed; bottom: 22px; right: 22px;
  z-index: 118;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 9px;
  border-radius: 12px; border: none;
  color: #fff;
  font-size: 14px; font-weight: 600; letter-spacing: -0.015em;
  background-color: #111013;
  background-image: linear-gradient(var(--brand), var(--brand)); background-repeat: no-repeat; background-size: 0% 100%;
  box-shadow: 0 18px 40px -16px rgba(17, 16, 19, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform .45s var(--ease-out), background-size .5s var(--ease), color .3s, opacity .2s, right .6s var(--ease);
}
.copilot-fab:hover { transform: translateY(-2px); background-size: 100% 100%; color: #111013; }
.copilot-fab:hover .fab-orb { background: #111013; color: var(--brand); }
.copilot-fab:hover .fab-kbd { background: rgba(17, 16, 19, 0.12); color: #111013; }
.copilot-fab:active { transform: scale(.97); }
.copilot-fab .fab-orb {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; color: #111013;
  background: var(--brand);
  transition: background .3s, color .3s;
}
.copilot-fab svg { width: 17px; height: 17px; animation: twinkle 3.2s var(--ease) infinite; }
.copilot-fab .fab-kbd { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.12); border-radius: 5px; padding: 1px 6px; transition: background .3s, color .3s; }
.copilot-fab .fab-dot {
  position: absolute; top: 5px; left: 34px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--status-critical); box-shadow: 0 0 0 2px #111013;
  display: none;
}
.copilot-fab.has-chat .fab-dot { display: block; }
body.copilot-open .copilot-fab { opacity: 0; pointer-events: none; transform: translateY(10px) scale(.94); }

.copilot {
  position: fixed; bottom: 16px; right: 16px;
  width: min(450px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  border-radius: 20px;
  box-shadow: var(--shadow-lg), 0 40px 90px -30px rgba(17, 16, 19, 0.45);
  transform: translateY(20px) scale(.97);
  transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: transform .55s var(--ease-out), opacity .25s, right .6s var(--ease);
  z-index: 120;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.copilot.open { transform: none; opacity: 1; pointer-events: auto; }
/* thinking: a yellow arc runs round the rim and the edges warm up */
.copilot::before, .copilot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity .45s ease; z-index: 3;
}
.copilot::before {
  padding: 2px;
  background: var(--ai-conic); animation: aiSpin 1.8s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.copilot::after { animation: edgeGlow 2.4s linear infinite; }
@keyframes edgeGlow {
  0%, 100% { box-shadow: inset 18px 0 32px -22px var(--ai-c1), inset 0 18px 32px -22px var(--ai-c3), inset -18px 0 32px -22px var(--ai-c2), inset 0 -18px 32px -22px var(--ai-c1); }
  25% { box-shadow: inset 18px 0 32px -22px var(--ai-c1), inset 0 18px 32px -22px var(--ai-c1), inset -18px 0 32px -22px var(--ai-c3), inset 0 -18px 32px -22px var(--ai-c2); }
  50% { box-shadow: inset 18px 0 32px -22px var(--ai-c2), inset 0 18px 32px -22px var(--ai-c1), inset -18px 0 32px -22px var(--ai-c1), inset 0 -18px 32px -22px var(--ai-c3); }
  75% { box-shadow: inset 18px 0 32px -22px var(--ai-c3), inset 0 18px 32px -22px var(--ai-c2), inset -18px 0 32px -22px var(--ai-c1), inset 0 -18px 32px -22px var(--ai-c1); }
}
.copilot.thinking::before, .copilot.thinking::after { opacity: 1; }
.copilot-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 14px 14px 14px 16px;
  background: #111013; color: #fff;
  flex-shrink: 0;
  position: relative; overflow: hidden; isolation: isolate;
}
.copilot-head::after {
  content: ""; position: absolute; right: -60px; top: -90px; width: 220px; height: 220px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(250, 196, 0, 0.26), transparent 68%);
}
.copilot-head .icon-btn { color: rgba(255, 255, 255, 0.72); background: rgba(255, 255, 255, 0.08); }
.copilot-head .icon-btn:hover { background: var(--brand); color: #111013; }
.copilot-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.copilot-id > div:last-child { min-width: 0; }
.copilot-id strong { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: -0.035em; }
.copilot-id span { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copilot-orb {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: var(--brand);
  position: relative; overflow: hidden;
}
.copilot-orb::before {   /* the spark */
  content: ""; position: absolute; inset: 8px;
  background: #111013;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5c.5 3.9 1.9 6.3 5.6 7.5-3.7 1.2-5.1 3.6-5.6 7.5-.5-3.9-1.9-6.3-5.6-7.5 3.7-1.2 5.1-3.6 5.6-7.5Z'/%3E%3Cpath d='M18.6 14.2c.25 1.7.85 2.7 2.4 3.2-1.55.5-2.15 1.5-2.4 3.2-.25-1.7-.85-2.7-2.4-3.2 1.55-.5 2.15-1.5 2.4-3.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5c.5 3.9 1.9 6.3 5.6 7.5-3.7 1.2-5.1 3.6-5.6 7.5-.5-3.9-1.9-6.3-5.6-7.5 3.7-1.2 5.1-3.6 5.6-7.5Z'/%3E%3Cpath d='M18.6 14.2c.25 1.7.85 2.7 2.4 3.2-1.55.5-2.15 1.5-2.4 3.2-.25-1.7-.85-2.7-2.4-3.2 1.55-.5 2.15-1.5 2.4-3.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: twinkle 3.2s var(--ease) infinite;
}
.copilot-orb::after {   /* a scan line when thinking */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(transparent 40%, rgba(255, 255, 255, 0.7) 50%, transparent 60%);
  transform: translateY(-100%); opacity: 0;
}
.copilot.thinking .copilot-orb::after { opacity: 1; animation: scan 1.1s linear infinite; }
@keyframes scan { to { transform: translateY(100%); } }
.copilot-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; background: var(--surface-2); }
[data-theme="dark"] .copilot-thread { background: var(--surface); }
.msg { max-width: 94%; animation: msgIn .5s var(--ease-out) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; }
.msg.bot { align-self: stretch; max-width: 100%; }
.msg .bubble { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.55; }
.msg.user .bubble { background: #111013; color: #fff; border-bottom-right-radius: 4px; }
[data-theme="dark"] .msg.user .bubble { background: var(--brand); color: #111013; }
.msg.bot .bubble { background: var(--surface); box-shadow: 0 0 0 1px var(--border); border-bottom-left-radius: 4px; color: var(--ink-2); }
[data-theme="dark"] .msg.bot .bubble { background: var(--surface-3); }
.msg.bot .bubble strong { color: var(--ink); font-weight: 600; }
.msg.bot .bubble p { margin-bottom: 8px; }
.msg.bot .bubble p:last-child { margin-bottom: 0; }
.msg.bot .bubble ul, .msg.bot .bubble ol { margin: 4px 0 8px 18px; }
.msg.bot .bubble li { margin-bottom: 4px; }
.msg.bot .bubble table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0; }
.msg.bot .bubble th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 4px 6px; border-bottom: 1px solid var(--border-strong); }
.msg.bot .bubble td { padding: 6px 6px; border-bottom: 1px solid var(--separator); font-variant-numeric: tabular-nums; }
.msg.bot .bubble tr:last-child td { border-bottom: none; }
.msg.bot .bubble .cell-sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.msg .agent-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: -0.005em;
  color: var(--ink-3); margin: 0 0 6px 4px;
}
.msg .agent-tag i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; background: var(--brand); animation: livePulse 2.2s infinite; }
.msg-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.msg-actions .chip { background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong); color: var(--ink); font-size: 12.5px; padding: 5px 11px; }
.msg-actions .chip:hover { background: var(--brand); box-shadow: 0 0 0 1px var(--brand); color: #111013; }
.msg-actions .chip.primary { background: #111013; color: #fff; box-shadow: none; }
[data-theme="dark"] .msg-actions .chip.primary { background: var(--brand); color: #111013; }
.msg-actions .chip.primary:hover { background: var(--brand); color: #111013; }
.msg-actions .chip.done { background: var(--status-good-soft); color: var(--good-text); box-shadow: none; pointer-events: none; }
.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 2px; background: var(--brand); animation: blink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
.typing-label { font-size: 12px; color: var(--ink-3); margin: 2px 0 0 6px; display: block; }
@keyframes blink { 0%, 70%, 100% { opacity: .3; transform: none; } 35% { opacity: 1; transform: translateY(-3px); } }
.copilot-suggests {
  padding: 10px 14px 4px; display: flex; gap: 7px; flex-wrap: nowrap; overflow-x: auto;
  scrollbar-width: none; background: var(--surface);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent);
}
.copilot-suggests::-webkit-scrollbar { display: none; }
.copilot-suggests .chip { font-size: 12.5px; padding: 6px 11px; flex-shrink: 0; background: var(--fill-2); }
.copilot-suggests .chip:hover { background: var(--brand); color: #111013; }
.copilot-context { display: flex; align-items: center; gap: 8px; padding: 6px 14px 0; min-height: 26px; background: var(--surface); }
.ctx-chip {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  padding: 3px 5px 3px 9px; border-radius: 6px;
  background: var(--brand-soft); color: var(--ink);
  font-size: 12px; font-weight: 600;
  max-width: 100%;
}
.ctx-chip.off { background: var(--fill-2); color: var(--ink-3); text-decoration: line-through; }
.ctx-chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.ctx-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ctx-x {
  width: 18px; height: 18px; border-radius: 4px; border: none; flex-shrink: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, currentColor 14%, transparent); color: inherit;
}
.ctx-x svg { width: 10px; height: 10px; }
.ctx-hint { font-size: 11.5px; color: var(--ink-4); white-space: nowrap; }
.copilot-input { display: flex; align-items: center; gap: 8px; padding: 8px 14px 14px; background: var(--surface); }
.copilot-input input {
  flex: 1; min-width: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 14px;
  height: 44px;
  font-size: 14.5px; font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: box-shadow .2s, border-color .2s;
}
.copilot-input input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(250, 196, 0, 0.3); }
.copilot-send {
  width: 44px; height: 44px; border-radius: 10px; border: none; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--brand); color: #111013;
  transition: transform .2s var(--ease-out), background .2s, opacity .2s;
}
.copilot-send:hover { background: #111013; color: var(--brand); }
[data-theme="dark"] .copilot-send:hover { background: #fff; color: #111013; }
.copilot-send:active { transform: scale(.9); }
.copilot-send svg { width: 18px; height: 18px; }

/* Rich answers inside the thread */
.ans-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 6px; margin: 8px 0 10px; }
.ans-fact { background: var(--fill-3); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.ans-fact .af-l { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.ans-fact .af-v { font-family: var(--font-rounded); font-size: 16.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ans-fact .af-v.bad { color: var(--crit-text); }
.ans-fact .af-v.good { color: var(--good-text); }
.ans-bars { display: grid; gap: 5px; margin: 6px 0 8px; }
.ans-bar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ans-bar i { display: block; height: 8px; border-radius: 2px; background: var(--status-serious); min-width: 3px; transform-origin: left; animation: barGrow .8s var(--ease-rv) both; }
.ans-bar.cur { color: var(--ink); font-weight: 600; }
.ans-bar.cur i { background: var(--status-critical); }
.ans-bar b { font-weight: 600; color: var(--ink-2); }
.working { margin-top: 8px; border-top: 1px solid var(--separator); padding-top: 6px; }
.working summary {
  list-style: none; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 0;
}
.working summary::-webkit-details-marker { display: none; }
.working summary::before { content: "›"; display: inline-block; transition: transform .25s var(--ease); font-size: 15px; line-height: 1; color: var(--brand-text); }
.working[open] summary::before { transform: rotate(90deg); }
.working ol, .working ul { margin: 6px 0 2px 18px; font-size: 12.5px; color: var(--ink-3); }
.working li { margin-bottom: 3px; }
.working code, .formula { font-family: var(--font-mono); font-size: 11.5px; background: var(--fill-3); border-radius: 4px; padding: 1px 5px; color: var(--ink-2); }
.draft {
  background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 8px 0;
  font-size: 13px; color: var(--ink-2); white-space: pre-wrap; line-height: 1.6;
  box-shadow: inset 0 0 0 1px var(--border);
  border-left: 3px solid var(--brand);
  max-height: 300px; overflow-y: auto;
}
.draft b { color: var(--ink); }
.dym { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

@media (min-width: 1180px) {
  body.drawer-open .copilot { right: calc(min(660px, 100vw - 20px) + 22px); }
  body.drawer-open .copilot-fab { right: calc(min(660px, 100vw - 20px) + 28px); }
}

/* ============ Modal ============ */
.modal-scrim {
  position: fixed; inset: 0;
  background: rgba(17, 16, 19, 0.32);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: none; place-items: center;
  z-index: 140;
  padding: 30px;
}
[data-theme="dark"] .modal-scrim { background: rgba(0, 0, 0, 0.6); }
.modal-scrim.open { display: grid; animation: fadeIn .25s ease; }
.modal-scrim.open .modal { animation: sheetIn .55s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.modal {
  width: min(820px, 96vw);
  max-height: 88vh;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 20px 16px 24px;
  border-bottom: 1px solid var(--separator);
}
.modal-head h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.045em; }
.modal-body { padding: 18px 24px 26px; overflow-y: auto; font-size: 14.5px; }
.modal-body h3 { font-size: 15px; font-weight: 700; margin: 16px 0 6px; letter-spacing: -0.03em; }
.modal-body p { color: var(--ink-2); margin-bottom: 9px; }
.modal-body ul { margin: 4px 0 11px 19px; color: var(--ink-2); }
.modal-body li { margin-bottom: 5px; }
.modal-body table.tbl { font-size: 13.5px; }

/* Forms inside sheets (the AI-drafted action) */
.ai-note {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 16px;
  border-radius: 10px; background: var(--ai-wash);
  border-left: 3px solid var(--brand);
  font-size: 13.5px; color: var(--ink-2); line-height: 1.55;
}
.ai-note .ai-mark { width: 24px; height: 24px; border-radius: 6px; }
.ai-note .ai-mark svg { width: 13px; height: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fld {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface);
  color: var(--ink); font-size: 14.5px; font-weight: 500;
  outline: none;
  transition: box-shadow .2s, border-color .2s;
}
.fld:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(250, 196, 0, 0.3); }
textarea.fld { resize: vertical; min-height: 72px; line-height: 1.55; }
.fld-select.fld { border-radius: 8px; height: 40px; padding-right: 32px; font-weight: 500; }
.form-foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.form-foot .muted { margin-right: auto; font-size: 12.5px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ============ Toasts ============ */
.toasts { position: fixed; top: calc(var(--appbar-h) + 10px); right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: #111013; color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 20px 44px -16px rgba(17, 16, 19, 0.6);
  padding: 13px 15px;
  width: 370px; max-width: calc(100vw - 32px);
  font-size: 13.5px; line-height: 1.5;
  animation: toastIn .6s var(--ease-out);
  pointer-events: auto;
  position: relative; overflow: hidden;
}
[data-theme="dark"] .toast { background: #1d1c21; }
.toast::after {   /* the time left, as a yellow line */
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--brand); transform-origin: left; animation: toastTime 4.8s linear forwards;
}
.toast:hover::after { animation-play-state: paused; }
@keyframes toastTime { to { transform: scaleX(0); } }
.toast-ic {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; color: #111013;
  background: var(--brand);
}
.toast-ic svg { width: 16px; height: 16px; }
.toast.good .toast-ic { background: var(--status-good); color: #fff; }
.toast.warn .toast-ic { background: var(--status-warning); color: #111013; }
.toast.crit .toast-ic { background: var(--status-critical); color: #fff; }
.toast.ai .toast-ic svg { animation: twinkle 3.2s var(--ease) infinite; }
.toast strong { display: block; font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 1px; letter-spacing: -0.02em; }
.toast .t-body { color: rgba(255, 255, 255, 0.74); }
.toast .t-body strong { display: inline; font-size: inherit; color: #fff; }
.toast-act {
  display: inline-block; margin-top: 7px; background: none; border: none; color: var(--brand); font-weight: 700; font-size: 13px; padding: 0 0 1px;
  background-image: linear-gradient(var(--brand), var(--brand)); background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 1.5px;
}
.toast-act:hover { animation: underlineRun .5s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.out { animation: toastOut .35s ease forwards; }
@keyframes toastOut { to { transform: translateX(34px); opacity: 0; } }

/* ============ Notification panel ============ */
.notif-panel {
  display: none;
  position: absolute;
  top: calc(var(--appbar-h) + 6px);
  right: 18px;
  width: 430px; max-width: calc(100vw - 32px);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 95;
  overflow: hidden;
  color: var(--ink);
  transform-origin: top right;
}
.notif-panel.open { display: block; animation: popIn .3s var(--ease-out); }
.notif-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 18px 8px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.035em;
}
.notif-head span { font-size: 12px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.notif-summary {
  margin: 4px 12px 8px; padding: 12px 14px;
  border-radius: 12px; background: var(--surface);
  font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
}
.notif-summary .ns-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; }
.notif-summary .ns-head .ai-mark { width: 20px; height: 20px; border-radius: 5px; }
.notif-summary .ns-head .ai-mark svg { width: 11px; height: 11px; }
.notif-summary strong { color: var(--ink); font-weight: 600; }
.notif-list { max-height: 400px; overflow-y: auto; padding: 0 8px 8px; }
.notif-item { display: flex; gap: 12px; padding: 11px 10px; border-radius: 10px; font-size: 13.5px; transition: background .15s; }
.notif-item:hover { background: var(--fill-3); }
.notif-item .n-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
.notif-item .n-body { color: var(--ink-2); line-height: 1.5; }
.notif-item .n-body strong { color: var(--ink); font-weight: 600; }
.notif-item .n-time { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

/* ============ Agents / feed / recos ============ */
.agent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1280px) { .agent-grid { grid-template-columns: repeat(2, 1fr); } }
.agent-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 17px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.agent-card.clickable { cursor: pointer; transition: transform .4s var(--ease-out), box-shadow .3s; }
.agent-card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.agent-foot {
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  border-top: 1px solid var(--separator); padding-top: 9px;
  opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .35s var(--ease-out);
}
.agent-card.clickable:hover .agent-foot { opacity: 1; transform: none; }
.agent-top { display: flex; align-items: center; gap: 11px; }
.agent-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.agent-icon svg { width: 19px; height: 19px; }
.agent-name { font-weight: 700; font-size: 15px; letter-spacing: -0.03em; }
.agent-role { font-size: 12.5px; color: var(--ink-3); }
.agent-status { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--good-text); }
.agent-status .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--status-good); animation: livePulseG 1.8s infinite; }
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250, 196, 0, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(250, 196, 0, 0); }
}
@keyframes livePulseG {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-good) 45%, transparent); }
  50% { box-shadow: 0 0 0 5px transparent; }
}
.agent-stats { display: flex; gap: 16px; border-top: 1px solid var(--separator); padding-top: 10px; }
.agent-stat .as-val { font-family: var(--font-rounded); font-size: 18px; font-weight: 700; letter-spacing: -0.04em; }
.agent-stat .as-label { font-size: 11.5px; color: var(--ink-3); }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--separator); font-size: 14px; }
.feed-item:last-child { border-bottom: none; }
.feed-item.fresh { animation: rise .6s var(--ease-out) both; background: linear-gradient(90deg, var(--brand-wash), transparent 70%); }
.feed-body { flex: 1; min-width: 0; }
.feed-body .f-agent { font-size: 12px; font-weight: 700; letter-spacing: -0.005em; color: color-mix(in srgb, var(--tone, var(--ink)) 50%, var(--ink)); }
.feed-body .f-text { color: var(--ink-2); margin-top: 2px; }
.feed-body .f-text strong { color: var(--ink); font-weight: 600; }
.feed-time { font-size: 12px; color: var(--ink-3); white-space: nowrap; flex-shrink: 0; }

.reco {
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  margin-bottom: 10px;
  background: var(--fill-3);
  transition: background .2s;
}
.reco:hover { background: var(--fill-2); }
.reco-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.reco-title { font-weight: 700; font-size: 14.5px; letter-spacing: -0.025em; }
.reco-meta { display: flex; gap: 16px; margin: 8px 0 10px; flex-wrap: wrap; }
.reco-meta .rm { font-size: 12px; color: var(--ink-3); }
.reco-meta .rm strong { display: block; font-size: 15px; color: var(--ink); font-weight: 700; letter-spacing: -0.03em; }
.reco-meta .rm strong.good { color: var(--good-text); }
.reco-meta .rm strong.bad { color: var(--crit-text); }
.reco-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.reco.done { opacity: .62; }
.reco.new { box-shadow: inset 0 0 0 1.5px var(--brand); background: var(--brand-wash); }
.reco .approved-tag { color: var(--good-text); font-weight: 700; font-size: 13.5px; }
.reco .dismissed-tag { color: var(--ink-3); font-weight: 600; font-size: 13.5px; }

.alert-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--fill-3);
  transition: background .2s, box-shadow .2s;
}
.alert-row:hover { background: var(--fill-2); }
.alert-row .a-sev { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
.alert-row .a-main { flex: 1; min-width: 0; }
.alert-row .a-title { font-weight: 700; font-size: 14.5px; color: var(--ink); letter-spacing: -0.025em; }
.alert-row .a-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.alert-row .a-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex-shrink: 0; }
.alert-row.closed { opacity: .55; }

.playbook {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--fill-3);
  font-size: 14px;
}
.playbook .pb-ic { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; display: grid; place-items: center; }
.playbook .pb-ic svg { width: 15px; height: 15px; }
.playbook .pb-main { flex: 1; min-width: 0; }
.playbook .pb-name { font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.playbook .pb-sub { font-size: 12px; color: var(--ink-3); }

/* ============ Scenario studio ============ */
.sim-panel { display: flex; flex-direction: column; gap: 15px; }
.sim-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.sim-field select, .sim-field input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px; font-weight: 500;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.sim-field select:focus, .sim-field input[type="text"]:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(250, 196, 0, 0.3); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--range); }
.range-val {
  min-width: 66px; text-align: center;
  font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
  background: var(--brand); color: #111013;
  border-radius: 6px; padding: 4px 10px;
}
.sim-out-note {
  font-size: 13.5px; color: var(--ink-2);
  background: var(--fill-3);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand);
  padding: 11px 14px;
  line-height: 1.6;
}
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cmp { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px 14px; min-width: 0; }
.cmp .c-label { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cmp .c-base { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.cmp .c-now { font-family: var(--font-rounded); font-size: 23px; font-weight: 600; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.cmp .c-delta { font-size: 12.5px; font-weight: 700; }
.cmp .c-delta.bad { color: var(--crit-text); }
.cmp .c-delta.good { color: var(--good-text); }

.empty { padding: 30px; text-align: center; color: var(--ink-3); font-size: 15px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(17, 16, 19, 0.2); border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(17, 16, 19, 0.38); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.18); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.32); }
::-webkit-scrollbar-track { background: transparent; }

/* Section heading: big, tight, with a yellow full stop */
.section-title {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 34px 0 12px 2px;
  font-family: var(--font-display);
  font-size: 23px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.045em;
}
.section-title .st-dot { color: var(--brand); margin-left: -0.06em; }
.section-title small { font-family: var(--font); font-weight: 500; color: var(--ink-3); font-size: 13px; letter-spacing: -0.005em; }

.mt-16 { margin-top: 16px; }
.muted { color: var(--ink-3); }
.flex { display: flex; } .aic { align-items: center; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.flex.wrap { flex-wrap: wrap; }
.flex.wrap > * { min-width: 0; }
.spread { justify-content: space-between; }
.flex.spread > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex.spread > .badge, .flex.spread > :last-child:not(:first-child) { flex-shrink: 0; }

/* ============ Sankey tier legend ============ */
.tier-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  margin: 0 0 6px;
}
.tier-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.tier-legend i { width: 10px; height: 10px; border-radius: 2px; display: block; }
.tier-legend .tl-arrow { color: var(--ink-3); opacity: .5; font-weight: 400; }
.tier-legend .tl-single { margin-left: auto; color: var(--crit-text); }
.tier-legend .tl-single i { background: var(--status-critical); border-radius: 2px; width: 14px; height: 4px; }

/* ============ AI agent insights ============ */
.insight-btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 30px;
  padding: 3px 11px 3px 4px; font-size: 12.5px; font-weight: 700;
  color: var(--ink);
  background-color: var(--brand-wash);
  background-image: linear-gradient(var(--brand), var(--brand)); background-repeat: no-repeat; background-size: 0% 100%;
  border: 1px solid var(--brand-soft); border-radius: 8px;
  white-space: nowrap; cursor: pointer;
  transition: background-size .45s var(--ease), border-color .3s, color .3s, transform .18s var(--ease-out);
}
.insight-btn .ib-orb {
  width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center;
  color: var(--orb-ink); background: var(--orb-bg);
}
.insight-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.insight-btn:hover { background-size: 100% 100%; border-color: var(--brand); color: #111013; }
.insight-btn:hover .ib-orb { background: #111013; color: var(--brand); }
.insight-btn:hover .ib-orb svg { animation: twinkle .8s var(--ease); }
.insight-btn:active { transform: scale(.96); }
.ins-agent {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 16px;
  background: var(--ai-wash); border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand);
  font-size: 14px;
}
.ins-agent-chip {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--orb-bg); color: var(--orb-ink);
}
.ins-agent-chip svg { width: 16px; height: 16px; animation: twinkle 3.6s var(--ease) infinite; }
.ins-points { margin: 0 0 16px; padding-left: 18px; }
.ins-points li { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin-bottom: 8px; }
.ins-points li::marker { color: var(--brand-text); }
.ins-points li strong { color: var(--ink); font-weight: 600; }
.ins-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ins-ask { margin-top: 18px; }
.k-sub-link { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.k-sub-link:hover { filter: brightness(.92); }
.badge.chip-link { cursor: pointer; transition: background .15s, box-shadow .15s; }
.badge.chip-link:hover { box-shadow: 0 0 0 2px var(--brand); }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .rv { opacity: 1 !important; }
  .ticker-track { animation: none !important; }
  .cur { display: none !important; }
}

/* ============ Narrow-pane hardening ============ */
@media (max-width: 1150px) {
  .global-search { width: 220px; }
  .global-search:focus-within { width: 300px; }
  .crumb-scope { display: none; }
  .persona-pill .pp-cap { display: none; }
}
@media (max-width: 900px) {
  .agent-grid { grid-template-columns: 1fr; }
  .appbar { gap: 8px; padding: 0 10px; }
  .page { padding: calc(var(--appbar-h) + 14px) 14px 32px; }
  .copilot-launch span { display: none; }
  .persona-grid { grid-template-columns: 1fr; }
  .hero { padding: 24px 20px; }
  .hero-stat { padding: 0 14px; }
  .today-title { font-size: 26px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .gap-name { width: 110px; }
  .persona-pill .pp-meta { display: none; }
  .persona-pill { padding-right: 8px; }
  .global-search { width: 160px; }
  .crumbbar { display: none; }
  .shell, .shell.side-collapsed { --side-w: 66px; }
  .sidebar .nav-section, .sidebar .nav-item > span, .sidebar .nav-badge,
  .sidebar .nav-home-tag, .sidebar .brand-text, .sidebar .side-foot-text { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 10px 8px; }
  .side-brand { padding-left: 15px; }
  .side-foot { justify-content: center; }
  .side-handle { display: none; }
  .copilot-fab .fab-label, .copilot-fab .fab-kbd { display: none; }
  .copilot-fab { padding: 8px; }
}
