:root {
  --bg: #fbfaf7; --fg: #1d1d1b; --muted: #6b6a64; --line: #d9d6cc; --card: #ffffff;
  --accent: #1e6f8c; --accent-soft: #e3eff3; --cross: #c8402e; --shape: #f1efe8;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --fg: #ecebe6; --muted: #9c9a92; --line: #3a3935; --card: #1f1f1d;
          --accent: #6fb6cf; --accent-soft: #1e3038; --cross: #ec7a66; --shape: #262623; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 17px/1.6 'Source Serif 4', Georgia, serif; }
button, .ui, .bar, .progress, .legend, .group, .muted.small { font-family: Inter, system-ui, sans-serif; }
.bar { display: flex; gap: 1rem; align-items: center; padding: .7rem 1.25rem; border-bottom: 1px solid var(--line);
       font-size: .9rem; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.brand { font-weight: 600; letter-spacing: .02em; color: inherit; text-decoration: none; }
#who { color: var(--muted); flex: 1; }
main { max-width: 46rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
h1 { font-size: 2rem; font-weight: 600; margin: .2rem 0 1.2rem; }
h2 { font-size: 1.5rem; font-weight: 600; margin: .2rem 0 1rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.refs { font-size: .9rem; color: var(--muted); padding-left: 1.2rem; }
.refs li { margin-bottom: .3rem; }
button { font-size: .95rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
         color: var(--fg); padding: .55rem 1.1rem; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: .45; cursor: default; }
button.link { border: none; background: none; color: var(--accent); padding: .2rem .4rem; }
button.chosen { background: var(--accent-soft); border-color: var(--accent); }
.actions { display: flex; gap: .6rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.progress { font-size: .85rem; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: .4rem; }
.progress-track { height: 4px; background: var(--line); border-radius: 2px; margin-bottom: 1.6rem; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .2s; }
.group { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .5rem; }
.indicator { font-size: 1.3rem; line-height: 1.45; margin: 0 0 1.4rem; height: 5.8em; overflow: hidden; }
@media (max-width: 600px) { .indicator { height: 8.7em; } }
.instruction { font-size: .95rem; color: var(--muted); margin-bottom: 1rem; }
.stage { display: flex; justify-content: center; }
svg.shape { width: 100%; max-width: 30rem; touch-action: none; user-select: none; cursor: crosshair; }
svg.shape .area { fill: var(--shape); stroke: var(--line); stroke-width: 2; }
svg.shape .centre { fill: var(--muted); opacity: .5; }
svg.shape .corner { fill: var(--fg); font: 600 14px Inter, system-ui, sans-serif; }
svg.shape .cross { stroke: var(--cross); stroke-width: 4; stroke-linecap: round; }
svg.shape.off .area { opacity: .45; }
.legend { display: grid; gap: .6rem; margin-top: 1.2rem; font-size: .88rem; }
.legend b { font-weight: 600; }
.legend div { color: var(--muted); }
.legend div b { color: var(--fg); }
.need { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.overview section { margin-bottom: 2rem; }
.overview ol { padding-left: 1.4rem; }
.overview li { margin-bottom: .35rem; cursor: pointer; }
.overview li.done::marker { color: var(--accent); }
.overview li.todo { color: var(--muted); }
.overview li span.state { font: .75rem Inter, sans-serif; margin-left: .4rem; color: var(--accent); }
.error { color: var(--cross); }
.saved { font-size: .8rem; color: var(--muted); }
.foot { display: flex; justify-content: center; padding: 0 1.25rem 3rem; }
.foot button { color: var(--muted); font-size: .85rem; }
.help { margin-top: 2.2rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.help .instruction { margin: 0 0 .6rem; }
.help .legend { margin-top: 0; }
