/* Archivo (SIL Open Font License 1.1, fonts/Archivo-OFL.txt), served from here: Latin
   subset, variable weight 100-900 and width 62-125%. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(/fonts/archivo-latin.woff2) format('woff2');
}
:root {
  --bg: #fbfaf8; --fg: #1d1d1b; --muted: #6b6a66; --line: #e4e2dc; --card: #ffffff;
  --accent: #2459d6; --accent-fg: #ffffff;
  --a: #1f8a4c; --b: #5f9e2f; --c: #b08a12; --d: #c2621b; --f: #c0362c;
  --warn-bg: #fff6e5; --problem-bg: #fdecea; --info-bg: #eef3fd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --fg: #ecebe7; --muted: #a09e98; --line: #2f2e2b; --card: #1d1d1b;
    --accent: #6b93f0; --accent-fg: #0e0e0d;
    --a: #4cc27f; --b: #9ccc59; --c: #e0b941; --d: #ee8b45; --f: #f0675b;
    --warn-bg: #2d2513; --problem-bg: #331b19; --info-bg: #18213a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 64px; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; gap: 12px; }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
h1 { font-size: 32px; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 20px; margin: 32px 0 12px; }
.lead { font-size: 18px; margin: 0 0 24px; }
.btn, .btn-ghost { display: inline-block; border-radius: 8px; padding: 10px 16px; font: inherit; cursor: pointer; text-decoration: none; }
.btn { background: var(--accent); color: var(--accent-fg); border: 0; font-weight: 600; }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn-big { font-size: 18px; padding: 14px 28px; margin: 16px 0 8px; }
.banner { background: var(--info-bg); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
.banner.error { background: var(--problem-bg); }
details.setup { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 16px 0; background: var(--card); }
details.setup summary { cursor: pointer; font-weight: 600; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.form input, .form select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.phase { font-size: 20px; font-weight: 600; }
.live { font-size: 48px; font-weight: 700; margin: 8px 0; font-variant-numeric: tabular-nums; min-height: 72px; }
.live .muted { font-size: 18px; font-weight: 400; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
#bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.steps { padding-left: 20px; color: var(--muted); }
.steps li.active { color: var(--fg); font-weight: 600; }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.hero { display: flex; align-items: center; gap: 24px; margin: 8px 0 24px; flex-wrap: wrap; }
.score-ring { width: 128px; height: 128px; border-radius: 50%; border: 8px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1; }
.score-ring .score { font-size: 42px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-ring .of { font-size: 14px; margin-top: 4px; }
.grade-A { border-color: var(--a); color: var(--a); } .grade-B { border-color: var(--b); color: var(--b); }
.grade-C { border-color: var(--c); color: var(--c); } .grade-D { border-color: var(--d); color: var(--d); }
.grade-F { border-color: var(--f); color: var(--f); }
.score-ring .score { color: var(--fg); } .score-ring .of { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.card .big { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.findings { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.findings li { padding: 10px 14px; border-radius: 8px; background: var(--info-bg); }
.findings li.sev-warn { background: var(--warn-bg); }
.findings li.sev-problem { background: var(--problem-bg); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); width: 45%; }
td.src { color: var(--muted); font-size: 14px; white-space: nowrap; }
.share { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
footer { margin-top: 40px; }
pre.guide { white-space: pre-wrap; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; overflow-wrap: anywhere; }
@media (max-width: 480px) { h1 { font-size: 26px; } .live { font-size: 40px; } th { width: 40%; } }
.banner.warn { background: var(--warn-bg); }
.arrow { font-size: 32px; color: var(--muted); }
.findings li.check-consistent { background: var(--info-bg); }
.findings li.check-inconsistent { background: var(--warn-bg); }
.table-scroll { overflow-x: auto; }
table.compare th { width: 34%; }
table.compare .src { color: var(--muted); font-size: 13px; }

.watch-chart { width: 100%; height: auto; display: block; margin: 8px 0 12px; }
.watch-chart .axis { stroke: var(--muted); stroke-width: 1; }
.watch-chart .label { fill: var(--muted); font-size: 12px; }
.watch-chart .band { fill: var(--accent, #4a7); opacity: .18; }
.watch-chart .median { fill: none; stroke: var(--accent, #4a7); stroke-width: 2; }
.watch-chart .lost { fill: #c33; }
.watch-chart .line { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.watch-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.watch-chart .lost { stroke: var(--f); stroke-width: 2; }
.watch-h { font-size: 14px; font-weight: 600; color: var(--muted); margin: 20px 0 0; }
.watch-stats .card .big { font-size: 24px; }
.watch-stats .card { padding: 10px 12px; }
#watch-saved { align-self: center; }
.probe-panels .card h3 { font-size: 16px; margin: 0 0 6px; }
.probe-panels .card p { margin: 0 0 12px; font-size: 14px; }
.probe-panels .card .value { font-size: 18px; font-weight: 600; margin: 0; }
.probe-panels .btn { font-size: 14px; padding: 8px 12px; }
.watch-chart .dot { fill: var(--accent); }
.watch-stats { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.watch-chart .median-dot { fill: var(--accent); }
.watch-chart .band-tick { stroke: var(--accent); stroke-width: 6; opacity: .18; }

/* ---- The test page: dark, one combined live chart (design direction D, "Stage") ---- */
.stage-page {
  --bg: #070a12; --fg: #eef1f8; --muted: #a3acc0; --line: #1f2840; --card: #0b1020;
  --accent: #9db8ff; --accent-fg: #070a12;
  --a: #4cc27f; --b: #9ccc59; --c: #e0b941; --d: #ee8b45; --f: #f0675b;
  --warn-bg: #2d2513; --problem-bg: #331b19; --info-bg: #121a33;
  --down: #5b8cff; --up: #ffb020; --ok: #7ee0a8;
  color-scheme: dark;
}
.stage-page .wrap { max-width: 1200px; }
.stage-page #intro, .stage-page #result > :not(.full) { max-width: 820px; }
.stage-page .top { margin-bottom: 24px; }
.giant, .dock .value, .closing h2, .q-card h3 { font-family: Archivo, ui-sans-serif, system-ui, sans-serif; font-stretch: 125%; font-variant-numeric: tabular-nums; }
#stage { display: flex; flex-direction: column; gap: 20px; }
#stage[hidden] { display: none; }
.stage-hero { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; }
.stage-now { flex: 1 1 460px; min-width: 0; }
.eyebrow { margin: 0 0 4px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.eyebrow.down { color: var(--down); } .eyebrow.up { color: var(--up); } .eyebrow.done { color: var(--ok); }
.giant-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.giant { font-size: 120px; line-height: .9; font-weight: 800; letter-spacing: -.03em; }
.giant.pair { font-size: 96px; }
.giant-unit { font-size: 22px; color: var(--muted); }
.subline { margin: 10px 0 0; color: var(--muted); min-height: 1.5em; }
.dock { flex: 0 1 560px; display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 10px; }
.dock .slot { min-height: 92px; box-sizing: border-box; border-radius: 12px; padding: 12px 14px; border: 1px dashed var(--line); }
.dock .slot .label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dock .slot.filled { border-style: solid; background: var(--card); animation: land .5s cubic-bezier(.2,.8,.2,1) both; }
.dock .slot .value { font-size: 30px; font-weight: 700; }
.dock .slot .unit { font-size: 12px; color: var(--muted); }
.dock .slot.filled.idle { border-color: var(--fg); }
.dock .slot.filled.download { border-color: var(--down); } .dock .slot.download .value { color: var(--down); }
.dock .slot.filled.upload { border-color: var(--up); } .dock .slot.upload .value { color: var(--up); }
.dock .slot.filled.lag { border-color: var(--ok); } .dock .slot.lag .value { color: var(--ok); }
.dock .slot.filled.loss { border-color: #c9a0ff; } .dock .slot.loss .value { color: #c9a0ff; }
@keyframes land { 0% { opacity: 0; transform: translateY(-18px) scale(.96); } 100% { opacity: 1; transform: none; } }
@keyframes rise { 0% { opacity: 0; transform: translateY(16px); } 100% { opacity: 1; transform: none; } }
.rise { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.dock .slot.filled.missing { border-color: var(--line); } .dock .slot.missing .value { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 4px; }
.live-chart { width: 100%; height: auto; display: block; }
.live-chart .grid { stroke: #141b2e; } .live-chart .axis { stroke: #263048; }
.live-chart text { fill: var(--muted); font-size: 12px; }
.live-chart .tag { letter-spacing: 1px; }
.live-chart .mark { stroke: var(--line); }
.live-chart .q-download { fill: var(--down); fill-opacity: .28; } .live-chart .q-upload { fill: var(--up); fill-opacity: .3; }
.live-chart .base { fill: none; stroke: var(--fg); stroke-opacity: .6; stroke-width: 1.2; stroke-dasharray: 5 5; }
.live-chart .dots { fill: none; stroke: var(--fg); stroke-opacity: .28; stroke-width: 3.5; stroke-linecap: round; }
.live-chart .line { fill: none; stroke: var(--fg); stroke-width: 2.2; stroke-linejoin: round; }
.live-chart .s-download { fill: var(--down); fill-opacity: .85; } .live-chart .s-upload { fill: var(--up); fill-opacity: .9; }
.live-chart .cursor { stroke: var(--fg); stroke-opacity: .7; }
.live-chart .head { fill: var(--fg); } .live-chart .head.download { fill: var(--down); } .live-chart .head.upload { fill: var(--up); }
.live-chart .big { font-size: 15px; font-weight: 700; fill: var(--fg); }
.live-chart .big.download { fill: var(--down); } .live-chart .big.upload { fill: var(--up); }
.stage-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.stage-row[hidden], .closing[hidden] { display: none; }
.q-card { flex: 999 1 520px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.q-card .q-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.q-card .kicker { color: var(--muted); }
.q-card h3 { margin: 0; font-size: 24px; line-height: 1.2; }
.q-card .q-body { display: flex; flex-direction: column; gap: 12px; }
.q-card .choices, .q-card .inputs { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.q-card .choice { font: inherit; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid #3a4666; background: #10162a; color: var(--fg); cursor: pointer; }
.q-card .choice:hover { border-color: var(--accent); }
.q-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.q-card input { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid #3a4666; border-radius: 10px; padding: 12px; width: 150px; }
.q-card .next { font: inherit; font-weight: 600; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--fg); color: var(--bg); cursor: pointer; }
.q-card .q-private { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); }
.q-card .q-private input { width: 20px; height: 20px; padding: 0; accent-color: var(--accent); }
.q-card .skip { font: inherit; font-size: 14px; color: var(--muted); background: none; border: 0; min-height: 44px; cursor: pointer; text-decoration: underline; }
.kicker { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.prompt-card { flex: 1 1 400px; min-width: 0; background: var(--fg); color: var(--bg); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.prompt-card .kicker, .closing .kicker { color: #3d4760; }
.prompt-card p { margin: 0; font-size: 14px; color: #2c3446; }
pre.prompt { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); color: var(--fg); border-radius: 10px; padding: 12px; }
.btn-dark { align-self: flex-start; font: inherit; font-weight: 600; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--bg); color: var(--fg); cursor: pointer; }
.closing { display: flex; flex-wrap: wrap; gap: 20px; background: var(--fg); color: var(--bg); border-radius: 20px; padding: 28px; animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.closing-verdict { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.closing-verdict h2 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.closing-verdict p { margin: 0; font-size: 17px; color: #2c3446; }
.closing-verdict a { color: #1d3fae; font-weight: 600; align-self: flex-start; }
.closing-prompt { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.closing pre.prompt { font-size: 14px; }
@media (max-width: 640px) {
  .giant { font-size: 76px; }
  .giant.pair { font-size: 50px; }
  .closing-verdict h2 { font-size: 26px; }
  .q-card input { width: 120px; }
}

/* Last, so it wins over every animation above. */
@media (prefers-reduced-motion: reduce) { .dock .slot.filled, .rise, .closing { animation: none; } }
