#app {
  --panel-w: 308px;
  --panel: #0e151c;
  --line: #283943;
  --accent: #edc171;
  --foliage: #a6dbad;
  --water: #86d9f7;
  min-height: 490px;
}

#stage {
  display: flex;
  flex-direction: column;
  padding: 17px clamp(16px, 2.5vw, 36px) 12px;
  background: #05070d;
  gap: 9px;
}
.stage-head, .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stage-head h1 { margin: 0; font-size: 18px; font-weight: 650; }
.stage-head a {
  color: #a5b6c3;
  font-size: 12px;
  padding: 6px 0 6px 12px;
  text-decoration: none;
}
.stage-head a:hover { color: #e6ebf2; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 530px; }
#app button:where(:not(#panelToggle)) {
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: #c0d0dc;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111d25;
  min-height: 40px;
  padding: 4px 9px;
}
#app .presets button:hover { border-color: #618778; }
#app .presets button[aria-pressed="true"] {
  background: #193730;
  border-color: #5e997c;
  color: #ccf0d5;
}
#app :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#sceneNote {
  margin: 0;
  color: #a9bfc9;
  font-size: 12px;
  min-height: 2.8em;
  display: flex;
  align-items: center;
}
.observatory { flex: 1; min-height: 0; position: relative; }
#plant { width: 100%; height: 100%; position: absolute; inset: 0; touch-action: none; }
#plant.dragging { cursor: ew-resize; }
.stage-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid #273841;
  padding-top: 7px;
}
.stage-readout div { padding: 0 13px; border-left: 1px solid #26343e; }
.stage-readout div:first-child { padding-left: 0; border-left: 0; }
.stage-readout dt { color: #adc0ce; font-size: 12px; }
.stage-readout dd { font-size: 18px; color: var(--water); font-variant-numeric: tabular-nums; }
.stage-readout div:last-child dd { color: var(--foliage); }
.stage-tools, .actions { display: flex; gap: 7px; }
#stage .stage-tools button { background: #0c151d; }
#panel { padding: 18px 16px 22px; }
#panel h2 { font-size: 14px; color: var(--foliage); margin: 0; letter-spacing: 0; }
.panel-head { margin-bottom: 6px; min-height: 29px; }
#app #closePanel, .panel-rate { display: none; }
#panel section { padding: 12px 0; }
#panel .variables { display: grid; gap: 3px; padding-bottom: 6px; }
.control { display: block; font-size: 12px; }
.control output { float: right; color: var(--water); }
.control input { display: block; margin: 1px 0 0; min-height: 32px; }
.control:not(:first-child) input { accent-color: #7bbab2; }
#records { margin: 6px 0 9px; font-size: 12px; color: #b3c4ce; overflow-x: auto; }
#records table { width: 100%; border-collapse: collapse; white-space: nowrap; font-variant-numeric: tabular-nums; }
#records th, #records td { padding: 5px 3px; border-bottom: 1px solid var(--line); text-align: right; }
#records th:last-child, #records td:last-child { color: var(--water); }
.actions button { flex: 1; }
#shareStatus { overflow-wrap: anywhere; }
#shareStatus:empty, #feedback:empty { display: none; }
.panel-details { padding: 11px 0; border-top: 1px solid var(--line); }
.panel-details summary { cursor: pointer; color: #c6d5df; font-size: 13px; }
.panel-details .actions { margin-top: 8px; }
#panel .related a::after { white-space: nowrap; }

@media (max-width: 760px) {
  #stage { padding: 5px 12px 7px; gap: 5px; }
  .stage-head h1 { font-size: 16px; }
  .stage-head a { padding: 10px 0 10px 12px; }
  #sceneNote { font-size: 11px; min-height: 2.6em; }
  .stage-readout dt { font-size: 11px; }
  .stage-readout dd { font-size: 16px; }
  #app button:where(:not(#panelToggle)), #panelToggle { min-height: 44px; }
  .stage-tools button { flex: 1; }
  #panelToggle {
    position: static;
    flex: 1.25;
    border-radius: 7px;
    color: #dcf3e4;
    background: #193730;
    border-color: #5e997c;
    cursor: pointer;
  }
  #panel { z-index: 7; max-height: 82%; padding: 10px 16px 14px; }
  .panel-rate { display: block; margin: 0 0 0 auto; color: #a9bec9; font-size: 11px; }
  .panel-rate strong { margin-left: 3px; color: var(--water); font-size: 15px; font-variant-numeric: tabular-nums; }
  #panel.collapsed { visibility: hidden; }
  #app #closePanel { display: block; }
  .control input { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  #panel { transition: none; }
}

:lang(en) #learn .related a::after,
:lang(en) #panel .related a::after { content: "Open →"; }

@media (max-width: 420px) {
  .site-bar-in:lang(en) { gap: 6px; padding-inline: 8px; }
  .site-logo b:lang(en) { font-size: 13px; }
  .site-bar-in:lang(en) .site-all { padding-inline: 8px; }
}
