/* Eclipse trip, map and local Sky preview. */
.chartwrap[data-view="earth"]:has(.ea-trip[data-eclipse]:not([hidden])) {
  --ea-eclipse-sheet: min(400px, 55%);
  min-height: min(620px, 78dvh);
}
.chartwrap[data-view="earth"]:has(.ea-trip[data-eclipse]:not([hidden])) > :is(.eacv, .ealab) {
  inset: 60px 0 auto var(--ea-eclipse-sheet);
  width: calc(100% - var(--ea-eclipse-sheet));
  height: calc(100% - 168px);
}
.chartwrap[data-view="earth"] > .ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) {
  display: grid;
  grid-template: minmax(0, 1fr) auto auto auto / var(--ea-eclipse-sheet) minmax(0, 1fr);
  padding-top: var(--ea-toolbar-top);
}
.ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) .ea-foot {
  grid-area: 4 / 1 / 5 / -1;
  position: relative;
  inset: auto;
  margin: 4px 10px 8px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(9, 14, 28, 0.9);
}
.ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) .ea-credit { padding: 0; background: none; overflow-wrap: anywhere; }
.ea-trip[data-eclipse] { grid-area: 1 / 1 / 4 / 2; position: relative; inset: auto; align-self: stretch; margin-inline: 10px 0; width: auto; max-height: 100%; min-height: 0; padding-block: 8px; overflow-y: auto; overscroll-behavior-y: contain; touch-action: pan-y; background: var(--place-clock-bg, #F5F2EB); color: var(--place-clock-ink, #16202C); border-color: var(--line); }
.ea-trip[data-eclipse]:not([hidden]) ~ .ea-time {
  grid-area: 3 / 2;
  align-self: end;
  position: relative;
  inset: auto;
  max-width: none;
  margin: 0 10px 4px;
}
.ea-trip[data-eclipse]:not([hidden]) ~ .ea-time .ea-tt2 { display: none; }
.ea-trip[data-eclipse]:not([hidden]) ~ .ea-time .btn { min-width: 44px; min-height: 44px; padding-inline: 9px; border-radius: 8px; }
.ea-trip[data-eclipse] .ea-th { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
.ea-trip[data-eclipse] .btn { min-height: var(--tap); padding-block: 4px; }
.ea-trip[data-eclipse] .ea-th [data-ea="tclose"] { margin-inline-start: auto; }
.ea-trip[data-eclipse] .ea-trip-more:not([hidden]) { display: block; width: auto; margin: 0; }
.ea-trip[data-eclipse] .ea-fine, .ea-trip[data-eclipse] .ea-tib span { color: var(--place-clock-meta, #4D5969); }
.ea-trip[data-eclipse] .btn:not(.on) { background: transparent; color: inherit; border-color: var(--line); }
.ea-trip[data-eclipse] .ea-tib [data-stop-clock] { color: inherit; font-size: 13px; }
.ea-trip[data-eclipse] .ea-trip-scene { font-variant-numeric: tabular-nums; }
.ea-trip[data-eclipse] .ea-tlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ea-trip[data-eclipse] .ea-ti { flex-wrap: nowrap; flex-direction: column; align-items: stretch; gap: 4px; }
.ea-trip[data-eclipse] .ea-ti:not([aria-current="true"]) { border-color: var(--line); }
.ea-trip[data-eclipse] .ea-tib { padding: 1px 4px; }
.ea-trip[data-eclipse] .ea-ti .btn { align-self: flex-start; max-width: 100%; white-space: normal; }
.ea-trip[data-eclipse] .ea-route-actions { margin-top: 6px; }
.ea-trip[data-eclipse] .ea-go { margin-top: 0; }
.ea-eclipse-drive { padding-inline: 4px; }
.ea-eclipse-clouds { margin-block: 4px; }
.ea-eclipse-safety { margin: 7px 0; padding: 6px 8px; border-inline-start: 2px solid var(--accent); background: var(--accent-soft); font-size: 15px; line-height: 1.25; }
.ea-eclipse-scroll-cue { display: none; }
@media (max-width: 640px) {
  .chartwrap[data-view="earth"]:has(.ea-trip[data-eclipse]:not([hidden])) {
    --ea-eclipse-map: 207px; --ea-eclipse-ui-top: 0px;
    min-height: min(748px, 92dvh);
  }
  body.immersive .chartwrap[data-view="earth"]:has(.ea-trip[data-eclipse]:not([hidden])) { --ea-eclipse-ui-top: 46px; }
  body.immersive .chartwrap[data-view="earth"] > .ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) { top: var(--ea-eclipse-ui-top); }
  .chartwrap[data-view="earth"]:has(.ea-trip[data-eclipse]:not([hidden])) > :is(.eacv, .ealab) {
    top: calc(var(--ea-eclipse-ui-top) + 58px); left: 0;
    width: 100%;
    height: calc(var(--ea-eclipse-map) - 58px);
  }
  .chartwrap[data-view="earth"] > .ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) {
    grid-template: var(--ea-eclipse-map) auto auto minmax(0, 1fr) auto / minmax(0, 1fr);
    padding-top: 0;
  }
  .ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) .ea-side { grid-template-columns: repeat(2, var(--tap)); }
  .ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) .ea-foot { grid-area: 5 / 1; display: block; margin-block: 2px 5px; line-height: 1.35; }
  .ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) .ea-alt { padding: 0; background: none; }
  .ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) .ea-alt:not(:empty)::after { content: ' · '; }
  .ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) .ea-credit > span:not([hidden]) { display: inline; }
  .ea-ui:has(.ea-trip[data-eclipse]:not([hidden])) .ea-credit > span + span::before { content: ' · '; }
  .ea-trip[data-eclipse] { --tap: 44px; grid-area: 4 / 1; margin-inline: 0; padding-block: 8px; }
  .ea-trip[data-eclipse] .ea-ti { gap: 2px; line-height: 1.3; }
  .ea-trip[data-eclipse] :is(.ea-trip-scene, .ea-eclipse-drive) { line-height: 1.3; }
  .ea-eclipse-dock { position: sticky; bottom: 0; z-index: 1; display: flow-root; background: var(--place-clock-bg, #F5F2EB); }
  .ea-eclipse-dock .ea-eclipse-safety { margin-block: 4px; }
  .ea-trip[data-eclipse] .ea-route-actions { margin-top: 4px; }
  .ea-eclipse-scroll-cue { display: block; margin-block: 4px; color: var(--place-clock-meta, #4D5969); font-size: 12px; line-height: 1.25; }
  .ea-ui.trip-open .ea-trip[data-eclipse]:not([hidden]) ~ .ea-time { display: flex; grid-area: 3 / 1; justify-content: flex-start; }
}

.chartwrap[data-view="sky"]:has(.sky-eclipse-preview:not([hidden])) > :is(#sky, .hud, .zoom) { visibility: hidden; }
.sky-eclipse-preview {
  position: absolute; inset: 0; z-index: 8; overflow: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: #070B12; color: #f3eee7;
  display: grid; align-content: safe center; align-items: center; justify-content: center;
  grid-template-columns: minmax(265px, 340px) minmax(0, 420px);
  grid-template-areas: 'facts figure' 'facts phases'; gap: 8px 32px; padding: 24px;
}
.sky-eclipse-preview[hidden] { display: none; }
.sky-eclipse-facts {
  grid-area: facts; align-self: center; padding: 18px 20px 10px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
}
.sky-eclipse-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sky-eclipse-head .btn, .sky-eclipse-phases .btn { min-height: 44px; }
.sky-eclipse-time { display: flex; gap: 2px 8px; flex-wrap: wrap; align-items: baseline; margin: 10px 0 0; color: var(--ink2); }
.sky-eclipse-simulation { white-space: nowrap; }
.sky-eclipse-figure { grid-area: figure; margin: 0; text-align: center; min-width: 0; }
.sky-eclipse-figure canvas { display: block; max-width: 100%; width: 320px; height: auto; margin-inline: auto; }
.sky-eclipse-figure figcaption { color: #b7c5dc; font-size: 13px; }
.sky-eclipse-phases { grid-area: phases; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sky-eclipse-phases .btn { color: #f3eee7; border-color: #53627a; background: #101828; }
.sky-eclipse-phases .btn[aria-pressed="true"] { color: #211208; border-color: #ffaa70; background: #ffaa70; }
body.immersive .chartwrap > #sky-eclipse-preview {
  top: calc(16px + var(--sky-viewbar-height, 44px)); opacity: 1; pointer-events: auto; transition: none;
}
body.immersive.idle .stage:has(.sky-eclipse-preview:not([hidden])) > .viewbar { opacity: 1; pointer-events: auto; }
@media (min-width: 1040px) {
  body.immersive .chartwrap[data-view="sky"]:has(> #sky-eclipse-preview:not([hidden])) > #sky {
    visibility: visible; pointer-events: none; interactivity: inert;
  }
  body.immersive .chartwrap > #sky-eclipse-preview {
    width: min(900px, calc(100% - 64px)); height: fit-content; max-height: calc(100% - 88px);
    margin: auto; border-radius: var(--r-panel);
  }
}
@media (max-width: 740px) {
  .sky-eclipse-preview {
    grid-template-columns: minmax(0, 390px); grid-template-areas: 'facts' 'figure' 'phases';
    align-content: start; gap: 8px; padding: 12px 14px;
  }
  .sky-eclipse-facts { padding: 10px 15px 3px; }
  body:not(.immersive) .chartwrap[data-view="sky"]:has(.sky-eclipse-preview:not([hidden])) { min-height: min(680px, calc(100svh - 58px)); }
}

.eclipse-home {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px;
  padding: 18px 20px; margin-block: 12px;
  background: var(--place-clock-bg, #F5F2EB); color: var(--place-clock-ink, #16202C);
  border: 1px solid var(--line); border-radius: var(--r-panel);
}
.eclipse-heading { margin-top: 4px; font: 650 clamp(22px, 3vw, 28px)/1.2 var(--f-body); }
.eclipse-heading:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.eclipse-home h3, .ea-eclipse-home h3 {
  margin: 4px 0; font: 650 24px/1.1 var(--f-body); overflow-wrap: anywhere;
}
.eclipse-home-actions { grid-column: 1 / -1; }
.eclipse-home-actions .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.eclipse-home-actions .acts .btn { min-height: 44px; }
.eclipse-thumbnail { width: 80px; height: 70px; border-radius: 8px; background: #070b12; }
.eclipse-meta, .eclipse-summary { margin: 4px 0; color: var(--place-clock-meta, #4D5969); font-size: 13px; }
.eclipse-verdict { margin: 4px 0; font-weight: 650; font-size: 17px; }
.eclipse-peak { margin-block: 5px; font: 700 17px/1.35 var(--f-body); font-variant-numeric: tabular-nums; }
.eclipse-home .eclipse-peak { white-space: nowrap; }
.eclipse-safety {
  margin: 8px 0; padding: 7px 9px; border-inline-start: 2px solid var(--accent);
  background: var(--accent-soft); font-size: 15px; line-height: 1.3;
}
:is(.ev, .nexte) .eclipse-safety { font-size: 15px; }
.eclipse-details, .eclipse-archive { color: var(--ink2); font-size: 13px; }
.eclipse-details summary, .eclipse-archive summary {
  min-height: 44px; padding-block: 12px; cursor: pointer; font-weight: 650;
}
.eclipse-details p { margin: 0 0 10px; }
.eclipse-timeline { list-style: none; padding: 0; margin: 0 0 10px; }
.eclipse-timeline li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; border-top: 1px solid var(--line); padding: 5px 0; }
.eclipse-timeline time, .ea-trip[data-eclipse] time { font-variant-numeric: tabular-nums; }
.ea-trip[data-eclipse] .ea-tt { font: 650 18px/1.2 var(--f-body); }
.ea-trip[data-eclipse] .ea-th { gap: 4px; }
.ea-trip[data-eclipse] .ea-th .btn { padding-inline: 8px; }
.ea-eclipse-key {
  grid-area: 2 / 2; justify-self: start; margin: 0 10px 6px;
  color: #f3eee7; background: #101925; border: 1px solid #46576b; border-radius: 8px;
  padding: 5px 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px;
}
.ea-eclipse-key[hidden] { display: none; }
.ea-eclipse-key span { display: inline-flex; align-items: center; gap: 5px; }
.ea-eclipse-key span::before { content: ''; width: 15px; height: 5px; border-block: 1px solid #ffd29f; background: #735839; }
.ea-eclipse-key .ea-key-partial::before { height: 9px; border: 1px dashed #bbdaf1; background: #344b61; }
#sky-eclipse-place { margin: 0; color: var(--ink2); overflow-wrap: anywhere; font-weight: 650; }
#sky-eclipse-title { margin: 3px 0 8px; font: 650 clamp(24px, 4vw, 32px)/1.1 var(--f-body); }
#sky-eclipse-clock { font: 700 17px/1.35 var(--f-body); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sky-eclipse-facts { background: var(--place-clock-bg, #F5F2EB); color: var(--place-clock-ink, #16202C); }
.sky-eclipse-phases .btn:disabled { opacity: .55; }
@media (max-width: 640px) {
  .ea-eclipse-key { grid-area: 2 / 1; }
  .eclipse-home { column-gap: 10px; }
  .eclipse-thumbnail { width: 68px; height: auto; }
  .sky-eclipse-facts { align-self: start; position: sticky; top: 0; z-index: 1; }
  .sky-eclipse-figure canvas { width: clamp(190px, 34vh, 305px); }
}
body.immersive.idle .stage:has(.ea-trip[data-eclipse]:not([hidden])) > .viewbar { opacity: 1; pointer-events: auto; }
@media (max-width: 560px) {
  body.immersive .chartwrap[data-view="earth"]:has(.ea-trip[data-eclipse]:not([hidden])) { --ea-eclipse-ui-top: 54px; }
}
