/* theCURB Live — design system. Apple-style dark surfaces (soft grays, hairlines, gray segmented
   controls, pill buttons) in theCURB colors: CURB yellow for anything "on", Oswald for headings, Inter UI. */
:root {
  --curb: #f9e87a;
  --curb-deep: #e9d24f;
  --curb-rgb: 249 232 122;
  --ink: #0a0a0a;
  /* The show's own color (theCURB Studio: each account picks it). Drives what guests and viewers
     see: speaking glow, name tags, banner, avatars. Defaults to theCURB yellow. */
  --accent: var(--curb);
  --accent-rgb: var(--curb-rgb);
  --accent-ink: var(--ink);
  --bg: #000;
  --panel: #1c1c1e;
  --panel-2: #2c2c2e;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.14);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f5f5f7;
  --muted: rgba(235, 235, 245, 0.6);
  --dim: rgba(235, 235, 245, 0.3);
  --live: #ff3b30;
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 22px;
  --display: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--ui);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--curb); }
.ico { display: inline-flex; width: 18px; height: 18px; }
.ico svg { width: 100%; height: 100%; fill: currentColor; }

/* ---------- type ---------- */
.display { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.02em; font-weight: 700; }
.eyebrow { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.02em; margin: 0; line-height: 1.05; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--panel-2); color: var(--text); cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: background 0.15s, transform 0.08s, color 0.15s;
}
.btn:hover { background: #3a3a3c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--curb); color: var(--ink); }
.btn.primary:hover { background: var(--curb-deep); }
.btn.danger { background: rgba(255, 69, 58, 0.14); color: #ff6961; }
.btn.danger:hover { background: rgba(255, 69, 58, 0.24); }
.btn.live { background: var(--live); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid transparent; background: var(--panel-2);
  display: inline-grid; place-items: center; cursor: pointer; color: var(--text); transition: background 0.15s;
}
.icon-btn .ico { width: 22px; height: 22px; }
.icon-btn:hover { background: #3a3a3c; }
.icon-btn.off { background: rgba(255, 69, 58, 0.18); color: #ff6961; }
.icon-btn.end { background: var(--live); border-color: var(--live); color: #fff; width: 60px; border-radius: 999px; }
.icon-btn.end:hover { background: #e0302a; }

/* ---------- form ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  height: 40px; width: 100%; padding: 0 12px; border-radius: 10px; border: 1px solid transparent;
  background: var(--fill-2); outline: none; transition: box-shadow 0.15s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { box-shadow: 0 0 0 3px rgb(var(--curb-rgb) / 0.35); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.copyrow { display: flex; gap: 6px; }
.copyrow .input { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; color: var(--muted); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; padding: 6px 0; }
.switch input { appearance: none; width: 42px; height: 25px; border-radius: 99px; background: rgba(120, 120, 128, 0.32); position: relative; cursor: pointer; transition: background 0.2s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1); }
.switch input:checked { background: var(--curb); }
.switch input:checked::after { transform: translateX(17px); }
.seg { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 0; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 8px; cursor: pointer; color: var(--text); font-weight: 500; font-size: 12.5px; transition: background 0.2s, color 0.2s; }
.seg button[aria-pressed='true'] { background: var(--curb); color: var(--ink); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); }
.seg button:not([aria-pressed='true']):hover { background: rgba(255, 255, 255, 0.06); }

/* ---------- chips / status ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; background: var(--fill-2); border: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.chip.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.chip.ok { color: var(--text); }
.chip.live { background: var(--live); border-color: var(--live); color: #fff; font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.chip.live .dot { background: #fff; animation: pulse 1.4s infinite; }
.chip.stage { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.chip.stage .dot { background: var(--ink); }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- app frame ---------- */
.topbar {
  height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  border-bottom: 0.5px solid var(--line-2); background: rgba(22, 22, 24, 0.72);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand img { height: 26px; display: block; }
.brand .tag { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; background: var(--curb); color: var(--ink); padding: 3px 7px 2px; border-radius: 4px; }
.topbar .spacer { flex: 1; }
.topbar .title { font-family: var(--display); text-transform: uppercase; font-size: 18px; letter-spacing: 0.03em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .title-input { background: transparent; border: 1px solid transparent; border-radius: 10px; font: 600 20px var(--display); text-transform: uppercase; letter-spacing: 0.03em; padding: 5px 10px; width: min(420px, 34vw); outline: none; }
.topbar .title-input:hover { background: var(--fill-2); }
.topbar .title-input:focus { border-color: var(--curb); }
.divider { width: 1px; height: 24px; background: var(--line-2); }

.panel { background: var(--panel); border: 0; border-radius: var(--radius); box-shadow: inset 0 0 0 0.5px var(--line); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 18px 12px; }
.panel-h h3 { font-size: 17px; font-weight: 600; letter-spacing: 0.05em; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.hr { height: 1px; background: var(--line); margin: 4px 0; }
.note { background: #15140c; border: 1px solid #3a3517; color: #e9e2b0; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.note b { color: var(--curb); }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: #cfcfc8; font-size: 12.5px; }
.steps b { color: var(--text); }
kbd, code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11.5px; background: #222; border: 1px solid #333; border-radius: 5px; padding: 1px 5px; color: #eee; }

/* tabs */
.tabs { display: flex; gap: 0; margin: 14px 14px 0; padding: 2px; background: var(--fill); border-radius: 10px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 6px 2px; border-radius: 8px; cursor: pointer; color: var(--text); font: 500 12.5px var(--ui); position: relative; }
.tabs button[aria-selected='true'] { background: #636366; font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); }
.tabs .badge { position: absolute; top: -5px; right: -2px; background: var(--curb); color: var(--ink); border-radius: 99px; font: 700 10px/16px var(--ui); min-width: 16px; padding: 0 4px; }
.tabpanel { display: none; padding: 16px; overflow: auto; }
.tabpanel.on { display: grid; gap: 14px; align-content: start; }

/* video tiles (people) */
.vtile { position: relative; background: #000; border-radius: 16px; overflow: hidden; overflow: clip; /* clip: can't be scrolled by focus, so the framing never jumps */ aspect-ratio: 1; border: 0; }
.vtile video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; display: block; background: #000; max-height: none; transition: left .6s ease, top .6s ease, width .6s ease, height .6s ease; }
.vtile.mirror video { transform: scaleX(-1); }
.vtile .avatar { position: absolute; inset: 0; display: none; place-items: center; background: radial-gradient(circle at 50% 40%, #1d1d1d, #0b0b0b); }
.vtile.no-video .avatar { display: grid; }
.vtile.no-video video { visibility: hidden; }
.vtile .avatar span { width: 30%; max-width: 72px; aspect-ratio: 1; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 clamp(14px, 2.4vw, 26px) var(--display); }
.vtile .label { position: absolute; left: 8px; bottom: 8px; right: 8px; display: flex; align-items: center; gap: 6px; }
.vtile .name { background: rgba(0, 0, 0, 0.72); padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.vtile .mic-off { background: var(--live); color: #fff; border-radius: 6px; width: 22px; height: 22px; display: none; place-items: center; }
.vtile .mic-off .ico { width: 14px; height: 14px; }
.vtile.muted .mic-off { display: grid; }
.vtile.speaking { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgb(var(--accent-rgb) / 0.45); }
.vtile .flag { position: absolute; top: 8px; left: 8px; }
/* re-center: bottom-left of your own camera tile */
.vtile .recenter { position: absolute; left: 8px; bottom: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(0, 0, 0, 0.72); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; transition: background 0.15s, color 0.15s; }
.vtile .recenter .ico { width: 16px; height: 16px; }
.vtile .recenter:hover { background: var(--curb); color: var(--ink); border-color: var(--curb); }
.vtile .recenter.busy .ico { animation: spin 0.9s linear infinite; }
.vtile.no-video .recenter { display: none; }
.vtile.mirror .recenter .ico { transform: none; }
.vtile.has-recenter .label { left: 44px; }
@keyframes spin { to { transform: rotate(360deg); } }
.vtile .net { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 5px; background: rgba(0, 0, 0, 0.72); padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; cursor: help; }
.vtile .net i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.vtile .net.warn i { background: var(--warn); }
.vtile .net.bad i { background: var(--live); }
.vtile .net.bad { color: #ffb4ad; }

/* ---------- stage (overlay + preview) ---------- */
.stage-host { position: relative; overflow: hidden; }
.stage-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.stage-tile {
  position: absolute; overflow: hidden; overflow: clip; background: #0c0c0c;
  transition: left 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s, transform 0.3s, box-shadow 0.2s;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.stage-tile.entering, .stage-tile.leaving { opacity: 0; transform: scale(0.94); }
.stage-tile video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; display: block; max-height: none; transition: left .6s ease, top .6s ease, width .6s ease, height .6s ease; }
.stage-tile.mirror video { transform: scaleX(-1); }
.stage-tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 calc(5px * var(--tile-scale, 1)) var(--accent); opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.stage-tile.speaking::after { opacity: 1; }
.stage-tile .avatar { position: absolute; inset: 0; display: none; place-items: center; background: radial-gradient(circle at 50% 40%, #222, #0b0b0b 70%); }
.stage-tile.no-video .avatar { display: grid; }
.stage-tile.no-video video { visibility: hidden; }
.stage-tile .avatar span { width: calc(150px * var(--tile-scale, 1)); height: calc(150px * var(--tile-scale, 1)); border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 calc(60px * var(--tile-scale, 1)) var(--display); }
.stage-tile .nametag {
  position: absolute; left: calc(22px * var(--tile-scale, 1)); bottom: calc(22px * var(--tile-scale, 1));
  display: flex; align-items: stretch; max-width: calc(100% - 44px * var(--tile-scale, 1));
  transition: opacity 0.25s, transform 0.25s;
}
.stage-tile.hide-name .nametag { opacity: 0; transform: translateY(8px); }
.stage-tile .nametag i { width: calc(11px * var(--tile-scale, 1)); background: var(--accent); flex: none; }
.stage-tile .nametag span {
  background: rgba(8, 8, 8, 0.86); color: #fff; font: 600 calc(38px * var(--tile-scale, 1)) / 1 var(--display); text-transform: uppercase; letter-spacing: 0.04em;
  padding: calc(12px * var(--tile-scale, 1)) calc(18px * var(--tile-scale, 1)) calc(10px * var(--tile-scale, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stage-bug { position: absolute; left: 48px; top: 40px; width: calc(230px * var(--logo-k, 1)); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); opacity: 0; transition: opacity 0.3s; }
.stage-bug.on { opacity: 1; }
.stage-banner {
  position: absolute; left: 50%; bottom: 34px; transform: translate(-50%, 20px); opacity: 0; transition: opacity 0.35s, transform 0.35s;
  font: 700 54px/1 var(--display); text-transform: uppercase; color: var(--accent); letter-spacing: 0.01em; white-space: nowrap;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 18px rgba(0, 0, 0, 0.75);
}
.stage-banner.on { opacity: 1; transform: translate(-50%, 0); }
.stage-canvas.portrait .stage-banner { white-space: normal; width: 88%; text-align: center; font-size: 66px; line-height: 1.02; }
.stage-canvas.portrait .stage-bug { width: calc(200px * var(--logo-k, 1)); left: 40px; }
.stage-guide { position: absolute; left: 0; right: 0; display: grid; place-items: center; background: repeating-linear-gradient(-45deg, rgba(255,59,48,.10) 0 18px, rgba(255,59,48,.04) 18px 36px); border: 3px dashed rgba(255,59,48,.45); color: rgba(255,140,130,.85); font: 600 34px var(--display); text-transform: uppercase; letter-spacing: .08em; pointer-events: none; }
.stage-guide.top { top: 0; border-top: 0; border-left: 0; border-right: 0; }
.stage-guide.bottom { bottom: 0; border-bottom: 0; border-left: 0; border-right: 0; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: rgba(44, 44, 46, 0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 0.5px solid var(--line-2); padding: 10px 16px; border-radius: 999px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: tin 0.2s ease; text-align: center; }
.toast.ok { border-color: #2e5a3a; }
.toast.curb { background: var(--curb); color: var(--ink); border-color: var(--curb); }
.toast.out { opacity: 0; transition: opacity 0.4s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* chat */
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.chat-log { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; min-height: 120px; }
.chat-msg .who { font-size: 12px; font-weight: 700; display: flex; gap: 6px; align-items: baseline; }
.chat-msg .who .role { font-family: var(--display); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; background: var(--curb); color: var(--ink); padding: 1px 5px; border-radius: 3px; }
.chat-msg .who time { color: var(--dim); font-weight: 500; font-size: 11px; }
.chat-msg .txt { color: #ddd; word-wrap: break-word; }
.chat-form { display: flex; gap: 6px; }
.chat-empty { color: var(--dim); text-align: center; margin: auto; font-size: 12.5px; }

/* full-screen states */
.center-screen { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.fatal { text-align: center; display: grid; gap: 14px; justify-items: center; max-width: 420px; }
.fatal img { height: 40px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #333 transparent; }

[hidden] { display: none !important; }

/* ---------- platforms (restream + live chat) ---------- */
.pf { --pf: #8a8a85; display: inline-grid; place-items: center; flex: none; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--pf); color: #fff; font: 700 9.5px/1 var(--ui); letter-spacing: 0.04em; text-transform: uppercase; }
.pf.youtube { --pf: #ff0033; }
.pf.twitch { --pf: #9146ff; }
.pf.kick { --pf: #53fc18; color: #061; }
.pf.facebook { --pf: #1877f2; }
.pf.tiktok { --pf: #fe2c55; }
.pf.instagram { --pf: linear-gradient(45deg, #f9a825, #e1306c 55%, #833ab4); background: var(--pf); }
.pf.x { --pf: #f4f4f2; color: #000; }

/* live chat messages (studio + chat overlay) */
/* Send to Twitch chat (studio Live chat tab + Broadcast page) */
.lc-send-wrap { flex: none; }
.lc-send { display: flex; align-items: center; gap: 8px; }
.lc-send .input { flex: 1; min-width: 0; height: 36px; font-size: 13px; }
.lc-send .btn { width: 36px; padding: 0; flex: none; }
.lc-send .btn .ico { width: 16px; height: 16px; }
.lc-send-connect { width: 100%; gap: 8px; text-decoration: none; }
.lc-acct .link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.lc-msg { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; align-items: start; padding: 7px 8px; border-radius: 10px; position: relative; }
.lc-msg .pf { margin-top: 2px; }
.lc-msg .body { min-width: 0; overflow-wrap: anywhere; color: #e6e6e1; }
.lc-msg .user { font-weight: 700; margin-right: 6px; }
.lc-msg .bdg { display: inline-block; font: 700 9.5px/1 var(--ui); text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 4px 2px; border-radius: 3px; background: #2a2a2a; color: #ddd; margin-right: 4px; vertical-align: 2px; }
.lc-msg .bdg.Streamer { background: var(--curb); color: var(--ink); }
.lc-msg .bdg.Mod { background: #1f6f3a; color: #fff; }
.lc-msg .emote { height: 1.6em; vertical-align: middle; margin: -0.3em 1px; }
.lc-msg .amount { display: inline-block; background: var(--curb); color: var(--ink); font-weight: 800; border-radius: 4px; padding: 0 5px; margin-right: 6px; }
.lc-msg.ev { background: #17160e; border: 1px solid #3a3517; }
.lc-msg.ev .body { color: #f1e9b6; }
/* questions: the whole comment in blue (studio, guest screens, chat overlay) */
.lc-msg.q { background: rgba(90, 200, 250, 0.1); box-shadow: inset 3px 0 0 #5ac8fa; }
.lc-msg.q .text { color: #8fd8ff; }

/* small shared bits */
.row .spacer { flex: 1; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm .ico { width: 18px; height: 18px; }
.input.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; }

/* ---------- guest screen (guest page + studio "Guest view" preview), see guestscreen.js ----------
   Minimal stack: top overlays, then middle overlays + on-screen comment + viewer chat. */
.gs { position: relative; display: flex; flex-direction: column; gap: 8px; background: #000; container-type: size; overflow: hidden; }
.gs-top { flex: none; display: flex; flex-direction: column; gap: 6px; max-height: 58%; overflow: hidden; }
.gs-top:empty, .gs-midov:empty, .gs-featurebox:empty { display: none; }
.gs-mid { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.gs-midov { flex: none; display: flex; flex-direction: column; gap: 6px; }
.gs-ov { position: relative; width: 100%; overflow: hidden; flex: none; }
.gs-ov iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: transparent; color-scheme: normal; pointer-events: none; }
.gs-featurebox { flex: none; }
.gs-feature { background: #17160c; border: 1px solid #3a3517; border-left: 4px solid var(--curb); border-radius: 6px 12px 12px 6px; padding: 0.7em 0.85em; font-size: clamp(8px, 4cqw, 15px); display: grid; gap: 0.4em; animation: gcin 0.35s ease-out; }
.gs-feature .fc-who { display: flex; align-items: center; gap: 0.5em; font: 600 0.95em/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; color: var(--curb); }
.gs-feature .fc-who .pf { height: 1.4em; font-size: 0.7em; }
.gs-feature .fc-who b { background: var(--curb); color: var(--ink); padding: 0.15em 0.4em; border-radius: 4px; font-family: var(--ui); }
.gs-feature .fc-tag { margin-left: auto; font: 700 0.62em/1 var(--ui); letter-spacing: 0.06em; color: var(--ink); background: var(--curb); border-radius: 99px; padding: 0.35em 0.6em; }
.gs-feature .fc-text { color: #fff; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.gs-feature .emote { height: 1.3em; vertical-align: middle; }
.gs-chatwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.gs-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 18%); mask-image: linear-gradient(transparent, #000 18%); }
.gs-chat .lc-msg { flex: none; background: #111; padding: 0.5em 0.7em; font-size: clamp(7px, 3.8cqw, 14px); line-height: 1.32; gap: 0.3em 0.6em; border-radius: 10px; animation: gcin 0.3s ease-out; }
.gs-chat .lc-msg .pf { height: 1.3em; min-width: 2.6em; font-size: 0.62em; }
.gs-chat .lc-msg .body { color: #eee; }
.gs-hint { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #555; font-size: clamp(7px, 3.6cqw, 13px); padding: 1em; }
@keyframes gcin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Broadcast page (Go live) ---------- */
body.bc-open { overflow: hidden; }
.bc { position: fixed; inset: 0; z-index: 45; background: var(--bg); display: flex; flex-direction: column; animation: bcin .22s ease; }
@keyframes bcin { from { opacity: 0; transform: translateY(8px); } }
.bc-top { display: flex; align-items: center; gap: 14px; height: 72px; padding: 0 22px; border-bottom: 1px solid var(--line); flex: none; }
.bc-top .spacer, .bc-col-h .spacer, .bc-chat-h .spacer, .bc-panel-h .spacer { flex: 1; }
.bc-title { background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 6px 10px; font: 600 22px var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--text); width: min(460px, 40vw); outline: none; }
.bc-title:hover { border-color: var(--line-2); }
.bc-title:focus { border-color: var(--curb); }
.bc-status { height: 32px; padding: 0 14px; font-size: 13px; }
.bc-status.live { background: var(--live); border-color: var(--live); color: #fff; font-family: var(--display); letter-spacing: .06em; text-transform: uppercase; }
.bc-status.live .dot { background: #fff; animation: pulse 1.4s infinite; }
.bc-status.live.warn { box-shadow: 0 0 0 2px var(--warn); }
.bc-go { min-width: 150px; border-radius: 999px; background: var(--curb); color: var(--ink); border-color: var(--curb); font-size: 18px; }
.bc-go:hover:not(:disabled) { background: var(--curb-deep); }
.bc-go:disabled { opacity: .35; cursor: not-allowed; }
.bc-go.end { background: var(--live); border-color: var(--live); color: #fff; }
.bc-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; padding: 18px 22px 22px; }
.bc.no-chat .bc-body { grid-template-columns: minmax(0, 1fr) 0; gap: 0; }
.bc-cols { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: center; }
.bc-cols.two { grid-template-columns: minmax(0, 1fr) minmax(220px, .42fr); align-items: start; }
.bc-col { display: grid; gap: 12px; min-width: 0; }
.bc-col-h { display: flex; align-items: center; gap: 10px; min-height: 40px; flex-wrap: wrap; }
.bc-col-h > b { font: 600 20px var(--display); text-transform: uppercase; letter-spacing: .03em; }
.bc-icons { display: flex; gap: 6px; flex-wrap: wrap; }
.bc-link { background: none; border: 0; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; }
.bc-link:hover { color: var(--text); }
.bc-link .ico { width: 15px; height: 15px; }
.bc-minus { font-size: 20px; line-height: 1; padding: 2px 8px; }

/* platform icon buttons */
.pf-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: #151515; color: #5d5d58; display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s; padding: 0; }
.pf-btn svg { width: 17px; height: 17px; fill: currentColor; }
.pf-btn:hover { color: var(--text); border-color: #4a4a4a; }
.pf-btn:active { transform: scale(.94); }
.pf-btn.add { border-style: dashed; }
.pf-btn.st-ready, .pf-btn.st-waiting { color: var(--text); border-color: var(--curb); background: #1d1b10; }
.pf-btn.st-off { color: #5d5d58; border-style: dashed; }
.pf-btn.st-live { color: #fff; border-color: transparent; }
.pf-btn.st-live.youtube { background: #ff0033; } .pf-btn.st-live.twitch { background: #9146ff; } .pf-btn.st-live.kick { background: #53fc18; color: #061; }
.pf-btn.st-live.facebook { background: #1877f2; } .pf-btn.st-live.x { background: #f4f4f2; color: #000; } .pf-btn.st-live.tiktok { background: #fe2c55; }
.pf-btn.st-live.instagram { background: linear-gradient(45deg, #f9a825, #e1306c 55%, #833ab4); } .pf-btn.st-live.custom { background: var(--curb); color: var(--ink); }
.pf-btn.st-connecting, .pf-btn.st-retrying { color: var(--text); border-color: var(--warn); }
.pf-btn.st-unavailable { color: #ffb4ad; border-color: var(--live); }
.pf-dot { position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg); background: var(--live); }
.pf-btn.st-live .pf-dot { animation: pulse 1.4s infinite; }
.pf-btn.st-connecting .pf-dot, .pf-btn.st-retrying .pf-dot { background: var(--warn); }

/* the big card: connect form or live preview */
.bc-card { position: relative; aspect-ratio: 16 / 9; max-height: calc(100dvh - 72px - 120px); width: 100%; margin: 0 auto; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.bc-card.tall { aspect-ratio: 9 / 16; }
.bc-cols.two .bc-col:first-child .bc-card { max-height: calc(100dvh - 72px - 120px); }
.bc-card.has-preview { background: #000; border-color: #1e1e1e; }
.bc-connect { width: min(420px, 88%); display: grid; gap: 14px; padding: 18px 0; }
.bc-connect.compact { width: 100%; padding: 0; }
.bc-connect h3 { font: 500 22px var(--ui); text-transform: none; letter-spacing: 0; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.bc-connect.compact h3 { font-size: 15px; justify-content: flex-start; }
.bc-card.tall .bc-connect h3 { font-size: 18px; }
.bc-card.tall { max-height: calc(100dvh - 72px - 170px); }
.bc-src { justify-self: center; }
.bc-made { padding: 24px; text-align: center; font-size: 14px; line-height: 1.45; max-width: 240px; }
.bc-help { width: 20px; height: 20px; border-radius: 50%; background: #222; color: var(--muted); display: inline-grid; place-items: center; font: 700 11px var(--ui); cursor: help; }
.bc-input { display: flex; align-items: center; background: #0c0c0c; border: 1px solid var(--line-2); border-radius: 12px; padding-right: 4px; }
.bc-input .input { border: 0; background: transparent; box-shadow: none; min-width: 0; flex: 1; font-size: 13px; }
.bc-ico { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; cursor: pointer; flex: none; }
.bc-ico:hover { color: var(--text); background: #1c1c1c; }
.bc-ico .ico { width: 17px; height: 17px; }
.bc-srt summary { cursor: pointer; margin-bottom: 6px; }
.bc-preview { position: absolute; inset: 0; }
.bc-preview video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.bc-preview-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.bc-mute { position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.6); color: #888; display: grid; place-items: center; cursor: pointer; }
.bc-mute.on { color: var(--curb); }
.bc-mute .ico { width: 18px; height: 18px; }
.bc-feedinfo { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.bc-feedinfo .chip { background: rgba(0,0,0,.7); }
.bc-keys-pop { position: absolute; left: 12px; right: 12px; top: 12px; max-width: 460px; padding: 16px; border-radius: 16px; background: rgba(18,18,18,.97); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0,0,0,.6); }

/* right side: chat, or a platform's panel */
.bc-side { position: relative; min-height: 0; }
.bc-chat, .bc-panel { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.bc-chat[hidden], .bc-panel[hidden] { display: none; }
.bc-panel { animation: bcpanel .2s ease; }
@keyframes bcpanel { from { opacity: 0; transform: translateX(12px); } }
.bc-chat-h, .bc-panel-h { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.bc-chat-h b, .bc-panel-h b { font: 600 18px var(--display); text-transform: uppercase; letter-spacing: .04em; }
.bc-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #1f1f1f; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.bc-x .ico { width: 15px; height: 15px; }
.bc-send { padding: 10px 12px 12px; border-top: .5px solid var(--line-2); }
.chip .ico { width: 14px; height: 14px; }
.bc-chat-log { flex: 1; overflow: auto; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.bc-chat-empty { margin: auto; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; padding: 20px; font-size: 13.5px; }
.bc-chat-fab { position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--curb); background: #1d1b10; color: var(--curb); display: grid; place-items: center; cursor: pointer; z-index: 46; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.bc-chat-fab .ico { width: 22px; height: 22px; }
.pf-badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #222; color: #fff; }
.pf-badge svg { width: 22px; height: 22px; fill: currentColor; }
.pf-badge.youtube { background: #ff0033; } .pf-badge.twitch { background: #9146ff; } .pf-badge.kick { background: #53fc18; color: #061; } .pf-badge.facebook { background: #1877f2; }
.pf-badge.x { background: #f4f4f2; color: #000; } .pf-badge.tiktok { background: #111; border: 1px solid #333; } .pf-badge.instagram { background: linear-gradient(45deg, #f9a825, #e1306c 55%, #833ab4); } .pf-badge.custom { background: var(--curb); color: var(--ink); }
.bc-form { flex: 1; overflow: auto; padding: 4px 16px 18px; display: grid; gap: 14px; align-content: start; }
/* Show details: what Twitch and YouTube call this show */
.bc-show-pf { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.bc-show-pf-h { display: flex; align-items: center; gap: 10px; }
.bc-show-pf-h .spacer { flex: 1; }
.bc-show-pf .pf-badge { width: 28px; height: 28px; border-radius: 8px; }
.bc-show-pf .pf-badge svg { width: 16px; height: 16px; }
.bc-show-pf p { margin: 0; }
.bc-form .link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.bc-skip { justify-self: center; }
.bc-thumb { display: flex; align-items: center; gap: 12px; }
.bc-thumb-img { width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #0e0e0e; }
.bc-thumb-act { display: grid; gap: 8px; justify-items: start; }
.bc-thumb-btns { display: flex; gap: 8px; }
.bc-thumb-btns .btn { font-variant-numeric: tabular-nums; min-width: 84px; }
.bc-show-pf .bc-link { justify-self: start; padding: 0; }
.bc-steps { margin: 0; padding: 14px 14px 14px 32px; display: grid; gap: 8px; background: #0e0e0e; border: 1px solid var(--line); border-radius: 14px; color: #cfcfc8; font-size: 13px; }
.bc-steps li::marker { color: var(--curb); font-weight: 700; }
.bc-dest-st { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #0e0e0e; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.bc-dest-st i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.bc-dest-st.st-ready i, .bc-dest-st.st-waiting i { background: var(--curb); }
.bc-dest-st.st-live { color: #fff; border-color: #5b1d19; } .bc-dest-st.st-live i { background: var(--live); animation: pulse 1.4s infinite; }
.bc-dest-st.st-retrying, .bc-dest-st.st-connecting { color: #f5c46b; } .bc-dest-st.st-retrying i, .bc-dest-st.st-connecting i { background: var(--warn); }
.bc-dest-st.st-unavailable { color: #ffb4ad; } .bc-dest-st.st-unavailable i { background: var(--live); }

@media (max-width: 1100px) {
  .bc-body { grid-template-columns: minmax(0, 1fr); overflow: auto; }
  .bc-side { min-height: 520px; }
  .bc-cols.two { grid-template-columns: minmax(0, 1fr); }
  .bc-card.tall { max-height: 70dvh; width: auto; }
  .bc-title { width: 100%; font-size: 18px; }
}

.bc-feedinfo .chip.rt { color: var(--ink); background: var(--curb); border-color: var(--curb); font-weight: 700; }
.bc-feedinfo .chip.warn-tip { color: #f5c46b; border-color: #4d3a12; cursor: help; }

/* ---------- theCURB Studio edition ---------- */
/* Live-edition features (restream, live chat, return feed, vertical) are hidden in the studio edition. */
[data-edition='studio'] .live-only { display: none !important; }
html:not([data-edition='studio']) .studio-only { display: none !important; }
/* Overlay styles a show can pick: bold = thick color bar lower third, minimal = thin glow. */
.stage-canvas[data-style='bold'] .stage-tile .nametag { font-size: 1.12em; }
.stage-canvas[data-style='bold'] .stage-tile .nametag i { width: calc(18px * var(--tile-scale, 1)); }
.stage-canvas[data-style='minimal'] .stage-tile::after { box-shadow: inset 0 0 0 calc(3px * var(--tile-scale, 1)) var(--accent); }
.topbar .show-logo { height: 28px; max-width: 120px; object-fit: contain; border-radius: 4px; }
.powered { color: var(--dim); font-size: 12px; text-align: center; padding: 18px 0 calc(14px + env(safe-area-inset-bottom)); }
.powered a { color: var(--muted); text-decoration: none; }
.powered b { font-family: var(--display); letter-spacing: 0.04em; font-weight: 600; color: var(--muted); }
.stage-canvas[data-style] .stage-bug { width: auto; max-width: calc(230px * var(--logo-k, 1)); max-height: calc(120px * var(--logo-k, 1)); object-fit: contain; }
.show-cam { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.show-cam small { display: block; color: var(--muted); font-size: 12px; }
.brand .brand-name { font: 600 18px/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }
.brand img:not([src*='thecurb-logo']) { height: 30px; max-width: 140px; object-fit: contain; }
.app-brand img:not([src*='thecurb-logo']) { max-height: 48px; max-width: 180px; object-fit: contain; }
.welcome-msg { color: var(--muted); margin: -4px 0 4px; white-space: pre-line; }

/* ⓘ explainers: hidden until the little i is tapped */
.info { display: inline-grid; place-items: center; flex: none; width: 17px; height: 17px; padding: 0; margin: 0 0 0 6px; border-radius: 50%; border: 1.3px solid var(--dim); background: transparent; color: var(--muted); cursor: pointer; vertical-align: middle; position: relative; top: 0; font: italic 700 10.5px/1 Georgia, 'Times New Roman', serif; text-transform: none; letter-spacing: 0; transition: color .15s, border-color .15s, background .15s; }
.info::before { content: 'i'; }
/* Centered on the text beside it: headings sit a touch higher (tall display font). */
h1 .info, h2 .info, h3 .info { top: -1.5px; }
.info:hover, .info:focus-visible { color: var(--text); border-color: var(--muted); outline: none; }
.info[aria-expanded='true'] { color: var(--ink); background: var(--curb); border-color: var(--curb); }
/* Opens as a card floating over everything, next to its ⓘ (placed by ui.js); nothing else moves. */
.explain { display: none; position: fixed; z-index: 1000; width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; margin: 0; padding: 14px 36px 14px 16px; border-radius: 14px; background: #2c2c2e; color: rgba(235, 235, 245, 0.75); box-shadow: 0 18px 50px rgba(0, 0, 0, .6), inset 0 0 0 .5px var(--line-2); font: 400 13px/1.5 var(--ui); text-transform: none; letter-spacing: 0; text-align: left; white-space: normal; }
.explain.open { display: block; animation: exin .16s ease; }
.explain-x { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--fill-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.explain-x::before { content: '×'; font: 500 16px/1 var(--ui); transform: translateY(-1px); }
.explain-x:hover { background: var(--fill); color: var(--text); }
.explain b { color: var(--text); font-weight: 600; }
.explain ul, .explain ol { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.explain .btn { margin-top: 8px; }
@keyframes exin { from { opacity: 0; transform: translateY(-3px); } }

/* Free layout (studio preview): grab a cam to move it, its corner to resize */
.stage-tile .rs { display: none; }
.stage-canvas.free-edit .stage-tile { cursor: grab; touch-action: none; user-select: none; }
.stage-canvas.free-edit .stage-tile:hover { outline: 4px solid rgba(255, 255, 255, 0.55); outline-offset: 0; }
.stage-canvas.free-edit .stage-tile.dragging { cursor: grabbing; transition: opacity 0.3s, box-shadow 0.2s; outline-color: var(--curb); }
.stage-canvas.free-edit .stage-tile .rs { display: block; position: absolute; right: 0; bottom: 0; z-index: 4; width: 56px; height: 56px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 54%, rgba(255, 255, 255, 0.9) 55%); }
.stage-canvas.free-edit .stage-tile .rs:hover { background: linear-gradient(135deg, transparent 54%, var(--curb) 55%); }
.stage-bug, .stage-banner { z-index: 1000; pointer-events: none; } /* logo + banner stay above cams, and never block dragging */

/* ---------- Dark / light mode (theme.js sets <html data-theme>) ---------- */
.theme-btn { flex: none; margin-left: 4px; width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 0.5px solid var(--line-2); background: var(--fill-2); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.theme-btn.push { margin-left: auto; } /* top bars with nothing pushing it right */
.theme-btn:hover { background: var(--fill); }
.theme-btn:focus-visible { outline: 2px solid var(--curb); outline-offset: 2px; }
.theme-btn.floating { position: fixed; top: 14px; right: 14px; z-index: 50; }

:root[data-theme='light'] {
  --bg: #f2f2f7;
  --panel: #ffffff;
  --panel-2: #e9e9ee;
  --fill: rgba(118, 118, 128, 0.16);
  --fill-2: rgba(118, 118, 128, 0.09);
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.13);
  --text: #1d1d1f;
  --muted: rgba(60, 60, 67, 0.68);
  --dim: rgba(60, 60, 67, 0.34);
  color-scheme: light;
}
[data-theme='light'] .topbar { background: rgba(255, 255, 255, 0.78); }
/* theCURB wordmark is white: show it dark on light surfaces (cams, stage and previews keep it as is) */
[data-theme='light'] .brand img[src*='thecurb-logo'], [data-theme='light'] .logo img[src*='thecurb-logo'] { filter: brightness(0); }
[data-theme='light'] .tabs button[aria-selected='true'] { background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
[data-theme='light'] .seg button:not([aria-pressed='true']):hover { background: rgba(0, 0, 0, 0.05); }
[data-theme='light'] .explain { background: #fff; color: rgba(60, 60, 67, 0.85); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18), inset 0 0 0 .5px var(--line-2); }
[data-theme='light'] .toast { background: rgba(255, 255, 255, 0.94); color: var(--text); }
[data-theme='light'] .steps { color: rgba(60, 60, 67, 0.85); }
[data-theme='light'] kbd, [data-theme='light'] code { background: #ececf0; border-color: #d4d4da; color: #1d1d1f; }
[data-theme='light'] .swatch { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
[data-theme='light'] .swatch[aria-pressed='true'], [data-theme='light'] .bc-swatches [aria-pressed='true'] { outline-color: var(--text); }
/* logos are usually made for a dark stream: preview them on dark */
[data-theme='light'] .logo-drop img { background: #1c1c1e; padding: 10px 14px; border-radius: 10px; box-sizing: content-box; }
[data-theme='light'] .aud-pop { background: rgba(255, 255, 255, 0.97); }
[data-theme='light'] .gv-modes button[aria-checked='true'] { background: rgb(var(--curb-rgb) / 0.22); }
[data-theme='light'] .gv-modes button::before { border-color: #b8b8c0; }
[data-theme='light'] .lc-log .lc-msg.featured { background: rgb(var(--curb-rgb) / 0.2); }
[data-theme='light'] .lc-onscreen { background: rgb(var(--curb-rgb) / 0.12); border-color: rgb(var(--curb-rgb) / 0.6); }
[data-theme='light'] .ov-item .ov-ico { background: var(--panel-2); }
[data-theme='light'] .chip.bad, [data-theme='light'] .lc-src-help.err, [data-theme='light'] .err { color: #d70015; }
[data-theme='light'] .sheet { background: rgba(255, 255, 255, 0.96); }
[data-theme='light'] .btn:not(.primary, .danger, .live, .google, .twitch, .studio-go):hover { background: #dcdce2; }
[data-theme='light'] .btn.danger { color: #d70015; }
/* Video areas stay dark (like a monitor) in light mode, so keep dark-mode text and controls inside them. */
[data-theme='light'] :is(.stage-tools, .stage-tile, .vtile, .pv-tile, .phone, .gs, .waiting, .main, .bc-preview, .preview .pv-cam) {
  --text: #f5f5f7; --muted: rgba(235, 235, 245, 0.6); --dim: rgba(235, 235, 245, 0.3);
  --fill: rgba(118, 118, 128, 0.24); --fill-2: rgba(118, 118, 128, 0.14);
  --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.12);
  --panel: #1c1c1e; --panel-2: #2c2c2e; color: var(--text);
}
/* Yellow (or the show's color) as text is unreadable on white: use a deeper shade of it. */
[data-theme='light'] { --curb-text: color-mix(in srgb, var(--curb) 50%, #000); }
[data-theme='light'] a:not(.btn, .brand, .logo, .ov-link), [data-theme='light'] .note b, [data-theme='light'] .lobby-card h1 em, [data-theme='light'] .pcard .acts .aud-btn.alert { color: var(--curb-text); }
[data-theme='light'] .bc-steps li::marker { color: var(--curb-text); }
/* Stage previews: a light gray checkerboard (like a see-through PNG) instead of the dark one. */
[data-theme='light'] :is(.stage-box, .pv-stage) {
  background-color: #ffffff;
  background-image: linear-gradient(45deg, #e4e4e8 25%, transparent 25%), linear-gradient(-45deg, #e4e4e8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e4e4e8 75%), linear-gradient(-45deg, transparent 75%, #e4e4e8 75%);
  box-shadow: inset 0 0 0 .5px var(--line-2), 0 14px 36px rgba(0, 0, 0, .12);
}
[data-theme='light'] .stage-box .hint b { color: var(--text); }
/* Camera off: a soft gray tile in light mode (the OBS overlay never loads the theme, so the stream keeps the dark one). */
[data-theme='light'] .vtile .avatar { background: radial-gradient(circle at 50% 40%, #ececf0, #cfcfd5); }
[data-theme='light'] .stage-tile .avatar { background: radial-gradient(circle at 50% 40%, #ececf0, #cfcfd5 70%); }
[data-theme='light'] .vtile.no-video, [data-theme='light'] .stage-tile.no-video { background: #d9d9de; }
