:root {
  --bg: #faf8f5; --surface: #ffffff; --ink: #1f2328; --muted: #5d6470; --line: #e4e0da;
  --accent: #3f6f6a; --accent-ink: #ffffff; --soft: #eef4f3;
  --a: #3f6f6a; --b: #b0654a;
  --green: #e7f3ea; --green-line: #6aa77b; --yellow: #fbf3dc; --yellow-line: #d4a62a; --red: #fbe7e4; --red-line: #c9594a;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --surface: #1d2024; --ink: #e8e6e3; --muted: #a2a8b0; --line: #30343a;
    --accent: #7fb3ab; --accent-ink: #0f1a19; --soft: #1f2a29;
    --a: #7fb3ab; --b: #e0957a;
    --green: #1b2a20; --green-line: #6aa77b; --yellow: #2b2616; --yellow-line: #d4a62a; --red: #2e1c1a; --red-line: #d9776a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; }
.top, main, footer { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; padding-bottom: 8px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
main { padding-bottom: 48px; }
footer { padding-bottom: 32px; }
h1 { font-size: 1.9rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0.6em 0 0.3em; }
h2 { font-size: 1.25rem; margin: 1.8em 0 0.5em; }
h3 { font-size: 1.05rem; margin: 0 0 0.4em; }
a { color: var(--accent); }
.lede { font-size: 1.08rem; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--muted); margin: 0.4em 0; }
.fine { font-size: 0.85rem; color: var(--muted); }
.hero h1 { font-size: 2.3rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; }
.card.note { background: var(--soft); }
.card.warn { background: var(--yellow); border-color: var(--yellow-line); }
.zone.green { background: var(--green); border-color: var(--green-line); }
.zone.yellow { background: var(--yellow); border-color: var(--yellow-line); }
.zone.red { background: var(--red); border-color: var(--red-line); }
.zone h2 { margin-top: 0; }
.q { margin: 18px 0; }
.q > p { margin: 0 0 8px; font-weight: 500; }
.pair { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.pair > span { font-size: 0.9rem; color: var(--muted); }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios.stack { flex-direction: column; align-items: stretch; }
.radios.five .chip, .radios.seven .chip { flex: 1 1 0; min-width: 0; text-align: center; }
.radios.seven .chip span { font-size: 0.8rem; }
.radios.eleven .chip { flex: 1 1 0; min-width: 34px; text-align: center; padding: 10px 0; }
.chip { position: relative; display: block; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; user-select: none; font-size: 0.92rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--accent); }
.chip.on { border-color: var(--accent); background: var(--soft); box-shadow: inset 0 0 0 1px var(--accent); }
.chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: block; margin: 16px 0; font-weight: 500; }
.field input, .field textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; }
.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--accent); }
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
button { font: inherit; border-radius: 999px; padding: 11px 22px; cursor: pointer; border: 1px solid transparent; }
button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:disabled { opacity: 0.6; cursor: default; }
button.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
button.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
.err { color: var(--red-line); font-weight: 500; min-height: 1.2em; margin: 16px 0 0; }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.progress div { height: 100%; background: var(--accent); transition: width 0.3s; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 12px; margin: 8px 0; }
.linkbox code { flex: 1; overflow-wrap: anywhere; font-size: 0.8rem; }
.steps { padding-left: 1.2em; margin: 0.4em 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .pair { grid-template-columns: 1fr; } h1 { font-size: 1.6rem; } .hero h1 { font-size: 1.9rem; } }
.t { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.t th, .t td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t th { font-weight: 600; }
.t tr:last-child td { border-bottom: 0; }
.t.goals td:first-child { color: var(--muted); width: 32%; }
.plot { width: 100%; max-width: 320px; }
.plot .bg { fill: var(--surface); stroke: var(--line); }
.plot .mid { stroke: var(--line); stroke-dasharray: 4 4; }
.plot .q { font-size: 9px; fill: var(--muted); }
.plot .ax { font-size: 11px; fill: var(--muted); }
.plot .lbl { font-size: 12px; font-weight: 600; fill: var(--ink); }
.plot .pa { fill: var(--a); } .plot .pb { fill: var(--b); }
.cycle em { color: var(--ink); }
.tag { font-size: 0.72rem; background: var(--soft); color: var(--accent); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }
#analysis h3 { margin-top: 1em; } #analysis h3:first-child { margin-top: 0; }
.progress-row { display: flex; justify-content: space-between; align-items: center; margin: 0.4em 0; }
.progress-row .eyebrow { margin: 0; }
.module-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.module-row.locked { opacity: 0.5; }
.module-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.mod-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mod-actions button { padding: 8px 16px; font-size: 0.9rem; }
.mod-status { background: var(--soft); color: var(--muted); }
.module-row.active .mod-status { color: var(--accent); }
.module-row.done .mod-status { background: var(--green); color: var(--green-line); }
