/* txt-poll shared styles: public pages, the poll page and the admin app.
   Colors are tokens on :root; dark mode swaps them. Mobile first. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --ink: #1c2321;
  --ink-2: #4d5753;
  --ink-3: #7a837f;
  --line: #dcd8cd;
  --accent: #0f6b62;
  --accent-ink: #ffffff;
  --accent-soft: #d9ece8;
  --warn: #9a5b00;
  --warn-soft: #fbedd2;
  --danger: #b3261e;
  --danger-soft: #f9dedc;
  --ok: #1e7b34;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 28, .06), 0 6px 24px rgba(20, 30, 28, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111615; --surface: #1a201f; --surface-2: #222a28; --ink: #e9eeec; --ink-2: #b4bfbb; --ink-3: #85908c;
    --line: #2f3936; --accent: #4fc1b3; --accent-ink: #062521; --accent-soft: #173a36; --warn: #f0b85a; --warn-soft: #3a2c12;
    --danger: #f2a39d; --danger-soft: #3d1c1a; --ok: #7fd197; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111615; --surface: #1a201f; --surface-2: #222a28; --ink: #e9eeec; --ink-2: #b4bfbb; --ink-3: #85908c;
  --line: #2f3936; --accent: #4fc1b3; --accent-ink: #062521; --accent-soft: #173a36; --warn: #f0b85a; --warn-soft: #3a2c12;
  --danger: #f2a39d; --danger-soft: #3d1c1a; --ok: #7fd197; 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.55 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 750; }
h2 { font-size: clamp(1.35rem, 4vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
mark.placeholder { background: var(--warn-soft); color: var(--warn); padding: 1px 6px; border-radius: 6px; font-weight: 600; }

/* header / footer */
.site-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.nav a:hover { color: var(--accent); }
.site-foot { border-top: 1px solid var(--line); margin-top: 64px; padding: 28px 0 40px; color: var(--ink-3); font-size: .9rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-foot a { color: var(--ink-2); }

/* hero */
.hero { padding: 56px 0 40px; }
.hero .lede { font-size: clamp(1.05rem, 3vw, 1.25rem); color: var(--ink-2); max-width: 36em; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 820px) { .hero-grid { grid-template-columns: 1.2fr .8fr; } }
.phone-mock { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 18px; box-shadow: var(--shadow); max-width: 320px; margin: 0 auto; width: 100%; }
.bubble { background: var(--surface-2); border-radius: 18px 18px 18px 4px; padding: 12px 14px; font-size: .92rem; margin-bottom: 10px; }
.bubble .lnk { color: var(--accent); text-decoration: underline; white-space: nowrap; }
.mock-q { border: 1px solid var(--line); border-radius: 14px; padding: 12px; font-size: .9rem; }
.mock-q .opt { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }
.mock-q .opt.on { border-color: var(--accent); background: var(--accent-soft); }
.mock-bar { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.mock-bar i { display: block; height: 100%; width: 40%; background: var(--accent); }

.section { padding: 32px 0; }
.cards { display: grid; gap: 16px; }
@media (min-width: 720px) { .cards.three { grid-template-columns: repeat(3, 1fr); } .cards.two { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card .num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 10px; }
.notice { background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; color: var(--ink-2); font-size: .95rem; }
details.faq { border-bottom: 1px solid var(--line); padding: 14px 0; }
details.faq summary { cursor: pointer; font-weight: 650; }
details.faq p { margin: 8px 0 0; color: var(--ink-2); }
.prose h2 { margin-top: 1.6em; font-size: 1.3rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }

/* forms and buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.plain { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
label { display: block; font-weight: 600; margin: 0 0 6px; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .choice:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 1px; }
.field { margin-bottom: 16px; }
.err { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: 10px; }
.okmsg { color: var(--ok); background: var(--accent-soft); padding: 10px 12px; border-radius: 10px; }

/* ---------------- recipient poll page ---------------- */
body.poll { background: var(--bg); }
.poll-top { background: var(--surface); border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--ink-2); }
.poll-top .wrap { padding-top: 8px; padding-bottom: 8px; }
.poll-main { max-width: 560px; margin: 0 auto; padding: 16px 16px 120px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin: 12px 0 20px; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .25s ease; }
.qcount { font-size: .82rem; color: var(--ink-3); margin-bottom: 6px; }
.qtext { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.qhelp { color: var(--ink-2); font-size: .92rem; margin-bottom: 14px; }
.req { color: var(--danger); font-size: .8rem; font-weight: 600; margin-left: 6px; }
.choice { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 10px; cursor: pointer; font-weight: 500; min-height: 52px; }
.choice input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.other-in { margin: -4px 0 10px 0; }
.scale { display: grid; gap: 8px; grid-template-columns: repeat(5, 1fr); }
.scale.ten { grid-template-columns: repeat(5, 1fr); }
.scale button { min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.scale button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scale-ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-3); margin-top: 6px; }
.rank-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 8px 8px 14px; margin-bottom: 8px; }
.rank-item .pos { font-weight: 800; color: var(--accent); width: 1.6em; }
.rank-item .lbl { flex: 1; }
.rank-item button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 1rem; cursor: pointer; }
.poll-nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.poll-nav .in { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.poll-nav .grow { flex: 1; }
.linkbtn { background: none; border: 0; color: var(--ink-2); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; padding: 8px 0; }
.center { text-align: center; }
.big-ico { font-size: 2.6rem; margin: 24px 0 8px; }
.preview-banner { background: var(--warn-soft); color: var(--warn); text-align: center; padding: 6px 12px; font-size: .85rem; font-weight: 600; }
.page-title { margin-top: 40px; }
.mt16 { margin-top: 16px; }
.login-wrap { max-width: 400px; padding-top: 12vh; }
.login-wrap .err { margin-bottom: 14px; }
