/* Attendee remote (phone) */
html, body { height: 100%; }
body {
  font-size: 17px; line-height: 1.45;
  background:
    radial-gradient(120% 60% at 110% -10%, rgba(3, 231, 202, .10), transparent 60%),
    radial-gradient(90% 50% at -20% 110%, rgba(137, 72, 252, .08), transparent 60%),
    var(--paper);
  display: flex; flex-direction: column; min-height: 100%;
  padding: env(safe-area-inset-top) 0 0;
  overscroll-behavior-y: none;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: .88em; }
.center { text-align: center; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 8px; }
.top-logo { height: 30px; width: auto; display: block; }
.pill-help {
  border: 0; border-radius: 99px; padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--blue);
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box;
  border: 1.5px solid transparent; white-space: nowrap;
  box-shadow: 0 4px 14px -6px rgba(20, 70, 248, .35);
}

.stage { flex: 1; display: flex; flex-direction: column; padding: 8px 20px calc(118px + env(safe-area-inset-bottom)); max-width: 560px; width: 100%; margin: 0 auto; }
.view { flex: 1; display: flex; flex-direction: column; }
.view-center { justify-content: center; text-align: center; }
.big { font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; margin: 0 0 10px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 18px; }

/* Buttons */
.btn { border: 0; border-radius: 18px; padding: 15px 22px; font-weight: 700; font-size: 17px; transition: transform .12s ease, box-shadow .2s ease, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn.primary { color: #fff; background: var(--grad); box-shadow: 0 10px 24px -10px rgba(20, 70, 248, .7); }
.btn.ghost { background: var(--tint); color: var(--blue); }
.btn.block { display: block; width: 100%; }

/* Join */
.view-join { justify-content: center; }
.join input {
  width: 100%; font-size: 18px; padding: 16px 18px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card);
}
.join input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgba(20, 70, 248, .12); }
.err { color: var(--danger); min-height: 1.4em; margin: 8px 2px; font-size: 15px; }

/* Idle: the one ambient motion, a slow listening pulse built from the logo's dot */
.view-idle { justify-content: center; align-items: center; text-align: center; gap: 6px; }
.listen { position: relative; width: 120px; height: 120px; margin-bottom: 26px; }
.listen span { position: absolute; inset: 0; border-radius: 50%; background: var(--grad); opacity: .0; animation: pulse 3.6s ease-out infinite; }
.listen span:nth-child(1) { inset: 38px; opacity: 1; animation: breathe 3.6s ease-in-out infinite; }
.listen span:nth-child(2) { animation-delay: 0s; }
.listen span:nth-child(3) { animation-delay: 1.8s; }
@keyframes pulse { 0% { transform: scale(.35); opacity: .35; } 100% { transform: scale(1); opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.idle-msg { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; margin: 0 0 6px; max-width: 20ch; }

/* Question */
.view-q { padding-top: 6px; }
.qhead { margin-bottom: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--blue); background: var(--tint); padding: 6px 12px 6px 9px; border-radius: 99px; }
.chip svg { width: 16px; height: 16px; stroke: currentColor; fill: currentColor; }
.chip svg [fill="none"] { fill: none; }
.chip svg path:not([fill]) { fill: none; }
.qtext { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; margin: 14px 0 0; min-height: 1.2em; }
.saved { min-height: 1.4em; margin: 14px 2px 0; color: var(--muted); font-size: 15px; text-align: center; }
.saved.is-err { color: var(--danger); }

/* Slider */
.sl { background: var(--card); border-radius: 26px; padding: 18px 18px 14px; margin-bottom: 16px; box-shadow: 0 1px 0 var(--line); }
.sl-out { display: block; text-align: center; font-size: 76px; font-weight: 800; line-height: 1; letter-spacing: -.04em; margin: 4px 0 14px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sl-range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; --p: 44%; }
.sl-range::-webkit-slider-runnable-track { height: 18px; border-radius: 99px; background: linear-gradient(90deg, #01B0FD, #1446F8 60%, #8948FC) 0 0 / var(--p) 100% no-repeat, var(--line); }
.sl-range::-moz-range-track { height: 18px; border-radius: 99px; background: var(--line); }
.sl-range::-moz-range-progress { height: 18px; border-radius: 99px; background: linear-gradient(90deg, #01B0FD, #1446F8); }
.sl-range::-webkit-slider-thumb { -webkit-appearance: none; width: 40px; height: 40px; margin-top: -11px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 5px var(--blue), 0 6px 16px rgba(20, 70, 248, .35); }
.sl-range::-moz-range-thumb { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 5px solid var(--blue); }
.sl-ticks { display: flex; justify-content: space-between; padding: 0 12px; color: var(--faint); font-size: 12.5px; font-weight: 600; }
.sl-ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.sl-ends span:last-child { text-align: right; }

/* True or false */
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-btn {
  height: 150px; border-radius: 28px; font-size: 26px; font-weight: 800; letter-spacing: -.01em;
  background: var(--card); color: var(--ink); border: 2px solid var(--line); transition: transform .12s, background .2s, color .2s, border-color .2s;
}
.tf-btn:active { transform: scale(.97); }
.tf-btn.is-on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 14px 30px -14px rgba(20, 70, 248, .8); }

/* Emote */
.emo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.emo-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px 10px; border-radius: 20px; background: var(--card); border: 2px solid var(--line); transition: transform .12s, border-color .2s, background .2s; }
.emo-btn:active { transform: scale(.96); }
.emo-e { font-size: 34px; line-height: 1; }
.emo-l { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.emo-btn.is-on { border-color: var(--blue); background: var(--tint); }
.emo-btn.is-on .emo-l { color: var(--blue); }

/* Word cloud input and rank form */
.one { display: flex; gap: 10px; }
.one input { flex: 1; min-width: 0; font-size: 22px; font-weight: 600; padding: 14px 18px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); }
.one input:focus, .rank-form textarea:focus, .refl textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgba(20, 70, 248, .12); }
.rank-form textarea, .refl textarea { width: 100%; font-size: 18px; padding: 14px 16px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); resize: none; line-height: 1.4; }
.rank-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: 14px; }
.rank-meta .is-over { color: var(--danger); font-weight: 600; }
.refl .muted { margin: 8px 2px 14px; }

.rank-lead { margin: 0 0 12px; font-weight: 600; }
.vote { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vote-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; padding: 14px 16px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); transition: border-color .2s, background .2s; }
.vote-t { font-weight: 600; line-height: 1.3; }
.vote-v { flex: none; font-size: 13.5px; color: var(--muted); }
.vote-btn.is-on { border-color: var(--blue); background: var(--tint); }
.vote-btn.is-on .vote-v { color: var(--blue); font-weight: 700; }
.vote-btn.is-own { background: transparent; border-style: dashed; opacity: .75; }

/* Results */
.results { font-size: 16px; background: var(--card); border-radius: 24px; padding: 20px 18px; margin-bottom: 10px; }
.results .r-cloud { height: 260px; }
.results .r-reflect { box-shadow: inset 4px 0 0 var(--violet); padding-left: 1.2em; background: transparent; }

/* Ended */
.view-ended .ended-ok { display: inline-block; margin: 6px auto 0; padding: 12px 18px; border-radius: 16px; background: var(--tint); color: var(--blue); font-weight: 600; }

/* Engagement dock */
.dock {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5;
  display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 12px;
  max-width: 536px; margin: 0 auto; padding: 10px 16px 10px 10px; border: 0; border-radius: 24px; text-align: left;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px -14px rgba(19, 34, 55, .35), 0 0 0 1px rgba(19, 34, 55, .05);
}
.ring { grid-row: 1; grid-column: 1; width: 50px; height: 50px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
.dock-pct { grid-row: 1; grid-column: 1; justify-self: center; font-size: 12.5px; font-weight: 800; }
.dock-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.dock-text strong { font-size: 15px; }
.dock-text span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-rank { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.dock-rank strong { font-size: 20px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dock-rank span { font-size: 12px; color: var(--muted); }

/* Bottom sheets */
.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(19, 34, 55, 0); display: flex; align-items: flex-end; transition: background .22s; }
.sheet.is-open { background: rgba(19, 34, 55, .35); }
.sheet-card { width: 100%; max-width: 560px; margin: 0 auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 22px calc(22px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); max-height: 86vh; overflow: auto; }
.sheet.is-open .sheet-card { transform: none; }
.sheet-grab { width: 42px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.sheet p { margin: 0 0 14px; }
.lb { list-style: none; counter-reset: lb; margin: 4px 0 18px; padding: 0; display: grid; gap: 10px; }
.lb li { counter-increment: lb; display: grid; grid-template-columns: 26px minmax(0, 9em) 1fr 44px; align-items: center; gap: 10px; }
.lb li::before { content: counter(lb); font-weight: 800; color: var(--blue); text-align: center; }
.lb-n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-p { text-align: right; font-weight: 700; font-size: 14px; }
.help-meter { position: relative; margin: 6px 0 12px; }
.help-meter .r-track { height: 12px; }
.help-mark { position: absolute; top: -5px; width: 3px; height: 22px; border-radius: 2px; background: var(--ink); transform: translateX(-50%); }
