:root {
  --bg: oklch(0.16 0.012 240);
  --bg-2: oklch(0.185 0.013 240);
  --panel: oklch(0.205 0.014 240);
  --panel-2: oklch(0.235 0.014 240);
  --border: oklch(0.295 0.016 240);
  --border-soft: oklch(0.255 0.014 240);
  --text: oklch(0.965 0.005 240);
  --text-dim: oklch(0.78 0.01 240);
  --muted: oklch(0.6 0.012 240);
  --faint: oklch(0.46 0.012 240);

  --green: oklch(0.82 0.16 145);
  --green-soft: oklch(0.82 0.16 145 / 0.14);
  --red: oklch(0.72 0.18 25);
  --red-soft: oklch(0.72 0.18 25 / 0.14);
  --amber: oklch(0.85 0.14 85);
  --amber-soft: oklch(0.85 0.14 85 / 0.14);
  --cyan: oklch(0.82 0.11 220);
  --cyan-soft: oklch(0.82 0.11 220 / 0.14);
  --violet: oklch(0.75 0.14 295);

  --ff-sans: "Geist", system-ui, -apple-system, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-lg: 0 30px 80px -20px oklch(0 0 0 / 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--ff-sans); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--ff-mono); }

::selection { background: var(--green-soft); color: var(--text); }

/* ===== App shell ===== */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.app.fullbleed { grid-template-columns: 1fr; }

/* ===== Sidebar (logged-in nav) ===== */
.sidebar {
  border-right: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
}
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--green) 0%, var(--cyan) 100%);
  color: oklch(0.15 0.012 240);
  font-family: var(--ff-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.brand-name {
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 15px;
}
.brand-env {
  margin-left: auto;
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border-soft);
  padding: 2px 6px;
  border-radius: 999px;
}

.nav-group-label {
  font-family: var(--ff-mono);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--faint);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 13.5px;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active {
  background: var(--panel);
  color: var(--text);
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 2px; background: var(--green);
  border-radius: 2px;
}
.nav-item .ico { width: 16px; height: 16px; color: var(--muted); flex: 0 0 16px; }
.nav-item.active .ico { color: var(--green); }
.nav-badge {
  margin-left: auto;
  font-family: var(--ff-mono);
  font-size: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 999px;
  color: var(--muted);
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: oklch(0.15 0.012 240);
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
}
.user-name { font-size: 13px; }
.user-email { font-size: 11px; color: var(--muted); font-family: var(--ff-mono); }

/* ===== Top header inside content ===== */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(8px);
}
.crumbs {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--muted);
  display: flex; gap: 6px;
}
.crumbs .sep { color: var(--faint); }
.crumbs .cur { color: var(--text); }
.topbar-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  padding: 6px 10px;
  border-radius: 7px;
  width: 280px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--muted);
}
.kbd {
  display: inline-flex; align-items: center;
  font-family: var(--ff-mono); font-size: 10px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 4px;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ff-mono); font-size: 11px;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border-soft);
  padding: 4px 9px; border-radius: 999px;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.dot.amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot.red { background: var(--red); box-shadow: 0 0 8px var(--red); }

/* ===== Content scaffold ===== */
.page {
  padding: 28px;
  max-width: 1280px;
  margin: 0 auto;
}
.page-head { margin-bottom: 24px; }
.page-title {
  font-size: 26px; letter-spacing: -0.02em; font-weight: 600; margin: 6px 0 6px;
}
.page-sub { color: var(--muted); font-size: 14px; max-width: 640px; }
.eyebrow {
  font-family: var(--ff-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--green);
}

/* ===== Card primitives ===== */
.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500;
}
.card-body { padding: 18px; }

.grid { display: grid; gap: 16px; }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-2 { grid-template-columns: 1fr 1fr; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 7px;
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--text);
  transition: background 0.15s;
}
.btn:hover { background: var(--panel-2); }
.btn-primary {
  background: var(--green);
  color: oklch(0.15 0.012 240);
  border-color: transparent;
  font-weight: 600;
}
.btn-primary:hover { background: oklch(0.86 0.16 145); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--panel); }
.btn-danger {
  color: var(--red);
  border-color: oklch(0.72 0.18 25 / 0.4);
  background: var(--red-soft);
}

.icon-btn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--text-dim);
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

/* ===== Tag / badge ===== */
.tag {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid currentColor;
  display: inline-flex; align-items: center; gap: 4px;
}
.tag.get { color: var(--green); background: var(--green-soft); border-color: transparent; }
.tag.post { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.tag.delete { color: var(--red); background: var(--red-soft); border-color: transparent; }
.tag.muted { color: var(--muted); background: var(--panel-2); border-color: var(--border-soft); }
.tag.beta { color: var(--cyan); background: var(--cyan-soft); border-color: transparent; }

/* ===== Inputs ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px; color: var(--text-dim);
  font-weight: 500;
}
.input {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus { border-color: var(--green); background: var(--bg); }
.input.mono { font-family: var(--ff-mono); font-size: 12.5px; }

/* ===== Code block ===== */
.code-card {
  background: oklch(0.13 0.011 240);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
}
.code-tab {
  padding: 9px 14px;
  font-family: var(--ff-mono); font-size: 11.5px;
  color: var(--muted);
  border-right: 1px solid var(--border-soft);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.code-tab:hover { color: var(--text-dim); }
.code-tab.active { color: var(--text); background: oklch(0.13 0.011 240); position: relative; }
.code-tab.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--green);
}
.code-tab .lang-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
}
.code-tab.active .lang-dot { background: var(--green); }

.code-toolbar {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px;
}

.code-body {
  padding: 14px 16px;
  font-family: var(--ff-mono);
  font-size: 12.5px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-dim);
}
.tok-key { color: var(--cyan); }
.tok-str { color: var(--green); }
.tok-num { color: var(--amber); }
.tok-bool { color: var(--violet); }
.tok-cmt { color: var(--faint); font-style: italic; }
.tok-flag { color: var(--amber); }
.tok-path { color: var(--text); }
.tok-method { color: var(--green); font-weight: 600; }

/* ===== Tables ===== */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-2);
  font-family: var(--ff-mono);
}
.tbl td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: oklch(0.21 0.014 240 / 0.6); }

/* ===== Misc ===== */
.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 16px;
  font-size: 13px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--ff-mono); font-size: 12.5px; }

.meter {
  height: 6px;
  background: var(--bg-2);
  border-radius: 3px;
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}
.meter.warn > i { background: linear-gradient(90deg, var(--amber), var(--red)); }

.spark { width: 100%; height: 36px; }

.divider { height: 1px; background: var(--border-soft); margin: 18px 0; }

.scroll-x { overflow-x: auto; }

/* ===== Landing ===== */
.landing-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 18px 48px;
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
  background: oklch(0.16 0.012 240 / 0.7);
}
.landing-nav .brand { padding: 0; }
.landing-nav .links {
  display: flex; gap: 22px; font-size: 13px; color: var(--text-dim);
  margin-left: 32px;
}
.landing-nav .links a:hover { color: var(--text); }
.landing-nav .cta { margin-left: auto; display: flex; gap: 10px; }

.hero {
  position: relative;
  padding: 88px 48px 72px;
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, oklch(0.28 0.015 240 / 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(0.28 0.015 240 / 0.5) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 40%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, black 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 {
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 18px 0 22px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.55;
  max-width: 540px;
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 12px; align-items: center; }
.trust-line {
  margin-top: 36px;
  display: flex; align-items: center; gap: 18px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--muted);
}
.trust-line .sep { color: var(--faint); }

.hero-terminal {
  background: oklch(0.13 0.011 240);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--muted);
}
.tl-lights { display: flex; gap: 6px; }
.tl-lights span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }

.section {
  padding: 80px 48px;
  border-bottom: 1px solid var(--border-soft);
}
.section-inner { max-width: 1280px; margin: 0 auto; }
.section h2 {
  font-size: 36px; letter-spacing: -0.025em; font-weight: 600; margin: 14px 0 14px;
}
.section h2 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section .lead { color: var(--text-dim); font-size: 16px; max-width: 640px; margin-bottom: 48px; }

.feature-card {
  padding: 26px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}
.feature-card h3 {
  font-size: 16px; font-weight: 600; margin: 14px 0 8px;
  letter-spacing: -0.01em;
}
.feature-card p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0; }
.feature-card .ico-wrap {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  display: grid; place-items: center;
}

.endpoint-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.endpoint-strip .col {
  padding: 22px;
  border-right: 1px solid var(--border-soft);
}
.endpoint-strip .col:last-child { border-right: 0; }
.endpoint-strip .col h4 {
  font-family: var(--ff-mono);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 14px 0 10px;
}
.endpoint-strip .col p { font-size: 13px; color: var(--text-dim); margin: 0; line-height: 1.5; }
.endpoint-strip .col .num { font-family: var(--ff-mono); font-size: 11px; color: var(--faint); }

/* ===== Auth ===== */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-aside {
  background:
    radial-gradient(circle at 30% 20%, oklch(0.82 0.16 145 / 0.12), transparent 50%),
    radial-gradient(circle at 70% 80%, oklch(0.82 0.11 220 / 0.1), transparent 50%),
    var(--bg-2);
  border-right: 1px solid var(--border-soft);
  padding: 48px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.auth-aside .ticker {
  position: absolute; left: 0; right: 0; bottom: 48px;
  font-family: var(--ff-mono); font-size: 11.5px;
  white-space: nowrap;
  color: var(--muted);
}
.auth-aside .ticker .up { color: var(--green); }
.auth-aside .ticker .down { color: var(--red); }
.auth-aside .quote {
  margin-top: auto;
  font-size: 22px; letter-spacing: -0.015em;
  line-height: 1.35; max-width: 460px;
  color: var(--text-dim);
}
.auth-aside .quote em {
  font-style: normal;
  color: var(--text);
}

.auth-main {
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 380px;
}
.auth-card h1 {
  font-size: 28px; letter-spacing: -0.02em; font-weight: 600;
  margin: 18px 0 8px;
}
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .form-row { display: flex; gap: 10px; }
.auth-card .form-row .field { flex: 1; }
.auth-foot {
  margin-top: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.auth-foot a { color: var(--green); }

.oauth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.divider-or {
  display: flex; align-items: center; gap: 10px;
  color: var(--faint); font-size: 11px;
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }

/* ===== Stat tiles ===== */
.stat {
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.stat .label {
  font-family: var(--ff-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.stat .value {
  font-family: var(--ff-mono);
  font-size: 28px; letter-spacing: -0.02em;
  margin-top: 6px;
  font-weight: 500;
}
.stat .trend {
  font-family: var(--ff-mono); font-size: 11.5px;
  margin-top: 4px;
  color: var(--green);
  display: inline-flex; align-items: center; gap: 4px;
}
.stat .trend.down { color: var(--red); }
.stat .trend.flat { color: var(--muted); }

/* ===== Docs page ===== */
.docs-shell {
  display: grid;
  grid-template-columns: 260px 1fr 360px;
  min-height: calc(100vh - 56px);
}
.docs-side {
  border-right: 1px solid var(--border-soft);
  padding: 22px 18px;
  background: var(--bg-2);
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.docs-side .section-label {
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10.5px;
  color: var(--faint);
  margin: 18px 8px 6px;
}
.docs-side .ep-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}
.docs-side .ep-item:hover { background: var(--panel); color: var(--text); }
.docs-side .ep-item.active { background: var(--panel); color: var(--text); }
.docs-side .ep-item .tag { flex: 0 0 auto; }
.docs-side .filter {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  padding: 7px 10px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--muted);
  outline: none;
}

.docs-main {
  padding: 36px 44px;
  max-width: 760px;
  width: 100%;
}
.docs-main h1 {
  font-size: 30px;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 14px 0 12px;
}
.docs-main .endpoint-url {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 13px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  padding: 6px 10px; border-radius: 7px;
}
.docs-main h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 36px 0 12px;
  letter-spacing: -0.015em;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
.docs-main h2:first-of-type { border-top: 0; padding-top: 0; }
.docs-main p { color: var(--text-dim); font-size: 14px; line-height: 1.65; }
.docs-main p code, .docs-main li code {
  font-family: var(--ff-mono); font-size: 12px;
  background: var(--panel-2); padding: 1px 5px; border-radius: 4px;
  color: var(--amber); border: 1px solid var(--border-soft);
}
.params-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.params-tbl th {
  text-align: left; font-weight: 500; font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--ff-mono);
}
.params-tbl td {
  padding: 14px 12px; vertical-align: top;
  border-bottom: 1px solid var(--border-soft);
}
.params-tbl tr:last-child td { border-bottom: 0; }
.param-name { font-family: var(--ff-mono); font-size: 12.5px; color: var(--text); }
.param-type { font-family: var(--ff-mono); font-size: 11px; color: var(--cyan); }
.param-req { font-family: var(--ff-mono); font-size: 10px; color: var(--red); text-transform: uppercase; letter-spacing: 0.08em; }
.param-opt { font-family: var(--ff-mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.param-desc { color: var(--text-dim); font-size: 12.5px; line-height: 1.55; }
.param-desc code { font-family: var(--ff-mono); font-size: 11px; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; color: var(--amber); }

.docs-aside {
  border-left: 1px solid var(--border-soft);
  background: var(--bg);
  padding: 24px;
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.docs-aside .ep-label {
  font-family: var(--ff-mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px;
}

/* ===== Chart ===== */
.chart {
  width: 100%; height: 260px; display: block;
}
.chart-axis { stroke: var(--border-soft); stroke-width: 1; }
.chart-grid { stroke: var(--border-soft); stroke-width: 1; stroke-dasharray: 2 4; opacity: 0.6; }
.chart-label { font-family: var(--ff-mono); font-size: 10px; fill: var(--muted); }
.chart-bar { fill: var(--green); }
.chart-bar.alt { fill: var(--cyan); }
.chart-line { stroke: var(--green); stroke-width: 2; fill: none; }
.chart-area { fill: var(--green-soft); }

.legend { display: flex; gap: 16px; font-family: var(--ff-mono); font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ===== Floating mini-nav for prototype ===== */
.proto-nav {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 6px;
  background: oklch(0.13 0.011 240 / 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  font-family: var(--ff-mono); font-size: 11px;
}
.proto-nav button {
  padding: 7px 12px; border-radius: 999px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.proto-nav button:hover { color: var(--text); }
.proto-nav button.active { background: var(--green); color: oklch(0.15 0.012 240); font-weight: 600; }
.proto-nav .group-sep { width: 1px; height: 14px; background: var(--border); margin: 0 4px; }

/* Utility */
.row { display: flex; align-items: center; gap: 10px; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 10px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.flex-1 { flex: 1; }
.muted { color: var(--muted); }
.mono { font-family: var(--ff-mono); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }

/* ===========================================================================
   Responsive layer — ADDITIVE ONLY.
   The whole site above is authored for a fixed wide desktop. These blocks
   apply only at/below their max-width, so they cannot touch desktop rendering
   (a max-width media query simply doesn't match a wide viewport). This pairs
   with the index.html viewport switch to width=device-width. Do NOT fold any
   of these declarations back into the base rules — collapsing the desktop and
   mobile styles together is exactly what broke (and got reverted) before.
   =========================================================================== */

/* ---- Tablet and below: collapse multi-column layouts ---- */
@media (max-width: 920px) {
  /* Landing hero: copy + terminal stack vertically */
  .hero { padding: 64px 24px 48px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }

  /* Section + nav rhythm tightens */
  .section { padding: 56px 24px; }
  .landing-nav { padding: 16px 24px; }

  /* Card grids shed columns (3/4-up -> 2-up) */
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .endpoint-strip { grid-template-columns: repeat(2, 1fr); }
  /* These two carry inline grid styles in the JSX, so !important is required
     to win over the element's style attribute. */
  .code-split { grid-template-columns: 1fr !important; }
  .pricing-grid { grid-template-columns: 1fr !important; }

  /* Auth: drop the marketing aside, center the form full-width */
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding: 40px 24px; }

  /* Docs: hide the left index + right aside, keep the article column */
  .docs-shell { grid-template-columns: 1fr; }
  .docs-side, .docs-aside { display: none; }
  .docs-main { padding: 28px 22px; max-width: none; }

  /* Console shell: the sticky full-height sidebar becomes a static block
     above the page content (no hamburger JS — keeps this CSS-only & safe). */
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .topbar-search { display: none; }
  .page { padding: 22px 16px; }
}

/* ---- Phone: single column everywhere, smaller type, tap-friendly CTAs ---- */
@media (max-width: 600px) {
  .hero { padding: 48px 18px 36px; }
  .hero h1 { font-size: 36px; }
  .hero-sub { font-size: 15px; }
  .section { padding: 44px 18px; }
  .section h2 { font-size: 26px; }

  /* Stack every card grid */
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .endpoint-strip { grid-template-columns: 1fr; }
  .endpoint-strip .col { border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .endpoint-strip .col:last-child { border-bottom: 0; }

  /* Landing nav: hide in-page anchors, keep brand + auth CTAs */
  .landing-nav { padding: 12px 16px; gap: 10px; }
  .landing-nav .links { display: none; }
  .landing-nav .cta { margin-left: auto; gap: 8px; }

  /* Hero CTAs go full-width and wrap cleanly */
  .hero-actions { flex-wrap: wrap; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .trust-line { flex-wrap: wrap; gap: 8px 14px; }

  /* Auth form fills the screen, stacked name fields */
  .auth-main { padding: 32px 18px; }
  .auth-card { max-width: 100%; }
  .auth-card .form-row { flex-direction: column; }
}

/* ===========================================================================
   Responsive layer — PHASE 2 (additive, isolated).
   Everything below is a SEPARATE set of @media blocks appended after the
   original responsive layer above. CSS allows multiple @media blocks with the
   same query — they stack — so nothing here edits or overrides the existing
   working rules; it only adds coverage the first pass didn't have.

   Why a second pass was needed: several console screens (billing pricing,
   the dashboard / analytics two-up rows, the support screen's side column)
   set `grid-template-columns` as an INLINE style on the element. An inline
   style beats any class selector — even inside a media query — UNLESS the
   media-query rule uses `!important`. The first pass only collapsed
   class-based grids (.g-2/.g-3/.g-4), so the inline-grid screens stayed
   multi-column on phones. The `.mq-stack` rule below fixes that with the
   same `!important` technique the first pass already used for .code-split
   and .pricing-grid.

   SAFETY INVARIANT (the thing that broke before): every selector here is
   either (a) a brand-new class (.mq-stack / .mq-modal) that has NO desktop
   rule anywhere, so it is inert above the breakpoint, or (b) wrapped in a
   max-width media query that cannot match a wide viewport. Desktop rendering
   is therefore mathematically unchanged. Do NOT lift any of these into the
   base cascade.
   =========================================================================== */

/* ---- Tablet and below: collapse inline-grid two/three-up layouts ---- */
@media (max-width: 920px) {
  /* The single lever for every inline-styled grid that should become one
     column on a narrow screen. `!important` is REQUIRED to win over the
     element's own style="grid-template-columns:…" attribute. Applied to:
       • billing plan comparison (repeat(3,1fr))
       • dashboard rate-limit + recent-requests two-up (1.1fr 1.4fr)
       • analytics latency+table and heatmap+status two-ups
       • support screen conversation + tips side column (1fr 240px) */
  .mq-stack { grid-template-columns: 1fr !important; }

  /* Cap the stacked app column at the viewport even when a descendant has a
     min-content WIDER than the screen — e.g. a `white-space: pre` code
     snippet in the docs whose longest line is ~630px. A bare `1fr` column
     resolves to `minmax(auto, 1fr)`, and `auto` adopts that min-content, so
     the whole page scrolls sideways. `minmax(0, 1fr)` floors the minimum at
     0 so the column tracks the viewport instead; the wide block then scrolls
     inside its OWN box via the `pre { overflow-x: auto }` rule below. This is
     the textbook fix for "a grid/flex child with long unbreakable content
     drags the page wider than the screen". Layout is otherwise identical to
     the existing `.app { grid-template-columns: 1fr }` rule it refines. */
  .app { grid-template-columns: minmax(0, 1fr); }
  .content { min-width: 0; }
  .docs-shell, .docs-main { min-width: 0; }
}

/* ---- Phone: modal width caps, scrollable tables, bigger tap targets ---- */
@media (max-width: 600px) {
  /* Fixed-pixel-width modals (480 / 540 / 420 / 440) overflow a ~360px phone.
     Cap them to the viewport with a small gutter and allow the body to scroll
     when a tall modal (e.g. "save this key") exceeds the screen height. The
     `!important` beats the inline width; the overlay already centres them. */
  .mq-modal {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 28px);
    overflow-y: auto;
  }

  /* Data tables: instead of squishing many columns into 360px (or worse,
     pushing the whole page wider than the viewport and creating a horizontal
     page scroll), let the table scroll horizontally INSIDE its own card.
     :has() is supported in every 2024+ mobile browser; where it is somehow
     not, the rule is ignored and the table falls back to today's wrapping
     behaviour — a safe progressive enhancement, never a regression. */
  .card-body:has(.tbl) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tbl th, .tbl td {
    padding-left: 12px;
    padding-right: 12px;
    white-space: nowrap;
  }

  /* Tap targets — nudge the smallest interactive elements toward the ~44px
     comfortable-touch zone without changing their desktop size. */
  .btn { padding: 10px 16px; }
  .icon-btn { width: 36px; height: 36px; }
  .nav-item { padding: 10px; }

  /* Page gutter trims a touch more on the smallest screens so cards get the
     maximum readable width. Mirrors the existing 16px gutter at 920. */
  .page { padding: 18px 14px; }

  /* Any preformatted / code block scrolls horizontally inside its own box
     rather than widening the whole page. `.code-body` already had this;
     the docs page also renders bare `<pre class="mono">` example snippets
     with `white-space: pre` that did NOT, which was forcing a horizontal
     page scroll on the docs screen at phone widths. Capping max-width and
     enabling overflow-x contains the longest line to the block. */
  pre, .code-body {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Docs parameter / error-code tables (.params-tbl) have a name column and a
     long-description column. With the default `table-layout: auto` the two
     columns' combined min-content (~514px) exceeded the phone viewport and
     pushed the whole docs page into a horizontal scroll. `table-layout: fixed`
     + `width: 100%` makes the columns share the available width and the
     descriptions wrap; `overflow-wrap: anywhere` guarantees a long single
     token (an OSI symbol, a URL) breaks instead of overflowing. Reading a
     wrapped description beats sideways-scrolling a table on a phone. */
  .params-tbl {
    table-layout: fixed;
    width: 100%;
  }
  .params-tbl th, .params-tbl td {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* The docs endpoint URL pill (.endpoint-url) lays a GET badge beside a long
     mono URL on one inline-flex line. The URL
     (https://market-option.com/api/v1/options/chain) does not wrap, so it
     pushed a few px past the phone viewport. Let the pill wrap to a second
     line and break the URL so it always fits. */
  .endpoint-url {
    flex-wrap: wrap;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
}
