/*
  cosmos.css — Estilos del modulo "Cosmos" (cosmos.html).
  Mobile-first (390x844) con mejoras para escritorio. Estetica del sitio:
  oscuro de lujo, acentos dorados (#d4af37 / #f2d27a) y glassmorphism
  (fondo translucido + blur(12px) + borde ultrafino).
  Contraste: texto #f4f5f9 / #c9cde2 sobre vidrio oscuro (>= 7:1, AA con margen).
*/

.cosmos-page {
  --cx-bg: #0b0b0e;
  --cx-glass: rgba(16, 16, 22, 0.66);
  --cx-glass-strong: rgba(14, 14, 19, 0.82);
  --cx-line: rgba(255, 255, 255, 0.12);
  --cx-gold: #d4af37;
  --cx-gold-hi: #f2d27a;
  --cx-text: #f4f5f9;
  --cx-text-2: #c9cde2;
  --cx-nav-h: 64px;
  --cx-nav-b: 30px;
  --cx-safe-b: env(safe-area-inset-bottom, 0px);
  --cx-safe-t: env(safe-area-inset-top, 0px);
  background: var(--cx-bg);
  overscroll-behavior: none;
}

.cosmos {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--cx-bg);
  color: var(--cx-text);
  font-family: var(--font-ui);
}

/* ---------- vidrio ---------- */
.glass {
  background: var(--cx-glass);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
  border: 1px solid var(--cx-line);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--cx-glass-strong); }
}

/* ---------- escenario ---------- */
.cosmos__stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.cosmos:not(.is-loading) .cosmos__stage { opacity: 1; }
.cosmos-canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
  cursor: grab;
}
.cosmos-canvas:active { cursor: grabbing; }

/* ---------- etiquetas de cuerpos (botones accesibles) ---------- */
.cosmos__labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}
.cosmos__labels.is-hidden { visibility: hidden; }
.cosmos-label {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  color: var(--cx-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: rgba(11, 11, 14, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  pointer-events: auto;
  will-change: transform;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.cosmos-label[hidden] { display: none; }
.cosmos-label__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cx-gold-hi);
  box-shadow: 0 0 8px rgba(242, 210, 122, 0.8);
}
.cosmos-label:hover,
.cosmos-label.is-hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(242, 210, 122, 0.55);
  color: var(--cx-gold-hi);
}
@media (max-width: 767px) {
  .cosmos-label { font-size: 11px; min-height: 28px; padding: 3px 8px 3px 7px; }
}
@media (min-width: 768px) {
  .cosmos-label { font-size: 13px; min-height: 28px; }
}

/* ---------- barra superior ---------- */
.cosmos__topbar {
  position: absolute;
  z-index: 20;
  top: calc(10px + var(--cx-safe-t));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.cosmos__topbar > * { pointer-events: auto; }
.cosmos__title {
  margin-right: auto;
  font-family: var(--font-display), var(--font-ui);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  color: var(--cx-gold-hi);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
.cosmos__topbar-end { display: flex; align-items: center; gap: 8px; }
.cosmos__lang .lang-selector__trigger {
  background: var(--cx-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--cx-line);
  border-radius: 999px;
  padding: 8px 12px;
}
.cosmos__lang .lang-selector__panel {
  background: var(--cx-glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--cx-line);
}

.cosmos-ico { width: 20px; height: 20px; flex: none; }

.cosmos-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  color: var(--cx-text);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.cosmos-pill:hover { border-color: rgba(242, 210, 122, 0.6); color: var(--cx-gold-hi); }
.cosmos-pill--gold {
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(242, 210, 122, 0.5);
  color: var(--cx-gold-hi);
  padding: 0 14px;
  min-height: 40px;
  font-size: 13px;
}
.cosmos-pill--gold:hover { background: rgba(212, 175, 55, 0.28); }

.cosmos-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  color: var(--cx-text-2);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.cosmos-iconbtn:hover { color: var(--cx-gold-hi); }
.cosmos-iconbtn.glass:hover { border-color: rgba(242, 210, 122, 0.6); }
#motion-toggle .ico-play { display: none; }
#motion-toggle[aria-pressed="true"] .ico-pause { display: none; }
#motion-toggle[aria-pressed="true"] .ico-play { display: block; }
#motion-toggle[aria-pressed="true"] { color: var(--cx-gold-hi); }

/* ---------- capa principal de UI ---------- */
.cosmos__main { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.cosmos__main > * { pointer-events: auto; }

.cosmos-hint {
  position: absolute;
  top: calc(66px + var(--cx-safe-t));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--cx-text-2);
  text-align: center;
  white-space: nowrap;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.cosmos-hint.is-gone { opacity: 0; visibility: hidden; }
.cosmos-hint[hidden] { display: none; }

.cosmos-overview-btn {
  position: absolute;
  top: calc(66px + var(--cx-safe-t));
  left: 12px;
}
.cosmos-overview-btn[hidden] { display: none; }

.cosmos-fab {
  position: absolute;
  right: 12px;
  bottom: calc(var(--cx-nav-h) + var(--cx-nav-b) + 14px + var(--cx-safe-b));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  color: var(--cx-gold-hi);
  border-color: rgba(242, 210, 122, 0.45);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.cosmos-fab:hover { background: rgba(212, 175, 55, 0.2); border-color: var(--cx-gold-hi); }
.cosmos-fab[hidden], .cosmos-fab.is-away { display: none; }

/* ---------- selector de vistas ---------- */
.cosmos-views {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--cx-nav-b) + var(--cx-safe-b));
  height: var(--cx-nav-h);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 5px;
  border-radius: 20px;
  z-index: 12;
}
.cosmos-views__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  border-radius: 15px;
  color: var(--cx-text-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  padding: 4px 4px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cosmos-views__btn:hover { color: var(--cx-text); }
.cosmos-views__btn[aria-pressed="true"] {
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(242, 210, 122, 0.5);
  color: var(--cx-gold-hi);
}

.cosmos-credit {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(5px + var(--cx-safe-b));
  text-align: center;
  font-size: 10.5px;
  line-height: 1.3;
  white-space: nowrap;
  color: #b4b9d0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  z-index: 11;
}
.cosmos-credit__note { display: none; }
.cosmos-credit a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(255, 255, 255, 0.35); }
.cosmos-credit a:hover { color: var(--cx-gold-hi); }

/* ---------- ficha (sheet) ---------- */
.cosmos-sheet,
.cosmos-eclipse {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(var(--cx-nav-h) + var(--cx-nav-b) + 8px + var(--cx-safe-b));
  height: min(48dvh, 460px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  z-index: 15;
  animation: cosmos-rise 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cosmos-sheet[hidden], .cosmos-eclipse[hidden] { display: none; }
@keyframes cosmos-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.cosmos-sheet__grip {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
  margin: 8px auto 2px;
  flex: none;
}
.cosmos-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px 10px 18px;
  flex: none;
}
.cosmos-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cx-gold);
}
.cosmos-sheet__title {
  font-family: var(--font-display), var(--font-ui);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.1;
  margin-top: 2px;
  color: var(--cx-text);
}
.cosmos-sheet__tagline {
  margin-top: 4px;
  font-size: 14px;
  color: var(--cx-text-2);
}
.cosmos-sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2px 18px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 210, 122, 0.4) transparent;
}
.cosmos-section-title {
  margin: 16px 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cx-gold-hi);
}
.cosmos-section-title:first-child { margin-top: 4px; }
.cosmos-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cosmos-fact {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.cosmos-fact dt { font-size: 11.5px; color: #b9bed6; }
.cosmos-fact dd { margin-top: 2px; font-size: 14.5px; font-weight: 600; color: var(--cx-text); }
.cosmos-prose p, .cosmos-sheet__body p.cosmos-p {
  font-size: 14.5px;
  line-height: 1.62;
  color: #dadded;
}
.cosmos-prose p + p { margin-top: 10px; }
.cosmos-missions { display: grid; gap: 10px; }
.cosmos-mission { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: baseline; }
.cosmos-mission__y {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  color: var(--cx-gold-hi);
}
.cosmos-mission__t { font-size: 14px; line-height: 1.5; color: #dadded; }

.cosmos-sheet__nav {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex: none;
}
.cosmos-navbtn {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cx-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.cosmos-navbtn small { display: block; font-size: 10.5px; font-weight: 500; color: #b9bed6; }
.cosmos-navbtn:hover { border-color: rgba(242, 210, 122, 0.55); color: var(--cx-gold-hi); }
.cosmos-navbtn[disabled] { opacity: 0.35; cursor: default; }

/* ---------- panel de eclipse ---------- */
.cosmos-eclipse { height: auto; max-height: min(58dvh, 520px); }
.cosmos-eclipse__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 14px 6px 18px;
  flex: none;
}
.cosmos-eclipse__title {
  font-family: var(--font-display), var(--font-ui);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.15;
  color: var(--cx-text);
}
.cosmos-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 2px 14px 4px;
  flex: none;
}
.cosmos-step {
  min-height: 40px;
  padding: 4px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--cx-text-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  transition: all 0.2s ease;
}
.cosmos-step:hover { color: var(--cx-text); }
.cosmos-step[aria-pressed="true"] {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(242, 210, 122, 0.55);
  color: var(--cx-gold-hi);
}
.cosmos-eclipse__caption {
  padding: 6px 18px 4px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #dadded;
  flex: none;
}
.cosmos-eclipse__toggle {
  margin: 4px 14px 8px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cx-gold-hi);
  font-size: 13px;
  font-weight: 600;
  flex: none;
}
.cosmos-eclipse__toggle:hover { border-color: rgba(242, 210, 122, 0.55); }
.cosmos-eclipse__story {
  display: none;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.cosmos-eclipse.is-open .cosmos-eclipse__story { display: flex; }
.cosmos-eclipse.is-open { height: min(58dvh, 520px); }
.cosmos-tabs { display: flex; gap: 6px; padding: 0 14px 6px; flex: none; overflow-x: auto; scrollbar-width: none; }
.cosmos-tabs::-webkit-scrollbar { display: none; }
.cosmos-tab {
  flex: 1 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--cx-text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.cosmos-tab[aria-selected="true"] {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(242, 210, 122, 0.55);
  color: var(--cx-gold-hi);
}
.cosmos-eclipse__content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 18px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 210, 122, 0.4) transparent;
}
.cosmos-eclipse__content h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--cx-gold-hi);
  margin: 12px 0 4px;
}
.cosmos-eclipse__content h3:first-child { margin-top: 2px; }
.cosmos-eclipse__content p { font-size: 14px; line-height: 1.6; color: #dadded; }
.cosmos-eclipse__safety {
  flex: none;
  margin: 0 14px 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(242, 210, 122, 0.3);
  font-size: 12.5px;
  color: #f1e3b3;
}

/* ---------- linea de tiempo ---------- */
.cosmos-timeline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--cx-nav-h) + var(--cx-nav-b) + 8px + var(--cx-safe-b));
  z-index: 14;
  animation: cosmos-rise 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cosmos-timeline[hidden] { display: none; }
.cosmos-timeline__bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 0 18px 8px; }
.cosmos-timeline__title { font-family: var(--font-display), var(--font-ui); font-weight: 600; font-size: 1.05rem; color: var(--cx-gold-hi); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
.cosmos-timeline__hint { font-size: 12px; color: var(--cx-text-2); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9); }
.cosmos-timeline__rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 18px 16px 12px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 210, 122, 0.4) transparent;
  touch-action: pan-x;
}
.cosmos-tl-card {
  position: relative;
  flex: 0 0 min(78vw, 300px);
  scroll-snap-align: center;
  padding: 14px 16px 14px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.cosmos-tl-card::before {
  content: '';
  position: absolute;
  top: -13px;
  left: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cx-gold);
  box-shadow: 0 0 10px rgba(242, 210, 122, 0.8);
}
.cosmos-tl-card::after {
  content: '';
  position: absolute;
  top: -9px;
  left: -14px;
  right: -14px;
  height: 1px;
  background: rgba(242, 210, 122, 0.3);
  z-index: -1;
}
.cosmos-tl-card.is-active { border-color: rgba(242, 210, 122, 0.65); background: rgba(24, 22, 14, 0.78); }
.cosmos-tl-card__year { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--cx-gold-hi); }
.cosmos-tl-card__title { font-family: var(--font-display), var(--font-ui); font-weight: 600; font-size: 1.12rem; line-height: 1.2; color: var(--cx-text); }
.cosmos-tl-card__text { font-size: 13.5px; line-height: 1.5; color: #d3d7ea; }
.cosmos-tl-card__btn {
  align-self: flex-start;
  margin-top: 4px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(242, 210, 122, 0.5);
  color: var(--cx-gold-hi);
  font-size: 12.5px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}
.cosmos-tl-card__btn:hover { background: rgba(212, 175, 55, 0.2); }

/* ---------- carga ---------- */
.cosmos-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--cx-text-2);
  font-size: 14px;
  background: radial-gradient(ellipse at 50% 45%, #14141c 0%, #0b0b0e 70%);
  transition: opacity 0.7s ease, visibility 0.7s;
  pointer-events: none;
}
.cosmos:not(.is-loading) .cosmos-loading { opacity: 0; visibility: hidden; }
.cosmos-loading__ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--cx-gold);
  animation: cosmos-spin 1s linear infinite;
}
@keyframes cosmos-spin { to { transform: rotate(360deg); } }

/* ---------- fallback sin WebGL ---------- */
.cosmos-fallback {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 0%, #1a1a24 0%, #0b0b0e 60%);
  padding: calc(72px + var(--cx-safe-t)) 16px 40px;
}
.cosmos-fallback[hidden] { display: none; }
.cosmos-fallback__inner { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.cosmos-fallback__note { padding: 12px 16px; border-radius: 14px; font-size: 14px; color: #f1e3b3; }
.cosmos-fallback h2.cosmos-fallback__h { font-family: var(--font-display), var(--font-ui); font-size: 1.4rem; color: var(--cx-gold-hi); margin-top: 10px; }
.cosmos-card { border-radius: 18px; padding: 16px 18px 18px; }
.cosmos-card h3 { font-family: var(--font-display), var(--font-ui); font-size: 1.35rem; color: var(--cx-text); margin: 2px 0 2px; }
.cosmos-card .cosmos-sheet__tagline { margin-bottom: 8px; }
.cosmos--fallback .cosmos__main,
.cosmos--fallback .cosmos__stage,
.cosmos--fallback .cosmos__labels,
.cosmos--fallback .cosmos-loading { display: none; }
.cosmos--fallback .cosmos__title { position: relative; }

/* ---------- escritorio ---------- */
@media (min-width: 768px) {
  .cosmos__topbar { left: 24px; right: 24px; top: calc(16px + var(--cx-safe-t)); }
  .cosmos__title { font-size: 1.7rem; margin-right: auto; }
  .cosmos-hint { top: calc(74px + var(--cx-safe-t)); font-size: 14px; }
  .cosmos-overview-btn { top: calc(74px + var(--cx-safe-t)); left: 24px; }

  .cosmos-views {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: calc(28px + var(--cx-safe-b));
    grid-template-columns: repeat(3, auto);
    height: 56px;
    padding: 5px;
    border-radius: 999px;
  }
  .cosmos-views__btn { flex-direction: row; gap: 8px; padding: 0 20px; border-radius: 999px; font-size: 14px; white-space: nowrap; }
  .cosmos-credit { bottom: 8px; font-size: 11.5px; }
  .cosmos-credit__note { display: inline; }

  .cosmos-fab { right: 24px; bottom: auto; top: calc(74px + var(--cx-safe-t)); }

  .cosmos-sheet,
  .cosmos-eclipse {
    left: auto;
    right: 24px;
    top: calc(74px + var(--cx-safe-t));
    bottom: 100px;
    width: 420px;
    height: auto;
    max-height: none;
    border-radius: 24px;
  }
  .cosmos-sheet__grip { display: none; }
  .cosmos-sheet__head { padding: 18px 12px 12px 22px; }
  .cosmos-sheet__title { font-size: 2rem; }
  .cosmos-sheet__body { padding: 2px 22px 16px; }
  .cosmos-eclipse__story { display: flex; }
  .cosmos-eclipse__toggle { display: none; }
  .cosmos-eclipse { padding-top: 10px; }
  .cosmos-eclipse__head { padding: 8px 16px 8px 22px; }
  .cosmos-eclipse__title { font-size: 1.45rem; }
  .cosmos-eclipse__caption { padding: 8px 22px 6px; font-size: 14px; }
  .cosmos-steps { padding: 4px 18px 6px; }

  .cosmos-timeline { bottom: 100px; }
  .cosmos-timeline__bar { padding: 0 32px 8px; }
  .cosmos-timeline__rail { padding: 20px 32px 14px; scroll-padding-inline: 32px; }
  .cosmos-tl-card { flex-basis: 300px; }
}
@media (min-width: 768px) and (max-height: 640px) {
  .cosmos-sheet, .cosmos-eclipse { bottom: 90px; }
}
@media (min-width: 1280px) {
  .cosmos-sheet, .cosmos-eclipse { width: 440px; right: 32px; }
}

/* ---------- movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .cosmos__stage, .cosmos-loading, .cosmos-hint { transition: none; }
  .cosmos-sheet, .cosmos-eclipse, .cosmos-timeline { animation: none; }
  .cosmos-loading__ring { animation: none; border-top-color: var(--cx-gold); }
}

.cosmos-sheet__title:focus, .cosmos-eclipse__title:focus, .cosmos-sheet:focus { outline: none; }
.cosmos-card h3.cosmos-section-title { font-family: var(--font-ui); font-size: 11px; font-weight: 700; color: var(--cx-gold-hi); margin: 16px 0 8px; }

/* ---------- calendario y mecanica de eclipses ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.cosmos-ecl-hint { margin: 0 0 6px; font-size: 13px; color: var(--cx-text-2); }
.cosmos-ecl-stale {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(242, 210, 122, 0.4);
  font-size: 12.5px;
  color: #f1e3b3;
}
.cosmos-ecl-strip {
  display: flex;
  gap: 10px;
  margin: 0 -18px;
  padding: 4px 18px 10px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 18px;
  scrollbar-width: none;
}
.cosmos-ecl-strip::-webkit-scrollbar { display: none; }
.cosmos-ecl-strip > li { flex: 0 0 min(74%, 250px); scroll-snap-align: center; display: flex; }
.cosmos-ecl-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 128px;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cx-text);
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.cosmos-ecl-card:hover { border-color: rgba(242, 210, 122, 0.5); }
.cosmos-ecl-card[aria-pressed="true"] {
  border-color: rgba(242, 210, 122, 0.85);
  background: rgba(212, 175, 55, 0.16);
  box-shadow: 0 0 0 1px rgba(242, 210, 122, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.cosmos-ecl-card:focus-visible,
.cosmos-ecl-link:focus-visible,
.cosmos-tab:focus-visible {
  outline: 2px solid var(--cx-gold-hi);
  outline-offset: 2px;
}
.cosmos-ecl-card__top { display: flex; gap: 6px; flex-wrap: wrap; }
.cosmos-ecl-card__date { font-family: var(--font-display), var(--font-ui); font-size: 1.1rem; font-weight: 600; line-height: 1.15; }
.cosmos-ecl-card__name { font-size: 13px; font-weight: 600; color: var(--cx-gold-hi); line-height: 1.3; }
.cosmos-ecl-card__dur { font-size: 12.5px; color: #dadded; }
.cosmos-ecl-card__places { font-size: 12px; color: var(--cx-text-2); line-height: 1.35; }
.cosmos-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(242, 210, 122, 0.7);
  color: var(--cx-gold-hi);
}
.cosmos-badge--total { background: #D4AF37; border-color: #D4AF37; color: #0B0B0E; }
.cosmos-badge--anular { background: transparent; }
.cosmos-badge--hibrido { background: linear-gradient(90deg, #D4AF37 50%, transparent 50%); border-color: #D4AF37; color: #0B0B0E; text-shadow: 0 0 2px rgba(242, 210, 122, 0.9); }
.cosmos-badge--next { background: rgba(255, 255, 255, 0.92); border-color: transparent; color: #0B0B0E; }
.cosmos-ecl-detail { margin-top: 4px; }
.cosmos-eclipse__content .cosmos-ecl-detail__title { margin: 6px 0 8px; font-size: 15.5px; }
.cosmos-ecl-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 10px; }
.cosmos-ecl-facts > div { padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
.cosmos-ecl-facts > div:last-child { grid-column: 1 / -1; }
.cosmos-ecl-facts dt { font-size: 11px; font-weight: 700; color: var(--cx-text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.cosmos-ecl-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--cx-text); }
.cosmos-eclipse__content h4.cosmos-ecl-sub { margin: 12px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cx-text-2); }
.cosmos-ecl-places { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cosmos-ecl-places > li { padding: 9px 11px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); font-size: 14px; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.cosmos-ecl-place__name { font-weight: 700; color: var(--cx-text); }
.cosmos-ecl-place__meta { color: var(--cx-text-2); font-size: 13px; }
.cosmos-ecl-link { flex-basis: 100%; font-size: 13px; font-weight: 600; color: var(--cx-gold-hi); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(242, 210, 122, 0.4); padding: 4px 0; }
.cosmos-ecl-link:hover { text-decoration-color: var(--cx-gold-hi); }
.cosmos-eclipse__content .cosmos-ecl-note,
.cosmos-eclipse__content .cosmos-ecl-source,
.cosmos-eclipse__content .cosmos-ecl-none { font-size: 12.5px; color: var(--cx-text-2); margin-top: 8px; }
.cosmos-diagram { margin: 2px 0 12px; padding: 8px 8px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
.cosmos-diagram__svg { display: block; width: 100%; height: auto; overflow: hidden; }
.cosmos-diagram .dg-t { font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; fill: #eceef7; }
.cosmos-diagram .dg-gold { fill: #f2d27a; }
.cosmos-diagram .dg-dim { fill: #b9bed6; font-weight: 500; }
.cosmos-diagram .dg-small { font-size: 10px; }
.cosmos-diagram .dg-big { font-size: 15px; font-weight: 700; }
.cosmos-diagram .dg-t { paint-order: stroke; stroke: #0b0b0e; stroke-width: 3px; stroke-linejoin: round; }
.cosmos-diagram__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 4px 0 6px; padding: 0; list-style: none; font-size: 12px; color: #dadded; }
.cosmos-diagram__legend li { display: inline-flex; align-items: center; gap: 6px; }
.dg-sw { display: inline-block; width: 16px; height: 10px; border-radius: 3px; }
.dg-sw--umbra { background: #000; border: 1px solid rgba(255, 255, 255, 0.6); }
.dg-sw--pen { background: rgba(242, 210, 122, 0.3); border: 1px solid rgba(242, 210, 122, 0.6); }
.dg-sw--ant { background: transparent; border: 1px dashed rgba(255, 255, 255, 0.6); }
.cosmos-diagram figcaption { margin: 0; padding: 0 6px; font-size: 12.5px; line-height: 1.5; color: var(--cx-text-2); }
@media (min-width: 768px) {
  .cosmos-ecl-strip > li { flex-basis: 232px; }
}
@media (prefers-reduced-motion: reduce) {
  .cosmos-ecl-card { transition: none; }
  .cosmos-ecl-strip { scroll-behavior: auto; }
}

/* Movil con el panel abierto: mas espacio para el calendario (sin los botones de etapa) */
@media (max-width: 767px) {
    .cosmos-eclipse.is-open .cosmos-steps { display: none; }
  .cosmos-eclipse.is-open .cosmos-eclipse__caption { padding-top: 0; font-size: 13px; }
  .cosmos-eclipse.is-open .cosmos-eclipse__toggle { min-height: 36px; margin-bottom: 6px; }
  .cosmos-eclipse__safety { font-size: 11.5px; padding: 5px 10px; margin: 0 14px 8px; line-height: 1.35; }
}
