:root {
  color-scheme: dark;
  --bg: #070707;
  --ink: #f2f2ee;
  --muted: #9b9b96;
  --dim: #5f605c;
  --line: rgba(242, 242, 238, 0.17);
  --line-strong: rgba(242, 242, 238, 0.36);
  --surface: rgba(12, 12, 12, 0.9);
  --surface-soft: rgba(20, 20, 20, 0.66);
  --white: #ffffff;
  --glow: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
  color: var(--ink);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace, monospace;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 21vw, 360px);
  gap: 10px;
  width: 100vw;
  height: 100vh;
  padding: 10px;
}

.stage-panel,
.control-panel {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 24px 80px rgba(0, 0, 0, 0.42);
}

.stage-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.stage-panel::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 76px 100%,
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 100% 76px,
    radial-gradient(circle at center, transparent 0 46%, rgba(0, 0, 0, 0.26) 78%, rgba(0, 0, 0, 0.56) 100%);
  opacity: 0.38;
}

.stage-panel::after {
  position: absolute;
  inset: 18px;
  z-index: 2;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#orb-canvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#orb-canvas.is-dragging {
  cursor: grabbing;
}

.hud {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  padding: 0;
  text-transform: uppercase;
  pointer-events: none;
}

.hud strong {
  color: var(--ink);
  font-weight: 500;
}

.top-left {
  top: 24px;
  left: 24px;
}

.bottom-left {
  bottom: 24px;
  left: 24px;
}

.bottom-right {
  right: 24px;
  bottom: 24px;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
}

.stage-footer {
  position: absolute;
  right: 36px;
  bottom: 24px;
  left: 36px;
  z-index: 4;
  display: grid;
  grid-template-columns: 160px minmax(260px, 1fr) 112px;
  gap: 22px;
  align-items: end;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-transform: uppercase;
  pointer-events: none;
}

.footer-status,
.footer-system {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 1px;
}

.footer-status {
  padding-left: 20px;
}

.footer-status b {
  color: var(--dim);
  font-weight: 500;
}

.footer-status strong {
  color: #d8d8d2;
  font-weight: 500;
}

.footer-system {
  align-items: flex-end;
  padding-right: 20px;
}

.footer-rail {
  position: relative;
  height: 28px;
  align-self: center;
}

.rail-ticks {
  position: absolute;
  right: 36px;
  bottom: 8px;
  left: 36px;
  height: 18px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent) 0 13px / 100%
      1px no-repeat;
}

.rail-ticks::before,
.rail-ticks::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  content: "";
}

.rail-ticks::before {
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.24) 0 1px,
    transparent 1px 12px
  );
}

.rail-ticks::after {
  height: 14px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.46) 0 1px,
    transparent 1px 48px
  );
}

.rail-id {
  position: absolute;
  bottom: 4px;
  left: 50%;
  min-width: 21px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--ink);
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  background: rgba(10, 10, 10, 0.9);
  transform: translateX(-50%);
}

.rail-bracket {
  position: absolute;
  bottom: 8px;
  width: 10px;
  height: 10px;
}

.rail-bracket.left {
  left: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.45);
}

.rail-bracket.right {
  right: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-right: 1px solid rgba(255, 255, 255, 0.45);
}

.stage-corner {
  position: absolute;
  z-index: 3;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.top-left-corner {
  top: 48px;
  left: 24px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.top-right-corner {
  top: 48px;
  right: 24px;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
}

.bottom-left-corner {
  bottom: 48px;
  left: 24px;
  border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.bottom-right-corner {
  right: 24px;
  bottom: 48px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.stage-reticle {
  position: absolute;
  z-index: 3;
  top: 24%;
  width: 42px;
  height: 52%;
  pointer-events: none;
}

.stage-reticle::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  content: "";
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.34) 0 2px,
    transparent 2px 8px
  );
}

.stage-reticle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--ink);
  transform: translate(-50%, -50%);
}

.left-reticle {
  left: 18px;
}

.right-reticle {
  right: 18px;
}

.stage-scale {
  position: absolute;
  z-index: 3;
  right: 56px;
  width: 172px;
  height: 14px;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent) 0 50% / 100% 1px
      no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.34) 0 1px, transparent 1px 8px);
}

.top-scale {
  top: 58px;
}

.bottom-scale {
  bottom: 52px;
  right: 26%;
}

.fullscreen-button {
  position: absolute;
  right: 30px;
  bottom: 78px;
  z-index: 6;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(10, 10, 10, 0.45);
  color: var(--ink);
  opacity: 0.76;
  backdrop-filter: blur(10px);
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.fullscreen-button:hover,
.fullscreen-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.54);
  background: rgba(18, 18, 18, 0.82);
  opacity: 1;
  outline: none;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.16);
}

.fs-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
}

.fs-corner-tl {
  top: 8px;
  left: 8px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

.fs-corner-tr {
  top: 8px;
  right: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.fs-corner-bl {
  bottom: 8px;
  left: 8px;
  border-bottom: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

.fs-corner-br {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.fullscreen-button.is-active .fs-corner-tl {
  top: 11px;
  left: 11px;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.fullscreen-button.is-active .fs-corner-tr {
  top: 11px;
  right: 11px;
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

.fullscreen-button.is-active .fs-corner-bl {
  bottom: 11px;
  left: 11px;
  border-bottom: 0;
  border-left: 0;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.fullscreen-button.is-active .fs-corner-br {
  right: 11px;
  bottom: 11px;
  border-right: 0;
  border-bottom: 0;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

.orb-close-button {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 7;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(10, 10, 10, 0.48);
  color: var(--ink);
  opacity: 0.78;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.orb-close-button span {
  position: absolute;
  width: 15px;
  height: 1px;
  background: currentColor;
}

.orb-close-button span:first-child {
  transform: rotate(45deg);
}

.orb-close-button span:last-child {
  transform: rotate(-45deg);
}

.orb-close-button:hover,
.orb-close-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(18, 18, 18, 0.84);
  opacity: 1;
  outline: none;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.16);
}

.stage-panel:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: #000000;
  box-shadow: none;
}

.stage-panel:fullscreen::before,
.stage-panel:fullscreen::after {
  display: none;
}

.stage-panel:fullscreen > :not(#orb-canvas):not(.orb-close-button) {
  display: none;
}

.stage-panel:fullscreen #orb-canvas {
  cursor: default;
}

.control-panel {
  position: relative;
  display: flex;
  min-height: 0;
  overflow: auto;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px 12px;
  backdrop-filter: blur(18px);
  scrollbar-color: rgba(255, 255, 255, 0.42) transparent;
  scrollbar-width: thin;
}

.control-panel::before {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  content: "";
  background: radial-gradient(circle, rgba(255, 255, 255, 0.76) 0 1px, transparent 1.5px) 0 0 /
    7px 7px;
  opacity: 0.54;
}

.control-panel::-webkit-scrollbar {
  width: 9px;
}

.control-panel::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  background-clip: padding-box;
}

.panel-header {
  position: relative;
  flex: 0 0 auto;
  padding: 0 48px 10px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.panel-header p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.panel-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 1.55vw, 24px);
  font-weight: 500;
  line-height: 1.04;
  text-transform: uppercase;
}

.preset-grid {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0 0 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.preset,
.mode {
  min-height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.preset {
  position: relative;
}

.preset::after {
  position: absolute;
  right: 20%;
  bottom: 0;
  left: 20%;
  height: 2px;
  content: "";
  background: transparent;
}

.preset.active,
.mode.active {
  color: var(--ink);
}

.preset.active::after {
  background: var(--white);
  box-shadow: 0 0 18px var(--glow);
}

.control-card {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 34%),
    var(--surface-soft);
  padding: 8px 22px 5px 31px;
}

.control-card::before {
  position: absolute;
  top: 17px;
  bottom: 12px;
  left: 15px;
  width: 7px;
  content: "";
  background: radial-gradient(circle, rgba(255, 255, 255, 0.58) 0 0.8px, transparent 1.1px) 0 0 /
    5px 6px;
  opacity: 0.66;
}

.control-card::after {
  position: absolute;
  right: 9px;
  bottom: 10px;
  width: 5px;
  height: 22px;
  content: "";
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.34) 0 1px,
    transparent 1px 5px
  );
  opacity: 0.5;
}

.control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: -1px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
}

.control-heading label {
  color: #c9c9c4;
}

.control-heading output,
.control-heading span {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

input[type="range"] {
  display: block;
  width: 100%;
  height: 22px;
  margin: 0;
  accent-color: var(--white);
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  background:
    linear-gradient(90deg, var(--white), var(--white)) 0 50% / var(--range-progress, 50%) 2px
      no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.28)) 0 50% /
      100% 1px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0 1px, transparent 1px 7px);
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 22px;
  border: 0;
  background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 16px;
  margin-top: 3px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
  background:
    linear-gradient(90deg, transparent 0 5px, rgba(255, 255, 255, 0.9) 5px 6px, transparent 6px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    #101010;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.82),
    0 0 0 2px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(255, 255, 255, 0.34);
}

input[type="range"]::-moz-range-track {
  height: 22px;
  border: 0;
  background: transparent;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent 0 5px, rgba(255, 255, 255, 0.9) 5px 6px, transparent 6px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    #101010;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.8),
    0 0 0 2px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(255, 255, 255, 0.34);
}

input[type="range"]:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.28));
}

.range-control {
  position: relative;
  height: 24px;
  --range-progress: 50%;
}

.range-control input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
}

.range-control input[type="range"]:active {
  cursor: grabbing;
}

.range-ticks {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 13px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.14)) 0 8px /
      100% 1px no-repeat,
    repeating-linear-gradient(
        90deg,
        transparent 0 31px,
        rgba(255, 255, 255, 0.46) 31px 32px,
        transparent 32px 62px
      )
      0 2px / 100% 9px no-repeat,
    repeating-linear-gradient(
        90deg,
        transparent 0 15px,
        rgba(255, 255, 255, 0.2) 15px 16px,
        transparent 16px 31px
      )
      0 6px / 100% 6px no-repeat;
}

.range-fill {
  position: absolute;
  bottom: 10px;
  left: 0;
  z-index: 1;
  width: var(--range-progress);
  height: 2px;
  border-radius: 999px;
  background: #f5f5f1;
  box-shadow:
    0 0 5px rgba(255, 255, 255, 0.32),
    0 0 1px rgba(255, 255, 255, 0.9);
}

.range-stop {
  position: absolute;
  bottom: 5px;
  z-index: 2;
  width: 5px;
  height: 11px;
}

.range-stop::before {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 8px;
  content: "";
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.22);
}

.range-stop::after {
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.72);
}

.range-stop-left {
  left: -1px;
}

.range-stop-left::before,
.range-stop-left::after {
  left: 0;
}

.range-stop-right {
  right: -1px;
}

.range-stop-right::before,
.range-stop-right::after {
  right: 0;
}

.range-thumb {
  position: absolute;
  bottom: 3px;
  left: var(--range-progress);
  z-index: 3;
  display: grid;
  width: 12px;
  height: 17px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(15, 15, 15, 0.98);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.72),
    0 0 5px rgba(255, 255, 255, 0.28),
    inset 0 0 4px rgba(255, 255, 255, 0.08);
  transform: translateX(-50%);
}

.range-thumb span {
  width: 5px;
  height: 9px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.76) 0 0.55px, transparent 0.8px) 0 0 /
    2px 2px;
  opacity: 0.82;
}

.range-control:focus-within .range-thumb {
  border-color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.72),
    0 0 7px rgba(255, 255, 255, 0.46),
    inset 0 0 4px rgba(255, 255, 255, 0.12);
}

.pose-number {
  position: absolute;
  top: 6px;
  right: 22px;
  z-index: 6;
  width: 54px;
  height: 20px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.78);
  color: var(--ink);
  font-size: 9px;
  font-weight: 500;
  padding: 0 9px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.control-card:hover .pose-number,
.pose-number:focus {
  opacity: 1;
}

.pose-number:focus {
  border-color: rgba(255, 255, 255, 0.72);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.pose-number::-webkit-outer-spin-button,
.pose-number::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input[type="color"] {
  width: 100%;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 1px;
}

.segmented {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  padding: 6px;
}

.mode {
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.mode.active {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--white);
}

.pose-actions {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.pose-action {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.pose-action:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.095);
}

.switch-row {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.switch {
  display: flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
  color: #cacac5;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  padding: 0 9px;
}

.switch input {
  width: 13px;
  height: 13px;
  accent-color: var(--white);
}

@media (max-width: 1050px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .stage-panel {
    height: min(64vh, 640px);
    min-height: 390px;
  }

  .control-panel {
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .app-shell {
    gap: 10px;
    padding: 10px;
  }

  .stage-panel {
    min-height: 340px;
  }

  .hud {
    font-size: 10px;
  }

  .top-left {
    top: 18px;
    left: 18px;
  }

  .bottom-left {
    right: 18px;
    bottom: 18px;
    left: 18px;
    justify-content: space-between;
  }

  .bottom-right,
  .stage-reticle,
  .stage-scale {
    display: none;
  }

  .control-panel {
    padding: 20px 16px 16px;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .switch-row {
    grid-template-columns: 1fr;
  }
}
