:root {
  --gold: #dab784;
  --cyan: #8debe2;
  --panel: #0c2027f5;
  --line: #a9d9db29;
  --muted: #a4b7bd;
  --text: #eef4f3;
  --bg: #08191e;
}
body {
  background: #08191e;
}
button {
  touch-action: manipulation;
}
body:after {
  box-shadow: inset 0 0 130px #02121966;
}
.primary {
  background: #9becdf;
  border-color: #9becdf;
  color: #092628;
}
.primary:hover {
  background: #cffbf3;
}
.brand small {
  letter-spacing: 3px;
  color: #bea882;
}
.brand-icon {
  color: var(--gold);
}
.hud {
  height: 100px;
  background: linear-gradient(#07181eeb, transparent);
  padding: 26px 40px;
}
.edition {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #b8a88c;
}
.status {
  font-size: 12px;
}
.icon-button {
  height: 38px;
  width: 38px;
}
.zone-caption .eyebrow {
  color: var(--gold);
}
.right-hud button.selected {
  color: #9bf1e3;
  background: #31524780;
}
.scene-label code {
  color: #a5f1e8;
}
.experiment-dock {
  background: linear-gradient(120deg, #153536f0, #12262ef0);
  border-color: #accbbd45;
}
.tiny {
  color: #a6bdc0;
}
.panel-head {
  background: #10282bf5;
}
.panel-head h2 {
  font-size: 17px;
}
.panel-body .hint {
  font-size: 12px;
}
#explorer {
  border-color: #bad7c641;
  box-shadow: 0 20px 80px #0005;
}
#back-home {
  font-size: 21px;
}
#mobile-toolbar,
#mobile-zoom {
  display: none;
}
#home-screen {
  position: fixed;
  inset: 100px 0 0;
  z-index: 4;
  pointer-events: none;
}
#home-screen button {
  pointer-events: auto;
}
.home #home-screen {
  display: block;
}
body:not(.home) #home-screen {
  display: none;
}
.home .zone-caption,
.home #zones,
.home .scene-label,
.home .right-hud,
.home .experiment-dock,
.home footer,
.home #touch-pad,
.home #crosshair,
.home #proximity,
.home #back-home {
  display: none !important;
}
.home:before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      #07181ef5 0%,
      #07181ee0 25%,
      #07181e66 50%,
      transparent 72%
    ),
    linear-gradient(0deg, #07181e 0%, transparent 44%);
}
.home-top {
  position: absolute;
  top: 22px;
  left: 44px;
  right: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.home-edition {
  font: 11px monospace;
  letter-spacing: 1.8px;
  color: #d1bd9d;
}
.home-edition i {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--gold);
  margin-right: 9px;
}
.home-top button {
  border: 0;
  background: none;
  color: #d5d8d0;
  padding: 12px;
  font-size: 13px;
}
.home-copy {
  position: absolute;
  left: 7%;
  top: 13%;
  max-width: 520px;
}
.home-kicker {
  font: 11px monospace;
  letter-spacing: 2px;
  color: #a3c8c8;
}
.home-copy h1 {
  font-size: clamp(42px, 4.7vw, 72px);
  line-height: 1.06;
  font-weight: 450;
  letter-spacing: -2px;
  margin: 22px 0;
}
.home-copy em {
  font-style: normal;
  color: #9febde;
}
.home-copy p {
  font-size: 16px;
  line-height: 1.75;
  color: #afc4c4;
  margin-bottom: 25px;
}
.home-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.home-actions button {
  padding: 15px 23px;
  border-radius: 9px;
  font-size: 14px;
  min-height: 51px;
}
.install-button {
  color: #d9e7e4;
  border-color: #9ac3bd3d;
  background: #1c363d55;
}
.home-origin {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 30px;
  color: #d7c2a4;
  font-size: 13px;
}
.origin-diamond {
  font-size: 34px;
  color: #bb9865;
}
.home-origin small {
  display: block;
  color: #8ea7a9;
  margin-top: 6px;
  font-size: 12px;
}
.home-preview {
  position: absolute;
  top: 52%;
  left: 61%;
  text-align: center;
  transform: translateX(-15%);
  pointer-events: auto;
  padding: 15px;
}
.home-preview .tiny {
  font-size: 10px;
  color: #d3e8dc;
}
.preview-tabs {
  display: flex;
  gap: 5px;
  margin: 12px 0;
}
.preview-tabs button {
  border-radius: 30px;
  background: #0c252de0;
  color: #a7c3c2;
  padding: 10px 15px;
  font-size: 12px;
  white-space: nowrap;
}
.preview-tabs button.active {
  background: #aee7d9;
  color: #14352f;
  border-color: #d5f6e5;
}
.preview-tip {
  font-size: 11px;
  color: #93b7b8;
}
.home-bottom {
  position: absolute;
  bottom: 22px;
  left: 7%;
  right: 7%;
}
.home-route-title {
  display: flex;
  justify-content: space-between;
  color: #b6c4c3;
  font-size: 12px;
  margin-bottom: 13px;
}
.home-route-title span:last-child {
  font: 11px monospace;
  color: #8ba5a5;
}
.home-routes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.home-routes button {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  padding: 18px 20px;
  border-radius: 10px;
  background: linear-gradient(115deg, #173138bd, #0b242baf);
  border-color: #86b2b730;
  backdrop-filter: blur(12px);
}
.home-routes button:hover {
  background: #244548;
}
.route-icon {
  font: 28px Georgia;
  color: var(--gold);
  width: 36px;
}
.home-routes button div {
  flex: 1;
  font-size: 15px;
}
.home-routes small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #8da8ab;
}
.home-routes button > span:last-child {
  color: #a8c3c1;
}
.home-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  color: #829b9d;
  font: 10px monospace;
  letter-spacing: 1px;
}
dialog {
  color: var(--text);
  border: 1px solid #bbd6c64d;
  border-radius: 18px;
  background: #10252c;
  width: min(530px, calc(100% - 28px));
  max-height: 85dvh;
  overflow: auto;
  padding: 30px;
  box-shadow: 0 20px 100px #0007;
}
dialog::backdrop {
  background: #021218b8;
  backdrop-filter: blur(7px);
}
dialog h2 {
  font-size: 25px;
  font-weight: 500;
  margin: 20px 0 13px;
}
dialog p,
dialog li {
  font-size: 15px;
  color: #b7cccd;
  line-height: 1.8;
}
dialog a {
  color: var(--cyan);
}
#close-info {
  position: absolute;
  right: 14px;
  top: 12px;
  border: 0;
  background: none;
  width: 40px;
  height: 40px;
  font-size: 23px;
}
#pwa-update {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 13px;
  background: #17433e;
  padding: 14px;
  border: 1px solid #8ecdbb;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 40px #0006;
}
#pwa-update button {
  padding: 9px;
}
.axis-controls {
  scroll-margin-top: 64px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.axis-controls h3 {
  font-size: 14px;
  font-weight: 550;
  margin: 0 0 14px;
}
.axis-toggle-row {
  display: flex;
  gap: 9px;
}
.axis-toggle-row label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #193b414d;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.axis-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.axis-fields label {
  font-size: 12px;
}
.axis-fields select {
  margin-bottom: 0;
}
.axis-fields input {
  min-height: 40px;
}
.mobile-sheet-bar {
  display: none;
}
.quality-row {
  margin-top: 18px;
}
.quality-row select {
  margin-bottom: 0;
}
@media (max-height: 760px) and (min-width: 801px) {
  .home-copy {
    top: 12%;
  }
  .home-copy h1 {
    font-size: 46px;
    margin: 14px 0;
  }
  .home-copy p {
    font-size: 14px;
    margin-bottom: 18px;
  }
  .home-origin {
    margin-top: 20px;
  }
  .home-bottom {
    bottom: 16px;
  }
  .home-preview {
    top: 48%;
  }
  .home-routes button {
    padding: 14px;
  }
  .home-foot {
    margin-top: 12px;
  }
  .home-top {
    top: 2px;
  }
}
@media (max-width: 1000px) and (min-width: 801px) {
  .home-copy {
    left: 5%;
    max-width: 440px;
  }
  .home-copy h1 {
    font-size: 49px;
  }
  .home-actions {
    gap: 8px;
  }
  .home-actions button {
    padding: 14px;
  }
  .home-preview {
    left: 65%;
    top: 53%;
  }
  .preview-tabs button {
    padding: 9px;
  }
  .home-bottom {
    left: 5%;
    right: 5%;
  }
  .home-routes button {
    gap: 7px;
    padding: 15px;
  }
  .home-routes small {
    font-size: 11px;
  }
}
@media (max-width: 800px), (max-width: 1000px) and (max-height: 500px) {
  :root {
    font-size: 16px;
  }
  .hud {
    height: calc(72px + env(safe-area-inset-top));
    padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  }
  .brand {
    font-size: 20px;
    gap: 10px;
    letter-spacing: 4px;
  }
  .brand small {
    font-size: 8px;
  }
  .brand-icon {
    font-size: 32px;
  }
  .edition,
  .divider,
  .status {
    display: none;
  }
  .hud-right {
    gap: 6px;
  }
  .icon-button {
    width: 38px;
    height: 38px;
  }
  .zone-caption {
    display: none;
  }
  .scene-label {
    top: calc(86px + env(safe-area-inset-top));
    left: 18px !important;
    right: 18px;
    transform: none;
    text-align: left;
    max-width: calc(100% - 85px);
    pointer-events: none;
  }
  .scene-label div {
    font-size: 14px;
    margin: 6px 0;
  }
  .scene-label code {
    font-size: 12px;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .scene-label .tiny {
    font-size: 10px;
  }
  .right-hud,
  .experiment-dock,
  footer {
    display: none;
  }
  #zones {
    display: none;
    top: calc(80px + env(safe-area-inset-top));
    left: 15px;
    right: 15px;
    z-index: 8;
    background: #10282ef5;
    padding: 14px;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #97d2c954;
    border-radius: 13px;
    backdrop-filter: blur(16px);
  }
  body.zones-open #zones {
    display: grid;
  }
  #zones button {
    font-size: 13px;
    padding: 12px;
    min-height: 48px;
  }
  #mobile-toolbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9;
    gap: 3px;
    justify-content: space-around;
    background: #0b2026f2;
    border-top: 1px solid #a5d3c933;
    padding: 8px 10px calc(9px + env(safe-area-inset-bottom));
    backdrop-filter: blur(20px);
  }
  #mobile-toolbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    background: none;
    color: #a3b8bc;
    font-size: 20px;
    min-width: 53px;
    min-height: 49px;
    padding: 5px 8px;
  }
  #mobile-toolbar button span {
    font-size: 10px;
  }
  #mobile-toolbar button.active {
    color: #a4f4e3;
  }
  #mobile-toolbar .mobile-main {
    background: #99e8d8;
    color: #113d36;
    border-radius: 12px;
    padding: 6px 20px;
  }
  #mobile-toolbar #mobile-axis {
    font-size: 14px;
  }
  .home #mobile-toolbar,
  .home #mobile-zoom {
    display: none;
  }
  #mobile-zoom {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: fixed;
    right: 15px;
    top: 42%;
    z-index: 4;
  }
  #mobile-zoom button {
    width: 42px;
    height: 42px;
    font-size: 22px;
    background: #0c2932c9;
  }
  #touch-pad {
    display: none;
    bottom: calc(99px + env(safe-area-inset-bottom));
    left: 16px;
    grid-template-columns: repeat(3, 43px);
  }
  body.walking:not(.open):not(.home) #touch-pad {
    display: grid;
  }
  #touch-pad button {
    height: 43px;
    background: #173d45b0;
  }
  #proximity {
    bottom: calc(170px + env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100% - 24px);
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
  }
  #explorer {
    inset: auto 0 calc(73px + env(safe-area-inset-bottom)) 0;
    width: 100%;
    height: 48dvh;
    max-height: calc(100dvh - 140px - env(safe-area-inset-top));
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    background: #0d252cf5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.2s ease;
  }
  #explorer.expanded {
    height: calc(100dvh - 157px - env(safe-area-inset-top));
  }
  .mobile-sheet-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 31px;
    background: #10282b;
  }
  .mobile-sheet-bar button {
    border: 0;
    background: none;
    color: #adc9c6;
    font-size: 11px;
    min-height: 30px;
    padding: 5px 35px;
  }
  .mobile-sheet-bar button:before {
    content: "";
    display: inline-block;
    width: 30px;
    height: 3px;
    background: #678a87;
    border-radius: 6px;
    margin-right: 10px;
    vertical-align: middle;
  }
  .panel-head {
    flex: none;
    padding: 10px 16px;
    border-top: 1px solid #83bcab16;
  }
  .panel-head h2 {
    font-size: 15px;
    white-space: nowrap;
  }
  .panel-head .tiny {
    font-size: 9px;
  }
  .panel-head .icon-button {
    min-width: 38px;
  }
  .panel-body {
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 13px 16px 25px;
  }
  .tabs {
    position: sticky;
    top: -13px;
    z-index: 2;
    background: #102a30;
    gap: 3px;
    margin-bottom: 17px;
    border-radius: 9px;
  }
  .tabs button {
    min-height: 40px;
    font-size: 13px;
  }
  .panel-body
    input:not([type="checkbox"]):not([type="range"]):not([type="color"]),
  .panel-body select,
  .panel-body textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .panel-body textarea {
    min-height: 72px;
  }
  .panel-body label {
    font-size: 13px;
  }
  .panel-body .hint {
    font-size: 12px;
  }
  .panel-body button {
    min-height: 40px;
  }
  .mode-grid button {
    font-size: 12px;
    min-height: 43px;
  }
  .action-row {
    margin-top: 13px;
  }
  .action-row button {
    min-height: 47px;
  }
  .panel-body input[type="range"] {
    min-height: 28px;
  }
  .panel-body input[type="checkbox"] {
    width: 19px;
    height: 19px;
  }
  .object-row {
    min-height: 49px;
  }
  .object-select {
    font-size: 13px;
  }
  .object-row button[data-remove] {
    min-width: 40px;
  }
  .open .scene-label {
    display: block !important;
  }
  .open #mobile-zoom {
    top: 22%;
  }
  .open #crosshair {
    display: none;
  }
  #toast {
    bottom: calc(86px + env(safe-area-inset-bottom));
    font-size: 13px;
    max-width: 92%;
    text-align: center;
    z-index: 18;
  }
  body.open #toast {
    bottom: calc(48dvh + 85px + env(safe-area-inset-bottom));
  }
  .check-options label {
    font-size: 12px;
    gap: 4px;
  }
  .home:before {
    background: linear-gradient(
      180deg,
      #07191ee6,
      transparent 52%,
      #07191ef2 78%,
      #07191e
    );
  }
  #home-screen {
    top: calc(72px + env(safe-area-inset-top));
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: none;
  }
  .home-top {
    top: 5px;
    left: 22px;
    right: 16px;
  }
  .home-edition {
    font-size: 9px;
    letter-spacing: 1.1px;
  }
  .home-top button {
    font-size: 11px;
    padding: 10px 5px;
  }
  .home-copy {
    top: 60px;
    left: 24px;
    right: 24px;
    max-width: none;
  }
  .home-kicker {
    font-size: 9px;
    letter-spacing: 1.5px;
  }
  .home-copy h1 {
    font-size: clamp(33px, 9.4vw, 48px);
    line-height: 1.06;
    letter-spacing: -1.2px;
    margin: 13px 0;
  }
  .home-copy p {
    font-size: 13px;
    line-height: 1.7;
    max-width: 310px;
    margin: 0;
  }
  .desktop-only {
    display: none;
  }
  .home-actions {
    position: fixed;
    left: 22px;
    right: 22px;
    bottom: calc(110px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  .home-actions button {
    padding: 14px 12px;
    min-height: 49px;
    font-size: 13px;
  }
  .home-actions .primary {
    flex: 1;
  }
  .home-origin {
    display: none;
  }
  .home-preview {
    position: fixed;
    top: auto;
    bottom: calc(181px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 0;
  }
  .home-preview .tiny,
  .preview-tip {
    font-size: 9px;
  }
  .preview-tabs {
    margin: 8px 0;
  }
  .preview-tabs button {
    padding: 10px 12px;
    font-size: 11px;
    min-height: 38px;
  }
  .home-bottom {
    left: 22px;
    right: 22px;
    bottom: calc(15px + env(safe-area-inset-bottom));
  }
  .home-route-title {
    display: none;
  }
  .home-routes {
    gap: 7px;
  }
  .home-routes button {
    display: block;
    text-align: center;
    padding: 9px 4px;
    min-height: 60px;
    border-radius: 9px;
  }
  .route-icon {
    display: none;
  }
  .home-routes button div {
    font-size: 11px;
  }
  .home-routes small {
    font-size: 9px;
    margin-top: 5px;
  }
  .home-routes button > span:last-child {
    display: none;
  }
  .home-foot {
    font-size: 8px;
    letter-spacing: 0.2px;
    margin-top: 11px;
    gap: 10px;
  }
  .home-foot span:first-child {
    display: none;
  }
  .home-foot span:last-child {
    margin: auto;
  }
  #pwa-update {
    bottom: calc(83px + env(safe-area-inset-bottom));
    width: max-content;
    max-width: 95%;
    font-size: 12px;
  }
  #help-panel {
    max-height: calc(90dvh - env(safe-area-inset-top));
    padding: 22px;
  }
  body.keyboard-open .hud,
  body.keyboard-open .scene-label,
  body.keyboard-open #mobile-zoom {
    display: none;
  }
  body.keyboard-open #explorer {
    height: calc(var(--visual-height, 100dvh) - 20px);
    max-height: calc(var(--visual-height, 100dvh) - 20px);
    bottom: auto;
    top: calc(var(--visual-top, 0px) + 10px);
  }
  body.keyboard-open #mobile-toolbar {
    display: none;
  }
}
@media (max-height: 690px) and (max-width: 800px) {
  .home-copy {
    top: 43px;
  }
  .home-copy h1 {
    font-size: 33px;
    margin: 10px 0;
  }
  .home-kicker {
    display: none;
  }
  .home-copy p {
    font-size: 12px;
    max-width: 265px;
  }
  .home-preview {
    bottom: 168px;
  }
  .home-actions {
    bottom: 102px;
  }
  .home-bottom {
    bottom: 10px;
  }
  .preview-tip {
    display: none;
  }
  .home-foot {
    display: none;
  }
}
@media (max-height: 500px) and (max-width: 1000px) {
  .home-copy {
    top: 27px;
    max-width: 50%;
  }
  .home-copy h1 {
    font-size: 31px;
  }
  .home-copy p {
    font-size: 12px;
  }
  .home-actions {
    position: static;
    margin-top: 13px;
  }
  .home-actions button {
    font-size: 11px;
    padding: 10px;
    min-height: 40px;
  }
  .home-bottom {
    display: none;
  }
  .home-preview {
    left: 73%;
    bottom: 35px;
  }
  .home-top {
    top: 0;
  }
  .home-origin,
  .home-kicker {
    display: none;
  }
  #explorer {
    left: auto;
    width: 52%;
    height: calc(100dvh - 90px);
    max-height: calc(100dvh - 90px);
    bottom: 0;
    border-radius: 15px 0 0 0;
  }
  #mobile-toolbar {
    right: 52%;
    padding: 5px;
    gap: 0;
  }
  #mobile-toolbar button {
    min-width: 35px;
    font-size: 16px;
    padding: 4px;
  }
  #mobile-toolbar .mobile-main {
    padding: 5px 10px;
  }
  #mobile-toolbar button span {
    font-size: 9px;
  }
  .open #mobile-zoom {
    right: auto;
    left: 12px;
    top: 42%;
  }
  .mobile-sheet-bar {
    display: none;
  }
  .panel-head {
    padding: 8px;
  }
  .panel-head h2 {
    font-size: 12px;
  }
  .panel-head .tiny {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
  .home:before {
    animation: none;
  }
}
/* Each apparatus operates in its own place in the room. */
#station-panel {
  position: fixed;
  z-index: 16;
  right: 24px;
  top: 105px;
  width: 340px;
  max-height: calc(100dvh - 130px);
  display: flex;
  flex-direction: column;
  border: 1px solid #b99c6780;
  border-radius: 18px;
  background: #1c292bef;
  box-shadow: 0 20px 70px #0008;
  overflow: hidden;
}
#station-panel[hidden] {
  display: none;
}
.live-chart {
  margin: 12px 14px 0;
  flex-shrink: 0;
  padding: 10px;
  border: 1px solid #80e8e14a;
  border-radius: 12px;
  background: #081e26;
}
.live-chart figcaption { display: grid; gap: 5px; margin-bottom: 8px; }
.live-chart strong { color: #ecdfc2; font-size: 14px; }
.live-chart canvas { display: block; width: 100%; height: 170px; }
.live-chart-values { color: #a1eee3; font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.live-chart p { font-size: 11px; color: #aebdbb; line-height: 1.45; margin: 8px 0 0; }
.craft-source a { color: #e8cd92; }
.instrument-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px;
  background: #542d27;
}
.instrument-head h2 {
  font-size: 18px;
  margin: 5px 0 0;
  color: #f3e2bf;
}
.instrument-head button {
  min-width: 44px;
  min-height: 44px;
  font-size: 22px;
}
.instrument-body {
  flex: 1;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
}
.instrument-body p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 15px;
}
.instrument-body label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin: 12px 0 6px;
}
.instrument-body input,
.instrument-body select {
  width: 100%;
  min-height: 40px;
  font-size: 16px;
}
.instrument-body button {
  min-height: 44px;
  font-size: 13px;
  padding: 10px;
}
#instrument-readout {
  display: block;
  white-space: pre-line;
  margin: 14px 0;
  padding: 12px;
  background: #071c24;
  border: 1px solid #9cbeae55;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.7;
  color: #e5d9b9;
}
.station-open .scene-label,
.station-open #proximity,
.station-open #crosshair {
  display: none !important;
}
@media (max-width: 800px), (max-width: 1000px) and (max-height: 500px) {
  #station-panel {
    inset: auto 0 calc(73px + env(safe-area-inset-bottom));
    width: 100%;
    height: 38dvh;
    max-height: 50dvh;
    border-radius: 18px 18px 0 0;
  }
  #station-panel:has(.live-chart) { height: 50dvh; }
  .live-chart { padding: 6px 8px; margin: 6px 12px 0; }
  .live-chart canvas { height: 130px; object-fit: contain; }
  .live-chart figcaption { gap: 2px; margin: 0; }
  .live-chart .tiny { display: none; }
  .live-chart p { display: none; }
  .live-chart-values { font-size: 11px; }
  .instrument-head {
    padding: 10px 16px;
  }
  .instrument-head h2 {
    font-size: 16px;
  }
  .instrument-body {
    padding: 12px 16px 24px;
  }
  .station-open #mobile-zoom {
    top: 21%;
  }
}
@media (max-width: 1000px) and (max-height: 500px) {
  #station-panel:has(.live-chart) { height: auto; }
  #station-panel > .live-chart { flex-shrink: 0; }
  #station-panel:has(.live-chart) .instrument-head { padding: 6px 12px; }
  #station-panel:has(.live-chart) .instrument-head .tiny { display: none; }
  #station-panel:has(.live-chart) .instrument-head h2 { font-size: 14px; margin: 0; }
  .live-chart canvas { height: 120px; }
  #station-panel:has(.live-chart) .instrument-body { min-height: 0; }
  #station-panel {
    inset: 80px 0 0 auto;
    width: 48%;
    height: auto;
    max-height: none;
    border-radius: 15px 0 0;
  }
  .station-open #mobile-toolbar {
    right: 48%;
  }
  .station-open #mobile-zoom {
    left: 12px;
    right: auto;
    top: 32%;
  }
}
.station-open .zone-caption,
.station-open #zones,
.station-open .right-hud,
.station-open .experiment-dock {
  display: none;
}

/* Guided experiments and an opt-in Creative Commons soundtrack. */
.starter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 9px 0 14px;
  color: #b0c4c5;
  font-size: 11px;
  line-height: 1.5;
}
.starter-row button {
  flex-shrink: 0;
  font-size: 11px;
  padding: 8px 10px;
  min-height: 40px;
  color: var(--gold);
}
.subject-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 18px;
}
.subject-shortcuts button {
  padding: 10px 4px;
  font-size: 11px;
  min-height: 42px;
}
.subject-shortcuts .active {
  border-color: var(--gold);
  color: var(--gold);
  background: #caac7620;
}
.preset-grid .preset-subject {
  display: block;
  color: var(--gold);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.preset-grid .preset-context {
  display: block;
  font-size: 10px;
  color: #adbec5;
  line-height: 1.5;
  margin-top: 9px;
  font-weight: 400;
}
.lesson-card {
  margin: 12px 0;
  background: #d3b47b09;
  border: 1px solid #d3b47b3d;
  border-radius: 10px;
  padding: 12px 14px;
}
.lesson-card summary {
  font-size: 12px;
  color: var(--gold);
}
.lesson-card p {
  font-size: 12px;
  line-height: 1.7;
  color: #bcced2;
  margin: 12px 0;
}
.lesson-card strong {
  font-weight: 500;
  color: #e3eff0;
}
.lesson-card small {
  display: block;
  font-size: 10px;
  line-height: 1.5;
  color: #9aafb8;
}
.lesson-challenge {
  padding-left: 10px;
  border-left: 2px solid #b6e5d4;
}
#music-toggle.playing {
  color: var(--gold);
  border-color: var(--gold);
  background: #d2ae7520;
}
#music-dialog {
  color: #e2eee8;
  background: linear-gradient(140deg, #19312f, #101f28 70%);
  border: 1px solid #c2a37470;
  border-radius: 22px;
  padding: 30px;
  width: min(370px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: 0 24px 90px #000a;
}
#music-dialog::backdrop {
  background: #020c13a8;
  backdrop-filter: blur(8px);
}
#music-close {
  position: absolute;
  right: 14px;
  top: 14px;
}
#music-dialog h2 {
  font:
    400 30px Georgia,
    serif;
  letter-spacing: -0.4px;
  margin: 4px 0 8px;
  color: #f0dfba;
}
#music-dialog p {
  font-size: 12px;
  color: #bdd0ce;
  line-height: 1.7;
  margin: 8px 0 16px;
}
#music-dialog #music-status {
  font-size: 11px;
  color: #e0c58e;
  min-height: 2em;
}
#music-dialog label {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  font-size: 12px;
}
#music-dialog input {
  width: 100%;
  accent-color: #d2b27a;
  min-height: 44px;
}
#music-dialog .hint {
  font-size: 10px;
  margin-top: 10px;
}
#music-dialog a {
  color: #b4dcce;
  font-size: 11px;
  text-underline-offset: 3px;
}
.music-art {
  height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #e1c48c;
}
.music-art span {
  font-size: 58px;
  font-family: Georgia, serif;
  margin-right: 20px;
}
.music-art i {
  width: 3px;
  height: 23px;
  background: linear-gradient(#dfc289, #76bdaa);
  border-radius: 4px;
  transform-origin: center;
}
.music-art i:nth-of-type(2),
.music-art i:nth-of-type(4) {
  height: 43px;
}
.music-art i:nth-of-type(3) {
  height: 64px;
}
.playing .music-art i {
  animation: music-breathe 2.4s ease-in-out infinite alternate;
}
.playing .music-art i:nth-of-type(even) {
  animation-delay: -1.2s;
}
@keyframes music-breathe {
  to {
    transform: scaleY(0.5);
    opacity: 0.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .playing .music-art i {
    animation: none;
  }
}
@media (max-width: 420px) {
  .hud {
    padding-left: 12px;
    padding-right: 12px;
  }
  .brand {
    gap: 6px;
    font-size: 18px;
    letter-spacing: 3px;
  }
  .brand-icon {
    font-size: 26px;
  }
  .hud-right {
    gap: 3px;
  }
  .hud-right .icon-button {
    width: 40px;
    height: 42px;
  }
  .starter-row {
    gap: 6px;
    font-size: 10px;
  }
}
@media (max-height: 480px) {
  #music-dialog {
    padding: 20px 25px;
  }
  .music-art {
    height: 55px;
  }
  .music-art span {
    font-size: 35px;
  }
}

/* Aula Betang: a quiet instrument menu and a legible mathematical writing surface. */
#zones {
  width: 230px;
  max-height: calc(100dvh - 410px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(90deg, #0b2027eb, #0b202790);
  border: 1px solid #d6c39125;
  border-radius: 12px;
  padding: 10px;
  scrollbar-width: thin;
}
.zone-menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 13px;
  color: #eee1c4;
  gap: 12px;
}
.zone-menu-heading b {
  font-size: 14px;
  font-weight: 500;
}
.zone-menu-heading span {
  font-size: 11px;
  color: #aaafa6;
  letter-spacing: 1px;
}
#zones .zone-gallery {
  border: 0;
  border-top: 1px solid #b9c8bd20;
  margin: 0;
  padding: 0;
  border-radius: 0;
}
#zones .zone-gallery summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 9px;
  font-size: 13px;
  cursor: pointer;
  color: #bdcec9;
  list-style: none;
}
#zones .zone-gallery summary:after {
  content: "＋";
  color: #c6ae7e;
  margin-left: 6px;
}
#zones .zone-gallery[open] summary:after {
  content: "−";
}
#zones .zone-gallery summary span {
  margin-left: auto;
  color: #7d9b9b;
  font-size: 11px;
}
#zones .zone-gallery[open] summary {
  color: #eed9ad;
}
#zones button {
  font-size: 12px;
  line-height: 1.5;
  min-height: 43px;
  padding: 9px 7px;
  width: 100%;
  gap: 8px;
}
#zones .zone-gallery button {
  padding-left: 13px;
}
.formula-preview {
  padding: 16px 14px 12px;
  background: #f1eddf;
  color: #24373d;
  border: 1px solid #d5c18c;
  border-radius: 12px;
  margin: 12px 0;
}
.formula-preview > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #596862;
  font-size: 11px;
  letter-spacing: 1px;
}
.formula-preview small {
  font-size: 11px;
  letter-spacing: 0;
  text-align: right;
  color: #758278;
}
#formula-render {
  min-height: 72px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 10px 3px 5px;
  max-width: 100%;
}
#formula-render math {
  font-size: 25px;
  color: #20363b;
  margin: auto;
  flex-shrink: 0;
  font-family: math, "Cambria Math", "STIX Two Math", serif;
}
.formula-placeholder {
  font-size: 13px;
  color: #677568;
  line-height: 1.6;
}
.formula-keyboard {
  border: 1px solid #c8b48240;
  border-radius: 10px;
  margin: 12px 0;
  padding: 11px;
}
.formula-keyboard summary {
  font-size: 14px;
  color: #e9d7af;
}
.formula-keyboard > div {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.formula-keyboard button {
  font-size: 19px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 0;
  background: #18343c;
  color: #dbe9e3;
  border: 1px solid #77999e42;
}
.formula-keyboard button:nth-child(-n + 2) {
  background: #69533345;
  border-color: #d6af7166;
  color: #ffe1a9;
  font-family: Georgia, serif;
  font-size: 24px;
}
.formula-keyboard p {
  font-size: 12px;
  line-height: 1.65;
  color: #a9bcb9;
  margin: 10px 0 0;
}
.instrument-head h2 {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.2px;
}
.instrument-body > p {
  font-size: 14px;
  line-height: 1.7;
}
.instrument-body label {
  font-size: 14px;
}
.instrument-body button {
  min-height: 44px;
  font-size: 14px;
}
#instrument-readout {
  font-size: 14px;
  line-height: 1.8;
  border-left: 2px solid #dbc18d;
  background: #dcc09408;
}
@media (max-width: 800px), (max-width: 1000px) and (max-height: 500px) {
  #zones {
    top: calc(82px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100dvh - 185px);
    padding: 14px;
    background: #10262cf5;
    border: 1px solid #d8bb7b44;
    box-shadow: 0 20px 60px #0007;
  }
  #zones button {
    font-size: 14px;
    min-height: 45px;
  }
  #zones .zone-gallery summary {
    font-size: 14px;
    min-height: 46px;
  }
  .formula-preview {
    padding: 12px;
  }
  #formula-render math {
    font-size: 24px;
  }
  .open .scene-label {
    display: none;
  }
}
