:root {
  --primario: #004852;
  --primario-oscuro: #00343b;
  --primario-claro: #e6f0f1;
  --acento: #fcdf00;
  --acento-oscuro: #e0c600;
  --texto: #1f2a2e;
  --texto-suave: #55656b;
  --fondo: #ffffff;
  --fondo-suave: #f4f7f7;
  --borde: #d5dfe1;
  --peligro: #b3261e;
  --ok: #1b6e3a;
  --cancion: #7a3e9d;
  --cuento: #0067a5;
  --radio: 10px;
  --sombra: 0 2px 10px rgba(0, 40, 46, .08);
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--fuente); font-size: 1rem; line-height: 1.6; color: var(--texto); background: var(--fondo); }
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--primario); text-underline-offset: 2px; }
a:hover { color: var(--primario-oscuro); }
h1, h2, h3 { line-height: 1.25; color: var(--primario); }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); margin: .5rem 0 1rem; }
h2 { font-size: 1.3rem; }
:focus-visible { outline: 3px solid var(--acento-oscuro); outline-offset: 2px; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: -999px; top: 0; background: var(--acento); padding: .5rem 1rem; z-index: 100; }
.saltar:focus { left: 0; }
.contenedor { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.principal { padding-top: 1.5rem; padding-bottom: 3rem; min-height: 60vh; }
.centrado { text-align: center; }
.subtitulo { color: var(--texto-suave); margin-top: -.5rem; }
.nota, .ayuda { font-size: .9rem; color: var(--texto-suave); }
.ayuda { margin: .25rem 0 1rem; }
.separado { margin-top: 2rem; }

/* ---------- Botones ---------- */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.2rem; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; line-height: 1.2; text-transform: uppercase; letter-spacing: .02em; }
.boton-primario { background: var(--primario); color: #fff; }
.boton-primario:hover { background: var(--primario-oscuro); color: #fff; }
.boton-acento { background: var(--acento); color: var(--primario); }
.boton-acento:hover { background: var(--acento-oscuro); color: var(--primario); }
.boton-secundario { background: #fff; color: var(--primario); border-color: var(--primario); }
.boton-secundario:hover { background: var(--primario-claro); }
.boton-claro { background: transparent; color: #fff; border-color: #fff; }
.boton-peligro { background: #fff; color: var(--peligro); border-color: var(--peligro); }
.boton-peligro:hover { background: var(--peligro); color: #fff; }
.boton-enlace { background: none; color: var(--primario); padding: .6rem .5rem; }
.boton-pequeno { padding: .35rem .8rem; font-size: .8rem; }
.boton-ancho { width: 100%; margin-top: 1rem; }
.enlace-boton { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.enlace-discreto { font-size: .9rem; color: var(--texto-suave); }
.botones { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ---------- Cabecera ---------- */
.cabecera { background: #fff; border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 20; }
.cabecera-fila { display: flex; align-items: center; gap: 1rem; padding-top: .6rem; padding-bottom: .6rem; }
.logo img { display: block; width: 110px; height: auto; }
.buscador { flex: 1; display: flex; max-width: 460px; margin-left: auto; }
.buscador input { flex: 1; min-width: 0; padding: .55rem .9rem; border: 2px solid var(--borde); border-right: 0; border-radius: 999px 0 0 999px; font: inherit; }
.buscador button { border: 0; background: var(--primario); color: #fff; padding: 0 1rem; border-radius: 0 999px 999px 0; cursor: pointer; }
.cuenta { display: flex; align-items: center; gap: .5rem; }
.cuenta form { margin: 0; }
.menu { background: var(--primario); }
.menu .contenedor { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.menu a { color: #fff; text-decoration: none; font-weight: 700; text-transform: uppercase; font-size: .9rem; padding: .75rem 1rem; letter-spacing: .03em; }
.menu a:hover { background: var(--primario-oscuro); color: #fff; }
.menu a[aria-current="page"] { color: var(--acento); box-shadow: inset 0 -3px 0 var(--acento); }
.menu-sep { flex: 1; }
.menu-boton { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.hamburguesa, .hamburguesa::before, .hamburguesa::after { display: block; width: 26px; height: 3px; background: var(--primario); border-radius: 2px; position: relative; content: ""; }
.hamburguesa::before { position: absolute; top: -8px; }
.hamburguesa::after { position: absolute; top: 8px; }

/* ---------- Avisos ---------- */
.aviso { padding: .8rem 1rem; border-radius: var(--radio); margin: 0 0 1rem; border-left: 5px solid; background: var(--fondo-suave); }
.aviso-ok { border-color: var(--ok); background: #e9f6ee; }
.aviso-error { border-color: var(--peligro); background: #fcecea; }
.aviso-info { border-color: var(--primario); background: var(--primario-claro); }

/* ---------- Portada ---------- */
.portada { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; margin-bottom: 3rem; }
.portada h1 { text-transform: uppercase; }
.portada video, .video-pagina { width: 100%; border-radius: var(--radio); background: #000; box-shadow: var(--sombra); }
.video-pagina { margin-bottom: 1.5rem; }
.seccion-titulo { margin-top: 1rem; }

/* ---------- Biblioteca ---------- */
.pestanas { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.pestanas a { padding: .45rem 1rem; border-radius: 999px; background: var(--fondo-suave); color: var(--primario); text-decoration: none; font-weight: 700; font-size: .9rem; text-transform: uppercase; }
.pestanas a[aria-current="page"] { background: var(--primario); color: #fff; }
.pestanas-cuenta { border-bottom: 1px solid var(--borde); padding-bottom: 1rem; }
.filtros { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; background: var(--fondo-suave); padding: 1rem; border-radius: var(--radio); margin-bottom: 1.5rem; }
.filtros label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 700; color: var(--texto-suave); flex: 1 1 160px; }
.filtros input, .filtros select { margin-top: .25rem; }
.resultados { color: var(--texto-suave); font-size: .9rem; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); display: flex; flex-direction: column; }
.tarjeta-cuerpo { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.tarjeta-titulo { font-size: 1.1rem; margin: 0; }
.tarjeta-titulo a { text-decoration: none; }
.tarjeta-titulo a:hover { text-decoration: underline; }
.tarjeta-texto { margin: 0; color: var(--texto-suave); font-size: .93rem; overflow-wrap: anywhere; }
.etiquetas { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.chip { display: inline-block; font-size: .78rem; padding: .15rem .6rem; border-radius: 999px; background: var(--fondo-suave); color: var(--texto-suave); text-decoration: none; font-weight: 600; }
a.chip:hover { background: var(--primario-claro); }
.chip-cuento { background: var(--cuento); color: #fff; }
.chip-cancion { background: var(--cancion); color: #fff; }
.chip-estado { background: #fff3c4; color: #6b5600; }
.chip-usuario { background: #fff; border: 1px solid var(--borde); }
.vacio { text-align: center; color: var(--texto-suave); padding: 2rem 1rem; background: var(--fondo-suave); border-radius: var(--radio); }
.vacio img { display: block; margin: 0 auto 1rem; width: 120px; }
.paginacion { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin: 2rem 0 0; }
.paginacion a, .paginacion span { min-width: 2.4rem; text-align: center; padding: .4rem .7rem; border-radius: 8px; text-decoration: none; border: 1px solid var(--borde); }
.paginacion span { border-color: transparent; }
.paginacion a[aria-current="page"] { background: var(--primario); color: #fff; border-color: var(--primario); }

/* ---------- Reproductor con consentimiento ---------- */
.reproductor { position: relative; aspect-ratio: 16 / 9; background: var(--primario); overflow: hidden; color: #fff; }
.reproductor iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reproductor-fondo { position: absolute; inset: 0; background: linear-gradient(135deg, var(--primario) 0%, var(--primario-oscuro) 100%); }
.reproductor-cancion { background: linear-gradient(135deg, #5d2d79 0%, var(--primario) 100%); }
.reproductor-fondo::after { content: ""; position: absolute; inset: 0; background: url("../img/logo.png") no-repeat right 12px bottom 12px / 56px auto; opacity: .35; }
.reproductor-miniatura { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.reproductor-play { position: absolute; inset: 0; z-index: 2; width: 100%; border: 0; background: rgba(0, 0, 0, .12); color: rgba(0, 0, 0, .7); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.reproductor-play svg circle { fill: var(--acento); }
.reproductor-play svg path { fill: var(--primario); }
.reproductor-play:hover svg { transform: scale(1.08); }
.reproductor-play svg { transition: transform .15s; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.reproductor-aviso { position: absolute; inset: 0; z-index: 3; background: rgba(0, 40, 46, .94); padding: 1rem; display: flex; flex-direction: column; justify-content: center; gap: .6rem; font-size: .88rem; }
.reproductor-aviso[hidden] { display: none; }
.reproductor-aviso p { margin: 0; }
.reproductor-aviso div { display: flex; flex-wrap: wrap; gap: .5rem; }
.reproductor-externo { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.ficha { max-width: 860px; }
.ficha .reproductor { border-radius: var(--radio); margin-bottom: 1rem; }
.migas { font-size: .9rem; color: var(--texto-suave); margin: 0; }
.meta { color: var(--texto-suave); font-size: .9rem; }
.denunciar { margin-top: 1.5rem; font-size: .9rem; }

/* ---------- Acciones en tarjeta ---------- */
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: auto; padding-top: .5rem; }
.acciones form { margin: 0; }
.boton-icono { display: inline-flex; align-items: center; gap: .3rem; background: #fff; border: 1px solid var(--borde); border-radius: 999px; padding: .35rem .7rem; cursor: pointer; font: inherit; font-size: .85rem; color: var(--primario); text-decoration: none; list-style: none; }
.boton-icono::-webkit-details-marker { display: none; }
.boton-icono svg { fill: none; stroke: var(--primario); stroke-width: 2; }
.boton-icono svg path[fill] { stroke: none; }
.boton-icono.activo svg { fill: #d6336c; stroke: #d6336c; }
.boton-icono:hover { background: var(--fondo-suave); }
.desplegable { position: relative; }
.desplegable-panel { position: absolute; z-index: 10; bottom: calc(100% + 6px); left: 0; width: 260px; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: .8rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .15); display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; }

/* ---------- Formularios ---------- */
.caja-estrecha { max-width: 520px; margin: 0 auto; }
.caja-media { max-width: 760px; margin: 0 auto; }
.caja { background: var(--fondo-suave); border-radius: var(--radio); padding: 1.25rem; }
.caja h2 { margin-top: 0; }
.caja-peligro { border: 1px solid #f0c7c3; background: #fff8f7; }
.formulario label, .formulario legend { display: block; font-weight: 700; margin: .9rem 0 .3rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; padding: .6rem .8rem; border: 2px solid var(--borde); border-radius: 8px; font: inherit; background: #fff; color: var(--texto); }
input:focus, select:focus, textarea:focus { border-color: var(--primario); outline: none; box-shadow: 0 0 0 3px rgba(0, 72, 82, .2); }
fieldset { border: 0; padding: 0; margin: 0; }
.formulario .casilla, .casilla { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: 1rem 0; }
.casilla input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.campo-clave { position: relative; }
.campo-clave input { padding-right: 5.5rem; }
.campo-clave button { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font-size: .85rem; }
.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.info-privacidad { font-size: .8rem; color: var(--texto-suave); background: var(--fondo-suave); padding: .75rem; border-radius: 8px; line-height: 1.5; }
.en-linea { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.en-linea label { flex: 1 1 240px; display: flex; flex-direction: column; font-weight: 700; gap: .3rem; }
.titulo-con-accion { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.barra-lista { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.barra-lista form { margin: 0; }
.listado-listas { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.listado-listas a { display: flex; flex-direction: column; padding: 1.1rem; border: 1px solid var(--borde); border-radius: var(--radio); text-decoration: none; box-shadow: var(--sombra); }
.listado-listas a:hover { border-color: var(--primario); }
.listado-listas span { color: var(--texto-suave); font-size: .9rem; }
.columnas-cuenta { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; align-items: start; }
.datos { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; }
.datos dt { font-weight: 700; }
.datos dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Textos legales ---------- */
.texto-legal { max-width: 860px; }
.texto-legal table { border-collapse: collapse; width: 100%; font-size: .9rem; margin: 1rem 0; display: block; overflow-x: auto; }
.texto-legal th, .texto-legal td { border: 1px solid var(--borde); padding: .5rem; text-align: left; vertical-align: top; }
.texto-legal th { background: var(--fondo-suave); }
.texto-legal a { overflow-wrap: anywhere; }

/* ---------- Administración ---------- */
.tabla-scroll { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th, .tabla td { padding: .6rem; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: top; }
.tabla th { background: var(--fondo-suave); }
.tabla tr.resuelta { opacity: .55; }
.acciones-tabla { display: flex; flex-wrap: wrap; gap: .3rem; }
.acciones-tabla form { margin: 0; }

.admin-nav { border-bottom: 1px solid var(--borde); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.contador { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; margin-left: .25rem; border-radius: 999px; background: var(--peligro); color: #fff; font-size: .75rem; line-height: 1.4rem; text-align: center; }
.menu .contador { background: var(--acento); color: var(--primario); }
.estadisticas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.estadistica { background: var(--fondo-suave); border-radius: var(--radio); padding: 1rem; display: flex; flex-direction: column; }
.estadistica strong { font-size: 1.8rem; color: var(--primario); line-height: 1.1; }
.estadistica span { font-size: .85rem; color: var(--texto-suave); }
.barra-masiva { position: sticky; top: 0; z-index: 15; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; background: var(--primario-claro); border: 1px solid var(--borde); border-radius: var(--radio); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.barra-masiva label { display: flex; flex-direction: column; font-weight: 700; }
.barra-masiva .casilla { flex-direction: row; font-weight: 400; margin: 0; align-items: center; }
.barra-masiva .motivo { flex: 1 1 260px; }
.barra-masiva select, .barra-masiva input[type="text"] { padding: .4rem .6rem; }
.tarjeta-admin.por-revisar { border: 2px solid var(--acento-oscuro); }
.tarjeta-admin .seleccionar { margin: 0; font-size: .85rem; }
.meta-admin { font-size: .82rem; color: var(--texto-suave); margin: 0; overflow-wrap: anywhere; }
.chip-revisar { background: var(--acento); color: var(--primario); }
.chip-denuncia { background: #fcecea; color: var(--peligro); }
.chip-admin { background: var(--primario); color: #fff; }
.actividad { list-style: none; padding: 0; font-size: .9rem; }
.actividad li { padding: .5rem 0; border-bottom: 1px solid var(--borde); }
.actividad time, .actividad .quien { color: var(--texto-suave); }
.texto-largo { overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--borde); margin: 1.25rem 0; }

/* ---------- Pie ---------- */
.pie { background: var(--primario); color: #fff; margin-top: 2rem; }
.pie a, .pie .enlace-boton { color: #fff; }
.pie h2 { color: var(--acento); font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.pie ul { list-style: none; padding: 0; margin: 0; }
.pie li { margin: .3rem 0; }
.pie address { font-style: normal; }
.pie-columnas { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; padding-top: 2.5rem; padding-bottom: 2rem; font-size: .92rem; }
.pie-logo { background: #fff; border-radius: 8px; padding: 6px; width: 110px; }
.pie-logos { background: #fff; padding: 1rem 0; }
.pie-logos .contenedor { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: center; align-items: center; }
.pie-logos img { height: 56px; width: auto; }
.pie-copy { font-size: .8rem; padding-top: .8rem; padding-bottom: .8rem; margin: 0; opacity: .85; }

/* ---------- Banner de cookies ---------- */
.cookies { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 16px; }
.cookies[hidden] { display: none; }
.cookies-caja { max-width: 860px; margin: 0 auto; background: #fff; border-radius: var(--radio); box-shadow: 0 10px 40px rgba(0, 0, 0, .3); padding: 1.25rem 1.5rem; border-top: 5px solid var(--acento); font-size: .92rem; }
.cookies-caja h2 { margin: 0 0 .5rem; }
.cookies-opciones { margin: .5rem 0 1rem; display: flex; flex-direction: column; gap: .5rem; }
.cookies-opciones[hidden] { display: none; }
.interruptor { display: flex; gap: .6rem; align-items: flex-start; }
.interruptor input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.cookies-botones { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.cookies-botones [hidden] { display: none; }

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  .portada { grid-template-columns: 1fr; gap: 1.5rem; }
  .pie-columnas { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .cabecera-fila { flex-wrap: wrap; }
  .menu-boton { display: block; margin-left: auto; }
  .buscador { order: 3; flex-basis: 100%; max-width: none; }
  .cuenta { order: 2; }
  .cuenta .boton { padding: .45rem .8rem; font-size: .78rem; }
  .menu { display: none; }
  .menu-abierto .menu { display: block; }
  .menu .contenedor { flex-direction: column; align-items: stretch; padding: .25rem 0; }
  .menu-sep { height: 1px; background: rgba(255, 255, 255, .2); margin: .25rem 1rem; }
  .dos-columnas { grid-template-columns: 1fr; }
  .rejilla { grid-template-columns: 1fr; }
  .cookies { padding: 8px; }
  .cookies-botones .boton { flex: 1 1 40%; }
}
@media (max-width: 480px) {
  .pie-columnas { grid-template-columns: 1fr; }
  .logo img { width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
