#stage {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto auto auto;
  align-content: start;
  gap: 10px;
  padding: 19px 20px 41px;
  background: #05070d;
}
.stage-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.stage-head h1 {
  margin: 0;
  color: var(--accent);
  font-size: 20px;
  line-height: 1.35;
}
.stage-head p {
  font-size: 12px;
  color: #9dabbd;
  margin: 4px 0 0;
}
#stage .seg button, #stage button.small {
  min-height: 38px;
  padding: 3px 12px;
  color: var(--accent);
}
#stage .seg button.on, #stage button.small[aria-pressed=true]:not(#play) {
  color: #161208;
  background: var(--accent);
  border-color: var(--accent);
}
button:focus-visible { outline: 2px solid #eff7ff; outline-offset: 2px; }
.map-wrap {
  position: relative;
  border: 1px solid #304556;
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
  background: #0b1b29;
}
#map { width: 100%; height: 100%; touch-action: manipulation; }
#map.interactive { cursor: pointer; }
.map-note {
  position: absolute;
  top: 8px;
  left: 9px;
  padding: 3px 7px;
  font-size: 11px;
  color: #c0d0df;
  background: #091522e8;
  border: 1px solid #41607590;
  border-radius: 5px;
  pointer-events: none;
}
.stage-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.observation {
  display: grid;
  grid-template-columns: minmax(116px, max-content) 1fr;
  align-items: center;
  min-height: 76px;
  gap: 17px;
  padding: 10px 13px;
  border: 1px solid #283748;
  border-radius: 9px;
  background: #101924;
}
.obs-title { font-size: 15px; font-weight: 650; color: var(--accent); }
.obs-copy { padding-left: 14px; border-left: 1px solid #2f4152; }
.obs-copy strong { font-size: 13px; font-weight: 650; }
.obs-copy p { margin: 2px 0 0; font-size: 12px; color: #a7b7c8; }
.map-legend { margin: 0; color: #a9b8c9; min-height: 18px; }
.map-legend .high { background: #9acaff; }
.map-legend .low { background: #ffb092; }
.map-legend .air-cold { background: #8bd0ff; }
.map-legend .air-wet { background: #76f7c6; }
.map-instruction { margin-left: auto; }
#stage .learn-fab { left: 20px; bottom: 9px; }
#panel .panel-title { font-size: 17px; }
.thermal { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; font-size: 12px; font-weight: 650; }
.thermal div { position: relative; overflow: hidden; padding: 12px 8px; border: 1px solid #436783; border-radius: 7px; text-align: center; color: #d7edff; background: #244056; }
.thermal #seaTemp { color: #b9dded; border-color: #416779; background: #203746; }
.thermal.winter #seaTemp, .thermal.summer #landTemp { color: #ffe2c1; border-color: #85614b; background: #493c35; }
.center-buttons { display: flex; flex-wrap: wrap; gap: 6px; min-height: 74px; align-content: flex-start; }
.center-buttons button, .wind-table button, #share {
  color: var(--accent);
  min-height: 36px;
  background: #192332;
  border: 1px solid #344355;
  border-radius: 7px;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.center-buttons button[aria-pressed=true], .wind-table button[aria-pressed=true] { border-color: var(--accent); background: #362d1d; }
.center-buttons .pressure {
  display: inline-block;
  width: 19px;
  margin-right: 5px;
  border-radius: 50%;
  color: #9acaff;
  border: 1px solid currentColor;
  text-align: center;
}
.center-buttons .pressure.low { color: #ffb092; }
.wind-table { display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: 6px; font-size: 12px; }
.wind-table b { color: #a9b8c9; text-align: center; }
.wind-table span { color: #c2cfde; padding: 0 6px 0 0; }
.share-line { display: flex; gap: 8px; align-items: center; }
#shareStatus { font-size: 12px; color: #a8bed1; }
#shareStatus input { width: 100%; }

@media (max-width: 760px) {
  #stage {
    padding: 12px 10px 65px;
    gap: 8px;
    grid-template-rows: auto minmax(160px, min(45dvh, 420px)) auto auto auto;
  }
  .stage-head { align-items: center; flex-wrap: wrap; gap: 5px; }
  .stage-head h1 { font-size: 17px; }
  .stage-head p { display: none; }
  #stage .seg button, #stage button.small { min-height: 44px; padding: 3px 8px; font-size: 11px; }
  .stage-controls { gap: 5px; }
  .obs-title { font-size: 14px; }
  .observation { grid-template-columns: 1fr; gap: 4px; min-height: 94px; padding: 8px 10px; }
  .obs-copy { padding: 0; border: 0; }
  .obs-copy strong, .obs-copy p { font-size: 12px; }
  .map-legend { gap: 4px 9px; font-size: 11px; }
  .map-instruction { display: none; }
  #panelToggle { top: auto; bottom: 9px; right: 10px; min-height: 44px; color: var(--accent); }
  #panel { bottom: 59px; }
  #panel.collapsed { visibility: hidden; transform: translateY(calc(100% + 59px)); }
  .center-buttons button, .wind-table button, #share { min-height: 44px; }
  #stage .learn-fab { left: 10px; bottom: 13px; }
}
@media (max-width: 760px) and (max-height: 710px) {
  #stage { grid-template-rows: auto minmax(158px, 37dvh) auto auto auto; }
}
@media (max-height: 520px) {
  #app { min-height: 550px; }
}
@media (prefers-reduced-motion: reduce) {
  #panel { transition: none; }
}
#stage button.small:disabled { opacity: .46; cursor: default; }
#stage .learn-fab { transform: none; }
#learn td, #learn th { white-space: normal; }
