:root {
  --bg: #fbfaf7;
  --ink: #1d2321;
  --muted: #66706c;
  --line: #e3e1da;
  --accent: #1f6f5c;
  --accent-soft: #e4f1ec;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }

.top { border-bottom: 1px solid var(--line); padding: 14px 20px; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
main { max-width: 860px; margin: 0 auto; padding: 32px 20px 64px; }
.narrow { max-width: 620px; margin: 0 auto; }
h1 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 16px; letter-spacing: -0.015em; }
h2 { font-size: 1.15rem; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { display: block; height: 100%; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; }
.card:hover, .card:focus-visible { border-color: var(--accent); }
.card p { margin: 6px 0 0; }
.card-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.pill { font-size: 0.75rem; padding: 2px 8px; border-radius: 99px; background: #f0eee8; color: var(--muted); white-space: nowrap; }
.pill-done { background: var(--accent-soft); color: var(--accent); }

.checks { padding-left: 20px; }
.checks li { margin-bottom: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.btn { font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 10px 18px; border-radius: var(--radius); cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn:focus-visible, .option:focus-visible, .dot:focus-visible { outline: 3px solid #9cc9bb; outline-offset: 2px; }

.quiz { max-width: 640px; margin: 0 auto; }
.quiz-head { display: flex; justify-content: space-between; font-size: 0.9rem; }
.quiz-head a { text-decoration: none; }
.progress { height: 4px; background: var(--line); border-radius: 4px; margin: 10px 0 28px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); transition: width 0.2s; }
.qnum { margin: 0 0 4px; font-size: 0.875rem; }
.question { font-size: 1.5rem; min-height: 3.75em; }

.options { display: grid; gap: 8px; }
.option { font: inherit; text-align: left; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.option:hover { border-color: var(--accent); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.option kbd { font: 0.75rem ui-monospace, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.dots { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.dot { width: 26px; height: 26px; display: grid; place-items: center; font-size: 0.75rem; border-radius: 50%; text-decoration: none; color: var(--muted); border: 1px solid var(--line); background: #fff; }
.dot.done { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dot.current { border-color: var(--accent); color: var(--ink); font-weight: 700; }
.finish { text-align: center; margin-top: 24px; }

.lead { font-size: 1.15rem; }
.bars { display: grid; gap: 10px; margin: 20px 0; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 12px; }
.bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: #9fb8b0; }
.bar-row.highlight .bar-fill { background: var(--accent); }
.bar-row.highlight .bar-label { font-weight: 700; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.block { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.discuss { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.discuss ol { margin: 8px 0 0; padding-left: 20px; }
.discuss li { margin-bottom: 6px; }
.bar-row { grid-template-columns: 150px 1fr 36px; }
.note { background: var(--accent-soft); padding: 10px 14px; border-radius: var(--radius); }
.error { white-space: pre-wrap; background: #fff3f0; padding: 12px; border-radius: var(--radius); }

@media (max-width: 560px) {
  .question { font-size: 1.25rem; }
  .dots { display: none; }
}
.btn-danger { border-color: #b3261e; color: #b3261e; }
.copy { margin-top: 24px; }
.copy-fallback { display: block; width: 100%; margin-top: 10px; font: 0.875rem/1.4 ui-monospace, monospace; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.copy-fallback[hidden] { display: none; }
