:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(23, 32, 54, 0.7);
  --bg-card-hover: rgba(30, 41, 69, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Header */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-server {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-server::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

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

/* Layout Containers */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Dashboard Hero */
.hero {
  background: linear-gradient(180deg, rgba(30, 41, 69, 0.4) 0%, rgba(11, 15, 25, 0) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-bottom: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.hero-text h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
}

/* Projects Grid */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.project-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 6px;
}

.project-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Progress bar inside cards */
.progress-container {
  margin: 14px 0;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
}

.project-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #131b2e;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: min(92vh, 850px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 8px !important;
    align-items: flex-start !important;
  }
  .modal-box {
    padding: 16px 12px !important;
    max-height: 96vh !important;
    margin: 10px auto !important;
  }
  .drop-zone {
    padding: 14px 10px !important;
  }
  .drop-zone-icon svg {
    width: 26px !important;
    height: 26px !important;
  }
  .drop-zone-text {
    font-size: 0.78rem !important;
  }
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 6px;
}

.modal-footer {
  flex-shrink: 0;
  padding-top: 14px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}
.btn-close:hover {
  color: var(--text-main);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.drop-zone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--accent-cyan);
}

.drop-zone-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.drop-zone-selected {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

/* =========================================
   STUDIO PAGE SPECIFIC STYLES
   ========================================= */

.studio-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.studio-navbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #0d121f;
  border-bottom: 1px solid var(--border);
  z-index: 40;
}

.studio-main-grid {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Left Pane: Synchronized Player & Slide View */
.studio-stage {
  flex: 0 0 58%;
  min-width: 320px;
  max-width: 82%;
  background: #070a12;
  border-right: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Draggable Split Pane Resizer */
.studio-pane-resizer {
  width: 8px;
  background: #0d121f;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  z-index: 25;
  flex-shrink: 0;
}

.studio-pane-resizer::after {
  content: "";
  width: 2px;
  height: 28px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: background 0.15s ease;
}

.studio-pane-resizer:hover, .studio-pane-resizer.is-dragging {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-primary);
}

.studio-pane-resizer:hover::after, .studio-pane-resizer.is-dragging::after {
  background: var(--accent-cyan);
}

.slide-display-frame {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 16px;
  background: radial-gradient(circle at center, rgba(30, 41, 69, 0.25) 0%, rgba(7, 10, 18, 0.8) 100%);
  cursor: pointer;
  overflow: hidden;
}

.slide-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: transform 0.15s ease-out;
  transform-origin: center center;
}

/* Stage Zoom Controls */
.stage-zoom-controls {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  z-index: 20;
}

.stage-tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #c7d2fe;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.stage-tool-btn:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
  border-color: #818cf8;
}

.stage-zoom-pct {
  min-width: 34px;
  font-weight: 700;
  font-family: monospace;
}

/* Fullscreen Mode */
.slide-display-frame.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: #000 !important;
  padding: 0 !important;
}

.slide-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.slide-display-frame:hover .slide-play-overlay {
  opacity: 1;
}

.play-circle-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.6), 0 4px 15px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: transform 0.15s ease, background 0.15s ease;
}

.slide-display-frame:hover .play-circle-btn {
  transform: scale(1.08);
  background: #06b6d4;
}

.btn-playing-active {
  background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.5) !important;
}

.slide-image-current {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.15s ease;
}

.slide-info-overlay {
  position: absolute;
  top: 24px;
  left: 24px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

/* Quick Cursor-to-Slide Sync Bar */
.cursor-sync-bar {
  flex-shrink: 0;
  background: #090e1a;
  border-top: 1px solid var(--border);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.badge-timestamp {
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.cursor-sync-pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
}

.cursor-sync-pill:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.5);
}

/* Playback Control Bar */
.playback-bar {
  flex-shrink: 0;
  background: #0f172a;
  border-top: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.time-display {
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.time-display .current {
  color: #fff;
  font-weight: 700;
}

.speed-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  outline: none;
}

/* Right Pane: Transcript & Grouping */
.studio-transcript-pane {
  background: #0b0f19;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.transcript-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.transcript-search {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* Sticky Batch Action Bar */
.batch-toolbar {
  background: linear-gradient(90deg, #1e1b4b, #172554);
  border-bottom: 1px solid rgba(99, 102, 241, 0.3);
  padding: 10px 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  animation: fadeIn 0.2s ease;
}

.batch-toolbar.active {
  display: flex;
}

.transcript-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transcript-card {
  background: rgba(23, 32, 54, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  content-visibility: auto;
  contain-intrinsic-size: 76px;
}

.transcript-card:hover {
  background: rgba(30, 41, 69, 0.7);
  border-color: rgba(99, 102, 241, 0.4);
}

.transcript-card.active-playing {
  border-color: #06b6d4 !important;
  background: rgba(6, 182, 212, 0.16) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25), inset 4px 0 0 #06b6d4;
  transform: translateX(4px);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.transcript-card.active-playing .transcript-time {
  color: #67e8f9 !important;
  font-weight: 700;
}

.transcript-card.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
}

.transcript-card.is-cut {
  opacity: 0.45;
  border-style: dashed;
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.05);
}

.transcript-card.is-cut .transcript-text {
  text-decoration: line-through;
  color: var(--text-dim);
}

.transcript-checkbox {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.transcript-body {
  flex: 1;
}

.transcript-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.transcript-time {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.transcript-slide-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.transcript-text {
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.45;
}

/* Bottom Pane: Waveform & Slide Timeline Track */
.studio-bottom-panel {
  flex-shrink: 0;
  height: 270px;
  background: #090d16;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 30;
}

.timeline-toolbar {
  padding: 8px 24px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.waveform-container {
  height: 90px;
  background: #05070c;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: pointer;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.4) rgba(15, 23, 42, 0.8);
}

.waveform-container::-webkit-scrollbar {
  height: 6px;
}
.waveform-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8);
}
.waveform-container::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
}
.waveform-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.waveform-scroll-area {
  position: relative;
  height: 100%;
  width: 100%;
  min-width: 100%;
}

#waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#waveform {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Waveform Cursor & Tooltip */
.waveform-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #06b6d4;
  box-shadow: 0 0 10px #06b6d4, 0 0 4px #fff;
  pointer-events: none;
  z-index: 20;
  transform: translateX(-50%);
  display: block;
  will-change: left;
}

.waveform-cursor::after {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 10px;
  background: #06b6d4;
  border-radius: 50%;
  box-shadow: 0 0 8px #06b6d4;
}

/* SVG Icon System */
.icon {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  flex-shrink: 0;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

.icon-sm {
  width: 13px;
  height: 13px;
}

.waveform-hover-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  z-index: 15;
  display: none;
}

/* Magnetic Snap Guideline */
.waveform-snap-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8, 0 0 4px #fff;
  pointer-events: none;
  z-index: 22;
  display: none;
}

.waveform-tooltip {
  position: absolute;
  bottom: 6px;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  font-family: monospace;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  pointer-events: none;
  z-index: 25;
  display: none;
  transform: translateX(-50%);
}

/* Silence Alert Bar */
.silence-alert-bar {
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.silence-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.silence-item-chip.skipped {
  background: rgba(100, 116, 139, 0.2);
  border-color: rgba(100, 116, 139, 0.4);
  color: #94a3b8;
  text-decoration: line-through;
}

.btn-silence-action {
  background: rgba(244, 63, 94, 0.25);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fff;
  font-size: 0.8rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  line-height: 1;
}

.btn-silence-action:hover {
  background: var(--accent-rose);
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}

.silence-item-chip.skipped .btn-silence-action {
  background: rgba(100, 116, 139, 0.4);
  border-color: rgba(100, 116, 139, 0.6);
}

.silence-item-chip.skipped .btn-silence-action:hover {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Waveform Selection Overlay (Bôi đen vùng sóng âm) */
.waveform-selection-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(99, 102, 241, 0.35);
  border-left: 2px solid #818cf8;
  border-right: 2px solid #818cf8;
  box-shadow: inset 0 0 15px rgba(99, 102, 241, 0.4), 0 0 10px rgba(99, 102, 241, 0.3);
  pointer-events: none;
  z-index: 18;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.selection-badge {
  background: rgba(30, 27, 75, 0.95);
  color: #c7d2fe;
  font-size: 0.7rem;
  font-family: monospace;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #6366f1;
  margin-top: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Silence Block on Timeline Track */
.timeline-block.silence-block {
  background: repeating-linear-gradient(
    45deg,
    rgba(23, 32, 54, 0.85),
    rgba(23, 32, 54, 0.85) 10px,
    rgba(40, 53, 83, 0.7) 10px,
    rgba(40, 53, 83, 0.7) 20px
  );
  border: 1px dashed rgba(244, 63, 94, 0.5);
  color: #fda4af;
}

.timeline-block.silence-block.skipped {
  opacity: 0.45;
  filter: grayscale(0.8);
}

/* Slide Blocks Track */
.timeline-track-container {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  background: #080c14;
  padding: 10px 16px;
  position: relative;
}

.timeline-blocks-wrapper {
  display: flex;
  height: 100%;
  gap: 4px;
  min-width: 100%;
}

.timeline-block {
  height: 100%;
  background: rgba(30, 41, 69, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 8px;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
  min-width: 110px;
}

.timeline-block:hover {
  border-color: var(--accent-cyan);
  background: rgba(38, 52, 86, 0.95);
}

.timeline-block.active {
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

/* Drag-to-resize duration handles */
.block-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
}

.block-resize-handle::after {
  content: "";
  display: block;
  width: 2px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1px;
}

.block-resize-handle:hover::after,
.block-resize-handle.active::after {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.8);
}

.block-resize-handle:hover,
.block-resize-handle.active {
  background: rgba(6, 182, 212, 0.25);
}

.block-resize-handle.handle-left {
  left: 0;
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.block-resize-handle.handle-right {
  right: 0;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.block-actions {
  display: flex;
  gap: 4px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.timeline-block:hover .block-actions {
  opacity: 1;
}

.block-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  cursor: pointer;
}
.block-btn:hover {
  background: var(--accent-primary);
  color: #fff;
}

.block-content {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  overflow: hidden;
}

.block-thumb {
  width: 44px;
  height: 26px;
  border-radius: 3px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.block-title-text {
  font-size: 0.75rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: monospace;
}

.block-dur-badge {
  cursor: pointer;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a5b4fc;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.block-dur-badge:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: #818cf8;
  color: #fff;
  transform: scale(1.05);
}

/* Slide Picker Modal Deck Grid */
.slide-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-height: 480px;
  overflow-y: auto;
  padding: 10px;
}

.slide-deck-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.slide-deck-item:hover {
  border-color: var(--accent-primary);
  transform: scale(1.03);
}

.slide-deck-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 6px;
}

.slide-deck-title {
  font-size: 0.75rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
