/* ═══════════════════════════════════════════════════════════════════════════
   Ejercicio 03 · CIJT · pub.legaltech.com.gt
   Tokens institucionales y estilos custom encima de Tailwind CDN.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Base neutrals */
  --ink: #0f172a;
  --graphite: #1e293b;
  --slate: #475569;
  --slate-soft: #64748b;
  --mist: #f8fafc;
  --mist-2: #f1f5f9;
  --border: #e2e8f0;
  --border-soft: #eef2f7;

  /* AXIOMA primary (institutional blue) + secondary (deep violet) */
  --primary-50:  #eff6ff;
  --primary-100: #dbeafe;
  --primary-300: #93c5fd;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-900: #1e3a8a;

  --violet-50:  #f5f3ff;
  --violet-100: #ede9fe;
  --violet-300: #c4b5fd;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;

  /* Acentos por voz (preservados) */
  --openai: #475569;
  --gemini: #4f46e5;
  --claude: #059669;
  --moderator: #d97706;

  /* Etiquetas epistémicas (preservadas) */
  --tag-hecho:        #059669;
  --tag-tendencia:    #0891b2;
  --tag-inferencia:   #7c3aed;
  --tag-especulacion: #dc2626;
  --tag-no_se:        #6b7280;

  --verificado:    #059669;
  --disputado:     #dc2626;
  --sin_verificar: #6b7280;
  --corpus_gt:     #d97706;

  /* Gradientes — AXIOMA-like */
  --grad-brand: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #a855f7 100%);
  --grad-brand-h: linear-gradient(90deg, #2563eb 0%, #7c3aed 50%, #a855f7 100%);
  --grad-soft:  linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08));
  --grad-line:  linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
  --grad-warm:  linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
  --grad-cool:  linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #3b82f6 100%);
  --grad-dark:  linear-gradient(180deg, #0f172a 0%, #1e293b 100%);

  /* Sombras tintadas — fundamental del look AXIOMA */
  --shadow-xs:   0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:   0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:   0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg:   0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl:   0 25px 50px -12px rgba(15, 23, 42, 0.18);
  --shadow-blue:   0 8px 24px -8px rgba(37, 99, 235, 0.35);
  --shadow-violet: 0 8px 24px -8px rgba(124, 58, 237, 0.35);

  --radius-card: 18px;
  --radius-pill: 9999px;
  --radius-btn:  14px;
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { -webkit-font-smoothing: antialiased; }

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

/* ─── Layout helpers ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 80rem; /* 7xl */
  margin-left: auto;
  margin-right: auto;
  /* Padding lateral con safe-area para iPhone notch / dynamic island */
  padding-left:  max(1rem, env(safe-area-inset-left, 1rem));
  padding-right: max(1rem, env(safe-area-inset-right, 1rem));
  box-sizing: border-box;
}
@media (min-width: 640px) {
  .container { padding-left: max(1.5rem, env(safe-area-inset-left, 1.5rem));
                padding-right: max(1.5rem, env(safe-area-inset-right, 1.5rem)); }
}
@media (min-width: 1024px) {
  .container { padding-left: max(2rem, env(safe-area-inset-left, 2rem));
                padding-right: max(2rem, env(safe-area-inset-right, 2rem)); }
}

.section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
@media (min-width: 640px) { .section { padding-top: 5rem;   padding-bottom: 5rem; } }
@media (min-width: 768px) { .section { padding-top: 6rem;   padding-bottom: 6rem; } }
.section-mist { background: var(--mist); }

/* Sección oscura estilo AXIOMA: hero gris-azulado con blobs blur */
.section-dark {
  position: relative;
  isolation: isolate;
  background: var(--grad-dark);
  color: #e2e8f0;
  overflow: hidden;
}
.section-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(59,130,246,0.18), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(139,92,246,0.18), transparent 55%);
  z-index: -1;
}
.section-dark .h2,
.section-dark .h3 { color: #f8fafc; }
.section-dark .lede { color: #cbd5e1; }
.section-dark .section-head .eyebrow { color: #93c5fd; }

/* Cards dentro de sección oscura */
.section-dark .timeline-card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.section-dark .timeline-card p { color: #cbd5e1; }
.section-dark .timeline-card .timeline-meta { color: #93c5fd; }
.section-dark .timeline-card .timeline-title { color: #f8fafc; }
.section-dark .timeline-card .timeline-limit strong { color: #f8fafc; }
.section-dark .timeline-card-active {
  background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(59,130,246,0.10));
  border-color: rgba(16,185,129,0.35);
  box-shadow: 0 8px 24px -8px rgba(16,185,129,0.30);
}
.section-dark .timeline-dot { background: #1e293b; border-color: #93c5fd; }
.section-dark .timeline.active .timeline-dot,
.section-dark .timeline-item.active .timeline-dot {
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.20);
}
.section-dark .phase-table thead th { background: rgba(255,255,255,0.04); color: #cbd5e1; }
.section-dark .phase-table tbody td { background: rgba(255,255,255,0.02); color: #e2e8f0; border-bottom-color: rgba(255,255,255,0.08); }
.section-dark .phase-table tbody tr:hover td { background: rgba(255,255,255,0.06); }
.section-dark .phase-table .row-highlight td { background: rgba(59,130,246,0.10); color: #f8fafc; }

/* ─── Defensas globales contra overflow horizontal ──────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  max-width: 100%;
  overflow-x: clip; /* clip es más estable que hidden con position: sticky */
}
body {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
img, svg, video, canvas, iframe, table { max-width: 100%; }
/* Cualquier contenedor que haga scroll horizontal interno NO debe expandir su padre */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

/* Diagrama de arquitectura: contenedor */
.arch-figure { max-width: 100%; }
.arch-figure svg { width: 100%; height: auto; max-width: 100%; display: block; }

.section-head .eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--slate);
  margin-bottom: 0.75rem;
}
.h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  line-height: 1.15;
  color: var(--ink);
  margin-top: 0;
}
.lede { @apply mt-3 text-base md:text-lg text-slate2 max-w-3xl leading-relaxed; }

/* ─── Header navlinks ────────────────────────────────────────────────────── */
.nav-link {
  position: relative;
  color: var(--slate);
  transition: color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link:hover { color: var(--ink); }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--grad-brand-h);
  border-radius: 2px;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link[aria-current='true']::after { width: 100%; }
.nav-link[aria-current='true'] { color: var(--ink); font-weight: 600; }

#site-header { transition: backdrop-filter 220ms, background-color 220ms, box-shadow 220ms; }
#site-header.is-scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow: 0 1px 0 rgba(15,23,42,0.06), 0 8px 24px -16px rgba(15,23,42,0.12);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
#top { position: relative; isolation: isolate; }
#top::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 18%, rgba(59,130,246,0.18), transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(139,92,246,0.16), transparent 55%),
    radial-gradient(circle at 60% 0%,  rgba(236,72,153,0.10), transparent 60%);
  z-index: -2;
  pointer-events: none;
}
#top::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(to right,  rgba(15,23,42,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,23,42,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, black 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, black 0%, transparent 75%);
  z-index: -1;
  pointer-events: none;
}
/* Mantener compatibilidad con clases anteriores aunque ahora sean opcionales */
.hero-gradient, .hero-grid { display: none; }

/* Blobs flotantes */
.hero-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(64px);
  opacity: 0.45;
  z-index: -1;
  pointer-events: none;
  animation: blobDrift 18s ease-in-out infinite alternate;
}
.hero-blob.b1 { top: 6%;  left: 8%;   width: 22rem; height: 22rem; background: radial-gradient(circle, #3b82f6, transparent 60%); }
.hero-blob.b2 { top: 30%; right: -4%; width: 26rem; height: 26rem; background: radial-gradient(circle, #8b5cf6, transparent 60%); animation-delay: -6s; }
.hero-blob.b3 { bottom: 8%; left: 35%; width: 18rem; height: 18rem; background: radial-gradient(circle, #ec4899, transparent 60%); opacity: 0.30; animation-delay: -12s; }

@keyframes blobDrift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(20px, -16px) scale(1.06); }
  100% { transform: translate(-12px, 24px) scale(0.96); }
}

/* Badge institucional sobre el hero */
.org-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.85rem 0.4rem 0.5rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 9999px;
  font-size: 12.5px;
  color: var(--graphite);
  box-shadow: var(--shadow-sm);
}
.org-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.18);
  flex-shrink: 0;
}

/* Texto con gradiente para el título / acentos */
.gradient-text {
  background: var(--grad-brand-h);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Pills de feature en hero (chips con icono coloreado) */
.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 9999px;
  font-size: 13px;
  line-height: 1;
  color: var(--graphite);
  box-shadow: var(--shadow-xs);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.feature-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--primary-300); }
.feature-pill svg {
  width: 14px; height: 14px;
  color: var(--primary-600);
  flex-shrink: 0;
  display: inline-block;
}

/* Blindaje global de SVGs inline para que nunca se rendericen enormes */
.cta-primary svg, .cta-secondary svg { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; }
.scroll-indicator svg { width: 16px; height: 16px; display: inline-block; }
button svg, a svg { display: inline-block; }
svg:not([width]):not([height]) { max-width: 100%; }

.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--graphite);
  box-shadow: var(--shadow-xs);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.model-badge:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.model-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.model-badge.openai     { border-color: rgba(71, 85, 105, 0.4); color: var(--openai); }
.model-badge.openai::before     { background: var(--openai); box-shadow: 0 0 0 3px rgba(71,85,105,0.18); }
.model-badge.gemini     { border-color: rgba(79, 70, 229, 0.4); color: var(--gemini); }
.model-badge.gemini::before     { background: var(--gemini); box-shadow: 0 0 0 3px rgba(79,70,229,0.18); }
.model-badge.claude     { border-color: rgba(5, 150, 105, 0.4); color: var(--claude); }
.model-badge.claude::before     { background: var(--claude); box-shadow: 0 0 0 3px rgba(5,150,105,0.18); }
.model-badge.moderator  { border-color: rgba(217, 119, 6, 0.5);  color: var(--moderator); background: rgba(255, 247, 237, 0.7); }
.model-badge.moderator::before  { background: var(--moderator); box-shadow: 0 0 0 3px rgba(217,119,6,0.22); }

.hero-stat {
  position: relative;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-xs);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 220ms, border-color 220ms;
  overflow: hidden;
}
.hero-stat::before {
  content: '';
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 3px;
  background: var(--grad-brand-h);
  opacity: 0;
  transition: opacity 220ms;
}
.hero-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-300); }
.hero-stat:hover::before { opacity: 1; }
.hero-stat .num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(2.1rem, 3.5vw, 2.95rem);
  line-height: 1;
  background: var(--grad-brand-h);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.hero-stat .label {
  margin-top: 0.6rem;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.hero-stat .hint { margin-top: 0.5rem; font-size: 12px; color: var(--graphite); line-height: 1.45; }

/* ─── CTAs ────────────────────────────────────────────────────────────────── */
.cta-primary, .cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.cta-primary {
  background: var(--grad-brand-h);
  color: white;
  box-shadow: var(--shadow-blue);
  border: 1px solid rgba(255,255,255,0.18);
}
.cta-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-violet), var(--shadow-md); }
.cta-primary svg { transition: transform 220ms; }
.cta-primary:hover svg { transform: translateX(3px); }

.cta-secondary {
  border: 1px solid var(--border);
  color: var(--graphite);
  background: white;
  box-shadow: var(--shadow-xs);
}
.cta-secondary:hover { border-color: var(--primary-500); color: var(--primary-700); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* ─── Cards genéricas ────────────────────────────────────────────────────── */
.role-card, .stack-card {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 240ms, border-color 240ms;
  border-left-width: 4px;
  overflow: hidden;
}
.role-card::after, .stack-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(59,130,246,0.05), transparent 50%);
  opacity: 0;
  transition: opacity 280ms;
  pointer-events: none;
}
.role-card:hover, .stack-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
}
.role-card:hover::after, .stack-card:hover::after { opacity: 1; }

.border-l-voice-openai     { border-left-color: var(--openai); }
.border-l-voice-gemini     { border-left-color: var(--gemini); }
.border-l-voice-claude     { border-left-color: var(--claude); }
.border-l-voice-moderator  { border-left-color: var(--moderator); }

.role-card .role-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
}
.role-card .role-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.1;
  margin: 0.4rem 0 0.5rem;
}
.role-card p { color: var(--graphite); font-size: 0.95rem; line-height: 1.55; }
.role-card code.code-pill {
  background: var(--mist);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--graphite);
}

.stack-card .stack-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
}
.stack-card .stack-value { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.35rem; line-height: 1.1; margin: 0.3rem 0 0.4rem; }
.stack-card .stack-detail { color: var(--graphite); font-size: 0.85rem; line-height: 1.5; }
.stack-card { border-left-color: transparent; }

/* ─── Fases ──────────────────────────────────────────────────────────────── */
.phase-card {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.2rem 1.35rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 240ms, box-shadow 240ms, border-color 240ms;
  overflow: hidden;
}
.phase-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand-h);
  opacity: 0;
  transition: opacity 220ms;
}
.phase-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-300); }
.phase-card:hover::before { opacity: 1; }
.phase-card .phase-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: transparent;
  background: var(--grad-brand-h);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}
.phase-card .phase-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.15;
  color: var(--ink);
}
.phase-card .phase-q { color: var(--graphite); font-size: 0.85rem; line-height: 1.5; }

.phase-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.phase-table thead th {
  text-align: left;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: white;
}
.phase-table tbody td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  background: white;
}
.phase-table tbody tr:hover td { background: var(--mist); }
.phase-table .row-highlight td { background: rgba(236, 253, 245, 0.5); }
.phase-table tbody td:first-child { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--moderator); width: 4ch; }

/* ─── Reglas / pills ─────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: baseline;
}
.pill-hecho        { color: var(--tag-hecho);        background: #ecfdf5; border-color: #a7f3d0; }
.pill-tendencia    { color: var(--tag-tendencia);    background: #ecfeff; border-color: #a5f3fc; }
.pill-inferencia   { color: var(--tag-inferencia);   background: #f5f3ff; border-color: #ddd6fe; }
.pill-especulacion { color: var(--tag-especulacion); background: #fef2f2; border-color: #fecaca; }
.pill-no_se        { color: var(--tag-no_se);        background: #f3f4f6; border-color: #d1d5db; }
.pill-mod-verif    { color: var(--verificado);       background: #ecfdf5; border-color: #6ee7b7; }
.pill-mod-disp     { color: var(--disputado);        background: #fef2f2; border-color: #fca5a5; }
.pill-mod-na       { color: var(--sin_verificar);    background: #f3f4f6; border-color: #d1d5db; }
.pill-corpus       { color: var(--corpus_gt);        background: #fff7ed; border-color: #fed7aa; }

.rule-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  color: var(--graphite);
}

/* ─── Timeline trazabilidad ──────────────────────────────────────────────── */
.timeline {
  position: relative;
  margin: 0;
  padding-left: 2rem;
  list-style: none;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border) 10%, var(--border) 90%, transparent);
}
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--slate);
}
.timeline-item.active .timeline-dot { border-color: var(--claude); background: var(--claude); }
.timeline-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-xs);
}
.timeline-card.timeline-card-active {
  border-color: var(--claude);
  background: linear-gradient(135deg, white 0%, #ecfdf5 100%);
  box-shadow: var(--shadow-sm);
}
.timeline-meta { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.12em; color: var(--slate); }
.timeline-title { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.4rem; line-height: 1.15; margin: 0.3rem 0 0.5rem; color: var(--ink); }
.timeline-card p { color: var(--graphite); font-size: 0.95rem; line-height: 1.55; }
.timeline-limit { margin-top: 0.5rem; font-size: 0.85rem; color: var(--slate); }
.timeline-limit strong { color: var(--ink); }

/* ─── KPIs ───────────────────────────────────────────────────────────────── */
.kpi-card {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.5rem 1.4rem;
  box-shadow: var(--shadow-xs);
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 240ms, border-color 240ms;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
  isolation: isolate;
}
.kpi-card::before {
  content: '';
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 3px;
  background: var(--grad-brand-h);
  opacity: 0;
  transition: opacity 220ms;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 100%, rgba(124,58,237,0.06), transparent 55%);
  opacity: 0;
  transition: opacity 280ms;
  pointer-events: none;
  z-index: -1;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-300); }
.kpi-card:hover::before, .kpi-card:hover::after { opacity: 1; }

.kpi-card .kpi-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate);
}
.kpi-card .kpi-num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(2.4rem, 4.4vw, 3.2rem);
  line-height: 1;
  background: var(--grad-brand-h);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}
.kpi-card .kpi-num .kpi-unit {
  font-size: 0.5em;
  color: var(--slate);
  margin-left: 0.2em;
  -webkit-text-fill-color: var(--slate);
  background: none;
}
.kpi-card .kpi-hint { font-size: 0.83rem; color: var(--graphite); line-height: 1.5; }

/* ─── Resultados ─────────────────────────────────────────────────────────── */
.pred-card {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 240ms, box-shadow 240ms, border-color 240ms;
  overflow: hidden;
}
.pred-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #10b981 0%, #06b6d4 100%);
}
.pred-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-300); }
.pred-card .pred-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.pred-card .pred-code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--moderator); letter-spacing: 0.12em; }
.pred-card .pred-title { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.25rem; line-height: 1.2; color: var(--ink); }
.pred-card .pred-body { font-size: 0.92rem; line-height: 1.6; color: var(--graphite); }
.pred-card .pred-tagline { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 11px; font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--slate); }
.pred-card .pred-tagline span.kv { background: var(--mist); padding: 0.1rem 0.5rem; border-radius: var(--radius-pill); }

.diss-card, .agenda-card, .rec-card {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.3rem 1.45rem;
  box-shadow: var(--shadow-xs);
  transition: transform 240ms, box-shadow 240ms, border-color 240ms;
  overflow: hidden;
}
.diss-card:hover, .agenda-card:hover, .rec-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-300);
}
.diss-card::before, .agenda-card::before, .rec-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.diss-card::before   { background: linear-gradient(180deg, #ef4444 0%, #ec4899 100%); }
.agenda-card::before { background: linear-gradient(180deg, #f59e0b 0%, #ef4444 100%); }
.rec-card::before    { background: var(--grad-brand); }
.diss-card .diss-code, .agenda-card .ag-code, .rec-card .rec-aud {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
}
.diss-card .diss-code { color: var(--tag-especulacion); }
.agenda-card .ag-code { color: var(--moderator); }
.rec-card .rec-aud { color: var(--claude); }

.diss-card .diss-title, .agenda-card .ag-title, .rec-card .rec-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.2;
  margin: 0.3rem 0 0.4rem;
  color: var(--ink);
}
.diss-card .diss-body, .agenda-card .ag-body, .rec-card .rec-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--graphite);
}

/* ─── Charts ─────────────────────────────────────────────────────────────── */
.chart-card {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-xs);
  transition: transform 240ms, box-shadow 240ms, border-color 240ms;
  overflow: hidden;
}
.chart-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-300); }
.chart-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.chart-wrap {
  position: relative;
  height: 280px;
}
@media (min-width: 1024px) {
  .chart-wrap { height: 300px; }
}

/* ─── Conversación ───────────────────────────────────────────────────────── */
.conv-filters {
  position: sticky;
  top: 64px; /* alto del header */
  z-index: 30;
  background: rgba(247, 248, 250, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0.8rem 1rem;
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.4rem;
  align-items: center;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.filter-search { flex: 1; min-width: 240px; gap: 0.6rem; }
.filter-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
  margin-right: 0.2rem;
}
.chip {
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: white;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--graphite);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip.chip-on { background: var(--ink); color: white; border-color: var(--ink); }
.chip.chip-openai.chip-on    { background: var(--openai); border-color: var(--openai); }
.chip.chip-gemini.chip-on    { background: var(--gemini); border-color: var(--gemini); }
.chip.chip-claude.chip-on    { background: var(--claude); border-color: var(--claude); }
.chip.chip-moderator.chip-on { background: var(--moderator); border-color: var(--moderator); }
.chip.chip-tag-hecho.chip-on        { background: var(--tag-hecho);        border-color: var(--tag-hecho);        color: white; }
.chip.chip-tag-tendencia.chip-on    { background: var(--tag-tendencia);    border-color: var(--tag-tendencia);    color: white; }
.chip.chip-tag-inferencia.chip-on   { background: var(--tag-inferencia);   border-color: var(--tag-inferencia);   color: white; }
.chip.chip-tag-especulacion.chip-on { background: var(--tag-especulacion); border-color: var(--tag-especulacion); color: white; }
.chip.chip-tag-no_se.chip-on        { background: var(--tag-no_se);        border-color: var(--tag-no_se);        color: white; }

.phase-select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: white;
  font-size: 0.85rem;
  color: var(--ink);
}
.search-input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: white;
  font-size: 0.9rem;
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.search-input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}
.filter-status { font-size: 11px; color: var(--slate); font-family: 'JetBrains Mono', ui-monospace, monospace; min-width: 8ch; text-align: right; }

/* Anclas de fase */
.phase-anchor {
  margin: 2rem 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--moderator);
  background: linear-gradient(90deg, rgba(255, 247, 237, 0.7), transparent);
  border-radius: 8px;
}
.phase-anchor .pn { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.14em; color: var(--moderator); }
.phase-anchor .pt { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.4rem; line-height: 1.15; color: var(--ink); }

/* Burbujas de turno */
.turn-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-xs);
  border-left-width: 4px;
}
.turn-card.voice-OPENAI    { border-left-color: var(--openai); }
.turn-card.voice-GEMINI    { border-left-color: var(--gemini); }
.turn-card.voice-CLAUDE    { border-left-color: var(--claude); }
.turn-card.voice-MODERATOR {
  background: rgba(255, 247, 237, 0.45);
  border-color: rgba(217, 119, 6, 0.3);
  border-left-color: var(--moderator);
}
.turn-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--slate);
  letter-spacing: 0.06em;
  margin-bottom: 0.7rem;
}
.turn-head .turn-id { color: var(--ink); font-weight: 600; }
.turn-head .turn-voice { font-weight: 600; padding: 0.06rem 0.45rem; border-radius: var(--radius-pill); border: 1px solid currentColor; }
.turn-head .turn-voice.OPENAI    { color: var(--openai); }
.turn-head .turn-voice.GEMINI    { color: var(--gemini); }
.turn-head .turn-voice.CLAUDE    { color: var(--claude); }
.turn-head .turn-voice.MODERATOR { color: var(--moderator); }
.turn-head .turn-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-left: auto; }
.turn-head .turn-words { color: var(--slate); }

.turn-body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--graphite);
}
.turn-body p { margin: 0.6rem 0; }
.turn-body p:first-child { margin-top: 0; }
.turn-body p:last-child  { margin-bottom: 0; }
.turn-body ul, .turn-body ol { margin: 0.6rem 0; padding-left: 1.4rem; }
.turn-body ul li { list-style: disc; }
.turn-body ol li { list-style: decimal; }
.turn-body strong { color: var(--ink); }
.turn-body code {
  background: var(--mist);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--graphite);
  word-break: break-word;
}
.turn-body table { width: 100%; border-collapse: collapse; margin: 0.8rem 0; font-size: 0.85em; }
.turn-body th, .turn-body td { border: 1px solid var(--border); padding: 0.4rem 0.5rem; text-align: left; vertical-align: top; }
.turn-body th { background: var(--mist); font-family: 'Manrope', sans-serif; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); }
.turn-body blockquote {
  border-left: 3px solid var(--border);
  margin: 0.8rem 0;
  padding: 0.2rem 0.9rem;
  color: var(--slate);
  font-style: italic;
}
.turn-body h1, .turn-body h2, .turn-body h3, .turn-body h4 {
  font-family: 'Instrument Serif', Georgia, serif;
  color: var(--ink);
  line-height: 1.2;
  margin: 1.1rem 0 0.5rem;
}
.turn-body h1 { font-size: 1.4rem; }
.turn-body h2 { font-size: 1.25rem; }
.turn-body h3 { font-size: 1.1rem; }
.turn-body h4 { font-size: 1rem; }
.turn-body hr { margin: 1.2rem 0; border: 0; border-top: 1px solid var(--border); }

/* Inline pills epistémicas (transformadas por JS) */
.turn-body .pill { vertical-align: middle; margin: 0 0.05rem; }

.turn-fc {
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--border);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--slate);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.turn-fc .fc-label { font-family: 'Manrope', sans-serif; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--slate); margin-right: 0.4rem; }
.turn-fc .fc-pill {
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  white-space: nowrap;
}
.turn-fc .fc-pill.verified   { color: var(--verificado);    background: rgba(236, 253, 245, 0.6); }
.turn-fc .fc-pill.disputed   { color: var(--disputado);     background: rgba(254, 242, 242, 0.6); }
.turn-fc .fc-pill.unverified { color: var(--sin_verificar); background: rgba(243, 244, 246, 0.6); }

/* Hidden bodies (lazy mount) */
.turn-card.is-hidden { display: none; }
.turn-card.is-collapsed .turn-body { display: none; }

/* Highlight de búsqueda */
mark.search-hit { background: rgba(217, 119, 6, 0.18); color: var(--ink); padding: 0 0.1rem; border-radius: 2px; }

/* ─── Listas y prosa ─────────────────────────────────────────────────────── */
.prose-cijt { color: var(--graphite); font-size: 1rem; line-height: 1.7; }
.prose-cijt p { margin: 0.8rem 0; }
.prose-cijt strong { color: var(--ink); }
.prose-cijt code { background: var(--mist); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.85em; font-family: 'JetBrains Mono', ui-monospace, monospace; }

.list-emerald, .list-amber, .list-ordered { margin-top: 0.5rem; padding-left: 0; list-style: none; }
.list-emerald li, .list-amber li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.6rem;
}
.list-emerald li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; border-radius: 50%; background: var(--claude); }
.list-amber   li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; border-radius: 50%; background: var(--moderator); }
.list-ordered { counter-reset: ord; }
.list-ordered li {
  counter-increment: ord;
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 0.6rem;
}
.list-ordered li::before {
  content: counter(ord, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85em;
  color: var(--moderator);
  letter-spacing: 0.06em;
}

/* ─── Cierre meta ────────────────────────────────────────────────────────── */
.closing-question {
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--moderator);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--graphite);
}
.closing-question .closing-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moderator);
  margin-bottom: 0.6rem;
}
.closing-question p { margin-bottom: 0.7rem; }
.closing-question p:last-child { margin-bottom: 0; }
.closing-question strong { color: var(--ink); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer { padding: 4rem 0 3rem; border-top: 1px solid var(--border); background: white; }
.footer-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate);
}
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; transition: text-decoration-color 200ms; }
.link:hover { text-decoration-color: var(--ink); }

/* ─── Fade-in al entrar a viewport ───────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1), transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Stagger: cuando aparezca un grupo, sus hijos entran escalonados */
.stagger > .fade-up.visible { transition-delay: calc(var(--i, 0) * 70ms); }

/* Scale-in para cards más prominentes */
.scale-in {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1), transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
}
.scale-in.visible { opacity: 1; transform: scale(1); }

/* Indicador de scroll en el hero */
.scroll-indicator {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--slate);
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  animation: floatY 2.4s ease-in-out infinite;
  pointer-events: none;
}
.scroll-indicator svg { color: var(--primary-600); }
@keyframes floatY {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* Pulse suave para el dot de "en desarrollo" */
@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,6,0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(217,119,6,0); }
}
.dev-dot { animation: softPulse 2.2s ease-out infinite; }

/* ─── Banner desarrollo ──────────────────────────────────────────────────── */
.dev-banner {
  background: #fff7ed;
  border-bottom: 1px solid rgba(217, 119, 6, 0.25);
  color: var(--graphite);
  position: relative;
  z-index: 40;
}
.dev-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--moderator);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.18);
  display: inline-block;
  margin-right: 0.2rem;
  flex-shrink: 0;
}

/* ─── Links suaves en hero ───────────────────────────────────────────────── */
.link-soft {
  color: var(--ink);
  border-bottom: 1px solid rgba(217, 119, 6, 0.5);
  transition: border-color 200ms;
}
.link-soft:hover { border-bottom-color: var(--ink); }

/* ─── Mobile fixes ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hero más cómodo en pantallas pequeñas */
  #top { padding-top: 1.75rem; padding-bottom: 1.75rem; }
  #top .hero-grid { background-size: 40px 40px; }

  /* SVG arquitectura: escala completa, sin scroll horizontal */
  .arch-figure { padding: 0.9rem; overflow: hidden; }

  /* Tablas: el wrapper ya hace scroll, hacemos la tipografía compacta */
  .phase-table { font-size: 0.82rem; }
  .phase-table thead th, .phase-table tbody td { padding: 0.55rem 0.6rem; }
  .phase-table thead th { white-space: nowrap; }

  /* Tarjetas más compactas */
  .role-card, .stack-card, .kpi-card,
  .pred-card, .diss-card, .agenda-card, .rec-card,
  .turn-card, .timeline-card, .chart-card, .closing-question {
    padding: 0.95rem 1rem;
  }
  .hero-stat { padding: 0.85rem 0.95rem; }

  /* Charts: menos altos en móvil */
  .chart-wrap { height: 230px; }
  .chart-card { padding: 0.85rem 0.9rem; }

  /* Conversación: cabecera de turno más legible */
  .turn-head { font-size: 10px; gap: 0.35rem 0.65rem; }
  .turn-head .turn-tags { width: 100%; margin-left: 0; }
  .turn-body { font-size: 0.92rem; }

  /* Filtros sticky: respiración + scroll horizontal interno por grupo si hace falta */
  .conv-filters {
    top: 56px;
    padding: 0.6rem 0.7rem;
    gap: 0.5rem 0.9rem;
    border-radius: 12px;
  }
  .filter-group { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.15rem; }
  .filter-group::-webkit-scrollbar { display: none; }
  .filter-search { order: 99; flex-wrap: wrap; }
  .filter-search .search-input { font-size: 16px; /* iOS no hace zoom si >=16px */ width: 100%; }
  .filter-status { width: 100%; text-align: left; min-width: 0; }

  /* Footer más compacto */
  .footer { padding: 2.75rem 0 2rem; }
  .footer .grid { gap: 2rem; }

  /* Inputs y selects nunca menores a 16px en iOS */
  input, select, textarea { font-size: 16px !important; }
}

@media (max-width: 480px) {
  .h2 { font-size: clamp(1.65rem, 7vw, 2.2rem); line-height: 1.1; letter-spacing: -0.01em; }
  .h3 { font-size: clamp(1.15rem, 5.5vw, 1.45rem); }
  .lede { font-size: 0.92rem; }
  .section-head .eyebrow { font-size: 10px; letter-spacing: 0.24em; }
  .section { padding-top: 3rem; padding-bottom: 3rem; }

  /* Hero título: que no estire el ancho en pantallas estrechas */
  #top h1 { font-size: clamp(2.1rem, 9vw, 3.6rem) !important; line-height: 1.05; }

  .hero-stat .num { font-size: 1.7rem; }
  .hero-stat .label { font-size: 9px; letter-spacing: 0.14em; }
  .hero-stat .hint { font-size: 10.5px; line-height: 1.35; }

  .kpi-card .kpi-num { font-size: 1.75rem; }

  .timeline { padding-left: 1.55rem; }
  .timeline-dot { left: -22px; width: 14px; height: 14px; }
  .timeline::before { left: 6px; }

  .nav-link::after { bottom: -14px; }

  /* Padding del banner desarrollo */
  .dev-banner .container { padding-top: 0.45rem; padding-bottom: 0.45rem; }

  /* Tarjetas con padding aún más compacto */
  .role-card, .stack-card, .kpi-card,
  .pred-card, .diss-card, .agenda-card, .rec-card,
  .turn-card, .timeline-card, .chart-card { padding: 0.85rem 0.9rem; }

  /* Hero badges: ancho cómodo */
  .model-badge { font-size: 10.5px; padding: 0.25rem 0.6rem; }

  /* Reducir ancho del menú móvil para que no se desborde */
  #nav-mobile { padding: 0.5rem 0.25rem; }
}

/* iOS-only: input zoom fix más agresivo (Safari móvil) */
@supports (-webkit-touch-callout: none) {
  input[type="search"], input[type="text"], input[type="email"], select, textarea {
    font-size: 16px;
  }
}
