:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1f2420;
  --muted: #5d655f;
  --line: #dcd8cf;
  --accent: #2f6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e2efe7;
  --focus: #b4541a;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151816;
    --surface: #1e2320;
    --ink: #eef1ee;
    --muted: #a6b0a9;
    --line: #333a35;
    --accent: #7cc6a0;
    --accent-ink: #0f1a14;
    --accent-soft: #23362b;
    --focus: #f2a46b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; max-width: 880px; margin: 0 auto; }
.brand { font-weight: 650; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: inline-block; }
.top-actions { display: flex; gap: 6px; }

main { max-width: 720px; margin: 0 auto; padding: 16px 24px 64px; outline: none; }
.screen { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.15; letter-spacing: -0.02em; margin: 24px 0 10px; }
.lede { color: var(--muted); margin: 0 0 22px; }
textarea {
  width: 100%; padding: 16px 18px; border-radius: var(--radius); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; resize: vertical; min-height: 200px;
}
textarea:focus { border-color: var(--accent); }

.choices { border: 0; padding: 0; margin: 22px 0 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg span {
  display: inline-block; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; min-width: 84px; text-align: center;
}
.seg input:checked + span { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

button {
  font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px 18px; cursor: pointer; min-height: 48px;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:hover { filter: brightness(1.06); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 8px 12px; min-height: 40px; }
button.ghost:hover { color: var(--ink); border-color: var(--line); }
#btn-start { margin-top: 28px; width: 100%; padding: 16px; font-size: 19px; }
kbd {
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 6px; border-radius: 5px;
  border: 1px solid currentColor; opacity: .7; margin-left: 4px; vertical-align: 2px;
}
.hint { color: var(--focus); min-height: 1.5em; }

.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 650; color: var(--accent); margin: 32px 0 0; }
.step { font-size: clamp(30px, 5.4vw, 46px); outline: none; margin-top: 12px; }
.why { color: var(--muted); margin: 0 0 24px; }

.timer { position: relative; width: 120px; height: 120px; margin: 8px 0 24px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: var(--line); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
#timer-text { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 22px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions.minor { margin-top: 12px; gap: 4px; }
.actions .primary { min-width: 140px; }

.peek { margin-top: 24px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 8px 20px 12px; }
.peek h2 { font-size: 16px; color: var(--muted); }
.peek li { margin: 4px 0; }
.peek li.current { font-weight: 650; color: var(--accent); }
.peek li.done { text-decoration: line-through; color: var(--muted); }

.progress { height: 6px; background: var(--line); border-radius: 99px; margin-top: 40px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .5s ease; }
.progress-label { color: var(--muted); font-size: 15px; margin-top: 8px; }

.done-list { padding-left: 0; list-style: none; }
.done-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.done-list li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 10px; }
#btn-again { margin-top: 24px; }

h1[tabindex="-1"]:focus { outline: none; }
dialog { border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 8px 28px 24px; max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: rgb(0 0 0 / .35); }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; align-items: center; }
.keys dd { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 520px) {
  .top { padding: 14px 16px; }
  main { padding: 8px 16px 48px; }
  .actions button { flex: 1 1 100%; }
  #btn-help kbd, .actions kbd, #btn-start kbd { display: none; }
}
