/* Layout: command strip with live status, summary band, three small tallies, filter bar, then the live feed as a ruled table. */
/* Sistema "Monitoreo Electoral Chiapas": cielo nocturno, rosa neón, Consolas, todo recto. Un solo tema, oscuro. */

/* Desarrollado por un equipo multidisciplinario basado en chiapas, creditos a yach, snakebytes y sadgrlonline*/
:root {
  --sky: #08031a; --night: #13092d; --side: #241445; --content: #43256e;
  --text: #fceaff; --text-soft: #d3bfe6; --pink: #ed64f5; --pink-soft: rgba(237,100,245,.18);
  --nuevo: #7cf5b0; --seg: #ffd86b; --otra: #8fd8ff; --alto: #ff5c8a;
  --hover: #a49cba; --fila-hover: rgba(237,100,245,.07); --barra-fondo: rgba(252,234,255,.1);
  --halo: rgba(190,150,255,.35);
  /* alias usados por la página */
  --bg: var(--sky); --surface: var(--night); --surface-2: var(--side);
  --ink: var(--text); --ink-2: var(--text-soft); --muted: var(--text-soft);
  --line: var(--pink-soft); --accent: var(--pink); --accent-ink: var(--sky); --accent-soft: rgba(237,100,245,.14);
  --live: var(--nuevo); --warn: var(--seg); --bad: var(--alto);
  --c-fb: var(--pink); --c-x: var(--text); --c-ig: var(--alto); --c-tt: var(--otra); --c-yt: var(--seg); --c-rd: var(--nuevo); --c-other: var(--hover);
  --font-mono: Consolas, ui-monospace, "Cascadia Mono", Menlo, "Courier New", monospace;
  --font-display: var(--font-mono); --font-body: var(--font-mono);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 40px;
}
.wrap { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- Command strip ---- */
.strip { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.strip__title { min-width: 0; }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 38px); line-height: 1.05; margin: 0; text-wrap: balance; }
.lede { color: var(--ink-2); margin: 8px 0 0; max-width: 62ch; }
.live-box { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 0; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 0; font-weight: 600; font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 0; background: var(--muted); flex: none; }
.live-pill[data-phase="searching"] .dot { background: var(--live); animation: pulse 1.4s ease-in-out infinite; }
.live-pill[data-phase="done"] .dot { background: var(--accent); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.status-line { font-size: 13px; color: var(--ink-2); text-align: right; max-width: 46ch; }
.countdown { font-size: 12px; color: var(--muted); text-align: right; }

/* ---- Summary band ---- */
.band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.band__item { padding: 14px 16px; border-left: 1px solid var(--line); min-width: 0; }
.band__item:first-child { border-left: 0; padding-left: 0; }
.band__label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.band__value { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3vw, 34px); line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.band__sub { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bump { animation: bump 0.7s ease-out; }
@keyframes bump { 0% { color: var(--accent); transform: translateY(-2px); } 100% { color: inherit; transform: none; } }

/* ---- Tallies ---- */
.tallies { display: grid; grid-template-columns: 1.1fr 1.3fr 1fr; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 0; padding: 16px; min-width: 0; }
.panel h2 { font-family: var(--font-display); font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 12px; font-weight: 600; color: var(--ink-2); }
.bars { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bar { display: grid; grid-template-columns: 84px minmax(0, 1fr) 32px; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 3px 4px; border-radius: 0; cursor: pointer; text-align: left; }
.bar:hover { background: var(--surface-2); }
.bar[aria-pressed="true"] { background: var(--accent-soft); }
.bar__name { display: flex; align-items: center; gap: 7px; font-size: 14px; min-width: 0; }
.bar__name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__track { height: 8px; background: var(--surface-2); border-radius: 0; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--accent); border-radius: 0; transition: width 0.4s ease; }
.bar__n { font-family: var(--font-mono); font-size: 13px; text-align: right; }
.swatch { width: 9px; height: 9px; border-radius: 0; flex: none; background: var(--c-other); }
.days { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; }
.day { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; min-width: 0; }
.day__n { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.day__bar { width: 100%; background: var(--accent); border-radius: 0; min-height: 2px; transition: height 0.4s ease; }
.day__bar[data-zero="1"] { background: var(--line); }
.day__lbl { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.15; }
.src { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.src li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 13.5px; }
.src__state { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; color: var(--muted); }
.src__state[data-s="done"] { color: var(--live); }
.src__state[data-s="running"] { color: var(--accent); }
.src__state[data-s="blocked"] { color: var(--bad); }
.src__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src__n { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }

/* ---- Filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field select { height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 0; padding: 0 10px; min-width: 0; }
.field--grow { flex: 1 1 220px; }
.field--sm input { width: 92px; }
.btn { height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 0; padding: 0 14px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--accent); }
.count-line { font-size: 13px; color: var(--muted); margin-left: auto; align-self: center; }

/* ---- Feed ---- */
.feed { background: var(--surface); border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.feed__head, .post { display: grid; grid-template-columns: 112px minmax(150px, 1.1fr) minmax(220px, 3fr) 96px 78px 84px 66px 70px 54px; gap: 12px; align-items: start; padding: 10px 16px; }
.feed__head { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); align-items: center; }
.feed__head .r, .post .r { text-align: right; }
.post { border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post.is-new { animation: arrive 6s ease-out; }
@keyframes arrive { 0% { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } 70% { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } 100% { background: transparent; box-shadow: inset 3px 0 0 transparent; } }
.c-when { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.c-src { min-width: 0; }
.c-src__name { display: flex; align-items: center; gap: 7px; font-weight: 600; min-width: 0; }
.c-src__name span:last-child { overflow-wrap: anywhere; }
.c-src__plat { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.risk { display: inline-block; margin: 6px 0 0 6px; font-size: 12px; padding: 1px 8px; border: 1px solid currentColor; font-family: var(--font-mono); }
.risk[data-lvl="alto"] { color: var(--alto); } .risk[data-lvl="medio"] { color: var(--seg); } .risk[data-lvl="bajo"] { color: var(--nuevo); }
.topic { display: inline-block; margin-top: 6px; font-size: 12px; padding: 1px 8px; border-radius: 0; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.c-text { min-width: 0; }
.textbtn { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.textbtn[aria-expanded="true"] { display: block; -webkit-line-clamp: unset; }
.c-type { font-size: 13px; color: var(--ink-2); }
.stat { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.stat small { display: none; }
.stat--hot { font-weight: 500; color: var(--accent); }
.c-link a { color: var(--accent); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; font-family: var(--font-display); font-size: 18px; color: var(--ink); margin-bottom: 4px; }
.foot { font-size: 12.5px; color: var(--muted); }
/* Rasgos del sistema */
body { background-image: radial-gradient(1px 1px at 20px 30px, rgba(252,234,255,.55), transparent), radial-gradient(1px 1px at 90px 120px, rgba(237,100,245,.5), transparent), radial-gradient(1px 1px at 160px 70px, rgba(143,216,255,.45), transparent); background-size: 200px 160px; }
h1 { color: var(--pink); text-shadow: 0 0 12px rgba(237,100,245,.6); }
.panel, .feed, .live-pill, .band, .rep details { border-color: var(--pink); }
.panel h2, .rep__h, .rep summary { color: var(--pink); }
.panel, .feed { box-shadow: 0 0 30px rgba(190,150,255,.18); }
.dot { box-shadow: 0 0 6px var(--live); }
a { color: var(--pink); }
.c-link a { border-bottom: 1px dotted currentColor; }
:focus-visible { outline: 2px dashed var(--nuevo); outline-offset: 3px; }
.rep .lvl-alto { color: var(--alto); } .rep .lvl-medio { color: var(--seg); } .rep .lvl-bajo { color: var(--nuevo); }

/* Daily report tables (informe/*) */
.rep { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rep details { min-width: 0; } /* wide tables scroll inside .rep__wrap instead of stretching the page */
.rep__h { font-family: var(--font-display); font-size: 18px; margin: 0; color: var(--ink); }
.rep details { background: var(--surface); border: 1px solid var(--line); }
.rep summary { cursor: pointer; padding: 12px 16px; font-family: var(--font-display); font-weight: 700; color: var(--ink); display: flex; gap: 10px; align-items: baseline; }
.rep summary small { font-family: var(--font-mono); font-weight: 400; color: var(--muted); }
.rep__wrap { overflow-x: auto; border-top: 1px solid var(--line); max-height: 560px; overflow-y: auto; }
.rep table { border-collapse: collapse; width: 100%; font-size: 13px; }
.rep th, .rep td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); min-width: 90px; }
.rep td.w { min-width: 260px; }
.rep th { position: sticky; top: 0; background: var(--surface-2); font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.rep .lvl-alto { color: var(--bad); font-weight: 600; }
.rep .lvl-medio { color: var(--warn); font-weight: 600; }
.rep .lvl-bajo { color: var(--live); font-weight: 600; }

/* Connection map (informe/conexiones drawn as a node-link diagram) */
.map__lede { margin: -4px 0 10px; font-size: 13px; color: var(--ink-2); max-width: 80ch; }
.map__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: 12.5px; color: var(--ink-2); }
.map__key { display: inline-flex; align-items: center; gap: 6px; }
.map__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.map__line { width: 22px; height: 0; border-top: 2px solid; flex: none; }
.map__line[data-c="neu"] { border-top-style: dashed; }
.map__line[data-c="nd"] { border-top-style: dotted; }
.map__wrap { position: relative; overflow: hidden; height: clamp(420px, 64vh, 660px); border: 1px solid var(--line); background: var(--sky); }
.map__wrap svg { display: block; width: 100%; height: 100%; font-family: var(--font-mono); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.map__wrap.is-dragging svg, .map__wrap.is-dragging .map__node circle { cursor: grabbing; }
.map__ctl { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; }
.map__ctl button { width: 44px; height: 44px; font: inherit; font-size: 22px; line-height: 1; color: var(--ink); background: var(--night); border: 1px solid var(--pink); border-radius: 0; cursor: pointer; }
.map__ctl button:hover { background: var(--side); }
.map__edge { fill: none; opacity: .6; }
.map__node circle { stroke: var(--sky); stroke-width: 2px; cursor: pointer; }
.map__node:focus-visible { outline: none; }
.map__node circle.asp { stroke: var(--pink); stroke-width: 3.5px; }
.map__dot.asp { background: transparent !important; border: 3px solid var(--pink); }
.map__node:focus-visible circle { stroke: var(--nuevo); stroke-width: 3px; }
.map__label { font-size: 16px; fill: var(--ink-2); paint-order: stroke; stroke: var(--sky); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.map__node[data-deg="1"] .map__label { display: none; }
.map__node.is-on .map__label { display: block; fill: var(--ink); }
.has-on .map__edge:not(.is-on) { opacity: .12; }
.has-on .map__edge.is-on { opacity: 1; }
.has-on .map__node:not(.is-on) { opacity: .3; }
.map__detail { margin-top: 10px; font-size: 13px; color: var(--ink-2); min-height: 1.5em; }
.map__name { font-weight: 700; color: var(--ink); font-size: 14px; }
.map__meta { margin-bottom: 6px; }
.map__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.map__list li { padding-left: 10px; border-left: 3px solid var(--hover); overflow-wrap: anywhere; }
.map__list li[data-c="neg"] { border-left-color: #d9742b; }
.map__list li[data-c="pos"] { border-left-color: #2f9fd4; }
.map__choice {
  position: fixed;
  z-index: 30;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(27rem, calc(100vw - 2rem));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .75rem;
  border: 1px solid var(--pink);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .5);
}
.map__directory { border: 1px solid var(--line); background: var(--surface); padding: .75rem; margin-bottom: .75rem; }
.map__directory h3 { display: table; position: relative; margin: 0 auto .75rem; font-size: .95rem; text-align: center; }
.map__directory h3::after { position: absolute; top: 100%; left: 50%; height: .75rem; border-left: 1px solid var(--pink); content: ""; }
.map__branches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.map__branches > li { position: relative; padding: .7rem .35rem 0; min-width: 0; }
.map__branches > li::before { position: absolute; top: 0; left: 0; right: 0; border-top: 1px solid var(--pink); content: ""; }
.map__branches > li:first-child::before { left: 50%; }
.map__branches > li:last-child::before { right: 50%; }
.map__branches > li::after { position: absolute; top: 0; left: 50%; height: .7rem; border-left: 1px solid var(--pink); content: ""; }
.map__branches h4 { margin: 0; padding: .35rem; border: 1px solid var(--line); color: var(--ink); text-align: center; overflow-wrap: anywhere; }
.map__branches ul { margin: 0 0 0 .45rem; padding: 0; list-style: none; }
.map__branches ul li { position: relative; padding: .4rem 0 0 .65rem; }
.map__branches ul li::before { position: absolute; top: 0; left: 0; bottom: 0; border-left: 1px solid var(--pink); content: ""; }
.map__branches ul li:last-child::before { bottom: auto; height: 1.15rem; }
.map__branches ul li::after { position: absolute; top: 1.15rem; left: 0; width: .65rem; border-top: 1px solid var(--pink); content: ""; }
.map__directory .btn { display: block; width: 100%; height: auto; min-height: 44px; padding: .35rem .5rem; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.map__directory .btn span { display: block; color: var(--muted); font-size: .85em; }
@media (max-width: 760px) {
  .map__directory h3 { margin-left: 0; text-align: left; }
  .map__directory h3::after { left: .45rem; }
  .map__branches { grid-template-columns: minmax(0, 1fr); margin-left: .45rem; }
  .map__branches > li { padding: .4rem 0 .4rem .75rem; }
  .map__branches > li::before, .map__branches > li:first-child::before, .map__branches > li:last-child::before { top: 1.15rem; left: 0; right: auto; width: .75rem; }
  .map__branches > li::after { left: 0; height: 100%; }
  .map__branches > li:last-child::after { height: 1.15rem; }
  .map__branches h4 { text-align: left; }
}
.map__choice strong { width: 100%; color: var(--ink); overflow-wrap: anywhere; }
.map__choice button { min-height: 44px; }
.map__hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.actor-card {
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  font-family: Consolas, "Liberation Mono", monospace;
  line-height: 1.4;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--pink);
}
.actor-card[open] { display: flex; flex-direction: column; }
.actor-card::backdrop { background: rgba(8, 3, 26, .8); }
.actor-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--line);
}
.actor-card__head h2 { margin: 0; color: var(--pink); font-size: 1.25rem; overflow-wrap: anywhere; }
.actor-card__head form { flex: none; }
.actor-card__head .btn { min-height: 44px; }
.actor-card__body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: .5rem .75rem; overflow-wrap: anywhere; }
.actor-card__body:focus-visible { outline-offset: -4px; }
.actor-card__section { border-top: 1px solid var(--line); margin-top: .35rem; }
.actor-card__section summary { cursor: pointer; padding: .32rem 0; }
.actor-card__section h3 { display: inline; margin: 0; font-size: 1rem; }
.actor-card__section p { margin: .15rem 0; }
.actor-card__meta, .actor-card__empty, .actor-card__sources { margin: 0; color: var(--ink-2); }
.actor-card__list { margin: 0; padding: 0; list-style: none; }
.actor-card__list li + li { margin-top: .4rem; }
.actor-card__date { display: block; font-size: .875rem; color: var(--ink-2); }
.actor-card__marker--allegation { color: #ff687c; }
.actor-card__marker--criticism { color: #ffd65c; }

[hidden] { display: none !important; }

/* What changed / actors / sources */
.cambio, .actores, .fuentes { display: grid; gap: 12px; min-width: 0; }
.cambio__tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cambio__tile { border: 1px solid var(--line); background: var(--sky); padding: 12px; min-width: 0; }
.cambio__tile .l { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cambio__tile .v { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cambio__tile .s { font-size: 12.5px; color: var(--ink-2); }
.cambio__tile .s.up { color: var(--alto); } .cambio__tile .s.down { color: var(--nuevo); }
.cambio__cols, .fuentes__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fuentes__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cambio__col h3, .fuentes h3, .actores h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--pink); font-weight: 600; }
.fuentes h3 small { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.cambio__col ul, .rep__list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.cambio__col li, .rep__list li { overflow-wrap: anywhere; }
.cambio__col a, .rep__list a { color: var(--text); text-decoration-color: var(--pink); }
.cbars { display: grid; gap: 6px; }
.cbar { display: grid; grid-template-columns: minmax(96px, 1.3fr) minmax(0, 2fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.cbar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbar__track { height: 8px; background: var(--surface-2); }
.cbar__fill { display: block; height: 100%; background: var(--accent); }
.cbar__n { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.rep__cards { display: grid; gap: 10px; }
.rcard { border: 1px solid var(--line); background: var(--sky); padding: 12px 14px; min-width: 0; }
.rcard__head { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.rcard__text { margin: 4px 0 6px; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; font-style: italic; }
.rcard ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 2px; }
.rcard a { color: var(--text); text-decoration-color: var(--pink); }
@media (max-width: 640px) {
  .cambio__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cambio__cols, .fuentes__cols { grid-template-columns: 1fr; }
  .cambio__tile .v { font-size: 22px; }
}

/* Daily reading (conclusiones in data.json) */
.lectura { display: grid; gap: 12px; }
.lectura__base { font-size: 12.5px; color: var(--muted); max-width: 60ch; }
.lectura__texto { display: grid; gap: 10px; max-width: 86ch; }
.lectura__texto p { margin: 0; color: var(--ink); line-height: 1.6; }
.lectura a.nm { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.lectura a.nm:hover { color: var(--pink); }
.lectura__vigilar { border-left: 3px solid var(--pink); padding: 2px 0 2px 12px; }
.lectura__vigilar h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--pink); }
.lectura__vigilar ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 4px; }
.lectura__descargas { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); padding-top: 4px; border-top: 1px solid var(--line); }
.prio { display: inline-block; margin: 6px 0 0 6px; font-size: 12px; padding: 1px 8px; border: 1px solid currentColor; font-family: var(--font-mono); }
.prio[data-lvl="Alta"] { color: var(--alto); } .prio[data-lvl="Media"] { color: var(--seg); } .prio[data-lvl="Baja"] { color: var(--nuevo); }
.c-src__post { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* International media and institutions */
.intl { display: grid; gap: 12px; min-width: 0; }
.intl__top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.intl__top h2 { margin: 0; }
.intl h3 { margin: 6px 0 0; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--pink); font-weight: 600; }
.intl small { font-weight: 400; color: var(--muted); letter-spacing: 0; text-transform: none; font-family: var(--font-mono); }
.intl__filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.intl__news { display: grid; gap: 10px; }
.news { border: 1px solid var(--line); background: var(--sky); padding: 12px 14px; min-width: 0; }
.news__meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.news__meta b { color: var(--ink-2); font-weight: 600; }
.news__title { margin: 4px 0 2px; font-weight: 700; overflow-wrap: anywhere; }
.news__title a { color: var(--text); text-decoration-color: var(--pink); }
.news__sum { margin: 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.news__tag { display: inline-block; margin-top: 6px; font-size: 12px; padding: 1px 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.news-empty { padding: 18px 14px; border: 1px dashed var(--line); color: var(--ink-2); font-size: 14px; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
.rep--bare { margin-top: 0; }
.rep--bare .rep__wrap { border: 1px solid var(--line); max-height: 520px; }

/* Sticky section navbar */
.nav { position: sticky; top: 0; z-index: 30; display: flex; gap: 2px; overflow-x: auto; white-space: nowrap; margin: -20px -16px 0; padding: 0 16px; background: rgba(8,3,26,.94); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-bottom: 1px solid var(--pink); box-shadow: 0 6px 18px rgba(8,3,26,.7); scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text-soft); text-decoration: none; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="true"] { color: var(--pink); border-bottom-color: var(--pink); }
#inicio, #resumen, #lectura, #cambio, #actores, #fuentes, #desgloses, #publicaciones, #mapa, #rpRiesgo, #rpEventos, #rpPersonas, #rpConex, #internacional { scroll-margin-top: 56px; }

/* Sorting inside the feed box */
.feed__sortbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.feed__sortbar label { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.feed__sortbar select { height: 36px; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 0; padding: 0 10px; }
.feed__head .th { font: inherit; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: inherit; }
.feed__head .th:hover { color: var(--text); }
.feed__head .th[data-on="1"] { color: var(--pink); }
.feed__head .th[data-on="1"]::after { content: ' ↓'; }
.feed__head .th[data-on="1"][data-dir="asc"]::after { content: ' ↑'; }
.rep th { cursor: pointer; user-select: none; }
.rep th:hover { color: var(--text); }
.rep th[data-dir]::after { content: ' ↓'; color: var(--pink); }
.rep th[data-dir="asc"]::after { content: ' ↑'; }


@media (max-width: 960px) {
  .tallies { grid-template-columns: 1fr; }
  .band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band__item:nth-child(3) { border-left: 0; padding-left: 0; }
  .band__item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .feed__head { display: none; }
  .post { grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-areas: "when when when link" "src src src src" "text text text text" "type comm reac shar" "type eng eng eng"; row-gap: 8px; }
  .c-when { grid-area: when; }
  .c-link { grid-area: link; text-align: right; }
  .c-src { grid-area: src; }
  .c-text { grid-area: text; }
  .c-type { grid-area: type; }
  .stat--comm { grid-area: comm; }
  .stat--reac { grid-area: reac; }
  .stat--shar { grid-area: shar; }
  .stat--eng { grid-area: eng; }
  .post .r { text-align: left; }
  .stat small { display: block; color: var(--muted); font-family: var(--font-body); font-size: 11px; }
  .c-type::before { content: 'Tipo'; display: block; color: var(--muted); font-size: 11px; }
  .live-box { align-items: flex-start; }
  .status-line, .countdown { text-align: left; }
}
/* Phones: single-column cards, two filters per row, 44px controls, 16px inputs (no iOS zoom). */
@media (max-width: 640px) {
  body { padding-block: 14px 32px; }
  .nav { margin: -14px -16px 0; }
  .map__wrap { height: clamp(360px, 68vh, 560px); }
  .feed__sortbar { padding: 10px 12px; }
  .feed__sortbar select, .feed__sortbar .btn { height: 44px; font-size: 16px; }
  .feed__sortbar select { flex: 1 1 160px; }
  .wrap { gap: 16px; }
  .band__item { padding: 12px 10px; }
  .band__value { font-size: 24px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .field--grow { grid-column: 1 / -1; }
  .field input, .field select, .btn { width: 100%; height: 44px; font-size: 16px; }
  .field--sm input { width: 100%; }
  .count-line { grid-column: 1 / -1; margin-left: 0; width: 100%; }
  .panel { padding: 14px 12px; }
  .bar { padding: 6px 4px; }
  .days { gap: 3px; height: 130px; }
  .day__n { font-size: 11px; }
  .day__lbl { font-size: 10px; }
  .post { padding: 12px; column-gap: 8px; }
  .textbtn { -webkit-line-clamp: 4; }
  .c-link a { display: inline-block; padding: 6px 10px; border: 1px solid var(--pink); }
  .rep summary { padding: 12px; }
  .rep th, .rep td { padding: 8px 10px; }
  .rep__wrap { -webkit-overflow-scrolling: touch; }
}
@media (prefers-reduced-motion: reduce) {
  .live-pill[data-phase="searching"] .dot, .post.is-new, .bump { animation: none; }
  .post.is-new { background: var(--accent-soft); }
  .bar__fill, .day__bar { transition: none; }
}

/* =====================================================================
   Multi-page layout: left sidebar + content (this block overrides the
   single-page layout above; the old .nav rules are no longer used)
   ===================================================================== */
body { display: grid; grid-template-columns: 264px minmax(0, 1fr); align-items: start; padding: 0; margin: 0; }
.main { min-width: 0; }
.wrap { padding: 24px 28px 56px; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 20px 14px; background: rgba(19, 9, 45, .96); border-right: 1px solid var(--pink); box-shadow: 0 0 30px rgba(190, 150, 255, .12); }
.side__brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--text); padding: 0 6px; }
.side__logo { color: var(--pink); font-size: 24px; text-shadow: 0 0 10px rgba(237, 100, 245, .7); }
.side__brand b { display: block; font-size: 15px; }
.side__brand small { display: block; color: var(--muted); font-size: 11.5px; }
.side__nav { display: grid; gap: 2px; }
.side__link { display: grid; gap: 1px; padding: 10px 12px; text-decoration: none; color: var(--text-soft); border-left: 3px solid transparent; }
.side__link small { font-size: 11.5px; color: var(--muted); }
.side__link:hover { background: var(--fila-hover); color: var(--text); }
.side__link[aria-current="page"] { border-left-color: var(--pink); background: var(--pink-soft); color: var(--text); }
.side__sub { list-style: none; margin: 0 0 8px 12px; padding: 0 0 0 10px; display: grid; gap: 1px; border-left: 1px solid var(--line); }
.side__sub a { display: block; padding: 5px 8px; font-size: 13px; color: var(--text-soft); text-decoration: none; }
.side__sub a:hover { color: var(--text); }
.side__sub a[aria-current="true"] { color: var(--pink); }
.side__foot { margin-top: auto; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; padding: 0 6px; }
.side__foot a { color: var(--text-soft); }
[data-nav] { scroll-margin-top: 20px; }
.pagehead { display: grid; gap: 4px; }
.pagehead h1 { margin: 0; }
.pagehead p { margin: 0; color: var(--ink-2); max-width: 78ch; }
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; gap: 2px; padding: 0 8px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--pink); z-index: 30; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side__brand { flex: none; padding: 0 8px 0 0; }
  .side__brand span:last-child, .side__foot, .side__sub, .side__link small { display: none; }
  .side__nav { display: flex; flex: none; }
  .side__link { min-height: 48px; align-content: center; border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; font-size: 13.5px; }
  .side__link[aria-current="page"] { border-bottom-color: var(--pink); }
  .wrap { padding: 16px 16px 44px; }
  [data-nav] { scroll-margin-top: 64px; }
}

/* ---------- charts ---------- */
.chart { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--font-mono); font-size: 12px; fill: var(--ink-2); }
.chart .val { fill: var(--ink); }
.chart .ax { stroke: var(--line); stroke-width: 1; }
.chart .gridl { stroke: var(--line); stroke-width: 1; opacity: .5; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--line); background: var(--sky); padding: 14px; min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--pink); font-weight: 600; }
.card .note { margin: 0 0 8px; }
.note { font-size: 12.5px; color: var(--muted); }
.warn { border: 1px solid var(--seg); color: var(--seg); padding: 8px 12px; font-size: 13px; }

/* ---------- semáforo ---------- */
.sem { display: inline-block; padding: 1px 9px; border: 1px solid currentColor; font-family: var(--font-mono); font-size: 12px; font-weight: 700; white-space: nowrap; }
.sem--rojo { color: #ff5c8a; } .sem--naranja { color: #ff9a4d; } .sem--amarillo { color: #ffd86b; } .sem--verde { color: #7cf5b0; } .sem--sin { color: var(--muted); }
.semtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .semtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.semtile { border: 1px solid var(--line); background: var(--sky); padding: 12px; }
.semtile .l { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.semtile .v { font-size: 28px; font-weight: 700; line-height: 1.15; }
.semtile .s { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.heatwrap { overflow-x: auto; border: 1px solid var(--line); background: var(--sky); }
.heat { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.heat th, .heat td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.heat th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.heat td.c, .heat th.c { text-align: center; font-family: var(--font-mono); font-variant-numeric: tabular-nums; min-width: 46px; }
.heat .h0 { color: var(--muted); } .heat .h1 { background: rgba(237, 100, 245, .16); } .heat .h2 { background: rgba(237, 100, 245, .36); } .heat .h3 { background: rgba(237, 100, 245, .66); font-weight: 700; }
.heat .tot { min-width: 130px; }
.heat__bar { display: block; height: 8px; background: var(--pink); margin-top: 3px; }
.sigposts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sigposts li { border-left: 3px solid var(--pink); padding-left: 10px; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.sigposts a { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 2px 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }

/* ---------- verification ---------- */
.vsum { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.vst { display: inline-block; font-family: var(--font-mono); font-size: 12px; padding: 1px 8px; border: 1px solid currentColor; white-space: nowrap; }
.vst--ok { color: var(--nuevo); } .vst--warn { color: var(--seg); } .vst--fail { color: var(--alto); } .vst--info { color: var(--otra); }
.vlist { display: grid; }
.vcheck { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vcheck__t { font-weight: 600; }
.vcheck__d { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.vcheck details { grid-column: 2; font-size: 12.5px; color: var(--ink-2); }
.vcheck summary { cursor: pointer; color: var(--muted); }
.vcheck ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 2px; }

/* ---------- daily archive ---------- */
.res { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.res__list { display: grid; gap: 6px; position: sticky; top: 16px; }
.res__btn { text-align: left; padding: 9px 12px; border: 1px solid var(--line); background: var(--sky); color: var(--text-soft); cursor: pointer; font: inherit; }
.res__btn small { display: block; color: var(--muted); font-size: 11.5px; }
.res__btn[aria-pressed="true"] { border-color: var(--pink); background: var(--pink-soft); color: var(--text); }
.res__detail { display: grid; gap: 14px; min-width: 0; }
.res__detail p { margin: 0; line-height: 1.6; }
@media (max-width: 900px) {
  .res { grid-template-columns: 1fr; }
  .res__list { position: static; display: flex; overflow-x: auto; }
  .res__btn { flex: none; min-height: 44px; }
}

/* =====================================================================
   Top bar (pages) + left rail (sections of the current page)
   ===================================================================== */
body { grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
body.noside { grid-template-columns: minmax(0, 1fr); }
.side { position: sticky; top: 54px; height: calc(100vh - 54px); padding: 22px 12px; gap: 4px; background: transparent; box-shadow: none; border-right: 1px solid var(--line); }
.side__title { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); padding: 0 10px 8px; }
.side__sub { margin: 0; padding: 0; border-left: 0; gap: 0; }
.side__sub a { padding: 7px 10px; border-left: 2px solid transparent; font-size: 13.5px; }
.side__sub a[aria-current="true"] { color: var(--pink); border-left-color: var(--pink); background: var(--pink-soft); }
.side__foot { margin-top: auto; padding: 0 10px; }
[data-nav] { scroll-margin-top: 74px; }
.heat th { cursor: pointer; user-select: none; }
.heat th:hover { color: var(--text); }
.heat th[data-dir]::after { content: ' ↓'; color: var(--pink); }
.heat th[data-dir="asc"]::after { content: ' ↑'; }
.contact { display: grid; gap: 14px; max-width: 70ch; }
.contact p { margin: 0; line-height: 1.6; color: var(--ink); }
.contact__mail { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.contact__mail a { color: var(--pink); }
@media (max-width: 900px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .side { top: 48px; height: auto; flex-direction: row; align-items: center; gap: 0; padding: 0 6px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(19, 9, 45, .97); z-index: 30; }
  .side__title, .side__foot { display: none; }
  .side__sub { display: flex; flex: none; }
  .side__sub a { white-space: nowrap; display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-left: 0; border-bottom: 2px solid transparent; }
  .side__sub a[aria-current="true"] { border-bottom-color: var(--pink); background: transparent; }
  [data-nav] { scroll-margin-top: 112px; }
}

.analysis-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.analysis-counts div { border: 1px solid var(--line); padding: .75rem; }
.analysis-counts strong { display: block; color: var(--pink); font-size: 1.5rem; }
.analysis-counts span { display: block; color: var(--text-soft); }
.analysis-timeline { display: grid; gap: .5rem; margin: 1rem 0; }
.analysis-timeline > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); align-items: center; gap: .75rem; }
.analysis-timeline progress { width: 100%; height: 1rem; accent-color: var(--pink); }
@media (max-width: 600px) {
  .analysis-counts { grid-template-columns: 1fr; }
}

.risk-window { padding-inline-start: 1.25rem; margin: .45rem 0 .75rem; }
.risk-window li + li { margin-top: .4rem; }
