:root { --panel-w: 318px; }
#stage { isolation: isolate; background: #080f1e; }
#sky { width: 100%; height: 100%; touch-action: none; cursor: grab; }
#sky.pressed { cursor: grabbing; }
#sky.over-star:not(.pressed) { cursor: pointer; }
#sky:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
#stage [hidden], #panel [hidden] { display: none; }

.stage-top { position: absolute; top: 15px; left: 18px; right: 18px; display: flex; justify-content: space-between; pointer-events: none; }
#stage .seg button, #panel .seg button { color: var(--accent); min-height: 40px; padding: 5px 10px; }
#stage .seg button { background: #0c1829eb; border-color: #46516a; }
#stage .seg button.on, #panel .seg button.on { background: var(--accent); color: #191405; border-color: var(--accent); }
#stage .seg button:hover, #panel .seg button:hover { border-color: var(--accent); }
.stage-status { position: absolute; top: 67px; left: 19px; display: flex; align-items: baseline; gap: 8px; pointer-events: none; text-shadow: 0 1px 5px #05070d, 0 0 8px #05070d; }
#stamp { font-size: 16px; font-weight: 650; }
#starlight { font-size: 11px; color: #c4d4e8; }
#sky-help { position: absolute; left: 19px; top: 92px; color: #bdcde4; font-size: 12px; text-shadow: 0 1px 5px #05070d, 0 0 8px #05070d; pointer-events: none; }
#view-tools { position: absolute; top: 15px; right: 18px; }
.stage-bottom { position: absolute; bottom: 14px; left: 50%; width: min(480px, calc(100% - 32px)); transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.timeline { width: 100%; display: grid; grid-template-columns: auto 1fr 53px; align-items: center; gap: 12px; padding: 4px 10px 4px 4px; background: #0c1627ed; border: 1px solid #425470; border-radius: 12px; pointer-events: auto; }
#play { min-height: 42px; min-width: 80px; color: var(--accent); }
#time { margin: 0; height: 34px; cursor: pointer; }
#clock { color: #eef5ff; font: 650 16px var(--mono); }
.stage-bottom .learn-fab { position: static; transform: none; min-height: 34px; padding: 7px 13px; color: var(--accent); pointer-events: auto; }
.terms button { min-width: 64px; }

#panel h1 { font-size: 18px; margin: 1px 0 7px; }
#panel .learn-link { color: #c1d1e8; margin-bottom: 11px; }
#panel .note { color: #aebdd2; }
#panel h2 { font-size: 14px; }
.star-readout { background: #0c1423; margin-bottom: 13px; }
.star-title { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.star-title strong { color: var(--accent); font-size: 18px; }
.star-title span, .coordinates span { color: #b4c3d8; font-size: 11px; }
.coordinates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coordinates div { display: flex; flex-direction: column; border-top: 1px solid #334058; padding-top: 6px; }
.coordinates b { font: 650 19px var(--mono); margin-top: 3px; color: #e7f0ff; }
#pole-height { color: #d8c17e; font-size: 12px; margin: 10px 0 0; }
.places { display: flex; margin-bottom: 8px; }
.places button { flex: 1; min-width: 0; white-space: nowrap; }
#panel .slider { grid-template-columns: 40px 1fr 72px; min-height: 37px; margin: 1px 0; }
#panel .slider output { color: #c5d2e4; }
#panel select { min-height: 42px; color: #f2f5fa; }
#panel .checks { gap: 0 6px; }
#panel .checks label { display: flex; min-height: 38px; align-items: center; gap: 5px; font-size: 12px; }
#panel .checks input { margin-left: 0; }

@media (max-width: 760px) {
  .stage-top { top: 9px; left: 10px; right: 10px; }
  #panelToggle { position: static; color: var(--accent); min-height: 44px; padding: 5px 10px; border-color: #46516a; pointer-events: auto; }
  #stage .seg button { min-height: 44px; }
  .stage-status { top: 62px; left: 12px; gap: 6px; }
  #stamp { font-size: 14px; }
  #starlight { font-size: 11px; }
  #sky-help { top: 85px; left: 12px; font-size: 11px; }
  #view-tools { top: 59px; right: 10px; }
  #view-tools button { padding-inline: 8px; font-size: 11px; }
  .stage-bottom { bottom: 9px; width: calc(100% - 20px); gap: 5px; }
  .timeline { gap: 8px; }
  #panel { max-height: 57%; padding: 12px 13px 18px; }
  #panel h1, .star-title strong { font-size: 16px; }
  #panel section { padding: 8px 0; }
  #panel .seg button, #panel .checks label, #panel .slider { min-height: 44px; }
  .drawer-open #sky { height: 43%; }
  .drawer-open #view-tools { top: auto; bottom: calc(57% + 8px); }
  .drawer-open .stage-bottom { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  #panel { transition: none; }
}

#quick-star { display: none; }
@media (max-width: 760px) {
  #quick-star {
    display: block;
    padding: 3px 10px;
    border-radius: 9px;
    background: #0c1627e6;
    color: #dbe8f8;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }
}
