/* =========================================================
   ConscienTV � base styles (mobile first)
   ========================================================= */

:root {
    --color-bg: #050814;
    --color-bg-alt: #0b1020;
    --color-card: #11182b;
    --color-accent: #31B8BD;
    --color-accent-strong: #23538D;
    --color-text: #f5f7ff;
    --color-muted: #9ba4c4;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
    --max-width: 1200px;

    /* Parrilla (JS la lee) */
    --tv-day-col-w: 140px;
    --tv-slot-w: 80;   /* n�mero (JS lo lee) */
    --tv-slot-gap: 8;  /* n�mero (JS lo lee) */
}

/* Reset b�sico */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #101939 0, #050814 50%, #02040a 100%);
    color: var(--color-text);
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* =========================================================
   Layout general
   ========================================================= */

.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 70vh;
}

/* =========================================================
   HEADER / NAVBAR conscienTV
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #071424;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.site-header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-right: auto;
}

.site-header__logo {
    height: 60px;
    width: auto;
    display: block;
}

.main-nav__list {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: flex-end;
}

.main-nav__item {
    margin: 0;
    padding: 0;
}

.main-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    text-decoration: none;
    color: #c2d2f0;
    background: transparent;
    border: 0;
    transition: color 0.2s ease, background 0.2s ease;
}

.main-nav__link--active,
.main-nav__link:hover,
.main-nav__link:focus-visible {
    background: rgba(18, 60, 104, 0.90);
    color: #ffffff;
    text-decoration: none;
}

.main-nav__link::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #31B8BD, #23538D);
    bottom: -4px;
    opacity: 0;
    transform: scaleX(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.main-nav__link--active::after,
.main-nav__link:hover::after,
.main-nav__link:focus-visible::after {
    opacity: 1;
    transform: scaleX(1);
}

@media (max-width: 768px) {
    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .main-nav__list {
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
    }
}

/* =========================================================
   HERO y secciones de home
   ========================================================= */

.hero {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.hero__title {
    font-size: 1.9rem;
    margin: 0 0 0.75rem;
}

.hero__subtitle {
    margin: 0 0 0.75rem;
    color: var(--color-muted);
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    width: auto;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-strong));
    color: #fff;
}

.btn-outline {
    background: transparent;
    border-color: rgba(255,255,255,0.18);
    color: var(--color-text);
}

.btn:hover {
    filter: brightness(1.05);
    text-decoration: none;
}

/* Bot�n pequeno */
.btn-sm { padding: 8px 12px; font-size: 0.9rem; line-height: 1.2; }

/* =========================================================
   SECCI�N EN VIVO
   ========================================================= */

.live-section {
    padding: 2rem 0 3rem;
    background: radial-gradient(circle at top, #163a5c 0, #050b11 60%);
}

/* Live full-bleed (100% viewport). �salo como: <section class="live-section live-section--fullbleed"> */
.live-section--fullbleed{
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.live-section__inner {
    max-width: none;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.live-section__header {
    margin-bottom: 1rem;
}

.live-section__title {
    margin: 0 0 0.25rem;
    font-size: 1.6rem;
}

.live-section__subtitle {
    margin: 0;
    color: #c4d4e8;
    font-size: 0.95rem;
}

/* ===== Home: split player + ficha (DEPURADO) ===== */
.live-split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.live-split__left,
.live-split__right {
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

.live-split__left  { flex: 0 0 68%; min-width: 0; }
.live-split__right { flex: 0 0 32%; min-width: 0; }

@media (max-width: 900px) {
    .live-split {
        flex-direction: column;
    }
    .live-split__left,
    .live-split__right {
        flex: 1 1 auto;
    }
}

/* Player */
.live-player {
    margin-top: 1rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    background: #000;
    flex: 0 0 auto;   /* NO estirar por culpa de la columna derecha */
    display: flex;
}

.live-player__video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    background: #000;
    object-fit: contain;
    aspect-ratio: 16 / 9;
}

/* Columna derecha: 2 bloques en stack (arriba: programa actual, abajo: chat o pr�ximo) */
.live-side{
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 70vh; /* empata con el max-height del video */
}

@media (max-width: 900px){
    .live-side{
        height: auto;
    }
}

.live-side__top,
.live-side__bottom{
    flex: 1;
    min-height: 0;
    display: flex;
}

/* Ajustes de la program-card cuando vive dentro del stack */
.live-side .program-card{
    margin-top: 0;
    flex: 1;
}

/* Logo m�s pequeno para que no infle la card */
.program-card__logo img{
    max-width: 120px;
}

/* Contenedor del chat: ocupa TODO el bloque inferior */
.live-chat{
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    overflow: hidden;
    flex: 1;
}

.live-chat iframe{
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Card del programa (EN VIVO) � se conserva tal cual */
.program-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}

.program-card__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.program-card__logo img {
    max-width: 120px;
    height: auto;
    display: block;
}



.program-card__title {
    margin: 0 0 8px 0;
}

.program-card__desc {
    margin: 0 0 10px 0;
    color: var(--color-muted);
}

.program-card__host {
    margin: 0 0 10px 0;
    color: #cfd8ff;
    font-size: 0.9rem;
}

.program-card__meta {
    margin-top: auto;
    opacity: 0.9;
}

.program-card__live {
    margin: 10px 0 0 0;
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(49,184,189,0.18);
    border: 1px solid rgba(49,184,189,0.35);
}

/* =========================================================
   SECCIONES GENERALES
   ========================================================= */

.section {
    margin-bottom: 2.5rem;
}

.section__inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section__title {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
}

.section__subtitle {
    margin: 1rem 0 0.5rem;
    font-size: 1.15rem;
}

.section__text {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.program-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Separador reutilizable */
.divider {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.12);
}

/* =========================================================
   GRID DE PROGRAMAS
   ========================================================= */

.section-programs {
    margin-top: 1.5rem;
}

.program-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 1rem;
    margin-top: 1.25rem;
}

/* La card del grid ES el <a> */
.program-card-inner {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, rgba(11,16,32,0.96), rgba(16,28,56,0.96));
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    color: var(--color-text);
}

.program-card:hover{
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 10px 26px rgba(0,0,0,0.25);
}

.program-card-inner:hover {
    filter: brightness(1.03);
}

.program-card-inner:focus-visible {
    outline: 3px solid rgba(49,184,189,0.55);
    outline-offset: 3px;
}

.program-card-thumb {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: radial-gradient(circle at top, #22335f, #060814);
}

.program-card-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* =========================================================
   COMUNICADORES � avatar circular dentro del grid
   (override del thumb 16:9 y del img absolute)
   ========================================================= */

.program-card-thumb.communicator-card-avatar{
    padding-top: 0 !important;     /* mata el 16:9 */
    width: 140px;
    height: 140px;
    margin: 18px auto 0;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0,0,0,0.25);
}

/* OJO: aqu� est� la clave: anulamos el img absoluto */
.program-card-thumb.communicator-card-avatar img{
    position: static !important;   /* anula el absolute global */
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 999px;
}

/* Si cae al placeholder, tambi�n circular */
.program-card-thumb.communicator-card-avatar .program-placeholder{
    position: static;
    width: 100%;
    height: 100%;
    border-radius: 999px;
}


/* Placeholder base (no muestra texto) */
.program-placeholder {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, #22335f, #060814);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    font-size: 0.9rem;
}

/* Logo dentro del thumb (100% ancho, centrado, sin deformar) */
.program-card-logo-thumb {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.program-card-logo-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.program-card-body {
    padding: 0.9rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
}

.program-card-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.25;
}

.program-card-summary {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.program-card-schedule {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-accent);
    opacity: 0.95;
}

/* =========================================================
   P�GINA DE PROGRAMA
   ========================================================= */

.program-hero {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.program-hero-media img,
.program-placeholder-big {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.program-placeholder-big {
    min-height: 180px;
    background: radial-gradient(circle at top, #22335f, #060814);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
}

/* ==== FIX: logo gigante en program.php (sin tocar HTML/PHP) ==== */
.program-hero-logo {
    width: 200px;       /* bloque del logo */
    max-width: 45%;     /* evita que se coma el texto en pantallas angostas */
}

.program-hero-logo img {
    width: 100%;
    max-width: 200px;   /* tope duro */
    height: auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 720px) {
    .program-hero-logo {
        width: 160px;
        max-width: 60%;
    }
    .program-hero-logo img {
        max-width: 160px;
    }
}

.program-hero-copy h1 {
    margin: 0 0 0.5rem;
}

.program-tagline {
    margin: 0 0 0.75rem;
    color: var(--color-muted);
}

.program-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--color-accent);
}

.program-meta span {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(35,83,141,0.25);
}

.program-categories {
    margin: 0 0 1rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    background: rgba(49,184,189,0.18);
    color: var(--color-accent);
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

/* =========================================================
   COMUNICADORES
   ========================================================= */

.communicator-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.communicator-card {
    display: flex;
    gap: 0.9rem;
    padding: 0.9rem;
    border-radius: var(--radius-md);
    background: rgba(11,16,32,0.85);
    box-shadow: var(--shadow-soft);
}

.communicator-avatar img,
.avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 999px;
    object-fit: cover;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder {
    color: var(--color-accent);
    font-weight: 600;
}

.communicator-body h3 {
    margin: 0 0 0.25rem;
}

.communicator-bio {
    margin: 0 0 0.5rem;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.communicator-meta,
.communicator-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.communicator-meta a,
.communicator-social a {
    color: var(--color-accent);
}



/* =========================================================
   EPISODIOS
   ========================================================= */

.episode-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.episode-card {
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem;
    border-radius: var(--radius-md);
    background: rgba(11,16,32,0.9);
    box-shadow: var(--shadow-soft);
}

.episode-body h3 {
    margin: 0 0 0.4rem;
}

.episode-summary {
    margin: 0 0 0.5rem;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.episode-meta {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-muted);
    display: flex;
    gap: 0.5rem;
}

/* Embed responsivo (YouTube, etc.) */
.responsive-iframe {
    position: relative;
    padding-top: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.responsive-iframe iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    padding: 1.25rem 1.25rem 1.75rem;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.8rem;
}

/* =========================================================
   BREAKPOINTS
   ========================================================= */

@media (min-width: 720px) {
    .hero {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .program-grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }

    .program-hero {
        grid-template-columns: 5fr 6fr;
        align-items: center;
    }

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

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

@media (min-width: 1024px) {
    .program-grid {
        grid-template-columns: repeat(4, minmax(0,1fr));
    }

    .episode-grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }
}

/* ================= ADMIN UI ===================== */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.admin-card {
    background: rgba(11,16,32,0.95);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.admin-table-wrapper {
    margin-top: 1rem;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-align: left;
}

.admin-table th {
    font-weight: 600;
    color: #cfd8ff;
    background: rgba(255,255,255,0.03);
}

.admin-table tr:hover {
    background: rgba(255,255,255,0.03);
}

.admin-form {
    max-width: 580px;
    margin-top: 1rem;
}

.form-field {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-field label {
    font-size: 0.85rem;
    color: #cfd8ff;
}

.form-field input,
.form-field select,
.form-field textarea {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.35);
    padding: 0.4rem 0.55rem;
    color: #f5f7ff;
}

/* Acciones del formulario (la usas en programs_edit.php, aqu� queda definida) */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.form-error {
    margin-top: 0.5rem;
    color: #ff8a80;
}

.form-error-list {
    margin-top: 0.5rem;
    color: #ff8a80;
}

/* Mensajes de sistema sin inline */
.notice {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: var(--shadow-soft);
}

.notice--success {
    border-color: rgba(49,184,189,0.35);
    background: rgba(49,184,189,0.12);
    color: #e8feff;
}

.notice--error {
    border-color: rgba(255,138,128,0.35);
    background: rgba(255,138,128,0.10);
    color: #ffe9e7;
}

/* =========================================================
   Dropdown Admin (nav) � FIX sin huecos
   ========================================================= */

.nav-dropdown {
    position: relative;
}

.nav-dropdown__menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0;
    min-width: 220px;
    background: rgba(7, 20, 36, 0.98);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.45);
    padding: 0.5rem;
    display: none;
    z-index: 2000;
}

.nav-dropdown__menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

.nav-dropdown__item {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    color: #e4f0ff;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

.nav-dropdown__item:hover,
.nav-dropdown__item:focus-visible {
    background: rgba(49,184,189,0.14);
    color: #ffffff;
    text-decoration: none;
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
    display: block;
}

/* ===== Parrilla semanal (FIX Chrome: d�as fijos fuera del scroller) ===== */

.tv-guide{
  width: 100%;
}

/* Contenedor overlay de flechas */
.tv-guide--arrows{
  position: relative;
}

/* Layout 2 columnas: izquierda fija + derecha scrolleable */
.tv-guide__layout{
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: start;
}

/* Columna izquierda (NO scrollea) */
.tv-guide__left{
  display: grid;
  grid-auto-rows: min-content;
  gap: 10px;
}

.tv-guide__corner,
.tv-guide__day{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-weight: 700;
  opacity: .95;

  background: rgba(7, 20, 36, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 12px;
}

/* Header de "D�a" */
.tv-guide__corner{
  padding: 8px 12px;
}

/* Para que la altura de cada d�a coincida con la altura m�nima de un bloque */
.tv-guide__day{
  min-height: 64px;
}

/* Columna derecha scrolleable */
.tv-guide__scroller{
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

/* Ocultar scrollbar sin romper scroll */
.tv-guide__scroller::-webkit-scrollbar{ height: 0; }
.tv-guide__scroller{ scrollbar-width: none; }
.tv-guide__scroller{ -ms-overflow-style: none; }

/* Dentro del scroller */
.tv-guide__right{
  display: grid;
  grid-auto-rows: min-content;
  gap: 10px;
  min-width: 0;
}

/* Tiempos */
.tv-guide__times{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 80px;
  gap: 8px;
  align-items: center;
}

.tv-guide__time{
  font-size: 12px;
  opacity: .75;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  text-align:center;
  white-space: nowrap;
}

/* Celdas por d�a */
.tv-guide__cells{
  display:grid;
  grid-auto-flow: column;
  grid-auto-columns: 80px;
  gap: 8px;
}

/* Bloques */
.tv-guide__block{
  display:block;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.03);
}

.tv-guide__block--available{ opacity: .55; }

.tv-guide__block--program:hover{
  border-color: rgba(49,184,189,0.45);
  text-decoration: none;
}

.tv-guide__block-title{
  font-weight: 700;
  margin-bottom: 6px;
}

.tv-guide__block-meta{
  font-size: 12px;
  opacity: .85;
}

.tv-guide__block.is-live{
  background: rgba(49,184,189,0.16);
  border-color: rgba(49,184,189,0.55);
}

/* Flechas overlay */
.tv-guide__nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(7,20,36,0.72);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 5;
}

.tv-guide__nav--left{ left: 10px; }
.tv-guide__nav--right{ right: 10px; }

.tv-guide--arrows:hover .tv-guide__nav{
  opacity: 1;
  pointer-events: auto;
}

/* En m�vil, mejor siempre visibles */
@media (max-width: 900px){
  .tv-guide__layout{ grid-template-columns: 120px 1fr; }
  .tv-guide__nav{
    opacity: 1;
    pointer-events: auto;
  }
}

/* Utilidad de ocultamiento */
.is-hidden { display: none !important; }

/* Episodios: 5 por fila en desktop (sin tocar el grid normal) */
@media (min-width: 1024px) {
  .episode-grid.episode-grid--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* En pantallas medianas, 3 por fila es una buena base */
@media (min-width: 720px) and (max-width: 1023px) {
  .episode-grid.episode-grid--five {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* =========================================================
   P�GINA DE PROGRAMA � estilo Netflix (full-bleed + overlay)
   ========================================================= */

/* El main normal tiene max-width + padding; aqu� liberamos el hero */
.program-page{
    max-width: none;
    padding: 0;              /* quita el espacio arriba para que pegue al men� */
}

/* Lo dem�s de secciones sigue centrado con .section__inner */
.program-page .section{
    padding: 0 1.25rem;
    margin-top: 2rem;
}

/* HERO full-bleed */
.program-hero--netflix{
    position: relative;
    width: 100%;
    min-height: 420px;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
}

/* HERO full-bleed real (100% viewport) */
.program-hero--netflix{
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
}


/* fondo */
.program-hero__bg{
    position: absolute;
    inset: 0;
    z-index: 0;
}

.program-hero__bg-img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.program-hero__bg-fallback{
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top, #22335f, #060814);
}

/* overlay tipo Netflix: oscurece para que el texto se lea */
.program-hero__bg-overlay{
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5,8,20,0.95) 0%, rgba(5,8,20,0.75) 42%, rgba(5,8,20,0.10) 100%),
        linear-gradient(180deg, rgba(5,8,20,0.15) 0%, rgba(5,8,20,0.90) 100%);
}

/* contenido */
.program-hero__inner{
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 86px 1.25rem 2.25rem; /* 86px para despegar del header sticky */
}

.program-hero__copy{
    max-width: 560px;
}

.program-hero__logo img{
    max-width: auto;
    height: 200px;
    display: block;
    margin-bottom: 10px;
}

.program-hero__title{
    margin: 0 0 0.5rem;
    font-size: 2.1rem;
}

.program-hero__tagline{
    margin: 0 0 0.85rem;
    color: rgba(245,247,255,0.85);
}

.program-hero__actions{
    margin-top: 0.85rem;
}

/* =========================================================
   Conductores � una sola fila, centrada, m�s compacta
   ========================================================= */

.section__inner--narrow{
    max-width: 980px;
    margin: 0 auto;
}

.hosts-row{
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: stretch;
    overflow-x: auto;
    padding: 12px 2px 4px;
    scrollbar-width: none;
}
.hosts-row::-webkit-scrollbar{ height: 0; }

.host-chip{
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 220px;
    max-width: 260px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(11,16,32,0.85);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: var(--color-text);
}
.host-chip:hover{
    transform: translateY(-2px);
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 10px 26px rgba(0,0,0,0.25);
    text-decoration: none;
}

.host-chip__avatar img,
.host-chip__avatar .avatar-placeholder{
    width: 58px;
    height: 58px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.host-chip__name{
    font-weight: 700;
    line-height: 1.15;
}

.host-chip__bio{
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 2px;
}

.host-chip__meta{
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--color-accent);
    display: flex;
    gap: 10px;
}

/* =========================================================
   Episodios � cinco por l�nea en desktop
   ========================================================= */

@media (min-width: 1024px){
    .episode-grid--five{
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* =========================================================
   AUTOSUICIDIO � Grid RSS (4 por fila, cuadrado, sin texto)
   ========================================================= */

.auto-episodes-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 720px){
    .auto-episodes-grid{
        grid-template-columns: repeat(3, minmax(0,1fr));
    }
}

@media (min-width: 1024px){
    .auto-episodes-grid{
        grid-template-columns: repeat(4, minmax(0,1fr));
    }
}

.auto-ep-card{
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(11,16,32,0.90);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.08);
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, filter 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.auto-ep-card:hover{
    transform: translateY(-2px);
    filter: brightness(1.03);
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 10px 26px rgba(0,0,0,0.25);
    text-decoration: none;
}

.auto-ep-card:focus-visible{
    outline: 3px solid rgba(49,184,189,0.55);
    outline-offset: 3px;
}

/* Card deshabilitada cuando no hay link/audio */
.auto-ep-card--disabled{
    cursor: default;
    opacity: 0.8;
}

.auto-ep-card__media{
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* CUADRADA para que salga completa */
    background: radial-gradient(circle at top, #22335f, #060814);
    overflow: hidden;
}

.auto-ep-card__media img{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* IMPORTANTE: no recorta, muestra completa */
    display: block;
    background: rgba(0,0,0,0.35);
}

.auto-ep-card__fallback{
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, #22335f, #060814);
}

/* Oculta texto pero lo deja accesible (no se muestra el t�tulo) */
.sr-only{
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.auto-ep-card {
    max-width: 100%;
    overflow: hidden;
}

.auto-ep-card__audio {
    width: 100%;
    max-width: 100%;
    display: block;
}


/* Evita scroll horizontal global */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
.site-main {
  max-width: 100%;
  overflow-x: hidden;
}


/* =========================================================
   HOME � Live panel derecho 50/50 SIN alturas fijas
   ========================================================= */

/* El split debe estirar ambas columnas a la misma altura */
.live-split{
  align-items: stretch; /* antes: flex-start */
}

/* La columna derecha debe poder estirarse */
.live-split__right{
  align-self: stretch;
  min-height: 0;
}

/* Quita el alto fijo del panel derecho */
.live-side{
  height: 100%;        /* anula el 70vh */
  max-height: none;    /* por si lo llegaste a poner */
  align-self: stretch; /* toma la altura de la columna derecha */
}

/* Mant�n el 50/50, con un gap ligero */
.live-side__top,
.live-side__bottom{
  flex: 1;
  min-height: 0;
  display: flex;
}

/* Cada card llena su mitad, sin empujar contenido al fondo */
.live-side .program-card{
  flex: 1;
  height: 100%;
  margin-top: 0;
  padding: 12px; /* reduce aire innecesario */
}

/* CLAVE: evita el hueco �horrible� interno */
.live-side .program-card__meta{
  margin-top: 12px; /* anula el margin-top:auto dentro de estas cards */
}

/* Compacta un poco los m�rgenes internos */
.live-side .program-card__title{ margin: 0 0 6px 0; }
.live-side .program-card__desc{ margin: 0 0 8px 0; }
.live-side .program-card__host{ margin: 0 0 8px 0; }

/* Logo m�s discreto para no gastar alto */
.live-side .program-card__logo{ margin-bottom: 6px; }
.live-side .program-card__logo img{ max-width: auto; max-height: 80px; }

/* Indicador de espectadores en vivo */
@keyframes pulse-red {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

#viewer-count-display {
    display: none; /* Se activa por JS */
    align-items: center;
    background: rgba(255, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    color: #d32f2f;
    font-weight: bold;
    font-size: 0.9em;
    border: 1px solid rgba(255,0,0,0.2);
}

#viewer-count-display .dot {
    animation: pulse-red 1.5s infinite;
    margin-right: 4px;
}

.ct-host-slot {
    display: block;
}

.ct-host-button {
    appearance: none;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.ct-host-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
}

.ct-host-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ct-host-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 20, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ct-host-modal__panel {
    position: relative;
    z-index: 1;
    width: min(860px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
    overflow: auto;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(20, 31, 64, 0.72), rgba(8, 14, 30, 0.82));
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.ct-host-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.ct-host-modal__close:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.04);
}

.ct-host-modal__header {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1.75rem 1.75rem 1.25rem;
    padding-right: 4.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ct-host-modal__avatar {
    width: 92px;
    height: 92px;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ct-host-modal__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ct-host-modal__initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.ct-host-modal__eyebrow {
    margin-bottom: 0.3rem;
    color: #31B8BD;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ct-host-modal__title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    line-height: 1.15;
}

.ct-host-modal__body {
    padding: 1.5rem 1.75rem 1.75rem;
}

.ct-host-modal__section + .ct-host-modal__section {
    margin-top: 1.35rem;
}

.ct-host-modal__section-title {
    margin: 0 0 0.85rem;
    color: #fff;
    font-size: 1rem;
}

.ct-host-modal__bio {
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.7;
    white-space: pre-line;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ct-host-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.ct-host-modal__card {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 0;
}

.ct-host-modal__card-label {
    margin-bottom: 0.22rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ct-host-modal__card-value {
    display: block;
    color: #fff;
    text-decoration: none;
    word-break: break-word;
    line-height: 1.45;
}

a.ct-host-modal__card-value {
    color: #7CE8EA;
}

a.ct-host-modal__card-value:hover {
    text-decoration: underline;
}

.ct-host-modal__empty {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ct-host-modal-open {
    overflow: hidden;
}

@media (max-width: 760px) {
    .ct-host-modal__panel {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        margin: 0.5rem auto;
        border-radius: 22px;
    }

    .ct-host-modal__header {
        grid-template-columns: 72px 1fr;
        gap: 0.85rem;
        padding: 1.1rem 1.1rem 1rem;
        padding-right: 3.8rem;
    }

    .ct-host-modal__avatar {
        width: 72px;
        height: 72px;
        border-radius: 18px;
    }

    .ct-host-modal__body {
        padding: 1rem 1.1rem 1.15rem;
    }

    .ct-host-modal__grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   HOME · chat propio
   ========================================================= */

#live-card-bottom {
    position: relative;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

#live-card-bottom-html,
#custom-chat-area {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
}

#live-card-bottom-html[hidden],
#custom-chat-area[hidden] {
    display: none !important;
}

.ctv-chat-shell {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
    z-index: 5;
}

.ctv-chat {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(20, 31, 64, 0.74), rgba(8, 14, 30, 0.84));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.ctv-chat__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.ctv-chat__header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ctv-chat__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #31B8BD;
    box-shadow: 0 0 12px rgba(49, 184, 189, 0.7);
    flex: 0 0 auto;
}

.ctv-chat__title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctv-chat__hint {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    white-space: nowrap;
}

.ctv-chat__messages {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    scrollbar-gutter: stable both-edges;
}

.ctv-chat__messages-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.ctv-chat__bubble {
    max-width: 90%;
    padding: 10px 12px;
    border-radius: 14px 14px 14px 4px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.ctv-chat__bubble-name {
    margin-bottom: 4px;
    color: #128c7e;
    font-size: 0.76rem;
    font-weight: 700;
}

.ctv-chat__bubble-text {
    color: #1f1f1f;
    font-size: 0.92rem;
    line-height: 1.42;
    word-break: break-word;
}

.ctv-chat__empty {
    padding: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
}

.ctv-chat__form {
    flex: 0 0 auto;
    position: relative;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 24, 0.42);
}

.ctv-chat__row {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.ctv-chat__row--message {
    align-items: center;
}

.ctv-chat__input {
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #1f1f1f;
    outline: none;
    position: relative;
    z-index: 7;
    pointer-events: auto;
}

.ctv-chat__input:focus {
    border-color: #31B8BD;
    box-shadow: 0 0 0 3px rgba(49, 184, 189, 0.16);
}

.ctv-chat__input--message {
    flex: 1 1 auto;
    min-width: 0;
}

.ctv-chat__send {
    flex: 0 0 auto;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #31B8BD, #23538D);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    z-index: 7;
    pointer-events: auto;
}

.ctv-chat__send:hover {
    filter: brightness(1.05);
}

@media (max-width: 900px) {
    .ctv-chat__hint {
        display: none;
    }
}

@media (max-width: 640px) {
    .ctv-chat__row--message {
        flex-direction: column;
        align-items: stretch;
    }

    .ctv-chat__send {
        width: 100%;
    }
}

.live-player {
    position: relative;
    overflow: hidden;
}

.player-offline-mask[hidden] {
    display: none !important;
}

.player-offline-mask {
    position: absolute !important;
    inset: 0 !important;
    z-index: 8 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(5, 8, 20, 0.58);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
}

/* =========================================================
   CHAT EMBED · panel y overlay OBS
   ========================================================= */

.chat-embed-page {
    margin: 0;
    min-height: 100vh;
    background: #050814;
    color: #f5f7ff;
}

.chat-embed-page--overlay {
    background: transparent;
}

.chat-embed {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-embed--panel {
    background: linear-gradient(180deg, rgba(20, 31, 64, 0.74), rgba(8, 14, 30, 0.84));
}

.chat-embed--overlay {
    justify-content: flex-end;
    padding: 16px;
    background: transparent;
}

.chat-embed__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.chat-embed__header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-embed__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #31B8BD;
    box-shadow: 0 0 12px rgba(49, 184, 189, 0.7);
    flex: 0 0 auto;
}

.chat-embed__title {
    margin: 0;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-embed__hint {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    white-space: nowrap;
}

.chat-embed__messages {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    scrollbar-gutter: stable both-edges;
}

.chat-embed--overlay .chat-embed__messages {
    overflow: hidden;
    padding: 0;
}

.chat-embed__messages-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.chat-embed--overlay .chat-embed__messages-inner {
    align-items: flex-start;
    gap: 12px;
}

.chat-embed__bubble {
    max-width: min(520px, 100%);
    padding: 10px 12px;
    border-radius: 14px 14px 14px 4px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.chat-embed--overlay .chat-embed__bubble {
    background: rgba(7, 20, 36, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chat-embed__bubble-name {
    margin-bottom: 4px;
    color: #128c7e;
    font-size: 0.76rem;
    font-weight: 700;
}

.chat-embed--overlay .chat-embed__bubble-name {
    color: #7CE8EA;
}

.chat-embed__bubble-text {
    color: #1f1f1f;
    font-size: 0.92rem;
    line-height: 1.42;
    word-break: break-word;
}

.chat-embed--overlay .chat-embed__bubble-text {
    color: #fff;
}

.chat-embed__empty {
    padding: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
}

.chat-embed--overlay .chat-embed__empty {
    display: none;
}

.chat-embed__form {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 24, 0.42);
}

.chat-embed__row {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.chat-embed__row--message {
    align-items: center;
}

.chat-embed__input {
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #1f1f1f;
    outline: none;
}

.chat-embed__input:focus {
    border-color: #31B8BD;
    box-shadow: 0 0 0 3px rgba(49, 184, 189, 0.16);
}

.chat-embed__input--message {
    flex: 1 1 auto;
    min-width: 0;
}

.chat-embed__send {
    flex: 0 0 auto;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #31B8BD, #23538D);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.chat-embed__send:hover {
    filter: brightness(1.05);
}

@media (max-width: 900px) {
    .chat-embed__hint {
        display: none;
    }
}

@media (max-width: 640px) {
    .chat-embed__row--message {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-embed__send {
        width: 100%;
    }

    .chat-embed--overlay {
        padding: 10px;
    }
}

/* =========================================================
   CHAT EMBED · panel, overlay y control
   ========================================================= */

.chat-embed-page {
    margin: 0;
    min-height: 100vh;
    background: #050814;
    color: #f5f7ff;
}

.chat-embed-page--overlay {
    background: transparent;
}

.chat-embed {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-embed--panel {
    background: linear-gradient(180deg, rgba(20, 31, 64, 0.74), rgba(8, 14, 30, 0.84));
}

.chat-embed--overlay {
    justify-content: flex-end;
    padding: 16px;
    background: transparent;
}

.chat-embed__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.chat-embed__header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-embed__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #31B8BD;
    box-shadow: 0 0 12px rgba(49, 184, 189, 0.7);
    flex: 0 0 auto;
}

.chat-embed__title {
    margin: 0;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-embed__hint {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    white-space: nowrap;
}

.chat-embed__messages {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    scrollbar-gutter: stable both-edges;
}

.chat-embed--overlay .chat-embed__messages {
    overflow: hidden;
    padding: 0;
}

.chat-embed__messages-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.chat-embed--overlay .chat-embed__messages-inner {
    align-items: flex-start;
    gap: 12px;
}

.chat-embed__bubble {
    max-width: min(520px, 100%);
    padding: 10px 12px;
    border-radius: 14px 14px 14px 4px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.chat-embed--overlay .chat-embed__bubble {
    background: rgba(7, 20, 36, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chat-embed__bubble-name {
    margin-bottom: 4px;
    color: #128c7e;
    font-size: 0.76rem;
    font-weight: 700;
}

.chat-embed--overlay .chat-embed__bubble-name {
    color: #7CE8EA;
}

.chat-embed__bubble-text {
    color: #1f1f1f;
    font-size: 0.92rem;
    line-height: 1.42;
    word-break: break-word;
}

.chat-embed--overlay .chat-embed__bubble-text {
    color: #fff;
}

.chat-embed__empty {
    padding: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
}

.chat-embed--overlay .chat-embed__empty {
    display: none;
}

.chat-embed__form {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 24, 0.42);
}

.chat-embed__row {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.chat-embed__row--message {
    align-items: center;
}

.chat-embed__input {
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #1f1f1f;
    outline: none;
}

.chat-embed__input:focus {
    border-color: #31B8BD;
    box-shadow: 0 0 0 3px rgba(49, 184, 189, 0.16);
}

.chat-embed__input--message {
    flex: 1 1 auto;
    min-width: 0;
}

.chat-embed__send {
    flex: 0 0 auto;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #31B8BD, #23538D);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.chat-embed__send:hover {
    filter: brightness(1.05);
}

/* =========================================================
   CHAT CONTROL · tipo StreamYard
   ========================================================= */

.chat-control-denied {
    max-width: 700px;
    margin: 3rem auto;
    padding: 1.5rem;
}

.chat-control {
    min-height: 100vh;
    padding: 1rem;
    background: radial-gradient(circle at top, #163a5c 0, #050b11 60%);
    color: #f5f7ff;
}

.chat-control__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1rem;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(20, 31, 64, 0.74), rgba(8, 14, 30, 0.84));
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.chat-control__header-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-control__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #31B8BD;
    box-shadow: 0 0 12px rgba(49, 184, 189, 0.7);
}

.chat-control__title {
    margin: 0;
    font-size: 1.2rem;
}

.chat-control__hint {
    color: rgba(255,255,255,0.74);
    font-size: 0.88rem;
}

.chat-control__featured,
.chat-control__messages-wrap {
    margin-bottom: 1rem;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(20, 31, 64, 0.74), rgba(8, 14, 30, 0.84));
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.chat-control__featured-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.chat-control__section-title {
    margin: 0;
    font-size: 1rem;
}

.chat-control__clear-btn,
.chat-control__show-btn,
.chat-control__delete-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.chat-control__clear-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.chat-control__show-btn {
    background: linear-gradient(135deg, #31B8BD, #23538D);
    color: #fff;
}

.chat-control__delete-btn {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.14);
}

.chat-control__featured-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
}

.chat-control__featured-card--empty {
    color: rgba(255,255,255,0.72);
}

.chat-control__featured-name {
    margin-bottom: 6px;
    color: #7CE8EA;
    font-weight: 700;
    font-size: 0.86rem;
}

.chat-control__featured-text {
    line-height: 1.5;
}

.chat-control__messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-control__empty {
    padding: 14px;
    border-radius: 14px;
    border: 1px dashed rgba(255,255,255,0.16);
    color: rgba(255,255,255,0.74);
}

.chat-control__message {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
}

.chat-control__message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.chat-control__message-name {
    margin-bottom: 4px;
    color: #7CE8EA;
    font-size: 0.82rem;
    font-weight: 700;
}

.chat-control__message-text {
    line-height: 1.45;
    word-break: break-word;
}

/* =========================================================
   FEATURED OVERLAY · para OBS
   ========================================================= */

.chat-featured-page {
    margin: 0;
    background: transparent;
}

.chat-featured-overlay {
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 22px;
    background: transparent;
}

.chat-featured-overlay__box {
    width: min(900px, 100%);
    padding: 18px 22px;
    border-radius: 22px;
    background: rgba(7, 20, 36, 0.88);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 16px 36px rgba(0,0,0,0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.chat-featured-overlay__name {
    margin-bottom: 6px;
    color: #7CE8EA;
    font-size: 0.92rem;
    font-weight: 700;
}

.chat-featured-overlay__text {
    color: #fff;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    line-height: 1.45;
    word-break: break-word;
}

@media (max-width: 900px) {
    .chat-embed__hint,
    .chat-control__hint {
        display: none;
    }
}

@media (max-width: 640px) {
    .chat-embed__row--message {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-embed__send {
        width: 100%;
    }

    .chat-embed--overlay {
        padding: 10px;
    }

    .chat-control {
        padding: 0.75rem;
    }

    .chat-control__message {
        grid-template-columns: 1fr;
    }

    .chat-control__message-actions {
        justify-content: stretch;
    }

    .chat-control__show-btn,
    .chat-control__delete-btn,
    .chat-control__clear-btn {
        width: 100%;
    }

    .chat-featured-overlay {
        padding: 12px;
    }

    .chat-featured-overlay__box {
        padding: 14px 16px;
        border-radius: 18px;
    }
}

/* =========================================================
   HOME · fix chat lateral del index
   ========================================================= */

@media (min-width: 901px) {
    .live-split {
        align-items: flex-start;
    }

    .live-split__right {
        flex: 0 0 32%;
        max-width: 32%;
        height: 70vh;
        min-height: 0;
    }

    .live-side {
        height: 100%;
        max-height: 70vh;
        min-height: 0;
    }
}

.live-split__right,
.live-side,
.live-side__top,
.live-side__bottom,
#live-card-bottom,
#live-card-bottom-html,
#custom-chat-area,
.ctv-chat-shell,
.ctv-chat {
    min-height: 0;
}

.live-side__top,
.live-side__bottom,
#live-card-bottom,
#live-card-bottom-html:not([hidden]),
#custom-chat-area:not([hidden]),
.ctv-chat-shell,
.ctv-chat {
    display: flex;
    overflow: hidden;
}

.ctv-chat {
    width: 100%;
    height: 100%;
}

.ctv-chat__messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}