/* ──────────────────────────────────────────────────────────────────────
   Checkers — vanilla CSS. Mobile-first, fluid (no media queries).
   Tokens from .reference/skill design system.
   ────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Suisse Intl";
  src: url("/assets/fonts/SuisseIntl-Regular-subset.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Suisse Intl";
  src: url("/assets/fonts/SuisseIntl-SemiBold-subset.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  /* Neutrals */
  --color-bg: #ffffff;
  --color-bg-subtle: #f5f5f5;
  --color-text: #111111;
  --color-text-muted: #5d6265;
  --color-border: #e6e6e6;
  --color-border-dark: #b3b3b3;
  --color-grey-100: #f5f5f5;
  --color-grey-200: #d9d9d9;
  --color-grey-300: #8c8c8c;

  /* Semantic state colors (status pills, alerts) */
  --color-status-queued-bg: #f5f5f5;
  --color-status-queued-fg: #5d6265;
  --color-status-running-bg: #ebebe5;
  --color-status-running-fg: #4f4f4a;
  --color-status-done-bg: #f0f5f1;
  --color-status-done-fg: #1c403a;
  --color-status-failed-bg: #fbeae6;
  --color-status-failed-fg: #7a2418;
  --color-status-warn-bg: #fdf6e3;
  --color-status-warn-fg: #6b5615;
  --color-status-good-bg: #587246;
  --color-status-good-fg: #ffffff;

  /* Brand palette */
  --brand-board-light: #FFEEBB;
  --brand-board-dark:  #587246;
  --brand-piece-light: #FFFFFF;
  --brand-piece-red:   #CC0605;
  --brand-ink:         #0A0A0A;
  --brand-cream:       #EAE6CA;
  --color-status-lost-bg: #f4f1f8;
  --color-status-lost-fg: #51485b;

  /* Type */
  --font-sans: "Suisse Intl", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --size--2: clamp(0.78rem, 0.75rem + 0.18vw, 0.88rem);
  --size--1: clamp(0.94rem, 0.88rem + 0.30vw, 1.10rem);
  --size-0:  clamp(1.13rem, 1.03rem + 0.45vw, 1.38rem);
  --size-1:  clamp(1.35rem, 1.22rem + 0.67vw, 1.72rem);
  --size-2:  clamp(1.62rem, 1.43rem + 0.96vw, 2.15rem);
  --size-3:  clamp(1.94rem, 1.67rem + 1.35vw, 2.69rem);
  --size-4:  clamp(2.33rem, 1.96rem + 1.86vw, 3.36rem);
  --size-5:  clamp(1.80rem, 1.29rem + 2.54vw, 4.20rem);

  /* Spacing */
  --space-3xs: clamp(0.25rem, 0.23rem + 0.11vw, 0.31rem);
  --space-2xs: clamp(0.50rem, 0.46rem + 0.22vw, 0.63rem);
  --space-xs:  clamp(0.75rem, 0.69rem + 0.33vw, 0.94rem);
  --space-s:   clamp(1.00rem, 0.91rem + 0.43vw, 1.25rem);
  --space-m:   clamp(1.50rem, 1.37rem + 0.65vw, 1.88rem);
  --space-l:   clamp(2.00rem, 1.83rem + 0.87vw, 2.50rem);
  --space-xl:  clamp(3.00rem, 2.74rem + 1.30vw, 3.75rem);
  --space-2xl: clamp(4.00rem, 3.65rem + 1.74vw, 5.00rem);
  --space-3xl: clamp(6.00rem, 5.48rem + 2.61vw, 7.50rem);

  --radius: 4px;
  --transition: 150ms ease;
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--size-0);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
code { font-family: var(--font-mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; border-radius: 2px; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 100rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.site-main { flex: 1; padding-block: clamp(1.5rem, 3vw + 1rem, 3.75rem) clamp(2rem, 4vw + 1.5rem, 5rem); }

/* ── Header ──────────────────────────────────────────────────────────── */
/* Brand palette lives at :root — reused by footer and any other surface. */
.site-header {
  background: var(--brand-cream);
  border-bottom: 1px solid #D6CFB0;
  padding-block: var(--space-s);
}
body.is-home {
  background: var(--brand-cream);
}
body.is-home .site-header { border-bottom: none; }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-m); flex-wrap: wrap;
}
.logo-text { font-size: var(--size-1); font-weight: 600; letter-spacing: -0.02em; }
.site-logo {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  line-height: 1; color: var(--brand-ink); cursor: pointer;
}
.site-logo img { height: clamp(2.5rem, 2vw + 1.5rem, 4rem); width: auto; display: block; }
.site-header .site-nav { display: flex; gap: var(--space-m); list-style: none; flex-wrap: wrap; }
.site-header .site-nav a {
  font-size: var(--size--1); font-weight: 600;
  color: var(--brand-ink); transition: color var(--transition);
}
.site-header .site-nav a:hover { color: var(--brand-board-dark); }
.site-header .site-nav a[aria-current] { color: var(--brand-board-dark); }
/* Print-only header meta (attribution) — replaces the nav on paper. */
.site-header__print-meta { display: none; }
/* Print-only Beta marker next to a report eyebrow. */
.beta-pill { display: none; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--brand-board-dark);
  color: var(--brand-piece-light);
  padding-block: var(--space-l);
  margin-top: var(--space-2xl);
}
.site-footer__text { color: inherit; }
.site-footer a { color: inherit; }

/* ── Eyebrow / labels ────────────────────────────────────────────────── */
/* Shared uppercase-label recipe. `.eyebrow` / `.report__eyebrow` add standalone layout. */
.label-eyebrow, .eyebrow, .report__eyebrow {
  font-size: var(--size--2); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--color-text-muted);
}
.eyebrow, .report__eyebrow { display: block; margin-bottom: var(--space-s); }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero { max-width: 50rem; }
.hero__title {
  font-size: var(--size-4); font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.1; margin-bottom: var(--space-m);
}
.hero__lead {
  font-size: var(--size-0); color: var(--color-text-muted);
  margin-bottom: var(--space-xl); max-width: 40rem;
}
.hero__lead + .hero__lead { margin-top: calc(-1 * var(--space-l)); }

/* ── Check form ──────────────────────────────────────────────────────── */
.check-form {
  display: flex; flex-direction: column; gap: var(--space-xs);
  margin-bottom: var(--space-2xl);
  max-width: 32rem;
}
.check-form__row {
  display: flex; gap: var(--space-s); flex-wrap: wrap;
}
.check-form__input {
  flex: 1 1 18rem; min-width: 0;
  padding: var(--space-xs) var(--space-s);
  font-family: var(--font-sans);
  font-size: var(--size-0);
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.check-form__input:hover { border-color: var(--color-text); }
.check-form__input:focus-visible { outline: none; border-color: var(--color-text); }
.check-form__textarea {
  font-family: inherit; resize: vertical; min-height: 8rem;
  line-height: 1.5;
}
.check-form__submit { flex: 0 0 auto; }
.check-form__hint { font-size: var(--size--2); color: var(--color-text-muted); }
.check-form__error {
  background: var(--color-status-failed-bg);
  color: var(--color-status-failed-fg);
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius);
  font-size: var(--size--1);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-m);
  font-family: var(--font-sans);
  font-size: var(--size--1); font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--color-grey-100); color: var(--color-text); border-color: var(--color-border-dark); }
.btn--primary:hover:not(:disabled) { background: var(--color-grey-200); border-color: var(--color-text); }
.btn--secondary { background: transparent; color: var(--color-text); border-color: var(--color-border-dark); }
.btn--secondary:hover { border-color: var(--color-text); }
.btn--ghost {
  background: none; border: none; color: var(--color-text);
  padding-inline: 0; text-decoration: underline; text-underline-offset: 3px;
}

/* ── Feature grid ────────────────────────────────────────────────────── */
.features { margin-top: var(--space-2xl); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-m);
  list-style: none;
}
@media (max-width: 40rem) {
  .feature-grid { grid-template-columns: 1fr; }
}
.feature-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-l);
  display: flex; flex-direction: column; gap: var(--space-s);
}
.feature-card__title {
  font-size: var(--size-1); font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.2;
}
.feature-card__body { font-size: var(--size--1); color: var(--color-text-muted); }

/* ── Check (waiting) page ────────────────────────────────────────────── */
.check { max-width: none; }
.check__back { margin-bottom: var(--space-m); }
.check__title {
  font-size: var(--size-3); font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.2; margin-bottom: var(--space-l);
  word-break: break-all;
}
.check__status {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-l);
  display: flex; flex-direction: column; gap: var(--space-m);
}
.check__status-head {
  display: flex; align-items: center; gap: var(--space-s); flex-wrap: wrap;
}
.check__timer {
  font-family: var(--font-mono); font-size: var(--size--1);
  color: var(--color-text-muted); margin-left: auto;
}
.check__status-text { font-size: var(--size-0); color: var(--color-text-muted); }
.is-processing::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: processing-dots 1.2s steps(4) infinite;
}
@keyframes processing-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}
.check__progress {
  width: 100%; height: 6px;
  appearance: none; -webkit-appearance: none;
  border: none; background: var(--color-grey-100); border-radius: 999px; overflow: hidden;
}
.check__progress::-webkit-progress-bar { background: var(--color-grey-100); border-radius: 999px; }
.check__progress::-webkit-progress-value { background: var(--color-text); transition: width var(--transition); border-radius: 999px; }
.check__progress::-moz-progress-bar { background: var(--color-text); border-radius: 999px; }
.check__log {
  list-style: none;
  display: flex; flex-direction: column; gap: var(--space-3xs);
  font-size: var(--size--2); color: var(--color-text-muted);
  font-family: var(--font-mono);
}
.check__log li::before { content: "› "; color: var(--color-grey-300); }
.check__actions { display: flex; gap: var(--space-s); flex-wrap: wrap; margin-top: var(--space-s); }

/* ── Status pill ─────────────────────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  padding: var(--space-3xs) var(--space-xs); border-radius: 999px;
  font-size: var(--size--2); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.status-pill::before {
  content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: currentColor;
}
.status-pill--queued { background: var(--color-status-queued-bg); color: var(--color-status-queued-fg); }
.status-pill--running { background: var(--color-status-running-bg); color: var(--color-status-running-fg); }
.status-pill--running::before { animation: pulse 1.4s ease-in-out infinite; }
.status-pill--done { background: var(--color-status-done-bg); color: var(--color-status-done-fg); }
.status-pill--failed { background: var(--color-status-failed-bg); color: var(--color-status-failed-fg); }
.status-pill--lost { background: var(--color-status-lost-bg); color: var(--color-status-lost-fg); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.3); }
}

/* ── Report page chrome ──────────────────────────────────────────────── */
.report-page__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-s); flex-wrap: wrap;
  margin-bottom: var(--space-l);
}
.report-page__loading {
  display: flex; align-items: center; gap: var(--space-s);
  padding: var(--space-l);
  background: var(--color-bg-subtle);
  border-radius: var(--radius);
}
.report-page__loading-text { font-size: var(--size-0); color: var(--color-text-muted); }
.report-page__error {
  padding: var(--space-l);
  border: 1px solid var(--color-status-failed-fg);
  background: var(--color-status-failed-bg);
  border-radius: var(--radius);
  margin-bottom: var(--space-l);
}
.report-page__error h2 {
  font-size: var(--size-2); font-weight: 600;
  color: var(--color-status-failed-fg); margin-bottom: var(--space-s);
}
.report-page__error p { margin-bottom: var(--space-m); }
.report-page__error-actions { display: flex; gap: var(--space-s); flex-wrap: wrap; }

/* ── Report ──────────────────────────────────────────────────────────── */
.report-slot { margin-top: 0; }
.report__header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-l);
  margin-bottom: var(--space-l);
}
.report__url {
  font-size: var(--size-2); font-weight: 600; letter-spacing: -0.01em;
  word-break: break-all; margin-bottom: var(--space-xs);
}
.report__redirect { font-size: var(--size--1); color: var(--color-text-muted); margin-bottom: var(--space-m); }
.report__meta {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: var(--space-l); margin-top: var(--space-m);
}
.report__meta li { display: flex; flex-direction: column; gap: 2px; }
.report__meta span {
  font-size: var(--size--2); color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.report__meta strong { font-size: var(--size-0); font-weight: 600; font-family: var(--font-mono); }
.report__meta-action {
  margin-left: auto;
  align-self: center;
}
/* Wrapper keeps the icon button + Re-run on one row. A div (not an li) sidesteps
   the `.report__meta li { flex-direction: column }` rule that would stack them. */
.report__meta-actions {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--space-xs);
}
/* align-items:stretch on the row makes the icon button match Re-run's height. */
.btn--icon svg { display: block; width: 18px; height: 18px; }

.report__notice {
  margin-top: var(--space-m);
  padding: var(--space-s) var(--space-m);
  background: var(--color-status-running-bg);
  color: var(--color-status-running-fg);
  border-left: 3px solid var(--color-border-dark);
  border-radius: 2px;
}
.report__notice p { margin: 0; }
.report__notice a { color: inherit; text-decoration: underline; }

.report-section {
  margin-block: clamp(1.5rem, 3vw + 1rem, 3.75rem);
  padding-top: clamp(1rem, 2vw + 0.5rem, 2.5rem);
  border-top: 1px solid var(--color-border);
}
.report-section:first-of-type { border-top: none; padding-top: 0; }
.report-section--compact {
  margin-block: var(--space-m);
  padding-top: var(--space-s);
}
.report-section--highlight,
.report-section--highlight:first-of-type {
  position: relative;
  padding: var(--space-l);
  padding-right: clamp(5rem, 8vw + 3rem, 8rem);
  margin-block: var(--space-l);
  border: none;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.08), 0 2px 6px rgb(0 0 0 / 0.04);
}
.report-section--highlight .report-section__title,
.report-section--highlight .verdict__title,
.report-section--highlight .verdict__score,
.report-section--highlight .deep-checks a { color: inherit; }

/* Typography hierarchy on the highlight card. */
.report-section--highlight .report-section__title {
  font-size: var(--size--2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-s);
}
.report-section--highlight .verdict__title {
  font-size: var(--size-3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.report-section--highlight .verdict__detail {
  font-size: var(--size-0);
  margin-top: var(--space-xs);
}
.report-section--highlight .verdict__score {
  font-size: var(--size-5);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.report-section--highlight .verdict__score-max { font-size: var(--size-0); font-weight: 400; }

/* Each score band: primary text colour (color), supporting text colour
 * (`--score-secondary`) — hand-tuned complementary tones, no opacity. */
.report-section--highlight .report-section__title,
.report-section--highlight .verdict__detail,
.report-section--highlight .verdict__score-max { color: var(--score-secondary); }

.report-section--highlight-score-0,  .report-section--highlight-score-0:first-of-type  { background: #6c6c70; color: #ffffff; --score-secondary: #c8c8cc; }
.report-section--highlight-score-1,  .report-section--highlight-score-1:first-of-type  { background: #c8201a; color: #ffffff; --score-secondary: #f3c4c0; }
.report-section--highlight-score-2,  .report-section--highlight-score-2:first-of-type  { background: #c45419; color: #ffffff; --score-secondary: #f1cfb6; }
.report-section--highlight-score-3,  .report-section--highlight-score-3:first-of-type  { background: #b87300; color: #ffffff; --score-secondary: #ead2a2; }
.report-section--highlight-score-4,  .report-section--highlight-score-4:first-of-type  { background: #ffd84d; color: #2a1f00; --score-secondary: #6b5210; }
.report-section--highlight-score-5,  .report-section--highlight-score-5:first-of-type  { background: #ffe978; color: #2a2400; --score-secondary: #6b5d10; }
.report-section--highlight-score-6,  .report-section--highlight-score-6:first-of-type  { background: #d9e072; color: #1a2e00; --score-secondary: #4a6a10; }
.report-section--highlight-score-7,  .report-section--highlight-score-7:first-of-type  { background: #84c046; color: #15330a; --score-secondary: #3a6a18; }
.report-section--highlight-score-8,  .report-section--highlight-score-8:first-of-type  { background: #3ca352; color: #ffffff; --score-secondary: #b9e6c2; }
.report-section--highlight-score-9,  .report-section--highlight-score-9:first-of-type  { background: #1f8c3e; color: #ffffff; --score-secondary: #a2d8b0; }
.report-section--highlight-score-10, .report-section--highlight-score-10:first-of-type { background: #0a7c2c; color: #ffffff; --score-secondary: #94d0a4; }

.verdict {
  display: flex; flex-direction: column; gap: var(--space-2xs);
}
.verdict__title { font-size: var(--size-2); font-weight: 600; }
.verdict__detail { font-size: var(--size-0); color: var(--color-text-muted); }
.verdict__score {
  position: absolute; top: var(--space-m); right: var(--space-m);
  font-size: var(--size-4); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1; white-space: nowrap;
  color: var(--color-text);
}
.verdict__score-max { font-size: var(--size-0); color: var(--color-text-muted); font-weight: 400; }

.deep-checks {
  list-style: none; padding: 0; margin: var(--space-m) 0 0;
  display: flex; flex-direction: column; gap: var(--space-2xs);
}
.deep-checks a {
  display: inline-flex; align-items: baseline; gap: var(--space-2xs);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  width: fit-content;
  transition: gap 120ms ease;
}
.deep-checks a:hover { gap: var(--space-xs); }
.report-section--compact .report-section__head { margin-bottom: 0; }
/* Tighten the next section's leading space too — otherwise the compact
   section looks like it has a big gap below it. */
.report-section--compact + .report-section {
  margin-top: var(--space-m);
  padding-top: var(--space-s);
}
.report-section__title {
  font-size: var(--size-2); font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: var(--space-m);
}
.report-section__subtitle {
  font-size: var(--size--1); font-weight: 600;
  margin-top: var(--space-l); margin-bottom: var(--space-s);
  color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.report-section__note {
  font-size: var(--size--1); color: var(--color-text-muted);
  padding: var(--space-s) var(--space-m);
  background: var(--color-bg-subtle); border-radius: var(--radius);
}
/* Inline header: title on the left, empty-state hint on the right. */
.report-section__head {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: var(--space-m); margin-bottom: var(--space-m);
}
.report-section__head .report-section__title { margin-bottom: 0; }
.report-section__hint {
  font-size: var(--size--1); color: var(--color-text-muted); margin: 0;
}

/* ── Stat grid (legacy + new strip) ──────────────────────────────────── */
.stat-grid {
  list-style: none; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: var(--space-m);
}
.stat-grid--compact { gap: var(--space-s); }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__number {
  font-size: var(--size-3); font-weight: 600; letter-spacing: -0.02em;
  line-height: 1;
}
.stat__label { font-size: var(--size--2); color: var(--color-text-muted); }

/* New "at a glance" before/after stat strip. */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(calc(50% - var(--space-m) / 2), 11rem), 1fr));
  gap: var(--space-m);
}
.stat__value {
  display: flex; align-items: baseline; gap: var(--space-2xs);
}
.stat__num {
  font-size: var(--size-4); font-weight: 600;
  letter-spacing: -0.02em; line-height: 1;
}
.stat__num--after {
  font-size: var(--size-1); color: var(--color-text-muted);
  padding: 0.1rem 0.6rem;
  background: var(--color-status-done-bg);
  border-radius: 999px;
}
.stat__num--after::before { content: "→ "; }
.stat__num--extra {
  font-size: var(--size-1); color: var(--color-text-muted);
}
.stat__delta {
  font-size: var(--size--2);
  margin-top: var(--space-2xs);
}
.stat__delta--up   { color: var(--color-status-done-fg); font-weight: 600; }
.stat__delta--down { color: var(--color-status-failed-fg); font-weight: 600; }
.stat__delta--flat { color: var(--color-text-muted); }

/* ── Key/value list ──────────────────────────────────────────────────── */
.kv-list { display: flex; flex-direction: column; gap: var(--space-xs); }
/* Card variant: the subtle grey block behind short stat lists like the
   report "At a glance" section. */
.kv-list--card {
  background: var(--color-bg-subtle);
  border-radius: var(--radius);
  padding: var(--space-s) var(--space-m);
}
/* Tighter gap under the card's title so the first row lines up with the
   verdict text in the adjacent highlight card. */
.kv-list--card > .report-section__title { margin-bottom: var(--space-2xs); }
/* Chip fills (pale green/yellow) melt into the card's grey — give them an
   outline so they read as chips. */
.kv-list--card .chip { border: 1px solid var(--color-border-dark); }

/* Flush pair: the two cards sit edge to edge at equal height (e.g. the
   "At a glance" grey card against the verdict card). Doubled class selector
   outranks the base .report-pair rules that appear later in this file. */
.report-pair.report-pair--flush { gap: 0; }
.report-pair.report-pair--flush > * { display: flex; flex-direction: column; }
.report-pair.report-pair--flush > * > .report-section,
.report-pair.report-pair--flush > * > .report-section--highlight { flex: 1; display: flex; flex-direction: column; }
.report-pair.report-pair--flush .kv-list--card,
.report-pair.report-pair--flush .tech-card { flex: 1; border-radius: 0; }
.kv-list__row {
  display: grid; grid-template-columns: minmax(8rem, 14ch) 1fr;
  gap: var(--space-s); padding-block: var(--space-2xs);
  border-bottom: 1px solid var(--color-border);
}
.kv-list__row:last-child { border-bottom: none; }
.kv-list__row dt {
  font-size: var(--size--2); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.kv-list__row dd { font-size: var(--size--1); word-break: break-word; }
.code--block {
  display: block; padding: var(--space-xs); background: var(--color-bg-subtle);
  border-radius: var(--radius); white-space: pre-wrap; word-break: break-all;
}

/* ── Data table ──────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-block: var(--space-s); }
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--size--1); min-width: 30rem;
}
.data-table th, .data-table td {
  padding: var(--space-2xs) var(--space-s);
  text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}
.data-table thead th {
  font-weight: 600; font-size: var(--size--2);
  background: var(--color-grey-100);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.data-table__value, .data-table__url {
  font-family: var(--font-mono); font-size: 0.85em;
  word-break: break-all; max-width: 40rem;
}
.data-table--compact th, .data-table--compact td {
  padding: var(--space-3xs) var(--space-s);
}

/* ── Flags (cookie attrs) ────────────────────────────────────────────── */
.flag {
  display: inline-block; min-width: 1.2rem; text-align: center;
  padding: 0 0.4rem; border-radius: 3px;
  font-family: var(--font-mono); font-size: var(--size--2);
  background: var(--color-grey-100); color: var(--color-grey-300);
  margin-right: 2px;
}
.flag--on { background: var(--color-status-done-bg); color: var(--color-status-done-fg); }
.flag--text {
  background: transparent; color: var(--color-text-muted);
  font-family: var(--font-sans); padding: 0 0.3rem;
}

/* ── Chips (small status pills used inside report content) ───────────── */
.chip {
  display: inline-block; padding: 2px var(--space-2xs); margin-right: var(--space-3xs);
  border-radius: 3px; font-size: var(--size--2); font-weight: 600;
  background: var(--color-grey-100); color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.chip--good    { background: var(--color-status-done-bg);   color: var(--color-status-done-fg);   border-color: transparent; }
.chip--warn    { background: var(--color-status-warn-bg);   color: var(--color-status-warn-fg);   border-color: transparent; }
.chip--bad     { background: var(--color-status-failed-bg); color: var(--color-status-failed-fg); border-color: transparent; }
.chip--neutral { background: var(--color-grey-100);         color: var(--color-text-muted);       border-color: transparent; }

.bare-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2xs); }
.bare-list li { font-size: var(--size--1); }

.muted { color: var(--color-text-muted); }
.muted-heading {
  font-size: var(--size--2); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xs);
}

/* ── Two-column pair (technologies | analytics) ──────────────────────── */
.report-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr));
  gap: var(--space-m);
}
.report-pair--triple {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.report-pair > * { min-width: 0; }
/* Sections inside the pair shouldn't carry their own vertical margins — the
   grid gap handles spacing, both side-by-side and stacked on mobile. */
.report-pair > * > .report-section,
.report-pair > * > .report-section--highlight,
.report-pair > * > .report-section--highlight:first-of-type {
  margin-block: 0;
  padding-top: 0;
  border-top: none;
}
.report-pair > * > .report-section--highlight,
.report-pair > * > .report-section--highlight:first-of-type {
  padding-top: var(--space-l);
}

/* ── Findings list (label + value) ───────────────────────────────────── */
.findings { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-xs); }
.finding {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-s);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
}
.finding:last-child { border-bottom: none; }
.finding__label { color: var(--color-text); display: flex; flex-direction: column; gap: var(--space-3xs); }
.finding__detail { font-size: var(--size--1); color: var(--color-text-muted); }
.finding__value {
  color: var(--color-text-muted); font-weight: 600; white-space: nowrap;
  padding: var(--space-3xs) var(--space-xs);
  font-size: var(--size--1);
}
.finding__value--bad  { color: var(--color-status-failed-fg); background: var(--color-status-failed-bg); }
.finding__value--good { color: var(--color-status-done-fg);   background: var(--color-status-done-bg); }
.finding--prominent {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-s);
  padding: var(--space-s) 0;
  margin-bottom: var(--space-s);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--size-1);
}
.finding--prominent .finding__label { font-weight: 600; }

/* ── Technologies (grouped) ──────────────────────────────────────────── */
.tech-groups {
  display: flex; flex-wrap: wrap;
  gap: var(--space-s) var(--space-l);
}
/* Grey card behind the technologies block (title + groups) — same treatment
   as .kv-list--card. Tags flip to white so they don't melt into the card
   (both are subtle grey). */
.tech-card {
  background: var(--color-bg-subtle);
  border-radius: var(--radius);
  padding: var(--space-s) var(--space-m);
}
.tech-card > .report-section__title { margin-bottom: var(--space-2xs); }
.tech-card .tag { background: #fff; }
.tech-group { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.tech-group--full { flex-basis: 100%; }

/* ── Tags ────────────────────────────────────────────────────────────── */
.tag-list {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: var(--space-2xs);
}
.tag {
  font-size: var(--size--1);
  padding: var(--space-3xs) var(--space-xs);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.tag__type {
  font-size: var(--size--2); color: var(--color-text-muted);
  margin-left: var(--space-3xs);
}

/* ── Compare (before / after side-by-side) ──────────────────────────── */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr));
  gap: var(--space-m);
}
.compare__col {
  display: flex; flex-direction: column; gap: var(--space-s);
  min-width: 0;
}
.compare__title {
  font-size: var(--size-1); font-weight: 600;
  letter-spacing: -0.01em;
}
.compare__meta {
  font-size: var(--size--1); color: var(--color-text-muted);
  margin-top: calc(-1 * var(--space-2xs));
}
.compare__meta--muted { font-style: italic; }

/* Status tags shown inline next to a name/url to mark new/changed entries. */
.status-tag {
  display: inline-block;
  font-size: 0.65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.status-tag--new     { background: var(--color-status-done-bg); color: var(--color-status-done-fg); }
.status-tag--changed { background: var(--color-status-running-bg); color: var(--color-status-running-fg); }

/* ── Tree (grouped lists with details/summary) ───────────────────────── */
.tree {
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.tree__node + .tree__node { border-top: 1px solid var(--color-border); }
.tree__head,
.tree__summary {
  display: grid;
  /* Caret · main · party-badge · count.  Fixed widths on the trailing two
     so the header columns line up with the data values — `auto auto` made
     each row size independently and the columns drifted. */
  grid-template-columns: 1.5rem minmax(0, 1fr) 4.5rem 6rem;
  align-items: center;
  gap: var(--space-s);
}
/* On narrow screens the fixed columns squeeze the main column, so let them
   collapse to content width. Header/row alignment drifts slightly but the
   layout no longer breaks. */
@media (max-width: 36rem) {
  .tree__head,
  .tree__summary {
    grid-template-columns: 1.5rem minmax(0, 1fr) auto auto;
    gap: var(--space-xs);
  }
}
.tree__head {
  padding: var(--space-2xs) var(--space-s);
  background: var(--color-grey-100);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--size--2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.tree__details { width: 100%; }
.tree__summary {
  padding: var(--space-xs) var(--space-s);
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: #fff;
  transition: background-color var(--transition);
}
.tree__summary::-webkit-details-marker { display: none; }
.tree__caret {
  width: 0; height: 0;
  border-style: solid;
  border-width: 5px 0 5px 7px;
  border-color: transparent transparent transparent var(--color-text);
  transition: transform 150ms ease;
  justify-self: center;
}
.tree__details[open] > .tree__summary .tree__caret { transform: rotate(90deg); }
.tree__summary:hover { background: var(--color-bg-subtle); }

.tree__host, .tree__name {
  font-family: var(--font-mono);
  font-size: var(--size--1);
  word-break: break-all;
  min-width: 0;
}
.tree__host { font-weight: 600; }
.tree__count {
  font-family: var(--font-mono);
  font-size: var(--size--2);
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  min-width: 2.5ch;
  text-align: center;
  justify-self: start;
}
.tree__badge {
  font-size: var(--size--2);
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  justify-self: start;
}
.tree__badge--first { background: var(--color-status-done-bg); color: var(--color-status-done-fg); }
.tree__badge--third { background: var(--color-status-lost-bg); color: var(--color-status-lost-fg); }

.tree__children {
  list-style: none;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
.tree__leaf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: var(--space-s);
  padding: var(--space-2xs) var(--space-s) var(--space-2xs) calc(var(--space-s) + 1.5rem);
  border-top: 1px solid var(--color-border);
  font-size: var(--size--1);
}
.tree__leaf:first-child { border-top: none; }
.tree__url, .tree__leaf > code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  word-break: break-all;
  min-width: 0;
}
.tree__meta {
  font-size: var(--size--2);
  color: var(--color-text-muted);
  text-align: right;
  white-space: nowrap;
  /* Scales the cap from 6rem on phones up to 14rem on wide screens so the
     content-type column doesn't push the URL column off-screen on mobile. */
  max-width: clamp(6rem, 35vw, 14rem);
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree__meta--mono { font-family: var(--font-mono); }
.tree__leaf--cookie { padding-block: var(--space-3xs); }

/* Storage rows: 2-column grid where the value column wraps on long JSON blobs. */
.tree__head--storage,
.tree__leaf--storage {
  grid-template-columns: minmax(8rem, 1fr) minmax(0, 3fr);
  padding-left: var(--space-s);
}
.tree__value {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--color-text-muted);
  word-break: break-all;
  overflow-wrap: anywhere;
  min-width: 0;
}

/* ── Disclosure (details/summary) ────────────────────────────────────── */
.disclosure {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
}
.disclosure__summary {
  padding: var(--space-s) var(--space-m);
  font-size: var(--size--1); font-weight: 600;
  cursor: pointer; user-select: none;
  list-style: none;
}
.disclosure__summary::-webkit-details-marker { display: none; }
.disclosure__summary::before { content: "+ "; color: var(--color-text-muted); }
.disclosure[open] .disclosure__summary::before { content: "− "; }
.disclosure[open] .disclosure__summary { border-bottom: 1px solid var(--color-border); }

/* ── Report error ────────────────────────────────────────────────────── */
.report-error {
  padding: var(--space-l);
  border: 1px solid var(--color-status-failed-fg);
  background: var(--color-status-failed-bg);
  border-radius: var(--radius);
}
.report-error__title {
  font-size: var(--size-2); font-weight: 600;
  color: var(--color-status-failed-fg); margin-bottom: var(--space-s);
}
.report-error__reason { font-size: var(--size-0); margin-bottom: var(--space-s); }
.report-error__url { font-size: var(--size--1); color: var(--color-text-muted); }

/* ── Prose (about page) ──────────────────────────────────────────────── */
.prose { max-width: 50rem; }
.prose h1 {
  font-size: var(--size-4); font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.1; margin-bottom: var(--space-m);
}
.prose h2 {
  font-size: var(--size-2); font-weight: 600;
  margin-top: var(--space-xl); margin-bottom: var(--space-s);
}
.prose .lead { font-size: var(--size-1); color: var(--color-text-muted); margin-bottom: var(--space-l); }
.prose p { margin-bottom: var(--space-s); }
.prose ol, .prose ul { margin: var(--space-s) 0 var(--space-m) var(--space-l); }
.prose li { margin-bottom: var(--space-2xs); }
.prose a { color: #0a66c2; text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: #084d92; }
.prose__muted { color: var(--color-text-muted); font-size: var(--size--1); }

/* ── Print ───────────────────────────────────────────────────────────────
   Make every check/report page save to a clean PDF: drop the site chrome
   and interactive controls, keep the verdict cards' colors, and let tables
   flow across pages instead of scrolling. */
@media print {
  @page { margin: 14mm; }

  :root {
    /* Fluid type is tuned for screens; print reads better smaller. Pin the
       whole scale to fixed pt sizes instead of viewport-relative clamps. */
    --size--2: 7.5pt;
    --size--1: 8.5pt;
    --size-0:  10pt;
    --size-1:  12pt;
    --size-2:  14pt;
    --size-3:  17pt;
    --size-4:  20pt;
    --size-5:  24pt;
  }

  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; color: #000; display: block; min-height: 0; }

  /* Controls that make no sense on paper. The branded site header stays —
     a saved PDF should lead with the Checkers logo on the cream band — but
     its nav links go. */
  .site-header .site-nav,
  .site-footer,
  .report__meta-actions,
  .report-page__loading,
  .check-form,
  .check__actions,
  .report-page__error-actions { display: none !important; }

  .site-header {
    background: var(--brand-cream);
    border-bottom: 1px solid #D6CFB0;
    margin-bottom: var(--space-l);
  }
  /* Same look as the nav links it replaces ("About" etc.), two stacked rows. */
  .site-header__print-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--brand-ink);
    font-size: var(--size--1);
    font-weight: 600;
    line-height: 1.35;
  }
  .site-header__print-byline { font-weight: 400; }
  /* Anchor the Beta pill to the right edge of the report header line. */
  .report__header { position: relative; }
  .beta-pill {
    display: inline-block;
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.15rem 0.7rem;
    border: 1px solid #000;
    border-radius: 999px;
    background: none;
    font-size: 9pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #000;
  }

  /* A sliver of side padding — just enough that nothing (e.g. the
     right-anchored Beta pill's border) is clipped at the page edge. */
  .container { max-width: none; padding-inline: var(--space-2xs); }
  .site-main { padding-block: 0 var(--space-m); }

  a { text-decoration: none; color: inherit; }

  /* Tables: no horizontal scrolling on paper — let them take full width and
     break across pages, repeating the header row. */
  .table-wrap { overflow-x: visible; }
  .data-table { min-width: 0; }
  .data-table thead { display: table-header-group; }
  .data-table th, .data-table td { page-break-inside: avoid; }

  /* Keep headline blocks intact and drop screen-only shadows. */
  .report__header,
  .report-section--highlight,
  .kv-list__row,
  .feature-card,
  .stat { page-break-inside: avoid; }
  .report-section--highlight,
  .report-section--highlight:first-of-type { box-shadow: none; }
  .report-section { page-break-inside: auto; }
  .report-section__title { page-break-after: avoid; }

  /* Report-document rhythm: the screen's airy spacing reads sloppy on paper.
     Tighter title block, consistent section spacing, compact cards. */
  .site-header { padding-block: var(--space-xs); margin-bottom: var(--space-m); }
  .site-main { padding-top: 0; }
  .report__header {
    padding-bottom: var(--space-s);
    margin-bottom: var(--space-s);
  }
  .report__url { margin-bottom: var(--space-3xs); }
  .report__meta { margin-top: var(--space-s); gap: var(--space-m); }
  .report-section {
    margin-block: var(--space-m);
    padding-top: var(--space-s);
  }
  .report-section__title { margin-bottom: var(--space-s); }
  .report-section--highlight,
  .report-section--highlight:first-of-type {
    padding: var(--space-m);
    padding-right: 6rem;
    margin-block: var(--space-m);
  }
  .report-section--highlight .verdict__score { top: var(--space-s); right: var(--space-s); }
  .table-wrap { margin-block: var(--space-2xs); }

  /* Grouped trees (CSP, network, cookies) print as plain tables: no carets,
     no pill chrome, flat rows. (Closed <details> can't be opened from CSS —
     collapsed groups print collapsed, keeping the PDF at summary level.) */
  .tree { border-color: var(--color-border); }
  .tree__summary { cursor: default; }
  .tree__caret { display: none; }
  .tree__head:not(.tree__head--storage) > span:first-child { display: none; }
  .tree__head:not(.tree__head--storage),
  .tree__summary { grid-template-columns: minmax(0, 1fr) 4rem 5rem; }
  /* Match the data tables: grey header band, same row padding, columns
     left-aligned so header and row text line up. */
  .tree__head,
  .tree__summary,
  .tree__leaf { padding: var(--space-2xs) var(--space-s); }
  .tree__badge,
  .tree__count {
    background: none;
    padding: 0;
    border-radius: 0;
    min-width: 0;
    text-align: left;
  }
  .tree__node, .tree__leaf, .tree__summary { page-break-inside: avoid; }

  /* Side-by-side pairs stay side-by-side on paper — the auto-fit minimum
     (28rem) is tuned for screens and would stack them on a print page. Only
     pairs with two+ children though: single-child pairs (e.g. each "Known
     vulnerabilities" table) must keep the full page width. */
  .report-pair:has(> :nth-child(2)) { grid-template-columns: 1fr 1fr; page-break-inside: avoid; }
  .report-pair.report-pair--triple { grid-template-columns: repeat(3, 1fr); }

  /* Before/after comparisons (cookies, network, storage) keep their two
     columns on paper too: before on the left, after on the right. */
  .compare { grid-template-columns: 1fr 1fr; }

  /* "At a glance" stats all on one row on paper. */
  .stat-strip { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

  /* The raw sample beacon URL is a debugging aid — noise on paper. */
  .tracker-sample { display: none; }
}
