:root {
  color-scheme: only light;
  --page: #f5f5f7;
  --surface: #fff;
  --ink: #1d1d1f;
  --secondary: #606067;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --line: #dedee3;
  --header-height: 76px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 180px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: wait; }
button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
button:focus-visible, a:focus-visible, main:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
a { color: var(--blue); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1420px; margin-inline: auto; padding-inline: clamp(24px, 3vw, 48px); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 20px;
  z-index: 10;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  transform: translateY(-150%);
  text-decoration: none;
}
.skip-link:focus { transform: none; }

/* La marca permanece visible mientras se consulta cualquiera de las vistas. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(250, 250, 252, .88);
  border-bottom: 1px solid rgba(29, 29, 31, .08);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
}
.topbar-inner {
  max-width: 1420px;
  height: var(--header-height);
  margin: auto;
  padding-inline: clamp(24px, 3vw, 48px);
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand img { width: 44px; height: 44px; object-fit: cover; border-radius: 13px; flex-shrink: 0; }
.brand > span { min-width: 0; }
.brand strong { display: block; font-size: 14px; line-height: 1.3; font-weight: 650; letter-spacing: .055em; }
.brand small { display: block; margin-top: 4px; color: var(--secondary); font-size: 10px; line-height: 1.45; letter-spacing: .07em; }
.location { display: flex; align-items: center; gap: 9px; color: var(--secondary); font-size: 12px; white-space: nowrap; }
.status-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
.location-divider { color: #b1b1b8; margin-inline: 5px; }
.route-year { color: var(--ink); }
.print-button {
  min-height: 44px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  border: 1px solid #d6d6dc;
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  color: #48484d;
  font-size: 12px;
  font-weight: 500;
  transition: background .2s, border-color .2s, color .2s;
}
.print-button:hover { background: #fff; border-color: #b8b8c0; color: var(--ink); }

/* Una introducción breve deja espacio a la información y los controles. */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 48px; padding-block: 58px 50px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 15px; color: var(--blue); font-size: 11px; line-height: 1.5; font-weight: 600; letter-spacing: .11em; }
.eyebrow > span { width: 18px; height: 1px; background: currentColor; }
h1 { margin: 0; font-size: clamp(44px, 5vw, 68px); line-height: 1.04; font-weight: 650; letter-spacing: -.055em; }
.title-period { color: var(--blue); }
.hero-description { margin: 15px 0 0; color: var(--secondary); font-size: clamp(17px, 1.7vw, 21px); line-height: 1.45; letter-spacing: -.025em; }
.hero-context {
  min-width: 272px;
  padding: 21px 26px;
  border: 1px solid #e2e2e7;
  border-radius: 22px;
  background: rgba(255, 255, 255, .75);
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 7px;
}
.context-label { color: var(--secondary); font-size: 10px; line-height: 1.5; font-weight: 600; letter-spacing: .09em; }
.historical-years { font-size: 21px; line-height: 1.5; font-weight: 550; letter-spacing: -.025em; white-space: nowrap; }
.historical-years i { color: #c0c0c7; font-style: normal; font-weight: 300; margin: 0 8px; }
.projection { color: var(--blue); font-size: 12px; font-weight: 500; }
.projection > span { margin-right: 5px; }

/* Selector segmentado: mismos roles, IDs y eventos que en la versión original. */
.view-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 4;
  background: rgba(245, 245, 247, .9);
  border-block: 1px solid rgba(29, 29, 31, .08);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
}
.view-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 15px; }
.tabs { display: flex; align-items: stretch; gap: 4px; padding: 4px; min-width: 0; border: 1px solid #e0e0e5; border-radius: 15px; background: #eaeaec; }
.view-tab {
  min-height: 44px;
  padding: 10px 19px;
  border: 1px solid transparent;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #56565d;
  background: transparent;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  white-space: nowrap;
  transition: background .22s var(--ease), color .22s, box-shadow .22s;
}
.view-tab[aria-selected=true] { background: #fff; border-color: rgba(29, 29, 31, .04); color: var(--ink); box-shadow: 0 2px 7px rgba(29, 29, 31, .08), 0 1px 2px rgba(29, 29, 31, .04); }
.view-tab[aria-selected=true] svg { color: var(--blue); }
.view-tab:hover { color: var(--ink); background-color: rgba(255, 255, 255, .55); }
.view-tab[aria-selected=true]:hover { background: #fff; }
.tab-number { color: #777780; font-size: 10px; font-weight: 500; }
.view-tab[aria-selected=true] .tab-number { color: var(--blue); }
.switch-button {
  min-height: 44px;
  padding: 10px 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  white-space: nowrap;
  transition: background .2s, box-shadow .2s;
}
.switch-button:hover { background: var(--blue-hover); box-shadow: 0 3px 10px #0071e31a; }
.switch-button > span:last-child { font-size: 19px; line-height: 1; font-weight: 400; }
.workspace-meta { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; margin-bottom: 7px; }
.workspace-meta p { margin: 0; color: var(--secondary); font-size: 12px; line-height: 1.6; }
.view-index { color: #6b6b73; font-size: 10px; letter-spacing: .07em; white-space: nowrap; }
.view-panel { min-height: 600px; background: var(--page); }
.view-panel iframe { display: block; width: 100%; height: 1200px; border: 0; background: var(--page); }

.footer { padding-block: 30px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--secondary); }
.footer-brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.footer-brand img { width: 32px; height: 32px; object-fit: cover; border-radius: 10px; }
.footer-brand strong { display: block; color: var(--ink); font-size: 12px; line-height: 1.4; font-weight: 600; }
.footer-brand div > span { display: block; margin-top: 2px; font-size: 11px; }
.footer > p { margin: 0; font-size: 11px; text-align: center; }
.footer > p > span { color: #b3b3ba; padding: 0 7px; }
.footer > button { min-height: 44px; padding: 10px 0 10px 12px; border: 0; background: transparent; color: var(--blue); font-size: 12px; line-height: 1.4; white-space: nowrap; }
.footer > button > span { padding-left: 7px; font-size: 16px; }
.footer > button:hover { text-decoration: underline; }
.noscript { padding-block: 24px; }

@media (min-width: 1600px) { .hero { padding-block: 66px 58px; } }
@media (max-width: 1000px) {
  .topbar-inner { gap: 20px; }
  .location-divider, .route-year { display: none; }
  .tab-number { display: none; }
  .view-tab { padding-inline: 15px; }
  .hero { gap: 30px; }
  .hero-context { min-width: 250px; padding: 20px 23px; }
  .historical-years { font-size: 19px; }
}
@media (max-width: 760px) {
  :root { --header-height: 72px; }
  html { scroll-padding-top: 215px; }
  .wrap, .topbar-inner { padding-inline: 24px; }
  .topbar-inner { gap: 16px; }
  .brand { gap: 10px; }
  .brand img { width: 40px; height: 40px; border-radius: 12px; }
  .brand small { font-size: 10px; letter-spacing: .025em; }
  .location { display: none; }
  .print-button { width: 44px; height: 44px; padding: 0; }
  .print-button > span { display: none; }
  .hero { padding-block: 35px 32px; flex-direction: column; align-items: flex-start; gap: 25px; }
  .eyebrow { font-size: 10px; margin-bottom: 12px; }
  h1 { font-size: clamp(44px, 9vw, 57px); }
  .hero-description { margin-top: 12px; font-size: 18px; line-height: 1.45; }
  .hero-context { width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 17px; }
  .context-label { width: 100%; font-size: 10px; letter-spacing: .075em; }
  .historical-years { font-size: 15px; }
  .historical-years i { margin-inline: 5px; }
  .projection { font-size: 12px; }
  .view-bar-inner { padding-block: 12px; flex-direction: column; align-items: stretch; gap: 10px; }
  .tabs { width: 100%; }
  .view-tab { flex: 1 1 0; min-width: 0; padding: 10px 12px; font-size: 12px; gap: 7px; }
  .view-tab svg { width: 16px; height: 16px; }
  .switch-button { width: 100%; min-height: 44px; padding: 10px 17px; justify-content: space-between; font-size: 13px; }
  .workspace-meta { align-items: flex-start; margin-top: 21px; margin-bottom: 3px; gap: 15px; }
  .workspace-meta p { font-size: 12px; max-width: 35ch; }
  .view-index { font-size: 10px; margin-top: 2px; }
  .footer { flex-wrap: wrap; gap: 19px 12px; padding-block: 26px; }
  .footer-brand { margin-right: auto; }
  .footer > p { width: 100%; order: 3; text-align: left; font-size: 10px; }
}
@media (max-width: 430px) {
  .wrap, .topbar-inner { padding-inline: 20px; }
  .brand strong { font-size: 13px; }
  .brand small { max-width: 164px; }
  .hero-description { max-width: 25ch; }
  .view-tab { white-space: normal; padding-inline: 9px; font-size: 12px; }
  .workspace-meta p { max-width: 27ch; }
  .view-index { font-size: 10px; letter-spacing: .025em; }
}
@media (max-width: 360px) {
  .wrap, .topbar-inner { padding-inline: 16px; }
  .topbar-inner { gap: 12px; }
  .brand { gap: 9px; }
  .brand small { font-size: 10px; max-width: 143px; }
  .brand strong { font-size: 13px; }
  .view-tab svg { display: none; }
  .view-tab { padding-inline: 10px; font-size: 12px; }
  .hero-description { font-size: 17px; }
  .historical-years { font-size: 14px; }
  .projection { font-size: 11px; }
  .hero-context { column-gap: 12px; }
  .workspace-meta { gap: 10px; }
  .workspace-meta p { font-size: 11px; }
  .view-index { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .topbar, .hero, .view-bar, .workspace-meta, .footer, .skip-link { display: none !important; }
  body { background: #fff; }
  .view-panel { min-height: 0; }
  .view-panel iframe { height: auto; }
}
