:root {
  color-scheme: light;
  --bg: #f3f8f8;
  --surface: #ffffff;
  --ink: #183139;
  --muted: #52676b;
  --accent: #126f68;
  --soft: #e7f3f1;
  --line: #cadbdc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main {
  max-width: 560px;
  margin-inline: auto;
  padding: max(32px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}
h1 { margin: 0; font-size: clamp(1.5rem, 5.8vw, 2rem); line-height: 1.25; text-wrap: balance; }
h2 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.4; }
p { margin: 0; line-height: 1.6; }
.intro { margin-top: 12px; font-size: 1.05rem; }
.scope { margin: 12px 0 24px; color: var(--muted); font-size: .82rem; }
.experiment { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.method-label { display: block; margin-bottom: 8px; font-size: .9rem; font-weight: 650; }
.method-note { margin-top: 10px; color: var(--muted); font-size: .875rem; }
button, select { font: inherit; }
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
}
.count-display { margin: 28px 0 20px; text-align: center; }
.count-label { color: var(--muted); font-size: .85rem; }
.digits { display: flex; justify-content: center; align-items: baseline; margin: 4px 0 12px; font-size: clamp(4rem, 15vw, 5rem); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--accent); }
.percent { font-size: .35em; margin-left: 4px; font-weight: 500; }
progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden; background: var(--soft); accent-color: var(--accent); direction: ltr; }
progress::-webkit-progress-bar { background: var(--soft); border-radius: 8px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 8px; }
.phase { min-height: 26px; margin-bottom: 12px; font-size: .9rem; text-align: center; font-weight: 600; }
button {
  min-height: 48px;
  border-radius: 9px;
  padding: 11px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:active:not(:disabled) { opacity: .8; }
.primary { display: block; width: 100%; color: #fff; background: var(--accent); font-weight: 650; }
.seed-start { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 9px; background: var(--soft); color: var(--accent); font-weight: 650; cursor: pointer; }
.seed-start[aria-disabled="true"] { opacity: .5; cursor: default; }
.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.stop { display: block; width: 100%; margin-top: 8px; }
button:disabled, select:disabled { opacity: .5; cursor: default; }
.instruction { margin: 14px 0 24px; font-size: .85rem; color: var(--muted); }
.probe-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.probe-label { font-size: .9rem; font-weight: 600; }
.probe-row p { margin-top: 3px; font-size: .8rem; color: var(--muted); }
.native-switch {
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--accent);
  flex-shrink: 0;
  margin: 8px 0;
  width: 64px;
  height: 34px;
  touch-action: none;
}
#probe-switch { pointer-events: none; }
#probe-label { position: absolute; width: 1px; height: 1px; overflow: hidden; pointer-events: none; }
.summary { margin-top: 16px; color: var(--muted); font-size: .85rem; }
.summary:empty { display: none; }
fieldset { margin: 24px 0 0; border: 0; border-top: 1px solid var(--line); padding: 16px 0 0; min-width: 0; }
fieldset[hidden] { display: none; }
legend { padding: 0 0 8px; font-size: .95rem; font-weight: 650; }
.answers { display: grid; gap: 8px; }
.answers button { width: 100%; border-color: var(--line); background: var(--surface); color: var(--ink); font-size: .9rem; }
.answers button[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); color: var(--accent); font-weight: 650; }
#answer-status { margin-top: 12px; font-size: .85rem; color: var(--muted); }
.copy { margin-top: 12px; width: 100%; background: var(--soft); color: var(--accent); font-size: .9rem; }
.comparison { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.comparison p, .note { color: var(--muted); font-size: .9rem; }
.note { margin: 20px 0; }
details { border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; padding: 10px 0; font-size: .9rem; font-weight: 600; }
details p { font-size: .85rem; color: var(--muted); margin: 6px 0 12px; }
pre { max-height: 300px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: .72rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border: 1px solid var(--line); padding: 12px; border-radius: 8px; }
footer { padding-top: 24px; color: var(--muted); font-size: .78rem; text-align: center; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
::selection { background: #c5e9e3; color: var(--ink); }
* { scrollbar-color: var(--line) var(--bg); scrollbar-width: thin; }
@media (hover: hover) {
  .primary:hover:not(:disabled) { background: #0d5d57; }
  .secondary:hover:not(:disabled), .answers button:hover { background: var(--soft); }
}
@media (max-width: 359px) {
  main { padding-inline: 14px; }
  .experiment { padding: 18px; }
}
