/*
 * The Acidex website and Developer Console stylesheet, on the app's brand (v1, the design canvas's
 * "Current branding" page): Besley for editorial headlines and the odd italic hero number, IBM Plex
 * Mono for kickers, code and IDs (sentence case, no tracking), and the system sans for body text.
 * Coral is for actions and the tint only and never encodes data; no mesh, glow or gradient text.
 * Adapted from the Acidex Claude Design project. The Console serves this file as is, and
 * the Astro website copies it unchanged from its publicDir (ADR-0013).
 */

:root {
  --bg: #fafaf7;
  --bg-elev: #ffffff;
  --bg-soft: #f3f1ec;
  --bg-tint: #faf6ef;
  --fg: #0c0e10;
  --fg2: #4a4f55;
  --fg3: #676d73;
  --fg4: #b6b9bd;
  --line: #e8e4dc;
  --line-soft: #efebe2;
  --accent: #ff5d4b;
  --accent-2: #ffb19f;
  --accent-bg: #fff2ee;
  --accent-ink: #b5382a;
  --ok: #1c7a55;
  --ok-bg: #e3f4ea;
  --warn-ink: #8a560c;
  --warn-bg: #ffefd6;
  --err-ink: #a3271b;
  --err-bg: #ffe9e5;
  --mesh-1: #ffe3da;
  --mesh-2: #ffd5c8;
  --mesh-3: #ffe9b0;
  --mesh-4: #e8d4ff;
  --font-display: "Besley", ui-serif, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  --page-width: 1440px; /* website and docs content width */
  --docs-text-width: 920px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
code, kbd, pre, .mono { font-family: var(--font-mono); }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--fg); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
/* Kickers: the small label above a section or card, as the app sets them. */
.kicker { font: 500 13px/1.3 var(--font-mono); letter-spacing: 0; text-transform: none; color: var(--fg3); }
.muted { color: var(--fg3); }
.arrow { display: inline-block; margin-left: 4px; transition: transform .15s; }
a:hover > .arrow, button:hover > .arrow { transform: translateX(2px); }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 500 14.5px/1.2 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary {
  background: var(--fg); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 1px 2px rgba(0,0,0,0.18);
}
.btn-primary:hover { background: #24282d; }
/* A light sweep across primary buttons on hover */
.btn-primary { position: relative; overflow: hidden; isolation: isolate; transition: background .15s, transform .2s, box-shadow .2s; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.22) 48%, transparent 66%);
  transform: translateX(-110%);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 10px 26px rgba(255,93,75,0.25); }
.btn-primary:hover::after { transform: translateX(110%); transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.btn-ghost { transition: background .15s, border-color .15s, transform .2s; }
.btn-ghost:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .btn-primary:hover, .btn-ghost:hover { transform: none; } .btn-primary::after { display: none; } }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { background: rgba(0,0,0,0.03); border-color: #d6d2c8; }
.btn-lg { padding: 14px 24px; font-size: 15.5px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-danger { background: transparent; color: var(--err-ink); border-color: #f1cfc9; }
.btn-danger:hover { background: var(--err-bg); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }

/* ── Logo ──────────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--fg); }
.logo-mark { width: 26px; height: 26px; display: block; }
.logo-text { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.logo-tag {
  font: 500 11px/1 var(--font-mono); color: var(--fg3);
  padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; margin-left: 2px;
}

/* ── Pills ─────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--bg-soft); color: var(--fg2);
}
.pill-accent { background: var(--accent-bg); color: var(--accent-ink); }
.pill-high { background: var(--ok-bg); color: var(--ok); }
.pill-medium { background: var(--warn-bg); color: var(--warn-ink); }
.pill-low { background: #eeece7; color: #4f545a; }
.pill-unknown { background: transparent; color: var(--fg3); border: 1px dashed #cfcac0; }
.pill-mitigating { background: #e3effa; color: #1d5a91; }
.pill-aggravating { background: #ffeadb; color: #9a4316; }
.pill-retired { background: var(--err-bg); color: var(--err-ink); }

.status-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
  background: #1c9c6d; box-shadow: 0 0 0 3px rgba(28,156,109,0.18);
}

/* ── Notices ───────────────────────────────────────── */
.notice, .error {
  border-radius: 12px; padding: 12px 16px; margin: 0 0 18px;
  font-size: 14px; border: 1px solid;
}
.notice { background: #f1f8f3; border-color: #cfe7d8; color: #164e38; }
.error { background: var(--err-bg); border-color: #f5c9c1; color: var(--err-ink); }
.notice p, .error p { margin: 0 0 6px; }
.notice p:last-child, .error p:last-child { margin-bottom: 0; }
.new-key {
  background: linear-gradient(135deg, #fff, var(--bg-tint));
  border: 1px solid #efe1c8; border-radius: var(--radius);
  padding: 18px 20px; margin: 0 0 20px;
}
.new-key-h { font-weight: 600; margin: 0 0 4px; }
.new-key-v {
  display: block; margin: 12px 0;
  font: 500 14px/1.5 var(--font-mono); word-break: break-all;
  background: var(--fg); color: #fff; padding: 12px 14px; border-radius: 10px;
}
.new-key p { margin: 0; font-size: 13.5px; color: var(--fg2); }

/* ── Mesh background ───────────────────────────────── */
/* Retired with brand v1 ("no gradient orbs, glow or mesh backgrounds"). The element stays in the
   markup as the hero's positioning layer, but draws nothing. */
.mesh { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: none; }

/* ═════════════════════════════════════════════════════
 * Public website
 * ═════════════════════════════════════════════════════ */
.site { overflow-x: hidden; }

/* Full width so the mesh spans the window; the side padding keeps the content within --page-width. */
.hero { position: relative; padding: 40px max(48px, calc((100% - var(--page-width)) / 2 + 48px)) 96px; }
.hero-split { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.hero > :not(.mesh) { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
  font: 500 13px/1.4 var(--font-mono); color: var(--fg2);
}
.eyebrow-tag {
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-elev);
  font: 500 12px/1.2 var(--font-mono); color: var(--fg);
}
.hero-h {
  font-family: var(--font-display); font-weight: 400; font-size: 64px; line-height: 1.04; letter-spacing: -0.02em;
  margin: 0 0 24px; text-wrap: balance;
}
.hero-h .italic { line-height: 1; }
.hero-sub { font-size: 18px; color: var(--fg2); margin: 0 0 32px; max-width: 540px; }
.ctas { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-facts {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 28px; margin: 48px 0 0; padding: 24px 0 0;
  border-top: 1px solid var(--line); list-style: none;
}
.hero-facts li { display: flex; flex-direction: column; gap: 2px; }
.hero-facts b { font-size: 20px; letter-spacing: -0.02em; line-height: 1.1; }
.hero-facts span { font-size: 12.5px; color: var(--fg3); }

/* Hero visual: a Trigger Profile as the Console shows it */
.app-window {
  background: var(--bg-elev); border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 32px 80px rgba(28,30,33,0.16), 0 12px 40px rgba(255,93,75,0.10);
}
.app-bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: linear-gradient(to bottom, #fbfaf7, #fff); border-bottom: 1px solid var(--line);
}
.app-dots { display: flex; gap: 6px; }
.app-dots i { width: 10px; height: 10px; border-radius: 50%; background: #e6e2da; display: block; }
.app-url {
  margin-left: auto; font: 11.5px var(--font-mono); color: var(--fg3);
  padding: 5px 10px; background: var(--bg-soft); border-radius: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-body { padding: 22px; }
.app-food { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.app-food-name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.app-food-id { font: 12px var(--font-mono); color: var(--fg3); }
.app-caption { font-size: 12px; color: var(--fg3); margin: 14px 0 0; }

/* Sections */
.section { position: relative; padding: 112px 48px; }
.section-inner { max-width: var(--page-width); margin: 0 auto; }
.section-bg { background: linear-gradient(to bottom, var(--bg) 0%, var(--bg-soft) 50%, var(--bg) 100%); }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head-c { margin-left: auto; margin-right: auto; text-align: center; }
.section-eyebrow {
  display: inline-block; margin-bottom: 16px;
  font: 500 13px/1.3 var(--font-mono); letter-spacing: 0; text-transform: none; color: var(--fg3);
}
.section-h {
  font-family: var(--font-display); font-weight: 400; font-size: 46px; line-height: 1.08; letter-spacing: -0.015em;
  margin: 0 0 18px; text-wrap: balance;
}
/* Besley carries the headline by itself: italic is kept for the hero line and hero numbers. */
.section-h .italic, .cta-h .italic { font-style: normal; letter-spacing: inherit; }
.section-sub { font-size: 17px; color: var(--fg2); margin: 0; }

/* Code card with CSS-only tabs */
.code-card {
  background: #0c0e10; color: rgba(255,255,255,0.86); border-radius: 16px; overflow: hidden;
  max-width: 1040px; margin: 0 auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
}
.code-tabs { display: flex; align-items: center; gap: 4px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.code-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.code-tabs label {
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  color: rgba(255,255,255,0.62); font-size: 13px; font-weight: 500;
}
.code-tabs input:checked + label { background: rgba(255,255,255,0.1); color: #fff; }
.code-tabs input:focus-visible + label { outline: 2px solid var(--accent); }
.code-pane { display: none; }
.code-card:has(#tab-curl:checked) .code-pane-curl,
.code-card:has(#tab-node:checked) .code-pane-node,
.code-card:has(#tab-response:checked) .code-pane-response { display: block; }
.code {
  margin: 0; padding: 22px 24px 26px; overflow-x: auto;
  font: 13.5px/1.65 var(--font-mono); color: rgba(255,255,255,0.86); background: transparent;
}
.code-pane pre.astro-code { margin: 0; padding: 22px 24px 26px; overflow-x: auto; font: 13.5px/1.65 var(--font-mono); background: transparent !important; }
.code .c { color: rgba(255,255,255,0.45); font-style: italic; }
.code .s { color: #ffc07a; }
.code .k { color: #d4a8f5; }
.code .n { color: #ffa38a; }
.code-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid rgba(255,255,255,0.08);
  font: 12px var(--font-mono); color: rgba(255,255,255,0.62);
}
.code-foot a { color: rgba(255,255,255,0.8); text-decoration: none; font-family: var(--font-body); font-size: 13px; }
.code-foot a:hover { color: #fff; }

/* Feature cards */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card-feature {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 28px 28px; display: flex; flex-direction: column;
}
.card-feature-tag { font: 500 12.5px/1.3 var(--font-mono); letter-spacing: 0; text-transform: none; color: var(--fg3); margin-bottom: 10px; }
.card-feature h3 { font-weight: 600; font-size: 21px; line-height: 1.22; letter-spacing: -0.02em; margin: 0 0 12px; }
.card-feature p { color: var(--fg2); font-size: 15px; margin: 0 0 18px; }
.card-feature code { font-size: 12.5px; color: var(--fg2); margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line); }

.factor-card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; padding: 20px 20px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.factor-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.factor-card-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.factor-card p { margin: 0; font-size: 13.5px; color: var(--fg2); }

/* Plans */
.tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); justify-content: center; gap: 18px; }
.tier {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px;
  padding: 32px 28px 28px; display: flex; flex-direction: column; position: relative;
}
.tier-dark { background: var(--fg); color: #fff; border-color: transparent; box-shadow: 0 12px 40px rgba(0,0,0,0.18); }
.tier-dark .tier-tag, .tier-dark .tier-per { color: rgba(255,255,255,0.7); }
.tier-dark .btn-primary { background: #fff; color: var(--fg); }
.tier-dark .btn-primary:hover { background: #f1efea; }
.tier-name { font-weight: 600; font-size: 18px; }
.tier-tag { font-size: 14px; color: var(--fg3); margin: 2px 0 22px; }
.tier-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 22px; }
.tier-pv { font-family: var(--font-display); font-style: italic; font-size: 52px; line-height: 1; letter-spacing: -0.02em; }
.tier-per { font-size: 14px; color: var(--fg3); }
.tier ul { list-style: none; padding: 22px 0 0; margin: 22px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.tier-dark ul { border-color: rgba(255,255,255,0.14); }
.tier li { display: flex; gap: 10px; }
.tier li::before { content: "✓"; color: #1c9c6d; font-weight: 700; }
.tier-dark li::before { color: #7fe0b4; }
.price-note { text-align: center; font-size: 13.5px; color: var(--fg3); margin: 28px auto 0; max-width: 640px; }

.compare { width: 100%; max-width: 860px; margin: 56px auto 0; border-collapse: collapse; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; font-size: 14.5px; }
.compare th, .compare td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.compare thead th { background: var(--bg-soft); font-size: 13px; color: var(--fg2); }
.compare tbody th { font-weight: 500; color: var(--fg2); width: 38%; }
.compare tr:last-child > * { border-bottom: 0; }
/* A table that can be wider than a phone scrolls inside its own box, never the page. */
.compare-wrap { max-width: 860px; margin: 0 auto; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elev); }
.compare-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.compare-wrap .compare { margin: 0; border: 0; border-radius: 0; min-width: 560px; }
/* The row labels stay put while the plan columns scroll under them. */
.compare-wrap .compare tbody th { position: sticky; left: 0; z-index: 1; background: var(--bg-elev); }
.compare-wrap .compare thead th:first-child { position: sticky; left: 0; z-index: 1; }
@media (max-width: 640px) { .compare-wrap .compare { min-width: 480px; } .compare-wrap .compare tbody th { width: 136px; min-width: 136px; } .compare-wrap .compare th, .compare-wrap .compare td { padding: 12px 14px; } }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 4px; cursor: pointer; list-style: none;
  font-weight: 500; font-size: 17px; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--fg3); font-weight: 300; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 4px 22px; color: var(--fg2); max-width: 680px; }

/* CTA + footer */
.cta { position: relative; overflow: hidden; padding: 120px 48px; text-align: center; }
.cta > :not(.mesh) { position: relative; z-index: 1; }
.cta-h { font-family: var(--font-display); font-weight: 400; font-size: 56px; line-height: 1.06; letter-spacing: -0.02em; margin: 0 0 18px; text-wrap: balance; }
.cta-sub { font-size: 17px; color: var(--fg2); max-width: 560px; margin: 0 auto 32px; }
.cta .ctas { justify-content: center; }
.site-footer {
  display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap;
  max-width: var(--page-width); margin: 0 auto; padding: 48px 48px 56px; border-top: 1px solid var(--line);
}
.site-footer-meta { font-size: 13.5px; color: var(--fg3); margin: 12px 0 0; max-width: 420px; }
.site-footer-cols { display: flex; gap: 64px; }
.site-footer h2 { font: 500 12.5px/1.3 var(--font-mono); text-transform: none; letter-spacing: 0; color: var(--fg3); margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer ul a { font-size: 14px; text-decoration: none; color: var(--fg2); }
.site-footer ul a:hover { color: var(--fg); }

/* Docs */
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; max-width: var(--page-width); margin: 0 auto; padding: 24px 48px 96px; }
.docs-nav { position: sticky; top: 88px; align-self: start; font-size: 14px; }
.docs-nav h2 { font: 500 12.5px/1.3 var(--font-mono); text-transform: none; letter-spacing: 0; color: var(--fg3); margin: 22px 0 8px; }
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav a { display: block; padding: 5px 10px; border-radius: 8px; text-decoration: none; color: var(--fg2); }
.docs-nav a:hover { background: var(--bg-soft); color: var(--fg); }
.docs-nav a[aria-current="page"] { background: var(--bg-soft); color: var(--fg); font-weight: 500; }
.docs-body { max-width: var(--docs-text-width); }
.docs-body h1 { font-family: var(--font-display); font-weight: 400; font-size: 44px; letter-spacing: -0.015em; line-height: 1.08; margin: 0 0 14px; }
.docs-lead { font-size: 18px; color: var(--fg2); margin: 0 0 40px; }
.docs-body h2 { font-weight: 600; font-size: 26px; letter-spacing: -0.02em; margin: 56px 0 12px; scroll-margin-top: 24px; }
.docs-body h3 { font-size: 17px; margin: 28px 0 8px; }
.docs-body p, .docs-body li { color: var(--fg2); }
.docs-body p code, .docs-body li code, .docs-body td code {
  font-size: 0.88em; background: var(--bg-soft); color: var(--fg); padding: 1px 6px; border-radius: 5px;
}
.docs-body .code-card { margin: 16px 0 8px; max-width: none; }
.docs-body .code { font-size: 13px; }
.endpoint { display: inline-flex; gap: 10px; align-items: center; font: 500 14px var(--font-mono); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.method { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: var(--ok-bg); color: var(--ok); }
.method-post { background: #e3effa; color: #1d5a91; }
.method-delete { background: var(--err-bg); color: var(--err-ink); }
/* Markdown in the docs: code blocks highlighted at build time (theme in site/astro.config.mjs) and tables */
.docs-body pre.astro-code {
  margin: 16px 0 8px; padding: 18px 22px; border-radius: 14px; overflow-x: auto;
  font: 13px/1.65 var(--font-mono); box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}
.docs-table, .docs-body table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.docs-table th, .docs-table td, .docs-body table th, .docs-body table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs-table th, .docs-body table th { color: var(--fg3); font-weight: 500; font-size: 12.5px; }
.docs-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }
.docs-pager a { text-decoration: none; color: var(--fg2); }
.docs-pager a:hover { color: var(--accent-ink); }
.callout { border-left: 3px solid var(--accent); background: var(--bg-tint); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 20px 0; }
.callout p { margin: 0; color: var(--fg); }

/* 404 */
.e404 { position: relative; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.e404 > :not(.mesh) { position: relative; z-index: 1; }
.e404-body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 24px 96px; }
.e404-card {
  display: flex; gap: 18px; align-items: center; text-align: left;
  background: rgba(255,255,255,0.8); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; margin-bottom: 36px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}
.e404-card img { width: 44px; height: 44px; }
.e404-readout { font: 13px/1.7 var(--font-mono); color: var(--fg3); }
.e404-readout b { color: var(--fg); font-weight: 500; margin-left: 10px; word-break: break-all; }
.e404-readout b.null { color: #6a4fb3; }
.e404-readout b.err { color: var(--err-ink); }
.e404-code { font-family: var(--font-display); font-style: italic; font-size: 120px; line-height: .9; color: var(--fg); letter-spacing: -0.03em; }
.e404-h { font-family: var(--font-display); font-weight: 400; font-size: 48px; letter-spacing: -0.015em; margin: 16px 0 12px; }
.e404-sub { font-size: 17px; color: var(--fg2); max-width: 520px; margin: 0 0 28px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; margin-bottom: 32px; font: 13px var(--font-mono); color: var(--fg3); }
.chip { font: 500 13px var(--font-body); color: var(--fg); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; }
.chip:hover { border-color: #d6d2c8; }

/* ═════════════════════════════════════════════════════
 * Sign-up and sign-in
 * ═════════════════════════════════════════════════════ */
.auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden; padding: 40px 48px;
  background: linear-gradient(180deg, var(--bg-tint), var(--bg)); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 48px;
}
.auth-brand .mesh {
  inset: -100px;
  background:
    radial-gradient(560px 380px at 12% 18%, var(--mesh-1) 0%, transparent 60%),
    radial-gradient(420px 320px at 90% 88%, var(--mesh-4) 0%, transparent 60%),
    radial-gradient(380px 280px at 70% 30%, var(--mesh-3) 0%, transparent 60%);
}
.auth-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: linear-gradient(to right, rgba(0,0,0,0.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 80%);
}
.auth-brand > :not(.mesh):not(.auth-grid) { position: relative; }
.auth-brand-h { margin-top: 24px; }
.auth-brand-eyebrow { font: 12px var(--font-mono); color: var(--fg3); }
.auth-brand-h h2 { font-weight: 600; font-size: 52px; line-height: 1; letter-spacing: -0.035em; margin: 14px 0 0; }
.auth-points { list-style: none; margin: auto 0 0; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px;
  background: rgba(255,255,255,0.6); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.8); border-radius: var(--radius); }
.auth-points li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14.5px; color: var(--fg2); }
.auth-points li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.auth-points b { color: var(--fg); font-weight: 600; }

.auth-panel { display: flex; flex-direction: column; padding: 32px 48px 48px; }
.auth-top { display: flex; justify-content: flex-end; gap: 8px; font-size: 13.5px; color: var(--fg3); }
.auth-top a { color: var(--fg); font-weight: 500; text-decoration: none; }
.auth-top a:hover { color: var(--accent-ink); }
.auth-inner { max-width: 440px; width: 100%; margin: 40px auto 0; }
.auth-eyebrow { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--accent-bg); color: var(--accent-ink); font-size: 12px; font-weight: 600; margin-bottom: 18px; }
.auth-h { font-weight: 600; font-size: 38px; line-height: 1.06; letter-spacing: -0.03em; margin: 0 0 8px; }
.auth-sub { font-size: 15px; color: var(--fg2); margin: 0 0 28px; }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 13px; font-weight: 500; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="search"], .input {
  width: 100%; padding: 10px 14px; background: var(--bg-elev); border: 1px solid #ddd8ce; border-radius: 10px;
  font: 14.5px var(--font-body); color: var(--fg); transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,93,75,0.14); }
.field-hint { font-size: 12px; color: var(--fg3); }
.terms-box {
  max-height: 220px; overflow-y: auto; padding: 4px 16px; font-size: 13px; color: var(--fg2);
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px;
}
.terms-box h2, .terms-box h3 { font-size: 13px; color: var(--fg); margin: 14px 0 4px; }
.terms-box p { margin: 0 0 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--fg2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--fg); flex: none; }
.auth-foot { margin-top: 24px; font-size: 13.5px; color: var(--fg3); }
.auth-foot a { color: var(--fg); font-weight: 500; }

.auth-center { position: relative; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; }
.auth-center > :not(.mesh) { position: relative; z-index: 1; }
.auth-card {
  width: 100%; max-width: 460px; background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 20px; padding: 36px 36px 30px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 24px 60px rgba(28,30,33,0.10);
}
.auth-card-wide { max-width: 580px; }
.auth-card .logo { margin-bottom: 26px; }
.auth-card .auth-h { font-size: 32px; }
.welcome-ok { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); font-weight: 700; font-size: 22px; margin-bottom: 18px; }
.auth-below { margin-top: 20px; font-size: 13px; color: var(--fg3); display: flex; align-items: center; gap: 8px; }

/* ═════════════════════════════════════════════════════
 * Developer Console
 * ═════════════════════════════════════════════════════ */
.console { font-size: 14px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: rgba(250,250,247,0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-l, .topbar-r { display: flex; align-items: center; gap: 16px; }
.topbar-link { font-size: 13.5px; text-decoration: none; opacity: .85; }
.topbar-link:hover { opacity: 1; }
.topbar-search { position: relative; }
.topbar-search input { width: 280px; padding: 7px 12px 7px 32px; border-radius: 9px; font-size: 13.5px; }
.topbar-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--fg3); pointer-events: none; }
.plan-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-elev); font-size: 12.5px; }

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: calc(100vh - 55px); }
.side {
  position: sticky; top: 55px; height: calc(100vh - 55px); overflow-y: auto;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  padding: 16px 12px; border-right: 1px solid var(--line);
}
.side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px;
  color: var(--fg2); text-decoration: none; font-size: 13.5px; transition: background .12s, color .12s;
}
.side-link:hover { background: var(--bg-soft); color: var(--fg); }
.side-link[aria-current="page"] { background: var(--fg); color: #fff; }
.side-link svg { width: 16px; height: 16px; flex: none; color: var(--fg3); }
.side-link[aria-current="page"] svg { color: var(--accent); }
.side-plan {
  padding: 16px; border-radius: 12px; border: 1px solid #efe6d3;
  background: linear-gradient(135deg, var(--mesh-1), var(--bg-tint));
}
.side-plan-h { font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.side-plan-meta { font: 11px var(--font-mono); color: var(--fg2); margin: 8px 0 12px; }
.side-plan form { margin: 0; }
.side-plan .btn { width: 100%; }
.side-signout { margin: 0; padding: 0 12px; }
.side-signout button { color: var(--fg3); text-decoration: none; font-size: 13px; }
.side-signout button:hover { color: var(--fg); text-decoration: underline; }

.meter { height: 6px; background: rgba(0,0,0,0.08); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; background: linear-gradient(90deg, #ff5d4b, #ffb04b); border-radius: 999px; }
.meter-lg { height: 10px; }

.main { padding: 32px 36px 72px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-eyebrow { font-size: 12.5px; color: var(--fg3); margin-bottom: 6px; }
.page-h { font-weight: 600; font-size: 30px; line-height: 1.05; letter-spacing: -0.03em; margin: 0; }
.page-head-r { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--fg3); margin-bottom: 16px; }
.crumbs a { color: var(--fg2); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 18px 18px 16px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi dt { font-size: 12.5px; color: var(--fg3); margin-bottom: 10px; }
.kpi dd { margin: 0; font-weight: 600; font-size: 28px; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-note { display: block; margin-top: 10px; font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--fg3); }

.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 22px; min-width: 0; }
.card + .card { margin-top: 14px; }
.grid > .card + .card { margin-top: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-t { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.card-s { font-size: 12.5px; color: var(--fg3); margin: 2px 0 0; }
.card-link { font-size: 13px; font-weight: 500; color: var(--accent-ink); text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-dark { background: #0c0e10; border-color: #0c0e10; color: rgba(255,255,255,0.86); padding: 0; overflow: hidden; }
.card-dark .card-h { padding: 14px 18px; margin: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.card-dark .card-t { color: #fff; font-size: 13.5px; }
.card-dark .code { font-size: 12.5px; padding: 16px 18px 20px; max-height: 520px; }

/* Usage meter on the Plan page */
.usage-bar-wrap { margin: 6px 0 18px; }
.usage-bar-legend { display: flex; justify-content: space-between; font: 12px var(--font-mono); color: var(--fg3); margin-top: 8px; }
dl.usage { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 0; font-size: 14px; }
dl.usage dt { color: var(--fg3); }
dl.usage dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }

/* Lists of rows: keys, per-key usage, interactions */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.rows > .row:first-child { border-top: 0; padding-top: 2px; }
.row-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-r { display: flex; align-items: center; gap: 14px; flex: none; }
.row-name { font-weight: 500; }
.row-sub { font: 12px var(--font-mono); color: var(--fg3); }
.row form { margin: 0; }
.key-badge { font: 600 10.5px var(--font-mono); text-transform: uppercase; padding: 3px 7px; border-radius: 5px; background: var(--ok-bg); color: var(--ok); }
.key-badge-off { background: #eeece7; color: #5b6066; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 220px; }

/* Data table */
.table-wrap { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--fg3); padding: 11px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbf8; }
.table a.food-link { font-weight: 500; text-decoration: none; }
.table a.food-link:hover { text-decoration: underline; color: var(--accent-ink); }
.id { font: 12.5px var(--font-mono); color: var(--fg2); }
.preps { display: flex; flex-wrap: wrap; gap: 4px; }
.prep { font: 11.5px var(--font-mono); color: var(--fg2); background: var(--bg-soft); padding: 2px 7px; border-radius: 5px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--fg3); }
.pager-links { display: flex; gap: 8px; }

/* Foods browser */
.browser { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.filters { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 76px; }
.filters h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg3); margin: 0 0 10px; }
.filters ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.filters a { display: block; padding: 6px 10px; border-radius: 7px; text-decoration: none; color: var(--fg2); font-size: 13.5px; }
.filters a:hover { background: var(--bg-soft); color: var(--fg); }
.filters a[aria-current="true"] { background: var(--fg); color: #fff; }
.search-row { display: flex; gap: 10px; margin-bottom: 14px; }
.search-row .input { flex: 1; }
.meta-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; color: var(--fg3); }
.empty { padding: 40px 24px; text-align: center; color: var(--fg2); }
.empty b { display: block; font-size: 16px; color: var(--fg); margin-bottom: 4px; }

/* Food page */
.food-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.food-h { font-weight: 600; font-size: 32px; letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 8px; }
.food-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--fg3); }
.food-meta .id { background: var(--bg-soft); padding: 2px 8px; border-radius: 6px; }
.prep-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.prep-switch a {
  font-size: 13px; padding: 6px 12px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--fg2);
}
.prep-switch a:hover { border-color: #d6d2c8; color: var(--fg); }
.prep-switch a[aria-current="true"] { background: var(--fg); color: #fff; border-color: var(--fg); }

.factor { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2.2fr); gap: 20px; padding: 18px 0; border-top: 1px solid var(--line-soft); }
.factors > .factor:first-child { border-top: 0; padding-top: 4px; }
.factor-name { font-weight: 600; font-size: 15px; }
.factor-kind { font: 11.5px var(--font-mono); color: var(--fg3); margin-top: 2px; }
.factor-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.factor-v { font-family: var(--font-display); font-style: italic; font-size: 34px; line-height: 1; letter-spacing: -0.02em; }
.factor-u { font: 12px var(--font-mono); color: var(--fg3); }
.factor-unknown { font-size: 14px; color: var(--fg2); }
.factor-src { font-size: 12.5px; color: var(--fg3); margin: 10px 0 0; }
.factor-src cite { font-style: normal; color: var(--fg2); }
.factor-wording { font-size: 13px; color: var(--fg2); margin: 8px 0 0; padding-left: 10px; border-left: 2px solid var(--line); }

.ph-scale { position: relative; height: 48px; margin: 22px 0 4px; }
.ph-grad {
  position: absolute; left: 0; right: 0; top: 16px; height: 8px; border-radius: 4px; opacity: .85;
  background: linear-gradient(to right, #ff5d4b 0%, #ff8a4b 14%, #ffc049 30%, #d4d878 50%, #6cc99c 65%, #4d9fd9 82%, #8b6fdc 100%);
}
.ph-mark { position: absolute; top: 8px; width: 2px; height: 24px; background: var(--fg); transform: translateX(-50%); }
.ph-bubble {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font: 600 11px var(--font-mono); background: var(--fg); color: #fff; padding: 2px 7px; border-radius: 6px; white-space: nowrap;
}
.ph-axis { position: absolute; top: 30px; left: 0; right: 0; display: flex; justify-content: space-between; font: 10px var(--font-mono); color: var(--fg3); }

.interaction { padding: 16px 0; border-top: 1px solid var(--line-soft); }
.interactions > .interaction:first-child { border-top: 0; padding-top: 2px; }
.interaction-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.interaction-wording { margin: 0 0 8px; font-size: 14.5px; }
.interaction-foods { font-size: 13px; color: var(--fg3); }
.interaction-foods a { color: var(--fg2); }

.attribution { margin-top: 18px; font-size: 12.5px; color: var(--fg3); }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field input { font: 12.5px var(--font-mono); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1080px) {
  .hero-split { grid-template-columns: 1fr; }
  .cards-3 { grid-template-columns: 1fr 1fr; }
  .cards-4 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid-main, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero-facts { grid-template-columns: repeat(2, auto); }
  .hero, .section, .cta { padding-left: 20px; padding-right: 20px; }
  .hero-h { font-size: 44px; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .section-h { font-size: 34px; }
  .cta-h { font-size: 42px; }
  .cards-3, .cards-4, .tiers { grid-template-columns: 1fr; }
  .site-footer { padding: 40px 20px; }
  /* Two even columns on phones, rather than a ragged wrap. */
  .site-footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 24px; width: 100%; }
  .docs-layout { grid-template-columns: 1fr; padding: 16px 20px 72px; }
  .docs-nav { position: static; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { padding: 24px 20px 48px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side ul { flex-direction: row; flex-wrap: wrap; }
  .side-plan, .side-signout { display: none; }
  .topbar-search { display: none; }
  .main { padding: 24px 18px 56px; }
  .browser { grid-template-columns: 1fr; }
  .filters { position: static; }
  .factor { grid-template-columns: 1fr; gap: 8px; }
  .e404-code { font-size: 88px; }
  .e404-h { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Draft previews only (site/src/pages/drafts) */
.draft-banner { position: relative; z-index: 6; margin: 0; padding: 10px 20px; text-align: center; font-size: 13.5px; font-weight: 500; background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid #f3d9a8; }
