/* repeater-logger: colores del logo de Radioaficionados Sierras Chicas
   (celeste y blanco, el rojo del aro, el verde de las sierras y el amarillo del sol). */

:root {
  --celeste: #2f86c8;
  --celeste-deep: #1d5f9c;
  --celeste-soft: #e3f0fa;
  --red: #e0362c;
  --green: #2f8f46;
  --green-soft: #e3f3e7;
  --sun: #f2a71b;
  --sun-soft: #fdf1d8;
  /* Barras de los gráficos (una sola serie). Validado: contraste >= 3:1 con la tarjeta y
     dentro de la banda de luminosidad, en claro y en oscuro (en oscuro, un paso más oscuro). */
  --bar: #2f86c8;
  --bar-hover: #1d5f9c;

  --bg: #edf2f7;
  --card: #ffffff;
  --card-2: #f6f9fc;
  --border: #d9e2ec;
  --text: #17212b;
  --muted: #5d6f82;
  --faint: #93a3b3;
  --chip: #eef3f8;
  --shadow: 0 1px 2px rgba(16, 33, 50, .06), 0 6px 18px rgba(16, 33, 50, .06);
  --radius: 16px;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --celeste: #5aaae6;
    --celeste-deep: #2a6aa6;
    --celeste-soft: #16324a;
    --green: #4cbf6a;
    --green-soft: #173523;
    --sun: #f7bd45;
    --sun-soft: #3a2e12;
    --bar: #4d9ad6;
    --bar-hover: #6cb0e6;
    --red: #ff5b4f;
    --bg: #0c131a;
    --card: #141e28;
    --card-2: #1a2632;
    --border: #253545;
    --text: #e4ecf4;
    --muted: #93a6b9;
    --faint: #62778b;
    --chip: #1e2c3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sprite { display: none; }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ------------------------------------------------------------------ encabezado */

.top {
  position: relative;
  color: #fff;
  background:
    radial-gradient(1200px 300px at 85% -60%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(500px 220px at 0% 120%, rgba(242, 167, 27, .25), transparent 70%),
    linear-gradient(135deg, #3a95d6 0%, var(--celeste-deep) 70%, #154a7c 100%);
}
.top-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; min-width: 0; }
.logo {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .35), 0 6px 16px rgba(0, 0, 0, .25);
  flex: none;
}
.brand-text { min-width: 0; }
.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.channels { margin: 4px 0 0; font-size: .86rem; opacity: .92; display: flex; flex-wrap: wrap; gap: 6px; }
.channels .ch {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  padding: 1px 9px;
  white-space: nowrap;
}
.channels .ch b { font-family: var(--mono); font-weight: 600; }

.live {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem;
  background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: #9fb3c4; }
.live.on .dot { background: #7be08f; }
.live.off .dot { background: #c9d3dc; }
.live.off { opacity: .85; }
/* Testigo "AL AIRE": la repetidora está activa y se está grabando. */
.onair-tag { display: none; font-weight: 800; letter-spacing: 1.2px; font-size: .76rem; }
.live.onair {
  background: #c62828;
  border-color: rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 0 rgba(255, 82, 82, .7);
  animation: onair 1.6s infinite;
  font-variant-numeric: tabular-nums;
}
.live.onair .onair-tag { display: inline; }
.live.onair .dot { background: #fff; box-shadow: 0 0 8px #fff; animation: blink 1s infinite; }
@keyframes onair {
  0% { box-shadow: 0 0 0 0 rgba(255, 82, 82, .65); }
  70% { box-shadow: 0 0 0 10px rgba(255, 82, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 91, 79, .6); }
  70% { box-shadow: 0 0 0 9px rgba(255, 91, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 91, 79, 0); }
}

/* La franja de la bandera, como en el logo. */
.flag-strip { height: 6px; background: linear-gradient(#74b4e3 0 33%, #fff 33% 66%, #74b4e3 66%); opacity: .9; }

/* ------------------------------------------------------------------ pestañas */

.tabs {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.tabs-inner { max-width: 820px; margin: 0 auto; padding: 8px 12px; display: flex; gap: 6px; }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.tab svg { width: 18px; height: 18px; }
.tab:hover { background: var(--chip); color: var(--text); }
.tab.active { background: var(--celeste); color: #fff; box-shadow: 0 2px 8px rgba(47, 134, 200, .35); }
.tab.ghost { margin-left: auto; padding: 8px 10px; }

main { max-width: 820px; margin: 0 auto; padding: 14px 12px 80px; }

/* ------------------------------------------------------------------ días */

.day { margin-bottom: 26px; }
.day-head {
  position: sticky; top: 53px; z-index: 10;
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px;
  padding: 10px 4px 8px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.day-head h2 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.day-head h2::first-letter { text-transform: uppercase; }
.day-stats { display: flex; gap: 6px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; }
.stat b { color: var(--text); }
.items { display: flex; flex-direction: column; gap: 12px; }

.empty {
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 34px 16px;
}
.empty img { width: 72px; height: 72px; opacity: .85; border-radius: 50%; }
.empty p { margin: 10px 0 0; }

/* ------------------------------------------------------------------ tarjetas */

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 12px 18px;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--green);
}
.card.call::before { background: var(--sun); }
.card.is-new { animation: arrive .7s ease-out, glow 3s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(-10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes glow { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--celeste) 45%, transparent), var(--shadow); } to { box-shadow: var(--shadow); } }

.card-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  font-size: .84rem; color: var(--muted);
}
.time { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; font-size: .95rem; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 1px 9px;
  font-size: .76rem; font-weight: 700; letter-spacing: .2px;
  background: var(--green-soft); color: var(--green);
}
.badge.call { background: var(--sun-soft); color: color-mix(in srgb, var(--sun) 80%, var(--text)); }
.badge.freq { background: var(--celeste-soft); color: var(--celeste); font-weight: 600; }
.badge.freq .mono { font-family: var(--mono); font-weight: 700; }
.badge.live { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.dur { margin-left: auto; font-variant-numeric: tabular-nums; }

.sentence { margin: 9px 0 10px; font-size: 1.06rem; line-height: 1.45; font-weight: 500; }
.sentence .edited { font-size: .75rem; color: var(--faint); font-weight: 400; margin-left: 6px; }

/* Indicativos */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--chip);
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 4px 10px 4px 9px;
  font-size: .86rem;
  line-height: 1.2;
  transition: border-color .15s, transform .1s;
}
button.chip:hover { border-color: var(--celeste); }
button.chip:active { transform: scale(.98); }
.chip .call { font-family: var(--mono); font-weight: 700; font-size: .95rem; letter-spacing: .4px; }
.chip .where { color: var(--muted); font-size: .76rem; }
.chip .role { font-size: .7rem; color: var(--celeste); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.chip .ok { color: var(--green); width: 15px; height: 15px; }
.chip.doubtful { border: 1.5px dashed var(--sun); background: var(--sun-soft); }
.chip.doubtful .call::after { content: "?"; color: var(--sun); margin-left: 1px; }
.chip.unlicensed .where::after { content: " · no figura en ENACOM"; color: var(--sun); }
.chip.more-chips { border: 1.5px dashed var(--border); background: transparent; color: var(--muted); font-size: .8rem; font-weight: 600; }
.hidden-chips { display: contents; }
.hidden-chips[hidden] { display: none; }

/* Temas */
.topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.topic {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  padding: 1px 9px;
}
.topic svg { width: 12px; height: 12px; }
button.topic:hover { border-color: var(--celeste); color: var(--text); }

/* ------------------------------------------------------------------ reproductor */

.player {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 12px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.play {
  grid-row: span 2;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #3d9be0, var(--celeste-deep));
  box-shadow: 0 3px 10px rgba(29, 95, 156, .35);
  transition: transform .1s, filter .15s;
}
.play:hover { filter: brightness(1.08); }
.play:active { transform: scale(.95); }
.play svg { width: 20px; height: 20px; }
.play:disabled { background: var(--faint); box-shadow: none; cursor: default; }
.track { display: flex; gap: 3px; height: 26px; align-items: stretch; cursor: pointer; touch-action: none; }
.seg {
  position: relative;
  flex: 1 1 0;
  min-width: 4px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--celeste) 18%, transparent);
  overflow: hidden;
}
.seg::after { /* "onda" decorativa */
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 3px, color-mix(in srgb, var(--celeste) 22%, transparent) 3px 4px);
  opacity: .7;
}
.seg .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--celeste); opacity: .85; }
.seg.missing { background: repeating-linear-gradient(45deg, var(--chip) 0 5px, transparent 5px 10px); cursor: not-allowed; }
.seg.current { outline: 2px solid color-mix(in srgb, var(--celeste) 55%, transparent); outline-offset: 1px; }
.ptime { grid-column: 2; display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.speed {
  grid-row: span 2;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .76rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.no-audio { margin-top: 10px; font-size: .8rem; color: var(--faint); }

.card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; }
.linkbtn svg { width: 15px; height: 15px; }
.linkbtn:hover span { text-decoration: underline; }
.linkbtn.fix { margin-left: auto; color: var(--muted); font-weight: 500; }
.linkbtn.fix:hover { color: var(--celeste); }
.said-list { margin-top: 10px; }
.beacon .mini.more { opacity: 0; transition: opacity .15s; }
.beacon:hover .mini.more, .beacon .mini.more:focus-visible { opacity: 1; }
@media (hover: none) { .beacon .mini.more { opacity: .7; } }
.pop h3.plain { font-family: var(--sans); font-size: 1rem; letter-spacing: 0; }
.pop .menu { display: flex; flex-direction: column; gap: 2px; margin: 6px -6px 0; }
.pop .menu button {
  display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; text-align: left;
  padding: 9px 8px; border-radius: 9px; font-size: .92rem;
}
.pop .menu button:hover { background: var(--chip); }
.pop .menu svg { width: 17px; height: 17px; color: var(--celeste); }
.pop textarea, .pop select { width: 100%; margin-top: 4px; }
.pop .feedback-slot > .btn { margin: 4px 4px 0 0; }

/* Lo que se dijo */
details.said { margin-top: 10px; }
details.said > summary {
  list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--celeste);
  padding: 2px 0;
}
details.said > summary::-webkit-details-marker { display: none; }
details.said > summary svg { width: 15px; height: 15px; }
details.said[open] > summary { margin-bottom: 6px; }
.said-list { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 12px; display: flex; flex-direction: column; gap: 10px; }
.said-item { font-size: .9rem; }
.said-meta { display: flex; align-items: center; gap: 8px; font-size: .74rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.said-meta .mini {
  border: 0; background: var(--chip); color: var(--celeste);
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
}
.said-meta .mini svg { width: 11px; height: 11px; }
.said-text { margin: 2px 0 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.said-text.empty-text { color: var(--faint); font-style: italic; }

/* ------------------------------------------------------------------ balizas */

.beacon {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--faint);
  font-size: .8rem;
  background: color-mix(in srgb, var(--card) 55%, transparent);
  border: 1px dashed var(--border);
  align-self: flex-start;
  max-width: 100%;
}
.beacon svg { width: 15px; height: 15px; }
.beacon .time { font-size: .8rem; color: var(--muted); font-weight: 600; }
.beacon .mini {
  border: 0; background: transparent; color: var(--faint);
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
}
.beacon .mini:hover { background: var(--chip); color: var(--celeste); }
.beacon .mini svg { width: 11px; height: 11px; }
.beacon.playing { color: var(--celeste); border-color: var(--celeste); }
.beacons { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
button.beacon-sum { cursor: pointer; }
button.beacon-sum:hover { color: var(--muted); border-style: solid; }
.beacon-sum .chev { width: 13px; height: 13px; transition: transform .2s; }
.beacons.open .beacon-sum .chev { transform: rotate(180deg); }
.beacon-list { display: flex; flex-direction: column; gap: 5px; padding-left: 14px; border-left: 2px dashed var(--border); margin-left: 14px; }

/* ------------------------------------------------------------------ varios */

.more { text-align: center; margin: 18px 0; }
.end { text-align: center; color: var(--faint); font-size: .85rem; }
.queue {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--muted);
  margin: 2px 4px 10px;
}
.queue svg { width: 16px; height: 16px; color: var(--sun); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  background: var(--celeste); color: #fff;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn svg { width: 16px; height: 16px; }
.btn.soft { background: var(--card); color: var(--celeste); border-color: var(--border); }
.btn.danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn.small { padding: 4px 10px; font-size: .82rem; border-radius: 8px; }
.btn.icon { padding: 6px; width: 34px; height: 34px; }
.linkbtn { border: 0; background: none; color: var(--celeste); padding: 0; font-size: .8rem; font-weight: 600; }

.toasts {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 100;
  width: min(92vw, 460px);
}
.toast {
  background: #18232e; color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  font-size: .9rem;
  animation: arrive .25s ease-out;
}
.toast.error { background: #8d1d17; }
.toast.ok { background: #1f6a35; }

/* Ventanita de un indicativo o un tema */
.pop {
  position: absolute; z-index: 60;
  width: min(330px, calc(100vw - 24px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
  padding: 14px;
  font-size: .9rem;
  animation: arrive .15s ease-out;
}
.pop h3 { margin: 0 0 2px; font-family: var(--mono); font-size: 1.15rem; letter-spacing: .5px; }
.pop .sub { color: var(--muted); font-size: .82rem; margin: 0 0 10px; }
.pop .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pop .note { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }
.pop label { display: block; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.pop input[type=text] { width: 100%; margin-top: 4px; }
.pop .kw { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 999px; padding: 1px 4px 1px 9px; font-size: .8rem; }
.pop .kw button { border: 0; background: none; color: var(--faint); width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; }
.pop .kw button:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.pop .kw svg { width: 10px; height: 10px; }
.pop .sugg { border: 1px dashed var(--border); background: transparent; border-radius: 999px; padding: 1px 9px; font-size: .8rem; color: var(--muted); }
.pop .sugg.on { border-style: solid; border-color: var(--celeste); color: var(--celeste); background: var(--celeste-soft); }

input[type=text], input[type=number], input[type=time], input[type=password], select, textarea {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--celeste);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--celeste) 22%, transparent);
}

/* ------------------------------------------------------------------ configuración */

.settings-intro { color: var(--muted); font-size: .88rem; margin: 4px 4px 14px; }
.group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px 16px;
  margin-bottom: 14px;
}
.group h3 {
  margin: 10px 0 4px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--celeste);
}
.field {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 210px);
  gap: 4px 16px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.group h3 + .field, .group h3 + .channels-edit { border-top: 0; }
.field .label { font-weight: 600; font-size: .92rem; }
.field .help { grid-column: 1; color: var(--muted); font-size: .8rem; }
.field .control { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.field .control input, .field .control select { width: 100%; }
.field .unit { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.field .changed { display: inline-flex; gap: 6px; align-items: center; font-size: .72rem; color: var(--sun); margin-left: 8px; font-weight: 600; }
.field.dirty .label::after { content: " •"; color: var(--celeste); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--border); transition: background .2s;
}
.switch span::after {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s;
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--celeste) 30%, transparent); }

.channels-edit { padding: 6px 0 12px; }
.ch-row {
  display: grid;
  grid-template-columns: 26px 128px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
}
.ch-row .prio { font-weight: 800; color: var(--celeste); text-align: center; font-variant-numeric: tabular-nums; }
.ch-row input.freq { font-family: var(--mono); }
.ch-row .ops { display: flex; gap: 2px; }
.ch-row .ops button { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.ch-row .ops button:hover:not(:disabled) { background: var(--chip); color: var(--text); }
.ch-row .ops button.del:hover { color: var(--red); }
.ch-row .ops button:disabled { opacity: .3; cursor: default; }
.ch-row .ops svg { width: 16px; height: 16px; }
.ch-head { font-size: .74rem; color: var(--faint); text-transform: uppercase; letter-spacing: .6px; padding-bottom: 0; }
.ch-row input.bad { border-color: var(--red); }
#ch-list.reset { opacity: .45; }
.field-spacer { height: 10px; }
code { font-family: var(--mono); font-size: .85em; background: var(--chip); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.ch-hint { font-size: .8rem; color: var(--muted); margin: 4px 0 8px; }

.logo-edit { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.logo-edit img { width: 56px; height: 56px; border-radius: 50%; background: #fff; object-fit: contain; border: 1px solid var(--border); }

.procs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 12px; }
.proc { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; background: var(--chip); border-radius: 999px; padding: 3px 11px; }
.proc .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.proc.up .pdot { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.proc.down .pdot { background: var(--red); }

.savebar {
  position: sticky; bottom: 12px; z-index: 30;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  border-radius: 14px;
  padding: 10px 12px 10px 16px;
  margin-top: 16px;
}
.savebar .msg { font-size: .86rem; color: var(--muted); }
.errors { color: var(--red); font-size: .85rem; margin: 6px 4px; }
.errors li { margin: 2px 0; }

/* ------------------------------------------------------------------ entrada */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login {
  width: min(380px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: center;
}
.login-top {
  padding: 28px 20px 18px;
  color: #fff;
  background:
    radial-gradient(500px 160px at 80% -40%, rgba(255, 255, 255, .25), transparent 60%),
    linear-gradient(135deg, #3a95d6, var(--celeste-deep));
}
.login-top img { width: 104px; height: 104px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .35), 0 10px 24px rgba(0, 0, 0, .25); object-fit: contain; }
.login-top h1 { font-size: 1.25rem; margin: 14px 0 0; }
.login form { padding: 20px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.login input { width: 100%; margin-top: 4px; font-size: 1rem; padding: 10px 12px; }
.login .btn { padding: 11px; font-size: 1rem; }
.login .err { color: var(--red); font-size: .88rem; min-height: 1.3em; margin: 0; }

/* ------------------------------------------------------------------ número de cada audio */

.txid {
  border: 0;
  background: var(--chip);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.6;
  padding: 0 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.txid:hover, .txid:focus-visible { color: var(--celeste); background: var(--celeste-soft); }
.beacon .txid { background: transparent; color: var(--faint); padding: 0 4px; }
.said-item.is-target { background: var(--celeste-soft); border-radius: 8px; box-shadow: -14px 0 0 var(--celeste-soft), 6px 0 0 var(--celeste-soft); }
.beacon.is-target { border-style: solid; border-color: var(--celeste); color: var(--celeste); }

/* ------------------------------------------------------------------ corregir el texto */

.said-edit-btn {
  margin-left: auto;
  border: 0; background: transparent; color: var(--faint);
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-grid; place-items: center;
}
.said-edit-btn:hover, .said-edit-btn:focus-visible { background: var(--chip); color: var(--celeste); }
.said-edit-btn svg { width: 13px; height: 13px; }
.fixed-mark { color: var(--green); font-weight: 600; }
.said-edit textarea, .rv-card textarea {
  width: 100%; margin-top: 4px; resize: vertical;
  font-size: .95rem; line-height: 1.45;
}
.said-edit .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.said-edit .note { font-size: .76rem; color: var(--muted); margin: 6px 0 0; }

/* ------------------------------------------------------------------ revisar */

.tab-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: .68rem; line-height: 18px; text-align: center; font-weight: 700;
}
.rv-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin: 4px 2px 12px; }
.rv-count { font-size: .9rem; color: var(--muted); }
.rv-count b { color: var(--text); }
.rv-top .seg-small { margin: 0; }
.rv-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.rv-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: .86rem; color: var(--muted); }
.rv-open { margin-left: auto; color: var(--celeste); font-weight: 600; text-decoration: none; font-size: .8rem; }
.rv-open:hover { text-decoration: underline; }
.rv-audio { width: 100%; height: 44px; }
.rv-label { font-weight: 600; font-size: .9rem; }
.rv-label span { font-weight: 400; color: var(--muted); font-size: .8rem; }
.rv-card textarea { margin-top: -4px; font-size: 1rem; }
.rv-asr { margin: -4px 0 0; font-size: .78rem; color: var(--faint); }
.rv-codes { margin: -4px 0 0; font-size: .8rem; color: var(--muted); }
.rv-codes b { font-family: var(--mono); color: var(--celeste); }
/* Código Q y abreviaturas: subrayado punteado, el significado al pasar el mouse. */
abbr.jargon { text-decoration: underline dotted var(--celeste); text-underline-offset: 3px; cursor: help; font-weight: 600; }
/* Turnos: cada uno en su renglón; la flechita marca dónde se pasó el turno ("cambio"). */
.said-text .turn { display: block; }
.said-text .turn + .turn { margin-top: 4px; }
.said-text .pass { margin-left: 6px; color: var(--celeste); font-weight: 700; }
.rv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rv-chips-label { font-size: .8rem; color: var(--muted); margin-right: 2px; }
.rv-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--chip); border: 1.5px solid transparent; border-radius: 10px;
  padding: 3px 4px 3px 9px; font-size: .84rem;
}
.rv-chip .call { font-family: var(--mono); font-weight: 700; }
.rv-chip .sub { color: var(--muted); font-size: .74rem; }
.rv-chip.doubtful { border: 1.5px dashed var(--sun); background: var(--sun-soft); }
.rv-x { border: 0; background: none; color: var(--faint); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.rv-x:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.rv-x svg { width: 10px; height: 10px; }
.rv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.rv-actions .btn { padding: 10px 16px; }
.rv-actions .btn.changed { background: var(--green); }
.rv-actions .rv-skip { margin-left: auto; }
.rv-skip-icon { transform: rotate(-90deg); }
.rv-hint { font-size: .74rem; color: var(--faint); margin: 0; }
.rv-next-title { font-size: .78rem; font-weight: 600; color: var(--muted); margin: 16px 4px 6px; }
.rv-next-item { display: flex; gap: 8px; align-items: baseline; font-size: .82rem; color: var(--muted); padding: 4px; min-width: 0; }
.rv-next-item .when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv-next-item .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rv-auto { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); margin: 14px 4px 0; }

/* Lo que aprendió (Configuración) */
.learned { padding-bottom: 12px; }
.learn-sec { padding: 10px 0; border-top: 1px solid var(--border); }
.learned h3 + .learn-sec, .learned h3 + p + .learn-sec { border-top: 0; }
.learn-sec .label { font-weight: 600; font-size: .92rem; }
.learn-sec .help, .learned > .help { color: var(--muted); font-size: .8rem; }
.learn-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.learn-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--chip); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: .82rem;
  max-width: 100%;
}
.learn-chip > span:first-child { overflow-wrap: anywhere; }
.learn-chip .ln { font-size: .7rem; color: var(--muted); }
.learn-chip.out { opacity: .55; }
.learn-chip button { border: 0; background: none; color: var(--faint); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.learn-chip button:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.learn-chip svg { width: 10px; height: 10px; }
.learn-add { display: flex; gap: 6px; margin-top: 8px; }
.learn-add input { flex: 1; min-width: 0; max-width: 280px; }

/* ------------------------------------------------------------------ estadísticas */

.st-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; width: fit-content; max-width: 100%; }
.seg-btn {
  border: 0; background: transparent; color: var(--muted);
  font-weight: 600; font-size: .88rem;
  padding: 6px 14px; border-radius: 9px;
}
.seg-btn:hover { background: var(--chip); color: var(--text); }
.seg-btn[aria-pressed="true"] { background: var(--celeste); color: #fff; }
.st-range { color: var(--muted); font-size: .86rem; margin: 10px 4px 12px; }
.st-range::first-letter { text-transform: uppercase; }
.st-body { display: flex; flex-direction: column; gap: 14px; transition: opacity .2s; }
.st-body.loading { opacity: .55; }

.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 10px 14px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.tile .tl { font-size: .78rem; color: var(--muted); }
.tile .tv { font-size: 1.55rem; font-weight: 650; line-height: 1.15; white-space: nowrap; }

.st-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; min-width: 0;
}
.st-head { margin-bottom: 10px; }
.st-head h3 { margin: 0; font-size: 1rem; }
.st-head p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.st-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.st-note, .st-foot { font-size: .78rem; color: var(--faint); margin: 10px 2px 0; }
.st-empty { color: var(--muted); font-size: .88rem; margin: 0; }
.st-card a { color: var(--celeste); text-decoration: none; font-weight: 600; }
.st-card a:hover { text-decoration: underline; }

/* Lo destacado */
.hls { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 18px; }
.hl { display: flex; gap: 10px; align-items: flex-start; }
.hl-icon {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--celeste-soft); color: var(--celeste);
}
.hl-icon svg { width: 18px; height: 18px; }
.hl p { margin: 0; }
.hl-title { font-size: .76rem; color: var(--muted); }
.hl-value { font-size: 1.02rem; font-weight: 650; }
.hl-detail { font-size: .78rem; color: var(--muted); }

/* Ranking */
.seg-small { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--chip); margin-bottom: 10px; }
.seg-small button { border: 0; background: transparent; color: var(--muted); font-size: .8rem; font-weight: 600; padding: 4px 11px; border-radius: 8px; }
.seg-small button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.table-wrap { overflow-x: auto; }
table.rank { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rank th { font-size: .72rem; font-weight: 600; color: var(--muted); text-align: left; padding: 0 8px 6px; white-space: nowrap; }
.rank td { padding: 8px; border-top: 1px solid var(--border); vertical-align: top; }
.rank .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank td.num.on { font-weight: 700; }
.rank .rk { width: 1%; color: var(--faint); font-variant-numeric: tabular-nums; padding-left: 2px; }
.rank .who { min-width: 130px; }
.rank .call, .newlist .call { font-family: var(--mono); font-weight: 700; letter-spacing: .3px; }
.rank .sub, .newlist .sub { display: block; font-size: .74rem; color: var(--muted); }
.new-badge { margin-left: 6px; font-size: .68rem; font-weight: 700; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 0 7px; vertical-align: 1px; }
.rbar { display: block; height: 6px; margin-top: 6px; }
.rbar i { display: block; height: 100%; width: 0; background: var(--bar); border-radius: 0 4px 4px 0; }

/* Estaciones nuevas */
.newlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.newlist li { background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.newlist .when { display: block; font-size: .74rem; color: var(--muted); margin-top: 2px; }

/* Barras horizontales (temas, provincias, duplas) */
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hrow { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .85rem; }
.hlabel { overflow-wrap: anywhere; }
.hlabel.mono { font-family: var(--mono); font-weight: 600; font-size: .82rem; }
.htrack { height: 8px; }
.htrack i { display: block; height: 100%; width: 0; background: var(--bar); border-radius: 0 4px 4px 0; }
.hval { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Columnas */
.chart { position: relative; }
.plot { position: relative; height: 150px; margin-left: 44px; }
.grid { position: absolute; inset: 0; pointer-events: none; }
.gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--border); }
.gl span { position: absolute; right: calc(100% + 6px); top: -8px; font-size: .68rem; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cols { position: absolute; inset: 0; display: flex; align-items: stretch; }
.col { flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; outline: none; min-width: 0; cursor: default; }
.col .bar { display: block; width: min(24px, calc(100% - 2px)); height: 0; background: var(--bar); border-radius: 4px 4px 0 0; transition: background .12s; }
.col:hover .bar, .col:focus-visible .bar { background: var(--bar-hover); }
.col:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--celeste) 45%, transparent); border-radius: 6px; }
.xaxis { display: flex; margin-left: 44px; margin-top: 4px; }
.xaxis span { flex: 1 1 0; min-width: 0; text-align: center; font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
details.nums { margin-top: 10px; }
details.nums > summary { cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--celeste); }
details.nums table { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: 6px; }
details.nums th { text-align: left; font-weight: 600; color: var(--muted); padding: 3px 6px; }
details.nums td { padding: 3px 6px; border-top: 1px solid var(--border); }
details.nums .num { text-align: right; font-variant-numeric: tabular-nums; }

.tip {
  position: absolute; z-index: 70; pointer-events: none;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  padding: 6px 10px; font-size: .8rem; max-width: 240px;
}
.tip b { font-size: .92rem; }
.tip span { color: var(--muted); }
.tip small { display: block; color: var(--muted); font-size: .74rem; }

/* ------------------------------------------------------------------ celular */

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .top-inner { padding: 14px 12px 12px; }
  .logo { width: 50px; height: 50px; }
  .brand h1 { font-size: 1.1rem; }
  .live #live-text { display: none; }
  .live { padding: 8px; }
  .tab span { display: none; }
  .tab { padding: 8px 12px; }
  .tab.active span { display: inline; }
  .card { padding: 12px 12px 10px 15px; }
  .field { grid-template-columns: 1fr; }
  .field .control { grid-row: auto; grid-column: 1; justify-content: flex-start; }
  .ch-row { grid-template-columns: 22px 1fr auto; }
  .ch-row .ops { grid-column: 3; grid-row: 1; }
  .ch-row input.name { grid-column: 2 / span 2; grid-row: 2; }
  .ch-head span:nth-child(3), .ch-head span:nth-child(4) { display: none; }
  .day-head { top: 51px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .tile { padding: 8px 10px; }
  .tile .tv { font-size: 1.25rem; }
  .st-card { padding: 12px; }
  .seg-btn { padding: 6px 10px; }
  .rank .opt { display: none; }
  .rank td, .rank th { padding-left: 5px; padding-right: 5px; }
  .rank .who { min-width: 96px; }
  .plot, .xaxis { margin-left: 38px; }
  .hrow { grid-template-columns: minmax(80px, 34%) 1fr auto; }
}

@media (max-width: 420px) {
  .rank .rk { display: none; }
  .rank .who { min-width: 84px; }
  .rank { font-size: .82rem; }
  .tile .tv { font-size: 1.1rem; }
}

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