.hero-h1.hero-title--large {
  font-size: 2.2rem !important;
}
/* ─── TOKENS ──────────────────────────────────────── */
:root {
  --white: #FFFFFF;
  --bg: #F4F7FF;
  --blue-deep: #001AFF;
  --blue-elec: #0066FF;
  --blue-mid: #2B8BFF;
  --blue-light: #B8D4FF;
  --blue-pale: #E8F1FF;
  --teal: #00C8B4;
  --danger: #FF3B3B;
  --warning: #FF9A3B;
  --text-primary: #0A0E24;
  --text-secondary: #4A5568;
  --text-muted: #94A3B8;
  --border: #E2EAFF;
  --shadow-sm: 0 1px 3px rgba(0,102,255,.08);
  --shadow-md: 0 4px 20px rgba(0,102,255,.12);
  --shadow-lg: 0 12px 48px rgba(0,26,255,.15);
  --radius: 16px;
  --radius-sm: 10px;
  --font-main: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-display: 'Space Grotesk', 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ─── RESET & BASE ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── LAYOUT ─────────────────────────────────────── */
.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.legend .scrollbox {
  clip-path: none !important;
}

/* ─── TOPBAR ─────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-elec);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo .dot {
  width: 8px; height: 8px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity:1; }
  50% { transform: scale(1.4); opacity:.7; }
}

.topbar-nav {
  display: flex;
  gap: 4px;
}

.topbar-nav a {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all .2s;
}

.topbar-nav a:hover, .topbar-nav a.active {
  background: var(--blue-pale);
  color: var(--blue-elec);
}

.topbar-badge {
  background: var(--blue-elec);
  color: white;
  font-size: .72rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: .3px;
}

/* Contenedor principal de los 3 datos */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px; /* Espacio entre cada bloque de datos */
  flex-wrap: wrap;
  margin-top: 40px; /* Separación con el párrafo anterior */
}

/* Cada bloque individual */
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Estilo del número grande */
.hero-stat .num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
  margin-bottom: 4px;
}

/* Estilo del texto descriptivo pequeño */
.hero-stat .label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  max-width: 180px; /* Evita que el texto se alargue demasiado */
  line-height: 1.4;
}

/* ─── HERO ───────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #001AFF 0%, #0066FF 40%, #00C8B4 100%);
  padding: 80px 32px 90px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: white;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  color: white;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 24px;
}

.hero-title--large {
  font-size: 2.2rem;
}

.hero-h1 em {
  font-style: normal;
  color: rgba(255,255,255,.7);
}

.hero-sub {
  color: rgba(255,255,255,.8);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: white;
  display: block;
}

.hero-stat .label {
  font-size: .78rem;
  color: rgba(255,255,255,.65);
  letter-spacing: .5px;
}

/* ─── SECTIONS ───────────────────────────────────── */
.section {
  padding: 0;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue-elec);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.section-desc {
  color: var(--text-secondary);
  font-size: .92rem;
  max-width: 600px;
  margin-top: 8px;
  line-height: 1.65;
}

/* ─── CARDS ──────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-title {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1px;
}

.card-unit {
  font-size: .85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.card-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  font-weight: 600;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 20px;
}

.card-trend.up { background: #FFF0F0; color: var(--danger); }
.card-trend.down { background: #F0FFF8; color: #00A86B; }

.card-accent {
  border-top: 3px solid var(--blue-elec);
}

.card-blue {
  background: linear-gradient(135deg, var(--blue-elec), var(--blue-deep));
  color: white;
  border: none;
}

.card-blue .card-title { color: rgba(255,255,255,.7); }
.card-blue .card-value { color: white; }
.card-blue .card-unit { color: rgba(255,255,255,.65); }

/* ─── KPI ROW ────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* ─── DUAL PANEL ─────────────────────────────────── */
.dual-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .dual-panel { grid-template-columns: 1fr; }
}

/* ─── INPUT PANEL ────────────────────────────────── */
.input-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.input-panel h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-panel h3::before {
  content: '';
  width: 4px; height: 18px;
  background: var(--blue-elec);
  border-radius: 2px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-group label span {
  color: var(--blue-elec);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--blue-pale);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  background: var(--blue-elec);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0,102,255,.4);
  cursor: pointer;
  transition: transform .15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.debt-total {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-elec));
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  margin-top: 20px;
}

.debt-total .label {
  font-size: .75rem;
  color: rgba(255,255,255,.7);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.debt-total .value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  letter-spacing: -1px;
}

.debt-total .unit {
  font-size: .78rem;
  color: rgba(255,255,255,.65);
}

/* ─── GRAPH CONTAINER ────────────────────────────── */
.graph-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.graph-container svg {
  width: 100%;
  height: 100%;
}

/* ─── SECTION ALTERNATING BG ─────────────────────── */
.section-alt { background: var(--white); }
.section-dark {
  background: linear-gradient(180deg, #001022 0%, #002060 100%);
  color: white;
}

.section-dark .section-title { color: white; }
.section-dark .section-label { color: var(--blue-light); }
.section-dark .section-desc { color: rgba(255,255,255,.65); }
.section-dark .card {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
}
.section-dark .card-title { color: rgba(255,255,255,.55); }
.section-dark .card-value { color: white; }
.section-dark .card-unit { color: rgba(255,255,255,.55); }
.section-dark .input-panel {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
}
.section-dark .input-panel h3 { color: white; }
.section-dark .input-group label { color: rgba(255,255,255,.7); }
.section-dark .graph-container {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.1);
}

/* ─── GAUGE ──────────────────────────────────────── */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gauge-label {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}

.gauge-sub { font-size: .85rem; color: var(--text-secondary); text-align: center; }

/* ─── BAR CHART ──────────────────────────────────── */
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: .82rem;
}

.bar-label { width: 140px; color: var(--text-secondary); flex-shrink: 0; text-align: right; }
.bar-track { flex: 1; background: var(--blue-pale); border-radius: 4px; height: 10px; }
.bar-fill { height: 10px; border-radius: 4px; background: var(--blue-elec); transition: width .6s ease; }
.bar-fill.teal { background: var(--teal); }
.bar-fill.danger { background: var(--danger); }
.bar-val { width: 60px; font-weight: 700; color: var(--text-primary); }

/* ─── ZIP INPUT ──────────────────────────────────── */
.zip-input-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.zip-input {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  width: 180px;
  outline: none;
  text-align: center;
  letter-spacing: 4px;
  transition: border-color .2s;
}

.zip-input:focus { border-color: var(--blue-elec); box-shadow: 0 0 0 3px var(--blue-pale); }

.zip-btn {
  background: var(--blue-elec);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s;
}

.zip-btn:hover { background: var(--blue-deep); transform: translateY(-1px); }

/* ─── CALLOUT QUOTE ──────────────────────────────── */
.quote-block {
  border-left: 4px solid var(--blue-elec);
  padding: 16px 24px;
  background: var(--blue-pale);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
  margin: 24px 0;
  font-size: .95rem;
  line-height: 1.7;
}

.quote-block strong { color: var(--blue-elec); font-style: normal; }

/* ─── RESOLUTION GRID ────────────────────────────── */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.solution-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s;
}

.solution-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.solution-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.solution-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.solution-card p {
  font-size: .85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── FOOTER ─────────────────────────────────────── */
.footer {
  background: var(--text-primary);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 32px;
  font-size: .82rem;
}

.footer strong { color: white; }

/* ─── OJS OVERRIDES ──────────────────────────────── */
.observablehq { font-family: var(--font-main) !important; }
.observablehq--inspect { display: none !important; }
.quarto-layout-panel { padding: 0 !important; }

/* ─── DIVIDER ────────────────────────────────────── */
.section-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 32px;
}

.hero-emphasis {
  color: rgba(255,255,255,.7);
  font-style: italic;
}

.card-spacious {
  margin-top: 20px;
  padding: 28px;
}

.card-title--large {
  margin-bottom: 16px;
  text-transform: none;
  font-size: 1.1rem;
}

.card-title--primary {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.card-title--compact {
  margin-bottom: 8px;
  text-transform: none;
  font-size: 1rem;
}

.card-title--dark {
  color: rgba(15, 5, 5, 0.82);
  margin-bottom: 16px;
  text-transform: none;
}

.card-value--danger {
  color: var(--danger);
}

.card-value--primary {
  color: var(--blue-elec);
}

.dual-panel--spaced {
  margin-top: 20px;
}

.callout-box {
  background: var(--blue-elec);
  border-radius: 10px;
  padding: 16px;
  color: white;
  text-align: center;
  margin-top: 20px;
}

.callout-label {
  font-size: 0.8rem;
  text-transform: uppercase;
}

.callout-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.grid-auto-320 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.grid-auto-220 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.text-note {
  font-size: .85rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 16px;
  line-height: 1.6;
}

.text-note--muted {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 0;
}

.section-dia-cero {
  padding-top: 72px;
  padding-bottom: 72px;
}

.resolution-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}

.section-label--center {
  text-align: center;
  display: block;
}

.section-title--center {
  text-align: center;
  margin-bottom: 16px;
}

.resolution-copy {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: .95rem;
  display: block;
}

.quote-block--left {
  text-align: left;
  margin-top: 24px;
}

.solution-card--featured {
  background: linear-gradient(135deg,#0066FF,#001AFF);
  border: none;
}

.featured-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.featured-text {
  color: rgba(255,255,255,.8);
}

.outro-box {
  text-align: center;
  margin-top: 48px;
  padding: 40px;
  background: var(--blue-pale);
  border-radius: var(--radius);
}

.outro-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue-elec);
  margin-bottom: 12px;
}

.outro-copy {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
  display: block;
}

.badge-row {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stat .num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: white;
  display: block;
}

.hero-stat .label {
  font-size: .78rem;
  color: rgba(255,255,255,.65);
  letter-spacing: .5px;
}

/* ─── BADGE ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--blue-pale);
  color: var(--blue-elec);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ─── SCROLL REVEAL ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 40px 20px; }
  .hero { padding: 60px 20px 70px; }
  .hero-stats { gap: 24px; }
  .topbar { padding: 0 20px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── OCULTAR BOTÓN DE EXPANDIR EN CARDS ─────────────── */
.card-expand-btn,
.expand-btn,
[class*="expand"],
.observablehq-fullscreen-button,
figure .expand,
.quarto-figure .expand,
button[title="Expand"],
button[aria-label="Expand"] {
  display: none !important;
}

/* Ocultar botón expand de Quarto OJS/Observable */
.observablehq--expanded-button,
.quarto-layout-panel button,
.cell-output-display .expand,
figure > button {
  display: none !important;
}