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

:root{
  --bg:#0b0b0b;
  --panel:#111;
  --panel-soft:#161616;
  --panel-input:#1a1a1a;
  --line:#242424;
  --text:#ffffff;
  --muted:rgba(255,255,255,0.72);
  --accent:#7c6af7;
  --accent-hover:#8d7cff;
  --success:#39c780;
  --danger:#ff5a7a;
  --warning:#ffbf5a;
}

html,
body{
  width:100%;
  height:100%;
}

body{
  background:var(--bg);
  color:var(--text);
  font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow:hidden;
}

.app{
  display:grid;
  grid-template-columns:340px minmax(560px, 1fr) 360px;
  gap:14px;
  height:calc(100vh - 24px);
  padding:12px;
  max-width:2100px;
  margin:0 auto;
}

.sidebar,
.rightbar{
  background:var(--panel);
  border:1px solid #1f1f1f;
  border-radius:16px;
  min-height:0;
  overflow:hidden;
}

.left-scroll,
.right-scroll{
  height:100%;
  overflow-y:auto;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.main{
  min-width:0;
  min-height:0;
  overflow:hidden;
}

.center-layout{
  height:100%;
  display:grid;
  grid-template-columns:minmax(300px, 38%) minmax(0, 1fr);
  gap:12px;
  min-height:0;
}

.panel-section,
.rightbar-section{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding-bottom:12px;
  border-bottom:1px solid var(--line);
}

.panel-section:last-child,
.rightbar-section:last-child{
  border-bottom:none;
  padding-bottom:0;
}

.sidebar h2,
.rightbar h2,
.bottom-strip-header h2{
  font-size:16px;
  font-weight:700;
}

label{
  font-size:13px;
  color:var(--muted);
}

textarea{
  width:100%;
  min-height:160px;
  max-height:260px;
  padding:12px;
  border:none;
  outline:none;
  border-radius:12px;
  background:var(--panel-input);
  color:#fff;
  font-size:13px;
  line-height:1.45;
  resize:vertical;
}

input[type="range"]{
  width:100%;
  accent-color:var(--accent);
  cursor:pointer;
}

input[type="file"]{
  display:none;
}

select{
  width:100%;
  padding:12px;
  border:none;
  outline:none;
  border-radius:12px;
  background:var(--panel-input);
  color:#fff;
  font-size:13px;
}

.info-box{
  background:var(--panel-soft);
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  font-size:13px;
  line-height:1.5;
  color:var(--muted);
}

.file-upload,
.file-input{
  display:flex;
  flex-direction:column;
  gap:4px;
  background:linear-gradient(180deg, #1c1c1c, #171717);
  border:1px dashed #3a3a3a;
  border-radius:14px;
  padding:14px;
  cursor:pointer;
  transition:0.18s ease;
}

.file-upload:hover,
.file-input:hover{
  border-color:var(--accent);
  transform:translateY(-1px);
}

.file-upload-main{
  color:#fff;
  font-weight:700;
  font-size:14px;
}

.file-upload-sub{
  color:var(--muted);
  font-size:12px;
}

.buttons{
  display:flex;
  flex-direction:column;
  gap:10px;
}

button{
  width:100%;
  padding:12px;
  border:none;
  border-radius:12px;
  background:var(--accent);
  color:white;
  font-weight:bold;
  cursor:pointer;
  font-size:13px;
  transition:0.18s ease;
}

button:hover{
  transform:scale(1.02);
  background:var(--accent-hover);
}

button:disabled{
  opacity:.65;
  cursor:not-allowed;
  transform:none;
}

.mini-btn{
  width:auto;
  padding:9px 12px;
  font-size:12px;
  border-radius:10px;
}

.inline-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.danger-btn{
  background:#2a1a1f;
  border:1px solid #4d2532;
}

.danger-btn:hover{
  background:#3a1f29;
}

.section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.preview-shell{
  min-height:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:8px;
  background:radial-gradient(circle at top, rgba(124,106,247,.10), transparent 34%), var(--panel);
  border:1px solid #1f1f1f;
  border-radius:18px;
  padding:10px;
}

.preview-header{
  font-size:14px;
  color:var(--muted);
  flex:0 0 auto;
}

.preview-container{
  height:clamp(520px, calc(100vh - 292px), 760px);
  aspect-ratio:9/16;
  max-width:min(100%, 720px);
  background:#000;
  border-radius:24px;
  box-shadow:0 0 40px rgba(0,0,0,0.65);
  display:flex;
  justify-content:center;
  align-items:center;
  overflow:hidden;
}

canvas{
  width:100%;
  height:100%;
  display:block;
  border-radius:24px;
}

.voice-controls{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.voice-value{
  font-size:12px;
  color:var(--muted);
}

.prompts-list,
.assignment-scenes{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:0;
}

.prompt-card,
.scene-assign-card{
  background:var(--panel-soft);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.prompt-card-title,
.scene-assign-title{
  font-size:13px;
  font-weight:700;
  color:#fff;
}

.prompt-card-scene{
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
  max-height:60px;
  overflow:auto;
}

.prompt-card-text{
  background:var(--panel-input);
  border-radius:12px;
  padding:12px;
  font-size:12px;
  line-height:1.55;
  color:#f2f2f2;
  white-space:pre-wrap;
}

.copy-success{
  color:var(--success);
  font-size:12px;
}

.bottom-strip{
  background:var(--panel);
  border:1px solid #1f1f1f;
  border-radius:16px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
}

.bottom-strip-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.bottom-strip-sub{
  font-size:12px;
  color:var(--muted);
}

.assignment-thumbs.horizontal-thumbs{
  display:flex;
  gap:10px;
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:4px;
}

.thumb-card{
  min-width:100px;
  max-width:100px;
  background:var(--panel-soft);
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  cursor:grab;
  transition:0.18s ease;
  flex-shrink:0;
  position:relative;
}

.thumb-card:hover{
  border-color:var(--accent);
  transform:translateY(-1px);
}

.thumb-card.used{
  border-color:var(--success);
}

.thumb-card.linked-active{
  border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(124,106,247,0.35) inset;
}

.thumb-card.dragging{
  opacity:0.45;
  transform:scale(0.96);
}

.thumb-number{
  position:absolute;
  top:6px;
  left:6px;
  background:rgba(0,0,0,0.7);
  color:#fff;
  font-size:11px;
  font-weight:bold;
  padding:3px 6px;
  border-radius:6px;
  z-index:2;
}

.thumb-image{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  display:block;
  background:#000;
}

.thumb-meta{
  padding:8px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.thumb-index{
  font-size:12px;
  font-weight:700;
  color:#fff;
}

.thumb-name{
  display:none;
}

.thumb-usage{
  font-size:11px;
  color:var(--success);
}

.thumb-scene-badge{
  font-size:10px;
  color:#fff;
  background:rgba(124,106,247,0.18);
  border:1px solid rgba(124,106,247,0.35);
  border-radius:999px;
  padding:3px 6px;
  width:fit-content;
}

.scene-assign-card.active{
  border-color:var(--accent);
  box-shadow:0 0 0 1px var(--accent) inset;
}

.scene-assign-card.drop-target{
  border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(124,106,247,0.30) inset;
}

.scene-assign-text{
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
}

.scene-assign-body{
  display:grid;
  grid-template-columns:72px 1fr;
  gap:10px;
  align-items:start;
}

.scene-assign-preview{
  width:72px;
  height:72px;
  border-radius:12px;
  background:#000;
  overflow:hidden;
  border:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
}

.scene-assign-preview img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.scene-assign-empty{
  font-size:11px;
  color:var(--muted);
  text-align:center;
  padding:8px;
}

.scene-assign-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.scene-status{
  font-size:11px;
  color:var(--muted);
}

.scene-status.ok{
  color:var(--success);
}

.scene-status.missing{
  color:var(--warning);
}

.scene-image-picker{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:5px;
}

.scene-image-option{
  background:var(--panel-input);
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden;
  cursor:pointer;
  transition:0.18s ease;
}

.scene-image-option:hover{
  border-color:var(--accent);
  transform:translateY(-1px);
}

.scene-image-option.selected{
  border-color:var(--success);
  box-shadow:0 0 0 1px var(--success) inset;
}

.scene-image-option img{
  width:100%;
  height:52px;
  object-fit:cover;
  display:block;
  background:#000;
}

.scene-image-option-meta{
  padding:6px;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.scene-image-option-title{
  font-size:10px;
  font-weight:700;
  color:#fff;
  line-height:1.1;
}

.scene-image-option-name{
  display:none;
}

.scene-picker-tools{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.scene-picker-tools button{
  width:auto;
  padding:8px 10px;
  font-size:11px;
  border-radius:10px;
}

/* ================== PANEL PLANTILLAS ================== */
.subtitle-style-panel{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.subtitle-style-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.subtitle-style-card{
  background:var(--panel-soft);
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  cursor:pointer;
  transition:0.18s ease;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.subtitle-style-card:hover{
  border-color:var(--accent);
  transform:translateY(-1px);
}

.subtitle-style-card.active{
  border-color:var(--accent);
  box-shadow:0 0 0 1px var(--accent) inset;
}

.subtitle-style-preview{
  height:74px;
  border-radius:10px;
  background:#1d1d1d;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  overflow:hidden;
}

.subtitle-style-label{
  font-size:12px;
  color:#fff;
  font-weight:700;
}

.subtitle-style-mini{
  text-align:center;
  line-height:1;
  user-select:none;
  white-space:nowrap;
}

.style-mini-amber{
  font-family:Impact, Anton, "Arial Narrow", sans-serif;
  font-weight:900;
  font-size:24px;
  color:#d8942f;
  -webkit-text-stroke:2px #3b220c;
  text-shadow:0 2px 6px rgba(0,0,0,.25);
}

.style-mini-neon{
  font-family:"Arial Black", Arial, sans-serif;
  font-weight:900;
  font-size:22px;
  color:#00eaff;
  -webkit-text-stroke:2px #00363d;
  text-shadow:0 0 10px #00eaff;
}

.style-mini-classic{
  font-family:"Arial Black", Arial, sans-serif;
  font-weight:900;
  font-size:22px;
  color:#ffffff;
  -webkit-text-stroke:2px #000000;
  text-shadow:0 2px 4px rgba(0,0,0,.35);
}

.style-mini-horror{
  font-family:Impact, sans-serif;
  font-weight:900;
  font-size:24px;
  color:#ff3b3b;
  -webkit-text-stroke:2px #2a0000;
  text-shadow:0 0 8px rgba(255,0,0,.45);
}

.left-scroll::-webkit-scrollbar,
.right-scroll::-webkit-scrollbar,
.assignment-thumbs::-webkit-scrollbar,
.prompt-card-scene::-webkit-scrollbar{
  width:10px;
  height:10px;
}

.left-scroll::-webkit-scrollbar-thumb,
.right-scroll::-webkit-scrollbar-thumb,
.assignment-thumbs::-webkit-scrollbar-thumb,
.prompt-card-scene::-webkit-scrollbar-thumb{
  background:#343434;
  border-radius:999px;
}

.left-scroll::-webkit-scrollbar-thumb:hover,
.right-scroll::-webkit-scrollbar-thumb:hover,
.assignment-thumbs::-webkit-scrollbar-thumb:hover,
.prompt-card-scene::-webkit-scrollbar-thumb:hover{
  background:#4a4a4a;
}



/* ============================================================
   V3.4 - REESTRUCTURA DE INTERFAZ
   Vista previa grande + timeline abajo + medios en panel derecho.
   ============================================================ */
.side-note{
  font-size:11px;
  color:var(--muted);
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  border-radius:999px;
  padding:4px 8px;
  white-space:nowrap;
}

.media-library-side{
  padding-bottom:14px;
}

.assignment-thumbs.side-thumbs{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:9px;
  overflow:visible;
  padding:0;
}

.assignment-thumbs.side-thumbs .thumb-card{
  min-width:0;
  max-width:none;
  width:100%;
}

.assignment-thumbs.side-thumbs .thumb-image{
  aspect-ratio:9/10;
}

.assignment-thumbs.side-thumbs .thumb-meta{
  padding:7px;
}

.assignment-thumbs.side-thumbs .thumb-index,
.assignment-thumbs.side-thumbs .thumb-usage{
  font-size:10.5px;
}

.timeline-strip{
  margin-top:0;
  padding:10px 12px;
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02)), var(--panel);
}

.timeline-scenes-pro{
  padding:8px 2px 4px;
}

.preview-header{
  width:100%;
  text-align:center;
  font-weight:700;
  letter-spacing:.2px;
}

.scene-detail-side .assignment-scenes{
  max-height:none;
}
@media (max-width: 1500px){
  .app{
    grid-template-columns:310px minmax(520px, 1fr) 330px;
  }

  .center-layout{
    grid-template-columns:minmax(260px, 34%) minmax(0, 1fr);
  }

  .preview-container{
    height:clamp(500px, calc(100vh - 292px), 720px);
  }

  .scene-image-picker{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px){
  body{
    overflow:auto;
  }

  .app{
    grid-template-columns:1fr;
    height:auto;
    min-height:100vh;
  }

  .center-layout{
    grid-template-columns:1fr;
    grid-template-rows:auto auto;
  }

  .center-layout .preview-shell{
    order:-1;
  }

  .timeline-scenes-pro{
    max-height:340px;
  }

  .preview-container{
    width:min(92vw, 520px);
    height:auto;
    min-height:0;
    aspect-ratio:9/16;
  }

  .assignment-thumbs.side-thumbs{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
  .style-mini-anton-clean{
  font-family:"Anton", Impact, sans-serif;
  font-weight:900;
  font-size:24px;
  color:#ffffff;
  -webkit-text-stroke:2px #101010;
  text-shadow:0 2px 6px rgba(0,0,0,.2);
}

.style-mini-oswald{
  font-family:"Oswald", "Arial Narrow", sans-serif;
  font-weight:700;
  font-size:23px;
  color:#f5f5f5;
  -webkit-text-stroke:2px #111111;
  text-shadow:0 2px 4px rgba(0,0,0,.22);
}

.style-mini-bebas{
  font-family:"Bebas Neue", Impact, sans-serif;
  font-weight:700;
  font-size:26px;
  color:#ffd84d;
  -webkit-text-stroke:2px #1d1407;
  letter-spacing:1px;
  text-shadow:0 2px 4px rgba(0,0,0,.18);
}

.style-mini-thin{
  font-family:"Oswald", Arial, sans-serif;
  font-weight:500;
  font-size:22px;
  color:#f0f0f0;
  -webkit-text-stroke:1px #2b2b2b;
  letter-spacing:1px;
  text-shadow:0 0 8px rgba(255,255,255,.12);
}
.subtitle-size-box{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.subtitle-size-select{
  width:100%;
  padding:12px;
  border:none;
  outline:none;
  border-radius:12px;
  background:var(--panel-input);
  color:#fff;
  font-size:13px;
}
/* ================== BLOQUE NUEVO: PERSONAJES ================== */
.characters-panel{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.characters-tools{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.characters-tools button{
  width:auto;
  padding:8px 10px;
  font-size:11px;
  border-radius:10px;
}

.character-card{
  background:var(--panel-soft);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.character-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.character-title{
  font-size:13px;
  font-weight:700;
  color:#fff;
}

.character-delete{
  width:auto;
  padding:6px 8px;
  font-size:11px;
  border-radius:8px;
}

.character-fields{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.character-fields input,
.character-fields textarea,
.character-fields select{
  width:100%;
  padding:10px 12px;
  border:none;
  outline:none;
  border-radius:10px;
  background:var(--panel-input);
  color:#fff;
  font-size:12px;
}

.character-fields textarea{
  min-height:66px;
  resize:vertical;
  line-height:1.45;
}

.character-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.character-empty{
  font-size:12px;
  color:var(--muted);
  background:var(--panel-soft);
  border:1px dashed var(--line);
  border-radius:12px;
  padding:12px;
}
}

/* ============================================================
   V2.0 - MEDIOS MIXTOS: IMÁGENES + VIDEOS
   ============================================================ */
.media-video-preview{
  position:relative;
  width:100%;
  height:100%;
  background:#000;
  overflow:hidden;
}

.media-video-preview video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  background:#000;
}

.media-type-badge{
  position:absolute;
  right:6px;
  bottom:6px;
  z-index:3;
  background:rgba(0,0,0,.78);
  color:#fff;
  border:1px solid rgba(255,255,255,.22);
  border-radius:999px;
  padding:3px 7px;
  font-size:9px;
  font-weight:800;
  letter-spacing:.4px;
  pointer-events:none;
}

.thumb-card.video-thumb{
  border-color:rgba(124,106,247,.55);
}

.video-scene-card{
  border-color:rgba(124,106,247,.45);
}

.scene-image-option .media-video-preview,
.scene-assign-preview .media-video-preview{
  width:100%;
  height:100%;
  min-height:72px;
  border-radius:10px;
}

/* ============================================================
   V2.1 - BOTÓN REEMPLAZAR MEDIO EN MINIATURA
   ============================================================ */
.thumb-replace-btn{
  position:absolute;
  top:6px;
  right:6px;
  z-index:6;
  width:26px;
  height:26px;
  min-width:26px;
  padding:0;
  border-radius:999px;
  background:rgba(0,0,0,.72);
  border:1px solid rgba(255,255,255,.28);
  color:#fff;
  font-size:16px;
  font-weight:900;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  opacity:.92;
  box-shadow:0 4px 12px rgba(0,0,0,.35);
}

.thumb-replace-btn:hover{
  background:var(--accent);
  border-color:rgba(255,255,255,.45);
  transform:scale(1.08);
}

.thumb-card:hover .thumb-replace-btn{
  opacity:1;
}

/* ============================================================
   V3.3 - Línea de tiempo visual de escenas
   No cambia motor de audio, subtítulos ni exportación.
   ============================================================ */
.timeline-strip{
  margin-top:16px;
}

.timeline-scenes-pro{
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow-y:auto;
  overflow-x:hidden;
  padding:4px 6px 6px 2px;
  min-height:0;
  flex:1 1 auto;
}

.timeline-scene-card{
  position:relative;
  display:flex;
  align-items:stretch;
  gap:12px;
  width:100%;
  min-height:82px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  overflow:visible;
  cursor:pointer;
  padding:10px;
  transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.timeline-card-mismatch-badge{
  position:absolute;
  top:-9px;
  right:10px;
  background:linear-gradient(135deg, #f59e0b, #d97706);
  color:#1a1206;
  font-size:10.5px;
  font-weight:700;
  padding:4px 9px 4px 8px;
  border-radius:999px;
  box-shadow:0 3px 8px rgba(0,0,0,.35), 0 0 0 0 rgba(245,158,11,.55);
  cursor:pointer;
  white-space:nowrap;
  z-index:5;
  display:flex;
  align-items:center;
  gap:4px;
  transition:transform .12s ease;
  animation:pulseAvisoBadge 2s ease-in-out infinite;
}

.timeline-card-mismatch-badge::after{
  content:"✏️";
  font-size:10px;
}

@keyframes pulseAvisoBadge{
  0%, 100%{ box-shadow:0 3px 8px rgba(0,0,0,.35), 0 0 0 0 rgba(245,158,11,.55); }
  50%{ box-shadow:0 3px 8px rgba(0,0,0,.35), 0 0 0 5px rgba(245,158,11,0); }
}

.timeline-card-mismatch-badge:hover{
  transform:translateY(-1px) scale(1.05);
  animation-play-state:paused;
}

.timeline-scene-card:hover{
  transform:translateX(2px);
  border-color:rgba(255,255,255,.22);
  box-shadow:0 8px 20px rgba(0,0,0,.28);
}

.timeline-scene-card.active{
  border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(255,193,7,.20), 0 10px 26px rgba(0,0,0,.34);
}

.timeline-row-thumb{
  position:relative;
  flex:0 0 56px;
  width:56px;
  height:82px;
  border-radius:10px;
  overflow:hidden;
  background:#0b0b0b;
  display:flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  order:3;
}

.timeline-row-thumb .timeline-card-preview{
  width:100%;
  height:100%;
}

.timeline-row-thumb img,
.timeline-row-thumb video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.timeline-row-thumb .timeline-card-empty-icon{
  font-size:20px;
  opacity:.5;
}

.timeline-row-thumb .timeline-row-duration-badge{
  position:absolute;
  left:4px;
  bottom:4px;
  background:rgba(0,0,0,.65);
  color:#fff;
  font-size:10px;
  font-weight:600;
  padding:1px 5px;
  border-radius:5px;
  font-variant-numeric:tabular-nums;
}

.timeline-row-main{
  flex:1 1 auto;
  min-width:0;
  width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  order:1;
}

.timeline-row-topline{
  display:flex;
  align-items:baseline;
  gap:8px;
}

.timeline-row-number{
  font-size:12px;
  font-weight:700;
  color:var(--accent);
  flex:0 0 auto;
}

.timeline-row-text{
  font-size:12.5px;
  line-height:1.4;
  color:var(--text, #e6edf3);
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
  word-break:break-word;
  cursor:text;
  border-radius:6px;
  padding:2px 4px;
  margin:-2px -4px;
  transition:background .12s ease;
}

.timeline-row-text:hover{
  background:rgba(255,255,255,.05);
}

.timeline-row-text:focus{
  outline:1px solid var(--accent);
  background:rgba(255,255,255,.06);
  display:block;
  -webkit-line-clamp:unset;
  overflow:visible;
}

.timeline-row-duration{
  display:none;
}

.timeline-row-actions{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  opacity:0;
  transition:opacity .15s ease;
  order:2;
}

.timeline-scene-card:hover .timeline-row-actions,
.timeline-scene-card.active .timeline-row-actions{
  opacity:1;
}

.timeline-row-actions button{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  color:var(--text, #e6edf3);
  border-radius:6px;
  padding:2px 5px;
  font-size:10px;
  cursor:pointer;
  line-height:1.4;
  font-size:11px;
  cursor:pointer;
}

.timeline-row-actions button:hover{
  background:rgba(255,255,255,.16);
}

.timeline-row-actions button:disabled{
  opacity:.35;
  cursor:not-allowed;
}

.timeline-scene-card.video{
  border-color:rgba(93,176,255,.38);
}

.timeline-scene-card.missing{
  border-style:dashed;
  opacity:.82;
}

.timeline-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:9px 10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.timeline-card-title{
  font-size:12px;
  font-weight:800;
  color:var(--text);
  white-space:nowrap;
}

.timeline-card-type{
  font-size:11px;
  color:var(--muted);
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  padding:3px 7px;
}

.timeline-card-preview{
  height:88px;
  background:#070707;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.timeline-card-preview img,
.timeline-card-preview video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.timeline-card-empty{
  color:var(--muted);
  font-size:12px;
  padding:10px;
  text-align:center;
}

.timeline-card-body{
  padding:8px 9px 9px;
}

.timeline-card-name{
  font-size:12px;
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-bottom:5px;
}

.timeline-card-text{
  font-size:11px;
  color:var(--muted);
  line-height:1.25;
  height:24px;
  overflow:hidden;
  margin-bottom:8px;
}

.timeline-card-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
}

.timeline-card-actions button{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:var(--text);
  border-radius:8px;
  padding:5px 6px;
  font-size:10.5px;
  cursor:pointer;
}

.timeline-card-actions button:hover{
  background:rgba(255,255,255,.12);
}

.timeline-card-actions .danger{
  color:#ffb3b3;
  border-color:rgba(255,120,120,.25);
}

.timeline-card-actions .wide{
  grid-column:span 2;
}


/* ============================================================
   V3.5 - BANDA SONORA
   ============================================================ */
.soundtrack-panel select,
.soundtrack-panel input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  outline: none;
}

.soundtrack-info {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  margin: 6px 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}

.soundtrack-fades {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.soundtrack-panel .voice-value {
  text-align: right;
  margin-top: 4px;
}


/* ============================================================
   V3.6 - BIBLIOTECA DE AUDIO CON PREVIEW
   ============================================================ */
.soundtrack-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 14px;
}

.soundtrack-preview-btn {
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(135deg, rgba(154, 43, 43, 0.95), rgba(62, 18, 18, 0.95));
  color: #fff;
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .2px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  white-space: nowrap;
}

.soundtrack-preview-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.soundtrack-preview-btn.playing {
  background: linear-gradient(135deg, rgba(30, 91, 67, 0.95), rgba(15, 55, 43, 0.95));
}

.soundtrack-preview-status {
  font-size: 11px;
  color: rgba(255,255,255,0.68);
  line-height: 1.25;
}


/* =====================================================
   TikTok Studio PRO - Gestor de proyectos .TSP
   ===================================================== */
.project-manager-panel {
  border: 1px solid rgba(59, 130, 246, 0.30);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.90), rgba(15, 23, 42, 0.92));
}
.project-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.project-actions .mini-btn {
  width: 100%;
  justify-content: center;
}
.project-status-box {
  font-size: 12px;
  line-height: 1.35;
}
.project-status-box.project-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(20, 83, 45, 0.20);
  color: #bbf7d0;
}
.project-status-box.project-error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
}
.project-status-box.project-working {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(120, 53, 15, 0.20);
  color: #fde68a;
}

/* =====================================================
   TikTok Studio PRO v4.1 - Continuidad visual
   ===================================================== */
.continuity-studio-mount {
  margin: 12px 0 14px;
}

.continuity-panel {
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(25,25,34,0.96), rgba(12,12,18,0.96));
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}

.continuity-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #f5d38a;
}

.continuity-head p {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255,255,255,0.72);
}

.continuity-panel label {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.86);
}

.continuity-select,
.continuity-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.28);
  color: #fff;
  border-radius: 10px;
  padding: 9px 10px;
  outline: none;
  font-size: 12px;
}

.continuity-textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.35;
}

.continuity-textarea.large {
  min-height: 132px;
}

.continuity-textarea.small {
  min-height: 58px;
}

.continuity-select:focus,
.continuity-textarea:focus {
  border-color: rgba(245, 211, 138, 0.75);
  box-shadow: 0 0 0 3px rgba(245, 211, 138, 0.10);
}

.continuity-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.continuity-status {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(245, 211, 138, 0.08);
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  line-height: 1.35;
}
