/* ==========================================================================
   PlayRivet design system — "upfront"
   ==========================================================================
   The Upfronts, but for the algorithm era. Broadcast pitch-pink, thumbnail
   yellow and stream cyan on cool studio white with violet-black ink. Hard
   3px ink borders, hard offset shadows, zero border radius. Condensed
   display caps for headlines and big numbers only; quiet system-ui body;
   mono for anything that is data — durations, timestamps, quota, tags.
   Committed light theme (studio lighting stays on).

   Legacy note: every class used by the current app templates
   (playlists / playlist_editor / activity / admin) and app.js/admin.js is
   kept below, restyled in the new language. Do not remove selectors until
   those screens are rebuilt.
   ========================================================================== */

:root {
  /* Broadcast palette */
  --studio: #FAF9F5;      /* cool studio white */
  --studio2: #F1EFE8;     /* recessed panel */
  --ink: #171320;         /* violet-black */
  --onair: #FF2E63;       /* live pink — display type, large surfaces */
  --onair-deep: #E01448;  /* live pink darkened for small text on white */
  --thumb: #FFD400;       /* thumbnail yellow */
  --stream: #00B8D4;      /* stream cyan */
  --stream-deep: #007A8F; /* stream cyan darkened for links/small text */
  --muted-violet: #6E6880;

  /* Semantic tokens (legacy names kept — the whole app reads these) */
  --bg: var(--studio);
  --bg-elevated: #ffffff;
  --bg-sunken: var(--studio2);
  --border: #ddd9d0;
  --border-strong: var(--ink);
  --text: var(--ink);
  --text-muted: var(--muted-violet);
  --text-faint: #9d97b3;

  --accent: var(--onair-deep);
  --accent-strong: #b81038;
  --accent-contrast: #ffffff;
  --accent-wash: #fde3ea;

  --link: var(--stream-deep);

  --danger: var(--onair-deep);
  --danger-bg: #fde3ea;
  --ok: #0F7A3D;
  --ok-bg: #e3f2e8;
  --warning: #8a6400;
  --warning-bg: #fdf3cd;

  /* Hard offset shadows — broadcast hardware, not SaaS glow */
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow-md: 5px 5px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);

  /* Hard corners everywhere */
  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;

  --line: 3px solid var(--ink);
  --line-2: 2px solid var(--ink);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Impact", "Haettenschweiler", "Franklin Gothic Bold", "Arial Narrow Bold", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
}

* { box-sizing: border-box; }

/* The hidden attribute always wins, even over display:flex on a class */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; font-weight: 700; }
h1 { font-size: 1.9rem; letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Display voice: condensed heavy caps — YouTube-thumbnail vernacular,
   used only where a headline earns it. */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.94;
  letter-spacing: 0.01em;
  margin: 0;
}

/* Record-dot kicker — mono strapline above a section title */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}
.kicker::before { content: "\25CF  "; color: var(--onair); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
}
.eyebrow::before { content: "\25CF "; color: var(--onair); }

:focus-visible {
  outline: 3px solid var(--stream);
  outline-offset: 2px;
  border-radius: 0;
}

/* ==========================================================================
   Masthead — optional mono ticker strip (landing uses it)
   ========================================================================== */

.masthead {
  border-bottom: var(--line);
  background: var(--ink);
  color: var(--studio);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.55rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.masthead strong { color: var(--thumb); font-weight: 700; }
.masthead-quota { color: #9d97b3; }
@media (max-width: 560px) { .masthead-quota { display: none; } }

/* ==========================================================================
   Topbar
   ========================================================================== */

.topbar {
  border-bottom: var(--line);
  background: var(--studio);
  position: relative;
  z-index: 50;
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text);
}
.wordmark:hover { text-decoration: none; }
.wordmark-rivet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--onair);
  border: 2px solid var(--ink);
  flex: none;
  margin-right: 0.45rem;
}
.wordmark span { color: var(--onair); }

.topnav { display: flex; gap: 1.4rem; flex: 1; align-items: center; }
.topnav a {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0;
  border-bottom: 3px solid transparent;
}
.topnav a:hover { color: var(--onair-deep); text-decoration: none; }
.topnav-admin { color: var(--onair-deep); }
.topnav .button { border-bottom-width: 2px; }

.topbar-right { display: flex; align-items: center; gap: 1.25rem; }

.quota-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.quota-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  font-size: 0.62rem;
}
.quota-bar { width: 72px; height: 8px; background: var(--bg-elevated); border: 2px solid var(--ink); overflow: hidden; }
.quota-bar-fill { height: 100%; background: var(--stream); transition: width var(--dur) var(--ease); }
.quota-meter.quota-warn .quota-bar-fill { background: var(--thumb); }
.quota-meter.quota-crit .quota-bar-fill { background: var(--onair); }
.quota-value { white-space: nowrap; font-family: var(--font-mono); color: var(--text-muted); }
@media (max-width: 600px) { .quota-meter { display: none; } }

.lang-switcher { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.lang-switcher select {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.3rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 2px solid var(--ink);
  cursor: pointer;
}
.lang-switcher select:hover { color: var(--ink); }
.lang-switcher-go { font-size: 0.68rem; padding: 0.2rem 0.4rem; }

.user-chip { position: relative; }
.user-chip-button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elevated);
  border: var(--line-2);
  border-radius: 0;
  padding: 0.35rem 0.9rem;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.user-chip-button:hover { background: var(--thumb); }
.chevron { font-size: 0.65em; color: var(--text-muted); }
.user-chip-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-elevated);
  border: var(--line-2);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 60;
}
.user-chip-menu[hidden] { display: none; }
.user-chip-email { margin: 0.3rem 0.5rem 0.2rem; font-size: 0.8rem; font-family: var(--font-mono); color: var(--text-muted); }
.user-chip-plan {
  margin: 0 0.5rem 0.2rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
/* Quota reappears inside the menu once the top-bar meter is hidden */
.user-chip-quota {
  display: none;
  margin: 0 0.5rem 0.2rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
@media (max-width: 600px) { .user-chip-quota { display: block; } }
.user-chip-divider { border: none; border-top: 2px solid var(--ink); margin: 0.35rem 0; }

/* ==========================================================================
   Page shell
   ========================================================================== */

.page { max-width: 1120px; margin: 0 auto; padding: 2.25rem 1.5rem 4rem; width: 100%; flex: 1; }

/* Full-bleed variant used by the landing page: sections manage their own
   .wrap containers. */
.page-bleed { max-width: none; margin: 0; padding: 0; width: 100%; flex: 1; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.page-header h1 { margin-bottom: 0.2rem; }
.header-actions { display: flex; gap: 0.6rem; flex: none; }

/* Banners (flash messages) */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border: var(--line-2);
  box-shadow: var(--shadow-sm);
  padding: 0.9rem 1.25rem;
  margin-bottom: 1.5rem;
}
.banner p { margin: 0; font-weight: 600; }
.banner-warning { background: var(--warning-bg); color: var(--ink); }
.banner-warning .button { background: var(--thumb); color: var(--ink); }

/* SIGNAL LOST reconnect strip: full-width, directly under the top bar */
.banner-signal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  background: var(--thumb);
  color: var(--ink);
  border-bottom: var(--line);
  padding: 0.7rem 1.5rem;
}
.banner-signal p { margin: 0; font-weight: 600; }
.banner-signal .signal-label { font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.banner-signal .signal-label::before { content: "\25CF "; color: var(--onair); }
.banner-signal .button { background: var(--bg-elevated); }

/* ==========================================================================
   Buttons — chunky broadcast hardware, not SaaS pills
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: var(--line-2);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 0;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.button.primary { background: var(--thumb); color: var(--ink); }
.button.primary:hover { background: var(--thumb); }
.button.pink { background: var(--onair-deep); color: #fff; }
.button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.button.ghost:hover { background: var(--bg-sunken); border-color: transparent; box-shadow: none; transform: none; }
.button.ghost:active { transform: none; }
.button.danger { color: var(--danger); }
.button.danger:hover { background: var(--danger-bg); }
.button.large { padding: 0.85rem 1.6rem; font-size: 0.95rem; box-shadow: var(--shadow-md); }
.button.large:hover { box-shadow: 7px 7px 0 var(--ink); transform: translate(-2px, -2px); }
.button.large:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.button.full { width: 100%; }
.button.disabled, .button[disabled] {
  background: var(--studio2);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: auto;
}
.button.disabled:hover, .button[disabled]:hover { transform: none; box-shadow: none; background: var(--studio2); }
.button.disabled:active, .button[disabled]:active { transform: none; }
.button .spinner { display: none; }
.button[data-loading="true"] { pointer-events: none; opacity: 0.75; }

.link-button {
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.link-button:hover { background: var(--thumb); }
.link-button.danger { color: var(--danger); }
.link-button.danger:hover { background: var(--danger-bg); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-row { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-row label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-row.inline { flex-direction: row; align-items: center; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem 1.25rem;
}
input[type="text"], input[type="number"], input[type="search"], textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--bg-elevated);
  border: var(--line-2);
  border-radius: 0;
  padding: 0.55rem 0.7rem;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: 3px solid var(--stream);
  outline-offset: 0;
}
textarea { resize: vertical; }
.hint { font-size: 0.8rem; color: var(--text-muted); margin: 0.25rem 0 0.75rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1rem; align-items: center; }

/* Switch (toggle) */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 40px;
  height: 22px;
  background: var(--bg-elevated);
  border: var(--line-2);
  position: relative;
  flex: none;
  transition: background var(--dur) var(--ease);
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--ink);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch-track { background: var(--thumb); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--stream); outline-offset: 2px; }
.switch-copy { display: flex; flex-direction: column; gap: 0.05rem; }
.switch-copy .switch-desc { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  padding: 0.9rem 0;
  border-top: 2px solid var(--studio2);
}
.toggle-row:first-of-type { border-top: none; padding-top: 0; }

/* Chips (keyword filters, resolved channels) */
.chip-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  border: var(--line-2);
  border-radius: 0;
  padding: 0.4rem;
  background: var(--bg-elevated);
}
.chip-field:focus-within { outline: 3px solid var(--stream); outline-offset: 0; }
.chip-field input {
  flex: 1;
  min-width: 140px;
  border: none;
  background: none;
  padding: 0.25rem 0.3rem;
}
.chip-field input:focus { outline: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-sunken);
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 0.12rem 0.3rem 0.12rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.chip.chip-exclude { background: var(--danger-bg); color: var(--danger); }
.chip-remove {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
}
.chip-remove:hover { opacity: 1; background: rgba(23, 19, 32, 0.1); }

/* Duration range */
.range-pair { display: flex; align-items: center; gap: 0.6rem; max-width: 320px; }
.range-pair input { width: 90px; flex: none; }
.range-pair span { color: var(--text-faint); }
.range-pair .unit { color: var(--text-muted); font-size: 0.85rem; }

/* Advanced disclosure */
details.advanced { border-top: 2px solid var(--studio2); margin-top: 1.25rem; padding-top: 1rem; }
details.advanced summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 700;
  color: var(--text);
}
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease);
  flex: none;
}
details.advanced[open] summary::after { transform: rotate(-135deg); }
.advanced-summary { color: var(--text-muted); font-family: var(--font-mono); font-weight: 400; font-size: 0.78rem; flex: 1; text-align: right; }
.advanced-body { padding-top: 1.1rem; }
.advanced-body h3 { margin-top: 1.5rem; }
.advanced-body h3:first-child { margin-top: 0.25rem; }

/* Attach an existing YouTube playlist */
.attach-existing-select { margin-top: 0.35rem; }

/* ==========================================================================
   Playlists dashboard — the lineup (playlists.html, spec 4)
   ========================================================================== */

.page-display-title { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.dash-header-actions { align-items: center; gap: 0.9rem; }
.plan-used { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); }

.show-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.6rem;
}
.show-card {
  display: flex;
  flex-direction: column;
  box-shadow: 6px 6px 0 var(--ink);
}
.show-card-link { display: block; color: var(--text); }
.show-card-link:hover { text-decoration: none; }
.show-card-link:hover .show-card-title { text-decoration: underline; }
.show-card-link:focus-visible { outline: 3px solid var(--stream); outline-offset: -3px; }
.show-card-head { gap: 0.6rem; }
.show-card-title {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  font-size: 0.82rem;
  font-family: var(--font);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.show-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--ink);
  border-bottom: var(--line-2);
  aspect-ratio: 4 / 1.4;
}
.show-thumb { position: relative; overflow: hidden; background: var(--studio2); }
.show-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.show-dur {
  position: absolute;
  right: 3px;
  bottom: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  background: var(--thumb);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.18em 0.35em;
}
/* Broken thumbnail: NO SIGNAL, never a broken-image icon */
.show-thumb.is-dead img, .show-thumb.is-dead .show-dur { display: none; }
.show-thumb.is-dead::after {
  content: "NO SIGNAL";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(-45deg, var(--studio2) 0 6px, #fff 6px 12px);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
/* Never synced: one drawn placeholder frame across the strip */
.show-thumb-none {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(-45deg, var(--studio2) 0 6px, #fff 6px 12px);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.show-status {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.8rem 0.95rem 0.9rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.show-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.16rem 0.5rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  white-space: nowrap;
  background: var(--bg-elevated);
}
.show-badge { flex: none; color: var(--ink); }

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

.show-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.95rem;
  border-top: var(--line-2);
  margin-top: auto;
}
.show-actions .button { padding: 0.55rem 0.85rem; font-size: 0.68rem; box-shadow: 2px 2px 0 var(--ink); min-height: 44px; }
.show-yt { margin-left: auto; font-size: 0.74rem; font-weight: 700; padding: 0.6rem 0.2rem; }
@media (max-width: 640px) {
  .show-grid { grid-template-columns: minmax(0, 1fr); }
  .show-actions { flex-wrap: wrap; }
  .show-actions .button { flex: 1 1 40%; }
  .show-yt { flex-basis: 100%; margin-left: 0; text-align: right; }
}

/* Empty lineup: DEAD AIR instrument with a static mini EPG frame */
.dead-air { box-shadow: 6px 6px 0 var(--ink); }
.dead-air-body { text-align: center; padding: 2.4rem 1.5rem 2.6rem; }
.dead-air-epg {
  width: min(340px, 100%);
  margin: 0 auto 1.5rem;
  border: var(--line-2);
  background: var(--studio);
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.dead-air-row { display: flex; align-items: center; gap: 0.6rem; }
.dead-air-time { font-size: 0.62rem; font-weight: 700; color: var(--text-muted); flex: none; }
.dead-air-vt { width: 3.6rem; aspect-ratio: 16 / 9; }
.dead-air-bars { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.dead-air-bar { height: 6px; background: var(--studio2); border: 1px solid rgba(23, 19, 32, 0.25); }
.dead-air-bar-short { width: 55%; }
.dead-air-headline { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin-bottom: 0.6rem; }
.dead-air-copy { color: var(--text-muted); max-width: 42ch; margin: 0 auto 1.4rem; }

/* ==========================================================================
   Lists (sources / raw filters)
   ========================================================================== */

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.inline-form select { flex: 0 0 auto; width: auto; min-width: 190px; }
.inline-form input[type="text"] { flex: 1; min-width: 220px; }

/* Channel autocomplete (add-source form) */
.suggest-wrap { position: relative; flex: 1; min-width: 220px; }
.inline-form .suggest-wrap input[type="text"] { width: 100%; min-width: 0; }
.suggest-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--bg-elevated);
  border: var(--line-2);
  box-shadow: var(--shadow-md);
  max-height: 16.5rem;
  overflow-y: auto;
  z-index: 60;
}
.suggest-menu[hidden] { display: none; }
.suggest-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.suggest-option .suggest-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggest-option { align-items: center; }
.suggest-cav { width: 22px; height: 22px; font-size: 0.62rem; }
.suggest-option .suggest-origin {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.suggest-option:hover, .suggest-option.is-active { background: var(--thumb); }
/* A picked channel: the box shows the name, this line shows what will actually
   be sent, so the resolved id is never a mystery. */
.suggest-pick-hint {
  margin: 0.35rem 0 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inline-form input.is-picked {
  border-color: var(--thumb);
  box-shadow: inset 3px 0 0 var(--thumb);
}

.filter-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; }
.filter-source-wrap { display: inline-flex; align-items: center; gap: 0.4rem; flex: none; }
.filter-source-wrap[hidden] { display: none; }
.filter-source-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.filter-row select.filter-kind { width: auto; min-width: 200px; }
.filter-row input { width: auto; flex: 1; min-width: 140px; }

/* ==========================================================================
   Toasts
   ========================================================================== */

#toast-container {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 100;
}
.toast {
  background: var(--ink);
  color: var(--studio);
  border: var(--line-2);
  border-left: 8px solid var(--studio);
  box-shadow: var(--shadow-md);
  padding: 0.65rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  max-width: 340px;
  animation: toast-in var(--dur) var(--ease);
}
.toast.error { border-left-color: var(--onair); }
.toast.success { border-left-color: var(--thumb); }
@media (max-width: 600px) {
  #toast-container { left: 0; right: 0; bottom: 0; }
  .toast { max-width: none; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes chip-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Video cards (preview grid) — the star of the create/edit flow
   ========================================================================== */

.preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
}

.preview-empty-hint {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  border: 2px dashed var(--ink);
}

.video-section { margin-top: 1.5rem; }
.video-section-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.video-section-head h3 { margin: 0; }
.video-section-head .count-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--thumb);
  border: 2px solid var(--ink);
  padding: 0.05rem 0.5rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}

.video-card {
  border: var(--line-2);
  overflow: hidden;
  background: var(--bg-elevated);
  animation: chip-in var(--dur) var(--ease);
}
.video-card-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--studio2); overflow: hidden; border-bottom: var(--line-2); }
.video-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card-thumb .thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(-45deg, var(--studio2) 0 6px, #fff 6px 12px);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.video-card-duration {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  background: rgba(23, 19, 32, 0.92);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
}
.video-card-status {
  position: absolute;
  left: 0.35rem;
  top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.14rem 0.42rem;
  background: var(--ink);
  color: #fff;
}
.video-card.status-add .video-card-status { background: var(--thumb); color: var(--ink); }
.video-card.status-remove .video-card-status { background: var(--onair-deep); color: #fff; }
.video-card.status-exclude .video-card-status { background: var(--ink); color: var(--studio); }
.video-card.status-exclude .video-card-title { text-decoration: line-through; color: var(--text-muted); }
.video-card.status-exclude .video-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(23, 19, 32, 0.35) 6px 9px);
}

.video-card-body { padding: 0.6rem 0.65rem 0.75rem; }
.video-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-channel { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-card-published { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.03em; color: var(--text-faint); margin: 0.1rem 0 0; }
.video-card-reason { font-family: var(--font-mono); font-size: 0.68rem; color: var(--onair-deep); margin: 0.25rem 0 0; }

/* Skeleton loading state */
.video-card.skeleton { pointer-events: none; }
.skeleton .video-card-thumb, .skeleton-line {
  position: relative;
  overflow: hidden;
  background: var(--studio2);
}
.skeleton-line { height: 0.6rem; margin: 0.35rem 0.65rem; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton .video-card-thumb::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.preview-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--studio2);
}
.preview-action-bar p { margin: 0; color: var(--text-muted); font-size: 0.85rem; }

details.preview-excluded { margin-top: 1.5rem; }
details.preview-excluded summary {
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}
details.preview-excluded summary::-webkit-details-marker { display: none; }

/* ==========================================================================
   Site footer
   ========================================================================== */

.site-footer {
  border-top: var(--line);
  background: var(--ink);
  color: #9d97b3;
  margin-top: 2rem;
}
.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-footer .muted { color: #9d97b3; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: #9d97b3; }
.footer-links a:hover { color: var(--thumb); text-decoration: none; }

/* ==========================================================================
   Thumbnail-card primitive — the product's output, drawn in the house
   palette. 16:9 art area (inline SVG, one subject each), mono duration pill
   bottom-right, round channel avatar with an initial. Reusable by app
   screens and the landing page alike.
   ========================================================================== */

.vt {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--ink);
  background: var(--studio2);
  overflow: hidden;
  flex-shrink: 0;
}
.vt svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vt-y { background: var(--thumb); }
.vt-c { background: var(--stream); }
.vt-p { background: var(--onair); }
.vt-k { background: var(--ink); }
.vt-w { background: #fff; }
.vt .dur {
  position: absolute;
  right: 3px;
  bottom: 3px;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  background: rgba(23, 19, 32, 0.92);
  color: #fff;
  padding: 0.22em 0.4em;
  border-radius: 2px;
}
/* a card the standards desk killed: hatched over */
.vt-x::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(250, 249, 245, 0.88) 0 6px, rgba(250, 249, 245, 0.5) 6px 12px);
}

/* channel avatar */
.cav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}
/* The real channel thumbnail, sized to the letter avatar it replaces. */
img.cav {
  display: inline-block;
  object-fit: cover;
  background: var(--bg-elevated);
  padding: 0;
}
.cav-a { background: var(--thumb); }
.cav-b { background: var(--stream); }
.cav-c { background: var(--onair); color: #fff; }
.cav-d { background: var(--ink); color: var(--studio); }

/* squared broadcast tag */
.tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--studio);
  padding: 0.1em 0.4em;
  text-decoration: none;
  flex-shrink: 0;
}
.tag-new { background: var(--onair-deep); color: #fff; }

/* instrument panel: ink header bar, body, mono footer */
.panel {
  border: var(--line);
  background: #fff;
  box-shadow: var(--shadow-lg);
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  background: var(--ink);
  color: var(--studio);
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.panel-head .rec { color: var(--onair); }
.panel-head .rec::before { content: "\25CF "; }
.panel-head .rec-live::before { animation: blink 1.4s steps(2, end) infinite; display: inline-block; }
@keyframes blink { 50% { opacity: 0.15; } }
.panel-body { padding: 0.85rem 0.95rem; }
.panel-foot {
  border-top: var(--line);
  background: var(--studio);
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.panel-foot strong { color: var(--ink); }

/* ==========================================================================
   LANDING PAGE — the upfront pitch (scoped to landing.html markup)
   ========================================================================== */

.landing section[id] { scroll-margin-top: 4.5rem; }

/* ---- hero: headline left, the playlist panel right ---- */
.hero {
  border-bottom: var(--line);
  padding: 3.5rem 0 4rem;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}
@media (max-width: 940px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
}
.hero h1 {
  font-size: clamp(2.9rem, 6.2vw, 5.2rem);
  margin: 0 0 1.4rem;
  font-weight: 400;
}
.hero h1 .hl {
  background: var(--onair);
  color: #fff;
  padding: 0 0.18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.hero-lede {
  font-size: 1.12rem;
  max-width: 34rem;
  margin: 0 0 1.8rem;
}
.hero-lede strong { background: var(--thumb); padding: 0 0.2em; }
.hero-ctas { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.hero-sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 1.1rem 0 0;
}

/* ---- the playlist panel: the sole above-the-fold demo ---- */
.hero-demo { min-width: 0; }
.lineup {
  border: var(--line);
  background: #fff;
  box-shadow: 10px 10px 0 var(--ink);
}
.lineup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  background: var(--ink);
  color: var(--studio);
  padding: 0.55rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lineup-live { color: var(--onair); white-space: nowrap; }
.lineup-live::before {
  content: "\25CF";
  margin-right: 0.4em;
  display: inline-block;
  animation: blink 1.4s steps(2, end) infinite;
}
.lineup-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  min-width: 0;
}
.lineup-row + .lineup-row { border-top: 2px solid var(--studio2); }
.lineup-row .ix {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}
.lineup-row .vt { width: 5.4rem; }
.lineup-meta { flex: 1; min-width: 0; }
.lineup-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lineup-chan {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
}
/* the fresh sync arriving — the hero's one orchestrated moment */
.lineup-row-new {
  animation: slotin 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.6s backwards;
}
@keyframes slotin {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
/* a row the standards desk cut: struck through, reason tagged */
.lineup-row-x { background: var(--studio); }
.lineup-row-x .ix { text-decoration: line-through; }
.lineup-row-x .lineup-title { text-decoration: line-through; color: var(--text-muted); font-weight: 600; }
.lineup-caption {
  border-top: var(--line);
  background: var(--studio);
  padding: 0.6rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin: 0;
}
.lineup-caption strong { color: var(--ink); }

/* ---- the slate ---- */
.slate {
  border-bottom: var(--line);
  background: #fff;
  padding: 3.8rem 0;
}
.slate-title { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: 0.6rem; }
.slate-title .hl { background: var(--thumb); padding: 0 0.15em; }
.slate-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0 0 2.2rem;
}
.slate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem;
}
@media (max-width: 820px) { .slate-grid { grid-template-columns: minmax(0, 1fr); } }
.slate-item {
  border: var(--line);
  border-left-width: 14px;
  background: var(--studio);
  padding: 1.1rem 1.2rem;
}
.slate-item:nth-child(6n+1) { border-left-color: var(--onair); }
.slate-item:nth-child(6n+2) { border-left-color: var(--stream); }
.slate-item:nth-child(6n+3) { border-left-color: var(--thumb); }
.slate-item:nth-child(6n+4) { border-left-color: var(--stream); }
.slate-item:nth-child(6n+5) { border-left-color: var(--thumb); }
.slate-item:nth-child(6n+6) { border-left-color: var(--onair); }
.slate-slug {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.slate-said {
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.8rem;
}
.slate-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}
.slate-strip .vt { width: 100%; }
.slate-chans {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slate-set { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.slate-set span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  background: #fff;
  padding: 0.12em 0.42em;
}

/* ---- ratings report (the problem) ---- */
.problem {
  background: var(--studio2);
  border-bottom: var(--line);
  padding: 3.8rem 0;
}
.problem-title { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: 0.7rem; }
.problem-title .hl { background: var(--onair); color: #fff; padding: 0 0.15em; }
.problem-intro { max-width: 38rem; color: #3d3850; margin: 0 0 2.2rem; }
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}
@media (max-width: 820px) { .problem-grid { grid-template-columns: minmax(0, 1fr); } }
.problem-card {
  border: var(--line);
  background: #fff;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 1.3rem 1.3rem 1.4rem;
}
.problem-card .problem-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--onair-deep);
  margin: 0 0 0.5rem;
}
.problem-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.98;
  font-size: 1.6rem;
  margin: 0 0 0.6rem;
}
.problem-card p { font-size: 0.94rem; color: #3d3850; margin: 0; }

/* ---- feature rows ---- */
.featrow {
  border-bottom: var(--line);
  padding: 3.4rem 0;
}
.featrow-flip { background: var(--studio2); }
.featrow .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 3rem;
  align-items: center;
}
.featrow-copy .kicker { margin-bottom: 0.7rem; }
.featrow-title { font-size: clamp(1.8rem, 3.4vw, 2.7rem); margin-bottom: 0.8rem; }
.featrow-title .hl { background: var(--stream); padding: 0 0.15em; }
.featrow-copy p:not(.kicker) { color: #3d3850; max-width: 32rem; margin: 0; }
.featrow-flip .featrow-copy { order: 2; }
@media (max-width: 900px) {
  .featrow .wrap { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .featrow-flip .featrow-copy { order: 0; }
}

/* row 1 — casting: sources as typed in */
.cast-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.45rem 0;
  min-width: 0;
}
.cast-row + .cast-row { border-top: 1px dashed rgba(23, 19, 32, 0.28); }
.cast-row .h {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.cast-row .form {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  padding: 0.1em 0.4em;
  flex-shrink: 0;
}
.cast-row .n { color: var(--text-muted); font-size: 0.7rem; flex-shrink: 0; }

/* row 2 — standards memo */
.memo-line {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.35rem 0;
}
.memo-line + .memo-line { border-top: 1px dashed rgba(23, 19, 32, 0.28); }
.memo-line .op {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--studio);
  padding: 0.1em 0.42em;
  flex-shrink: 0;
  min-width: 5.4rem;
  text-align: center;
}
.memo-line .op-out { background: var(--onair-deep); color: #fff; }
.memo-line .op-in { background: var(--stream); color: var(--ink); }
.memo-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.85rem;
  border-top: var(--line);
  padding-top: 0.85rem;
}
.memo-card { min-width: 0; position: relative; }
.memo-card .vt { width: 100%; margin-bottom: 0.35rem; }
.memo-card .mc-t {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}
.memo-card .mc-s {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}
.memo-card .mc-s b { color: var(--ok); }
.memo-card-x .mc-t { text-decoration: line-through; color: var(--text-muted); }
.memo-card-x .mc-s b { color: var(--onair-deep); }
.memo-card .mc-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--onair-deep);
  color: #fff;
  padding: 0.18em 0.45em;
}

/* row 3 — running order */
.order-opts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.85rem; }
.order-opts span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  padding: 0.14em 0.45em;
  color: var(--text-muted);
}
.order-opts span.on { background: var(--thumb); color: var(--ink); }
.order-list { list-style: none; margin: 0; padding: 0; }
.order-list li {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.4rem 0;
  min-width: 0;
}
.order-list li + li { border-top: 1px dashed rgba(23, 19, 32, 0.28); }
.order-list .p { font-weight: 700; color: var(--onair-deep); flex-shrink: 0; }
.order-list .vt { width: 3.8rem; }
.order-list .ti {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* row 4 — the air check log */
.log-line {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.32rem 0;
  min-width: 0;
}
.log-line + .log-line { border-top: 1px dashed rgba(23, 19, 32, 0.22); }
.log-line .ts { color: var(--text-muted); flex-shrink: 0; }
.log-line .sig { font-weight: 700; flex-shrink: 0; width: 1.1em; }
.log-add .sig { color: var(--ok); }
.log-rm .sig { color: var(--onair-deep); }
.log-mv .sig { color: var(--stream-deep); }
.log-line .vt { width: 2.9rem; }
.log-line .msg {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- the business case ---- */
.proof {
  background: var(--ink);
  color: var(--studio);
  border-bottom: var(--line);
  padding: 3.8rem 0;
}
.proof .kicker { color: #9d97b3; }
.proof-title {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  color: var(--studio);
  margin-bottom: 2.4rem;
}
.proof-title .hl { color: var(--thumb); }
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 820px) { .proof-grid { grid-template-columns: 1fr; } }
.proof-card {
  border: 3px solid var(--studio);
  padding: 1.6rem 1.4rem 1.5rem;
  background: transparent;
}
.proof-card .proof-num {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 6vw, 5rem);
  line-height: 1;
  margin: 0 0 0.4rem;
}
.proof-card .proof-num small { font-size: 0.42em; letter-spacing: 0.06em; }
.proof-card:nth-child(1) .proof-num { color: var(--thumb); }
.proof-card:nth-child(2) .proof-num { color: var(--stream); }
.proof-card:nth-child(3) .proof-num { color: var(--onair); }
.proof-card .proof-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9d97b3;
  margin: 0 0 0.9rem;
}
.proof-card p { font-size: 0.95rem; color: #d9d5e6; margin: 0; }
.proof-card code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.05em 0.35em;
}

/* ---- steps ---- */
.steps {
  border-bottom: var(--line);
  padding: 3.8rem 0;
}
.steps-title { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: 2.4rem; }
.steps-title .hl { background: var(--stream); padding: 0 0.15em; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: var(--line);
  background: #fff;
}
@media (max-width: 940px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps-grid { grid-template-columns: 1fr; } }
.step {
  padding: 1.5rem 1.3rem 1.6rem;
  border-right: var(--line);
  position: relative;
}
.step:last-child { border-right: none; }
@media (max-width: 940px) {
  .step:nth-child(2) { border-right: none; }
  .step:nth-child(1), .step:nth-child(2) { border-bottom: var(--line); }
}
@media (max-width: 560px) {
  .step { border-right: none; border-bottom: var(--line); }
  .step:last-child { border-bottom: none; }
}
.step .step-no {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  padding: 0.05em 0.16em 0;
  margin: 0 0 0.5rem;
  background: var(--onair);
  color: #fff;
}
.step:nth-child(2) .step-no { background: var(--stream); color: var(--ink); }
.step:nth-child(3) .step-no { background: var(--thumb); color: var(--ink); }
.step:nth-child(4) .step-no { background: var(--ink); color: var(--studio); }
.step .step-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}
.step p { font-size: 0.93rem; color: #3d3850; margin: 0; }

/* ---- rate card ---- */
.rates {
  background: var(--studio2);
  border-bottom: var(--line);
  padding: 3.8rem 0;
}
.rates-title { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: 0.6rem; }
.rates-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0 0 2.2rem;
}
.rates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 820px) { .rates-grid { grid-template-columns: 1fr; max-width: 30rem; } }
.rate {
  background: #fff;
  border: var(--line);
  box-shadow: 6px 6px 0 var(--ink);
  font-family: var(--font-mono);
  position: relative;
}
.rate-hot {
  background: var(--ink);
  color: var(--studio);
  box-shadow: 6px 6px 0 var(--onair);
}
.rate-flag {
  position: absolute;
  top: -0.9rem;
  right: 1rem;
  background: var(--onair-deep);
  color: #fff;
  border: 2px solid var(--ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
}
.rate-tier {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 1rem 1.2rem 0.4rem;
  color: var(--text-muted);
  margin: 0;
}
.rate-hot .rate-tier { color: var(--thumb); }
.rate-name {
  font-family: var(--font-display);
  font-size: 1.9rem;
  text-transform: uppercase;
  padding: 0 1.2rem 0.9rem;
  letter-spacing: 0.02em;
  margin: 0;
}
.rate-rows {
  list-style: none;
  margin: 0;
  padding: 0 1.2rem 1.2rem;
  font-size: 0.78rem;
}
.rate-rows li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.42rem 0;
}
.rate-rows li + li { border-top: 1px dashed rgba(23, 19, 32, 0.3); }
.rate-hot .rate-rows li + li { border-top-color: rgba(250, 249, 245, 0.25); }
.rate-rows .k { flex-shrink: 0; }
.rate-rows .leader {
  flex: 1;
  border-bottom: 2px dotted rgba(23, 19, 32, 0.35);
  transform: translateY(-3px);
}
.rate-hot .rate-rows .leader { border-bottom-color: rgba(250, 249, 245, 0.35); }
.rate-rows .v { font-weight: 700; text-align: right; }
.rate-rows .no { opacity: 0.45; }

/* ---- standards & practices fine-print strip ---- */
.standards {
  border-bottom: var(--line);
  background: var(--studio2);
  padding: 2.2rem 0;
}
.standards .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.5fr) minmax(0, 1.5fr);
  gap: 2rem;
}
@media (max-width: 820px) { .standards .wrap { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; } }
.standards h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
}
.standards h2::before { content: "\25CF "; color: var(--onair); }
.standards .standards-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0;
}
.standards-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 2rem;
}
@media (max-width: 620px) { .standards-list { grid-template-columns: minmax(0, 1fr); } }
.standards-list li { font-size: 0.88rem; color: #3d3850; }
.standards-list b {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.standards-list b::before { content: "\25B8 "; color: var(--stream); }

/* ---- questions from the floor ---- */
.floor {
  border-bottom: var(--line);
  padding: 3.8rem 0;
}
.floor-title { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: 2.2rem; }
.floor-title .hl { background: var(--thumb); padding: 0 0.15em; }
.floor-list { border: var(--line); background: #fff; }
.floor-item { padding: 1.2rem 1.3rem; }
.floor-item + .floor-item { border-top: var(--line); }
.floor-q {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.7rem;
  align-items: baseline;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.55rem;
}
.floor-q .mark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--onair-deep);
  letter-spacing: 0.04em;
}
.floor-a {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.7rem;
  align-items: baseline;
}
.floor-a .mark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--stream);
  letter-spacing: 0.04em;
}
.floor-a p { font-size: 0.95rem; color: #3d3850; margin: 0; }
.floor-a code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--studio2);
  padding: 0.05em 0.35em;
}
@media (max-width: 520px) {
  .floor-q, .floor-a { grid-template-columns: 1.6rem 1fr; gap: 0.5rem; }
}

/* ---- closing ---- */
.closing {
  background: var(--onair-deep);
  color: #fff;
  padding: 4.5rem 0;
  text-align: center;
}
.closing h2 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  margin-bottom: 0.8rem;
}
.closing > .wrap > p {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 2rem;
}
.closing .button.primary { background: var(--thumb); color: var(--ink); }
.closing-trust {
  margin: 1.6rem 0 0 !important;
  font-size: 0.74rem !important;
  letter-spacing: 0.08em !important;
  color: #ffd9e2;
}
.closing-trust a { color: #fff; }

/* ==========================================================================
   Legal pages (privacy / terms)
   ========================================================================== */

.legal-article { max-width: 720px; margin: 0 auto; padding-bottom: 2rem; }
.legal-article h1 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
}
.legal-effective {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0;
  margin-bottom: 2rem;
}
.legal-effective::before { content: "\25CF "; color: var(--onair); }
.legal-article h2 {
  margin-top: 2.2rem;
  padding-top: 0.9rem;
  border-top: var(--line);
  font-size: 1.15rem;
}
.legal-article p, .legal-article li { color: #3d3850; }
.legal-article ul { padding-left: 1.25rem; }
.legal-article li { margin-bottom: 0.4rem; }

/* ==========================================================================
   Activity — the broadcast log (activity.html, spec 5)
   ========================================================================== */

/* Filter bar: one slim instrument */
.filter-bar { box-shadow: var(--shadow-sm); margin-bottom: 1.5rem; }
.filter-bar-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.8rem 1rem;
  padding: 0.8rem 0.95rem;
}
.filter-bar-field { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-bar-field label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.filter-bar-field select { width: auto; min-width: 180px; }
.filter-bar-form .button { min-height: 44px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 2px solid var(--ink);
  background: var(--thumb);
  color: var(--ink);
  padding: 0.55rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  min-height: 44px;
}
.filter-chip:hover { text-decoration: none; background: var(--studio2); }
.filter-chip span { font-size: 0.9rem; line-height: 1; }
@media (max-width: 600px) {
  .filter-bar-field { flex: 1 1 100%; }
  .filter-bar-field select { width: 100%; }
}

/* The log panel: hardware output */
.log-panel { box-shadow: 6px 6px 0 var(--ink); }
.tele-playlist { flex: none; font-weight: 700; color: var(--stream-deep); max-width: 24ch; overflow: hidden; text-overflow: ellipsis; }
.tele-playlist-none { color: var(--text-faint); }
.log-empty p:last-child { margin-top: 0.4rem; margin-bottom: 0; }

/* Mono pagination */
.tele-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  margin-top: 1.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  flex-wrap: wrap;
}
.tele-pagination a { color: var(--text); padding: 0.6rem 0.2rem; }
.tele-pagination a:hover { color: var(--onair-deep); }
.tele-pagination .muted { color: var(--text-faint); padding: 0.6rem 0.2rem; }

.activity-pagination, .admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.activity-page-status { font-size: 0.82rem; font-family: var(--font-mono); }

/* ==========================================================================
   Admin panel — the operator view, typeset with the same tokens
   ========================================================================== */

.admin-tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 0;
  border: var(--line-2);
  background: var(--bg-elevated);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.admin-tab {
  background: none;
  border: none;
  padding: 0.7rem 1.1rem;
  min-height: 44px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.admin-tab + .admin-tab { border-left: var(--line-2); }
.admin-tab:hover { color: var(--text); background: var(--studio2); }
.admin-tab[aria-selected="true"] { color: var(--studio); background: var(--ink); }
.admin-tab:focus-visible { outline: 3px solid var(--stream); outline-offset: -3px; }

.admin-panel { box-shadow: 6px 6px 0 var(--ink); margin-bottom: 1.5rem; }
.admin-panel .panel-body { padding: 1rem 1.1rem 1.2rem; }

/* Ghost actions living inside an ink header bar */
.panel-head-btn {
  background: none;
  border: none;
  color: var(--studio);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
}
.panel-head-btn:hover { color: var(--thumb); }
.panel-head-switch { color: var(--studio); font-size: 0.68rem; font-family: var(--font-mono); }
.panel-head-switch .switch-track { background: var(--studio); }
.panel-head-switch input:checked + .switch-track { background: var(--thumb); }

.admin-toolbar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.admin-toolbar input[type="number"] { width: 160px; }
.admin-toolbar-switch { font-size: 0.85rem; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.admin-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: var(--line-2);
  white-space: nowrap;
}
.admin-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px dashed rgba(23, 19, 32, 0.25);
  vertical-align: middle;
  white-space: nowrap;
}
/* Row headers (th[scope=row]) are data, not chrome: undo the column-head voice
   but leave font-family alone so a .mono cell still reads as mono. */
.admin-table tbody th {
  font-size: inherit;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  padding: 0.55rem 0.75rem;
  border-bottom: 1px dashed rgba(23, 19, 32, 0.25);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: var(--bg-sunken); }
.admin-loading, .admin-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: normal !important;
}
.admin-error { color: var(--danger); }
.admin-error a { color: var(--danger); text-decoration: underline; }
.cell-error .badge { border-color: var(--danger); }
.cell-error { color: var(--danger); }
.admin-details {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.admin-row-actions { display: flex; gap: 0.4rem; }
.admin-row-actions .button { padding: 0.3rem 0.6rem; font-size: 0.64rem; box-shadow: 2px 2px 0 var(--ink); }

.tier-cell { display: flex; align-items: center; gap: 0.5rem; }
.admin-tier-select { width: auto; padding: 0.25rem 0.4rem; font-size: 0.8rem; }

.tier-badge { text-transform: uppercase; }
.tier-badge.tier-free { background: var(--bg-sunken); color: var(--text); }
.tier-badge.tier-paid { background: var(--thumb); color: var(--ink); }
.tier-badge.tier-org { background: var(--stream); color: var(--ink); }

.badge-status-ok { background: var(--ok-bg); color: var(--ok); }
.badge-status-error { background: var(--danger-bg); color: var(--danger); }

.conn-dot { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; }
.conn-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.conn-dot.conn-ok { color: var(--ok); }
.conn-dot.conn-warn { color: var(--warning); }
.conn-dot.conn-none { color: var(--text-faint); }

/* Quota chart — pure CSS bars */
.quota-chart-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 170px;
  padding-top: 1.6rem;
}
.quota-chart-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.quota-chart-bar-fill {
  position: relative;
  width: 100%;
  min-height: 2px;
  background: var(--stream);
  border: 2px solid var(--ink);
  border-bottom: none;
  transition: height var(--dur) var(--ease);
}
.quota-chart-bar-fill.quota-warn { background: var(--thumb); }
.quota-chart-bar-fill.quota-crit { background: var(--onair); }
.quota-chart-bar-fill::after {
  content: attr(data-value);
  position: absolute;
  top: -1.35rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.quota-chart-budget-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px dashed var(--ink);
}
.quota-chart-budget-tag {
  position: absolute;
  right: 0;
  bottom: 2px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--studio);
  padding: 0.15em 0.45em;
}
.quota-chart-labels { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.quota-chart-label { flex: 1; text-align: center; font-size: 0.65rem; color: var(--text-muted); }
.quota-chart-legend { margin-top: 1rem; }

/* Quota breakdowns — usage by purpose / method / user, under the day chart */
.quota-range { flex-wrap: wrap; }
.quota-range .button { padding: 0.35rem 0.7rem; font-size: 0.66rem; box-shadow: 2px 2px 0 var(--ink); }
.quota-range-btn[aria-pressed="true"] { background: var(--ink); color: var(--studio); }

.quota-section-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.quota-section { margin-top: 1.75rem; padding-top: 1.25rem; border-top: var(--line-2); }
.quota-section > h3.quota-section-label { margin: 0 0 0.35rem; color: var(--text); }
.quota-section .hint { margin-top: 0; }

/* The read/write split under the method table: the headline number on the
   page, so it reads as a summary rather than as another table row. */
.quota-section-note {
  margin: 0.6rem 0 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.quota-limits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.quota-limit {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  border: var(--line-2);
  box-shadow: 3px 3px 0 var(--ink);
}
.quota-limit-value { font-size: 0.95rem; font-weight: 700; color: var(--text); }

.quota-gauge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}
.quota-gauge-bar {
  flex: 1 1 160px;
  min-width: 120px;
  height: 10px;
  background: var(--bg-elevated);
  border: 2px solid var(--ink);
  overflow: hidden;
}
.quota-gauge-fill { height: 100%; background: var(--stream); transition: width var(--dur) var(--ease); }
.quota-gauge.quota-warn .quota-gauge-fill { background: var(--thumb); }
.quota-gauge.quota-crit .quota-gauge-fill { background: var(--onair); }
.quota-gauge-value { white-space: nowrap; font-size: 0.8rem; color: var(--text); }
.quota-gauge-note { font-size: 0.75rem; color: var(--text-muted); }

.quota-cell.quota-warn { color: var(--warning); font-weight: 700; }
.quota-cell.quota-crit { color: var(--danger); font-weight: 700; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 840px) {
  .topnav-marketing a:not(.button) { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; gap: 0.75rem; }
  .topnav { order: 3; flex-basis: 100%; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .header-actions { flex-wrap: wrap; }
}

/* ==========================================================================
   PLAYLIST EDITOR — greenlight card, two-pane editor, screening room
   (playlist_editor.html + the editor half of app.js). Built on the panel /
   vt / cav / tag / kicker primitives above.
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Panel head labels are real headings styled as bar labels */
.panel-head-label {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  margin: 0;
  color: inherit;
}
.panel-head-label::before { content: "\25CF  "; color: var(--onair); }
.panel-head-meta { display: inline-flex; align-items: center; gap: 0.7rem; }
.panel-dirty { color: var(--thumb); }
.panel-head-link { color: var(--studio); }
.panel-head-link:hover { color: var(--thumb); text-decoration: none; }
#filter-budget.over-budget { color: var(--thumb); }

/* Editor panels: standard 6px instrument shadow; screening room is hero */
.ed-panel { box-shadow: 6px 6px 0 var(--ink); margin-bottom: 2rem; }
.ed-panel .panel-body { padding: 1.1rem 1.2rem; }
.ed-hero { box-shadow: 10px 10px 0 var(--ink); }

.label-note {
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  text-transform: none;
}

.field-error { color: var(--danger); }
.field-error::before { content: "ERROR: "; font-family: var(--font-mono); font-weight: 700; }
input.is-invalid { border-color: var(--danger); }

/* Busy-state record dot inside buttons */
.busy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--onair);
  flex: none;
  animation: blink 1.4s steps(2, end) infinite;
}

/* Plan-limit / reconnect strip */
.plan-strip {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: var(--thumb);
  color: var(--ink);
  border: var(--line-2);
  padding: 0.55rem 0.8rem;
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
}
.plan-strip a { color: var(--ink); text-decoration: underline; }
.plan-strip-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--thumb);
  padding: 0.14em 0.45em;
  flex: none;
}

/* ---- create mode: the greenlight card ---- */

.greenlight-wrap { max-width: 640px; margin: 0 auto; }
.greenlight-headline { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 1.4rem; }
.greenlight-card { box-shadow: 6px 6px 0 var(--ink); }
.greenlight-card .panel-body { padding: 1.25rem 1.3rem 1.4rem; }

.ed-title-input {
  font-size: 1.25rem;
  font-weight: 600;
}

.attach-fieldset { border: none; padding: 0; margin: 0 0 1rem; }
.attach-fieldset legend {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0;
  margin-bottom: 0.4rem;
}
.form-row label.radio-card,
.radio-card {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  border: var(--line-2);
  background: var(--bg-elevated);
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
  /* undo the mono-uppercase .form-row label styling — this is body copy */
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
}
.radio-card:has(input:checked) { background: var(--studio); box-shadow: inset 4px 0 0 var(--thumb); }
.radio-card input { margin-top: 0.2rem; accent-color: var(--ink); }
.radio-card-copy { display: flex; flex-direction: column; gap: 0.1rem; }
.radio-card-title { font-weight: 700; }
.radio-card-sub { font-size: 0.8rem; color: var(--text-muted); }

/* The consent moment — the only recessed element on the card */
.consent-block {
  background: var(--studio2);
  border: var(--line-2);
  padding: 0.9rem 1rem;
  margin: 1.1rem 0;
}
.consent-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}
.consent-kicker::before { content: "\25CF "; color: var(--onair); }
.consent-copy { font-size: 0.86rem; margin: 0 0 0.7rem; }
.consent-check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.consent-check input { width: 18px; height: 18px; margin-top: 0.1rem; accent-color: var(--ink); flex: none; }
.consent-receipt { letter-spacing: 0.04em; }

.greenlight-foot { overflow: hidden; }
.ed-title-echo {
  display: block;
  font-size: 1.3rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.3rem;
}
@media (max-width: 600px) { .greenlight-foot { display: none; } }

/* ---- edit mode: masthead ---- */

.ed-masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.ed-masthead .kicker { margin-bottom: 0.4rem; }
.ed-show-title { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 0.5rem; overflow-wrap: anywhere; }
.ed-status-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}
.ed-yt-link { font-family: var(--font-mono); }

.badge-onair { background: var(--thumb); color: var(--ink); }
.badge-onair::before { content: "\25CF "; color: var(--onair); animation: blink 1.4s steps(2, end) infinite; }
.badge-offair { background: var(--studio2); color: var(--text-muted); }
.badge-lost { background: var(--bg-elevated); color: var(--danger); }

.button.ed-delete { color: var(--danger); }
.button.ed-delete:hover { background: var(--danger-bg); }

/* ---- two-pane grid ---- */

.editor-grid {
  display: grid;
  grid-template-columns: minmax(420px, 520px) 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}
.editor-rail { min-width: 0; }
/* The rail is its own formatting context, so the last panel's 2rem trailing
   margin does not collapse out -- it silently pads the rail's height, and the
   screening room (100% of that height) would end 2rem below the last panel's
   visible edge. Zero it; .editor-grid's own margin keeps the space below. */
.editor-rail > :last-child { margin-bottom: 0; }
/* The column stretches to the row height, which `contain: size` keeps pinned to
   the rail: the screening room's own (very tall) content no longer votes on how
   tall the row is, so `max-height: 100%` below can settle on the rail's height
   and both panes end on the same line. */
.screening-col {
  min-width: 0;
  align-self: stretch;
  contain: size;
}
/* No viewport cap: the room grows until it is as tall as the rail and only then
   scrolls inside. Sticky still pays off while the room is shorter than the rail;
   once it fills the column there is no slack left to travel. */
#screening-room {
  position: sticky;
  top: 1rem;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#screening-room .screening-body { overflow-y: auto; min-height: 0; }
@media (max-width: 900px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .screening-col { contain: none; }
  #screening-room { position: static; max-height: none; }
  #screening-room .screening-body { overflow-y: visible; }
}

/* ---- cast: source rows ---- */

.source-rows { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.source-rows:empty { margin-bottom: 0; }
.source-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: var(--line-2);
  background: var(--bg-elevated);
  padding: 0.45rem 0.55rem;
  animation: chip-in var(--dur) var(--ease);
}
.source-row.is-resolving { border-style: dashed; color: var(--text-muted); }
.source-row.is-failed { border-left: 6px solid var(--danger); color: var(--danger); }
.source-row.flash-dupe { animation: dupe-flash 0.9s var(--ease); }
@keyframes dupe-flash {
  0%, 100% { border-color: var(--ink); }
  30%, 70% { border-color: var(--thumb); box-shadow: 0 0 0 2px var(--thumb); }
}
.source-cav { width: 32px; height: 32px; font-size: 0.85rem; }
.source-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.source-row-title { font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row-kind {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-row-kind .rec::before { content: "\25CF "; color: var(--onair); }
.source-row-kind .rec-live::before { animation: blink 1.4s steps(2, end) infinite; display: inline-block; }
.source-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  flex: none;
  cursor: pointer;
}
.source-remove:hover { color: var(--danger); background: var(--danger-bg); }

.ed-empty {
  background: var(--studio2);
  border: var(--line-2);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
.ed-empty p { margin: 0; }
.ed-empty-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}
.ed-empty-label::before, p.ed-empty-label::before { content: "\25CF "; color: var(--onair); }

/* ---- standards & practices ---- */

/* Two groups, stated plainly: what lets a video in (combinable), and what
   throws it out (always, together). */
.filter-group { padding: 0 0 0.4rem; }
.filter-group + .filter-group { border-top: 2px solid var(--studio2); margin-top: 1.1rem; padding-top: 1.1rem; }
.filter-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 0.2rem;
}
.filter-group-label::before { content: "\25CF  "; color: var(--onair); }
.filter-group-cut .filter-group-label::before { color: var(--ink); }
.filter-group-sub { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 0.9rem; }

.match-mode-fieldset { margin-bottom: 1rem; }
.match-mode-fieldset[hidden] { display: none; }
.match-mode-note {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin: 0 0 0.9rem;
}

.cuts-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--studio);
  padding: 0.12em 0.4em;
  margin-left: 0.3rem;
  display: none;
  align-self: flex-start;
  width: fit-content;
}
.switch input:checked ~ .switch-copy .cuts-tag { display: inline-block; }
.switch-copy .cuts-tag { margin-left: 0; }

.chip.flash-dupe { animation: dupe-flash 0.9s var(--ease); }
.chip.chip-exclude { background: var(--ink); color: var(--studio); }
.chip.chip-exclude { text-decoration: line-through; }

/* ---- running order & air time ---- */

.radio-fieldset { border: none; padding: 0; margin: 0 0 1.25rem; }
.radio-fieldset legend {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0;
  margin-bottom: 0.4rem;
}
.radio-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.4rem 0.2rem;
  cursor: pointer;
  min-height: 44px;
  box-sizing: border-box;
}
.radio-row + .radio-row { border-top: 1px dashed rgba(23, 19, 32, 0.22); }
.radio-row input { margin-top: 0.25rem; accent-color: var(--ink); }
.radio-row-copy { display: flex; flex-direction: column; gap: 0.05rem; }
.radio-row-title { font-weight: 600; font-size: 0.92rem; }
.radio-row-sub { font-size: 0.78rem; color: var(--text-muted); }
.radio-row.is-locked { opacity: 0.55; cursor: not-allowed; }
.radio-cadence { font-size: 0.72rem; color: var(--text-muted); }
.lock-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border: 2px solid var(--ink);
  background: var(--bg-elevated);
  padding: 0.05em 0.35em;
  vertical-align: 1px;
}
.next-air-line { font-size: 0.74rem; color: var(--text-muted); letter-spacing: 0.04em; margin: 0.6rem 0 0; }

/* ---- the screening room ---- */

.screening-body { padding: 1.1rem 1.2rem; }

.ed-notice {
  background: var(--studio2);
  border: var(--line-2);
  padding: 0.6rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.screening-initial { text-align: center; padding: 1.5rem 1rem 1.75rem; }
.screening-placeholder { width: min(340px, 100%); margin: 0 auto 1.1rem; }
.screening-placeholder .dur {
  right: auto;
  bottom: auto;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}
.screening-initial p { max-width: 42ch; margin: 0 auto 1.25rem; color: var(--text-muted); }
.button[aria-disabled="true"] {
  background: var(--studio2);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}
.button[aria-disabled="true"]:hover { transform: none; box-shadow: none; }

/* Screenings run themselves off the free cache; this row explains that and
   offers the one control that actually costs quota. */
.screening-refresh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  border: var(--line-2);
  background: var(--bg-elevated);
  padding: 0.5rem 0.8rem;
  margin-bottom: 1rem;
}
.screening-refresh[hidden] { display: none; }
.screening-refresh-note {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.screening-refresh .button { flex: none; }

/* A source outran the per-sync page budget, so the playlist is only as
   complete as the window that was read. Warned, not errored: the screening
   above is still accurate for everything it did look at. */
.screening-window {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
  /* The detail is a sentence, not a micro-label: opt out of .ed-notice's
     uppercase mono and let it read as prose. */
  font-family: inherit;
  font-size: 0.82rem;
  letter-spacing: normal;
  text-transform: none;
}
.screening-window[hidden] { display: none; }
.screening-window-label {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* An auto re-run dims the previous screening in place instead of tearing the
   grid down to skeletons. */
#preview-results.is-stale .preview-summary,
#preview-results.is-stale .video-section,
#preview-results.is-stale .preview-excluded { opacity: 0.6; }

.ed-error {
  border: var(--line-2);
  border-left: 8px solid var(--danger);
  background: var(--bg-elevated);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.ed-error-label { color: var(--danger); font-weight: 700; letter-spacing: 0.1em; margin: 0 0 0.3rem; }
.ed-error p { margin: 0 0 0.6rem; }

/* summary strip: four mono stat chips, each an anchor button */
.summary-chip {
  border: 2px solid var(--ink);
  padding: 0.32rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.summary-chip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.summary-chip.add { background: var(--thumb); color: var(--ink); }
.summary-chip.remove { color: var(--danger); }
.summary-chip.cut { background: var(--ink); color: var(--studio); }

.video-grid-dense {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
}
.video-grid-dense .video-card-title { font-size: 0.72rem; }
.video-grid-dense .video-card-channel { font-size: 0.64rem; }
.video-grid-dense .video-card-published { font-size: 0.6rem; }

.cut-summary-h { display: inline; font-size: 1rem; margin: 0; }
details.preview-excluded .video-grid { margin-top: 0.75rem; }

.show-all { grid-column: 1 / -1; justify-self: start; }

/* the one orchestrated moment: preview cards scale in from the left */
.video-card.card-in {
  animation: card-in 0.35s var(--ease) backwards;
  transform-origin: left center;
}
@keyframes card-in {
  from { opacity: 0; transform: scaleX(0.6); }
  to { opacity: 1; transform: scaleX(1); }
}

/* ---- broadcast log: teletype (admin /activity page) ---- */

.log-body { background: var(--studio2); }
.tele-log { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 0.76rem; overflow-x: auto; }
.tele-line {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.28rem 0.2rem;
  white-space: nowrap;
}
.tele-line:nth-child(even) { background: rgba(23, 19, 32, 0.04); }
.tele-ts { color: var(--text-muted); flex: none; }
.tele-sig { font-weight: 700; width: 1.1em; flex: none; }
.tele-add .tele-sig { color: var(--ok); }
.tele-rm .tele-sig { color: var(--danger); }
.tele-sync .tele-sig { color: var(--onair); }
.tele-action { font-weight: 700; letter-spacing: 0.04em; flex: none; min-width: 15ch; }
.tele-detail { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }

/* ---- dialogs: instrument-styled <dialog> ---- */

.app-dialog {
  border: var(--line);
  padding: 0;
  max-width: 460px;
  width: calc(100% - 2.5rem);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 10px 10px 0 var(--ink);
}
.app-dialog::backdrop { background: rgba(23, 19, 32, 0.55); }
.app-dialog .panel-head { justify-content: flex-start; }
.app-dialog-body { padding: 1.1rem 1.2rem 0.4rem; font-size: 0.92rem; }
.app-dialog-body p { margin: 0 0 0.7rem; }
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  padding: 0.9rem 1.2rem 1.2rem;
}
.app-dialog .button.pink:disabled { background: var(--studio2); color: var(--text-muted); box-shadow: none; }
@media (max-width: 600px) {
  .app-dialog {
    margin: auto 0 0;
    max-width: none;
    width: 100%;
    box-shadow: none;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
}

/* ---- mobile sticky bottom bar ---- */

.mobile-preview-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--ink);
  color: var(--studio);
  border-top: var(--line);
  padding: 0.6rem 1rem;
  font-size: 0.78rem;
}
.mobile-preview-bar[hidden] { display: none; }
.mobile-preview-bar .button { box-shadow: none; }
@media (min-width: 900px) { .mobile-preview-bar { display: none; } }

/* ==========================================================================
   Motion preference — everything airs settled
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .lineup-row-new { animation: none; }
  .lineup-live::before { animation: none; }
  .panel-head .rec-live::before { animation: none; }
}

/* ==========================================================================
   Per-source rules & fixed group order (cast reorder arrows, scoped
   filter rows, "Removed by you" tombstone panel)
   ========================================================================== */

/* Cast order: up/down arrows on each source row. Same 44px hit area and
   quiet-until-hover treatment as .source-remove; no radius, no shadow. */
.source-move-controls { display: inline-flex; flex: none; }
.source-move {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  width: 38px;
  height: 44px;
  flex: none;
  cursor: pointer;
}
.source-move:hover { color: var(--text); background: var(--studio2); }

.cast-order-hint {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: -0.4rem 0 1rem;
}

/* Scoped filter rows: the "Applies to" select in the raw rule editor. */
.filter-row select.filter-source { width: auto; min-width: 150px; max-width: 240px; flex: none; }

/* Removed by you: tombstone rows mirror the cast rows' anatomy. */
.suppressed-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.suppressed-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: var(--line-2);
  background: var(--bg-elevated);
  padding: 0.45rem 0.55rem;
}
.suppressed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.suppressed-title {
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: line-through; /* the CUT treatment in miniature: struck while suppressed */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suppressed-meta {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suppressed-row .restore-suppressed { flex: none; padding: 0.4rem 0.8rem; font-size: 0.82rem; }

/* ---- plan caps: the cast is limited per plan ---- */

/* Same warning colour the filter budget uses when it runs out. */
#source-count.at-cap { color: var(--thumb); }

/* At the cap the add-source form is closed, not hidden: it stays legible,
   with the reason on the plan strip right below it. */
.inline-form.is-capped { opacity: 0.55; }
.inline-form.is-capped input,
.inline-form.is-capped select { cursor: not-allowed; }

/* ---- forced re-fetch cooling down ---- */

/* The one quota-spending control is rate limited; while it counts itself
   back in it wears the mono micro-label treatment of the row it sits in. */
#preview-refetch.is-cooling {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- a sync that stopped at its quota ceiling ---- */

/* Not an error: real work was applied and the playlist is consistent, just
   not fully caught up. Warning colours, not danger. */
.ed-error.is-quota {
  border-left-color: var(--warning);
  background: var(--warning-bg);
  color: var(--ink);
}
.ed-error.is-quota .ed-error-label { color: var(--warning); }
