:root {
  color-scheme: dark;
  --bg: #0c1118;
  --card: #121a24;
  --border: #2a3542;
  --muted: #a1adbb;
  --gold: #eeb67c;
  --cyan: #88cfc1;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  background: var(--bg);
  color: #eaeef2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 75% -15%, #182433 0, transparent 48%), var(--bg);
  font-size: 14px;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: transparent;
  border: 0;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
canvas:focus-visible,
summary:focus-visible,
#stage:focus-visible {
  outline: 2px solid #f3bc83;
  outline-offset: 2px;
}
button:hover:not(:disabled) {
  filter: brightness(1.17);
}
[hidden] {
  display: none !important;
}
#symbols {
  display: none;
}
i[data-i],
svg.ic {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  display: inline-block;
}
.mono,
.eyebrow,
.kicker span,
.panelhead small,
.topcode,
.hud,
.live,
.specs b,
.drawno,
.value,
.rangeends,
.maptools,
.station .mono,
footer span,
.missiontext h2 b,
.missiontext h2 small {
  font-family:
    ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}
.top {
  border-bottom: 1px solid #26313c;
  background: #0d141dd9;
}
.bar,
main {
  max-width: 1516px;
  margin: auto;
  padding-left: clamp(22px, 4vw, 76px);
  padding-right: clamp(22px, 4vw, 76px);
}
.bar {
  min-height: 65px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #f4f2ef;
  white-space: nowrap;
}
.brand b {
  font-size: 18px;
  letter-spacing: 2.1px;
  font-weight: 720;
}
.divider,
.vline {
  height: 17px;
  border-left: 1px solid #3a424c;
}
.brandmeta {
  font-size: 12px;
  color: #9ca9b6;
  letter-spacing: 0.14em;
}
.bar nav {
  display: flex;
  margin: auto;
  height: 65px;
  gap: 16px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  color: #9aa6b5;
  font-weight: 520;
}
.nav.active {
  border-color: var(--gold);
  color: var(--gold);
  background: linear-gradient(0deg, #eeb67c09, transparent 72%);
}
.help {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bec8d3;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 12px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 32px 0 24px;
  gap: 15px;
}
.eyebrow,
.kicker,
.panelhead small,
.drawno,
.topcode {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
}
.eyebrow {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--gold);
}
.eyebrow b {
  width: 19px;
  height: 1px;
  background: var(--gold);
}
.eyebrow span:first-of-type {
  color: #786149;
}
.intro h1 {
  font-size: clamp(34px, 3vw, 47px);
  letter-spacing: -1px;
  line-height: 1.16;
  font-weight: 680;
  margin: 11px 0 8px;
}
.period {
  color: var(--gold);
  padding-left: 2px;
}
.intro p {
  color: #a5b0bd;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.35px;
}
.station {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #bac6d1;
  margin-bottom: 2px;
}
.station .mono {
  font-size: 10px;
  color: #93a1af;
  letter-spacing: 0.5px;
}
.station .vline {
  height: 12px;
}
.dot,
.live b {
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 9px #81cfbe48;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(270px, 24.4vw, 355px);
  gap: 19px;
  align-items: start;
}
.left {
  min-width: 0;
}
.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}
.panelhead {
  height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.panelhead > div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.panelhead .ic {
  color: #bdcbd8;
  width: 16px;
}
.panelhead strong {
  font-size: 14px;
  letter-spacing: 0.5px;
}
.panelhead small {
  font-size: 9px;
  letter-spacing: 1.35px;
  color: #8192a5;
  margin-left: 3px;
}
.live {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9ad7c9;
  letter-spacing: 1.3px;
  font-size: 10px;
}
.live b {
  height: 5px;
  width: 5px;
}
#stage {
  position: relative;
  height: clamp(345px, 47vh, 625px);
  min-height: 340px;
  overflow: hidden;
  touch-action: pan-y;
  background: #0b1420;
}
#sky {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
  user-select: none;
}
.hud,
.corner {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.hud {
  font-size: 10px;
  letter-spacing: 0.8px;
  color: #aaaaaf;
}
.hud.tag {
  left: 23px;
  top: 20px;
  padding: 5px 8px;
  border: 1px solid #61718165;
  border-radius: 4px;
  background: #0e1825b0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ced9e5;
  font-family: inherit;
  letter-spacing: 0.6px;
  font-size: 11px;
}
.tag em {
  width: 5px;
  height: 5px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}
.topcode {
  right: 23px;
  top: 24px;
  color: #8997aa;
  font-size: 9px;
  letter-spacing: 1.5px;
}
.lowerleft,
.scale {
  bottom: 20px;
  font-size: 10px;
  color: #a5b2c2;
  text-shadow: 0 1px 3px #07101d;
}
.lowerleft {
  left: 23px;
}
.scale {
  right: 24px;
  border-bottom: 1px solid #97a4b4;
  padding: 0 3px 3px;
}
.scale:before,
.scale:after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 4px;
  background: #97a4b4;
}
.scale:before {
  left: 0;
}
.scale:after {
  right: 0;
}
.corner {
  width: 10px;
  height: 10px;
  border: 0 solid #96a6ba75;
}
.tl {
  left: 12px;
  top: 11px;
  border-width: 1px 0 0 1px;
}
.tr {
  right: 12px;
  top: 11px;
  border-width: 1px 1px 0 0;
}
.bl {
  left: 12px;
  bottom: 11px;
  border-width: 0 0 1px 1px;
}
.br {
  right: 12px;
  bottom: 11px;
  border-width: 0 1px 1px 0;
}
#loading {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  background: #162130;
  padding: 9px 14px;
  border-radius: 6px;
}
.viewbar {
  min-height: 56px;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
}
.seg {
  display: flex;
  padding: 3px;
  border: 1px solid #2a3541;
  border-radius: 7px;
  background: #0c131d;
  gap: 3px;
}
.seg button {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9eacbb;
  font-size: 12px;
  border-radius: 4px;
  padding: 6px 12px;
  border: 1px solid transparent;
}
.seg button.on,
.ep button.on {
  color: var(--gold);
  background: #2d2824;
  border-color: #785b40;
}
.seg .ic {
  width: 14px;
  height: 14px;
}
#viewstats,
#guessdiam {
  font-size: 11px;
  color: #a9b5c3;
}
.mission {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin-top: 15px;
  position: relative;
  background: linear-gradient(110deg, #19232e, #121a24 72%);
}
.missionicon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background:
    repeating-radial-gradient(circle, transparent 0 9px, #8c73551c 9px 10px),
    #252924;
  border: 1px solid #51493c;
  border-radius: 9px;
}
.missionicon .ic {
  width: 27px;
  height: 27px;
  color: var(--gold);
}
.kicker {
  color: #c8a581;
  font-size: 10px;
  letter-spacing: 1px;
}
.kicker span {
  color: #84909e;
  font-size: 9px;
  letter-spacing: 1.25px;
  margin-left: 4px;
}
.missiontext h2 {
  font-size: 22px;
  letter-spacing: 0.3px;
  line-height: 1.2;
  margin: 6px 0 4px;
  font-weight: 620;
}
.missiontext h2 b {
  font-size: 0.87em;
  margin-right: 7px;
}
.muted,
.micro,
.copy,
.subhint {
  color: #a2afbd;
  font-size: 12px;
}
.mission-actions {
  margin-left: auto;
  display: grid;
  justify-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.primary,
.outline {
  background: var(--gold);
  color: #271e15;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  border-radius: 6px;
}
.primary .ic,
.outline .ic {
  width: 15px;
  height: 15px;
}
.linkbtn {
  color: #acb7c4;
  font-size: 11px;
}
.linkbtn span {
  color: var(--gold);
  padding-left: 3px;
}
.controls {
  padding: 15px 17px 13px;
}
.caption,
.rowlabel {
  font-size: 12px;
  color: #c1cbd6;
}
.caption {
  display: block;
  margin-bottom: 7px;
}
.select {
  position: relative;
}
.select:after {
  content: "";
  height: 5px;
  width: 5px;
  border: solid #aab5c3;
  border-width: 0 1.4px 1.4px 0;
  transform: rotate(45deg);
  position: absolute;
  top: calc(50% - 4px);
  right: 13px;
  pointer-events: none;
}
select,
input[type="number"] {
  border: 1px solid #344251;
  border-radius: 5px;
  background: #0e1620;
  outline: 0;
}
select {
  width: 100%;
  appearance: none;
  padding: 7px 29px 7px 11px;
  cursor: pointer;
  font-size: 12px;
}
.big select {
  font-weight: 550;
  font-size: 14px;
}
.blueprint {
  height: 85px;
  margin-top: 10px;
  position: relative;
  background:
    radial-gradient(ellipse at center, #1c2935aa, transparent 80%),
    linear-gradient(#25313c66 1px, transparent 1px),
    linear-gradient(90deg, #25313c66 1px, transparent 1px), #101821;
  background-size:
    auto,
    14px 14px,
    14px 14px,
    auto;
  border: 1px solid #2a3541;
  border-radius: 5px;
}
.blueprint img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.drawno {
  font-size: 7px;
  position: absolute;
  left: 7px;
  top: 6px;
  color: #8393a2;
  letter-spacing: 1px;
}
.drawno b {
  color: #c7a680;
}
.specs {
  display: flex;
  padding-top: 9px;
}
.specs > div {
  flex: 1;
  text-align: center;
  border-right: 1px solid #2a3541;
}
.specs > div:first-child {
  text-align: left;
}
.specs > div:last-child {
  border: 0;
}
.specs small {
  font-size: 10px;
  display: block;
  color: #8f9ba9;
}
.specs b {
  font-size: 12px;
  color: #dce3e9;
  font-weight: 550;
  display: block;
  margin-top: 3px;
}
.rule {
  border-top: 1px solid #2b3743;
  margin: 13px 0;
}
.labelline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  gap: 8px;
}
.labelline .caption {
  margin: 0;
}
.labelline > span,
.value {
  color: #acbaca;
  font-size: 11px;
}
.ep {
  display: flex;
  gap: 4px;
}
.ep button {
  border: 1px solid #34404e;
  background: #151e29;
  color: #bbc6d1;
  border-radius: 4px;
  padding: 6px 4px;
  flex: 1;
  white-space: nowrap;
  font:
    11px ui-monospace,
    monospace;
}
.ep button[data-ep="zoom"] {
  flex: 1.95;
}
.ep button.on {
  border-color: #785b40;
}
.mount {
  margin-top: 11px;
}
.mount select {
  padding-top: 4px;
  padding-bottom: 4px;
}
.rowlabel,
.subhint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rowlabel .ic {
  width: 14px;
  height: 14px;
  color: #9daec0;
}
input.switch {
  appearance: none;
  cursor: pointer;
  width: 29px;
  height: 16px;
  background: #35414e;
  border: 1px solid #485463;
  border-radius: 20px;
  position: relative;
  transition: 0.15s;
  margin: 0;
}
input.switch:before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 100%;
  background: #c5ced7;
  position: absolute;
  top: 2px;
  left: 2px;
}
input.switch:checked {
  background: #9fbbad;
  border-color: #9fbbad;
}
input.switch:checked:before {
  background: #122821;
  left: 15px;
}
input.switch:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
input[type="range"] {
  accent-color: var(--gold);
  width: 100%;
  height: 4px;
  display: block;
  margin: 8px 0;
  cursor: pointer;
}
.rangeends,
.zoomline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #9ba7b4;
  font-size: 10px;
}
.zoomline input {
  flex: 1;
}
.zoomline output {
  white-space: nowrap;
}
.controls details {
  margin-top: 11px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
summary {
  cursor: pointer;
  color: #abb7c4;
  font-size: 11px;
}
details label,
#customrow {
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #bac5d0;
}
input[type="number"] {
  width: 70px;
  padding: 4px 6px;
}
details small {
  color: #95a2b1;
  font-size: 10px;
}
.outline {
  background: #282820;
  color: var(--gold);
  border: 1px solid #735d44;
  width: 100%;
  margin-top: 18px;
}
.micro {
  font-size: 11px;
  text-align: center;
}
.copy {
  font-size: 13px;
  line-height: 1.85;
  margin: 0;
}
.amber {
  color: var(--gold);
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 1px;
}
.controls h3 {
  font-size: 20px;
  margin: 7px 0;
}
#gamekit .caption:not(:first-child) {
  margin-top: 16px;
}
.subhint {
  font-size: 11px;
}
.guessing .scale {
  display: none;
}
#mapbox {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: min(175px, 43%);
  background: #101b29;
  border: 1px solid #5b6a7a;
  border-radius: 7px;
  box-shadow: 0 4px 17px #030811a0;
  overflow: hidden;
  z-index: 3;
}
#mapbox.expanded {
  width: min(80%, 540px, calc((47vh - 85px) * 2));
}
.maptop,
.maptools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 7px;
  gap: 5px;
}
.maptop button {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.maptop .ic {
  width: 12px;
}
.maptop span,
.maptools span {
  font-size: 9px;
  color: #a8b7c8;
}
.maptools {
  display: none;
  border-top: 1px solid #293543;
  justify-content: flex-start;
  padding: 3px 7px;
}
.expanded .maptools {
  display: flex;
}
.maptools button {
  border: 1px solid #3d4856;
  border-radius: 3px;
  font-size: 11px;
  min-width: 23px;
}
.maptools span {
  margin-left: auto;
}
#atlas {
  display: block;
  width: 100%;
  aspect-ratio: 2/1;
  touch-action: none;
  cursor: crosshair;
}
.maptop {
  border-bottom: 1px solid #2a3949;
}
#feedback {
  border: 1px solid #4d4d40;
  background: #20251f;
  border-radius: 8px;
  color: #e4d6bd;
  font-size: 13px;
  padding: 12px 15px;
  margin-top: 10px;
}
.mount + .labelline {
  margin-top: 5px;
}
footer {
  border-top: 1px solid #25303b;
  margin-top: 24px;
  padding: 14px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #8794a3;
}
footer span {
  font-size: 9px;
  letter-spacing: 1px;
}
footer b {
  color: var(--gold);
  font-size: 13px;
}
footer i {
  font-style: normal;
  color: #5d6976;
  margin: 0 4px;
}
footer button {
  font-size: 10px;
  color: #98a6b4;
}
dialog {
  background: #131d29;
  color: #e4eaf0;
  border: 1px solid #405065;
  border-radius: 13px;
  width: min(500px, 92vw);
  padding: 22px;
  box-shadow: 0 25px 80px #0009;
}
dialog::backdrop {
  background: #050910bb;
}
.dlghead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dlghead button {
  font-size: 24px;
  line-height: 1;
}
.dlghead .eyebrow {
  font-size: 9px;
}
dialog h2 {
  font-size: 24px;
  margin: 12px 0;
}
dialog p,
dialog li {
  line-height: 1.8;
  font-size: 13px;
  color: #bfcbda;
}
dialog a {
  color: var(--gold);
}
.taskoption {
  width: 100%;
  text-align: left;
  margin: 3px 0;
  padding: 10px;
  background: #1c2937;
  border-radius: 5px;
}
.taskoption small {
  display: block;
  color: #9cabbc;
  padding-top: 4px;
}
@media (min-width: 1650px) {
  #stage {
    height: 54vh;
  }
}
@media (max-width: 980px) {
  .brandmeta,
  .brandline {
    display: none;
  }
  .bar,
  main {
    padding-left: 22px;
    padding-right: 22px;
  }
  .layout {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 255px;
  }
  .bar {
    gap: 8px;
  }
  .mission {
    padding: 14px;
    gap: 10px;
  }
  .missionicon {
    width: 37px;
    height: 37px;
  }
  .kicker span {
    display: none;
  }
  .seg button {
    padding: 6px 8px;
  }
  .station .mono,
  .station .vline {
    display: none;
  }
  .controls {
    padding: 12px;
  }
  .panelhead {
    padding: 0 13px;
  }
}
@media (max-width: 735px) {
  .bar,
  main {
    padding-left: 14px;
    padding-right: 14px;
  }
  .bar {
    flex-wrap: wrap;
    gap: 0;
  }
  .brand b {
    font-size: 15px;
  }
  .brand svg {
    width: 28px;
  }
  .brand {
    padding: 8px 0;
  }
  .bar nav {
    height: 46px;
    gap: 0;
    margin-left: auto;
    margin-right: 6px;
  }
  .nav {
    padding: 0 8px;
    font-size: 12px;
    gap: 4px;
  }
  .nav .ic {
    width: 14px;
  }
  .bar {
    min-height: 47px;
  }
  .help {
    padding: 6px;
  }
  .help span {
    display: none;
  }
  .intro {
    padding: 21px 0 16px;
  }
  .intro h1 {
    font-size: 31px;
  }
  .intro p {
    font-size: 12px;
  }
  .station {
    display: none;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .panelhead {
    height: 41px;
  }
  #stage {
    height: clamp(310px, 52vh, 470px);
    min-height: 0;
  }
  .viewbar {
    min-height: 48px;
    padding: 6px 9px;
  }
  .mission {
    margin-top: 10px;
  }
  .missiontext h2 {
    font-size: 18px;
  }
  .missionicon {
    display: none;
  }
  .controls {
    padding: 14px 16px;
  }
  .blueprint {
    height: 90px;
  }
  .mission .muted {
    font-size: 11px;
  }
  .primary {
    font-size: 12px;
    padding: 8px 10px;
  }
  #mapbox.expanded {
    width: min(94%, 510px);
  }
  .panelhead small {
    font-size: 8px;
  }
  .topcode {
    font-size: 8px;
  }
  footer {
    margin-top: 14px;
  }
  .specs > div {
    text-align: center !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
details select {
  width: auto;
  padding: 3px 6px;
  appearance: auto;
}
#drivebar,
.axis-keys,
.gear-keys {
  display: flex;
  align-items: center;
}
#drivebar {
  padding: 7px 15px;
  gap: 6px 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  color: #a9b5c3;
  font-size: 11px;
}
.axis-keys {
  gap: 12px;
}
#drivebar kbd {
  font:
    11px ui-monospace,
    monospace;
  font-weight: 600;
}
.gear-keys {
  gap: 4px;
}
.gear-keys span {
  padding: 2px 5px;
  border: 1px solid transparent;
  border-radius: 4px;
}
.gear-keys [aria-current="true"] {
  color: var(--gold);
  background: #2d2824;
  border-color: #785b40;
}
#speed-readout {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 500px) {
  #drivebar {
    padding: 6px 9px;
    gap: 4px 8px;
  }
  .axis-keys {
    gap: 5px;
  }
  .gear-keys {
    gap: 1px;
  }
}
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fullscreen-button,
.preset-pick button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #c5d0db;
  border: 1px solid #405063;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.fullscreen-button .ic {
  height: 13px;
  width: 13px;
}
.fullscreen-button[aria-pressed="true"] {
  color: var(--gold);
  border-color: #785b40;
}
.seg kbd,
.fullscreen-button kbd {
  color: #97a8b9;
  font:
    10px ui-monospace,
    monospace;
}
.equipment-grid,
.ed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.equipment-form {
  padding: 18px;
}
.equipment-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #b6c3d2;
  min-width: 0;
}
.equipment-card input:not([type="checkbox"]),
.equipment-card select {
  width: 100%;
  height: 35px;
  padding: 6px 9px;
  background: #0e1620;
  border: 1px solid #344251;
  border-radius: 5px;
  color: #e5ecf2;
}
.preset-pick {
  display: flex;
  align-items: end;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.preset-pick label {
  flex: 1;
}
.preset-pick button {
  height: 35px;
  color: var(--gold);
}
.ed-grid {
  gap: 12px;
}
.ed-switches {
  display: grid;
  gap: 6px;
  align-self: end;
}
.equipment-card label.ed-check {
  display: block;
}
.ed-check input {
  accent-color: var(--gold);
}
.ed-footer p,
.equipment-note {
  color: #a5b3bf;
  font-size: 12px;
  line-height: 1.65;
}
.ed-footer output {
  display: block;
  margin-top: 9px;
  color: var(--gold);
  font-size: 12px;
}
#ep {
  flex-wrap: wrap;
}
#ep button {
  overflow-wrap: anywhere;
  white-space: normal;
}
.custom-tube {
  padding: 16px 4px;
  color: var(--gold);
  font:
    11px ui-monospace,
    monospace;
}
.equipment-note {
  margin: 15px 2px;
}
body.field-expanded {
  overflow: hidden;
}
#observing-area.expanded-field {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: var(--bg);
  width: 100%;
  height: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: auto;
}
#observing-area.expanded-field .viewer {
  display: flex;
  flex: 1 0 55%;
  flex-direction: column;
  min-height: 160px;
}
#observing-area.expanded-field #stage {
  flex: 1 1 0;
  height: auto;
  min-height: 100px;
}
#observing-area.expanded-field .viewer > :not(#stage),
#observing-area.expanded-field .mission {
  flex-shrink: 0;
}
#observing-area.expanded-field .mission {
  margin-top: 0;
  padding: 7px 15px;
}
#observing-area.expanded-field .missionicon {
  height: 36px;
  width: 36px;
}
#observing-area.expanded-field #feedback {
  margin: 0;
}
#full-status {
  padding: 4px 12px;
  font-size: 12px;
  color: var(--gold);
}
@media (max-width: 800px) {
  .equipment-grid {
    grid-template-columns: 1fr;
  }
  .equipment-form {
    padding: 14px;
  }
}
@media (max-width: 680px) {
  .brandline,
  .brandmeta {
    display: none;
  }
  .bar nav {
    order: 3;
    flex: 1 0 100%;
    height: 37px;
    justify-content: center;
  }
  .bar .help {
    margin-left: auto;
  }
  .nav {
    min-width: 25%;
    justify-content: center;
  }
  .intro:has(#equipment-title) {
    flex-wrap: wrap;
  }
  .viewer-actions {
    gap: 6px;
  }
}
.equipment-card select {
  appearance: auto;
  cursor: pointer;
}
/* Training and review charts */
#station:not(:disabled) {
  border: 1px solid #38495d;
  border-radius: 20px;
  padding: 7px 12px;
  cursor: pointer;
}
#station:disabled {
  opacity: 1;
}
#station-edit {
  color: var(--gold);
}
#mapbox:not(.expanded) {
  opacity: 0.66;
}
#mapbox.expanded {
  opacity: 1;
  width: var(--map-width, min(80%, 510px));
  max-width: calc(100% - 18px);
}
#map-resize {
  display: none;
  touch-action: none;
  cursor: nwse-resize;
  background: #263d50;
  border-radius: 3px;
  color: #e8d7ad;
  font-size: 16px;
  padding: 0 7px;
}
.expanded #map-resize {
  display: inline-flex;
}
.maptop #mapexpand {
  margin-right: auto;
}
.plate-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0b1420;
  color: #e5c19b;
  z-index: 2;
}
.scorecard {
  font:
    11px ui-monospace,
    monospace;
  font-variant-numeric: tabular-nums;
  color: #cddbe3;
  background: #0b1625eb;
  border: 1px solid #43505f;
  border-radius: 6px;
  padding: 4px 8px;
}
#scorecard {
  position: absolute;
  right: 10px;
  top: 10px;
  pointer-events: none;
}
.guessing .topcode {
  display: none;
}
.score-row {
  display: grid;
  grid-template-columns: 2ch 4.5ch 4.4ch;
  gap: 8px;
  text-align: right;
  line-height: 1.45;
}
.score-row span:first-child {
  color: #8d9cae;
}
.score-row.current span {
  color: #ffd088;
}
#results {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  padding: 14px;
  background: #0d1621;
  box-sizing: border-box;
  overflow: auto;
}
#results[open] {
  display: grid;
  grid-template: auto minmax(120px, 1fr) auto / minmax(0, 1fr);
  gap: 10px;
}
#results header,
.result-bottom {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
}
#results header {
  min-height: 84px;
  padding-right: 130px;
}
#results h2 {
  font-size: clamp(16px, 2vw, 25px);
  margin: 5px 0;
  overflow-wrap: anywhere;
}
.result-chart {
  position: relative;
  min-height: 0;
  border: 1px solid #374758;
  border-radius: 9px;
  overflow: hidden;
}
#result-atlas,
#lab-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.result-chart #result-fit {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: #152434;
}
.result-bottom {
  justify-content: flex-start;
}
.result-bottom .primary {
  margin-left: auto;
  flex: none;
}
.result-bottom small,
.result-bottom strong {
  display: block;
}
.result-bottom strong {
  font:
    700 33px ui-monospace,
    monospace;
  color: var(--gold);
  min-width: 5ch;
}
.result-bottom p {
  font-size: 12px;
  line-height: 1.4;
  margin: 4px 0;
}
.result-bottom small {
  white-space: nowrap;
}
#result-card {
  position: absolute;
  right: 14px;
  top: 12px;
}
.result-bottom b {
  font-size: 14px;
}
.lab-layout {
  display: grid;
  grid-template-columns: minmax(245px, 0.72fr) minmax(0, 2fr);
  gap: 16px;
  align-items: start;
}
.lab-workspace {
  display: grid;
  gap: 12px;
  min-width: 0;
}
#lab-keys {
  color: #a5b6c7;
}
#lab-inputs input.matched {
  border-color: #73cbb2;
}
#lab-inputs input:read-only {
  color: #a6beb7;
}
.lab-pad {
  padding: 18px;
  display: grid;
  gap: 14px;
}
.lab-pad label,
.caption:has(select) {
  display: grid;
  gap: 7px;
  color: #b9c7d2;
  font-size: 13px;
}
.lab-pad input:not(.switch),
.lab-pad select,
#field-deck,
#photo-deck {
  font: inherit;
  font-size: 14px;
  background: #101b28;
  color: #e2eaf1;
  border: 1px solid #46586c;
  padding: 9px 12px;
  border-radius: 5px;
  width: 100%;
  min-width: 0;
}
.lab-pad h2,
.lab-pad p {
  margin: 0;
}
.lab-pad form,
#lab-inputs {
  display: grid;
  gap: 12px;
}
.lab-pad output {
  color: var(--gold);
  font-size: 14px;
}
.lab-actions,
.chart-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.chart-tools {
  padding: 10px 14px;
  color: #b7c7d4;
  font-size: 13px;
}
.chart-tools button {
  background: #1e2d3e;
  border-radius: 3px;
  padding: 4px 9px;
}
.lab-chart {
  position: relative;
  overflow: hidden;
}
#lab-canvas {
  height: clamp(280px, 58vh, 710px);
}
.lab-study h2 {
  overflow-wrap: anywhere;
}
.lab-actions .outline,
#results .outline {
  width: auto;
  margin: 0;
  padding: 7px 10px;
}
.lab-pad .rule {
  margin: 1px;
}
.aim-preview {
  pointer-events: none;
  position: absolute;
  z-index: 2;
  opacity: 0.58;
}
canvas.aiming,
#atlas.aiming,
#lab-canvas.aiming {
  cursor: none;
}
.page-expanded {
  position: fixed !important;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  overflow: auto;
  padding: 12px;
}
.page-expanded #lab-canvas {
  height: 65vh;
}
@media (max-width: 800px) {
  .lab-layout {
    grid-template-columns: 1fr;
  }
  .intro:has(#station) {
    flex-wrap: wrap;
    gap: 8px;
  }
  #station {
    display: flex;
  }
  .viewer-actions {
    gap: 4px;
  }
  .nav {
    min-width: 0;
  }
  .brandmeta {
    display: none;
  }
  .lab-pad {
    gap: 10px;
  }
  #lab-canvas {
    height: 50vh;
  }
  .lab-layout:has(#lab-chart:not([hidden])) .lab-study .lab-pad {
    padding: 12px;
  }
  .result-bottom {
    flex-wrap: wrap;
    gap: 6px;
  }
  .result-bottom > div:nth-child(2) {
    flex: 1;
    min-width: 40%;
  }
}
@media (max-width: 540px) {
  .bar nav {
    justify-content: space-between;
  }
  .bar .nav {
    font-size: 11px;
    min-width: 0;
    padding: 0 5px;
  }
  .viewer .panelhead small,
  .viewer-actions .live {
    display: none;
  }
  .fullscreen-button {
    font-size: 10px;
    padding: 4px;
  }
  .panelhead .viewer-actions {
    gap: 4px;
  }
  .result-bottom .primary {
    width: 100%;
  }
  #results header {
    flex-wrap: wrap;
    gap: 3px;
  }
  .scorecard {
    font-size: 9px;
  }
  .score-row {
    gap: 4px;
  }
  .guessing .hud.tag {
    max-width: 50%;
  }
  .station .mono {
    display: inline;
  }
  .result-bottom p {
    font-size: 11px;
  }
}
#perfect {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  display: grid;
  place-items: center;
}
#perfect b {
  font: bold italic clamp(50px, 10vw, 110px) / 1 system-ui;
  color: #ffe08a;
  letter-spacing: -0.05em;
  text-shadow:
    0 2px 0 #765126,
    0 4px 22px #0b1322;
  animation: perfect-badge 1.7s both;
}
#perfect i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--w);
  height: var(--h);
  background: var(--color);
  animation: gold-shower 1.55s var(--delay) cubic-bezier(0.17, 0.58, 0.41, 1)
    both;
}
@keyframes perfect-badge {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  20%,
  73% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}
@keyframes gold-shower {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  8% {
    opacity: 1;
  }
  55% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--turn));
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--dx) * 1.25), calc(var(--dy) + 145px))
      rotate(calc(var(--turn) * 1.5));
  }
}
@media (prefers-reduced-motion: reduce) {
  #perfect i {
    display: none;
  }
  #perfect b {
    animation: none;
    font-size: 42px;
  }
}
#infield-score:empty,
#infield-score:has([hidden]) {
  display: none;
}
#scorecard {
  position: static;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px;
  padding: 10px;
  color: #d3dee8;
}
.scorecard .score-row {
  font-variant-numeric: tabular-nums;
}
#scorecard::before {
  content: "本轮记录　/　得分 · 用时";
  flex-basis: 100%;
  font: 11px system-ui;
  color: #a8bacb;
  margin-bottom: 3px;
}
#scorecard .score-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 2.5em;
}
#scorecard .score-row span:nth-child(2) {
  font-size: 13px;
  font-weight: bold;
}
#infield-score #scorecard {
  align-items: center;
  border: 0;
  border-radius: 0;
  border-top: 1px solid #344456;
  gap: 8px;
  justify-content: flex-end;
  padding: 4px 12px;
}
#infield-score #scorecard::before {
  flex-basis: auto;
  margin: 0 auto 0 0;
}
#infield-score #scorecard .score-row {
  flex-direction: row;
  gap: 4px;
}
#infield-score #scorecard .score-row span:nth-child(2) {
  font-size: 11px;
}
@media (max-width: 800px) {
  #infield-score #scorecard {
    justify-content: space-between;
  }
  #infield-score #scorecard::before {
    display: none;
  }
}
#lightbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 15px;
  border-top: 1px solid var(--border);
  background: #121c27;
}
#lightbar .rowlabel {
  white-space: nowrap;
}
.light-scale {
  flex: 1;
  max-width: 470px;
  min-width: 0;
}
#lightbar input {
  height: 18px;
  margin: 0;
  width: 100%;
}
.light-ticks {
  display: flex;
  justify-content: space-between;
  font:
    10px ui-monospace,
    monospace;
  color: #9aaab9;
  padding: 3px 5px 0;
  background: repeating-linear-gradient(
      to right,
      #4c5a65 0px 1px,
      transparent 1px 10%
    )
    center top/calc(100% - 14px) 3px no-repeat;
}
#lpval {
  white-space: nowrap;
  min-width: 8.5ch;
  font-variant-numeric: tabular-nums;
}
#light-hint {
  color: #96a6b6;
  font-size: 10px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  #lightbar {
    gap: 8px;
    padding: 7px 10px;
  }
  #light-hint {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
}

#field-dark-settings {
  margin-top: 9px;
}
#field-dark-controls {
  margin: 2px 0 12px;
}
#results.series-summary[open] {
  display: block;
  background: radial-gradient(ellipse at 50% 30%, #20333e, #0d1621 70%);
}
#results.series-summary > :not(#series-summary) {
  display: none;
}
#series-summary {
  max-width: 500px;
  margin: clamp(12px, 7vh, 80px) auto;
  padding: clamp(18px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #121e2b;
}
#series-title {
  outline: none;
}
.series-tally {
  margin: 24px 0 6px;
}
.series-tally small,
#series-stats,
.series-tally span {
  color: #acbaca;
}
#series-score {
  color: var(--gold);
  font:
    700 clamp(44px, 10vw, 72px) / 1.15 ui-monospace,
    monospace;
}
#series-rows {
  list-style: none;
  padding: 0;
  margin: 22px 0;
}
#series-rows li {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr) auto auto;
  gap: 5px 12px;
  align-items: baseline;
  padding: 7px 0;
  font-variant-numeric: tabular-nums;
}
#series-rows small {
  color: #98aabb;
}
#series-rows strong {
  color: var(--gold);
}
.series-track {
  grid-column: 2 / -1;
  height: 3px;
  background: #2a3847;
}
.series-track i {
  display: block;
  height: 100%;
  background: var(--gold);
  transform-origin: left;
}
.result-chart [data-chart-lang] {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: auto;
  padding: 5px 10px;
  background: #152434;
}
.ledger-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 10px;
  border-top: 1px solid #354452;
  padding-top: 4px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  color: #e5d2ae;
}
#scorecard .ledger-total {
  flex-basis: 100%;
}
#result-card .ledger-total {
  flex-direction: column;
}
#results header {
  min-height: 114px;
}
.lab-pair {
  display: grid;
  gap: 10px;
}
#lab-progress {
  width: 100%;
  accent-color: var(--gold);
}
.stats-panel {
  max-width: 100%;
  min-width: 0;
}
.stats-panel .only-errors {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
}
.stats-panel .only-errors input {
  width: auto;
}
.stats-scroll {
  overflow-x: auto;
}
.stats-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.stats-scroll th,
.stats-scroll td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.stats-scroll th {
  white-space: nowrap;
  color: var(--gold);
}
/* Manual routes share the field's fullscreen container, not the quiz answer map. */
#hop-controls {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: #151e2a;
}
.hop-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
}
.hop-row + .hop-row:not([hidden]) {
  margin-top: 6px;
}
.hop-row label {
  white-space: nowrap;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}
.hop-row select {
  width: auto;
  appearance: auto;
}
.hop-row select,
.hop-row input:not([type="checkbox"]) {
  max-width: 100%;
  background: #101923;
  color: inherit;
  border: 1px solid #344758;
  border-radius: 4px;
  padding: 5px 8px;
  min-width: 0;
}
#hop-query {
  width: clamp(140px, 22vw, 250px);
}
#hop-hits,
#hop-points {
  max-width: min(320px, 85vw);
}
.hop-row .outline,
.hop-row .primary {
  width: auto;
  margin: 0;
  min-height: 30px;
  padding: 4px 10px;
}
#hop-tip {
  flex-basis: 100%;
  color: #d2e4df;
}
#hop-source,
#hop-layer,
#hop-diameter,
#hop-detail,
.hop-body > p {
  font-size: 12px;
  color: var(--muted);
}
#hop-notice {
  margin: 6px 0 0;
  color: var(--gold);
}
#hop-editor {
  flex-shrink: 0;
  min-width: 0;
}
.hop-body {
  padding: 0 16px 16px;
}
.hop-chart {
  position: relative;
  margin: 10px 0;
}
#hop-atlas {
  display: block;
  width: 100%;
  height: clamp(250px, 46vh, 600px);
  touch-action: none;
  cursor: crosshair;
  border: 1px solid var(--border);
}
#hop-atlas.aiming {
  cursor: none;
}
#stage.eye-field #sky {
  touch-action: none;
  cursor: grab;
}
#stage.hop-placing #sky {
  cursor: crosshair;
}
#stage.eye-field #sky.panning {
  cursor: grabbing;
}
#time-error:empty {
  display: none;
}
#hop-zoom {
  width: 6em;
}
#observing-area.expanded-field:has(#hop-editor:not([hidden])) .viewer {
  flex-basis: 85vh;
}
/* Feedback lives on stable cards, not the input replaced by auto-advance. */
.lab-prompt-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
#lab-success {
  color: #90efad;
  font-weight: 650;
  font-size: 0.85rem;
}
.lab-question {
  position: relative;
}
.answer-correct :is(.lab-question, .lab-chart)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  border: 1px solid #86eaa8;
  box-shadow:
    inset 0 0 22px #57dc8745,
    0 0 14px #4cdb7c50;
  animation: lab-correct-glow 750ms ease-out both;
}
@keyframes lab-correct-glow {
  0%,
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .answer-correct :is(.lab-question, .lab-chart)::after {
    animation: none;
    box-shadow: inset 0 0 5px #57dc8745;
  }
}
/* A held pointer drives the same two mount axes as a held key. */
#touch-drive {
  display: none;
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
}
.touch-ui #stage:not(.guessing) #touch-drive {
  display: block;
}
.touch-ui #drivebar {
  display: none;
}
.axis-pad,
.speed-pad {
  position: absolute;
  bottom: 9px;
  display: grid;
  gap: 3px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.axis-pad {
  left: 9px;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  grid-template-areas: ". W ." "A . D" ". S .";
}
.axis-pad [data-axis="KeyW"] {
  grid-area: W;
}
.axis-pad [data-axis="KeyA"] {
  grid-area: A;
}
.axis-pad [data-axis="KeyD"] {
  grid-area: D;
}
.axis-pad [data-axis="KeyS"] {
  grid-area: S;
}
.speed-pad {
  right: 9px;
  bottom: 9px;
  grid-template-rows: repeat(3, 44px);
}
.axis-pad button,
.speed-pad button {
  border: 1px solid #779094;
  border-radius: 7px;
  background: #101d29d9;
  color: #deebeb;
  min-width: 44px;
  touch-action: none;
  padding: 4px;
}
.axis-pad .pushed,
.speed-pad button[aria-pressed="true"] {
  color: #ffce84;
  border-color: #ffce84;
  background: #3c3022ed;
}
.touch-ui #stage:not(.guessing) :is(.lowerleft, .scale) {
  bottom: 150px;
}
.touch-ui #mapbox:not(.expanded) {
  width: auto;
  opacity: 1;
}
.touch-ui #mapbox:not(.expanded) :is(#atlas, .maptools, #layer, .aim-preview) {
  display: none;
}
.touch-ui .maptop #mapexpand {
  min-height: 42px;
  padding: 4px 12px;
}
#paper-map {
  width: min(940px, 96vw);
  max-height: 94dvh;
  padding: 12px;
  background: #131e2a;
  color: var(--text);
  border: 1px solid #536678;
  border-radius: 12px;
}
#paper-map::backdrop {
  background: #050b13b8;
}
#paper-map header,
.paper-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#paper-map header {
  justify-content: space-between;
}
#paper-map h2,
#paper-map p {
  margin: 4px 0 8px;
}
#paper-map header small,
#paper-map p,
#paper-layer {
  color: var(--muted);
  font-size: 12px;
}
#paper-map header button,
.paper-bar button {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid #405165;
  border-radius: 5px;
}
#paper-window {
  position: relative;
  width: 100%;
  height: clamp(160px, 54dvh, 620px);
  overflow: hidden;
  background: #0c1827;
  touch-action: none;
}
#paper-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  touch-action: none;
  cursor: grab;
}
.paper-bar {
  margin: 10px 0;
}
.paper-bar select,
.paper-bar input {
  width: auto;
  vertical-align: middle;
}
#paper-angle {
  width: 90px;
}
#paper-deg {
  min-width: 3em;
}

.photo-credit {
  font-size: 0.76rem;
  color: var(--cyan);
  text-underline-offset: 2px;
}
#guessbar {
  flex-wrap: wrap;
}
#photo-packs {
  margin: 10px 0 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
#photo-packs summary {
  cursor: pointer;
}
#photo-packs p {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 8px 0;
}
#photo-packs select {
  max-width: 100%;
}

#sky-image-credit,
#sky-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
}
/* The answer book is inside the fullscreen learner area; browsing never replaces the question. */
#lab-reference {
  width: min(94vw, 980px);
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(14px, 3vw, 26px);
}
.lab-ref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lab-ref-head h2 {
  margin: 4px 0 12px;
}
.lab-ref-head small,
#lab-ref-status {
  color: #9aaebd;
}
.lab-ref-label {
  display: grid;
  gap: 4px;
}
.lab-ref-label input {
  font: inherit;
  color: inherit;
  background: #101e2c;
  border: 1px solid #496172;
  border-radius: 5px;
  padding: 9px;
}
#lab-ref-canvas {
  display: block;
  width: 100%;
  height: clamp(195px, 45vh, 460px);
  touch-action: none;
  cursor: grab;
}
#lab-ref-status {
  margin: 8px 0;
  font-size: 0.86rem;
}
#lab-ref-list {
  overflow: auto;
  max-height: 24vh;
  margin-top: 10px;
}
#lab-ref-map[hidden] + #lab-ref-list {
  max-height: 58vh;
}
#lab-ref-list table {
  width: 100%;
  border-collapse: collapse;
}
#lab-ref-list th,
#lab-ref-list td {
  text-align: left;
  padding: 6px;
  border-bottom: 1px solid #344353;
}
#lab-ref-list th {
  position: sticky;
  top: 0;
  background: #162331;
}
#lab-ref-list button {
  margin: 2px;
  padding: 4px 8px;
}
#lab-ref-list [aria-pressed="true"] {
  outline: 2px solid #73e7a3;
}
#lab-map-progress progress {
  display: block;
  width: 100%;
  accent-color: #65df98;
  margin-top: 5px;
}
.lab-subnav {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0 0 12px;
}
.lab-subnav a {
  color: #96d9d0;
}
.stats-heat {
  margin: 0;
  background: #101d2d;
  border: 1px solid #344456;
  border-radius: 8px;
  padding: 10px;
}
.stats-heat figcaption {
  font-size: 0.85rem;
  color: #b5c4d1;
}
#stats-map {
  width: 100%;
  max-height: 52vh;
  display: block;
  margin: 8px auto;
  overflow: hidden;
}
.stats-heat path[data-con] {
  cursor: pointer;
  stroke: #758493;
  stroke-width: 0.65;
}
.stats-heat [data-con]:hover,
.stats-heat [data-con].chosen {
  stroke: #fff;
  stroke-width: 2;
}
.heat-key {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #b9c7d2;
}
.heat-key span:nth-child(2) {
  color: #6ccbc3;
}
.heat-key i {
  display: inline-block;
  width: 64px;
  height: 9px;
  background: linear-gradient(90deg, #e9af5a, #e74350);
}
#stats-detail {
  font-size: 0.9rem;
}
.stats-panel {
  min-width: 0;
}
.stats-heat .heat-labels {
  pointer-events: none;
  fill: #fff;
  font: 3px system-ui;
  stroke: #172232;
  stroke-width: 0.65;
  paint-order: stroke;
}
.practice-volume .heat-key i {
  background: linear-gradient(90deg, #75b2d7, #2f6cbc);
}
#lab-ref-type-row {
  margin-bottom: 0.55rem;
}
#lab-ref-type {
  width: fit-content;
  background: #101e2c;
  color: inherit;
  border: 1px solid #496172;
  padding: 5px;
}
#stats-viewport {
  overflow: auto;
  max-height: 55vh;
  overscroll-behavior: contain;
  margin: 8px 0;
  min-width: 0;
}
#stats-map {
  margin: 0;
  max-width: none;
}
.heat-tools {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 8px 0;
}
.heat-tools label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.heat-tools select {
  width: auto;
}
.stats-panel .heat-tools input[type="checkbox"] {
  width: auto;
}

#guess-observer-form {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  margin: 0.5rem 0 0.9rem;
  border: 1px solid #344251;
  border-radius: 8px;
  background: #111b27;
}
#guess-observer-form label {
  display: block;
  min-width: 0;
  font-size: 12px;
  color: #c1cbd6;
}
#guess-observer-form input,
#guess-observer-form select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 0.28rem;
}
#guess-observer-form input {
  padding: 0.4rem;
  color-scheme: dark;
  border: 1px solid #344251;
  border-radius: 5px;
  background: #0e1620;
  color: inherit;
}
#guess-coords {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
#guess-observer-form .micro {
  margin: 0;
}
#guess-observer-note,
#guess-scene,
#stats-reset-status {
  font-size: 12px;
  color: #b4c4d6;
}
#guess-observer-note:empty,
#stats-reset-status:empty {
  display: none;
}
.stats-summary-bar,
.stats-confirm-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.stats-summary-bar {
  justify-content: space-between;
}
.stats-confirm-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}
#stats-erase {
  border-color: #a65d55;
  color: #ffc1ad;
}
.stats-summary-bar .outline,
.stats-confirm-actions .outline {
  width: auto;
  margin: 0;
}
#guess-observer-form .outline {
  margin: 0;
}
.plate-state {
  text-align: center;
  padding: 1rem;
}
.limit-reading {
  font-size: 11px;
  color: #b9d7de;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#lightbar {
  flex-wrap: wrap;
}
#lab-canvas.fixed-frame {
  touch-action: pan-y;
  cursor: default;
}
#lab-nav,
.ref-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem;
  border-bottom: 1px solid #304252;
  margin: 0 0 1rem;
}
#lab-nav a,
.ref-tabs a {
  text-decoration: none;
  color: #cbd6de;
  padding: 0.55rem 0.9rem;
  border-radius: 5px;
  font-size: 0.88rem;
}
#lab-nav [aria-current],
.ref-tabs [aria-current] {
  color: #ffcb85;
  background: #342c23;
  box-shadow: inset 0 -2px #dcac6a;
}
.drill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
  gap: 1rem;
}
.drill-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #121d29;
  border: 1px solid #344354;
  padding: 1.1rem;
  border-radius: 0.65rem;
}
.drill-card:hover,
.drill-card:focus-visible {
  border-color: #dfae72;
  background: #192634;
}
.drill-card small,
.drill-card span {
  font:
    0.77rem ui-monospace,
    monospace;
  color: #efbd82;
}
.drill-card h3 {
  margin: 0.6rem 0 0;
}
.drill-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #b5c4d3;
  flex: 1;
}
#lab-reference {
  width: 100%;
  max-height: none;
  overflow: visible;
}
#lab-ref-close {
  width: auto;
  margin: 0;
}
.guide-filter {
  display: block;
  font-size: 13px;
  color: #c1cbd6;
  margin: 0.55rem 0;
}
.guide-filter input {
  width: 100%;
  padding: 0.55rem;
  background: #101924;
  color: inherit;
  border: 1px solid #344354;
  border-radius: 5px;
}
#guide-list {
  max-height: 50vh;
  overflow: auto;
  margin-top: 0.5rem;
}
/* Practice selection lives one level up; leave the full width for the atlas. */
#lab-practice {
  grid-template-columns: minmax(0, 1fr);
}
#lab-practice .lab-study .lab-pad {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  padding: 0.75rem 1rem;
}
#lab-practice .lab-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
#lab-practice .lab-study .labelline {
  gap: 0.6rem;
  margin: 0;
}
#lab-practice .lab-study .lab-actions {
  margin: 0;
}
@media (min-width: 840px) {
  #lab-nav {
    justify-content: center;
  }
}
/* Keep the chart within reach on a landscape tablet; the introduction belongs to the catalogue. */
#learner-page:has(#lab-practice:not([hidden])) > .intro,
#learner-page:has(#lab-reference:not([hidden])) > .intro {
  display: none;
}
#lab-home > .copy {
  margin-bottom: 1rem;
}
@media (min-width: 700px) {
  #lab-practice .lab-study {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }
  #lab-practice .lab-study .panelhead {
    border: 0;
    height: auto;
    gap: 1rem;
  }
  #lab-practice .lab-study .lab-pad {
    flex: 1;
  }
}

/* Field and drill screens spend remaining viewport space on the chart. Minimum
   usable sizes intentionally allow ordinary document scroll on short screens. */
body:has(
  #observatory:not([hidden]),
  #learner-page:not([hidden]) :is(#lab-practice, #lab-reference):not([hidden]),
  #learner-page:not([hidden])
    #night-panel:not([hidden])
    #night-play:not([hidden])
) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}
body:has(
    #observatory:not([hidden]),
    #learner-page:not([hidden])
      :is(#lab-practice, #lab-reference):not([hidden]),
    #learner-page:not([hidden])
      #night-panel:not([hidden])
      #night-play:not([hidden])
  )
  main {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}
body:has(
    #observatory:not([hidden]),
    #learner-page:not([hidden])
      :is(#lab-practice, #lab-reference):not([hidden]),
    #learner-page:not([hidden])
      #night-panel:not([hidden])
      #night-play:not([hidden])
  )
  footer {
  flex: none;
  padding: 3px 0;
  margin-top: 4px;
}
#obs-intro {
  flex: none;
  align-items: center;
  padding: 8px 0;
}
#obs-intro h1 {
  font-size: clamp(20px, 2vw, 30px);
  margin: 0;
}
#obs-intro .eyebrow {
  display: none;
}
#obs-intro > div:first-child,
.station-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}
#obs-intro p {
  font-size: 12px;
}
#settings-open {
  display: none;
  width: auto;
  margin: 0;
}
#field-settings {
  max-height: 90dvh;
  padding: 0;
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
#observatory:not(:has(#hop-editor:not([hidden]))) {
  flex: 1 0 auto;
  min-height: min-content;
}
#observatory {
  align-items: stretch;
}
#observatory:not(:has(#hop-editor:not([hidden])))
  #observing-area:not(.expanded-field),
#observing-area:not(.expanded-field):has(#hop-editor[hidden]) > .viewer {
  display: flex;
  flex-direction: column;
}
#observing-area:not(.expanded-field):has(#hop-editor[hidden]) > .viewer {
  flex: 1 0 auto;
}
#observing-area:not(.expanded-field):has(#hop-editor[hidden]) #stage {
  flex: 1 0 240px;
  height: auto;
  min-height: 240px;
}
#observatory .panelhead {
  height: 37px;
  flex: none;
}
#observatory .viewbar {
  min-height: 38px;
  padding-block: 4px;
}
#observatory .mission {
  margin-top: 6px;
  padding: 8px 12px;
}
#observatory #feedback {
  margin-top: 4px;
  padding: 5px 12px;
}
#observatory .mission h2 {
  margin-block: 3px;
}
#observatory #hop-controls {
  padding-block: 5px;
}
#observatory #lightbar {
  padding-block: 4px;
}
@media (min-width: 736px) {
  #observatory aside {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    min-width: 0;
  }
  /* Contain the long settings without letting their content set the height of the field. */
  #kit-home {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  #observatory:has(#hop-editor:not([hidden])) #kit-home {
    max-height: 85vh;
    min-height: 420px;
    position: sticky;
    top: 8px;
  }
}
#lens-drawer {
  position: absolute;
  right: 0;
  top: 36%;
  transform: translateY(-36%);
  z-index: 4;
  display: flex;
  align-items: center;
  max-width: 96%;
}
#lens-tab {
  width: 40px;
  min-height: 56px;
  border: 1px solid #5b6e76;
  background: #172430df;
  color: #f2c991;
  border-radius: 7px 0 0 7px;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
}
#lens-menu {
  width: min(268px, 70vw);
  max-height: min(250px, 40dvh);
  overflow: auto;
  padding: 12px;
  border: 1px solid #536877;
  border-radius: 8px 0 0 8px;
  background: #14212ef5;
}
#lens-controls .ep {
  flex-wrap: wrap;
}
#lens-controls button {
  white-space: normal;
  overflow-wrap: anywhere;
}
#lens-menu button {
  min-width: 40px;
  min-height: 38px;
}
#learner-page:has(:is(#lab-practice, #lab-reference):not([hidden])) {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  min-height: min-content;
}
#learner-page #lab-nav {
  flex: none;
  margin: 0 0 6px;
  padding: 3px;
}
#lab-practice {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
#lab-practice .lab-study {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
#lab-practice .lab-study .panelhead {
  height: auto;
  border: 0;
  gap: 10px;
  padding: 5px 12px;
}
#lab-practice .lab-study .lab-pad {
  display: flex;
  flex: 1;
  padding: 5px 10px;
  gap: 5px 12px;
}
#lab-practice .lab-study label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
#lab-practice .lab-study select {
  width: auto;
  padding: 4px;
}
#lab-practice .lab-study .outline {
  padding: 4px 8px;
}
#lab-workspace {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 6px;
}
#lab-practice .lab-question {
  padding: 8px 12px;
  gap: 4px;
}
#lab-prompt {
  font-size: clamp(18px, 2vw, 25px);
}
#lab-hint {
  font-size: 12px;
  line-height: 1.45;
}
#lab-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 5px 12px;
}
#lab-inputs:not(:empty) {
  flex: 1 1 190px;
  max-width: 520px;
}
#lab-inputs:empty,
#lab-feedback:empty {
  display: none;
}
#lab-inputs label {
  gap: 2px;
}
#lab-inputs input {
  padding: 5px 8px;
}
#lab-form .lab-actions {
  gap: 6px;
}
#lab-form button {
  margin: 0;
  width: auto;
  padding: 5px 9px;
}
#lab-map-progress label {
  display: flex;
  gap: 8px;
}
#lab-map-progress progress {
  height: 6px;
  margin: 2px 0;
}
#lab-chart {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}
#lab-chart .panelhead {
  flex: none;
  height: 30px;
}
#lab-chart .chart-tools {
  flex: none;
  padding: 4px 10px;
  gap: 4px 8px;
}
#lab-chart #lab-canvas {
  flex: 1 0 200px;
  height: 0;
  min-height: 200px;
}
#lab-reference {
  padding: 10px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#lab-reference .ref-tabs,
#lab-ref-status {
  margin: 0;
}
#lab-ref-list,
#lab-ref-map[hidden] + #lab-ref-list {
  flex: 1 1 0;
  height: 0;
  min-height: 100px;
  max-height: none;
}
#lab-reference .lab-ref-label:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 8px;
}
#lab-reference .lab-ref-label input {
  flex: 1;
  min-width: 0;
}
#lab-reference .lab-ref-label select {
  width: auto;
}
#lab-ref-canvas {
  height: clamp(180px, 38vh, 480px);
}
/* Catalogues and editing pages may scroll; compact their headers so the content starts earlier. */
:is(#learner-page, #stats-page, #equipment-page) > .intro {
  padding: 12px 0;
}
:is(#learner-page, #stats-page, #equipment-page) > .intro h1 {
  font-size: 28px;
  margin: 4px 0;
}
#stats-page .stats-panel {
  gap: 8px;
  padding: 12px;
}
#lab-home .drill-card {
  padding: 12px;
}
#lab-home .drill-card p {
  margin: 6px 0;
}
@media (max-width: 735px) {
  #observatory {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  #observatory aside {
    display: contents;
  }
  #kit-home {
    display: none;
  }
  #settings-open {
    display: block;
    padding: 5px 8px;
  }
  #obs-intro {
    flex-wrap: nowrap;
    gap: 4px;
  }
  #obs-intro p {
    display: none;
  }
  #observatory #observing-area:not(.expanded-field):has(#hop-editor[hidden]) {
    flex: 1;
  }
  #obs-intro .station-tools {
    gap: 8px;
  }
  #lab-practice .lab-study .panelhead {
    font-size: 12px;
  }
  #lab-practice .lab-study .lab-pad {
    flex-basis: 100%;
  }
  #lab-form .lab-actions {
    flex-wrap: wrap;
  }
  #lab-keys {
    display: none;
  }
  #lab-ref-canvas {
    height: clamp(170px, 32vh, 350px);
  }
}

body:has(
    #observatory:not([hidden]),
    #learner-page:not([hidden])
      :is(#lab-practice, #lab-reference):not([hidden]),
    #learner-page:not([hidden])
      #night-panel:not([hidden])
      #night-play:not([hidden])
  )
  main {
  margin-block: 0;
}
#lab-reference {
  flex: 1 1 0;
  min-height: 370px;
}
#lab-reference #lab-ref-map {
  flex: 1 0 185px;
  display: flex;
  flex-direction: column;
}
#lab-ref-map #lab-ref-canvas {
  flex: 1 0 160px;
  height: 0;
  min-height: 160px;
}
#lab-ref-list.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  align-content: start;
  gap: 6px;
}
#lab-ref-list.answer-grid button {
  text-align: left;
  width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
}
.book-views,
#lab-ref-labels {
  display: flex;
  align-items: center;
  gap: 0.6em;
  flex-wrap: wrap;
  font-size: 13px;
}
.book-views a {
  color: #b7c7d5;
  text-decoration: none;
  padding: 2px 8px;
}
.book-views a[aria-current] {
  color: #ffcf93;
  border-bottom: 2px solid;
}
#lab-reference .ref-tabs {
  gap: 2px;
  padding: 2px;
}
#lab-reference .ref-tabs a {
  font-size: 13px;
  padding: 5px;
}
#lab-reference .lab-ref-head h2 {
  font-size: 18px;
  margin: 0;
}
#lab-reference .lab-ref-head small {
  display: none;
}
#lab-reference .chart-tools {
  padding: 5px 8px;
  gap: 4px 10px;
}
#list-form,
#list-form label {
  display: grid;
  gap: 6px;
}
#list-form {
  gap: 12px;
}
#list-form :is(input, textarea) {
  background: #101d29;
  color: inherit;
  border: 1px solid #475969;
  border-radius: 5px;
  padding: 8px;
}
#list-error {
  color: var(--gold);
}

#overview-exit {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  padding: 5px 10px;
  background: #142a30dd;
  border: 1px solid #466867;
  border-radius: 6px;
  color: #a6e6cf;
  font-size: 12px;
  z-index: 2;
}

.learner-heading {
  flex: none;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: clamp(12px, 4vw, 64px);
}
.learner-heading .intro {
  display: block;
  padding: 10px 0;
}
.learner-heading h1 {
  margin: 4px 0;
  font-size: clamp(22px, 2.5vw, 38px);
}
.learner-heading :is(#lab-nav) {
  justify-content: flex-start;
  align-self: start;
  padding: 6px 0;
  margin: 0;
}
#learner-page:has(#lab-home[hidden]) .learner-heading .intro {
  padding: 7px 0;
}
#learner-page:has(#lab-home[hidden]) .learner-heading h1 {
  font-size: 22px;
  margin: 0;
}
#learner-page:has(#lab-home[hidden]) .learner-heading :is(.eyebrow, p) {
  display: none;
}
.book-headings,
.book-search {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.book-headings .ref-tabs {
  flex: 1;
}
.book-search .lab-ref-label:last-child {
  flex: 1 1 180px;
}
#lab-ref-map .book-sky {
  container-type: size;
  position: relative;
  flex: 1 0 160px;
  min-height: 160px;
  background: #0c1827;
  display: flex;
  justify-content: center;
}
#lab-ref-map .book-sky #lab-ref-canvas {
  flex: none;
  width: 100%;
  width: min(100%, 222.222cqh);
  height: 100%;
}
@media (max-width: 735px) {
  .learner-heading {
    gap: 4px;
    align-items: center;
  }
  .learner-heading .intro {
    padding: 8px 0;
  }
  .learner-heading h1,
  #learner-page:has(#lab-home[hidden]) .learner-heading h1 {
    font-size: 19px;
  }
  .learner-heading .intro :is(p, .eyebrow) {
    display: none;
  }
  .learner-heading #lab-nav {
    align-self: center;
    justify-content: flex-end;
    gap: 2px;
  }
  .learner-heading #lab-nav a {
    font-size: 12px;
    padding: 6px 4px;
  }
}

@media (min-width: 736px) {
  .learner-heading {
    grid-template-columns: minmax(215px, 27%) minmax(0, 1fr);
    gap: 12px;
  }
  #learner-page:has(#lab-home[hidden]) .learner-heading .intro {
    padding: 8px 0;
  }
  #learner-page:has(#lab-home[hidden]) .learner-heading h1 {
    font-size: clamp(24px, 2.5vw, 38px);
    margin: 3px 0;
  }
  #learner-page:has(#lab-home[hidden]) .learner-heading :is(.eyebrow, p) {
    display: block;
  }
  .learner-heading #lab-nav a {
    flex: 1;
    text-align: center;
  }
}

/* Challenge rules belong in the lobby; the running round gets the entire chart column. */
#gamekit .intro {
  padding-block: clamp(18px, 3.4vh, 40px);
}
.setup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.setup-card {
  min-width: 0;
  padding: clamp(14px, 1.7vw, 24px);
}
.setup-card > header {
  display: flex;
  gap: 10px;
  align-items: center;
}
.setup-num {
  color: var(--cyan);
  border: 1px solid #35524f;
  border-radius: 5px;
  padding: 4px 6px;
  font:
    12px ui-monospace,
    monospace;
}
.setup-card h2 {
  margin: 0;
  font-size: 18px;
}
.setup-hint,
.setup-actions p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.setup-hint {
  margin: 9px 0 16px;
}
#gamekit :is(.select select, .caption select) {
  width: 100%;
}
#field-fov-row,
#field-dark-settings {
  margin-top: 14px;
}
.setup-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 18px;
}
.setup-actions > div {
  flex: 1;
}
.setup-actions p {
  margin: 3px 0 0;
}
.setup-actions .outline {
  width: auto;
  margin: 0;
}
#observatory.challenge-play {
  grid-template-columns: minmax(0, 1fr);
}
#observatory.challenge-play aside {
  display: none;
}
#guess-back {
  white-space: nowrap;
  color: var(--gold);
}
@media (min-width: 736px) {
  #infield-score #scorecard .ledger-total {
    flex-basis: auto;
    border: none;
    margin: 0 0 0 10px;
    padding: 0;
  }
}
@media (max-width: 735px) {
  .setup-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  #gamekit .intro {
    padding-block: 13px;
  }
  .setup-card {
    padding: 12px 14px;
  }
  .setup-card h2 {
    font-size: 15px;
  }
  .setup-hint {
    margin: 4px 0 9px;
  }
  .setup-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-wrap: wrap;
    gap: 7px;
    padding: 9px 12px max(9px, env(safe-area-inset-bottom));
    background: #17202a;
  }
  .setup-actions > div {
    min-width: 135px;
  }
  .setup-actions:has(#guess-resume:not([hidden])) > div {
    flex-basis: 100%;
  }
  .setup-actions:has(#guess-resume:not([hidden])) button {
    flex: 1;
  }
}
.setup-card > .setup-control + .setup-control {
  margin-top: 16px;
}
#gamekit #guess-observer-form {
  margin-top: 12px;
}
@media (min-width: 736px) {
  .setup-actions {
    position: sticky;
    bottom: 8px;
    z-index: 2;
  }
}
@media (max-width: 735px) {
  .setup-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
  }
  .setup-card > * {
    grid-column: 1 / -1;
  }
  .setup-card
    > :is(.setup-control, #field-fov-row, #field-deck-row, #photo-deck-row) {
    grid-column: span 1;
    align-self: start;
    min-width: 0;
  }
  #gamekit
    .setup-card
    :is(.caption, .setup-control, #field-fov-row, #field-dark-settings) {
    margin: 0;
  }
  #gamekit .setup-card .caption {
    gap: 4px;
  }
  .setup-card .select {
    margin-top: 4px;
  }
  .setup-card select,
  .setup-actions button {
    min-height: 40px;
  }
  .setup-hint {
    margin: 0 0 3px;
  }
}
/* Night walk: keep the answer above the field and the large touch surface clear. */
#night-panel {
  min-width: 0;
}
.night-kicker {
  color: #89cabc;
  letter-spacing: 0.08em;
  font:
    600 11px/1.45 ui-monospace,
    monospace;
}
.night-setup {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
  display: grid;
  gap: 15px;
}
.night-setup h2,
.night-head h2 {
  margin: 0.2em 0;
  font-size: clamp(19px, 2.1vw, 27px);
}
.night-setup p {
  margin: 5px 0;
  color: #b3c4cf;
}
.night-setup #night-error {
  color: #edbd93;
}
.night-setup #night-error:empty {
  display: none;
}
.night-setup label {
  display: grid;
  gap: 5px;
}
.night-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr));
  gap: 12px;
}
.night-setup input,
.night-setup select {
  width: 100%;
  min-width: 0;
}
.night-setup #night-light {
  max-width: 460px;
}
.night-setup #night-zone {
  color: #a3b9c5;
}
.night-observe {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
}
.night-head,
.night-tools,
#night-answer {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  flex-wrap: wrap;
}
.night-head {
  justify-content: space-between;
}
.night-head a,
#night-resume {
  color: #9ce0ce;
}
#night-answer input {
  min-width: 130px;
  flex: 1 1 160px;
  max-width: 440px;
}
#night-answer strong {
  color: #a5d9c6;
  font-size: 13px;
}
.night-field {
  position: relative;
  background: #08101b;
  overflow: hidden;
  border-radius: 7px;
}
.night-field canvas {
  width: 100%;
  height: clamp(240px, calc(100dvh - 300px), 810px);
  display: block;
  touch-action: none;
  cursor: grab;
}
.night-field .night-guide-animation {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  cursor: default;
}
.night-field canvas.panning {
  cursor: grabbing;
}
.night-field canvas:focus-visible {
  outline: 2px solid #89bfba;
  outline-offset: -2px;
}
#night-bearing {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 8px;
  pointer-events: none;
  color: #bdccd4;
  background: #0b1722a0;
  padding: 2px 5px;
  font:
    11px/1.5 ui-monospace,
    monospace;
}
#night-feedback {
  font-size: 13px;
  margin: 0;
  min-height: 1.5em;
  color: #b8cbd7;
}
#night-feedback.good {
  color: #8df0b0;
  text-shadow: 0 0 8px #52ca8466;
}
.night-tools {
  font-size: 13px;
}
.night-tools label {
  white-space: nowrap;
}
.night-tools button,
#night-submit {
  padding: 5px 10px;
}
@media (max-width: 650px) {
  .night-observe {
    padding: 6px;
  }
  .night-head h2 {
    font-size: 17px;
  }
  .night-field canvas {
    height: clamp(200px, calc(100dvh - 338px), 650px);
  }
  #night-progress {
    font-size: 12px;
  }
  .night-tools {
    gap: 4px 8px;
  }
}
#learner-page:has(#night-panel:not([hidden]) #night-play:not([hidden])),
#night-panel:has(#night-play:not([hidden])),
#night-play:not([hidden]) {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
}
#night-play .night-field {
  flex: 1 1 0;
  min-height: 160px;
}
#night-play canvas {
  height: 100%;
  position: absolute;
  inset: 0;
}
#night-play .outline {
  width: auto;
  margin: 0;
}
#night-input,
.night-setup :is(select, input:not([type="range"])) {
  background: #0c1620;
  border: 1px solid #455663;
  border-radius: 5px;
  padding: 0.43em 0.65em;
  color: #e4edf2;
}
.night-setup .primary {
  width: auto;
  margin: 0;
}
#night-answer input:focus {
  border-color: #81bbae;
}

/* Night Walk live view: the question area is a focused instrument surface,
   not a catalogue page.  The learner heading and duplicate prompt disappear
   while the answer bar and controls remain reachable. */
#learner-page.night-live > .learner-heading {
  display: none;
}
#learner-page.night-live {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#learner-page.night-live #night-panel {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  flex-direction: column;
}
#learner-page.page-expanded.night-live {
  padding: 0;
  overflow: hidden;
}
#learner-page.night-live #night-play {
  flex: 1 1 0;
  min-height: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  padding: 5px 8px;
  gap: 4px;
}
#learner-page.night-live .night-head {
  display: none;
}
#learner-page.night-live #night-answer {
  flex: none;
  min-height: 32px;
}
#learner-page.night-live #night-feedback {
  min-height: 1.25em;
}
#learner-page.night-live .night-tools {
  flex: none;
  gap: 4px 8px;
  font-size: 12px;
}
.night-fov-control {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
}
.night-fov-control input[type="range"] {
  width: clamp(90px, 15vw, 180px);
  margin: 0;
  accent-color: var(--gold);
}
.night-fov-control output {
  min-width: 3.4em;
  color: #c8e5de;
  font-variant-numeric: tabular-nums;
}
#quiz-pause {
  width: min(420px, calc(100vw - 28px));
  padding: 0 18px 18px;
  color: #e4edf2;
  background: #101b27f7;
  border: 1px solid #4c6570;
  border-radius: 10px;
  box-shadow: 0 18px 70px #000b;
}
#quiz-pause::backdrop {
  background: #02070ccc;
  backdrop-filter: blur(3px);
}
#quiz-pause h2 {
  margin: 18px 0 5px;
}
#quiz-pause p {
  color: #b8cbd7;
}
.pause-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.pause-actions button {
  width: auto;
  margin: 0;
}
@media (max-width: 650px) {
  #learner-page.night-live #night-play {
    padding-inline: 5px;
  }
  #learner-page.night-live #night-answer strong {
    font-size: 11px;
  }
  .night-fov-control input[type="range"] {
    width: 92px;
  }
}
body.quiz-live #learner-page > .learner-heading,
body.quiz-live.field-expanded > .top,
body.quiz-live.field-expanded :is(#obs-intro, footer),
body:not(.quiz-live) [data-pause] {
  display: none;
}
body.quiz-live #learner-page.page-expanded {
  min-height: 0;
}
.pause-trigger {
  width: auto;
  margin: 0;
  white-space: nowrap;
  padding: 6px 10px;
}
#night-prompt {
  margin: 0;
  font-size: clamp(14px, 1.4vw, 18px);
}
#night-answer .pause-trigger {
  order: 5;
  margin-left: auto;
}
#night-answer input {
  font-size: 16px;
}
.night-tools a {
  color: #a5d9c6;
}
#night-play .night-field {
  min-height: 0;
}
#full-status {
  position: absolute;
  top: 48px;
  right: 8px;
  z-index: 6;
  background: #14202f;
  pointer-events: none;
}
#quiz-pause {
  max-height: 90dvh;
  overflow: auto;
  padding: 22px;
}
#quiz-pause .pause-heading small {
  color: var(--gold);
  letter-spacing: 0.1em;
}
#quiz-pause h2 {
  margin: 5px 0 12px;
}
#quiz-pause p {
  font-size: 13px;
  margin: 5px 0;
}
#quiz-pause .pause-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}
#quiz-pause .pause-actions button {
  min-height: 42px;
  padding: 7px;
}
#pause-resume,
#pause-home {
  grid-column: 1/-1;
}
#pause-nav #lab-nav {
  display: flex;
  justify-content: space-between;
  margin: 16px 0 0;
}
#pause-nav a {
  font-size: 13px;
  padding: 6px;
}
@media (max-width: 700px) {
  #night-answer .pause-trigger {
    order: 0;
  }
  #night-answer {
    gap: 4px 6px;
  }
  #night-answer input {
    flex-basis: 60%;
  }
  .challenge-play .viewer-actions .live {
    display: none;
  }
}
#night-guide-bar,
#night-script,
#night-script > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
#night-guide-bar,
#night-script {
  flex: none;
}
#night-guide-bar label,
#night-step {
  color: var(--gold);
  white-space: nowrap;
}
#night-tour,
#night-difficulty {
  min-width: 0;
  appearance: auto;
  color: inherit;
  background: #192735;
  padding: 6px;
  border-radius: 5px;
  font-size: 16px;
}
#night-tour {
  width: auto;
  max-width: 360px;
  flex: 1;
}
#night-difficulty {
  width: 105px;
  flex: none;
}
#night-return {
  margin-left: auto !important;
}
#night-script {
  padding: 5px 8px;
  justify-content: space-between;
}
#night-script p {
  margin: 0;
  max-width: 55em;
  color: #e3ede9;
  font-size: 15px;
  line-height: 1.6;
}
#night-script button,
#night-guide-bar button {
  white-space: nowrap;
  padding: 7px 10px;
}
#night-script button:disabled {
  opacity: 0.45;
}
@media (max-width: 700px) {
  #night-guide-bar label {
    display: none;
  }
  #night-difficulty {
    width: 86px;
    padding: 6px 3px;
    font-size: 14px;
  }
  #night-tour {
    max-width: none;
    font-size: 14px;
  }
  #night-guide-bar {
    gap: 5px;
  }
  #night-guide-bar button {
    padding: 6px;
  }
  #night-script {
    flex-direction: column;
  }
  #night-script p {
    font-size: 14px;
  }
}
