:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --ink: #1d1c1a;
  --ink-2: #55534d;
  --ink-3: #8a877f;
  --line: #dedad0;
  --accent: #1f6f68;
  --accent-ink: #ffffff;
  --accent-soft: #e2efec;
  --danger: #b3261e;
  --ok: #1d7a3a;
  --warn: #9a6400;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514; --surface: #1f1f1d; --surface-2: #2a2a27; --ink: #f3f1ea; --ink-2: #c3c1b8; --ink-3: #8f8d85;
    --line: #36352f; --accent: #5fb3a9; --accent-ink: #0d1f1d; --accent-soft: #1d302d; --danger: #f2837a; --ok: #6cc98a; --warn: #e2b04a;
    --series-1: #3987e5; --series-2: #d95926; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151514; --surface: #1f1f1d; --surface-2: #2a2a27; --ink: #f3f1ea; --ink-2: #c3c1b8; --ink-3: #8f8d85;
  --line: #36352f; --accent: #5fb3a9; --accent-ink: #0d1f1d; --accent-soft: #1d302d; --danger: #f2837a; --ok: #6cc98a; --warn: #e2b04a;
  --series-1: #3987e5; --series-2: #d95926; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; line-height: 1.25; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }

.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.wide { max-width: 1180px; }

.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.topbar.wide .inner { max-width: 1180px; }
.topbar .brand { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: 1rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 4px; background: var(--surface-2); }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.section-head { margin: 8px 0 18px; }
.section-head p { color: var(--ink-2); }
.eyebrow { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 6px; }

.q { margin-bottom: 14px; }
.q-label { font-weight: 600; margin-bottom: 4px; display: block; }
.q-label .num { color: var(--ink-3); font-weight: 500; margin-right: 6px; }
.q-label .req { color: var(--danger); margin-left: 2px; }
.q-help { color: var(--ink-2); font-size: .92rem; margin-bottom: 10px; }
.q.invalid { border-color: var(--danger); }
.q .err { color: var(--danger); font-size: .9rem; margin-top: 8px; display: none; }
.q.invalid .err { display: block; }

.options { display: grid; gap: 8px; margin-top: 10px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; min-height: 44px; }
.opt:hover { border-color: var(--accent); }
.opt input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (min-width: 720px) {
  .options.likert { grid-template-columns: repeat(var(--n), 1fr); gap: 6px; }
  .options.likert .opt { flex-direction: column; justify-content: flex-start; text-align: center; padding: 10px 6px; font-size: .86rem; line-height: 1.3; gap: 8px; }
}

.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 10px; }
.scale label { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label:has(input:checked) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scale label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; color: var(--ink-2); font-size: .85rem; margin-top: 6px; gap: 12px; }

input[type=text], input[type=email], input[type=number], input[type=password], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.other-input { margin-top: 8px; }

.nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 22px; }
.btn { font: inherit; font-weight: 600; border-radius: 10px; padding: 11px 20px; min-height: 44px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .9rem; }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: .92rem; }
.notice.error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.center { text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
footer.foot { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; color: var(--ink-3); font-size: .82rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer.foot a { color: var(--ink-3); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 8px auto 16px; }
