/* Diagnose My Internet
   A network-operations look: dark by default (light follows the system setting),
   a faint measurement grid, cyan for actions and live signal, and three health
   tones. Numbers are set in monospace like instrument readouts; reading text
   stays in Atkinson Hyperlegible Next, which is built for legibility.
   Self-hosted fonts and system monospace only: no third-party requests. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #0a1016;
  --bg-raised: #0e161d;
  --surface: #111b23;
  --surface-2: #16232d;
  --surface-3: #1c2c38;
  --line: #21313d;
  --line-strong: #2f4555;
  --grid: rgba(120, 170, 200, 0.055);
  --ink: #e6edf3;
  --muted: #9aabba;
  --faint: #6f8392;
  --accent: #3dd6d0;
  --accent-strong: #6ee7e2;
  --accent-ink: #032321;
  --accent-soft: rgba(61, 214, 208, 0.1);
  --accent-line: rgba(61, 214, 208, 0.38);
  --glow: 0 0 0 1px var(--accent-line), 0 8px 32px -8px rgba(61, 214, 208, 0.35);
  --ok: #3fd17f;
  --ok-soft: rgba(63, 209, 127, 0.12);
  --warn: #f5b83d;
  --warn-soft: rgba(245, 184, 61, 0.12);
  --bad: #ff6b5e;
  --bad-soft: rgba(255, 107, 94, 0.12);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 40px -18px rgba(0, 0, 0, 0.7);
  --header-bg: rgba(10, 16, 22, 0.78);
  --focus: #6ee7e2;

  --sans: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --wide: 72rem;
  --text: 41rem;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f6f8;
    --bg-raised: #eaf0f3;
    --surface: #ffffff;
    --surface-2: #f1f5f8;
    --surface-3: #e5edf2;
    --line: #d6e0e7;
    --line-strong: #b9c9d4;
    --grid: rgba(20, 70, 100, 0.055);
    --ink: #0d1a22;
    --muted: #4a5d6c;
    --faint: #6a7d8b;
    --accent: #0a8580;
    --accent-strong: #06706c;
    --accent-ink: #ffffff;
    --accent-soft: rgba(10, 133, 128, 0.09);
    --accent-line: rgba(10, 133, 128, 0.35);
    --glow: 0 0 0 1px var(--accent-line), 0 8px 28px -12px rgba(10, 133, 128, 0.35);
    --ok: #1d8549;
    --ok-soft: rgba(29, 133, 73, 0.1);
    --warn: #9a6300;
    --warn-soft: rgba(154, 99, 0, 0.1);
    --bad: #c0392b;
    --bad-soft: rgba(192, 57, 43, 0.09);
    --shadow: 0 1px 2px rgba(13, 26, 34, 0.05), 0 12px 32px -20px rgba(13, 26, 34, 0.25);
    --header-bg: rgba(243, 246, 248, 0.82);
    --focus: #0a8580;
    color-scheme: light;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* Scripts show and hide sections with the hidden attribute; no layout rule may override it. */
[hidden] { display: none !important; }

html { font-size: 106.25%; -webkit-text-size-adjust: 100%; } /* 17px base */

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Measurement grid and a soft light from the top, behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--accent-soft), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 44px 44px, 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%);
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

img, svg { max-width: 100%; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-line);
}
.skip:focus { left: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.22em;
}
.icon .f { fill: currentColor; stroke: none; }
.icon .dashed { stroke-dasharray: 2 2.2; }

/* ---------- Type ---------- */

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.75rem); font-weight: 800; margin: 0 0 14px; }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); font-weight: 750; margin: 0 0 14px; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 22px 0 8px; }
p, ul, ol, dl { max-width: var(--text); }
p { margin: 0 0 16px; }
strong { font-weight: 700; }

.lede { font-size: clamp(1.05rem, 1.8vw, 1.2rem); color: var(--muted); max-width: 38rem; }
.muted { color: var(--muted); font-size: 0.86rem; }
.mono, code, kbd { font-family: var(--mono); font-size: 0.92em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-label {
  display: block;
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* A blinking status light: the one recurring "live" signal. */
.status-dot, .live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
  flex: none;
}
.live-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- Page frame ---------- */

.wrap, .page {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
@media (min-width: 720px) {
  .wrap, .page { padding-left: 28px; padding-right: 28px; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
}
.wordmark:hover { color: var(--ink); }
.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  box-shadow: 0 0 18px -6px var(--accent);
}
.mark .icon { width: 20px; height: 20px; stroke-width: 2.2; }
.wordmark-accent { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 10px;
  border-radius: 8px;
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
@media (max-width: 560px) {
  .nav-link { display: none; }
  .wordmark-text { font-size: 0.95rem; }
}

.page { flex: 1; padding-top: 40px; padding-bottom: 72px; }
@media (min-width: 720px) { .page { padding-top: 56px; } }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  gap: 28px;
  padding: 44px 0 28px;
  grid-template-columns: 1fr 1fr;
}
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { margin: 12px 0 0; max-width: 24rem; }
@media (min-width: 820px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}
.footer-heading {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 6px 0 12px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-base {
  border-top: 1px solid var(--line);
  padding: 18px 0 32px;
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  justify-content: space-between;
}
.footer-base p { margin: 0; display: flex; align-items: center; gap: 9px; max-width: none; }
.footer-base a { text-decoration: underline; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  padding: 14px 22px;
  border-radius: 11px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 0 0 transparent, 0 10px 30px -12px var(--accent);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.button:hover {
  color: var(--accent-ink);
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 14px 34px -12px var(--accent);
}
.button:active { transform: translateY(0); }
.button .icon { width: 1.1em; height: 1.1em; stroke-width: 2.2; }
.button.secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent-line);
  box-shadow: none;
}
.button.secondary:hover { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.button.ghost {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: none;
}
.button.ghost:hover { border-color: var(--accent-line); color: var(--ink); background: var(--surface-3); }
.button.small { padding: 9px 15px; font-size: 0.9rem; border-radius: 9px; }
@media (prefers-reduced-motion: reduce) {
  .button, .button:hover { transition: none; transform: none; }
}

/* ---------- Panels (cards) ---------- */

.panel, .card {
  background: linear-gradient(180deg, var(--surface), var(--bg-raised));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 26px 22px; margin: 0 0 22px; }
@media (min-width: 720px) { .card { padding: 30px 32px; } }
.card > h2:first-child, .card > .section-label:first-child + h2 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.panel-head .live { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }

.section { margin: 0 0 72px; }
.section-head { margin-bottom: 26px; }
.section-head p { color: var(--muted); }

/* ---------- Landing ---------- */

.hero {
  display: grid;
  gap: 40px;
  align-items: center;
  margin: 0 0 80px;
}
@media (min-width: 960px) {
  .hero { grid-template-columns: 1.05fr 1fr; gap: 56px; margin-top: 8px; }
}
.hero h1 {
  font-size: clamp(2.45rem, 6.6vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}
.hero h1 .accent {
  color: var(--accent);
  text-shadow: 0 0 34px rgba(61, 214, 208, 0.35);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.chips li { display: inline-flex; align-items: center; gap: 7px; }
.chips .icon { color: var(--ok); width: 1.05em; height: 1.05em; stroke-width: 2.4; }

/* The connection path: four nodes, data packets travelling along the links.
   The first link (Wi-Fi or cable) is dashed. */
.path { margin: 0; overflow: hidden; }
.path-body { padding: 30px 18px 10px; }
.path-nodes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: none;
}
.path-nodes li {
  position: relative;
  text-align: center;
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.25;
  color: var(--ink);
}
.node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 15px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--accent);
}
.node .icon { width: 26px; height: 26px; }
.path-nodes li:first-child .node { border-color: var(--accent-line); box-shadow: 0 0 22px -6px var(--accent); }
.node-sub {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.link {
  position: absolute;
  top: 27px;
  left: calc(50% + 32px);
  width: calc(100% - 64px);
  height: 2px;
  background: var(--line-strong);
  overflow: visible;
}
.path-nodes li.wireless .link {
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 11px);
}
.link::after { /* the packet */
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 2px var(--accent);
  animation: packet 2.6s linear infinite;
  opacity: 0;
}
.path-nodes li:nth-child(2) .link::after { animation-delay: 0.65s; }
.path-nodes li:nth-child(3) .link::after { animation-delay: 1.3s; }
@keyframes packet {
  0% { left: 0; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: calc(100% - 8px); opacity: 0; }
}
.path-readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1px;
  margin: 26px 0 0;
  background: var(--line);
  border-top: 1px solid var(--line);
  max-width: none;
}
.path-readout div { background: var(--surface); padding: 12px 16px; }
.path-readout dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.path-readout dd { margin: 2px 0 0; font-weight: 700; font-size: 0.9rem; }
.path figcaption { color: var(--muted); font-size: 0.86rem; padding: 14px 18px 16px; border-top: 1px solid var(--line); }
@media (max-width: 480px) {
  .node { width: 44px; height: 44px; border-radius: 12px; }
  .node .icon { width: 22px; height: 22px; }
  .link { top: 22px; left: calc(50% + 26px); width: calc(100% - 52px); }
  .path-nodes li { font-size: 0.76rem; }
  .node-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .link::after, .live-dot { animation: none; }
  .link::after { opacity: 0; }
}

/* Symptom picker, guide and provider lists: a grid of cards. */
.symptom-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  max-width: none;
}
@media (min-width: 620px) { .symptom-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .symptom-list.three { grid-template-columns: repeat(3, 1fr); } }
.symptom-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 16px 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.symptom-list a:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}
.symptom-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 11px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}
.symptom-icon .icon { width: 22px; height: 22px; }
.symptom-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.symptom-label { font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.symptom-hint { color: var(--muted); font-size: 0.88rem; line-height: 1.4; margin-top: 2px; }
.symptom-go { color: var(--faint); transition: color 0.18s ease, transform 0.18s ease; }
.symptom-list a:hover .symptom-go { color: var(--accent); transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .symptom-list a, .symptom-list a:hover, .symptom-go { transition: none; transform: none; }
}

/* How it works: three numbered steps */
.steps-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-width: none;
  counter-reset: how;
}
@media (min-width: 820px) { .steps-row { grid-template-columns: repeat(3, 1fr); } }
.steps-row li {
  counter-increment: how;
  position: relative;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.steps-row li::before {
  content: "0" counter(how);
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.steps-row h3 { margin: 0 0 6px; }
.steps-row p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* What the test checks: diagnostic modules */
.how-list {
  margin: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  max-width: none;
}
@media (min-width: 620px) { .how-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .how-list { grid-template-columns: repeat(3, 1fr); } }
.how-list div {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.how-list dt { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.how-list dt .icon { color: var(--accent); width: 22px; height: 22px; }
.how-list .module-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 2px 6px;
}
.how-list dd { margin: 8px 0 0; color: var(--muted); font-size: 0.94rem; }

/* Differences band */
.features {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 820px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: var(--surface); padding: 26px 24px; }
.feature .icon { color: var(--accent); width: 26px; height: 26px; margin-bottom: 12px; }
.feature h3 { margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.more-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; margin-top: 18px; }
.more-link .icon { transition: transform 0.18s ease; }
.more-link:hover .icon { transform: translateX(3px); }

/* ---------- Test page ---------- */

.test-layout { display: grid; gap: 28px; max-width: 50rem; }
.test-intro h1 { margin-top: 0; }
.start { margin-top: 26px; padding: 22px; }
.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 22px;
  font-size: 0.9rem;
  color: var(--muted);
}
.consent input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); }
.consent strong { color: var(--ink); }

/* Progress: a diagnostic run log. Each step is a node on a vertical line; the
   state comes from data-state, set by test.js. */
.progress { overflow: hidden; }
.steps { list-style: none; margin: 0; padding: 18px 18px 8px; position: relative; max-width: none; }
.steps::before {
  content: "";
  position: absolute;
  left: 36px;
  top: 34px;
  bottom: 34px;
  width: 2px;
  background: var(--line);
}
.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  padding: 10px 0 16px 48px;
  min-height: 52px;
}
.steps li::before { /* node */
  content: "";
  position: absolute;
  left: 9px;
  top: 11px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--bg);
}
.steps li::after { /* state tag */
  content: attr(data-state);
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--faint);
}
.steps li[data-state="running"]::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 0 14px var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.steps li[data-state="running"]::after { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.steps li[data-state="done"]::before { border-color: var(--ok); background: var(--ok); }
.steps li[data-state="done"]::after { color: var(--ok); border-color: transparent; background: var(--ok-soft); }
.steps li[data-state="failed"]::before { border-color: var(--bad); background: var(--bg); }
.steps li[data-state="failed"]::after { color: var(--bad); border-color: transparent; background: var(--bad-soft); }
.steps li[data-state="skipped"]::before { border-style: dashed; }
.steps li[data-state="pending"] .step-name { color: var(--muted); }
.step-name { grid-column: 1; display: block; font-weight: 700; }
.step-detail {
  grid-column: 1;
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  min-height: 1.2em;
}
.steps li[data-state="failed"] .step-detail { color: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px transparent, 0 0 18px var(--accent); } }
@media (prefers-reduced-motion: reduce) {
  .steps li[data-state="running"]::before { animation: none; }
}

.problem { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.problem h1, .problem h2 { color: var(--bad); display: flex; align-items: center; gap: 12px; }
.problem-page { max-width: 40rem; margin: 24px auto 0; text-align: left; }

/* ---------- Results ---------- */

.verdict { position: relative; overflow: hidden; }
.verdict::before { /* tone light along the top edge */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
}
.verdict.tone-ok::before { background: var(--ok); box-shadow: 0 0 24px var(--ok); }
.verdict.tone-warn::before { background: var(--warn); box-shadow: 0 0 24px var(--warn); }
.verdict.tone-bad::before { background: var(--bad); box-shadow: 0 0 24px var(--bad); }

.verdict-grid { display: grid; gap: 26px; }
@media (min-width: 820px) {
  .verdict-grid { grid-template-columns: 13rem 1fr; gap: 36px; align-items: start; }
}
.verdict h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 3.8vw, 2.45rem); }

/* Health meter: signal bars plus the score as a readout */
.meter {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
@media (min-width: 820px) {
  .meter { flex-direction: column; align-items: flex-start; }
}
.bars { display: flex; align-items: flex-end; gap: 6px; height: 50px; }
.bar { width: 12px; border-radius: 3px; background: var(--line-strong); }
.bar-1 { height: 25%; } .bar-2 { height: 50%; } .bar-3 { height: 75%; } .bar-4 { height: 100%; }
.tone-ok .bar.on { background: var(--ok); box-shadow: 0 0 12px -2px var(--ok); }
.tone-warn .bar.on { background: var(--warn); box-shadow: 0 0 12px -2px var(--warn); }
.tone-bad .bar.on { background: var(--bad); box-shadow: 0 0 12px -2px var(--bad); }
.meter-text { color: var(--muted); font-size: 0.9rem; line-height: 1.3; }
.meter-text strong {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 4px;
}
.tone-ok .meter-text strong { color: var(--ok); }
.tone-warn .meter-text strong { color: var(--warn); }
.tone-bad .meter-text strong { color: var(--bad); }
.meter-none { color: var(--muted); padding: 18px 20px; border-radius: 12px; border: 1px dashed var(--line-strong); margin: 0; }

.confidence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 16px;
}
.explanation { font-size: 1.08rem; }
.learn-more { font-weight: 700; }

.measured { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.measured h2 { font-size: 0.78rem; font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin: 0 0 12px; }

.evidence { list-style: none; margin: 0; padding: 0; max-width: none; }
.evidence li {
  position: relative;
  padding: 10px 14px 10px 30px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.96rem;
}
.evidence li::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 1.05em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

/* Numbered fix steps */
.try-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; max-width: 46rem; }
.try-steps li {
  counter-increment: step;
  position: relative;
  padding: 2px 0 18px 50px;
  min-height: 34px;
}
.try-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
}
.try-steps li:last-child { padding-bottom: 0; }

/* Other findings: expandable cards with a severity light */
.finding-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: none; }
.finding {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--faint);
  border-radius: 12px;
}
.sev-major { border-left-color: var(--bad); }
.sev-moderate, .sev-minor { border-left-color: var(--warn); }
.finding summary {
  cursor: pointer;
  padding: 16px 48px 16px 18px;
  position: relative;
  list-style: none;
}
.finding summary::-webkit-details-marker { display: none; }
.finding summary::after { /* chevron */
  content: "";
  position: absolute;
  right: 20px;
  top: 24px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.finding details[open] summary::after { transform: rotate(-135deg); top: 28px; }
.finding-title { display: block; font-weight: 700; }
.finding-meta { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.finding details > :not(summary) { margin-left: 18px; margin-right: 18px; }
.finding details[open] { padding-bottom: 18px; }
.finding details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.finding .evidence li { background: var(--surface); }

.notes ul { margin: 0; padding-left: 20px; }
.notes li { margin-bottom: 8px; }
.notes li::marker { color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 34px 0; }

.results-grid { display: grid; gap: 0 22px; }
@media (min-width: 980px) {
  .results-grid { grid-template-columns: 1fr 1fr; }
  .results-grid > .span { grid-column: 1 / -1; }
}

/* Before/after and device comparison tables */
.table-wrap { overflow-x: auto; margin: 8px 0 14px; border: 1px solid var(--line); border-radius: 12px; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.compare-table th, .compare-table td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
}
.compare-table tbody tr:last-child > * { border-bottom: 0; }
.compare-table td { font-family: var(--mono); font-size: 0.88rem; }
.compare-table thead th {
  color: var(--faint);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--surface-2);
}
.compare-table tbody th { font-weight: 600; }
.compare-table tbody tr:hover { background: var(--surface-2); }
.change-better td:last-child { color: var(--ok); font-weight: 700; }
.change-worse td:last-child { color: var(--bad); font-weight: 700; }
.change-better { background: linear-gradient(90deg, var(--ok-soft), transparent 60%); }
.change-worse { background: linear-gradient(90deg, var(--bad-soft), transparent 60%); }
.change-word {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 6px;
}

/* Second device: QR + code */
.join-box {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  margin: 8px 0 22px;
}
.qr { margin: 0; padding: 14px; background: #ffffff; border-radius: 14px; box-shadow: var(--glow); }
.qr svg { display: block; border-radius: 4px; }
.qr figcaption { color: #4a5d6c; font-size: 0.8rem; margin-top: 8px; text-align: center; }
.join-code { flex: 1 1 15rem; }
.code {
  display: inline-block;
  font-family: var(--mono);
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 6px 0 10px;
  padding: 8px 18px;
  border-radius: 12px;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--accent-line);
  text-shadow: 0 0 18px rgba(61, 214, 208, 0.4);
}
.wait-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--accent);
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.wait-status::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .wait-status::before { animation: none; } }

.join-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 8px 0 18px; }
.join-form label { width: 100%; font-weight: 700; }

input[type="text"], input:not([type]), .join-form input {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 12px 14px;
}
input[type="text"]:focus, .join-form input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.join-form input {
  font-family: var(--mono);
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  width: 9em;
}
.field-error { color: var(--bad); font-weight: 700; }
.second-device form { margin-top: 4px; }

/* Save or share */
.share-links { display: grid; gap: 12px; margin-bottom: 18px; }
.share label { display: block; font-weight: 700; margin: 18px 0 8px; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; max-width: 44rem; }
.share-row input { flex: 1 1 14rem; min-width: 0; font-family: var(--mono); font-size: 0.84rem; }
.download {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  max-width: 44rem;
}
.download .icon { color: var(--accent); width: 28px; height: 28px; }
.download p { margin: 0; }

/* Technical details: an instrument readout */
.technical { margin-top: 8px; }
.technical > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  font-weight: 700;
  list-style: none;
}
.technical > summary::-webkit-details-marker { display: none; }
.technical > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
.technical[open] > summary::before { transform: rotate(45deg); }
.technical-body { padding: 0 22px 22px; }
.technical h3 {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 22px 0 8px;
}
.tech-table { margin: 0; max-width: none; }
.tech-table div {
  display: grid;
  grid-template-columns: minmax(9rem, 42%) 1fr;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.tech-table dt { color: var(--muted); }
.tech-table dd { margin: 0; font-family: var(--mono); font-size: 0.86rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Stat tiles: the same dl, laid out as readouts (provider pages, share page) */
.stat-tiles {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  margin: 8px 0 20px;
  max-width: none;
}
.stat-tiles div {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.stat-tiles dt { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.stat-tiles dd { margin: 8px 0 0; font-family: var(--mono); font-size: 1.45rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }

/* Product suggestions (affiliate): clearly secondary to the free fixes */
.offer-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; max-width: 46rem; }
.offer-list li { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.offer-list p { margin: 0 0 6px; }
.offer-title { font-weight: 700; }

/* ---------- Long-form pages (guides, providers, privacy) ---------- */

.article { max-width: 46rem; margin: 0 auto; }
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb::before { content: "<"; color: var(--accent); }

.prose h2 { margin-top: 44px; }
.prose h3 { font-size: 1.08rem; margin-top: 30px; }
.prose li { margin-bottom: 8px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li::marker { color: var(--accent); }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 24px;
  font-size: 0.94rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: table;
}
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th {
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose blockquote {
  margin: 18px 0;
  padding: 6px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
  max-width: var(--text);
}
.prose blockquote p { margin: 10px 0; }
.prose code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }

/* Guides: the short answer and the call to test */
.short-answer, .guide-cta {
  position: relative;
  padding: 24px 24px 22px;
  margin: 24px 0 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
  border: 1px solid var(--accent-line);
  box-shadow: var(--glow);
  max-width: none;
}
.short-answer h2, .guide-cta h2 { margin: 0 0 10px; font-size: 1.05rem; color: var(--accent); }
.short-answer p:first-of-type { font-size: 1.08rem; }
.short-answer .button, .guide-cta .button { margin: 6px 0 12px; }
.short-answer .muted, .guide-cta .muted { margin: 0; }
.guide-cta { margin-top: 48px; }
.related { max-width: var(--wide); margin: 64px auto 0; }

