/* =====================================================================
   MovieTube Platform — style.css (tema dark zinc + rose, prohibido azul/índigo)
   ---------------------------------------------------------------------
   [BASE]  Bloque base compartido (creado por agente 21-c porque el archivo
           no existía al construir el panel admin). Mínimo y reutilizable.
   [21-c]  Secciones del panel admin (prefijo .adm-).

   COORDINACIÓN: el agente 21-b debe APPEND sus estilos web al final de este
   archivo (no sobrescribir). Mantener la paleta rose (#e11d48/#f43f5e).
   ===================================================================== */

/* ================================================== [BASE] variables ==== */
:root {
  --bg: #09090b;          /* zinc-950 */
  --panel: #18181b;       /* zinc-900 */
  --panel-2: #1f1f23;     /* zinc-800-ish */
  --border: #27272a;      /* zinc-800 */
  --border-2: #3f3f46;    /* zinc-700 */
  --text: #e4e4e7;        /* zinc-200 */
  --muted: #a1a1aa;       /* zinc-400 */
  --faint: #71717a;       /* zinc-500 */
  --rose: #e11d48;
  --rose-2: #f43f5e;
  --rose-soft: rgba(225, 29, 72, 0.12);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ========================================================= [BASE] reset == */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; }
p { margin: 0; }
a { color: var(--rose-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.strong { font-weight: 600; color: var(--text); }
.center { text-align: center; }
.ta-r { text-align: right; }
.ok-text { color: #34d399; font-weight: 600; }
.err-text { color: #fb7185; font-weight: 600; }
.max-w { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1 1 160px; min-width: 160px; }

/* ========================================================= [BASE] card == */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-body { padding: 16px 18px; }
.card-foot { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); }

/* ========================================================= [BASE] botón == */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { filter: brightness(1.18); text-decoration: none; }
.btn-primary { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-2); border-color: var(--rose-2); }
.btn-danger { background: transparent; border-color: rgba(225, 29, 72, 0.55); color: var(--rose-2); }
.btn-outline { background: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-ghost.danger:hover { color: var(--rose-2); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 9px; font-size: 11px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ======================================================== [BASE] badge == */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid transparent; white-space: nowrap; vertical-align: middle;
}
.b-green { background: var(--green-soft); color: #34d399; border-color: rgba(16, 185, 129, 0.35); }
.b-amber { background: var(--amber-soft); color: #fbbf24; border-color: rgba(245, 158, 11, 0.35); }
.b-rose  { background: var(--rose-soft);  color: #fb7185; border-color: rgba(225, 29, 72, 0.4); }
.b-zinc  { background: rgba(113, 113, 122, 0.15); color: var(--muted); border-color: var(--border); }
.b-outline { background: transparent; color: var(--muted); border-color: var(--border-2); }

/* ================================================== [BASE] formularios == */
.input, .select, textarea.input {
  width: 100%; background: var(--bg); border: 1px solid var(--border-2);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 13px; font-family: inherit;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--rose);
  box-shadow: 0 0 0 3px var(--rose-soft);
}
.input::placeholder { color: var(--faint); }
.select { padding-right: 26px; }
textarea.input { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.input-xs { width: 70px; padding: 3px 6px; font-size: 12px; }
.input-country { width: 90px; }
.label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 5px;
}
.field { margin-bottom: 14px; min-width: 0; }
.help { font-size: 11px; color: var(--faint); margin-top: 4px; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }

/* ========================================================= [BASE] tabla == */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--panel-2); white-space: nowrap;
}
.table th.ta-r { text-align: right; }
.table td { padding: 10px 12px; border-bottom: 1px solid rgba(39, 39, 42, 0.6); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(39, 39, 42, 0.35); }
.stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* =============================================== [21-c] PANEL ADMIN ===== */

/* --- shell ------------------------------------------------------------- */
body.adm-body { min-height: 100vh; }
.adm-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 236px; z-index: 40;
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform 0.2s ease;
}
.adm-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; border-bottom: 1px solid var(--border);
  font-weight: 800; font-size: 15px; color: var(--text);
}
.adm-brand:hover { text-decoration: none; }
.adm-brand em { font-style: normal; color: var(--rose-2); }
.adm-brand-dot {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--rose); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900;
}
.adm-nav { flex: 1; overflow-y: auto; padding: 10px; }
.adm-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 600; font-size: 13px;
}
.adm-nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.adm-nav a.on { background: var(--rose-soft); color: var(--rose-2); }
.adm-nav svg { width: 16px; height: 16px; flex: none; }
.adm-side-foot { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--faint); line-height: 1.6; }

.adm-main { margin-left: 236px; display: flex; flex-direction: column; min-height: 100vh; }
.adm-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: rgba(9, 9, 11, 0.85); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.adm-topbar-title { font-size: 16px; }
.adm-userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); min-width: 0; }
.adm-user-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.adm-burger {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  background: transparent; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer;
}
.adm-burger svg { width: 18px; height: 18px; }
.adm-content { flex: 1; width: 100%; max-width: 1280px; padding: 20px; }
.adm-footer {
  border-top: 1px solid var(--border);
  padding: 14px 20px; font-size: 12px; color: var(--faint);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.adm-foot-right { margin-left: auto; }
.adm-skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--rose); color: #fff; padding: 8px 12px; border-radius: 0 0 8px 0;
}
.adm-skip:focus { left: 0; }
.adm-overlay { display: none; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.55); }
body.adm-drawer-open .adm-overlay { display: block; }

/* --- encabezado de página ---------------------------------------------- */
.adm-head {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 10px; margin-bottom: 16px;
}
.adm-head h2 { font-size: 20px; }
.adm-head p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.adm-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- flash -------------------------------------------------------------- */
.adm-flash {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px; border: 1px solid; word-break: break-word;
}
.adm-flash.ok   { background: var(--green-soft); border-color: rgba(16, 185, 129, 0.4);  color: #6ee7b7; }
.adm-flash.err  { background: var(--rose-soft);  border-color: rgba(225, 29, 72, 0.45); color: #fda4af; }
.adm-flash.warn { background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.4); color: #fcd34d; }

/* --- KPIs / cards de jobs ----------------------------------------------- */
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpis-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.adm-kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; min-width: 0;
}
.adm-kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.adm-kpi-val { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.adm-kpi-sub { font-size: 11px; color: var(--faint); margin-top: 4px; }
.adm-job p { margin: 6px 0 10px; }
.adm-job-form { margin-top: 8px; }

/* --- grids --------------------------------------------------------------- */
.adm-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 16px; }
.adm-grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 16px; margin-top: 16px; }
.adm-grid4 .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin-bottom: 2px; }

/* --- filtros / acciones --------------------------------------------------- */
.adm-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.adm-filters .field { margin: 0; }
.adm-actions { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.adm-actions.center-justify { justify-content: center; margin: 16px 0; }
.adm-actions.checks { gap: 16px; margin: 4px 0 14px; }
.adm-inline { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.adm-inline.extend { margin-top: 12px; align-items: flex-end; }
.adm-inline.extend .input-xs { width: 90px; }

/* --- tabs / paginación / varios -------------------------------------------- */
.adm-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.adm-tab {
  padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.adm-tab:hover { color: var(--text); text-decoration: none; }
.adm-tab.on { color: var(--rose-2); border-bottom-color: var(--rose); }

.adm-pagin { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.adm-pagin-info { font-size: 12px; color: var(--faint); }
.adm-pagin-btns { display: flex; gap: 8px; }

.adm-empty { padding: 36px 20px; text-align: center; color: var(--faint); font-size: 13px; }
.adm-ch { display: flex; align-items: center; gap: 8px; min-width: 0; }
.adm-logo { width: 26px; height: 26px; border-radius: 6px; object-fit: contain; background: var(--panel-2); flex: none; }
.adm-letter {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  background: var(--panel-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.adm-statline {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid rgba(39, 39, 42, 0.6); font-size: 13px;
  flex-wrap: wrap;
}
.adm-statline:last-child { border-bottom: 0; }
.adm-statline .k { color: var(--muted); }
.adm-callout { margin-bottom: 16px; border-color: rgba(225, 29, 72, 0.35); }
.adm-callout-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.adm-callout p { margin-top: 3px; }
.adm-detail-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.adm-detail-name { font-size: 18px; }

/* --- settings --------------------------------------------------------------- */
.adm-setting {
  display: flex; gap: 16px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid rgba(39, 39, 42, 0.6); flex-wrap: wrap;
}
.adm-setting:last-child { border-bottom: 0; }
.adm-setting-key { flex: 0 0 260px; min-width: 200px; }
.adm-setting-key .small { margin-top: 2px; }
.adm-setting-val { flex: 1 1 280px; min-width: 240px; }

/* --- bare (login / acceso denegado) ------------------------------------------ */
body.adm-bare-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.adm-bare { width: 100%; max-width: 420px; }
.adm-bare .adm-flash { margin-bottom: 12px; }
.adm-auth-card { box-shadow: var(--shadow); }
.adm-auth-head { text-align: center; margin-bottom: 18px; }
.adm-auth-head h2 { margin-top: 10px; font-size: 18px; }
.adm-auth-head p { margin-top: 4px; font-size: 13px; }
.adm-auth-logo { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.adm-denied-icon { color: var(--rose-2); margin: 8px auto 12px; }
.adm-denied-icon svg { width: 48px; height: 48px; }

/* --- responsive (drawer móvil) ------------------------------------------------ */
@media (max-width: 920px) {
  .adm-sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
  body.adm-drawer-open .adm-sidebar { transform: translateX(0); }
  .adm-main { margin-left: 0; }
  .adm-burger { display: inline-flex; }
  .adm-content { padding: 14px; }
  .adm-topbar { padding: 10px 14px; }
  .adm-user-mail { max-width: 110px; }
  .adm-setting-key { flex-basis: 100%; }
  .adm-kpi-val { font-size: 24px; }
  .adm-detail-head { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .adm-sidebar { transition: none; }
  .btn { transition: none; }
}

/* =====================================================================
   [21-b] WEB PÚBLICA (Task 21-b) — estilos de las páginas server-rendered.
   APPEND acordado con 21-c: NO redefinir variables del [BASE]; se reutilizan
   (--panel, --muted, --faint, --rose, --rose-2, --green, --amber, --radius).
   Los overrides de componentes compartidos (.btn/.badge/.card/.input) van
   acotados a body.web para no alterar el panel admin (.adm-*).
   ===================================================================== */
:root {
  --header-h: 60px;
  --wb-bad: #ef4444;
  --wb-bad-soft: rgba(239, 68, 68, 0.14);
  --wb-border-soft: rgba(39, 39, 42, 0.6);
}

/* --- body del sitio web: flex column + footer pegado abajo (mt-auto) --- */
body.web {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
}
body.web :focus-visible { outline: 2px solid var(--rose-2); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: 1rem; }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--rose); color: #fff; padding: .5rem .9rem; border-radius: 8px;
  font-weight: 600; transition: top .15s ease;
}
.skip-link:focus { top: .75rem; text-decoration: none; }
.text-capitalize { text-transform: capitalize; }
.text-center { text-align: center; }
.muted-strong { color: var(--muted); }

/* --- overrides de componentes compartidos, SOLO en el sitio web --------- */
body.web .btn { min-height: 44px; padding: .55rem 1.1rem; font-size: .95rem; border-radius: 10px; }
body.web .btn-rose { background: var(--rose); border-color: var(--rose); color: #fff; }
body.web .btn-rose:hover { background: var(--rose-2); border-color: var(--rose-2); filter: none; }
body.web .btn-outline { border-color: var(--border); color: var(--text); }
body.web .btn-outline:hover { border-color: var(--rose); color: var(--rose-2); filter: none; }
body.web .btn-ghost { color: var(--muted); }
body.web .btn-ghost:hover { background: var(--panel-2); color: var(--text); }
body.web .btn-danger { color: var(--rose-2); }
body.web .btn-danger:hover { background: var(--rose-soft); color: var(--rose-2); }
body.web .btn-sm { min-height: 38px; padding: .35rem .8rem; font-size: .88rem; }
body.web .btn[disabled] { opacity: .55; }
body.web .card { transition: transform .15s ease, border-color .15s ease; }
body.web .input, body.web select.input { min-height: 44px; border-radius: 10px; font-size: .95rem; color: var(--text); }
.input-lg { min-height: 50px; font-size: 1.05rem; }
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem;
}
body.web .form-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.form-grid-2 { grid-template-columns: 1fr; }
.form-field label { display: block; font-size: .88rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; }
.field-hint { margin-top: .3rem; font-size: .78rem; color: var(--faint); }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .25rem; }

/* --- badges de estado del sitio ----------------------------------------- */
body.web .badge { padding: .15rem .55rem; font-size: .72rem; border-color: var(--border); color: var(--muted); background: var(--panel); }
.badge-online { color: var(--green); border-color: rgba(16, 185, 129, .4); background: var(--green-soft); }
.badge-offline { color: var(--wb-bad); border-color: rgba(239, 68, 68, .4); background: var(--wb-bad-soft); }
.badge-timeout, .badge-amber { color: #fbbf24; border-color: rgba(245, 158, 11, .4); background: var(--amber-soft); }
.badge-muted { color: var(--faint); }
.badge-live, .badge-plan { color: var(--rose-2); border-color: rgba(225, 29, 72, .5); background: var(--rose-soft); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: wb-pulse 1.6s infinite; }
@keyframes wb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rose); display: inline-block; animation: wb-pulse 1.6s infinite; }

/* --- header sticky + drawer móvil (checkbox hack, sin JS) ---------------- */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(9, 9, 11, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--wb-border-soft);
  padding-top: env(safe-area-inset-top);
}
.header-inner { display: flex; align-items: center; gap: .75rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand span { color: var(--rose-2); }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--rose); color: #fff; font-size: .72rem;
}
.main-nav { display: none; margin-left: .5rem; }
.nav-link {
  padding: .45rem .7rem; border-radius: 8px;
  color: var(--muted); font-size: .92rem; font-weight: 500;
  transition: color .15s ease, background .15s ease;
}
.nav-link:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav-link.active { color: #fff; background: var(--rose-soft); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.nav-burger { display: inline-grid; place-items: center; width: 40px; height: 40px; font-size: 1.25rem; color: var(--muted); border-radius: 8px; user-select: none; cursor: pointer; }
.nav-burger:hover { background: var(--panel); color: var(--text); }
#nav-toggle:checked ~ .site-header .main-nav {
  display: flex; flex-direction: column;
  position: absolute; top: var(--header-h); left: 0; right: 0;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  gap: .25rem; box-shadow: 0 18px 30px rgba(0, 0, 0, .5);
}

/* --- main + footer sticky (regla del diseño: mt-auto) --------------------- */
.site-main { flex: 1 0 auto; padding-bottom: 2.5rem; }
.site-footer {
  margin-top: auto;
  background: var(--panel-2);
  border-top: 1px solid var(--wb-border-soft);
  padding: 1.75rem 0 calc(1.25rem + env(safe-area-inset-bottom));
}
.footer-inner { display: flex; flex-direction: column; gap: .75rem; }
.footer-brand { font-weight: 800; color: var(--text); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-nav a { color: var(--muted); font-size: .9rem; }
.footer-nav a:hover { color: var(--rose-2); }
.footer-note, .footer-copy { color: var(--faint); font-size: .8rem; max-width: 46rem; }

/* --- chips (estado activo rose) ------------------------------------------- */
.chip-row, .chip-wrap { display: flex; flex-wrap: nowrap; gap: .5rem; margin-bottom: 1rem; }
.chip-wrap { flex-wrap: wrap; }
.chip-row { overflow-x: auto; padding-bottom: .25rem; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .95rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--muted); font-size: .88rem; font-weight: 500;
  transition: border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--border-2); color: var(--text); text-decoration: none; }
.chip.active { border-color: var(--rose); background: var(--rose-soft); color: #fff; }
.chip-count { color: var(--faint); font-size: .78rem; }
.chip.active .chip-count { color: rgba(255, 255, 255, .75); }

/* --- alerts / notas -------------------------------------------------------- */
.alert { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 10px; font-size: .92rem; border: 1px solid; }
.alert-ok { color: #6ee7b7; border-color: rgba(16, 185, 129, .4); background: var(--green-soft); }
.alert-error { color: #fda4af; border-color: rgba(225, 29, 72, .5); background: var(--rose-soft); }
.tiny-note { margin-top: 1.25rem; color: var(--faint); font-size: .78rem; }

/* --- páginas / secciones --------------------------------------------------- */
.page { padding-top: 1.75rem; }
.page-narrow { max-width: 56rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head-center { text-align: center; }
.page-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.page-sub { margin-top: .35rem; color: var(--muted); font-size: .92rem; max-width: 44rem; }
.page-sub-center { margin-inline: auto; }
.page-head-badge { margin-bottom: .75rem; }
.section { margin-top: 2.25rem; }
.section-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.section-title { font-size: 1.12rem; font-weight: 700; display: inline-flex; align-items: center; gap: .5rem; color: var(--text); }
.section-count { color: var(--faint); font-weight: 400; font-size: .9rem; }
.section-link { margin-left: auto; color: var(--rose-2); font-size: .85rem; font-weight: 600; }
.section-link:hover { color: #fff; }
.row-track { display: flex; gap: .8rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x proximity; }

/* --- cards de película (póster 2:3) ----------------------------------------- */
.movie-card { display: flex; flex-direction: column; width: 8.5rem; flex-shrink: 0; scroll-snap-align: start; transition: transform .15s ease; }
.movie-card:hover { transform: translateY(-2px); text-decoration: none; }
.grid-posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.grid-posters .movie-card { width: auto; }
.poster {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 2 / 3; width: 100%;
  border-radius: 10px; border: 1px solid var(--border); background: var(--panel);
}
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.movie-card:hover .poster img { transform: scale(1.04); }
.poster-fallback { display: grid; place-items: center; width: 100%; height: 100%; font-size: 1.8rem; color: var(--faint); }
.poster-rating {
  position: absolute; top: .45rem; right: .45rem;
  background: rgba(0, 0, 0, .72); color: #fbbf24;
  padding: .1rem .4rem; border-radius: 6px; font-size: .74rem; font-weight: 700;
}
.movie-card-title { margin-top: .5rem; font-size: .88rem; font-weight: 500; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.movie-card:hover .movie-card-title { color: var(--rose-2); }
.movie-card-meta { font-size: .76rem; color: var(--faint); }

/* --- cards de canal ----------------------------------------------------------- */
.grid-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.channel-card { display: flex; flex-direction: column; gap: .7rem; padding: .9rem; flex-shrink: 0; width: 14rem; }
.grid-channels .channel-card { width: auto; }
.channel-card:hover { transform: translateY(-2px); border-color: var(--rose); text-decoration: none; }
.channel-card-top { display: flex; align-items: center; gap: .7rem; }
.channel-logo {
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
  width: 46px; height: 46px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg);
}
.channel-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.channel-logo-fallback { font-size: 1.15rem; opacity: .7; }
.channel-logo-lg { width: 60px; height: 60px; border-radius: 12px; }
.channel-logo-sm { width: 34px; height: 34px; border-radius: 8px; }
.channel-card-id { min-width: 0; display: flex; flex-direction: column; }
.channel-card-name { font-size: .9rem; font-weight: 600; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.channel-card:hover .channel-card-name { color: var(--rose-2); }
.channel-card-sub { font-size: .76rem; color: var(--faint); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.channel-card-live { display: flex; align-items: center; gap: .5rem; min-height: 22px; }
.channel-card-now { font-size: .78rem; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* --- hero ------------------------------------------------------------------------ */
.hero { position: relative; border-bottom: 1px solid var(--wb-border-soft); margin-bottom: 1.5rem; }
.hero-backdrop { width: 100%; height: clamp(300px, 48vw, 460px); object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 4%, rgba(9, 9, 11, .72) 55%, rgba(9, 9, 11, .25)); }
.hero-content { position: relative; padding-block: 1.5rem; }
.hero-kicker { color: var(--rose-2); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.hero-title { margin-top: .5rem; font-size: clamp(1.6rem, 4.5vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; color: var(--text); max-width: 38rem; }
.hero-overview {
  margin-top: .7rem; color: var(--muted); font-size: .95rem; max-width: 40rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.1rem; }

/* --- continuar viendo --------------------------------------------------------------- */
.continue-card { width: 12.5rem; flex-shrink: 0; scroll-snap-align: start; display: flex; flex-direction: column; }
.continue-card:hover { text-decoration: none; }
.continue-card:hover .continue-title { color: var(--rose-2); }
.continue-media { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); }
.continue-media img { width: 100%; height: 100%; object-fit: cover; }
.continue-title { margin-top: .5rem; font-size: .88rem; font-weight: 500; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.continue-meta { font-size: .76rem; color: var(--faint); }
.progress { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .16); }
.progress-fill { display: block; height: 100%; background: var(--rose); }
.progress-fill.is-done { background: var(--green); }

/* --- detalle película / canal --------------------------------------------------------- */
.detail-backdrop { position: relative; height: clamp(180px, 34vw, 320px); overflow: hidden; }
.detail-backdrop img { width: 100%; height: 100%; object-fit: cover; }
.detail-backdrop-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 2%, rgba(9, 9, 11, .55) 70%, rgba(9, 9, 11, .25)); }
.detail-body { position: relative; margin-top: calc(-1 * clamp(60px, 14vw, 130px)); }
.detail-head { display: flex; flex-direction: column; gap: 1.1rem; }
.detail-poster {
  display: block; overflow: hidden; width: 8.5rem; flex-shrink: 0;
  aspect-ratio: 2 / 3; border-radius: 12px; border: 1px solid var(--border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55); background: var(--panel);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: .6rem; color: var(--muted); font-size: .88rem; }
.detail-rating { color: #fbbf24; font-weight: 700; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1.1rem; }
.detail-license-link { color: var(--muted); font-size: .88rem; }
.detail-license-link:hover { color: var(--rose-2); }
.detail-grid { display: grid; gap: 1.75rem; margin-top: 1.75rem; grid-template-columns: 1fr; }
.detail-aside { min-width: 0; }
.aside-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.detail-overview { margin-top: .6rem; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.license-box { margin-top: 1.25rem; padding: .9rem 1rem; border-radius: 10px; border: 1px solid rgba(245, 158, 11, .4); background: var(--amber-soft); }
.license-title { color: #fbbf24; font-size: .85rem; font-weight: 700; }
.license-text { margin-top: .35rem; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.detail-backlink { margin-top: 1.5rem; }
.detail-backlink a { color: var(--muted); font-size: .9rem; }
.detail-backlink a:hover { color: var(--rose-2); }
.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }

/* --- player ---------------------------------------------------------------------------- */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.player-video { width: 100%; height: 100%; display: block; }
.player-notice {
  position: absolute; left: 50%; bottom: .9rem; transform: translateX(-50%);
  max-width: 90%; padding: .45rem .9rem; border-radius: 8px;
  background: rgba(9, 9, 11, .92); color: #fda4af; font-size: .82rem; text-align: center;
  border: 1px solid rgba(225, 29, 72, .5); margin: 0;
}
.player-retry {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: .55rem 1.1rem; border-radius: 10px;
  background: rgba(9, 9, 11, .92); color: var(--text); border: 1px solid var(--border-2);
  font-weight: 600; font-size: .9rem;
}
.player-retry:hover { border-color: var(--rose); color: var(--rose-2); }
.player.idle .player-video::-webkit-media-controls { opacity: 0; }
.player-empty { display: grid; place-content: center; gap: .4rem; aspect-ratio: 16 / 9; text-align: center; padding: 1rem; }
.player-empty-title { font-weight: 700; color: var(--text); }
.player-empty-sub { color: var(--faint); font-size: .85rem; max-width: 24rem; }
.source-block { margin-top: .9rem; }
.source-block-title { color: var(--faint); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .55rem; }
.source-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.source-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .8rem; border-radius: 10px;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--border); font-size: .82rem; font-weight: 500;
  transition: border-color .15s ease, color .15s ease;
}
.source-btn:hover { border-color: var(--border-2); color: var(--text); }
.source-btn.active { border-color: var(--rose); background: var(--rose-soft); color: #fff; }
.now-playing { margin-top: 1.1rem; padding: .9rem 1rem; border-radius: 10px; border: 1px solid rgba(225, 29, 72, .5); background: var(--rose-soft); }
.now-playing-kicker { color: var(--rose-2); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: .4rem; margin: 0; }
.now-playing-title { margin-top: .4rem; font-size: 1.08rem; font-weight: 700; color: var(--text); }
.now-playing-desc { margin-top: .3rem; color: var(--muted); font-size: .86rem; }

/* --- filtros ---------------------------------------------------------------------------- */
.filters { display: flex; flex-direction: column; gap: .9rem; padding: 1rem; margin-bottom: 1.5rem; }
.filter-field { min-width: 0; }
.filter-grow { flex: 1; }

/* --- EPG --------------------------------------------------------------------------------- */
.epg-layout { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.epg-channels { align-self: start; }
.side-panel { display: flex; flex-direction: column; }
.side-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.side-panel-filter { padding: .75rem; border-bottom: 1px solid var(--border); }
.side-panel-body { max-height: 30rem; overflow-y: auto; padding: .75rem; }
.side-panel-foot { padding: .6rem 1rem; border-top: 1px solid var(--border); color: var(--faint); font-size: .74rem; margin: 0; }
.side-panel-empty { padding: 1rem; color: var(--faint); font-size: .88rem; }
.channel-picker { display: flex; flex-direction: column; gap: .2rem; max-height: 26rem; overflow-y: auto; padding: .5rem; }
.channel-picker-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .6rem; border-radius: 8px; color: var(--muted); font-size: .88rem; font-weight: 500;
}
.channel-picker-item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.channel-picker-item.active { background: var(--rose-soft); color: #fff; }
.channel-picker-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.epg-day { overflow: hidden; }
.epg-list { display: flex; flex-direction: column; gap: .5rem; }
.epg-list-day { padding: .75rem; }
.epg-item { padding: .65rem .8rem; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); }
.epg-item.is-past { opacity: .5; }
.epg-item.is-now { border-color: var(--rose); background: var(--rose-soft); box-shadow: inset 0 0 0 1px rgba(225, 29, 72, .4); }
.epg-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.epg-time { color: var(--faint); font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.epg-item.is-now .epg-time { color: var(--rose-2); }
.epg-title { margin-top: .25rem; font-size: .9rem; font-weight: 600; color: var(--text); }
.epg-subtitle { font-weight: 400; color: var(--muted); }
.epg-desc { margin-top: .2rem; color: var(--faint); font-size: .78rem; line-height: 1.5; }

/* --- favoritos (tabs solo CSS) -------------------------------------------------------------- */
.tabs { display: flex; flex-direction: column; }
.tab-radio { position: absolute; opacity: 0; pointer-events: none; }
.tab-list { display: flex; gap: .5rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: .75rem; }
.tab-btn {
  padding: .5rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); color: var(--muted);
  font-size: .9rem; font-weight: 600; user-select: none;
}
.tab-btn:hover { color: var(--text); border-color: var(--border-2); }
.fav-item { position: relative; }
.fav-remove {
  position: absolute; top: .5rem; right: .5rem; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(9, 9, 11, .9); color: var(--muted);
  border: 1px solid var(--border); font-size: 1.05rem; line-height: 1;
}
.fav-remove:hover { border-color: var(--rose); color: var(--rose-2); background: var(--rose-soft); }

/* --- historial -------------------------------------------------------------------------------- */
.history-list { display: flex; flex-direction: column; gap: .75rem; }
.history-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
  transition: border-color .15s ease;
}
.history-item:hover { border-color: var(--rose); text-decoration: none; }
.history-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--bg); flex-shrink: 0; }
.history-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.history-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.history-title { font-weight: 600; font-size: .92rem; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.history-meta { color: var(--faint); font-size: .76rem; }
.history-body .progress { position: static; margin-top: .4rem; height: 5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.history-play { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--rose-soft); color: var(--rose-2); flex-shrink: 0; font-size: .8rem; }

/* --- cuenta -------------------------------------------------------------------------------------- */
.panel { padding: 1.15rem; margin-bottom: 1.25rem; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; color: var(--text); }
.sub-row { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.sub-plan { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: var(--text); }
.sub-meta { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.device-list, .notif-list { display: flex; flex-direction: column; gap: .6rem; }
.device-item, .notif-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .75rem .85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2);
}
.device-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--panel); flex-shrink: 0; }
.device-body, .notif-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.device-top, .notif-top { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.device-name, .notif-title { font-weight: 600; font-size: .9rem; color: var(--text); }
.device-meta, .notif-date { color: var(--faint); font-size: .76rem; }
.notif-text { color: var(--muted); font-size: .85rem; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); flex-shrink: 0; }
.notif-item.is-unread { border-color: rgba(225, 29, 72, .45); background: var(--rose-soft); }
.notif-item.is-unread .notif-dot { background: var(--rose); }
.empty-compact h2 { font-size: 1.05rem; }
.empty-compact .btn { margin-top: .6rem; }

/* --- auth / planes --------------------------------------------------------------------------------- */
.auth-wrap { max-width: 26rem; margin-inline: auto; padding-block: 2.5rem 3rem; }
.auth-hero { text-align: center; margin-bottom: 1.5rem; }
.auth-badge { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--rose); color: #fff; font-size: 1.3rem; font-weight: 800; margin-bottom: .9rem; }
.auth-form { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.auth-form .alert { margin: 0; }
.auth-alt { margin-top: 1.4rem; text-align: center; color: var(--muted); font-size: .9rem; }
.auth-alt a { color: var(--rose-2); font-weight: 600; }
.auth-alt-muted { margin-top: .5rem; font-size: .8rem; }
.auth-alt-muted a { color: var(--muted); font-weight: 400; }
.plans-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.plan { padding: 1.4rem; display: flex; flex-direction: column; }
.plan-paid { border-color: rgba(225, 29, 72, .5); background: linear-gradient(to bottom, rgba(225, 29, 72, .1), var(--panel)); }
.plan-paid:hover { border-color: var(--rose); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.plan-name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.plan-price { margin-top: 1rem; font-size: 1.9rem; font-weight: 800; color: var(--text); }
.plan-currency { font-size: .85rem; color: var(--faint); font-weight: 500; }
.plan-period { font-size: .85rem; color: var(--faint); font-weight: 500; }
.plan-features { margin-top: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .55rem; font-size: .88rem; color: var(--muted); }
.plan-features .off { color: var(--faint); opacity: .65; }
.plan-cta { margin-top: 1.25rem; }
.plans-note { max-width: 34rem; margin-inline: auto; text-align: center; }

/* --- paginación / estados vacíos ---------------------------------------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-top: 1.75rem; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 40px; padding: .35rem .7rem;
  border-radius: 9px; border: 1px solid var(--border); background: var(--panel);
  color: var(--muted); font-size: .88rem; font-weight: 600;
}
a.page-btn:hover { border-color: var(--rose); color: var(--rose-2); text-decoration: none; }
.page-btn.current { background: var(--rose); border-color: var(--rose); color: #fff; }
.page-btn.disabled { opacity: .45; }
.page-ellipsis { color: var(--faint); padding: 0 .2rem; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center;
  padding: 2.5rem 1rem; margin: 1.5rem 0;
  border: 1px dashed var(--border); border-radius: 12px; background: rgba(24, 24, 27, .5);
}
.empty-state h2 { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.empty-state p { color: var(--faint); font-size: .9rem; max-width: 26rem; }
.empty-state .btn { margin-top: .5rem; }
.empty-note { padding: 1.25rem; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: .92rem; }
.search-hero { display: flex; gap: .6rem; margin-bottom: 1.75rem; }

/* --- toasts (feedback de fetch) --------------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 26rem);
  padding: .7rem 1.1rem; border-radius: 10px; z-index: 200;
  background: #1c1c20; color: var(--text);
  border: 1px solid rgba(16, 185, 129, .5);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
  font-size: .88rem; text-align: center;
  animation: wb-toast-in .18s ease;
}
.toast.toast-error { border-color: rgba(225, 29, 72, .6); color: #fda4af; }
.toast.out { opacity: 0; transition: opacity .4s ease; }
@keyframes wb-toast-in { from { opacity: 0; transform: translate(-50%, .4rem); } to { opacity: 1; transform: translate(-50%, 0); } }

/* --- responsive web ------------------------------------------------------------------------------------------ */
@media (min-width: 640px) {
  .container { padding-inline: 1.5rem; }
  .page-title { font-size: 1.9rem; }
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .filters { flex-direction: row; align-items: flex-end; }
  .filters .btn { flex-shrink: 0; }
  .detail-head { flex-direction: row; align-items: flex-end; }
  .detail-poster { width: 11rem; }
  .movie-card { width: 10rem; }
  .continue-card { width: 15rem; }
  .plans-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .plans-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .sub-row { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (min-width: 768px) {
  .main-nav { display: flex; align-items: center; gap: .15rem; }
  .nav-burger { display: none; }
  :root { --header-h: 60px; }
}
@media (min-width: 900px) {
  .plans-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .epg-layout { grid-template-columns: 18rem minmax(0, 1fr); }
  .epg-channels .channel-picker { max-height: 32rem; }
}
@media (max-width: 767px) {
  :root { --header-h: 56px; }
  .header-actions .btn-outline { display: none; }
  #nav-toggle:checked ~ .site-header .main-nav .nav-link { padding: .8rem 1rem; font-size: 1rem; }
  .site-main { padding-bottom: 1.5rem; }
  .grid-channels { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .grid-posters { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .history-item { align-items: flex-start; }
}

/* --- [21-b] addendum: ganchos estructurales, tabs y estados de favorito --- */
.detail-info { min-width: 0; flex: 1; }
.detail-player { min-width: 0; }
.epg-main { min-width: 0; }
.channel-head { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1.5rem; }
.channel-head-info { min-width: 0; }
.channel-head-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
@media (min-width: 900px) {
  .channel-head { flex-direction: row; align-items: center; }
  .channel-head-actions { margin-left: auto; }
}
.fav-btn.is-fav { border-color: rgba(225, 29, 72, .6); color: var(--rose-2); }
.fav-btn.is-fav:hover { color: var(--rose-2); border-color: var(--rose-2); }
.fav-btn.is-fav .fav-icon { color: var(--rose-2); }
.tab-panel { display: none; }
#fav-tab-movies:checked ~ #fav-panel-movies,
#fav-tab-channels:checked ~ #fav-panel-channels { display: block; }
#fav-tab-movies:checked ~ .tab-list label[for="fav-tab-movies"],
#fav-tab-channels:checked ~ .tab-list label[for="fav-tab-channels"] {
  border-color: var(--rose); background: var(--rose-soft); color: #fff;
}
.empty-icon { font-size: 2rem; }

.catalog-player-controls{display:flex;gap:12px;flex-wrap:wrap;padding:16px}.catalog-player-controls label{display:flex;flex-direction:column;gap:6px;flex:1 1 240px;min-width:0}.catalog-player-controls select{width:100%;min-width:0;max-width:100%;text-overflow:ellipsis}.catalog-source-info{padding:0 16px 12px;overflow-wrap:anywhere;white-space:pre-line}
.catalog-player-screen{position:relative;aspect-ratio:16/9;background:#000;overflow:hidden;border-radius:12px 12px 0 0}
.catalog-player-screen video{display:block;width:100%;height:100%;object-fit:contain;background:#000}
.catalog-player-play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:76px;height:76px;border:0;border-radius:50%;background:#e50914;color:white;font-size:32px;cursor:pointer;box-shadow:0 8px 32px #000a;z-index:2}
.catalog-player-play:hover,.catalog-player-play:focus-visible{background:#ff2833;scale:1.05}
.catalog-player-play[hidden]{display:none}
.catalog-player-play:disabled{opacity:.55;cursor:wait}
.catalog-player-tracks{position:absolute;right:12px;top:12px;z-index:3;display:flex;gap:8px;max-width:calc(100% - 24px)}
.catalog-player-tracks label{font-size:11px;color:#fff;background:#09090bdd;border:1px solid #ffffff44;border-radius:8px;padding:4px 7px;display:flex;flex-direction:column;gap:2px;min-width:0}
.catalog-player-tracks select{background:transparent;border:0;color:#fff;max-width:135px;font-size:12px}.catalog-player-tracks select option{background:#171719;color:#fff}.catalog-player-tracks select:disabled{opacity:.65}
@media(max-width:520px){.catalog-player-play{width:58px;height:58px;font-size:26px}.catalog-player-tracks{right:6px;top:6px;gap:4px}.catalog-player-tracks label{padding:3px 5px}.catalog-player-tracks select{max-width:105px;font-size:11px}}
