/* Cuadro de mando · lienzo fijo 1920×1080 escalado a la pantalla */
:root {
  --bg: #08090b;
  --panel: #111215;
  --panel-2: #16171b;
  --line: #24252a;
  --line-2: #2f3036;
  --ink: #ffffff;
  --dim: #a8a8ab;
  --muted: #6b6b6e;
  --orange: #f38020;
  --orange-2: #fbad41;
  --orange-soft: rgba(243, 128, 32, 0.14);
  --red: #ef4b4b;
  --amber: #fbad41;
  --blue: #6ea8ff;
  --madrid: #de0029;
  --ok: #3ccf7c;
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* superficies del mapa y cristales */
  --sphere: #0c0d10; --land: #1c1d22; --land-line: #2b2c32; --land-hot: #2a211a;
  --grat: rgba(255,255,255,0.035); --halo: #0c0d10; --callout: rgba(255,255,255,0.35); --grid: rgba(255,255,255,0.05);
  --glass: rgba(12,13,16,0.86); --card-glass: var(--card-glass); --img-bg: #0c0d10;
  --comet: #ffffff; --alert-bg: linear-gradient(90deg, #3a0b0e, #1a0a0b 70%); --strong: #ffffff;
  color-scheme: dark;
}

/* Modo claro */
:root[data-theme="light"] {
  --bg: #f3f3f4; --panel: #ffffff; --panel-2: #f7f7f8; --line: #e3e3e6; --line-2: #d2d2d6;
  --ink: #1a1a1a; --dim: #55555a; --muted: #85858a;
  --orange: #e8710f; --orange-2: #c9650d; --orange-soft: rgba(243,128,32,0.14);
  --red: #d63a3a; --amber: #b8730a; --blue: #2c66d4; --ok: #1d9150;
  --sphere: #edf0f4; --land: #d6d9df; --land-line: #c2c5cc; --land-hot: #f6dcc4;
  --grat: rgba(0,0,0,0.05); --halo: #ffffff; --callout: rgba(0,0,0,0.35); --grid: rgba(0,0,0,0.07);
  --glass: rgba(255,255,255,0.92); --card-glass: rgba(255,255,255,0.96); --img-bg: #e9eaee;
  --comet: #b4470a; --alert-bg: linear-gradient(90deg, #fde3e3, #ffffff 70%); --strong: #1a1a1a;
  color-scheme: light;
}
:root[data-theme="light"] .kpi, :root[data-theme="light"] .stage, :root[data-theme="light"] .feed,
:root[data-theme="light"] .ticker, :root[data-theme="light"] .block { box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04); }
.theme-anim, .theme-anim * { transition: background-color 1.2s ease, color 1.2s ease, border-color 1.2s ease, fill 1.2s ease, stroke 1.2s ease !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); cursor: none; }

#screen {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px; padding: 26px 28px;
  transform-origin: center center;
  display: grid; grid-template-rows: 92px 1fr 52px; gap: 18px;
  background:
    radial-gradient(1200px 700px at 50% 45%, rgba(243,128,32,0.05), transparent 70%),
    var(--bg);
  transition: translate 2s ease;
}

/* ---------- Cabecera ---------- */
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 36px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.brands { display: flex; align-items: center; gap: 26px; height: 78px; }
.logo-cf { height: 50px; }
.logo-cm { height: 80px; }
.brand-sep { width: 1px; height: 56px; background: var(--line-2); }
.title .eyebrow { color: var(--orange); font-weight: 700; font-size: 17px; letter-spacing: 0.18em; text-transform: uppercase; }
.title h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.01em; margin-top: 6px; }
.status { display: flex; align-items: center; gap: 30px; }
.status-line { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.updated { color: var(--dim); font-size: 15px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; border-left: 1px solid var(--line-2); padding-left: 28px; }
#clock-time { font-family: var(--mono); font-size: 42px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
#clock-date { color: var(--dim); font-size: 15px; text-transform: capitalize; margin-top: 2px; }

.pill { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px; border-radius: 999px; font-size: 13px; letter-spacing: 0.14em; border: 1px solid; }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: blink 1.6s ease-in-out infinite; }
.pill-live { color: var(--ok); border-color: rgba(60,207,124,0.45); background: rgba(60,207,124,0.08); }
.pill-demo { color: var(--amber); border-color: rgba(251,173,65,0.5); background: rgba(251,173,65,0.08); }
.pill-off { color: var(--red); border-color: rgba(239,75,75,0.5); background: rgba(239,75,75,0.08); }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- Rejilla principal ---------- */
.grid { display: grid; grid-template-columns: 330px 1fr 410px; gap: 20px; min-height: 0; }

/* KPIs */
.kpis { display: grid; grid-template-rows: repeat(6, 1fr); gap: 12px; min-height: 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px 12px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--orange); opacity: 0.85; }
.kpi.alert-kpi::before { background: var(--red); }
.kpi-label { color: var(--dim); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.kpi-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 8px; }
.kpi-value { font-size: 36px; font-weight: 700; color: var(--orange); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value.small { font-size: 26px; color: var(--ink); }
.kpi-value.red { color: var(--red); }
.kpi-sub { color: var(--dim); font-size: 14px; margin-top: auto; line-height: 1.35; }
.kpi-sub b { color: var(--ink); font-weight: 700; }
.kpi svg.spark { position: absolute; right: 14px; bottom: 12px; width: 120px; height: 38px; overflow: visible; }
.trend-up { color: var(--red); }
.trend-down { color: var(--ok); }

/* Escenario */
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; position: relative; overflow: hidden; display: grid; grid-template-rows: 74px 1fr; }
.stage-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 0 24px; border-bottom: 1px solid var(--line); position: relative; }
.stage-index { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--orange); }
.stage-title { font-size: 25px; font-weight: 700; }
.stage-sub { color: var(--dim); font-size: 15px; margin-top: 4px; }
.stage-dots { display: flex; gap: 8px; }
.stage-dots i { width: 26px; height: 4px; border-radius: 2px; background: var(--line-2); transition: background 0.4s; }
.stage-dots i.on { background: var(--orange); }
.stage-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.stage-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--orange-2)); }
.stage-body { position: relative; min-height: 0; }
.stage-foot { position: absolute; right: 18px; bottom: 10px; font-size: 12px; color: var(--muted); z-index: 5; }

.scene { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.scene.active { opacity: 1; }

/* Paneles flotantes sobre el mapa */
.overlay { position: absolute; background: var(--glass); border: 1px solid var(--line-2); border-radius: 10px; padding: 16px 18px; backdrop-filter: blur(4px); }
.overlay h3, .block h3 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; font-weight: 700; }
.rows { display: flex; flex-direction: column; gap: 9px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 16px; align-items: center; }
.row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .val { font-family: var(--mono); color: var(--orange); font-size: 15px; font-variant-numeric: tabular-nums; }
.row .bar { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-2)); border-radius: 2px; transform-origin: left; animation: grow 1.4s cubic-bezier(.2,.7,.2,1) both; }
.row .arrow { color: var(--muted); margin: 0 6px; }
.row.hl .lbl { color: var(--orange-2); font-weight: 700; }
@keyframes grow { from { transform: scaleX(0); } }

/* Mapa */
svg.map { width: 100%; height: 100%; display: block; }
.map .sphere { fill: var(--sphere); stroke: var(--line); }
.map .graticule { fill: none; stroke: var(--grat); }
.map .land { fill: var(--land); stroke: var(--land-line); stroke-width: 0.5; }
.map .land.focus { fill: rgba(222,0,41,0.22); stroke: rgba(222,0,41,0.7); stroke-width: 1; }
.map .arc { fill: none; stroke-linecap: round; stroke-dasharray: 6 10; animation: flow 1.6s linear infinite; }
.map .arc-base { fill: none; stroke: rgba(243,128,32,0.18); }
@keyframes flow { to { stroke-dashoffset: -32; } }
.map .ping { fill: none; stroke: var(--orange); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ping 2.4s ease-out infinite; }
.map .ping.red { stroke: var(--red); }
.map .ping.amber { stroke: var(--amber); }
.map .ping.blue { stroke: var(--blue); }
@keyframes ping { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(3.2); opacity: 0; } }
.map .node { fill: var(--orange); }
.map .label { fill: var(--ink); font-size: 13px; font-weight: 700; paint-order: stroke; stroke: var(--halo); stroke-width: 4px; }
.map .label.dim { fill: var(--dim); font-weight: 400; font-size: 12px; }
.map .callout { stroke: var(--callout); stroke-width: 1; fill: none; }

/* Gráficas */
.chart { position: relative; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .axis line, .chart .axis path { stroke: var(--line); }
.chart .grid-line { stroke: var(--grid); }
.chart .area { fill: url(#gradO); }
.chart .line { fill: none; stroke: var(--orange); stroke-width: 2.2; }
.chart .line.alt { stroke: var(--dim); stroke-width: 1.6; stroke-dasharray: 4 4; }
.chart .now-band { fill: rgba(243,128,32,0.05); }
.chart .peak { fill: var(--orange-2); }
.chart .peak-label { fill: var(--orange-2); font-size: 13px; font-weight: 700; }
.chart .band-label { fill: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }

.block { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; min-height: 0; overflow: hidden; }
.block .big { font-size: 46px; font-weight: 700; color: var(--orange); font-variant-numeric: tabular-nums; }
.block .note { color: var(--dim); font-size: 14px; line-height: 1.4; }

/* Escena de noticias */
.news-grid { position: absolute; inset: 22px; display: grid; grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; gap: 16px; }
.news-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.news-card.lead { grid-row: 1 / span 3; padding: 28px; border-color: rgba(243,128,32,0.45); background: linear-gradient(180deg, rgba(243,128,32,0.10), var(--panel-2) 55%); }
.news-card .meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--dim); }
.news-card .src { color: var(--orange); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; }
.news-card h4 { font-size: 19px; line-height: 1.3; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card.lead h4 { font-size: 34px; line-height: 1.2; -webkit-line-clamp: 5; }
.news-card p { color: var(--dim); font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card.lead p { font-size: 20px; line-height: 1.5; -webkit-line-clamp: 9; margin-top: 10px; }
.news-card.lead .meta { font-size: 15px; }
.news-card.lead .src { font-size: 14px; }
.news-card .orig { color: var(--muted); font-size: 13px; font-style: italic; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
.tag-hot { background: rgba(239,75,75,0.16); color: var(--red); }
.tag-local { background: rgba(222,0,41,0.18); color: #ff5b74; }
.tag-new { background: var(--orange-soft); color: var(--orange-2); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Panel derecho · incidencias */
.feed { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-rows: 58px 34px 1fr; min-height: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 700; letter-spacing: 0.04em; }
.panel-count { font-family: var(--mono); color: var(--orange); font-size: 15px; }
.feed-legend { display: flex; gap: 18px; align-items: center; padding: 0 20px; font-size: 12px; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dot-outage { background: var(--red); }
.dot-anomaly { background: var(--amber); }
.dot-bgp { background: var(--blue); }
.feed-window { position: relative; overflow: hidden; min-height: 0; mask-image: linear-gradient(180deg, transparent, #000 4%, #000 92%, transparent); }
.feed-list { display: flex; flex-direction: column; gap: 10px; padding: 10px 14px; }
.feed-list.scrolling { animation: feedscroll var(--dur, 60s) linear infinite; }
@keyframes feedscroll { to { transform: translateY(calc(-50% - 5px)); } }
.inc { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 8px; padding: 12px 14px; display: grid; gap: 6px; }
.inc.outage { border-left-color: var(--red); }
.inc.anomaly { border-left-color: var(--amber); }
.inc.hijack, .inc.leak { border-left-color: var(--blue); }
.inc.fresh { box-shadow: 0 0 0 1px rgba(243,128,32,0.35), 0 0 22px rgba(243,128,32,0.12); animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 1px rgba(243,128,32,0.65), 0 0 28px rgba(243,128,32,0.22); } }
.inc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.inc-kind { font-weight: 700; }
.inc.outage .inc-kind { color: var(--red); }
.inc.anomaly .inc-kind { color: var(--amber); }
.inc.hijack .inc-kind, .inc.leak .inc-kind { color: var(--blue); }
.inc-where { font-size: 17px; font-weight: 700; }
.inc-what { font-size: 14px; color: var(--dim); line-height: 1.35; }
.inc-badges { display: flex; gap: 6px; }
.tag-live { background: rgba(239,75,75,0.16); color: var(--red); }
.tag-live::before { content: "● "; animation: blink 1.4s infinite; }

/* Alerta flotante de nueva incidencia */
.alert { position: absolute; left: 0; right: 0; top: 0; height: 74px; z-index: 10; pointer-events: none; display: flex; gap: 22px; align-items: center; padding: 0 24px; background: var(--alert-bg); border-bottom: 2px solid var(--red); transform: translateY(-100%); transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.alert.show { transform: none; }
.alert .a-label { color: #fff; background: var(--red); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; white-space: nowrap; padding: 6px 12px; border-radius: 4px; animation: blink 1.4s infinite; }
.alert .a-text { font-size: 21px; font-weight: 700; }
.alert .a-sub { font-size: 14px; color: var(--dim); margin-top: 3px; }

/* Teletipo */
.ticker { display: grid; grid-template-columns: auto 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ticker-label { background: var(--orange); color: #111; font-weight: 700; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; display: flex; align-items: center; padding: 0 22px; }
.ticker-window { overflow: hidden; position: relative; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 2%, #000 98%, transparent); }
.ticker-track { display: inline-flex; white-space: nowrap; gap: 0; animation: ticker var(--dur, 240s) linear infinite; will-change: transform; }
.ticker-item { font-size: 19px; padding: 0 30px; display: inline-flex; align-items: center; gap: 12px; }
.ticker-item .src { color: var(--orange); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.ticker-item .sep { color: var(--line-2); padding-left: 30px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Escena: dos columnas */
.split { position: absolute; inset: 20px; display: grid; gap: 18px; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 18px; }

/* Banda inferior bajo los mapas */
.band { position: absolute; left: 20px; right: 20px; bottom: 34px; height: 186px; display: grid; gap: 14px; }
.band-col { background: var(--card-glass); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; overflow: hidden; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.band-col:nth-child(2) { animation-delay: 0.08s; } .band-col:nth-child(3) { animation-delay: 0.16s; } .band-col:nth-child(4) { animation-delay: 0.24s; }
.band-col h3 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band-col .rows { gap: 7px; }
.band-col .row { font-size: 15px; }
.stat { background: var(--card-glass); border: 1px solid var(--line); border-top: 3px solid var(--muted); border-radius: 10px; padding: 14px 18px; display: flex; flex-direction: column; justify-content: center; gap: 4px; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.stat b { font-size: 40px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--dim); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.stat.outage { border-top-color: var(--red); } .stat.outage b { color: var(--red); }
.stat.anomaly { border-top-color: var(--amber); } .stat.anomaly b { color: var(--amber); }
.stat.bgp { border-top-color: var(--blue); } .stat.bgp b { color: var(--blue); }
.stat.live { border-top-color: var(--orange); background: linear-gradient(180deg, rgba(239,75,75,0.12), var(--card-glass)); } .stat.live b { color: var(--strong); }

/* Modo ?still: sin transiciones de entrada */
.still .scene { transition: none; }
.still .row .bar i, .still .news-card, .still .band-col, .still .stat { animation: none; }

/* Escena: informes de Cloudflare Radar */
.rb-lead { background: var(--panel-2); border: 1px solid rgba(243,128,32,0.45); border-radius: 12px; overflow: hidden; display: grid; grid-template-rows: 46% 1fr; min-height: 0; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.rb-hero { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--img-bg); }
.rb-noimg { background: radial-gradient(400px 200px at 30% 40%, rgba(243,128,32,0.35), transparent 70%), var(--img-bg); }
.rb-body { padding: 22px 26px; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.rb-body .meta { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--dim); flex-wrap: wrap; }
.rb-body .src { color: var(--orange); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.rb-body h4 { font-size: 30px; line-height: 1.2; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rb-body .orig { color: var(--muted); font-size: 14px; font-style: italic; }
.rb-body p { color: var(--dim); font-size: 18px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rb-list { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.rb-list h3 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); font-weight: 700; margin: 4px 0 2px; }
.rb-item { flex: 0 0 162px; min-height: 0; display: grid; grid-template-columns: 168px 1fr; gap: 16px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.rb-thumb { width: 168px; height: 100%; max-height: 120px; object-fit: cover; border-radius: 6px; display: block; background: var(--img-bg); }
.rb-date { color: var(--orange); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.rb-title { font-size: 17px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.still .rb-lead, .still .rb-item { animation: none; }

/* ---------- Código QR ---------- */
.qr { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.qr svg { display: block; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-2); }
.qr span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.news-card.lead .qr { margin-top: auto; align-self: flex-start; flex-direction: row; gap: 14px; }
.rb-text { display: flex; gap: 20px; align-items: flex-start; min-height: 0; }
.rb-text p { flex: 1; }

/* ---------- Índice de actividad (cabecera) ---------- */
.threat { display: flex; flex-direction: column; gap: 7px; padding-right: 28px; border-right: 1px solid var(--line-2); --lvl: var(--ok); }
.threat[data-level="1"] { --lvl: #9ccc3d; }
.threat[data-level="2"] { --lvl: var(--amber); }
.threat[data-level="3"] { --lvl: var(--orange); }
.threat[data-level="4"] { --lvl: var(--red); }
.threat-label { color: var(--dim); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.threat-row { display: flex; align-items: center; gap: 12px; }
.threat-bars { display: flex; gap: 4px; }
.threat-bars i { width: 22px; height: 12px; border-radius: 2px; background: var(--line-2); transition: background 0.6s; }
.threat-bars i.on { background: var(--lvl); box-shadow: 0 0 10px color-mix(in srgb, var(--lvl) 45%, transparent); }
.threat-row b { font-size: 19px; color: var(--lvl); white-space: nowrap; }
.threat-row span { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- Escena región ---------- */
.legend-alt { float: right; color: var(--muted); font-weight: 400; letter-spacing: 0.04em; text-transform: none; font-size: 12px; }
.tiles { display: grid; grid-template-rows: repeat(4, 1fr); gap: 12px; min-height: 0; }
.tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.tile:nth-child(2) { animation-delay: 0.08s; } .tile:nth-child(3) { animation-delay: 0.16s; } .tile:nth-child(4) { animation-delay: 0.24s; }
.tile-label { color: var(--dim); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.tile-big { font-size: 34px; font-weight: 700; color: var(--orange); font-variant-numeric: tabular-nums; line-height: 1; }
.tile-big.red { color: var(--red); }
.tile-sub { color: var(--dim); font-size: 14px; margin-top: auto; }
.cmp { display: grid; gap: 5px; margin-top: auto; }
.cmp-row { display: grid; grid-template-columns: 70px 1fr 64px; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); }
.cmp-row i { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.cmp-row b { display: block; height: 100%; background: var(--orange); border-radius: 3px; transform-origin: left; animation: grow 1.4s cubic-bezier(.2,.7,.2,1) both; }
.cmp-row.world b { background: var(--muted); }
.cmp-row em { font-style: normal; font-family: var(--mono); text-align: right; color: var(--ink); }
.tile-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; }
.tile-pair b { display: block; font-size: 32px; color: var(--orange); font-variant-numeric: tabular-nums; }
.tile-pair span { color: var(--dim); font-size: 13px; }
.ranking { list-style: none; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px 22px; }
.ranking li { display: flex; align-items: center; gap: 12px; font-size: 17px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.ranking b { font-family: var(--mono); color: var(--orange); width: 22px; text-align: right; }

/* ---------- Escena KEV ---------- */
.kev-lead { background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); border-radius: 12px; padding: 26px 28px; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; background-image: linear-gradient(180deg, color-mix(in srgb, var(--red) 9%, transparent), transparent 45%); animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.kev-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kev-id { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--red); margin-right: 8px; }
.kev-prod { color: var(--orange); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.kev-lead h4 { font-size: 28px; line-height: 1.25; }
.kev-lead p { color: var(--dim); font-size: 18px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.kev-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.kev-dates { display: flex; gap: 28px; flex-wrap: wrap; }
.kev-dates span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.kev-dates b { font-size: 18px; }
.kev-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.kev-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kev-stats > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.kev-stats b { display: block; font-size: 34px; color: var(--orange); font-variant-numeric: tabular-nums; }
.kev-stats b.red { color: var(--red); }
.kev-stats span { color: var(--dim); font-size: 13px; }
.kev-list { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.kev-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 8px; padding: 12px 14px; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.kev-cve { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--red); }
.kev-what { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kev-day { color: var(--muted); font-size: 13px; }

/* ---------- Transiciones entre escenas (View Transitions API) ---------- */
.stage-body { view-transition-name: stage; }
.stage-titles { view-transition-name: scene-title; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(stage) { animation: vt-out 0.6s cubic-bezier(.4,0,.2,1) both; }
::view-transition-new(stage) { animation: vt-in 0.9s cubic-bezier(.2,.7,.2,1) both; }
::view-transition-old(scene-title) { animation: vt-title-out 0.45s ease both; }
::view-transition-new(scene-title) { animation: vt-title-in 0.6s 0.1s ease both; }
@keyframes vt-out { to { opacity: 0; transform: scale(0.985); filter: blur(8px); } }
@keyframes vt-in { from { opacity: 0; transform: scale(1.015); filter: blur(8px); } }
@keyframes vt-title-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-title-in { from { opacity: 0; transform: translateY(10px); } }
.still .tile, .still .kev-lead, .still .kev-row, .still .cmp-row b { animation: none; }

/* ---------- Escena de colaboración ---------- */
.colab { position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center; }
.colab-glow { position: absolute; inset: -20%; background:
    radial-gradient(38% 42% at 30% 45%, color-mix(in srgb, var(--orange) 26%, transparent), transparent 70%),
    radial-gradient(34% 40% at 72% 52%, color-mix(in srgb, var(--madrid) 24%, transparent), transparent 70%);
  animation: colab-drift 14s ease-in-out infinite alternate; filter: blur(10px); }
@keyframes colab-drift { to { transform: translate(3%, -2%) scale(1.06); } }
.colab-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent); animation: colab-grid 20s linear infinite; }
@keyframes colab-grid { to { background-position: 48px 48px, 48px 48px; } }
.colab-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 0 60px; max-width: 1000px; }
.colab-eyebrow { color: var(--orange); font-weight: 700; font-size: 15px; letter-spacing: 0.22em; text-transform: uppercase; animation: rise 0.8s both; }
.colab-logos { display: flex; align-items: center; gap: 38px; margin: 6px 0 4px; }
.cl-cf { height: 74px; animation: colab-in-left 1s cubic-bezier(.2,.7,.2,1) both; }
.cl-cm { height: 128px; animation: colab-in-right 1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes colab-in-left { from { opacity: 0; transform: translateX(-60px); filter: blur(6px); } }
@keyframes colab-in-right { from { opacity: 0; transform: translateX(60px); filter: blur(6px); } }
.colab-x { position: relative; width: 76px; height: 76px; display: grid; place-items: center; animation: colab-pop 0.9s 0.35s cubic-bezier(.2,1.4,.4,1) both; }
.colab-x::before { content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 2px;
  background: conic-gradient(from 0deg, var(--orange), var(--madrid), var(--orange-2), var(--orange));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 4s linear infinite; }
.colab-x span { font-size: 40px; font-weight: 300; color: var(--ink); }
@keyframes colab-pop { from { opacity: 0; transform: scale(0.3) rotate(-90deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.colab-lema { font-size: 56px; line-height: 1.08; font-weight: 700; letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 35%, var(--orange) 50%, var(--ink) 65%, var(--ink) 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise 0.9s 0.5s both, shimmer 5s 1.2s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 60%, 100% { background-position: -50% 0; } }
.colab-texto { font-size: 21px; line-height: 1.5; color: var(--dim); max-width: 860px; animation: rise 0.9s 0.65s both; }
.colab-pilares { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; margin-top: 6px; }
.cp { display: flex; gap: 14px; text-align: left; align-items: flex-start; background: var(--card-glass); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; animation: rise 0.8s both; }
.cp i { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--orange-soft); }
.cp svg { width: 26px; height: 26px; fill: none; stroke: var(--orange); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cp b { display: block; font-size: 16px; margin-bottom: 4px; }
.cp span { color: var(--dim); font-size: 14px; line-height: 1.4; }
.colab-live { display: flex; align-items: center; gap: 26px; margin-top: 8px; padding: 12px 22px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card-glass); animation: rise 0.8s 1s both; }
.colab-live em { font-style: normal; color: var(--dim); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.colab-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: live-pulse 1.8s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.cs { display: flex; align-items: baseline; gap: 8px; }
.cs b { font-size: 26px; color: var(--orange); font-variant-numeric: tabular-nums; }
.cs span { color: var(--dim); font-size: 13px; text-align: left; max-width: 150px; line-height: 1.2; }
.still .colab-glow, .still .colab-grid, .still .colab-eyebrow, .still .cl-cf, .still .cl-cm, .still .colab-x, .still .colab-lema,
.still .colab-texto, .still .cp, .still .colab-live { animation: none; }

/* Cabecera compacta: el índice de actividad comparte fila con el título */
.title h1 { font-size: 32px; white-space: nowrap; }
.top { gap: 30px; }
.status { gap: 24px; }

/* ---------- Escena Zero Wire ---------- */
.zw-item { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: 8px; padding: 12px 18px; animation: rise 0.6s both; }
.zw-item b { font-size: 18px; font-weight: 700; }
.zw-item span { color: var(--dim); font-size: 15px; line-height: 1.4; }
