:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1c2321;
  --muted: #6b7671;
  --line: #e2e0d8;
  --accent: #1f6f5c;
  --accent-soft: #e8f2ee;
  --accent-ink: #12463a;
  --danger: #b4402f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28,35,33,.05), 0 8px 24px rgba(28,35,33,.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

.wrap { max-width: 720px; margin: 0 auto; padding: 32px 20px 80px; }
.wrap--wide { max-width: 1100px; }

header.hero { margin-bottom: 24px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 8px; }
h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; }
.intro p { color: var(--muted); margin: 0 0 10px; }

.progress { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 0; margin-bottom: 8px; }
.progress__bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress__fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.progress__label { font-size: 13px; color: var(--muted); margin-top: 8px; display: flex; justify-content: space-between; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin: 0 0 4px; }
.section-heading { font-size: 22px; margin: 0 0 20px; letter-spacing: -.01em; }

.q { padding: 20px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; padding-top: 0; }
.q__label { font-weight: 600; margin: 0 0 4px; display: block; }
.q__label .req { color: var(--danger); }
.q__help { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.q__error { color: var(--danger); font-size: 13px; margin-top: 8px; display: none; }
.q.has-error .q__error { display: block; }
.q.has-error .opt, .q.has-error input[type=text], .q.has-error textarea { border-color: var(--danger); }

.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
  cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s;
}
.opt:hover { border-color: #c9cec9; background: #fcfcfa; }
.opt input { margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.opt.is-checked { border-color: var(--accent); background: var(--accent-soft); }
.opt.is-disabled { opacity: .45; }
.opt span { flex: 1; }

input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; font: inherit; color: inherit; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 110px; resize: vertical; }
.specify { margin: 8px 0 0 30px; max-width: 420px; }

.grid-scroll { overflow-x: auto; margin-top: 12px; }
table.grid { width: 100%; border-collapse: collapse; min-width: 460px; font-size: 14px; }
table.grid th { font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px; text-align: center; }
table.grid th:first-child { text-align: left; width: 46%; }
table.grid td { padding: 9px 6px; text-align: center; border-top: 1px solid var(--line); }
table.grid td:first-child { text-align: left; }
table.grid input { accent-color: var(--accent); width: 18px; height: 18px; }
.grid-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }

.actions { display: flex; gap: 12px; align-items: center; margin-top: 28px; }
button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px;
  padding: 12px 22px; border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #c9cec9; }
.spacer { flex: 1; }

.email-block { background: var(--accent-soft); border: 1px solid #cfe3db; border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.email-block label { font-weight: 600; display: block; margin-bottom: 4px; }
.email-block p { font-size: 13px; color: var(--accent-ink); margin: 0 0 12px; opacity: .85; }

.banner { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; display: none; }
.banner.error { background: #fdecea; border: 1px solid #f3c9c2; color: var(--danger); display: block; }
.done { text-align: center; padding: 56px 24px; }
.done .big { font-size: 44px; }
.footer-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 24px; }

/* ---------- Admin ---------- */
.login { max-width: 380px; margin: 12vh auto; }
.login h1 { font-size: 22px; }
.admin-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-bar h1 { margin: 0; font-size: 24px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .n { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.kpi .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 4px; font-size: 16px; }
.panel .meta { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.bar-row { margin-bottom: 10px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 4px; }
.bar-row .top .v { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar-fill.warm { background: #c9703f; }
.texts { list-style: none; padding: 0; margin: 8px 0 0; }
.texts li { border-left: 3px solid var(--accent-soft); padding: 6px 0 6px 12px; margin-bottom: 8px; font-size: 14px; }
.texts .who { display: block; font-size: 12px; color: var(--muted); }
.chip { display: inline-block; background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
table.data td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
.sparkline { display: flex; align-items: flex-end; gap: 3px; height: 60px; margin-top: 12px; }
.sparkline div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 40px 0; }
.link-btn { background: none; border: 0; color: var(--danger); font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline; }
