/* ==========================================================================
   TOKENS — Sistema de diseño "Centro de Operaciones"
   ========================================================================== */
:root {
  /* superficie — noche operativa */
  --bg: #080B12;
  --bg-hex: #0B0F18;
  --surface: #10151F;
  --surface-2: #171E2C;
  --surface-raised: #1C2434;
  --border: #232B3D;
  --border-soft: #1A2130;

  /* texto */
  --text: #EDF1F7;
  --text-muted: #8D99B0;
  --text-faint: #566078;

  /* acentos operativos */
  --signal: #35E5B4;       /* verde señal — sistema activo / seguro */
  --signal-dim: #1B7A62;
  --alert: #FF6A52;        /* rojo-ámbar — alerta / relevancia alta */
  --alert-dim: #9A3F2E;

  /* clasificación por categoría */
  --cat-vulnerabilidades: #F0A93A;
  --cat-ransomware: #FF5C5C;
  --cat-filtracion: #9B8CF0;
  --cat-phishing: #34C7C2;
  --cat-inteligencia: #5B93F5;
  --cat-herramientas: #35E5B4;
  --cat-regulacion: #B9C2D4;
  --cat-aula: #E8B4E0;
  --cat-otro: #6B7690;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 4px;
  --radius-lg: 8px;
  --max-width: 1240px;
}

/* ==========================================================================
   BASE
   ========================================================================== */
* { box-sizing: border-box; }
html { color-scheme: dark; }

/* Red de seguridad: si algo se desborda horizontalmente (una imagen sin
   redimensionar, texto sin cortar, un elemento flex/grid mal calculado),
   esto evita que arrastre a TODA la página a poder scrollearse hacia los
   lados — que es exactamente lo que le pasaba al topbar antes del fix de
   min-width en .cat-nav. No reemplaza corregir la causa real cuando se
   encuentre una, pero cubre casos que todavía no se han detectado. */
html, body { overflow-x: hidden; max-width: 100%; }
img, svg { max-width: 100%; height: auto; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(53, 229, 180, 0.05), transparent),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(255, 106, 82, 0.05), transparent),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding-inline: 24px; }

/* patrón hex/circuito de fondo, sutil */
.hex-field {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
  mask-image: linear-gradient(to bottom, black, transparent);
}

/* ==========================================================================
   MASTHEAD
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8, 11, 18, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-strip {
  border-bottom: 1px solid var(--border-soft);
}
.topbar-strip-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.topbar-strip-inner span.live {
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(53,229,180,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(53,229,180,0.45); }
  70% { box-shadow: 0 0 0 6px rgba(53,229,180,0); }
  100% { box-shadow: 0 0 0 0 rgba(53,229,180,0); }
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.logo-mark {
  width: 30px; height: 30px;
  flex-shrink: 0;
  color: var(--signal);
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.logo-text small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-top: 1px;
}

.cat-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0; /* crítico: sin esto, flexbox nunca encoge este elemento por
                   debajo del ancho de su contenido (todos los botones sin
                   envolver), y ESO desborda todo el topbar — y de ahí toda
                   la página — en vez de scrollear solo el menú internamente
                   como está pensado (overflow-x: auto, arriba). */
}
.cat-nav::-webkit-scrollbar { display: none; }

.cat-nav button {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cat-nav button:hover { color: var(--text); border-color: var(--dot-color, var(--border)); }
.cat-nav button.active {
  color: var(--bg);
  background: var(--dot-color, var(--signal));
  border-color: var(--dot-color, var(--signal));
  font-weight: 600;
}
.cat-nav button.active .cat-dot { background: var(--bg); }

.cat-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dot-color, var(--text-faint));
  flex-shrink: 0;
}

.cat-icon { width: 13px; height: 13px; flex-shrink: 0; color: var(--dot-color, currentColor); }
.cat-nav button.active .cat-icon { color: var(--bg); }

/* ==========================================================================
   HERO — "Señal del día"
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}

.hero-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 32px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 18px;
}
.hero-eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--signal-dim), transparent);
}
.scan-icon { width: 14px; height: 14px; }

.hero-card { position: relative; display: block; }

.hero-img {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.hero-img img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.hero-img:hover img { transform: scale(1.015); filter: brightness(1.04); }
.hero-img-attrib {
  display: block;
  margin: 8px 0 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}
.hero-img-attrib a { color: var(--text-muted); }
.hero-img-attrib a:hover { color: var(--signal); }

.report-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.badge-relevancia {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--alert);
  border: 1px solid var(--alert-dim);
  background: rgba(255, 106, 82, 0.08);
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ==========================================================================
   BETA 2 — clasificación IFF (Amigo/Enemigo), badge KEV y Contexto Defensor
   ========================================================================== */

.badge-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Amigo = --signal (verde, "sistema activo/seguro"), Enemigo = --alert (rojo, "alerta") —
   reutiliza los mismos tokens de color que ya existen, sin inventar una paleta nueva. */
.badge-iff {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}
.badge-iff-amigo {
  color: var(--signal);
  border: 1px solid var(--signal-dim);
  background: rgba(53, 229, 180, 0.08);
}
.badge-iff-enemigo {
  color: var(--alert);
  border: 1px solid var(--alert-dim);
  background: rgba(255, 106, 82, 0.08);
}

.badge-kev {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: var(--alert);
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  font-weight: 600;
}
.badge-kev .cat-icon { width: 12px; height: 12px; }

/* Versión compacta para las tarjetas de lista — solo el ícono, sin texto, para no
   competir por espacio con el título en una tarjeta chica. */
.badge-kev-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--alert);
  color: var(--bg);
}
.badge-kev-mini .cat-icon { width: 11px; height: 11px; }

/* Beta 2 (continuación) — badge de severidad CVSS, 4 niveles con colores estándar
   de la industria: crítica/alta en rojo-ámbar, media en ámbar, baja en gris neutro. */
.badge-cvss {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
}
.cvss-critica { color: #fff; background: var(--alert); }
.cvss-alta    { color: var(--alert); border: 1px solid var(--alert-dim); background: rgba(255, 106, 82, 0.08); }
.cvss-media   { color: var(--cat-vulnerabilidades); border: 1px solid var(--cat-vulnerabilidades); background: rgba(240, 169, 58, 0.08); }
.cvss-baja    { color: var(--text-muted); border: 1px solid var(--border); background: transparent; }

.badge-cvss-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}
.badge-cvss-mini.cvss-critica { color: #fff; background: var(--alert); }
.badge-cvss-mini.cvss-alta    { color: var(--alert); background: rgba(255, 106, 82, 0.12); }

.card-top-row { display: flex; align-items: center; justify-content: space-between; }

/* Punto de color simple para tarjetas de lista cuando no hay KEV pero sí clasificación IFF —
   más discreto que el badge de texto completo del hero/detalle. */
.badge-iff-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.badge-iff-dot-amigo { background: var(--signal); }
.badge-iff-dot-enemigo { background: var(--alert); }

.iff-razon {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: -6px 0 16px;
}
.iff-razon strong { color: var(--text); }

.defensor-box {
  border: 1px solid var(--signal-dim);
  background: rgba(53, 229, 180, 0.06);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.defensor-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--signal);
  margin: 0 0 6px;
}
.defensor-title .cat-icon { width: 15px; height: 15px; }
.defensor-box p:not(.defensor-title) {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-card h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.08;
  margin: 0 0 16px;
  letter-spacing: -0.015em;
  max-width: 22ch;
}
.hero-card:hover h1 { color: var(--signal); }

.hero-card p.summary {
  color: var(--text-muted);
  font-size: 16.5px;
  line-height: 1.65;
  max-width: 68ch;
  margin: 0 0 20px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.meta-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.source-favicon {
  width: 14px; height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--surface-2);
}

.cat-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dot-color, var(--text-muted));
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ==========================================================================
   AD SLOTS
   ========================================================================== */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot-leaderboard { height: 90px; margin: 28px auto; max-width: var(--max-width); padding: 0 24px; }
.ad-slot-box { height: 250px; width: 100%; max-width: 260px; }

.ad-label {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  background: var(--surface);
}

/* Anuncio propio de reserva — cuando un espacio no tiene nada configurado */
.house-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s;
  padding: 12px;
  text-align: center;
}
.house-ad:hover { border-color: var(--signal); }
.house-ad-title { color: var(--text); font-size: 13px; font-weight: 600; }
.house-ad-sub { color: var(--signal); font-family: var(--font-mono); font-size: 11px; }
.house-ad-compact .house-ad-title { font-size: 12px; }

/* Anuncio directo (vendido a un anunciante) — la imagen ocupa todo el espacio */
.ad-directo {
  display: block;
  width: 100%;
  height: 100%;
}
.ad-directo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* ==========================================================================
   LAYOUT PRINCIPAL — feed + barra lateral
   ========================================================================== */
.layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr) 260px; }
}

.feed { min-width: 0; }

.sidebar {
  display: none;
  flex-direction: column;
  gap: 20px;
}
@media (min-width: 980px) {
  .sidebar { display: flex; }
}

.sidebar-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.sidebar-panel-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.threat-meter { display: flex; flex-direction: column; gap: 10px; }
.threat-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.threat-row .cat-name { flex: 1; color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.threat-bar-track { width: 60px; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.threat-bar-fill { height: 100%; border-radius: 999px; background: var(--dot-color, var(--signal)); }
.threat-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); width: 18px; text-align: right; }

/* ==========================================================================
   SECCIONES POR CATEGORÍA
   ========================================================================== */
.cat-section { margin-bottom: 40px; }

.cat-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.cat-section-header .cat-icon-wrap {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--dot-color, var(--text-faint)) 16%, transparent);
  color: var(--dot-color, var(--text-muted));
}
.cat-section-header .cat-icon-wrap svg { width: 14px; height: 14px; }

.cat-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--text);
}

.cat-section-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.cat-section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--dot-color, var(--text-faint));
}
.card:hover { background: var(--surface-2); border-color: var(--dot-color, var(--border)); transform: translateY(-1px); }

.card .report-id { font-size: 11px; }

.card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16.5px;
  line-height: 1.3;
  margin: 0;
  letter-spacing: -0.005em;
}

.card p.summary {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .meta-row { font-size: 11px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-soft); }

/* ==========================================================================
   SKELETONS / EMPTY STATES
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-lg);
}
.skeleton-hero { height: 220px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 28px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-state svg { width: 22px; height: 22px; color: var(--alert); }
.empty-state .empty-detail {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-faint);
  max-width: 46ch;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px 32px;
  position: relative;
  overflow: hidden;
}
.footer-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.footer-col { flex: 1; min-width: 200px; }
.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
}
.footer-logo svg { width: 22px; height: 22px; color: var(--signal); }
.footer-note {
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.65;
  max-width: 42ch;
}
.footer-heading {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.footer-cats {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-cats li {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   PÁGINA DE DETALLE
   ========================================================================== */
.detail-wrap { max-width: var(--max-width); margin: 0 auto; padding: 36px 24px 60px; }

.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}
@media (min-width: 980px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}

.detail-sidebar { display: none; }
@media (min-width: 980px) {
  .detail-sidebar { display: block; }
}

.related-list { display: flex; flex-direction: column; gap: 4px; }
.related-item {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border-soft);
  text-decoration: none;
}
.related-item:last-child { border-bottom: none; }
.related-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 6px;
}
.related-item:hover .related-title { color: var(--signal); }
.related-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
}
.back-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}
.back-link:hover { color: var(--signal); }

.detail-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  overflow: hidden;
}
.detail-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--dot-color, var(--signal));
}
.detail-card h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
  max-width: 34ch;
}
.detail-card .summary { font-size: 17px; color: var(--text-muted); line-height: 1.72; margin: 0 0 26px; max-width: 72ch; }

.detail-hero-img { margin: 0 0 22px; }
.detail-hero-img img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.detail-hero-attrib {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
}
.detail-hero-attrib a { color: var(--text-muted); }
.detail-hero-attrib a:hover { color: var(--signal); }

.source-box {
  border-top: 1px solid var(--border-soft);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.source-identity { display: flex; align-items: center; gap: 10px; }
.source-favicon-lg {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  object-fit: contain;
  padding: 4px;
}
.source-name-block { display: flex; flex-direction: column; gap: 1px; }
.source-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.source-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }

.source-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--bg);
  background: var(--signal);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: filter 0.15s;
}
.source-link:hover { filter: brightness(1.1); }

.advertencia {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px dashed var(--alert-dim);
  background: rgba(255, 106, 82, 0.06);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.provenance {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ==========================================================================
   BUSCADOR Y BOTÓN DE ALERTAS (topbar)
   ========================================================================== */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.sort-select:focus,
.sort-select:hover {
  border-color: var(--signal);
  outline: none;
}
@media (max-width: 860px) {
  .sort-select { display: none; }
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg {
  position: absolute;
  left: 10px;
  width: 14px; height: 14px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-box input {
  width: 148px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 12px 7px 30px;
  transition: width 0.2s, border-color 0.15s;
}
.search-box input:focus {
  width: 200px;
  border-color: var(--signal);
  outline: none;
}
.search-box input::placeholder { color: var(--text-faint); }

.search-clear {
  position: absolute;
  right: 8px;
  width: 16px; height: 16px;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.search-clear svg { width: 12px; height: 12px; }
.search-clear.visible { display: flex; }

.btn-alertas {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--bg);
  background: var(--signal);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
  transition: filter 0.15s;
}
.btn-alertas:hover { filter: brightness(1.1); }
.btn-alertas svg { width: 14px; height: 14px; }
.btn-alertas .btn-alertas-text { display: none; }
@media (min-width: 860px) { .btn-alertas .btn-alertas-text { display: inline; } }

/* ==========================================================================
   RESULTADOS DE BÚSQUEDA
   ========================================================================== */
.search-results-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-results-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.search-results-back {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--signal);
  border: 1px solid var(--signal-dim);
  border-radius: 999px;
  padding: 5px 11px;
}

/* ==========================================================================
   PÁGINA DE REGISTRO (registro.html)
   ========================================================================== */
.registro-wrap { max-width: 620px; margin: 0 auto; padding: 40px 24px 60px; }

.registro-intro { margin-bottom: 28px; }
.registro-intro h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 34px);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.registro-intro p { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin: 0; max-width: 56ch; }

.registro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.field-group { margin-bottom: 20px; }
.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.field-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 11px 13px;
  transition: border-color 0.15s;
}
.field-input:focus { border-color: var(--signal); outline: none; }
.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.field-error { font-size: 12.5px; color: var(--alert); margin-top: 6px; display: none; }
.field-error.visible { display: block; }

.radio-option, .checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.radio-option:hover, .checkbox-option:hover { border-color: var(--signal-dim); background: var(--surface-2); }
.radio-option input, .checkbox-option input { margin-top: 2px; accent-color: var(--signal); flex-shrink: 0; }
.radio-option-body strong { display: block; font-size: 14px; margin-bottom: 2px; }
.radio-option-body span { font-size: 12.5px; color: var(--text-muted); }

.cat-checklist {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-left: 4px;
}
.cat-checklist.visible { display: flex; }
.cat-checklist .checkbox-option { margin-bottom: 0; padding: 9px 12px; }
.cat-checklist .checkbox-option span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--text);
}

.consent-row { display: flex; align-items: flex-start; gap: 10px; margin: 22px 0; }
.consent-row input { margin-top: 3px; accent-color: var(--signal); flex-shrink: 0; }
.consent-row label { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }

.btn-submit {
  width: 100%;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--bg);
  background: var(--signal);
  border: none;
  border-radius: 999px;
  padding: 13px;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn-submit:hover { filter: brightness(1.1); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.form-msg {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-mono);
  display: none;
  align-items: flex-start;
  gap: 8px;
}
.form-msg.visible { display: flex; }
.form-msg svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.form-msg.success { background: rgba(53,229,180,0.08); border: 1px solid var(--signal-dim); color: var(--text); }
.form-msg.error { background: rgba(255,106,82,0.08); border: 1px solid var(--alert-dim); color: var(--text); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
  .topbar-strip { display: none; }
  .topbar-inner { gap: 16px; }
  /* El subtítulo hereda white-space:nowrap de .logo — no puede partirse en
     dos líneas, así que fuerza un ancho fijo grande. Combinado con la barra
     de búsqueda y el botón (que tampoco se encogen, a propósito), esto por
     sí solo ya no cabía en un celular, sin importar qué tan chico se
     encogiera el menú de categorías al lado. Se oculta aquí — la marca
     "INFOSECDASH" sola ya es suficiente en el espacio angosto del header móvil.
     El slogan completo sigue visible en el <title> de la pestaña del navegador. */
  .logo-text small { display: none; }
  .hero-inner { padding: 28px 16px 24px; }
  .hero-img img { max-height: 220px; }
  .layout { padding: 20px 16px 32px; }
  .ad-slot-leaderboard { padding: 0 16px; }
  .detail-card { padding: 22px; }
  .search-box input { width: 100px; }
  .search-box input:focus { width: 140px; }
  .registro-card { padding: 20px; }
}
