/* Live streaming — scoped styles (uses the app's existing :root theme vars).
   Deliberately mirrors lectures.css: same page header, same seg buttons, same
   card surfaces, so Live does not look like a different product bolted on. */
#live .lv-phdr{margin-bottom:20px}
#live .lv-title{font-family:'Syne',sans-serif;font-size:22px;font-weight:800}
#live .lv-sub{font-size:12.5px;color:var(--mut);margin-top:4px;max-width:660px;line-height:1.55}
#live .lv-load,#live .lv-empty{font-size:13px;color:var(--mut);padding:16px 2px}

/* ── session rows (mirrors .lec-grp) ── */
#live .lv-row{background:var(--sur);border:1px solid var(--bdr);border-radius:14px;margin-bottom:12px;overflow:hidden}
#live .lv-head{display:flex;align-items:center;gap:12px;padding:14px 16px;flex-wrap:wrap;min-width:0}
#live .lv-ic{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:16px;flex:none;background:rgba(255,255,255,.05);border:1px solid var(--bdr)}
#live .lv-nm{font-weight:700;font-size:14.5px;flex:1 1 190px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#live .lv-meta{color:var(--mut);font-size:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#live .lv-row.ended{opacity:.68}

/* ── badges ── */
#live .lv-b{font-size:10px;font-weight:800;letter-spacing:1px;padding:3px 9px;border-radius:20px;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;flex-shrink:0}
#live .lv-b.live{background:rgba(255,59,59,.14);color:var(--red);box-shadow:0 0 0 1px rgba(255,59,59,.4)}
#live .lv-b.live::before{content:'';width:6px;height:6px;border-radius:50%;background:var(--red);box-shadow:0 0 8px var(--red);animation:crnxLivePulse 1.4s infinite}
#live .lv-b.up{background:rgba(91,159,255,.12);color:var(--blu);box-shadow:0 0 0 1px rgba(91,159,255,.35)}
#live .lv-b.wait{background:rgba(251,146,60,.12);color:var(--org);box-shadow:0 0 0 1px rgba(251,146,60,.35)}
#live .lv-b.err{background:rgba(255,59,59,.10);color:var(--red);box-shadow:0 0 0 1px rgba(255,59,59,.3)}
#live .lv-b.end{background:var(--sur2);color:var(--mut)}
#live .lv-rec{font-size:10.5px;font-weight:600;color:var(--mut);background:var(--sur2);border-radius:20px;padding:3px 9px;white-space:nowrap;flex-shrink:0}

/* ── buttons ── */
#live .lv-btn{background:rgba(var(--gG),.12);border:1px solid rgba(var(--gG),.5);color:var(--acc);padding:9px 16px;border-radius:10px;font-weight:700;font-size:13px;cursor:pointer;font-family:inherit;white-space:nowrap}
#live .lv-btn:disabled{opacity:.5;cursor:not-allowed}
#live .lv-btn.red{background:rgba(255,59,59,.1);border-color:rgba(255,59,59,.5);color:var(--red)}
#live .lv-btn.ghost{background:transparent;border-color:var(--bdr2);color:var(--txt)}
#live .lv-btn.sm{padding:6px 12px;font-size:12px}

/* ── forms / cards ── */
#live .lv-card{background:var(--sur2);border:1px solid var(--bdr);border-radius:12px;padding:16px;margin-bottom:12px}
#live .lv-card.hot{border-color:rgba(255,59,59,.35)}
#live .lv-note{font-size:11.5px;color:var(--mut);margin-top:10px;line-height:1.55}
#live .lv-note b{color:var(--org)}
#live .lv-tglrow{display:flex;align-items:center;gap:10px;font-size:13px;margin-top:12px}
#live .lv-tgl{width:38px;height:20px;border-radius:20px;background:rgba(var(--gG),.25);border:1px solid rgba(var(--gG),.6);position:relative;cursor:pointer;flex-shrink:0}
#live .lv-tgl::after{content:'';position:absolute;width:14px;height:14px;border-radius:50%;background:var(--acc);top:2px;right:2px;box-shadow:0 0 8px rgba(var(--gG),.8)}
#live .lv-tgl.off{background:rgba(255,255,255,.07);border-color:var(--bdr2)}
#live .lv-tgl.off::after{left:2px;right:auto;background:var(--mut);box-shadow:none}

/* ── stats ── */

/* ── OBS credentials ── */
#live .lv-key{background:var(--bg);border:1px solid var(--bdr2);border-radius:10px;padding:11px 12px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:11.5px;display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:8px;min-width:0}
#live .lv-key .val{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}

/* ── stage: player + chat (grid itself lives in the v2 block below) ── */
#live .lv-player{position:relative;aspect-ratio:16/9;background:#0d0f14;border:1px solid var(--bdr);border-radius:12px;overflow:hidden;min-width:0;max-height:calc(100vh - 180px)}
#live .lv-player iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
#live .lv-ph{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--mut);font-size:12.5px;text-align:center;padding:16px}
#live .lv-tag{position:absolute;top:8px;left:8px;z-index:2;font-size:10px;font-weight:600;background:rgba(0,0,0,.78);color:#fff;padding:2px 7px;border-radius:5px;max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:none;font-family:inherit}
#live .lv-tag.jump{cursor:pointer}
#live .lv-tag.jump:hover{background:rgba(255,59,59,.85)}

/* ── chat ── */
#live .lv-chat{background:var(--sur);border:1px solid var(--bdr);border-radius:12px;display:flex;flex-direction:column;height:auto;min-height:300px;min-width:0}
#live .lv-chat .hd{padding:10px 12px;border-bottom:1px solid var(--bdr);font-size:12px;font-weight:700;display:flex;align-items:center;gap:8px}
#live .lv-msgs{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:10px 12px;display:flex;flex-direction:column;gap:9px;font-size:12.5px}
#live .lv-m{line-height:1.45;overflow-wrap:anywhere;word-break:break-word}
#live .lv-m b{color:var(--acc);font-weight:600;font-size:11.5px}
#live .lv-m.del{color:var(--mut);font-style:italic}
#live .lv-m .x{color:var(--red);cursor:pointer;font-size:10px;font-weight:700;margin-left:6px;background:none;border:none;padding:0}
#live .lv-in{border-top:1px solid var(--bdr);padding:9px;display:flex;gap:8px}
#live .lv-in input{flex:1;min-width:0;background:var(--field);border:1px solid var(--bdr2);border-radius:8px;color:var(--txt);padding:8px 10px;font-size:12.5px;font-family:inherit}
#live .lv-in input:disabled{opacity:.45}
#live .lv-mutenote{font-size:11px;color:var(--org);padding:4px 12px 8px}

/* ── the sidebar LIVE pill (lives on the rail button, not inside #live) ── */
.crnx-livepill{display:inline-flex;align-items:center;gap:5px;margin-left:auto;flex-shrink:0;font-size:8.5px;font-weight:800;letter-spacing:1px;color:var(--red);background:rgba(255,59,59,.12);border:1px solid rgba(255,59,59,.4);border-radius:20px;padding:2px 7px;animation:crnxLivePulse 1.4s infinite}
.crnx-livepill::before{content:'';width:6px;height:6px;border-radius:50%;background:var(--red);box-shadow:0 0 8px var(--red)}
.crnx-livepill::after{content:'LIVE'}
@keyframes crnxLivePulse{0%,100%{opacity:1}50%{opacity:.4}}
@media (prefers-reduced-motion: reduce){.crnx-livepill,#live .lv-b.live::before{animation:none}}

/* ═══════════ v2 (2026-08-16) — hero feed, theater, compact console ═══════════ */
#live .lv-sect{font-family:'Syne',sans-serif;font-size:12.5px;font-weight:700;color:var(--mut);text-transform:uppercase;letter-spacing:1.5px;margin:20px 0 10px}

/* hero: the class that is ON is not a list row */
#live .lv-hero{background:linear-gradient(135deg,rgba(255,59,59,.10),var(--sur2) 55%);border:1px solid rgba(255,59,59,.35);border-radius:16px;padding:16px;display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-bottom:6px}
#live .lv-hthumb{width:180px;aspect-ratio:16/9;background:#0d0f14;border:1px solid var(--bdr);border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:26px;flex:none}
#live .lv-hbody{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:5px;align-items:flex-start}
/* v6: LIVE badge + subject pill share one line above the hero title */
#live .lv-hbadges{display:flex;align-items:center;gap:6px;flex-wrap:wrap;max-width:100%}
#live .lv-ht{font-family:'Syne',sans-serif;font-size:17px;font-weight:800;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#live .lv-hm{font-size:12px;color:var(--mut);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* card grid (upcoming + recordings) */
#live .lv-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px}
#live .lv-card{display:block;text-align:left;background:var(--sur);border:1px solid var(--bdr);border-radius:12px;overflow:hidden;cursor:pointer;padding:0;font-family:inherit;color:var(--txt);transition:border-color .15s,transform .15s;min-width:0}
#live .lv-card:hover{border-color:rgba(var(--gG),.4);transform:translateY(-2px)}
#live .lv-thumb{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:16/9;background:#0d0f14;border-bottom:1px solid var(--bdr);font-size:24px}
#live .lv-cal{position:absolute;top:8px;left:8px;background:rgba(0,0,0,.8);border:1px solid rgba(91,159,255,.4);color:var(--blu);border-radius:6px;padding:3px 8px;font-size:10px;font-weight:800;white-space:nowrap;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis}
#live .lv-dur{position:absolute;right:8px;bottom:8px;background:rgba(0,0,0,.78);color:#fff;font-size:10px;font-weight:600;padding:2px 7px;border-radius:5px}
#live .lv-cb{display:block;padding:11px 13px;min-width:0}
#live .lv-cnm{display:block;font-weight:700;font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#live .lv-cmm{display:flex;gap:8px;align-items:center;flex-wrap:wrap;color:var(--mut);font-size:11.5px;margin-top:4px;min-width:0}
#live .lv-cmm>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}

/* theater stage — NO width cap. The player column is sized from the viewport
   HEIGHT (the biggest 16:9 box that fits without scrolling), and the chat takes
   every remaining pixel of width. Nothing is left empty on wide screens, and the
   bounded player box keeps Cloudflare's in-player controls at a sane size (they
   scale with the box — the only handle we have on that cross-origin iframe). */
#live .lv-stage{display:grid;grid-template-columns:minmax(0,calc((100vh - 180px)*1.7778)) minmax(320px,1fr);gap:14px;align-items:stretch}
#live .lv-left{min-width:0}
#live .lv-under{display:flex;align-items:center;gap:10px;margin-top:10px;flex-wrap:wrap;min-width:0}
#live .lv-av{width:30px;height:30px;border-radius:50%;background:var(--sur2);border:1px solid var(--bdr2);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex:none}
#live .lv-ut{font-family:'Syne',sans-serif;font-size:16px;font-weight:800;flex:1 1 180px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#live .lv-fs{background:rgba(255,255,255,.06);border:1px solid var(--bdr2);color:var(--txt);border-radius:8px;padding:6px 12px;font-size:11.5px;font-weight:600;cursor:pointer;font-family:inherit;white-space:nowrap}
#live .lv-fs.on{background:rgba(var(--gG),.12);border-color:rgba(var(--gG),.5);color:var(--acc)}

/* chat v2 */
#live .lv-chat .hd .n{margin-left:auto;color:var(--mut);font-weight:600;font-size:11px}
#live .lv-m{display:flex;gap:8px;align-items:flex-start}
#live .lv-m .av{width:22px;height:22px;border-radius:50%;background:var(--sur2);border:1px solid var(--bdr);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;flex:none}
#live .lv-m .bd{min-width:0;flex:1;overflow-wrap:anywhere}
/* name · moderation ✕ · send time — one row, time pinned right (v6) */
#live .lv-m .toprow{display:flex;align-items:baseline;gap:8px;min-width:0}
#live .lv-m .toprow b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#live .lv-m .t{margin-left:auto;color:var(--mut2,#8a8a9a);font-size:10px;font-weight:500;flex:none;white-space:nowrap}
#live .lv-m.host .bd{background:rgba(251,146,60,.07);border:1px solid rgba(251,146,60,.2);border-radius:8px;padding:5px 8px}
#live .lv-m.host b{color:var(--org)}
#live .lv-m.del{display:block}
#live .lv-newmsg{align-self:center;margin:0 auto 6px;background:rgba(var(--gG),.15);border:1px solid rgba(var(--gG),.5);color:var(--acc);font-size:10.5px;font-weight:700;border-radius:16px;padding:4px 12px;cursor:pointer;font-family:inherit}

/* one-time OBS setup */
#live .lv-setup.done .ok{color:var(--acc);font-weight:800}
#live .lv-setup .t{font-weight:700;font-size:13px;margin-bottom:8px}
#live .lv-step{display:flex;gap:10px;align-items:flex-start;margin:8px 0;font-size:12.5px;color:var(--mut)}
#live .lv-step b{color:var(--txt)}

/* compact console strip */
#live .lv-con{background:var(--sur2);border:1px solid rgba(255,59,59,.35);border-radius:14px;padding:12px 14px;margin-bottom:12px}
#live .lv-strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
#live .lv-sep{width:1px;height:20px;background:var(--bdr2);flex:none;margin:0 2px}
#live .lv-strip .lv-tglrow{margin-top:0;font-size:12.5px;flex:none}
#live .lv-dot{width:12px;height:12px;border-radius:50%;flex:none;background:var(--mut)}
#live .lv-dot.live{background:var(--red);box-shadow:0 0 14px var(--red);animation:crnxLivePulse 1.4s infinite}
#live .lv-dot.wait{background:var(--org);box-shadow:0 0 10px rgba(251,146,60,.6)}
#live .lv-dot.bad{background:var(--red)}
#live .lv-state{font-family:'Syne',sans-serif;font-size:15px;font-weight:800;flex:none}
#live .lv-state.on{color:var(--red)}
#live .lv-state.bad{color:var(--org)}
#live .lv-ctitle{font-size:12.5px;color:var(--mut);flex:1 1 140px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#live .lv-pill{font-size:11px;font-weight:700;background:var(--bg);border:1px solid var(--bdr);border-radius:16px;padding:3px 10px;white-space:nowrap;flex:none}
#live .lv-pill.grn{color:var(--acc);border-color:rgba(var(--gG),.35)}
#live .lv-pill.red{color:var(--red);border-color:rgba(255,59,59,.35)}
#live .lv-hint{font-size:12px;color:var(--txt);margin-top:10px;line-height:1.6}
#live .lv-hint b{color:var(--txt)}

/* ── mobile ── */
@media(max-width:900px){
  #live .lv-stage{grid-template-columns:minmax(0,1fr)}
  #live .lv-fs{display:none}            /* theater is meaningless with no rails; use the player's fullscreen */
  #live .lv-hthumb{width:100%;flex-basis:100%}
  #live .lv-cards{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
  #live .lv-ctitle{flex-basis:100%;order:9}   /* wrap to its own line instead of truncating to nothing */
  #live .lv-sep{display:none}                 /* the one-row console wraps; a divider mid-wrap is noise */
  #live .lv-title{font-size:19px}
  #live .lv-key .val{font-size:10px}
  #live .lv-chat{height:320px;min-height:0}
}
@media(max-width:420px){
  #live .lv-cards{grid-template-columns:minmax(0,1fr)}
  #live .lv-hero{padding:12px;gap:10px}
  #live .lv-ht{font-size:15px}
  #live .lv-strip{gap:8px}
}

/* ═══ v3 (2026-08-18) — themed chips, neutral setup, house batch, exam-style scheduler ═══ */
/* Exam-scheduler controls, cloned VERBATIM from #orgexams .seIn/.seDT/.seWhenLbl
   (they are scoped there, not global — restating them under #live is the reuse). */
#live .seIn{background:var(--sur);border:1px solid var(--bdr);border-radius:9px;color:var(--txt);padding:9px 12px;font:inherit;box-sizing:border-box;color-scheme:dark}
#live .seDT{display:flex;gap:8px;flex-wrap:wrap}
#live .seWhenLbl{color:var(--mut);font-size:11px;margin-bottom:5px}
#live .lv-cardhd{font-weight:700;font-size:14px;margin-bottom:12px}
#live .lv-row2{display:grid;grid-template-columns:1.4fr 1fr;gap:10px}
#live .lv-fld{background:var(--field);border:1px solid var(--bdr2);border-radius:9px;color:var(--txt);padding:10px 12px;font:inherit;font-size:13px;width:100%;min-width:0;color-scheme:dark}
#live .lv-startrow{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;margin-top:10px}
#live .lv-startsel{min-width:170px}
#live .lv-dim{color:var(--mut2,#8a8a9a);font-weight:500;font-size:11px}
#live .lv-batchrow{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--mut);flex-wrap:wrap;margin-top:12px}
#live .lv-batchsel{background:var(--field);border:1px solid var(--bdr);color:var(--txt);border-radius:8px;padding:7px 11px;font:inherit;font-size:12.5px;max-width:230px}
#live .lv-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
#live .lv-chips label{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--txt);background:var(--field);border:1px solid var(--bdr);border-radius:7px;padding:5px 9px;cursor:pointer}
#live .lv-chips input{accent-color:var(--acc)}
/* the fixed COPY/SHOW: themed chips on the crnxBtnGhost scale — accent on hover only */
#live .lv-chip{background:var(--sur2);border:1px solid var(--bdr2);color:var(--txt);border-radius:7px;padding:5px 10px;font-family:'DM Sans',sans-serif;font-size:10.5px;font-weight:700;letter-spacing:.4px;cursor:pointer;flex-shrink:0}
#live .lv-chip:hover{border-color:rgba(var(--gG),.5);color:var(--acc)}
#live .lv-chiprow{display:flex;gap:6px;flex-shrink:0}
/* neutral one-time setup: ONE accent per zone — the card itself stays grey */
#live .lv-setup{background:var(--sur);border:1px solid var(--bdr);border-radius:12px;padding:14px;margin-bottom:12px}
#live .lv-setup .t{font-weight:700;font-size:13px;margin-bottom:10px;display:flex;align-items:center;gap:8px;color:var(--txt)}
#live .lv-setup.done{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12.5px;color:var(--mut)}
#live .lv-setup.done .ok{color:var(--acc);font-weight:800}
#live .lv-setup.done b{color:var(--txt)}
#live .lv-step .n{width:18px;height:18px;border-radius:50%;background:var(--sur2);border:1px solid var(--bdr2);color:var(--mut2,#8a8a9a);font-size:10.5px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:none;align-self:center}
#live .lv-key .lab{color:var(--mut)}
#live .lv-link{background:none;border:none;padding:0;color:var(--mut2,#8a8a9a);font:inherit;font-size:inherit;font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:2px}
#live .lv-link:hover{color:var(--acc)}
#live .lv-foot{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;font-size:11.5px;color:var(--mut)}
#live .lv-footnote{flex:1 1 100%;font-size:11px;color:var(--mut)}
@media(max-width:560px){#live .lv-row2{grid-template-columns:minmax(0,1fr)}}

/* ═══ v5 (2026-08-18) — recordings filed by subject ═══════════════════════════
   .lec-grp and its children are scoped to #lectures in lectures.css, so they are
   cloned here under #live rather than reached for — the same reuse pattern the
   .seIn exam controls follow. The grayscale+opacity on .lv-gic is copied verbatim
   from .lec-gic: that IS the house icon treatment, do not colourise it. */
#live .lv-grp{background:var(--sur);border:1px solid var(--bdr);border-radius:14px;margin-bottom:12px;overflow:hidden}
#live .lv-ghead{display:flex;align-items:center;gap:12px;padding:14px 16px;cursor:pointer;min-width:0}
#live .lv-gic{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:17px;flex:none;background:rgba(255,255,255,.05);border:1px solid var(--bdr);filter:grayscale(1);opacity:.85}
#live .lv-gnm{font-weight:700;font-size:14.5px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#live .lv-gcount{color:var(--mut);font-size:12px;white-space:nowrap;flex:none}
#live .lv-gcount.has{color:var(--acc)}
#live .lv-chev{color:var(--mut);font-size:18px;flex:none;transition:transform .15s}
#live .lv-grp.open .lv-chev{transform:rotate(90deg)}
#live .lv-gbody{display:none;padding:0 16px 16px}
#live .lv-grp.open .lv-gbody{display:block}
#live .lv-gempty{color:var(--mut);font-size:12.5px;padding:4px 0 8px}
#live .lv-subjpill{font-size:10.5px;font-weight:700;color:var(--blu);background:rgba(91,159,255,.1);border:1px solid rgba(91,159,255,.35);border-radius:14px;padding:2px 9px;white-space:nowrap;flex-shrink:0}
#live .lv-subjsel{min-width:190px}
@media(max-width:900px){#live .lv-gic{width:26px;height:26px;font-size:13px}}
@media(prefers-reduced-motion: reduce){#live .lv-chev{transition:none}}

/* ═══ v7 (2026-08-19) — live polls ═══════════════════════════════════════════
   All-new classes; nothing above is modified. Colour follows the house rule:
   green while a poll is open, neutral once closed, red only for the destructive
   Close action and the final-30s countdown. No new palette is introduced. */
#live .lv-seg{display:flex;gap:6px;padding:9px 10px;border-bottom:1px solid var(--bdr)}
#live .lv-segb{flex:1;background:transparent;border:1px solid var(--bdr);color:var(--mut);border-radius:9px;padding:6px 10px;cursor:pointer;font:inherit;font-size:11.5px;font-weight:700}
#live .lv-segb.on{border-color:rgba(var(--gG),.6);color:var(--acc);box-shadow:0 0 10px rgba(var(--gG),.25)}
#live .lv-segdot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--red);margin-left:5px;vertical-align:middle;animation:crnxLivePulse 1.4s infinite}
#live .lv-pollslot{padding:10px 10px 0;display:flex;flex-direction:column;gap:9px;max-height:300px;overflow-y:auto}
#live .lv-plist{padding:10px;display:flex;flex-direction:column;gap:8px;overflow-y:auto;flex:1;min-height:0}

/* the poll card, shared by both sides */
#live .lv-pollc{background:var(--sur2);border:1px solid rgba(var(--gG),.35);border-radius:12px;padding:11px 12px;font-size:12.5px}
#live .lv-pollc.closed{border-color:var(--bdr)}
#live .lv-pollhd{display:flex;align-items:center;gap:7px;margin-bottom:8px}
#live .lv-polltag{font-size:9.5px;font-weight:800;letter-spacing:1px;color:var(--acc);background:rgba(var(--gG),.12);border:1px solid rgba(var(--gG),.4);border-radius:20px;padding:2px 8px;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
#live .lv-polltag::before{content:'';width:5px;height:5px;border-radius:50%;background:var(--acc);animation:crnxLivePulse 1.4s infinite}
#live .lv-polltag.done{color:var(--mut);background:var(--sur);border-color:var(--bdr)}
#live .lv-polltag.done::before{display:none}
#live .lv-polltime{margin-left:auto;font-size:11px;font-weight:700;color:var(--mut);font-variant-numeric:tabular-nums}
#live .lv-polltime.low{color:var(--red)}
#live .lv-pollq{font-weight:700;font-size:12.5px;line-height:1.45;margin-bottom:9px;color:var(--txt);overflow-wrap:anywhere}
#live .lv-popt{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:var(--sur);border:1px solid var(--bdr2);border-radius:9px;padding:8px 10px;margin-bottom:6px;color:var(--txt);font:inherit;font-size:12px;cursor:pointer;overflow-wrap:anywhere}
#live .lv-popt:hover:not(:disabled){border-color:rgba(var(--gG),.5)}
#live .lv-popt .k{width:20px;height:20px;border-radius:5px;background:var(--sur2);border:1px solid var(--bdr);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;color:var(--mut);flex:none}
#live .lv-popt.picked{border-color:rgba(var(--gG),.6);box-shadow:0 0 10px rgba(var(--gG),.2)}
#live .lv-popt.picked .k{background:rgba(var(--gG),.15);color:var(--acc);border-color:rgba(var(--gG),.5)}
#live .lv-popt:disabled{cursor:default;opacity:.9}
#live .lv-pres{margin-bottom:8px}
#live .lv-presTop{display:flex;align-items:baseline;gap:8px;font-size:12px;margin-bottom:4px}
#live .lv-presTop .lbl{flex:1;min-width:0;overflow-wrap:anywhere}
#live .lv-presTop .pct{font-weight:800;font-variant-numeric:tabular-nums;color:var(--mut);flex:none}
#live .lv-mine{font-size:10px;color:var(--mut2);white-space:nowrap;flex:none}
#live .lv-pres.correct .lbl{color:var(--acc);font-weight:700}
#live .lv-pres.correct .pct{color:var(--acc)}
#live .lv-pbar{height:8px;background:var(--sur);border-radius:5px;overflow:hidden}
#live .lv-pbar>i{display:block;height:100%;background:var(--mut);border-radius:5px;transition:width .35s}
#live .lv-pres.correct .lv-pbar>i{background:var(--acc)}
#live .lv-pollfoot{font-size:11px;color:var(--mut);margin-top:8px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#live .lv-pollfoot .lv-btn{margin-left:auto}
#live .lv-polllock{font-size:11.5px;color:var(--acc);background:rgba(var(--gG),.08);border:1px solid rgba(var(--gG),.3);border-radius:8px;padding:7px 9px;margin-top:3px}
#live .lv-pollnote{font-size:11.5px;color:var(--mut);margin-top:8px;line-height:1.5}
#live .lv-pollempty{font-size:12px;color:var(--mut);line-height:1.55;padding:6px 2px}
#live .lv-psent{opacity:.55}

/* library rows (console list + the Live-screen section) */
#live .lv-pitem{background:var(--sur2);border:1px solid var(--bdr);border-radius:10px;padding:9px 10px}
#live .lv-gbody .lv-pitem{margin-bottom:8px}
#live .lv-pitemq{font-size:12px;font-weight:600;line-height:1.4;margin-bottom:7px;overflow-wrap:anywhere}
#live .lv-pitemr{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
#live .lv-pitemr .meta{color:var(--mut);font-size:11px;flex:1 1 120px;min-width:0}
#live .lv-pollfootrow{margin-top:12px}

/* builder overlay */
.lv-ov{position:fixed;inset:0;background:rgba(0,0,0,.72);z-index:100002;display:flex;align-items:flex-start;justify-content:center;padding:28px 16px;overflow-y:auto}
.lv-ovcard{background:var(--sur2);border:1px solid var(--bdr);border-radius:14px;padding:18px;width:100%;max-width:560px}
.lv-ovcard .lv-cardhd{font-weight:700;font-size:14px;margin-bottom:12px}
.lv-ovcard .lv-fld{background:var(--field);border:1px solid var(--bdr2);border-radius:9px;color:var(--txt);padding:10px 12px;font:inherit;font-size:13px;width:100%;color-scheme:dark}
.lv-ovcard .lv-fld:focus{outline:none;border-color:rgba(var(--gG),.5)}
.lv-ovcard .seIn{background:var(--sur);border:1px solid var(--bdr);border-radius:9px;color:var(--txt);padding:9px 12px;font:inherit;box-sizing:border-box;color-scheme:dark}
.lv-ovcard .seWhenLbl{color:var(--mut);font-size:11px;margin-bottom:5px}
.lv-ovcard .lv-startrow{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;margin-top:14px}
.lv-ovcard .lv-dim{color:var(--mut2);font-weight:500;font-size:11px}
.lv-ovcard .lv-btn{background:rgba(var(--gG),.12);border:1px solid rgba(var(--gG),.5);color:var(--acc);padding:9px 16px;border-radius:10px;font-weight:700;font-size:13px;cursor:pointer;font-family:inherit}
.lv-ovcard .lv-btn:disabled{opacity:.4;cursor:not-allowed}
.lv-ovcard .lv-btn.ghost{background:transparent;border-color:var(--bdr2);color:var(--txt)}
.lv-ovcard .lv-chip{background:var(--sur2);border:1px solid var(--bdr2);color:var(--txt);border-radius:7px;padding:5px 10px;font-family:'DM Sans',sans-serif;font-size:10.5px;font-weight:700;letter-spacing:.4px;cursor:pointer}
.lv-ovcard .lv-chip:hover{border-color:rgba(var(--gG),.5);color:var(--acc)}
.lv-ovcard .lv-pollnote{font-size:11.5px;color:var(--mut);margin-top:10px}
.lv-pchoice{display:flex;align-items:center;gap:9px;margin-bottom:8px}
.lv-pletter{width:24px;height:24px;border-radius:6px;background:var(--sur);border:1px solid var(--bdr);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;color:var(--mut);flex:none}
.lv-pcorrect{width:26px;height:26px;border-radius:50%;border:1.5px solid var(--bdr2);background:transparent;cursor:pointer;flex:none;display:flex;align-items:center;justify-content:center;font-size:13px;color:transparent;font-family:inherit}
.lv-pcorrect.on{border-color:rgba(var(--gG),.7);background:rgba(var(--gG),.12);color:var(--acc)}
.lv-pdel{background:none;border:none;color:var(--mut);cursor:pointer;font-size:14px;padding:2px 5px;flex:none;font-family:inherit}
.lv-pdel:hover:not(:disabled){color:var(--red)}
.lv-pdel:disabled{opacity:.25;cursor:not-allowed}
@media(max-width:560px){.lv-ov{padding:14px 10px}.lv-ovcard{padding:14px}}
