/* The phone page and the control page. Colours and fonts come from tokens.css, which copies the deck's. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-size: 18px; line-height: 1.4; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.page { max-width: 560px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column;
  padding: 20px 18px calc(16px + env(safe-area-inset-bottom)); }
.brand { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
main { flex: 1; padding: 28px 0 24px; }

.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 8px 0 6px; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.sub { margin: 0; color: var(--muted); }
.quiet { margin: 6px 0 0; color: var(--muted); }
.lead { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.note { margin: 18px 0 0; font-weight: 600; color: var(--accent-ink); }
.note.wait { color: var(--warn); }
.fact { margin: 14px 0 0; padding: 14px 16px; border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; overflow-wrap: anywhere; }

/* Options: the deck's poll rows, at a size a thumb can hit. */
.options { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
button.option, button.choice { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); font-weight: 600; line-height: 1.25; text-align: left; }
button.option .badge { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 16px; font-weight: 700; }
button.option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
button.option[aria-pressed="true"] .badge { background: var(--accent); color: var(--panel); }
button.option .tick { margin-left: auto; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.half-name { margin: 16px 0 -6px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

button.primary { width: 100%; min-height: 54px; margin-top: 16px; border: 0; border-radius: 12px; background: var(--accent); color: var(--panel); font-weight: 700; }
button.primary:active { background: var(--accent-ink); }
button.link { min-height: 48px; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; text-decoration: underline; }
input.text { width: 100%; min-height: 54px; margin-top: 20px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); }
.left { margin: 6px 0 0; font-size: 13px; color: var(--muted); text-align: right; }

/* A result: one bar per option. */
.bars { margin: 18px 0 0; padding: 0; list-style: none; }
.bar-row, .answer-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bar-row .label, .answer-row .label { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.bar-row .count, .answer-row .count { font-family: var(--font-mono); font-weight: 700; }
.bar-row .track { grid-column: 1 / -1; height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar-row .track i { display: block; width: var(--w, 0%); height: 100%; border-radius: 6px; background: var(--accent); }
.yours { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 2px; }
.totals { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.conn { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conn.off .dot { background: var(--warn); }

/* ---- the control page ---- */
.page.wide { max-width: 900px; }
.gate { max-width: 420px; }
.gate label, .field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.gate input, .field input { width: 100%; min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel); }
.refused { margin: 14px 0 0; font-weight: 700; color: var(--bad); }
.counts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 18px; font-family: var(--font-mono); font-size: 16px; font-weight: 700; }
.poll-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.poll { padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); }
.poll.is-open { border-color: var(--accent); background: var(--accent-soft); }
.poll-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.poll-id { flex: none; min-width: 44px; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--font-mono); font-size: 14px; font-weight: 700; text-align: center; }
.poll.is-open .poll-id { background: var(--accent); color: var(--panel); }
.poll-heading { flex: 1 1 260px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.state, .on-screen { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.state { background: var(--line); color: var(--muted); }
.state.open { background: var(--ok-soft); color: var(--ok); }
.state.closed { background: var(--warn-soft); color: var(--warn); }
.on-screen { background: var(--accent); color: var(--panel); }
.poll-n { font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
button.act { min-height: 44px; padding: 6px 16px; border: 1.5px solid var(--accent); border-radius: 10px; background: var(--panel); color: var(--accent-ink); font-size: 15px; font-weight: 700; }
button.act.main { background: var(--accent); color: var(--panel); }
button.act.danger { border-color: var(--bad); color: var(--bad); }
button.act:disabled { border-color: var(--line); background: var(--line); color: var(--muted); cursor: default; }
.poll details { margin-top: 8px; }
.poll summary { min-height: 32px; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
.poll .bars { margin-top: 4px; }
.poll .bar-row, .poll .answer-row { padding: 8px 0; font-size: 15px; }
.answer-row.is-hidden .label { color: var(--muted); text-decoration: line-through; }
.answer-row .tools { display: flex; align-items: center; gap: 12px; }
.score { margin: 10px 0 0; font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.foot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.foot .field { flex: 1 1 220px; max-width: 280px; }
