/* RadioQ · Menciones en vivo (web de la secretaria). Colores de RadioQ: fondo oscuro, rojo del logo, azul y verde de la app. */
:root {
  --bg: #0b0d11; --panel: #161a21; --panel-2: #1d222b; --line: rgba(255, 255, 255, .09);
  --text: #eef0f4; --muted: #9aa3b2; --red: #ff3b4f; --orange: #ff8a3d; --blue: #3fb6ff; --green: #3ddc97; --gold: #ffc53d;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 15px/1.55 'Inter', system-ui, sans-serif; color: var(--text);
  background: radial-gradient(800px 500px at 0% 0%, rgba(255, 59, 79, .12), transparent 60%), radial-gradient(700px 500px at 100% 0%, rgba(63, 182, 255, .08), transparent 60%), var(--bg); }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { font-family: 'Sora', 'Inter', sans-serif; margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; display: inline; margin-right: 8px; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

.brand { display: flex; align-items: center; gap: 9px; font: 800 1.25rem 'Sora', sans-serif; }
.brand b { color: var(--red); }
.brand small { font: 600 11px 'Inter', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 20px; border: 0; border-radius: 10px; cursor: pointer;
  font: 600 15px 'Inter', sans-serif; color: #fff; background: linear-gradient(135deg, var(--red), var(--orange)); box-shadow: 0 8px 22px rgba(255, 59, 79, .3); }
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, .16); box-shadow: none; color: var(--text); }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); }
.btn.danger { background: transparent; border: 1px solid rgba(255, 59, 79, .45); color: #ff8a96; box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }

.card { background: rgba(22, 26, 33, .92); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; font-weight: 500; color: #c9cfd9; }
.form input, .form textarea, .form select, .station select { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .13);
  background: #0d1015; color: var(--text); font: 15px 'Inter', sans-serif; }
.form textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.form input:focus, .form textarea:focus, .station select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63, 182, 255, .18); }
.form .btn { width: 100%; margin-top: 6px; }
.form small { font-weight: 400; }
.link { display: block; text-align: center; margin-top: 14px; font-size: 14px; }
.alert { padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; font-size: 14px; }
.alert.ok { color: #9fe6c4; background: #16291f; border: 1px solid #2c6b52; }
.alert.bad { color: #ffb3bb; background: #2d1619; border: 1px solid #6b2c35; }

/* Ingreso */
.narrow .auth { width: min(420px, 100% - 32px); margin: 8vh auto 40px; }
.auth .brand { margin-bottom: 26px; }
.auth > .muted { margin-bottom: 20px; }

/* Panel */
.wide { padding: 0 20px; }
.top { display: flex; align-items: center; gap: 16px; padding: 16px 0; flex-wrap: wrap; max-width: 1280px; width: 100%; margin: 0 auto; }
.station b { font-size: 15px; }
.station select { width: auto; min-width: 200px; padding: 8px 12px; }
.who { font-size: 13px; }
.app-state, .wide > .alert { max-width: 1280px; width: 100%; margin: 0 auto 16px; }
.app-state { padding: 10px 14px; border-radius: 10px; font-size: 13px; border: 1px solid var(--line); background: var(--panel); }
.app-state.on { color: var(--green); }
.app-state.off { color: var(--gold); }
.layout { display: grid; grid-template-columns: 420px 1fr; gap: 20px; max-width: 1280px; width: 100%; margin: 0 auto 30px; align-items: start; }
.editor { position: sticky; top: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-size: 13px; font-weight: 500; color: #c9cfd9; margin-bottom: 8px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.chip input { display: none; }
.chip span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .15); font-weight: 700; cursor: pointer; color: var(--muted); }
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #06223a; }
.form .chip { margin: 0; }
.hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 8px; }
.hour { display: flex; gap: 4px; }
.hour input { padding: 9px 8px; }
.x { background: none; border: 1px solid rgba(255, 255, 255, .12); color: var(--muted); border-radius: 8px; cursor: pointer; padding: 0 9px; }
fieldset small { display: block; margin-top: 8px; font-size: 12px; }
.actions { display: flex; gap: 10px; }
.actions .btn { flex: 1; }

.tabs { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); font-size: 14px; }
.tabs a.on { color: #fff; background: linear-gradient(135deg, var(--red), var(--orange)); border-color: transparent; }
.empty { text-align: center; color: var(--muted); }
.men { margin-bottom: 14px; padding: 18px 20px; }
.men > header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 9px; border-radius: 999px; border: 1px solid; vertical-align: 2px; margin-right: 4px; }
.badge.activa { color: var(--green); border-color: #2c6b52; background: #16291f; }
.badge.pausada { color: var(--muted); border-color: var(--line); }
.badge.completada { color: var(--blue); border-color: #24507a; background: #142335; }
.badge.vencida { color: #ff8a96; border-color: #6b2c35; background: #2d1619; }
.badge.programada { color: var(--gold); border-color: #6b552c; background: #2d2516; }
.badge.app { color: #c4a8ff; border-color: #4f3b80; }
.count { text-align: right; white-space: nowrap; font-size: 15px; color: var(--muted); }
.count b { font: 800 1.6rem 'Sora', sans-serif; color: var(--text); }
.count small { display: block; font-size: 11px; }
.bar { height: 6px; border-radius: 3px; background: #0d1015; margin: 10px 0 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--blue)); }
.men .text { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: #0d1015; border-left: 3px solid var(--red); font-size: 15px; white-space: pre-line; }
.st-pausada .text, .st-completada .text, .st-vencida .text { border-left-color: var(--line); color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.meta b { color: var(--text); }
details { margin-top: 10px; font-size: 13px; }
summary { cursor: pointer; color: var(--blue); }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.men > footer { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.men > footer form { margin: 0; }
.foot { margin-top: auto; padding: 22px; text-align: center; font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .editor { position: static; }
  .who { display: none; }
}
@media (max-width: 520px) {
  .wide { padding: 0 12px; }
  .card { padding: 16px; border-radius: 14px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .station select { min-width: 0; width: 100%; }
  .top .station { order: 3; width: 100%; }
  h1 { font-size: 1.45rem; }
}

/* ---------- App instalada (PWA) ---------- */
/* Margen para la muesca y la barra de inicio del iPhone en pantalla completa. */
body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.wide { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; color: var(--muted); cursor: pointer; }
.form label.check input { width: 18px; height: 18px; accent-color: var(--red); flex-shrink: 0; }
.is-app .foot { display: none; }
.offline { text-align: center; }
.offline .brand { justify-content: center; }
.offline .big { font-size: 56px; margin: 30px 0 6px; }

.pwa-install { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 12px; width: min(560px, calc(100% - 24px)); padding: 12px 12px 12px 14px; border-radius: 14px;
  background: rgba(29, 34, 43, .97); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  backdrop-filter: blur(10px); font-size: 14px; animation: piUp .4s cubic-bezier(.2, .8, .2, 1); }
.pwa-install[hidden] { display: none; }
@keyframes piUp { from { transform: translate(-50%, 140%); } }
.pwa-install img { border-radius: 10px; flex-shrink: 0; }
.pi-text { flex: 1; line-height: 1.4; }
.pi-share { display: inline-block; width: 14px; height: 17px; vertical-align: -3px; background: no-repeat center/contain
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18' fill='none' stroke='%233fb6ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 11V1M3.5 4.5 7 1l3.5 3.5M4 7H1.5v10h11V7H10'/%3E%3C/svg%3E"); }
.pi-close { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px; }
.pwa-install .btn { width: auto; margin: 0; flex-shrink: 0; }
@media (max-width: 520px) {
  .wide { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
}

/* Horarios en 12 horas (hora · minutos · am/pm) y fecha final sugerida */
.hours { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hour { align-items: center; gap: 4px; }
.hour span { color: var(--muted); font-weight: 700; }
.form .hour select { width: auto; flex: 1; min-width: 0; padding: 9px 6px; text-align: center; }
.form .hour select[name="ap[]"] { flex: 0 0 64px; }
.hint { margin: -4px 0 16px; padding: 9px 12px; border-radius: 10px; font-size: 13px; color: var(--muted); background: #0d1015; border: 1px dashed rgba(255, 255, 255, .12); }
.hint:empty { display: none; }
.hint b { color: var(--green); font-weight: 600; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; text-decoration: underline; }
