:root {
  --bg-dark: #090d16;
  --bg-card: #111827;
  --bg-panel: #1e293b;
  --bg-input: #0f172a;
  --border: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 60px;
}

.topbar {
  background: rgba(17, 24, 39, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

kbd {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.78em;
  font-family: monospace;
  color: #e2e8f0;
}

.container {
  max-width: 1320px;
  margin: 24px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 28px;
}

@media (max-width: 980px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.section-title-row h2 {
  font-size: 1.15rem;
}

.hint-badge {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.title-actions {
  display: flex;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: white;
}

.btn-primary {
  background: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-panel);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #334155;
}

.btn-success {
  background: var(--success);
}
.btn-success:hover {
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn-danger-icon {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}
.btn-danger-icon:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.74rem;
}

.btn-lg {
  padding: 13px 22px;
  font-size: 1rem;
}

/* Dropzone & Player */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.dropzone:hover,
.dropzone.dragover,
.paste-zone:focus,
.paste-zone.paste-target-active {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.06);
}

.upload-icon {
  font-size: 2.6rem;
  margin-bottom: 10px;
}

.link-text {
  color: #818cf8;
  text-decoration: underline;
}

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

.dropzone-buttons {
  margin-top: 14px;
}

.player-container {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  outline: none;
}

.player-container video {
  width: 100%;
  max-height: 360px;
  background: #000;
  display: block;
}

.player-toolbar {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.video-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: monospace;
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-time-pill {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #38bdf8;
}

/* Visual Timeline */
.timeline-wrapper {
  margin-bottom: 14px;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-bottom: 4px;
}

.visual-timeline {
  position: relative;
  height: 36px;
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.timeline-seg-block {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.73rem;
  font-weight: 700;
  color: white;
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
}

.timeline-seg-block:hover {
  filter: brightness(1.15);
}

/* Splits List */
.splits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}

.split-row {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.split-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 85px;
}

.split-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.split-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.time-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.time-field input {
  width: 86px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: white;
  font-family: monospace;
  font-size: 0.92rem;
  font-weight: 600;
}

.time-field input:focus {
  border-color: var(--primary);
  outline: none;
}

.split-dur-tag {
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
}

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

.split-actions-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.split-main-btn {
  width: 100%;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

/* Processing Banner */
.processing-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid var(--primary);
  padding: 14px 20px;
  border-radius: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results Grid */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.result-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-card video {
  width: 100%;
  height: 210px;
  background: #000;
  border-radius: 8px;
}

.toast-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #38bdf8;
  color: #f8fafc;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.hidden {
  display: none !important;
}

/* Video Quality Reducer Styles */
.quality-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.quality-option-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.quality-option-card input[type="radio"] {
  display: none;
}

.quality-option-card:not(.disabled):hover {
  border-color: var(--primary);
}

.quality-option-card.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.14);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28);
}

.quality-option-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.4);
}

.q-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.q-status-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-muted);
}

.q-status-tag.available {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
}

.q-status-tag.locked {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}

.reduced-result-box {
  margin-top: 18px;
  background: var(--bg-input);
  border: 1px solid var(--success);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reduced-result-box video {
  width: 100%;
  max-height: 250px;
  background: #000;
  border-radius: 8px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.engine-badge {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

/* ============================================================================
   SECTION 3: Filmstrip Timeline Video Editor & Combiner (Matches Screenshot UI)
   ============================================================================ */
.editor-studio-card {
  background: #05070b;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  outline: none;
}

.editor-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.editor-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Center Video Preview Stage */
.editor-stage-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
}

.editor-video-stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 380px;
  background: #0c0f17;
  border: 1px solid #1e293b;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.editor-video-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.editor-empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: rgba(8, 11, 18, 0.88);
  cursor: pointer;
}

.plus-badge-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  font-weight: 800;
  margin: 0 4px;
}

/* Transport Controls Bar (Matches Screenshot) */
.editor-transport-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
  padding: 6px 16px;
}

.transport-icon-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.transport-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.transport-icon-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.transport-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  border: none;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease;
}

.transport-play-btn:hover {
  transform: scale(1.06);
}

.transport-time {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
}

.transport-time.current {
  color: #f8fafc;
  font-weight: 700;
}

.transport-time.total {
  color: #64748b;
}

/* Mid Toolbar (Selected clip info + Zoom controls) */
.editor-mid-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.selected-clip-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.selected-clip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Filmstrip Timeline Scroll & Canvas (Multi-Layer Support) */
.filmstrip-timeline-scroll {
  width: 100%;
  overflow-x: auto;
  background: #080a0f;
  border-top: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
  border-radius: 8px;
  position: relative;
  user-select: none;
}

.filmstrip-timeline-canvas {
  position: relative;
  min-width: 100%;
  min-height: 155px;
  padding-bottom: 8px;
}

/* Top Ruler Row with Left Layer Header Corner */
.filmstrip-ruler-row {
  display: flex;
  align-items: center;
  height: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b0e17;
}

.layer-header-ruler-corner {
  width: 180px;
  min-width: 180px;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #64748b;
  border-right: 1px solid #1e293b;
  position: sticky;
  left: 0;
  z-index: 15;
  background: #0b0e17;
}

/* Top Ruler (00, 01, 02...) */
.filmstrip-ruler {
  position: relative;
  flex: 1;
  height: 28px;
  cursor: pointer;
}

.ruler-tick-label {
  position: absolute;
  top: 6px;
  font-family: monospace;
  font-size: 0.72rem;
  color: #94a3b8;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Vertical Grid Lines */
.filmstrip-grid-lines {
  position: absolute;
  top: 28px;
  bottom: 0;
  left: 180px;
  right: 0;
  pointer-events: none;
}

.grid-vline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.06);
}

/* Multi-Layer Rows & Sticky Left Layer Control Headers */
.timeline-layer-row {
  display: flex;
  align-items: stretch;
  min-height: 98px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
  z-index: 2;
}

.timeline-layer-row.layer-is-muted .filmstrip-track,
.timeline-layer-row.layer-is-muted .extra-layer-track {
  opacity: 0.55;
}

.timeline-layer-header {
  width: 180px;
  min-width: 180px;
  background: #0d121d;
  border-right: 1px solid #1e293b;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  position: sticky;
  left: 0;
  z-index: 12;
}

.layer-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.layer-name-text {
  font-size: 0.76rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layer-controls-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.layer-mute-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.layer-mute-btn:hover {
  background: #334155;
}

.layer-mute-btn.muted {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

.layer-mini-btn {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  font-size: 0.67rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.layer-mini-btn:hover {
  background: rgba(56, 189, 248, 0.28);
  color: #ffffff;
}

.layer-delete-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 4px;
}

.layer-delete-btn:hover {
  color: #f87171;
}

.btn-layer-action {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-layer-action:hover {
  background: #334155;
  color: #ffffff;
}

.btn-extract-audio {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.btn-extract-audio:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #ffffff;
}

/* Picture-in-Picture / Overlay Preview Video inside Center Stage */
.editor-overlay-preview-video {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 34%;
  max-width: 280px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid #38bdf8;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
  z-index: 6;
  background: #000;
}

/* Extra Layer Track & Positioned Overlay / Audio Clips */
.extra-layer-track {
  position: relative;
  flex: 1;
  min-height: 86px;
  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 60px;
}

.positioned-layer-clip {
  position: absolute;
  top: 10px;
  height: 66px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  cursor: grab;
  overflow: visible;
  user-select: none;
}

.positioned-layer-clip.overlay-clip {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 2px solid #818cf8;
}

.positioned-layer-clip.audio-clip {
  background: linear-gradient(135deg, #064e3b, #047857);
  border: 2px solid #34d399;
}

.positioned-layer-clip.selected,
.positioned-layer-clip:hover {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.positioned-layer-clip.clip-is-muted,
.filmstrip-clip.clip-is-muted {
  opacity: 0.55;
  filter: grayscale(0.45);
}

.audio-waveform-bars {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  width: 100%;
  height: 100%;
  padding: 0 16px;
  gap: 2px;
  overflow: hidden;
  pointer-events: none;
}

.audio-waveform-bars span {
  display: block;
  width: 3px;
  background: rgba(167, 243, 208, 0.75);
  border-radius: 2px;
}

/* Filmstrip Track & Clips */
.filmstrip-track {
  position: relative;
  flex: 1;
  min-height: 112px;
  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 60px;
  gap: 6px;
  z-index: 2;
}

.filmstrip-clips-container {
  display: flex;
  align-items: center;
  height: 76px;
  gap: 4px;
}

.filmstrip-clip {
  position: relative;
  height: 72px;
  border-radius: 9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: #111827;
  overflow: visible;
  display: flex;
  align-items: center;
  cursor: grab;
  flex-shrink: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.filmstrip-clip:active {
  cursor: grabbing;
}

.filmstrip-clip.dragging-move {
  z-index: 30;
  border: 3px solid #38bdf8 !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 0 3px rgba(56, 189, 248, 0.35) !important;
  opacity: 0.95;
  cursor: grabbing;
}

.filmstrip-clip.selected,
.filmstrip-clip:hover {
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.filmstrip-thumbs-row {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
  pointer-events: none;
}

.clip-floating-badge {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid #38bdf8;
  color: #f8fafc;
  font-family: monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 40;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.filmstrip-thumbs-row img {
  height: 100%;
  flex: 1 0 auto;
  object-fit: cover;
  min-width: 48px;
  max-width: 96px;
  opacity: 0.92;
}

.clip-overlay-label {
  position: absolute;
  bottom: 4px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-family: monospace;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

/* Left & Right Draggable Trim Handles (Matches Screenshot White Side Bars) */
.trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 13px;
  background: rgba(255, 255, 255, 0.92);
  cursor: ew-resize;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, width 0.12s;
}

.trim-handle:hover,
.trim-handle.dragging {
  background: #38bdf8;
  width: 15px;
}

.trim-handle::after {
  content: "";
  width: 3px;
  height: 22px;
  border-radius: 2px;
  background: #090d16;
}

.trim-handle-left {
  left: 0;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.trim-handle-right {
  right: 0;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Circular White "+" Button at End of Clips Track (Exact Screenshot Style) */
.timeline-add-plus-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  color: #090d16;
  border: none;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease, background 0.15s ease;
}

.timeline-add-plus-btn:hover {
  transform: scale(1.12);
  background: #38bdf8;
}

/* Vertical White Playhead Scrubber Line */
.filmstrip-playhead {
  position: absolute;
  top: 10px;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

.playhead-cap {
  position: absolute;
  top: -4px;
  left: -5px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #ffffff;
}


/* Inline SVG Icon Utilities */
.svg-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: -3px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  margin-right: 4px;
}

.transport-icon-btn .svg-icon,
.transport-play-btn .svg-icon,
.layer-delete-btn .svg-icon,
.brand-logo .svg-icon {
  margin-right: 0;
  vertical-align: middle;
}

.svg-icon-lg {
  width: 38px;
  height: 38px;
  stroke: #38bdf8;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ============================================================================
   SECTION 4: REAL-TIME AI FACE BLUR & PRIVACY FILTER (60 FPS GPU MODEL)
   ============================================================================ */
.face-blur-canvas-wrap {
  width: 100%;
  background: #05070c;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  position: relative;
}

.face-blur-live-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  cursor: pointer;
}

.face-blur-settings-box {
  background: #0d1322;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.fb-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fb-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
}

.fb-val-badge {
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.fb-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.fb-mode-btn {
  background: #131b2e;
  border: 1px solid #26334d;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.fb-mode-btn:hover {
  border-color: #475569;
  color: #f8fafc;
}

.fb-mode-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.fb-range-slider {
  width: 100%;
  accent-color: #6366f1;
  cursor: pointer;
}

.fb-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.fb-checkbox-row input[type="checkbox"] {
  accent-color: #6366f1;
  width: 15px;
  height: 15px;
  cursor: pointer;
}
