:root {
  /* Black theme after the simple-dark Neovim colorscheme: pure black, greyscale
     text, red highlights. */
  color-scheme: dark;
  --bg: #000000;
  --panel: #080808;
  --panel-2: #141414;
  --text: #d0d0d0;
  --text-bright: #eeeeee;
  --muted: #8a8a8a;
  --dim: #585858;
  --line: #262626;
  --accent: #ff2a2a;
  --accent-soft: #ff5555;
  --accent-text: #ffffff;
  --ok: #bcbcbc;
  --ok-bg: #141414;
  --bad: #ff5555;
  --bad-bg: #1a0606;
  --warn-bg: #120808;
  --warn-line: #5a1a1a;
  --radius: 10px;
  /* One height for text fields, selects and buttons, so rows line up. */
  --ctl-h: 2.4rem;
  --ctl-h-sm: 2rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
a { color: inherit; text-underline-offset: 3px; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; line-height: 1.25; color: var(--text-bright); }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel-2); padding: .1em .35em; border-radius: 5px; word-break: break-all; }
code.secret { user-select: all; }
[hidden] { display: none !important; }

.topbar { display: flex; align-items: center; gap: 1.25rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.brand { color: var(--text-bright); letter-spacing: .02em; }
.brand .dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 12px var(--accent); }
.main-nav, .account-nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.main-nav a, .account-nav a { text-decoration: none; color: var(--muted); }
.main-nav a.active, .account-nav a.active, .main-nav a:hover, .account-nav a:hover { color: var(--text); }
.account-nav { margin-left: auto; }
.account-nav a.btn, .account-nav a.btn:hover { color: var(--accent-text); }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.notice { max-width: 1100px; margin: 1rem auto 0; padding: .6rem 1rem; background: var(--panel-2); color: var(--text-bright); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.warning { background: var(--warn-bg); border: 1px solid var(--warn-line); padding: .6rem .9rem; border-radius: var(--radius); }
.warning-text { color: var(--bad); }
.error { background: var(--bad-bg); color: var(--bad); padding: .6rem .9rem; border-radius: var(--radius); }
.muted { color: var(--muted); }
.hint { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.small { font-size: .875rem; }
.center { text-align: center; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; display: block; text-decoration: none; }
.card.narrow { max-width: 440px; margin: 2rem auto; }
a.card:hover { border-color: var(--muted); }
.hero { text-align: center; padding: 4rem 1rem; }
.hero .lead { font-size: 1.2rem; color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.form-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.grid .wide { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.row.tight { gap: .5rem; margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head form { margin: 0; }
form.inline { display: inline; }

label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: .35rem; }
input, select, textarea { font: inherit; color: var(--text-bright); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; min-width: 0; }
input[type=checkbox] { width: 1rem; height: 1rem; }
textarea { resize: vertical; line-height: 1.45; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; margin: 0; min-width: 0; }
legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
fieldset p { margin: .4rem 0; }
.narrow-input { width: 5rem; }
h2.spaced { margin-top: 1.5rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=search] { width: 100%; max-width: 360px; margin-bottom: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; height: var(--ctl-h); line-height: 1.1; font: inherit; font-weight: 600; padding: 0 1rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; }
.btn.small { height: var(--ctl-h-sm); padding: 0 .7rem; font-size: .875rem; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { color: var(--text); }
button.link.danger { color: var(--bad); }

.tag { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; background: var(--panel-2); color: var(--muted); }
.tag.ok { background: var(--panel-2); color: var(--text-bright); border: 1px solid var(--line); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 6px; font-size: .8rem; font-weight: 700; letter-spacing: .05em; background: var(--panel-2); color: var(--muted); }
.badge.live { background: var(--accent); color: #fff; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.kv.wide { grid-template-columns: minmax(140px, max-content) 1fr; }

.subnav { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.subnav a { padding: .5rem .75rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--text); border-bottom-color: var(--line); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 1rem 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .2rem; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: .85rem; }
svg.spark { width: 100%; height: 48px; display: block; margin-bottom: .75rem; }
svg.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }

.tier ul.prices { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: .75rem; }
.tier ul.prices li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }

/* Player */
.player-wrap { max-width: 1100px; margin: 0 auto; }
.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player.audio { aspect-ratio: auto; height: 220px; }
.player.audio .eq { height: 40px; }
/* Live uses its own controls, so the empty video surface can be hidden. VOD keeps the
   native controls visible (the card leaves the bottom strip free for them). */
.player:not(.vod-player) video.audio-mode { opacity: 0; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; padding: 1rem; text-align: center; color: #ddd; }
.overlay > * { pointer-events: auto; }
.play { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 2rem; cursor: pointer; box-shadow: 0 6px 30px rgba(0,0,0,.5); }
.audio-card { position: absolute; inset: 0 0 56px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #ddd; pointer-events: none; }
.eq { display: flex; gap: 6px; align-items: flex-end; height: 48px; }
.eq span { width: 8px; background: var(--accent); border-radius: 3px; animation: eq 1.1s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: .2s; } .eq span:nth-child(3) { animation-delay: .4s; } .eq span:nth-child(4) { animation-delay: .6s; }
.player.paused .eq span { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .eq span { animation: none; height: 60%; } }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: .35rem; padding: 1.5rem .6rem .5rem; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); transition: opacity .25s; z-index: 3; }
.player.idle .controls { opacity: 0; pointer-events: none; }
.player.idle { cursor: none; }
.ctl { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 .4rem; border: 0; border-radius: 8px;
  background: transparent; color: #fff; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .05em; }
.ctl:hover { background: rgba(255,255,255,.12); }
.ctl svg { width: 24px; height: 24px; fill: currentColor; }
.controls .spacer { flex: 1; }
.latency { font-size: .85rem; color: #ddd; font-variant-numeric: tabular-nums; }
.live-btn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: .4rem; }
.live-btn.behind { color: #bbb; }
.live-btn.behind::before { background: #888; }
.volume { -webkit-appearance: none; appearance: none; width: 96px; height: 4px; padding: 0; border: 0; border-radius: 2px; cursor: pointer;
  background: linear-gradient(to right, #fff var(--fill, 100%), rgba(255,255,255,.3) var(--fill, 100%)); }
.volume::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.volume::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.volume:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* Offline screen: the operator's image or looping video, under the overlay. */
.offline-banner { position: absolute; inset: 0; display: none; }
.offline-banner img, .offline-banner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.player.offline.has-banner .offline-banner { display: block; }
.player.offline .controls { display: none; }
.player.offline.has-banner .overlay { align-items: flex-end; padding-bottom: 1.5rem; }
.player.offline.has-banner #offline-msg { background: rgba(0,0,0,.6); padding: .4rem .9rem; border-radius: 999px; font-size: .9rem; }
.hero-banner { max-width: 1100px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; max-height: 420px; background: #000; }
.hero-banner img, .hero-banner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-banner + .hero { padding-top: 2rem; }
.stream-info h1 { margin: .25rem 0 .5rem; }
.description { color: var(--text); overflow-wrap: anywhere; max-width: 75ch; margin-bottom: 1rem; }
.description a { color: var(--accent); }
.offline-preview { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: #000; margin-bottom: .5rem; }
.offline-preview img, .offline-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.emote-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.emote-item { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; margin: 0; }
.emote-item img { object-fit: contain; }
.player-bar { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; flex-wrap: wrap; }
.segmented { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented button { font: inherit; font-size: .9rem; padding: .4rem .9rem; border: 0; background: var(--panel); color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--panel-2); color: var(--text); font-weight: 600; }
.vod h2 { margin-bottom: .25rem; }

@media (max-width: 600px) {
  .volume { width: 64px; }
  .player-bar .muted.small { display: none; }
  .topbar { gap: .75rem 1rem; }
  .account-nav { margin-left: auto; }
  .account-nav a:not(.btn) { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .grid .wide { grid-column: auto; }
  h1 { font-size: 1.35rem; }
}

/* Live page with chat */
main:has(.live-layout.with-chat) { max-width: 1440px; }
.live-layout.with-chat { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.live-layout.with-chat .player-wrap { max-width: none; margin: 0; }
.live-chat { position: relative; align-self: stretch; min-height: 420px; }
.live-chat > .chat { position: absolute; inset: 0; }
@media (max-width: 960px) {
  .live-layout.with-chat { grid-template-columns: 1fr; }
  .live-chat { min-height: 0; height: 60vh; }
}

/* Chat */
.chat { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; min-height: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
.chan-name { font-weight: 700; white-space: nowrap; }
.chat-head .topic { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-scroll { flex: 1; overflow-y: auto; padding: .4rem 0; min-height: 0; overscroll-behavior: contain; }
.chat-messages { list-style: none; margin: 0; padding: 0; }
.msg { padding: .2rem .9rem; line-height: 1.45; overflow-wrap: anywhere; font-size: .94rem; }
.msg:hover { background: var(--panel-2); }
.msg time { color: var(--muted); font-size: .75rem; margin-right: .45rem; font-variant-numeric: tabular-nums; }
.msg .who { font-weight: 700; margin-right: .45rem; }
.msg .role-badge { margin-right: .45rem; vertical-align: 1px; }
.msg.system { color: var(--muted); font-style: italic; }
.msg .mod { display: none; margin-left: .5rem; font-size: .75rem; }
.msg .mod button { margin-left: .4rem; font-size: inherit; }
.chat.can-moderate .msg:hover .mod, .msg.mine:hover .mod, .msg:focus-within .mod { display: inline; }
.chat:not(.can-moderate) .msg .mute { display: none; }
.chat:not(.can-moderate) .msg:not(.mine) .mod { display: none; }
.c0 { color: #ff6b6b; } .c1 { color: #7aa7ff; } .c2 { color: #5fd38a; } .c3 { color: #e07ff0; }
.c4 { color: #f5b04a; } .c5 { color: #4fd1e8; } .c6 { color: #a99bff; } .c7 { color: #ff7ab8; }
.chat-empty { text-align: center; }
.load-older { display: block; margin: .25rem auto .5rem; font-size: .85rem; }
.new-msgs { position: absolute; left: 50%; transform: translateX(-50%); bottom: 5rem; border: 0; border-radius: 999px; padding: .3rem .8rem; background: var(--accent); color: #fff; font: inherit; font-size: .8rem; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.chat-compose { border-top: 1px solid var(--line); padding: .6rem .9rem; }
.chat-compose p { margin: .3rem 0 0; }
.chat-form, .name-form { display: flex; gap: .5rem; flex-direction: column; }
.name-form { flex-direction: row; }
.name-form input { flex: 1; }
.compose-row { display: flex; gap: .4rem; align-items: center; }
.compose-row input[name=body] { flex: 1; }
.icon-btn { flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--muted); font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 0; }
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.attach-preview { display: flex; align-items: center; gap: .6rem; }
.attach-preview img { max-height: 56px; max-width: 96px; border-radius: 6px; border: 1px solid var(--line); }
.chat-compose { position: relative; }
.picker { position: absolute; right: .9rem; bottom: calc(100% - .2rem); width: min(320px, calc(100% - 1.8rem)); max-height: 300px; overflow-y: auto; z-index: 5;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.picker-h { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .25rem .25rem .35rem; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 2px; }
.picker-grid button { height: 36px; border: 0; border-radius: 6px; background: none; font-size: 1.3rem; cursor: pointer; padding: 2px; display: flex; align-items: center; justify-content: center; }
.picker-grid button:hover, .picker-grid button:focus-visible { background: var(--panel-2); }
.picker-grid img { width: 28px; height: 28px; object-fit: contain; }
.suggest { position: absolute; left: .9rem; right: .9rem; bottom: calc(100% - .2rem); list-style: none; margin: 0; padding: .25rem; z-index: 6;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.suggest li { padding: .3rem .5rem; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.suggest li.active { background: var(--panel-2); }
.suggest img { width: 22px; height: 22px; object-fit: contain; }
.chat.dropping { outline: 2px dashed var(--accent); outline-offset: -4px; }
.chat-closed { margin: .5rem .9rem; }
.msg .emote { height: 28px; width: auto; max-width: 84px; vertical-align: middle; margin: -4px 0; }
.msg .mention { font-weight: 600; background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 4px; padding: 0 .2rem; }
.msg.mentions-me { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.msg .body a { color: var(--accent); }
.msg .att { display: block; margin: .3rem 0 .15rem; width: fit-content; }
.msg .att img { display: block; max-width: min(100%, 320px); max-height: 240px; width: auto; height: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.role-badge.b0 { background: #e5374a; } .role-badge.b1 { background: #2f80ed; } .role-badge.b2 { background: #16a34a; } .role-badge.b3 { background: #c026d3; }
.role-badge.b4 { background: #b45309; } .role-badge.b5 { background: #0e7490; } .role-badge.b6 { background: #7c3aed; } .role-badge.b7 { background: #db2777; }
.role-badge { display: inline-block; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--accent); color: #fff; border-radius: 4px; padding: .05rem .3rem; }
.unread { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .35rem; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.3rem;
  text-align: center; background: var(--panel-2); color: var(--text); vertical-align: 1px; }
.unread.mention { background: var(--accent); color: #fff; }
.chat-channels a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.chat-channels .chan-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-error, .error-text { color: var(--bad); font-size: .85rem; margin: .3rem 0 0; }
.chat-error:empty { display: none; }
.chat-page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; height: calc(100vh - 150px); min-height: 420px; }
.chat-page .chat { height: 100%; }
.chat-channels h2 { font-size: .8rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; margin: .5rem .6rem; }
.chat-channels ul { list-style: none; padding: 0; margin: 0 0 1rem; }
.chat-channels a { display: block; padding: .35rem .6rem; border-radius: 6px; text-decoration: none; color: var(--muted); }
.chat-channels a.active, .chat-channels a:hover { background: var(--panel-2); color: var(--text); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin-left: .25rem; }
@media (max-width: 700px) {
  .chat-page { grid-template-columns: 1fr; height: auto; }
  .chat-channels ul { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 0; }
  .chat-page .chat { height: 70vh; }
}

/* Name colors people choose (palette tuned per theme); viewers can hide them. */
:root { --uc0: #f87171; --uc1: #fb923c; --uc2: #fbbf24; --uc3: #a3e635; --uc4: #4ade80; --uc5: #2dd4bf; --uc6: #22d3ee; --uc7: #38bdf8; --uc8: #60a5fa; --uc9: #818cf8; --uc10: #a78bfa; --uc11: #c084fc; --uc12: #e879f9; --uc13: #f472b6; --uc14: #fb7185; --uc15: #9ca3af; }
.chat:not(.no-user-colors) .who.uc0, .chat-settings .sw0 { color: var(--uc0); }
.chat:not(.no-user-colors) .who.uc1, .chat-settings .sw1 { color: var(--uc1); }
.chat:not(.no-user-colors) .who.uc2, .chat-settings .sw2 { color: var(--uc2); }
.chat:not(.no-user-colors) .who.uc3, .chat-settings .sw3 { color: var(--uc3); }
.chat:not(.no-user-colors) .who.uc4, .chat-settings .sw4 { color: var(--uc4); }
.chat:not(.no-user-colors) .who.uc5, .chat-settings .sw5 { color: var(--uc5); }
.chat:not(.no-user-colors) .who.uc6, .chat-settings .sw6 { color: var(--uc6); }
.chat:not(.no-user-colors) .who.uc7, .chat-settings .sw7 { color: var(--uc7); }
.chat:not(.no-user-colors) .who.uc8, .chat-settings .sw8 { color: var(--uc8); }
.chat:not(.no-user-colors) .who.uc9, .chat-settings .sw9 { color: var(--uc9); }
.chat:not(.no-user-colors) .who.uc10, .chat-settings .sw10 { color: var(--uc10); }
.chat:not(.no-user-colors) .who.uc11, .chat-settings .sw11 { color: var(--uc11); }
.chat:not(.no-user-colors) .who.uc12, .chat-settings .sw12 { color: var(--uc12); }
.chat:not(.no-user-colors) .who.uc13, .chat-settings .sw13 { color: var(--uc13); }
.chat:not(.no-user-colors) .who.uc14, .chat-settings .sw14 { color: var(--uc14); }
.chat:not(.no-user-colors) .who.uc15, .chat-settings .sw15 { color: var(--uc15); }
.swatch.sw0 { background: var(--uc0); }
.swatch.sw1 { background: var(--uc1); }
.swatch.sw2 { background: var(--uc2); }
.swatch.sw3 { background: var(--uc3); }
.swatch.sw4 { background: var(--uc4); }
.swatch.sw5 { background: var(--uc5); }
.swatch.sw6 { background: var(--uc6); }
.swatch.sw7 { background: var(--uc7); }
.swatch.sw8 { background: var(--uc8); }
.swatch.sw9 { background: var(--uc9); }
.swatch.sw10 { background: var(--uc10); }
.swatch.sw11 { background: var(--uc11); }
.swatch.sw12 { background: var(--uc12); }
.swatch.sw13 { background: var(--uc13); }
.swatch.sw14 { background: var(--uc14); }
.swatch.sw15 { background: var(--uc15); }
.chat-head { align-items: center; }
.head-tools { display: inline-flex; gap: .25rem; margin-left: auto; flex: none; }
.head-btn { display: inline-flex; align-items: center; gap: .25rem; height: 30px; min-width: 30px; padding: 0 .35rem; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: .8rem; }
.head-btn:hover, .head-btn[aria-pressed=true], .head-btn[aria-expanded=true] { background: var(--panel-2); color: var(--text); }
.head-btn svg { width: 18px; height: 18px; fill: currentColor; }
.chat-settings { position: absolute; right: .6rem; top: 2.9rem; z-index: 7; width: min(300px, calc(100% - 1.2rem)); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .75rem; box-shadow: 0 8px 30px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: .6rem; }
.chat-settings .set-h { margin: 0; font-size: .8rem; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.swatch { aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; font: inherit; font-size: .7rem; font-weight: 700; }
.swatch.auto { background: var(--panel-2); color: var(--muted); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel) inset; }
.chat-main { flex: 1; display: flex; min-height: 0; position: relative; }
.chat-main .chat-scroll { flex: 1; }
.people { width: 220px; flex: none; border-left: 1px solid var(--line); overflow-y: auto; padding: .5rem .75rem; }
.chat.compact .people { position: absolute; inset: 0; width: auto; border-left: 0; background: var(--panel); z-index: 4; }
@media (max-width: 700px) { .people { position: absolute; inset: 0; width: auto; border-left: 0; background: var(--panel); z-index: 4; } }
.people-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .5rem 0 .3rem; font-weight: 600; }
.people-list { list-style: none; margin: 0 0 .5rem; padding: 0; }
.people-list li { display: flex; align-items: center; gap: .4rem; padding: .2rem 0; font-size: .9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.people-list .who { font-weight: 600; }
.people-list.offline li { opacity: .6; }
.presence-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-bright); box-shadow: 0 0 0 2px rgba(238,238,238,.15); flex: none; }
.presence-dot.off, .presence-dot.hidden-dot { background: transparent; border: 2px solid var(--dim); box-shadow: none; width: 9px; height: 9px; }
.people-count:empty { display: none; }
.picker-search { width: 100%; margin-bottom: .4rem; padding: .4rem .6rem; font-size: .9rem; }
.picker-grid[hidden], .picker-grid button[hidden] { display: none !important; }

/* "Working on" prompt: styled like an LLM chat prompt. */
.prompt-box { --p-bg: #050505; --p-fg: #eeeeee; --p-dim: #8a8a8a; --p-acc: #ff2a2a;
  background: var(--p-bg); color: var(--p-fg); border: 1px solid #262626; border-radius: 12px; padding: .55rem .85rem .65rem; margin: .25rem 0 .75rem;
  font-family: var(--mono); font-size: .92rem; line-height: 1.5; box-shadow: 0 1px 0 rgba(255,255,255,.03) inset; max-width: 100%; }
.prompt-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; min-width: 0; }
.prompt-collapse { display: inline-flex; align-items: center; gap: .35rem; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--p-dim); flex: none; }
.prompt-collapse:hover .prompt-label { color: var(--p-fg); }
.prompt-chev { width: .45rem; height: .45rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); transition: transform .15s; }
.prompt-box.collapsed .prompt-chev { transform: rotate(-45deg); }
.prompt-box.collapsed .prompt-line { display: none; }
.prompt-box.collapsed .prompt-head { margin-bottom: 0; }
.prompt-head .prompt-toggle { margin-left: auto; flex: none; }
.prompt-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--p-dim); }
.prompt-label::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--p-acc); margin-right: .45rem; vertical-align: 1px; animation: prompt-pulse 2s ease-in-out infinite; }
.prompt-toggle { font: inherit; font-size: .7rem; color: var(--p-dim); background: transparent; border: 1px solid #262626; border-radius: 6px; padding: .05rem .45rem; cursor: pointer; }
.prompt-toggle:hover { color: var(--p-fg); border-color: var(--p-dim); }
.prompt-line { display: flex; gap: .55rem; align-items: baseline; }
.prompt-caret { color: var(--p-acc); font-weight: 700; flex: none; }
.prompt-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-text::after { content: ""; display: inline-block; width: .55em; height: 1.05em; background: var(--p-fg); opacity: .7; vertical-align: -2px; margin-left: .15rem; animation: prompt-blink 1.1s steps(1) infinite; }
.prompt-file { font-size: .78rem; color: var(--p-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prompt-at { color: var(--p-acc); margin-right: .2rem; }
.prompt-file-name { background: #141414; color: #bcbcbc; border-radius: 4px; padding: .05rem .35rem; }
@keyframes prompt-blink { 50% { opacity: 0; } }
@keyframes prompt-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .prompt-text::after, .prompt-label::before { animation: none; } }
/* Over the video: compact, translucent, top-left; never blocks the controls. */
.prompt-box.over { position: absolute; top: .75rem; left: .75rem; right: auto; max-width: min(560px, calc(100% - 1.5rem)); margin: 0; z-index: 2;
  background: rgba(0,0,0,.78); backdrop-filter: blur(6px); border-color: rgba(255,255,255,.12); font-size: .85rem; }
.player.audio .prompt-box.over { top: .5rem; }
.prompt-history { margin: 0 0 1rem; }
.prompt-history summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.prompt-timeline { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.prompt-timeline li { padding: .2rem .4rem; border-radius: 6px; }
.prompt-timeline li.now { background: var(--panel-2); }
.prompt-timeline .seek { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .85rem; }

/* Chapters on recordings */
.chapters { margin: 0 0 1rem; }
.chapters-h { font-size: 1rem; margin: .25rem 0 .5rem; }
.chapter-list { list-style: none; margin: 0; padding: 0; display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x proximity; }
.chapter-list li { flex: none; width: 184px; scroll-snap-align: start; }
.chapter { display: flex; flex-direction: column; gap: .35rem; width: 100%; padding: .4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.chapter:hover, .chapter-list li.now .chapter { border-color: var(--accent); }
.chapter img, .chapter-noimg { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--panel-2); display: block; }
.chapter-meta { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.chapter-time { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.chapter-title { font-weight: 600; font-size: .88rem; line-height: 1.3; }
.chapter-summary { font-size: .78rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.clip-item { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: .8rem; align-items: start; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius); }
.clip-item.dismissed { opacity: .5; }
.clip-item img, .clip-item .chapter-noimg { width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.clip-item h3 { margin: 0 0 .2rem; font-size: .95rem; }
.clip-actions { display: flex; flex-direction: column; gap: .4rem; width: 10.4rem; }
.clip-actions > form, .clip-actions > .btn, .clip-actions > form > .btn { width: 100%; }
.clip-actions .btn { height: 2.35rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 .6rem; white-space: nowrap; }
.clip-state { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .4rem; }

@media (max-width: 700px) { .clip-item { grid-template-columns: 1fr; } .clip-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; } .clip-actions > .clip-state { grid-column: 1 / -1; } }
.row.spread { justify-content: space-between; }
.timeline-pending { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); font-size: .9rem; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.msg.notice { margin: .2rem .6rem; padding: .35rem .6rem; border-radius: 6px; background: var(--panel-2); border-left: 3px solid var(--muted); font-size: .88rem; }
.msg.notice.ok { border-left-color: var(--text-bright); }
.msg.notice.bad { border-left-color: var(--accent); }
.msg.notice .notice-tag { display: block; font-size: .7rem; color: var(--dim); margin-top: .1rem; }
.chat.no-user-colors.name-override .who { color: var(--name-override); }
.custom-color { flex-direction: row; align-items: center; gap: .5rem; }
.custom-color input[type=color] { width: 2.2rem; height: 1.6rem; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; }
.shortcuts { position: relative; }
.help-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.help-btn:hover, .help-btn[aria-expanded=true] { color: var(--text-bright); border-color: var(--muted); }
.shortcuts-pop { position: absolute; left: 0; top: calc(100% + .4rem); z-index: 6; width: 250px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem .8rem; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.shortcuts-pop .set-h { margin: 0 0 .4rem; font-size: .8rem; color: var(--muted); }
.shortcuts-pop dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .8rem; margin: 0 0 .4rem; font-size: .88rem; align-items: center; }
.shortcuts-pop dd { margin: 0; }
kbd { font-family: var(--mono); font-size: .75rem; padding: .05rem .35rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--panel-2); color: var(--text-bright); }

/* Signed-out front page */
body.bare main { max-width: none; padding: 0; }
body.bare .notice { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 10; margin: 0; }
.landing { min-height: 100vh; }
.landing-hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.landing-media { position: absolute; inset: 0; }
.landing-media img, .landing-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.landing-glow { background: radial-gradient(60% 50% at 70% 40%, rgba(255,42,42,.18), transparent 70%), radial-gradient(40% 40% at 20% 80%, rgba(255,255,255,.04), transparent 70%), #000; }
.landing-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.65) 45%, rgba(0,0,0,.35) 100%), linear-gradient(0deg, #000 0%, transparent 35%); }
.landing-inner { position: relative; width: 100%; max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 3rem; align-items: center; }
.landing-brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; color: var(--text-bright); margin: 0 0 2.5rem; }
.dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); display: inline-block; }
.live-pill { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 1rem; padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #fff; background: var(--accent); }
.live-pill span { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: prompt-pulse 1.6s ease-in-out infinite; }
.live-pill.off { background: rgba(255,255,255,.08); color: var(--muted); border: 1px solid var(--line); }
.live-pill.off span { background: var(--dim); animation: none; }
.landing-copy h1 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 1rem; max-width: 16ch; }
.landing-lead { font-size: 1.1rem; color: var(--text); max-width: 52ch; margin: 0 0 1.5rem; }
.landing-lead a { color: var(--accent-soft); }
.landing-scroll { color: var(--muted); text-decoration: none; font-size: .9rem; letter-spacing: .04em; }
.landing-scroll:hover { color: var(--text-bright); }
.landing-login { display: flex; flex-direction: column; gap: .8rem; padding: 1.5rem; border-radius: 14px; background: rgba(8,8,8,.82); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.landing-login h2 { margin: 0 0 .25rem; font-size: 1.15rem; color: var(--text-bright); }
.landing-login .btn { margin-top: .25rem; }
.landing-login p { margin: 0; }
.landing-login a, .landing-plans a:not(.btn) { color: var(--accent-soft); }
.landing-plans { max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem 3rem; }
.landing-plans > h2 { font-size: 1.6rem; color: var(--text-bright); margin: 0 0 1.5rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.plan-card { display: flex; flex-direction: column; gap: .75rem; padding: 1.5rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.plan-card:hover { border-color: #3a3a3a; }
.plan-card h3 { margin: 0; font-size: 1.2rem; color: var(--text-bright); }
.plan-card p { margin: 0; }
.benefits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.benefits li { padding-left: 1.5rem; position: relative; }
.benefits li::before { content: ""; position: absolute; left: 0; top: .45em; width: .7rem; height: .4rem; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.plan-prices { list-style: none; margin: auto 0 0; padding: .75rem 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .3rem; }
.plan-prices strong { color: var(--text-bright); font-size: 1.1rem; }
.plan-card .btn { align-self: flex-start; }
.landing-foot { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: 2rem 1rem 3rem; color: var(--dim); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 860px) {
  .landing-inner { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 1rem; }
  .landing-brand { margin-bottom: 1.5rem; }
  .landing-shade { background: linear-gradient(0deg, #000 10%, rgba(0,0,0,.6) 60%, rgba(0,0,0,.4) 100%); }
}
/* Live page: badge and title on one line, description and prompt below. */
.stream-head { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1 1 18rem; }
.stream-head h1 { margin: 0; font-size: 1.3rem; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.stream-head .badge { flex: none; }
.player-bar .segmented { margin-left: 0; }
.stream-desc { margin: 0 0 .75rem; }
.vod-head { align-items: baseline; flex-wrap: wrap; column-gap: .9rem; row-gap: .15rem; }
.vod-date { color: var(--muted); font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Markdown inside the prompt */
.prompt-text { white-space: normal; }
.prompt-text p { margin: 0; display: inline; }
.prompt-text p + p, .prompt-text p + ul, .prompt-text ul + p, .prompt-text p + ol, .prompt-text ol + p { display: block; margin-top: .35rem; }
.prompt-text ul, .prompt-text ol { margin: .2rem 0; padding-left: 1.2rem; }
.prompt-text a { color: var(--accent-soft); }
.prompt-text code { background: #141414; color: #eeeeee; }
.prompt-text .md-h { color: var(--text-bright); }
.md-inline p { display: inline; margin: 0; }
.md-inline ul, .md-inline ol { display: inline; padding: 0; margin: 0; list-style: none; }
.md-inline li { display: inline; }
.md-inline li + li::before { content: " · "; color: var(--muted); }
.md-inline a { color: var(--accent-soft); }
.prompt-timeline input[type=checkbox] { vertical-align: middle; }
.pt-edit { display: inline-block; margin-left: .4rem; }
.pt-edit summary { display: inline; cursor: pointer; color: var(--muted); font-size: .8rem; text-decoration: underline; }
.pt-edit[open] { display: block; margin: .3rem 0 .2rem; }
.pt-edit form input[name=text] { flex: 1 1 18rem; }

/* Tokens: coin, chip, toasts */
.coin { display: inline-block; width: .95em; height: .95em; border-radius: 50%; vertical-align: -.12em; margin-right: .3em;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, #d6d6d6 13% 45%, #8a8a8a 75%); box-shadow: inset 0 0 0 2px var(--accent), 0 0 6px rgba(255,42,42,.35); }
.token-chip { position: relative; display: inline-flex; align-items: center; gap: .1rem; padding: .25rem .65rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text-bright) !important; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; text-decoration: none; }
.token-chip:hover { border-color: var(--accent); }
.token-chip.bump { animation: chip-bump .6s ease; }
.token-chip.spend { animation: chip-spend .5s ease; }
@keyframes chip-bump { 0% { transform: scale(1); } 30% { transform: scale(1.18); box-shadow: 0 0 18px rgba(255,42,42,.55); border-color: var(--accent); } 100% { transform: scale(1); } }
@keyframes chip-spend { 30% { transform: scale(.92); } 100% { transform: scale(1); } }
.token-float { position: absolute; right: .3rem; top: -.2rem; font-size: .8rem; font-weight: 800; pointer-events: none; animation: float-up 1.2s ease-out forwards; }
.token-float.up { color: var(--accent-soft); }
.token-float.down { color: var(--muted); }
@keyframes float-up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-28px); } }
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; display: flex; flex-direction: column; gap: .6rem; align-items: flex-end; pointer-events: none; }
.toast { position: relative; pointer-events: auto; display: flex; align-items: center; gap: .8rem; min-width: 260px; max-width: 360px; padding: .8rem 1rem;
  background: #0b0b0b; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.7);
  animation: toast-in .45s cubic-bezier(.2,1.4,.4,1); cursor: pointer; }
.toast strong { display: block; color: var(--text-bright); font-size: 1.05rem; }
.toast.coins strong { color: var(--accent-soft); font-size: 1.25rem; }
.toast p { margin: .1rem 0 0; font-size: .88rem; color: var(--text); }
.toast.out { animation: toast-out .35s ease forwards; }
@keyframes toast-in { from { transform: translateY(20px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateX(30px); opacity: 0; } }
.toast-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--text-bright); flex: none; position: relative; }
.toast-check::after { content: ""; position: absolute; left: 8px; top: 4px; width: 7px; height: 12px; border: solid var(--text-bright); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.big-coin { width: 64px; height: 64px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #fff 0 10%, #d9d9d9 11% 42%, #7a7a7a 78%);
  box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 0 8px rgba(0,0,0,.25), 0 0 24px rgba(255,42,42,.35); }
.big-coin.small { width: 34px; height: 34px; box-shadow: inset 0 0 0 3px var(--accent), 0 0 14px rgba(255,42,42,.4); animation: coin-flip .9s ease; }
@keyframes coin-flip { from { transform: rotateY(0) scale(.4); } to { transform: rotateY(720deg) scale(1); } }
.coin-spark { position: absolute; left: 28px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-soft); pointer-events: none;
  animation: coin-spark .8s ease-out forwards; transform: rotate(var(--a)) translateX(0); }
@keyframes coin-spark { to { transform: rotate(var(--a)) translateX(42px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .big-coin, .big-coin.small, .toast, .token-chip.bump { animation: none; } }

/* Tokens page */
.token-hero { display: flex; align-items: center; gap: 1.25rem; padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid var(--line); border-radius: 16px;
  background: radial-gradient(80% 140% at 0% 0%, rgba(255,42,42,.12), transparent 60%), var(--panel); perspective: 400px; }
.token-label { margin: 0; text-transform: uppercase; letter-spacing: .08em; }
.token-balance-big { margin: 0; font-size: 3rem; font-weight: 800; line-height: 1; color: var(--text-bright); font-variant-numeric: tabular-nums; }
.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: .5rem; }
.reward-card { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); transition: border-color .2s, transform .2s; }
.reward-card:hover { border-color: #3a3a3a; transform: translateY(-2px); }
.reward-card.short { opacity: .75; }
.reward-card p { margin: 0; }
.reward-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.reward-top h3 { margin: 0; font-size: 1.05rem; color: var(--text-bright); }
.cost { font-weight: 800; color: var(--accent-soft); white-space: nowrap; }
.pack-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.pack-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
td.plus { color: var(--accent-soft); font-weight: 700; }
td.minus { color: var(--muted); }
.queue { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.queue-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; }
.queue-item.pending { border-left: 3px solid var(--accent); }
.queue-item:not(.pending) { opacity: .6; }
.queue-input { margin: .25rem 0 0; color: var(--text-bright); overflow-wrap: anywhere; }
.reward-edit { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }

/* Polls */
.poll-form { display: flex; flex-direction: column; gap: .5rem; padding: .75rem .9rem; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.poll-form .set-h { margin: 0; font-size: .8rem; color: var(--muted); }
.poll-slot:empty { display: none; }
.poll-slot { padding: .6rem .6rem 0; }
.poll-card { position: relative; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #0d0d0d, #080808); overflow: hidden; }
.poll-card.enter { animation: toast-in .45s cubic-bezier(.2,1.3,.4,1); }
.poll-card.token { border-color: #3a1515; box-shadow: 0 0 0 1px rgba(255,42,42,.08), 0 0 24px rgba(255,42,42,.08); }
.poll-card.cancelled { opacity: .6; }
.poll-card.celebrate { animation: celebrate 1.2s ease; }
@keyframes celebrate { 0% { box-shadow: 0 0 0 0 rgba(255,42,42,.6); } 40% { box-shadow: 0 0 0 10px rgba(255,42,42,0), 0 0 40px rgba(255,42,42,.4); } 100% { box-shadow: none; } }
.poll-head { display: flex; align-items: center; gap: .6rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.poll-kind { font-weight: 700; color: var(--text-bright); }
.poll-card.token .poll-kind { color: var(--accent-soft); }
.poll-timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-bright); text-transform: none; }
.poll-card.ending .poll-timer { color: var(--accent); animation: prompt-pulse .8s ease-in-out infinite; }
.poll-head .link { font-size: .75rem; text-transform: none; letter-spacing: 0; }
.poll-close { font-size: 1.1rem !important; text-decoration: none; }
.poll-q { margin: .35rem 0 .5rem; font-weight: 700; color: var(--text-bright); font-size: 1rem; overflow-wrap: anywhere; }
.poll-timebar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: .6rem; }
.poll-timebar span { display: block; height: 100%; background: var(--accent); transition: width .25s linear; }
.poll-opts { display: flex; flex-direction: column; gap: .4rem; }
.poll-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; padding: .5rem .7rem; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: #050505; color: var(--text-bright); font: inherit; font-size: .9rem; text-align: left; cursor: pointer;
  transition: border-color .2s, transform .1s; }
.poll-opt:not(:disabled):hover { border-color: var(--muted); }
.poll-opt:not(:disabled):active { transform: scale(.98); }
.poll-opt:disabled { cursor: default; }
.poll-opt .fill { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.07); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.poll-card.token .poll-opt .fill { background: rgba(255,42,42,.14); }
.poll-opt.picked { border-color: #555; }
.poll-opt.winner { border-color: var(--accent); }
.poll-opt.winner .fill { background: rgba(255,42,42,.25); }
.poll-opt.winner .label::before { content: "🏆 "; }
.poll-opt .label, .poll-opt .meta { position: relative; }
.poll-opt .label { overflow-wrap: anywhere; }
.poll-opt .meta { display: flex; gap: .5rem; align-items: baseline; flex: none; }
.poll-opt .pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.poll-opt .you { font-size: .72rem; color: var(--accent-soft); }
.poll-opt.pop { animation: chip-bump .5s ease; }
.poll-float { position: absolute; right: 3.5rem; top: .2rem; font-weight: 800; color: var(--accent-soft); animation: float-up 1s ease-out forwards; pointer-events: none; }
.poll-amounts { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .55rem; }
.chip { padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--line); background: #050505; color: var(--text); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.chip.on { border-color: var(--accent); color: var(--accent-soft); }
.chip-input { width: 4.5rem; padding: .2rem .4rem; font-size: .8rem; }
.poll-foot { margin: .5rem 0 0; font-size: .78rem; color: var(--muted); }
.poll-msg { margin: .25rem 0 0; font-size: .8rem; color: var(--accent-soft); min-height: 0; }
.poll-msg:empty { display: none; }
.poll-msg.show { animation: toast-in .3s ease; }

/* Membership tiers page */
.tiers-head { margin-bottom: 1.25rem; }
.tiers-head h1 { margin-bottom: .25rem; }
.tiers-head p { margin: 0; }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; align-items: stretch; }
.card.tier { display: flex; flex-direction: column; gap: .8rem; margin: 0; }
.card.tier.owned { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(255,42,42,.25), 0 0 28px rgba(255,42,42,.12); }
.tier-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tier-top h2 { margin: 0; font-size: 1.25rem; color: var(--text-bright); }
.tier-desc { margin: 0; color: var(--text); }
.tier-foot { margin-top: auto !important; }
.perk-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.perk-tags li { font-size: .78rem; padding: .15rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text-bright); background: var(--panel-2); white-space: nowrap; }
.perk-tags li.perk-coin { border-color: rgba(255,42,42,.45); color: var(--accent-soft); font-weight: 700; }
.token-explainer { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 2rem; perspective: 400px;
  background: radial-gradient(80% 140% at 0% 0%, rgba(255,42,42,.10), transparent 60%), var(--panel); }
.token-explainer h2 { font-size: 1.25rem; color: var(--text-bright); margin-bottom: .4rem; }
.token-explainer p { margin: 0 0 .6rem; }
.token-uses { margin: 0 0 .7rem; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.token-uses strong { color: var(--text-bright); }
.packs-title { margin-top: 1.5rem; }
.pack-list.wide li { padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); flex-wrap: wrap; }
.pack-buy { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.landing-tokens { margin: 1rem 0 0; max-width: 52rem; }
@media (max-width: 560px) { .token-explainer { flex-direction: column; } .token-explainer .big-coin { width: 44px; height: 44px; } }

/* Dashboard → Tiers */
.tier-admin-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tier-admin-head h3 { margin: 0; font-size: 1.1rem; color: var(--text-bright); }
.tier-admin .checks { display: flex; flex-direction: column; gap: .4rem; justify-content: flex-end; padding-bottom: .4rem; }
.price-title { margin: 1.25rem 0 .5rem; font-size: .95rem; color: var(--text-bright); }
.price-rows { display: flex; flex-direction: column; gap: .4rem; overflow-x: auto; }
.price-row { display: grid; grid-template-columns: minmax(7rem, 1.4fr) minmax(5rem, .8fr) 4.5rem minmax(7rem, 1fr) 5.5rem minmax(9rem, 1.4fr) 9.5rem; gap: .4rem; align-items: center; min-width: 54rem; }
.price-row > * { height: 2.35rem; font-size: .9rem; padding-top: 0; padding-bottom: 0; }
.price-row .btn { height: 2.35rem; display: inline-flex; align-items: center; justify-content: center; flex: 1; }
.price-row > .row { flex-wrap: nowrap; }
.price-row.new .btn { width: 100%; }
.price-row > .row { height: auto; }
.price-labels span { height: auto; font-size: .78rem; color: var(--muted); }
.price-row input.needs { border-color: var(--warn-line); }
.mono { font-family: var(--mono); }

/* Editor rows (VOD chapters and clips): one height for every control */
.edit-row { display: grid; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.edit-row > input, .edit-row > .btn { height: 2.35rem; margin: 0; }
.edit-row > .btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 .75rem; white-space: nowrap; }
.edit-row .span-2 { grid-column: span 2; }
.edit-labels { margin-bottom: .15rem; }
.edit-labels span { font-size: .78rem; color: var(--muted); }
.chapter-edit { grid-template-columns: 6rem minmax(0, 1fr) 5rem 5rem; }
.clip-add { grid-template-columns: 6rem 6rem minmax(0, 1fr) 5rem 5rem; }
.btn.ghost.danger-text { color: var(--bad); }
.btn.ghost.danger-text:hover { border-color: var(--bad); }
.clip-add-h { margin-top: 1.25rem; }
.danger-zone { border-color: var(--warn-line); }
.danger-zone h2 { color: var(--accent-soft); }
@media (max-width: 560px) {
  .chapter-edit { grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 1fr); }
  .chapter-edit > input[name=title] { grid-column: 2 / -1; }
  .chapter-edit > button:nth-of-type(1) { grid-column: 1 / 3; }
  .chapter-edit > button:nth-of-type(2) { grid-column: 3; }
  .edit-row > .span-2, .chapter-edit > button.span-2 { grid-column: 1 / -1; }
  .chapter-edit + .chapter-edit { margin-top: .5rem; }
  .clip-add { grid-template-columns: 1fr 1fr; }
  .clip-add > input[name=title] { grid-column: 1 / -1; }
  .edit-labels { display: none; }
}

/* Chat replay beside a recording */
.chat.replay .msg time[data-t] { cursor: pointer; }
.chat.replay .msg time[data-t]:hover { color: var(--accent-soft); text-decoration: underline; }
.replay-count { margin-right: auto; }
.chat.replay .chat-head { align-items: center; }
.replay-close { font-size: 1.2rem; line-height: 1; }
.replay-empty { padding: 1rem .9rem; text-align: center; }
.replay-toggle.active { border-color: var(--accent); color: var(--text-bright); }
.vod-layout:not(.with-chat) .player-wrap { max-width: 1100px; margin: 0 auto; }
.chat.replay .new-msgs { bottom: 1rem; }
.vod-layout .live-chat { align-self: start; position: sticky; top: 1rem; height: min(78vh, 760px); min-height: 360px; }
@media (max-width: 1000px) { .vod-layout .live-chat { position: relative; top: 0; height: 60vh; } }

/* Audio track mixer */
.mixer-wrap { position: relative; }
.mixer { position: absolute; z-index: 20; top: calc(100% + .4rem); left: 0; width: min(320px, 86vw); padding: .7rem .8rem; background: #0b0b0b; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.7); display: flex; flex-direction: column; gap: .45rem; }
.mixer[hidden] { display: none; }
.mixer .set-h { margin: 0 0 .1rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mix-row { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem; gap: .6rem; align-items: center; }
.mix-on { flex-direction: row; align-items: center; gap: .45rem; color: var(--text-bright); font-size: .9rem; min-width: 0; }
.mix-on span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mix-row.off .mix-on span { color: var(--muted); text-decoration: line-through; }
.mix-row.off input[type=range] { opacity: .45; }
.mix-row input[type=range] { width: 100%; accent-color: var(--accent); }
.mix-note { margin: .2rem 0 0; }
.player .mixer { top: auto; bottom: 3.4rem; left: auto; right: .6rem; }

/* Dashboard → Stream → Audio tracks */
.track-form { display: flex; flex-direction: column; gap: .35rem; }
.track-form { max-width: 720px; }
.track-row { display: grid; grid-template-columns: 1.6rem minmax(10rem, 1fr) 4.5rem 7rem 6.5rem; gap: .6rem; align-items: center; }
#tracks .obs-help, #tracks > p { max-width: 900px; }
.track-row > input[type=text] { height: 2.2rem; }
.track-row .check { justify-content: center; }
.track-head span { font-size: .75rem; color: var(--muted); }
.track-head span:nth-child(n+3) { text-align: center; }
.track-n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.vol-cell { flex-direction: row; align-items: center; gap: .25rem; color: var(--muted); }
.vol-cell input { width: 4.2rem; height: 2.2rem; }
.track-form .btn { align-self: flex-start; margin-top: .4rem; }
.obs-help summary { cursor: pointer; color: var(--text); }
.obs-help p { font-size: .9rem; }
.ctl[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) { .track-row { grid-template-columns: 1.2rem minmax(0, 1fr) 2.6rem 2.6rem 4.8rem; } .track-head span:nth-child(4) { font-size: .65rem; } }
.mixer input[type=checkbox], .track-form input[type=checkbox] { accent-color: var(--accent); }

/* Poll form: mode, time and token box on one line, all the same height */
.poll-when { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.poll-when select, .poll-when input[type=text], .poll-when input[type=datetime-local] { height: 2.2rem; padding-top: 0; padding-bottom: 0; font-size: .9rem; }
.poll-when input[type=text] { width: 8.5rem; }
.poll-when .pw-token { height: 2.2rem; margin-left: .2rem; white-space: nowrap; font-size: .9rem; color: var(--text); }
.poll-when [hidden] { display: none; }
.pw-help { margin: 0; }
/* Poll results (in chat and in the polls list) */
.poll-more { font-size: .78rem; margin-left: .3rem; font-style: normal; }
.poll-detail { margin: .35rem 0 .2rem; font-style: normal; color: var(--text); }
.poll-result { display: flex; flex-direction: column; gap: .3rem; }
.pr-row { position: relative; display: flex; justify-content: space-between; gap: .5rem; padding: .3rem .55rem; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: .85rem; }
.pr-row .fill { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.07); }
.poll-result.token .pr-row .fill { background: rgba(255,42,42,.14); }
.pr-row.winner { border-color: var(--accent); }
.pr-row.winner .label::before { content: "🏆 "; }
.pr-row .label, .pr-row .meta { position: relative; }
.pr-row .meta { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pr-foot { margin: .1rem 0 0; font-size: .75rem; color: var(--muted); }
.polls-panel { position: absolute; z-index: 15; top: 2.9rem; right: .6rem; left: .6rem; max-height: 60%; overflow-y: auto; padding: .6rem .7rem; background: #0b0b0b;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.7); }
.polls-panel[hidden] { display: none; }
.polls-panel .set-h { margin: 0 0 .4rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.polls-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.polls-list summary { display: flex; justify-content: space-between; gap: .5rem; cursor: pointer; padding: .3rem 0; }
.polls-list .pl-q { color: var(--text-bright); font-weight: 600; overflow-wrap: anywhere; }
.pl-status { font-size: .72rem; color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
.pl-status.open { color: var(--accent-soft); }
.polls-list details[open] > .poll-result { padding: .2rem 0 .5rem; }

/* Bulk actions and sortable tables */
.bulk-bar { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.bulk-bar.active { border-color: var(--accent); }
.bulk-bar > select, .bulk-bar > .btn.small { height: var(--ctl-h-sm); padding-top: 0; padding-bottom: 0; font-size: .875rem; }
.bulk-count { min-width: 6.5rem; }
th.sel, td.sel { width: 2rem; }
table.sortable th a { color: inherit; text-decoration: none; white-space: nowrap; }
table.sortable th a:hover { color: var(--text-bright); }
td.nowrap { white-space: nowrap; }
td.actions { white-space: nowrap; }
td.actions a + a { margin-left: .6rem; }
/* A label + input and its button on one line, bottoms aligned */
.inline-form { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; margin: .5rem 0; }
.inline-form label { flex: 1 1 14rem; max-width: 26rem; }
.inline-form input, .inline-form select, .inline-form .btn { height: 2.4rem; }
.inline-form .btn { display: inline-flex; align-items: center; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.icon-slot h3 { margin: 0 0 .5rem; font-size: .95rem; }
.icon-preview { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .5rem; }
.icon-preview img { width: 40px; height: 40px; object-fit: contain; }
.big-coin.small-static { width: 34px; height: 34px; }
.icon-upload { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.icon-upload input[type=file] { max-width: 15rem; font-size: .85rem; }
.new-token { border-color: var(--accent); }
/* Filter bars */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.filter-bar input[type=search] { flex: 1 1 16rem; max-width: 24rem; margin: 0; }
.filter-bar input, .filter-bar select, .filter-bar .btn { height: 2.3rem; padding-top: 0; padding-bottom: 0; }
.filter-summary { display: flex; align-items: center; gap: .75rem; min-height: 2.2rem; margin-bottom: .4rem; }

/* Badges */
.role-badge.staff { background: var(--accent); color: #fff; }
.role-badge[data-color] { background: var(--c, var(--accent)); color: var(--cf, #fff); }
.badge-icon { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; margin-right: .4rem; }
.badge-pick { flex-direction: row; align-items: center; gap: .5rem; margin: .4rem 0; color: var(--text); }
.badge-pick select { height: 2rem; padding-top: 0; padding-bottom: 0; }
/* Color picker component */
.color-pick { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.cp-opt { position: relative; display: inline-flex; cursor: pointer; }
.cp-opt input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.cp-sw { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 2px #000; }
.cp-sw.b0 { background: #e5374a; } .cp-sw.b1 { background: #2f80ed; } .cp-sw.b2 { background: #16a34a; } .cp-sw.b3 { background: #c026d3; }
.cp-sw.b4 { background: #b45309; } .cp-sw.b5 { background: #0e7490; } .cp-sw.b6 { background: #7c3aed; } .cp-sw.b7 { background: #db2777; }
.cp-opt input:checked + .cp-sw { border-color: var(--text-bright); }
.cp-opt input:focus-visible + .cp-sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-custom input[type=color] { width: 2.2rem; height: 1.7rem; padding: 0 .1rem; border-radius: 6px; cursor: pointer; }
.cp-custom input[type=radio]:checked + input[type=color] { outline: 2px solid var(--text-bright); outline-offset: 1px; }
/* Roles editor */
.role-card { display: flex; flex-direction: column; gap: .7rem; }
.role-form { display: flex; flex-direction: column; gap: .7rem; }
.role-fields { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(8rem, 12rem) 6rem; gap: .6rem; align-items: end; }
.role-fields input { height: 2.3rem; }
.field-label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .3rem; }
.role-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.role-actions { margin-left: auto; display: inline-flex; gap: .5rem; }
.role-icon { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: .6rem; }
.role-icon .field-label { display: inline; margin: 0 .3rem 0 0; }
@media (max-width: 560px) { .role-fields { grid-template-columns: 1fr 1fr; } .role-fields .narrow { grid-column: span 2; } }
/* Pack deals and token redemption */
.pack-deal { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.pack-deal s { color: var(--muted); }
.pack-deal .save { color: var(--accent-soft); font-weight: 700; }
.pack-price { font-weight: 700; color: var(--text-bright); }
.tier-redeem { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .6rem; border-top: 1px dashed var(--line); font-size: .9rem; }

/* Recording editor */
.vod-editor input, .vod-editor textarea, .vod-editor select { font-size: .9rem; }
.vod-editor h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.vod-editor h4 { margin: 0 0 .2rem; font-size: .95rem; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.editor-head h1 { margin: 0; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.editor-media { position: sticky; top: 1rem; }
.editor-media .player-bar { padding: .5rem 0; }
@media (max-width: 1100px) { .editor-grid { grid-template-columns: 1fr; } .editor-media { position: static; } }
main:has(.vod-editor) { max-width: 1440px; }
.kv.compact { margin-top: 1rem; font-size: .9rem; }
.inline-label { flex-direction: row; align-items: center; gap: .6rem; }
.inline-label input { width: 9rem; }
.prompt-timeline.editable li { display: grid; grid-template-columns: auto 4.5rem minmax(0, 1fr); gap: .5rem; align-items: center; padding: .25rem 0; }
.prompt-timeline.editable li.now { background: var(--panel-2); }
.pt-row { display: grid; grid-template-columns: minmax(0, 1fr) 9rem auto; gap: .4rem; align-items: center; }
.pt-row input, .pt-row .btn { height: 2.1rem; }
.pt-row .btn { display: inline-flex; align-items: center; }
#prompt-delete { margin-top: .6rem; }
.seek-btn, .now-btn { height: 2.35rem; width: 2.2rem; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font: inherit; font-size: .85rem; }
.seek-btn:hover, .now-btn:hover { border-color: var(--accent); color: var(--text-bright); }
.clip-actions .seek-btn { width: 100%; }
.vod-editor .chapter-edit { grid-template-columns: 2.2rem 5.5rem minmax(0, 1fr) 5rem 5rem; }
.vod-editor .clip-add { grid-template-columns: 7.5rem 7.5rem minmax(0, 1fr) 5rem 5rem; }
.with-now { display: grid; grid-template-columns: minmax(0, 1fr) 2.2rem; gap: .25rem; }
.with-now input { height: 2.35rem; min-width: 0; }
.vod-links { margin: .6rem 0 0; }
@media (max-width: 560px) {
  .pt-row { grid-template-columns: 1fr auto; }
  .pt-row input[name=file] { grid-column: 1 / -1; grid-row: 2; }
  .vod-editor .chapter-edit { grid-template-columns: 2.2rem 5rem minmax(0, 1fr); }
  .vod-editor .chapter-edit > input[name=title] { grid-column: 3; }
  .vod-editor .chapter-edit > button.btn { grid-column: span 1; }
}

/* ---- Alignment: every field, select and button in a form row shares one height,
   and rows line up on the bottom edge (labels sit above their fields). ---- */
:where(input:not([type=checkbox], [type=radio], [type=range], [type=file], [type=color], [type=hidden]), select) { height: var(--ctl-h); }
:where(input[type=file]) { height: var(--ctl-h); padding: .3rem .4rem; line-height: 1.6; }
:where(input[type=file])::file-selector-button { height: calc(var(--ctl-h) - .6rem - 2px); margin: 0 .5rem 0 0; padding: 0 .6rem; border: 0; border-radius: 6px; background: var(--panel-2); color: var(--text-bright); font: inherit; font-size: .85rem; cursor: pointer; }
.row:has(> label > input, > label > select, > input, > select, > span > input), .form-grid, .inline-form, .icon-upload { align-items: flex-end; }
:is(.row:has(> label > input, > label > select, > input, > select), .form-grid, .inline-form, .icon-upload, .upload-form) .btn { height: var(--ctl-h); }
:is(.form-grid, .row, .inline-form) > label.check { min-height: var(--ctl-h); align-items: center; }
.stack > .btn, .stack > button { align-self: flex-start; }
td.actions { white-space: nowrap; }
td.actions > * + * { margin-left: .6rem; }
td.actions form { display: inline; }
.upload-form.stack .btn { align-self: flex-start; }
.row.upload-form .upload-error:empty { display: none; }
.icon-upload .upload-error:empty { display: none; }
.player-bar .segmented { align-items: stretch; } .player-bar .segmented button { height: calc(var(--ctl-h-sm) - 2px); padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; }

/* ---- Thoughts: short posts with an optional recording above the text ---- */
.thoughts-page { max-width: 640px; margin: 0 auto; }
.thought-feed { display: flex; flex-direction: column; gap: .75rem; }
.thought { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem .8rem; display: flex; flex-direction: column; gap: .65rem; }
.thought-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; line-height: 1.2; }
.thought-head strong { color: var(--text-bright); }
.thought-head a { text-decoration: none; }
.thought-head a:hover { color: var(--text); }
.thought-head .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.thought-body { color: var(--text-bright); overflow-wrap: anywhere; font-size: 1.02rem; line-height: 1.55; }
.thought-body > :first-child { margin-top: 0; }
.thought-body > :last-child { margin-bottom: 0; }
.thought-body p, .thought-body ul, .thought-body ol, .thought-body blockquote, .thought-body pre { margin: 0 0 .65em; }
.thought-body ul, .thought-body ol { padding-left: 1.4em; }
.thought-body blockquote { padding: .1em 0 .1em .8em; border-left: 3px solid var(--line); color: var(--text); }
.thought-body pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: .6em .8em; overflow-x: auto; font-size: .88rem; }
.thought-body pre code { background: none; padding: 0; word-break: normal; white-space: pre; }
.thought-body a, .comment-body a { color: var(--accent-soft); }
.thought-body .emote, .comment-body .emote { height: 1.5em; vertical-align: -.35em; }
.thought-vod { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; padding: .75rem .9rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--panel-2); }
.tv-meta { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.tv-kicker { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tv-title { color: var(--text-bright); overflow-wrap: anywhere; }
.tv-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.thought-foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.thought-count { display: inline-flex; align-items: center; gap: .3rem; margin-left: auto; color: var(--muted); text-decoration: none; font-size: .875rem; }
.thought-count:hover { color: var(--text); }
.thought-count svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.reactions { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin: 0; }
.react { display: inline-flex; align-items: center; gap: .3rem; height: 1.9rem; padding: 0 .55rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: .9rem; line-height: 1; cursor: default; }
button.react, summary.react { cursor: pointer; }
button.react:hover, summary.react:hover { border-color: var(--muted); }
.react.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.react .n { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.react.mine .n { color: var(--text-bright); }
.react .emote { height: 1.15rem; width: auto; }
.react-pick { position: relative; }
.react-pick > summary { list-style: none; color: var(--muted); font-weight: 600; }
.react-pick > summary::-webkit-details-marker { display: none; }
.react-grid { position: absolute; z-index: 20; left: 0; bottom: calc(100% + .35rem); display: grid; grid-template-columns: repeat(6, 2.2rem); gap: .2rem; padding: .4rem; max-height: 14rem; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.react-grid button { width: 2.2rem; height: 2.2rem; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; font-size: 1.15rem; cursor: pointer; }
.react-grid button:hover { background: var(--line); }
.react-grid .emote { height: 1.5rem; width: auto; }
.compose { display: flex; flex-direction: column; gap: .6rem; }
.compose textarea { width: 100%; }
.compose p { margin: 0; }
.compose-foot { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.compose-foot select { flex: 1 1 14rem; min-width: 0; }
.thought-admin { margin-top: .75rem; }
.thought-admin summary { cursor: pointer; color: var(--muted); }
.thought-admin form.stack { margin-top: .75rem; }
.thought-comments { margin-top: .75rem; }
.comment { padding: .65rem 0; border-top: 1px solid var(--line); }
.comment:first-of-type { border-top: 0; }
.comment-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.comment-head strong { color: var(--text-bright); }
.comment-head form { margin: 0 0 0 auto; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: .2rem; }
.comment-form { display: flex; gap: .5rem; align-items: flex-end; margin-top: .75rem; }
.comment-form textarea { flex: 1; min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.section-head h2 { margin: 0; }
.section-head a { text-decoration: none; }
.home-thoughts { margin-top: 1.5rem; }
.home-thoughts.narrow-feed { max-width: 640px; margin: 2rem auto 0; }
.landing-thoughts { max-width: 680px; margin: 0 auto; padding: 4rem 1.5rem 0; }
.landing-thoughts .section-head h2 { font-size: 1.6rem; color: var(--text-bright); }
.landing-thoughts > p { margin-top: 1rem; }
.landing-thoughts a:not(.btn) { color: var(--accent-soft); }
.landing-links { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: 0; }
.feed-link { margin-left: .75rem; color: var(--dim); }
.feed-link:hover { color: var(--muted); }
.feed-note { margin-top: 2rem; }
@media (max-width: 520px) {
  .thought { padding: .9rem .9rem .7rem; }
  .react-grid { grid-template-columns: repeat(5, 2.2rem); }
  .comment-form { flex-direction: column; align-items: stretch; }
}

/* Post editor: Markdown toolbar, emote/emoji picker, :autocomplete and preview. */
.md-editor { position: relative; }
.md-editor > * + * { margin-top: .35rem; }
.md-editor textarea { display: block; }
.md-editor textarea { width: 100%; min-height: 6.5rem; }
.md-toolbar { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.md-toolbar .spacer { flex: 1; }
.md-toolbar .tool { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; padding: 0 .45rem; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: .95rem; cursor: pointer; }
.md-toolbar .tool:hover, .md-toolbar .tool[aria-expanded="true"], .md-toolbar .tool[aria-pressed="true"] { color: var(--text-bright); background: var(--panel-2); border-color: var(--line); }
.md-toolbar .tool code { background: none; padding: 0; font-size: .8rem; }
.md-toolbar .tool svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-toolbar .preview-btn { font-size: .85rem; }
.md-preview { min-height: 6.5rem; padding: .6rem .7rem; border: 1px dashed var(--line); border-radius: 8px; }
.md-hint { margin: 0; }
.md-hint code { font-size: .78rem; }
.md-editor .picker { top: 2.4rem; bottom: auto; right: 0; }
/* Block layout, so the list's static position is right under the textarea. */
.md-editor .suggest { top: auto; bottom: auto; left: 0; right: auto; min-width: 16rem; }
