* { box-sizing: border-box; }

html.theme-loading body {
  visibility: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--theme-bg);
  color: var(--theme-text);
  overflow-y: auto;
  overflow-x: hidden;
}

:root {
  --theme-bg: #152018;
  --theme-panel: #0f1812;
  --theme-border: #2f4a3b;
  --theme-border-strong: #3a5a47;
  --theme-accent: #1e2f25;
  --theme-accent-border: #4a6a55;
  --theme-text: #e3f1e8;
  --theme-text-muted: #9eb9aa;
  --grid-text-size: 10.5pt;
  --error-frame-height: 40px;
}


@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/material-symbols-outlined.woff2") format("woff2");
  font-display: swap;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  display: inline-block;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}

.icon-button .material-symbols-outlined {
  font-size: 18px;
}

.layout {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* PANEL IZQUIERDO: PLAYER */
.sidebar-left {
  flex: 0 0 650px; /* ancho inicial 650px */
  min-width: 200px;
  background: var(--theme-bg);
  border-right: 1px solid var(--theme-border);
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Modo fullscreen del panel izquierdo (Ctrl+F12 / zoom-top-only) */
body.zoom-top-only .sidebar-left {
  flex: 1 1 auto;
  min-width: 0;
}
body.zoom-top-only .center-panel,
body.zoom-top-only .sidebar-right {
  display: none;
}

/* Reorganizar layout en zoom-top-only: video arriba, controles al pie sin desbordar */
body.zoom-top-only .player-container {
  overflow: hidden;
}
body.zoom-top-only #leftTopPanel {
  display: flex;
  flex-direction: column;
  height: 100%;
}
body.zoom-top-only .video-wrapper {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: calc(100vh - 220px); /* deja espacio para controles */
}
body.zoom-top-only .video-wrapper video {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}
body.zoom-top-only .video-wrapper #omakase-player,
body.zoom-top-only .video-wrapper #omakase-player > *,
body.zoom-top-only .video-wrapper #omakase-player video {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}
body.zoom-top-only #waveformContainer {
  margin-top: auto; /* empuja el bloque de controles al pie */
}

.player-container {
  width: 100%;
  height: 100vh;
  padding: 16px;
  background: var(--theme-panel);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
}

.left-top-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.zoom-top-only .left-top-panel {
  flex: 1 1 auto;
}

.left-bottom-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px; /* reduce separación: ~10px sumando el gap del contenedor */
}

/* Contenedor del vídeo + subtítulos */
.video-wrapper {
  position: relative;
  height: 300px;
  min-height: 300px;
  max-height: 300px;
  overflow: hidden;
  background: #000000;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  max-height: 300px;
  object-fit: contain;
}

.video-wrapper #omakase-player {
  width: 100%;
  height: 100%;
  max-height: 300px;
  background: #000000;
}

.video-wrapper #omakase-player > * {
  width: 100%;
  height: 100%;
  max-height: 300px;
  background: #000000;
}

.video-wrapper #omakase-player video {
  width: 100%;
  height: 100%;
  max-height: 300px;
  object-fit: contain;
}

.video-wrapper #omakase-player * {
  background: #000000 !important;
}

.video-wrapper #omakase-player [class*="powered"],
.video-wrapper #omakase-player [class*="branding"],
.video-wrapper #omakase-player [class*="watermark"],
.video-wrapper #omakase-player [class*="logo"],
.video-wrapper #omakase-player [aria-label*="Powered"],
.video-wrapper #omakase-player [title*="Powered"],
.video-wrapper #omakase-player a[href*="omakase"] {
  display: none !important;
}

body.simulation-active .video-wrapper,
body.simulation-active .video-wrapper video {
  height: 300px;
  min-height: 300px;
  max-height: 300px;
}

body.simulation-active .video-wrapper #omakase-player,
body.simulation-active .video-wrapper #omakase-player video {
  height: 300px;
  min-height: 300px;
  max-height: 300px;
}

/* Ctrl+F12 (zoom-top-only) permite expandir el vídeo al máximo manteniendo controles visibles */
body.zoom-top-only .video-wrapper,
body.zoom-top-only .video-wrapper video {
  height: auto;
  min-height: 0;
  max-height: 70vh; /* limita para que no tape controles y ajuste al ancho del panel */
}

body.zoom-top-only .video-wrapper #omakase-player,
body.zoom-top-only .video-wrapper #omakase-player > *,
body.zoom-top-only .video-wrapper #omakase-player video {
  height: auto;
  min-height: 0;
  max-height: 70vh;
}

.subtitle-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6%;
  transform: none;
  width: auto;
  max-width: 90%;
  margin: 0 auto;
  display: inline-block;
  background: rgba(0,0,0,0.88);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 3px #13141b;
  pointer-events: none;
  white-space: pre-wrap;
  display: none;
}

.tc-display-overlay {
  position: absolute;
  left: 3px;
  bottom: 3px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--theme-border);
  padding: 3px;
  min-width: 0;
  font-size: 1rem;
  z-index: 5;
}

.subtitle-overlay p,
.subtitle-overlay div {
  margin: 0;
  padding: 0;
}

/* Cuando el panel de arriba está en modo "zoom" (Ctrl+F12) */
body.zoom-top-only .subtitle-overlay {
  font-size: 3rem;
}

/* PANEL CENTRAL: subtitleList */
.center-panel {
  flex: 0 0 1000px; /* ancho inicial 1000px */
  min-width: 200px;
  background: var(--theme-panel);
  border-right: 1px solid var(--theme-border);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
}

.center-top {
  flex: 0 0 279px; /* -54px */
  min-height: 259px; /* -54px */
  display: flex;
  flex-direction: column;
}

.center-tabs {
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--theme-panel);
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
}

.tabs-header {
  display: flex;
  background: var(--theme-panel);
  border-bottom: 1px solid var(--theme-border);
  padding: 0 6px; /* reduce altura */
}

.tab-btn {
  flex: 1 1 0;
  padding: 4px 10px; /* +4px altura */
  background: transparent;
  border: none;
  color: var(--theme-text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Pestañas principales (Pestaña 1-3) compactadas a 28px */
.center-tabs:not(.nested-tabs) .tabs-header {
  height: 28px;
  padding: 0 6px;
}
.center-tabs:not(.nested-tabs) .tab-btn {
  height: 28px;
  line-height: 28px;
  padding: 0 10px;
}
.center-tabs:not(.nested-tabs) .tab-btn.tab-btn-wide {
  flex: 1.6 1 0;
  padding: 0 14px;
  white-space: nowrap;
}

/* Tabs anidadas (Notas/Idiomas) más compactas */
.center-tabs.nested-tabs .tabs-header {
  padding: 0 6px;
}
.center-tabs.nested-tabs .tab-btn {
  height: 21px; /* +6px */
  padding: 0 6px;
  font-size: 0.85rem;
}


.tab-btn.active {
  background: var(--theme-border);
  color: #fff;
}

.tab-btn:not(.active):hover {
  background: var(--theme-border);
}

.tabs-body {
  flex: 1 1 auto;
  padding: 10px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-box {
  min-height: 140px;
}

.center-tabs.nested-tabs {
  height: 100%;
  min-height: 232px;
  display: flex;
  flex-direction: column;
}

.center-tabs.nested-tabs .tabs-body {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
}

.center-tabs.nested-tabs .tab-pane {
  flex: 1 1 0;
}

.center-tabs.nested-tabs .tab-pane.active {
  display: flex;
  flex-direction: column;
}

.nested-editor {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  align-items: flex-start;
}

.nested-rich-editor {
  flex: 0 0 auto;
  height: 143px !important;
  min-height: 143px !important;
  max-height: 143px !important;
}

/* Ajuste vertical de los editores de Idioma 1-3 */
#editorTab2,
#editorTab3,
#editorTab4 {
  margin-top: 8px;
}

.center-bottom {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.subtitleList-wrapper {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}
.subtitleList-top-frame {
  height: 2px;
  background: var(--theme-panel);
  width: 100%;
  flex: 0 0 2px;
  margin: 0;
  border: none;
}

.datagrid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 8px 0;
}

.datagrid-toolbar-left {
  display: flex;
  align-items: center;
  gap: 100px;
}

.datagrid-toolbar .toolbar-label {
  color: var(--theme-text);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.datagrid-toolbar-buttons {
  display: flex;
  gap: 6px;
}

.center-status {
  flex: 0 0 auto;
  padding: 6px 10px;
  background: var(--theme-panel);
  border-top: 1px solid var(--theme-border);
  color: var(--theme-text);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 20px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-progress-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-progress {
  position: relative;
  flex: 0 0 108px; /* duplicado desde 54px */
  height: 12px;
  background: var(--theme-border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.status-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #4caf50, #81c784);
  border-radius: 6px;
}

.status-progress-text {
  position: absolute;
  right: 6px;
  font-size: 0.75rem;
  color: var(--theme-bg);
  font-weight: 700;
}

.status-fps {
  font-family: "Inconsolata", monospace;
  font-size: 0.85rem;
  cursor: pointer;
}

select.status-fps {
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
  color: var(--theme-text);
  padding: 2px 6px;
  border-radius: 4px;
}

select.status-fps:focus-visible {
  outline: 2px solid #2d6cdf;
  outline-offset: 2px;
}

select.status-fps:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-duration {
  font-family: "Inconsolata", monospace;
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6000;
}

.modal-content {
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 16px;
  width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-body {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--theme-border-strong);
  background: var(--theme-bg);
  color: var(--theme-text);
  font-size: 0.9rem;
}

.video-picker-modal .modal-content {
  width: 1120px;
  max-width: 96vw;
  height: 70vh;
  min-height: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.video-picker-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.video-picker-columns {
  display: flex;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.video-picker-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  background: var(--theme-bg);
}

.video-picker-files {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.video-picker-tree-panel {
  flex: 0 0 320px;
  min-width: 220px;
  max-width: 60%;
  padding: 8px;
}

.video-picker-files-panel {
  flex: 1 1 auto;
  min-width: 260px;
  padding: 8px;
  gap: 10px;
}

.video-picker-splitter {
  width: 8px;
  cursor: col-resize;
  background: transparent;
  position: relative;
}

.video-picker-splitter::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 2px;
  background: var(--theme-border);
  border-radius: 999px;
}

.video-picker-splitter:hover::before {
  background: var(--theme-text-muted);
}

.video-picker-tree {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 240px;
}

.video-picker-path {
  font-size: 0.8rem;
  color: var(--theme-text-muted);
  word-break: break-all;
}

.video-picker-list {
  flex: 1 1 auto;
  min-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  background: var(--theme-bg);
}

.video-picker-save-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.video-picker-save-label {
  min-width: 80px;
  font-size: 0.85rem;
  color: var(--theme-text-muted);
}

.video-picker-save-row .modal-input {
  flex: 1 1 auto;
}

.video-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.video-picker-item:last-child {
  border-bottom: none;
}

.video-picker-item:hover {
  background: var(--theme-panel);
}

.video-picker-item.selected {
  background: var(--theme-accent);
  outline: 1px solid var(--theme-accent-border);
}

.video-picker-item.is-dir .video-picker-label {
  border-color: var(--theme-accent-border);
  color: var(--theme-text);
}

.video-picker-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--theme-border);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--theme-text-muted);
}

.video-picker-name {
  flex: 1 1 auto;
  font-size: 0.9rem;
}

.video-tree-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 12px;
}

.video-tree-node.root {
  margin-left: 0;
}

.video-tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.video-tree-toggle {
  border: none;
  background: transparent;
  color: var(--theme-text-muted);
  cursor: pointer;
  width: 18px;
  padding: 0;
  text-align: center;
}

.video-tree-toggle.disabled {
  opacity: 0.4;
  cursor: default;
}

.video-tree-name {
  border: none;
  background: transparent;
  color: var(--theme-text);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  text-align: left;
  flex: 1 1 auto;
}

.video-tree-name.selected {
  background: var(--theme-accent);
  outline: 1px solid var(--theme-accent-border);
}

.video-tree-children {
  margin-left: 14px;
  display: none;
}

.video-tree-node.expanded > .video-tree-children {
  display: block;
}

.video-picker-empty {
  padding: 12px;
  color: var(--theme-text-muted);
  font-size: 0.85rem;
}

.video-picker-refresh {
  align-self: flex-start;
  margin-top: 10px;
}

.no-select {
  user-select: none;
}

.export-modal .modal-content {
  width: 80vw;
  height: 80vh;
  max-width: 1200px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

  .reports-modal .modal-content {
    width: 1300px;
    height: 748px;
    max-width: 94vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
  }
  
  .reports-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

.reports-modal-actions {
  justify-content: flex-end;
}

.speed-modal .modal-content {
  width: 600px;
  height: 494px;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.speed-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.speed-modal-actions {
  justify-content: flex-end;
}

.speed-modal-panel {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--theme-panel);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.speed-timecode-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px 12px;
  align-items: start;
}

.speed-row-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--theme-text);
  padding-top: 18px;
}

.speed-timecode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.speed-timecode-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.speed-timecode-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--theme-text);
}

.speed-tc-btn {
  padding: 0 6px;
  min-height: 18px;
  font-size: 0.7rem;
}

.speed-timecode-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--theme-border-strong);
  background: #000;
  color: var(--theme-text);
  font-family: "Inconsolata", monospace;
  font-size: 0.85rem;
}

.speed-modal .speed-tc-editor {
  width: 100%;
  box-sizing: border-box;
  min-height: 24px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--theme-border-strong);
  background: #000;
  color: var(--theme-text);
  font-family: "Roboto", sans-serif;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
}

.speed-timecode-label {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--theme-border-strong);
  background: var(--theme-border);
  color: var(--theme-text);
  font-family: "Roboto", sans-serif;
  font-size: 1.1rem;
}

.speed-factor-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: end;
}

.speed-factor-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.speed-factor-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.speed-factor-label {
  font-size: 0.75rem;
  color: var(--theme-text);
}

.speed-factor-field {
  height: 28px;
}

.speed-divider {
  height: 1px;
  background: var(--theme-border);
  margin-bottom: 10px;
}

.speed-rate-row {
  display: grid;
  grid-template-columns: auto 26px auto 1fr;
  gap: 14px;
  align-items: center;
  margin-top: -10px;
}

.speed-rate-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.speed-modal .speed-rate-toggle {
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 2px 6px;
  font-size: 0.78rem;
}

.speed-modal .speed-rate-toggle .reports-field-order,
.speed-modal .speed-rate-toggle .reports-field-spacer {
  display: none;
}

.speed-modal .speed-rate-toggle .reports-field-label {
  text-align: center;
  justify-self: center;
  width: 100%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.speed-modal .speed-rate-toggle.active {
  background: var(--theme-border);
  border-color: var(--theme-border-strong);
}

.speed-rate-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-text);
}

.speed-rate-arrow .material-symbols-outlined {
  font-size: 22px;
}

.speed-convert-btn {
  justify-self: start;
}

.speed-convert-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.speed-modal .speed-reinterpret-check {
  white-space: nowrap;
}

  .reports-split {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    gap: 12px;
    --reports-pane-offset: calc(0.9rem + 6px);
  }

.reports-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
}

  .reports-pane-left {
    flex: 0 0 260px;
    min-width: 200px;
    padding-bottom: 0;
  }

  .reports-pane-right {
    flex: 1 1 auto;
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    padding: 12px;
    background: var(--theme-panel);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: var(--reports-pane-offset);
    height: calc(100% - var(--reports-pane-offset));
  }

.reports-right-split {
  display: flex;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
}

.reports-pane-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--theme-text);
  line-height: 1;
}

.reports-columns-panel {
  flex: 0 0 240px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.reports-columns-panel.is-disabled {
  opacity: 0.6;
}

.reports-main-panel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reports-list {
  flex: 0 0 50%;
  height: 50%;
  min-height: 0;
  width: 100%;
  background: var(--theme-bg);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  color: var(--theme-text);
  padding: 6px 8px;
  font-size: 0.9rem;
}

.dcp-list {
  flex: 0 0 50%;
  height: 50%;
  min-height: 0;
  width: 100%;
  background: var(--theme-bg);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  color: var(--theme-text);
  padding: 6px 8px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.dcp-list-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: center;
}

.dcp-offset-select {
  width: 100%;
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
  color: var(--theme-text);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.85rem;
}

.dcp-list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-list-message {
  min-height: 16px;
  font-size: 0.8rem;
  color: var(--theme-text-muted);
}

  .reports-resizer {
    width: 2px;
    cursor: col-resize;
    background: var(--theme-border);
    border-radius: 2px;
    margin-top: var(--reports-pane-offset);
    height: calc(100% - var(--reports-pane-offset));
  }

  body.reports-resize-active {
    cursor: col-resize;
    user-select: none;
  }

  .reports-fields {
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    padding: 6px 8px;
    padding-top: 10px;
    background: var(--theme-bg);
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
  }

  .reports-field-toggle {
    display: grid;
    grid-template-columns: 32px 18px 1fr;
    gap: 6px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--theme-text);
    background: var(--theme-bg);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    padding: 2px 6px;
    text-align: left;
    cursor: pointer;
    width: 100%;
  }

  .reports-field-toggle.active {
    background: var(--theme-border);
    border-color: var(--theme-border-strong);
  }

  .reports-field-toggle:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  .reports-field-toggle:focus-visible {
    outline: 1px solid var(--theme-accent-border);
    outline-offset: 1px;
  }

  .reports-field-order {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--theme-text);
    min-width: 28px;
  }

  .reports-field-spacer {
    width: 18px;
    height: 18px;
  }

  .reports-field-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .reports-top-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }

  .reports-top-left,
  .reports-top-right {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .reports-top-divider {
    width: 1px;
    align-self: stretch;
    background: var(--theme-border);
  }

  .reports-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    color: var(--theme-text);
  }

  .reports-radio input[type="radio"] {
    accent-color: var(--theme-border-strong);
  }

  .reports-number-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 22px;
    font-size: 0.82rem;
    color: var(--theme-text);
  }

  .reports-number-input {
    width: 70px;
    padding: 4px 6px;
  }

  .reports-table-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 22px;
  }

  .reports-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--theme-text);
  }

  .reports-check input[type="checkbox"] {
    accent-color: var(--theme-border-strong);
  }

  .reports-color-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
  }

  .reports-color-badge {
    width: 22px;
    height: 12px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 2px;
    background: #f28c28;
  }

  .reports-color-btn {
    width: 30px;
    padding: 2px 0;
    font-weight: 700;
  }

  .reports-color-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
  }

  .reports-section-divider {
    height: 1px;
    background: var(--theme-border);
  }

  .reports-bottom-section {
    display: flex;
    gap: 12px;
  }

  .reports-bottom-left {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .reports-row {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 8px;
    align-items: center;
    font-size: 0.82rem;
    color: var(--theme-text);
  }

  .reports-font-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    margin-top: 6px;
  }

  .reports-font-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .reports-font-buttons .secondary {
    min-width: 70px;
  }

  .reports-font-orientation {
    display: flex;
    gap: 6px;
    margin-top: 6px;
  }

  .reports-font-label {
    font-size: 0.82rem;
    color: var(--theme-text);
    margin-top: 2px;
  }

  .reports-font-reset {
    font-size: 0.72rem;
  }

  .reports-font-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--theme-panel);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    z-index: 5;
  }

  .reports-font-menu.open {
    display: flex;
  }

  .reports-font-option {
    background: var(--theme-bg);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    color: var(--theme-text);
    padding: 4px 6px;
    text-align: left;
    font-size: 0.82rem;
  }

  .reports-font-option:disabled {
    opacity: 0.5;
  }

  .reports-file-box {
    border: 2px solid var(--theme-border);
    border-radius: 6px;
    padding: 10px 14px;
    background: var(--theme-bg);
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: calc(100% + 70px);
    align-self: flex-start;
    margin-top: 4px;
  }

  .reports-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .reports-input-check {
    display: inline-flex;
    align-items: center;
  }

  .reports-file-input {
    width: 80%;
    max-width: 80%;
    flex: 0 0 80%;
  }

  .reports-file-note {
    font-size: 0.78rem;
    color: var(--theme-text-muted);
    text-align: center;
    position: relative;
    left: -130px;
  }

  .reports-input-row-split .reports-pages-label {
    margin-left: 50px;
  }

  .reports-input-row-split {
    flex-wrap: nowrap;
  }

  .reports-input-row-split .reports-file-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .reports-bottom-right {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .reports-pages-label {
    font-size: 0.82rem;
  }

  .reports-orientation {
    display: flex;
    gap: 6px;
  }

  .reports-orientation-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    background: var(--theme-bg);
    color: var(--theme-text-muted);
    padding: 0;
  }

  .reports-orientation-btn.active {
    background: var(--theme-border-strong);
    border-color: var(--theme-border-strong);
    color: var(--theme-text);
  }

  .reports-log-section {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    height: 72px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
  }

  .reports-log-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--theme-text);
    width: 100%;
    box-sizing: border-box;
    background: var(--theme-bg);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    padding: 4px 6px;
    line-height: 1;
    height: 66px;
    resize: none;
    font-family: inherit;
  }

  .reports-log-box {
    display: none;
  }

.reports-progress {
  height: 12px;
  background: var(--theme-bg);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  overflow: hidden;
}

.reports-progress-left {
  margin-top: 4px;
}

  .reports-progress-bar {
    height: 100%;
    width: 0%;
    background: #4b9cf5;
  }

  .reports-pane-right [data-reports-control][disabled] {
    opacity: 0.45;
    cursor: not-allowed;
  }

.export-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.export-split {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}

.export-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.export-pane-left {
  flex: 0 0 33%;
  min-width: 180px;
  padding-right: 8px;
}

.export-pane-right {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 8px;
}

.export-pane-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.export-list {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--theme-bg);
  color: var(--theme-text);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  padding: 4px;
}

.export-list-message {
  font-size: 0.85rem;
  color: var(--theme-text-muted);
  min-height: 18px;
}

.export-resizer {
  width: 6px;
  cursor: col-resize;
  background: var(--theme-panel);
  border-radius: 3px;
  margin: 0 2px;
}

body.export-resize-active {
  cursor: col-resize;
  user-select: none;
}

.export-tabs {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--theme-panel);
}

.export-tab-list {
  width: 180px;
  background: var(--theme-panel);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--theme-border);
  padding: 6px;
  gap: 4px;
}

.export-tab-btn {
  background: var(--theme-panel);
  color: var(--theme-text);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  padding: 6px 8px;
  text-align: left;
  font-size: 0.85rem;
}

.export-tab-btn.active {
  background: var(--theme-border);
  border-color: var(--theme-border-strong);
}

.export-tab-body {
  flex: 1 1 auto;
  padding: 10px;
  overflow: auto;
}

.export-tab-panel {
  display: none;
  font-size: 0.9rem;
  line-height: 1.4;
}

.export-tab-panel.active {
  display: block;
}

.export-status {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.export-status-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.export-progress {
  flex: 1 1 auto;
  height: 12px;
  background: var(--theme-bg);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  overflow: hidden;
}

.export-progress-bar {
  height: 100%;
  width: 0;
  background: #1ed124;
  transition: width 0.2s ease;
}

.export-status-message {
  min-height: 18px;
  font-size: 0.85rem;
  color: #d1b13b;
}

.export-smpte {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.export-smpte-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px 12px;
}

.export-smpte-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.export-smpte-label {
  font-size: 0.82rem;
  color: var(--theme-text-muted);
}

.export-smpte-span-3 {
  grid-column: span 3;
}

.export-smpte-span-4 {
  grid-column: span 4;
}

.export-smpte-span-6 {
  grid-column: span 6;
}

.export-smpte-span-9 {
  grid-column: span 9;
}

.export-smpte-span-12 {
  grid-column: span 12;
}

.export-smpte-check {
  margin-top: 18px;
}

.export-smpte-textarea {
  min-height: 110px;
  resize: vertical;
}

.export-smpte-uri-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.export-smpte-uri-row .search-input {
  flex: 1 1 auto;
}

.export-smpte-uri-add {
  width: 32px;
  min-height: 30px;
  padding: 0;
}

.export-smpte-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--theme-text);
}

.export-smpte-section-header::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--theme-border);
}

.export-smpte-fade-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.export-smpte-fade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--theme-text);
}

.export-smpte-mini {
  max-width: 80px;
  padding: 4px 6px;
}

.export-smpte-unit {
  font-size: 0.8rem;
  color: var(--theme-text-muted);
}

@media (max-width: 900px) {
  .export-smpte-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .export-smpte-span-9 {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .export-smpte-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .export-smpte-span-3,
  .export-smpte-span-4,
  .export-smpte-span-6,
  .export-smpte-span-9,
  .export-smpte-span-12 {
    grid-column: span 1;
  }
  .export-smpte-check {
    margin-top: 0;
  }
}

.f9-modal .modal-content {
  width: 560px;
  max-width: 80vw;
}

.f9-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.f9-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.f9-modes label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.f9-editors {
  align-items: flex-start;
}

.f9-editor-block {
  flex: 1 1 0;
  min-width: 200px;
}

.f9-editor-label {
  font-size: 0.85rem;
  color: var(--theme-text-muted);
  margin-bottom: 4px;
}

.f9-editor-host {
  display: flex;
  align-items: center;
  gap: 8px;
}

.f9-interval-host {
  align-items: center;
}

.f9-interval-sign {
  display: inline-flex;
  width: 18px;
  height: 28px;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  background: var(--theme-bg);
  color: var(--theme-text);
}

.mark-assign-modal .modal-content {
  width: 420px;
  max-width: 80vw;
  height: 680px;
  display: flex;
  flex-direction: column;
}

.mark-assign-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.mark-assign-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark-assign-key {
  width: 36px;
  text-align: right;
  font-weight: 600;
  color: var(--theme-text);
}

.mark-assign-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1 1 auto;
}

.mark-assign-toggle.disabled {
  cursor: not-allowed;
}

.mark-assign-input {
  display: none;
}

.mark-assign-label {
  flex: 1 1 auto;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  padding: 4px 8px;
  background: var(--theme-panel);
  color: var(--theme-text);
}

.mark-assign-input:checked + .mark-assign-label {
  background: #00a000;
  border-color: #00c000;
  color: var(--theme-bg);
}

.mark-assign-input:disabled + .mark-assign-label {
  opacity: 0.5;
}

.mark-position-modal {
  align-items: flex-start;
  justify-content: flex-start;
}

.mark-position-modal .modal-content {
  width: 450px;
  max-width: 96vw;
  position: absolute;
  padding: 12px;
}

.mark-position-body {
  display: grid;
  gap: 8px;
}

.mark-position-row {
  display: grid;
  gap: 8px;
  align-items: center;
}

.mark-position-row-labels {
  grid-template-columns: repeat(4, 90px);
  gap: 0 20px;
  justify-content: start;
}

.mark-position-row-inputs {
  grid-template-columns: repeat(4, 90px);
  gap: 0 20px;
  justify-content: start;
}

.mark-position-row-inputs .modal-input {
  width: 90px;
}

.mark-position-label {
  font-size: 0.8rem;
  color: var(--theme-text-muted);
  white-space: nowrap;
  justify-self: start;
  text-align: left;
}

.mark-position-modal .modal-actions {
  justify-content: center;
}

.page-blocker {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

.page-blocker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--theme-text);
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}

.page-blocker-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: page-blocker-spin 0.9s linear infinite;
}

.page-blocker-text {
  max-width: 240px;
  line-height: 1.3;
}

@keyframes page-blocker-spin {
  to { transform: rotate(360deg); }
}

.center-toolbox {
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  min-height: 259px; /* igual altura que el contenedor de pestañas Notas/Idiomas */
  background: var(--theme-panel);
}

.center-toolbox .toolbox-divider {
  align-self: stretch;
  width: 100%;
  margin: 6px 0 8px;
  border: 0;
  border-top: 1px solid var(--theme-border);
  height: 0;
}

.center-toolbox .toolbox-divider.import-divider {
  grid-column: 1 / -1;
  margin: 2px 0 2px;
}

.center-toolbox.toolbox-compact {
  min-height: 0;
}

.center-toolbox.toolbox-tight-bottom {
  padding-bottom: 0 !important;
}

#reportsDetails .center-toolbox.reports-panel {
  padding-bottom: 10px !important;
}

#actionsDetails .center-toolbox.toolbox-tight-bottom {
  min-height: 0 !important;
  padding-top: 10px;
  padding-bottom: 10px !important;
}

#actionsDetails .center-toolbox.toolbox-tight-bottom .center-toolbox-title {
  margin-bottom: 4px;
  line-height: normal;
}

#actionsDetails .center-toolbox.toolbox-tight-bottom .panel-controls {
  gap: 6px;
}

#actionsDetails .center-toolbox.toolbox-tight-bottom .controls-row {
  gap: 6px;
  justify-content: flex-start;
}

#actionsDetails .frame-action-panel {
  align-items: flex-start;
}

#actionsDetails .frame-action-panel .panel-controls {
  align-items: flex-start;
  width: 100%;
}

#actionsDetails .frame-action-panel .controls-row {
  justify-content: flex-start !important;
  width: 100%;
}

#actionsDetails .column-actions-panel {
  min-height: 0;
  padding-bottom: 8px;
}

#actionsDetails .column-actions-panel .panel-controls {
  width: max-content;
  align-items: stretch;
}

#actionsDetails .column-actions-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: max-content;
  align-self: flex-start;
}

#actionsDetails .column-actions-row .secondary {
  width: 100%;
}

#actionsDetails .column-visibility-frame {
  align-self: stretch;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  background: var(--theme-bg);
}

#actionsDetails .column-visibility-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--theme-text);
}

#actionsDetails .column-visibility-toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#actionsDetails .column-visibility-toggle {
  grid-template-columns: 1fr;
}

#actionsDetails .column-visibility-toggle .reports-field-order,
#actionsDetails .column-visibility-toggle .reports-field-spacer {
  display: none;
}

#actionsDetails .column-visibility-toggle .reports-field-label {
  text-align: center;
  justify-self: center;
  width: 100%;
}

.note-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.note-panels {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.note-panel {
  display: flex;
  flex-direction: column;
}

.note-panel-fixed {
  flex: 0 0 440px;
  min-width: 440px;
}

.note-panel-flex {
  flex: 1 1 0;
  min-width: 0;
}

.center-toolbox-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.marks-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
}

.mark-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px;
  padding: 0;
}

.mark-card {
  display: grid;
  grid-template-columns: 36px 22px 1fr 1fr 18px 18px;
  align-items: center;
  gap: 4px;
  padding: 0;
  min-height: 20px;
  background: transparent;
  border: none;
  border-radius: 2px;
}

.mark-type-a {
  background: linear-gradient(90deg, rgba(47,106,66,0.25), transparent);
}

.mark-type-m {
  background: linear-gradient(90deg, rgba(54,83,118,0.25), transparent);
}

.mark-header-row {
  margin-bottom: -16px;
}

.mark-header-card {
  min-height: 16px;
}

.mark-header-label {
  font-size: 0.65rem;
  color: var(--theme-text-muted);
  align-self: center;
  margin-top: -35px;
}

.mark-header-spacer {
  width: 100%;
  height: 1px;
}

.mark-btn {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel);
  color: var(--theme-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 700;
}

.mark-btn.activeMark {
  width: 36px;
  background: var(--theme-accent);
  border-color: var(--theme-accent-border);
}

.mark-btn.deleteMark {
  background: #5a2f2f;
  border-color: #7a3f3f;
}

.mark-btn.filterMark {
  background: var(--theme-accent);
  border-color: var(--theme-accent-border);
}

.mark-filter-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  width: 18px;
}

.mark-filter-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mark-filter-label {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel);
  color: var(--theme-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 700;
  font-size: 0.72rem;
  user-select: none;
}

.mark-filter-input:checked + .mark-filter-label {
  background: #00a000;
  border-color: #00c000;
  color: var(--theme-bg);
}

.mark-filter-input:focus-visible + .mark-filter-label {
  outline: 1px solid var(--theme-accent-border);
  outline-offset: 1px;
}

.mark-filter-input:disabled + .mark-filter-label {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--theme-panel);
  border-color: var(--theme-border);
  color: var(--theme-border-strong);
}

.mark-solo-filter-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mark-solo-filter-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mark-solo-filter-label {
  min-width: 45px;
  padding: 3px 6px;
  font-size: 0.7rem;
  border-radius: 4px;
  background: var(--theme-border);
  color: var(--theme-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  user-select: none;
}

.mark-solo-filter-input:checked + .mark-solo-filter-label {
  background: #00a000;
  color: var(--theme-bg);
}

.mark-solo-filter-input:focus-visible + .mark-solo-filter-label {
  outline: 1px solid var(--theme-accent-border);
  outline-offset: 1px;
}

.mark-solo-filter-input:disabled + .mark-solo-filter-label {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--theme-panel);
  color: var(--theme-border-strong);
}

.orderMark {
  min-width: 22px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel);
  color: var(--theme-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
}

.orderMark.order-active {
  background: #00a000;
  border-color: #00c000;
  color: var(--theme-bg);
}

.textMark,
.positionMark {
  width: 100%;
  height: 20px;
  border-radius: 3px;
  border: 1px solid var(--theme-border);
  background: var(--theme-bg);
  color: var(--theme-text);
  padding: 2px 4px;
  font-size: 0.8rem;
}

.mark-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--theme-panel);
  border-color: var(--theme-border);
  color: var(--theme-border-strong);
}

#characterPane {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.character-grid-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 4px;
}

#characterPane .center-toolbox-title {
  margin-bottom: 2px;
}

.character-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.character-column {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

:root {
  --character-name-width: 100px;
}

.character-row {
  display: grid;
  grid-template-columns: 36px var(--character-name-width) calc(var(--character-name-width) * 1.25);
  gap: 6px;
  align-items: center;
}

.character-row .applyCharacter {
  height: 18px;
}

.character-row .nameCharacte,
.character-row .infoCharacte {
  width: 100%;
}

.character-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-end;
}

.character-actions button {
  min-width: 45px;
  padding: 3px 6px;
  font-size: 0.7rem;
}

.mark-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: flex-end;
  align-self: flex-end;
}

.mark-actions button {
  min-width: 45px;
  padding: 3px 6px;
  font-size: 0.7rem;
}

.mark-actions .mark-solo-filter-toggle {
  align-self: flex-start;
}

.marks-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.marks-pane {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
}

.search-reports-panels {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

#searchPane {
  flex: 0 0 250px;
  min-width: 250px;
}

#reportsPane {
  flex: 1 1 0;
  min-width: 0;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--theme-text);
}

.search-input,
.search-select {
  width: 100%;
  background: var(--theme-bg);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  color: var(--theme-text);
  padding: 6px 8px;
  font-size: 0.9rem;
}

.search-input:focus-visible,
.search-select:focus-visible {
  outline: 2px solid #2d6cdf;
  outline-offset: 2px;
}

#searchText.search-input {
  margin-top: -2px !important;
}

#replaceText.search-input {
  margin-top: -4px !important;
}

#searchText.search-input,
#replaceText.search-input {
  padding-top: 5.5px;
  padding-bottom: 5.5px;
  width: 50%;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  row-gap: 4px;
}

.search-actions .secondary {
  min-width: 0;
}

.search-options {
  display: flex;
  flex-direction: column;
  gap: 0px;
  font-size: 0.8rem;
  color: var(--theme-text);
  width: 100%;
  margin-top: -2px;
}

.search-options-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search-options input[type="checkbox"] {
  accent-color: #2d6cdf;
}

.search-actions button {
  font-size: 0.6rem;
}

.search-actions #btnFindNext {
  margin-left: 40px;
}

.search-actions .search-upwards-label {
  font-size: 0.8rem;
}

.search-specials {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.search-specials .search-label {
  margin-top: 0px;
}

.search-specials .search-select {
  flex: 0 0 25%;
  max-width: 25%;
  font-size: 0.6rem;
  padding: 4px 6px;
  min-width: 0;
  margin-top: -2px;
}

.error-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  min-height: 0;
}

.error-filters {
  display: grid;
  grid-template-columns: repeat(12, 40px);
  gap: 0;
  justify-content: flex-start;
  width: 480px;
  min-width: 480px;
  margin-left: 65px; /* ID 60px + 5px de desplazamiento */
}

.error-filter {
  width: 40px;
  padding: 2px 4px;
  border-radius: 2px;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel);
  color: var(--theme-text);
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
  text-align: center;
}

.error-filter.active {
  background: #2e8b57;
  border-color: #1f5f3d;
  color: var(--theme-bg);
}

.error-table-wrapper {
  width: 555px; /* 60 + (12*40) + 15 scroll */
  min-width: 555px;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

.error-list {
  width: 540px; /* 60 + 12*40 */
  min-width: 540px;
  border-collapse: collapse;
  background: var(--theme-panel);
  color: var(--theme-text);
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  table-layout: fixed;
  cursor: pointer;
}

.error-list .error-hidden-col,
.error-list td.error-hidden-col {
  display: none;
  width: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.error-list col.error-id-col {
  width: 64px !important;
}

.error-list col.error-col {
  width: 40px !important;
}

.error-list tbody tr:nth-child(odd) {
  background: var(--theme-panel);
}

.error-list td {
  padding: 4px 6px;
  text-align: center;
  border-bottom: 1px solid var(--theme-border);
  border-right: 1px solid var(--theme-border);
  font-size: 10pt;
  vertical-align: middle;
  cursor: pointer;
  color: var(--theme-text);
}

.error-list td.has-error {
  color: #d46a6a; /* rojo menos saturado para no reventar sobre azul */
}

.error-body {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 10px;
}

.error-bottom {
  position: absolute;
  top: 0;
  left: 596px; /* 61px offset + 480px errores/tabla + 55px separación solicitada */
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
}

.error-pane {
  width: auto;
  align-self: flex-start;
}

.error-radio-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 6px;
}

#editorSelectionErrorPane {
  height: 165px;
  min-height: 165px;
}

#actionsErrorPane {
  align-self: flex-end;
  height: 69px;
  min-height: 69px;
}

.error-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--theme-text);
  font-size: 0.9rem;
}

.error-radio-row input[type="radio"] {
  accent-color: #2e8b57;
}

.error-actions-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-end;
}

.error-actions-row button {
  min-width: 90px;
  padding: 3px 6px;
  font-size: 0.8rem;
}

.error-list td:last-child {
  border-right: none;
}

.error-list tbody tr:last-child td {
  border-bottom: none;
}

.error-list tr.error-row-pressed {
  background: #2a4f8a !important;
}

.error-list tr.error-row-selected {
  background: #315b9a !important;
  color: #fff;
  outline: 1px solid #4f7bcc;
  outline-offset: -2px;
}

.errors-status-bar {
}

.errors-status-text {
}

.errors-status-actions {
}

#tabExtra2 .center-toolbox {
}
.center-toolbox-label {
  display: block;
  width: 100%;
  min-height: 100%;
  padding: 8px;
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  color: var(--theme-text);
  font-family: "Inconsolata", monospace;
  font-size: 0.9rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
}

/* Ajuste de altura de la caja de pestañas principal */
.center-toolbox {
  min-height: 232px;
}

.center-toolbox.toolbox-compact {
  min-height: 0;
}

/* PANEL DERECHO: dividido en TOP y BOTTOM */
.sidebar-right {
  flex: 1 1 auto;
  min-width: 200px;
  background: var(--theme-panel);
  padding: 10px;
  overflow: visible; /* permite que los flyouts sobresalgan */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-right-top {
  flex: 2 1 0;
  min-height: 0;
  overflow: visible; /* evita recortar submenús */
}

.sidebar-right-bottom {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid var(--theme-border);
  padding-top: 6px;
}

/* SPLITTERS VERTICALES */
.vertical-splitter {
  width: 6px;
  flex: 0 0 auto;
  background: var(--theme-border);
  cursor: col-resize;
}
.vertical-splitter:hover {
  background: var(--theme-border-strong);
}

.horizontal-splitter {
  height: 6px;
  flex: 0 0 auto;
  background: var(--theme-border);
  cursor: row-resize;
}
.horizontal-splitter:hover {
  background: var(--theme-border-strong);
}

/* Modo zoom-top-only: solo panel izquierdo arriba, resto oculto */
body.zoom-top-only .center-panel,
body.zoom-top-only .sidebar-right,
body.zoom-top-only .vertical-splitter {
  display: none;
}
body.zoom-top-only .sidebar-left {
  flex: 1 1 auto;
  background: var(--theme-bg);
}
body.zoom-top-only .player-container {
  height: 100vh;
  background: var(--theme-bg);
}
body.zoom-top-only #leftBottomPanel {
  display: none;
}
body.zoom-top-only video {
  max-height: 80vh;
}

/* Marca visual de simulación */
body.simulation-active .player-container {
  box-shadow: 0 0 0 2px #e67e22 inset;
  background: #0d1b2a;
}

/* Color de fondo en simulación (F12 y Ctrl+F12) */
body.simulation-active .sidebar-left {
  background: #0d1b2a;
}
body.simulation-active .player-container {
  background: #0d1b2a;
}
body.zoom-top-only.simulation-active .sidebar-left,
body.zoom-top-only.simulation-active .player-container {
  background: var(--theme-bg);
}

@media (max-width: 1200px) {
  .layout {
    flex-direction: column;
    height: auto;
  }
  .sidebar-left,
  .center-panel,
  .sidebar-right {
    max-width: none;
    width: 100%;
    min-width: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--theme-border);
  }
  .sidebar-right {
    border-bottom: none;
  }
  .player-container {
    height: auto;
  }
  .vertical-splitter {
    width: 100%;
    height: 4px;
    cursor: row-resize;
  }
}

h1 {
  font-size: 1.3rem;
  margin: 0 0 8px 0;
  color: #fff;
  text-align: center;
}

video {
  width: 100%;
  max-height: 33vh;
  object-fit: contain;
  background: #000000;
  border-radius: 6px;
  display: block;
}

.waveform-container {
  position: relative;
  width: 100%;
  height: 60px;
  min-height: 60px;
  max-height: 60px;
  background: var(--theme-bg);
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  overflow: hidden;
}

.waveform-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.waveform-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #2d6cdf;
  box-shadow: 0 0 6px rgba(45, 108, 223, 0.7);
  pointer-events: none;
}

.waveform-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--theme-text-muted);
  background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.55));
  text-align: center;
  padding: 0 8px;
  pointer-events: none;
}

.waveform-zoom-controls {
  position: absolute;
  right: 3px;
  top: 2px;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.15s ease;
}

#waveformContainer .waveform-zoom-controls {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#waveformContainer:hover .waveform-zoom-controls,
#waveformContainer:focus-within .waveform-zoom-controls {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.waveform-zoom-controls .material-symbols-outlined {
  font-size: 12px;
}

.waveform-zoom-controls button {
  background: #a85e1f;
  color: #fff;
  border: 1px solid #c07b3a;
  padding: 0 3px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1;
  min-width: 18px;
  min-height: 0;
  height: 14px;
  cursor: pointer;
  font-family: "Inconsolata", monospace;
}
.waveform-overlay-btn {
  background: var(--theme-text);
  color: #13141b !important;
  border-color: var(--theme-text);
}

.waveform-zoom-controls button:hover {
  filter: brightness(1.1);
}

.waveform-zoom-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.waveform-overlay-alpha-stack,
.waveform-zoom-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.waveform-overlay-btn {
  color: #13141b !important;
  font-weight: 700;
}
.wave-overlay-transparent {
  color: rgba(0, 0, 0, 0.2) !important;
}
.waveform-zoom-stack #waveZoomReset {
  margin-left: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
}
.tc-playback-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.tc-playback-row .playback-controls {
  margin-left: auto;
}
.row-tc-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.tc-editors-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
  flex: 1 1 auto;
}

#tcInEditor {
  margin-right: 0;
}

#tcOutEditor {
  margin-right: 0;
}
.tc-timecodes {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.tc-style-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.panel-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-controls.import-controls {
  display: grid;
  grid-template-columns: max-content 1fr;
  row-gap: 6px;
  align-items: center;
}

.panel-controls.import-controls .secondary {
  grid-column: 1;
  width: 100%;
}

.panel-controls.import-controls #btnImportSrt {
  order: 1;
}

.panel-controls.import-controls #btnImportTextList {
  order: 2;
}

.panel-controls.import-controls #btnImportRawList {
  order: 3;
}

.panel-controls.import-controls #btnImportTemplate {
  order: 4;
}

.panel-controls.import-controls #btnImportXub {
  order: 5;
}

.panel-controls.import-controls .import-divider {
  order: 6;
}

.panel-controls.import-controls #btnExport {
  order: 7;
}

.panel-controls.import-controls .export-dcp-group {
  grid-column: 1;
  order: 8;
  position: relative;
  width: 100%;
}

.panel-controls.import-controls .export-dcp-group .secondary {
  width: 100%;
}

.export-dcp-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  z-index: 6;
  min-width: 100%;
}

.export-dcp-menu[hidden] {
  display: none;
}

.export-dcp-option {
  width: 100%;
  text-align: left;
  background: var(--theme-border);
  color: var(--theme-text);
}

.special-chars-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 6px;
}

.special-char-btn {
  min-width: 0;
  padding: 4px 0;
  font-family: "Inconsolata", monospace;
  font-size: 0.95rem;
}

#btnChangeSpeed,
#btnResizeSpeed {
  width: 100%;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.scene-detect-status {
  font-weight: 600;
  font-size: 0.9rem;
}

.scene-status-generated {
  color: #58d26f;
}

.scene-status-missing {
  color: #ff6b6b;
}

.scene-status-generating {
  color: #4aa3ff;
}

.scene-detect-actions {
  gap: 8px;
}

.scene-detect-btn {
  width: 44px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.scene-filter-row {
  justify-content: flex-start;
  gap: 10px;
}

.scene-filter-threshold {
  width: 52px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel);
  color: var(--theme-text);
  padding: 0 6px;
  font-size: 0.75rem;
  line-height: 1;
}

.frames-info-panel {
  --frames-info-gap: 20px;
  --frames-input-width: calc((100% - var(--frames-info-gap)) / 4 + 20px);
}

.frames-info-panel .frames-info-row {
  display: grid;
  grid-template-columns: var(--frames-input-width) var(--frames-input-width);
  column-gap: var(--frames-info-gap);
  align-items: center;
  justify-content: start;
  justify-items: start;
}

.frames-info-panel .frames-info-row.frames-info-row-single {
  grid-template-columns: max-content var(--frames-input-width);
}

.frames-info-panel .frames-info-label {
  font-size: 0.82rem;
  color: var(--theme-text);
}

.frames-info-panel .frames-info-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--theme-border-strong);
  background: var(--theme-bg);
  color: var(--theme-text);
  font-size: 0.85rem;
  text-align: center;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.playback-controls .volume-slider {
  width: 72px;
  height: 14px;
  margin-right: 6px;
  accent-color: var(--theme-accent);
  cursor: pointer;
}

.spacer { flex: 1; }

.tc-display {
  font-family: "Roboto", sans-serif;
  font-size: 1.35rem;
  padding: 3px 7px;
  background: #13141b;
  border-radius: 4px;
  border: 1px solid var(--theme-border);
  min-width: 150px;
  text-align: center;
}

.tc-display.tc-display-overlay {
  position: absolute;
  left: 5px;
  top: 7px;
  bottom: auto;
  transform: none;
  box-sizing: border-box;
  padding: 9px 7px;
  font-size: 1.2rem;
  line-height: 1;
  height: calc(1.2rem + 15px);
  min-width: 0;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.zoom-top-only .tc-display.tc-display-overlay {
  left: 6px;
}

.color-frame {
  margin-top: 6px;
  width: 100%;
  min-height: 24px; /* altura reducida */
  border: 1px solid transparent; /* borde invisible */
  box-sizing: border-box;
}
.color-frame-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tc-inline-editor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tc-inline-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--theme-text);
}

.tc-editor {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px;
  min-height: 20px;
  border: 1px solid var(--theme-border-strong);
  border-radius: 4px;
  background: var(--theme-bg);
  font-family: "Roboto", sans-serif;
  font-size: 1.1rem;
  cursor: text;
}

.tc-editor:focus-visible {
  outline: 2px solid #2d6cdf;
  outline-offset: 2px;
}

.tc-dur-label {
  margin-left: 0;
  font-family: "Roboto", sans-serif;
  font-size: 1.1rem;
  color: var(--theme-text);
  min-width: 77px;
  max-width: 77px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  background: var(--theme-bg); /* igual al editor TC */
  border: 1px solid var(--theme-border-strong);
  border-radius: 4px;
  text-align: center;
}

.tc-mini-matrix {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  padding-left: 0;
  gap: 0;
  align-self: center;
  height: 32px;
  line-height: 1;
}

.zoom-top-only .tc-mini-matrix {
  margin-left: 30px;
}

.tc-mini-row {
  display: flex;
  height: 17px;
}

.tc-mini-row + .tc-mini-row {
  margin-top: 2px; /* separa las filas */
}

.tc-mini-label,
.tc-mini-badge {
  box-sizing: border-box;
  width: 16px;
  height: 17px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel);
  color: var(--theme-text);
  font-size: 0.75rem;
  line-height: 16px;
  text-align: center;
  border-radius: 0;
}

.tc-mini-label {
  margin-right: 3px;
}

.tc-mini-badge {
  cursor: pointer;
}

.tc-mini-row .tc-mini-badge:not(:first-child) {
  margin-left: 0px; /* deja 1px visible de cada lado por el borde */
}

.tc-mini-row .tc-mini-label + .tc-mini-badge {
  margin-left: 0px; /* separa la etiqueta del primer badge */
}

.tc-mini-row + .tc-mini-row .tc-mini-label,
.tc-mini-row + .tc-mini-row .tc-mini-badge {
  margin-top: -1px; /* elimina hueco vertical */
}

.tc-mini-badge.active {
  background: #00a000;
  border-color: #00c000;
  color: var(--theme-bg);
}

.tc-editor.error {
  background: #351515;
  border-color: #a94442;
  color: #f7c4c4;
}

.tc-digit {
  display: inline-block;
  min-width: 8px;
  padding: 1px 0;
  text-align: center;
  border-radius: 3px;
}

.tc-digit.active {
  outline: 1px solid #4d90fe;
  background: #1f3d73;
}

.tc-editor.error .tc-digit.active {
  outline-color: #f06f6f;
  background: #542020;
}

.tc-sep {
  padding: 0 1px;
  opacity: 0.7;
}

.info-tag {
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
}
#nextSubCountdown {
  font-size: 1rem;
  padding: 4px 8px;
  margin-right: 20px;
}
.next-sub-label {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  margin-right: 5px;
  height: 100%;
}

.next-sub-frame {
  display: none;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent; /* marco invisible */
  min-height: 34px;
  min-width: 34px;
  padding-right: 20px; /* separa del resto de botones */
}

body.simulation-active .next-sub-frame,
body.zoom-top-only .next-sub-frame {
  display: inline-flex;
}

button {
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  background: #2d6cdf;
  color: #fff;
  transition: background 0.15s, transform 0.05s;
}

button.secondary { background: var(--theme-border); }
button.danger { background: #c0392b; }
button:hover { filter: brightness(1.1); }

.icon-button {
  background: var(--theme-border);
  color: var(--theme-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 14px;
  padding: 0 4px; /* igual que los botones de reset de los editores */
  font-size: 0.82rem;
  line-height: 1;
}

.frame-action-btn {
  font-size: 0.75rem;
}

.frame-action-panel {
  position: relative;
}

.frame-action-modal {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  z-index: 6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.frame-action-modal #frameActionCancel {
  margin-top: 6px;
}

.frame-action-modal button {
  width: 100%;
  font-size: 0.75rem;
}

input[type="file"] {
  color-scheme: dark;
}

#seekBar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--theme-border);
  cursor: pointer;
}

.seekbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  width: 100%;
  margin-top: 8px;
}

.seekbar-row #seekBar {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.seekbar-row .playback-controls {
  flex: 0 0 auto;
}

#seekBar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2d6cdf;
  border: 1px solid #fff;
  margin-top: -4px;
}

/* Editores enriquecidos */
.editor-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 1px;
}

.editor-sub-wrapper, .editor-spot-wrapper {
  gap: 2px;
}

.editor-title {
  font-size: 0.85rem;
  color: var(--theme-text);
  position: relative;
  top: -4px;
}
.editable-title {
  padding: 2px 0;
  margin-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  direction: ltr !important;
  unicode-bidi: bidi-override;
  text-align: left !important;
  min-width: 25ch;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.editor-toolbar button {
  padding: 4px 8px;
  font-size: 0.8rem;
}

.editor-style-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.editor-style-row {
  display: flex;
  align-items: center;
  padding: 2px 0;
  margin-bottom: 8px;
}

.editor-style-frame {
  display: flex;
  align-items: center;
  margin-left: 12px;
  background: transparent;
  border: none;
  position: relative;
  top: -4px;
}

.editor-style-inline .italic-btn {
  margin-right: 4px;
}

.workspace-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 10px;
}

.workspace-selector-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.workspace-actions-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
}

.workspace-label {
  font-size: 0.92rem;
  color: var(--theme-text);
  font-weight: 600;
}

.workspace-selector {
  width: 100%;
  min-height: 140px;
  background: var(--theme-panel);
  color: var(--theme-text);
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  padding: 6px;
  font-family: "Inconsolata", monospace;
  font-size: 1rem;
}

.workspace-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.workspace-actions .secondary {
  flex: 0 0 auto;
  padding: 3px 3px;
  min-width: 22px;
  min-height: 22px;
  font-size: 14px;
}

.workspace-save-panel {
  display: none;
  flex-direction: row;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  align-items: stretch;
  height: 22px;
  margin-left: 4px;
}

.workspace-save-panel.visible {
  display: inline-flex;
}

.workspace-input {
  width: auto;
  padding: 0;
  margin: 0;
  border: 1px solid var(--theme-border);
  border-radius: 4px 0 0 4px;
  background: var(--theme-panel);
  color: var(--theme-text);
  font-size: 0.95rem;
  flex: 0 0 32px;
  height: 100%;
}

.workspace-save-actions {
  display: flex;
  gap: 0;
  justify-content: flex-start;
  height: 100%;
}

.workspace-save-actions .secondary {
  padding: 0 6px;
  min-width: 22px;
  min-height: 22px;
  font-size: 12px;
  border-radius: 0;
}

.workspace-save-actions .secondary:first-child {
  border-radius: 0 0 0 0;
}

.workspace-save-actions .secondary:last-child {
  border-radius: 0 4px 4px 0;
}

.editor-style-inline .secondary,
.editor-style-inline .italic-btn {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  line-height: 1;
}

.editor-toolbar .italic-btn {
  font-style: italic;
}

.color-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  min-width: 0;
  border-radius: 3px;
  border: 1px solid var(--theme-border-strong);
}

.color-frame-red {
  width: 22px;
  height: 22px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
}

.color-frame-blue {
  width: 22px;
  height: 22px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
}

.color-frame-blue-yellow {
  width: 22px;
  height: 22px;
  background: #ffff00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
}

.color-frame-inner .secondary,
.color-frame-inner .italic-btn {
  height: 18px;
  min-height: 18px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  line-height: 1;
}

.color-frame-inner .italic-btn {
  font-style: italic;
  font-weight: 600;
}

/* Ocultar controles de formato en modo simulación */
body.simulation-active .color-frame-inner .italic-btn,
body.simulation-active .color-frame-inner .secondary#btnClearFormat,
body.simulation-active .color-frame-inner .color-btn {
  display: none;
}

.rich-editor {
  width: 100%;
  height: 143px;
  min-height: 143px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel);
  color: var(--theme-text);
  font-family: "Inconsolata", monospace;
  font-size: 1.2rem;
  line-height: 1.18;
  white-space: pre;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  top: -5px; /* 1px lower than previous */
}

/* Fuerza monospace real en editores y contenido */
.rich-editor,
.rich-editor *,
.ql-editor,
.ql-editor * {
  font-family: "Inconsolata", monospace !important;
  font-variant-ligatures: none;
  letter-spacing: 0;
}

.ql-container.ql-snow {
  border: none;
  background: var(--theme-panel);
}

.ql-container .ql-editor {
  padding: 0;
  border: 1px solid transparent; /* ocultar marco interior */
  border-radius: 6px;
  background: var(--theme-panel);
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  min-height: 130px; /* 143px - 13px */
  height: 130px;     /* 143px - 13px */
  white-space: pre;
  overflow-x: auto;
  word-wrap: normal;
}

/* Evita scroll permanente en editores anidados (notas / idiomas) */
.rich-editor.nested-rich-editor {
  overflow-y: hidden;
}
.rich-editor.nested-rich-editor .ql-editor {
  overflow-y: auto;
}

.ql-container .ql-editor:focus {
  outline: 1px solid #2d6cdf;
  outline-offset: -1px;
  box-shadow: 0 0 0 1px #2d6cdf inset;
}

.ql-container .ql-tooltip,
.ql-toolbar {
  display: none !important;
}

.errors-frame {
  width: 100%;
  min-height: calc(var(--error-frame-height) - 2px);
  height: calc(var(--error-frame-height) - 2px);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0;
  margin-top: 6px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.editor-sub-wrapper .errors-frame,
.editor-spot-wrapper .errors-frame,
.nested-editor .errors-frame {
  margin-top: -3px;
}

.errors-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  background: transparent;
}

.errors-inner .error-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  min-width: 32px; /* igualar al error más ancho (>máx) */
  max-width: 32px;
  border-radius: 2px;
  background: #00a000;
  color: var(--theme-bg);
  font-family: "Inconsolata", monospace;
  font-size: 0.68rem;
  line-height: 1;
  border: 1px solid #007000;
}

.errors-inner .error-chip.state-green {
  background: #00a000;
  color: var(--theme-bg);
  border-color: #007000;
}

.errors-inner .error-chip.state-red {
  background: #c0392b;
  color: var(--theme-bg);
  border-color: #8e241d;
}

.rich-editor:focus {
  outline: 1px solid #2d6cdf;
  outline-offset: -1px;
  box-shadow: 0 0 0 1px #2d6cdf inset;
}

.editor-sub-wrapper {
  position: relative;
}

.editor-spot-wrapper {
  position: relative;
}

/* Cabecera editor + toggle */
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.editor-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.font-zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  top: -5px; /* sube 3px los botones + - R */
}
.spacer-20 {
  width: 20px;
  flex: 0 0 20px;
}
.font-zoom-controls .secondary {
  padding: 0 6px;
  font-size: 0.82rem;
}

.font-zoom-controls .material-symbols-outlined,
.datagrid-toolbar-buttons .material-symbols-outlined,
.editor-style-inline .material-symbols-outlined {
  font-size: 14px;
}

.font-zoom-controls .material-symbols-outlined {
  position: relative;
  top: 2px;
}
.datagrid-toolbar-buttons .material-symbols-outlined {
  position: relative;
  top: 2px;
}

.datagrid-toolbar-buttons .secondary {
  padding: 0 6px;
  font-size: 0.82rem;
  min-height: 14px;
}
.datagrid-toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.datagrid-toolbar-buttons button + button {
  margin-left: 0;
}
.datagrid-toolbar-buttons .secondary + .secondary:last-child {
  margin-left: 4px;
}

.spell-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--theme-text-muted);
  position: relative;
  top: -6px; /* sube 3px los conmutadores de subtítulos y spotting */
}

/* Toggle estilo slider */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: var(--theme-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: inset 0 0 0 1px #13141b;
  transition: background 0.2s ease;
}

.toggle-icon {
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.toggle-icon.icon-off {
  opacity: 1;
}

.toggle-thumb {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--theme-text);
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6);
  transition: transform 0.2s ease;
}

.toggle input:checked ~ .toggle-track {
  background: #22b573;
}

.toggle input:checked ~ .toggle-track .icon-on {
  opacity: 1;
}

.toggle input:checked ~ .toggle-track .icon-off {
  opacity: 0;
}

.toggle input:checked ~ .toggle-thumb {
  transform: translateX(22px);
}

.horizontal-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--theme-border-strong);
  pointer-events: none;
  z-index: 2;
}

.vertical-guide {
  position: absolute;
  width: 1px;
  background: var(--theme-border-strong);
  pointer-events: none;
  z-index: 2;
}

.vertical-distance-label {
  position: absolute;
  font-size: 0.7rem;
  color: var(--theme-text-muted);
  background: var(--theme-panel);
  padding: 1px 3px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 3;
  font-family: "Inconsolata", monospace;
}

.mod-badge {
  display: inline-block;
  width: 28px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid #fff;
  margin-left: 6px;
  vertical-align: middle;
}

.subtitleList-title {
  font-size: 1rem;
  margin-bottom: 6px;
  font-weight: 600;
  font-family: Arial, Helvetica, sans-serif;
}

table.subtitleList {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  user-select: none;
}

table.subtitleList thead {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--theme-panel);
  background: color-mix(in srgb, var(--theme-panel) 80%, #ffffff 20%);
}

table.subtitleList thead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--theme-panel);
  background: color-mix(in srgb, var(--theme-panel) 80%, #ffffff 20%);
  pointer-events: none;
}

table.subtitleList th,
table.subtitleList td {
  border: 1px solid var(--theme-border);
  padding: 4px 6px;
  text-align: left;
  vertical-align: middle;
  user-select: none;
}

/* ENTRADA centrada; DURACIÓN alineada a la derecha */
table.subtitleList th:nth-child(3),
table.subtitleList td:nth-child(3) {
  text-align: center;
}

table.subtitleList th:nth-child(4),
table.subtitleList td:nth-child(4) {
  text-align: center;
}

table.subtitleList th:nth-child(5),
table.subtitleList td:nth-child(5) {
  text-align: right;
}

/* Igualar ancho ENTRADA/SALIDA */
table.subtitleList col:nth-child(3),
table.subtitleList col:nth-child(4) {
  width: 110px;
}

table.subtitleList th {
  background: var(--theme-panel);
  background: color-mix(in srgb, var(--theme-panel) 80%, #ffffff 20%);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  position: sticky;
  top: 0; /* evita el salto de 1px al fijar la cabecera con el primer scroll */
  z-index: 2;
  box-shadow: none; /* sombreado se aplica en thead para cubrir la unión con el contenido */
}

table.subtitleList td {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Celdas de texto (Subtítulos/Spotting/Notas/Idiomas): sin wrap y sin ellipsis */
table.subtitleList th:nth-child(6),
table.subtitleList th:nth-child(7),
table.subtitleList th:nth-child(8),
table.subtitleList th:nth-child(9),
table.subtitleList td:nth-child(6),
table.subtitleList td:nth-child(7),
table.subtitleList td:nth-child(8),
table.subtitleList td:nth-child(9) {
  white-space: pre; /* respetar saltos manuales, sin word-wrap */
  word-wrap: normal;
  overflow: hidden;
  text-overflow: clip;
  vertical-align: middle;
}
table.subtitleList td:nth-child(6),
table.subtitleList td:nth-child(7),
table.subtitleList td:nth-child(8),
table.subtitleList td:nth-child(9) {
  line-height: 1.2;
  max-height: 2.4em; /* limita a 2 líneas (aprox) */
}
table.subtitleList td:nth-child(6) > *,
table.subtitleList td:nth-child(7) > *,
table.subtitleList td:nth-child(8) > *,
table.subtitleList td:nth-child(9) > * {
  display: block;
  white-space: pre;
  overflow: hidden;
  text-overflow: clip;
  line-height: inherit;
  max-height: inherit;
}

table.subtitleList tr:nth-child(even) {
  background: var(--theme-panel);
}

table.subtitleList tr {
  cursor: pointer;
}

table.subtitleList tr.mark-filter-match {
  background: color-mix(in srgb, var(--theme-bg) 90%, #ffffff 10%);
}

table.subtitleList tr.mark-filter-match:nth-child(even) {
  background: color-mix(in srgb, var(--theme-panel) 90%, #ffffff 10%);
}

table.subtitleList tr.selected {
  background: #315b9a !important;
}

table.subtitleList .hidden-col,
table.subtitleList col.hidden-col {
  display: none !important;
}

/* Forzamos ocultar la segunda columna (ID oculta) en el grid */
table.subtitleList th:nth-child(2),
table.subtitleList td:nth-child(2),
table.subtitleList col:nth-child(2) {
  display: none !important;
}

table.subtitleList th:nth-child(6),
table.subtitleList th:nth-child(7) {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: inherit;
}

table.subtitleList th:nth-child(n+10),
table.subtitleList td:nth-child(n+10),
table.subtitleList col:nth-child(n+10) {
  display: none;
}

table.subtitleList td:nth-child(6),
table.subtitleList td:nth-child(7) {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: var(--grid-text-size) !important;
}

/* Sin word-wrap en SUBTÍTULOS y SPOTTING */
table.subtitleList td:nth-child(6),
table.subtitleList td:nth-child(7),
table.subtitleList td:nth-child(8),
table.subtitleList td:nth-child(9) {
  white-space: pre-wrap;
  word-wrap: normal;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1.2;
}

table.subtitleList td:nth-child(6) p,
table.subtitleList td:nth-child(7) p,
table.subtitleList td:nth-child(8) p,
table.subtitleList td:nth-child(9) p,
table.subtitleList td:nth-child(6) div,
table.subtitleList td:nth-child(7) div,
table.subtitleList td:nth-child(8) div,
table.subtitleList td:nth-child(9) div {
  margin: 0;
  padding: 0;
}

details {
  background: var(--theme-panel);
  border-radius: 6px;
  border: 1px solid var(--theme-border);
  padding: 4px 6px;
  margin-bottom: 6px;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

summary::marker { color: var(--theme-text-muted); }

details[open] > summary {
  margin-bottom: 6px;
}

/* ======= MEN? LATERAL (panel derecho) ======= */
.app-menu {
  border-radius: 6px;
  overflow: visible; /* permite que los submen?s flotantes no se recorten */
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  font-family: Arial, Helvetica, sans-serif;
  margin-bottom: 8px;
  position: relative;
  width: 180px;
  min-width: 160px;
}

.app-menu-header {
  background: var(--theme-panel); /* tono oscuro para contrastar con el cuerpo */
  color: var(--theme-text);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.3px;
  font-size: 0.95rem;
}

.app-menu-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
  justify-content: flex-start;
}

.app-menu-burger {
  font-size: 1.1rem;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0;
}

.app-menu-body {
  background: var(--theme-text);
  border: 1px solid var(--theme-text-muted);
  display: none;
  position: absolute; /* evitar que empuje el layout al abrir */
  top: 100%;
  left: 0;
  width: auto;
  min-width: 210px;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.app-menu-body.open {
  display: block;
}

.app-menu-body ul {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.menu-item {
  border-top: none;
}

.menu-item.has-children {
  position: relative;
}

.menu-link {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--theme-bg);
  text-align: left;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  cursor: pointer;
  gap: 10px;
}

.menu-link-main {
  background: transparent;
}

.menu-link:hover {
  background: var(--theme-text);
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.menu-icon-left {
  display: none;
  width: 0;
  height: 0;
}

.menu-text {
  white-space: nowrap;
  color: var(--theme-bg);
}

.menu-accel {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--theme-bg);
}

.menu-caret {
  font-size: 0.7rem;
  opacity: 0.8;
  color: var(--theme-bg);
  transition: transform 0.15s ease;
  margin-left: auto;
}

.menu-item.menu-open > .menu-link .menu-caret {
  transform: rotate(90deg);
}

.menu-level {
  background: var(--theme-text);
  padding: 0;
  border: none;
}

.menu-item.has-children > .menu-level {
  position: absolute;
  top: -4px;
  left: calc(100% - 2px);
  min-width: 220px;
  display: none;
  background: var(--theme-text);
  border: 1px solid var(--theme-text-muted);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  z-index: 2000;
}

.menu-item.has-children.menu-open > .menu-level,
.menu-item.has-children:hover > .menu-level {
  display: block;
}

.menu-separator {
  margin: 4px 6px;
  border-top: 1px solid var(--theme-text-muted);
  padding: 0;
  height: 0;
}

/* Toasts */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5000;
  pointer-events: none;
}

.toast {
  background: rgba(0, 0, 0, 0.88);
  color: var(--theme-text);
  padding: 10px 14px;
  border-radius: 6px;
  min-width: 180px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Dropzone (Acotador) */
.dropzone {
  border: 2px dashed var(--theme-border);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  color: var(--theme-bg);
  background-color: var(--theme-border-strong);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.dropzone:hover {
  border-color: var(--theme-border);
  background-color: var(--theme-border-strong);
}

.dropzone.dragover {
  border-color: var(--theme-bg);
  background-color: var(--theme-border-strong);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25);
}

.dropzone-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 8px auto;
}

/* Acotador */
.dropzone-compact {
  width: 54px;
  height: 54px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background-color: var(--theme-panel);
  border-color: var(--theme-border);
  color: var(--theme-text);
  cursor: default;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}

.dropzone-compact:hover,
.dropzone-compact.dragover {
  border-color: var(--theme-border);
  background-color: var(--theme-panel);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}

.dropzone-compact .dropzone-img {
  max-width: 32px;
  margin: 0;
}

.acotador-panel {
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acotador-block {
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  padding: 8px;
  background: var(--theme-panel);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.acotador-title {
  font-weight: 600;
  color: var(--theme-text);
  font-size: 0.95rem;
}

.acotador-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.acotador-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--theme-text);
}

.acotador-field-inline {
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 6px;
}

.acotador-field .tc-editor {
  width: auto;
  min-width: fit-content;
  justify-content: center;
  align-self: flex-start;
}

.acotador-tc-editor {
  font-family: "Inconsolata", monospace;
  font-size: 1rem;
  padding: 3px 8px;
  min-height: 20px;
  border-color: var(--theme-border);
  background: var(--theme-bg);
}

.acotador-tc-editor .tc-digit,
.acotador-tc-editor .tc-sep {
  color: var(--theme-text);
}

.acotador-label-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.acotador-label-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  background: var(--theme-bg);
  color: var(--theme-text);
  font-family: "Inconsolata", monospace;
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 104px;
  align-self: flex-start;
}

.acotador-save-btn {
  padding: 3px 8px;
  min-width: 30px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.acotador-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.acotador-actions .secondary {
  flex: 0 0 auto;
}

.acotador-config-badge {
  width: 16px;
  height: 16px;
  border: 1px solid #0b8a1f;
  background: #1ed124;
  border-radius: 2px;
}

.acotador-config-badge.modified {
  border-color: #8a1f1f;
  background: #d12b2b;
}

.acotador-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.acotador-progress {
  flex: 1 1 auto;
  height: 12px;
  background: var(--theme-bg);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  overflow: hidden;
}

.acotador-progress-bar {
  height: 100%;
  width: 0%;
  background: #4b9cf5;
}

body.zoom-top-only .video-wrapper,
body.zoom-top-only .video-wrapper video {
  height: auto;
  min-height: 0;
  max-height: calc(100vh - 220px); /* evita desbordar y deja controles visibles */
  flex: 1 1 auto;
  object-fit: contain;
}

body.zoom-top-only .video-wrapper #omakase-player,
body.zoom-top-only .video-wrapper #omakase-player video {
  height: auto;
  min-height: 0;
  max-height: calc(100vh - 220px);
  flex: 1 1 auto;
  object-fit: contain;
}
















