:root {
  --bg: #f7efe1;
  --surface: #fffaf1;
  --surface-2: #f1e4cc;
  --ink: #2a1e14;
  --muted: #6e5a46;
  --line: #e2d0b2;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fde6d6;
  --stool: #b91c1c;
  --calm: #1f5e4a;
  --calm-soft: #dcefe6;
  --focus: #2563eb;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(42 30 20 / 6%), 0 8px 24px rgb(42 30 20 / 8%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a140f;
    --surface: #241c15;
    --surface-2: #2f251c;
    --ink: #f4e9d8;
    --muted: #bba78f;
    --line: #3d3127;
    --accent: #f97316;
    --accent-ink: #1a140f;
    --accent-soft: #3a2416;
    --stool: #f87171;
    --calm: #6ee7b7;
    --calm-soft: #17332a;
    --focus: #93c5fd;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100dvh; background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }

.demo-bar {
  font-size: 12px; text-align: center; padding: 6px 16px;
  background: var(--ink); color: var(--bg); letter-spacing: .02em;
}

.shell { max-width: 520px; margin: 0 auto; padding: 20px 16px 48px; }

h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: clamp(26px, 7vw, 34px); letter-spacing: -.01em; }
h2 { font-size: 24px; }
h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[tabindex="-1"]:focus { outline: none; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 28px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); font-size: 22px;
}

.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 24px; }
.muted { color: var(--muted); }
.mt { margin-top: 20px; }
.small { font-size: 14px; }

.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 650;
  min-height: 52px; padding: 14px 20px; border-radius: 14px; width: 100%;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-calm { background: var(--calm); color: #fff; }
.link-btn { appearance: none; background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }

.hero { display: grid; gap: 14px; margin-bottom: 28px; }
.hero .lead { font-size: 18px; color: var(--muted); }
.fineprint { font-size: 13px; color: var(--muted); }

.progress { display: grid; gap: 8px; margin-bottom: 20px; }
.progress-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.track { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.track > span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transition: transform .25s ease; }

.q-title { font-size: 22px; font-weight: 700; }
.q-note { color: var(--muted); margin-top: 6px; }
.q-serious .q-note { color: var(--calm); font-weight: 600; }

.options { display: grid; gap: 10px; margin-top: 20px; }
.option {
  appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1.5px solid var(--line);
  transition: transform .12s ease, border-color .12s ease;
}
.option:active { transform: scale(.99); }
.option[aria-pressed="true"], .option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.q-serious .option[aria-checked="true"] { border-color: var(--calm); background: var(--calm-soft); }
.box {
  flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 14px; font-weight: 800; color: transparent;
}
.option[aria-checked="true"] .box { border-color: currentColor; color: inherit; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; perspective: 900px; }
.card {
  appearance: none; border: 0; padding: 0; cursor: pointer; background: none; font: inherit; color: inherit;
  aspect-ratio: 3 / 4.4; position: relative;
}
.card-inner { position: absolute; inset: 0; transition: transform .5s ease; transform-style: preserve-3d; }
.card.flipped .card-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden;
  display: grid; place-items: center; text-align: center; padding: 10px; box-shadow: var(--shadow);
}
.card-back {
  background: repeating-linear-gradient(45deg, var(--stool) 0 10px, color-mix(in srgb, var(--stool) 82%, #000) 10px 20px);
  color: #fff; font-size: 30px; border: 3px solid var(--surface);
}
.card-front { background: var(--surface); border: 2px solid var(--accent); transform: rotateY(180deg); font-size: 13px; font-weight: 700; }
.card-front .icon { font-size: 30px; display: block; margin-bottom: 6px; }
.card.dim { opacity: .35; transition: opacity .3s ease; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel-calm { background: var(--calm-soft); border-color: transparent; box-shadow: none; }
.panel-legal { background: var(--surface-2); border-color: transparent; box-shadow: none; font-size: 14px; }

.result-head { display: grid; gap: 6px; }
.badge { justify-self: start; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.badge.calm { background: var(--calm-soft); color: var(--calm); }
.say { font-size: 20px; font-weight: 650; line-height: 1.4; }
.say::before { content: "“"; color: var(--accent); }
.say::after { content: "”"; color: var(--accent); }
.drawn { display: flex; gap: 12px; align-items: center; }
.drawn .icon { font-size: 28px; flex: none; }

ol.actions { margin: 0; padding-left: 22px; display: grid; gap: 8px; }

.vote { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vote .btn { min-height: 46px; padding: 10px; }
.vote .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.help-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.help-links a { color: var(--calm); font-weight: 650; }

footer.foot { margin-top: 32px; font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
footer.foot a { color: inherit; }

.toast { font-size: 14px; color: var(--calm); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
