/* App de Ceres Diario. Oscuro por defecto; claro desde "Más". Colores: azul #214BAA, naranja #F97D00, navy #0C1C48. */
:root {
	--fondo: #0A1636; --barra: #0C1C48; --borde: #1d2e63; --tarjeta: #122459; --chip: #16275a;
	--texto: #fff; --texto-2: #dfe5f5; --suave: #8E9BC0; --naranja: #F97D00; --azul: #214BAA; --navy: #0C1C48;
	--sombra: 0 10px 28px rgba(0, 0, 0, .35);
	color-scheme: dark;
}
:root[data-tema="claro"] {
	--fondo: #f3f5fa; --barra: #fff; --borde: #e2e6f0; --tarjeta: #fff; --chip: #e9edf7;
	--texto: #0C1C48; --texto-2: #2b3553; --suave: #66708f; --sombra: 0 8px 22px rgba(12, 28, 72, .12);
	color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }

.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 640px; margin: 0 auto; position: relative; overflow: hidden; background: var(--fondo); }
.app-cargando { flex: 1; display: grid; place-items: center; background: var(--navy); }
.app-vista { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* Barra de arriba */
.app-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--barra); border-bottom: 1px solid var(--borde); flex: none; }
.app-top h1 { margin: 0; font-size: 24px; font-weight: 800; }
.app-logo { height: 50px; width: auto; display: block; background: #fff; padding: 4px 8px; border-radius: 10px; }
.app-logo.chico { height: 42px; padding: 3px 7px; }
.vivo-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 5px 9px; border-radius: 99px; background: rgba(249, 125, 0, .15); color: #FFB066; }
:root[data-tema="claro"] .vivo-pill { color: #b45700; }
.punto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 0 3px rgba(255, 59, 48, .25); flex: none; }
:root[data-radio="sonando"] .punto { animation: titila 1.6s ease-in-out infinite; }
@keyframes titila { 50% { opacity: .35; } }
.ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--chip); }

/* Contenido */
.vista { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 20px; overscroll-behavior: contain; }
.sin-conexion { background: #6b4300; color: #fff; font-size: 13px; padding: calc(env(safe-area-inset-top) + 6px) 14px 6px; text-align: center; }
.sin-conexion + .app-vista .app-top { padding-top: 10px; }
.vacio { color: var(--suave); text-align: center; padding: 30px 10px; }

/* Pestañas y reproductor fijo */
.tabs { display: flex; justify-content: space-around; padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px); background: var(--barra); border-top: 1px solid var(--borde); flex: none; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--suave); font-size: 11px; min-width: 64px; min-height: 48px; justify-content: center; }
.tab b { font-weight: 600; }
.tab.on { color: var(--naranja); }
.mini { display: flex; align-items: center; gap: 10px; margin: 0 8px 6px; padding: 8px 10px; background: var(--azul); color: #fff; border-radius: 14px; box-shadow: var(--sombra); flex: none; }
.mini-info { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-info img { width: 38px; height: 38px; border-radius: 8px; }
.mini-info > span { display: flex; flex-direction: column; min-width: 0; }
.mini-info b { font-size: 14px; }
.mini-info small { font-size: 12px; color: #d6e0ff; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--naranja); color: #fff; display: grid; place-items: center; flex: none; }

/* Radio */
.aviso-vivo { display: flex; align-items: center; gap: 8px; background: #c4001d; color: #fff; border-radius: 12px; padding: 11px 12px; font-size: 14px; margin-bottom: 4px; }
.aviso-vivo span { margin-left: auto; font-weight: 700; }
.player { text-align: center; padding: 22px 0 8px; }
.ondas { position: relative; width: 186px; height: 186px; margin: 0 auto 18px; display: grid; place-items: center; }
.ondas span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(249, 125, 0, .35); }
.ondas span:nth-child(2) { inset: -14px; border-color: rgba(249, 125, 0, .2); }
.ondas span:nth-child(3) { inset: -28px; border-color: rgba(249, 125, 0, .1); }
:root[data-radio="sonando"] .ondas span { animation: onda 2.4s ease-out infinite; }
:root[data-radio="sonando"] .ondas span:nth-child(2) { animation-delay: .8s; }
:root[data-radio="sonando"] .ondas span:nth-child(3) { animation-delay: 1.6s; }
@keyframes onda { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.15); opacity: 0; } }
.play-grande { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffa04a, #F97D00 60%, #d96a00); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(249, 125, 0, .4); position: relative; z-index: 1; }
:root[data-radio="cargando"] .play-grande, :root[data-radio="reconectando"] .play-grande { animation: latido 1s ease-in-out infinite; }
@keyframes latido { 50% { transform: scale(.95); } }
.player h2 { margin: 4px 0 6px; font-size: 28px; font-weight: 800; }
.estado { margin: 0 0 10px; color: var(--suave); font-size: 14px; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.vivo-tag { display: inline-flex; align-items: center; gap: 6px; background: #ff3b30; color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .06em; padding: 4px 8px; border-radius: 6px; }
.vivo-tag .punto { background: #fff; box-shadow: none; width: 6px; height: 6px; }
.ahora { margin: 0 auto 12px; max-width: 320px; font-size: 14px; color: var(--texto-2); }
.ahora small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); }
.ahora span { color: var(--suave); }
.botones-radio { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; min-height: 46px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.btn.wa { background: #25D366; color: #06301a; }
.btn.sec { background: var(--chip); color: var(--texto); border: 1px solid var(--borde); }
.btn.nar { background: var(--naranja); color: #fff; }
.btn.ancho { display: flex; width: 100%; margin: 10px 0; }
.btn.grande { padding: 15px; font-size: 16px; }

/* Publicidad */
.pub { margin: 16px 0; text-align: center; }
.pub small { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--suave); margin-bottom: 4px; }
.pub img { display: block; width: auto; max-width: 100%; max-height: 60vh; height: auto; margin: 0 auto; border-radius: 10px; }

/* Listas de notas */
.tit { display: flex; justify-content: space-between; align-items: baseline; font-size: 19px; margin: 18px 0 6px; }
.tit a { font-size: 14px; color: var(--naranja); font-weight: 700; }
.fila { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--borde); width: 100%; text-align: left; }
.fila img, .fila-sin-foto { width: 100px; height: 75px; object-fit: cover; border-radius: 10px; flex: none; background: var(--chip); }
.fila h3 { margin: 2px 0 4px; font-size: 15px; line-height: 1.3; font-weight: 700; }
.fila small, .destacada small, .video-grande small { color: var(--suave); font-size: 12.5px; }
.cat { color: var(--naranja); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.chips { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; background: var(--barra); flex: none; scrollbar-width: none; border-bottom: 1px solid var(--borde); }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; border-radius: 99px; background: var(--chip); color: var(--texto-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--naranja); color: #fff; }
.destacada { display: block; background: var(--tarjeta); border-radius: 16px; overflow: hidden; margin-bottom: 4px; box-shadow: var(--sombra); }
.destacada img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.destacada div { padding: 12px 14px 14px; }
.destacada h2 { margin: 4px 0 6px; font-size: 21px; line-height: 1.25; }
.esqueleto { height: 220px; border-radius: 16px; background: linear-gradient(90deg, var(--chip), var(--tarjeta), var(--chip)); background-size: 200% 100%; animation: brillo 1.2s linear infinite; margin-bottom: 12px; }
.esqueleto.chico { height: 70px; }
.esqueleto.foto { height: 230px; border-radius: 0; }
@keyframes brillo { to { background-position: -200% 0; } }

/* Nota */
.nota-top { padding-bottom: 8px; }
.vista-nota { padding: 0 0 20px; }
.nota-foto { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.nota-cuerpo { padding: 14px 18px 0; }
.nota-cuerpo h1 { font-size: 24px; line-height: 1.25; margin: 6px 0 8px; }
.nota-meta { color: var(--suave); font-size: 13px; margin: 0 0 6px; }
.nota-texto { font-size: 17px; line-height: 1.65; color: var(--texto-2); overflow-wrap: break-word; }
.nota-texto p { margin: 0 0 1em; }
.nota-texto a { color: var(--naranja); text-decoration: underline; }
.nota-texto img, .nota-texto figure { max-width: 100%; height: auto; margin: 0 0 1em; border-radius: 10px; }
.nota-texto figure { margin-left: 0; margin-right: 0; }
.nota-texto figcaption { font-size: 13px; color: var(--suave); }
.nota-texto h2, .nota-texto h3 { line-height: 1.3; color: var(--texto); }
.nota-web { margin: 6px 0 16px; }
.nota-web a { display: inline-flex; gap: 6px; align-items: center; color: var(--suave); font-size: 14px; }
.compartir-barra { padding: 8px 10px 6px; background: var(--fondo); border-top: 1px solid var(--borde); flex: none; }
.compartir-barra .btn { width: 100%; }

/* Videos */
.vivo-card { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: #2a0d17; color: #fff; border: 1px solid #c4001d; border-radius: 14px; padding: 10px; margin-bottom: 12px; }
.vivo-card b { display: block; font-size: 15px; }
.vivo-card small { color: #ffb3bf; font-size: 12.5px; }
.vivo-mini { position: relative; width: 116px; flex: none; }
.vivo-mini img { width: 100%; border-radius: 8px; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.vivo-mini .vivo-tag { position: absolute; left: 6px; bottom: 6px; }
.video-grande { display: block; width: 100%; text-align: left; }
.video-grande .thumb { position: relative; display: block; }
.video-grande img { width: 100%; border-radius: 14px; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.video-grande h3 { margin: 8px 0 2px; font-size: 17px; }
.play-v { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%; background: rgba(249, 125, 0, .92); color: #fff; display: grid; place-items: center; }
.thumb.chico { position: relative; flex: none; display: block; }
.thumb.chico img { width: 124px; height: 70px; object-fit: cover; border-radius: 10px; display: block; }
.thumb.chico .play-v { width: 30px; height: 30px; }
.fila.video h3 { font-size: 14.5px; }
.video-capa { position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .92); display: flex; align-items: center; padding: 16px; }
.video-caja { width: 100%; }
.video-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: #fff; }
.video-barra .ic { background: #222; color: #fff; }
.video-marco { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-marco iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-caja .btn.sec { background: #222; color: #fff; border-color: #333; }

/* Más */
.redes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.redes a { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--chip); border-radius: 12px; padding: 13px; font-weight: 700; font-size: 14px; min-height: 48px; }
.caja { background: var(--tarjeta); border-radius: 14px; padding: 2px 14px; box-shadow: var(--sombra); }
.caja > a, .caja > p, .caja > button, .caja summary { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 13px 0; border-bottom: 1px solid var(--borde); font-size: 15px; text-align: left; min-height: 48px; }
.caja > :last-child { border-bottom: 0; }
.caja.ayuda { margin-top: 12px; }
.caja.ayuda summary { list-style: none; cursor: pointer; border: 0; }
.caja.ayuda summary::-webkit-details-marker { display: none; }
.caja.ayuda p { display: block; color: var(--texto-2); font-size: 14px; line-height: 1.5; padding: 0 0 12px; border: 0; min-height: 0; }
.switch { margin-left: auto; width: 44px; height: 26px; border-radius: 99px; background: var(--chip); position: relative; flex: none; border: 1px solid var(--borde); }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--naranja); border-color: var(--naranja); }
.switch.on::after { left: 21px; }
.version { text-align: center; color: var(--suave); font-size: 12px; margin-top: 18px; }

.aviso-flotante { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 130px); transform: translateX(-50%); z-index: 30; padding: 10px 16px; background: #1d2327; color: #fff; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); max-width: 90%; text-align: center; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
