:root {
  color-scheme: light dark;
  --bg: #f4efe6;
  --ink: #14110d;
  --muted: #6b6258;
  --line: #e0d6c8;
  --surface: #fffaf3;
  --accent: #ff4d1c;
  --accent-dark: #d1320a;
  --good: #1f8a57;
  --radius: 16px;
  --shadow: 0 10px 0 rgba(20, 17, 13, .08);
  --ease: cubic-bezier(.2, .85, .25, 1);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 420px at 8% -10%, #ffe2c4 0%, transparent 58%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 ui-rounded, "Segoe UI", system-ui, sans-serif;
}
button, a, summary, input, output, legend { font: inherit; }
button { min-height: 44px; }
.site-head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand tests" "status tests";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  grid-area: brand;
  color: inherit;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.origin-state {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c08a28;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent);
}
.dot.online { background: var(--good); animation: pulse 1.6s var(--ease) infinite; }
.dot.offline { background: #b43d3d; }
.menu-button, .icon-button, .secondary, .chip {
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background-color .14s;
}
.menu-button { grid-area: tests; }
.center-stage, .run-stage {
  min-height: calc(100dvh - 68px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: min(680px, calc(100% - 32px));
  margin: auto;
  padding: 12px 0 20px;
}
.signal-mark {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 26px;
  margin-bottom: 12px;
}
.signal-mark i {
  display: block;
  width: 7px;
  border-radius: 6px;
  background: var(--accent);
  transform-origin: bottom;
  animation: signal-pop .55s var(--ease) both;
}
.signal-mark i:nth-child(1) { height: 9px; }
.signal-mark i:nth-child(2) { height: 17px; animation-delay: .06s; }
.signal-mark i:nth-child(3) { height: 26px; animation-delay: .12s; }
h1 {
  font-size: clamp(30px, 7.4vw, 50px);
  line-height: .98;
  letter-spacing: -.055em;
  margin: 0 0 10px;
  max-width: 14ch;
}
.lede {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 36ch;
}
.size-picker {
  width: min(100%, 560px);
  margin: 0 0 18px;
  padding: 14px;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.size-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 0;
  font-weight: 800;
}
.size-heading output {
  color: var(--accent-dark);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.size-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 10px;
}
.chip {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  box-shadow: 0 2px 0 var(--ink);
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked),
.chip.is-on {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.size-picker input[type=range] {
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.size-picker input[type=range]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 0%), #efe4d4 var(--fill, 0%));
}
.size-picker input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 0 var(--ink);
  transition: transform .14s var(--ease);
}
.size-picker input[type=range]:active::-webkit-slider-thumb { transform: scale(1.16); }
.size-picker input[type=range]::-moz-range-track {
  height: 8px;
  border: 0;
  border-radius: 99px;
  background: #efe4d4;
}
.size-picker input[type=range]::-moz-range-progress {
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
}
.size-picker input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}
.size-picker p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.primary {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 13px 22px;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background-color .14s;
}
.primary:hover, .menu-button:hover, .secondary:hover, .chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink);
}
.primary:active, .menu-button:active, .secondary:active, .chip:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--ink);
}
.estimate, .last-result {
  font-size: 14px;
  color: var(--muted);
  margin: 12px 0 0;
}
.last-result { padding-top: 10px; border-top: 1px solid var(--line); }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 3px;
}
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 13, .42);
  z-index: 5;
  animation: fade-in .16s var(--ease);
}
.test-menu {
  position: fixed;
  z-index: 6;
  right: 12px;
  top: 12px;
  bottom: 12px;
  width: min(390px, calc(100% - 24px));
  overflow: auto;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 14px 0 rgba(20, 17, 13, .12);
  padding: 16px;
  animation: sheet-in .2s var(--ease);
}
.menu-head {
  position: sticky;
  top: -16px;
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 10px;
  z-index: 1;
}
.menu-head h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.icon-button { width: 44px; padding: 0; font-size: 26px; }
.menu-list { display: grid; gap: 6px; }
.menu-list > button, .menu-list details button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
}
.menu-list button:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.menu-list strong, .menu-list span { display: block; }
.menu-list span { font-size: 13px; color: var(--muted); font-weight: 550; }
.menu-list hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 6px 0; }
.menu-list summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}
.run-copy { width: 100%; animation: stage-in .18s var(--ease) both; }
.phase-label {
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 10px;
}
.run-copy h1 { font-size: clamp(28px, 7vw, 44px); max-width: none; }
progress {
  appearance: none;
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: #efe4d4;
  margin: 16px 0;
}
progress::-webkit-progress-bar { background: #efe4d4; }
progress::-webkit-progress-value { background: var(--accent); transition: width .14s var(--ease); }
progress::-moz-progress-bar { background: var(--accent); }
.live-number {
  font-size: clamp(28px, 7vw, 46px);
  font-weight: 800;
  letter-spacing: -.04em;
  margin: 10px 0 0;
  min-height: 1.4em;
}
.run-note { color: var(--muted); min-height: 1.4em; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
}
.metric {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 14px;
}
.metric span, .metric small { display: block; }
.metric span { font-size: 22px; font-weight: 800; }
.metric small { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.disclosures { margin-top: 18px; width: 100%; }
.disclosures details { border-top: 1px solid var(--line); padding: 12px 0; }
.disclosures summary { cursor: pointer; font-weight: 750; }
.external-links { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 0; }
.external-links a { color: var(--accent-dark); }
.share-link { word-break: break-all; color: var(--accent-dark); }
body.menu-open { overflow: hidden; }
[hidden] { display: none !important; }
@keyframes signal-pop { from { transform: scaleY(.12); opacity: .15; } to { transform: scaleY(1); opacity: 1; } }
@keyframes stage-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.25); } }
@media (min-width: 720px) {
  .site-head {
    height: 76px;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand status tests";
    padding: 0 36px;
  }
  .origin-state { justify-self: start; margin-left: 16px; }
}
@media (max-width: 520px) {
  .center-stage, .run-stage { min-height: calc(100dvh - 74px); padding: 16px 0 24px; }
  .lede { margin-bottom: 14px; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .test-menu {
    inset: auto 0 0;
    width: 100%;
    max-height: 90dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110f;
    --ink: #f6efe6;
    --muted: #b5aa9d;
    --line: #3a322b;
    --surface: #1d1915;
    --accent: #ff6336;
    --accent-dark: #ff8a66;
    --good: #4fce91;
    --shadow: 0 10px 0 rgba(0, 0, 0, .28);
  }
  html, body {
    background:
      radial-gradient(1000px 360px at 10% -12%, #3a1c12 0%, transparent 58%),
      var(--bg);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
