/* The validation page, light and dark. */
:root {
  color-scheme: light;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --ring: rgba(11, 11, 11, 0.10);
  --accent: #0b5d7a;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --quiet: #c3c2b7;
  --ref-sm: #6250d6;
  --ref-emodnet: #e87ba4;
  --ref-field: #eda100;
  --seq-100: #cde2fb; --seq-200: #9ec5f4; --seq-300: #6da7ec; --seq-400: #3987e5;
  --seq-500: #256abf; --seq-600: #184f95; --seq-700: #0d366b;
  --good: #0ca30c;
  --limit: #ec835a;
  --banner: #fff4dc;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --ring: rgba(255, 255, 255, 0.10); --accent: #6cc0dc;
    --series-1: #3987e5; --series-2: #d95926; --quiet: #4a4a46;
    --ref-sm: #9085e9; --ref-emodnet: #d55181; --ref-field: #c98500;
    --seq-100: #104281; --seq-200: #184f95; --seq-300: #1c5cab; --seq-400: #2a78d6;
    --seq-500: #5598e7; --seq-600: #86b6ef; --seq-700: #cde2fb;
    --banner: #3a2e10;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --ring: rgba(255, 255, 255, 0.10); --accent: #6cc0dc;
  --series-1: #3987e5; --series-2: #d95926; --quiet: #4a4a46;
  --ref-sm: #9085e9; --ref-emodnet: #d55181; --ref-field: #c98500;
  --seq-100: #104281; --seq-200: #184f95; --seq-300: #1c5cab; --seq-400: #2a78d6;
  --seq-500: #5598e7; --seq-600: #86b6ef; --seq-700: #cde2fb;
  --banner: #3a2e10;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--accent); }

.page-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100% - 1080px) / 2)); background: var(--surface); border-bottom: 1px solid var(--grid);
}
.page-head h1 { flex: 1; font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.back { text-decoration: none; font-size: 14px; white-space: nowrap; }
.ghost { background: none; border: 1px solid var(--grid); border-radius: 8px; color: var(--accent); padding: 4px 10px; font: inherit; cursor: pointer; }
.small { font-size: 12px; font-weight: 600; }

main { max-width: 1080px; margin: 0 auto; padding: 8px 16px 48px; }
h2 { font-size: 24px; margin: 40px 0 8px; letter-spacing: -0.02em; }
h3 { font-size: 18px; margin: 28px 0 6px; display: flex; align-items: center; gap: 10px; }
.lede { font-size: 17px; max-width: 760px; color: var(--ink); }
.intro, .about, .read { max-width: 820px; color: var(--ink-2); }
.read { color: var(--ink); }
.note { color: var(--muted); font-size: 13px; }
.banner { background: var(--banner); border-radius: 10px; padding: 10px 14px; margin: 16px 0 0; font-size: 14px; }
.footer { margin-top: 40px; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 12px 0; align-items: start; }
.verdict { background: var(--surface); border-radius: 12px; padding: 4px 20px 12px; box-shadow: 0 0 0 1px var(--ring); }
.verdict h3 { margin-top: 14px; }
.verdict ul { padding-inline-start: 18px; margin: 6px 0; }
.verdict li { margin: 8px 0; }
.verdict.good h3::before, .verdict.limits h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.verdict.good h3::before { background: var(--good); }
.verdict.limits h3::before { background: var(--limit); }

.product { border-top: 1px solid var(--grid); margin-top: 32px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.tile { background: var(--surface); border-radius: 12px; padding: 10px 14px; box-shadow: 0 0 0 1px var(--ring); display: flex; flex-direction: column; }
.tile-label { color: var(--ink-2); font-size: 13px; }
.tile-value { font-size: 24px; font-weight: 600; margin: 2px 0; }
.tile-note { color: var(--muted); font-size: 12px; }

.card { margin: 0; background: var(--surface); border-radius: 12px; padding: 12px 16px; box-shadow: 0 0 0 1px var(--ring); min-width: 0; }
.card figcaption { display: flex; flex-direction: column; margin-bottom: 8px; }
.card-title { font-weight: 600; font-size: 14px; }
.card-note { color: var(--muted); font-size: 12px; }
.plot { width: 100%; direction: ltr; }
/* charts read left to right in every language (negative left, positive right) */
.bar-track, .pair-bars, .scale, .confusion { direction: ltr; }
.plot canvas { display: block; touch-action: none; }
.scale { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; margin: 4px 0 0 52px; }
.scale i { width: 120px; height: 8px; border-radius: 4px; }

.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; border-radius: 6px; }
.bar-row:focus-visible, .bar-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bar-label { color: var(--ink-2); overflow-wrap: anywhere; }
.bar-label small { display: block; color: var(--muted); font-size: 11px; }
.bar-track { position: relative; display: flex; align-items: center; gap: 6px; min-height: 16px; }
.bar-fill { display: block; height: 12px; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bar-value { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; color: var(--ink); }
.bar-n { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 44px; text-align: end; }
.bar-row.ours .bar-label { color: var(--ink); font-weight: 600; }
.paired .pair { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.pair-bars { display: flex; flex-direction: column; gap: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }

table { border-collapse: collapse; font-size: 13px; width: 100%; }
th, td { text-align: start; padding: 4px 8px; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
th { color: var(--ink-2); font-weight: 600; }
.confusion td { text-align: center; border: 2px solid var(--surface); border-radius: 4px; }
.confusion td small { display: block; font-size: 11px; opacity: 0.8; }
.twin { margin-top: 8px; font-size: 13px; }
.twin summary, .examples summary { cursor: pointer; color: var(--accent); }
.twin table { margin-top: 6px; }
.examples { margin: 12px 0; }

#method ul, #sources ul { padding-inline-start: 18px; max-width: 860px; }
#method li, #sources li { margin: 6px 0; color: var(--ink-2); }

.tip {
  position: fixed; z-index: 10; display: none; pointer-events: none; background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--ring);
  max-width: 280px;
}
select.lang { font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--surface);
  border: 1px solid var(--grid); border-radius: 8px; padding: 3px 6px; }
.tip strong { display: block; font-size: 14px; }
.tip span { display: block; color: var(--ink-2); }

@media (max-width: 760px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  h2 { font-size: 21px; }
  .page-head h1 { font-size: 16px; }
  .back { font-size: 13px; }
}

#short .grid2 { align-items: stretch; }
