:root {
  --bg: #0b0c10;
  --bg-2: #12141c;
  --card: #161822;
  --line: #2a2e3d;
  --text: #e8e6e3;
  --muted: #8b90a0;
  --accent: #c8f542;
  --accent-2: #7cf0d6;
  --danger: #ff6b6b;
  --chat: #0e1016;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(200, 245, 66, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 245, 66, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at top, black 20%, transparent 75%);
}
header.top, main, footer { position: relative; z-index: 1; }
header.top {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 16, 0.8);
  backdrop-filter: blur(10px);
  position: sticky; top: 0;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: 0.02em;
}
.logo { color: var(--accent); font-size: 1.1rem; }
header.top nav { display: flex; gap: 1rem; }
header.top nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
header.top nav a:hover { color: var(--text); }
.auth-pill {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex; align-items: center; gap: 0.4rem;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #555; display: inline-block;
}
.dot.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
main { padding: 1.5rem 1.75rem 3rem; max-width: 1280px; margin: 0 auto; }
footer {
  padding: 1.25rem 1.75rem 2rem;
  color: var(--muted); font-size: 0.8rem;
  border-top: 1px solid var(--line);
}
.hero { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 1.5rem; }
.hero.compact { align-items: center; }
.hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.15; margin: 0.2rem 0 0.6rem;
  letter-spacing: -0.03em;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.72rem; color: var(--accent-2); margin: 0;
}
.lede { color: var(--muted); max-width: 40rem; margin: 0; }
.notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 0.9rem 1rem;
  border-radius: 10px;
  max-width: 22rem;
  font-size: 0.88rem;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.notice strong { color: var(--text); }
.layout { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 900px) {
  .layout, .hero { grid-template-columns: 1fr; display: grid; }
}
.col { display: flex; flex-direction: column; gap: 1rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.85rem;
}
.card-h h2 { margin: 0; font-size: 1rem; font-weight: 650; }
.status { font-size: 0.78rem; color: var(--accent-2); }
.row { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; }
.row.tight { gap: 0.4rem; }
label {
  display: flex; flex-direction: column; gap: 0.28rem;
  font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
}
label.grow { flex: 1; min-width: 10rem; }
input {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font: inherit;
}
input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn.primary {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
  font-weight: 650;
}
.btn.primary:hover { filter: brightness(1.05); color: #111; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.tiny { padding: 0.25rem 0.55rem; font-size: 0.8rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.7rem 0 0; }
.hint code, code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.82em;
  background: var(--bg);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}
.whisper { font-size: 0.9rem; color: var(--accent-2); min-height: 1.2em; margin: 0.5rem 0 0; }
.chat-card { min-height: 28rem; display: flex; flex-direction: column; }
.chat-log {
  background: var(--chat);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  flex: 1;
  min-height: 22rem;
  max-height: 34rem;
  overflow: auto;
  font-size: 0.9rem;
}
.msg { padding: 0.28rem 0.15rem; border-bottom: 1px solid rgba(42, 46, 61, 0.5); }
.msg .meta { color: var(--muted); font-size: 0.72rem; margin-right: 0.4rem; font-variant-numeric: tabular-nums; }
.msg .user { font-weight: 650; margin-right: 0.35rem; }
.msg .reply { display: block; color: var(--muted); font-size: 0.78rem; padding-left: 0.9rem; }
.badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  padding: 0 0.3rem;
  border-radius: 4px;
  color: var(--muted);
  margin-right: 0.25rem;
}
.tag {
  display: inline-block;
  background: rgba(200, 245, 66, 0.12);
  color: var(--accent);
  font-size: 0.7rem;
  padding: 0.05rem 0.4rem;
  border-radius: 99px;
  margin-right: 0.25rem;
}
.sessions { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.sessions th {
  text-align: left; color: var(--muted); font-weight: 500;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.4rem 0.35rem; border-bottom: 1px solid var(--line);
}
.sessions td { padding: 0.5rem 0.35rem; border-bottom: 1px solid var(--line); }
.mono { font-family: ui-monospace, monospace; }
.muted { color: var(--muted); }
.crumb { margin: 0 0 0.8rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.recap-md { font-size: 0.95rem; }
.recap-md h1 { font-size: 1.35rem; margin-top: 0; }
.recap-md h2 {
  font-size: 1.02rem;
  margin: 1.3rem 0 0.5rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.recap-md ul { padding-left: 1.1rem; }
.recap-md li { margin: 0.25rem 0; }
.recap-md p { color: #d2d0cc; }
.flash {
  margin: 0.6rem 0 0;
  color: var(--danger);
  font-size: 0.85rem;
}
.grow { flex: 1; }

main { max-width: 1280px; }
.lede.audience { margin-top: 0.45rem; }
.lede.audience strong { color: var(--accent); font-weight: 650; }
.timeline-card { margin-bottom: 1rem; }
.viewer-chart { width: 100%; height: 110px; position: relative; }
.viewer-svg { width: 100%; height: 110px; display: block; cursor: crosshair; touch-action: none; }
.viewer-empty { color: var(--muted); font-size: 0.88rem; padding: 1rem 0; }
.session-layout { align-items: start; }
.chat-col { min-width: 0; }
.people-card { padding-bottom: 0.75rem; }
.people-search-label { margin-bottom: 0.5rem; display: flex; }
.people-search-label input { width: 100%; }
.people-list {
  list-style: none; margin: 0; padding: 0;
  max-height: 14rem; overflow: auto;
}
.person {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.38rem 0.3rem; border-radius: 8px;
  cursor: pointer; border: 1px solid transparent;
}
.person:hover { background: var(--bg); }
.person.active { border-color: var(--accent); background: rgba(200, 245, 66, 0.08); }
.person .who { flex: 1; min-width: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .count { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.person .pin { font-size: 0.65rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.person-profile {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.15rem 0.7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.65rem;
}
.person-profile .meta { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.2rem; }
.person-profile .pname { font-weight: 700; font-size: 1.02rem; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: var(--line);
  display: inline-block; vertical-align: middle;
}
.person .avatar { width: 28px; height: 28px; }
.person-profile .avatar { width: 56px; height: 56px; }
.msg {
  display: flex; align-items: flex-start; gap: 0.45rem;
  padding: 0.32rem 0.2rem;
}
.msg .body { min-width: 0; flex: 1; }
.msg.stt {
  background: rgba(200, 245, 66, 0.06);
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding-left: 0.45rem;
}
.msg.stt .badge.stt,
.badge.stt {
  color: var(--accent);
  border-color: var(--accent);
}
.msg.highlight {
  background: rgba(124, 240, 214, 0.14);
  outline: 1px solid rgba(124, 240, 214, 0.35);
  border-radius: 6px;
}
.recap-md .chatter-row {
  display: flex; align-items: center; gap: 0.4rem;
}
.recap-avatars { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; margin: 0.4rem 0 0.8rem; }
.recap-avatars .who { font-weight: 650; }
.color-swatch {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; margin-right: 0.2rem;
  vertical-align: middle;
}

main { max-width: 1440px; }
.setup-steps { color: var(--muted); margin: 0 0 0.8rem; padding-left: 1.2rem; }
.setup-steps a { color: var(--accent-2); }
.setup-card { margin-bottom: 1rem; }
.subhead { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0.8rem 0 0.45rem; }
.live-badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.22rem 0.6rem; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted);
}
.live-badge.live {
  background: #e91916; color: #fff; border-color: #e91916;
  box-shadow: 0 0 10px rgba(233, 25, 22, 0.55);
  animation: livepulse 1.6s ease-in-out infinite;
}
.live-badge.over {
  background: rgba(200, 245, 66, 0.14); color: var(--accent); border-color: var(--accent);
}
@keyframes livepulse {
  0%, 100% { box-shadow: 0 0 8px rgba(233, 25, 22, 0.4); }
  50% { box-shadow: 0 0 16px rgba(233, 25, 22, 0.8); }
}
.live-tracker { margin-bottom: 1rem; }
.live-main {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 1rem;
  margin-bottom: 1rem; align-items: start;
}
.live-sub {
  display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 1rem;
}
.card.nested { box-shadow: none; }
.player-wrap {
  position: relative; width: 100%; padding-top: 56.25%;
  background: #000; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
}
.player-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.player-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.player-wrap.has-player .player-fallback { display: none; }
.rolling-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.85rem 1rem; max-height: 28rem; overflow: auto;
}
.auth-user-row { display: flex; align-items: center; gap: 0.8rem; }
.avatar.lg { width: 48px; height: 48px; }
.stream-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}
.stream-card {
  text-align: left; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; color: inherit;
  display: flex; flex-direction: column;
}
.stream-card:hover { border-color: var(--accent); }
.stream-card img { width: 100%; height: 96px; object-fit: cover; background: #111; display: block; }
.stream-card .sname { font-weight: 650; padding: 0.4rem 0.55rem 0; }
.stream-card .stitle { color: var(--muted); font-size: 0.8rem; padding: 0.1rem 0.55rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream-card .sview { color: var(--accent-2); font-size: 0.75rem; padding: 0.15rem 0.55rem 0.5rem; }
.compact-controls { margin-bottom: 1rem; }
@media (max-width: 980px) {
  .live-main, .live-sub { grid-template-columns: 1fr; }
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 800px) {
  .watch-grid { grid-template-columns: 1fr; }
}
.watch-slot {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  min-height: 7.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.watch-slot.empty {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.watch-slot .slot-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.watch-slot .slot-name {
  font-weight: 650;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.watch-slot .slot-login { font-size: 0.78rem; color: var(--muted); }
.watch-slot .slot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: auto;
}
.audio-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.audio-toggle input { width: auto; }
.live-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}
.live-tab {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 99px;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.live-tab.active {
  border-color: var(--accent);
  background: rgba(200, 245, 66, 0.12);
}
.live-badge.rec {
  background: rgba(124, 240, 214, 0.16);
  color: var(--accent-2);
  border-color: var(--accent-2);
}
.watch-full {
  color: var(--danger);
  font-size: 0.88rem;
  margin: 0.55rem 0 0;
}

.chat-search { margin-bottom: 0.55rem; }
.search-toolbar {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  min-height: 1.4rem; margin: 0.25rem 0 0.15rem;
}
.search-hits {
  list-style: none; margin: 0.35rem 0 0.45rem; padding: 0;
  max-height: 11rem; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg);
}
.search-hit {
  display: flex; align-items: flex-start; gap: 0.45rem;
  padding: 0.35rem 0.5rem; cursor: pointer;
  border-bottom: 1px solid rgba(42, 46, 61, 0.6);
}
.search-hit:last-child { border-bottom: 0; }
.search-hit:hover { background: rgba(124, 240, 214, 0.06); }
.search-hit.active {
  background: rgba(124, 240, 214, 0.12);
  outline: 1px solid rgba(124, 240, 214, 0.3);
}
.search-hit .snip { display: block; font-size: 0.82rem; color: var(--text); }
.search-hit .meta { margin-right: 0.35rem; }
.search-hit mark, .msg mark {
  background: rgba(200, 245, 66, 0.38);
  color: inherit;
  padding: 0 0.12em;
  border-radius: 2px;
}
.search-tick, .search-tick-dot { pointer-events: none; }

.stt-master {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 1.05rem;
  gap: 0.4rem;
}
.stt-toggle {
  width: min(100%, 38rem);
  min-height: 4.4rem;
  padding: 0.7rem 1.2rem;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #14161f;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  font: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.stt-toggle .stt-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  text-align: left;
}
.stt-toggle .stt-label {
  font-size: 1.28rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.stt-toggle .stt-sub {
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.85;
  text-transform: none;
  letter-spacing: 0;
}
.stt-live-pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3a3e4c;
  flex-shrink: 0;
}
.stt-toggle.off {
  background: #14161f;
  color: var(--muted);
  border-color: #2f3344;
}
.stt-toggle.off:hover {
  border-color: #5a6074;
  color: var(--text);
}
.stt-toggle.on {
  background: #c8f542;
  color: #0b0c10;
  border-color: #c8f542;
  box-shadow: 0 0 28px rgba(200, 245, 66, 0.45);
}
.stt-toggle.on:hover {
  filter: brightness(1.04);
  color: #0b0c10;
}
.stt-toggle.on .stt-live-pip {
  background: #e91916;
  box-shadow: 0 0 10px rgba(233, 25, 22, 0.85);
  animation: livepulse 1.6s ease-in-out infinite;
}
.stt-toggle.missing {
  opacity: 0.85;
}
.stt-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.stt-master-hint {
  margin: 0;
  text-align: center;
  max-width: 38rem;
}
.stt-skip-log {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
