@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
:root{color-scheme:dark;--bg:#090e18;--surface:#111a29;--surface2:#172235;--line:#26344a;--muted:#8fa0b8;--text:#edf3fb;--accent:#39c889;--blue:#4388f5}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,sans-serif;min-height:100vh}.topbar{height:68px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px;background:#0c1320}.brand{display:flex;align-items:center;gap:11px;color:var(--text);text-decoration:none;font-size:14px;font-weight:800;letter-spacing:1.5px}.brand small{display:block;color:var(--muted);font-size:9px;letter-spacing:2px;margin-top:3px}.brand-mark{width:34px;height:34px;border-radius:10px;background:var(--accent);color:#062316;display:grid;place-items:center;font-size:20px;font-weight:800}.top-actions,.toolbar-actions{display:flex;align-items:center;gap:10px}.count{font-size:10px;color:var(--muted);letter-spacing:1px;margin-right:8px}.button{border:1px solid transparent;border-radius:8px;padding:10px 13px;font:600 12px Inter;cursor:pointer;color:var(--text);white-space:nowrap}.primary{background:var(--accent);color:#052217}.secondary{background:#182438;border-color:#2a3a52}.button:hover{filter:brightness(1.12)}.channel-browser{margin:0 0 14px;padding:14px;background:var(--surface);border:1px solid var(--line);border-radius:11px}.channel-browser[hidden]{display:none}.channel-browser-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}.channel-browser-head strong{display:block;font-size:13px}.channel-browser-head small{display:block;color:var(--muted);font-size:10px;margin-top:4px}.channel-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.channel-item{display:flex;align-items:center;gap:10px;min-width:0;padding:9px;background:#0d1624;border:1px solid var(--line);border-radius:8px}.channel-number{font-size:10px;color:var(--accent);font-weight:700}.channel-details{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.channel-details strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.channel-details small{font-size:9px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.channel-add{padding:7px 9px;font-size:10px}.channel-add:disabled{opacity:.45;cursor:not-allowed}.channel-loading,.channel-error{grid-column:1/-1;color:var(--muted);font-size:12px;padding:12px}.channel-error{color:#ffaaa5}.playlist-select option{background:#182438;color:var(--text)}main{padding:22px 24px 14px;max-width:1900px;margin:auto}.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;gap:12px}.toolbar-title{display:flex;align-items:center;gap:12px}.toolbar-title strong{font-size:14px}.toolbar-title small{display:block;color:var(--muted);font-size:11px;margin-top:4px}.live-dot{width:9px;height:9px;border-radius:50%;background:var(--accent);box-shadow:0 0 12px #39c88999}.file-button{position:relative;overflow:hidden}.file-button input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}.dashboard{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;min-height:0}.panel{grid-column:span 1;min-width:0;min-height:0;background:var(--surface);border:1px solid var(--line);border-radius:11px;overflow:hidden;display:flex;flex-direction:column;position:relative}.panel.wide{grid-column:span 2}.panel.small{grid-column:span 1}.panel.full{grid-column:span 3}.panel.tall{grid-row:span 2}.panel-head{height:39px;flex:0 0 39px;display:flex;align-items:center;justify-content:space-between;padding:0 10px 0 13px;background:#131e2e;border-bottom:1px solid var(--line);gap:8px}.panel-name{font-size:11px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.panel-state{font-size:9px;color:var(--accent);letter-spacing:.8px;margin-left:auto;white-space:nowrap}.panel-tools{display:flex;gap:4px}.icon-button{width:26px;height:25px;border:0;border-radius:5px;background:#223149;color:#cbd6e5;cursor:pointer;font-size:13px}.icon-button:hover{background:#344a68}.player-wrap{position:relative;flex:1;min-height:0;background:#05080e;display:grid;place-items:center}.player-wrap iframe,.player-wrap video{width:100%;height:100%;border:0;position:absolute;inset:0}.player-wrap video{object-fit:contain}.placeholder{color:#708198;text-align:center;font-size:11px;padding:15px}.placeholder b{display:block;font-size:24px;margin-bottom:8px;color:#40536e}.panel-foot{height:28px;flex:0 0 28px;display:flex;align-items:center;justify-content:space-between;padding:0 10px;color:#8292a9;font-size:9px;background:#101827}.panel-foot button{border:0;background:none;color:#aab8ca;font-size:10px;cursor:pointer}.panel.dragging{opacity:.45}.panel.drop-target{outline:2px dashed var(--accent);outline-offset:2px}.empty-state{border:1px dashed #31435c;border-radius:12px;padding:50px 15px;text-align:center;color:var(--muted)}.empty-state h2{color:var(--text);font-size:17px}.empty-state p{font-size:12px;margin-bottom:20px}.empty-icon{font-size:32px;color:var(--accent)}footer{display:flex;justify-content:space-between;color:#66768d;font-size:10px;padding:16px 2px}.playlist-info{background:#132b26;border:1px solid #20513f;color:#b8ecd6;border-radius:8px;padding:10px 13px;font-size:11px;margin-bottom:12px}.dialog{background:#111a29;color:var(--text);border:1px solid var(--line);border-radius:14px;width:min(460px,calc(100% - 28px));padding:22px;box-shadow:0 20px 80px #000b}.dialog::backdrop{background:#02050bcc;backdrop-filter:blur(4px)}.dialog-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:18px}.dialog h2{font-size:17px;margin:0 0 6px}.dialog p,.dialog-hint{font-size:11px;color:var(--muted);margin:0}.dialog label{display:block;font-size:11px;margin:13px 0 7px;color:#cbd6e5}.dialog input{width:100%;background:#09111e;border:1px solid #30415a;border-radius:7px;padding:12px;color:var(--text);font:12px Inter;outline:none}.dialog input:focus{border-color:var(--accent)}.dialog-hint{margin-top:8px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:22px}.toast{position:fixed;bottom:20px;left:50%;transform:translate(-50%,20px);background:#e6fff3;color:#07331f;padding:11px 16px;border-radius:8px;font-size:12px;font-weight:600;opacity:0;pointer-events:none;transition:.2s;z-index:10}.toast.show{opacity:1;transform:translate(-50%,0)}.empty-state[hidden],.playlist-info[hidden]{display:none}.edit-mode .panel{border-style:dashed}.edit-mode .panel-head{cursor:grab}.edit-mode .panel-head:active{cursor:grabbing}
@media(max-width:1100px){.channel-list{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:850px){main{padding:12px 10px}.dashboard{height:auto!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:none!important;grid-auto-rows:minmax(240px,42vw)}.topbar{padding:0 13px}.toolbar{align-items:flex-start;flex-direction:column}.toolbar-actions{width:100%;flex-wrap:wrap}.dashboard{gap:8px}.panel{grid-column:span 1}.panel.wide{grid-column:span 2}.panel.full{grid-column:span 2}.panel.small{grid-column:span 1}.count{display:none}}
@media(max-width:520px){.channel-list{grid-template-columns:1fr}.channel-browser-head{align-items:flex-start;flex-direction:column}.topbar{height:58px}.top-actions{gap:5px}.top-actions .button{padding:8px}.toolbar-actions .button{flex:1;text-align:center}.dashboard{grid-template-columns:1fr!important;grid-auto-rows:minmax(240px,56.25vw);}.panel,.panel.small,.panel.wide,.panel.full{grid-column:span 1}footer{font-size:9px}}

#backgroundPlayers video,#backgroundPlayers iframe{width:640px!important;height:360px!important}
@media(min-width:851px){.dashboard{overflow:hidden}.dashboard .panel{height:100%;min-height:0}}

/* Mobile usability */
@media(max-width:850px){
  .topbar{height:auto;min-height:58px;padding:9px 12px;gap:8px;flex-wrap:wrap}
  .brand{font-size:12px;letter-spacing:1px}
  .brand-mark{width:30px;height:30px;font-size:18px}
  .top-actions{margin-left:auto}
  .toolbar{gap:12px;margin-bottom:12px}
  .toolbar-title strong{font-size:13px}
  .toolbar-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .toolbar-actions .button{width:100%;min-width:0;min-height:42px;padding:9px 7px;white-space:normal;text-align:center;font-size:11px;display:flex;align-items:center;justify-content:center}
  .file-button input{height:100%}
  .dashboard{height:auto!important;grid-template-columns:1fr!important;grid-template-rows:none!important;grid-auto-rows:auto!important;gap:10px}
  .panel,.panel.small,.panel.wide,.panel.full{grid-column:1!important;grid-row:auto!important;min-height:0;height:auto;aspect-ratio:16/10}
  .panel-head{height:38px;flex-basis:38px;padding:0 7px;gap:4px}
  .panel-name{font-size:10px;max-width:35%}
  .panel-state{font-size:8px;letter-spacing:0}
  .panel-tools{gap:3px}
  .icon-button{width:30px;height:29px;font-size:14px}
  .player-wrap{min-height:0}
  .panel-foot{height:26px;flex-basis:26px}
  .channel-browser{padding:10px}
  .channel-item{padding:8px;gap:7px}
  .channel-add{min-height:34px}
  .dialog{padding:17px}
  .dialog input{font-size:16px}
  .dialog-actions .button{min-height:42px}
  footer{gap:10px;flex-wrap:wrap}
}
@media(max-width:380px){
  .toolbar-actions{grid-template-columns:1fr 1fr}
  .top-actions .button{padding:7px;font-size:10px}
  .panel-name{max-width:30%}
}

/* iOS / touch input reliability */
button,.button,label.file-button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button{ -webkit-appearance:none; appearance:none }
@supports (-webkit-touch-callout:none){
 .toolbar-actions .button,.top-actions .button,.icon-button,.panel-foot button{position:relative;z-index:2;pointer-events:auto}
 .file-button{isolation:isolate}
 .file-button input{z-index:3}
}

/* Vista limpia: conservar únicamente los controles superiores solicitados */
body.clean-view .brand,
body.clean-view #streamCount,
body.clean-view .toolbar,
body.clean-view #playlistInfo,
body.clean-view #channelBrowser,
body.clean-view .panel-head,
body.clean-view .panel-foot,
body.clean-view footer{display:none!important}
body.clean-view .topbar{justify-content:flex-end;min-height:54px;padding-top:6px;padding-bottom:6px}
body.clean-view .top-actions{margin-left:auto}
body.clean-view main{padding-top:6px}
body.clean-view .dashboard{height:calc(100vh - 66px)!important;min-height:0!important;gap:6px!important}
body.clean-view .panel{min-height:0!important}
body.clean-view .player-wrap{height:100%!important;min-height:0!important}
body.clean-view .panel,.clean-view .panel.small,.clean-view .panel.wide,.clean-view .panel.full{grid-column:auto!important;grid-row:auto!important}

.replace-panel-list{display:grid;grid-template-columns:1fr;gap:8px;max-height:55vh;overflow:auto}.replace-panel-option{display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:11px 12px;border:1px solid var(--line);border-radius:8px;background:#0d1624;color:var(--text);text-align:left;cursor:pointer}.replace-panel-option:hover{border-color:var(--accent);background:#142438}.replace-panel-option strong{font-size:12px}.replace-panel-option small{font-size:10px;color:var(--muted);max-width:100%;overflow-wrap:anywhere}.channel-browser-actions{display:flex;gap:8px;flex-wrap:wrap}@media(max-width:520px){.channel-browser-actions{width:100%}.channel-browser-actions .button{flex:1}}

/* Canales seleccionables: borde verde, sin botón individual */
.channel-item.channel-available{border:1px solid #39c889;box-shadow:inset 0 0 0 1px #39c88933;cursor:pointer;transition:background .15s,border-color .15s}
.channel-item.channel-available:hover{background:#10251f;border-color:#65e6aa;box-shadow:inset 0 0 0 1px #65e6aa66,0 0 10px #39c88922}
.channel-item.channel-available:focus-within{outline:2px solid #65e6aa;outline-offset:2px}


/* Ajuste de encuadre: conservar proporción 16:9 del contenido en escritorio */
@media(min-width:851px){
  .dashboard{height:auto!important;grid-template-rows:none!important;align-items:start}
  .dashboard .panel{height:auto!important;min-height:0}
  .player-wrap{flex:0 0 auto;aspect-ratio:16/9;min-height:0}
  .player-wrap video{object-fit:contain;background:#05080e}
}

/* Modo de ajuste alternativo: llenar el panel sin conservar la proporción */
body.fit-fill .player-wrap video{object-fit:cover}

/* Canales que ya están abiertos en un panel: visibles pero no seleccionables */
.channel-item.channel-in-use{opacity:.48;filter:saturate(.55);cursor:not-allowed;border-color:#526174;background:#17202d}
.channel-item .channel-status{font-size:9px;color:#9aa8ba;font-weight:700;letter-spacing:.5px}


/* Menús desplegables de acciones de la barra */
.toolbar-dropdown{position:relative;display:inline-flex;align-items:center}
.toolbar-menu{position:absolute;top:calc(100% + 7px);left:0;display:flex;flex-direction:column;align-items:stretch;gap:7px;min-width:180px;padding:7px;background:#111a29;border:1px solid var(--line);border-radius:9px;box-shadow:0 10px 28px #000b;z-index:20}
.toolbar-menu[hidden]{display:none}
.toolbar-menu .button{min-height:36px}
@media(max-width:850px){
 .toolbar-dropdown{width:100%;min-width:0}
 .toolbar-dropdown>.button{width:100%;min-height:42px}
 .toolbar-menu{top:calc(100% + 5px);left:0;right:0;width:100%;min-width:0}
 .toolbar-menu .button{width:100%;min-height:40px}
}


/* Estados de transmisión: colores semánticos */
.panel-state{transition:color .18s ease}
.panel-state.status-live{color:#39c889}
.panel-state.status-connecting{color:#60a5fa}
.panel-state.status-waiting{color:#38bdf8}
.panel-state.status-recovering{color:#fbbf24}
.panel-state.status-error,.panel-state.status-disconnected{color:#f05252}

/* Evitar que el menú de Opciones se salga del borde derecho */
@media(min-width:851px){#optionsMenu{left:auto;right:0}}

/* Fallback IPTV mediante proxy HTTPS */
.panel-state.status-proxy{color:#38bdf8}

/* Pantalla grande: cuadrícula completa sin desplazamiento vertical */
@media(min-width:851px){
  .dashboard{
    height:calc(100vh - 230px)!important;
    grid-template-rows:repeat(var(--monitor-rows,2),minmax(0,1fr))!important;
    align-items:stretch!important;
    overflow:hidden;
  }
  @supports(height:100dvh){
    .dashboard{height:calc(100dvh - 230px)!important}
  }
  .dashboard .panel{
    height:100%!important;
    min-height:0!important;
    align-self:stretch;
  }
  .dashboard .player-wrap{
    flex:1 1 auto!important;
    min-height:0!important;
    aspect-ratio:auto!important;
  }
}

@media(min-width:851px){
  .dashboard:not(.panels-6){grid-template-rows:none!important}
}


/* Modo monitoreo en pantalla completa: prioridad absoluta a las cámaras */
@media(min-width:851px){
  body.clean-view .topbar{
    height:42px!important;
    min-height:42px!important;
    padding:3px 10px!important;
    border:0!important;
    background:#05080e!important;
  }
  body.clean-view #editBtn{display:none!important}
  body.clean-view .top-actions{margin:0!important}
  body.clean-view .top-actions #fullscreenBtn,
  body.clean-view .top-actions #reloadPageBtn{
    width:34px;height:32px;padding:4px!important;
    opacity:.72;
  }
  body.clean-view main{
    max-width:none!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
  }
  body.clean-view .dashboard{
    width:100%!important;
    height:calc(100vh - 42px)!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    gap:3px!important;
    overflow:hidden!important;
  }
  @supports(height:100dvh){
    body.clean-view .dashboard{height:calc(100dvh - 42px)!important}
  }
  body.clean-view .dashboard .panel{
    height:100%!important;
    min-height:0!important;
    border-radius:3px!important;
    border-width:0!important;
  }
  body.clean-view .dashboard .player-wrap{
    height:100%!important;
    min-height:0!important;
    flex:1 1 auto!important;
    aspect-ratio:auto!important;
  }
}


/* Modo monitoreo: separación mínima entre las seis cámaras */
@media(min-width:851px){
  body.clean-view .dashboard{
    gap:1px!important;
    background:#000!important;
  }
  body.clean-view .dashboard .panel{
    margin:0!important;
    border:0!important;
    border-radius:0!important;
  }
}


/* Tema claro: interfaz blanca con texto oscuro, alternable desde el icono de lámpara */
body.light-mode{
 color-scheme:light;
 --bg:#f2f4f7;
 --surface:#ffffff;
 --surface2:#e8edf3;
 --line:#cbd3dd;
 --muted:#596779;
 --text:#17212f;
 --accent:#159b68;
 --blue:#2563eb;
 background:var(--bg);
 color:var(--text);
}
body.light-mode .topbar{background:#fff;border-color:var(--line)}
body.light-mode .brand{color:var(--text)}
body.light-mode .button.secondary,
body.light-mode .icon-button{background:#e8edf3;border-color:#cbd3dd;color:#17212f}
body.light-mode .toolbar-menu{background:#fff;border-color:var(--line);box-shadow:0 10px 28px #17212f22}
body.light-mode .panel{background:#fff;border-color:var(--line)}
body.light-mode .panel-head{background:#e9eef4;border-color:var(--line)}
body.light-mode .panel-foot{background:#f0f3f7;color:#596779}
body.light-mode .player-wrap{background:#111}
body.light-mode .placeholder{color:#596779}
body.light-mode .channel-browser{background:#fff;border-color:var(--line)}
body.light-mode .channel-item{background:#f7f9fb;border-color:#cbd3dd}
body.light-mode .channel-item.channel-available{border-color:#159b68;box-shadow:inset 0 0 0 1px #159b6833}
body.light-mode .channel-item.channel-available:hover{background:#eaf8f1}
body.light-mode .channel-item.channel-in-use{background:#edf0f4;border-color:#aab4c1}
body.light-mode .channel-status{color:#596779}
body.light-mode .playlist-info{background:#e7f6ee;border-color:#a8ddc1;color:#155b3b}
body.light-mode .dialog{background:#fff;color:#17212f;border-color:var(--line)}
body.light-mode .dialog input{background:#f7f9fb;border-color:#cbd3dd;color:#17212f}
body.light-mode .replace-panel-option{background:#f7f9fb;color:#17212f;border-color:#cbd3dd}
body.light-mode .replace-panel-option:hover{background:#eaf8f1;border-color:#159b68}
body.light-mode .toast{background:#173c2d;color:#fff}
body.light-mode footer{color:#596779}
body.light-mode .channel-list .channel-details small{color:#596779}
.theme-toggle{min-width:38px;padding:8px 10px!important;font-size:17px!important;line-height:1}
@media(max-width:850px){
 .top-actions .theme-toggle{min-width:38px;width:38px;flex:0 0 38px;padding:7px!important}
}
@media(min-width:851px){
 body.clean-view .top-actions .theme-toggle{
  display:inline-flex!important;
  width:34px;height:32px;padding:4px!important;
  align-items:center;justify-content:center;
  opacity:.85;
 }
 body.clean-view .top-actions #fullscreenBtn{margin-right:2px}
}
/* El tema claro conserva el fondo negro del vídeo para evitar alterar la imagen */
body.light-mode .player-wrap video,
body.light-mode .player-wrap iframe{background:#05080e}


/* Cinco cámaras: tres arriba y dos centradas abajo, todas del mismo tamaño */
@media(min-width:851px){
  .dashboard.panels-5{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;
  }
  .dashboard.panels-5 .panel{
    grid-column:span 2!important;
    grid-row:auto!important;
    width:auto!important;
    height:100%!important;
    min-height:0!important;
  }
  .dashboard.panels-5 .panel:nth-child(4){grid-column:2 / span 2!important}
  .dashboard.panels-5 .panel:nth-child(5){grid-column:4 / span 2!important}
  body.clean-view .dashboard.panels-5{
    height:calc(100vh - 42px)!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
  }
  @supports(height:100dvh){
    body.clean-view .dashboard.panels-5{height:calc(100dvh - 42px)!important}
  }
}


/* Tres cámaras: dos arriba y una centrada abajo, todas del mismo tamaño */
@media(min-width:851px){
  .dashboard.panels-3{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;
  }
  .dashboard.panels-3 .panel{
    grid-column:span 2!important;
    grid-row:auto!important;
    width:auto!important;
    height:100%!important;
    min-height:0!important;
  }
  .dashboard.panels-3 .panel:nth-child(3){grid-column:2 / span 2!important}
  body.clean-view .dashboard.panels-3{
    height:calc(100vh - 42px)!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
  }
  @supports(height:100dvh){
    body.clean-view .dashboard.panels-3{height:calc(100dvh - 42px)!important}
  }
}


/* Controles de pantalla completa: centrados y ligeramente más grandes */
@media(min-width:851px){
  body.clean-view .topbar{
    justify-content:center!important;
  }
  body.clean-view .top-actions{
    margin:0 auto!important;
    justify-content:center!important;
    gap:12px!important;
  }
  body.clean-view .top-actions #fullscreenBtn,
  body.clean-view .top-actions .theme-toggle{
    width:44px!important;
    height:42px!important;
    min-width:44px!important;
    padding:5px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:21px!important;
    opacity:1!important;
  }
}


/* Centrar la barra principal y reforzar la lectura de sus accesos */
@media(min-width:851px){
  .toolbar{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px}
  .toolbar-title{display:flex!important;align-items:center;justify-content:center;text-align:center}
  .toolbar-title>div{text-align:center}
  .toolbar-actions{width:100%;justify-content:center;flex-wrap:wrap;gap:10px}
}
.toolbar-actions>.button,.toolbar-actions .menu-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.toolbar-menu .button,.toolbar-menu .file-button{display:flex;align-items:center;gap:8px;text-align:left}


/* Menú unificado de fuentes y paneles */
.toolbar-menu.sources-menu{min-width:230px}
.menu-section-title{padding:7px 9px 2px;color:var(--muted);font-size:9px;font-weight:800;letter-spacing:1.1px}
.menu-section-title:not(:first-child){margin-top:5px;border-top:1px solid var(--line);padding-top:11px}
@media(max-width:850px){.toolbar-menu.sources-menu{min-width:0}}


/* Fix visibilidad y apilamiento del menú Opciones */
.toolbar-dropdown:has(#optionsMenu){position:relative;z-index:1000;overflow:visible}
#optionsMenu:not([hidden]){display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;position:absolute!important;z-index:10000!important;min-width:220px!important;max-height:min(70vh,360px);overflow-y:auto!important}
#optionsMenu .button{display:flex!important;visibility:visible!important;opacity:1!important;min-height:40px!important;width:100%;color:var(--text)!important;background:var(--surface)!important;align-items:center!important;justify-content:flex-start!important}
#optionsMenu .button:hover{background:#263750!important}
@media(max-width:850px){#optionsMenu:not([hidden]){left:0!important;right:0!important;width:100%!important}}


/* Encabezado a la izquierda y controles a la derecha */
@media(min-width:851px){
  .toolbar{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:18px!important}
  .toolbar-title{display:flex!important;align-items:center!important;justify-content:flex-start!important;text-align:left!important;flex:0 0 auto}
  .toolbar-title>div{text-align:left!important}
  .toolbar-actions{width:auto!important;flex:1 1 auto;justify-content:flex-end!important;flex-wrap:wrap;gap:10px}
}


/* Ajuste de imagen independiente por panel */
.panel.fit-contain .player-wrap video{object-fit:contain!important}
.panel.fit-fill .player-wrap video{object-fit:cover!important}
