:root {
  color-scheme: dark;
  --bg: #07080d;
  --panel: rgba(17, 19, 29, 0.74);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f4f8;
  --muted: #a3a8bd;
  --faint: #737891;
  --accent: #f0a828;
  --accent-soft: #ffd27a;
  --good: #5ee6a8;
  --warn: #f5d547;
  --bad: #ff7a8a;
  --radius: 20px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --glide: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-bottom: 72px; /* keeps content clear of the fixed Cloudish badge */
}

button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon { width: 1em; height: 1em; flex: none; }

/* ---------- night sky ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 34rem at 10% -10%, rgba(240, 168, 40, 0.15), transparent 62%),
    radial-gradient(48rem 40rem at 108% 28%, rgba(108, 99, 255, 0.13), transparent 60%),
    radial-gradient(44rem 30rem at 35% 115%, rgba(76, 201, 240, 0.08), transparent 60%),
    var(--bg);
}

.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.75;
  background-image:
    radial-gradient(1px 1px at 22px 34px, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 118px 92px, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 206px 160px, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(1px 1px at 296px 48px, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 330px 228px, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 64px 250px, rgba(255, 220, 160, 0.7), transparent 60%),
    radial-gradient(1px 1px at 160px 300px, rgba(255, 255, 255, 0.4), transparent 60%);
  background-size: 360px 320px;
  -webkit-mask-image: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.3) 75%, transparent);
  mask-image: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.3) 75%, transparent);
}

/* ---------- frame ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 10px rgba(240, 168, 40, 0.55));
}

.brand small {
  margin-left: 2px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.app {
  max-width: 1160px;
  margin: 0 auto;
  padding: 8px 24px 40px;
  outline: none;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.noscript { text-align: center; color: var(--muted); }

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.22); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }

.btn.primary {
  border-color: rgba(255, 214, 130, 0.6);
  background: linear-gradient(180deg, #ffc65a, #f0a828 60%, #e8951a);
  color: #1b1203;
  box-shadow: 0 12px 30px -12px rgba(240, 168, 40, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn.primary:hover { filter: brightness(1.06); }
.btn.big { width: 100%; min-height: 54px; border-radius: 14px; font-size: 1.0625rem; }
.btn.small { min-height: 36px; padding: 7px 12px; font-size: 0.875rem; }
.btn.small .icon { width: 16px; height: 16px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(27, 18, 3, 0.3);
  border-top-color: #1b1203;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }

.link-btn {
  padding: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover { color: var(--text); }

:is(.btn, .icon-btn, .link-btn, .choice, .pill, .share-url, .brand, .recent a):focus-visible {
  outline: 3px solid rgba(240, 168, 40, 0.7);
  outline-offset: 2px;
}

/* ---------- home ---------- */

.home { display: grid; gap: 28px; }

.hero { max-width: 780px; margin: 28px auto 6px; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 6px 13px;
  border: 1px solid rgba(240, 168, 40, 0.35);
  border-radius: 999px;
  background: rgba(240, 168, 40, 0.08);
  color: var(--accent-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.eyebrow .dot { color: var(--accent); }

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 4.6vw + 1rem, 4.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(95deg, #ffe2a3 0%, #f0a828 45%, #ff7d45 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 580px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.25rem);
  text-wrap: pretty;
}

.create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

.create-form { display: grid; gap: 10px; padding: 26px; }

.field-label {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.options-label { margin-top: 12px; }

.input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(5, 6, 10, 0.55);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.input::placeholder { color: var(--faint); opacity: 1; }
.input:hover { border-color: rgba(255, 255, 255, 0.22); }

.input:focus {
  outline: none;
  border-color: rgba(240, 168, 40, 0.75);
  background: rgba(5, 6, 10, 0.75);
  box-shadow: 0 0 0 4px rgba(240, 168, 40, 0.16);
}

.question-input {
  min-height: 88px;
  resize: none;
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.35;
  field-sizing: content;
}

.option-list { display: grid; gap: 8px; }

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: rise 0.25s ease-out;
}

.swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--c);
  box-shadow: 0 0 12px -2px var(--c);
}

.add-option { justify-self: start; color: var(--muted); }

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.switch-input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.switch-track {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  transition: background-color 0.2s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--glide);
}

.switch-input:checked + .switch-track { background: var(--accent); }
.switch-input:checked + .switch-track::after { transform: translateX(18px); }
.switch-input:focus-visible + .switch-track { outline: 3px solid rgba(240, 168, 40, 0.7); outline-offset: 2px; }

.form-error { min-height: 1.5em; margin: 2px 0 0; color: var(--bad); font-size: 0.9375rem; font-weight: 600; }

.preview { position: sticky; top: 24px; padding: 26px; }

.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.preview-tag { color: var(--faint); font-size: 0.8125rem; font-weight: 600; }

.question.preview-question { margin: 16px 0 24px; font-size: clamp(1.4rem, 1vw + 1rem, 1.75rem); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 1040px;
  margin: 4px auto 0;
  padding: 0;
  list-style: none;
}

.steps li { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.02); }

.steps b {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: rgba(240, 168, 40, 0.14);
  color: var(--accent-soft);
  font-size: 0.875rem;
}

.steps h2 { margin: 0 0 4px; font-size: 1rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

.recent { width: 100%; max-width: 1040px; margin: 0 auto; }

.recent h2 {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recent ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.recent a:hover { border-color: rgba(240, 168, 40, 0.4); background: rgba(240, 168, 40, 0.05); }
.recent-q { flex: 1; min-width: 0; overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { flex: none; color: var(--faint); font-size: 0.8125rem; }
.recent a .icon { width: 16px; height: 16px; color: var(--faint); }

/* ---------- live status ---------- */

.statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 30px;
  padding: 0 12px 0 11px;
  border: 1px solid rgba(94, 230, 168, 0.3);
  border-radius: 999px;
  background: rgba(94, 230, 168, 0.1);
  color: var(--good);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pill:disabled { opacity: 1; cursor: default; }

.dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: beacon 1.8s ease-out infinite;
}

.pill[data-state="connecting"] { border-color: rgba(245, 213, 71, 0.3); background: rgba(245, 213, 71, 0.08); color: var(--warn); }
.pill[data-state="connecting"] .dot { animation: blink 1s steps(2, start) infinite; }
.pill[data-state="paused"] { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); color: var(--text); cursor: pointer; }
.pill[data-state="closed"] { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.pill:is([data-state="connecting"], [data-state="paused"], [data-state="closed"]) .dot::after { animation: none; opacity: 0; }

.stat b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 750; }
.stat .icon { width: 16px; height: 16px; margin-right: 5px; vertical-align: -3px; }

/* ---------- poll pages ---------- */

.question {
  margin: 16px 0 6px;
  font-size: clamp(1.75rem, 2.4vw + 1rem, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.kind { margin: 0 0 26px; color: var(--faint); font-size: 0.875rem; font-weight: 600; }

.thanks,
.closed-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 650;
}

.thanks { border: 1px solid rgba(94, 230, 168, 0.22); background: rgba(94, 230, 168, 0.08); color: var(--good); }
.closed-note { border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.05); color: var(--muted); }
:is(.thanks, .closed-note) .icon { width: 18px; height: 18px; }

/* ---------- results chart ---------- */

.chart-wrap { position: relative; }

.chart { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }

.row { --c: var(--accent); }

.row-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.3;
}

.label-text { min-width: 0; overflow-wrap: anywhere; }

.marker { position: relative; display: grid; flex: none; place-items: center; width: 18px; height: 18px; }

.marker-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
  transition: transform 0.4s var(--spring), opacity 0.3s;
}

.marker-star {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  color: var(--c);
  opacity: 0;
  transform: scale(0.3) rotate(-90deg);
  filter: drop-shadow(0 0 6px var(--c));
  transition: transform 0.5s var(--spring), opacity 0.3s;
}

.row.lead .marker-dot { opacity: 0; transform: scale(0); }
.row.lead .marker-star { opacity: 1; transform: none; }

.mine-tag {
  display: none;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.mine-tag .icon { width: 12px; height: 12px; }
.row.mine .mine-tag { display: inline-flex; }

.stats { display: flex; flex: none; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.pct { min-width: 3.2ch; color: var(--text); font-size: 1.125rem; font-weight: 800; text-align: right; }
.count { color: var(--faint); font-size: 0.875rem; font-weight: 600; text-align: right; }

.track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.fill {
  position: relative;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 50%, #000) 0%, var(--c) 100%);
  box-shadow: 0 0 22px -6px var(--c);
  /* width is animated from app.js, in step with the percentage */
}

.fill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 55%);
}

.row.hit .fill { animation: flash 0.9s ease-out; }

/* "+1" pops out just past the end of the bar, on the track, clear of the label */
.bump {
  position: absolute;
  top: 50%;
  left: 100%;
  z-index: 2;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--c);
  color: #0b0c11;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  translate: 0 -50%;
  box-shadow: 0 6px 18px -6px var(--c);
  animation: bump 1.5s var(--glide) forwards;
}

.bump.inside {
  right: 6px;
  left: auto;
  margin-left: 0;
  background: rgba(11, 12, 17, 0.88);
  color: var(--c);
}

.chart-empty { display: none; margin: 20px 0 0; color: var(--muted); font-weight: 600; text-align: center; }
.chart-wrap.is-empty .chart-empty { display: block; }

.chart-wrap.is-empty .track {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.04) 70%);
  background-size: 300% 100%;
  animation: shimmer 2.4s linear infinite;
}

/* ---------- host view ---------- */

.host {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.host-main { padding: 28px 30px 32px; }

.share {
  position: sticky;
  top: 20px;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.share-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qr-frame {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.04), 0 22px 50px -22px rgba(240, 168, 40, 0.5);
}

.qr-frame img { display: block; width: 100%; height: 100%; }

.share-url {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font: 600 0.875rem/1.35 var(--mono);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.share-url:hover { border-color: rgba(240, 168, 40, 0.5); }

.share-actions,
.host-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }

.host-actions { padding-top: 14px; border-top: 1px solid var(--line); }
.host-actions .wide { grid-column: 1 / -1; }

.share-note { margin: 0; color: var(--faint); font-size: 0.8125rem; }

.exit-present { display: none !important; position: fixed; top: 16px; right: 16px; z-index: 10; }

/* ---------- presenting ---------- */

body.presenting { padding-bottom: 0; }
body.presenting .topbar { display: none; }

body.presenting .app {
  display: grid;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(20px, 4vh, 56px) clamp(20px, 4vw, 72px);
}

body.presenting .host {
  grid-template-columns: minmax(0, 1fr) clamp(260px, 27vw, 460px);
  gap: clamp(24px, 4vw, 72px);
  align-items: center;
}

body.presenting .host-main {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.presenting .question { margin-bottom: 4vh; font-size: clamp(2rem, 3.6vw + 0.5rem, 5rem); }
body.presenting .kind { display: none; }
body.presenting .statusbar { font-size: clamp(1rem, 1.1vw + 0.3rem, 1.5rem); }
body.presenting .chart { gap: clamp(16px, 3.2vh, 40px); }
body.presenting .label { font-size: clamp(1.1rem, 1.6vw + 0.3rem, 2.2rem); }
body.presenting .marker { width: 1em; height: 1em; }
body.presenting .marker-star { width: 100%; height: 100%; }
body.presenting .pct { font-size: clamp(1.2rem, 1.8vw + 0.3rem, 2.4rem); }
body.presenting .count { font-size: clamp(0.9rem, 1vw + 0.2rem, 1.3rem); }
body.presenting .track { height: clamp(18px, 3.2vh, 38px); }
body.presenting .bump { font-size: clamp(0.8rem, 1vw + 0.2rem, 1.3rem); }
body.presenting .share { position: static; padding: clamp(18px, 2.4vw, 36px); }
body.presenting .qr-frame { max-width: none; }
body.presenting .share-title { font-size: clamp(0.9rem, 1vw + 0.2rem, 1.25rem); }
body.presenting .share-url { border-style: solid; font-size: clamp(0.85rem, 0.8vw + 0.25rem, 1.3rem); }
body.presenting :is(.share-actions, .host-actions, .share-note) { display: none; }
body.presenting .exit-present { display: inline-grid !important; }

/* ---------- voter view ---------- */

.voter { max-width: 720px; margin: 8px auto 0; padding: 28px 30px 32px; }

.hint { margin: 0 0 18px; color: var(--muted); }

.choices { display: grid; gap: 12px; }

.choice {
  --c: var(--accent);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 16px 18px 16px 20px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.12s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.choice::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--c);
}

.choice:hover {
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 9%, transparent);
}

.choice:active { transform: scale(0.985); }

.choice-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid color-mix(in srgb, var(--c) 80%, #fff);
  border-radius: 50%;
  transition: background-color 0.15s, border-color 0.15s;
}

.choices.multi .choice-mark { border-radius: 7px; }

.choice-mark .icon {
  width: 14px;
  height: 14px;
  color: #0b0c11;
  stroke-width: 3;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.15s, transform 0.25s var(--spring);
}

.choice-label { min-width: 0; overflow-wrap: anywhere; }

.choice[aria-pressed="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 15%, transparent);
  box-shadow: 0 0 0 1px var(--c), 0 12px 30px -16px var(--c);
}

.choice[aria-pressed="true"] .choice-mark { border-color: var(--c); background: var(--c); }
.choice[aria-pressed="true"] .choice-mark .icon { opacity: 1; transform: none; }

.choice.sending::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 28%, transparent), transparent);
  animation: sweep 0.9s linear infinite;
}

.voter-body.busy .choice:not(.sending) { opacity: 0.55; }
.voter .btn.big { margin-top: 18px; }
.skip { display: block; margin: 14px auto 0; }
.voter-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, max-content)); gap: 10px; margin-top: 28px; }

/* ---------- misc ---------- */

.notfound { max-width: 520px; margin: 48px auto; padding: 36px; text-align: center; }
.notfound h1 { margin: 0 0 8px; font-size: 1.75rem; letter-spacing: -0.02em; }
.notfound p { margin: 0 0 22px; color: var(--muted); }

.toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(22, 24, 34, 0.96);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 650;
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  translate: -50% 12px;
  transition: opacity 0.2s, translate 0.25s var(--glide);
}

.toast.show { opacity: 1; translate: -50% 0; }
.toast[data-kind="success"] { border-color: rgba(94, 230, 168, 0.4); }
.toast[data-kind="error"] { border-color: rgba(255, 122, 138, 0.5); }

/* ---------- motion ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes beacon { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(3.2); } }
@keyframes blink { to { opacity: 0.25; } }
@keyframes flash { from { filter: brightness(1.9) saturate(1.2); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@keyframes bump {
  0% { opacity: 0; transform: translateX(-10px) scale(0.5); }
  14% { opacity: 1; transform: translateX(0) scale(1.15); }
  28% { transform: translateX(0) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(8px) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ---------- smaller screens ---------- */

@media (max-width: 900px) {
  .create-grid { grid-template-columns: 1fr; }
  .preview { display: none; }
  .host { grid-template-columns: 1fr; }
  .share { position: static; order: -1; }
  .qr-frame { max-width: 190px; }
  body.presenting .host { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  .app { padding: 4px 14px 32px; }
  .hero { margin-top: 12px; }
  .create-form, .host-main, .voter, .share { padding: 20px; }
  .question { margin-top: 14px; }
  .choice { min-height: 58px; font-size: 1.0625rem; }
  .label { font-size: 1rem; }
  .row-head { gap: 10px; }
}
