:root {
  --bg: #06070a;
  --bg2: #0d0f14;
  --panel: rgba(255,255,255,0.035);
  --panel2: rgba(255,255,255,0.06);
  --line: rgba(255,255,255,0.09);
  --line2: rgba(255,255,255,0.18);
  --text: #ece7dc;
  --muted: #8d8a83;
  --heat: #ff8a3d;
  --cool: #79c3ff;
  --done: #f2c879;
  --idle: #d9d3c6;
  --ok: #6fe3a1;
  --danger: #ff6b6b;
  --accent: var(--idle);
  --display: "Chakra Petch", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
}
body.phase-heat { --accent: var(--heat); }
body.phase-cool { --accent: var(--cool); }
body.phase-done { --accent: var(--done); }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; overflow-x: hidden; min-height: 100vh; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: .04em; margin: 0; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.sky {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    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.4px 1.4px at 64% 72%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1px 1px at 30% 82%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 90% 54%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1px 1px at 46% 8%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(1.2px 1.2px at 8% 60%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1px 1px at 55% 40%, rgba(255,255,255,.25), transparent 60%),
    radial-gradient(1px 1px at 22% 44%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(1px 1px at 84% 88%, rgba(255,255,255,.35), transparent 60%);
}
header.top, .view, .banner { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- header */
header.top { display: flex; align-items: center; gap: 14px; padding: 16px 28px; }
.brand { font-family: var(--display); font-weight: 600; letter-spacing: .32em; font-size: 13px; text-transform: uppercase; white-space: nowrap; }
.brand span { color: var(--accent); transition: color 1.2s ease; }
.tabs { display: flex; gap: 4px; margin-left: 18px; }
.tab { background: transparent; border: 1px solid transparent; padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.tab.active { color: var(--text); border-color: var(--line); background: var(--panel); }
.tab:disabled { opacity: .35; }
.pill {
  font: inherit; font-size: 12px; color: var(--muted); border: 1px solid var(--line); background: transparent;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.pill.ok { color: var(--text); }
.pill::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #555; margin-right: 8px; vertical-align: 1px; }
.pill.ok::before { background: var(--ok); }
.pill.warn::before { background: var(--heat); }

/* ---------------------------------------------------------------- controls */
button {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 17px; cursor: pointer; transition: background .2s, border-color .2s, opacity .2s, color .2s;
}
button:hover:not(:disabled) { background: rgba(255,255,255,.08); border-color: var(--line2); }
button:disabled { opacity: .35; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); color: #0b0b0d; border-color: transparent; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
button.ghost { background: transparent; }
button.danger { color: var(--danger); }
button.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
button.icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; }
button.icon.big { width: 54px; height: 54px; background: var(--text); color: #0b0b0d; border-color: transparent; }
button.icon.big:hover:not(:disabled) { background: var(--text); filter: brightness(1.1); }
button.icon svg { width: 20px; height: 20px; fill: currentColor; }
button.icon.big svg { width: 24px; height: 24px; }
button.icon .i-play { display: none; }
button.icon.is-paused .i-play { display: block; }
button.icon.is-paused .i-pause { display: none; }

input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], select, textarea {
  font: inherit; color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; width: 100%;
}
textarea { resize: vertical; line-height: 1.55; min-height: 80px; }
select { width: auto; min-width: 180px; }
input[type=range] { width: 100%; accent-color: var(--text); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--text); flex: none; }
label.f, .f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.chk { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
label.radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14px; line-height: 1.45; }
label.radio input { margin-top: 2px; }
.code { font-family: var(--mono); font-size: 13px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; user-select: all; word-break: break-all; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 16px; }
.val { color: var(--text); font-variant-numeric: tabular-nums; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: rgba(111,227,161,.35); }
.chip.warn { color: var(--heat); border-color: rgba(255,138,61,.35); }
.chip.info { color: var(--cool); border-color: rgba(121,195,255,.35); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.label { font-family: var(--display); text-transform: uppercase; letter-spacing: .24em; font-size: 11px; color: var(--muted); margin-bottom: 10px; }

.banner { margin: 0 28px 14px; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255,138,61,.35); background: rgba(255,138,61,.08); font-size: 14px; line-height: 1.45; }
.banner .row { margin-top: 8px; }

.view { padding: 8px 28px 40px; }

/* ---------------------------------------------------------------- library */
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 10px 0 22px; }
.lib-head h1 { font-size: 30px; letter-spacing: .06em; }
.lib-head p { margin: 6px 0 0; max-width: 620px; }
#view-library .banner { margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 370px), 1fr)); gap: 16px; margin-bottom: 26px; }
.scard-foot button.ghost { padding: 7px 9px; }
.scard { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.scard-art { position: relative; height: 96px; background: radial-gradient(120% 140% at 0% 0%, rgba(255,138,61,.28), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(121,195,255,.22), transparent 55%), #0b0d12; }
.scard-art img { position: absolute; top: 16px; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.scard-art img:nth-child(1) { left: 18px; }
.scard-art img:nth-child(2) { left: 60px; top: 22px; }
.scard-body { padding: 14px 18px 4px; flex: 1; }
.scard-body h3 { font-size: 19px; margin-bottom: 8px; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.6; }
.meta b { color: var(--text); font-weight: 500; }
.scard-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; flex-wrap: wrap; }
.scard-foot .spacer { min-width: 4px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; border: 1px dashed var(--line2); border-radius: 16px; }
.empty h3 { font-size: 20px; margin-bottom: 8px; }
.tools { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tools p { margin: 0 0 4px; max-width: 640px; }

/* ---------------------------------------------------------------- editor */
.ed-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; flex-wrap: wrap; }
.ed-name { font-family: var(--display); font-size: 26px !important; letter-spacing: .04em; background: transparent !important; border: 1px solid transparent !important; padding: 6px 10px !important; flex: 1; min-width: 220px; }
.ed-name:hover, .ed-name:focus { border-color: var(--line) !important; }
.ed-sec { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; }
.ed-sec > h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 4px; }
.ed-sec > p.help { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.ed-wrap { max-width: 980px; margin: 0 auto; padding-bottom: 90px; }
.ed-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 28px; background: rgba(8,9,12,.92); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
}
.ed-bar .sum { color: var(--muted); font-size: 13px; }
.ed-bar .sum b { color: var(--text); font-weight: 500; }
.progress { height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; width: 160px; }
.progress i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }

/* playlist picker */
.pl-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); position: relative; }
.pl-btn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 12px; min-height: 60px; width: 100%; }
.pl-btn img, .pl-ph { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: linear-gradient(135deg, rgba(255,138,61,.35), rgba(121,195,255,.25)); }
.pl-btn .t { font-weight: 600; color: var(--text); font-size: 14px; }
.pl-btn .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pl-btn .caret { margin-left: auto; color: var(--muted); }
.pl-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; background: #12141a; border: 1px solid var(--line2); border-radius: 12px; padding: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.pl-list { max-height: 320px; overflow-y: auto; margin-top: 8px; }
.pl-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; }
.pl-item:hover { background: rgba(255,255,255,.06); }
.pl-item img, .pl-item .pl-ph { width: 36px; height: 36px; border-radius: 4px; }
.pl-item .t { color: var(--text); font-size: 14px; }
.pl-item .s { color: var(--muted); font-size: 12px; }

/* recording progress */
.rec-panel {
  position: fixed; z-index: 30; left: 50%; bottom: 86px; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 140px); overflow-y: auto;
  background: #12141a; border: 1px solid var(--line2); border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.65); display: flex; flex-direction: column; gap: 10px;
}
.rp-head { font-weight: 600; font-size: 15px; line-height: 1.35; flex: 1; }
.rp-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.rp-bar i { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 3px; transition: width .25s linear; }
.rp-bar i.bad { background: var(--danger); }
.rp-err { color: var(--danger); font-size: 13px; line-height: 1.45; border-left: 2px solid var(--danger); padding: 2px 10px; }
.rp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rp-list li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; color: var(--muted); }
.rp-list .sym { display: inline-grid; place-items: center; width: 18px; }
.rp-list .w { font-variant-numeric: tabular-nums; }
.rp-list .st-recording, .rp-list .st-retrying { color: var(--text); }
.rp-list .st-done .sym { color: var(--ok); }
.rp-list .st-failed { color: var(--danger); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--text); animation: rot .8s linear infinite; flex: none; display: inline-block; }
.spin.sm { width: 12px; height: 12px; border-width: 2px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* live: round theme, "then" row */
.theme { font-size: 14px; color: var(--muted); font-style: italic; margin-top: 4px; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.theme:empty { display: none; }
.upnext li.then { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }

/* resume + history */
.banner.resume { border-color: rgba(121,195,255,.4); background: rgba(121,195,255,.08); }
#view-library .banner.resume { margin: 0 0 18px; }
.history { margin-bottom: 20px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; font-size: 14px; }
.hist li:first-child { border-top: 0; }
.hist .w { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 150px; font-size: 13px; }
.hist .n { font-weight: 500; flex: 1; min-width: 140px; }

/* another tab took over */
.dormant { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(6,7,10,.94); backdrop-filter: blur(4px); padding: 24px; }
.dormant .card { max-width: 460px; text-align: center; padding: 28px; }
.dormant h2 { font-size: 20px; margin-bottom: 10px; }

/* round planner */
.grid5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 16px; margin-top: 10px; }
.rounds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 410px), 1fr)); gap: 12px; margin-top: 16px; }
.rcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; background: rgba(255,255,255,.02); }
.rcard.off { border-color: rgba(255,138,61,.4); }
.rhead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.rhead b { font-family: var(--display); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; color: var(--muted); }
.rdur { font-family: var(--mono); font-weight: 300; font-size: 24px; font-variant-numeric: tabular-nums; margin-right: auto; }
.rsongs { list-style: none; margin: 0; padding: 0; }
.rsongs li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.rsongs img, .rsongs .ph { width: 32px; height: 32px; border-radius: 4px; flex: none; object-fit: cover; background: rgba(255,255,255,.06); }
.rsongs .m { min-width: 0; flex: 1; }
.rsongs .t { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rsongs .a { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rsongs .d { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rsongs .x { width: 28px; height: 28px; padding: 0; border-radius: 50%; border-color: transparent; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.rsongs .x:hover { color: var(--danger); background: rgba(255,107,107,.08); }
.rcard select { width: 100%; margin-top: 8px; font-size: 13px; padding: 7px 9px; color: var(--muted); }
.rsongs li { cursor: default; }
.rsongs li.dragging { opacity: .35; }
.rsongs li.drop-before { box-shadow: inset 0 2px 0 var(--text); }
.rsongs li.drop-after { box-shadow: inset 0 -2px 0 var(--text); }
.rsongs.drop-end { box-shadow: 0 2px 0 var(--text); }
.rsongs:empty { min-height: 44px; border: 1px dashed var(--line2); border-radius: 8px; }
.rsongs .grip { color: var(--muted); cursor: grab; font-size: 12px; letter-spacing: -2px; user-select: none; padding: 0 2px; }
.rsongs .acts { display: inline-flex; gap: 2px; }
.rsongs .ib { width: 26px; height: 26px; padding: 0; border-radius: 6px; border-color: transparent; background: transparent; color: var(--muted); font-size: 11px; line-height: 1; }
.rsongs .ib:last-child { font-size: 17px; }
.rsongs .ib:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,.08); }
.rsongs .ib:last-child:hover:not(:disabled) { color: var(--danger); background: rgba(255,107,107,.08); }
.rsongs li.swapping .acts { flex: 1 1 100%; }
.rsongs select.swap { margin-top: 0; color: var(--text); }
.rsongs li.swapping { flex-wrap: wrap; }
.rtheme { margin: 2px 0 8px; }
.rtheme summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; padding: 2px 0; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtheme summary::-webkit-details-marker { display: none; }
.rtheme[open] summary { color: var(--text); white-space: normal; }
.rtheme textarea { min-height: 54px; font-size: 13px; margin-top: 4px; }

/* voice */
.voice-card { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); flex-wrap: wrap; }
.orb { width: 46px; height: 46px; border-radius: 50%; flex: none; background: radial-gradient(circle at 30% 30%, #ffd2a8, #ff8a3d 45%, #3a1d0b 100%); box-shadow: 0 0 22px rgba(255,138,61,.35); }
.voice-card .t { font-weight: 600; font-size: 16px; }
.voice-card .d { color: var(--muted); font-size: 13px; margin-top: 2px; max-width: 520px; }
.voice-card .row { margin-left: auto; }
.picker { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(0,0,0,.25); }
.seg-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-ctl button { border: 0; border-radius: 0; padding: 8px 14px; font-size: 13px; background: transparent; }
.seg-ctl button.on { background: var(--text); color: #0b0b0d; }
.vlist { max-height: 360px; overflow-y: auto; margin-top: 10px; }
.vrow { display: flex; gap: 10px; align-items: center; padding: 9px 6px; border-top: 1px solid var(--line); }
.vrow:first-child { border-top: 0; }
.vrow .t { font-weight: 600; font-size: 14px; }
.vrow .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.vrow .d { color: var(--muted); font-size: 12px; margin-top: 3px; max-width: 560px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vrow .row { margin-left: auto; flex-wrap: nowrap; }
.vrow.sel { background: rgba(255,255,255,.04); border-radius: 8px; }
.hint-box { margin-top: 12px; font-size: 13px; color: var(--muted); border-left: 2px solid var(--line2); padding: 4px 12px; line-height: 1.55; }
.hint-box code { font-family: var(--mono); font-size: 12px; color: var(--text); background: rgba(255,255,255,.05); padding: 1px 5px; border-radius: 4px; }

/* script cues */
.cue-ed { padding: 16px 0; border-top: 1px solid var(--line); }
.cue-ed:first-of-type { border-top: 0; padding-top: 4px; }
.cue-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cue-top b { font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: .06em; }
.cue-top .w { color: var(--muted); font-size: 13px; }
.cue-top .n { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cue-ed .row { margin-top: 8px; }
.cue-ed.drag textarea { border-color: var(--text); }

/* ---------------------------------------------------------------- live */
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: center; min-height: calc(100vh - 200px); }
.stage { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.kicker { font-family: var(--display); text-transform: uppercase; letter-spacing: .38em; font-size: 13px; color: var(--accent); transition: color 1.2s ease; margin-bottom: 6px; text-align: center; }
.ring-wrap { position: relative; width: min(62vh, 540px, 100%); aspect-ratio: 1; }
.ring-glow { position: absolute; inset: 9%; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 8%, var(--accent) 22%, transparent 40%, transparent 58%, var(--accent) 74%, transparent 90%); filter: blur(38px); opacity: .22; animation: spin 48s linear infinite; transition: opacity 1.2s ease; }
body.phase-idle .ring-glow { opacity: .1; }
body.paused .ring-glow { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
svg.ring circle { fill: none; }
.ring .track { stroke: rgba(255,255,255,.07); stroke-width: 2; }
.ring .prog { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke 1.2s ease; filter: drop-shadow(0 0 6px var(--accent)); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18%; }
.title { font-family: var(--display); font-size: clamp(18px, 2.4vw, 26px); font-weight: 500; letter-spacing: .04em; }
.timer { font-family: var(--mono); font-weight: 200; font-variant-numeric: tabular-nums; font-size: clamp(60px, 10.5vw, 146px); line-height: 1; letter-spacing: -.02em; margin: 10px 0 12px; }
body.paused .timer { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.sub { color: var(--muted); font-size: 14px; min-height: 1.4em; }
.timeline { display: flex; gap: 4px; width: min(640px, 100%); margin-top: 22px; }
.seg { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.seg i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; }
.seg.round i { background: var(--heat); }
.seg.break i { background: var(--cool); }
.seg.current { box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.seg-labels { display: flex; gap: 4px; width: min(640px, 100%); margin-top: 7px; }
.seg-labels span { font-family: var(--display); font-size: 11px; letter-spacing: .12em; color: var(--muted); text-align: center; overflow: hidden; white-space: nowrap; }

.side { display: flex; flex-direction: column; gap: 12px; }
.np-row { display: flex; gap: 12px; align-items: center; }
.np-art { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex: none; background: linear-gradient(135deg, rgba(255,138,61,.3), rgba(121,195,255,.2)); }
.np-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-art img:not([src]), .np-art img[src=""] { display: none; }
.np-meta { min-width: 0; }
.np-track { font-weight: 600; font-size: 16px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.np-artist { color: var(--muted); margin-top: 2px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-prog { margin-top: 14px; height: 4px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; }
.np-prog i { display: block; height: 100%; width: 0; background: var(--text); }
.np-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.transport { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 8px 0 12px; }
.meter { margin-top: 6px; height: 3px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear, background 1.2s ease; }
.meter-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.upnext { list-style: none; margin: 0; padding: 0; }
.upnext li button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px; border-radius: 8px; }
.upnext li button:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.upnext img, .upnext .ph { width: 34px; height: 34px; border-radius: 4px; flex: none; object-fit: cover; background: rgba(255,255,255,.06); }
.upnext .t { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext .a { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext .m { min-width: 0; flex: 1; }
.upnext .d { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.upnext .none { color: var(--muted); font-size: 13px; padding: 4px 6px; }
.narr-line { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.wave { display: inline-flex; gap: 3px; align-items: end; height: 16px; }
.wave b { width: 3px; background: var(--accent); border-radius: 2px; height: 4px; }
.speaking .wave b { animation: wave 1s ease-in-out infinite; }
.speaking .wave b:nth-child(2) { animation-delay: .15s; }
.speaking .wave b:nth-child(3) { animation-delay: .3s; }
.speaking .wave b:nth-child(4) { animation-delay: .45s; }
@keyframes wave { 50% { height: 16px; } }
.narr-when { color: var(--muted); font-size: 13px; margin-top: 6px; }
.sess-name { font-weight: 600; }
.total { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 4px; }
footer.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 18px 0 10px; }
footer.controls button { min-width: 120px; }
.hint { text-align: center; color: var(--muted); font-size: 12px; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }

/* ---------------------------------------------------------------- settings */
dialog#settings { width: min(780px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 0; overflow: hidden; }
dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.set-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.set-head h2 { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; }
.set-body { overflow-y: auto; max-height: calc(100vh - 140px); padding: 6px 22px 22px; }
.set-sec { padding: 18px 0; border-bottom: 1px solid var(--line); }
.set-sec:last-child { border-bottom: 0; }
.set-sec h3 { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.set-sec p.help { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1a1d24; border: 1px solid var(--line2); color: var(--text); padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 60; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
body.editing #toast { bottom: 84px; }

@media (max-width: 960px) {
  .live-grid { grid-template-columns: 1fr; }
  header.top { padding: 12px 16px; flex-wrap: wrap; }
  .tabs { margin-left: 0; }
  .view { padding: 8px 16px 40px; }
  .banner { margin: 0 16px 14px; }
  .ed-bar { padding: 12px 16px; }
  footer.controls button { min-width: 0; flex: 1 1 140px; }
  .pill { max-width: 44vw; }
}
@media (prefers-reduced-motion: reduce) {
  .ring-glow, .speaking .wave b, body.paused .timer { animation: none; }
}

/* account and sync */
.pill.sync::before { background: var(--cool); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
#acctEmail, #inviteEmail { flex: 1 1 220px; min-width: 0; }
.people { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.people li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.people .who { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.people .who small { color: var(--muted); margin-left: 6px; }
