/* =========================================================
   Ambih Monitor — Portal (pricing / auth / account / checkout)
   Shares tokens with site.css (loaded first).
   ========================================================= */

/* =========================================================
   Pro features section (home page)
   ========================================================= */
.pro-features {
  padding: 88px 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--bg-elev);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pro-eyebrow span {
  background: linear-gradient(135deg, var(--accent), var(--bolt));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 36px;
}
.pro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  position: relative;
  transition: border-color var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.pro-card::before {
  content: "";
  position: absolute;
  left: 0; top: 22px; bottom: 22px;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--bolt));
  border-radius: 0 2px 2px 0;
}
.pro-card:hover {
  border-color: var(--accent-ring);
  transform: translateY(-2px);
}
.pro-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  padding-left: 12px;
}
.pro-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 12px;
}
.pro-card em {
  color: var(--text);
  font-style: normal;
  font-weight: 500;
}
.pro-cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 44px;
}
.pro-cta-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================================================
   Pricing page
   ========================================================= */
.pricing-hero {
  position: relative;
  padding: 76px 0 32px;
  overflow: hidden;
}
.pricing-hero-inner { text-align: center; }
.pricing-title {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 700;
  margin: 14px auto 12px;
  max-width: 820px;
  background: linear-gradient(180deg, var(--hero-title-grad-start), var(--hero-title-grad-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pricing-sub {
  max-width: 720px;
  margin: 0 auto 28px;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}
.eyebrow.center { text-align: center; }

/* Billing toggle */
.billing-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
}
.billing-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.billing-opt:hover { color: var(--text); }
.billing-opt.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px -6px var(--accent-ring);
}
.billing-save {
  display: inline-block;
  background: rgba(251, 191, 36, 0.18);
  color: var(--bolt);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.billing-opt.active .billing-save {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Plan cards */
.plans { padding: 28px 0 76px; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  max-width: 880px;
  margin: 0 auto;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}
.plan-card.pro {
  border-color: var(--accent-ring);
  background:
    linear-gradient(180deg, var(--accent-soft) 0%, transparent 30%),
    var(--surface);
  box-shadow: 0 24px 60px -28px var(--accent-ring);
}
.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--bolt));
  color: #0F172A;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 8px 18px -8px var(--accent-ring);
}
.plan-head { display: flex; flex-direction: column; gap: 4px; }
.plan-name {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}
.plan-tag {
  font-size: 14px;
  color: var(--text-muted);
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.plan-amount {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.plan-per {
  font-size: 14px;
  color: var(--text-muted);
}
.plan-billed {
  width: 100%;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Pro card variant swap — only the active one is visible */
.plan-price-variant,
.plan-cta {
  display: none;
}
.plan-price-variant.active { display: flex; }
.plan-cta.active           { display: inline-flex; }

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-soft);
}
.plan-features li svg {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 4px;
}

/* Detailed comparison table extras */
.compare-table-plans .cell-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.compare-table-plans tbody tr:hover { background: var(--surface-2); }

.plan-compare { padding: 56px 0 36px; }

/* =========================================================
   Auth (register / login) — minimal full-screen shell
   ========================================================= */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-soft), transparent 60%),
    var(--bg);
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
  padding: 24px 28px;
  font-size: 15px;
}
.auth-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 48px;
}
.auth-foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 18px 20px 28px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { font-size: 24px; margin: 0 0 6px; font-weight: 700; }
.auth-head p { font-size: 14px; color: var(--text-muted); line-height: 1.55; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}
.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  font-family: inherit;
  font-size: 15px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 10px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.auth-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.45;
}
.auth-check input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent);
  width: 14px; height: 14px;
}
.auth-check a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--t-fast) var(--ease);
}
.auth-check a:hover { text-decoration-color: var(--accent); }
.auth-errors {
  background: rgba(220, 38, 38, 0.10);
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.auth-errors ul { list-style: none; margin: 0; padding: 0; }
.auth-errors li { font-size: 13px; color: #FCA5A5; }
.auth-status {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #86EFAC;
}
.auth-foot-link {
  margin-top: 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}
.auth-foot-link a {
  color: var(--accent);
  font-weight: 500;
}
.auth-foot-link a:hover { text-decoration: underline; }

/* =========================================================
   Checkout
   ========================================================= */
.checkout { padding: 56px 0 88px; }
.checkout-inner { max-width: 960px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 24px;
  transition: color var(--t-fast) var(--ease);
}
.back-link:hover { color: var(--text); }
.checkout-head {
  text-align: center;
  margin-bottom: 32px;
}
.checkout-head h1 {
  font-size: clamp(26px, 3.6vw, 34px);
  margin: 8px 0 8px;
}
.checkout-sub {
  color: var(--text-muted);
  font-size: 15px;
}
.checkout-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
}
@media (max-width: 760px) {
  .checkout-grid { grid-template-columns: 1fr; }
}
.checkout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
}
.checkout-card.sub { background: var(--bg-elev); }
.checkout-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
}
.checkout-lines {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.checkout-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.line-name { font-weight: 600; color: var(--text); }
.line-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.line-amount {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.line-per { font-size: 12px; color: var(--text-muted); margin-left: 4px; font-family: var(--font-sans); font-weight: 400; }
.checkout-savings {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.10);
  color: #4ADE80;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.checkout-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0 6px;
  margin-top: 6px;
  border-top: 1px solid var(--border-strong);
}
.total-label { font-weight: 600; }
.total-amount {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
}
.checkout-renew {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.checkout-form { margin-bottom: 14px; }
.checkout-fineprint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.55;
}
.checkout-included {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkout-included li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-soft);
}
.checkout-included li svg { color: var(--accent); flex-shrink: 0; margin-top: 4px; }
.checkout-account {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}
.checkout-account a {
  color: var(--accent);
  cursor: pointer;
}
.checkout-account a:hover { text-decoration: underline; }

/* Success */
.success-card {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 44px 36px 36px;
}
.success-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  color: #4ADE80;
  margin-bottom: 18px;
}
.success-card h1 { font-size: 26px; margin: 0 0 10px; }
.success-sub { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin-bottom: 24px; }
.success-pending {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.30);
  border-radius: 12px;
  padding: 16px 18px;
  text-align: left;
  margin-bottom: 24px;
}
.success-pending-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 14px;
}
.success-pending p { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin: 0; }
.success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================================================
   Account portal
   ========================================================= */
.account-body { background: var(--bg-elev); min-height: 100vh; }
.account-nav { background: var(--nav-bg-strong); }
.account-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
}
.logout-form { display: inline; }

.account-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  padding: 36px 24px 64px;
}
@media (max-width: 820px) {
  .account-shell { grid-template-columns: 1fr; gap: 16px; }
}
.account-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  height: max-content;
  position: sticky;
  top: 84px;
}
.account-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px 8px;
}
.account-menu { display: flex; flex-direction: column; gap: 2px; }
.account-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 500;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.account-menu a:hover { background: var(--surface-2); color: var(--text); }
.account-menu a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.account-main { min-width: 0; }
.account-flash {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.30);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #86EFAC;
  margin-bottom: 20px;
}
.account-page-head { margin-bottom: 28px; }
.account-page-head h1 { font-size: 26px; margin: 0 0 6px; font-weight: 700; }
.account-page-sub { color: var(--text-muted); font-size: 14.5px; }

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.account-card-head { margin-bottom: 16px; }
.account-card-head h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.account-card-head p { font-size: 13px; color: var(--text-muted); }
.account-empty { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* Plan summary card */
.plan-summary-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.plan-summary-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.plan-summary-name { font-size: 22px; margin: 0; font-weight: 700; }
.plan-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.plan-status.active   { background: rgba(34, 197, 94, 0.12);  color: #4ADE80; }
.plan-status.pending  { background: rgba(251, 191, 36, 0.14); color: var(--bolt); }
.plan-status.free     { background: var(--surface-2); color: var(--text-muted); }
.plan-summary-meta {
  font-size: 13.5px;
  color: var(--text-muted);
}

.plan-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  flex-wrap: wrap;
}
.plan-banner.pending {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.30);
  color: var(--text);
}
.plan-banner.pending svg { color: var(--bolt); flex-shrink: 0; margin-top: 2px; }
.plan-banner.upsell {
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
}
.plan-banner .banner-title { font-weight: 600; margin-bottom: 2px; }
.plan-banner p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }

/* License */
.license-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.license-key {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 14px;
  word-break: break-all;
  color: var(--text);
}
.license-help { font-size: 12.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.55; }
.license-empty {
  background: var(--bg-elev);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 18px 20px;
  text-align: center;
}
.license-empty p { color: var(--text-muted); font-size: 14px; margin-bottom: 14px; }

/* Profile defs */
.account-defs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 0;
}
.account-defs > div { display: flex; flex-direction: column; gap: 4px; }
.account-defs dt {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.account-defs dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

/* Invoices table */
.invoices-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.invoices-table thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.invoices-table tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.invoices-table tbody tr:last-child td { border-bottom: none; }
.invoice-action a { color: var(--accent); font-weight: 500; }
.invoice-action a:hover { text-decoration: underline; }
.invoice-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}
.invoice-status.paid     { background: rgba(34, 197, 94, 0.12);  color: #4ADE80; }
.invoice-status.pending  { background: rgba(251, 191, 36, 0.14); color: var(--bolt); }
.invoice-status.failed   { background: rgba(220, 38, 38, 0.12);  color: #FCA5A5; }
.invoice-status.refunded { background: var(--surface-2); color: var(--text-muted); }

/* Sticky-fix on small screens */
@media (max-width: 820px) {
  .account-sidebar { position: static; }
}

/* Nav controls — account chip spacing */
.nav-account-btn { margin-right: 4px; }

/* =========================================================
   Checkout — Stripe Elements form
   ========================================================= */
.checkout-section-label {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 18px 0 10px;
}
.checkout-section-label:first-of-type { margin-top: 0; }

.checkout-element {
  /* Stripe Elements iframes get their own background; this container is
     just spacing + alignment. Keep border off — let Stripe own the look
     of inputs, with the colors fed in via the appearance API in JS. */
  margin-bottom: 6px;
}

.checkout-error {
  min-height: 18px;
  margin: 10px 0 14px;
  font-size: 13px;
  color: #FCA5A5;
}

.checkout-pay-btn {
  position: relative;
}
.checkout-pay-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}
.checkout-submit-label,
.checkout-submit-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
/* The `hidden` HTML attribute's user-agent `display: none` loses to any
   class with an explicit `display` rule. Re-assert it for our two spans
   so the spinner and the label don't render simultaneously when one
   is marked hidden. */
.checkout-submit-label[hidden],
.checkout-submit-spinner[hidden] {
  display: none;
}
.checkout-submit-spinner .spin {
  animation: checkout-spin 0.9s linear infinite;
}
@keyframes checkout-spin {
  to { transform: rotate(360deg); }
}

.checkout-banner {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 10px 0 16px;
  font-size: 13.5px;
  line-height: 1.5;
}
.checkout-banner strong { display: block; margin-bottom: 4px; }
.checkout-banner p { margin: 0; }
.checkout-banner-warn {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: var(--text-soft);
}

/* =========================================================
   Legal pages (Terms of Service, Privacy Policy)
   ========================================================= */
.legal-hero {
  position: relative;
  padding: 76px 0 28px;
  overflow: hidden;
}
.legal-hero-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.legal-title {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 700;
  margin: 14px auto 14px;
  background: linear-gradient(180deg, var(--hero-title-grad-start), var(--hero-title-grad-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.legal-sub {
  max-width: 680px;
  margin: 0 auto 18px;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}
.legal-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
}
.legal-meta strong { color: var(--text); font-weight: 600; }

.legal-layout {
  padding: 28px 0 88px;
}
.legal-layout-inner {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
@media (max-width: 880px) {
  .legal-layout-inner { grid-template-columns: 1fr; gap: 32px; }
  .legal-toc { position: static; max-height: none; }
}

.legal-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
  font-size: 13.5px;
}
.legal-toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
  padding-left: 12px;
}
.legal-toc ol {
  list-style: none;
  counter-reset: legal-toc;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}
.legal-toc li { counter-increment: legal-toc; }
.legal-toc a {
  display: block;
  padding: 7px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.legal-toc a::before {
  content: counter(legal-toc) ".";
  display: inline-block;
  width: 22px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}
.legal-toc a:hover {
  color: var(--text);
  border-left-color: var(--border-strong);
}
.legal-toc a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.legal-prose {
  max-width: 740px;
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.72;
}
.legal-prose section + section { margin-top: 44px; }
.legal-prose h2 {
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  scroll-margin-top: 96px;
}
.legal-prose h2 .legal-num {
  display: inline-block;
  margin-right: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 700;
}
.legal-prose h3 {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
  margin: 26px 0 8px;
  letter-spacing: -0.005em;
}
.legal-prose p { margin: 0 0 14px; }
.legal-prose ul,
.legal-prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.legal-prose ul li,
.legal-prose ol li {
  margin: 0 0 8px;
  padding-left: 4px;
}
.legal-prose ul li::marker { color: var(--accent); }
.legal-prose strong { color: var(--text); font-weight: 600; }
.legal-prose em { color: var(--text); font-style: italic; }
.legal-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-soft);
  transition: text-decoration-color var(--t-fast) var(--ease);
}
.legal-prose a:hover { text-decoration-color: var(--accent); }
.legal-prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
}
.legal-prose blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--text-soft);
}
.legal-prose blockquote p:last-child { margin-bottom: 0; }

.legal-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 18px 0;
}
.legal-callout-title {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.legal-callout p { margin: 0; font-size: 14.5px; color: var(--text-soft); }
.legal-callout-warn { border-left-color: var(--bolt); }

.legal-contact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-top: 26px;
}
.legal-contact h3 { margin-top: 0; }
.legal-contact-list {
  display: grid;
  gap: 6px;
  font-size: 14.5px;
  color: var(--text-soft);
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.legal-contact-list li { padding: 0; margin: 0; }
.legal-contact-list strong { color: var(--text); margin-right: 6px; }

.legal-table-wrap {
  overflow-x: auto;
  margin: 14px 0 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.legal-table th,
.legal-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-soft);
}
.legal-table th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.legal-table tr:last-child td { border-bottom: none; }
.legal-table td code { font-size: 12.5px; }

/* =================================================================
   Account → Devices page
   Active-device list with per-row revoke. Each card is a single row
   so the table-of-devices reads as a settings page, not a data table.
   ================================================================= */

/* Error variant of the existing flash banner — same shape, red tint. */
.account-flash.error {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.30);
  color: #FCA5A5;
}

/* GDPR privacy callout above the device list. Two-column: icon left,
   text right. Soft accent tint so it reads as "advisory note", not
   "warning". */
.privacy-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.22);
}
.privacy-note-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.privacy-note-body { font-size: 13.5px; color: var(--text-soft); line-height: 1.55; }
.privacy-note-title { font-weight: 600; color: var(--text); margin: 0 0 4px; font-size: 14px; }
.privacy-note p { margin: 0; }
.privacy-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Device list container — vertical stack of cards. */
.devices-list { display: grid; gap: 12px; }

.device-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}
.device-card.revoked { opacity: 0.62; }

/* Card body: icon + identity column. */
.device-card-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}
.device-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-soft);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.device-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.device-name { font-size: 15px; font-weight: 600; margin: 0; color: var(--text); }

.device-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}
.device-badge.active {
  background: rgba(34, 197, 94, 0.14);
  color: #4ADE80;
}
.device-badge.revoked {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}

/* Per-device meta grid: first seen / last seen / fingerprint. */
.device-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 24px;
  margin: 10px 0 0;
}
.device-meta > div { display: flex; flex-direction: column; gap: 2px; }
.device-meta dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}
.device-meta dd { font-size: 13px; color: var(--text-soft); margin: 0; }
.device-fp {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
}

.device-actions { display: flex; align-items: center; }

/* Empty-state inside an account-card. */
.devices-empty {
  text-align: center;
  padding: 30px 12px;
  color: var(--text-muted);
}
.devices-empty svg { color: var(--text-muted); opacity: 0.6; margin-bottom: 14px; }
.devices-empty-title { font-size: 15px; color: var(--text); font-weight: 600; margin: 0 0 6px; }
.devices-empty-sub { font-size: 13px; margin: 0; line-height: 1.55; }
.devices-empty-sub a { color: var(--accent); text-decoration: underline; }

/* Danger button — no existing token; introduce one here scoped to
   this page initially. If a second consumer shows up, promote to
   site.css. */
.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.32);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.55);
  color: #FECACA;
}
.btn-danger:active { transform: translateY(1px); }

/* Light-theme tweaks for the colour-tinted backgrounds — slightly
   stronger contrast so they don't wash out on white. */
html[data-theme="light"] .privacy-note {
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.22);
}
html[data-theme="light"] .device-badge.active {
  background: rgba(22, 163, 74, 0.13);
  color: #15803D;
}
html[data-theme="light"] .btn-danger {
  background: rgba(220, 38, 38, 0.10);
  color: #B91C1C;
  border-color: rgba(220, 38, 38, 0.30);
}
html[data-theme="light"] .btn-danger:hover {
  background: rgba(220, 38, 38, 0.18);
  color: #991B1B;
  border-color: rgba(220, 38, 38, 0.55);
}
html[data-theme="light"] .account-flash.error {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.30);
  color: #B91C1C;
}

/* =================================================================
   Pricing → Algorithm Trust section ("The Math Behind Pro")

   Sits between the plan-grid and the plan-compare table. 2x2 grid
   on >=900px, 2-col on >=600px, single column on phones. Cards use
   the same surface + border tokens as account-card so the
   visual language stays consistent with the rest of the site.
   ================================================================= */

.proof { padding: 60px 0 36px; }

.proof .section-head { margin-bottom: 36px; }

/* 2x2 grid. auto-fit + minmax keeps it responsive without media
   queries — drops to 2 col on tablet, 1 col on phone. */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
/* Force exactly 2 columns on wide screens so the 4 cards land as
   a clean 2x2 grid. Below 900px the auto-fit takes over and they
   wrap naturally. */
@media (min-width: 900px) {
  .proof-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.proof-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 180ms, box-shadow 180ms;
}
.proof-card:hover {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.proof-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.proof-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.proof-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  color: var(--text);
}

/* The formula chip — the "this is real math" element. Mono font,
   soft surface, sized to be the visual anchor of the card. */
.proof-formula {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;   /* never wraps awkwardly on tiny screens */
}
.proof-formula code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  padding: 0;
  white-space: nowrap;
  display: block;
}

.proof-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0;
  flex: 1;
}

/* Trust pill — one load-bearing parameter from the algorithm,
   mono-font, accent left border. Sits at the bottom of the card. */
.proof-pill {
  margin: 0;
  padding: 6px 0 6px 12px;
  border-left: 3px solid var(--accent);
}
.proof-pill span {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* "Why median + MAD, not mean + stddev?" callout. Full-width card
   below the 4-card grid. SVG diagram inside scales via viewBox. */
.proof-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  display: grid;
  gap: 18px;
}
.proof-callout-head h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.proof-callout-chart {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
  color: var(--text-soft);   /* drives currentColor for the SVG axis + text */
  overflow-x: auto;
}
.proof-callout-chart svg {
  width: 100%;
  height: auto;
  max-height: 200px;
  display: block;
}
.proof-callout-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0;
}

/* Phone tightening — reduce padding so cards don't dominate the
   viewport on narrow screens. */
@media (max-width: 560px) {
  .proof { padding: 44px 0 28px; }
  .proof-card { padding: 18px; }
  .proof-callout { padding: 20px 18px; }
  .proof-callout-chart { padding: 10px 6px; }
  .proof-formula code { font-size: 12px; }
}

/* Light theme — keep the accent tints readable on white background. */
html[data-theme="light"] .proof-icon {
  background: rgba(37, 99, 235, 0.10);
}
html[data-theme="light"] .proof-card:hover {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.10);
}

/* Reduced-motion: the only transition on these cards is border +
   box-shadow on hover, both already harmless. No JS animations to
   suppress. The site-wide reveal class is already gated upstream. */

/* =================================================================
   DOCS / CHANGELOG / ERROR PAGES
   A small, self-contained design system layered on the site tokens.
   Goals: clear hierarchy, Carbon-style terminal blocks, and content
   that stays centred and readable from 320px up.
   ================================================================= */

/* ---- Shared doc hero (centred) ---- */
.doc-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 9vw, 108px) 0 clamp(26px, 4vw, 44px);
  text-align: center;
}
.doc-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}
.doc-title {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 16px auto 16px;
  background: linear-gradient(180deg, var(--hero-title-grad-start), var(--hero-title-grad-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.doc-sub {
  max-width: 600px;
  margin: 0 auto;
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.65;
  color: var(--text-muted);
}
.doc-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
}
.doc-meta strong { color: var(--text-soft); font-weight: 600; }

/* ---- Doc layout: optional sticky TOC + centred article ---- */
.doc-body { padding: clamp(8px, 2vw, 20px) 0 clamp(64px, 10vw, 112px); }
.doc-grid {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(36px, 5vw, 64px);
  align-items: start;
  max-width: 1060px;
  margin: 0 auto;
}
.doc-article { min-width: 0; max-width: 760px; }
@media (max-width: 940px) {
  .doc-grid { grid-template-columns: 1fr; max-width: 760px; }
  .doc-toc { display: none; }
  .doc-article { max-width: 100%; }
}

.doc-toc {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  font-size: 13.5px;
}
.doc-toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
  padding-left: 14px;
}
.doc-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.doc-toc a {
  display: block;
  padding: 7px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.45;
  font-family: var(--font-mono);
  font-size: 12.5px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.doc-toc a:hover { color: var(--text); border-left-color: var(--border-strong); }
.doc-toc a.is-active { color: var(--accent); border-left-color: var(--accent); }

/* ---- Generic doc prose ---- */
.doc-prose { color: var(--text-soft); font-size: 15.5px; line-height: 1.72; }
.doc-prose > p { margin: 0 0 14px; }
.doc-prose strong { color: var(--text); font-weight: 600; }
.doc-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-soft);
}
.doc-prose a:hover { text-decoration-color: var(--accent); }
.doc-prose code:not([class]) {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
}

/* =================================================================
   Carbon-style terminal block — always dark, even in light theme,
   so code reads like a real editor window on every page.
   ================================================================= */
.term {
  background: #0B1120;
  border: 1px solid #1E2C44;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 44px -22px rgba(0, 0, 0, 0.75);
  font-family: var(--font-mono);
}
.term-frame {
  padding: clamp(12px, 2.6vw, 22px);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 70% 80% at 15% 0%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(ellipse 60% 80% at 100% 100%, rgba(251, 191, 36, 0.10), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
}
.term-frame .term { box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85); }
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #0E1626;
  border-bottom: 1px solid #1A2740;
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.term-dot.r { background: #FF5F57; }
.term-dot.a { background: #FEBC2E; }
.term-dot.g { background: #28C840; }
.term-label {
  margin-left: 8px;
  font-size: 12px;
  color: #64748B;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term-copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #2A3A55;
  color: #8595AC;
  border-radius: 7px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.term-copy:hover { color: #E2E8F0; border-color: var(--accent); background: rgba(59, 130, 246, 0.12); }
.term-copy svg { width: 13px; height: 13px; }
.term-copy.is-copied { color: #34D399; border-color: rgba(52, 211, 153, 0.5); }
.term-body {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.75;
  color: #D6E2F2;
  white-space: pre;
  tab-size: 2;
}
.term-body .ln { display: block; }
.term-prompt { color: #34D399; user-select: none; margin-right: 10px; }
.term-cont { color: #5B6B82; user-select: none; }
.term-flag { color: #7FB0FF; }
.term-str  { color: #F0B86E; }
.term-cmd  { color: #F1F5F9; }

/* =================================================================
   CLI reference — one command per card with a clear label rhythm
   ================================================================= */
.cmd {
  scroll-margin-top: 92px;
  padding-top: clamp(34px, 5vw, 52px);
  margin-top: clamp(34px, 5vw, 52px);
  border-top: 1px solid var(--border);
}
.cmd:first-of-type { border-top: none; margin-top: clamp(20px, 3vw, 32px); padding-top: 0; }
.cmd-name {
  font-family: var(--font-mono);
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.cmd-name .cmd-ns { color: var(--text-muted); font-weight: 500; }
.cmd-name .cmd-verb { color: var(--accent); }
.cmd-lead {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 18px;
  max-width: 64ch;
}
.cmd-lead code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
}
.cmd-lead strong { color: var(--text); font-weight: 600; }
.cmd-lead em { color: var(--text-soft); font-style: italic; }
.doc-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 22px 0 11px;
}
.doc-label::before {
  content: "";
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* Option list — flag chip + description, stacks on mobile */
.opts {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.opt {
  display: grid;
  grid-template-columns: minmax(150px, 230px) 1fr;
  gap: 14px 20px;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  align-items: baseline;
}
.opt:first-child { border-top: none; }
.opt-flag {
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}
.opt-desc { font-size: 14px; color: var(--text-soft); line-height: 1.55; }
.opt-desc code { font-family: var(--font-mono); font-size: 0.86em; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
@media (max-width: 560px) {
  .opt { grid-template-columns: 1fr; gap: 7px; }
}

/* =================================================================
   Docs hub — guide cards
   ================================================================= */
.docs-index { padding: clamp(12px, 2vw, 24px) 0 clamp(64px, 10vw, 112px); }
.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1020px;
  margin: 0 auto;
}
@media (max-width: 860px) { .docs-grid { grid-template-columns: 1fr; max-width: 520px; } }
.docs-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: border-color var(--t-med) var(--ease), background-color var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.docs-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-soft), transparent 70%);
  transition: opacity var(--t-med) var(--ease);
}
.docs-card:hover { border-color: var(--accent-ring); transform: translateY(-3px); }
.docs-card:hover::after { opacity: 1; }
.docs-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.22);
}
.docs-card-icon svg { width: 24px; height: 24px; }
.docs-card-title { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.docs-card-desc { font-size: 14px; line-height: 1.6; color: var(--text-muted); flex: 1; }
.docs-card-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
}
.docs-card-more svg { width: 15px; height: 15px; transition: transform var(--t-med) var(--ease); }
.docs-card:hover .docs-card-more svg { transform: translateX(3px); }

/* =================================================================
   Add-a-project — screenshot figure, numbered steps, field list
   ================================================================= */
.docs-figure { margin: 0 0 clamp(28px, 5vw, 44px); }
.docs-figure .shot-frame { max-width: 100%; }
.docs-figure img { display: block; width: 100%; height: auto; }
.docs-figure figcaption {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
}

.steps { list-style: none; margin: 0; padding: 0; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 20px;
  padding-bottom: clamp(28px, 4vw, 40px);
}
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 52px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--border-strong), var(--border));
}
.step-num {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
}
.step-title { font-size: clamp(17px, 2vw, 19px); font-weight: 600; color: var(--text); margin: 9px 0 10px; letter-spacing: -0.01em; }
.step-body { padding-bottom: 4px; }
.step-body p { margin: 0 0 12px; color: var(--text-soft); line-height: 1.68; font-size: 15px; }
.step-body ul { margin: 0 0 12px; padding-left: 20px; }
.step-body li { margin: 0 0 8px; padding-left: 3px; color: var(--text-soft); line-height: 1.6; font-size: 15px; }
.step-body li::marker { color: var(--accent); }
.step-body strong { color: var(--text); font-weight: 600; }
.step-body code { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--text); }
.step-body .legal-callout { margin: 14px 0 4px; }

.docs-fields {
  margin: 10px 0 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.docs-field {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 8px 22px;
  padding: 15px 20px;
  border-top: 1px solid var(--border);
}
.docs-field:first-child { border-top: none; }
.docs-field dt { font-weight: 600; color: var(--text); font-size: 14.5px; font-family: var(--font-mono); }
.docs-field dd { margin: 0; font-size: 14px; color: var(--text-soft); line-height: 1.6; }
.docs-field dd code { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--text); }
@media (max-width: 560px) { .docs-field { grid-template-columns: 1fr; gap: 4px; } }

/* =================================================================
   Changelog — centred timeline of releases
   ================================================================= */
.changelog { padding: clamp(12px, 2vw, 24px) 0 clamp(64px, 10vw, 112px); }
.changelog-inner { max-width: 720px; margin: 0 auto; }
.changelog-list { list-style: none; margin: 0; padding: 0; }
.changelog-entry { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 24px; }
.changelog-rail { position: relative; display: flex; justify-content: center; }
.changelog-rail::before {
  content: "";
  position: absolute;
  top: 8px; bottom: -10px;
  width: 2px;
  background: var(--border);
}
.changelog-entry:last-child .changelog-rail::before { display: none; }
.changelog-dot {
  position: relative;
  z-index: 1;
  width: 14px; height: 14px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border-strong);
}
.changelog-dot.is-current { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.changelog-body {
  padding: 0 0 clamp(34px, 5vw, 52px);
  min-width: 0;
}
.changelog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px);
}
.changelog-entry.is-current .changelog-card {
  border-color: var(--accent-ring);
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 26%), var(--surface);
}
.changelog-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.changelog-version { font-size: clamp(20px, 2.6vw, 24px); font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin: 0; font-family: var(--font-mono); }
.changelog-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  padding: 3px 10px;
}
.changelog-date { margin-left: auto; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.changelog-summary { font-size: 15px; color: var(--text-soft); line-height: 1.62; margin: 0 0 18px; }
.changelog-summary code, .changelog-group code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px; color: var(--text);
}
.changelog-group { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.changelog-group:last-child { margin-bottom: 0; }
.changelog-badge {
  justify-self: start;
  height: fit-content;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 7px;
  padding: 4px 10px;
}
.changelog-badge.is-added   { color: #34D399; background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3); }
.changelog-badge.is-changed { color: #60A5FA; background: rgba(96, 165, 250, 0.12); border: 1px solid rgba(96, 165, 250, 0.3); }
.changelog-badge.is-fixed   { color: var(--bolt); background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.3); }
.changelog-group ul { margin: 2px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.changelog-group li { font-size: 14.5px; color: var(--text-soft); line-height: 1.55; }
.changelog-group li::marker { color: var(--text-muted); }
@media (max-width: 540px) {
  .changelog-entry { gap: 16px; }
  .changelog-group { grid-template-columns: 1fr; gap: 9px; }
  .changelog-date { width: 100%; margin-left: 0; order: 3; }
}
html[data-theme="light"] .changelog-badge.is-added   { color: #059669; }
html[data-theme="light"] .changelog-badge.is-changed { color: #2563EB; }
html[data-theme="light"] .changelog-badge.is-fixed   { color: #B45309; }

/* Pricing — "payments coming soon" notice (shown on the Pro card when
   the paid checkout is temporarily closed). */
.pay-soon {
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.32);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.pay-soon-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--bolt);
  margin: 0 0 4px;
}
.pay-soon-body {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
  margin: 0;
}
.account-flash.info { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--text); }

/* Pricing — active sale banner (driven by an admin promotion). */
.promo-banner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px auto 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(251, 191, 36, 0.16), rgba(59, 130, 246, 0.14));
  border: 1px solid rgba(251, 191, 36, 0.36);
}
.promo-banner-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0F172A;
  background: var(--bolt);
  border-radius: 999px;
  padding: 3px 10px;
}
.promo-banner-text { font-size: 14px; color: var(--text-soft); }
.promo-banner-text strong { color: var(--text); font-weight: 600; }
.promo-banner-ends { color: var(--text-muted); }
.promo-banner-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  padding: 2px 9px;
}

/* =================================================================
   Error pages (404 / 500) — spacious, centred, responsive
   ================================================================= */
.err {
  position: relative;
  overflow: hidden;
  min-height: calc(100dvh - 65px);
  display: grid;
  place-items: center;
  padding: clamp(56px, 10vw, 104px) 0;
  text-align: center;
}
.err-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.err-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
}
.err-badge .err-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bolt); box-shadow: 0 0 10px var(--bolt); }
.err-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 1vw, 8px);
  margin: clamp(22px, 4vw, 36px) 0 clamp(14px, 3vw, 26px);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(88px, 22vw, 188px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--hero-title-grad-start), var(--hero-title-grad-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.err-code-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 10px 34px var(--accent-ring));
  transform: translateY(2px);
}
.err-code-mark svg { width: clamp(66px, 16vw, 148px); height: auto; }
.err-title {
  font-size: clamp(23px, 3.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.15;
}
.err-sub {
  font-size: clamp(15px, 1.8vw, 16.5px);
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 clamp(26px, 4vw, 34px);
  max-width: 460px;
}
.err-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.err-actions .btn { min-width: 168px; }
.err-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  margin: clamp(30px, 5vw, 40px) 0 clamp(18px, 3vw, 24px);
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.err-divider::before, .err-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.err-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: center;
}
.err-links a {
  display: inline-flex;
  align-items: center;
  font-size: 13.5px;
  color: var(--text-soft);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.err-links a:hover { color: var(--accent); border-color: var(--accent-ring); background: var(--accent-soft); }
.err-note { font-size: 13.5px; color: var(--text-muted); margin: 0; line-height: 1.6; }
.err-note code { font-family: var(--font-mono); font-size: 0.9em; color: var(--text-soft); }

@media (prefers-reduced-motion: reduce) {
  .docs-card, .docs-card-more svg, .term-copy { transition: none; }
  .docs-card:hover { transform: none; }
}
