:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f3f1ea;
  --text: #1d1f23;
  --muted: #5d6169;
  --border: #e3e0d6;
  --accent: #e0a100;
  --accent-ink: #1d1f23;
  --accent-soft: #fff4d1;
  --link: #0b5cad;
  --ok: #1d7a46;
  --err: #b3261e;
  --radius: 12px;
  --maxw: 980px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --surface: #1c1f24;
    --surface-2: #23272e;
    --text: #eceae4;
    --muted: #a3a7af;
    --border: #33373f;
    --accent: #f5c542;
    --accent-ink: #14161a;
    --accent-soft: #3a3220;
    --link: #7fb6f2;
    --ok: #5cc88b;
    --err: #f2877f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); }
img { max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Header / nav */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-owner { background: var(--accent-soft); color: var(--text); font-size: 0.88rem; text-align: center; border-bottom: 1px solid var(--border); }
.site-owner .wrap { display: block; padding-top: 6px; padding-bottom: 6px; }
.site-header > .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); }

main { padding: 32px 0 64px; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; padding: 20px 0; }

/* Type */
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 1.45rem; margin: 40px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; margin: 0 0 6px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }

/* Layout pieces */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card p { margin: 0.3em 0 0; }
.card ul { margin: 0.5em 0 0; padding-left: 1.2em; }
.hero { padding: 16px 0 8px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.checklist li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.checklist li::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: 8px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 12px 52px; position: relative; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: 0.85rem; }
.status { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-left: 6px; vertical-align: middle; }
.status.done { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.status.now { background: var(--accent-soft); color: var(--text); }
.placeholder { border: 2px dashed var(--border); border-radius: var(--radius); padding: 20px; color: var(--muted); }

.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

/* Forms */
.survey-section { margin-top: 28px; }
.survey-section > h2 { margin-top: 0; }
.q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.q > label, .q legend { font-weight: 600; display: block; margin-bottom: 4px; padding: 0; }
.q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q .help { color: var(--muted); font-size: 0.92rem; margin: 0 0 8px; }
.req { color: var(--err); margin-left: 2px; }
input[type="text"], textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, textarea:focus-visible, .btn:focus-visible, .nav a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.choice input { margin-top: 5px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.group-name { font-weight: 700; font-size: 0.9rem; margin: 12px 0 2px; color: var(--muted); }
.group-name:first-of-type { margin-top: 4px; }
.notice { border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; border: 1px solid var(--border); background: var(--surface); }
.notice.ok { border-color: var(--ok); }
.notice.err { border-color: var(--err); color: var(--err); }

/* Dashboard */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 0.93rem; }
.bar .track { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar .count { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; }
td { min-width: 140px; max-width: 360px; }
details.resp { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
details.resp summary { cursor: pointer; font-weight: 600; }
details.resp dl { margin: 10px 0 0; }
details.resp dt { font-weight: 600; font-size: 0.9rem; margin-top: 8px; }
details.resp dd { margin: 2px 0 0; color: var(--muted); white-space: pre-wrap; }
