/* Fragen-Tool: live questions and polls. Neutral defaults; /theme.css (config.json) sets colours and fonts. */

:root {
  --primary: #1d2b3a;
  --primary-2: #2a3b4f;
  --paper: #fbfbfa;
  --card: #ffffff;
  --accent: #1f5fbf;
  --accent-hover: #174a96;
  --accent-light: #8fb4ec;
  --accent-tint: #e8f0fb;
  --alert: #b42318;
  --text: #1c1c1c;
  --text-2: #4a4740;
  --text-3: #6b665d;
  --line: #e7e3da;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--paper); line-height: 1.5; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Public ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
/* Header: deep night gradient with a faint warm glow (like the night slides), brand left, heart right.
   The first card overlaps the bottom of the gradient. */
.brand {
  position: relative; color: var(--paper);
  padding: calc(18px + env(safe-area-inset-top)) 18px 54px;
  background:
    radial-gradient(120% 90% at 85% 120%, color-mix(in srgb, var(--accent-light) 22%, transparent), transparent 60%),
    radial-gradient(80% 120% at 0% 0%, var(--primary-2) 0%, transparent 70%),
    linear-gradient(160deg, var(--primary) 0%, var(--primary) 45%, var(--primary-2) 100%);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.brand__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand__name { font-family: var(--serif); font-size: 20px; font-weight: 500; letter-spacing: .01em; line-height: 1.2; }
.brand__event { color: var(--accent-light); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand__heart { height: 32px; width: auto; max-width: 140px; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.wrap { width: 100%; max-width: 560px; margin: -34px auto 0; padding: 0 16px 32px; flex: 1; display: flex; flex-direction: column; gap: 16px; position: relative; }
.wrap > .card, .wrap > .poll { box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 10%, transparent); }
/* An open poll (dark card) never sits on the dark header: the band ends earlier and the card starts on paper. */
body:has(.poll:not([hidden])) .brand { padding-bottom: 18px; }
.wrap:has(> .poll:not([hidden])) { margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; }
.card.calm { text-align: center; padding: 40px 18px; }
.title { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.15; margin: 0 0 6px; color: var(--primary); }
.lead { margin: 0 0 18px; color: var(--text-2); font-size: 17px; }
textarea, .input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 14px; font-size: 17px; background: var(--paper);
  resize: vertical; min-height: 140px;
}
.input { min-height: 0; resize: none; }
textarea:focus, .input:focus { border-color: var(--accent); outline: none; }
.row { display: flex; justify-content: flex-end; margin-top: 6px; }
.counter { font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.counter.is-low { color: var(--alert); }
.hint { font-size: 14px; color: var(--text-2); margin: 10px 0 16px; }
.error { color: var(--alert); font-weight: 600; margin: 0 0 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; width: 100%;
  border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 17px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .55; cursor: default; }
/* After sending a question: the form makes way for a calm confirmation. */
.card.is-sent > .title, .card.is-sent > .lead, .card.is-sent > .notice { display: none; }
.done { text-align: center; padding: 18px 4px 6px; outline: none; }
.done__mark { display: block; width: 56px; height: 56px; margin: 0 auto 16px; }
.done__mark circle { fill: var(--accent-tint); stroke: var(--accent); stroke-width: 1.5; }
.done__mark path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 32; stroke-dashoffset: 32; animation: done-tick .5s .15s ease-out forwards; }
@keyframes done-tick { to { stroke-dashoffset: 0; } }
.done__text { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.15; color: var(--primary); margin: 0 0 10px; }
.done__sub { font-size: 16px; line-height: 1.5; color: var(--text-2); margin: 0 auto 22px; max-width: 30ch; }
.btn--quiet { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--line-strong, #d9dee6); }
.btn--quiet:hover { background: var(--accent-tint); }
@media (prefers-reduced-motion: reduce) { .done__mark path { animation: none; stroke-dashoffset: 0; } }
.link { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }
.watch { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px 8px; text-align: center; }
.watch__text { margin: 0 0 10px; font-size: 15px; color: var(--text-2); }
.watch__btn { min-height: 48px; font-size: 16px; }
.foot { padding: 16px; text-align: center; font-size: 13px; color: var(--text-3); max-width: 560px; margin: 0 auto; }
.foot a { color: var(--text-2); }

/* Poll card on the public page */
.helpbtn {
  position: fixed; right: 14px; bottom: 14px; z-index: 30; min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--accent-light); background: var(--primary); color: var(--paper); font-family: inherit; font-size: 15px; font-weight: 600; box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 28%, transparent);
}
.helpbtn__dot { display: inline-block; width: 9px; height: 9px; margin-left: 8px; border-radius: 50%; background: var(--accent-light); }
.help {
  position: fixed; right: 14px; left: 14px; bottom: 68px; z-index: 31; max-height: min(76vh, 560px); overflow: auto; box-sizing: border-box; padding: 20px 18px;
  background: var(--card, #fff); color: var(--ink, #1e1d1b); border-radius: var(--radius); box-shadow: 0 18px 50px color-mix(in srgb, var(--primary) 35%, transparent);
}
.help__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.help__title { margin: 0; font: 600 23px/1.2 var(--serif); }
.help__close { border: 0; background: none; padding: 6px 0; color: var(--primary); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; }
.help__lead { margin: 6px 0 14px; font-size: 16px; line-height: 1.4; }
.help__list { list-style: none; margin: 0; padding: 0; }
.help__item { margin-bottom: 14px; }
.help__me, .help__reply, .help__wait { margin: 0 0 6px; padding: 10px 12px; border-radius: 10px; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.help__me { background: var(--accent-tint); margin-left: 28px; }
.help__reply { background: var(--primary); color: var(--paper); margin-right: 28px; }
.help__wait { padding: 2px 0; color: #6b665d; font-style: italic; }
.help textarea { margin-bottom: 8px; }
@media (min-width: 900px) { .help { left: auto; width: 400px; } }
.period { color: var(--text-2); font-size: 14px; }
.period summary { cursor: pointer; font-weight: 600; width: fit-content; }
.period input[type='text'], .period #per-name { display: block; margin: 6px 0 10px; min-height: 40px; width: min(320px, 100%); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.period .check { display: block; margin-bottom: 10px; }
.perview { padding: 20px 22px; height: calc(100vh - 60px); overflow: auto; box-sizing: border-box; }
.perview__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.perview__acts { display: flex; align-items: center; gap: 14px; }
.perview__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.perview__col { display: grid; gap: 10px; }
.perview__row { margin: 0 0 3px; font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 800px) { .perview__cols { grid-template-columns: 1fr; } }
.hbox { padding: 14px 18px; border-bottom: 1px solid #e3e7ed; background: #fbf6ea; }
.hbox.has-open { background: var(--accent-tint); box-shadow: inset 4px 0 0 var(--accent); }
.hbox__title { margin: 0 0 6px; font-size: 16px; }
.hbox__empty { margin: 0; font-size: 14px; color: #6b665d; }
.hbox__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 46vh; overflow: auto; }
.hbox__item { padding: 10px 12px; background: #fff; border: 1px solid #e3e7ed; border-radius: 8px; }
.hbox__meta { margin: 0 0 4px; font-size: 12px; color: #6b665d; }
.hbox__text { margin: 0 0 8px; overflow-wrap: anywhere; }
.hbox__reply { margin: 0 0 8px; padding: 6px 8px; background: var(--accent-tint); border-radius: 6px; overflow-wrap: anywhere; }
.hbox__row { display: flex; gap: 8px; align-items: center; }
.hbox__row .input { flex: 1; min-width: 0; min-height: 38px; padding: 6px 10px; }
.join {
  background: var(--primary); color: var(--paper); border-radius: var(--radius); padding: 26px 22px 22px; text-align: center;
  border: 1.5px solid var(--accent-light); box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 16%, transparent); margin-bottom: 16px;
}
.join__heart { display: block; width: 44px; height: auto; margin: 0 auto 10px; }
.join__label { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-light); }
.join__title { margin: 0 0 6px; font: 600 34px/1.12 var(--serif); color: var(--paper); }
.join__text { margin: 0 0 18px; font-size: 16px; line-height: 1.45; color: #d9dce8; }
.join .join__btn { background: var(--accent-light); color: var(--primary); font-size: 18px; font-weight: 700; }
.join .join__btn:hover { background: #d8bd88; }
.poll { background: var(--primary); color: var(--paper); border-radius: var(--radius); padding: 22px 18px; border: 1.5px solid color-mix(in srgb, var(--accent-light) 45%, transparent); }
.poll__label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-light); margin: 0 0 6px; }
.poll__q { font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.2; margin: 0 0 16px; }
.poll__hint { font-size: 14px; color: #cfd3e3; margin: -8px 0 14px; }
.opts { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; padding: 0; border: 0; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1.5px solid color-mix(in srgb, var(--paper) 24%, transparent); border-radius: 12px; cursor: pointer; font-size: 17px; }
.opt input { width: 22px; height: 22px; accent-color: var(--accent-light); flex: none; margin: 0; }
.opt:has(input:checked) { border-color: var(--accent-light); background: var(--primary-2); }
.scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 8px; margin: 0 0 8px; }
.scale button { min-height: 56px; border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--paper) 24%, transparent); background: transparent; color: var(--paper); font-size: 20px; font-weight: 600; cursor: pointer; }
.scale button[aria-pressed='true'] { border-color: var(--accent-light); background: var(--accent-light); color: var(--primary); }
.numf { display: grid; gap: 6px; margin: 0 0 14px; }
.numf__l { font-size: 15px; line-height: 1.35; }
.numf__in { display: flex; align-items: center; gap: 10px; }
.numf__in .input { flex: 1; font-size: 20px; font-variant-numeric: tabular-nums; }
.numf__u { font-weight: 600; min-width: 1.2em; }
.nums { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.nums li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.nums b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.scale__labels { display: flex; justify-content: space-between; font-size: 13px; color: #cfd3e3; margin: 0 0 16px; gap: 12px; }
.poll .input { background: var(--primary-2); border-color: color-mix(in srgb, var(--paper) 24%, transparent); color: var(--paper); margin-bottom: 16px; }
.poll .btn { background: var(--accent-light); color: var(--primary); }
.poll .btn:hover { background: #d8bd88; }
.poll .btn.is-waiting { animation: vote-wait 1.6s ease-in-out infinite; }
@keyframes vote-wait {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-light) 75%, transparent); transform: scale(1); }
  45% { transform: scale(1.025); }
  70% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent-light) 0%, transparent); transform: scale(1); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-light) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .poll .btn.is-waiting { animation: none; box-shadow: 0 0 0 3px var(--paper); } }
.poll .error { color: #ffb4bf; }
.poll__done { font-family: var(--serif); font-size: 22px; margin: 0; }
.poll__again {
  display: block; margin: 16px auto 0; min-height: 44px; padding: 0 12px; background: none; border: 0; cursor: pointer;
  color: var(--accent-light); font-weight: 600; font-size: 16px; text-decoration: underline; text-underline-offset: 4px;
}
.poll__again:hover { color: #e2cb9c; }

/* Result bars (public, admin, screen) */
.bars { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bar__top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.bar__n { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bar__track { height: 10px; border-radius: 6px; background: rgba(127, 127, 127, .18); overflow: hidden; margin-top: 4px; }
.bar__fill { height: 100%; width: 0; background: var(--accent-light); border-radius: 6px; transition: width .4s ease; }
.admin .bar__fill { background: var(--accent); }
.total { font-size: 14px; color: var(--text-3); margin-top: 10px; }
.poll .total { color: #cfd3e3; }

/* ---------- Admin ---------- */
.admin {
  --ink-soft: #3b3a52;
  --surface: #ffffff;
  --sunk: #f6f3ec;
  --shadow: 0 1px 2px color-mix(in srgb, var(--primary) 6%, transparent), 0 4px 14px color-mix(in srgb, var(--primary) 5%, transparent);
  background: var(--sunk); min-height: 100vh;
}
.admin ::selection { background: var(--accent-tint); color: var(--primary); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.top { position: sticky; top: 0; z-index: 5; background: var(--primary); color: var(--paper); }
.top__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 10px 20px; min-height: 60px; }
.top__brand { font-family: var(--serif); font-size: 18px; font-weight: 500; white-space: nowrap; }
.top__event { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.top__event select {
  min-height: 38px; max-width: 440px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); background: var(--primary-2); color: var(--paper); padding: 0 10px;
}
.top__event-name { color: var(--accent-light); font-size: 15px; }
.top__tools { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.tool {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; border-radius: 10px; border: 0; background: none;
  color: #cfd3e3; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer;
}
.tool:hover { background: rgba(255, 255, 255, .07); color: var(--paper); }
.tool:disabled { opacity: .55; cursor: default; }
.tool--speed { max-width: 170px; }
.tool--speed option { color: var(--primary); background: #fff; }
.tool[aria-expanded='true'] { color: var(--paper); background: rgba(255, 255, 255, .07); }
.tool--lang { font-weight: 700; letter-spacing: .04em; border: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); margin-left: 6px; }
.admin--solo .tool--lang { margin-left: auto; }
.top__new { display: flex; gap: 8px; padding: 0 20px 12px; }
.top__new input {
  flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); background: var(--primary-2); color: var(--paper); padding: 0 12px;
}
.top__new input::placeholder { color: #9aa1bd; }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #aeb4cc; padding: 0 4px; }
.state:empty { display: none; }
.state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #5d6690; }
.state.is-live { color: #ffd1d8; }
.state.is-live::before { background: #ff5a6e; box-shadow: 0 0 0 0 rgba(255, 90, 110, .6); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255, 90, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 110, 0); } }

.btn--small { min-height: 38px; width: auto; padding: 0 16px; font-size: 14px; gap: 6px; }
.btn--small .ico { width: 16px; height: 16px; }
.btn--onnight { background: var(--accent-light); color: var(--primary); }
.btn--onnight:hover { background: #d8bd88; }
.btn--ghost { background: transparent; border: 1px solid color-mix(in srgb, var(--paper) 30%, transparent); color: #e4e6ef; }
.btn--ghost:hover { background: rgba(255, 255, 255, .07); }
.btn--danger { background: var(--alert); }
.btn--danger:hover { background: #6d1724; }

.tabs { display: flex; gap: 4px; padding: 0 12px; border-top: 1px solid #252f5a; }
.tab { background: none; border: 0; color: #aeb4cc; padding: 12px 12px; border-bottom: 2px solid transparent; cursor: pointer; font-weight: 600; font-size: 15px; }
.tab.is-on { color: var(--paper); border-color: var(--accent-light); }
.badge:not(:empty) { background: var(--accent-light); color: var(--primary); border-radius: 999px; padding: 1px 7px; font-size: 12px; margin-left: 4px; }

/* Work area: two panes with a draggable divider, or one pane (tabs, narrow screens, presenter view) */
.work { --qw: 50%; display: grid; grid-template-columns: minmax(0, var(--qw)) 12px minmax(0, 1fr); height: calc(100vh - 60px); }
.work[data-layout='tabs'], .work--solo { display: block; height: auto; }
.work[data-layout='tabs'] .split { display: none; }
.work.is-dragging { cursor: col-resize; user-select: none; }
.split { position: relative; cursor: col-resize; touch-action: none; }
.split::after { content: ''; position: absolute; inset: 0 5px; background: var(--line); transition: background .15s; }
.split:hover::after, .split:focus-visible::after, .is-dragging .split::after { background: var(--accent-light); }
.split:focus-visible { outline: none; }

.pane { display: flex; flex-direction: column; min-height: 0; }
.work[data-layout='split'] .pane { overflow: hidden; }
.pane__head {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line); background: var(--sunk);
}
.pane__title { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 0; color: var(--primary); display: flex; align-items: baseline; gap: 10px; }
.count { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent); }
.pane__body { padding: 16px 22px 40px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #d6d0c3 transparent; }
.work[data-layout='tabs'] .pane__body, .work--solo .pane__body { overflow: visible; }
.work[data-layout='tabs'] .pane, .work--solo .pane { max-width: 860px; margin: 0 auto; }
.pane__foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.export { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }

.filters { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip {
  min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer;
  font-size: 14px; color: var(--text-2); font-weight: 500;
}
.chip:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.chip.is-on { background: var(--primary); color: var(--paper); }
.chip--plain { margin-left: 6px; border-color: var(--line); }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 14px; color: var(--text-2); cursor: pointer; }
.empty { color: var(--text-3); text-align: center; padding: 40px 0; margin: 0; }
.note { font-size: 14px; color: var(--text-2); margin: 0; }
.link-btn {
  background: none; border: 0; padding: 4px 2px; cursor: pointer; font-size: 14px; color: var(--text-2); font-weight: 500;
  text-decoration: underline; text-decoration-color: #cdc6b6; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--primary); text-decoration-color: currentColor; }
.link-btn--danger { color: var(--alert); }

/* Questions */
.qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 12px; box-shadow: var(--shadow); }
.q.is-starred { background: #fffaef; border-color: #e6d5ae; }
.q.is-answered { box-shadow: none; background: transparent; }
.q.is-answered .q__text { color: var(--text-3); }
.q.is-hidden { box-shadow: none; background: transparent; border-style: dashed; }
.q.is-hidden .q__text { color: var(--text-3); text-decoration: line-through; text-decoration-color: #c9c3b6; }
.q__text { font-size: 19px; line-height: 1.45; margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty; color: var(--text); }
.admin--solo .q__text { font-size: 23px; }
.q__meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; color: var(--text-3); }
.q__meta time { margin-right: auto; font-variant-numeric: tabular-nums; display: inline-flex; gap: 8px; align-items: center; }
.q__new { color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.q__pre { color: var(--text-3); font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.act {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border-radius: 8px; border: 0; background: none;
  cursor: pointer; font-size: 14px; color: var(--text-2);
}
.act .ico { width: 16px; height: 16px; }
.act:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); color: var(--primary); }
.act.is-on { background: var(--accent-tint); color: var(--accent-hover); font-weight: 600; }
.act--starred.is-on .ico { fill: currentColor; }

.danger { color: var(--text-2); font-size: 14px; }
.danger summary { cursor: pointer; color: var(--alert); font-weight: 600; width: fit-content; }
.danger input { display: block; margin: 6px 0 10px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--primary); color: var(--paper); padding: 10px 16px;
  border-radius: 12px; font-size: 14px; display: flex; gap: 14px; align-items: center; z-index: 10; box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 25%, transparent);
}
.toast button { background: none; border: 0; color: var(--accent-light); font-weight: 700; cursor: pointer; }

/* Polls */
.pform {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 20px; display: grid; gap: 14px;
  box-shadow: var(--shadow);
}
.pform h2 { font-family: var(--serif); font-weight: 500; font-size: 21px; margin: 0; color: var(--primary); }
.pform label { font-size: 14px; color: var(--text-2); display: grid; gap: 5px; font-weight: 500; }
.pform input, .pform select { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--paper); font-size: 15px; }
.pform input:focus, .pform select:focus { border-color: var(--accent); outline: none; }
.pform .inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.pform .inline label { flex: 1; min-width: 120px; }
.pform .plist { gap: 8px; }
.pform .act { border: 1px solid var(--line); background: var(--paper); }
.optrow { display: flex; gap: 8px; }
.optrow input { flex: 1; }
.templates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--text-2); }
.plist { display: grid; gap: 12px; }
.p { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 12px; box-shadow: var(--shadow); }
.p.is-live { border-color: #e3b3bb; box-shadow: 0 0 0 3px rgba(139, 30, 47, .08), var(--shadow); }
.p.is-closed { background: #fbfaf7; box-shadow: none; }
.p__head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.status { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #eeebe3; color: var(--text-2); }
.status--live { background: var(--alert); color: #fff; }
.status--closed { background: #e4e7f0; color: #3b4466; }
.p__type { font-size: 13px; color: var(--text-3); }
.p__q { font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.25; margin: 0; color: var(--primary); overflow-wrap: anywhere; text-wrap: balance; }
.p__opts { font-size: 14px; color: var(--text-3); margin: 6px 0 0; }
.p__actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; align-items: center; }
.p__more { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0ece3; }
.p .bars { margin-top: 12px; }
.p .bar__fill, .admin .bar__fill { background: var(--accent); }
.shortlist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.shortlist li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid #f0ece3; padding: 4px 0; overflow-wrap: anywhere; }
.shortlist li.is-hidden span:first-child { text-decoration: line-through; color: var(--text-3); }

@media (max-width: 899px) {
  .top__row { padding: 10px 16px; }
  .pane__head, .pane__body { padding-left: 16px; padding-right: 16px; }
  .top__tools .tool span { display: none; }
  .top__event select { flex: 1 1 160px; max-width: 100%; min-width: 0; }
  .top__row { gap: 8px 12px; }
}
.top__event .btn { white-space: nowrap; }
.work[data-layout='tabs'] .pane__title { display: none; }
.work[data-layout='tabs'] .pane__head { justify-content: flex-start; }

/* ---------- Big screen (shared full screen in the stream) ---------- */
.screen {
  margin: 0; min-height: 100vh; color: var(--paper); overflow: hidden;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(255, 255, 255, .45), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 72%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(1px 1px at 30% 84%, rgba(255, 255, 255, .4), transparent 60%),
    radial-gradient(1px 1px at 90% 58%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(1px 1px at 46% 34%, rgba(255, 255, 255, .25), transparent 60%),
    radial-gradient(120% 90% at 50% 0%, #1d2858 0%, var(--primary) 60%, #0d1330 100%);
  display: flex; flex-direction: column;
}
.screen ::selection { background: color-mix(in srgb, var(--accent-light) 35%, transparent); }
.screen__main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6vh 8vw 2vh; }
.stage { width: 100%; max-width: 1280px; }
.stage__q {
  font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.6vw, 84px); line-height: 1.1; letter-spacing: -.01em;
  margin: 0 0 6vh; max-width: 26ch; text-wrap: balance;
}
.stage__avg { font-family: var(--serif); font-size: clamp(56px, 8vw, 150px); line-height: 1; color: var(--accent-light); margin: -2vh 0 4vh; font-variant-numeric: tabular-nums; }
.stage__avg:empty { display: none; }
.sbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3.4vh; }
.sbar__head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; font-size: clamp(18px, 2.2vw, 38px); }
.sbar__label { color: #dfe2ee; }
.sbar__n { font-variant-numeric: tabular-nums; color: #9aa1bd; font-weight: 500; }
.sbar__track { height: clamp(6px, 1vh, 12px); border-radius: 99px; background: rgba(255, 255, 255, .08); margin-top: 1.4vh; overflow: hidden; }
.sbar__fill { height: 100%; border-radius: 99px; background: rgba(223, 226, 238, .45); transform: scaleX(0); transform-origin: left; transition: transform .9s cubic-bezier(.16, 1, .3, 1); }
.sbar.is-lead .sbar__label { color: var(--paper); }
.sbar.is-lead .sbar__n { color: var(--accent-light); font-weight: 600; }
.sbar.is-lead .sbar__fill { background: var(--accent-light); }
.stage--scale .sbars { flex-direction: row; gap: 2vw; }
.stage--scale .sbar { flex: 1; }
.stage--scale .sbar__head { flex-direction: column; align-items: flex-start; gap: .4vh; }
.stage__total { margin: 5vh 0 0; font-size: clamp(14px, 1.4vw, 24px); color: #8b92b0; font-variant-numeric: tabular-nums; }
.cloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.4vh 2.4vw; align-items: baseline; font-size: clamp(18px, 2vw, 34px); }
.cloud__w { font-family: var(--serif); color: #c7cbdc; line-height: 1.1; }
.cloud__w.is-lead { color: var(--accent-light); }
.cloud__empty { font-size: clamp(18px, 2vw, 34px); color: #9aa1bd; margin: 0; }
.screen__idle { text-align: center; }
.screen__idle-title { font-family: var(--serif); font-size: clamp(44px, 7vw, 120px); line-height: 1.05; margin: 0 0 2vh; }
.screen__idle-sub { font-size: clamp(18px, 2vw, 34px); color: #aeb4cc; margin: 0; }
.screen__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 3vh 8vw 4vh;
  font-size: clamp(14px, 1.5vw, 26px); color: #aeb4cc;
}
.screen__cta { margin: 0; display: flex; align-items: center; gap: .5em; flex-wrap: wrap; }
.screen__cta strong { color: var(--paper); font-weight: 600; }
.screen__brand { margin: 0; font-family: var(--serif); color: var(--accent-light); white-space: nowrap; }
.screen__dot { width: .55em; height: .55em; border-radius: 50%; background: #ff5a6e; animation: pulse 2s ease-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .sbar__fill { transition: none; }
  .screen__dot, .state.is-live::before { animation: none; }
}

/* fixes */
.pform label.check { display: inline-flex; gap: 8px; align-items: center; }
.pform input[type='checkbox'], .p input[type='checkbox'], .check input { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); }
a.act { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
.nw { white-space: nowrap; }

/* ---------- Public page on wide screens ----------
   Night sky with stars as the frame of the whole page, the question large on the left, the form on a white card on
   the right. Phones keep the header band above. An open poll takes the place of the headline. */
@media (min-width: 900px) {
  .public {
    background-color: var(--primary);
    background-image:
      radial-gradient(1.5px 1.5px at 7% 14%, rgba(255, 255, 255, .75), transparent),
      radial-gradient(1px 1px at 16% 62%, rgba(255, 255, 255, .55), transparent),
      radial-gradient(1px 1px at 23% 31%, rgba(255, 255, 255, .4), transparent),
      radial-gradient(1.5px 1.5px at 31% 86%, rgba(232, 214, 176, .6), transparent),
      radial-gradient(1px 1px at 38% 9%, rgba(255, 255, 255, .6), transparent),
      radial-gradient(1px 1px at 47% 72%, rgba(255, 255, 255, .35), transparent),
      radial-gradient(1.5px 1.5px at 54% 21%, rgba(232, 214, 176, .7), transparent),
      radial-gradient(1px 1px at 61% 93%, rgba(255, 255, 255, .5), transparent),
      radial-gradient(1px 1px at 68% 6%, rgba(255, 255, 255, .45), transparent),
      radial-gradient(1.5px 1.5px at 76% 12%, rgba(255, 255, 255, .6), transparent),
      radial-gradient(1px 1px at 84% 90%, rgba(255, 255, 255, .55), transparent),
      radial-gradient(1px 1px at 91% 24%, rgba(232, 214, 176, .6), transparent),
      radial-gradient(1.5px 1.5px at 96% 67%, rgba(255, 255, 255, .5), transparent),
      radial-gradient(1px 1px at 3% 44%, rgba(255, 255, 255, .4), transparent),
      radial-gradient(1px 1px at 11% 91%, rgba(255, 255, 255, .5), transparent),
      radial-gradient(60% 70% at 100% 105%, color-mix(in srgb, var(--accent-light) 16%, transparent), transparent 70%),
      radial-gradient(70% 80% at 0% 0%, var(--primary-2) 0%, transparent 70%),
      linear-gradient(160deg, var(--primary) 0%, var(--primary) 50%, var(--primary-2) 100%);
    background-attachment: fixed;
  }
  ::selection { background: var(--accent-light); color: var(--primary); }

  .brand, body:has(.poll:not([hidden])) .brand {
    width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 48px 0; background: none;
    flex-direction: row-reverse; justify-content: flex-end; gap: 12px;
  }
  .brand__heart { height: 26px; }
  .brand__text { flex: 1; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 24px; }
  .brand__name { font-size: 20px; }
  .brand__event { font-size: 13px; font-weight: 500; letter-spacing: .08em; }

  .wrap { max-width: 1200px; margin: 0 auto; padding: 48px 48px 40px; justify-content: center; }
  .wrap:has(> .poll:not([hidden])) { margin-top: 0; }
  .wrap > .card.calm { width: 100%; max-width: 560px; align-self: center; padding: 48px 40px; box-shadow: 0 24px 60px rgba(4, 7, 20, .45); }

  #ask {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 480px); column-gap: clamp(48px, 8vw, 112px);
    grid-template-rows: 1fr auto auto 1fr; align-items: start;
    padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none;
  }
  #ask > .title { grid-column: 1; grid-row: 2; margin: 0 0 22px; color: var(--paper); font-size: clamp(44px, 4.4vw, 60px); line-height: 1.08; letter-spacing: -.012em; text-wrap: balance; }
  #ask > .lead { grid-column: 1; grid-row: 3; margin: 0; max-width: 36ch; color: #d9dce8; font-size: 20px; line-height: 1.5; text-wrap: pretty; }
  #ask > .notice { grid-column: 1; grid-row: 4; margin-top: 20px; }
  #ask > form, #ask > .done { grid-column: 2; grid-row: 1 / -1; background: var(--card); border-radius: 10px; padding: 32px; box-shadow: 0 24px 60px rgba(4, 7, 20, .45); }
  #ask > .done { padding: 48px 32px 32px; }
  #ask.is-sent > .title, #ask.is-sent > .lead { display: block; }
  textarea { min-height: 188px; caret-color: var(--accent); }
  .hint { color: var(--text-3); }

  /* An open poll: the poll on the left, the question form stays on the right. */
  .wrap:has(> .poll:not([hidden])) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 480px); column-gap: clamp(48px, 8vw, 112px); align-items: center; align-content: center;
  }
  .join { grid-column: 1 / -1; max-width: 560px; width: 100%; margin: 0 auto 24px; box-sizing: border-box; }
  .wrap:has(> .poll:not([hidden])) > #ask { display: contents; }
  .wrap:has(> .poll:not([hidden])) > #ask > .title,
  .wrap:has(> .poll:not([hidden])) > #ask > .lead { display: none; }
  .wrap:has(> .poll:not([hidden])) > #ask > form,
  .wrap:has(> .poll:not([hidden])) > #ask > .done { grid-column: 2; grid-row: 1; }
  .wrap > .poll { grid-column: 1; grid-row: 1; background: var(--primary-2); border-radius: 10px; padding: 32px; border-color: color-mix(in srgb, var(--accent-light) 40%, transparent); box-shadow: 0 24px 60px rgba(4, 7, 20, .45); }
  .poll__q { font-size: 31px; }

  .watch { max-width: 1200px; padding: 0 48px 24px; display: flex; align-items: center; gap: 16px; text-align: left; }
  .watch__text { margin: 0; font-size: 16px; color: #d9dce8; }
  .watch__btn { width: auto; min-height: 44px; padding: 0 22px; font-size: 15px; color: var(--paper); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-light) 60%, transparent); }
  .watch__btn:hover { background: color-mix(in srgb, var(--accent-light) 14%, transparent); }
  .foot { width: 100%; max-width: 1200px; padding: 0 48px 28px; text-align: left; color: #aeb4c9; }
  .foot a { color: var(--paper); }
}
