/*
  The service's design system: the qweb idiom (Satoshi + Geist Mono, a blurred glass nav, pill buttons, mono
  eyebrows, bento cells with hairline borders, one dark ink panel) in the service's own palette. Jade is the
  only primary; amber and red mark states, and colour code snippets' tokens. Style from the variables below,
  never raw hex.
*/

:root {
  color-scheme: light;

  /* ─── Palette ─── */
  --accent:        #0d7a63;   /* the one primary: CTAs, links, active states */
  --accent-deep:   #095b4a;   /* hover of the primary */
  --accent-tint:   #e3f3ee;   /* pale fill: badges, hover of soft pills */
  --accent-glow:   #5fd3b0;   /* the accent word and dots on the dark panel */
  --ink:           #0f211d;   /* the dark panel: deep jade-black, never pure black */

  --fg-1:          #141513;   /* headings and primary text */
  --fg-2:          #2a2b27;   /* body text */
  --fg-3:          #5c5d57;   /* muted: labels, meta */
  --fg-4:          #74756e;   /* faint: timestamps, empty states; still 4.5:1 on white */

  --bg-1:          #ffffff;   /* page */
  --bg-2:          #f6f6f3;   /* table headers, inset panels */
  --bg-3:          #eeeee9;   /* soft pill fill */

  --border-1:      #e6e6e1;   /* hairline */
  --border-2:      #d2d2cb;

  --amber:         #8a5d06;
  --amber-tint:    #f8efd9;
  --red:           #b23722;
  --red-tint:      #fbe8e3;
  --blue:          #2b5fb3;   /* numbers in a JSON example, nothing else */
  --white:         #ffffff;

  /* ─── Type ─── */
  --font-display:  "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans:     "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:     "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ─── Shape and depth ─── */
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-cell:   18px;
  --shadow-card:   0 10px 30px -12px rgba(15, 33, 29, 0.14);
  --shadow-lift:   0 18px 40px -18px rgba(15, 33, 29, 0.26);
  --shadow-accent: 0 6px 18px rgba(13, 122, 99, 0.16);

  /* ─── Layout ─── */
  --nav-h:         64px;
  --content-w:     1200px;
}

/* ─── Base ─── */
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg-1);
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  margin: 0; font-family: var(--font-display); font-weight: 700; color: var(--fg-1);
  letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance;
}
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: var(--content-w); margin: 0 auto; padding: 0 28px; }
main { padding-bottom: 88px; }
.body { padding-top: 32px; }
.section-gap { margin-top: 24px; }
.page-top { margin-top: 32px; }

/* ─── Nav: one sticky glass bar ─── */
.nav {
  position: sticky; top: 0; z-index: 40; height: var(--nav-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-1);
}
.nav-inner {
  max-width: var(--content-w); margin: 0 auto; padding: 0 28px; height: 100%;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.brand .glyph {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; box-shadow: var(--shadow-accent);
}
.brand .glyph::after {
  content: ""; width: 13px; height: 3px; background: var(--white); border-radius: 2px;
  box-shadow: 0 6px 0 rgba(255, 255, 255, 0.55);
  transform: translateY(-3px);
}
.ctx {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-tint); padding: 5px 11px; border-radius: 999px; flex: none;
}
.nav-menu { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a {
  position: relative; font-size: 13.5px; font-weight: 500; color: var(--fg-1); text-decoration: none;
  letter-spacing: 0.01em; white-space: nowrap; padding: 6px 0;
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--accent); }
.nav-links a[aria-current="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px;
  background: var(--accent);
}
.nav-account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-account .btn[aria-current="true"] { background: var(--accent-deep); border-color: var(--accent-deep); }
.userbtn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg-1);
  font-size: 13.5px; font-weight: 500; padding: 3px 12px 3px 3px; border-radius: 999px; white-space: nowrap;
}
.userbtn:hover { background: var(--bg-3); color: var(--fg-1); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-tint); color: var(--accent);
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
}
.nav-burger {
  display: none; margin-left: auto; background: none; border: 1.5px solid var(--border-2); border-radius: 999px;
  width: 40px; height: 36px; cursor: pointer; color: var(--fg-1); align-items: center; justify-content: center;
}
.nav-burger span, .nav-burger span::before, .nav-burger span::after {
  display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; position: relative;
}
.nav-burger span::before, .nav-burger span::after { content: ""; position: absolute; left: 0; }
.nav-burger span::before { top: -5px; }
.nav-burger span::after { top: 5px; }

@media (max-width: 1080px) {
  .nav-burger { display: inline-flex; }
  .nav-menu {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 18px; padding: 20px 28px 24px;
    background: var(--bg-1); border-bottom: 1px solid var(--border-1); box-shadow: var(--shadow-card);
  }
  .nav-menu.open { display: flex; }
  .nav-links { flex-direction: column; align-items: flex-start; gap: 14px; }
  .nav-account { margin-left: 0; flex-wrap: wrap; }
}

/* ─── Pills: every button is fully round ─── */
.btn {
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 700; line-height: 1.4;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  padding: 8px 18px; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 1.5px solid var(--border-2); background: var(--bg-1); color: var(--fg-1);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }
.btn-key { background: var(--accent); border-color: var(--accent); color: var(--white); box-shadow: var(--shadow-accent); }
.btn-key:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--white); }
.btn-quiet { background: var(--bg-3); border-color: transparent; color: var(--fg-1); }
.btn-quiet:hover { background: var(--accent-tint); border-color: transparent; color: var(--accent); }
.btn-sm { font-size: 12.5px; padding: 5px 13px; gap: 6px; }
.btn-light { border-color: rgba(255, 255, 255, 0.85); color: var(--white); background: transparent; }
.btn-light:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--white); color: var(--white); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
a.btn { text-decoration: none; }
.inline-form { display: inline; margin: 0; }

/* A link that is one of a row's choices: an outline pill with an arrow, so it reads as clickable. */
.pill-link {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none;
  font-size: 13px; font-weight: 700; color: var(--accent); background: var(--bg-1);
  border: 1.5px solid rgba(13, 122, 99, 0.35); border-radius: 999px; padding: 4px 12px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.pill-link::after { content: "→"; font-weight: 500; }
.pill-link:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-deep); transform: translateY(-1px); }
.pill-link.external::after { content: "↗"; }
.pill-link.mono { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
}
.b-open { background: var(--accent-tint); color: var(--accent); }
.b-closed { background: var(--bg-3); color: var(--fg-3); }
.b-run { background: var(--accent); color: var(--white); }
.b-fail { background: var(--red-tint); color: var(--red); }
.b-warn { background: var(--amber-tint); color: var(--amber); }
.b-out {
  background: none; border-color: var(--border-2); color: var(--fg-3);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
}
.led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: tick 2s ease-in-out infinite; }
@keyframes tick { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ─── Text helpers ─── */
.mono, .c { font-family: var(--font-mono); }
.c { font-size: 12px; background: var(--bg-3); border-radius: var(--radius-sm); padding: 1px 6px; color: var(--fg-2); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-3); }
.faint { color: var(--fg-4); }
.name { font-weight: 700; color: var(--fg-1); display: block; }
a.name { text-decoration: none; }
a.name:hover { color: var(--accent); }
.nsub { display: block; font-size: 12.5px; color: var(--fg-4); }
.mdl { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--fg-1); display: block; white-space: nowrap; }
.val { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg-1); }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}

/* A score: the value, then its metric's name as a mono caption beneath it. */
.score { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.2; }
.score b { font-size: 16px; font-weight: 700; color: var(--fg-1); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.score b small { font-size: 11px; font-weight: 500; color: var(--fg-3); margin-left: 1px; }
.score-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-4);
  white-space: nowrap;
}

/* ─── Page header ─── */
.ph { border-bottom: 1px solid var(--border-1); padding: 40px 0 28px; }
.ph-in { max-width: var(--content-w); margin: 0 auto; padding: 0 28px; }
.ph .row { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.ph h1 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.025em; line-height: 1.08; }
.ph .sub { color: var(--fg-3); font-size: 15px; margin-top: 8px; max-width: 76ch; }
.ph .acts { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; font-size: 13.5px; color: var(--fg-4); }
.crumbs a { color: var(--accent); font-weight: 700; text-decoration: none; }
.crumbs a:hover { color: var(--accent-deep); }
.crumbs span { color: var(--fg-3); }

/* ─── The dark panel (home) ─── */
.hero { position: relative; overflow: hidden; background: var(--ink); color: var(--white); padding: 64px 0 56px; }
.hero-inner { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.hero .eyebrow { color: var(--accent-glow); margin-bottom: 14px; display: block; }
.hero h1 { color: var(--white); font-size: clamp(40px, 6.4vw, 76px); line-height: 0.98; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; color: var(--accent-glow); }
.hero-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 12px; }

/* ─── Section headings ─── */
.secline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 44px 0 16px; }
.secline:first-child { margin-top: 8px; }
.lab { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg-1); }
.lab em { font-style: normal; color: var(--accent); }
.secline .count {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 9px; border-radius: 999px;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--accent); background: var(--accent-tint); border: 1.5px solid rgba(13, 122, 99, 0.22);
}
.secline .nsub { display: inline; }

/* ─── Bento cells ─── */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.cell {
  background: var(--bg-1); border: 1px solid var(--border-1); border-radius: var(--radius-cell);
  padding: 26px 28px; display: flex; flex-direction: column; box-shadow: var(--shadow-card);
  transition: border-color 220ms ease, background 220ms ease;
}
.cell:hover { border-color: rgba(13, 122, 99, 0.45); background: rgba(13, 122, 99, 0.025); }
.cell-2 { grid-column: span 2; }
.cell-3 { grid-column: span 3; }
.cell-6 { grid-column: span 6; }
.cell-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.cell-tag .meta { color: var(--fg-4); letter-spacing: 0.06em; }
.cell h3 { font-size: 21px; letter-spacing: -0.015em; margin-bottom: 8px; }
.cell h3 a { color: inherit; text-decoration: none; }
.cell h3 a:hover { color: var(--accent); }
.cell > p { font-size: 14.5px; color: var(--fg-3); }
.cell-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 22px; }
.cell.upcoming .cell-tag { color: var(--amber); }

a.stat { text-decoration: none; color: inherit; }
.stat b {
  display: block; font-family: var(--font-display); font-size: 46px; font-weight: 700; line-height: 1;
  letter-spacing: -0.03em; color: var(--fg-1); font-variant-numeric: tabular-nums;
}
/* A stat's state, as a mono label with a dot in that state's colour, above its count. */
.stat-tag {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
}
.stat-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-open { color: var(--accent); }
.s-upcoming { color: var(--amber); }
.s-concluded { color: var(--fg-3); }
.stat.hi { border: 1.5px solid var(--accent); background: rgba(13, 122, 99, 0.04); box-shadow: var(--shadow-accent); }
.stat.hi b { color: var(--accent); }

@media (max-width: 900px) {
  .cell-2, .cell-3 { grid-column: span 6; }
}

/* ─── Tables ─── */
/*
  clip, not hidden: overflow: hidden makes the box a scroll container, so a sticky header would pin to the nav's
  height inside it and cover the first row instead of pinning under the nav.
*/
.table {
  background: var(--bg-1); border: 1px solid var(--border-1); border-radius: var(--radius-cell);
  box-shadow: var(--shadow-card); overflow: clip;
}
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.scroll table { min-width: 680px; }
thead th {
  position: sticky; top: var(--nav-h); z-index: 5; text-align: left; white-space: nowrap;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-3); padding: 12px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border-1);
}
/* A .scroll wrapper is the scroll container a sticky header pins against, not the viewport. */
.scroll thead th { top: 0; }
thead th .name, thead th a.name { font-family: var(--font-sans); font-size: 13px; letter-spacing: 0; text-transform: none; }
th.r, td.r { text-align: right; }
td { padding: 14px 18px; border-bottom: 1px solid var(--border-1); vertical-align: middle; font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(246, 246, 243, 0.6); }
td.r { font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; }
/* A row that opens its record: site.js follows data-href on a click outside the row's own links and buttons. */
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--accent-tint); }
tr.row-link:hover a.name { color: var(--accent); }
.when { white-space: nowrap; color: var(--fg-4); font-size: 13px; }
.target-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.empty { text-align: center; padding: 40px 16px; color: var(--fg-4); margin: 0; }
td .empty { display: block; }

/* ─── Toolbar and filters ─── */
.toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
/* The stage switch under a dataset's tabs: clear of the tab bar's rule above and the board below. */
.toolbar.stage-switch { margin: 28px 0 8px; }
/* A task page's stage picker: its tracks, then the chosen track's phases, each button carrying its state. */
.stage-picker .toolbar.stage-switch + .toolbar.stage-switch { margin-top: 0; }
.stage-switch .btn .badge { margin-left: 6px; }
/* A campaign page's task card lists the task's stages, each with its state. */
.stage-list { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--fg-3); }
.stage-item .badge { margin-left: 4px; }
.filters label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-3);
}
.filters select, .filters input, .inline-pick select {
  font-family: var(--font-sans); font-size: 13.5px; text-transform: none; letter-spacing: 0; color: var(--fg-1);
  padding: 7px 12px; border: 1.5px solid var(--border-1); border-radius: 999px; background: var(--bg-1); max-width: 190px;
}
.filters input { width: 150px; }
.filters select:focus, .filters input:focus, .inline-pick select:focus { border-color: var(--accent); outline: none; }
.pager { display: flex; align-items: center; gap: 12px; }

/* ─── Cards and panels ─── */
.card {
  background: var(--bg-1); border: 1px solid var(--border-1); border-radius: var(--radius-cell);
  box-shadow: var(--shadow-card); padding: 26px 28px;
}
.card h2 { font-size: 20px; margin-bottom: 12px; }
.card h2 + .kv, .card h2 + .table { margin-top: 12px; }
.card h3 { font-size: 16px; margin: 20px 0 8px; }
.card > h2:not(:first-child) { margin-top: 26px; }
.intro { color: var(--fg-3); font-size: 14.5px; margin: 0 0 16px; }
.sub-head { font-size: 16px; margin: 24px 0 8px; }
.review-summary .sub-head { font-size: 14px; margin: 18px 0 6px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.inline-card { margin: 0 0 18px; padding: 20px 22px; border: 1px solid var(--border-1); border-radius: var(--radius-cell); background: var(--bg-2); }
.inline-card h3 { font-size: 16px; margin-bottom: 12px; }
.run-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.run-head .push { margin-left: auto; font-size: 13px; }
.foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-1); }
.push { margin-left: auto; }
.foot-note { font-size: 13px; color: var(--fg-3); margin: 16px 0 0; }

.kv { display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border-1); font-size: 14px; }
.kv > div:last-child { border-bottom: 0; }
.kv .k { color: var(--fg-3); }
.kv .v { font-weight: 500; color: var(--fg-1); text-align: right; font-variant-numeric: tabular-nums; }
.kv .v.warn { color: var(--red); }
.facts { display: flex; flex-wrap: wrap; gap: 12px 36px; }
.facts > div { display: flex; flex-direction: column; gap: 2px; }
.facts .k {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3);
}
.facts .v { font-size: 15px; font-weight: 700; color: var(--fg-1); font-variant-numeric: tabular-nums; }

.dataset-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
a.dataset-card { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; transition: border-color 220ms ease, transform 220ms ease; }
a.dataset-card:hover { border-color: rgba(13, 122, 99, 0.45); transform: translateY(-1px); }
a.dataset-card .name { font-size: 17px; }
a.dataset-card .task-number {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
a.dataset-card .run-head { margin-bottom: 4px; }
a.dataset-card .nsub::after { content: " →"; color: var(--accent); }

pre, pre.report-example {
  margin: 8px 0 0; background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-md);
  padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--fg-2);
}
pre.report-example + .intro { margin-top: 14px; }
/*
  Code: one scheme for every snippet. JSON tokens come from the highlight_json and highlight_jsonl filters, prompt
  placeholders from highlight_placeholders, shell commands from the hf_download macro.
*/
pre.code, .code { color: var(--fg-3); }
pre.clone-command { white-space: pre; overflow-x: auto; margin: 6px 0; }
.v.code, td.code { font-family: var(--font-mono); font-size: 12.5px; }
.j-key, .sh-cmd { color: var(--accent-deep); }
.sh-cmd { font-weight: 500; }
.j-str, .sh-arg { color: var(--amber); }
.j-num, .sh-flag { color: var(--blue); }
.j-lit { color: var(--red); }
.sh-cont { color: var(--fg-4); }
/* A snippet with long values wraps them rather than scrolling sideways. */
pre.wrap-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-var { color: var(--accent-deep); background: var(--accent-tint); border-radius: 4px; padding: 0 2px; }
.run-summary { margin-top: 4px; }

.callout {
  display: flex; gap: 12px; border: 1px solid var(--border-1); background: var(--bg-2);
  border-radius: var(--radius-md); padding: 13px 16px; font-size: 14px; color: var(--fg-2);
}
.callout.warn { background: var(--amber-tint); border-color: rgba(138, 93, 6, 0.22); }
.callout .i { font-family: var(--font-mono); font-weight: 500; color: var(--fg-3); flex: none; }
.callout.warn .i { color: var(--amber); }
.errors, .notices { margin: 0 0 18px; padding: 12px 16px 12px 34px; border-radius: var(--radius-md); font-size: 14px; }
.errors { border: 1px solid rgba(178, 55, 34, 0.25); background: var(--red-tint); color: var(--red); }
.notices { border: 1px solid rgba(13, 122, 99, 0.25); background: var(--accent-tint); color: var(--accent); }
.errors li + li, .notices li + li { margin-top: 4px; }
.sync-error { display: block; margin-top: 4px; font-size: 12.5px; color: var(--red); }

/* ─── A submission's numbers ─── */
.metrics { display: flex; flex-wrap: wrap; border: 1px solid var(--border-1); border-radius: var(--radius-md); overflow: hidden; margin-top: 18px; }
.metrics > div { flex: 1 1 120px; padding: 12px 16px; border-left: 1px solid var(--border-1); }
.metrics > div:first-child { border-left: 0; }
.metrics b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.metrics b.lead { color: var(--accent); }
.metrics span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
progress.run { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 99px; background: var(--bg-3); overflow: hidden; margin-top: 8px; }
progress.run::-webkit-progress-bar { background: var(--bg-3); border-radius: 99px; }
progress.run::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress.run::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

/* ─── In-page tabs: mono, underlined ─── */
/* The hairline is an inset shadow, not a border the active tab overlaps: an overlap overflows the scroller. */
.tabbar { margin-bottom: 4px; }
.tabbar-in {
  display: flex; gap: 26px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  box-shadow: inset 0 -1px 0 var(--border-1);
}
.tabbar-in::-webkit-scrollbar { display: none; }
.tabbar-in a {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-3); text-decoration: none; padding: 12px 0 11px; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabbar-in a:hover { color: var(--fg-1); }
.tabbar-in a[aria-current="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Forms ─── */
.flow { max-width: 620px; margin: 0 auto; }
.flow .crumbs { margin-top: 36px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13.5px; font-weight: 700; color: var(--fg-1); }
.field .hint { font-size: 12.5px; color: var(--fg-3); }
.field input[type="text"], .field input[type="password"], .field input[type="number"], .field input[type="url"],
.field input[type="datetime-local"], .field select, .field textarea {
  font-family: var(--font-sans); font-size: 14px; padding: 9px 13px; width: 100%; color: var(--fg-1);
  border: 1.5px solid var(--border-1); border-radius: var(--radius-md); background: var(--bg-1);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }
.field textarea { min-height: 72px; resize: vertical; }
.field > .c { align-self: flex-start; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.field input.file-drop {
  font: inherit; font-size: 13.5px; color: var(--fg-3); width: 100%; cursor: pointer;
  padding: 20px 18px; border: 1.5px dashed var(--border-2); border-radius: var(--radius-cell); background: var(--bg-2);
  transition: border-color 160ms ease, background 160ms ease;
}
.field input.file-drop:hover, .field input.file-drop:focus-visible { border-color: var(--accent); background: var(--accent-tint); }
.field input.file-drop::file-selector-button {
  font: inherit; font-size: 13.5px; font-weight: 700; margin-right: 14px; padding: 7px 16px; cursor: pointer;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--white);
}
.inline-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 13.5px; }
.inline-pick label { font-weight: 700; }
.review-summary h3 { font-size: 15px; margin-bottom: 8px; }

/* ─── Dialogs ─── */
.route-modal {
  width: min(760px, calc(100% - 32px)); max-height: calc(100% - 48px); padding: 26px 28px 28px;
  border: 1px solid var(--border-1); border-radius: var(--radius-cell); background: var(--bg-1); color: var(--fg-2);
  box-shadow: 0 30px 70px -24px rgba(15, 33, 29, 0.4); white-space: normal; text-align: left;
}
.route-modal::backdrop { background: rgba(15, 33, 29, 0.4); }
.route-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.route-modal h2 { font-size: 21px; }
.route-modal > p.intro { margin: 6px 0 18px; }
.route-modal form { margin-top: 14px; }
.route-options { display: grid; gap: 14px; }
.route-modal-head + .route-options { margin-top: 18px; }
.route-option { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border: 1px solid var(--border-1); border-radius: var(--radius-cell); background: var(--bg-2); }
.route-option h3 { font-size: 16px; }
.route-option p { font-size: 14px; color: var(--fg-2); }
.route-option pre.report-example { margin: 0; }
.route-option .btn { align-self: flex-start; }

/* ─── Sign-in gate ─── */
.gate { max-width: 400px; margin: 88px auto 0; }
.gate h1 { font-size: 24px; margin-bottom: 8px; }
.gate .card > p { color: var(--fg-3); margin: 0 0 20px; }
.gate .btn { width: 100%; padding: 11px; font-size: 14px; }

/* ─── Rendered READMEs ─── */
.readme { font-size: 14.5px; line-height: 1.7; color: var(--fg-2); overflow-wrap: anywhere; }
.readme > :first-child { margin-top: 0; }
.readme > :last-child { margin-bottom: 0; }
.readme h1, .readme h2, .readme h3, .readme h4 { margin: 24px 0 8px; }
.readme h1 { font-size: 24px; }
.readme h2 { font-size: 19px; }
.readme h3 { font-size: 16px; }
.readme h4 { font-size: 14.5px; }
.readme p, .readme ul, .readme ol, .readme blockquote, .readme pre { margin: 0 0 12px; }
.readme ul, .readme ol { padding-left: 22px; }
.readme li + li { margin-top: 3px; }
.readme blockquote { padding: 2px 0 2px 14px; border-left: 3px solid var(--border-2); color: var(--fg-3); }
.readme code { font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-3); border-radius: 4px; padding: 1px 5px; }
.readme pre code { background: none; padding: 0; }
.readme hr { border: 0; border-top: 1px solid var(--border-1); margin: 18px 0; }
/* LaTeX, which the README renderer turns into MathML for the browser to draw; a formula it cannot convert shows as code. */
.readme math { font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", math; font-size: 1.08em; }
.readme math[display="block"] { margin: 0 0 12px; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.readme code.math-source { color: var(--fg-3); }
.readme table { display: block; width: max-content; max-width: 100%; overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--border-1); border-radius: var(--radius-md); }
.readme thead th { position: static; white-space: normal; font-family: var(--font-sans); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--fg-1); font-weight: 700; padding: 8px 12px; }
.readme td { padding: 8px 12px; font-size: 13.5px; vertical-align: top; }

@media (max-width: 768px) {
  .wrap, .ph-in, .nav-inner { padding-left: 20px; padding-right: 20px; }
  .nav-menu { padding-left: 20px; padding-right: 20px; }
  .cell, .card { padding: 22px 20px; }
  .hero { padding: 48px 0 40px; }
  .hero-actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
