body.orrery-page { overflow: hidden; height: 100vh; height: 100dvh; min-height: 0; }
.orrery-page #orrery { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; touch-action: none; outline: none; display: block; }
.orrery-page h1 { animation: none; opacity: 1; }

.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.75rem; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar .brand { font-family: "Orbitron", sans-serif; font-size: 0.95rem; letter-spacing: 0.08em; text-decoration: none; color: var(--text); }
.topbar nav { display: flex; gap: 1rem; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.topbar nav a:hover, .topbar nav a.active { color: var(--accent); }

.heading { position: fixed; z-index: 3; top: 3.6rem; left: 1.75rem; pointer-events: none; }
.heading h1 { font-size: 1.35rem; letter-spacing: 0.14em; text-shadow: 0 0 24px var(--glow); font-weight: 500; }
.clock { margin-top: 0.3rem; font-size: 0.8rem; letter-spacing: 0.1em; color: var(--muted); font-variant-numeric: tabular-nums; }

.controls { position: fixed; z-index: 4; top: 7.6rem; left: 1.75rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.7rem; }
.switch { display: inline-flex; align-items: center; gap: 0.65rem; background: none; border: 0; color: var(--text); font: 400 0.9rem "Outfit", sans-serif; letter-spacing: 0.04em; cursor: pointer; padding: 0.25rem 0; }
.switch .track { width: 2.4rem; height: 1.3rem; border-radius: 999px; border: 1px solid rgba(232,236,255,0.35); background: rgba(255,255,255,0.04); position: relative; transition: background .25s, border-color .25s; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: calc(1.3rem - 6px); height: calc(1.3rem - 6px); border-radius: 50%; background: var(--muted); transition: transform .25s, background .25s; }
.switch[aria-checked="true"] .track { background: rgba(125,211,252,0.22); border-color: var(--accent); }
.switch[aria-checked="true"] .thumb { transform: translateX(1.1rem); background: var(--accent); }
.viewmode { display: flex; flex-direction: column; gap: 0.35rem; }
.vm-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.seg { display: inline-flex; padding: 2px; border-radius: 999px; border: 1px solid rgba(232,236,255,0.26); background: rgba(255,255,255,0.04); backdrop-filter: blur(8px); }
.seg button { font: 400 0.82rem "Outfit", sans-serif; letter-spacing: 0.04em; color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 0.32rem 0.8rem; cursor: pointer; transition: background .2s, color .2s; }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { color: var(--text); background: rgba(125,211,252,0.2); box-shadow: inset 0 0 0 1px var(--accent); }
button:focus-visible, .chip:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.chip, .back, .zoomctl button, .panel .zoom-btn { font: 400 0.82rem "Outfit", sans-serif; letter-spacing: 0.04em; color: var(--text); background: rgba(255,255,255,0.04); border: 1px solid rgba(232,236,255,0.26); border-radius: 999px; padding: 0.38rem 0.85rem; cursor: pointer; backdrop-filter: blur(8px); transition: border-color .2s, background .2s; }
.chip:hover, .back:hover, .zoomctl button:hover, .panel .zoom-btn:hover { border-color: var(--accent); background: rgba(125,211,252,0.1); }
.back { position: fixed; z-index: 4; top: 7.6rem; left: 1.75rem; }

.zoomctl { position: fixed; z-index: 4; top: 50%; right: 1.5rem; transform: translateY(-50%); display: flex; flex-direction: column; gap: 0.5rem; transition: right .3s; }
.zoomctl #zfit { font-size: 0.72rem; letter-spacing: 0; }
.zoomctl button { width: 2.5rem; height: 2.5rem; padding: 0; font-size: 1.25rem; line-height: 1; border-radius: 50%; }
body.panel-open .zoomctl { right: calc(360px + 1.5rem); }

.planet-list { position: fixed; left: -9999px; top: 0; z-index: 6; display: flex; gap: .4rem; }
.planet-list:focus-within { left: 1.75rem; top: auto; bottom: 5.2rem; flex-wrap: wrap; max-width: 80vw; }

.key { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; padding: 0.9rem 1.75rem calc(1rem + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 1.5rem; font-size: 0.78rem; letter-spacing: 0.05em; color: var(--muted); pointer-events: none; transition: right .3s; }
body.panel-open .key { right: 360px; }
.key-bar { display: flex; align-items: center; gap: 0.75rem; flex: none; }
.key-bar[hidden] { display: none; }
.bar-line { display: block; height: 7px; border: 1px solid rgba(232,236,255,0.55); border-top: 0; width: 80px; }
.bar-label { color: var(--text); white-space: nowrap; }
.key-text { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; min-width: 0; font-variant-numeric: tabular-nums; }
.key-text span.k { white-space: nowrap; transition: color .2s; }
.key-text span.k i { font-style: normal; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 0.4rem; vertical-align: 0; }
.key-text span.k.on { color: var(--text); }

.tip { position: fixed; z-index: 7; pointer-events: none; padding: 0.3rem 0.6rem; font-size: 0.78rem; letter-spacing: 0.04em; background: rgba(8,10,24,0.88); border: 1px solid rgba(232,236,255,0.2); border-radius: 8px; color: var(--text); white-space: nowrap; transform: translate(12px, -34px); }

.moon-card { position: fixed; z-index: 7; width: 15.5rem; padding: 0.8rem 0.95rem; background: rgba(8,10,24,0.92); border: 1px solid rgba(232,236,255,0.22); border-radius: 12px; backdrop-filter: blur(10px); font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.moon-card h3 { font: 500 0.9rem "Orbitron", sans-serif; letter-spacing: 0.06em; color: var(--text); margin-bottom: 0.35rem; }
.moon-card p + p { margin-top: 0.35rem; }

.panel { position: fixed; z-index: 5; top: 0; right: 0; bottom: 0; width: 360px; padding: 4.2rem 1.5rem 1.5rem; overflow-y: auto; background: rgba(6,8,20,0.82); backdrop-filter: blur(16px); border-left: 1px solid rgba(232,236,255,0.12); transform: translateX(0); animation: slideIn .35s ease; }
.panel[hidden] { display: none; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.1rem; }
.panel-head .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 14px currentColor; }
.panel-head h2 { font: 700 1.4rem "Orbitron", sans-serif; letter-spacing: 0.08em; flex: 1; }
.panel .close { background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.4rem; }
.panel .close:hover { color: var(--text); }
.panel dl { display: grid; grid-template-columns: 1fr; gap: 0; }
.panel .row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid rgba(232,236,255,0.08); font-size: 0.88rem; }
.panel dt { color: var(--muted); font-weight: 300; }
.panel dd { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.panel .facts { margin: 1.1rem 0 1.2rem; font-weight: 300; font-size: 0.92rem; line-height: 1.65; color: var(--muted); }
.panel .zoom-btn { width: 100%; margin-bottom: 0.9rem; padding: 0.7rem 1rem; font-size: 0.92rem; background: linear-gradient(135deg, rgba(56,189,248,.22), rgba(129,140,248,.22)); border-color: rgba(125,211,252,.5); }
.sheet-grip, .sheet-handle { display: none; }

#timeSlider { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 34px; margin: 0; background: transparent; cursor: pointer; touch-action: none; }
#timeSlider::-webkit-slider-runnable-track { height: 2px; background: rgba(232,236,255,0.4); border-radius: 2px; }
#timeSlider::-moz-range-track { height: 2px; background: rgba(232,236,255,0.4); border-radius: 2px; }
#timeSlider::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -14px; border-radius: 50%; background: rgba(8,10,24,0.9); border: 2px solid var(--accent); box-shadow: 0 0 12px var(--glow); }
#timeSlider::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: rgba(8,10,24,0.9); border: 2px solid var(--accent); box-shadow: 0 0 12px var(--glow); }
#timeSlider:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.timebox { position: fixed; z-index: 4; left: 0; right: 0; margin: 0 auto; width: min(640px, calc(100% - 3.5rem)); bottom: var(--keyh, 3.6rem); padding: 0.35rem 1rem 0.45rem; border: 1px solid rgba(232,236,255,0.26); border-radius: 14px; background: transparent; transition: right .3s; }
body.panel-open .timebox { right: 360px; }
.tb-ends { display: flex; justify-content: space-between; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); }
.tb-date { text-align: center; font-size: 0.82rem; letter-spacing: 0.1em; color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .timebox { width: calc(100% - 1.5rem); padding: 0.3rem 0.9rem 0.4rem; }
  body.panel-open .timebox { right: 0; bottom: calc(0.5rem + env(safe-area-inset-bottom)); }
  body.panel-open .panel { bottom: calc(var(--tbh, 90px) + 0.9rem + env(safe-area-inset-bottom)); height: calc(46dvh - var(--tbh, 90px)); border-radius: 18px; }
  .topbar { padding: 0.9rem 1rem; }
  .heading { left: 1rem; top: 3.1rem; }
  .heading h1 { font-size: 1.1rem; }
  .controls { left: 1rem; top: 6.1rem; }
  .back { left: 1rem; top: 6.1rem; }
  .zoomctl { top: 6rem; right: 1rem; transform: none; flex-direction: row; }
  body.panel-open .zoomctl { right: 1rem; }
  .zoomctl button { width: 2.2rem; height: 2.2rem; }
  .key { padding: 0.8rem 1rem calc(0.9rem + env(safe-area-inset-bottom)); gap: 0.9rem; font-size: 0.72rem; flex-wrap: wrap; }
  body.panel-open .key { right: 0; visibility: hidden; }
  body.panel-open.local .key { visibility: visible; bottom: calc(var(--sheet-top, 46dvh + 0.9rem) + 0.2rem); }
  .key-text { max-height: 5rem; overflow: hidden; gap: 0.1rem 0.8rem; }
  .panel { top: auto; width: auto; left: 0; right: 0; bottom: 0; height: 46vh; height: 46dvh; padding: 1.5rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); border-left: 0; border-top: 1px solid rgba(232,236,255,0.18); border-radius: 18px 18px 0 0; animation: slideUp .35s ease; }
  @keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .sheet-grip { display: block; position: absolute; top: 0.55rem; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: rgba(232,236,255,0.3); }
  .panel-head h2 { font-size: 1.15rem; }
  .panel { transition: bottom .28s cubic-bezier(.2,.8,.2,1), height .28s cubic-bezier(.2,.8,.2,1), border-radius .28s; overscroll-behavior: contain; }
  .panel.dragging { transition: none; }
  .panel-head { touch-action: none; cursor: grab; }
  .sheet-handle { display: block; position: absolute; top: 0; left: 0; right: 0; height: 2.2rem; touch-action: none; cursor: grab; z-index: 1; }
  .sheet-handle .sheet-grip { top: 0.55rem; }
  body.sheet-hidden .panel { overflow: hidden; padding-bottom: 0; }
  body.sheet-hidden .key { bottom: 28px; }
  .moon-card { width: 13.5rem; }
}
[hidden] { display: none !important; }
