/* ═══════════════════════════════════════════════════════════════════
   AI Revenue Accelerator — global stylesheet
   Dark-first "AI revenue command center" theme (deep navy, glass panels,
   cyan → violet → magenta glow, gold highlights) with a full light theme.
   <html data-theme="light|dark">; default is dark.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Brand */
  --primary: #7c5cff;
  --primary-dark: #6246ea;
  --primary-soft: rgba(124, 92, 255, .16);
  --on-primary: #ffffff;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --magenta: #e879f9;
  --gold: #f5b83d;
  --grad: linear-gradient(135deg, #22d3ee 0%, #7c5cff 52%, #e879f9 100%);
  --grad-soft: linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(124, 92, 255, .18) 55%, rgba(232, 121, 249, .16));

  /* Surfaces (dark) */
  --bg: #060a1d;
  --bg-glow: radial-gradient(1100px 600px at 85% -10%, rgba(124, 92, 255, .20), transparent 60%),
             radial-gradient(900px 500px at -10% 30%, rgba(34, 211, 238, .10), transparent 60%),
             radial-gradient(800px 500px at 60% 120%, rgba(232, 121, 249, .10), transparent 60%);
  --surface: rgba(17, 24, 58, .72);
  --surface-solid: #0e1430;
  --surface-2: rgba(30, 40, 88, .55);
  --surface-3: rgba(44, 56, 120, .45);
  --border: rgba(125, 140, 255, .16);
  --border-strong: rgba(140, 155, 255, .32);
  --text: #e8ebff;
  --text-muted: #9aa3d0;
  --text-faint: #6b74a3;

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .14);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, .14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, .14);

  /* Chart palette — validated (dataviz validator, dark surface #0e1430). Fixed order. */
  --c1: #0891b2; --c2: #8b5cf6; --c3: #d97706; --c4: #ec4899; --c5: #3b82f6; --c6: #059669;
  --chart-grid: rgba(140, 155, 255, .10);
  --chart-axis: #6b74a3;

  --sidebar-bg: rgba(8, 12, 32, .85);
  --sidebar-text: #9aa3d0;
  --sidebar-active: #ffffff;
  --sidebar-hover: rgba(124, 92, 255, .12);
  --sidebar-w: 256px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  --glow: 0 0 0 1px rgba(124, 92, 255, .25), 0 8px 32px rgba(76, 60, 200, .25);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: 160ms cubic-bezier(.4, 0, .2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --primary: #5b3df5;
  --primary-dark: #4527d6;
  --primary-soft: rgba(91, 61, 245, .10);
  --bg: #f3f5fb;
  --bg-glow: radial-gradient(1000px 500px at 90% -10%, rgba(124, 92, 255, .10), transparent 60%),
             radial-gradient(800px 400px at -10% 20%, rgba(34, 211, 238, .08), transparent 60%);
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f6f7fc;
  --surface-3: #eceffa;
  --border: #e3e6f2;
  --border-strong: #cdd2e8;
  --text: #0f1530;
  --text-muted: #5a6385;
  --text-faint: #8d94b3;
  --success: #059669; --success-soft: #ecfdf5;
  --warning: #b45309; --warning-soft: #fffbeb;
  --danger: #dc2626; --danger-soft: #fef2f2;
  --info: #2563eb; --info-soft: #eff6ff;
  /* Light chart palette — validated against #ffffff. Same hue order. */
  --c1: #0891b2; --c2: #7c3aed; --c3: #d97706; --c4: #db2777; --c5: #2563eb; --c6: #059669;
  --chart-grid: #eceff7;
  --chart-axis: #8d94b3;
  --sidebar-bg: #0b1030;
  --sidebar-text: #a3abd6;
  --shadow-sm: 0 1px 2px rgba(15, 23, 60, .06), 0 1px 3px rgba(15, 23, 60, .06);
  --shadow-md: 0 8px 24px rgba(15, 23, 60, .08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 60, .18);
  --glow: 0 1px 2px rgba(15, 23, 60, .05), 0 6px 20px rgba(15, 23, 60, .06);
  color-scheme: light;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14.5px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg-glow), var(--bg); background-attachment: fixed; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--violet); text-decoration: none; }
:where(:root[data-theme="light"]) a { color: var(--primary); }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }
code, pre { font-family: var(--mono); font-size: .86em; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: .85rem; }
.xs { font-size: .76rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.up { color: var(--success); }
.down { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: rgba(124, 92, 255, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ── Layout helpers ────────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-kpi { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.split { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.spacer { flex: 1; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem 1rem; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap;
  transition: background var(--ease), border-color var(--ease), opacity var(--ease), box-shadow var(--ease), transform var(--ease);
  text-decoration: none !important;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, #3b82f6, #7c5cff 55%, #c026d3); color: #fff; box-shadow: 0 6px 20px rgba(124, 92, 255, .35); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 28px rgba(124, 92, 255, .5); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.95); }
.btn-success { background: var(--success); color: #04120c; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-xs { padding: .2rem .5rem; font-size: .74rem; border-radius: 7px; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { position: relative; width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--magenta); color: #1a0520; font-size: .65rem; font-weight: 800; display: grid; place-items: center; }

/* ── Forms ─────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.field .hint { font-size: .76rem; color: var(--text-faint); }
.input, .select, .textarea {
  width: 100%; padding: .58rem .75rem; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface-solid); transition: border-color var(--ease), box-shadow var(--ease);
}
.select { padding-right: 2rem; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-sm, .select-sm { padding: .35rem .6rem; font-size: .84rem; border-radius: 8px; width: auto; }
.checkbox { display: flex; align-items: flex-start; gap: .5rem; font-size: .88rem; }
.checkbox input { margin-top: .2rem; accent-color: var(--primary); }
.code-input { letter-spacing: .4em; font-family: var(--mono); text-align: center; font-size: 1.3rem; }
.form-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.toggle { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 22px; transition: var(--ease); cursor: pointer; border: 1px solid var(--border-strong); }
.toggle span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: var(--ease); }
.toggle input:checked + span { background: linear-gradient(135deg, #22d3ee, #7c5cff); border-color: transparent; }
.toggle input:checked + span::after { transform: translateX(16px); }

/* ── Panels / cards ────────────────────────────────────────────────── */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--glow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card.glow::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(34, 211, 238, .55), rgba(124, 92, 255, .25) 40%, transparent 60%, rgba(232, 121, 249, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card-body { padding: 1.15rem 1.25rem; }
.card-header { padding: .9rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-header h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--text); }
.card-header .sub { font-size: .78rem; color: var(--text-muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.card-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 650; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-primary { background: var(--primary-soft); color: var(--violet); border-color: transparent; }
:root[data-theme="light"] .badge-primary { color: var(--primary); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-gold { background: rgba(245, 184, 61, .14); color: var(--gold); border-color: transparent; }
.badge-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: pulse 1.6s infinite; }
.badge-sample { background: rgba(245, 184, 61, .16); color: var(--gold); border: 1px dashed rgba(245, 184, 61, .5); text-transform: uppercase; letter-spacing: .06em; }
@keyframes pulse { 50% { opacity: .35; } }

.alert { padding: .75rem 1rem; border-radius: 10px; font-size: .88rem; border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--info-soft); color: var(--info); }

.stat { padding: 1.1rem 1.25rem; }
.stat .label { font-size: .74rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.stat .value { font-size: 1.7rem; font-weight: 650; margin-top: .25rem; font-variant-numeric: tabular-nums; }

/* KPI tile (stat tile + sparkline) */
.kpi { padding: 1rem 1.1rem .8rem; display: flex; flex-direction: column; gap: .2rem; min-height: 132px; overflow: hidden; }
.kpi .kpi-top { display: flex; align-items: center; gap: .6rem; }
.kpi .kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--cyan); border: 1px solid var(--border); flex: none; }
.kpi .kpi-icon svg { width: 17px; height: 17px; }
.kpi .label { font-size: .7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; line-height: 1.2; }
.kpi .value { font-family: var(--display); font-size: 1.65rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: .35rem; }
.kpi .delta { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.kpi .delta .up, .kpi .delta .down { font-weight: 700; }
.kpi .spark { margin-top: auto; height: 34px; }
.kpi.accent .value { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); }
.empty svg { margin: 0 auto .75rem; opacity: .5; }

/* ── Tables ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); padding: .6rem 1rem; border-bottom: 1px solid var(--border); font-weight: 700; white-space: nowrap; }
.table td { padding: .62rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .total td { font-weight: 700; border-top: 1px solid var(--border-strong); }

/* ── Tabs & chips ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { background: none; border: none; padding: .6rem .9rem; color: var(--text-muted); font-weight: 600; font-size: .88rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--cyan); }
.tabs button .count { margin-left: .35rem; font-size: .7rem; padding: .05rem .4rem; border-radius: 8px; background: var(--surface-2); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { padding: .28rem .7rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: .78rem; cursor: pointer; color: var(--text-muted); font-weight: 600; }
.chip.active, .chip:hover { color: var(--text); border-color: var(--primary); background: var(--primary-soft); }

/* ── Filter bar ────────────────────────────────────────────────────── */
.filterbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 1rem; }
.filterbar label { font-size: .72rem; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ── Progress, meters ──────────────────────────────────────────────── */
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--grad); }
.meter-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: .75rem; align-items: center; font-size: .85rem; padding: .35rem 0; }

/* ── App shell ─────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--border); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.15rem 1.15rem 1rem; color: #fff; font-weight: 700; font-size: .98rem; line-height: 1.15; }
.sidebar .brand small { display: block; font-size: .68rem; color: var(--sidebar-text); font-weight: 500; letter-spacing: .04em; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .25), transparent 50%), var(--grad); box-shadow: 0 0 22px rgba(124, 92, 255, .55); color: #fff; }
.brand-mark svg { width: 22px; height: 22px; }
.tenant-pill { margin: 0 .9rem .5rem; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--border); background: rgba(124, 92, 255, .08); font-size: .8rem; color: #dfe3ff; }
.tenant-pill .t-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-pill select { width: 100%; background: transparent; border: none; color: #dfe3ff; font-weight: 650; padding: 0; }
.tenant-pill select option { color: #0f1530; }
.nav { padding: .35rem .65rem; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-section { font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; padding: 1rem .7rem .35rem; color: #5b6390; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .52rem .7rem; border-radius: 10px; color: var(--sidebar-text); font-size: .88rem; font-weight: 550; text-decoration: none; position: relative; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--sidebar-hover); color: #e2e6ff; }
.nav a.active { background: linear-gradient(90deg, rgba(124, 92, 255, .30), rgba(34, 211, 238, .08)); color: var(--sidebar-active); box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .35); }
.nav a.active svg { color: var(--cyan); filter: drop-shadow(0 0 6px rgba(34, 211, 238, .7)); }
.nav a .nav-count { margin-left: auto; font-size: .68rem; font-weight: 800; padding: .05rem .45rem; border-radius: 9px; background: var(--magenta); color: #1a0520; }
.sidebar-assist { margin: .5rem .9rem; padding: .85rem; border-radius: 14px; background: linear-gradient(160deg, rgba(124, 92, 255, .28), rgba(232, 121, 249, .12)); border: 1px solid rgba(167, 139, 250, .35); font-size: .78rem; color: #dfe3ff; }
.sidebar-assist strong { display: block; font-size: .85rem; margin-bottom: .2rem; }
.sidebar-foot { padding: .85rem 1rem; border-top: 1px solid var(--border); font-size: .8rem; }
.sidebar-foot .who { color: #e2e6ff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); margin-right: .35rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; border-bottom: 1px solid var(--border); background: rgba(6, 10, 29, .6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10; }
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, .8); }
.topbar h1 { font-size: 1.12rem; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.topbar .subtitle { font-size: .76rem; color: var(--text-muted); }
.topbar .clock { font-family: var(--mono); font-size: .8rem; color: var(--text-muted); }
.menu-btn { display: none; }
.content { padding: 1.4rem 1.5rem 3rem; max-width: 1560px; width: 100%; }
.page-head { margin-bottom: 1.1rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h2 { font-family: var(--display); font-size: 1.45rem; font-weight: 600; }
.page-head p { color: var(--text-muted); margin-top: .2rem; max-width: 760px; }
.banner { padding: .55rem 1.5rem; font-size: .85rem; display: flex; align-items: center; gap: .75rem; justify-content: center; }
.banner-warning { background: var(--warning-soft); color: var(--warning); }
.banner-sample { background: repeating-linear-gradient(135deg, rgba(245, 184, 61, .10) 0 12px, rgba(245, 184, 61, .05) 12px 24px); color: var(--gold); border-bottom: 1px solid rgba(245, 184, 61, .25); }
.banner-platform { background: rgba(232, 121, 249, .10); color: var(--magenta); border-bottom: 1px solid rgba(232, 121, 249, .25); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 50; transform: translateX(-100%); transition: transform var(--ease); background: #080c22; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open .main::before { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 40; }
  .menu-btn { display: inline-flex; }
  .content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .topbar .clock, .topbar .subtitle { display: none; }
}

/* ── Modal & toast ─────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 5, 18, .7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 1rem; z-index: 100; animation: fade .12s ease; }
.modal { background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 2rem); overflow: auto; }
.modal-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surface-solid); z-index: 1; }
.modal-head h3 { font-size: 1.02rem; }
.modal-body { padding: 1.25rem; }
.modal-foot { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; position: sticky; bottom: 0; background: var(--surface-solid); }

.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 200; }
.toast { min-width: 260px; max-width: 400px; padding: .75rem 1rem; border-radius: 12px; background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md); font-size: .88rem; animation: rise .18s ease; }
.toast-error { border-color: var(--danger); }
.toast-success { border-color: var(--success); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--cyan); border-radius: 50%; animation: spin .7s linear infinite; }
.page-loading { display: grid; place-items: center; min-height: 40vh; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Charts ────────────────────────────────────────────────────────── */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-label { fill: var(--chart-axis); font-size: 11px; font-family: var(--font); }
.chart .baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart .crosshair { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 150px; padding: .55rem .7rem; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md); font-size: .78rem; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.chart-tip .t-title { font-weight: 700; margin-bottom: .25rem; color: var(--text); }
.chart-tip .t-row { display: flex; align-items: center; gap: .45rem; color: var(--text-muted); }
.chart-tip .t-row b { margin-left: auto; padding-left: .8rem; color: var(--text); font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.swatch.line { height: 3px; border-radius: 2px; }
.swatch.dash { height: 0; border-top: 2px dashed; background: none !important; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--text-muted); margin-top: .6rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 1rem; align-items: center; }
@media (max-width: 520px) { .donut-wrap { grid-template-columns: 1fr; } }
.donut-legend { display: flex; flex-direction: column; gap: .5rem; font-size: .84rem; }
.donut-legend .row-between { gap: .5rem; flex-wrap: nowrap; }

/* ── Domain components ─────────────────────────────────────────────── */
.hero-strip { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 1.1rem 1.3rem; margin-bottom: 1rem; border-radius: var(--radius); background: linear-gradient(110deg, rgba(34, 211, 238, .12), rgba(124, 92, 255, .18) 45%, rgba(232, 121, 249, .12)); border: 1px solid rgba(124, 92, 255, .35); }
.hero-strip h2 { font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.hero-strip p { color: var(--text-muted); font-size: .88rem; }
@media (max-width: 700px) { .hero-strip { grid-template-columns: 1fr; } }

.agent-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.agent-card { padding: 1rem 1.1rem; cursor: pointer; transition: transform var(--ease), box-shadow var(--ease); }
.agent-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(124, 92, 255, .45), 0 12px 36px rgba(76, 60, 200, .35); }
.agent-avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: .85rem; letter-spacing: .02em; box-shadow: 0 0 18px var(--agent-color, #7c5cff); background: var(--agent-color, #7c5cff); }
.agent-card .mission { color: var(--text-muted); font-size: .8rem; margin: .6rem 0 .75rem; min-height: 3.6em; }
.agent-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; font-size: .74rem; color: var(--text-faint); }
.agent-stats b { display: block; font-size: .95rem; color: var(--text); font-variant-numeric: tabular-nums; }

.org { display: flex; flex-direction: column; align-items: center; gap: .9rem; padding: .5rem 0 1rem; }
.org-root { padding: .6rem 1rem; border-radius: 12px; border: 1px solid rgba(167, 139, 250, .6); background: var(--grad-soft); font-weight: 700; display: flex; align-items: center; gap: .6rem; box-shadow: 0 0 24px rgba(124, 92, 255, .35); }
.org-children { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; position: relative; padding-top: .9rem; border-top: 1px dashed var(--border-strong); }
.org-node { padding: .4rem .65rem; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: .78rem; display: flex; align-items: center; gap: .45rem; cursor: pointer; }
.org-node i { width: 8px; height: 8px; border-radius: 50%; }
.org-node.paused { opacity: .5; }

.feed { display: flex; flex-direction: column; gap: 0; max-height: 440px; overflow: auto; }
.feed-item { display: grid; grid-template-columns: 26px 1fr auto; gap: .6rem; padding: .55rem .2rem; border-bottom: 1px solid var(--border); font-size: .82rem; align-items: start; }
.feed-item:last-child { border-bottom: none; }
.feed-item .lvl { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); }
.feed-item .lvl svg { width: 14px; height: 14px; }
.feed-item.guardrail .lvl { background: rgba(232, 121, 249, .16); color: var(--magenta); }
.feed-item.error .lvl { background: var(--danger-soft); color: var(--danger); }
.feed-item.warn .lvl { background: var(--warning-soft); color: var(--warning); }
.feed-item .when { font-size: .72rem; color: var(--text-faint); white-space: nowrap; }
.feed-item.fresh { animation: flash 1.4s ease; }
@keyframes flash { from { background: rgba(34, 211, 238, .15); } }

.rec { padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); display: grid; grid-template-columns: 40px 1fr auto; gap: .8rem; align-items: start; transition: border-color var(--ease); }
.rec:hover { border-color: var(--border-strong); }
.rec .rec-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); color: var(--cyan); border: 1px solid var(--border); }
.rec .rec-icon svg { width: 18px; height: 18px; }
.rec h4 { font-size: .92rem; font-weight: 650; }
.rec p { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.rec .impact { text-align: right; font-family: var(--display); font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
.rec .impact small { display: block; font-family: var(--font); font-size: .7rem; color: var(--text-faint); font-weight: 600; }
@media (max-width: 600px) { .rec { grid-template-columns: 1fr; } .rec .impact { text-align: left; } }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: .8rem; overflow-x: auto; }
.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .7rem; min-height: 200px; }
.kanban-col h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); display: flex; justify-content: space-between; margin-bottom: .6rem; }
.deal { padding: .6rem .7rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: .5rem; font-size: .8rem; cursor: pointer; }
.deal:hover { border-color: var(--primary); }
.deal .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.deal.ai { border-left: 3px solid var(--violet); }

.flow { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; align-items: start; }
.flow-step { text-align: center; font-size: .74rem; color: var(--text-muted); position: relative; }
.flow-step .fi { width: 52px; height: 52px; margin: 0 auto .45rem; border-radius: 14px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid rgba(124, 92, 255, .45); box-shadow: 0 0 18px rgba(124, 92, 255, .25); color: var(--cyan); }
.flow-step .fi svg { width: 22px; height: 22px; }
.flow-step b { display: block; color: var(--text); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.flow-step:not(:last-child)::after { content: ''; position: absolute; top: 26px; left: calc(50% + 32px); right: calc(-50% + 32px); height: 2px; background: linear-gradient(90deg, var(--cyan), var(--magenta)); opacity: .55; }
@media (max-width: 760px) { .flow { grid-template-columns: repeat(3, 1fr); row-gap: 1rem; } .flow-step::after { display: none; } }
.flow.compact { grid-template-columns: repeat(3, 1fr); row-gap: 1.1rem; }
.flow.compact .flow-step:nth-child(3n)::after { display: none; }
.flow.compact .fi { width: 44px; height: 44px; }
.flow.compact .flow-step::after { top: 22px; left: calc(50% + 28px); right: calc(-50% + 28px); }

.calc-steps { display: flex; flex-direction: column; }
.calc-step { display: grid; grid-template-columns: 28px 1fr auto; gap: .75rem; padding: .65rem 0; border-bottom: 1px dashed var(--border); align-items: center; }
.calc-step .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .75rem; font-weight: 800; background: var(--surface-2); border: 1px solid var(--border); }
.calc-step .f { font-size: .74rem; color: var(--text-faint); font-family: var(--mono); }
.calc-step .v { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-step.final { border-bottom: none; }
.calc-step.final .v { font-size: 1.35rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hash { font-family: var(--mono); font-size: .7rem; color: var(--text-faint); word-break: break-all; }

.matrix td, .matrix th { text-align: center; padding: .45rem .5rem; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.perm { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; display: inline-grid; place-items: center; }
.perm.on { background: linear-gradient(135deg, #22d3ee, #7c5cff); border-color: transparent; color: #fff; }
.perm.override { box-shadow: 0 0 0 2px var(--gold); }
.perm svg { width: 13px; height: 13px; }

.kv { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: .45rem 1rem; font-size: .86rem; }
.kv dt { color: var(--text-muted); }
.kv dd { font-variant-numeric: tabular-nums; }
pre.json { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .75rem; font-size: .74rem; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* AI Assistant */
.chat-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1rem; height: calc(100vh - 150px); min-height: 460px; }
.chat-history, .chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-list { flex: 1; overflow-y: auto; padding: .5rem; display: flex; flex-direction: column; gap: 2px; }
.chat-item { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .65rem; border-radius: 10px; color: var(--text) !important; text-decoration: none !important; border: 1px solid transparent; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--primary-soft); border-color: rgba(124, 92, 255, .35); }
.chat-item-title { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; }
.chat-msg { display: flex; flex-direction: column; max-width: 82%; }
.chat-msg.user { align-self: flex-end; align-items: flex-end; }
.chat-msg.assistant { align-self: flex-start; }
.chat-bubble { padding: .65rem .9rem; border-radius: 12px; line-height: 1.55; }
.chat-bubble.user { background: var(--primary); color: var(--on-primary); white-space: pre-wrap; }
.chat-bubble.assistant { background: var(--surface-2); border: 1px solid var(--border); }
.chat-meta { font-size: .7rem; color: var(--text-faint); margin-top: .25rem; padding: 0 .3rem; }
@media (max-width: 860px) { .chat-shell { grid-template-columns: 1fr; height: auto; } .chat-history { max-height: 220px; } .chat-main { height: 70vh; } }

/* Markdown in AI replies */
.md { line-height: 1.6; }
.md .md-h1 { font-weight: 700; font-size: 1.08rem; margin: .7rem 0 .25rem; }
.md .md-h2 { font-weight: 700; font-size: 1rem; margin: .65rem 0 .2rem; }
.md .md-h3 { font-weight: 700; font-size: .94rem; margin: .55rem 0 .15rem; color: var(--text); }
.md .md-list { margin: .25rem 0 .25rem 1.25rem; }
.md .md-list li { margin: .12rem 0; }
.md .md-gap { height: .45rem; }
.md .md-hr { border: none; border-top: 1px solid var(--border); margin: .6rem 0; }
.md .md-quote { border-left: 3px solid var(--primary); padding: .15rem .7rem; color: var(--text-muted); margin: .3rem 0; }
.md code { background: var(--surface-3); padding: .05rem .35rem; border-radius: 5px; }
.md .md-code { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; padding: .7rem .85rem; overflow-x: auto; margin: .4rem 0; white-space: pre; }
.md .md-code code { background: none; padding: 0; }
.md .md-table { margin: .4rem 0; border: 1px solid var(--border); border-radius: 10px; }
.md .md-table .table td, .md .md-table .table th { padding: .4rem .65rem; }
.md strong { color: var(--text); }

/* Printable statement */
.statement { background: #fff; color: #111827; border-radius: 12px; padding: 2rem; }
.statement h1 { font-size: 1.4rem; }
.statement .table th { color: #6b7280; }
.statement .table td, .statement .table th { border-color: #e5e7eb; }
.statement .table tbody tr:hover { background: none; }
.statement .calc-step { border-color: #e5e7eb; }
.statement .calc-step .n { background: #f3f4f6; border-color: #e5e7eb; }
.statement .calc-step .f, .statement .hash { color: #6b7280; }
.statement .calc-step.final .v { background: none; color: #4c1d95; -webkit-text-fill-color: #4c1d95; }
.statement .muted { color: #6b7280; }
@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .banner, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .statement { padding: 0; }
  .card { box-shadow: none; border: none; backdrop-filter: none; }
}

/* ── Auth pages ────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card-body { padding: 2rem; }
.auth-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; margin-bottom: 1.5rem; color: var(--text); text-decoration: none !important; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: .35rem; font-family: var(--display); }
.auth-card .sub { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .92rem; }
.auth-foot { text-align: center; margin-top: 1.25rem; font-size: .88rem; color: var(--text-muted); }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--text-faint); font-size: .8rem; margin: 1.1rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Marketing pages ───────────────────────────────────────────────── */
.site-header { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; max-width: 1180px; margin: 0 auto; }
@media (max-width: 640px) { .site-header { gap: .4rem; padding: .8rem 1rem; flex-wrap: wrap; } .site-header .hide-sm { display: none; } .site-header .btn { padding: .45rem .7rem; } .site-header .brand small { display: none !important; } }
.site-header .brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); text-decoration: none !important; font-size: 1.05rem; }
.hero { max-width: 1180px; margin: 0 auto; padding: 4.5rem 1.5rem 3rem; display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-family: var(--display); font-size: clamp(2.1rem, 4.6vw, 3.5rem); letter-spacing: -0.03em; font-weight: 600; line-height: 1.08; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 1.1rem; color: var(--text-muted); margin: 1.25rem 0 2rem; max-width: 560px; }
.hero-visual { position: relative; aspect-ratio: 1.15; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero p { margin-left: auto; margin-right: auto; } .hero .row { justify-content: center; } }
.section { max-width: 1180px; margin: 0 auto; padding: 3rem 1.5rem; }
.section h2 { font-family: var(--display); font-size: 1.9rem; text-align: center; margin-bottom: .6rem; font-weight: 600; }
.section .lead { text-align: center; color: var(--text-muted); max-width: 680px; margin: 0 auto 2rem; }
.feature { padding: 1.4rem; }
.feature .icon { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-soft); color: var(--cyan); display: grid; place-items: center; margin-bottom: .9rem; border: 1px solid var(--border); }
.feature .icon svg { width: 20px; height: 20px; }
.feature h3 { font-size: 1rem; margin-bottom: .35rem; }
.feature p { color: var(--text-muted); font-size: .9rem; }
.price-card { padding: 2rem; text-align: center; }
.price-card .big { font-family: var(--display); font-size: 2.6rem; font-weight: 600; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; }
.site-footer .inner { max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem; display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; color: var(--text-muted); font-size: .86rem; }
.site-footer a { color: var(--text-muted); }
.prose { max-width: 780px; margin: 0 auto; padding: 3rem 1.5rem; }
.prose h1 { font-size: 2rem; margin-bottom: .5rem; font-family: var(--display); }
.prose h2 { font-size: 1.2rem; margin: 2rem 0 .6rem; }
.prose p, .prose li { color: var(--text-muted); margin-bottom: .75rem; }
.prose ul { padding-left: 1.25rem; }
.prose pre { background: var(--surface-2); border: 1px solid var(--border); padding: 1rem; border-radius: 10px; overflow-x: auto; margin-bottom: 1rem; color: var(--text); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── Landing: the app shown on a laptop ─────────────────────────────── */
.device { max-width: 1120px; margin: 0 auto; }
.device-lid { position: relative; padding: 14px 14px 16px; border-radius: 22px 22px 6px 6px; background: linear-gradient(180deg, #2a2f45, #12152a); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 40px 90px -30px rgba(76, 45, 220, .55), 0 0 0 1px rgba(0, 0, 0, .4) inset; }
.device-cam { position: absolute; top: 5px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #05060c; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.device-screen { border-radius: 8px; overflow: hidden; background: var(--bg); background-image: var(--bg-glow); border: 1px solid #000; }
.device-base { position: relative; height: 18px; margin: 0 -5%; border-radius: 0 0 18px 18px; background: linear-gradient(180deg, #c9cddc, #8d92a8 55%, #5d6178); box-shadow: 0 22px 30px -18px rgba(0, 0, 0, .7); }
.device-base span { position: absolute; top: 0; left: 50%; width: 14%; height: 7px; transform: translateX(-50%); border-radius: 0 0 10px 10px; background: linear-gradient(180deg, #7e8399, #a6abbf); }
.device-hint { text-align: center; margin-top: 1rem; }
.browser-bar { display: flex; align-items: center; gap: .8rem; padding: .55rem .8rem; background: var(--surface-solid); border-bottom: 1px solid var(--border); }
.browser-bar .dots { display: flex; gap: 6px; flex: none; width: 54px; }
.browser-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.browser-bar .dots i:nth-child(2) { background: #febc2e; }
.browser-bar .dots i:nth-child(3) { background: #28c840; }
.browser-bar .url { flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .3rem .8rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: .74rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-bar .url svg { color: var(--success); flex: none; }
.browser-spacer { width: 54px; flex: none; }
.mock-app { display: grid; grid-template-columns: 210px minmax(0, 1fr); height: 640px; }
.mock-side { background: var(--sidebar-bg); color: var(--sidebar-text); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.mock-side .brand { display: flex; align-items: center; gap: .6rem; padding: .95rem .9rem .8rem; color: #fff; font-weight: 700; font-size: .86rem; line-height: 1.15; }
.mock-side .brand small { display: block; font-size: .66rem; color: var(--sidebar-text); font-weight: 500; }
.mock-side .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.mock-side .brand-mark svg { width: 18px; height: 18px; }
.mock-side .tenant-pill { margin: 0 .7rem .4rem; font-size: .74rem; }
.mock-side .nav { padding: .25rem .5rem; }
.mock-side .nav a, .mock-side .nav .nav-static { display: flex; align-items: center; gap: .6rem; padding: .42rem .6rem; border-radius: 9px; font-size: .78rem; font-weight: 550; color: var(--sidebar-text); text-decoration: none; }
.mock-side .nav .nav-static { opacity: .55; cursor: default; }
.mock-side .nav svg { width: 15px; height: 15px; flex: none; }
.mock-side .nav-section { padding: .7rem .6rem .25rem; font-size: .6rem; }
.mock-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.mock-main .topbar { position: static; height: 56px; padding: 0 1.1rem; flex: none; }
.mock-main .topbar h1 { font-size: .95rem; }
.mock-main .topbar .subtitle { font-size: .72rem; }
.mock-content { flex: 1; overflow-y: auto; padding: 1rem 1.1rem 1.4rem; overscroll-behavior: contain; }
.mock-content .split { grid-template-columns: 1.4fr 1fr; }
.mock-pane { animation: mockIn .35s ease; }
@keyframes mockIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) { .mock-content .split { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .device-lid { padding: 8px 8px 10px; border-radius: 14px 14px 4px 4px; }
  .device-cam { top: 2px; width: 4px; height: 4px; }
  .device-base { height: 12px; margin: 0 -3%; }
  .browser-bar .dots, .browser-spacer { display: none; }
  .mock-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 600px; }
  .mock-content .grid-kpi { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .mock-content .kpi .value { font-size: 1.3rem; }
  .mock-content .kpi .delta { display: none; }
  .mock-content .kpi { min-height: 0; height: auto; padding: .8rem; }
  .mock-content .rec { grid-template-columns: 1fr !important; }
  .mock-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .mock-side .brand, .mock-side .tenant-pill, .mock-side .nav-section, .mock-side .nav .nav-static { display: none; }
  .mock-side .nav { flex-direction: row; overflow-x: auto; padding: .45rem; }
  .mock-side .nav a { white-space: nowrap; }
  .hide-mock-sm { display: none; }
  .mock-content { padding: .8rem; }
}

/* ── Landing: narrative sections ─────────────────────────────────────── */
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; padding: .6rem 1rem; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 650; }
.skip-link:focus { top: 1rem; }
.site-nav { display: flex; gap: .25rem; }
.site-footer a:focus-visible, .section a:focus-visible, .faq-item summary:focus-visible, .mock-side .nav a:focus-visible, .skip-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
.hero-facts { list-style: none; margin-top: 1.4rem; display: grid; gap: .45rem; font-size: .92rem; color: var(--text-muted); }
.hero-facts li { display: flex; gap: .5rem; align-items: flex-start; }
.hero-facts svg { width: 18px; height: 18px; flex: none; color: var(--success); margin-top: .12rem; }
@media (max-width: 900px) { .hero-facts { justify-content: center; justify-items: start; } .hero-facts li { text-align: left; } }
.fit-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.ps-list { list-style: none; display: grid; gap: .9rem; }
.ps-row { display: grid; grid-template-columns: 1fr 44px 1.15fr; align-items: stretch; gap: .6rem; }
.ps-problem, .ps-solution { padding: 1.15rem 1.3rem; border-radius: var(--radius); border: 1px solid var(--border); }
.ps-problem { background: var(--surface-2); }
.ps-solution { background: var(--surface); box-shadow: inset 3px 0 0 var(--primary); }
.ps-row h3 { font-size: 1.02rem; margin: .35rem 0 .3rem; }
.ps-row p { color: var(--text-muted); font-size: .9rem; }
.ps-tag { font-size: .66rem; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.ps-tag.ok { color: var(--cyan); }
:root[data-theme="light"] .ps-tag.ok { color: var(--primary); }
.ps-arrow { display: grid; place-items: center; color: var(--text-muted); }
.ps-arrow svg { width: 22px; height: 22px; }
@media (max-width: 760px) { .ps-row { grid-template-columns: 1fr; } .ps-arrow { transform: rotate(90deg); height: 22px; } }

.steps { list-style: none; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.step { position: relative; padding: 1.4rem 1.4rem 1.3rem; }
.step-n { position: absolute; top: 1.1rem; right: 1.2rem; font-family: var(--display); font-size: 1.6rem; font-weight: 600; color: var(--text-muted); opacity: .55; }
.step .icon { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-soft); color: var(--cyan); display: grid; place-items: center; margin-bottom: .9rem; border: 1px solid var(--border); }
.step .icon svg { width: 20px; height: 20px; }
.step h3 { font-size: 1rem; margin-bottom: .35rem; }
.step p { color: var(--text-muted); font-size: .9rem; }
.step dfn { font-style: normal; font-weight: 650; color: var(--text); }
.cta-inline { margin-top: 1.6rem; justify-content: center; text-align: center; }

.agent-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.ag-kicker { display: inline-block; font-size: .66rem; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; color: var(--cyan); margin-bottom: .35rem; }
:root[data-theme="light"] .ag-kicker { color: var(--primary); }
.sample-note { text-align: center; max-width: 760px; margin: .6rem auto 0; }

.pricing-explain { margin-top: 1rem; }
.explain-list { list-style: none; display: grid; gap: .7rem; font-size: .92rem; color: var(--text-muted); }
.explain-list b { color: var(--text); }

.faq { max-width: 820px; margin: 0 auto; display: grid; gap: .6rem; }
.faq-item { padding: 0; }
.faq-item summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; line-height: 1; color: var(--text-muted); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 1.2rem 1.1rem; color: var(--text-muted); font-size: .92rem; }

.cta-band { text-align: center; padding: 2.4rem 1.5rem; }
.cta-band p { color: var(--text-muted); max-width: 640px; margin: 0 auto 1.2rem; }
.next-steps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.2rem; margin: 0 auto 1.6rem; font-size: .9rem; }
.next-steps li { display: flex; align-items: center; gap: .45rem; }
.next-steps b { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: .75rem; background: var(--grad-soft); border: 1px solid var(--border); }
.mock-main .topbar .mock-h { font-size: .95rem; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* ─── Getting started checklist (views/onboarding.js) ─────────────────────── */
.ob-progress { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-top: .6rem; }
.ob-progress span { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.ob-stages { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; padding: 0; }
.ob-stages li { font-size: .74rem; font-weight: 650; padding: .15rem .6rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-faint); }
.ob-stages li.past { color: var(--success); border-color: transparent; background: var(--success-soft); }
.ob-stages li.current { color: var(--on-primary); background: var(--primary); border-color: transparent; }
.ob-next { font-family: var(--display, inherit); font-size: 1.15rem; margin-top: .2rem; }
.ob-steps { list-style: none; padding: 0; display: grid; gap: .6rem; }
.ob-step { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.ob-step.attention { border-color: var(--warning); }
.ob-head { width: 100%; display: flex; align-items: center; gap: .85rem; padding: .85rem 1.1rem; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ob-head:hover { background: var(--surface-2); }
.ob-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ob-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .8rem; font-weight: 700; border: 1px solid var(--border-strong); color: var(--text-muted); }
.ob-step.done .ob-num { background: var(--success-soft); color: var(--success); border-color: transparent; }
.ob-step.attention .ob-num { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.ob-title { flex: 1; min-width: 0; font-weight: 650; display: flex; flex-direction: column; gap: .1rem; }
.ob-who { font-weight: 500; }
.ob-body { padding: 0 1.1rem 1.1rem 3.95rem; display: grid; gap: .75rem; font-size: .9rem; }
.ob-body ul { padding-left: 1.1rem; display: grid; gap: .25rem; margin-top: .25rem; }
.ob-facts ul { list-style: none; padding: 0; }
.ob-facts li { display: flex; gap: .45rem; align-items: flex-start; font-size: .86rem; }
.ob-facts li.ok > span:first-child { color: var(--success); }
.ob-facts li.warn > span:first-child { color: var(--warning); }
.ob-facts li.no > span:first-child { color: var(--text-faint); }
.ob-actions { gap: .5rem; align-items: center; }
.ob-tasks { padding-left: 1.1rem; display: grid; gap: .35rem; }
@media (max-width: 640px) { .ob-body { padding-left: 1.1rem; } .ob-head .badge { display: none; } }

/* ─── Help & guides (views/help.js) ───────────────────────────────────────── */
.kb-search { padding: 1rem 1.25rem; margin-bottom: 1.25rem; display: grid; gap: .5rem; }
.kb-search-label { font-weight: 650; }
.kb-search-row { display: flex; gap: .5rem; }
.kb-search-row .input { flex: 1; min-width: 0; }
.kb-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: .6rem; }
.kb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; }
.kb-item { display: grid; gap: .25rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; }
.kb-item:hover { border-color: var(--primary); }
.kb-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.kb-item span { font-size: .84rem; color: var(--text-muted); }
.kb-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.kb-cat h4 { font-size: .95rem; }
.kb-cat .kpi-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--cyan); border: 1px solid var(--border); flex: none; }
.kb-links { margin-top: .6rem; padding-left: 1.1rem; display: grid; gap: .3rem; font-size: .88rem; }
.kb-faq { border-bottom: 1px solid var(--border); padding: .6rem 0; }
.kb-faq:last-child { border-bottom: 0; }
.kb-faq summary { cursor: pointer; font-weight: 600; }
.kb-faq > div { margin-top: .4rem; color: var(--text-muted); }
.kb-crumbs { margin-bottom: .75rem; color: var(--text-muted); display: flex; gap: .4rem; flex-wrap: wrap; }
.kb-article { max-width: 860px; }
.kb-article h2 { font-size: 1.5rem; }
.kb-article h2:focus { outline: none; }
.kb-lead { font-size: 1rem; color: var(--text-muted); margin-top: .4rem; }
.kb-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; margin: 1rem 0 .5rem; padding: .75rem 1rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.kb-meta dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--text-faint); }
.kb-sec { margin-top: 1.25rem; }
.kb-sec h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: .5rem; }
.kb-sec ol, .kb-sec ul { padding-left: 1.3rem; display: grid; gap: .45rem; }
.kb-sec ol li::marker { font-weight: 700; color: var(--primary); }
.kb-problems { display: grid; gap: .6rem; }
.kb-problems dt { font-weight: 650; }
.kb-problems dd { margin: .15rem 0 0; color: var(--text-muted); }
.kb-review ul { padding-left: 1.1rem; margin-top: .35rem; }
@media (max-width: 640px) { .kb-search-row { flex-direction: column; } .kb-cats, .kb-list { grid-template-columns: 1fr; } }
.ob-body .alert { display: flex; gap: .5rem; align-items: flex-start; }
.ob-body .alert svg { flex: none; margin-top: .15rem; }
