.stage {
  --flight-bg: rgba(247, 248, 251, .96);
  --flight-ink: #17212f;
  --flight-dim: #465468;
  --flight-focus: #9a460f;
  --flight-line: #46546840;
  --flight-top: 0px;
  --flight-bottom: max(16px, env(safe-area-inset-bottom));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stage {
    --flight-bg: rgba(11, 16, 24, .92);
    --flight-ink: #f4f6fa;
    --flight-dim: #bdc7d4;
    --flight-focus: #ffaa70;
    --flight-line: #bdc7d440;
  }
}
:root[data-theme="dark"] .stage, .redm .stage {
  --flight-bg: rgba(11, 16, 24, .92);
  --flight-ink: #f4f6fa;
  --flight-dim: #bdc7d4;
  --flight-focus: #ffaa70;
  --flight-line: #bdc7d440;
}
body.immersive .chartwrap {
  --flight-top: calc(8px + var(--sky-viewbar-height, 44px));
}
body.immersive .chartwrap[data-view="space"] {
  --flight-top: max(0px, calc(8px + var(--sky-viewbar-height, 44px) - var(--sp-ui-top, 0px)));
}

.chartwrap :is(.sky-sheet, #sky-target, .sp-target, .sp-impression, .sp-menu)[hidden],
.chartwrap:not([data-view="sky"]) > :is(#sky-target, .sky-sheet),
.sp-ui:not([data-flight]) > :is(.sp-target, .sp-impression),
.sp-ui[data-flight] > :is(.sp-info, .sp-top, .sp-side, .sp-optmenu, .sp-go, .sp-gal-more),
.sp-ui[data-flight]:not([data-hud-sheet="time"]) > .sp-time,
.sp-ui[data-flight]:not([data-home-offer]) > .sp-where {
  display: none !important;
}
.chartwrap[data-view="sky"] > :is(.hud, .zoom, #boot-note[hidden]) { display: none; }
.viewbar > .vb-hud, .vb-menu-full { display: none; }
.stage[data-view="sky"] > .viewbar > .vb-sky,
.stage[data-view="space"]:has(.sp-ui[data-flight]) > .viewbar > .vb-space { display: inline-grid; }
body.tonight-first:not(.immersive) .viewbar > .vb-sky { display: none; }

:where(body:not(.tonight-first:not(.immersive))) .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar {
  gap: 8px;
  flex-wrap: nowrap;
}
:where(body:not(.tonight-first:not(.immersive))) .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar > button {
  background: var(--flight-bg);
  border: 1px solid var(--flight-line);
  border-radius: 12px;
  color: var(--flight-ink);
  height: 44px;
  min-width: 44px;
  margin: 0;
  flex: none;
  white-space: nowrap;
  place-content: center;
}
.stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar > button:is(:focus-visible, [aria-expanded="true"], [aria-selected="true"], [aria-pressed="true"]) {
  border-color: var(--flight-focus);
  color: var(--flight-focus);
}
.viewbar > .vb-hud { place-items: center; }
.viewbar > .vb-time {
  grid-auto-flow: column;
  gap: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.viewbar > .vb-time::before { content: "Time"; }
:where(body:not(.tonight-first:not(.immersive))) .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar > .vb-find {
  display: inline-grid;
  grid-auto-flow: column; /* on phones Space adds a "Search" label: keep it beside the glass, not stacked under it */
  gap: 6px;
  align-items: center;
}
.viewbar > .vb-hud:focus-visible { outline: 2px solid var(--flight-focus); outline-offset: -3px; }

@media (max-width: 640px) {
  .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar > .vb-full { display: none; }
  .vb-menu-full { display: inline-flex; align-items: center; }
  :where(body:not(.tonight-first:not(.immersive))) .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar > .vb-time {
    width: 62px;
    padding-inline: 2px;
  }
  .viewbar > .vb-time::before, .viewbar > .vb-menu > span { display: none; }
  .viewbar > .vb-menu { padding: 0; }
  .viewbar > .vb-menu::before {
    content: "";
    width: 16px;
    height: 10px;
    border-block: 1.5px solid;
    background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat;
  }
  :where(body:not(.tonight-first:not(.immersive))) .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar > .vtab {
    display: grid;
    justify-items: center;
    width: 44px;
    padding: 2px;
    gap: 1px;
    font-size: 11px;
    line-height: 1;
  }
  .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar {
    gap: clamp(2px, calc((100% - 326px) / 6), 5px);
  }
  :where(body:not(.tonight-first:not(.immersive))) .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar > #vt-sky {
    width: clamp(44px, calc(100% - 312px), 68px);
  }
  .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar .vtab svg { width: 14px; height: 14px; }
  .viewbar #vt-sky > span { white-space: normal; text-align: center; }
  /* The compact phone bar says "Sky" like Space and Earth beside it, so the label never wraps onto two lines. */
  :where(body:not(.tonight-first:not(.immersive))) .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar > #vt-sky .vt-long { display: none; }
  .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar :is(.newtag, .vb-rt) { display: none; }
}
@media (max-width: 359px) {
  :where(body:not(.tonight-first:not(.immersive))) .stage:is([data-view="sky"], [data-view="space"]:has(.sp-ui[data-flight])) > .viewbar { flex-wrap: wrap; }
}
body.immersive .stage:has(.sp-ui[data-flight]) > .viewbar {
  transition: opacity 150ms ease-out;
}
body.immersive .stage:has([data-flight][data-hud-idle]) > .viewbar {
  opacity: 0;
  transition-duration: 180ms;
}
body.immersive.idle .stage[data-view="sky"] > .viewbar,
body.immersive.idle .stage:has([data-flight]:not([data-hud-idle])) > .viewbar {
  opacity: 1;
}
.sp-ui[data-flight][data-hud-idle] > :is(.sp-hint, .sp-arrive, .sp-lookback) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.sp-ui[data-flight] > :is(.sp-hint, .sp-arrive, .sp-lookback) {
  transition: opacity 180ms ease-out, visibility 180ms;
}
.sp-ui[data-flight] > :is(.sp-arrive, .sp-hint) { top: calc(var(--flight-top) + 8px); }
.sp-ui[data-flight] > .sp-where { top: calc(var(--flight-top) + 8px) !important; }
.sp-ui[data-flight]:has(.sp-arrive:not([hidden])) > .sp-where { display: none; }
.sp-ui[data-flight] > .sp-lookback:not(.sp-where) { top: calc(var(--flight-top) + 8px); }
/* While the arrival caption holds the top, Look back home keeps its place at the bottom (style.css). Without this the
   line above won on `top` only, and the button stretched from top to bottom across the object. */
.sp-ui[data-flight] > .sp-arrive:not([hidden]) ~ .sp-lookback:not(.sp-where) { top: auto; }
@media (max-width: 560px) { .sp-ui[data-flight] > .sp-arrive:not([hidden]) ~ .sp-lookback:not(.sp-where) { bottom: 76px; } }
.sp-ui[data-flight] > .sp-drive {
  right: 16px;
  bottom: var(--flight-bottom);
  flex-direction: row;
  gap: 8px;
}
.sp-ui[data-flight] > .sp-target, #sky-target {
  position: absolute;
  left: 16px;
  bottom: var(--flight-bottom);
  max-width: calc(100% - 32px);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  font-size: 15px;
}
.chartwrap[data-spmode="drive"] .sp-ui[data-flight] > .sp-target {
  bottom: calc(var(--flight-bottom) + 64px);
}
@media (max-width: 560px) {
  /* Leave room for the bottom clock when the compact HUD is unavailable. */
  .chartwrap[data-spmode="explore"] .sp-ui:not([data-flight]) > .sp-arrive[data-find-arrival]:not([hidden]) ~ [data-sp="lookback"] {
    top: auto;
    bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  }
}
.sp-target > b, #sky-target { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.sp-target > span {
  flex: none;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.sp-target::after, #sky-target::after { content: "›"; flex: none; }
#sky-target > .st-txt { display: grid; min-width: 0; gap: 1px; text-align: start; line-height: 1.2; }
#sky-target > .st-txt > :is(b, small) { overflow: hidden; text-overflow: ellipsis; }
#sky-target > .st-txt > b { font-weight: 600; }
#sky-target > .st-txt > small { font-size: 13px; color: var(--flight-dim, inherit); }
#sky-target:has(small) { padding-block: 6px; }
.sp-impression {
  position: absolute;
  left: 16px;
  bottom: calc(var(--flight-bottom) + 52px);
  border-radius: 6px;
  padding: 4px 8px;
  background: #0b1018;
  color: #f4f6fa;
  pointer-events: none;
}
.chartwrap[data-spmode="drive"] .sp-impression { bottom: calc(var(--flight-bottom) + 116px); }

.sp-exo-descent[hidden] { display: none; }
.sp-impression:has(+ .sp-exo-descent:not([hidden])) { max-width: calc(100% - 128px); }
.sp-ui[data-flight] > .sp-exo-descent {
  position: absolute;
  right: 16px;
  bottom: calc(var(--flight-bottom) + 48px);
  min-width: 82px;
  min-height: 44px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.sp-exo-chart[hidden] { display: none; }
.sp-exo-chart {
  position: absolute;
  left: 16px;
  bottom: calc(var(--flight-bottom) + 52px);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px;
  border: 1px solid var(--flight-line);
  border-radius: 12px;
  background: var(--flight-bg);
  color: var(--flight-ink);
}
.sp-exo-measure { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; font-size: 12px; color: var(--flight-dim); }
.sp-exo-scale { display: grid; justify-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.sp-exo-scale::after { content: ''; width: var(--exo-scale); height: 4px; border: 1px solid currentColor; border-top: 0; }
.sp-exo-choice { display: block; margin-top: 8px; font-size: 15px; }
.sp-exo-planets { display: flex; flex-wrap: wrap; gap: 4px; margin-block: 6px; }
.sp-exo-planets .btn { width: 44px; height: 44px; padding: 0; }
.sp-exo-chart .sp-exo-orbit { min-height: 44px; width: 100%; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

@media (width > 560px) {
  .sp-ui[data-guided] > .sp-side > .sp-fsx { display: none; }
  body.immersive.idle .stage[data-view="space"]:has(.sp-ui[data-guided]) > .viewbar { opacity: 1; }
  body.immersive.idle .stage[data-view="space"]:has(.sp-ui[data-guided]) > .viewbar:not(:has(:focus-visible)) > :not(.vb-full) {
    visibility: hidden;
  }
}
@media (max-width: 560px) {
  body.immersive .sp-ui[data-guided] > .sp-side > .sp-fsx { width: 44px; height: 44px; }
  body.immersive .sp-ui[data-guided] > .sp-info { max-width: calc(100% - 72px); }
  body.immersive.idle .sp-ui[data-guided] > .sp-side { opacity: 1; }
  body.immersive.idle .sp-ui[data-guided] > .sp-side:not(:has(:focus-visible)) > :not(.sp-fsx) { visibility: hidden; }
  body.immersive.idle .sp-ui[data-guided] > .sp-side > .sp-fsx { pointer-events: auto; }
}
.sp-ui[data-flight] > .sp-menu,
.sp-ui[data-flight][data-hud-sheet="time"] > .sp-time,
.sky-sheet {
  position: absolute;
  z-index: 6;
  inset: calc(var(--flight-top) + 8px) auto auto 16px;
  width: min(390px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  max-height: min(55%, calc(100% - var(--flight-top) - 24px));
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  touch-action: pan-y;
  padding: 10px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}
.chartwrap[data-spmode="drive"] .sp-ui[data-flight][data-hud-sheet="time"] > .sp-time { display: flex; }
.sp-ui[data-flight] .sp-menu > :is(.sp-top, .sp-side, .sp-go, .sp-optmenu), .sky-sheet .zoom {
  position: static;
  inset: auto;
  display: flex;
  flex-flow: row wrap;
  justify-content: flex-start;
  max-width: 100%;
  gap: 8px;
  padding: 0;
  margin: 0;
  transform: none;
  border: 0;
  background: none;
  box-shadow: none;
}
.sp-ui[data-flight] .sp-menu > :is(.sp-side, .sp-go, .sp-optmenu),
:is(.sky-sheet, .sp-ui[data-flight] .sp-time) > .clock { width: 100%; }
.sp-menu :is(.sp-top .sp-optbtn, .sp-go [data-sp="hist"]), .sp-ui[data-flight] .sp-time > [data-sp="tnow"] { display: none; }
.sp-menu .sp-optmenu > label { min-height: 44px; }
.sp-menu .sp-optmenu summary { min-height: 44px; align-content: center; }
.sp-menu > .sp-go { mask-image: none; -webkit-mask-image: none; }
.sp-menu .sp-optmenu :is(label, summary) { color: var(--flight-ink); }
.sp-menu > .sp-top { order: -1; }
.sp-menu > .sp-side { order: 1; }
.sp-menu > .sp-go { order: 2; }
.sp-menu > .sp-optmenu { order: 3; }
.sp-ui[data-flight] .sp-time > .sp-tc {
  width: 100%;
  padding: 0;
  order: -1;
}
.sp-ui[data-flight] .sp-tc > :is(.sp-tdate, .sp-trate) {
  white-space: normal;
  overflow: visible;
}
.sp-ui[data-flight] .clock > #play { display: none; }
.sky-sheet #looks { display: flex; flex-wrap: wrap; gap: 8px; }
.sky-sheet > :is(#layers, #views) { padding-block: 6px; }
.sky-sheet .zoom .zb { display: grid; }
.chartwrap[data-view="sky"] > :is(#fovmenu, #guide) { z-index: 7; }

.chartwrap[data-view="sky"] > #selcard:where(:not(.sp-catalogue-facts)),
.chartwrap[data-view="space"]:has(.sp-ui[data-flight]) > #selcard:where(:not([data-target="body:mars"])) {
  inset: auto 16px var(--flight-bottom) 16px !important;
  width: min(440px, calc(100% - 32px)) !important;
  max-width: calc(100% - 32px);
  max-height: 50% !important;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  z-index: 5;
  transform: none;
  color: var(--flight-ink);
  font-size: 15px;
}
@media (max-width: 560px) {
  .chartwrap[data-view="space"]:has(> .sp-ui[data-flight]) > #selcard[data-target="hole:gaiabh2"]:not([hidden]) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #selcard[data-target="hole:gaiabh2"] > .sp-facts-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #selcard[data-target="hole:gaiabh2"] .sp-facts-copy {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  #selcard[data-target="hole:gaiabh2"] .sp-facts-body > .acts { flex: none; }
}
.chartwrap > #selcard :is(h3, .sp-facts-head h3) { font-size: 18px; }
.chartwrap > #selcard .dso-status { color: var(--flight-dim); }
.chartwrap:has(> #selcard:not([hidden])) > .sp-ui[data-flight] > .sp-target { visibility: hidden; }
.chartwrap[data-view="space"]:has(.sp-ui[data-flight]) > #selcard[data-exoplanet-facts] {
  max-height: min(38%, 300px) !important;
}
.chartwrap > #selcard[data-exoplanet-facts] .sp-facts-copy > .acts {
  position: static;
  margin: 8px 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.chartwrap > #selcard[data-exoplanet-facts] [data-act="sp-exo-target"] { min-height: 44px; }
.chartwrap:has(> .sp-ui[data-flight]) > #selcard:is([data-target="body:mars"], [data-target="body:moon"])
  :is(.sp-facts-copy, .sp-facts-body) > .acts {
  background: transparent;
  box-shadow: none;
}
.chartwrap:has(> .sp-ui[data-flight]) > #selcard:is([data-target="body:mars"], [data-target="body:moon"]) .sp-facts-copy > .acts {
  position: static;
  margin: 4px 0 8px;
  padding: 0;
}

.chartwrap :is(.sp-ui[data-flight] > .sp-target, .sp-ui[data-flight] > .sp-drive .btn,
    #sky-target, .sky-sheet, .sp-menu, .sp-ui[data-flight] .sp-time,
    .sp-menu .btn, .sky-sheet :is(.btn, .lpbtn), .sp-ui[data-flight] .sp-time .btn),
.chartwrap[data-view="sky"] > #selcard,
.chartwrap:has(.sp-ui[data-flight]) > #selcard:where(:not([data-target="body:mars"])) {
  background: var(--flight-bg);
  color: var(--flight-ink);
  border: 1px solid var(--flight-line);
  border-radius: 12px;
}
.chartwrap :is(.sp-target, .sp-menu, .sp-time, .sp-drive,
    #sky-target, .sky-sheet, #selcard) :is(.btn, input, select),
.chartwrap :is(.sp-target, #sky-target, .sky-sheet .lpbtn) { min-width: 44px; min-height: 44px; }
.chartwrap :is(.sp-time, .sky-sheet) .clock { gap: 8px; }
.chartwrap :is(.sp-menu, .sp-time, .sky-sheet) .seg { gap: 8px; border: 0; background: none; }
.chartwrap :is(.sky-sheet, .sp-menu, .sp-time, .sp-drive) .btn[aria-pressed="true"] {
  background: var(--flight-bg);
  color: var(--flight-focus);
  border-color: currentColor;
}
.chartwrap :is(.sky-sheet, .sp-menu, .sp-time, .sp-drive) :focus-visible,
:is(#sky-target, .sp-target):focus-visible {
  outline: 2px solid var(--flight-focus);
  outline-offset: -3px;
}
body.immersive.idle .chartwrap[data-view="sky"] > :is(.sky-sheet, #sky-target, #selcard),
body.immersive.idle .sp-ui[data-flight]:not([data-hud-idle]) > :is(.sp-menu, .sp-time, .sp-hint, .sp-lookback),
body.immersive.idle .sp-ui[data-flight] > :is(.sp-target, .sp-drive, .sp-impression, .sp-exo-chart, .sp-exo-descent),
body.immersive.idle .chartwrap:has(.sp-ui[data-flight]) > #selcard { opacity: 1; pointer-events: auto; }

.sp-ui > .sp-tourbar[data-grand-tour] {
  background: var(--surface); color: var(--ink); border-color: var(--control-line);
  align-items: center;
}
body.immersive.idle .sp-ui > .sp-tourbar[data-grand-tour] { opacity: 1; pointer-events: auto; }
body.immersive.idle .stage[data-view="space"]:has(.sp-ui:not([data-flight]) > [data-grand-tour]:not([hidden])) > .viewbar { opacity: 1; }
.sp-tourbar[data-grand-tour] .eyebrow { color: var(--ink2); }
.sp-tourbar[data-grand-tour] .sp-ta { flex-direction: row; flex-wrap: wrap; }
.sp-ui .sp-tourbar[data-grand-tour] .btn {
  min-height: 44px; min-width: 44px; padding-inline: 10px;
  background: var(--surface); color: var(--ink); border-color: var(--control-line);
}
.sp-ui .sp-tourbar[data-grand-tour] :is([data-sp="tresume"], [data-sp="tnext"]:first-child) {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.sp-tourbar[data-grand-tour] .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* 28 Nov launch-eve check: the glass above makes every tour bar white in a light-mode browser, but the Wow Tour and the
   rides kept the old white words, so their captions and Exit tour vanished. Words follow the glass, like the grand tour. */
.chartwrap .sp-tourbar { color: var(--ink); }
.chartwrap .sp-tourbar :is(.eyebrow, .sp-wowtruth, .sp-shower-source) { color: var(--ink2); }
.chartwrap .sp-tourbar .sp-wowcap { color: var(--ink); }
.chartwrap .sp-ui .sp-tourbar .btn.ghost { color: var(--ink); }
@media (max-width: 640px) {
  .sp-ui > .sp-tourbar[data-grand-tour] { align-items: stretch; }
  /* The compact HUD has its clock in the top bar. Clear the target pill and any credit at the foot. */
  .chartwrap[data-spmode="explore"]:not(:has(> #selcard:not([hidden]))) > .sp-ui[data-flight] > [data-grand-tour] {
    left: 16px; width: calc(100% - 32px); bottom: calc(var(--flight-bottom) + 52px);
  }
  .chartwrap[data-spmode="explore"]:not(:has(> #selcard:not([hidden]))) > .sp-ui[data-flight]:has(> .sp-impression:not([hidden])) > [data-grand-tour] {
    bottom: calc(var(--flight-bottom) + 88px);
  }
}
@media (max-width: 560px) {
  body.immersive .stage[data-view="space"]:has(.sp-ui:not([data-flight]) > [data-grand-tour]:not([hidden])) > .viewbar > .vb-full {
    display: inline-grid;
  }
}

/* An open compact Facts sheet and the tour use the same lower edge. Give each its own row. */
.chartwrap[data-view="space"][data-spmode="explore"]:has(> #selcard:not([hidden], [data-atlas-facts], [data-target="craft:voyager1"], [data-target="body:mars"])):has(> .sp-ui[data-flight] > [data-grand-tour]:not([hidden])) {
  --tour-footer: var(--flight-bottom);
  display: grid;
  grid-template: [scene] minmax(0, 1fr) [player] auto calc(var(--tour-footer) - 8px) / minmax(0, 1fr);
  row-gap: 8px;
}
.chartwrap[data-view="space"][data-spmode="explore"]:has(> #selcard:not([hidden], [data-atlas-facts], [data-target="craft:voyager1"], [data-target="body:mars"])) > .sp-ui[data-flight]:has(> [data-grand-tour]:not([hidden])) {
  position: relative;
  inset: auto;
  display: grid;
  grid-area: 1 / 1 / -1 / 2;
  grid-template-rows: subgrid;
  margin-top: var(--sp-ui-top);
}
.chartwrap[data-view="space"][data-spmode="explore"]:has(> #selcard:not([hidden], [data-atlas-facts], [data-target="craft:voyager1"], [data-target="body:mars"])) > .sp-ui[data-flight] > [data-grand-tour]:not([hidden]) {
  position: relative;
  inset: auto;
  grid-row: player;
  width: min(540px, calc(100% - 32px));
  margin-inline: 16px;
}
.chartwrap[data-view="space"][data-spmode="explore"]:has(> .sp-ui[data-flight] > [data-grand-tour]:not([hidden])) > #selcard:not([hidden], [data-atlas-facts], [data-target="craft:voyager1"], [data-target="body:mars"]) {
  position: relative;
  inset: auto !important;
  grid-area: scene / 1 / player;
  align-self: end;
  justify-self: end;
  margin-inline: 16px;
  max-height: min(var(--tour-facts-height, 24dvh), calc(100% - var(--sp-ui-top))) !important;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.chartwrap[data-view="space"][data-spmode="explore"]:has(> .sp-ui[data-flight] > [data-grand-tour]:not([hidden])) > #selcard:not([hidden], [data-atlas-facts], [data-target="craft:voyager1"], [data-target="body:mars"]) > .sp-facts-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
@media (width > 640px) {
  /* Leave room for Moon Facts to scroll between its header and two action rows. */
  .chartwrap[data-spmode="explore"]:has(> .sp-ui[data-flight] > [data-grand-tour]:not([hidden])) > #selcard[data-target="body:moon"]:not([data-atlas-facts]) {
    --tour-facts-height: max(38dvh, 300px);
  }
}
@media (max-width: 640px) {
  /* Scroll the copy and actions together below the fixed Moon heading. */
  .chartwrap[data-spmode="explore"]:has(> .sp-ui[data-flight] > [data-grand-tour]:not([hidden])) > #selcard[data-target="body:moon"] > .sp-facts-body {
    display: block;
  }
  .chartwrap[data-spmode="explore"]:has(> .sp-ui[data-flight] > [data-grand-tour]:not([hidden])) > #selcard[data-target="body:moon"] .sp-facts-copy {
    overflow: visible;
  }
  /* Two rows of full-size tap targets fit within the compact scrollport. */
  .chartwrap[data-spmode="explore"]:has(> .sp-ui[data-flight] > [data-grand-tour]:not([hidden])) > #selcard[data-target="body:moon"] .sp-facts-body > .acts {
    display: grid;
    grid-template-columns: repeat(4, minmax(44px, 1fr));
    gap: 4px;
    padding: 6px 10px 7px;
  }
  .chartwrap[data-spmode="explore"]:has(> .sp-ui[data-flight] > [data-grand-tour]:not([hidden])) > #selcard[data-target="body:moon"] .sp-facts-body > .acts > .btn {
    padding: 3px 4px;
    white-space: normal;
  }
  .chartwrap[data-spmode="explore"]:has(> .sp-ui[data-flight] > [data-grand-tour]:not([hidden])) > #selcard[data-target="body:moon"] .sp-facts-body > .acts > [data-act="sp-eyepiece"] {
    grid-column: span 2;
  }
}
/* Keep progress and actions visible while the reader has Facts open. */
.chartwrap[data-view="space"][data-spmode="explore"]:has(> #selcard:not([hidden], [data-atlas-facts], [data-target="craft:voyager1"], [data-target="body:mars"])) > .sp-ui[data-flight] > [data-grand-tour]:not(:has([data-sp="tresume"])) {
  align-items: center;
  flex-direction: row;
}
.chartwrap[data-view="space"][data-spmode="explore"]:has(> #selcard:not([hidden], [data-atlas-facts], [data-target="craft:voyager1"], [data-target="body:mars"])) > .sp-ui[data-flight] > [data-grand-tour]:not(:has([data-sp="tresume"])) > .sp-tt > p {
  display: none;
}
.chartwrap[data-view="space"][data-spmode="explore"]:has(> #selcard:not([hidden], [data-atlas-facts], [data-target="craft:voyager1"], [data-target="body:mars"])):has(> .sp-ui[data-flight] > .sp-impression:not([hidden]) ~ [data-grand-tour]:not([hidden])) {
  --tour-footer: calc(var(--flight-bottom) + 32px);
}
.chartwrap[data-view="space"][data-spmode="explore"]:has(> #selcard:not([hidden], [data-atlas-facts], [data-target="craft:voyager1"], [data-target="body:mars"])) > .sp-ui[data-flight]:has(> [data-grand-tour]:not([hidden])) > .sp-impression {
  top: auto;
  bottom: var(--flight-bottom);
}

@media (max-width: 640px) {
  /* The compact toolbar fills the first row. Keep the existing Exit button within reach below it. */
  body.immersive .stage[data-view="space"]:has(.sp-ui[data-flight]:not([data-hud-sheet="menu"], [data-hud-sheet="time"]) > [data-grand-tour]:not([hidden])) > .viewbar > .vb-full {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: inline-grid;
    width: auto;
    padding-inline: 10px !important;
    font-size: 13px !important;
  }
  body.immersive .stage[data-view="space"]:has(.sp-ui[data-flight] > [data-grand-tour]:not([hidden])) > .viewbar > .vb-full::after {
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.immersive .stage:has(.sp-ui[data-flight]) > .viewbar,
  .sp-ui[data-flight] > :is(.sp-hint, .sp-arrive, .sp-lookback) { transition: none; }
}

/* ===== Observatory look (owner pick, 25 Nov 2026: "Observatory everywhere", "Glass controls like Apple").
   One layer over the atlas layout: a quiet black stage, a sans wordmark, a slim navigation rail,
   frosted-glass controls and panels, and a light pill for the selected control. Tokens below; light mode gets a light glass. */
:root {
  --obs-bg: #f3f1ec; --obs-glass: rgba(255, 255, 255, .74); --obs-glass-strong: rgba(255, 255, 255, .9);
  --obs-edge: rgba(20, 24, 32, .11); --obs-hover: rgba(20, 24, 32, .06); --obs-sel: #16202c; --obs-sel-ink: #fbf8f2;
  --obs-ink2: #4d5969; --obs-blur: blur(22px) saturate(170%); --obs-shadow: 0 10px 30px rgba(20, 24, 32, .12);
  /* Craft pass (28 Nov): a quiet tinted fill for secondary buttons and fields, a solid card, a raised sheet. */
  --obs-fill: rgba(22, 32, 44, .065); --obs-fill-strong: rgba(22, 32, 44, .11); --obs-card: #fbfaf6; --obs-sheet: #fbfaf6;
  --obs-sheet-shadow: 0 24px 64px rgba(20, 24, 32, .18), 0 2px 6px rgba(20, 24, 32, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --obs-bg: #05070a; --obs-glass: rgba(24, 27, 34, .62); --obs-glass-strong: rgba(17, 20, 26, .86);
    --obs-edge: rgba(255, 255, 255, .09); --obs-hover: rgba(255, 255, 255, .07); --obs-sel: rgba(246, 247, 250, .94); --obs-sel-ink: #0b0d12;
    --obs-ink2: #a9b2c1; --obs-shadow: 0 12px 34px rgba(0, 0, 0, .45);
    --obs-fill: rgba(255, 255, 255, .075); --obs-fill-strong: rgba(255, 255, 255, .12); --obs-card: #101217; --obs-sheet: #14161b;
    --obs-sheet-shadow: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  }
}
:root[data-theme="dark"] {
  --obs-bg: #05070a; --obs-glass: rgba(24, 27, 34, .62); --obs-glass-strong: rgba(17, 20, 26, .86);
  --obs-edge: rgba(255, 255, 255, .09); --obs-hover: rgba(255, 255, 255, .07); --obs-sel: rgba(246, 247, 250, .94); --obs-sel-ink: #0b0d12;
  --obs-ink2: #a9b2c1; --obs-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --obs-fill: rgba(255, 255, 255, .075); --obs-fill-strong: rgba(255, 255, 255, .12); --obs-card: #101217; --obs-sheet: #14161b;
  --obs-sheet-shadow: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
}
html, body:has(.app) { background: var(--obs-bg); }
/* Retheme the atlas and flight surfaces the other layers already share. */
:root { --atlas-page: var(--obs-bg); --atlas-rule: var(--obs-edge); --atlas-sheet: var(--obs-glass-strong); }
html:root body .app .stage, html:root body .stage {
  --flight-bg: var(--obs-glass); --flight-line: var(--obs-edge); --flight-ink: var(--ink); --flight-dim: var(--obs-ink2);
}
/* Wordmark: the app's own sans, not the atlas serif. */
.brand h1 { font-family: var(--f-body); font-style: normal; font-weight: 650; font-size: 21px; letter-spacing: -0.015em; }
.brand svg { width: 30px; height: 30px; border-radius: 8px; box-shadow: none; }
.brand .sub, .brand .ver { display: none; }
/* Controls (craft pass, 28 Nov): one shape and three weights. Secondary is a quiet tinted fill, ghost is text until
   hovered, and primary (.on) is the one ember action in its group. A selected toggle takes the light pill.
   Frosted glass is kept for controls that float over a scene; reading surfaces stay solid. */
.btn, .sel { background: var(--obs-fill); border: 1px solid transparent; border-radius: 12px; }
.vtab {
  background: var(--obs-glass); border: 1px solid var(--obs-edge); border-radius: 12px;
  -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur);
}
.btn:hover { border-color: transparent; background: var(--obs-fill-strong); }
.vtab:hover { border-color: var(--obs-edge); background: color-mix(in srgb, var(--obs-glass) 70%, var(--obs-hover)); }
.btn.ghost { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn.ghost:hover { background: var(--obs-fill); }
.btn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.on:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn[aria-pressed="true"], .vtab[aria-selected="true"] {
  background: var(--obs-sel); color: var(--obs-sel-ink); border-color: transparent;
}
/* Over a scene: frosted glass with a hairline, so the control reads on stars, clouds or the Sun. Same weight as the
   old rule (one class), so every component rule in style.css still wins. */
:where(.chartwrap) .btn {
  background: var(--obs-glass); border-color: var(--obs-edge);
  -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur);
}
:where(.chartwrap) .btn:hover { border-color: var(--obs-edge); background: color-mix(in srgb, var(--obs-glass) 70%, var(--obs-fill-strong)); }
/* Inside a card or sheet that already floats on the scene: a solid tint, never glass on glass. */
:where(.chartwrap :is(#selcard, .ea-card, .sp-menu, .sp-time, .sp-info, .sp-pick, .sp-tourbar, .sp-card, .sp-panel, .ea-layers)) .btn {
  background: var(--obs-fill); border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
}
:where(.chartwrap :is(#selcard, .ea-card, .sp-menu, .sp-time, .sp-info, .sp-pick, .sp-tourbar, .sp-card, .sp-panel, .ea-layers)) .btn:hover {
  background: var(--obs-fill-strong); border-color: transparent;
}
/* Header: one quiet row. Text buttons until hovered; search reads as a field. */
.top .btn:not(.find-trigger), .top .whats-new-entry { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--obs-ink2); font-weight: 550; }
.top .btn:not(.find-trigger):hover, .top .whats-new-entry:hover { background: var(--obs-hover); color: var(--ink); }
.top .find-trigger { min-width: 240px; justify-content: flex-start; color: var(--obs-ink2); font-weight: 500; border-radius: 12px; }
.top .sel { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.top .sel:hover { background: var(--obs-hover); }
.place-note { color: var(--obs-ink2); }
/* Navigation rail: no boxed tab, a soft fill for the current page. */
.tab[aria-current="page"] { background: var(--obs-hover); color: var(--ink); box-shadow: none; }
.tab[aria-current="page"] svg { color: var(--ink); }
@media (hover: hover) { .tab:hover { background: var(--obs-hover); } }
@media (min-width: 1280px) {
  body:not(.immersive) .layout #tabs { border-inline-end: 0; background: transparent; padding: 6px 8px; }
  body:not(.immersive) #tabs .tab { min-height: 40px; border-radius: 10px; font-weight: 550; color: var(--obs-ink2); }
  body:not(.immersive) #tabs .tab[aria-current="page"] { color: var(--ink); font-weight: 650; }
}
/* The stage: a black, borderless viewport. */
.chartwrap { border: 0; border-radius: 18px; box-shadow: 0 0 0 1px var(--obs-edge), var(--obs-shadow); background: #000; }
/* Toolbar above the view: Sky, Space and Earth as one segmented control; the tools sit to the right. */
html:root body .stage > .viewbar { gap: 8px; }
@media (min-width: 561px) { html:root body .stage > .viewbar > .vtab + .vtab { margin-inline-start: -9px; } }
html:root body .stage > .viewbar > .vtab { border-radius: 0; }
html:root body .stage > .viewbar > .vtab:first-of-type { border-radius: 13px 0 0 13px; }
html:root body .stage > .viewbar > #vt-earth { border-radius: 0 13px 13px 0; margin-inline-end: 4px; }
html:root body .stage > .viewbar > .vtab[aria-selected="true"] { border-radius: 10px; box-shadow: 0 0 0 4px var(--obs-glass), 0 0 0 5px var(--obs-edge); position: relative; z-index: 1; }
@media (min-width: 1040px) { html:root body:not(.immersive) .stage > .viewbar > .vb-red { margin-inline-start: auto; } }
/* Panels and cards floating over the view. */
.chartwrap :is(#selcard, .sky-sheet, .ea-card, .sp-menu, .sp-time, .sp-info, .sp-pick, .sp-tourbar, .ea-time) {
  background: var(--obs-glass-strong); border: 1px solid var(--obs-edge); border-radius: 16px;
  -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur); box-shadow: var(--obs-shadow);
}
.panel { background: transparent; border-color: var(--obs-edge); box-shadow: none; }
html:root body .stage > .viewbar > :is(.vtab[aria-selected="true"], .btn[aria-pressed="true"]:not(.vb-red)) {
  background: var(--obs-sel); color: var(--obs-sel-ink); border-color: transparent;
}
html:root body .stage > .viewbar > :is(.vtab, .btn) { -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur); }
/* Reading panels under the view: no boxed navy cards, just hairlines. */
.stage > .chart-options > .opts, .stage > .opts { background: transparent; border-color: var(--obs-edge); }
/* Tonight's pick on phones: a glass card, not an outlined box. */
.pick-strip { background: var(--obs-glass); border: 1px solid var(--obs-edge); -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur); }
/* Observatory pass 2: one typeface. Readouts, labels and chips set in Hanken Grotesk with even-width figures, the way the
   Observatory mockups show them; only things people copy or type as code keep the monospace. */
:root { --f-code: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace; --f-mono: var(--f-body); }
:is(dd, .mono, .val, time, .chip, .caption, .eyebrow, .times, .ev .when, .sp-py, #sky-time-value, .wx-t b) { font-variant-numeric: tabular-nums; }
:is(kbd, textarea.tle, #lg-copybox textarea, .fcustom input, .clock input[type="date"]) { font-family: var(--f-code); }
.selcard dd, .card .stats dd, .times dd, .row .val { font-weight: 550; letter-spacing: -0.005em; }
:is(.eyebrow, .grp, .guide .key-grid h4, .pick-strip .ps-l, .newtag) { letter-spacing: 0.07em; font-weight: 600; }
/* Reading pages: the Tonight page and its neighbours drop the old navy for the same neutral black as the stage.
   Night vision keeps its own colours (html.redm). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not(.redm) .tonight-page { --tn-bg: #0b0c0f; --tn-dim: #b4bac6; --tn-line: #2b2f38; }
  :root:not([data-theme="light"]):not(.redm) .tonight-first:not(.immersive):has(.tonight-page) { background: #0b0c0f; }
  :root:not([data-theme="light"]):not(.redm) { --place-clock-bg: #111318; --place-clock-meta: #b4bac6; }
}
:root[data-theme="dark"]:not(.redm) .tonight-page { --tn-bg: #0b0c0f; --tn-dim: #b4bac6; --tn-line: #2b2f38; }
:root[data-theme="dark"]:not(.redm) .tonight-first:not(.immersive):has(.tonight-page) { background: #0b0c0f; }
:root[data-theme="dark"]:not(.redm) { --place-clock-bg: #111318; --place-clock-meta: #b4bac6; }
:root:not(.redm) .sp-info:has(.sp-dso-source) { background: var(--obs-glass-strong); }

/* ===== Craft pass (28 Nov 2026, owner: "improve the actual UI, the buttons and professional ness... insanely easy to read").
   One system over the Observatory look: a single typeface for every heading, two radii (12 px controls and tiles, 20 px
   sheets and dialogs), 44 px touch targets, solid reading surfaces, and ember kept for the main action and where you are. */

/* Type: one family. The serif italic headings left over from the atlas look become the app's sans, weight carries rank. */
h3.sec, .card h4, .nexte h4, .guide h2, .coach-card h3, .ea-card h3, .ea-tt, .lab-tile b, .ln-big b, .moon-card b,
.selcard h3, .verdict, .about-sources h2, #locdlg h2, .cust h2, .lg-top h2, .lg-fh h3, .lg-entry h4,
details.lg-sec > summary > span:first-child {
  font-family: var(--f-body); font-style: normal; font-weight: 650; letter-spacing: -0.015em;
}
.verdict { font-size: 1.875rem; line-height: 1.15; letter-spacing: -0.025em; } /* the same 30 px as Worlds and Learn */
/* The rest of the old serif italic: the black hole and Orion visits, the eyepiece, trip planner, Supporter sheet,
   energy, ocean pass, pyramid, cosmic maker and ancient-sky pages. Some inject their styles at run time, so the html
   prefix keeps this rule ahead of theirs. Sizes stay theirs. */
html :is(.strip-h h2, .ln-face, .bh-name, #orion-title, .orion-facts h2, .ep-top h2, .old-scene-guide h3, .mx-polar h3,
  .nh-visit h2, .en-masthead h2, #tp-energy :is(.en-b3, .en-planet, .en-layer) h4, .cp-pair, .ocean-pass h2,
  .na-planner :is(h2, h3, .np-target h4), .na-pyramid h2, .na-cosmic :is(h2, h3), .ancient-title h2, .sup-h, .sup-status b) {
  font-family: var(--f-body); font-style: normal; font-weight: 650; letter-spacing: -0.015em;
}
html .cp-pct { font-family: var(--f-body); font-weight: 650; }
h3.sec { font-size: 1.25rem; line-height: 1.3; }
.card h4, .nexte h4 { font-size: 1.0625rem; line-height: 1.3; }
#locdlg h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.ev .date b { font-family: var(--f-body); font-weight: 650; font-size: 1.25rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wx-big { font-family: var(--f-body); font-weight: 300; letter-spacing: -0.04em; }
/* Nothing under 12 px: chips, dates and group labels were 10.5 to 11.5 px. */
.chip { font-size: .75rem; font-weight: 600; letter-spacing: 0; padding: 2px 8px; line-height: 1.5; }
.grp { font-size: .75rem; font-weight: 650; letter-spacing: .06em; }
.ev .date span, .ev .when, .times dt, .times dd small, .card .stats dt, .key { font-size: .75rem; }
.ev .date span { font-weight: 600; letter-spacing: .04em; }
/* Readable secondary text: the "looks fainter" note fell back to an undefined grey (2:1 on the light page). */
.target-visibility .target-verdict { color: var(--ink2); font-size: var(--text-small); }

/* A heading that receives focus after a page change is a landmark for screen readers, not a control: no focus box. */
:is(h1, h2, h3, h4)[tabindex="-1"]:focus, :is(h1, h2, h3, h4)[tabindex="-1"]:focus-visible,
#tp-learn :is(h1, h2, h3)[tabindex="-1"]:focus-visible { outline: none; }

/* Buttons in reading pages: 44 px on touch, 40 px with a mouse, one radius, label never squeezed. */
.panel .btn, .panel .btn.sm, #locdlg .btn, dialog#display-quality .btn, .cust .btn { border-radius: 12px; }
@media (hover: hover) and (pointer: fine) {
  .panel .btn, .panel .btn.sm { min-height: 40px; padding-block: 0; padding-inline: 14px; }
}
@media (pointer: coarse) {
  .panel .btn, .panel .btn.sm { min-height: 44px; }
}
.panel .btn.sm { font-size: var(--text-label); }
/* Quiet secondaries: a row of equal boxed buttons read as noise. Repeated row actions sit as tinted pills of one weight. */
.ev .btn, .card .acts .btn:not(.on), .target-actions .btn:not(.on), .about-actions .btn { background: var(--obs-fill); border-color: transparent; }
.ev .btn:hover, .card .acts .btn:not(.on):hover, .target-actions .btn:not(.on):hover, .about-actions .btn:hover { background: var(--obs-fill-strong); }
/* Targets: the first row's Show on chart is the main action, so it is the filled one (it was a third, outlined style). */
#tp-targets > :nth-child(1 of :is(section, .reach[open]):has(> .target-row)) > .target-row:first-of-type .target-actions [data-act="sel"] {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
}

/* Worlds: Browse exoplanets is a secondary action, the search a field like every other. */
.world-page-head .exo-entry > .btn { background: var(--obs-fill); border-color: transparent; border-radius: 12px; }
.world-search input, .world-weight input { border-radius: 12px; }
/* Learn course: the old navy paper becomes the app's neutral night surface; the current section is ink on a soft fill. */
html #tp-learn[data-course][data-course-theme="dark"] {
  --course-paper: #0b0c0f; --course-tile: #131519; --course-rule: #262a32; --course-border: #7d8594; --course-selection: rgba(255, 255, 255, .08);
}
html body #tp-learn[data-course] #ln-nav .en-pill[aria-pressed="true"] { color: var(--course-ink); font-weight: 650; }
html body #tp-learn[data-course] .course-overview li button { border-color: var(--course-rule); }

/* Cards and notices: solid, hairline, 12 px. No coloured borders; ember stays for actions. */
.card, .ln-tile, .ln-deck, .ln-big, #tp-targets .target-row, .target-body { background: var(--obs-card); border: 1px solid var(--obs-edge); border-radius: 12px; }
#tp-targets .target-row + .target-row { border-top-color: var(--obs-edge); }
.target-body:is(:hover, :focus-visible) { border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.target-gear { background: var(--obs-fill); }
.ln-big { background: var(--obs-card); }
.nexte { background: var(--obs-card); border: 1px solid var(--obs-edge); border-radius: 12px; padding: 16px; gap: 8px; }
.nexte p { color: var(--ink2); }
.notice, .target-tonight { border-radius: 12px; }
.target-tonight { background: var(--obs-fill); font-weight: 550; padding: 12px 16px; }
.ev .date { background: var(--obs-fill); border-radius: 12px; padding: 6px 0 5px; }
.chip { background: var(--obs-fill); color: var(--ink2); }
.chip.good { background: var(--accent-soft); color: var(--accent); }

/* Links inside UI text: one ember action, the rest ink. */
.place-note .linkbtn + .linkbtn { color: var(--ink2); }
.place-note .linkbtn { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Header: every control 40 px with a mouse, 44 px on touch; search reads as a field, place as a quiet picker. */
.top .btn, .top .sel select { min-height: 40px; }
.top .find-trigger { background: var(--obs-fill); border-color: transparent; min-width: 260px; padding-inline: 12px 16px; gap: 10px; }
.top .find-trigger:hover { background: var(--obs-fill-strong); color: var(--ink); }
.top .find-trigger svg { width: 18px; height: 18px; }
.top .sel { padding-inline: 12px 4px; border-radius: 12px; background: var(--obs-fill); }
.top .sel:hover { background: var(--obs-fill-strong); }
.top .sel span { font-size: var(--text-caption); font-weight: 600; color: var(--obs-ink2); }
.top .sel select { font-weight: 600; }
@media (pointer: fine) { .top .sel select { font-size: .9375rem; } }
@media (pointer: coarse) { .top .btn, .top .sel select { min-height: 44px; } }
/* Phone header: the brand holds the left, Take the tour and Place sit together on the right at one size. */
@media (max-width: 560px) {
  .top .brand { margin-inline-end: auto; }
  .top .whats-new-entry, .top .top-ctl-toggle { margin-inline-start: 0; padding-inline: 10px; font-size: var(--text-small); font-weight: 600; }
}

/* Side menu (wide screens): where you are gets the ember icon and full ink, everything else is quiet. */
.tab[aria-current="page"] svg { color: var(--accent); }
#tabs .tab svg { width: 18px; height: 18px; }

/* Phone bar: frosted like the system tab bar, one ember mark for where you are. */
@media (max-width: 560px) {
  #phone-nav {
    background: color-mix(in srgb, var(--obs-bg) 86%, transparent); border-top: 1px solid var(--obs-edge);
    -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur);
  }
  #phone-nav .tab { color: var(--obs-ink2); font-weight: 600; letter-spacing: 0; }
  #phone-nav .tab[aria-current="page"] { background: transparent; color: var(--ink); }
  #phone-nav .tab[aria-current="page"] svg { color: var(--accent); }
  #phone-nav .tab svg { width: 22px; height: 22px; }
  /* Section tabs: ink for the current one, an ember rule under it. */
  #section-nav:not([hidden]) { border-bottom-color: var(--obs-edge); }
  #section-nav button { color: var(--obs-ink2); font-size: var(--text-small); }
  #section-nav button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
}

/* Sheets and dialogs: one solid raised surface, 20 px corners, a quiet Close. */
#locdlg, dialog#display-quality {
  background: var(--obs-sheet); border: 1px solid var(--obs-edge); border-radius: 20px; box-shadow: var(--obs-sheet-shadow);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
#locdlg .loc-h, #locdlg .loc-alternatives { border-color: var(--obs-edge); }
#locdlg .loc-field, #locdlg .loc-form :is(input, select) { border-radius: 12px; }
:is(#loc-close, #display-quality .mx-top > .btn) {
  padding-inline: 14px; border-radius: 12px; background: var(--obs-fill); border-color: transparent; color: var(--ink);
}
@media (pointer: fine) { :is(#loc-close, #display-quality .mx-top > .btn) { min-height: 36px; } }
@media (max-width: 760px) { dialog#display-quality { border-radius: 20px 20px 0 0; border-bottom: 0; } }
#browse-sheet { border-radius: 20px; box-shadow: var(--obs-sheet-shadow); }
#browse-sheet #browse-close { border-color: transparent; background: color-mix(in srgb, var(--find-ink) 8%, transparent); }
#browse-sheet .find-field { border-radius: 12px; }

/* Scene controls (Space and Earth): every control over a scene is the same frosted chip, 44 px, 12 px corners, so
   Earth's bare text buttons, outlined zoom boxes and the borderless Night vision now match Space's toolbar. */
.stage:is([data-view="space"], [data-view="earth"]) > .viewbar > .btn:is(.vb-red, .vb-full, .vb-find) {
  min-height: 44px; padding-inline: 12px; background: var(--obs-glass); border: 1px solid var(--obs-edge); border-radius: 12px;
  color: var(--ink); -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur);
}
.stage:is([data-view="space"], [data-view="earth"]) > .viewbar > .btn.vb-find { padding-inline: 0; }
.stage:is([data-view="space"], [data-view="earth"]) > .viewbar > .btn:is(.vb-red, .vb-full, .vb-find):hover { background: color-mix(in srgb, var(--obs-glass) 70%, var(--obs-fill-strong)); }
.stage:is([data-view="space"], [data-view="earth"]) > .viewbar > .btn { font-size: var(--text-label); }
.ea-ui :is(.ea-top, .ea-side, .ea-time, .ea-view-options) .btn, .ea-ui .ea-home, .ea-framed .ea-top .btn,
.chartwrap[data-view="earth"] > .aurora-inspect {
  background: var(--obs-glass-strong); color: var(--ink); border: 1px solid var(--obs-edge); border-radius: 12px;
  -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur); box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.ea-ui :is(.ea-top, .ea-side, .ea-time, .ea-view-options) .btn:hover, .ea-ui .ea-home:hover, .ea-framed .ea-top .btn:hover,
.chartwrap[data-view="earth"] > .aurora-inspect:hover { background: var(--obs-glass-strong); border-color: color-mix(in srgb, var(--ink) 30%, transparent); color: var(--ink); }
.ea-ui :is(.ea-top, .ea-side, .ea-time, .ea-view-options) .btn[aria-pressed="true"], .ea-framed .ea-top .btn[aria-expanded="true"] {
  background: var(--obs-sel); color: var(--obs-sel-ink); border-color: transparent;
}
.ea-ui .ea-side .btn { font-size: 20px; font-weight: 500; }
/* Space: the first-use hint's Got it is a real 36 px button, not a 27 px chip. */
.sp-hint { background: var(--obs-glass-strong); color: var(--ink); border-color: var(--obs-edge); border-radius: 14px; padding: 10px 10px 10px 16px; line-height: 1.4;
  -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur); box-shadow: var(--obs-shadow); }
.sp-hint .btn { flex: none; min-height: 36px; padding-inline: 14px; border-radius: 10px; background: var(--obs-fill-strong); border-color: transparent; color: var(--ink); font-size: var(--text-label); }
@media (pointer: coarse) { .sp-hint .btn { min-height: 44px; } }

/* Observatory pass 3: the in-view card. In explore mode the target pill grows into the picked mockup's glass card: kind, name,
   up to three facts, actions and one source line. The pill and its note stay in the page and come back in drive mode, tours and
   exoplanet systems; the card stands in for them only while it is shown. */
.sp-card[hidden], .sp-card [hidden], .sp-ui:not([data-flight]) > .sp-card,
.sp-ui[data-flight][data-card] > :is(.sp-target, .sp-impression) { display: none !important; }
.chartwrap:not([data-view="earth"]):has(> .sp-ui[data-flight][data-card]) > .aurora-inspect { left: 16px; bottom: calc(var(--flight-bottom) + var(--sp-card-h, 44px) + 8px); }
.chartwrap:has(> #selcard:not([hidden])) > .sp-ui[data-flight] > .sp-card { visibility: hidden; }
@media (min-width: 1024px) {
  /* Wide layouts keep Facts beside the view, so the card stays, folded to its one row. */
  body:not(.immersive) .chartwrap:has(> #selcard:not([hidden])) > .sp-ui[data-flight] > .sp-card { visibility: visible; }
}
.sp-ui[data-flight] > .sp-card {
  position: absolute; left: 16px; bottom: var(--flight-bottom); box-sizing: border-box;
  width: min(380px, calc(100% - 32px)); margin: 0; padding: 18px 20px 14px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  background: var(--obs-glass-strong); color: var(--ink); border: 1px solid var(--obs-edge); border-radius: 18px;
  -webkit-backdrop-filter: var(--obs-blur); backdrop-filter: var(--obs-blur); box-shadow: var(--obs-shadow);
  font-family: var(--f-body); font-size: 13px; line-height: 1.3; text-align: start;
}
.redm .sp-ui[data-flight] > .sp-card {
  --obs-glass: rgba(24, 27, 34, .62); --obs-glass-strong: rgba(17, 20, 26, .9); --obs-edge: rgba(255, 255, 255, .12);
  --obs-hover: rgba(255, 255, 255, .07); --obs-sel: rgba(246, 247, 250, .94); --obs-sel-ink: #0b0d12; --obs-ink2: #b4bcc9;
}
.sp-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; color: var(--obs-ink2); }
.sp-card-kind { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-card-range { flex: none; font-variant-numeric: tabular-nums; }
.sp-card-name {
  appearance: none; display: flex; align-items: center; justify-self: start; max-width: 100%; min-height: 44px; margin: -10px 0 -6px; padding: 0;
  background: none; border: 0; border-radius: 8px; color: inherit; cursor: pointer;
  font: 650 30px/1.12 var(--f-body); letter-spacing: -0.02em; text-align: start; text-wrap: balance; overflow-wrap: anywhere;
}
.sp-card-stats {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, auto); margin: 0; padding: 12px 0;
  border-block: 1px solid var(--obs-edge);
}
.sp-card-stats > div { min-width: 0; padding-inline: 14px 8px; border-inline-start: 1px solid var(--obs-edge); }
.sp-card-stats > div:first-child { padding-inline-start: 0; border-inline-start: 0; }
.sp-card-stats dt { color: var(--obs-ink2); font-size: 12px; }
.sp-card-stats dd { margin: 4px 0 0; font-size: 16px; font-weight: 550; letter-spacing: -0.005em; font-variant-numeric: tabular-nums; }
.sp-card-stats dd > span { white-space: nowrap; }
.sp-card-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-card-acts > .btn { min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 12px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.sp-card-acts > .btn:not(.sp-card-go) { background: var(--obs-fill); color: var(--ink); border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.sp-card-acts > .btn:not(.sp-card-go):hover { background: var(--obs-fill-strong); }
/* Craft pass: the card's main action is the app's one primary style (ember), not the selected-toggle pill. */
.sp-card-acts > .sp-card-go { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.sp-card-acts > .sp-card-go:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); color: var(--accent-ink); border-color: transparent; }
.sp-card-narrow, .sp-card-fold { display: none; }
.sp-card-day { width: 100%; min-height: 44px; padding: 0 16px; border-radius: 12px; font-size: 15px; font-weight: 600; background: var(--obs-fill); color: var(--ink); border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.sp-card-day[hidden], .sp-card[data-folded] > .sp-card-day { display: none; }
.sp-card-note { display: flex; align-items: baseline; gap: 8px; margin: 0; color: var(--obs-ink2); font-size: 12.5px; }
.sp-card-note::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.sp-card :is(.sp-card-name, .sp-card-fold, .btn):focus-visible { outline: 2px solid var(--flight-focus); outline-offset: 2px; }
.sp-card > .sp-card-name:focus-visible { outline-offset: -2px; }
/* Folded: one row, name then range. Used while Facts is open beside the view, in short views, and when a phone folds it. */
.sp-ui[data-flight] > .sp-card[data-folded] { width: auto; max-width: calc(100% - 32px); grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; padding: 0 16px; border-radius: 14px; }
.sp-card[data-folded] > :is(.sp-card-stats, .sp-card-acts, .sp-card-note), .sp-card[data-folded] .sp-card-kind { display: none; }
.sp-card[data-folded] > .sp-card-name { grid-area: 1 / 1; margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0; }
.sp-card[data-folded] > .sp-card-head { grid-area: 1 / 2; }
body.immersive.idle .sp-ui[data-flight] > .sp-card { opacity: 1; pointer-events: auto; }
@media (max-width: 640px) {
  /* Phones: the mockup's bottom sheet. A grab handle folds it to one row; two actions share the row. */
  .sp-ui[data-flight] > .sp-card, .sp-ui[data-flight] > .sp-card[data-folded] {
    left: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: calc(100% - 16px); max-width: none; padding: 22px 16px 12px; gap: 10px; border-radius: 20px;
  }
  .sp-ui[data-flight] > .sp-card[data-folded] { padding: 10px 16px 0; }
  .chartwrap:not([data-view="earth"]):has(> .sp-ui[data-flight][data-card]) > .aurora-inspect { left: 8px; bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--sp-card-h, 44px) + 8px); }
  .sp-card-fold {
    appearance: none; display: block; position: absolute; top: -10px; left: 50%; width: 88px; height: 44px; margin-left: -44px; padding: 0;
    background: none; border: 0; border-radius: 12px; cursor: pointer;
  }
  .sp-card-fold::before { content: ""; position: absolute; top: 18px; left: 26px; width: 36px; height: 4px; border-radius: 2px; background: var(--obs-ink2); opacity: .55; }
  .sp-card-name { font-size: 26px; }
  .sp-card-stats { padding: 10px 0 0; border-block-end: 0; }
  .sp-card-stats > div { padding-inline: 0 8px; border-inline-start: 0; }
  .sp-card-acts { flex-wrap: nowrap; }
  .sp-card-acts > .btn { flex: 1 1 0; padding: 0 10px; }
  .sp-card-acts:has(> .sp-card-go:not([hidden])):has(> .sp-card-sky:not([hidden])) > .sp-card-facts { display: none; }
  .sp-card-wide { display: none; }
  .sp-card-narrow { display: inline; }
}
@media (max-width: 560px) {
  .sp-ui[data-flight][data-sun-card] > .sp-card[data-folded] {
    grid-template-columns: 36px minmax(0, 1fr); gap: 0 10px; padding: 0 12px 6px; border-radius: 14px;
  }
  .sp-ui[data-sun-card] .sp-card-fold { display: none; }
  .sp-ui[data-sun-card] .sp-card[data-folded] > .sp-card-name {
    grid-area: 1 / 1 / 2 / -1; justify-self: stretch; justify-content: space-between;
  }
  .sp-ui[data-sun-card] .sp-card-name::after { content: "Facts"; font-size: 13px; color: var(--flight-dim); }
  .sp-ui[data-sun-card] .sp-card-head { display: block; margin-inline-end: 46px; text-align: end; pointer-events: none; }
  .sp-ui[data-sun-card] .sp-card-range { white-space: pre-line; font-size: 12.5px; }
  .sp-ui[data-sun-card] .sp-card[data-folded] > .sp-card-note:not([hidden]) {
    display: block; grid-area: 2 / 1 / 3 / -1; padding-top: 4px; border-top: 1px solid var(--obs-edge);
  }
  .sp-ui[data-sun-card] .sp-card-note::before { content: none; }
  .chartwrap[data-view="space"]:has(> .sp-ui[data-flight][data-sun-card]) > #selcard[data-target="body:sun"]:not([hidden]) {
    inset: auto 8px 8px !important; width: auto !important; max-width: none; max-height: min(456px, calc(100% - 122px)) !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .sp-ui[data-flight] > .sp-card { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Phone header (first-look panel, 25 Nov): search reads as a field, and on the Tonight page night vision sits
   beside Settings instead of alone on a bar of its own. */
.top .top-red { display: none; }
@media (max-width: 560px) {
  .top .top-ctl .find-trigger { background: var(--obs-hover); border: 1px solid var(--obs-edge); color: var(--obs-ink2); }
  body.tonight-first:not(.immersive) .top .top-red { display: inline-grid; place-items: center; flex: none; width: 44px; min-height: 44px; padding: 0; color: #e2473b; }
  .top .top-red svg { width: 22px; height: 22px; }
  body.tonight-first:not(.immersive) .top .top-red[aria-pressed="true"] { background: #5a0000; color: #ffb0b0; border-color: #a00000; }
  body.tonight-first:not(.immersive) .layout > .stage { display: none; }
}
/* Earth (first-look panel, 25 Nov): the Auroras button sat on the caption, and on phones the time controls drew an
   empty box. Auroras moves under the top bar; the time controls hug their buttons. */
.chartwrap[data-view="earth"] > .aurora-inspect { top: 88px; bottom: auto; left: 12px; }
@media (max-width: 640px) { .chartwrap .ea-time { left: auto; max-width: calc(100% - 28px - var(--tap)); } }

.ea-phone-shortcuts { display: none; }
@media (max-width: 560px) {
  body:not(.immersive):has(.layout:not(.phone-library) > .stage:is([data-view="space"], [data-view="earth"])) {
    --scene-page-top: max(8px, env(safe-area-inset-top));
    margin: 0;
    padding: var(--scene-page-top) max(12px, env(safe-area-inset-right)) var(--phone-nav-space) max(12px, env(safe-area-inset-left));
  }
  body:not(.immersive) .app:has(> .layout:not(.phone-library) > .stage:is([data-view="space"], [data-view="earth"])) {
    height: calc(100dvh - var(--phone-nav-space) - var(--scene-page-top));
    min-height: calc(min(420px, 65dvh) + 72px);
    gap: 8px;
  }
  body:not(.immersive) .app:has(> .layout:not(.phone-library) > .stage:is([data-view="space"], [data-view="earth"])) .top #browse-open {
    display: none;
  }
  body:not(.immersive) .layout:not(.phone-library):has(> .stage:is([data-view="space"], [data-view="earth"])) {
    flex: 1;
    align-items: stretch;
    grid-template-rows: minmax(min-content, 1fr) auto;
    row-gap: 8px;
    min-height: 0;
  }
  .stage:is([data-view="space"], [data-view="earth"]) {
    --scene-tools-inset: 12px;
    --scene-tools-bottom: calc(var(--scene-tools-inset) + var(--sky-viewbar-height, 44px));
  }
  body.immersive .stage[data-view="earth"] { --scene-tools-inset: 8px; }
  body:not(.immersive) .stage:is([data-view="space"], [data-view="earth"]) { position: relative; }
  body:not(.immersive) .stage:is([data-view="space"], [data-view="earth"]) > .chartwrap {
    flex: 1 1 0;
    aspect-ratio: auto;
    min-height: min(420px, 65dvh);
  }
  body:not(.immersive) .stage > .chartwrap[data-view="earth"].ea-framed {
    max-height: none;
  }
  body:not(.immersive) .stage:is([data-view="earth"], [data-view="space"]:has(.sp-ui[data-flight])) > .chart-options {
    display: none;
  }
  :is(body:not(.immersive) .stage[data-view="space"], body .stage[data-view="earth"]) > .viewbar {
    position: absolute;
    inset: var(--scene-tools-inset) 12px auto;
    z-index: 3;
    padding: 0;
    flex-wrap: nowrap;
    pointer-events: none;
  }
  :is(body:not(.immersive) .stage[data-view="space"], body .stage[data-view="earth"]) > .viewbar > .btn {
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    border: 1px solid var(--flight-line);
    border-radius: 12px;
    background: var(--flight-bg);
    color: var(--flight-ink);
    pointer-events: auto;
  }
  :is(body:not(.immersive) .stage[data-view="space"], body .stage[data-view="earth"]) > .viewbar > .vb-find {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding-inline: 10px;
  }
  :is(body:not(.immersive) .stage[data-view="space"], body .stage[data-view="earth"]) > .viewbar > .vb-find::after {
    content: "Search";
  }
  :is(body:not(.immersive) .stage[data-view="space"], body .stage[data-view="earth"]) > .viewbar > .vb-menu {
    margin-inline-start: auto;
  }
  :is(body:not(.immersive) .stage[data-view="space"], body .stage[data-view="earth"]) > .viewbar > .vb-time {
    width: auto;
    min-width: 64px;
    padding-inline: 8px;
  }
  :is(body:not(.immersive) .stage[data-view="space"], body .stage[data-view="earth"]) > .viewbar > .btn:is([aria-expanded="true"], :focus-visible) {
    outline: 2px solid var(--flight-focus);
    outline-offset: -3px;
  }
  :is(body:not(.immersive) .stage[data-view="space"], body .stage[data-view="earth"]) > .viewbar > .vb-red[aria-pressed="true"] {
    background: #5a0000;
    color: #ffb0b0;
  }
  body:not(.immersive) .stage[data-view="space"] .chartwrap {
    --flight-top: var(--scene-tools-bottom);
  }
  body:not(.immersive) .stage[data-view="space"]:has(.sp-ui[data-flight][data-hud-idle]) > .viewbar {
    opacity: 0;
  }
  @media (prefers-reduced-motion: no-preference) {
    body:not(.immersive) .stage[data-view="space"]:has(.sp-ui[data-flight]) > .viewbar { transition: opacity 150ms ease-out; }
    body:not(.immersive) .stage[data-view="space"]:has(.sp-ui[data-flight][data-hud-idle]) > .viewbar { transition-duration: 180ms; }
  }
  body:not(.immersive) .stage[data-view="space"] .sp-ui:not([data-flight]) {
    --sp-ui-top: var(--scene-tools-bottom);
  }
  body:not(.immersive) .chartwrap[data-view="space"] .sp-ui[data-flight] > .sp-arrive:not([hidden]) ~ [data-sp="lookback"] {
    bottom: max(76px, calc(var(--sp-card-h, 0px) + 16px));
  }
  body:not(.immersive) .chartwrap[data-view="space"]:has(> #selcard:not([hidden])) .sp-ui[data-flight] > .sp-arrive:not([hidden]) ~ [data-sp="lookback"] {
    bottom: calc(50% + var(--flight-bottom) + 8px);
  }
  body.immersive:has(.stage[data-view="space"]) > .lu-bar:not([data-m31-arrival]) {
    top: calc(env(safe-area-inset-top, 0px) + 16px + var(--sky-viewbar-height, 44px));
    bottom: auto;
    width: min(460px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  }
  body.immersive:has(.stage[data-view="space"] :is(.sp-ui:is([data-hud-sheet="menu"], [data-hud-sheet="time"]),
    :is(.sp-panel, .sp-homemap, #selcard, .sp-sun-hud):not([hidden]))) > .lu-bar:not([data-m31-arrival]) {
    visibility: hidden;
  }
  body.immersive:has(> .lu-bar:not([hidden], [data-m31-arrival])) .stage[data-view="space"] .sp-ui > :is(.sp-arrive, .sp-lookback) {
    visibility: hidden;
  }
  body .stage[data-view="earth"] > .viewbar > .vb-earth { display: inline-grid; }
  body .stage[data-view="earth"] > .viewbar > .vb-full { display: none; }
  body.immersive .stage[data-view="earth"] > .viewbar {
    top: calc(var(--scene-tools-inset) + env(safe-area-inset-top, 0px));
    background: none;
  }
  body.immersive.idle .stage[data-view="earth"] > .viewbar:has(:focus-visible, [aria-expanded="true"]),
  body.immersive.idle .chartwrap > .ea-ui:has(.ea-phone-time:not([hidden])) {
    opacity: 1;
  }
  body.immersive .chartwrap[data-view="earth"] > .ea-ui { top: 0; }
  body.immersive .stage[data-view="earth"] .ea-cut-compact:has(.ea-cutkey:not([hidden])) .ea-side {
    top: calc(var(--scene-tools-bottom) + 8px);
  }
  body.immersive .ea-ui:has(.ea-layers:not([hidden]), .ea-phone-time:not([hidden])) > .ea-card { visibility: hidden; }
  .stage[data-view="earth"] .ea-ui {
    --ea-toolbar-top: calc(var(--scene-tools-bottom) + 8px);
  }
  .stage[data-view="earth"] .ea-top:not(:has(.ea-search:not([hidden]))),
  .stage[data-view="earth"] .ea-top > .btn,
  .stage[data-view="earth"] .ea-time:not(:has(:is(.ea-cut-close, .ea-daynow):not([hidden]))),
  .stage[data-view="earth"] .ea-time > :not(.ea-cut-close, .ea-daynow) { display: none; }
  .stage[data-view="earth"] .ea-top {
    top: var(--ea-toolbar-top);
    grid-template-columns: minmax(0, 1fr);
  }
  .stage[data-view="earth"] .ea-phone-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .stage[data-view="earth"] .ea-framed .ea-foot {
    left: calc(var(--tap) + 18px);
    bottom: var(--ea-footer-inset);
  }
  .stage[data-view="earth"] .ea-framed .ea-ui:has(.ea-daynow:not([hidden])) > .ea-foot {
    bottom: calc(var(--ea-footer-inset) + var(--tap) + 6px);
  }
  body.immersive.idle .stage[data-view="earth"] .ea-framed .ea-ui > .ea-time:has(.ea-daynow:not([hidden])) {
    opacity: 1;
    pointer-events: auto;
  }
  .stage[data-view="earth"] .ea-phone-time:not([hidden]) {
    position: absolute;
    inset: var(--ea-toolbar-top) 10px auto;
    z-index: 5;
    max-height: calc(100% - var(--ea-toolbar-top) - 12px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 12px;
    border: 1px solid var(--flight-line);
    border-radius: 12px;
    background: var(--flight-bg);
    color: var(--flight-ink);
  }
  .ea-phone-time .clock { margin-bottom: 8px; }
  .ea-phone-time .clock > time { width: 100%; }
  .ea-phone-time :is(.btn, input), .ea-phone-shortcuts .btn { min-height: 44px; }
}
