#app { --panel-w: 306px; --accent: #78d9ff; }
#stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #05070d;
  padding: 0 clamp(12px, 2.5vw, 36px);
}
.stage-head, .stage-view, .stage-foot { width: 100%; max-width: 1000px; margin-inline: auto; }
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 0 8px;
}
.stage-title, .stage-tools, .stage-foot { display: flex; align-items: center; gap: 8px; }
.stage-title h1 { font-size: 18px; margin: 0 6px 0 0; }
.stage-title span { color: #a7bacf; font-size: 12px; white-space: nowrap; }
.stage-title output { color: #e8f1fa; font-size: 16px; display: inline-block; min-width: 3ch; }
.stage-tools button { min-height: 44px; padding-inline: 10px; }
.stage-tools [data-scene="normal"].on { background: #c9a7ff; border-color: #c9a7ff; }
.stage-view { min-width: 0; min-height: 0; }
#stage canvas { width: 100%; height: 100%; touch-action: none; }
.stage-foot { min-height: 48px; color: #9eb1c7; font-size: 12px; }
.stage-foot a { color: #b9d6ec; margin-left: auto; padding: 10px 0; }
#panel { background: #101622; }
#panel h2, #panel summary { color: #dce8f5; }
#panel .readout { background: #141e2c; }
#panel dd { text-align: right; font-variant-numeric: tabular-nums; }
#panel details { border-top: 1px solid var(--line); }
#panel summary { font-size: 13px; cursor: pointer; padding: 14px 0; }
#panel .slider { grid-template-columns: 60px minmax(0, 1fr) 53px; min-height: 36px; }
#panel .slider input { height: 30px; margin: 0; }
#panel .checks label { display: flex; align-items: center; gap: 5px; min-height: 34px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button {
  background: #1a2231; border: 1px solid #34455a; color: #e6ebf2;
  border-radius: 6px; min-height: 44px; padding: 6px 10px; cursor: pointer;
}
.actions button:hover { border-color: #78d9ff; }
#records { font-size: 12px; width: 100%; border-collapse: collapse; }
#records td, #records th { padding: 4px; text-align: right; border-bottom: 1px solid #2a3446; }
#records th:first-child, #records td:first-child { text-align: left; }
.note { color: #a8bacd; font-size: 12px; line-height: 1.55; }
#status { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .stage-head { padding-top: 7px; }
  .stage-title h1 { font-size: 16px; }
  .stage-foot { gap: 12px; }
  #panel { bottom: 48px; max-height: min(62%, calc(100% - 150px)); }
  #panel.collapsed { visibility: hidden; }
  #panelToggle { position: relative; inset: auto; min-height: 44px; font-size: 12px; border-radius: 8px; }
}
@media (prefers-reduced-motion: reduce) { #panel { transition: none; } }

.stage-view { position: relative; }
.force-compare {
  position: absolute; inset: 3px 0 auto; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; pointer-events: none;
}
.force-tile {
  --force-color: #78d9ff;
  height: 54px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 0 12px; background: #0c121d; border: 1px solid #27364a; border-radius: 9px;
  color: var(--force-color); font-size: 11px;
}
.force-tile.normal { --force-color: #c9a7ff; }
#stage[data-scene="vertical"] .force-tile.vertical,
#stage[data-scene="normal"] .force-tile.normal { background: #152334; border-color: var(--force-color); }
.force-tile strong { color: #edf4fc; font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.2; }
@media (max-width: 760px) { .force-tile strong { font-size: 16px; } }
@media (max-height: 580px) { #app { min-height: 540px; } }
