/* ============================================================
   LLM Gateway Bench — shared visual system
   Style inspired by synthorai.io: light, generous whitespace, Inter / IBM Plex Mono,
   slate grayscale + indigo accent, soft-shadowed white cards, readability first.
   Shared across all pages (index / article / articles); class names are identical
   to the original dark version, so the JS rendering logic needs no changes.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #f8fafc;            /* page base: very light slate */
  --bg-grad-top: #ffffff;
  --panel: #ffffff;         /* card / table white background */
  --panel2: #f1f5f9;        /* secondary fill / hover */
  --border: #e2e8f0;        /* slate-200 */
  --border-soft: #eef2f6;
  --text: #0f172a;          /* slate-900 headings / body */
  --muted: #475569;         /* slate-600 secondary text */
  --faint: #94a3b8;         /* slate-400 de-emphasized */
  --accent: #6366f1;        /* indigo */
  --accent-strong: #4f46e5;
  --accent-soft: #eef2ff;   /* very light indigo background */
  --good: #059669; --warn: #d97706; --bad: #dc2626;
  --good-bg: #ecfdf5; --warn-bg: #fffbeb; --bad-bg: #fef2f2; --unk-bg: #f1f5f9;
  --good-bd: #a7f3d0; --warn-bd: #fde68a; --bad-bd: #fecaca;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --shadow: 0 1px 3px #0f172a14, 0 1px 2px #0f172a0a;
  --shadow-md: 0 4px 12px -2px #0f172a1f, 0 2px 6px -2px #0f172a14;
  --radius: 14px;
  --radius-sm: 9px;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px; line-height: 1.65;
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg) 320px);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--panel2);
  border: 1px solid var(--border); border-radius: 6px; padding: 1.5px 6px; color: #334155; }
.num { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.good { color: var(--good); } .warn { color: var(--warn); }
.bad { color: var(--bad); } .muted { color: var(--muted); }

/* ===== Top navigation ===== */
nav { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
nav .wrap { display: flex; align-items: center; gap: 24px; height: 60px; max-width: 1200px; }
nav .logo { font-weight: 800; font-size: 16px; color: var(--text); letter-spacing: -.01em; }
nav .logo span { color: var(--faint); font-weight: 500; margin-left: 8px; font-size: 13px; }
nav a.lnk { color: var(--muted); font-size: 14px; font-weight: 500; transition: color .15s; }
nav a.lnk:hover { color: var(--accent); text-decoration: none; }
nav .right { margin-left: auto; display: flex; gap: 18px; }

/* ===== Header ===== */
header { padding: 56px 0 36px; }
h1 { font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.tagline { color: var(--muted); margin-top: 14px; max-width: 800px; font-size: 17px; line-height: 1.6; }
.tagline b { color: var(--text); font-weight: 700; }
.meta-row { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.meta-item { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 16px; box-shadow: var(--shadow); }
.meta-item .k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.meta-item .v { font-family: var(--mono); font-size: 15px; margin-top: 3px; color: var(--text); }
.mock-banner { background: var(--warn-bg); border: 1px solid var(--warn-bd); color: #92400e;
  border-radius: var(--radius-sm); padding: 10px 16px; font-size: 13.5px; margin-top: 22px; display: inline-block; }

/* ===== Sections ===== */
section { padding: 44px 0 8px; }
h2 { font-size: 23px; font-weight: 700; letter-spacing: -.01em; }
h2 .anchor { color: var(--faint); font-weight: 400; font-size: 13.5px; margin-left: 10px; }
h2 .anchor a { font-weight: 500; }
.sub { color: var(--muted); font-size: 14.5px; margin: 10px 0 20px; max-width: 860px; line-height: 1.6; }

/* ===== Tables ===== */
.tablebox { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; white-space: nowrap; vertical-align: middle; }
thead th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600;
  border-bottom: 1px solid var(--border); background: #f8fafc; }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--accent); }
thead th.sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; color: var(--accent); }
thead th.sorted { color: var(--accent); }
thead th .arr { font-size: 9px; opacity: .6; }
thead th.sorted .arr { opacity: 1; }
tbody tr { border-bottom: 1px solid var(--border-soft); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
td.r, th.r { text-align: right; }
.gw-name { font-weight: 600; font-size: 14.5px; }
.gw-name a { color: var(--text); }
.gw-name a:hover { color: var(--accent); }
.gw-sub { font-size: 12px; color: var(--faint); font-family: var(--mono); margin-top: 1px; }

/* ===== Badges ===== */
.bdg { display: inline-block; font-size: 12px; line-height: 1; padding: 5px 10px;
  border-radius: 999px; border: 1px solid; font-weight: 600; }
.bdg.ok   { color: var(--good); border-color: var(--good-bd); background: var(--good-bg); }
.bdg.warn { color: var(--warn); border-color: var(--warn-bd); background: var(--warn-bg); }
.bdg.bad  { color: var(--bad);  border-color: var(--bad-bd);  background: var(--bad-bg); }
.bdg.unk  { color: var(--muted); border-color: var(--border); background: var(--unk-bg); }

/* ===== uptime strip ===== */
.uptime-strip { display: inline-flex; gap: 2px; vertical-align: middle; }
.uptime-strip i { width: 4px; height: 16px; border-radius: 2px; background: var(--good); }
.uptime-strip i.w { background: var(--warn); } .uptime-strip i.b { background: var(--bad); }
.uptime-strip i.n { background: #e2e8f0; }
.uptime-strip i:hover { outline: 1px solid var(--text); }

.spark { vertical-align: middle; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; }

/* ===== Card grid (pain points / articles / self-test cards) ===== */
.pains { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; }
.pain { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 22px; box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s; }
.pain:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pain .no { font-family: var(--mono); color: var(--accent); font-size: 12px; font-weight: 500; }
.pain h3 { font-size: 16.5px; margin: 6px 0 6px; font-weight: 700; }
.pain h3 a { color: var(--text); }
.pain h3 a:hover { color: var(--accent); }
.pain p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.pain a { font-size: 14px; }

/* ===== Stability panel ===== */
.stab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(540px, 1fr)); gap: 16px; }
.stab { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); }
.stab .head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.stab .head .pct { font-family: var(--mono); font-size: 24px; font-weight: 700; }
.stab .row { display: flex; align-items: center; gap: 10px; margin-top: 11px; }
.stab .lbl { width: 92px; flex: none; font-size: 11px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.errbar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; flex: 1; background: var(--unk-bg); }
.errbar i { height: 100%; }
.legend { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.axis { font-family: var(--mono); font-size: 10px; fill: var(--faint); }
.gridline { stroke: var(--border); stroke-width: 1; }

/* ===== Annotations / footnotes ===== */
.evidence { font-size: 11.5px; color: var(--faint); }
.fn { font-size: 13px; color: var(--muted); margin-top: 14px; line-height: 1.6; }
.fn b { color: var(--text); }

footer { margin-top: 56px; padding: 28px 0 56px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 13px; }
footer p { margin-bottom: 6px; }

/* ============================================================
   Reading pages (article.html / articles.html): body.reading
   ============================================================ */
body.reading .wrap { max-width: 840px; }
body.reading { font-size: 16px; line-height: 1.75; }

/* Article body */
article { padding: 44px 0 24px; }
.back { font-size: 13.5px; color: var(--muted); }
article h1 { font-size: 32px; margin: 16px 0 8px; }
.a-meta { color: var(--faint); font-size: 13px; font-family: var(--mono); margin-bottom: 10px; }
.a-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.a-tag { font-size: 12px; color: var(--accent); border: 1px solid var(--accent-soft);
  background: var(--accent-soft); border-radius: 999px; padding: 3px 11px; font-weight: 500; }
.md h2 { font-size: 22px; font-weight: 700; margin: 38px 0 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.md h3 { font-size: 18px; font-weight: 650; margin: 26px 0 8px; }
.md p { margin: 15px 0; color: #1e293b; }
.md ul, .md ol { margin: 15px 0 15px 26px; }
.md li { margin: 7px 0; color: #1e293b; }
.md strong { color: var(--text); font-weight: 700; }
.md code { font-size: 13.5px; }
.md pre { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; overflow-x: auto; margin: 18px 0; box-shadow: var(--shadow); }
.md pre code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.7; color: #334155; }
.md blockquote { border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 12px 18px; margin: 18px 0; color: #3730a3; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.md blockquote p { margin: 4px 0; color: #3730a3; }
.md a { border-bottom: 1px solid transparent; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 30px 0; }
.related { margin: 44px 0 0; padding: 24px 0 0; border-top: 1px solid var(--border); }
.related h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 14px; font-weight: 600; }
.related a { display: block; padding: 6px 0; }
.err { color: var(--muted); padding: 60px 0; text-align: center; }

/* Article index page */
article-list, .list { padding: 18px 0 8px; }
.list .item { display: flex; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.list .item:last-child { border-bottom: none; }
.list .idx-num { font-family: var(--mono); font-size: 24px; color: var(--accent); flex: none; width: 38px; padding-top: 2px; font-weight: 500; }
.list .body h2 { font-size: 18.5px; font-weight: 650; margin-bottom: 5px; border: none; padding: 0; }
.list .body h2 a { color: var(--text); }
.list .body h2 a:hover { color: var(--accent); }
.list .body p { color: var(--muted); font-size: 14px; }
.list .tags { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.list .tag { font-size: 12px; color: var(--accent); border: 1px solid var(--accent-soft);
  background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; font-weight: 500; }
.list .date { font-size: 12px; color: var(--faint); font-family: var(--mono); }
.lead { color: var(--muted); margin-top: 12px; max-width: 680px; font-size: 16px; line-height: 1.6; }

/* ============================================================
   Responsive: narrow screens (mobile)
   ============================================================ */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  /* Nav: links scroll horizontally rather than wrapping; hide the logo subtitle to save space */
  nav .wrap { height: 52px; gap: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  nav .wrap::-webkit-scrollbar { display: none; }
  nav .logo { white-space: nowrap; flex: none; }
  nav .logo span { display: none; }
  nav a.lnk { white-space: nowrap; flex: none; }
  nav .right { margin-left: 0; }
  /* Tighten header spacing and font sizes */
  header { padding: 36px 0 24px; }
  h1 { font-size: 27px; }
  .tagline { font-size: 15px; }
  section { padding: 32px 0 6px; }
  h2 { font-size: 20px; }
  h2 .anchor { display: block; margin-left: 0; margin-top: 4px; }
  /* Stability two-column collapses to single column on narrow screens */
  .stab-grid { grid-template-columns: 1fr; }
  /* Slightly tighten reading-page body */
  body.reading { font-size: 15.5px; }
  article h1, .list .body h2 { font-size: 24px; }
}

/* Quick-pick: priority chips + filters + current-#1 verdict */
.picker { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin: 4px 0 16px; box-shadow: var(--shadow); }
.picker-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picker-row + .picker-row { margin-top: 10px; }
.pk-label { font-size: 12.5px; font-weight: 700; color: var(--muted); min-width: 56px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 600 13px/1 var(--sans); color: var(--muted); background: var(--panel2);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: all .12s; }
.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.picker select { font: 500 13px var(--sans); color: var(--text); background: var(--panel);
  border: 1px solid var(--border); border-radius: 9px; padding: 7px 11px; cursor: pointer; }
.picker select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pk-self { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid #c7d2fe; border-radius: 9px; padding: 7px 13px; }
.pk-self:hover { background: #e0e7ff; text-decoration: none; }
.verdict { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--border);
  font-size: 14px; color: var(--text); }
.verdict b { color: var(--accent-strong); }
#lb tr.toppick td { background: var(--accent-soft); }
#lb tr.toppick td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.pick-star { color: #f59e0b; font-weight: 700; }
/* Multi-lens tab bar */
.lenses { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px;
  border-bottom: 1px solid var(--border); padding-bottom: 0; }
.lens { font: 600 13.5px/1 var(--sans); color: var(--muted); background: none; border: 0;
  border-bottom: 2px solid transparent; padding: 9px 12px; cursor: pointer; transition: color .12s; margin-bottom: -1px; }
.lens:hover { color: var(--accent); }
.lens.on { color: var(--accent-strong); border-bottom-color: var(--accent); }
.lens-hint { margin-left: auto; font-size: 12px; color: var(--faint); }
@media (max-width: 640px){ .lens-hint { display: none; } }
/* Help-Me-Choose wizard */
.wizard { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); margin-top: 8px; }
.wz-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wz-row + .wz-row { margin-top: 10px; }
.wizard select { font: 500 13px var(--sans); color: var(--text); background: var(--panel);
  border: 1px solid var(--border); border-radius: 9px; padding: 7px 11px; cursor: pointer; }
.rec-out { margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--border); }
.rec-pick { font-size: 15px; line-height: 1.7; }
.rec-pick b { color: var(--text); } .rec-name { color: var(--accent-strong) !important; font-size: 16.5px; }
.rec-tbl th, .rec-tbl td { padding: 8px 10px; }

/* Home / page CTA buttons */
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 4px; }
.cta { display: inline-flex; align-items: center; font-size: 14.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid #c7d2fe; border-radius: 10px; padding: 10px 18px; transition: all .15s; }
.cta:hover { background: #e0e7ff; text-decoration: none; transform: translateY(-1px); }
.cta-primary { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: var(--shadow-md); }
.cta-primary:hover { background: var(--accent-strong); }
/* Pricing page */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.tier { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.tier.feat { border-color: var(--accent); box-shadow: var(--shadow-md); }
.tier .t-name { font-weight: 800; font-size: 17px; }
.tier .t-price { font-family: var(--mono); color: var(--accent); font-size: 15px; }
.tier ul { list-style: none; padding: 0; margin: 4px 0 0; }
.tier li { color: var(--muted); font-size: 13.5px; padding: 4px 0 4px 20px; position: relative; line-height: 1.5; }
.tier li::before { content: "✓"; color: var(--good); position: absolute; left: 0; font-weight: 700; }
.tier .t-tag { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 3px 10px; align-self: flex-start; }
