/* Referso Jobs API portal.
   Neutrals, radii and shadows follow the admin dashboard (dashboard/src/app.css); ink and accent follow the
   job board (jobs.referso.com) so the portal reads as the same product. Dark mode follows the OS.
   The CSP allows no inline style: every visual lives here, SVG charts are styled by class. */

:root {
  --bg: #fbfbfc;
  --bg-tint: #f5f4ff;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eef0f4;
  --border: #e7e9ee;
  --border-2: #d8dbe3;
  --ink: #16133a;
  --ink-2: #4a4f5e;
  --ink-3: #6b7280;
  --brand: #5b4bff;
  --brand-2: #4b3be6;
  --brand-ink: #4b3be6;
  --brand-weak: #efedff;
  --brand-line: #d9d4ff;
  --btn: #5b4bff;
  --btn-hover: #4b3be6;
  --danger: #c81e1e;
  --danger-weak: #fef0f0;
  --ok: #047857;
  --ok-weak: #e7f7f0;
  --warn: #a15c07;
  --warn-weak: #fff4e0;
  --code-bg: #16133a;
  --code-ink: #e7e5ff;
  --code-dim: #a19dc8;
  --dot: rgba(91, 75, 255, .16);
  --scrim: rgba(10, 12, 24, .45);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(22, 19, 58, .05);
  --shadow: 0 1px 3px rgba(22, 19, 58, .06), 0 8px 24px -12px rgba(22, 19, 58, .16);
  --shadow-lg: 0 2px 8px rgba(22, 19, 58, .06), 0 24px 56px -20px rgba(22, 19, 58, .24);
  --ring: 0 0 0 3px rgba(91, 75, 255, .22);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0e;
    --bg-tint: #0d0c1c;
    --surface: #131519;
    --surface-2: #1a1d22;
    --surface-3: #22262d;
    --border: #23262d;
    --border-2: #2e323a;
    --ink: #f2f4f7;
    --ink-2: #b4bccb;
    --ink-3: #8a93a3;
    --brand: #8b7fff;
    --brand-2: #a99fff;
    --brand-ink: #b0a7ff;
    --brand-weak: #1f1b45;
    --brand-line: #3a3480;
    --btn: #5b4bff;
    --btn-hover: #6d5fff;
    --danger: #f87171;
    --danger-weak: #2a1618;
    --ok: #34d399;
    --ok-weak: #11241e;
    --warn: #fbbf24;
    --warn-weak: #2e2410;
    --code-bg: #0f0d26;
    --code-ink: #e7e5ff;
    --code-dim: #8f8bb8;
    --dot: rgba(169, 159, 255, .14);
    --scrim: rgba(0, 0, 0, .6);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 8px 24px -12px rgba(0, 0, 0, .7);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, .5), 0 24px 56px -20px rgba(0, 0, 0, .8);
    --ring: 0 0 0 3px rgba(139, 127, 255, .3);
    color-scheme: dark;
  }
}

/* ── base ─────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 8px; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: 0 0 auto; }
::placeholder { color: var(--ink-3); opacity: .8; }
::selection { background: var(--brand-weak); color: var(--ink); }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:where(a, button, input, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
code, pre, .mono { font-family: var(--mono); }
:not(pre) > code {
  font-size: .9em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--ink);
  overflow-wrap: anywhere;
}
strong { font-weight: 600; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.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;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 8px 16px; border-radius: var(--r-sm);
  background: var(--btn); color: #fff; font-weight: 600;
}
.skip-link:focus { top: 8px; }
.ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 20px; height: 20px; }

/* ── buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 550; line-height: 1; white-space: nowrap;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.btn-primary { background: var(--btn); border-color: var(--btn); color: #fff; box-shadow: 0 1px 2px rgba(75, 59, 230, .3); }
.btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn-dark:hover { background: var(--ink); opacity: .9; color: var(--surface); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-weak); border-color: var(--danger); color: var(--danger); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--surface-3); border-color: var(--border); color: var(--ink-3);
  box-shadow: none; cursor: not-allowed;
}
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-pill { border-radius: 999px; }
.btn-pill:focus-visible { border-radius: 999px; }
.btn-block { width: 100%; }
.btn-grad {
  background: linear-gradient(100deg, #5b4bff 0%, #8b3dff 60%, #c13df0 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 24px -10px rgba(91, 75, 255, .7);
}
.btn-grad:hover { background: linear-gradient(100deg, #4b3be6 0%, #7a2ff0 60%, #ad2ddd 100%); color: #fff; }
.link-btn {
  background: none; border: 0; padding: 0; color: var(--brand-ink); font-weight: 500;
}
.link-btn:hover { text-decoration: underline; }

/* ── badges ───────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-plain::before { display: none; }
.badge-active, .badge-revoked, .badge-expired { text-transform: capitalize; }
.badge-active, .badge-ok { background: var(--ok-weak); color: var(--ok); }
.badge-revoked { background: var(--surface-3); color: var(--ink-3); }
.badge-expired, .badge-warn { background: var(--warn-weak); color: var(--warn); }
.badge-brand { background: var(--brand-weak); color: var(--brand-ink); }
.badge-plan { text-transform: none; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
}
.chip-amber { border-color: transparent; background: #fcc934; color: #2b2100; }

/* ── alerts ───────────────────────────────────────────────────────────── */

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 500;
}
.alert .ico { margin-top: 2px; }
.alert-error { background: var(--danger-weak); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-ok { background: var(--ok-weak); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-info { background: var(--brand-weak); color: var(--brand-ink); border-color: var(--brand-line); }

/* ── forms ────────────────────────────────────────────────────────────── */

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field-hint { font-size: 12.5px; color: var(--ink-3); }
.field-error { font-size: 12.5px; font-weight: 500; color: var(--danger); }
.input {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  font-size: 14px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 104px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: var(--ink-3); }
.input:focus { border-color: var(--brand); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--danger-weak); }
.form-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.form-row .field { flex: 1 1 240px; }
.form-foot { margin-top: 16px; font-size: 13px; color: var(--ink-3); text-align: center; }
.form-foot a { font-weight: 500; }
.dot-sep { margin: 0 6px; color: var(--border-2); }

/* ── cards ────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-xs);
  min-width: 0;
}
.card-pad { padding: 24px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.card-body { padding: 20px; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--r) var(--r);
  font-size: 13px; color: var(--ink-3);
}
.card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 20px; text-align: center;
}
.empty p { margin: 0; color: var(--ink-3); max-width: 340px; }
.empty-ico {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: grid; place-items: center; background: var(--brand-weak); color: var(--brand-ink);
}

/* ── code blocks ──────────────────────────────────────────────────────── */

.code-block { border-radius: var(--r-sm); overflow: hidden; background: var(--code-bg); }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 6px 8px 6px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: 12px; font-weight: 600; color: var(--code-dim); font-family: var(--mono); }
.code-block pre.code { border-radius: 0; }
pre.code, pre.secret {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  border-radius: var(--r-sm);
  font-size: 13px; line-height: 1.65;
}
pre.code { background: var(--code-bg); color: var(--code-ink); }
pre.code .c-dim { color: var(--code-dim); }
pre.code .c-str { color: #9ef0c4; }
pre.code .c-key { color: #c4b5fd; }
pre.code .c-num { color: #fcd34d; }
pre code { font: inherit; background: none; padding: 0; color: inherit; }
.copy {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08);
  color: var(--code-ink); font-size: 12px; font-weight: 600;
}
.copy:hover { background: rgba(255, 255, 255, .16); }
.copy-light { border-color: var(--border-2); background: var(--surface); color: var(--ink); }
.copy-light:hover { background: var(--surface-2); }
.copy[data-state="done"] { color: #6ee7b7; }
.copy-light[data-state="done"] { color: var(--ok); }
.copy[hidden] { display: none; }

/* ═══ public layout ═════════════════════════════════════════════════════ */

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.public { background: var(--bg-tint); }

.topnav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg-tint) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topnav-row { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: -.02em; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-sub { color: var(--brand-ink); }
.topnav-links { display: flex; align-items: center; gap: 4px; }
.topnav-links a {
  padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: 14px;
}
.topnav-links a:hover { color: var(--ink); background: var(--surface); text-decoration: none; }
.topnav-links a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-xs); }
.topnav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topnav-actions .signin { padding: 6px 12px; color: var(--ink); font-weight: 600; }

.hero {
  position: relative; padding: 72px 0 56px;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg-tint));
  pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.hero h1 { font-size: 48px; font-weight: 800; letter-spacing: -.035em; line-height: 1.04; }
.grad-text {
  background: linear-gradient(95deg, #5b4bff 0%, #8b3dff 45%, #d43df0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin: 20px 0 0; font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 40px; max-width: 560px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.hero-stats div { padding: 16px 20px; border-left: 1px solid var(--border); }
.hero-stats div:first-child { border-left: 0; }
.hero-stats strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.hero-stats span { font-size: 13px; color: var(--ink-3); }

.terminal {
  background: var(--code-bg); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .06);
}
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.terminal-bar span { margin-left: 8px; font-size: 12px; color: var(--code-dim); font-family: var(--mono); }
.terminal pre.code { border-radius: 0; background: transparent; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

.section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { margin-top: 12px; font-size: 36px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
.section-head p { margin-top: 12px; font-size: 16px; color: var(--ink-2); }
.section-head.center { margin-left: auto; margin-right: auto; }

.plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: 24px 20px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
}
.plan-featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.plan-head h3 { font-size: 16px; font-weight: 700; }
.plan-tagline { margin: 6px 0 0; min-height: 42px; font-size: 13px; color: var(--ink-3); }
.price { margin: 16px 0 0; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.price span { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
.price-talk { font-size: 26px; }
.features { list-style: none; margin: 20px 0 24px; padding: 20px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.features li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.features li .ico { color: var(--brand-ink); margin-top: 2px; }
.features strong { color: var(--ink); }
.plan-cta { margin-top: auto; }
.plans-note { margin-top: 24px; font-size: 13px; color: var(--ink-3); text-align: center; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.step { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.step-ico {
  width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 16px;
  border-radius: 10px; background: var(--brand-weak); color: var(--brand-ink);
}
.step-num { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 4px; }
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--ink-2); }

.faq { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.faq details { border-top: 1px solid var(--border); }
.faq details:first-child { border-top: 0; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px; cursor: pointer; list-style: none;
  font-size: 15px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 8px; height: 8px; flex: 0 0 auto; margin-right: 4px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .15s;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { padding: 0 24px 20px; margin: 0; color: var(--ink-2); }

.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 40px; border-radius: 20px;
  background: radial-gradient(120% 140% at 100% 0%, #3b2fd6 0%, #16133a 55%);
  color: #fff;
}
.cta-band h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.cta-band p { margin-top: 8px; color: #c8c5e6; }
.cta-band .btn { background: #fff; border-color: #fff; color: #16133a; }
.cta-band .btn:hover { background: #efedff; }

.footer { padding: 32px 0 40px; border-top: 1px solid var(--border); margin-top: 24px; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-2); }

/* auth pages */
.auth-wrap { padding-top: 56px; padding-bottom: 72px; }
.auth-card { max-width: 440px; margin: 0 auto; padding: 32px; border-radius: var(--r-lg); box-shadow: var(--shadow); }
.auth-head { margin-bottom: 24px; }
.auth-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.auth-head p { margin-top: 6px; color: var(--ink-3); }
.auth-head .badge { margin-bottom: 12px; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 32px; max-width: 960px; margin: 0 auto; align-items: start; }
.auth-split .auth-card { max-width: none; margin: 0; }
.side-panel { padding: 32px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.side-panel h2 { font-size: 16px; font-weight: 700; margin-bottom: 20px; }
.timeline { list-style: none; display: flex; flex-direction: column; }
.timeline li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding-bottom: 24px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline-dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-weak); color: var(--brand-ink); font-size: 13px; font-weight: 700;
}
.timeline h3 { font-size: 14px; font-weight: 600; margin: 5px 0 4px; }
.timeline p { color: var(--ink-3); font-size: 13.5px; }
.side-note { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-3); }
.status-card { text-align: center; }
.status-icon {
  width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center;
}
.status-icon .ico { width: 24px; height: 24px; }
.status-ok { background: var(--ok-weak); color: var(--ok); }
.status-warn { background: var(--warn-weak); color: var(--warn); }
.status-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.status-card p { color: var(--ink-2); }
.status-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 24px; }

/* ═══ app shell ═════════════════════════════════════════════════════════ */

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 16px 12px 12px;
  background: var(--surface); border-right: 1px solid var(--border);
}
.sidebar .brand { padding: 4px 8px; margin-bottom: 16px; font-size: 15px; border-radius: var(--r-sm); }
.sidebar .brand-mark { width: 28px; height: 28px; }
.side-nav { flex: 1; overflow-y: auto; }
.side-group {
  padding: 16px 8px 6px; font-size: 11px; font-weight: 600;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em;
}
.side-group:first-child { padding-top: 0; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 2px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  transition: background .1s, color .1s;
}
.side-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side-item[aria-current="page"] { background: var(--brand-weak); color: var(--brand-ink); font-weight: 600; }
.side-item .ext { margin-left: auto; color: var(--ink-3); }
.side-foot { padding-top: 12px; border-top: 1px solid var(--border); }
.who { display: flex; align-items: center; gap: 10px; padding: 8px; min-width: 0; }
.avatar {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.who-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.who-t strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-t span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { margin: 4px 0 0; }
.logout-form .btn { justify-content: flex-start; width: 100%; padding: 0 10px; font-weight: 500; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.topbar-crumb { color: var(--ink-3); font-weight: 500; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.burger {
  display: none; width: 36px; height: 36px; margin-left: -8px;
  align-items: center; justify-content: center;
  background: none; border: 0; border-radius: var(--r-sm); color: var(--ink-2);
}
.burger:hover { background: var(--surface-2); }
.scrim { display: none; }
.content { flex: 1; padding: 32px 28px 56px; }
.page { max-width: 1100px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 24px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.tile-label .ico { color: var(--brand-ink); }
.tile-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile-value-sm { font-size: 20px; line-height: 1.5; }
.tile-sub { font-size: 12.5px; color: var(--ink-3); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; }

/* usage ring */
.usage-body { display: flex; align-items: center; gap: 28px; padding: 24px; }
.ring { width: 136px; height: 136px; flex: 0 0 136px; }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 12; }
.ring-fill { fill: none; stroke: var(--brand); stroke-width: 12; stroke-linecap: round; }
.ring-warn .ring-fill { stroke: var(--warn); }
.ring-full .ring-fill { stroke: var(--danger); }
.ring-value { fill: var(--ink); font-family: var(--font); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-value-sm { font-size: 17px; }
.ring-caption { fill: var(--ink-3); font-family: var(--font); font-size: 11px; font-weight: 500; }
.usage-text { min-width: 0; }
.usage-num { font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }
.usage-num strong { font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.meter { height: 8px; margin: 12px 0 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }

/* plan card */
.plan-summary { padding: 24px; display: flex; flex-direction: column; gap: 16px; height: 100%; }
.plan-summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plan-name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.plan-price { font-size: 13px; color: var(--ink-3); }
.limits { list-style: none; display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--r-sm); }
.limits li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13.5px; }
.limits li:first-child { border-top: 0; }
.limits span { color: var(--ink-3); }
.limits strong { font-variant-numeric: tabular-nums; }
.plan-summary .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* tables (dashboard style) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 20px; white-space: nowrap;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .dim { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.key-name { display: flex; align-items: center; gap: 10px; font-weight: 600; overflow-wrap: anywhere; }
.key-ico { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
tr.is-revoked .key-name { color: var(--ink-3); font-weight: 500; }
form.inline { display: inline; margin: 0; }

/* key reveal */
.reveal { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); box-shadow: 0 0 0 3px var(--ok-weak), var(--shadow-xs); }
.reveal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 0; }
.reveal-ico { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--ok-weak); color: var(--ok); }
.reveal-head h2 { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.reveal-head p { margin-top: 2px; color: var(--warn); font-weight: 600; font-size: 13.5px; }
.reveal-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 0; border: 1px dashed var(--border-2); border-radius: var(--r-sm); background: var(--surface-2); }
pre.secret { flex: 1; min-width: 0; padding: 10px 14px; background: none; color: var(--ink); font-size: 14px; font-weight: 600; user-select: all; white-space: pre; }

/* bar chart */
.chart { margin: 0; padding: 20px 20px 16px; }
.chart-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 214px; margin: -7px 0; line-height: 14px; font-size: 11px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.chart-plot { display: block; width: 100%; height: 200px; overflow: visible; }
.chart-grid { stroke: var(--border-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-axis { stroke: var(--border-2); stroke-width: 1; }
.bar { fill: var(--brand); }
.chart-hit { fill: transparent; }
.chart-day:hover .bar { fill: var(--brand-2); }
.chart-day:hover .chart-hit { fill: var(--brand-weak); opacity: .6; }
.chart-x { display: flex; justify-content: space-between; margin: 10px 0 0 var(--chart-y-w, 34px); font-size: 11px; color: var(--ink-3); }
.chart-empty { padding: 48px 20px; text-align: center; color: var(--ink-3); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--brand); }

/* plan comparison */
.compare th, .compare td { text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; color: var(--ink-2); font-weight: 500; }
.compare thead th { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); padding-top: 14px; padding-bottom: 14px; }
.compare .is-current { background: var(--brand-weak); }
.compare tbody tr:hover { background: transparent; }
.compare tbody tr:hover td.is-current { background: var(--brand-weak); }
.compare td { font-variant-numeric: tabular-nums; }
.compare .current-tag { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--brand-ink); text-transform: uppercase; letter-spacing: .05em; }
.compare tfoot td { padding-top: 14px; padding-bottom: 14px; border-top: 1px solid var(--border); }

.callout { display: flex; gap: 16px; align-items: flex-start; padding: 20px; }
.callout-ico { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; background: var(--brand-weak); color: var(--brand-ink); }
.callout h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.callout p { color: var(--ink-2); }
.callout .actions { margin-left: auto; align-self: center; }
.dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.dl > div { padding: 16px 20px; border-left: 1px solid var(--border); }
.dl > div:first-child { border-left: 0; }
.dl dt { font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.dl dd { margin: 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bullets { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bullets li { display: flex; gap: 10px; color: var(--ink-2); }
.bullets .ico { color: var(--brand-ink); margin-top: 3px; }

/* ═══ responsive ═══════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero h1 { font-size: 44px; }
  .auth-split { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .js .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; height: 100%;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
    visibility: hidden;
  }
  .js .nav-open .sidebar { transform: none; visibility: visible; }
  .js .burger { display: inline-flex; }
  .js .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: var(--scrim); border: 0; }
  html:not(.js) .shell { flex-direction: column; }
  html:not(.js) .sidebar { position: static; width: auto; height: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--border); }
  .topbar { padding: 0 16px; }
  .content { padding: 24px 16px 48px; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .topnav-row { gap: 12px; }
  .topnav-links { display: none; }
  .hero { padding-top: 40px; padding-bottom: 40px; }
  .hero h1 { font-size: 36px; }
  .lead { font-size: 16px; }
  .hero-stats div { padding: 12px 14px; }
  .hero-stats strong { font-size: 20px; }
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 28px; }
  .section-head h2 { font-size: 28px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan-tagline { min-height: 0; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .cta-band { padding: 28px 24px; }
  .cta-band h2 { font-size: 22px; }
  .faq summary { padding: 16px 18px; }
  .faq details p { padding: 0 18px 18px; }
  .auth-wrap { padding-top: 32px; padding-bottom: 48px; }
  .auth-card, .side-panel { padding: 24px 20px; }
  .tiles { gap: 12px; }
  .tile { padding: 14px 16px; }
  .tile-value { font-size: 22px; }
  .tile-value-sm { font-size: 17px; }
  .usage-body { flex-direction: column; align-items: flex-start; gap: 20px; padding: 20px; }
  .dl > div { padding: 14px 12px; }
  .dl dt { font-size: 12px; }
  .callout { flex-wrap: wrap; }
  .callout .actions { margin-left: 0; width: 100%; }
  .chart-plot { height: 160px; }
  .chart-y { height: 174px; }
  .page-head h1 { font-size: 22px; }
  .topbar-crumb { display: none; }

  /* key table becomes stacked rows */
  .table-stack thead { display: none; }
  .table-stack tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack td { padding: 0; border: 0; }
  .table-stack td.key-cell { grid-column: 1; }
  .table-stack td.status-cell { grid-column: 2; grid-row: 1; align-self: center; }
  .table-stack td.dim { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); }
  .table-stack td.dim::before { content: attr(data-label) ": "; }
  .table-stack td.actions { grid-column: 1 / -1; text-align: left; padding-top: 6px; }
}

@media (max-width: 420px) {
  .brand-text-sub { display: none; }
  .topnav-actions .signin { padding: 6px 4px; }
  .hero h1 { font-size: 32px; }
  .hero-stats { grid-template-columns: minmax(0, 1fr); }
  .hero-stats div { border-left: 0; border-top: 1px solid var(--border); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .hero-stats div:first-child { border-top: 0; }
  .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

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

.form-row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.meter svg { display: block; width: 100%; height: 8px; }
.meter-track { fill: var(--surface-3); }
.meter-fill { fill: var(--brand); }
.meter-warn .meter-fill { fill: var(--warn); }
.meter-full .meter-fill { fill: var(--danger); }
.btn-lg-row { height: 40px; }
.field-error { margin: 8px 0 0; }
.small-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.chart-x { margin: 10px 0 0; }
.compare tbody th { text-align: left; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 500; color: var(--ink-2); text-transform: none; letter-spacing: 0; background: none; white-space: nowrap; }
.compare tfoot td .btn { white-space: nowrap; }
.compare { min-width: 720px; }
.card-foot .ico { vertical-align: -2px; }
@media (max-width: 420px) {
  .terminal pre.code { font-size: 11px; padding: 14px; }
  .hero-actions .btn { width: 100%; }
}

/* sidebar column paints full height even when the page is taller than the viewport */
@media (min-width: 900px) {
  .shell { background: linear-gradient(to right, var(--surface) calc(var(--sidebar-w) - 1px), var(--border) calc(var(--sidebar-w) - 1px), var(--border) var(--sidebar-w), var(--bg) var(--sidebar-w)); }
}
.grid-2 > .card { display: flex; flex-direction: column; }
.grid-2 > .card > .usage-body { flex: 1; }
.compare { table-layout: fixed; }
.compare thead th:first-child, .compare tbody th { width: 22%; }
.cell-note { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
body.public { display: flex; flex-direction: column; }
body.public > main { flex: 1 0 auto; }
.topnav-actions .signin[aria-current="page"] { color: var(--brand-ink); }
.side-item:focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }
.scroll-hint { display: none; margin: 0; padding: 10px 20px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--border); }
.card > .table-wrap:last-child { border-radius: 0 0 var(--r) var(--r); }
@media (max-width: 720px) {
  .compare { min-width: 600px; }
  .compare th:first-child, .compare td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--surface);
    box-shadow: inset -1px 0 var(--border);
  }
  .compare thead th:first-child { background: var(--surface-2); }
  .compare thead th:first-child, .compare tbody th { width: 120px; }
  .compare th, .compare td { padding-left: 12px; padding-right: 12px; }
  .scroll-hint { display: block; }
  .compare tbody th { white-space: normal; }
}
