/* Codex-NOTE: isolate horizontal overflow to the track; the phone page itself must remain 375px wide. */
#film-timeline { min-width: 0; margin: 16px 0; }
.timeline-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.timeline-tools label { display: flex; gap: 6px; align-items: center; }
.timeline-tools input { width: 120px; }
.timeline-scroll { overflow-x: auto; max-width: 100%; padding: 18px 0 6px; overscroll-behavior-x: contain; }
.timeline-track { display: flex; align-items: stretch; width: max-content; gap: 3px; padding: 2px; }
.timeline-clip { position: relative; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 2px solid var(--phase-color, #777); border-radius: 5px; background: var(--panel); box-sizing: border-box; min-height: 150px; }
.timeline-clip.selected { outline: 2px solid var(--text); outline-offset: 1px; }
.timeline-clip strong, .timeline-clip span:not(.timeline-clock) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.timeline-clip img { width: 100%; height: 48px; object-fit: cover; }
.timeline-placeholder { min-height: 48px; }
.timeline-clock { position: absolute; top: -20px; left: 0; font-size: 11px; }
.trim-edge { position: absolute; top: 0; bottom: 0; width: 12px; border: 0; background: color-mix(in srgb, var(--phase-color) 35%, transparent); cursor: ew-resize; touch-action: none; padding: 0; }
.trim-edge.start { left: 0; } .trim-edge.end { right: 0; }
.trim-edge:disabled { opacity: 0; cursor: default; }
.phase-original { --phase-color: #929292; } .phase-queued { --phase-color: #6caaff; } .phase-sent { --phase-color: #b0a37a; }
.phase-rendering { --phase-color: #f7c64b; } .phase-publishing { --phase-color: #c08aff; }
.phase-ready { --phase-color: #49d7cf; } .phase-question { --phase-color: #ff9b50; }
.phase-approved { --phase-color: #6cdb8a; } .phase-chopped { --phase-color: #f37474; }
.scene-card[class*="phase-"] { border-left: 3px solid var(--phase-color); box-shadow: inset 3px 0 12px -7px var(--phase-color); }
.phase-chopped.timeline-clip { opacity: .55; }
.phase-rendering.timeline-clip, .scene-card.phase-rendering { animation: phase-pulse 1.6s ease-in-out infinite; }
@keyframes phase-pulse { 50% { box-shadow: 0 0 10px var(--phase-color); } }
@media (prefers-reduced-motion: reduce) { .phase-rendering.timeline-clip, .scene-card.phase-rendering { animation: none; } }
.phase-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 11px; margin: 8px 0; }
.phase-legend span { border-bottom: 2px solid var(--phase-color); }
.progress-controls { grid-column: 1 / -1; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; display: grid; gap: 6px; }
#film-inspector { position: fixed; z-index: 90; right: 8px; top: 8px; bottom: 8px; width: min(720px, 70vw); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: auto; padding: 12px; box-shadow: 0 0 30px #0009; }
#film-inspector[hidden] { display: none; }
#film-inspector .scene-viewer-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
#film-inspector .stage-col, #film-inspector .inspector { min-width: 0; }
#film-inspector .stage-col { position: static; }
#film-inspector .timeline-tools { position: sticky; top: -12px; background: var(--panel); z-index: 2; padding: 8px 0; }
#timeline-export-warning { overflow-wrap: anywhere; font-size: 12px; }
@media (max-width: 600px) {
  #film-inspector { top: auto; bottom: 0; right: 0; width: 100%; height: 78dvh; box-sizing: border-box; border-radius: 14px 14px 0 0; }
  .film-shell, .film-layout, .film-layout > div { min-width: 0; max-width: 100%; }
  .timeline-tools button { min-height: 44px; }
}

/* CLAUDE-NOTE (Ilyas 2026-10-16): the clip playing in the film player blinks softly (gold glow). */
.timeline-clip.playing { animation: timeline-playing 1.4s ease-in-out infinite alternate; outline: 2px solid var(--gold, #d4a640); outline-offset: 1px; }
@keyframes timeline-playing { from { box-shadow: 0 0 0 0 rgba(212, 166, 64, .15); } to { box-shadow: 0 0 14px 4px rgba(212, 166, 64, .75); } }
.timeline-autoselect { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
/* CLAUDE-NOTE (Ilyas 2026-10-16): scene "precomps". A scene block and its revealed clips share --scene-color (top bar +
   tint); the phase color keeps the side border so production status is still readable. */
.timeline-clip.in-scene { background: linear-gradient(var(--scene-soft), var(--scene-soft)), var(--panel); box-shadow: inset 0 5px 0 var(--scene-color); }
.timeline-scene { position: relative; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; min-height: 150px; box-sizing: border-box;
  border: 2px solid var(--scene-color); border-radius: 6px; background: linear-gradient(var(--scene-soft), var(--scene-soft)), var(--panel); box-shadow: inset 0 7px 0 var(--scene-color); cursor: grab; }
.timeline-scene strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-scene span:not(.timeline-clock):not(.timeline-scene-actions) { font-size: 12px; opacity: .85; }
.timeline-scene img { width: 100%; height: 48px; object-fit: cover; border-radius: 3px; }
.timeline-scene.selected { outline: 2px solid var(--text); outline-offset: 1px; }
.timeline-scene.playing { outline: 2px solid var(--gold, #d4a640); outline-offset: 1px; }
.timeline-scene-actions { display: flex; gap: 6px; margin-top: auto; }
.timeline-scene-fold { flex-shrink: 0; width: 42px; min-height: 150px; border: 2px solid var(--scene-color); border-radius: 6px 0 0 6px; background: var(--scene-color);
  color: #111; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; padding: 0; }
.timeline-scene-fold span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; }
.timeline-scene-fold small { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
#timeline-scene-move { max-width: 260px; }
