/* ============================================================
   TOKENS
   ============================================================ */
:root{
  color-scheme: light;
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #EEF0F6;
  --surface-3: #E5E7F1;
  --border: #DFE1EC;
  --border-strong: #CBCEDF;
  --text-primary: #14151F;
  --text-secondary: #585B70;
  --text-muted: #8B8EA3;
  --accent: #5A5FE0;
  --accent-strong: #4548C4;
  --accent-soft: #ECEDFC;
  --accent-ink: #FFFFFF;
  --shadow-1: 0 1px 2px rgba(20,21,31,0.06);
  --shadow-2: 0 8px 24px rgba(20,21,31,0.12);
  --status-good: #0ca30c;
  --status-good-soft: #E3F6E3;
  --status-warning: #c98100;
  --status-warning-soft: #FBEDD3;
  --status-serious: #c85a30;
  --status-serious-soft: #FBE6DC;
  --status-critical: #d03b3b;
  --status-critical-soft: #FBE1E1;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme: dark;
    --bg: #0A0B10;
    --surface: #12141C;
    --surface-2: #1A1D28;
    --surface-3: #232636;
    --border: #262A3A;
    --border-strong: #33374A;
    --text-primary: #F3F4FA;
    --text-secondary: #A9ACC2;
    --text-muted: #6E7189;
    --accent: #7C82F5;
    --accent-strong: #9298FF;
    --accent-soft: rgba(124,130,245,0.16);
    --accent-ink: #0A0B10;
    --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-2: 0 12px 32px rgba(0,0,0,0.5);
    --status-good: #2fd12f;
    --status-good-soft: rgba(47,209,47,0.14);
    --status-warning: #fab219;
    --status-warning-soft: rgba(250,178,25,0.14);
    --status-serious: #ec835a;
    --status-serious-soft: rgba(236,131,90,0.14);
    --status-critical: #f0605f;
    --status-critical-soft: rgba(240,96,95,0.14);
  }
}
:root[data-theme="dark"]{
  color-scheme: dark;
  --bg: #0A0B10;
  --surface: #12141C;
  --surface-2: #1A1D28;
  --surface-3: #232636;
  --border: #262A3A;
  --border-strong: #33374A;
  --text-primary: #F3F4FA;
  --text-secondary: #A9ACC2;
  --text-muted: #6E7189;
  --accent: #7C82F5;
  --accent-strong: #9298FF;
  --accent-soft: rgba(124,130,245,0.16);
  --accent-ink: #0A0B10;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 12px 32px rgba(0,0,0,0.5);
  --status-good: #2fd12f;
  --status-good-soft: rgba(47,209,47,0.14);
  --status-warning: #fab219;
  --status-warning-soft: rgba(250,178,25,0.14);
  --status-serious: #ec835a;
  --status-serious-soft: rgba(236,131,90,0.14);
  --status-critical: #f0605f;
  --status-critical-soft: rgba(240,96,95,0.14);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,*::before,*::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", ui-sans-serif, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,p,figure{ margin:0; }
button, input, select, textarea{ font: inherit; color: inherit; }
button{ cursor:pointer; background:none; border:none; padding:0; -webkit-appearance:none; appearance:none; }
a{ color: inherit; text-decoration:none; }
::selection{ background: var(--accent); color: var(--accent-ink); }
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mono{ font-family: ui-monospace, "Cascadia Code", "Consolas", "SFMono-Regular", Menlo, monospace; font-variant-numeric: tabular-nums; direction:ltr; unicode-bidi:isolate; }
html[dir="rtl"] body{ font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, ui-sans-serif, sans-serif; }
html[dir="rtl"] .search-input svg{ left:auto; right:10px; }
html[dir="rtl"] .search-input input{ padding-left:10px; padding-right:32px; }
html[dir="rtl"] .back-to-marketing svg, html[dir="rtl"] .chev-next{ transform:scaleX(-1); }
html[dir="rtl"] .steps-rule{ left:0; right:0; }
.hero-panel{ direction:ltr; }
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   PRIMITIVES
   ============================================================ */
.btn{
  display:inline-flex; align-items:center; gap:6px; justify-content:center;
  height:34px; padding:0 14px; border-radius:8px; border:1px solid transparent;
  font-size:13px; font-weight:600; white-space:nowrap; transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover{ background: var(--accent-strong); }
.btn-ghost{ background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
.btn-ghost:hover{ background: var(--surface-2); border-color: var(--text-muted); }
.btn-subtle{ background: var(--surface-2); color: var(--text-primary); border-color: var(--border-strong); }
.btn-subtle:hover{ background: var(--surface-3); border-color: var(--text-muted); }
.btn-danger{ background: var(--status-critical-soft); color: var(--status-critical); border-color: transparent; }
.btn-danger:hover{ background: var(--status-critical); color: #fff; }
.btn-sm{ height:28px; padding:0 10px; font-size:12px; border-radius:7px; }
.btn[disabled]{ opacity:0.45; cursor:not-allowed; }
.icon-btn{ width:32px; height:32px; display:inline-flex; align-items:center; justify-content:center; border-radius:7px; border:1px solid transparent; background:transparent; color: var(--text-secondary); transition: background 150ms ease, color 150ms ease; }
.icon-btn:hover{ background: var(--surface-2); color: var(--text-primary); }

.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:12px; font-weight:600; color: var(--text-secondary); }
.field .hint{ font-size:12px; color: var(--text-muted); }
.input, .select{
  height:34px; padding:0 10px; border-radius:7px; border:1px solid var(--border-strong);
  background: var(--surface); color: var(--text-primary); font-size:13px; width:100%;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input:focus, .select:focus{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline:none; }
.input.mono{ font-size:12.5px; }
textarea.input{ height:auto; padding:8px 10px; resize:vertical; }
.search-input{ position:relative; }
.search-input svg{ position:absolute; left:10px; top:50%; transform:translateY(-50%); color: var(--text-muted); }
.search-input input{ padding-left:32px; }

.card{ background: var(--surface); border:1px solid var(--border); border-radius:12px; }
.card-pad{ padding:18px; }

.badge{ display:inline-flex; align-items:center; gap:5px; height:22px; padding:0 9px; border-radius:999px; font-size:11.5px; font-weight:700; letter-spacing:.2px; }
.badge-dot{ width:6px; height:6px; border-radius:999px; background:currentColor; flex:none; }
.badge-good{ background: var(--status-good-soft); color: var(--status-good); }
.badge-warning{ background: var(--status-warning-soft); color: var(--status-warning); }
.badge-serious{ background: var(--status-serious-soft); color: var(--status-serious); }
.badge-critical{ background: var(--status-critical-soft); color: var(--status-critical); }
.badge-neutral{ background: var(--surface-2); color: var(--text-secondary); }
.badge-accent{ background: var(--accent-soft); color: var(--accent-strong); }

.chip{ display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 12px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--text-secondary); font-size:12.5px; font-weight:600; transition:background 150ms ease,color 150ms ease,border-color 150ms ease; }
.chip:hover{ background:var(--surface-2); color:var(--text-primary); }
.chip[aria-pressed="true"]{ background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }

.pulse-dot{ position:relative; width:8px; height:8px; border-radius:999px; background:currentColor; flex:none; }
@media (prefers-reduced-motion: no-preference){
  .pulse-dot.live::after{ content:""; position:absolute; inset:-4px; border-radius:999px; border:1.5px solid currentColor; opacity:0.6; animation: pulse-ring 2.2s ease-out infinite; }
}
@keyframes pulse-ring{ 0%{ transform:scale(0.6); opacity:0.7; } 100%{ transform:scale(1.9); opacity:0; } }

.section-title{ font-size:15px; font-weight:700; letter-spacing:-.1px; }
.eyebrow{ font-size:11px; font-weight:700; letter-spacing:1.2px; text-transform:uppercase; color: var(--accent); }
.divider{ height:1px; background:var(--border); border:none; margin:0; }

/* table */
.table{ width:100%; border-collapse:collapse; font-size:13px; }
.table th{ text-align:start; font-size:11px; font-weight:700; letter-spacing:.4px; text-transform:uppercase; color:var(--text-muted); padding:0 14px 10px; border-bottom:1px solid var(--border); white-space:nowrap; }
.table td{ padding:12px 14px; border-bottom:1px solid var(--border); vertical-align:middle; }
.table tbody tr{ transition: background 120ms ease; cursor:pointer; }
.table tbody tr:hover{ background: var(--surface-2); }
.table tbody tr:last-child td{ border-bottom:none; }
.cell-primary{ font-weight:600; color:var(--text-primary); }
.cell-sub{ color:var(--text-muted); font-size:12px; margin-top:2px; }

/* scroll container for wide content */
.scroll-x{ overflow-x:auto; }

/* stat tile */
.stat-tile{ display:flex; flex-direction:column; gap:10px; }
.stat-label{ font-size:12px; font-weight:600; color:var(--text-secondary); }
.stat-value{ font-size:26px; font-weight:700; letter-spacing:-.5px; display:flex; align-items:baseline; gap:8px; }
.stat-value .unit{ font-size:14px; font-weight:600; color:var(--text-muted); }
.stat-delta{ font-size:12px; font-weight:700; display:inline-flex; align-items:center; gap:4px; }
.stat-delta.up{ color: var(--status-good); }
.stat-delta.down{ color: var(--status-critical); }
.stat-foot{ display:flex; align-items:center; justify-content:space-between; }

/* toggle switch */
.toggle{ position:relative; width:36px; height:20px; border-radius:999px; background:var(--surface-3); border:1px solid var(--border-strong); transition: background 150ms ease; flex:none; }
.toggle::after{ content:""; position:absolute; top:1px; left:1px; width:16px; height:16px; border-radius:999px; background:var(--surface); box-shadow:var(--shadow-1); transition: transform 150ms ease; }
.toggle[aria-checked="true"]{ background:var(--accent); border-color:var(--accent); }
.toggle[aria-checked="true"]::after{ transform:translateX(16px); background:#fff; }

/* modal / drawer */
.overlay{ position:fixed; inset:0; background:rgba(6,7,12,0.5); backdrop-filter:blur(2px); z-index:60; opacity:0; pointer-events:none; transition:opacity 180ms ease; }
.overlay.open{ opacity:1; pointer-events:auto; }
.modal{ position:fixed; top:50%; left:50%; transform:translate(-50%,-46%); width:min(560px,92vw); max-height:86vh; overflow:auto; background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow-2); z-index:61; opacity:0; pointer-events:none; transition:opacity 180ms ease, transform 180ms ease; }
.overlay.open + .modal, .modal.open{ opacity:1; pointer-events:auto; transform:translate(-50%,-50%); }
.drawer{ position:fixed; top:0; right:0; bottom:0; width:min(480px,94vw); background:var(--surface); border-left:1px solid var(--border); box-shadow:var(--shadow-2); z-index:61; transform:translateX(100%); transition:transform 220ms ease; display:flex; flex-direction:column; }
.drawer.open{ transform:translateX(0); }
.modal-head, .drawer-head{ display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid var(--border); }
.modal-body, .drawer-body{ padding:18px; display:flex; flex-direction:column; gap:16px; overflow:auto; }
.modal-foot{ display:flex; justify-content:flex-end; gap:8px; padding:14px 18px; border-top:1px solid var(--border); }

/* chart svgs */
svg.spark, .hero-wave, #fleet-pulse, .drawer-body svg{ display:block; }
svg.chart-interactive{ cursor:crosshair; }
.chart-hit{ cursor:crosshair; }
#chart-tooltip{ position:fixed; z-index:70; transform:translate(-50%,-100%); background:var(--text-primary); color:var(--bg); font-size:11.5px; font-weight:700; padding:4px 8px; border-radius:6px; pointer-events:none; display:none; white-space:nowrap; font-family: ui-monospace, Consolas, monospace; }

/* theme toggle */
.theme-toggle{ position:relative; width:32px; height:32px; border-radius:7px; border:1px solid transparent; background:transparent; color:var(--text-secondary); display:inline-flex; align-items:center; justify-content:center; transition:background 150ms ease,color 150ms ease; }
.theme-toggle:hover{ background:var(--surface-2); color:var(--text-primary); }
.theme-toggle svg{ position:absolute; transition:opacity 200ms ease, transform 300ms ease; }
.theme-toggle .icon-sun{ opacity:0; transform:rotate(-60deg) scale(.5); }
.theme-toggle .icon-moon{ opacity:1; transform:rotate(0) scale(1); }
html[data-theme="dark"] .theme-toggle .icon-sun{ opacity:1; transform:rotate(0) scale(1); }
html[data-theme="dark"] .theme-toggle .icon-moon{ opacity:0; transform:rotate(60deg) scale(.5); }

/* toast */
.toast-stack{ position:fixed; top:16px; inset-inline-end:16px; z-index:90; display:flex; flex-direction:column; gap:8px; max-width:320px; }
.toast{ display:flex; align-items:center; gap:9px; background:var(--text-primary); color:var(--bg); padding:11px 14px; border-radius:10px; box-shadow:var(--shadow-2); font-size:12.5px; font-weight:600; opacity:0; transform:translateY(-6px); transition:opacity 200ms ease, transform 200ms ease; }
.toast.show{ opacity:1; transform:translateY(0); }
.toast svg{ flex:none; color:var(--status-good); }

/* interactive / clickable cards */
.card-link{ cursor:pointer; transition:box-shadow 150ms ease, border-color 150ms ease, transform 150ms ease; }
.card-link:hover{ box-shadow:var(--shadow-2); border-color:var(--border-strong); }
.card-link:active{ transform:translateY(1px); }

/* code block */
.code-block{ background:var(--surface-2); border:1px solid var(--border); border-radius:9px; padding:12px 14px; font-size:12.5px; overflow-x:auto; position:relative; }
.code-block .copy-btn{ position:absolute; top:8px; right:8px; }

/* scrollbar (webkit) minor polish */
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-thumb{ background:var(--border-strong); border-radius:8px; border:2px solid var(--bg); }

/* ============================================================
   LANGUAGE DOCK (persistent, every page)
   ============================================================ */
.lang-dock{ position:fixed; bottom:16px; left:50%; transform:translateX(-50%); z-index:80; }
.lang-switch{ display:flex; gap:2px; padding:3px; background:var(--surface); border:1px solid var(--border); border-radius:999px; box-shadow:var(--shadow-2); }
.lang-switch button{ border:none; background:transparent; height:28px; width:34px; border-radius:999px; font-size:11px; font-weight:800; color:var(--text-secondary); font-family: ui-monospace, Consolas, monospace; }
.lang-switch button[aria-current="true"]{ background:var(--text-primary); color:var(--bg); }

/* ============================================================
   LANDING
   ============================================================ */
.landing{ max-width:1180px; margin:0 auto; padding:0 28px 100px; }
.landing-nav{ display:flex; align-items:center; justify-content:space-between; padding:22px 0; }
.brand{ display:flex; align-items:center; gap:9px; font-weight:800; font-size:15px; letter-spacing:-.2px; }
.brand-mark{ width:26px; height:26px; border-radius:7px; background:var(--accent); display:flex; align-items:center; justify-content:center; flex:none; }
.brand-mark svg{ color:var(--accent-ink); }
.landing-nav-links{ display:flex; align-items:center; gap:26px; font-size:13px; font-weight:600; color:var(--text-secondary); }
.landing-nav-links a:hover{ color:var(--text-primary); }
.landing-nav-cta{ display:flex; align-items:center; gap:10px; }

.hero{ display:grid; grid-template-columns:1.05fr 0.95fr; gap:56px; align-items:center; padding:56px 0 88px; }
.hero-eyebrow{ display:inline-flex; align-items:center; gap:7px; }
.hero h1{ font-size:46px; line-height:1.08; letter-spacing:-1.4px; font-weight:800; margin:16px 0 18px; text-wrap:balance; }
.hero h1 em{ font-style:normal; color:var(--accent); }
.hero p.lead{ font-size:16.5px; line-height:1.6; color:var(--text-secondary); max-width:46ch; margin-bottom:26px; }
.hero-cta{ display:flex; gap:12px; align-items:center; }
.hero-cta .btn{ height:42px; padding:0 20px; font-size:13.5px; }
.hero-meta{ margin-top:18px; font-size:12px; color:var(--text-muted); }

.hero-panel{ background:var(--surface); border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow-2); overflow:hidden; }
.hero-panel-head{ display:flex; align-items:center; gap:8px; padding:12px 16px; border-bottom:1px solid var(--border); }
.hero-panel-head .dot{ width:9px; height:9px; border-radius:999px; background:var(--surface-3); }
.hero-panel-body{ padding:18px; display:flex; flex-direction:column; gap:14px; }
.hero-wave{ width:100%; height:120px; }

.section{ padding:64px 0; border-top:1px solid var(--border); }
.section-head{ max-width:56ch; margin-bottom:34px; }
.section-head h2{ font-size:26px; font-weight:800; letter-spacing:-.6px; margin:8px 0 10px; text-wrap:balance; }
.section-head p{ color:var(--text-secondary); font-size:14.5px; line-height:1.6; }

.problem-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.problem-card{ padding:20px; border-radius:12px; background:var(--surface); border:1px solid var(--border); }
.problem-card p{ font-size:14.5px; line-height:1.55; color:var(--text-primary); }
.problem-card .num{ font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size:12px; color:var(--text-muted); margin-bottom:10px; display:block; }

.steps{ display:grid; grid-template-columns:repeat(4,1fr); gap:0; position:relative; }
.step-card{ padding:22px 20px 0; position:relative; }
.step-card .step-num{ width:34px; height:34px; border-radius:9px; background:var(--accent-soft); color:var(--accent-strong); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px; margin-bottom:16px; font-family: ui-monospace, Consolas, monospace; }
.step-card h3{ font-size:15px; font-weight:700; margin-bottom:6px; }
.step-card p{ font-size:13.3px; color:var(--text-secondary); line-height:1.55; }
.steps-rule{ position:absolute; top:39px; left:0; right:0; height:1px; background:var(--border); z-index:0; }

.persona-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:14px; }
.persona-card{ padding:16px; border-radius:11px; border:1px solid var(--border); background:var(--surface); }
.persona-card h4{ font-size:13px; font-weight:700; margin-bottom:6px; }
.persona-card p{ font-size:12px; color:var(--text-secondary); line-height:1.5; }

.plans-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:14px; }
.plan-card{ padding:18px 16px; border-radius:12px; border:1px solid var(--border); background:var(--surface); display:flex; flex-direction:column; gap:12px; }
.plan-card.featured{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.plan-name{ font-size:13px; font-weight:800; }
.plan-limits{ display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--text-secondary); }
.plan-limits b{ color:var(--text-primary); font-family: ui-monospace, Consolas, monospace; }

.cta-band{ margin-top:20px; padding:40px; border-radius:16px; background: var(--text-primary); color: var(--bg); display:flex; align-items:center; justify-content:space-between; gap:24px; }
.cta-band h3{ font-size:21px; font-weight:800; letter-spacing:-.4px; }
.cta-band p{ color: var(--bg); opacity:0.7; font-size:13.5px; margin-top:6px; }
.cta-band .btn-primary{ background:var(--bg); color:var(--text-primary); }

.landing-footer{ padding-top:36px; margin-top:20px; border-top:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; font-size:12px; color:var(--text-muted); }
.landing-footer .links{ display:flex; gap:18px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell{ display:grid; grid-template-columns:224px 1fr; min-height:100vh; transition:grid-template-columns 200ms ease; }
.sidebar{ background:var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; padding:16px 12px; gap:4px; position:sticky; top:0; height:100vh; }
.sidebar-brand{ display:flex; align-items:center; gap:9px; padding:6px 8px 18px; }
.sidebar-brand .brand{ font-size:14px; }
.nav-group{ display:flex; flex-direction:column; gap:2px; }
.nav-item{ position:relative; display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; font-size:13px; font-weight:600; color:var(--text-secondary); transition:background 130ms ease,color 130ms ease,padding 130ms ease; border-inline-start:3px solid transparent; }
.nav-item svg{ flex:none; }
.nav-item:hover{ background:var(--surface-2); color:var(--text-primary); }
.nav-item[aria-current="page"]{ background:var(--accent-soft); color:var(--accent-strong); border-inline-start-color:var(--accent); padding-inline-start:7px; }
.nav-label-group{ font-size:10.5px; font-weight:700; letter-spacing:.7px; text-transform:uppercase; color:var(--text-muted); padding:16px 10px 6px; white-space:nowrap; overflow:hidden; }
.sidebar-foot{ margin-top:auto; display:flex; flex-direction:column; gap:10px; }
.plan-meter{ padding:11px 12px; border-radius:10px; background:var(--surface-2); display:flex; flex-direction:column; gap:8px; }
.plan-meter-top{ display:flex; align-items:center; justify-content:space-between; font-size:11.5px; font-weight:700; }
.meter-track{ height:5px; border-radius:999px; background:var(--surface-3); overflow:hidden; }
.meter-fill{ height:100%; background:var(--accent); border-radius:999px; transition:width 500ms ease; }

/* Indeterminate progress bar — for a long-running operation with no
   granular progress data to report (SSH install, etc.): a moving band
   rather than a real percentage, since there's nothing to measure it
   against until the single opaque operation finishes. */
.progress-track{ position:relative; height:5px; border-radius:999px; background:var(--surface-3); overflow:hidden; margin-top:8px; }
.progress-track .progress-fill{ position:absolute; top:0; left:0; height:100%; width:40%; border-radius:999px; background:var(--accent); animation:progress-indeterminate 1.3s ease-in-out infinite; }
@keyframes progress-indeterminate{ 0%{ left:-40%; } 100%{ left:100%; } }
@media (prefers-reduced-motion: reduce){ .progress-track .progress-fill{ animation-duration:2.6s; } }

/* sidebar collapse */
.sidebar-collapse-btn{ display:flex; align-items:center; justify-content:center; gap:8px; width:100%; height:30px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--text-muted); transition:background 130ms ease,color 130ms ease; }
.sidebar-collapse-btn:hover{ background:var(--surface-2); color:var(--text-primary); }
.sidebar-collapse-btn svg{ transition:transform 200ms ease; }
.app-shell.collapsed{ grid-template-columns:64px 1fr; }
.app-shell.collapsed .sidebar{ padding-left:8px; padding-right:8px; }
.app-shell.collapsed .sidebar-brand{ justify-content:center; padding-left:0; padding-right:0; }
.app-shell.collapsed .hide-collapsed{ display:none; }
.app-shell.collapsed .nav-item{ justify-content:center; padding-inline-start:8px; }
.app-shell.collapsed .nav-item[aria-current="page"]{ padding-inline-start:5px; }
.app-shell.collapsed .sidebar-collapse-btn svg{ transform:rotate(180deg); }

.main{ display:flex; flex-direction:column; min-width:0; }
.topbar{ height:58px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; padding:0 22px; gap:16px; position:sticky; top:0; background:var(--bg); z-index:10; }
.topbar-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.org-switch{ display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:8px; border:1px solid var(--border); background:var(--surface); font-size:12.5px; font-weight:700; }
.env-pill{ font-size:11px; font-weight:700; color:var(--text-secondary); background:var(--surface-2); padding:4px 9px; border-radius:999px; }
.topbar-right{ display:flex; align-items:center; gap:10px; }
.kbd{ font-family: ui-monospace, Consolas, monospace; font-size:10.5px; background:var(--surface-2); border:1px solid var(--border); border-radius:5px; padding:1px 5px; color:var(--text-muted); }
.avatar{ width:28px; height:28px; border-radius:999px; background:var(--accent); color:var(--accent-ink); display:flex; align-items:center; justify-content:center; font-size:11.5px; font-weight:800; }
.back-to-marketing{ font-size:12px; font-weight:700; color:var(--text-muted); display:flex; align-items:center; gap:5px; }
.back-to-marketing:hover{ color:var(--text-primary); }

.page{ padding:24px 28px 56px; max-width:1320px; }
.page-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; flex-wrap:wrap; }
.page-head h1{ font-size:21px; font-weight:800; letter-spacing:-.4px; }
.page-head .sub{ font-size:13px; color:var(--text-muted); margin-top:4px; }
.page-actions{ display:flex; align-items:center; gap:8px; }
.toolbar{ display:flex; align-items:center; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.toolbar-spacer{ flex:1; }

.grid{ display:grid; gap:16px; }
.grid-4{ grid-template-columns:repeat(4,1fr); }
.grid-3{ grid-template-columns:repeat(3,1fr); }
.grid-2{ grid-template-columns:1.5fr 1fr; }
.grid-split{ grid-template-columns:1fr 1fr; }

.list-row{ display:flex; align-items:center; gap:14px; padding:13px 16px; border-bottom:1px solid var(--border); }
.list-row:last-child{ border-bottom:none; }
.severity-stripe{ width:3px; align-self:stretch; border-radius:3px; flex:none; }
.list-row-main{ flex:1; min-width:0; }
.list-row-title{ font-size:13.3px; font-weight:600; }
.list-row-sub{ font-size:12px; color:var(--text-muted); margin-top:2px; }
.list-row-meta{ display:flex; align-items:center; gap:16px; font-size:12px; color:var(--text-secondary); }

.card-head{ display:flex; align-items:center; justify-content:space-between; padding:15px 18px; border-bottom:1px solid var(--border); }
.card-head .actions{ display:flex; gap:6px; }

.uptime-strip{ display:flex; gap:2px; align-items:flex-end; }
.uptime-tick{ width:4px; height:20px; border-radius:2px; flex:none; }

.tabs{ display:flex; gap:2px; border-bottom:1px solid var(--border); margin-bottom:18px; }
.tab-btn{ padding:10px 4px; margin-right:22px; font-size:13px; font-weight:700; color:var(--text-muted); background:transparent; border:none; border-bottom:2px solid transparent; border-radius:0; }
.tab-btn[aria-selected="true"]{ color:var(--text-primary); border-color:var(--accent); }

.empty-state{ display:flex; flex-direction:column; align-items:flex-start; gap:10px; padding:40px 20px; }
.empty-state svg{ color:var(--text-muted); }
.empty-state h3{ font-size:14px; font-weight:700; }
.empty-state p{ font-size:12.5px; color:var(--text-muted); max-width:38ch; }

/* type-cards for monitor/onboarding pickers */
.type-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.type-card{ border:1px solid var(--border-strong); border-radius:10px; padding:14px; display:flex; flex-direction:column; gap:8px; text-align:start; background:var(--surface); }
.type-card[aria-pressed="true"]{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); background:var(--accent-soft); }
.type-card[disabled]{ opacity:.45; cursor:not-allowed; }
.type-card .t-icon{ color:var(--accent); }
.type-card b{ font-size:12.5px; }
.type-card span{ font-size:11px; color:var(--text-muted); }

/* ============================================================
   ONBOARDING
   ============================================================ */
.onboard-shell{ min-height:100vh; display:grid; grid-template-columns:280px 1fr; }
.onboard-rail{ border-right:1px solid var(--border); padding:26px 22px; display:flex; flex-direction:column; gap:22px; }
.onboard-rail .brand-row{ display:flex; align-items:center; justify-content:space-between; }
.ob-steps{ display:flex; flex-direction:column; gap:2px; }
.ob-step{ display:flex; align-items:center; gap:10px; padding:9px 8px; border-radius:8px; font-size:12.8px; font-weight:600; color:var(--text-muted); }
.ob-step .ob-num{ width:22px; height:22px; border-radius:999px; border:1.5px solid var(--border-strong); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; flex:none; }
.ob-step[data-state="done"]{ color:var(--text-primary); }
.ob-step[data-state="done"] .ob-num{ background:var(--status-good); border-color:var(--status-good); color:#fff; }
.ob-step[data-state="current"]{ color:var(--text-primary); }
.ob-step[data-state="current"] .ob-num{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.ob-timer{ margin-top:auto; font-size:11.5px; color:var(--text-muted); display:flex; align-items:center; gap:7px; }
.onboard-main{ display:flex; align-items:flex-start; justify-content:center; padding:64px 28px; }
.ob-panel{ width:100%; max-width:520px; }
.ob-panel h2{ font-size:21px; font-weight:800; letter-spacing:-.4px; margin-bottom:8px; }
.ob-panel > p.lead{ font-size:13.5px; color:var(--text-secondary); margin-bottom:26px; line-height:1.6; }
.ob-foot{ display:flex; justify-content:space-between; align-items:center; margin-top:28px; }
.goal-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:6px; }
.install-tabs{ display:flex; gap:2px; margin-bottom:14px; background:var(--surface-2); padding:3px; border-radius:9px; width:fit-content; }
.install-tabs button{ border:none; background:transparent; padding:6px 14px; border-radius:7px; font-size:12px; font-weight:700; color:var(--text-secondary); }
.install-tabs button[aria-selected="true"]{ background:var(--surface); color:var(--text-primary); box-shadow:var(--shadow-1); }
.waiting-box{ display:flex; flex-direction:column; align-items:center; gap:16px; padding:34px 20px; border:1px dashed var(--border-strong); border-radius:12px; text-align:center; }
.waiting-ring{ width:52px; height:52px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:1080px){
  .grid-4{ grid-template-columns:repeat(2,1fr); }
  .grid-3{ grid-template-columns:repeat(2,1fr); }
  .grid-2, .grid-split{ grid-template-columns:1fr; }
  .persona-grid{ grid-template-columns:repeat(3,1fr); }
  .plans-grid{ grid-template-columns:repeat(3,1fr); }
  .steps{ grid-template-columns:repeat(2,1fr); }
  .hero{ grid-template-columns:1fr; }
}
/* ============================================================
   DEMO / PREVIEW BANNER (buyers: delete js/demo-banner.js to remove)
   ============================================================ */
.demo-banner{ position:fixed; left:16px; bottom:16px; z-index:85; display:flex; align-items:center; gap:10px; background:var(--text-primary); color:var(--bg); border-radius:999px; padding:8px 10px 8px 14px; box-shadow:var(--shadow-2); font-size:12.5px; font-weight:600; max-width:min(360px,calc(100vw - 32px)); }
.demo-banner span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.demo-banner a.btn{ height:26px; padding:0 10px; font-size:11.5px; background:var(--accent); color:var(--accent-ink); flex:none; }
.demo-banner button.dismiss{ width:22px; height:22px; border-radius:999px; display:flex; align-items:center; justify-content:center; color:var(--bg); opacity:.6; flex:none; }
.demo-banner button.dismiss:hover{ opacity:1; background:rgba(255,255,255,.12); }
@media (max-width:520px){ .demo-banner{ left:8px; right:8px; bottom:8px; max-width:none; } }

/* ============================================================
   LICENSE (Settings tab)
   ============================================================ */
.license-card{ display:flex; flex-direction:column; gap:14px; }
.license-status-row{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.license-kv{ display:grid; grid-template-columns:1fr 1fr; gap:10px 20px; }
.license-kv div{ display:flex; flex-direction:column; gap:3px; }
.license-kv .k{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--text-muted); }
.license-kv .v{ font-size:13px; font-weight:600; }
.license-key-input{ letter-spacing:.5px; text-transform:uppercase; }

@media (max-width:760px){
  .app-shell{ grid-template-columns:1fr; }
  .sidebar{ display:none; }
  .grid-4,.grid-3{ grid-template-columns:1fr 1fr; }
  .persona-grid,.plans-grid{ grid-template-columns:1fr 1fr; }
  .problem-grid{ grid-template-columns:1fr; }
  .onboard-shell{ grid-template-columns:1fr; }
  .onboard-rail{ display:none; }
}
