:root { --panel-w: 320px; --warm: #ffac68; --cold: #6addf6; --link: #aabbd2; }
[hidden] { display: none !important; }
#stage {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: 18px 18px 12px;
  background: radial-gradient(ellipse at 50% 53%, #0d1c2b 0, #080e18 55%, #05070d 87%);
}
.scene-tabs, .stage-heading, .stage-footer { justify-self: center; }
.scene-tabs button { min-height: 38px; padding-inline: 15px; }
.seg button, button.small, #panelToggle { color: var(--accent); }
.seg button.on { color: #111; }
.stage-heading { text-align: center; margin: 15px 0 2px; padding-inline: 5px; }
.stage-heading h2 { color: var(--accent); font-size: 18px; margin: 0; }
.stage-heading p { color: #a9b8c9; font-size: 12px; margin: 3px 0 0; }
#art { position: relative; min-height: 0; }
.visual { position: absolute; inset: 0; }
.visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#globe canvas:first-child { cursor: grab; touch-action: none; }
#routes, #routeLabel { pointer-events: none; }
#routeLabel {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #fff0d7;
  background: #081523ef;
  font-size: 13px;
  border: 1px solid #698ca4;
  border-radius: 6px;
  padding: 4px 8px;
  white-space: nowrap;
}
#globeFallback { position: absolute; inset: 35% 10% auto; text-align: center; }
.stage-footer { width: min(100%, 430px); text-align: center; }
.stage-row { display: flex; justify-content: center; align-items: center; gap: 8px; }
.stage-row label, .stage-row span, #windControls label { color: #bbc8d5; font-size: 12px; white-space: nowrap; }
.stage-row select { width: min(40%, 146px); color: var(--accent); min-height: 36px; }
.stage-row input { flex: 1; min-width: 45px; height: 36px; }
.stage-row button { flex: none; min-height: 36px; }
.stage-footer .legend { justify-content: center; margin: 8px 0 0; color: #bbc8d5; }
.legend .warm { background: var(--warm); }
.legend .cold { background: var(--cold); }
.legend .link { background: var(--link); }
.stage-footer .learn-fab { position: static; transform: none; display: inline-block; margin-top: 10px; }
#panel .seg button { min-height: 40px; min-width: 88px; }
#panel .readout p { margin: 7px 0 3px; color: #c6d3df; font-size: 13px; }
#panel h1 { color: var(--text); }
#panel h2 { font-size: 14px; }
.readout .big { font-size: 17px; }
.route-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.route-buttons button { display: flex; align-items: center; gap: 6px; text-align: left; min-height: 44px; }
.route-buttons i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--route-color); }
.route-buttons [aria-pressed="true"] { border-color: var(--accent); background: #352d24; }
.motion-controls { margin-top: 12px; }
.motion-controls button { min-height: 38px; }
.table-scroll { overflow-x: auto; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  #stage { padding: 10px 10px 8px; }
  .scene-tabs { justify-self: start; }
  .scene-tabs button, #panelToggle { min-height: 44px; }
  #panelToggle { top: 10px; right: 10px; font-size: 12px; }
  .stage-heading { margin-block: 12px 2px; }
  .stage-heading h2 { font-size: 16px; }
  .stage-heading p { font-size: 11px; }
  .stage-row select, .stage-row button, .stage-row input { min-height: 44px; }
  .stage-footer .learn-fab { min-height: 42px; align-content: center; margin-top: 5px; }
  #panel .seg button, .motion-controls button { min-height: 44px; }
}
@media (max-height: 500px) {
  #stage { padding-block: 5px; }
  .stage-heading { margin-top: 4px; }
  .stage-footer .learn-fab { margin-top: 4px; }
}
