/* LLMQA dashboard — "newspaper / lab-notebook" theme (light + dark).
 *
 * Design rules:
 *  - Ink-on-paper: dark text on light, hairline rules, generous whitespace.
 *  - Newspaper hierarchy: serif display headings, small-caps section labels.
 *  - Lab notebook: monospace for ALL data (ids, scores, costs, timestamps).
 *  - Color is reserved strictly for TEST STATE and appears ONLY in the
 *    per-case results table. Summary cards and the trend chart stay pure ink.
 *  - Accessibility: state is never color-alone — always color + glyph + label,
 *    and the shades are contrast-safe / WCAG-AA on their background.
 *
 * Theming: everything reads from the tokens below, so light and dark are a
 * single palette swap. The dark palette keeps the same warm-newsprint feel
 * (a night edition on toned paper), not a cold blue-gray. Filled controls read
 * from --on-ink / --ink-strong so "ink" backgrounds invert cleanly.
 */
:root {
  /* Ink-on-paper base (the whole UI except the results table). */
  --paper: #fbfbf9;        /* warm off-white, like newsprint */
  --paper-edge: #ffffff;
  --ink: #111111;
  --ink-2: #333333;
  --muted: #6b6b6b;
  --rule: #dddad2;         /* hairline rules */
  --rule-strong: #111111;  /* masthead / heavy rules */

  /* Filled-control tokens: text/hover for elements painted with --ink. */
  --on-ink: #ffffff;       /* text on an --ink background */
  --ink-strong: #000000;   /* filled-button hover */
  --field-bg: #ffffff;     /* text inputs / selects */

  /* Test-state semantics — used ONLY in the case-results table. */
  --pass: #1a7f37;  --pass-bg: #eef6f0;
  --warn: #92400e;  --warn-bg: #f8f2e3;   /* deep amber-brown: WCAG-AA on white */
  --fail: #c1121f;  --fail-bg: #f9ecec;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

/* ---- Dark palette (night edition on toned paper) ----
 * Applied when the user explicitly picks dark, OR when the OS prefers dark and
 * the user hasn't explicitly picked light. Tokens are kept in sync in both
 * selectors so the two entry points can never drift.
 */
:root[data-theme="dark"] {
  --paper: #16150f;        /* warm near-black, a toned page at night */
  --paper-edge: #1e1c15;   /* panels / cards sit just above the page */
  --ink: #f1eee3;          /* warm off-white "ink" */
  --ink-2: #c9c5b8;
  --muted: #928d80;
  --rule: #34322a;
  --rule-strong: #726d5f;  /* heavy rules stay visible on the dark page */

  --on-ink: #16150f;       /* dark text on the now-light "ink" fills */
  --ink-strong: #ffffff;   /* filled-button hover brightens */
  --field-bg: #100f0a;     /* inputs sink below the panel */

  /* Test state: brighter, more saturated fg on dark tints (WCAG-AA on dark). */
  --pass: #56d07f;  --pass-bg: #15271b;
  --warn: #e3b341;  --warn-bg: #2b2213;
  --fail: #ff6f6f;  --fail-bg: #2c1719;

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16150f;
    --paper-edge: #1e1c15;
    --ink: #f1eee3;
    --ink-2: #c9c5b8;
    --muted: #928d80;
    --rule: #34322a;
    --rule-strong: #726d5f;

    --on-ink: #16150f;
    --ink-strong: #ffffff;
    --field-bg: #100f0a;

    --pass: #56d07f;  --pass-bg: #15271b;
    --warn: #e3b341;  --warn-bg: #2b2213;
    --fail: #ff6f6f;  --fail-bg: #2c1719;

    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Skip link (a11y): hidden until focused. */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--on-ink);
  padding: 8px 14px; font-size: 13px; font-family: var(--mono); z-index: 100; border-radius: 0 0 3px 0; }
.skip-link:focus { left: 0; }
/* Keep native form controls in the ink palette (no default blue accent). */
input[type=checkbox], select { accent-color: var(--ink); }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

/* ---- Masthead: newspaper nameplate with heavy top/bottom rules ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  position: relative;
  gap: 16px; padding: 22px 28px;
  border-bottom: 3px double var(--rule-strong);
  background: var(--paper-edge);
}
.brand { display: flex; align-items: center; gap: 15px; text-decoration: none; color: inherit; }
.brand:hover h1 { color: var(--ink-2); }
/* Graphic brand mark. Two theme variants (dark glyph for light bg, light glyph
 * for dark bg); the wordmark <h1> carries the accessible name, so the images
 * are decorative. Swap on the resolved theme, with a prefers-color-scheme
 * fallback for the pre-JS / no-JS frame so there's no wrong-logo flash. */
.brand-logo { width: 40px; height: 40px; display: block; flex: none; }
.brand-logo--dark { display: none; }
:root[data-theme="dark"] .brand-logo--light { display: none; }
:root[data-theme="dark"] .brand-logo--dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo--light { display: none; }
  :root:not([data-theme="light"]) .brand-logo--dark { display: block; }
}
.topbar h1 {
  margin: 0; font-family: var(--serif); font-weight: 700;
  font-size: 30px; letter-spacing: -0.5px;
}
.tagline {
  margin: 3px 0 0; color: var(--muted); font-size: 12px;
  font-variant: small-caps; letter-spacing: 0.6px;
}
.gh { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600;
  font-variant: small-caps; letter-spacing: 0.5px; border-bottom: 1px solid var(--ink); }
.gh:hover { color: var(--muted); border-bottom-color: var(--muted); }

/* ---- Masthead nav ---- */
.topnav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.topnav a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600;
  font-variant: small-caps; letter-spacing: 0.5px; border-bottom: 1px solid transparent; }
.topnav a:hover { border-bottom-color: var(--ink); }
.topnav a[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 700; }
.topnav a.gh-star { border: 1px solid var(--ink); border-radius: 3px; padding: 5px 12px;
  font-family: var(--mono); font-variant: normal; letter-spacing: 0.3px; }
.topnav a.gh-star:hover { background: var(--ink); color: var(--on-ink); border-bottom-color: var(--ink); }
/* Light/dark theme toggle in the masthead nav. */
.theme-toggle { background: none; border: 1px solid var(--rule-strong); color: var(--ink);
  border-radius: 3px; width: 32px; height: 27px; cursor: pointer; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); padding: 0; }
.theme-toggle:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- Mobile hamburger toggle (hidden on desktop) ---- */
.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule-strong);
  color: var(--ink); border-radius: 3px; width: 40px; height: 34px; cursor: pointer;
  padding: 0; position: relative; flex: none;
}
.nav-toggle:hover { background: var(--ink); border-color: var(--ink); }
.nav-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Three-bar icon drawn from the middle bar + its ::before/::after. */
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  display: block; position: absolute; left: 9px; width: 22px; height: 2px;
  background: var(--ink); transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-bar { top: 50%; transform: translateY(-50%); }
.nav-toggle-bar::before { content: ""; top: -7px; }
.nav-toggle-bar::after { content: ""; top: 7px; }
.nav-toggle:hover .nav-toggle-bar,
.nav-toggle:hover .nav-toggle-bar::before,
.nav-toggle:hover .nav-toggle-bar::after { background: var(--on-ink); }
/* Morph to an X when open. */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }

/* ---- Lede / standfirst: newspaper intro ---- */
.lede { margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--rule); }
.edition { margin: 0 0 12px; font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted); }
.standfirst { margin: 0 0 20px; font-family: var(--serif); font-size: 20px;
  line-height: 1.5; color: var(--ink); max-width: 780px; }
.standfirst em { font-style: italic; }
.lede-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.osbadge { font-family: var(--mono); font-size: 11px; letter-spacing: 0.4px; color: var(--ink-2);
  border: 1px solid var(--rule-strong); border-radius: 3px; padding: 3px 9px; background: var(--paper-edge); }
.osbadge--cta { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 700;
  text-decoration: none; }
.osbadge--cta:hover { background: var(--ink-strong); }
.demo-note { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); font-style: italic; max-width: 760px; }
.demo-note code { font-family: var(--mono); font-style: normal; font-size: 11.5px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; }

/* ---- Colophon: open-source / contribute section ---- */
.colophon p { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 760px; }
.colophon code { font-family: var(--mono); font-style: normal; font-size: 12px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; }
.colophon-links { list-style: none; padding: 0; margin: 16px 0 0;
  display: flex; flex-wrap: wrap; gap: 8px 22px; }
.colophon-links a { color: var(--ink); text-decoration: none; font-size: 13px;
  font-family: var(--mono); border-bottom: 1px solid var(--rule-strong); }
.colophon-links a:hover { color: var(--muted); border-bottom-color: var(--muted); }

main { max-width: 1040px; margin: 0 auto; padding: 30px 22px 60px; }

/* ---- Page head (interior pages: Dashboard/Docs/About) ---- */
.page-head { margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--rule); }
.page-title { margin: 6px 0 12px; font-family: var(--serif); font-weight: 700;
  font-size: 34px; letter-spacing: -0.5px; }
.page-sub { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.5;
  color: var(--ink-2); max-width: 760px; }
.page-sub a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.page-sub a:hover { color: var(--muted); border-bottom-color: var(--muted); }

/* ---- Home: how-it-works steps ---- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.step-n { flex: none; width: 30px; height: 30px; border: 1.5px solid var(--ink);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 14px; }
.steps li div { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.steps strong { color: var(--ink); }
.steps code, .prose code, .cta-lead code { font-family: var(--mono); font-size: 12px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; }

/* ---- Home: feature grid ---- */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; margin-bottom: 26px; }
.feature { margin-bottom: 0; }
.feature h3 { margin: 0 0 10px; font-family: var(--sans); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px; color: var(--ink); }
.feature p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.feature code { font-family: var(--mono); font-size: 12px; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; }

/* ---- Home: CTA panel ---- */
.cta-panel { text-align: center; }
.cta-lead { margin: 0 0 20px; font-size: 15px; color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.cta-btn { text-decoration: none; display: inline-block; }
.ghost-btn { display: inline-block; text-decoration: none; background: var(--paper-edge);
  color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 3px;
  padding: 11px 22px; font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; font-family: var(--sans); }
.ghost-btn:hover { background: var(--ink); color: var(--on-ink); }
.osbadge--cta { cursor: pointer; }

/* ---- Docs: two-column layout + code blocks ---- */
.docs-layout { display: grid; grid-template-columns: 200px 1fr; gap: 34px; align-items: start; }
.docs-nav { position: sticky; top: 22px; border-right: 1px solid var(--rule); padding-right: 20px; }
.docs-nav-title { margin: 0 0 12px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.docs-nav a { color: var(--ink-2); text-decoration: none; font-size: 13px; font-family: var(--mono);
  border-bottom: 1px solid transparent; }
.docs-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.docs-body { min-width: 0; }
.docs-body .page-head { margin-top: 0; }
.doc-section { scroll-margin-top: 20px; }
.prose { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.6; max-width: 760px; }
.prose em { font-style: italic; }
.doc-list { margin: 0; padding-left: 20px; display: grid; gap: 9px; }
.doc-list li { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.doc-list strong { color: var(--ink); font-family: var(--mono); font-size: 13px; }
.doc-list code { font-family: var(--mono); font-size: 12px; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; }
.code { background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 4px;
  padding: 14px 16px; overflow-x: auto; margin: 4px 0 14px; }
.code code { font-family: var(--mono); font-size: 12.5px; color: var(--ink); line-height: 1.6;
  white-space: pre; display: block; }

/* ---- Panels: understated, hairline-ruled sections ---- */
.panel {
  background: var(--paper-edge); border: 1px solid var(--rule);
  border-radius: 4px; padding: 22px 24px; margin-bottom: 26px;
}
.panel h2 {
  margin: 0 0 16px; font-family: var(--sans); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--ink);
  padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.hint { margin: -6px 0 16px; color: var(--muted); font-size: 12.5px; font-style: italic; }

/* ---- Empty state (shown before the first run; always-fresh start) ---- */
.empty-state { text-align: center; padding: 40px 24px 44px; }
.empty-state h2 { border: none; padding: 0; margin: 0 0 10px; }
.empty-illo { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 22px; }
.empty-logo { width: 54px; height: 54px; opacity: 0.9; }
.empty-check { font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: 0.5px;
  border: 1.5px solid var(--rule-strong); color: var(--ink); padding: 8px 12px; border-radius: 4px; opacity: 0.85; }
.empty-skeleton { display: grid; gap: 8px; width: min(320px, 80%); }
.empty-skeleton span { height: 12px; border-radius: 3px;
  background: linear-gradient(90deg, var(--rule) 0%, var(--paper) 50%, var(--rule) 100%);
  background-size: 200% 100%; animation: sk 1.6s ease-in-out infinite; }
.empty-skeleton span:nth-child(2) { width: 88%; }
.empty-skeleton span:nth-child(3) { width: 72%; }
.empty-skeleton span:nth-child(4) { width: 80%; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .empty-skeleton span { animation: none; } }
.empty-lead { margin: 0 auto 10px; max-width: 440px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.empty-lead strong { color: var(--ink); }
.empty-note { margin: 0; font-size: 12.5px; color: var(--muted); font-style: italic; }
td .mscore { margin-right: 12px; display: inline-block; }

.control-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted);
  gap: 6px; text-transform: uppercase; letter-spacing: 0.6px; }
label.checkbox { flex-direction: row; align-items: center; gap: 8px; color: var(--ink);
  font-size: 13px; text-transform: none; letter-spacing: normal; }
select, input[type=text] {
  background: var(--field-bg); border: 1px solid var(--rule-strong); color: var(--ink);
  border-radius: 3px; padding: 8px 10px; font-size: 14px; min-width: 190px;
  font-family: var(--mono);
}
select:focus, input[type=text]:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.metrics { border: 1px solid var(--rule); border-radius: 3px; margin: 18px 0; padding: 12px 16px; }
.metrics legend { color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.6px; padding: 0 6px; }
.metrics label { flex-direction: row; align-items: center; gap: 8px; color: var(--ink);
  font-size: 13px; display: inline-flex; margin-right: 20px; font-family: var(--mono);
  text-transform: none; letter-spacing: normal; }

.run {
  background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); font-weight: 700;
  padding: 11px 22px; border-radius: 3px; font-size: 14px; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.run:hover { background: var(--ink-strong); }
.run:disabled { opacity: 0.4; cursor: not-allowed; }
.status { margin-left: 14px; color: var(--muted); font-size: 13px; font-family: var(--mono); }

/* ---- Summary cards: PURE INK, no state color ---- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin-bottom: 26px; border: 1px solid var(--rule-strong); border-radius: 4px; overflow: hidden; }
.card {
  background: var(--paper-edge); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--rule);
}
.card:last-child { border-right: none; }
.card .k { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; }
.card .v { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; }
.card .v.small { font-size: 14px; font-weight: 600; word-break: break-all; }

/* ---- Results table: the only place color lives ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule);
  white-space: nowrap; vertical-align: top; }
#results td:last-child, #results th:last-child { white-space: normal; min-width: 300px; }
/* Lay the per-case metric scores on a fixed 2-column grid (in a wrapper div,
   so table-cell layout stays intact) — tidy columns, no ragged wrapping.
   Columns size to content so mono values never clip. */
.mgrid { display: grid; grid-template-columns: max-content max-content; gap: 2px 24px; }
.mgrid .mscore { margin: 0; white-space: nowrap; }
@media (max-width: 560px) { .mgrid { grid-template-columns: 1fr; } }
th { color: var(--ink); font-weight: 700; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.8px; border-bottom: 2px solid var(--rule-strong); }
#results td:first-child, #history td { font-family: var(--mono); }
tbody tr:hover { background: var(--paper); }

/* Pass / partial / fail badge: color + GLYPH + LABEL (never color-alone). */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 3px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.4px; font-family: var(--mono);
}
.badge .glyph { font-weight: 900; }
.badge.pass { background: var(--pass-bg); color: var(--pass); box-shadow: inset 3px 0 0 var(--pass); }
.badge.fail { background: var(--fail-bg); color: var(--fail); box-shadow: inset 3px 0 0 var(--fail); }

.tag { background: var(--paper); border: 1px solid var(--rule); border-radius: 3px;
  padding: 1px 7px; font-size: 11px; color: var(--muted); margin-right: 4px; font-family: var(--mono); }

/* Metric scores: monochrome digits; a small state glyph carries the color. */
.mscore { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }
/* The gating metric decides pass/fail: bold + a faint tint so the concept
   reads even when weight alone is easy to miss. */
.mscore.gate { font-weight: 700; color: var(--ink);
  background: var(--paper); border-bottom: 1.5px solid var(--rule-strong);
  padding: 0 4px 1px; border-radius: 2px; }
.mscore .sglyph { font-weight: 900; margin-right: 3px; }
.mscore.high .sglyph { color: var(--pass); }
.mscore.mid  .sglyph { color: var(--warn); }
.mscore.low  .sglyph { color: var(--fail); }
.mname { color: var(--muted); font-size: 11px; font-family: var(--mono); }

/* Legend for the three states (accessibility affordance). */
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin: -4px 0 14px;
  font-size: 12px; color: var(--muted); font-family: var(--mono); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .g { font-weight: 900; }
.legend .pass .g { color: var(--pass); }
.legend .mid  .g { color: var(--warn); }
.legend .fail .g { color: var(--fail); }

/* ---- Trend chart: PURE INK ---- */
.trend { margin-bottom: 16px; color: var(--muted); }
.trend svg { width: 100%; height: 120px; }

/* Tag filter bar */
.tag-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; min-height: 28px; }
.tf-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-right: 2px; }
.tf-btn { background: var(--paper); border: 1px solid var(--rule); color: var(--muted); border-radius: 3px; padding: 2px 10px; font-size: 12px; cursor: pointer; font-family: var(--mono); transition: border-color 0.1s, color 0.1s; }
.tf-btn:hover { border-color: var(--ink); color: var(--ink); }
.tf-btn.active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 700; }
.tf-clear { background: none; border: none; color: var(--muted); font-size: 11px; cursor: pointer; text-decoration: underline dotted; padding: 0 4px; font-family: var(--mono); }
.tf-clear:hover { color: var(--ink); }

/* Provider comparison */
.cmp-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.cmp-pill { background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: 8px 14px; font-size: 13px; font-family: var(--mono); }
.cmp-vs { color: var(--muted); font-size: 13px; font-style: italic; }
#cmp-table .cmp-flip { background: var(--warn-bg); }
.cmp-score { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.cmp-delta { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; }
.cmp-delta.pos { color: var(--pass); }
.cmp-delta.neg { color: var(--fail); }
.cmp-delta.neu { color: var(--muted); }

.cmp-chart { margin: 0 0 20px; overflow-x: auto; }
.cmp-chart svg { width: 100%; height: 140px; display: block; }

/* Row expansion — model output vs expected */
.result-row { cursor: pointer; }
.result-row:hover .expand-toggle { text-decoration: underline dotted; }
.expand-toggle { font-family: var(--mono); font-size: 13px; }
.detail-row td.detail-cell { padding: 0; border-bottom: 2px solid var(--rule); }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 14px 18px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.detail-field { display: flex; flex-direction: column; gap: 4px; }
.dl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 600; font-family: var(--mono); }
.dv { margin: 0; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; line-height: 1.6; color: var(--ink); }
.dv.out { color: var(--pass); }
.dv.exp { color: var(--ink-2); font-style: italic; }
.dv.ctx { color: var(--muted); }

td.latency { color: var(--muted); font-size: 13px; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

footer a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
footer a:hover { color: var(--ink); border-bottom-color: var(--ink); }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 26px;
  border-top: 3px double var(--rule-strong); font-variant: small-caps; letter-spacing: 0.5px; }

/* =====================================================================
   Interactive dashboard extras (progress, verdict, downloads, peek,
   history diff, guided tour). Same ink-on-paper palette;
   color stays reserved for test state.
   ===================================================================== */

/* Small ghost/link buttons reused across the new UI. */
.mini-btn { background: var(--paper); border: 1px solid var(--rule-strong); color: var(--ink);
  border-radius: 3px; padding: 5px 11px; font-size: 12px; cursor: pointer; font-family: var(--mono);
  letter-spacing: 0.2px; }
.mini-btn:hover { background: var(--ink); color: var(--on-ink); }
.mini-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--paper); color: var(--muted); }
.link-btn { background: none; border: none; color: var(--ink); font-family: var(--mono); font-size: 13px;
  cursor: pointer; padding: 4px 0; border-bottom: 1px solid var(--rule-strong); margin-top: 12px; }
.link-btn:hover { color: var(--muted); border-bottom-color: var(--muted); }

/* Live run progress bar. */
.run-progress { margin-top: 16px; max-width: 460px; }
.rp-bar { height: 8px; background: var(--paper); border: 1px solid var(--rule-strong);
  border-radius: 4px; overflow: hidden; }
.rp-fill { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.25s ease; }
.rp-tally { display: flex; gap: 16px; margin-top: 7px; font-family: var(--mono); font-size: 12px;
  color: var(--muted); font-variant-numeric: tabular-nums; }
.rp-pass { color: var(--pass); }
.rp-fail { color: var(--fail); }

/* Verdict line above the case table. */
.verdict { margin: 0 0 14px; font-size: 14px; font-family: var(--mono); padding: 10px 14px;
  border-radius: 3px; border: 1px solid var(--rule-strong); background: var(--paper); }
.verdict.ok { box-shadow: inset 3px 0 0 var(--pass); }
.verdict.warn { box-shadow: inset 3px 0 0 var(--warn); }
.verdict .v-fail { color: var(--fail); font-weight: 700; }

/* Results panel header row with download buttons. */
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.panel-head-row h2 { margin: 0; border: none; padding: 0; }
.dl-btns { display: flex; gap: 8px; }

/* Single-case re-run affordance inside an expanded detail row. */
.detail-actions { display: flex; align-items: center; gap: 12px; padding: 0 18px 14px; background: var(--paper); }
.rerun-status { font-family: var(--mono); font-size: 12px; color: var(--muted); }
@keyframes flashrow { 0% { background: var(--warn-bg); } 100% { background: transparent; } }
tr.result-row.flash { animation: flashrow 1.1s ease-out; }

/* History diff slots. */
.hist-compare { margin: 18px 0 8px; padding: 16px; border: 1px dashed var(--rule-strong);
  border-radius: 4px; background: var(--paper); }
.slot-row { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.drop-slot { flex: 1 1 200px; min-height: 62px; border: 1.5px dashed var(--rule-strong); border-radius: 4px;
  background: var(--paper-edge); display: flex; flex-direction: column; justify-content: center;
  gap: 3px; padding: 10px 14px; }
.drop-slot.over { border-style: solid; background: var(--warn-bg); }
.drop-slot.filled { border-style: solid; }
.slot-label { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--ink); }
.slot-hint { font-size: 11.5px; color: var(--muted); font-style: italic; }
.slot-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.slot-vs { align-self: center; color: var(--muted); font-style: italic; font-size: 13px; }
.hist-row { cursor: pointer; }
.hist-row.dragging { opacity: 0.4; }
.hist-row.selected { background: var(--warn-bg); }
.hist-diff { margin-top: 16px; }
.diff-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.diff-run { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.diff-stat { display: flex; flex-direction: column; gap: 2px; }
.diff-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.diff-val { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.diff-val.pos { color: var(--pass); }
.diff-val.neg { color: var(--fail); }
.diff-val.neu { color: var(--muted); }
.diff-flips { display: grid; gap: 8px; }
.diff-flip { display: flex; align-items: center; gap: 8px; }
.diff-flip .diff-arrow { color: var(--muted); }
.diff-cid { font-family: var(--mono); font-size: 12px; margin-left: 4px; }
.diff-flip.gained .diff-cid { color: var(--pass); }
.diff-flip.lost .diff-cid { color: var(--fail); }

/* Dataset peek (collapsible). */
.peek > summary { cursor: pointer; font-family: var(--sans); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--ink); }
.peek-count { font-family: var(--mono); font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--muted); margin-left: 6px; }
.peek-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.peek-item { border: 1px solid var(--rule); border-radius: 4px; padding: 10px 12px; background: var(--paper); }
.peek-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.peek-id { font-family: var(--mono); font-weight: 700; font-size: 12.5px; color: var(--ink); }
.peek-in { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.peek-gate { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.peek-gate code { background: var(--paper-edge); border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; }
.peek-allgate { font-style: italic; }

/* Guided tour overlay. */
.tour[hidden] { display: none; }
/* Transparent — it only blocks clicks on the page behind the tour. All the
   dimming is done by the highlight ring's spotlight box-shadow below, so the
   ring's interior (the target) stays fully lit. */
.tour-scrim { position: fixed; inset: 0; background: transparent; z-index: 90; }
/* The ring's giant outer box-shadow is the real spotlight: it darkens the whole
   page while leaving the ring's interior (the target control) at full brightness. */
.tip { position: absolute; z-index: 92; border: 2px solid var(--paper-edge);
  box-shadow: 0 0 0 3px var(--ink), 0 0 0 9999px rgba(17,17,17,0.55);
  border-radius: 5px; pointer-events: none; transition: all 0.18s ease; }
.tour-bubble { position: fixed; z-index: 93; left: 50%; bottom: 28px; transform: translateX(-50%);
  width: min(460px, 92vw); background: var(--paper-edge); border: 1px solid var(--rule-strong);
  border-radius: 6px; padding: 18px 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.28); }
.tour-step { margin: 0 0 4px; font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); }
.tour-bubble h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 20px; }
.tour-bubble p#tour-body { margin: 0 0 16px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-actions .link-btn { margin-top: 0; }
.tour-nav { display: flex; gap: 8px; }
.tour-nav .run { padding: 8px 16px; }

@media (max-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card:nth-child(2) { border-right: none; }
  .card:nth-child(1), .card:nth-child(2) { border-bottom: 1px solid var(--rule); }

  /* Mobile masthead: logo top-left, hamburger top-right. Drop the wordmark
   * and tagline so the bar isn't staggered; the logo carries the brand. */
  .topbar { padding: 14px 18px; }
  .topbar h1, .tagline { display: none; }
  .brand { gap: 0; }
  .brand-logo { width: 36px; height: 36px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  /* Nav becomes a dropdown panel below the masthead, toggled by the hamburger. */
  .topnav {
    display: none; position: absolute; top: 100%; right: 0; left: 0; z-index: 40;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 18px 16px; background: var(--paper-edge);
    border-bottom: 3px double var(--rule-strong);
  }
  .topnav.is-open { display: flex; }
  .topnav a {
    font-size: 15px; padding: 12px 0; border-bottom: 1px solid var(--rule);
    letter-spacing: 0.4px;
  }
  .topnav a:hover { border-bottom-color: var(--rule); }
  .topnav a[aria-current="page"] { border-bottom-color: var(--ink); }
  .topnav a.gh-star { text-align: center; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--ink); }
  .topnav .theme-toggle { align-self: flex-start; margin-top: 12px; width: 40px; height: 32px; }

  .feature-grid { grid-template-columns: 1fr; gap: 20px; }
  .docs-layout { grid-template-columns: 1fr; gap: 22px; }
  .docs-nav { position: static; border-right: none; border-bottom: 1px solid var(--rule);
    padding-right: 0; padding-bottom: 16px; }
  .docs-nav ul { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 27px; }
}

/* =====================================================================
   Chart zoom modal + "tap to enlarge" affordance (shared, all widths)
   ===================================================================== */
.trend svg, .cmp-chart svg { cursor: zoom-in; }
.chart-cap { font-size: 12px; color: var(--muted); font-family: var(--mono);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; }
.zoom-hint { font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 3px; padding: 2px 8px; cursor: zoom-in; }

.chart-modal { position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.chart-modal[hidden] { display: none; }
.cm-backdrop { position: absolute; inset: 0; background: rgba(17,17,17,0.62); }
.cm-panel { position: relative; z-index: 1; width: min(1000px, 96vw); max-height: 92vh;
  overflow: auto; background: var(--paper-edge); border: 1px solid var(--rule-strong);
  border-radius: 6px; box-shadow: 0 14px 50px rgba(0,0,0,0.35); }
.cm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.cm-title { font-family: var(--serif); font-size: 20px; }
.cm-actions { display: flex; gap: 8px; }
.cm-body { padding: 18px; overflow: auto; text-align: center; }
/* These charts are very wide and short, so scaling by WIDTH alone barely
   enlarges them. Instead we scale by HEIGHT: the enlarged chart grows tall
   (real magnification, legible axis labels) and the body pans horizontally.
   Narrow charts simply center. */
.cm-body svg { width: auto; height: min(62vh, 520px); max-width: none;
  min-width: 100%; display: inline-block; }

/* =====================================================================
   Interaction states for touch (no hover on touch devices)
   ===================================================================== */
.run:active, .mini-btn:active, .tf-btn:active, .tf-clear:active,
.link-btn:active, .theme-toggle:active, .nav-toggle:active,
.osbadge--cta:active { transform: translateY(1px); }
.tf-btn:active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* Sticky table headers so column context survives long/scrolled tables
   (headers are hidden in the mobile card layout below, so this is desktop). */
thead th { position: sticky; top: 0; z-index: 2; background: var(--paper-edge); }

/* Tour bubble docked to the top when the highlighted target is low on screen. */
.tour-bubble.bubble-top { top: 20px; bottom: auto; }

/* =====================================================================
   Phone layout (<=560px): stacked result cards, single-column controls,
   full-width primary action, larger touch targets, no iOS input zoom.
   ===================================================================== */
@media (max-width: 560px) {
  main { padding: 22px 16px 50px; }

  /* Inputs at 16px stop iOS Safari from auto-zooming on focus; full width. */
  select, input[type=text] { font-size: 16px; width: 100%; min-width: 0; }
  .control-row { flex-direction: column; align-items: stretch; gap: 14px; }
  .control-row label { width: 100%; }
  .run { width: 100%; padding: 14px 22px; }
  .status { display: block; margin: 10px 0 0; }
  .run-progress { max-width: none; }

  /* Bigger tap targets for pill/link controls. */
  .tf-btn, .tf-clear, .mini-btn, .link-btn {
    min-height: 40px; display: inline-flex; align-items: center; }
  .tag { padding: 4px 10px; }
  .dl-btns { flex-wrap: wrap; }

  /* ---- Results table -> stacked cards ---- */
  #results thead { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; }
  #results, #results tbody { display: block; }
  #results tr.result-row { display: block; margin: 0 0 12px; overflow: hidden;
    border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--paper-edge); }
  #results tr.result-row td { display: flex; justify-content: space-between; gap: 14px;
    align-items: flex-start; white-space: normal; min-width: 0; padding: 9px 14px;
    border-bottom: 1px solid var(--rule); }
  #results tr.result-row td:last-child { border-bottom: none; }
  #results tr.result-row td::before { content: attr(data-label); flex: none;
    font-family: var(--sans); font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.7px; color: var(--muted); padding-top: 3px; }
  /* Case id is the card header: no label, larger tap area. */
  #results tr.result-row td:first-child { background: var(--paper); padding: 13px 14px;
    border-bottom: 1px solid var(--rule-strong); }
  #results tr.result-row td:first-child::before { display: none; }
  #results tr.result-row td:first-child .expand-toggle { font-size: 15px; }
  /* Metrics stack under their label on a tidy 2-col grid. */
  #results tr.result-row td[data-label="Metrics"] { flex-direction: column;
    align-items: stretch; gap: 8px; }
  #results tr.result-row td[data-label="Metrics"]::before { padding-top: 0; }
  /* One metric per row: long mono names (hallucination=1.00) never clip. */
  #results tr.result-row td[data-label="Metrics"] .mgrid { grid-template-columns: 1fr; }
  #results td:empty { display: none; }        /* hide an empty Tags row */
  #results td:last-child, #results th:last-child { min-width: 0; }

  /* Each metric checkbox on its own row so nothing clips at the fieldset edge. */
  .metrics label { display: flex; width: 100%; margin-right: 0; }

  /* ---- Compare-providers table -> stacked cards (same pattern) ---- */
  #cmp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; }
  #cmp-table, #cmp-table tbody { display: block; }
  #cmp-table tbody tr { display: block; margin: 0 0 12px; overflow: hidden;
    border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--paper-edge); }
  #cmp-table tbody td { display: flex; justify-content: space-between; gap: 14px;
    align-items: center; white-space: normal; min-width: 0; padding: 9px 14px;
    border-bottom: 1px solid var(--rule); }
  #cmp-table tbody td:last-child { border-bottom: none; }
  #cmp-table tbody td::before { content: attr(data-label); flex: none;
    font-family: var(--sans); font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.7px; color: var(--muted); }
  #cmp-table tbody td:first-child { background: var(--paper); font-weight: 700;
    border-bottom: 1px solid var(--rule-strong); }
  #cmp-table tbody td:first-child::before { display: none; }
  /* Expanded detail spans the full card width. */
  #results tr.detail-row { display: block; }
  #results tr.detail-row td.detail-cell { display: block; width: 100%; padding: 0; }

  /* ---- Collapsed-by-default cards ----
     A card renders compact: just the case id header + PASS/FAIL badge.
     Tags / Latency / Metrics stay hidden until the card is expanded (tap
     anywhere on the card, same toggle that opens the input/output detail). */
  #results tr.result-row td:nth-child(n+3) { display: none; }
  #results tr.result-row.expanded td { display: flex; }
  #results tr.result-row.expanded td[data-label="Metrics"] { flex-direction: column;
    align-items: stretch; }
  #results tr.result-row.expanded td:empty { display: none; }
  /* Make the collapsed header feel tappable. */
  #results tr.result-row td:first-child .expand-toggle { display: inline-flex; align-items: center; }
}

/* =====================================================================
   Tightest phones (<=480px): single-column everywhere.
   ===================================================================== */
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .card { border-right: none; border-bottom: 1px solid var(--rule); }
  .card:last-child { border-bottom: none; }
  .card:nth-child(2) { border-right: none; }

  .cmp-summary, .diff-head, .slot-row { flex-direction: column; align-items: stretch; }
  .slot-vs { align-self: center; }
  .detail-grid { grid-template-columns: 1fr; }
  .peek-list { grid-template-columns: 1fr; }

  .cm-head { padding: 12px 14px; }
  .cm-body { padding: 12px; }
  .cm-title { font-size: 17px; }

  /* Long mono output must wrap, never force horizontal scroll. */
  .dv { overflow-wrap: anywhere; word-break: break-word; }
}

/* =====================================================================
   PWA install — discoverable nav button + first-visit nudge + popup.
   ===================================================================== */
/* Masthead nav "Install app" button: matches the nav's small-caps links but
   reads as a filled call-to-action so it's easy to spot. */
.pwa-nav { display: inline-flex; align-items: center; gap: 6px; background: var(--ink);
  color: var(--on-ink); border: 1px solid var(--ink); border-radius: 3px; padding: 5px 12px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.3px; cursor: pointer; }
.pwa-nav[hidden] { display: none; }
.pwa-nav:hover { background: var(--ink-strong); }
.pwa-nav:active { transform: translateY(1px); }
.pwa-nav-ic { font-size: 14px; line-height: 1; }

/* First-visit floating nudge (bottom-right pill, opens the same popup). */
.pwa-nudge { position: fixed; right: 16px; bottom: 16px; z-index: 80;
  display: inline-flex; align-items: center; gap: 8px; background: var(--ink);
  color: var(--on-ink); border: 1px solid var(--ink); border-radius: 6px;
  padding: 11px 15px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.2px;
  cursor: pointer; box-shadow: 0 6px 22px rgba(0,0,0,0.22); }
.pwa-nudge:hover { background: var(--ink-strong); }
.pwa-nudge:active { transform: translateY(1px); }

/* Install popup (shared, all widths). */
.pwa-modal { position: fixed; inset: 0; z-index: 130; display: flex;
  align-items: center; justify-content: center; padding: 20px; }
.pwa-modal[hidden] { display: none; }
.pwa-modal-backdrop { position: absolute; inset: 0; background: rgba(17,17,17,0.58); }
.pwa-modal-card { position: relative; z-index: 1; width: min(460px, 94vw); max-height: 92vh;
  overflow: auto; background: var(--paper-edge); border: 1px solid var(--rule-strong);
  border-radius: 10px; padding: 26px 26px 22px; text-align: center;
  box-shadow: 0 16px 54px rgba(0,0,0,0.36); }
.pwa-modal-x { position: absolute; top: 10px; right: 12px; background: none; border: none;
  color: var(--muted); font-size: 15px; cursor: pointer; font-family: var(--mono);
  line-height: 1; padding: 4px; }
.pwa-modal-x:hover { color: var(--ink); }
.pwa-modal-mark { display: flex; justify-content: center; margin-bottom: 12px; }
.pwa-modal-mark .brand-logo { width: 44px; height: 44px; }
.pwa-modal-card h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 23px; }
.pwa-modal-lead { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.pwa-modal-body { text-align: left; }
.pwa-hint { margin: 0 0 4px; color: var(--ink-2); font-size: 13.5px; line-height: 1.6;
  font-family: var(--mono); }
.pwa-steps { margin: 0 auto 6px; padding-left: 20px; color: var(--ink-2); font-size: 14px;
  line-height: 1.8; text-align: left; }
.pwa-glyph { font-family: var(--mono); font-weight: 700; }
.pwa-modal-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  margin-top: 18px; }
.pwa-do-install { width: 100%; }
.pwa-do-install[hidden] { display: none; }
.pwa-modal-later { margin-top: 0; align-self: center; }

@media (max-width: 480px) {
  .pwa-nudge { right: 12px; bottom: 12px; padding: 10px 13px; font-size: 12.5px; }
  .pwa-modal-card { padding: 22px 18px 18px; }
}
