/* Vídeo · estilos propios */
body { overflow: hidden; }
.shell { position: relative; display: grid; height: 100dvh; grid-template-columns: minmax(0, 1fr) min(var(--side-w, 360px), 45vw); grid-template-rows: 48px minmax(0, 1fr); grid-template-areas: "top top" "stage side"; }
.topbar { grid-area: top; }
.top-mid { margin: 0 auto; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .top-actions { margin-left: 0; }

.stage { grid-area: stage; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px; gap: 10px; background: var(--bg); }
.drop { position: absolute; inset: 14px; display: grid; place-items: center; border: 1.5px dashed var(--border-2); border-radius: 14px; }
.drop[hidden] { display: none; }
.drop-in { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 420px; text-align: center; color: var(--text-2); line-height: 1.5; }
.drop-in strong { font-size: 16px; color: var(--text); }
.drop-in .btn { margin-top: 8px; }
.drop-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(225, 29, 72, .1); color: #e11d48; margin-bottom: 4px; }
.drop-ic .ic { width: 26px; height: 26px; }
body.dragging .stage { box-shadow: inset 0 0 0 3px var(--accent); }

.player { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.player[hidden] { display: none; }
.viewport { position: relative; flex: 1; min-height: 160px; display: grid; place-items: center; border-radius: 12px; background: #0b0b0a; overflow: hidden; }
#view { display: block; position: absolute; inset: 0; margin: auto; }   /* no empuja el tamaño del visor: este manda */
.crop { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); touch-action: none; }
.crop[hidden] { display: none; }
.crop-box { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); outline: 2px solid #fff; cursor: move;
  background-image: linear-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .35) 1px, transparent 1px);
  background-size: 33.333% 33.333%; background-position: -1px -1px; }
.ch { position: absolute; width: 14px; height: 14px; border-radius: 3px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.ch[data-h="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.ch[data-h="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.ch[data-h="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.ch[data-h="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.icon-btn.big { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.icon-btn.big:hover { background: var(--accent-hover); }
.icon-btn.big .ic { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.time { font: 500 13px var(--mono); font-variant-numeric: tabular-nums; color: var(--text-2); margin-left: 4px; }

.timeline { position: relative; height: 64px; border-radius: 10px; background: #111; overflow: hidden; cursor: pointer; touch-action: none; user-select: none; }
.thumbs { position: absolute; inset: 4px 0; width: 100%; height: 56px; opacity: .9; }
.pieces { position: absolute; inset: 0; }
.piece { position: absolute; top: 0; bottom: 0; border: 2px solid transparent; border-radius: 6px; }
.piece.sel { border-color: #fde047; }
.piece.off { background: repeating-linear-gradient(135deg, rgba(0, 0, 0, .72) 0 8px, rgba(229, 72, 77, .55) 8px 11px); }
.bnd { position: absolute; top: 0; bottom: 0; width: 12px; margin-left: -6px; cursor: ew-resize; z-index: 2; }
.bnd::after { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; border-radius: 1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); }
.trim-out { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .7); pointer-events: none; }
.trim-out.l { left: 0; }
.trim { position: absolute; top: 0; bottom: 0; width: 14px; z-index: 3; cursor: ew-resize; background: var(--accent); }
.trim::after { content: ""; position: absolute; left: 6px; top: 22px; bottom: 22px; width: 2px; border-radius: 1px; background: var(--on-accent); }
.trim.t-in { margin-left: 0; border-radius: 8px 0 0 8px; }
.trim.t-out { margin-left: -14px; border-radius: 0 8px 8px 0; }
.playhead { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); pointer-events: none; z-index: 4; }
.tl-hint { margin: 0; }

.side { grid-area: side; overflow: auto; border-left: 1px solid var(--border); background: var(--panel); }
.s-sec { display: grid; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ratios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ratios button { height: 30px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--panel); font-size: 12px; color: var(--text-2); }
.ratios button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.ratios button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
#flipBtn[aria-pressed="true"] { color: var(--accent); }
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.est { margin: 0; color: var(--text-2); line-height: 1.5; }
.btn.big { width: 100%; height: 40px; justify-content: center; font-size: 13.5px; }
.progress { display: grid; gap: 6px; }
.progress[hidden] { display: none; }
.bar { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.prog-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.close-v { justify-self: start; }
.side :disabled { opacity: .45; }

/* Barra de vista y tira de clips */
.view-bar { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 9px; background: var(--sunken); }
.seg button { flex: 1; height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.seg button:hover:not(:disabled) { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.seg.block { display: flex; }
.clips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.clip { display: flex; align-items: center; gap: 2px; flex: none; max-width: 240px; padding: 2px 4px 2px 2px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--panel); }
.clip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.clip-b { display: flex; align-items: center; gap: 6px; min-width: 0; height: 28px; padding: 0 6px; border: 0; background: none; font-size: 12px; color: var(--text); }
.clip-b b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--sunken); font-size: 11px; }
.clip-b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-b small { color: var(--text-3, var(--text-2)); font: 500 11px var(--mono); }
.clip.add { padding: 0 12px; height: 34px; border-style: dashed; font-size: 12px; color: var(--text-2); }
.clip.add:hover { color: var(--text); background: var(--hover); }
.combo-btn { gap: 6px; padding: 0 12px; height: 34px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.combo-btn .ic { width: 15px; height: 15px; }
.combo-btn:hover { color: var(--text); background: var(--hover); }
.combo-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Edición combinada: el vídeo se hace más pequeño y la línea de tiempo muestra todos los clips */
.combo[hidden] { display: none; }
.combo-mode .viewport { flex: 0 0 auto; height: var(--vp-h, clamp(150px, 34vh, 360px)); min-height: 0; }
.combo-mode .timeline { display: none; }
.combo { --gut: 86px; position: relative; flex: 1; min-height: 110px; overflow-x: hidden; overflow-y: auto; border-radius: 10px; background: #111; user-select: none; touch-action: none; }
.combo-ruler { position: sticky; top: 0; z-index: 3; display: flex; height: 22px; background: #161616; border-bottom: 1px solid #262626; cursor: pointer; }
.combo-gut { flex: none; width: var(--gut); }
.combo-ticks { position: relative; flex: 1; margin-right: 12px; }
.combo-ticks { overflow: hidden; }
.combo-ticks span { position: absolute; top: 0; bottom: 0; padding-left: 4px; border-left: 1px solid #3a3a3a; font: 500 10px/22px var(--mono); color: #8a8a8a; white-space: nowrap; }
.crow { display: flex; height: var(--row-h, 40px); border-bottom: 1px solid #1d1d1d; }
.crow-h { flex: none; display: flex; align-items: center; justify-content: center; gap: 2px; width: var(--gut); color: #9a9a9a; font-size: 11px; line-height: 1; }
.crow-ord { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 24px; }
.crow-h b { font-weight: 600; color: #ddd; }
.crow-h button { width: 22px; height: 12px; padding: 0; border: 0; border-radius: 3px; background: none; color: #9a9a9a; font-size: 11px; line-height: 12px; cursor: pointer; }
.crow-h button:hover:not(:disabled) { background: #2a2a2a; color: #fff; }
.crow-h button:disabled { opacity: .25; cursor: default; }
.crow-t { position: relative; flex: 1; margin-right: 12px; cursor: pointer; }
.cbar { position: absolute; top: 4px; bottom: 4px; min-width: 6px; border-radius: 6px; overflow: hidden; background: #2b2b2b; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .25); cursor: grab; }
.cbar:active { cursor: grabbing; }
.cbar.on { box-shadow: inset 0 0 0 2px #fde047; }
.cbar canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .85; pointer-events: none; }
.cbar-n { position: absolute; left: 8px; top: 3px; max-width: calc(100% - 16px); overflow: hidden; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .6); font-size: 10.5px; font-weight: 600; color: #fff; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
.cov { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(0, 0, 0, .7) 0 6px, rgba(0, 0, 0, .45) 6px 12px); pointer-events: none; }
.cedge { position: absolute; top: 0; bottom: 0; z-index: 1; width: 9px; cursor: ew-resize; }
.cedge::after { content: ""; position: absolute; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: rgba(255, 255, 255, .85); opacity: 0; transition: opacity .12s; }
.cbar:hover .cedge::after, .cbar.on .cedge::after { opacity: 1; }
.cedge.l { left: 0; } .cedge.l::after { left: 3px; }
.cedge.r { right: 0; } .cedge.r::after { right: 3px; }
.combo-over { position: absolute; top: 0; height: 100%; left: var(--gut); right: 12px; pointer-events: none; z-index: 4; }
.combo-gut { display: grid; place-items: center; font: 600 10px var(--mono); color: #fde047; }
.combo-head[hidden] { display: none; }
.crow-t { overflow: hidden; }
.cbar canvas { right: auto; }
.combo-nav { position: sticky; bottom: 0; z-index: 5; height: 12px; margin: 0 12px 0 var(--gut); padding: 3px 0; background: #111; cursor: pointer; }
.combo-nav[hidden] { display: none; }
.combo-nav i { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: #555; cursor: grab; }
.combo-nav i:hover { background: #777; }
.combo-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.icon-btn.sm { width: 24px; height: 24px; font-size: 14px; }
.icon-btn.sm .ic { width: 13px; height: 13px; }

/* Secciones plegables del panel */
details.s-sec { gap: 0; padding: 0; }
details.s-sec > summary { display: flex; align-items: center; gap: 6px; padding: 12px 16px; font-weight: 600; font-size: 13px; cursor: pointer; list-style: none; user-select: none; }
details.s-sec > summary::-webkit-details-marker { display: none; }
details.s-sec > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(-45deg); transition: transform .15s; }
details.s-sec[open] > summary::after { transform: rotate(45deg); }
details.s-sec > summary:hover { background: var(--hover); }
details.s-sec[open] { display: grid; gap: 10px; padding-bottom: 14px; }
details.s-sec > :not(summary) { margin: 0 16px; }
.count { font-weight: 500; color: var(--text-2); }
.s-sec p { margin: 0; }

.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.presets button { height: 28px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); font-size: 11.5px; color: var(--text-2); }
.presets button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.presets button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rng { display: grid; grid-template-columns: 78px minmax(0, 1fr) 44px; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.rng input { width: 100%; accent-color: var(--accent); }
.rng output { font: 500 11px var(--mono); text-align: right; color: var(--text); }
.field { display: grid; gap: 4px; font-size: 12px; }
.field-l { color: var(--text-2); }
.field select, .item select, .item input[type="number"], .tr-grid select, #logoAnim select { height: 30px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
.check input { accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
input[type="color"] { width: 30px; height: 30px; padding: 2px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); cursor: pointer; }
#bandRow { align-items: center; justify-content: space-between; }
#bandRow[hidden], .logo-opts[hidden] { display: none; }
.logo-opts { display: grid; gap: 10px; }

/* Elementos de textos y zonas */
.items { display: grid; gap: 8px; }
.items:empty { display: none; }
.item { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.item-h { display: flex; gap: 6px; align-items: flex-start; }
.item textarea { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; resize: vertical; }
.item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.item-row select { flex: 1; }
.item .btn.on { color: var(--accent); border-color: var(--accent); }
.item-row.times { font-size: 12px; color: var(--text-2); }
.item-row.times label { display: flex; align-items: center; gap: 4px; }
.item-row.times input { width: 58px; }
.item .rng { grid-template-columns: 56px minmax(0, 1fr) 30px; }
.item.zone { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.item.zone .rng { grid-template-columns: 62px minmax(0, 1fr); }

@media (max-width: 900px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: 48px auto auto; grid-template-areas: "top" "stage" "side"; }
  .stage { min-height: 70vh; }
  .viewport { min-height: 42vh; }
  .side { border-left: 0; border-top: 1px solid var(--border); }
  .top-mid { display: none; } .topbar .top-actions { margin-left: auto; }
}

/* Movimiento */
.item.mo.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mo-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; }
.mo-name small { flex: none; font-weight: 400; color: var(--text-2); }
.mo-track { position: relative; height: 22px; margin: 0 6px; border-radius: 6px; background: var(--sunken); cursor: pointer; }
.mo-key { position: absolute; top: 50%; z-index: 1; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; padding: 0; border: 1.5px solid var(--panel); border-radius: 2px; background: var(--text-2); transform: rotate(45deg); cursor: pointer; }
.item.mo.on .mo-key { background: var(--accent); }
.mo-key.cur, .item.mo.on .mo-key.cur { background: #fde047; }
.mo-ph { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); pointer-events: none; }

#clipCropBtn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Tamaño del vídeo (encuadre) */
.vsize { display: grid; gap: 6px; }
.vsize-row { display: flex; align-items: center; gap: 6px; }
.vsize-row input { width: 76px; height: 30px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font: 500 12.5px var(--mono); font-variant-numeric: tabular-nums; }
.vsize-row .icon-btn { margin-left: auto; }
.vsize-pre { display: flex; flex-wrap: wrap; gap: 4px; }
.vsize-pre button { height: 24px; padding: 0 7px; border: 1px solid var(--border-2); border-radius: 6px; background: var(--panel); font: 500 11px var(--mono); color: var(--text-2); }
.vsize-pre button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.vsize-pre button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
details.s-sec > .field-l { margin-bottom: -4px; font-size: 12px; }
.lock-ar { display: grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--text-3, var(--text-2)); cursor: pointer; }
.lock-ar .ic { width: 15px; height: 15px; }
.lock-ar:hover { background: var(--hover); color: var(--text); }
.lock-ar[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
#vidSel { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 30px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; }
.vsize-row input { width: 70px; }

/* Croma y transparencia */
.key-opts { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.key-opts[hidden], .alpha-note[hidden], #bandRow[hidden] { display: none; }
.key-row { align-items: center; }
#keyPick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
body.picking #view { cursor: crosshair !important; }

.pitch-row { display: grid; gap: 6px; }
.pitch-row[hidden] { display: none; }

/* Pistas de audio */
.atracks { display: grid; gap: 8px; }
.item.atrack.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.item.atrack .aname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.crow.arow { height: var(--arow-h, 34px); background: rgba(16, 185, 129, .04); }
.cbar.abar { background: #0f5f4a; box-shadow: inset 0 0 0 1.5px rgba(52, 211, 153, .5); }
.cbar.abar.on { box-shadow: inset 0 0 0 2px #fde047; }
.cbar.abar.muted { opacity: .45; }
.cbar.abar canvas { opacity: .9; }

/* Tamaño de la línea de tiempo combinada */
.split-h { display: none; height: 10px; margin: -6px 0 -4px; cursor: row-resize; touch-action: none; place-items: center; }
.combo-mode .split-h { display: grid; }
.split-h i { width: 44px; height: 4px; border-radius: 2px; background: var(--border-2); transition: background .12s; }
.split-h:hover i, .split-h:active i { background: var(--accent); }
.cbar-n { top: 3px; }

/* Silenciar desde la fila de la línea de tiempo */
.crow-h .row-mute { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: #b5b5b5; }
.crow-h .row-mute .ic { width: 15px; height: 15px; }
.crow-h .row-mute:hover:not(:disabled) { background: #2a2a2a; color: #fff; }
.crow-h .row-mute.on { color: #f87171; background: rgba(248, 113, 113, .12); }
.crow-h .row-mute:disabled { opacity: .3; }

/* Ventana de atajos */
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 22px; }
.key-group h4 { margin: 6px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3, var(--text-2)); }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.key-row > span:last-child { display: inline-flex; flex: none; align-items: center; gap: 3px; }
.key-row kbd + kbd { margin-left: 0; }
.key-mouse { font-size: 11.5px; color: var(--text-2); padding: 1px 6px; border: 1px dashed var(--border-2); border-radius: 5px; }
/* La ventana cabe siempre en la pantalla: la lista de atajos se desplaza por dentro y se reparte en columnas */
#help { padding-top: max(16px, 4vh); }
#help .modal { display: flex; flex-direction: column; width: min(1120px, 100%); max-height: calc(100dvh - max(16px, 4vh) - 16px); }
#help .modal-h { display: flex; flex: none; align-items: center; gap: 12px; margin-bottom: 8px; }
#help .modal-h h2 { flex: none; margin: 0; }
.keys-q { flex: 1; min-width: 0; max-width: 340px; margin-left: auto; height: 32px; }
#help .keys { display: block; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.keys-cols { columns: 250px 4; column-gap: 26px; }
.key-group { break-inside: auto; }
.key-group h4 { break-after: avoid; padding-top: 6px; }
.key-row { break-inside: avoid; }
.keys-none { padding: 20px 0; text-align: center; }
@media (max-width: 760px) { .keys { grid-template-columns: minmax(0, 1fr); } }

/* Historial */
.hist-wrap { position: relative; margin-left: 6px; flex: none; }
.fs-btn { margin-left: auto; }
.hist-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(360px, 86vw); padding: 10px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--panel); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.hist-pop[hidden] { display: none; }
.hist-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.hist-list { list-style: none; margin: 0; padding: 0; max-height: min(360px, 50vh); overflow: auto; }
.hist-it { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.hist-it:hover { background: var(--hover); }
.hist-it.cur { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.hist-it.future { opacity: .5; }
.hist-n { font: 500 11px var(--mono); color: var(--text-2); text-align: right; }
.hist-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-t { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.hist-foot { margin: 8px 2px 0; }

/* Curva de volumen */
.env-toggle { display: inline-flex; }
.env-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.env { display: grid; gap: 8px; padding-top: 4px; }
.env-list:empty { display: none; }
.env-pt { font-size: 12px; color: var(--text-2); }
.env-pt label { display: inline-flex; align-items: center; gap: 4px; }
.env-pt input, .env-fade input { width: 62px; height: 28px; padding: 0 6px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; }
.env-fade { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.env-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.env-svg polyline { fill: none; stroke: #fde047; stroke-width: 2; vector-effect: non-scaling-stroke; }
.env-svg .env-100 { stroke: rgba(255, 255, 255, .25); stroke-dasharray: 3 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ep { position: absolute; z-index: 3; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border: 2px solid #111; border-radius: 50%; background: #fde047; cursor: grab; }
.ep b { position: absolute; left: 50%; bottom: 13px; transform: translateX(-50%); padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .8); color: #fff; font: 600 10px var(--mono); white-space: nowrap; opacity: 0; pointer-events: none; }
.ep:hover b, .ep:active b { opacity: 1; }
body.env-mode .cbar { cursor: crosshair; }
body.env-mode .cedge { display: none; }

/* Pistas de audio en solitario y marcas en el montaje */
.clip.aclip .clip-b b { background: rgba(16, 185, 129, .22); color: #34d399; }
.clip.aclip.on { border-color: #34d399; box-shadow: 0 0 0 1px #34d399; }
body.audio-solo #viewSeg, body.audio-solo #frameBtn { display: none; }
.cmark { position: absolute; top: 0; bottom: 0; z-index: 2; width: 2px; margin-left: -1px; background: #fde047; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); cursor: pointer; }
.cmark::before { content: ""; position: absolute; top: 0; bottom: 0; left: -5px; right: -5px; }
.cmark:hover { background: #fff; }
body.env-mode .cmark { pointer-events: none; }
body.env-mode .timeline { cursor: crosshair; }
body.env-mode .timeline .bnd, body.env-mode .timeline .trim { pointer-events: none; opacity: .5; }
.timeline .env-svg { z-index: 5; }
.timeline .ep { z-index: 6; }

/* Curva de volumen discreta cuando no se está editando */
.env-svg.off polyline { stroke: rgba(253, 224, 71, .38); stroke-width: 1.25; }
.env-svg.off .env-100 { display: none; }
.aspeed button { font-size: 11px; padding: 0 4px; }

/* Archivos cargándose */
.load-box:empty { display: none; }
.load-box { display: grid; gap: 8px; width: min(420px, 90vw); text-align: left; }
.load-box > strong { text-align: center; }
.load-box > p { margin: 0 0 4px; text-align: center; }
.drop.is-loading .drop-in > :not(.load-box):not(.drop-ic) { display: none; }
.load-it { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; font-size: 12px; }
.load-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.load-it small { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.load-bar { grid-column: 1 / -1; position: relative; height: 3px; overflow: hidden; border-radius: 2px; background: var(--sunken); }
.load-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); transition: width .2s; }
.load-bar.indet i { width: 35% !important; animation: load-indet 1.1s ease-in-out infinite; }
@keyframes load-indet { from { left: -35%; } to { left: 100%; } }
.spin { width: 14px; height: 14px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } .load-bar.indet i { animation-duration: 3s; } }
.clip.loading { padding: 4px 10px; min-width: 200px; max-width: 280px; border-style: dashed; }
.clip.loading .load-it { width: 100%; }

/* Miniaturas generándose: brillo que recorre la tira y porcentaje */
.timeline.thumbing::after, .cbar.thumbing::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .09) 45%, transparent 70%); background-size: 220% 100%; animation: thumb-shine 1.6s linear infinite; }
@keyframes thumb-shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .timeline.thumbing::after, .cbar.thumbing::after { animation: none; } }
.thumb-prog { position: absolute; right: 22px; top: 6px; z-index: 6; display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .72); color: #e5e5e5; font: 500 11px var(--mono); pointer-events: none; }
.thumb-prog[hidden] { display: none; }
.bar-prog { position: absolute; right: 6px; bottom: 3px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; padding: 0 5px; border-radius: 4px; background: rgba(0, 0, 0, .65); color: #e5e5e5; font: 500 10px var(--mono); pointer-events: none; }
.bar-prog .spin { width: 9px; height: 9px; border-width: 1.5px; }

/* Visor a pantalla completa */
#viewport:fullscreen { border-radius: 0; background: #000; }
#viewport:-webkit-full-screen { border-radius: 0; background: #000; }

body.vp-max #viewport { position: fixed; inset: 0; z-index: 900; border-radius: 0; background: #000; }
.fs-exit { position: absolute; top: 12px; right: 12px; z-index: 10; gap: 6px; background: rgba(0, 0, 0, .55); color: #fff; border-color: rgba(255, 255, 255, .25); opacity: .55; transition: opacity .15s; }
.fs-exit:hover, .fs-exit:focus-visible { opacity: 1; }
.fs-exit[hidden] { display: none; }

/* Modo «ver» a pantalla completa: nada del editor, controles que se esconden solos */
.fs-on .crop, .fs-on #crop { display: none !important; }
.fs-on #view { cursor: pointer; }
.fs-on.idle, .fs-on.idle #view { cursor: none; }
.fs-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; gap: 8px; padding: 28px 22px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; transition: opacity .25s; }
.fs-bar[hidden] { display: none; }
.fs-on.idle .fs-bar { opacity: 0; pointer-events: none; }
.fs-prog { position: relative; height: 16px; cursor: pointer; touch-action: none; }
.fs-track { position: absolute; left: 0; right: 0; top: 6px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.fs-track i { display: block; height: 100%; width: 0; background: var(--accent); }
.fs-prog b { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.fs-prog:hover .fs-track { height: 6px; top: 5px; }
.fs-row { display: flex; align-items: center; gap: 6px; }
.fs-b { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff; font: 600 12px var(--mono); cursor: pointer; }
.fs-b:hover { background: rgba(255, 255, 255, .22); }
.fs-b .ic { width: 18px; height: 18px; }
.fs-play { width: 46px; justify-content: center; background: #fff; color: #111; }
.fs-play:hover { background: #e5e5e5; }
.fs-play .ic { fill: currentColor; stroke: none; }
.fs-time { margin-left: 8px; font: 500 13px var(--mono); font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .85); }
.fs-out { margin-left: auto; }

/* Reproductores de trabajo: dentro del visor (en pantalla completa es lo único que se dibuja) y nunca con display:none;
   si no, el navegador deja de darles fotogramas cuando no se mueve nada. Son un punto de 2 px casi transparente */
.vsrc { position: absolute; left: 0; bottom: 0; z-index: 0; display: flex; width: 2px; height: 2px; overflow: hidden; opacity: .01; pointer-events: none; }
.vsrc video { width: 2px; height: 2px; flex: none; }

/* Velocidad personalizada */
.speed-custom { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.speed-custom input { width: 64px; height: 28px; padding: 0 6px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font: 500 12px var(--mono); }
.speed-custom.wide { gap: 8px; }
.aspeed-row { display: flex; align-items: center; gap: 6px; }
.aspeed-row .aspeed { flex: 1; min-width: 0; }

/* Imágenes */
.img-thumb { width: 34px; height: 34px; flex: none; object-fit: cover; border-radius: 6px; background: repeating-conic-gradient(#9a9a9a 0 25%, #d9d9d9 0 50%) 0 0 / 10px 10px; }
.img-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }

/* Aviso de exportación (bloquea el editor) */
.exp-ov { align-items: center; padding-top: 16px; z-index: 950; }
.exp-modal { display: grid; gap: 10px; }
.exp-h { display: flex; align-items: center; gap: 10px; }
.exp-h h2 { margin: 0; }
.spin { width: 18px; height: 18px; flex: none; border: 2.5px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.exp-bar { position: relative; height: 10px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.exp-bar i { position: relative; display: block; height: 100%; width: 0; min-width: 10px; border-radius: inherit; background: var(--accent); transition: width .25s; overflow: hidden; }
/* rayas que avanzan siempre, aunque el porcentaje no cambie */
.exp-bar i::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .28) 0 8px, transparent 8px 16px); background-size: 22.6px 100%; animation: stripes .7s linear infinite; }
.exp-bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 22%, transparent), transparent); transform: translateX(-100%); animation: sweep 1.8s ease-in-out infinite; pointer-events: none; }
@keyframes stripes { to { background-position: 22.6px 0; } }
@keyframes sweep { to { transform: translateX(100%); } }
.exp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.exp-phase { font-size: 13px; color: var(--text-2); }
.exp-phase::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.exp-pct { font: 600 15px var(--mono); }
.exp-time { margin: 0; min-height: 1.2em; font: 12px var(--mono); color: var(--text-2); }
.exp-note { margin: 0; }
body.busy { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .spin, .exp-bar i::after, .exp-bar::after { animation-duration: 3s; } }

/* Guardar / abrir edición */
.proj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.proj-row .btn { justify-content: center; }
#relink { align-items: center; padding-top: 16px; z-index: 940; }
.relink { display: grid; gap: 10px; width: min(560px, 100%); }
.relink .modal-h { margin-bottom: 0; }
.rl-note, #relinkMsg { margin: 0; }
.rl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: min(320px, 46vh); overflow: auto; }
.rl-it { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, max-content); align-items: center; gap: 8px; padding: 7px 10px; border: 1px dashed var(--border-2); border-radius: 8px; font-size: 12.5px; }
.rl-it.ok { border-style: solid; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.rl-ic { text-align: center; color: var(--text-2); }
.rl-it.ok .rl-ic { color: var(--accent); font-weight: 700; }
.rl-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-s { font: 11px var(--mono); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .rl-it { grid-template-columns: 22px minmax(0, 1fr); } .rl-s { grid-column: 2; } }
.img-it .rng { grid-template-columns: 78px minmax(0, 1fr) 50px; }
.img-it .rng output { white-space: nowrap; }

/* Textos, imágenes, logo y zonas en la edición combinada */
.crow.orow { height: var(--orow-h, 26px); }
.crow.orow .crow-h b { font-size: 12px; }
.cbar.obar { top: 3px; bottom: 3px; display: flex; align-items: center; gap: 5px; padding-left: 6px; border-radius: 5px; }
.cbar.obar .cbar-n { position: static; max-width: none; min-width: 0; padding: 0; background: none; font-size: 10.5px; }
.obar-img { flex: none; height: calc(100% - 4px); max-width: 30px; object-fit: contain; border-radius: 2px; pointer-events: none; }
.orow.k-text .obar { background: #6d28d9; box-shadow: inset 0 0 0 1.5px rgba(196, 181, 253, .55); }
.orow.k-image .obar { background: #b45309; box-shadow: inset 0 0 0 1.5px rgba(253, 186, 116, .55); }
.orow.k-logo .obar { background: #0e7490; box-shadow: inset 0 0 0 1.5px rgba(103, 232, 249, .5); }
.orow.k-zone .obar { background: #475569 repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 6px, transparent 6px 12px); box-shadow: inset 0 0 0 1.5px rgba(203, 213, 225, .45); }
.orow .cbar.obar.on { box-shadow: inset 0 0 0 2px #fde047; }
.orow .cedge::after { top: 5px; bottom: 5px; }
.item.flash { animation: flash 1s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 2px var(--accent); } to { box-shadow: 0 0 0 2px transparent; } }

/* Formas y dibujo */
.shp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.shp-b { display: grid; place-items: center; height: 38px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg); color: var(--text); cursor: pointer; }
.shp-b:hover:not(:disabled) { background: var(--hover); border-color: var(--accent); color: var(--accent); }
.shp-b .ic, .shp-ic .ic, .draw-btn .ic { width: 20px; height: 20px; }
.draw-btn { justify-self: start; gap: 6px; }
.draw-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.draw-opts { display: grid; gap: 8px; padding: 8px 10px; border: 1px dashed var(--accent); border-radius: 10px; }
.draw-opts[hidden] { display: none; }
.shp-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 6px; background: var(--sunken); color: var(--text-2); }
.shp-cols { gap: 10px; }
.shp-cols input[type="color"], .shp-c input[type="color"], .draw-opts input[type="color"] { width: 34px; height: 26px; padding: 0 2px; border: 1px solid var(--border-2); border-radius: 6px; background: var(--panel); }
.shp-c { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.shp-it .rng { grid-template-columns: 78px minmax(0, 1fr) 50px; }
.shp-it .rng output { white-space: nowrap; }
body.drawing #view { cursor: crosshair; }
.orow.k-shape .obar { background: #be185d; box-shadow: inset 0 0 0 1.5px rgba(249, 168, 212, .55); }
.obar-svg { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 3px; background: rgba(0, 0, 0, .35); pointer-events: none; }
.obar-svg .ic { width: 14px; height: 14px; }
.crow-h b .ic { width: 13px; height: 13px; }
.orow-ord { flex-direction: row; width: auto; gap: 1px; }
.orow-ord button { width: 15px; height: 20px; line-height: 20px; font-size: 12px; }
.orow-ord b { display: grid; place-items: center; width: 16px; }

/* Tipo de imagen */
.img-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.img-meta small { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; color: var(--text-2); }
.fmt { flex: none; padding: 1px 5px; border-radius: 4px; font: 600 10px var(--mono); letter-spacing: .03em; color: #fff; background: #64748b; }
.fmt-jpeg { background: #2563eb; } .fmt-png { background: #059669; } .fmt-apng { background: #0d9488; } .fmt-gif { background: #c026d3; }
.fmt-webp { background: #ea580c; } .fmt-svg { background: #ca8a04; } .fmt-avif { background: #7c3aed; }

/* Explicaciones del panel: se pueden ocultar */
.side-foot { display: flex; justify-content: center; padding: 8px 10px 14px; border-top: 1px solid var(--border); }
.hint-btn { gap: 6px; color: var(--text-2); }
.hint-btn .ic { width: 15px; height: 15px; }
body.no-hints .hint { display: none !important; }

/* Recuperar la edición autoguardada */
.recover { display: grid; gap: 6px; justify-items: center; margin-top: 6px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); font-size: 13px; }
.recover[hidden] { display: none; }
.recover span { color: var(--text-2); font-size: 12px; }

/* Transiciones y animaciones */
.tr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 6px 8px; align-items: end; }
.tr-grid label, .anim-row label { display: grid; gap: 3px; min-width: 0; font-size: 11.5px; color: var(--text-2); }
.tr-grid select, .anim-row select { width: 100%; min-width: 0; }
.anim-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 70px; gap: 6px; align-items: end; }
.cshape-opts { display: grid; gap: 8px; }
.cshape-opts[hidden], #cRadRow[hidden] { display: none; }
.item.zone select { max-width: 120px; }
.kb-row { grid-template-columns: auto minmax(0, 1fr); }

/* Velocidad por tramos */
.piece-box { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.piece-box[hidden] { display: none; }
.piece-box select { height: 30px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font-size: 12px; }
#freezeBtn { justify-self: start; }
.piece-tag { position: absolute; left: 4px; bottom: 3px; padding: 0 4px; border-radius: 3px; background: rgba(0, 0, 0, .65); color: #fff; font: 600 10px var(--mono); white-space: nowrap; pointer-events: none; }

/* Herramientas de sonido */
.snd-tools { display: grid; gap: 8px; }
.snd-tools > .btn { justify-self: start; }
.snd-box { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.snd-box .btn { justify-self: start; }
#recBtn.rec-on { background: #dc2626; border-color: #dc2626; color: #fff; animation: recPulse 1.2s ease-in-out infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .25); } }

/* ───────── Panel de ajustes: más claro y accesible ───────── */
.side { scroll-padding-top: 64px; }
.side-grip { position: absolute; top: 48px; bottom: 0; right: calc(min(var(--side-w, 360px), 45vw) - 3px); z-index: 6; width: 6px; cursor: col-resize; }
.side-grip:hover, .side-grip.drag, .side-grip:focus-visible { background: color-mix(in srgb, var(--accent) 50%, transparent); outline: none; }
@media (max-width: 900px) { .side-grip { display: none; } }
/* qué estás editando */
.ctx { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(8px); }
.ctx[hidden] { display: none; }
.ctx-dot { flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--text-2); box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }
.ctx-txt { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.ctx-txt small { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.ctx-txt b { overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
/* grupos y apartados */
.s-grp { margin: 18px 16px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); }
.ctx + .s-grp { margin-top: 12px; }
details.s-sec { border-top: 1px solid var(--border); }
.s-grp + details.s-sec { border-top: 0; }
details.s-sec > summary { min-height: 44px; padding: 10px 16px; font-size: 13.5px; }
details.s-sec[open] { box-shadow: inset 3px 0 0 var(--accent); background: color-mix(in srgb, var(--accent) 3%, transparent); gap: 12px; padding-bottom: 16px; }
details.s-sec[open] > summary { color: var(--accent); }
.chip, .tgt-chip { overflow: hidden; max-width: 62%; padding: 2px 9px; border-radius: 99px; background: var(--sunken); font-size: 11.5px; font-weight: 500; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.chip:empty, .tgt-chip:empty { display: none; }
.tgt-chip { justify-self: start; max-width: 100%; color: var(--text); }
/* subapartados */
.sub { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.sub[hidden] { display: none; }
details.s-sec > summary + .sub, details.s-sec > summary + .hint + .sub, body.no-hints details.s-sec > summary + .hint + .sub { padding-top: 0; border-top: 0; }
.sub-h { font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.sub-h.inline { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.row-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.row-line[hidden] { display: none; }
.danger-zone { justify-items: start; }
.add-btn, .draw-btn { justify-self: start; }
.link-btn { justify-self: start; padding-left: 0; padding-right: 0; border: 0; text-decoration: underline; text-underline-offset: 2px; }
.link-btn[hidden] { display: none; }
/* deslizadores con espacio para su nombre y su valor */
.rng { grid-template-columns: minmax(84px, 32%) minmax(0, 1fr) 54px; font-size: 12.5px; }
.rng > span { line-height: 1.25; }
.rng output { white-space: nowrap; font-size: 11.5px; }
.rng select { height: 30px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font-size: 12.5px; }
.item .rng, .img-it .rng, .shp-it .rng { grid-template-columns: 70px minmax(0, 1fr) 50px; }
.item .rng output { white-space: nowrap; }
/* rejillas */
.grid2.g-wide { grid-template-columns: minmax(0, 1fr) 104px; }
.tr-grid { grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; align-items: end; }
.pos-grid { display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; }
.pos-grid button { height: 34px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--panel); font-size: 16px; color: var(--text-2); }
.pos-grid button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.seg button { min-height: 30px; font-size: 12.5px; }
#logoPos button { font-size: 15px; }
.piece-lbl { font-size: 12.5px; color: var(--text); }
/* foco bien visible con teclado */
#side :is(button, select, input, summary, textarea, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* herramientas de sonido */
.snd-box { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); transition: border-color .15s, box-shadow .15s; }
details.s-sec > summary + .snd-box { padding-top: 12px; border-top: 1px solid var(--border); }
.snd-box:hover, .snd-box:focus-within { border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
.cbar.tgt { box-shadow: inset 0 0 0 2px #22d3ee, 0 0 0 3px rgba(34, 211, 238, .4) !important; }
.cbar.snd-voice { box-shadow: inset 0 0 0 2px #a78bfa, 0 0 0 2px rgba(167, 139, 250, .3) !important; }
/* tinte por dentro (encima de las miniaturas y la onda) y etiqueta */
.cbar.tgt::after, .cbar.snd-voice::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; animation: none; }
.cbar.tgt::after { background: repeating-linear-gradient(-45deg, rgba(34, 211, 238, .38) 0 10px, rgba(34, 211, 238, .24) 10px 20px); }
.cbar.snd-voice::after { background: rgba(167, 139, 250, .3); }
.cbar.tgt::before, .cbar.snd-voice::before { position: absolute; right: 6px; top: 50%; z-index: 3; transform: translateY(-50%); padding: 2px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: #00131a; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.cbar.tgt::before { content: "AFECTA"; background: #22d3ee; }
.cbar.snd-voice::before { content: "VOZ"; background: #a78bfa; }
.cbar.tgt .cbar-n, .cbar.snd-voice .cbar-n { z-index: 2; }
/* grabación de voz en off */
.rec-hud { position: absolute; left: 50%; top: 12px; z-index: 12; display: flex; align-items: center; gap: 10px; transform: translateX(-50%); padding: 8px 10px 8px 14px; border: 1px solid rgba(239, 68, 68, .6); border-radius: 12px; background: rgba(12, 12, 12, .88); color: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.rec-hud[hidden] { display: none; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #ef4444; animation: recBlink 1s steps(2) infinite; }
.rec-hud.paused .rec-dot { animation: none; background: #f59e0b; }
@keyframes recBlink { 50% { opacity: .25; } }
.rec-st { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.rec-time { min-width: 52px; font: 600 14px var(--mono); }
.rec-lv { position: relative; overflow: hidden; width: 70px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .15); }
.rec-lv i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #22c55e, #eab308 70%, #ef4444); transition: width .08s; }
.rec-hud .btn { color: #fff; border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); }
.rec-hud .btn.primary { background: #ef4444; border-color: #ef4444; }
.rec-row .crow-t { pointer-events: none; }
.cbar.recbar { background: repeating-linear-gradient(-45deg, #b91c1c 0 8px, #dc2626 8px 16px); box-shadow: inset 0 0 0 1.5px #fca5a5; animation: stripes .8s linear infinite; background-size: 22.6px 100%; }
.rec-ic { color: #ef4444; }
body.recording #exportBtn { opacity: .5; pointer-events: none; }
@media (max-width: 760px) { .rec-hud { flex-wrap: wrap; justify-content: center; width: calc(100% - 24px); } }

/* Pantallas estrechas: nada se sale por la derecha */
.player > *, .stage > * { min-width: 0; }
.clips { min-width: 0; max-width: 100%; }
@media (max-width: 600px) {
  .view-bar { flex-wrap: wrap; row-gap: 6px; }
  #viewHint { display: none; }
  .view-bar .fs-btn { margin-left: auto; }
}

#ctxGo { gap: 6px; }
#ctxGo kbd { padding: 0 5px; border: 1px solid var(--border-2); border-radius: 4px; font: 600 10px var(--mono); color: var(--text-2); }
#ctxGo.flash-btn { animation: flash 0.8s ease-out; }

/* Escribir un texto directamente en el visor */
.txt-edit { position: absolute; z-index: 8; min-width: 60px; padding: 0 4px; overflow: hidden; resize: none; border: 1.5px dashed #fde047; border-radius: 6px; outline: none; background: rgba(0, 0, 0, .15); text-align: center; white-space: pre; caret-color: #fde047; }
.txt-edit.st-sombra { text-shadow: 0 .06em .25em rgba(0, 0, 0, .65); }
.txt-edit.st-caja { background: color-mix(in srgb, var(--box, #000) 85%, transparent); }
.txt-edit.st-contorno { -webkit-text-stroke: .08em var(--box, #000); paint-order: stroke fill; }

/* Clips sin sonido propio (no tienen o está separado en una pista) */
.nosnd { position: absolute; right: 6px; bottom: 3px; z-index: 2; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 4px; border-radius: 4px; background: rgba(0, 0, 0, .65); font-size: 10px; font-weight: 600; color: #e5e5e5; pointer-events: none; }
.nosnd .ic { width: 11px; height: 11px; color: #f87171; }
body.env-mode .cbar.mute-bar { cursor: not-allowed; }
body.env-mode .cbar.mute-bar canvas { opacity: .35; filter: grayscale(1); }
body.env-mode .cbar.mute-bar .nosnd { font-size: 11px; padding: 2px 8px 2px 6px; background: rgba(127, 29, 29, .9); color: #fff; }

/* Varios elegidos a la vez */
.cbar.msel { box-shadow: inset 0 0 0 2px #fde047, 0 0 0 2px rgba(253, 224, 71, .35); }

/* Clips con miniaturas: el borde amarillo de «elegido» se dibuja por encima de las imágenes */
.cbar.msel { box-shadow: 0 0 0 3px rgba(253, 224, 71, .35); }
.cbar.msel canvas { filter: brightness(1.12); }
.cbar.tgt, .cbar.snd-voice { outline: none; }

.sel-ring { display: none; }
.cbar.csel > .sel-ring, .cbar.msel > .sel-ring { display: block; position: absolute; inset: 0; z-index: 4; border: 2px solid #fde047; border-radius: inherit; pointer-events: none; }
.cbar.msel > .sel-ring { border-width: 3px; background: rgba(253, 224, 71, .32); }

/* Modo sin distracciones */
.zen-exit { display: none; }
body.zen .shell { grid-template-rows: minmax(0, 1fr); grid-template-areas: "stage side"; }
body.zen .side-grip { top: 0; }
body.zen .zen-exit { display: block; position: fixed; left: 14px; bottom: 10px; z-index: 40; padding: 5px 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--panel); color: var(--text-2); font-size: 12px; opacity: .55; }
body.zen .zen-exit:hover, body.zen .zen-exit:focus-visible { opacity: 1; color: var(--text); }
#zenBtn[aria-pressed="true"] { color: var(--accent); }
@media (max-width: 900px) { body.zen .shell { grid-template-rows: auto auto; grid-template-areas: "stage" "side"; } }

/* Sin clip elegido */
.empty-sec { margin: 4px 16px 10px; padding: 12px 14px; border: 1px dashed var(--border-2); border-radius: 10px; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.empty-sec[hidden], details.s-sec[hidden], #ctxGo[hidden] { display: none; }

/* Renombrar lo elegido */
.ctx-nm { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ctx-nm b { overflow: hidden; min-width: 0; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.ctx-nm b[hidden], #ctxRename[hidden] { display: none; }
#ctxRename { flex: none; opacity: .6; }
#ctxRename:hover, #ctxRename:focus-visible { opacity: 1; }
.ctx-in { flex: 1; min-width: 0; height: 26px; padding: 0 8px; border: 1px solid var(--accent); border-radius: 6px; background: var(--panel); color: var(--text); font-weight: 600; font-size: 13px; }

/* Barra de texto: su nombre (si tiene) arriba a la izquierda, como clips y pistas, y el texto entero al lado */
.cbar.obar .cbar-n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbar-lbl { flex: none; max-width: 45%; overflow: hidden; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .6); font-size: 10.5px; font-weight: 700; color: #fff; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.cbar.obar { padding-right: 10px; }

/* Texto con nombre: fila igual de alta que la de un clip, nombre arriba a la izquierda (como clips y pistas) y el texto debajo */
.crow.orow.has-lbl { height: var(--row-h, 40px); }
/* sin altura suficiente: el texto sigue a la derecha del nombre, en su misma línea */
.cbar.obar.has-lbl { display: flex; align-items: flex-start; gap: 6px; padding: 3px 10px 3px 8px; container: obar / size; }
.cbar.obar.has-lbl .cbar-lbl { position: static; flex: none; max-width: 45%; padding: 1px 5px; }
.cbar.obar.has-lbl .cbar-n { position: static; flex: 1; min-width: 0; line-height: 18px; }
/* con altura de sobra: el nombre arriba a la izquierda (como los clips) y el texto centrado en la barra */
@container obar (min-height: 62px) {
  .cbar.obar.has-lbl .cbar-lbl { position: absolute; left: 8px; top: 3px; max-width: calc(100% - 16px); }
  .cbar.obar.has-lbl .cbar-n { position: absolute; left: 8px; right: 10px; top: 50%; transform: translateY(-50%); }
}

/* Línea que separa los controles de cada fila (orden, silenciar) de la zona de los clips: marca justo el 0:00 del vídeo */
.combo .crow-h, .combo-gut { box-shadow: inset -2px 0 0 rgba(255, 255, 255, .32); }
.combo .crow-h { background: rgba(255, 255, 255, .025); }

/* Nombre del archivo antes de descargar */
.name-ov { align-items: center; padding-top: 16px; z-index: 945; }
.name-modal { display: grid; gap: 12px; }
.name-modal h2 { margin: 0; }
.name-row { display: flex; align-items: center; gap: 6px; }
.name-row input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 14px; }
.name-row input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.name-ext { flex: none; font: 600 13px var(--mono); color: var(--text-2); }

/* Plantillas de títulos */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.tpl-b { display: grid; gap: 4px; place-items: center; min-height: 64px; padding: 6px; border: 1px solid var(--border-2); border-radius: 9px; background: #15151a; color: #fff; cursor: pointer; }
.tpl-b:hover { border-color: var(--accent); }
.tpl-b small { font-size: 10.5px; color: #a3a3a3; text-align: center; line-height: 1.2; }
.tpl-prev { font-weight: 800; font-size: 12px; line-height: 1.15; text-align: center; }
.tpl-prev small { display: block; font-weight: 500; font-size: 9px; color: inherit; }
.tpl-lower .tpl-prev { padding: 2px 6px; background: #e11d48; border-radius: 3px; text-align: left; }
.tpl-title .tpl-prev { font-size: 16px; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.tpl-sub .tpl-prev { padding: 2px 6px; background: #ff0033; border-radius: 4px; font-size: 11px; }
.tpl-count .tpl-prev { font-size: 15px; }
.tpl-caption .tpl-prev { padding: 1px 6px; background: #000; font-weight: 500; }
.tpl-type .tpl-prev { font-family: var(--mono); }
.tpl-neon .tpl-prev { font-size: 16px; color: #fff; -webkit-text-stroke: 1px #22d3ee; text-shadow: 0 0 8px #22d3ee; }
.tpl-corner .tpl-prev { align-self: start; justify-self: start; font-size: 10px; }
.tpl-quote .tpl-prev { color: #fde047; }
.tpl-breaking .tpl-prev { padding: 1px 5px; background: #dc2626; font-size: 10px; }
/* Pegatinas y emojis */
.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.emo-b { height: 38px; border: 1px solid transparent; border-radius: 8px; background: var(--bg); font-size: 22px; line-height: 1; cursor: pointer; }
.emo-b:hover { border-color: var(--accent); transform: scale(1.08); }
.badge-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-b { padding: 5px 10px; border: 0; border-radius: 8px; font: 900 12px Inter, system-ui, sans-serif; transform: rotate(-3deg); cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.badge-b:hover { transform: rotate(-3deg) scale(1.08); }
/* Marcadores */
.mkr { position: absolute; top: 0; bottom: 0; z-index: 3; display: flex; align-items: flex-start; gap: 3px; margin-left: -1px; cursor: grab; font-style: normal; }
.mkr i { width: 2px; height: 100%; background: #f59e0b; }
.mkr em { max-width: 110px; overflow: hidden; margin-top: 2px; padding: 0 5px; border-radius: 0 4px 4px 0; background: #f59e0b; color: #1a1300; font: 700 10px/16px Inter, system-ui, sans-serif; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.mkr:hover em { max-width: 260px; }
.mk-lines i { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed rgba(245, 158, 11, .55); }
.mk-it .item-row { flex-wrap: nowrap; }
.mk-go { flex: none; font-family: var(--mono); }
.mk-name { flex: 1; min-width: 0; height: 28px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; }
#mkAdd kbd { margin-left: 4px; padding: 0 5px; border: 1px solid var(--border-2); border-radius: 4px; font: 600 10px var(--mono); }

/* Color propio del clip */
.cadj { position: absolute; right: 6px; top: 3px; z-index: 2; font-size: 11px; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
#colNote[hidden], #vigRow[hidden] { display: none; }
/* Pantalla dividida */
.split-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.split-grid button { display: grid; gap: 4px; justify-items: center; padding: 8px 4px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--bg); color: var(--text-2); font-size: 11px; cursor: pointer; }
.split-grid button:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.sp { display: grid; gap: 2px; width: 44px; height: 26px; }
.sp b { border-radius: 2px; background: var(--accent); opacity: .75; }
.sp-2h { grid-template-columns: 1fr 1fr; } .sp-2v { grid-template-rows: 1fr 1fr; }
.sp-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; } .sp-3 b:first-child { grid-row: span 2; }
.sp-3c { grid-template-columns: 1fr 1fr 1fr; } .sp-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

/* Golpes de la música en la regla */
.combo-ticks .beat { position: absolute; bottom: 0; width: 2px; height: 7px; margin-left: -1px; border-radius: 1px; background: #f472b6; pointer-events: none; }
#dnOff[hidden], #beatOff[hidden] { display: none; }
#beatEvery { height: 28px; padding: 0 6px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font-size: 12px; }
#beatInfo:empty { display: none; }

.rec-prev { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; background: #000; }
.rec-prev[hidden] { display: none; }


/* Botones de añadir y grabar, a la izquierda de la tira */
.clip-adds { display: flex; flex: none; gap: 4px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--border-2); }
.clip-adds .clip.add { padding: 0 10px; white-space: nowrap; }
.clip.add.rec-add { color: #fca5a5; }
/* Quitar ruido: comparar */
.dn-info:empty, #dnCmp[hidden] { display: none; }
.dn-info { color: #22d3ee; }
#dnCmp.on { background: #f59e0b; border-color: #f59e0b; color: #1a1300; }

/* Botón «Añadir» con su menú */
.clip.add.add-main { font-weight: 600; }   /* mismo aspecto que los demás botones de la tira */
.clip.add.add-main[aria-expanded="true"] { border-color: var(--accent); }
.clip.add.add-main span { margin-left: 2px; font-size: 10px; opacity: .8; }
.add-menu { position: fixed; z-index: 60; display: grid; gap: 2px; min-width: 230px; padding: 6px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--panel); box-shadow: 0 14px 36px rgba(0, 0, 0, .45); animation: pop .14s var(--ease); }
.add-menu[hidden] { display: none; }
.add-menu hr { margin: 4px 6px; border: 0; border-top: 1px solid var(--border); }
.add-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.add-menu button:hover, .add-menu button:focus-visible { background: var(--hover); outline: none; }
.add-menu b { display: block; font-size: 13px; font-weight: 600; }
.add-menu small { display: block; font-size: 11.5px; color: var(--text-2); }
.am-ic { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--sunken); font-size: 16px; }

/* Iconos de línea (sin emojis) en los botones de añadir */
.am-ic { color: var(--text); }
.am-ic .ic { width: 17px; height: 17px; }
.add-main { display: inline-flex; align-items: center; gap: 5px; }
.add-main .ic { width: 14px; height: 14px; }
.add-main .chev { width: 12px; height: 12px; opacity: .8; }
#mkAdd, #addViz, #addProgress, #addTimer, #addAudio2, #recBtn { gap: 6px; }
#mkAdd .ic, #addViz .ic, #addProgress .ic, #addTimer .ic, #addAudio2 .ic, #recBtn .ic { width: 15px; height: 15px; }

/* Bandas de inicio y final por FUERA de lo que queda: su borde interior marca el punto exacto.
   La tira deja 14 px a cada lado para que se puedan agarrar también al principio y al final del archivo. */
.timeline { margin: 0 14px; overflow: visible; }
.timeline .thumbs { border-radius: 10px; }
.trim.t-in { margin-left: -14px; border-radius: 8px 0 0 8px; }
.trim.t-out { margin-left: 0; border-radius: 0 8px 8px 0; }

/* «Añadir» y «Edición combinada» se quedan fijos a la izquierda aunque la tira se desplace */
.clip-adds { position: sticky; left: 0; z-index: 3; align-items: center; background: var(--bg); box-shadow: 10px 0 10px -6px var(--bg); }

/* Menú del clic derecho */
.ctx-menu { position: fixed; z-index: 70; display: grid; gap: 1px; min-width: 220px; max-width: 300px; padding: 5px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--panel); box-shadow: 0 14px 36px rgba(0, 0, 0, .5); font-size: 13px; animation: pop .12s var(--ease); }
.ctx-menu[hidden] { display: none; }
.ctx-menu .cm-title { overflow: hidden; padding: 5px 10px 6px; color: var(--text-2); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; }
.ctx-menu hr { margin: 3px 6px; border: 0; border-top: 1px solid var(--border); }
.ctx-menu button { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.ctx-menu button:hover:not(:disabled), .ctx-menu button:focus-visible { background: var(--hover); outline: none; }
.ctx-menu button:disabled { opacity: .4; cursor: default; }
.ctx-menu button.danger { color: #f87171; }
.ctx-menu kbd { color: var(--text-2); font: 500 11px var(--mono); }

/* Escuchar solo una fila o pista (auriculares junto a silenciar) */
.row-btns2 { display: flex; align-items: center; gap: 1px; }
.crow-h .row-solo { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: #8a8a8a; }
.crow-h .row-solo .ic { width: 14px; height: 14px; }
.crow-h .row-solo:hover:not(:disabled) { background: #2a2a2a; color: #fff; }
.crow-h .row-solo.on { color: #fde047; background: rgba(253, 224, 71, .14); }
.crow-h .row-solo:disabled { opacity: .3; }
.crow.deaf .crow-t { opacity: .38; }

/* Subtítulos: panel */
.sync-btn { justify-self: start; }
.sync-btn.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.sync-hud { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); font-size: 12.5px; }
.sync-hud .sync-cur { font-size: 15px; font-weight: 650; color: var(--text); white-space: pre-line; }
.sync-hud .sync-next { color: var(--text-2); }
.sync-hud .sync-n { font-size: 11.5px; color: var(--text-3); }
.sub-list { display: grid; gap: 6px; max-height: min(52vh, 520px); overflow-y: auto; padding-right: 2px; }
.sub-empty { margin: 0; }
.subitem { display: grid; gap: 4px; padding: 6px 8px 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); }
.subitem.now { border-color: color-mix(in srgb, var(--accent) 65%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.subitem.on { border-color: #e6c619; }
.subitem-t { display: flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--text-2); }
.subitem-n { min-width: 20px; font: 600 11px var(--mono); }
.st-in { width: 52px; padding: 2px 4px; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--text); font: 500 11.5px var(--mono); }
.st-in:hover, .st-in:focus { border-color: var(--border-2); background: var(--panel); outline: none; }
.st-now { padding: 1px 4px; border: 0; border-radius: 4px; background: none; color: var(--text-2); font-size: 12px; line-height: 1; cursor: pointer; }
.st-now:hover, .st-now:focus-visible { background: var(--panel); color: var(--text); }
.st-sep { padding: 0 1px; }
.st-d { margin-left: auto; padding-right: 2px; font: 500 11px var(--mono); }
.st-d.fast { color: #d97706; }
.subitem textarea { width: 100%; min-height: 30px; padding: 5px 7px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; line-height: 1.35; resize: none; overflow: hidden; }
.subitem textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.kara-l { display: flex; flex: 1; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.kara-l select { flex: 1; min-width: 0; }
.btn.danger-txt { justify-self: start; color: #dc2626; }
.script-modal { display: grid; gap: 10px; width: min(580px, 100%); }
.script-modal h2, .script-modal p { margin: 0; }
.script-modal textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.45; resize: vertical; }

/* Subtítulos: su fila en la línea de tiempo del montaje */
.crow.subrow { height: var(--orow-h, 26px); }
.crow.subrow .crow-h b { font-size: 10.5px; letter-spacing: .04em; }
.cbar.subbar { top: 3px; bottom: 3px; display: flex; align-items: center; padding-left: 6px; border-radius: 5px; background: #9d174d; box-shadow: inset 0 0 0 1.5px rgba(251, 207, 232, .5); }
.cbar.subbar .cbar-n { position: static; max-width: none; min-width: 0; padding: 0; background: none; }
.cbar.subbar.on { box-shadow: inset 0 0 0 2px #fde047; }
.crow.subrow.off .cbar.subbar { opacity: .5; }

/* Empezar sin vídeo */
.start-blank { display: grid; justify-items: center; gap: 6px; margin-top: 2px; }
.sw-dot { width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(135deg, #f43f5e, #8b5cf6 55%, #0ea5e9); }
.blank-modal { display: grid; gap: 12px; width: min(560px, 100%); }
.blank-modal h2, .blank-modal p { margin: 0; }
.blank-fmts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.blank-fmts button { display: grid; justify-items: center; align-content: start; gap: 3px; padding: 10px 6px 8px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.blank-fmts button[hidden] { display: none; }
.blank-fmts button:hover { border-color: var(--text-3); }
.blank-fmts button[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.blank-fmts b { font-size: 12.5px; font-weight: 600; }
.blank-fmts small { font-size: 11px; color: var(--text-2); text-align: center; }
.bf { display: block; height: 30px; margin-bottom: 3px; border: 2px solid currentColor; border-radius: 4px; color: var(--text-2); }
.bf-h { width: 48px; height: 27px; margin-top: 3px; } .bf-v { width: 17px; } .bf-sq { width: 30px; } .bf-p { width: 24px; }
.bf-auto { width: 34px; border-style: dashed; }
[aria-checked="true"] > .bf { color: var(--accent); }
.blank-modal input[type="color"] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--panel); }
.blank-photo { display: grid; gap: 8px; }
.blank-photo[hidden], .blank-modal .field[hidden] { display: none; }
.blank-sum { margin: 0; color: var(--text-2); }

/* Proyecto vacío: el visor invita a añadir el primer clip */
.empty-view { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 20px; text-align: center; background: #151517; border-radius: inherit; }
.empty-view[hidden] { display: none; }
.empty-view strong { font-size: 16px; color: #f2f2f2; }
.empty-view span { max-width: 420px; font-size: 13px; line-height: 1.45; color: #a3a3a3; }
.empty-view .btn { margin-top: 6px; }
.empty-sec p { margin: 0; }
.empty-sec .btn { margin-top: 10px; }
body.no-clips .controls, body.no-clips #viewSeg, body.no-clips #fsBtn, body.no-clips #viewHint { visibility: hidden; }
.blank-modal input[type="color"]:disabled { opacity: .35; }

/* Vista previa del fondo al crear un clip */
.blank-prev { position: relative; display: grid; place-items: center; height: 132px; border: 1px solid var(--border); border-radius: 10px; background: #0d0d0f; overflow: hidden; }
.blank-prev canvas { max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.blank-prev.clear canvas { background: repeating-conic-gradient(#3a3a3a 0 25%, #2a2a2a 0 50%) 0 0 / 14px 14px; }
.blank-prev-l { position: absolute; left: 8px; bottom: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .55); color: #ddd; font-size: 11px; }

/* Progreso al crear o abrir un clip, dentro del editor */
.side-load { display: grid; gap: 8px; margin: 4px 16px 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); font-size: 12.5px; }
.side-load[hidden] { display: none; }
.empty-view .empty-load { width: min(360px, 80vw); color: #ddd; }
.empty-view.busy > span, .empty-view.busy > .btn { display: none; }
.side-load:not([hidden]) + .empty-sec { display: none; }

/* Mantener pulsado en el móvil abre el menú propio, no el del sistema */
#combo, #view, #clips, #timeline { -webkit-touch-callout: none; }

/* ───────── Móvil en horizontal: el vídeo a la izquierda y los ajustes a la derecha, sin desplazar la página ───────── */
@media (orientation: landscape) and (max-height: 520px) {
  body { overflow: hidden; }
  .shell { height: 100dvh; min-height: 0; grid-template-columns: minmax(0, 1fr) min(300px, 42vw); grid-template-rows: 40px minmax(0, 1fr); grid-template-areas: "top top" "stage side"; }
  .topbar { height: 40px; }
  .stage { min-height: 0; padding: 6px 8px; gap: 6px; }
  .viewport { min-height: 0; }
  .side { border-top: 0; border-left: 1px solid var(--border); }
}
/* Pantallas táctiles: que escribir en un campo no amplíe la página */
:root[data-input="touch"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select) { font-size: 16px !important; }
:root[data-input="touch"] .side :is(button:not(.mo-key), select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"])) { min-height: 38px; }
:root[data-input="touch"] .side input[type="color"] { min-width: 38px; }
:root[data-input="touch"] .lock-ar { min-width: 38px; }

/* Pantallas táctiles: sin modo «sin distracciones» (en el móvil no aporta) y pantalla completa cómoda */
:root[data-input="touch"] #zenBtn { display: none; }
body.vp-max { overflow: hidden; }
body.vp-max .orient-hint { display: none; }
:root[data-input="touch"] .fs-bar { padding: 28px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
:root[data-input="touch"] .fs-bar .icon-btn, :root[data-input="touch"] .fs-bar button { min-width: 44px; min-height: 44px; }
:root[data-input="touch"] #fsProg { min-height: 28px; }
