:root {
  --bg: #12141a;
  --surface: #1a1d26;
  --surface-2: #222634;
  --border: #2e3342;
  --text: #e6e8ef;
  --muted: #949bb0;
  --accent: #5b8cff;
  --accent-text: #ffffff;
  --ok: #4ade80;
  --error: #ff7b72;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

h1 { font-size: 1.5rem; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1rem; margin: 0 0 .35rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }

.muted { color: var(--muted); font-size: .925rem; }

/* ---------------------------------------------------------------- layout */

/* The signed-in shell: a sidebar beside the page on wide screens, a drawer behind a
   menu button on narrow ones. See views/layout.php and assets/nav.js. */

.brand { font-weight: 650; color: var(--text); text-decoration: none; }
.who { color: var(--muted); font-size: .9rem; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem .75rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.sidebar-brand { padding: 0 .75rem; }

/* The channel being worked in, as in YouTube Studio, and the others to switch to. */
.channel-pick { position: relative; margin: 0 .25rem; }
.channel-pick summary, .channel-pick-menu button {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .45rem .5rem;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
}
.channel-pick summary { cursor: pointer; list-style: none; border: 1px solid var(--border); }
.channel-pick summary::-webkit-details-marker { display: none; }
.channel-pick summary::after { content: '\25BE'; margin-left: auto; color: var(--muted); }
.channel-pick[open] summary::after { content: '\25B4'; }
.channel-pick[open] summary { border-color: var(--muted); }
.channel-pick summary:hover, .channel-pick-menu button:hover:not(:disabled) { background: var(--surface-2); }
/* Open, a panel floating over the nav, so it doesn't read as more of the nav. */
.channel-pick-menu {
  position: absolute;
  top: calc(100% + .35rem);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  gap: .1rem;
  padding: .35rem;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 10px;
  box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .5);
}
.channel-pick-menu form { display: grid; gap: .1rem; margin: 0; }
.channel-pick-add { color: var(--muted) !important; font-weight: 550 !important; }
.channel-pick-menu .channel-pick-signout { margin-top: .25rem; padding-top: .25rem; border-top: 1px solid var(--border); }
.channel-pick-signout button { color: var(--muted); font-weight: 550; }
.channel-pick-plus { display: grid; place-items: center; font-size: 1.1rem; line-height: 1; }
.channel-pick-menu button { background: none; border: 0; cursor: pointer; }
.channel-pick-menu button:disabled { cursor: default; opacity: .6; }
.channel-pick-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }
.channel-pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }

/* Groups: during a stream, after one, setup. */
.nav-groups { display: grid; gap: .25rem; }
.nav-group {
  margin: .9rem 0 .2rem;
  padding: 0 .75rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav-list a {
  display: block;
  padding: .55rem .75rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
}

.nav-list a:hover { color: var(--text); background: var(--surface-2); }

.nav-list a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
  border-left-color: var(--accent);
}

.nav-list a:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem .75rem 0;
  border-top: 1px solid var(--border);
}

.sidebar-foot form { margin: 0; }

.mobilebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  padding-top: max(.5rem, env(safe-area-inset-top, 0));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle:hover { background: var(--surface-2); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgb(0 0 0 / .5);
}

@media (min-width: 52rem) {
  .shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
  .mobilebar, .nav-backdrop { display: none; }
}

@media (max-width: 51.99rem) {
  /* The drawer. visibility keeps a closed drawer's links out of the tab order. */
  .js .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(18rem, 85vw);
    padding-top: max(1.25rem, env(safe-area-inset-top, 0));
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
  }

  .js .nav-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform .2s ease;
  }

  /* Without JavaScript there is no drawer: the menu sits above the page. */
  .no-js .nav-toggle { display: none; }
  .no-js .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (prefers-reduced-motion: reduce) {
  .js .sidebar, .js .nav-open .sidebar { transition: none; }
}

/* Left-aligned, so the content stays put moving between pages of different widths. */
.page { max-width: 62rem; margin: 0; padding: 2rem 1.25rem 3rem; }

.centered {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.centered .card { width: 100%; max-width: 26rem; }

/* ---------------------------------------------------------------- blocks */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
/* Cards one after another down a page get room between them. */
.page > .card ~ .card { margin-top: 1.25rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.panel { padding: 1.25rem; }
.panel p:last-child { margin-bottom: 0; }

/* The dashboard: the stream now or next, what needs attention, the overlays. */
.dash-grid { grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); align-items: start; }
.dash-stream h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.dash-countdown { font-size: 1.1rem; margin: .25rem 0 .5rem; }
.dash-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; }
.dash-checks { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .35rem; }
.dash-checks li, .dash-dot { display: flex; align-items: baseline; gap: .4rem; }
.dash-checks li::before, .dash-dot::before {
  content: '';
  flex: none;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--muted);
  transform: translateY(-.05rem);
}
.dash-checks li.is-ok::before, .dash-dot.is-ok::before { background: var(--ok); }
.dash-dot { color: var(--muted); font-size: .85rem; }
.dash-dot.is-ok { color: var(--ok); }
.dash-attention { margin-top: 1.5rem; border-color: var(--error); }
.dash-attention ul { margin: .5rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.dash-stats dt { color: var(--muted); font-size: .8rem; }
.dash-stats dd { margin: .1rem 0 0; font-size: 1.15rem; font-weight: 600; }
.dash-checks .btn { margin-left: .25rem; }

.dash-copy { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }
/* Not the form inputs' bottom margin: the button would stretch to match it. */
.dash-copy input[type="text"] { flex: 1; min-width: 0; margin: 0; padding: .4rem .6rem; font-family: ui-monospace, monospace; font-size: .8rem; }
.dash-copy .btn { flex: none; }
.overlay-setup-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.overlay-setup-head h2 { margin-bottom: .25rem; }
.overlay-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem 1.5rem; margin: 1rem 0; }
.overlay-option { margin: 0; padding: 0; border: 0; min-width: 0; }
.overlay-option legend { padding: 0; font-weight: 600; }
.overlay-option label { display: block; }
fieldset.overlay-option label { font-weight: normal; }
.overlay-option p { margin: .2rem 0 0; font-size: .85rem; }
.overlay-option input[type="text"] { max-width: 12rem; margin-bottom: 0; }

/* A channel's keys on /channels: shown masked, copied in full. */
.channel-keys { display: grid; gap: .6rem; margin: .9rem 0; }
.channel-keys dt { font-size: .85rem; font-weight: 600; }
.channel-keys dd { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .2rem 0 0; }
.channel-keys form { margin: 0; }

.placeholder {
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-top: 1px dashed var(--border);
  padding-top: .75rem;
  margin-top: 1rem;
}

/* ---------------------------------------------------------------- forms */

label {
  display: block;
  font-size: .875rem;
  font-weight: 550;
  margin-bottom: .35rem;
}

input[type="text"] {
  width: 100%;
  padding: .6rem .7rem;
  margin-bottom: 1rem;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* The text inputs' look, with our own chevron in place of the system one. */
select {
  width: 100%;
  padding: .6rem 2.2rem .6rem .7rem;
  margin-bottom: 1rem;
  font: inherit;
  color: var(--text);
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23949bb0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .8rem center;
  border: 1px solid var(--border);
  border-radius: 8px;
  appearance: none;
  cursor: pointer;
}
select:hover { border-color: var(--muted); }

input[type="text"]:focus-visible,
select:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  display: inline-block;
  padding: .5rem .9rem;
  font: inherit;
  font-size: .925rem;
  font-weight: 550;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover:not(:disabled) { border-color: var(--muted); }

/* A file input's button, as a .btn; the file name beside it is muted. */
input[type="file"] { font: inherit; font-size: .925rem; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: .75rem;
  padding: .5rem .9rem;
  font: inherit;
  font-weight: 550;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--muted); }
input[type="file"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.btn:disabled { opacity: .6; cursor: default; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Every button is one size, so ones side by side match; .btn-quiet is only a name now. */
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- status */

.status {
  padding: .7rem .85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: .925rem;
}

.status-ok { border-color: var(--ok); color: var(--ok); }
.status-error { border-color: var(--error); color: var(--error); }

/* ---------------------------------------------------------------- channels */

.channel-list { display: grid; gap: 1rem; margin: 1.5rem 0; }

.channel {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
}

.channel-avatar {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.channel-avatar-blank { border: 1px solid var(--border); }

.channel-body { min-width: 0; flex: 1; }
.channel-body h2 { margin-bottom: .2rem; }

.channel-meta { margin-bottom: .5rem; word-break: break-word; }
.channel-meta code { font-size: .85em; color: var(--muted); }

.channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
}

.channel-actions form { margin: 0; }

.channel .status { margin: .5rem 0; }

.btn-danger { color: var(--error); }
.btn-danger:hover:not(:disabled) { border-color: var(--error); }

/* ------------------------------------------------------------- broadcasts */

.check-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.check-bar form { margin: 0; }

.channel-block { margin-bottom: 2rem; }

.channel-heading {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .6rem;
}

.broadcast {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  margin-bottom: .75rem;
}
/* The videos list keeps its own closer spacing. */
.page > .card.broadcast { margin-top: 0; }

.broadcast-thumb {
  flex: none;
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
}

.broadcast-thumb-blank { border: 1px solid var(--border); }

.broadcast-body { flex: 1; min-width: 0; }
.broadcast-body h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.broadcast-body h3 a { color: var(--text); text-decoration: none; }
.broadcast-body h3 a:hover { text-decoration: underline; }

.broadcast-meta { margin-bottom: .5rem; }

.broadcast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-top: .85rem;
}

.broadcast-actions form { margin: 0; }

.pill {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.pill-live { border-color: var(--error); color: var(--error); }
.pill-testing { border-color: var(--ok); color: var(--ok); }
.pill-ready,
.pill-created,
.pill-complete,
.pill-revoked,
.pill-deleted { color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .3rem 1rem;
  margin: 0;
  font-size: .925rem;
}

.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-all; }

@media (max-width: 30rem) {
  .broadcast { flex-direction: column; }
  .broadcast-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .facts { grid-template-columns: 1fr; gap: 0 0; }
  .facts dd { margin-bottom: .5rem; }
}

/* ------------------------------------------------------------------ chat */

.chat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.chat-header h2 { margin: 0; }
.chat-header p { margin: 0; }

.chat {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  max-height: 40rem;
  overflow-y: auto;
}

.chat-message {
  display: flex;
  gap: .65rem;
  padding: .5rem 0;
  border-top: 1px solid var(--border);
}

.chat-message:first-child { border-top: 0; }

/* A message that just arrived live, fading back to normal. */
.chat-message.is-new,
.transcript-lines li.is-new { animation: chat-arrive 3s ease-out; }

@keyframes chat-arrive {
  from { background: var(--surface-2); }
  to   { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-message.is-new,
  .transcript-lines li.is-new { animation: none; }
}

.chat-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.chat-avatar-blank { border: 1px solid var(--border); }

.chat-body { min-width: 0; flex: 1; }

.chat-byline {
  margin: 0 0 .15rem;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.chat-author { font-weight: 600; }
.chat-time { font-size: .78rem; }

.chat-text {
  margin: 0;
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.chat-highlight {
  margin: 0 0 .2rem;
  padding: .25rem .5rem;
  border-radius: 6px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  font-size: .9rem;
  font-weight: 550;
  display: inline-block;
}

.badge {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .05rem .35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge-owner { border-color: var(--error); color: var(--error); }
.badge-mod { border-color: var(--accent); color: var(--accent); }
.badge-member { border-color: var(--ok); color: var(--ok); }

/* Money and membership events stand out from ordinary chatter. */
.chat-superChatEvent .chat-highlight,
.chat-superStickerEvent .chat-highlight { border-left-color: var(--ok); }
.chat-membershipGiftingEvent .chat-highlight,
.chat-giftMembershipReceivedEvent .chat-highlight,
.chat-memberMilestoneChatEvent .chat-highlight,
.chat-newSponsorEvent .chat-highlight { border-left-color: var(--error); }

/* ---------------------------------------------------------------- topic desk */

textarea {
  width: 100%;
  padding: .6rem .7rem;
  margin-bottom: 1rem;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}

textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset:disabled { opacity: .55; }

.desk {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.desk .card { padding: 1.25rem; }
.desk h2 { margin-top: 0; }
.desk-wide { grid-column: 1 / -1; }

@media (max-width: 52rem) {
  .desk { grid-template-columns: minmax(0, 1fr); }
}

.desk-heading { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.desk-heading h2 { margin: 0 .25rem 0 0; }
.desk-time { font-size: .85rem; margin-left: auto; }
.desk-actions { display: flex; gap: .5rem; align-items: center; }

.badge-locked { border-color: var(--accent); color: var(--accent); }
.badge-human { border-color: var(--ok); color: var(--ok); }

.command-status { margin: .6rem 0 0; font-size: .875rem; min-height: 1.2em; }
.command-pending { color: var(--muted); }
.command-ok { color: var(--ok); }
.command-error { color: var(--error); }

#health dd.warn { color: var(--error); }

.topic-history { list-style: none; margin: 0; padding: 0; }
.topic-history li {
  display: flex;
  gap: .75rem;
  align-items: baseline;
  padding: .45rem 0;
  border-top: 1px solid var(--border);
}
.topic-history li:first-child { border-top: 0; }
.topic-history li.is-current .topic-title { font-weight: 650; }
.topic-time { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 7.5rem; }
.topic-title { flex: 1; }

/* ---------------------------------------------------------------- transcripts */

.table { width: 100%; border-collapse: collapse; font-size: .925rem; }
.table th { text-align: left; color: var(--muted); font-weight: 550; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.table td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

.transcript { margin-top: 1rem; }
.transcript-lines { list-style: none; margin: 0; padding: 0; }
.transcript-lines li { display: flex; gap: .75rem; align-items: baseline; padding: .3rem 0; }
.transcript-time { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; min-width: 4.5rem; text-align: right; }
.transcript-text { flex: 1; }
.transcript-lag { color: var(--error); font-size: .8rem; font-variant-numeric: tabular-nums; }

.topic-summary { display: block; font-size: .85rem; margin-top: .15rem; }
.offset-form { display: flex; align-items: center; gap: .5rem; }
.offset-form label { margin: 0; white-space: nowrap; }
.offset-form input[type="text"] { width: 6rem; margin: 0; }
.markers { white-space: pre-wrap; font-size: .85rem; background: var(--surface-2); padding: .75rem; border-radius: 8px; }
.chapters-describe { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .75rem; }
.clip-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .75rem; }
.clip-form label { margin: 0; white-space: nowrap; }
.clip-form select, .clip-form input[type="text"] { width: auto; margin: 0; }
.clip-form select { max-width: 28rem; }
.clip-form input[name="topic"] { flex: 1; min-width: 12rem; }
.clip-asked { list-style: none; margin: 0 0 1rem; padding: 0; }
.clip-asked li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; padding: .35rem 0; }
.clip-asked form { margin: 0; }
.clip { border-top: 1px solid var(--border); padding-top: .75rem; margin-top: 1rem; }
.clip h3 { margin: 0 0 .15rem; }
.clip-edit { list-style: none; margin: .5rem 0; padding: 0; }
.clip-edit li { display: flex; flex-wrap: wrap; gap: .5rem; padding: .15rem 0; }
.clip-cut .transcript-text { text-decoration: line-through; color: var(--muted); }
.clip-reason { flex-basis: 100%; padding-left: 4.5rem; font-size: .8rem; color: var(--muted); }
.clip-unsure .clip-reason, .clip-tangent .clip-reason { color: var(--error); }

/* ------------------------------------------------------------- pre-show check */

.preflight-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.preflight { list-style: none; margin: 0; padding: .25rem 1.25rem; }
.preflight-row { display: flex; align-items: baseline; gap: .85rem; padding: .85rem 0; border-top: 1px solid var(--border); }
.preflight-row:first-child { border-top: 0; }
.preflight-mark {
  flex: none;
  min-width: 4.5rem;
  padding: .1rem .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}
.preflight-body { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.preflight-detail { font-size: .85rem; overflow-wrap: anywhere; }
.preflight-time { flex: none; font-size: .8rem; font-variant-numeric: tabular-nums; }
.is-pass .preflight-mark { color: var(--ok); border-color: var(--ok); }
.is-fail .preflight-mark { color: var(--error); border-color: var(--error); }
.is-warn .preflight-mark { color: #f5c451; border-color: #f5c451; }
.is-running .preflight-mark::before { content: "…"; }
.is-running .preflight-summary { color: var(--muted); }

/* --------------------------------------------------------------------- library */

.library-search { display: flex; gap: .5rem; margin: 1rem 0 1.5rem; }
.library-search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: .6rem .7rem;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.library-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.library-result h2 { margin-bottom: .25rem; }
.library-hits { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .35rem; font-size: .925rem; }
.library-hits li { display: flex; gap: .5rem; align-items: baseline; }
.library-hits .transcript-time { min-width: 3.5rem; }
.library-coverage { border-collapse: collapse; width: 100%; margin-bottom: .75rem; }
.library-coverage th, .library-coverage td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--border); }
.library-coverage td { font-variant-numeric: tabular-nums; }
.library-comments { list-style: none; margin: 0; padding: 0; }
.library-comments li { padding: .6rem 0; border-top: 1px solid var(--border); }
.library-comments li.is-reply { margin-left: 1.5rem; }
.library-comments p { margin: 0 0 .25rem; overflow-wrap: anywhere; }
a.transcript-time { text-decoration: none; }

/* ------------------------------------------------------------------ chat desk */

.desk-wide .page { max-width: none; padding-bottom: 1rem; }
.desk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.desk-head h1 { margin-bottom: .25rem; }
/* The stream to go live with or end, above the desk. */
.desk-stream { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; margin: .25rem 0 .75rem; }
.desk-stream .broadcast-actions { margin: 0; }

.desk {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  height: calc(100dvh - 9rem);
  min-height: 24rem;
}
.desk-split { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; min-height: 0; }
.desk-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.desk-col h2 { margin: 0; padding: .6rem .85rem; border-bottom: 1px solid var(--border); font-size: .95rem; }
.desk-count { font-weight: 400; font-size: .8rem; }
.desk-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.desk-empty { padding: .85rem; margin: 0; }

.desk-row { position: relative; border-bottom: 1px solid var(--border); }
.desk-message {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  width: 100%;
  padding: .45rem .75rem;
  font: inherit;
  font-size: .9rem;
  line-height: 1.4;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.desk-message:hover { background: var(--surface-2); }
.desk-message:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.desk-avatar { flex: none; width: 24px; height: 24px; margin-top: .1rem; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.desk-body { min-width: 0; overflow-wrap: anywhere; }
.desk-author { font-weight: 600; margin-right: .35rem; }
.desk-badge {
  display: inline-block;
  margin-right: .35rem;
  padding: 0 .3rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--ok);
}
.desk-channel { margin-right: .35rem; font-size: .75rem; color: var(--muted); }
.desk-event { display: block; color: var(--accent); }
.desk-sticker { display: block; width: 64px; height: 64px; margin-top: .25rem; }

/* Kinds of message, roughly as on the old desk. */
.desk-row.is-member .desk-message { background: rgb(74 222 128 / .07); }
.desk-row.is-question .desk-message { background: rgb(245 196 81 / .10); }
.desk-row.is-new .desk-message { background: rgb(236 72 153 / .14); }
.desk-row.is-paid .desk-message { background: rgb(91 140 255 / .14); }
.desk-row.is-owner .desk-author { color: var(--accent); }

/* Been on screen: greyed. On screen now: outlined. */
.desk-row.is-shown .desk-message { opacity: .45; }
.desk-row.is-featured .desk-message {
  opacity: 1;
  background: rgb(91 140 255 / .28);
  box-shadow: inset 4px 0 0 var(--accent);
}

/* Put on the chat map: shown on hover, and always once it's there. Desk only. */
.desk-map {
  position: absolute;
  top: .3rem;
  right: .4rem;
  padding: .1rem .3rem;
  font-size: .85rem;
  line-height: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
}
.desk-row:hover .desk-map, .desk-map:focus-visible, .desk-row.is-mapped .desk-map { opacity: 1; }
.desk-row:not(.is-mapped) .desk-map { filter: grayscale(1); }
.desk:not([data-map-url]) .desk-map { display: none; }

.desk-row.is-new-arrival .desk-message { animation: chat-arrive 3s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .desk-row.is-new-arrival .desk-message { animation: none; }
}

@media (max-width: 51.99rem) {
  .desk { grid-template-columns: minmax(0, 1fr); height: auto; }
  .desk-col { max-height: 60vh; }
  .desk-split { grid-template-rows: auto; }
}

/* ------------------------------------------------- Claude (MCP) connections */

.oauth-card { max-width: 34rem; margin: 2rem auto; }
.oauth-facts { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: 1rem 0; }
.oauth-facts dt { color: var(--muted); }
.oauth-facts dd { margin: 0; overflow-wrap: anywhere; }
.oauth-card select { margin: .35rem 0 .75rem; }
.oauth-actions { display: flex; gap: .5rem; }
.mcp-connections { margin-top: 1.5rem; }
.mcp-connection-list form { margin: 0; }

/* --------------------------------------------------------------- chat remotes */

.desk-remote-notice { margin-bottom: .75rem; }
.remote-list { display: grid; gap: .75rem; margin-bottom: 1.5rem; }
.remote-card p:last-of-type { margin-bottom: .75rem; }
.remote-card-code { font: 700 2rem/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; margin-bottom: .5rem; }
.remote-actions { display: flex; gap: .5rem; }
.remote-rename { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.remote-rename input[type="text"] { flex: 1; max-width: 20rem; margin: 0; }
.companion-token { margin-bottom: 1rem; }
.companion-token input[type="text"] { font-size: .9rem; }
.companion-new { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.companion-new label { margin: 0; }
.companion-new input[type="text"] { flex: 1; max-width: 16rem; margin: 0; }

/* ------------------------------------------------------- topic ticker model */

.model-form { display: grid; gap: .5rem; }
.model-option { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.model-option input { margin-top: .3rem; }
.model-form .btn { justify-self: start; margin-top: .25rem; }

/* -------------------------------------------------------------------- to-dos */

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; padding: .6rem 0; border-top: 1px solid var(--border); }
.todo:first-child { border-top: 0; }
.todo-body { min-width: 0; }
.todo-task { display: block; font-weight: 600; }
.todo-quote { display: block; font-size: .875rem; overflow-wrap: anywhere; }
.todo-quote a { margin-right: .35rem; }
.todo-actions { display: flex; gap: .4rem; flex: none; }
.todo.is-done .todo-task { text-decoration: line-through; color: var(--muted); }
.todo-stream h2 { margin-bottom: .5rem; }
.todo-done { margin-top: 1rem; }
.todo-done > summary { cursor: pointer; margin-bottom: .75rem; }

/* ------------------------------------------------------------------ show bar */
/* Above the chat desk: the countdown and credits on the chat overlay. */

.show-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  align-items: center;
  margin: .25rem 0 .75rem;
  padding: .45rem .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.show-group { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0; }
.show-label { font-weight: 600; font-size: .9rem; margin-right: .25rem; }
.show-group input[type="text"] { width: 7.5rem; margin: 0; padding: .3rem .5rem; }
.show-group .btn { padding: .3rem .6rem; font-size: .85rem; }
.show-status { color: var(--accent); font-size: .875rem; font-variant-numeric: tabular-nums; min-width: 5rem; }
/* The columns give up the bar's height. */
.desk-wide .show-bar ~ .desk { height: calc(100dvh - 12.5rem); }

.channel-upload { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Inside a video: the way back, and its pages in place of the sections. */
.nav-back {
  display: block;
  margin: 0 .25rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
}
.nav-back:hover { background: var(--surface-2); }
.nav-group-title { text-transform: none; letter-spacing: 0; font-size: .85rem; line-height: 1.35; overflow-wrap: anywhere; }
.nav-list a.is-empty { opacity: .45; }
.nav-count { float: right; font-size: .8rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* A row of choices of which one is showing: the Videos filter, transcript sources. */
.segmented { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; }
.segmented a {
  padding: .3rem .75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
}
.segmented a:hover { color: var(--text); }
.segmented a[aria-current="page"] { color: var(--text); background: var(--surface-2); border-color: var(--accent); }

details > summary h2 { display: inline; }

/* Rough cuts */
.rc-crumbs { margin-top: 0; }
.rc-description p { max-width: 48rem; }
.rc-description p:last-child { margin-bottom: 0; }
.rc-repeats { padding-left: 1.5rem; }
.rc-repeats li { margin-bottom: .9rem; }
.rc-repeats .pill { margin: 0 .35rem; }
.rc-strong { border-color: var(--error); color: var(--error); }

/* Settings, People: a role select and its buttons on one line, at the buttons' size. */
.people-actions { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; }
.people-actions form, .people-invites form { margin: 0; }
.people select, .people-invite select {
  width: auto;
  margin: 0;
  font-size: .925rem;
  line-height: inherit;
  padding-top: .5rem;
  padding-bottom: .5rem;
}
.people-invites { list-style: none; padding: 0; margin: 0 0 1rem; }
.people-invites li { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.people-invites li:last-child { border-bottom: 0; }
.people-invite { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.people-invite label { margin: 0; }
