/* ==========================================================================
   AI Native Demo · dashboard (POC)
   Glass UI tokens adapted from the CutoffGenie UI guide.
   Light by default, dark from system, or either via the toggle.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #eceefb;
  --bg-2: #f7f5ff;
  --blob-1: rgba(167, 139, 250, 0.55);
  --blob-2: rgba(103, 232, 249, 0.45);
  --blob-3: rgba(249, 168, 212, 0.45);
  --blob-4: rgba(147, 197, 253, 0.55);
  --glass: linear-gradient(150deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.58));
  --card-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.66));
  --bar-bg: rgba(250, 250, 255, 0.84);
  --sheet-bg: rgba(248, 248, 255, 0.96);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-hi: rgba(255, 255, 255, 0.9);
  --shadow: 0 24px 48px -28px rgba(49, 46, 129, 0.35), 0 2px 6px rgba(49, 46, 129, 0.05);
  --shadow-sm: 0 14px 30px -22px rgba(49, 46, 129, 0.5), 0 1px 3px rgba(49, 46, 129, 0.05);
  --surface: #f7f7fd;
  --ring: #fbfbff;
  --ink: #15142b;
  --ink-2: #45435f;
  --ink-3: #5b5977;
  --hairline: rgba(21, 20, 43, 0.09);
  --grid: rgba(21, 20, 43, 0.08);
  --axis: rgba(21, 20, 43, 0.22);
  --field-bg: rgba(255, 255, 255, 0.6);
  --chip-bg: rgba(255, 255, 255, 0.7);
  --track: rgba(21, 20, 43, 0.1);
  --seg-active: #ffffff;
  --focus: rgba(124, 58, 237, 0.28);
  --info-bg: rgba(124, 58, 237, 0.08);
  --notice-bg: rgba(250, 178, 25, 0.14);
  --notice-border: rgba(250, 178, 25, 0.35);
  --accent-1: #6d28d9;
  --accent-2: #0891b2;
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 55%, #06b6d4 100%);
  --btn-grad: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --hero-ink: linear-gradient(180deg, #15142b 35%, #5b3fd6 100%);
  --good: #0ca30c;
  --ok-ink: #03694c;
  --ok-bg: rgba(5, 150, 105, 0.12);
  --warn-ink: #8a5a00;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --bad-ink: #b42318;
  --bad-bg: rgba(227, 73, 72, 0.12);

  /* validated categorical order (light surface) */
  --c1: #2a78d6;
  --c2: #008300;
  --c3: #e87ba4;
  --c4: #eda100;
  --c5: #1baf7a;
  --ref: #7a7896;             /* target / baseline reference lines */
  /* sequential (one hue, light → dark) */
  --s1: #dbe9fb; --s2: #a9cbf3; --s3: #6ea6e8; --s4: #2a78d6; --s5: #1d5fb3;

  --topbar-h: 64px;
  --sidebar-w: 258px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0a1a; --bg-2: #171433;
    --blob-1: rgba(124, 58, 237, 0.3); --blob-2: rgba(6, 182, 212, 0.18);
    --blob-3: rgba(236, 72, 153, 0.18); --blob-4: rgba(79, 70, 229, 0.28);
    --glass: linear-gradient(150deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    --card-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.03));
    --bar-bg: rgba(22, 20, 44, 0.84); --sheet-bg: rgba(24, 22, 46, 0.97);
    --glass-border: rgba(255, 255, 255, 0.13); --glass-hi: rgba(255, 255, 255, 0.14);
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 16px 32px -22px rgba(0, 0, 0, 0.8), 0 1px 4px rgba(0, 0, 0, 0.2);
    --surface: #1c1b33; --ring: #1a1930;
    --ink: #f4f3ff; --ink-2: #c6c4e2; --ink-3: #b8b6d6;
    --hairline: rgba(255, 255, 255, 0.1); --grid: rgba(255, 255, 255, 0.08); --axis: rgba(255, 255, 255, 0.24);
    --field-bg: rgba(255, 255, 255, 0.05); --chip-bg: rgba(255, 255, 255, 0.06);
    --track: rgba(255, 255, 255, 0.12); --seg-active: rgba(255, 255, 255, 0.14);
    --focus: rgba(167, 139, 250, 0.35); --info-bg: rgba(167, 139, 250, 0.1);
    --notice-bg: rgba(250, 178, 25, 0.12); --notice-border: rgba(250, 178, 25, 0.3);
    --accent-1: #b4a0fb; --accent-2: #22d3ee;
    --hero-ink: linear-gradient(180deg, #ffffff 30%, #c4b5fd 100%);
    --ok-ink: #6ee7b7; --ok-bg: rgba(52, 211, 153, 0.13);
    --warn-ink: #fcd34d; --warn-bg: rgba(251, 191, 36, 0.14);
    --bad-ink: #f59494; --bad-bg: rgba(230, 103, 103, 0.14);
    --c1: #3987e5; --c2: #008300; --c3: #d55181; --c4: #c98500; --c5: #199e70;
    --ref: #9a98b8;
    --s1: #1f2f4d; --s2: #24497a; --s3: #2c64aa; --s4: #3987e5; --s5: #7cb3f5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0a1a; --bg-2: #171433;
  --blob-1: rgba(124, 58, 237, 0.3); --blob-2: rgba(6, 182, 212, 0.18);
  --blob-3: rgba(236, 72, 153, 0.18); --blob-4: rgba(79, 70, 229, 0.28);
  --glass: linear-gradient(150deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  --card-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.03));
  --bar-bg: rgba(22, 20, 44, 0.84); --sheet-bg: rgba(24, 22, 46, 0.97);
  --glass-border: rgba(255, 255, 255, 0.13); --glass-hi: rgba(255, 255, 255, 0.14);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 16px 32px -22px rgba(0, 0, 0, 0.8), 0 1px 4px rgba(0, 0, 0, 0.2);
  --surface: #1c1b33; --ring: #1a1930;
  --ink: #f4f3ff; --ink-2: #c6c4e2; --ink-3: #b8b6d6;
  --hairline: rgba(255, 255, 255, 0.1); --grid: rgba(255, 255, 255, 0.08); --axis: rgba(255, 255, 255, 0.24);
  --field-bg: rgba(255, 255, 255, 0.05); --chip-bg: rgba(255, 255, 255, 0.06);
  --track: rgba(255, 255, 255, 0.12); --seg-active: rgba(255, 255, 255, 0.14);
  --focus: rgba(167, 139, 250, 0.35); --info-bg: rgba(167, 139, 250, 0.1);
  --notice-bg: rgba(250, 178, 25, 0.12); --notice-border: rgba(250, 178, 25, 0.3);
  --accent-1: #b4a0fb; --accent-2: #22d3ee;
  --hero-ink: linear-gradient(180deg, #ffffff 30%, #c4b5fd 100%);
  --ok-ink: #6ee7b7; --ok-bg: rgba(52, 211, 153, 0.13);
  --warn-ink: #fcd34d; --warn-bg: rgba(251, 191, 36, 0.14);
  --bad-ink: #f59494; --bad-bg: rgba(230, 103, 103, 0.14);
  --c1: #3987e5; --c2: #008300; --c3: #d55181; --c4: #c98500; --c5: #199e70;
  --ref: #9a98b8;
  --s1: #1f2f4d; --s2: #24497a; --s3: #2c64aa; --s4: #3987e5; --s5: #7cb3f5;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.modal-open { overflow: hidden; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- moving backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 70% at 50% -10%, var(--bg-2), var(--bg) 65%); }
.blob { position: absolute; width: 75vmax; height: 75vmax; border-radius: 50%; background: radial-gradient(closest-side, var(--c), transparent 72%); will-change: transform; animation: drift 28s ease-in-out infinite alternate; }
.b1 { --c: var(--blob-1); top: -30vmax; left: -25vmax; }
.b2 { --c: var(--blob-2); top: 5vh; right: -35vmax; animation-duration: 34s; animation-delay: -9s; }
.b3 { --c: var(--blob-3); bottom: -35vmax; left: -15vmax; animation-duration: 38s; animation-delay: -15s; }
.b4 { --c: var(--blob-4); bottom: -25vmax; right: -25vmax; animation-duration: 31s; animation-delay: -4s; }
@keyframes drift { 0% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(7vmax,5vmax,0) scale(1.08); } 100% { transform: translate3d(-5vmax,9vmax,0) scale(.94); } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } * { scroll-behavior: auto !important; } }
.grain { position: absolute; inset: 0; opacity: 0.06; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- glass ---------- */
.glass { position: relative; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); }
.card { position: relative; border-radius: 24px; padding: 20px; background: var(--card-bg); border: 1px solid var(--glass-border); box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); min-width: 0; }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card-head .grow { flex: 1; min-width: 0; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 16.5px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.3; }
.card-sub { margin-top: 4px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.card-sub b { color: var(--ink-2); }
.card-icon { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--chip-bg); border: 1px solid var(--hairline); color: var(--accent-1); }
.card-icon .i { width: 17px; height: 17px; }
.card-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); font-size: 12.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.card-foot b { color: var(--ink-2); }

/* info (i) button */
.info-btn {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border-radius: 50%; border: 1px solid var(--hairline); background: var(--chip-bg); color: var(--ink-3);
  cursor: pointer; transition: color .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.info-btn .i { width: 16px; height: 16px; }
.info-btn:hover { color: var(--accent-1); border-color: var(--accent-1); box-shadow: 0 0 0 4px var(--focus); }
.info-btn:active { transform: scale(.92); }
.info-btn.sm { width: 26px; height: 26px; }
.info-btn.sm .i { width: 14px; height: 14px; }

/* ---------- app shell ---------- */
.app-shell { display: block; }
.app-content { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 10px 16px; border-bottom: 1px solid transparent; transition: background .3s, border-color .3s;
}
.topbar.scrolled { background: var(--bar-bg); border-bottom-color: var(--glass-border); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%); }
.topbar .spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 11px; box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.6); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; min-width: 0; }
.brand-text strong { font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; }
.brand-text span { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.icon-btn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 14px; border: 1px solid var(--glass-border); background: var(--glass); cursor: pointer; transition: transform .2s; color: var(--ink-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .i { width: 20px; height: 20px; }
.i-moon { display: none; }
:root[data-effective="light"] .i-sun { display: none; }
:root[data-effective="light"] .i-moon { display: block; }

/* sidebar: drawer on small screens, sticky rail on desktop */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(300px, 86vw); display: flex; flex-direction: column;
  background: var(--sheet-bg); border-right: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  transform: translateX(-105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); overflow-y: auto; border-radius: 0 26px 26px 0;
}
.sidebar.open { transform: none; box-shadow: 0 0 80px rgba(0,0,0,.35); }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(11,10,26,.45); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.sidebar-top { display: flex; align-items: center; gap: 8px; padding: 18px 14px 14px 18px; }
.sidebar-nav { flex: 1; display: grid; align-content: start; gap: 2px; padding: 6px 12px; }
.nav-section { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 14px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 700; text-decoration: none; transition: background .2s, color .2s;
}
.nav-link:hover { background: var(--chip-bg); color: var(--ink); }
.nav-link .i { width: 20px; height: 20px; }
.nav-link .nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link .nav-num { font-size: 11px; font-weight: 800; color: var(--ink-3); background: var(--chip-bg); border: 1px solid var(--hairline); border-radius: 999px; padding: 1px 7px; }
.nav-link[aria-current="page"] { background: var(--seg-active); color: var(--ink); box-shadow: 0 2px 10px -4px rgba(15,12,40,.3); }
.nav-link[aria-current="page"] .i { color: var(--accent-1); }
.sidebar-bottom { display: grid; gap: 10px; padding: 12px 12px 18px; border-top: 1px solid var(--hairline); }
.side-theme { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--chip-bg); color: var(--ink-2); font-size: 14px; font-weight: 700; cursor: pointer; }
.side-theme:hover { color: var(--ink); border-color: var(--accent-1); }
.side-theme .i { width: 20px; height: 20px; }
.sidebar-credit { font-size: 11.5px; color: var(--ink-3); text-align: center; }

@media (min-width: 1000px) {
  .app-shell { display: flex; align-items: flex-start; min-height: 100vh; }
  .app-content { flex: 1; }
  .sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; width: var(--sidebar-w); transform: none; flex: none; background: var(--bar-bg); }
  .scrim, .menu-btn, .topbar .brand { display: none; }
  .topbar { justify-content: flex-end; }
}

/* ---------- layout ---------- */
.layout { max-width: 1320px; margin: 0 auto; padding: 4px 16px 72px; }
.intro { padding: 8px 2px 22px; display: grid; gap: 14px; }
.intro-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; justify-self: start; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--glass-border); color: var(--ink-2); }
.pulse { position: relative; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--good); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); opacity: .5; animation: pulse 2.4s infinite; }
@keyframes pulse { 70%, 100% { transform: scale(3); opacity: 0; } }
h1 { font-size: clamp(28px, 5.4vw, 42px); line-height: 1.08; font-weight: 800; letter-spacing: -0.035em; background: var(--hero-ink); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.lede { font-size: 15px; color: var(--ink-2); max-width: 52em; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 2px 14px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
}
@media (min-width: 1180px) {
  .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid.g3-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .grid.g1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .span-3 { grid-column: span 3; }
}
@media (min-width: 760px) and (max-width: 1179px) { .grid.g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- segmented control & chips ---------- */
.seg { display: inline-flex; max-width: 100%; padding: 3px; border-radius: 14px; border: 1px solid var(--glass-border); background: var(--glass); overflow-x: auto; }
.seg > button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 11px; background: none; color: var(--ink-3); font-size: 13.5px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s; }
.seg > button:hover { color: var(--ink); }
.seg > button[aria-pressed="true"] { background: var(--seg-active); color: var(--ink); box-shadow: 0 2px 8px -2px rgba(15,12,40,.25); }
.seg.seg-field { background: var(--field-bg); border-color: var(--hairline); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--chip-bg); color: var(--ink-2); font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: all .2s; }
.chip:hover { border-color: var(--accent-1); color: var(--ink); }
.chip[aria-pressed="true"] { color: #fff; background: var(--btn-grad); border-color: transparent; box-shadow: 0 8px 20px -10px rgba(79,70,229,.8); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--hairline); color: var(--ink-2); white-space: nowrap; }
.mock-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: var(--notice-bg); border: 1px solid var(--notice-border); color: var(--warn-ink); white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 14px; border: 0; font-size: 14px; font-weight: 700; cursor: pointer; color: #fff; background: var(--btn-grad); box-shadow: 0 10px 24px -10px rgba(79,70,229,.8); text-decoration: none; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--chip-bg); color: var(--ink-2); font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-ghost:hover { border-color: var(--accent-1); color: var(--ink); }

/* status pills — always icon + label, never colour alone */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; padding: 3px 9px 3px 7px; border-radius: 999px; white-space: nowrap; }
.status .i { width: 13px; height: 13px; stroke-width: 2.6; }
.status.good { background: var(--ok-bg); color: var(--ok-ink); }
.status.warn { background: var(--warn-bg); color: var(--warn-ink); }
.status.bad { background: var(--bad-bg); color: var(--bad-ink); }
.status.info { background: var(--info-bg); color: var(--accent-1); }

/* ---------- KPI tiles ---------- */
.kpi { display: grid; gap: 4px; padding: 16px 16px 14px; border-radius: 20px; background: var(--card-bg); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-hi); min-width: 0; }
.kpi-top { display: flex; align-items: flex-start; gap: 8px; }
.kpi-label { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--ink-3); line-height: 1.35; padding-top: 4px; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.kpi-value small { font-size: 14px; font-weight: 700; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }
.kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.kpi-meta { font-size: 12px; color: var(--ink-3); }
.kpi-meta b { color: var(--ink-2); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.delta .i { width: 13px; height: 13px; stroke-width: 2.6; }
.delta.good { color: var(--ok-ink); }
.delta.bad { color: var(--bad-ink); }
.delta.flat { color: var(--ink-3); }
.spark { width: 96px; height: 28px; flex: none; }
.spark svg { display: block; overflow: visible; }

/* hero */
.hero { display: grid; gap: 18px; padding: 24px; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); align-items: center; } }
.hero-label { font-size: 13px; font-weight: 700; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.hero-figure { font-size: clamp(56px, 9vw, 84px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; background: var(--hero-ink); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 8px 0 6px; padding-bottom: .05em; }
.hero-sub { font-size: 13.5px; color: var(--ink-2); max-width: 30em; }

/* meter */
.meter { display: grid; gap: 6px; }
.meter-track { position: relative; height: 8px; border-radius: 999px; background: var(--track); overflow: visible; }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent-grad); }
.meter-target { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--ink); }
.meter-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

/* theme scorecards */
.theme-card { display: grid; gap: 12px; align-content: start; }
.theme-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; font-weight: 800; font-size: 14px; color: #fff; background: var(--btn-grad); flex: none; }
.theme-metric { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.theme-value { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.theme-value strong { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.theme-owner { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* flow chain */
.chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.chain-step { flex: 1 1 150px; display: grid; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--chip-bg); border: 1px solid var(--hairline); font-size: 13px; font-weight: 700; }
.chain-step span { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.chain-arrow { display: grid; place-items: center; color: var(--ink-3); flex: none; }
@media (max-width: 759px) { .chain-arrow { display: none; } }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: inherit; }
.ax-text { fill: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.ax-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.ax-base { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.ref-line { stroke: var(--ref); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ref-text { fill: var(--ink-2); font-size: 11px; font-weight: 700; }
.end-label { fill: var(--ink); font-size: 12px; font-weight: 800; }
.cap-label { fill: var(--ink-2); font-size: 11.5px; font-weight: 700; }
.crosshair { stroke: var(--axis); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.legend-swatch { width: 12px; height: 12px; flex: none; border-radius: 4px; }
.legend-line { width: 16px; height: 0; border-top: 2px dashed var(--ref); flex: none; }
.chart-tip {
  position: fixed; z-index: 100; pointer-events: none; min-width: 140px; max-width: 280px; padding: 10px 12px; border-radius: 14px;
  background: var(--sheet-bg); border: 1px solid var(--glass-border); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  font-size: 12.5px; color: var(--ink); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.chart-tip.show { opacity: 1; transform: none; }
.tip-title { font-weight: 800; margin-bottom: 6px; }
.tip-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; line-height: 1.7; }
.tip-row .k { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-weight: 600; }
.tip-row .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.tip-sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* horizontal bars (HTML) */
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; gap: 5px; }
.hbar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.hbar-name { font-weight: 700; color: var(--ink); min-width: 0; display: flex; align-items: center; gap: 8px; }
.hbar-val { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.hbar-val small { font-weight: 600; color: var(--ink-3); }
.hbar-track { position: relative; height: 12px; }
.hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; min-width: 2px; transition: filter .15s; }
.hbar-bg { position: absolute; inset: 0; border-radius: 4px; background: var(--track); opacity: .55; }
.hbar-ref { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.hbar:hover .hbar-fill { filter: brightness(1.1); }

/* tall segmented bar */
.segbar { display: flex; gap: 2px; height: 28px; width: 100%; }
.segbar-part { height: 100%; border-radius: 4px; display: flex; align-items: center; padding: 0 8px; font-size: 12px; font-weight: 800; white-space: nowrap; overflow: visible; min-width: 0; transition: filter .15s; cursor: default; }
.segbar-part:hover, .segbar-part:focus-visible { filter: brightness(1.1); }
.segbar-row { display: grid; gap: 8px; }
.segbar-row + .segbar-row { margin-top: 14px; }
.segbar-cap { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }

/* status matrix */
.matrix-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.matrix, table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.matrix th, .data th { text-align: left; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--hairline); white-space: nowrap; vertical-align: bottom; }
.matrix td, .data td { padding: 9px 10px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.matrix tr:last-child td, .data tr:last-child td { border-bottom: 0; }
.matrix tbody tr:hover td, .data tbody tr:hover td { background: var(--chip-bg); }
.data td.n, .data th.n { text-align: right; font-variant-numeric: tabular-nums; }
.cell { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; }
.cell .i { width: 15px; height: 15px; stroke-width: 2.6; }
.cell.good { background: var(--ok-bg); color: var(--ok-ink); }
.cell.warn { background: var(--warn-bg); color: var(--warn-ink); }
.cell.bad { background: var(--bad-bg); color: var(--bad-ink); }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--hairline); white-space: nowrap; }
.stage-pill i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-style: normal; font-size: 11px; }
.team-name { font-weight: 700; white-space: nowrap; }
.team-org { font-size: 11.5px; color: var(--ink-3); }

/* stage ladder */
.stages { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stage { padding: 16px; border-radius: 20px; background: var(--chip-bg); border: 1px solid var(--hairline); display: grid; gap: 6px; align-content: start; }
.stage-k { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.stage-dot { width: 10px; height: 10px; border-radius: 3px; }
.stage-n { font-size: 17px; font-weight: 800; }
.stage-mult { font-size: 13px; font-weight: 700; color: var(--accent-1); }
.stage-d { font-size: 12.5px; color: var(--ink-3); }
.stage-count { margin-top: 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.stage-count small { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: 0; }

/* calculator */
.calc { display: grid; gap: 14px; }
.calc-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.range-field { display: grid; gap: 6px; }
.range-field label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--ink-3); text-transform: uppercase; }
.range-field label output { color: var(--ink); font-size: 13px; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--accent-1); }
.calc-out { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.calc-box { padding: 12px 14px; border-radius: 16px; background: var(--chip-bg); border: 1px solid var(--hairline); }
.calc-box .k { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.calc-box .v { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.calc-box.accent { background: var(--info-bg); border-color: transparent; }

/* timeline / roadmap */
.timeline { display: grid; gap: 10px; }
.tl-item { display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 14px; padding: 14px; border-radius: 18px; background: var(--chip-bg); border: 1px solid var(--hairline); }
.tl-weeks { font-size: 12px; font-weight: 800; color: var(--accent-1); padding-top: 2px; }
.tl-title { font-weight: 700; font-size: 14px; }
.tl-done { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.tl-bar { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.tl-bar .meter-track { flex: 1; height: 6px; }
.quarters { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .quarters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.q { padding: 16px; border-radius: 20px; background: var(--chip-bg); border: 1px solid var(--hairline); display: grid; gap: 8px; align-content: start; }
.q.current { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--focus); }
.q-k { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.q-focus { font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.q ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.q li { display: flex; gap: 8px; align-items: flex-start; }
.q li .i { margin-top: 3px; flex: none; }
.q li.ok .i { color: var(--ok-ink); }
.q li.prog .i { color: var(--warn-ink); }
.q li.todo .i { color: var(--ink-3); }

/* callout */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: var(--info-bg); font-size: 13.5px; color: var(--ink-2); }
.callout .i { color: var(--accent-1); width: 18px; height: 18px; margin-top: 2px; }
.callout b { color: var(--ink); }

/* ---------- modal (dialog) ---------- */
.sheet { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.sheet::backdrop { background: rgba(11,10,26,.5); animation: fade .25s ease both; }
.sheet-inner { display: flex; flex-direction: column; max-height: 92dvh; border-radius: 28px 28px 0 0; border: 1px solid var(--glass-border); border-bottom: 0; background: var(--sheet-bg); box-shadow: 0 -24px 60px -24px rgba(15,12,40,.5), inset 0 1px 0 var(--glass-hi); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); animation: sheet-up .38s cubic-bezier(.2,.8,.2,1) both; }
.sheet.closing .sheet-inner { animation: sheet-down .2s ease-in both; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { from { transform: none; } to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-grab { width: 40px; height: 5px; margin: 10px auto 0; flex: none; border-radius: 3px; background: var(--track); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 22px 14px; border-bottom: 1px solid var(--hairline); }
.sheet-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-1); }
.sheet-head h2 { margin-top: 4px; font-size: 21px; font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; }
.sheet-head h2:focus { outline: none; }
.sheet-body { overflow-y: auto; padding: 18px 22px 26px; display: grid; gap: 18px; }
.m-sec h3 { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.m-sec h3 .i { width: 14px; height: 14px; }
.m-sec p { font-size: 14px; color: var(--ink-2); }
.m-sec ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.formula { font-family: var(--mono); font-size: 13px; line-height: 1.6; padding: 12px 14px; border-radius: 14px; background: var(--field-bg); border: 1px solid var(--hairline); color: var(--ink); white-space: pre-wrap; }
.facts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fact { padding: 10px 12px; border-radius: 14px; background: var(--chip-bg); border: 1px solid var(--hairline); }
.fact .k { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fact .v { font-size: 14px; font-weight: 700; margin-top: 2px; }
.m-table { max-height: 300px; overflow: auto; border-radius: 14px; border: 1px solid var(--hairline); }
.m-table table { font-size: 12.5px; }
.m-table th { position: sticky; top: 0; background: var(--sheet-bg); }
@media (min-width: 760px) {
  .sheet { width: min(720px, calc(100% - 48px)); margin: auto; }
  .sheet-inner { border-radius: 28px; border-bottom: 1px solid var(--glass-border); max-height: 86dvh; animation: pop .28s cubic-bezier(.2,.8,.2,1) both; }
  .sheet.closing .sheet-inner { animation: pop-out .16s ease-in both; }
  .sheet-grab { display: none; }
  @keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes pop-out { to { transform: translateY(8px) scale(.98); opacity: 0; } }
}

.view-enter { animation: view-in .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-foot { margin-top: 36px; font-size: 12px; color: var(--ink-3); text-align: center; }

@media print {
  .sidebar, .topbar, .backdrop, .info-btn { display: none !important; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
}
@media (min-width: 1180px) { .grid.g2-swap { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

/* ---------- Flow & DORA section banners ---------- */
.band-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 18px; margin: 30px 0 16px; padding: 20px 22px; scroll-margin-top: 84px; }
.band-head:first-of-type { margin-top: 4px; }
.band-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; margin-top: 2px; }
.band-head .grow { flex: 1 1 320px; min-width: 0; }
.band-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 16px; color: #fff; background: var(--btn-grad); box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.8); }
.band-icon .i { width: 26px; height: 26px; }
.band-chips { flex: 0 1 420px; justify-content: flex-end; }
@media (max-width: 759px) { .band-chips { justify-content: flex-start; } }
.band-cur { display: inline-block; font-weight: 800; color: var(--ink); background: var(--info-bg); box-shadow: inset 0 0 0 1px var(--accent-1); padding: 3px 8px; border-radius: 8px; }
.seg > button .i { width: 16px; height: 16px; }

/* compact metric boxes (Overview DORA / Flow cards) */
.mini-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.mini { display: grid; gap: 4px; align-content: start; justify-items: start; padding: 12px 12px 12px 14px; border-radius: 16px; background: var(--chip-bg); border: 1px solid var(--hairline); }
.mini-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.mini-v { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.mini-v small { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
/* KPI tiles never wider than their grid cell */
.kpi { grid-template-columns: minmax(0, 1fr); }
.kpi-row { flex-wrap: wrap; row-gap: 6px; }
.kpi-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }

/* narrow phones: brand name needs the room; "mock data" is still shown in the page chip + footer */
@media (max-width: 440px) { .topbar .mock-badge { display: none; } }
