/* ─── Cue Room page styles ────────────────────────────────────
   Built on tokens.css + shell.css.
   Brief 3: video left (50%), cue list right (50%), nothing else. */

/* ── Page split ─────────────────────────────────────────────── */
.cr-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  flex: 1 1 auto;
  background: var(--bg-app);
  overflow: hidden;
}
.cr-page > section { min-width: 0; min-height: 0; }

/* ── LEFT: Video panel ─────────────────────────────────────── */
.cr-video {
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
  min-height: 0;
}

.cr-frame-wrap {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 8px;
  min-height: 0;
}

/* Faux film-frame: deep room with a single off-screen practical
   light catching the right side. Keeps "The Quiet Hours" mood
   without inventing illustrative SVG. */
.cr-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: 100%;
  background:
    radial-gradient(ellipse 60% 80% at 78% 38%,
                    rgba(220,196,158,0.18) 0%,
                    rgba(170,138,98,0.07) 22%,
                    rgba(0,0,0,0) 55%),
    radial-gradient(ellipse 35% 25% at 22% 90%,
                    rgba(53,197,199,0.04) 0%,
                    rgba(0,0,0,0) 60%),
    linear-gradient(180deg, #0a0c0e 0%, #060708 100%);
  border: 1px solid #050606;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.025),
    inset 0 -1px 0 rgba(0,0,0,0.6),
    0 8px 28px rgba(0,0,0,0.55);
  overflow: hidden;
  border-radius: 1px;
}

/* faint window slats — vertical bars hinting at blinds */
.cr-frame::before {
  content: "";
  position: absolute;
  top: 8%;
  right: 14%;
  width: 26%;
  height: 60%;
  background:
    repeating-linear-gradient(180deg,
      rgba(220,196,158,0.05) 0,
      rgba(220,196,158,0.05) 4px,
      rgba(0,0,0,0) 4px,
      rgba(0,0,0,0) 10px);
  filter: blur(0.4px);
  opacity: 0.7;
  pointer-events: none;
}

/* very subtle vignette */
.cr-frame::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 40%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}

/* Broadcast burn-in overlay corners */
.cr-burnin {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
  color: rgba(220,224,232,0.78);
  background: rgba(0,0,0,0.42);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 2px;
  backdrop-filter: blur(2px);
  z-index: 2;
}
.cr-burnin.tl { top: 10px; left: 10px; }
.cr-burnin.tr { top: 10px; right: 10px; }
.cr-burnin.br { bottom: 10px; right: 10px; }
.cr-burnin.bl { bottom: 10px; left: 10px; }

.cr-burnin .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #c34e4e;
  box-shadow: 0 0 5px rgba(195,78,78,0.6);
}
.cr-burnin .lab {
  font-size: 9px; letter-spacing: 0.18em;
  color: rgba(180,184,192,0.7);
  text-transform: uppercase;
}
.cr-burnin .v { color: rgba(235,237,240,0.92); }

/* Center pause glyph - very subtle */
.cr-paused {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
  z-index: 2;
}
.cr-paused svg { color: rgba(235,237,240,0.86); }

/* Safe-action thirds guides (very faint) */
.cr-guides {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
.cr-guides::before,
.cr-guides::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,0.025);
}
.cr-guides::before {
  left: 0; right: 0; top: 33.33%; height: 1px;
  box-shadow: 0 33.33vh 0 rgba(255,255,255,0.025);
}

/* ── Transport bar (below video) ───────────────────────────── */
.cr-transport {
  flex: 0 0 auto;
  padding: 14px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #0c0e10 0%, #0a0c0e 100%);
  border-top: 1px solid var(--line-soft);
}

.cr-transport-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cr-tc-big {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 14px 6px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  box-shadow: var(--inset-input);
}
.cr-tc-big .tc {
  font: 600 22px/1 var(--mono);
  letter-spacing: 0.02em;
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
}
.cr-tc-big .frames {
  font: 500 11px/1 var(--mono);
  color: var(--teal);
  letter-spacing: 0.04em;
}
.cr-tc-big .fps {
  font: 500 9px/1 var(--ui);
  letter-spacing: 0.18em;
  color: var(--fg-dim);
  text-transform: uppercase;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  margin-left: 2px;
}

.cr-trans-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cr-trans-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--btn-grad);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  color: var(--fg);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}
.cr-trans-btn:hover { background: var(--btn-grad-h); border-color: var(--line-strong); }
.cr-trans-btn.play {
  width: 40px; height: 40px;
  color: var(--teal);
  border-color: var(--teal-line);
  background: var(--teal-bg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 0 14px var(--teal-glow);
}
.cr-trans-btn.play svg { transform: translateX(1px); }

.cr-trans-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 10px/1 var(--ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.cr-trans-status .nt-kbd { letter-spacing: 0; }
.cr-trans-status .sep { width: 1px; height: 12px; background: var(--line); }

/* Scrub bar ── ── */
.cr-scrub {
  position: relative;
  height: 28px;
}
.cr-scrub-track {
  position: absolute;
  left: 0; right: 0; top: 12px;
  height: 4px;
  background: var(--bg-sub);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.cr-scrub-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg,
    rgba(53,197,199,0.32) 0%,
    rgba(53,197,199,0.55) 100%);
}
.cr-scrub-ticks {
  position: absolute;
  left: 0; right: 0; top: 19px;
  height: 9px;
}
.cr-scrub-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 6px;
  background: var(--fg-dim);
  opacity: 0.55;
}
.cr-scrub-tick.active {
  background: var(--teal);
  height: 9px;
  width: 2px;
  margin-left: -1px;
  box-shadow: 0 0 6px var(--teal-glow);
  opacity: 1;
}
.cr-scrub-time {
  position: absolute;
  top: 0;
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--fg-faint);
  transform: translateX(-50%);
}
.cr-scrub-playhead {
  position: absolute;
  top: 4px; bottom: 0;
  width: 2px;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal-glow);
  pointer-events: none;
}
.cr-scrub-playhead::before {
  content: "";
  position: absolute;
  top: -3px; left: -4px;
  width: 10px; height: 10px;
  background: var(--teal);
  border: 1.5px solid #060708;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--teal-glow);
}

/* Picture version selector (below transport) */
.cr-version {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px 14px;
  background: linear-gradient(180deg, #0a0c0e 0%, #08090b 100%);
  border-top: 1px solid var(--line-soft);
  font: 500 11px/1 var(--ui);
  color: var(--fg-mute);
}
.cr-version-trig {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px 6px 8px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.cr-version-trig:hover { border-color: var(--line-strong); }
.cr-version-trig .v {
  font: 600 11px/1 var(--mono);
  color: var(--fg);
  letter-spacing: 0.04em;
}
.cr-version-trig .t {
  font: 500 11px/1 var(--ui);
  color: var(--fg);
  letter-spacing: 0.01em;
}
.cr-version-trig .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--st-resolved);
  box-shadow: 0 0 5px rgba(122,154,134,0.4);
}
.cr-version-meta {
  font: 500 10px/1 var(--mono);
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}
.cr-version-meta .sep { color: var(--fg-faint); margin: 0 7px; }
.cr-version-meta .nt-mono { color: var(--fg-mute); }

.cr-version .reel-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--fg-mute);
}
.cr-version .reel-badge .lab {
  font: 500 9px/1 var(--ui);
  letter-spacing: 0.16em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

/* ── RIGHT: Cue list panel ─────────────────────────────────── */
.cr-cues {
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  min-height: 0;
}

/* Add-cue inline input (top, sticky) */
.cr-cue-add {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}
.cr-cue-add .tc-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: 32px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--teal);
  border-radius: var(--r-btn);
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.02em;
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
}
.cr-cue-add .tc-stamp .lb {
  font: 500 9px/1 var(--ui);
  letter-spacing: 0.18em;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.cr-cue-add .nt-input {
  flex: 1;
  border-color: var(--teal-line);
  box-shadow:
    inset 0 1px 1px rgba(0,0,0,0.45),
    0 0 0 1px var(--teal-line),
    0 0 12px var(--teal-glow);
}
.cr-cue-add .nt-input input {
  color: var(--fg);
}
.cr-cue-add .nt-input input::placeholder {
  color: var(--fg-dim);
}
.cr-cue-add .hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10px/1 var(--ui);
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}
.cr-cue-add .hint .nt-kbd { padding: 0 6px; }
.cr-cue-add .add-btn {
  height: 32px;
  padding: 0 12px;
}

/* Cue list */
.cr-list {
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cr-cue-row {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 13px 18px 13px 18px;
  background: var(--bg-row);
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--t-fast);
  cursor: pointer;
}
.cr-cue-row:hover { background: var(--bg-row-hover); }

.cr-cue-row .tc {
  font: 600 12px/1.3 var(--mono);
  color: var(--fg-strong);
  letter-spacing: 0.02em;
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
}

.cr-cue-row .text {
  font: 400 13px/1.4 var(--ui);
  color: var(--fg);
  letter-spacing: -0.005em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  text-wrap: pretty;
}

.cr-cue-row .meta {
  font: 500 10px/1 var(--mono);
  color: var(--fg-faint);
  letter-spacing: 0.06em;
  padding-top: 4px;
  white-space: nowrap;
}

/* Active cue (synced to playhead) */
.cr-cue-row.active {
  background: var(--bg-row-sel);
}
.cr-cue-row.active::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal-glow);
}
.cr-cue-row.active .tc {
  color: var(--teal);
}
.cr-cue-row.active .text {
  color: var(--fg-strong);
}
.cr-cue-row.active .meta {
  color: var(--teal);
  opacity: 0.7;
}
.cr-cue-row.active .seek-glyph {
  opacity: 1;
}
.cr-cue-row .seek-glyph {
  opacity: 0;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  transition: opacity var(--t-fast);
  margin-top: 1px;
}
.cr-cue-row:hover .seek-glyph { opacity: 0.5; }

/* Footer: cue count */
.cr-cue-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: 32px;
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  font: 500 11px/1 var(--mono);
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}
.cr-cue-foot .l { display: inline-flex; align-items: center; gap: 8px; }
.cr-cue-foot .l .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal-glow);
}
.cr-cue-foot .r {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--fg-faint);
}
.cr-cue-foot .r .sep { color: var(--fg-faint); }

/* ────────────────────────────────────────────────────────────
   MOBILE
   ──────────────────────────────────────────────────────────── */

.ss-app.mobile .cr-page {
  display: flex;
  flex-direction: column;
}

.ss-app.mobile .cr-video {
  flex: 0 0 auto;
  border-right: none;
  border-bottom: 1px solid var(--line);
}
.ss-app.mobile .cr-frame-wrap {
  padding: 10px 12px 6px;
}
.ss-app.mobile .cr-transport {
  padding: 10px 14px;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
}
.ss-app.mobile .cr-transport .cr-trans-btn {
  width: 36px; height: 36px;
}
.ss-app.mobile .cr-transport .cr-trans-btn.play {
  width: 40px; height: 40px;
}
.ss-app.mobile .cr-transport .cr-tc-big {
  flex: 1;
  justify-content: center;
  padding: 6px 10px;
}
.ss-app.mobile .cr-transport .cr-tc-big .tc {
  font-size: 16px;
}
.ss-app.mobile .cr-transport .cr-tc-big .frames { font-size: 10px; }
.ss-app.mobile .cr-transport .cr-tc-big .fps { font-size: 8px; }

.ss-app.mobile .cr-mobile-scrub {
  padding: 0 14px 10px;
  background: linear-gradient(180deg, #0a0c0e 0%, #08090b 100%);
}

.ss-app.mobile .cr-cues {
  flex: 1 1 auto;
  min-height: 0;
}
.ss-app.mobile .cr-list { overflow-y: auto; }
.ss-app.mobile .cr-cue-row {
  grid-template-columns: 92px 1fr;
  padding: 11px 14px;
  gap: 10px;
}
.ss-app.mobile .cr-cue-row .meta { display: none; }
.ss-app.mobile .cr-cue-row .tc { font-size: 11px; }
.ss-app.mobile .cr-cue-row .text { font-size: 13px; }
.ss-app.mobile .cr-cue-row .seek-glyph { display: none; }

/* Sticky add-cue at bottom for mobile */
.ss-app.mobile .cr-cue-add {
  order: 2;
  border-top: 1px solid var(--line);
  border-bottom: none;
  background: var(--bg-deep);
  padding: 10px 12px;
  gap: 8px;
}
.ss-app.mobile .cr-cue-add .tc-stamp {
  height: 36px;
  padding: 0 9px;
  font-size: 11px;
}
.ss-app.mobile .cr-cue-add .tc-stamp .lb { display: none; }
.ss-app.mobile .cr-cue-add .nt-input { height: 36px; }
.ss-app.mobile .cr-cue-add .nt-input input { font-size: 12px; }
.ss-app.mobile .cr-cue-add .hint { display: none; }
.ss-app.mobile .cr-cue-add .add-btn {
  width: 36px; height: 36px; padding: 0;
  justify-content: center;
}

.ss-app.mobile .cr-cue-list-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.ss-app.mobile .cr-cue-foot {
  height: 28px;
  font-size: 10px;
}
