/* ==========================================================================
   THE PRODUCT YOUTUBE — Frameless Architectural Cinema System (v3)
   Warm gallery alabaster, carbon ink, signal vermilion, zero boxed cards.
   Typography: Bricolage Grotesque + IBM Plex Sans + IBM Plex Mono.
   ========================================================================== */

:root {
  --bg: #F4F2EC;
  --bg-elevated: #FAF9F6;
  --bg-recessed: #EAE7DF;
  --ink: #111110;
  --ink-2: #4A4843;
  --ink-3: #848078;
  --rule: rgba(17, 17, 16, 0.11);
  --rule-strong: rgba(17, 17, 16, 0.24);
  --signal: #D9381E;
  --signal-hover: #B82B14;

  --theater-bg: #0C0C0B;
  --theater-panel: #141413;
  --theater-rule: rgba(255, 255, 255, 0.10);
  --theater-ink: #F2F0EA;
  --theater-muted: #938F86;

  --font-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

button:focus,
a:focus,
input:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.mono-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ==================== TOP BAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  max-width: 1380px;
  margin: 0 auto;
  height: 62px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: auto minmax(260px, 460px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
}

.brand-mark {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  background: var(--signal);
  position: relative;
  flex-shrink: 0;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  border-style: solid;
  border-width: 3px 0 3px 5.5px;
  border-color: transparent transparent transparent #FFFFFF;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

/* GLOBAL COMMAND SEARCH */
.cmd-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.cmd-search:focus-within {
  border-color: var(--ink);
  background: #FFFFFF;
}

.cmd-icon {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
}

.cmd-input::placeholder {
  color: var(--ink-3);
}

.cmd-clear {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
}

.cmd-clear:hover {
  color: var(--ink);
}

.cmd-kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  padding: 1px 5px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  line-height: 1.3;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

.mode-btn {
  height: 62px;
  background: none;
  border: none;
  padding: 0 2px;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.mode-btn:hover {
  color: var(--ink);
}

.mode-btn.is-active {
  color: var(--ink);
  font-weight: 600;
}

.mode-btn.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--signal);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--rule);
}

.ghost-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.ghost-link:hover {
  color: var(--ink);
}

.ghost-link.is-syncing {
  color: var(--signal);
}

/* ==================== MAIN CANVAS ==================== */
.canvas {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 32px 96px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

/* ==================== FILTER & SORT BAR ==================== */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 28px;
  padding-bottom: 18px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.topic-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
}

.topic-btn {
  background: none;
  border: none;
  padding: 4px 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  position: relative;
  transition: color 0.14s ease;
}

.topic-btn:hover {
  color: var(--ink);
}

.topic-btn.is-active {
  color: var(--ink);
  font-weight: 600;
}

.topic-btn.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--ink);
}

.topic-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 4px;
  opacity: 0.78;
}

.sort-rail {
  display: flex;
  align-items: center;
  gap: 14px;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: var(--bg-recessed);
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.chip-x {
  background: none;
  border: none;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
}

.chip-x:hover {
  color: var(--ink);
}

.sort-switch,
.pacing-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-recessed);
  padding: 3px;
  border-radius: 5px;
}

.sort-tab {
  background: none;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.sort-tab:hover {
  color: var(--ink);
}

.sort-tab.is-active {
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(17, 17, 16, 0.08);
}

/* ==================== SEARCH BANNER & MARATHON HANDOFF ==================== */
.search-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 0 0 18px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.search-banner-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.search-status {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.inline-clear {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-clear:hover {
  color: var(--ink);
}

.handoff-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.handoff-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.handoff-picks,
.time-presets {
  display: inline-flex;
  gap: 5px;
  flex-wrap: wrap;
}

.dur-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.dur-pill:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.dur-pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

/* ==================== EDITORIAL LEAD FEATURE PLATE ==================== */
.lead-feature {
  display: grid;
  grid-template-columns: 1.38fr 1fr;
  gap: 36px;
  align-items: center;
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}

.lead-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #171715;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 16, 0.08);
}

.lead-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-thumb:hover img {
  transform: scale(1.022);
}

.lead-play-cue {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(17, 17, 16, 0.88);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  transition: background 0.15s ease;
}

.lead-thumb:hover .lead-play-cue {
  background: var(--signal);
}

.lead-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 10px;
}

.lead-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.025em;
  color: var(--ink);
  cursor: pointer;
}

.lead-title:hover {
  color: var(--signal);
}

.lead-byline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--ink-2);
}

.lead-synopsis {
  margin: 0 0 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

/* ==================== FRAMELESS EDITORIAL CINEMA GRID ==================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 38px 26px;
}

.video-plate {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.plate-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #1A1A18;
  margin-bottom: 12px;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 16, 0.08);
}

.plate-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-plate:hover .plate-thumb img {
  transform: scale(1.03);
}

.dur-tag {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(17, 17, 16, 0.88);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.plate-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.14s ease;
}

.video-plate:hover .plate-title {
  color: var(--signal);
}

.plate-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.creator-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator-btn:hover {
  color: var(--signal);
}

.plate-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.plate-date.is-focused {
  color: var(--signal);
  font-weight: 500;
}

.plate-signal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.micro-ratio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.micro-bar {
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: rgba(217, 56, 30, 0.25);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.micro-bar-fill {
  display: block;
  height: 100%;
  background: var(--ink);
}

.metric-val.is-focused {
  color: var(--ink);
  font-weight: 500;
}

.load-footer {
  margin-top: 48px;
  text-align: center;
}

/* ==================== BUTTONS ==================== */
.signal-btn {
  background: var(--signal);
  border: 1px solid var(--signal);
  color: #FFFFFF;
  border-radius: 5px;
  padding: 9px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.signal-btn:hover {
  background: var(--signal-hover);
  border-color: var(--signal-hover);
}

.signal-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.hairline-btn {
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  border-radius: 5px;
  padding: 8px 15px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hairline-btn:hover {
  border-color: var(--ink);
  background: var(--bg-elevated);
}

.dark-hairline-btn {
  background: transparent;
  border: 1px solid var(--theater-rule);
  color: var(--theater-ink);
  border-radius: 5px;
  padding: 7px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}

.dark-hairline-btn:hover:not(:disabled) {
  border-color: var(--theater-ink);
}

.dark-hairline-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 72px 20px;
  text-align: center;
}

.empty-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.empty-copy {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ==================== MARATHON STUDIO (UNBOXED COMPOSER + FILM-STRIP RULER) ==================== */
.studio-composer {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px 56px;
  padding: 10px 0 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.composer-kicker {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.composer-kicker-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.studio-topic-input {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 2px solid var(--ink);
  padding: 4px 0 10px;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.studio-topic-input:focus {
  border-bottom-color: var(--signal);
}

.studio-topic-input::placeholder {
  color: var(--ink-3);
  font-weight: 400;
}

.studio-quick-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 14px;
}

.text-chip {
  background: none;
  border: none;
  padding: 2px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.14s ease;
}

.text-chip:hover {
  color: var(--signal);
}

.clock-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.clock-display {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.precision-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--rule-strong);
  margin: 8px 0 20px;
  cursor: pointer;
}

.precision-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--signal);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--signal);
  cursor: pointer;
  transition: transform 0.14s ease;
}

.precision-slider::-webkit-slider-thumb:hover {
  transform: scale(1.16);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* MARATHON PROGRAM & TIME-BLOCK TAPE */
.program-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.program-heading {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.program-meta-line {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.program-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* PROPORTIONAL TIME-BLOCK TAPE RULER */
.tape-deck {
  margin-bottom: 32px;
}

.tape-blocks {
  display: flex;
  gap: 4px;
  min-height: 54px;
}

.tape-seg {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 11px;
  border-radius: 4px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-elevated);
  text-align: left;
  cursor: pointer;
  min-width: 68px;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tape-seg:hover,
.tape-seg.is-hovered {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

.tape-seg:hover .tape-seg-sub,
.tape-seg.is-hovered .tape-seg-sub {
  color: rgba(255, 255, 255, 0.72);
}

.tape-seg-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.tape-seg-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tape-spare {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px dashed var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  padding: 0 6px;
  min-width: 42px;
}

.tape-ruler {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* FRAMELESS MARATHON ROWS */
.program-list {
  display: flex;
  flex-direction: column;
}

.program-row {
  display: grid;
  grid-template-columns: 104px 210px 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  transition: background 0.14s ease;
}

.program-row:last-child {
  border-bottom: 1px solid var(--rule);
}

.row-timecode {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row-index {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
}

.row-window {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.row-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  overflow: hidden;
  background: #171715;
  cursor: pointer;
}

.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.32s ease;
}

.row-thumb:hover img {
  transform: scale(1.03);
}

.row-info {
  min-width: 0;
}

.row-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  cursor: pointer;
}

.row-title:hover {
  color: var(--signal);
}

.row-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.row-tags {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==================== THEATER & SCREENING ROOM MODALS ==================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 11, 0.82);
}

.theater-sheet,
.screening-room,
.charter-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 6px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.theater-sheet {
  max-width: 960px;
  background: var(--bg-elevated);
}

.screening-room {
  max-width: 1260px;
  background: var(--theater-bg);
  border: 1px solid var(--theater-rule);
  color: var(--theater-ink);
}

.charter-sheet {
  max-width: 680px;
  background: var(--bg-elevated);
}

.theater-bar,
.charter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
}

.theater-bar {
  background: var(--theater-bg);
  border-bottom: 1px solid var(--theater-rule);
  color: var(--theater-ink);
}

.charter-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.theater-bar-left,
.theater-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theater-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
}

.theater-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--theater-muted);
  font-variant-numeric: tabular-nums;
}

.theater-close {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--theater-muted);
  cursor: pointer;
}

.theater-close:hover {
  color: #FFFFFF;
}

.player-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.theater-details {
  padding: 22px 26px 28px;
}

.theater-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.theater-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.theater-byline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theater-creator {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.theater-creator:hover {
  color: var(--signal);
}

.dot {
  color: var(--ink-3);
}

.theater-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.theater-signal {
  padding: 12px 0 14px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
}

.theater-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 9px;
}

.theater-metrics strong {
  color: var(--ink);
}

.signal-bar-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(217, 56, 30, 0.24);
  overflow: hidden;
}

.signal-bar-fill {
  height: 100%;
  background: var(--ink);
}

.theater-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre-line;
  max-height: 180px;
  overflow-y: auto;
}

/* SCREENING ROOM LAYOUT */
.autoplay-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--theater-muted);
  cursor: pointer;
  user-select: none;
}

.autoplay-check input {
  accent-color: var(--signal);
  cursor: pointer;
}

.screening-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
}

.screening-main {
  border-right: 1px solid var(--theater-rule);
  display: flex;
  flex-direction: column;
}

.screening-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--theater-panel);
}

.screening-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--theater-ink);
}

.screening-nav {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.screening-queue {
  display: flex;
  flex-direction: column;
  background: var(--theater-bg);
  max-height: 78vh;
}

.queue-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--theater-rule);
}

.queue-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--theater-muted);
}

.queue-items {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

.queue-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--theater-rule);
  cursor: pointer;
  transition: background 0.14s ease;
}

.queue-item:hover {
  background: var(--theater-panel);
}

.queue-item.is-playing {
  background: var(--theater-panel);
  box-shadow: inset 3px 0 0 var(--signal);
}

.queue-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--theater-muted);
  padding-top: 2px;
}

.queue-item.is-playing .queue-num {
  color: var(--signal);
  font-weight: 500;
}

.queue-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.28;
  color: var(--theater-ink);
  margin-bottom: 3px;
}

.queue-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--theater-muted);
}

.complete-screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(12, 12, 11, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
}

.complete-heading {
  margin: 10px 0 6px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #FFFFFF;
}

.complete-btns {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* CHARTER MODAL */
.charter-body {
  padding: 24px 28px 28px;
}

.charter-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.charter-principle {
  margin: 0 0 20px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.charter-section {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--rule);
}

.charter-pillars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink);
}

.charter-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--ink-2);
}

.charter-list li {
  margin-bottom: 5px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  background: var(--ink);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1080px) {
  .topbar-inner {
    grid-template-columns: auto 1fr auto;
  }
  .topbar-meta {
    display: none;
  }
  .lead-feature,
  .studio-composer,
  .screening-grid {
    grid-template-columns: 1fr;
  }
  .screening-main {
    border-right: none;
    border-bottom: 1px solid var(--theater-rule);
  }
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .program-row {
    grid-template-columns: 84px 168px 1fr;
  }
  .row-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    height: auto;
    padding: 12px 16px;
    gap: 10px;
  }
  .cmd-search {
    grid-column: 1 / -1;
    order: 3;
  }
  .mode-btn {
    height: 36px;
  }
  .canvas {
    padding: 18px 16px 72px;
  }
  .video-grid {
    grid-template-columns: 1fr;
  }
  .studio-topic-input {
    font-size: 26px;
  }
  .program-row {
    grid-template-columns: 1fr;
  }
  .tape-blocks {
    flex-direction: column;
  }
  .theater-head {
    flex-direction: column;
  }
}
