/* Shared layout and component styles. Later feature/responsive overrides intentionally win.
 * Preserve cascade order when extracting styles; see docs/ARCHITECTURE.md. */
:root {
  --navy: #111d29;
  --navy2: #1a2a38;
  --panel: rgba(19, 32, 42, 0.93);
  --line: rgba(229, 241, 246, 0.12);
  --ink: #f4f5ee;
  --muted: #a6b6bf;
  --lime: #c7ee8e;
  --orange: #ffc58e;
  --sidebar: 83px;
  --topbar: 76px;
  --dock: 83px;
  --radius: 15px;
  --font: Inter, 'Avenir Next', Avenir, 'Segoe UI', Arial, sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--navy);
  color: var(--ink);
  font: 14px/1.5 var(--font);
}
button,
input,
select {
  font: inherit;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--lime);
}
button {
  transition:
    background 0.18s,
    transform 0.18s,
    border-color 0.18s;
}
button:hover:not(:disabled) {
  filter: brightness(1.1);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
a {
  color: var(--lime);
  text-underline-offset: 4px;
}
svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h2 {
  font-size: 32px;
  letter-spacing: -1.1px;
  line-height: 1.18;
  margin-bottom: 12px;
}
h3 {
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 10px;
}
p {
  color: var(--muted);
}
small {
  font-size: 11px;
}
.topbar {
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 27px 0 23px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
  background: var(--navy);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.2;
}
.brand-mark {
  color: var(--lime);
}
.brand-mark svg {
  width: 39px;
  height: 39px;
  stroke-width: 1.3;
}
.brand-light {
  font-weight: 350;
  margin-left: 6px;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 2.6px;
  margin-top: 7px;
  color: var(--muted);
  font-weight: 500;
}
.expedition-label {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
}
.expedition-label b {
  margin-left: 15px;
  font-weight: 500;
  color: #e1e5e4;
  letter-spacing: 1.5px;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px #c7ee8e33;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 15px;
}
.xp-pill {
  display: flex;
  gap: 6px;
  align-items: center;
  background: #c7ee8e0d;
  border: 1px solid #c7ee8e33;
  color: var(--lime);
  font-size: 11px;
  padding: 7px 12px;
  border-radius: 7px;
}
.xp-pill svg {
  width: 16px;
  height: 16px;
}
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}
.icon-btn:hover {
  background: #ffffff0c;
  color: var(--ink);
}
.icon-btn svg {
  width: 19px;
  height: 19px;
}
.avatar {
  border: 1px solid #b4c6d13d;
  background: #293d4e;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 10px;
  letter-spacing: 1px;
  color: #dae2de;
}
.sidebar {
  position: absolute;
  top: var(--topbar);
  bottom: 0;
  width: var(--sidebar);
  left: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 19px 8px;
  gap: 8px;
  border-right: 1px solid var(--line);
  z-index: 10;
  background: var(--navy);
}
.nav-btn {
  width: 64px;
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 10px;
  gap: 7px;
  color: #93a7b3;
  font-size: 9px;
  position: relative;
}
.nav-btn svg {
  width: 22px;
  height: 22px;
}
.nav-btn.active {
  color: var(--lime);
  background: #c7ee8e0f;
}
.nav-btn:hover {
  background: #ffffff08;
  color: #e9f2e5;
}
.nav-btn i {
  position: absolute;
  top: 10px;
  right: 13px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
}
.sidebar-bottom {
  margin-top: auto;
  text-align: center;
}
.class-tag {
  display: inline-block;
  font-size: 7px;
  color: #7c919f;
  border: 1px solid #ffffff14;
  padding: 5px 6px;
  border-radius: 4px;
  margin-top: 12px;
  letter-spacing: 1px;
}
#gameShell {
  position: absolute;
  top: var(--topbar);
  left: var(--sidebar);
  right: 0;
  bottom: 0;
  overflow: hidden;
}
#viewport {
  position: absolute;
  inset: 0 0 var(--dock);
  overflow: hidden;
  background: #bc896a;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#world:active {
  cursor: grabbing;
}
.world-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(16, 24, 33, 0.35),
      transparent 32%,
      transparent 68%,
      rgba(16, 24, 33, 0.4)
    ),
    linear-gradient(90deg, rgba(16, 24, 33, 0.24), transparent 50%, rgba(16, 24, 33, 0.13));
}
.destination-hud {
  position: absolute;
  left: 32px;
  top: 27px;
  pointer-events: none;
  text-shadow: 0 2px 20px #141c2c4d;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1.8px;
  font-size: 9px;
  font-weight: 600;
  color: #f1e5d9;
}
.eyebrow .live-dot {
  width: 5px;
  height: 5px;
  background: #ffcfaa;
  box-shadow: none;
}
.hud-chip {
  margin-left: 8px;
  font-size: 7px;
  letter-spacing: 1px;
  padding: 3px 6px;
  border-radius: 3px;
  border: 1px solid #fff5;
}
.destination-hud h1 {
  font-size: 64px;
  letter-spacing: -3px;
  font-weight: 550;
  line-height: 1.05;
  margin: 14px 0 6px;
}
.destination-hud h1 span {
  font-size: 12px;
  letter-spacing: 0;
  vertical-align: top;
  display: inline-block;
  margin: 8px 0 0 10px;
  color: #efd8c6;
}
.destination-hud p {
  font-size: 15px;
  color: #f7e7da;
  margin-bottom: 11px;
  letter-spacing: 0.1px;
}
.location {
  font-size: 10px;
  color: #ffeadb;
  display: flex;
  align-items: center;
  gap: 5px;
}
.location svg {
  height: 13px;
  width: 13px;
}
.text-button {
  font-size: 10px;
  font-weight: 600;
  color: var(--lime);
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.text-button span {
  font-size: 14px;
}
.destination-hud .text-button {
  color: #fbe7d6;
  font-size: 9px;
  margin-top: 12px;
  border-bottom: 1px solid #fbe7d655;
  padding-bottom: 3px;
  pointer-events: auto;
}
.resource-hud {
  position: absolute;
  right: 28px;
  top: 28px;
  display: flex;
  gap: 21px;
}
.resource {
  display: flex;
  gap: 9px;
  align-items: center;
}
.resource > span {
  color: #fae8db;
}
.resource svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.3;
}
.resource > div {
  min-width: 64px;
}
.resource span:not([data-icon]) {
  display: block;
  font-size: 7px;
  letter-spacing: 1.3px;
  color: #fae8db;
}
.resource b {
  display: block;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.resource b small {
  font-size: 11px;
  margin-left: 3px;
}
.resource i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #fff4;
  width: 66px;
  overflow: hidden;
  margin-top: 2px;
}
.resource em {
  height: 100%;
  width: 100%;
  background: var(--lime);
  display: block;
}
.resource:nth-child(2) em {
  background: #ffdaa4;
}
.resource.compact > div {
  min-width: 36px;
}
.glass {
  background: var(--panel);
  border: 1px solid #e7e4cf15;
  box-shadow: 0 8px 30px #10182412;
  /* Repeated live-canvas backdrop blurs can bottleneck the browser compositor
     even after WebGL resolution is reduced. The tinted panel supplies contrast. */
  backdrop-filter: none;
}
.mission-card {
  position: absolute;
  right: 27px;
  top: 116px;
  width: 281px;
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card-overline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #c4d1d5;
}
.card-overline > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-overline svg {
  width: 13px;
  height: 13px;
  color: var(--lime);
}
.mini-btn {
  color: var(--muted);
  padding: 0;
  font-size: 17px;
  line-height: 1;
}
.chapter {
  display: block;
  margin-top: 18px;
  color: var(--orange);
  font-size: 8px;
  letter-spacing: 1.5px;
}
.mission-card h2 {
  font-size: 21px;
  font-weight: 550;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin: 6px 0 9px;
}
.mission-description {
  font-size: 11px;
  line-height: 1.7;
  color: #aabac3;
  margin-bottom: 17px;
}
.mission-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 13px 0;
  font-size: 11px;
  color: #d6dedf;
}
.step-check {
  flex: 0 0 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid #68818e;
  display: grid;
  place-items: center;
  font-size: 8px;
  margin-top: 1px;
}
.mission-step.done {
  color: #8caca2;
}
.mission-step.done .step-check {
  background: #c7ee8e22;
  border-color: #c7ee8e;
  color: #c7ee8e;
}
.mission-step.current .step-check {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px #c7ee8e0b;
}
.mission-step.current {
  color: var(--ink);
}
.mission-step small {
  display: block;
  color: #8da0ab;
  font-size: 9px;
  margin-top: 2px;
}
.mission-reward {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #acbec5;
  font-size: 9px;
}
.mission-reward span {
  color: var(--lime);
  display: flex;
  align-items: center;
  gap: 4px;
}
.mission-reward svg {
  width: 13px;
  height: 13px;
}
.primary,
.secondary,
.danger {
  border-radius: 8px;
  padding: 12px 17px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  font-size: 12px;
  font-weight: 650;
}
.primary {
  background: var(--lime);
  color: #1d3024;
}
.primary svg {
  width: 16px;
  height: 16px;
}
.secondary {
  background: #ffffff07;
  border: 1px solid #ffffff20;
  color: #dae5e6;
}
.danger {
  background: #e8757520;
  border: 1px solid #e8757540;
  color: #ffc7bf;
}
.mission-card .primary {
  width: 100%;
  margin-top: 16px;
  font-size: 11px;
  padding: 11px;
}
.weather-badge {
  position: absolute;
  left: 32px;
  top: 247px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8px;
  letter-spacing: 1px;
  color: #f4eadc;
}
.weather-badge svg {
  width: 16px;
  height: 16px;
}
.weather-badge b {
  font-weight: 450;
  border-left: 1px solid #fff5;
  margin-left: 3px;
  padding-left: 10px;
  font-size: 8px;
  color: #fae3cf;
}
.guide-card {
  position: absolute;
  left: 27px;
  bottom: calc(var(--dock) + 134px);
  width: 292px;
  padding: 17px 17px 16px;
  display: flex;
  gap: 12px;
  border-radius: 13px;
}
.robot-avatar {
  position: relative;
  color: var(--lime);
  background: #c7ee8e0c;
  border: 1px solid #c7ee8e22;
  border-radius: 11px;
  width: 41px;
  height: 43px;
  flex: 0 0 41px;
  display: grid;
  place-items: center;
}
.robot-avatar svg {
  width: 27px;
  height: 27px;
}
.robot-avatar i {
  width: 5px;
  height: 5px;
  background: var(--lime);
  border-radius: 50%;
  position: absolute;
  bottom: -3px;
  right: -2px;
}
.guide-name {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--lime);
  font-weight: 650;
  line-height: 1;
  margin: 2px 0 9px;
}
.guide-name span {
  font-size: 6px;
  letter-spacing: 1.1px;
  color: #a5b8c0;
  font-weight: 400;
  margin-left: 5px;
}
.guide-card p {
  font-size: 11px;
  line-height: 1.65;
  margin: 0 0 9px;
  color: #c3cfd4;
}
.guide-card .text-button {
  font-size: 9px;
  color: #c7ee8e;
}
.dismiss-guide {
  position: absolute;
  right: 7px;
  top: 3px;
  color: #93a8b1;
  font-size: 15px;
}
.movement-deck {
  position: absolute;
  left: 27px;
  bottom: calc(var(--dock) + 23px);
  width: 480px;
  max-width: calc(100% - 260px);
  padding: 0;
}
.deck-label {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  margin-bottom: 10px;
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #fff0e5;
}
.deck-label .text-button {
  color: #fff0e5;
  font-size: 8px;
  letter-spacing: 0;
}
.movement-deck #modeButtons {
  display: flex;
  gap: 5px;
}
.mode-btn {
  background: #152632d9;
  border: 1px solid #ffffff1a;
  color: #9eb1bd;
  border-radius: 9px;
  width: 76px;
  position: relative;
  padding: 11px 7px 8px;
  text-align: center;
  font-size: 9px;
  line-height: 1;
}
.mode-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  margin: 0 auto 6px;
}
.mode-btn.active {
  background: #c7ee8e;
  color: #1c3227;
  border-color: #e3ffb7;
}
.mode-btn.locked {
  background: #192a33b3;
  color: #91a3ae;
}
.mode-btn.locked svg {
  opacity: 0.6;
}
.mode-btn kbd {
  position: absolute;
  top: 4px;
  left: 5px;
  font-size: 6px;
  opacity: 0.6;
  background: transparent;
  border: 0;
  padding: 0;
}
.lock-small {
  position: absolute;
  top: 5px;
  right: 4px;
}
.lock-small svg {
  width: 8px;
  height: 8px;
  margin: 0;
}
.control-hints {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 8px;
  color: #fff0e3;
}
.control-hints > span {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.control-hints .look-hint {
  color: #e5c8b5;
  font-size: 7px;
}
kbd {
  font: 9px var(--font);
  background: #e7f2f00d;
  border: 1px solid #f3f5e94a;
  border-radius: 3px;
  display: inline-block;
  padding: 1px 4px;
  color: inherit;
  min-width: 15px;
  text-align: center;
}
.mini-map {
  position: absolute;
  right: 27px;
  bottom: calc(var(--dock) + 23px);
  width: 190px;
  border-radius: 11px;
  overflow: hidden;
}
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px 0;
  font-size: 7px;
  letter-spacing: 1.4px;
  color: #a6b8c1;
}
.map-header button {
  font-size: 17px;
  line-height: 1;
  padding: 0;
  color: #b8c8cd;
}
.mini-map canvas {
  display: block;
  width: 100%;
  height: 123px;
}
.map-footer {
  padding: 0 11px 10px;
  display: flex;
  justify-content: space-between;
  color: #acbec6;
  font-size: 6px;
  letter-spacing: 0.7px;
}
.map-footer i {
  display: inline-block;
  height: 3px;
  width: 3px;
  background: white;
  border-radius: 50%;
  margin-right: 3px;
}
.planet-dock {
  position: absolute;
  bottom: 0;
  height: var(--dock);
  width: 100%;
  background: var(--navy);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 27px;
  gap: 24px;
  z-index: 5;
}
.dock-title {
  font-size: 8px;
  letter-spacing: 1.2px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.dock-title > span[data-icon] {
  color: #b4c8cf;
}
.dock-title svg {
  width: 24px;
  height: 24px;
}
.dock-title small {
  display: block;
  letter-spacing: 0.7px;
  font-size: 6px;
  color: #8da2af;
  margin-top: 5px;
}
#planetStrip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  flex: 1;
  overflow: auto;
  scrollbar-width: none;
}
.planet-stop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 40px;
  padding: 7px 3px;
  color: #a2b3bd;
  font-size: 7px;
}
.planet-stop:after {
  content: '';
  position: absolute;
  width: calc(100% - 28px);
  height: 1px;
  top: 20px;
  left: calc(50% + 15px);
  background: #ffffff12;
}
.planet-stop:last-child:after {
  display: none;
}
.planet-orb {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--planet-color);
  border-radius: 50%;
  box-shadow:
    inset -6px -2px 6px #0005,
    inset 2px 2px 3px #fff3;
}
.planet-stop.locked {
  opacity: 0.4;
}
.planet-stop.active .planet-orb {
  outline: 1px solid var(--lime);
  outline-offset: 5px;
}
.planet-stop.active {
  color: var(--lime);
}
.planet-stop.completed:before {
  content: '✓';
  position: absolute;
  top: 0;
  right: 5px;
  color: var(--lime);
  font-size: 8px;
}
.atlas-button {
  font-size: 9px;
  display: flex;
  gap: 20px;
  align-items: center;
  border: 1px solid #ffffff25;
  padding: 10px 13px;
  border-radius: 7px;
  white-space: nowrap;
}
.atlas-button span {
  font-size: 15px;
  color: #8eacba;
}
.world-label {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  color: #fff7e8;
  text-shadow: 0 1px 8px #1a1a25aa;
  transition: opacity 0.3s;
}
.world-label .label-name {
  font-size: 8px;
  letter-spacing: 1.5px;
  background: #192b36c9;
  border: 1px solid #ffffff30;
  border-radius: 4px;
  padding: 4px 8px;
  box-shadow: 0 3px 12px #0002;
}
.world-label .label-name.quest {
  background: var(--lime);
  color: #263b28;
  text-shadow: none;
  border-color: #dfffbc;
}
.world-label .label-stem {
  height: 17px;
  border-left: 1px solid #fffa;
}
.world-label .label-dot {
  height: 5px;
  width: 5px;
  background: #fff2bd;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #fff2bd15;
}
.world-label.active .label-dot {
  box-shadow: 0 0 0 5px #c7ee8e22;
}
.world-label.active .label-stem {
  border-color: var(--lime);
}
#interaction {
  position: absolute;
  left: 50%;
  bottom: calc(var(--dock) + 144px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #142633ed;
  border: 1px solid #c7ee8e60;
  box-shadow: 0 5px 25px #17252d44;
  border-radius: 12px;
  padding: 10px 12px;
  z-index: 3;
  min-width: 225px;
}
#interaction[hidden] {
  display: none;
}
#interaction > kbd {
  background: var(--lime);
  color: #233124;
  font-size: 16px;
  font-weight: 600;
  border: 0;
  padding: 4px 10px;
}
#interaction b {
  font-size: 11px;
  font-weight: 550;
  display: block;
}
#interaction span {
  font-size: 8px;
  color: #a9bcc5;
  display: block;
  margin-top: 1px;
}
#interactButton {
  font-size: 19px;
  color: var(--lime);
  margin-left: auto;
}
#toastRegion {
  position: absolute;
  top: 105px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 30;
  width: min(420px, 90%);
}
.toast {
  background: #152a36f5;
  border: 1px solid #b9d7b643;
  box-shadow: 0 7px 20px #0003;
  border-radius: 11px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.25s ease-out;
  font-size: 12px;
  color: #e5eadd;
}
.toast svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--lime);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#saveStatus {
  position: absolute;
  right: 28px;
  bottom: calc(var(--dock) + 207px);
  font-size: 8px;
  color: #e6e6d1;
  text-shadow: 0 1px 5px #0008;
}
#travelFade {
  position: absolute;
  inset: 0;
  background: #111d29;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 40;
}
#travelFade.active {
  opacity: 1;
}
#loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  z-index: 50;
}
#loading p {
  margin-top: 24px;
  font-size: 12px;
  letter-spacing: 1px;
}
.loading-orbit {
  width: 45px;
  height: 45px;
  border: 1px solid #c7ee8e33;
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: rotate 1.2s linear infinite;
}
@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}
/* Mission control panels */
dialog {
  background: #142330;
  color: var(--ink);
  border: 1px solid #a9c6d22b;
  border-radius: 21px;
  box-shadow: 0 30px 100px #0007;
  width: min(880px, calc(100vw - 40px));
  max-height: 89vh;
  padding: 25px 29px 30px;
  overscroll-behavior: contain;
  scrollbar-color: #4b6474 transparent;
  scrollbar-width: thin;
}
dialog::backdrop {
  background: rgba(7, 17, 27, 0.64);
  backdrop-filter: blur(7px);
}
dialog.wide {
  width: min(1040px, calc(100vw - 40px));
}
dialog.onboarding {
  width: min(740px, calc(100vw - 32px));
  padding: 23px 31px 29px;
}
.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--lime);
}
.modal-intro {
  max-width: 680px;
  font-size: 13px;
  line-height: 1.75;
  margin-bottom: 24px;
}
.panel-tabs {
  display: flex;
  gap: 5px;
  background: #0c192433;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px;
  margin: 20px 0;
}
.panel-tabs button {
  padding: 9px 17px;
  font-size: 11px;
  border-radius: 6px;
  flex: 1;
}
.panel-tabs .selected {
  color: var(--lime);
  background: #c7ee8e13;
}
.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.panel-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tile {
  background: #ffffff04;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 19px;
}
.tile p {
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.tile > svg,
.tile > span[data-icon] {
  color: var(--lime);
  display: inline-block;
  margin-bottom: 12px;
}
.tile .primary,
.tile .secondary {
  font-size: 11px;
  padding: 10px 13px;
}
.tile h3 {
  font-weight: 550;
}
.pill {
  font-size: 8px;
  letter-spacing: 0.8px;
  border: 1px solid #c7ee8e3a;
  color: var(--lime);
  background: #c7ee8e0c;
  padding: 4px 7px;
  display: inline-block;
  border-radius: 4px;
  vertical-align: middle;
}
.pill.amber {
  color: var(--orange);
  border-color: #ffc58e33;
  background: #ffc58e0a;
}
.tile .pill {
  margin-bottom: 13px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 11px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 23px 0;
}
.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
}
.info-note {
  padding: 12px 15px;
  border-left: 2px solid var(--lime);
  border-radius: 0 7px 7px 0;
  background: #c7ee8e07;
  font-size: 11px;
  line-height: 1.8;
  color: #bed0cf;
  margin: 17px 0;
}
.info-note.amber {
  border-color: var(--orange);
  background: #ffc58e07;
  color: #e5cdb2;
}
.onboard-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 27px;
  align-items: center;
}
.onboard-art {
  position: relative;
  aspect-ratio: 1;
  background: radial-gradient(ellipse at 55% 52%, #dba66b13, transparent 65%), #0d1b26;
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.onboard-art svg {
  width: 100%;
  height: 100%;
  stroke: none;
}
.onboard-copy h2 {
  font-size: 35px;
  font-weight: 550;
  line-height: 1.16;
}
.onboard-copy p {
  font-size: 12px;
  line-height: 1.85;
}
.onboard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 26px;
  gap: 16px;
}
.tour-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 9px;
  color: var(--muted);
}
.tour-dots i {
  height: 5px;
  width: 5px;
  background: #4b5d69;
  border-radius: 50%;
}
.tour-dots i.on {
  background: var(--lime);
  width: 20px;
  border-radius: 4px;
}
.onboard-footer .text-button {
  font-size: 10px;
  color: var(--muted);
}
.control-table {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 18px;
  font-size: 12px;
  color: var(--muted);
}
.control-table kbd {
  color: var(--ink);
  min-width: 24px;
  font-size: 10px;
}
.planet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}
.planet-tile {
  padding: 19px 16px 15px;
  border: 1px solid var(--line);
  background: #ffffff03;
  border-radius: 12px;
  text-align: left;
  position: relative;
}
.planet-tile.current {
  border-color: #c7ee8e66;
  background: #c7ee8e07;
}
.planet-tile .planet-orb {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  box-shadow:
    inset -11px -3px 10px #0007,
    inset 3px 3px 4px #fff3;
}
.planet-tile h3 {
  margin: 0 0 3px;
  font-size: 14px;
}
.planet-tile p {
  margin: 0;
  font-size: 9px;
}
.planet-tile .planet-status {
  display: block;
  font-size: 8px;
  color: var(--lime);
  margin-top: 12px;
}
.planet-tile .tile-number {
  position: absolute;
  right: 13px;
  top: 15px;
  font-size: 9px;
  color: #758b9a;
}
.planet-tile.locked {
  opacity: 0.56;
}
.atlas-fact {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 25px;
  align-items: center;
  margin: 20px 0;
}
.atlas-fact .planet-orb {
  width: 85px;
  height: 85px;
  box-shadow:
    inset -20px -6px 20px #0007,
    inset 5px 5px 10px #fff2;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.stat {
  background: #ffffff04;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}
.stat small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 6px;
}
.stat b {
  font-weight: 500;
  font-size: 15px;
}
.fact-row {
  display: flex;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.fact-row > b {
  font-size: 10px;
  color: var(--lime);
  font-weight: 400;
  margin-top: 2px;
}
.fact-row p {
  color: #d1dce0;
  font-size: 13px;
  line-height: 1.8;
  margin: 0;
}
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  font-size: 10px;
  margin-top: 17px;
}
.progress-track {
  height: 4px;
  background: #ffffff0d;
  border-radius: 3px;
  margin: 15px 0;
  overflow: hidden;
}
.progress-track i {
  display: block;
  height: 100%;
  background: var(--lime);
  transition: width 0.2s;
}
.inventory {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.inventory > span {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 11px;
  color: #c6d8dc;
}
.inventory svg {
  color: var(--lime);
  width: 16px;
  height: 16px;
}
.plot {
  position: relative;
  overflow: hidden;
}
.plant-visual {
  height: 80px;
  background: radial-gradient(ellipse at 50% 100%, #c7ee8e20, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.plant-visual svg {
  width: 52px;
  height: 52px;
  color: var(--lime);
  transition: transform 1s;
}
.plot-status {
  font-size: 10px;
  color: var(--lime);
  display: block;
  margin-bottom: 9px;
}
.crop-select {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  background: #132331;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
}
.sustain-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #b0c6cc;
  font-size: 9px;
  margin: 8px 0;
}
.sustain-bar i {
  flex: 1;
  background: #ffffff10;
  height: 3px;
  border-radius: 2px;
}
.sustain-bar em {
  display: block;
  height: 3px;
  background: var(--lime);
  border-radius: 2px;
}
.reward-banner {
  border: 1px solid #c7ee8e40;
  border-radius: 12px;
  background: linear-gradient(120deg, #c7ee8e13, #c7ee8e02);
  padding: 19px 22px;
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 20px 0;
}
.reward-banner svg {
  width: 40px;
  height: 40px;
  color: var(--lime);
  flex-shrink: 0;
}
.reward-banner h3 {
  margin: 0 0 4px;
}
.reward-banner p {
  margin: 0;
  font-size: 12px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 15px 17px;
  border: 1px solid #ffffff1c;
  border-radius: 9px;
  background: #ffffff03;
  text-align: left;
  font-size: 13px;
  margin-top: 10px;
}
.quiz-option > span {
  display: grid;
  place-items: center;
  border: 1px solid #ffffff26;
  border-radius: 5px;
  height: 25px;
  width: 25px;
  flex: 0 0 25px;
  font-size: 10px;
  color: #a5b8c3;
}
.quiz-option:hover {
  border-color: #c7ee8e77;
}
.quiz-option.correct {
  border-color: var(--lime);
  background: #c7ee8e0d;
}
.quiz-option.incorrect {
  border-color: #f3957c88;
  background: #f3957c0b;
}
.feedback {
  padding: 15px 17px;
  border: 1px solid #c7ee8e40;
  border-radius: 9px;
  background: #c7ee8e08;
  color: #d9ecc8;
  font-size: 12px;
  line-height: 1.8;
  margin-top: 17px;
}
.feedback.retry {
  border-color: #ffc58e33;
  color: #f8d1ac;
  background: #ffc58e08;
}
.lab-stage {
  width: 100%;
  height: 200px;
  background: #0c1925;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  margin: 18px 0;
}
.range-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 15px 0;
}
.range-row input {
  flex: 1;
  accent-color: var(--lime);
}
.range-value {
  font-size: 23px;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
  min-width: 105px;
  text-align: right;
}
.range-value small {
  font-size: 12px;
  color: var(--muted);
}
.badge-tile {
  text-align: center;
  padding: 23px 15px;
}
.badge-tile .badge-icon {
  height: 60px;
  width: 60px;
  border: 1px solid #526777;
  border-radius: 16px;
  display: grid;
  place-items: center;
  transform: rotate(-8deg);
  margin: 0 auto 18px;
  color: #718999;
  background: #ffffff03;
}
.badge-icon svg {
  width: 31px;
  height: 31px;
  transform: rotate(8deg);
}
.badge-tile.earned .badge-icon {
  border-color: #c7ee8e77;
  color: var(--lime);
  background: #c7ee8e0b;
  box-shadow: 0 0 25px #c7ee8e08;
}
.badge-tile h3 {
  font-size: 13px;
}
.badge-tile p {
  font-size: 10px;
  margin: 0;
}
.journal-locked {
  color: #6f8897;
}
.settings-row {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 17px 0;
}
.settings-row b {
  font-weight: 500;
  font-size: 13px;
}
.settings-row p {
  font-size: 11px;
  margin: 4px 0 0;
}
.settings-row select {
  background: #233b4a;
  color: var(--ink);
  border: 1px solid #ffffff26;
  border-radius: 6px;
  font-size: 11px;
  padding: 8px;
  min-width: 160px;
}
.settings-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--lime);
}
.local-map-large {
  width: 100%;
  max-height: 440px;
  aspect-ratio: 1.5;
  display: block;
  background: #0f1d2a;
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
}
.completion {
  text-align: center;
  padding: 10px 15px;
}
.completion > .badge-icon {
  margin: 10px auto 24px;
  color: var(--lime);
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border: 1px solid #c7ee8e66;
  border-radius: 50%;
  background: #c7ee8e09;
  box-shadow: 0 0 50px #c7ee8e12;
}
.completion > .badge-icon svg {
  width: 43px;
  height: 43px;
}
.completion h2 {
  font-size: 36px;
  font-weight: 500;
}
.completion p {
  max-width: 550px;
  margin: 0 auto 17px;
  line-height: 1.8;
}
.completion .button-row {
  justify-content: center;
}
#mobileControls {
  display: none;
}
.no-script {
  position: fixed;
  inset: 0;
  background: var(--navy);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 30px;
}
.hidden {
  display: none !important;
}
.lab-help {
  font-size: 10px;
  color: var(--orange);
}
.teacher-objectives {
  font-size: 12px;
  color: #c4d2d7;
  line-height: 1.9;
  padding-left: 20px;
}
.orbit-key {
  display: flex;
  gap: 15px;
  font-size: 9px;
  color: var(--muted);
  margin-top: 10px;
  flex-wrap: wrap;
}
.orbit-key span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.orbit-key i {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  display: inline-block;
}
.text-input {
  width: 100%;
  padding: 11px;
  background: #0f1d28;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-top: 6px;
}
.empty-state {
  text-align: center;
  padding: 25px;
  color: var(--muted);
  font-size: 12px;
}
.print-only {
  display: none;
}

/* Responsive layout rules */
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  body {
    overflow: visible;
    height: auto;
    background: white;
    color: #152330;
  }
  body > * {
    display: none !important;
  }
  body > .print-only {
    display: block !important;
    padding: 25px;
  }
  .print-only h1 {
    font-size: 28px;
  }
  .print-only p,
  .print-only td {
    color: #24394a;
  }
  .print-only table {
    border-collapse: collapse;
    width: 100%;
    font-size: 11px;
  }
  .print-only th,
  .print-only td {
    padding: 9px;
    border: 1px solid #ccc;
    text-align: left;
  }
}

@media screen {
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --bottom-nav: 0px;
    --dock: calc(76px + var(--safe-bottom));
    --topbar: 72px;
    --sidebar: 80px;
  }
  html,
  body {
    height: 100%;
    height: 100dvh;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
  }
  .topbar {
    height: calc(var(--topbar) + var(--safe-top));
    padding-top: var(--safe-top);
    padding-left: max(20px, var(--safe-left));
    padding-right: max(20px, var(--safe-right));
  }
  #gameShell {
    top: calc(var(--topbar) + var(--safe-top));
    left: calc(var(--sidebar) + var(--safe-left));
    right: var(--safe-right);
  }
  .sidebar {
    top: calc(var(--topbar) + var(--safe-top));
    left: var(--safe-left);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  .planet-dock {
    padding-bottom: var(--safe-bottom);
    min-width: 0;
  }
  #planetStrip {
    min-width: 0;
    justify-content: flex-start;
    gap: clamp(4px, 1vw, 18px);
    -webkit-overflow-scrolling: touch;
    scroll-padding-inline: 8px;
  }
  .planet-stop {
    flex: 1 0 40px;
    min-height: 50px;
  }
  .mission-tools {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  #missionToggle,
  .mission-summary {
    display: none;
  }
  .mission-tools .mini-btn {
    min-width: 28px;
    min-height: 28px;
    display: grid;
    place-items: center;
  }
  .mission-card {
    max-height: calc(100% - var(--dock) - 140px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #597789 transparent;
  }
  .icon-btn {
    min-width: 36px;
    min-height: 36px;
  }
  dialog,
  dialog.wide {
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px);
    max-width: calc(100vw - var(--safe-left) - var(--safe-right) - 24px);
    margin: auto;
    scroll-padding-block: 20px;
  }
  .modal-top {
    position: sticky;
    top: -25px;
    background: #142330;
    z-index: 3;
    padding-block: 6px;
  }
  .modal-top .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }
  #modalBody,
  .tile,
  .tile > div,
  .row > div,
  .onboard-copy {
    min-width: 0;
  }
  .modal-intro,
  .tile p,
  .info-note,
  .fact-row p,
  .quiz-option,
  .feedback {
    overflow-wrap: anywhere;
  }
  .primary,
  .secondary,
  .danger {
    min-height: 42px;
  }
  .panel-tabs {
    flex-wrap: wrap;
  }
  .panel-tabs button {
    min-height: 40px;
  }
  .range-row input {
    min-width: 0;
    min-height: 44px;
  }
  .orbit-planet-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .settings-row input[type='checkbox'] {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
  }
  .settings-row select,
  .crop-select,
  .text-input {
    min-height: 42px;
  }
  .touch-actions {
    display: grid;
    grid-template-columns: repeat(2, 48px);
    gap: 6px;
  }
  .touch-actions button {
    width: 48px;
    height: 48px;
    border: 1px solid #ddeee950;
    border-radius: 10px;
    background: #152a3be8;
    color: #edf4e8;
    font-size: 19px;
    line-height: 1;
    padding: 5px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  .touch-actions small {
    display: block;
    font-size: 8px;
    line-height: 1.2;
    margin-top: 4px;
    letter-spacing: 0.3px;
  }
  #mobileInteract {
    background: var(--lime);
    color: #243b27;
    border-color: var(--lime);
  }
  .dpad {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(2, 44px);
    gap: 5px;
  }
  .dpad button {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid #ddeee950;
    border-radius: 10px;
    background: #152a3be8;
    font-size: 22px;
    line-height: 1;
    padding: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  .dpad button:first-child {
    grid-column: 2;
  }
  .dpad button:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }
  .dpad button:nth-child(3) {
    grid-row: 2;
    grid-column: 2;
  }
  .dpad button:nth-child(4) {
    grid-row: 2;
    grid-column: 3;
  }
  #mobileControls {
    pointer-events: none;
  }
  .dpad,
  .touch-actions {
    pointer-events: auto;
  }
  [data-move].is-held {
    background: #c7ee8e;
    color: #213726;
    border-color: #c7ee8e;
    box-shadow: 0 0 0 3px #c7ee8e22;
  }
}

@media screen and (min-width: 1550px) {
  .mission-card {
    width: 310px;
    padding: 22px;
    top: 125px;
  }
  .mission-card h2 {
    font-size: 24px;
  }
  .mission-description,
  .mission-step {
    font-size: 12px;
  }
  .destination-hud {
    top: 35px;
    left: 40px;
  }
  .destination-hud h1 {
    font-size: 77px;
  }
  .weather-badge {
    left: 40px;
    top: 282px;
  }
  .guide-card {
    left: 36px;
    width: 320px;
    bottom: calc(var(--dock) + 150px);
  }
  .guide-card p {
    font-size: 12px;
  }
  .movement-deck {
    left: 36px;
    width: 510px;
  }
  .mode-btn {
    width: 81px;
    padding-block: 14px 12px;
  }
  .mode-btn svg {
    width: 26px;
    height: 26px;
  }
  .mini-map {
    width: 215px;
  }
  .mini-map canvas {
    height: 150px;
  }
  .resource-hud,
  .mission-card,
  .mini-map {
    right: 36px;
  }
}

@media screen and (max-width: 1200px) {
  :root {
    --sidebar: 68px;
    --topbar: 64px;
    --dock: calc(68px + var(--safe-bottom));
  }
  .sidebar {
    padding: 12px 4px;
    gap: 5px;
  }
  .nav-btn {
    width: 58px;
    min-height: 58px;
  }
  .brand {
    font-size: 13px;
    letter-spacing: 1.5px;
  }
  .brand-mark svg {
    height: 32px;
    width: 32px;
  }
  .brand small {
    font-size: 6px;
  }
  .top-right {
    gap: 9px;
  }
  .expedition-label {
    font-size: 8px;
  }
  .expedition-label b {
    margin-left: 4px;
  }
  .destination-hud {
    left: 24px;
    top: 24px;
  }
  .destination-hud h1 {
    font-size: 54px;
  }
  .destination-hud p {
    font-size: 13px;
  }
  .location {
    font-size: 9px;
  }
  .hud-chip {
    display: none;
  }
  .resource-hud {
    right: 20px;
    gap: 13px;
    top: 24px;
  }
  .resource > div {
    min-width: 50px;
  }
  .resource i {
    width: 54px;
  }
  .resource b {
    font-size: 20px;
  }
  .resource svg {
    width: 18px;
    height: 18px;
  }
  .mission-card {
    width: 260px;
    right: 20px;
    top: 110px;
    padding: 16px 18px;
  }
  .mission-card h2 {
    font-size: 21px;
  }
  .mission-description {
    font-size: 11px;
  }
  .mission-step {
    font-size: 11px;
  }
  .weather-badge {
    left: 24px;
    top: 235px;
  }
  .guide-card {
    left: 20px;
    width: 268px;
    padding: 14px;
    bottom: calc(var(--dock) + 132px);
  }
  .guide-card p {
    font-size: 11px;
  }
  .guide-name span {
    display: none;
  }
  .movement-deck {
    left: 20px;
    width: 430px;
  }
  .mode-btn {
    width: 68px;
  }
  .control-hints .look-hint {
    display: none;
  }
  .mini-map {
    width: 170px;
    right: 20px;
  }
  .mini-map canvas {
    height: 110px;
  }
  .planet-dock {
    padding-inline: 18px;
    gap: 14px;
  }
  .dock-title {
    font-size: 7px;
  }
  .dock-title small {
    font-size: 6px;
  }
  .dock-title > span[data-icon] {
    display: none;
  }
  .atlas-button {
    font-size: 10px;
    padding: 10px;
    gap: 10px;
  }
}

/* Compact mission cards expose a useful objective without covering the world. */
@media screen and (max-width: 1024px),
  screen and (max-height: 620px),
  screen and (any-pointer: coarse) {
  .mission-card {
    width: 238px;
    top: 116px;
    padding: 11px 14px;
    max-height: calc(100% - var(--dock) - 240px);
  }
  .mission-card .card-overline {
    padding-bottom: 8px;
    font-size: 8px;
    letter-spacing: 1px;
    position: sticky;
    top: -11px;
    background: #172a36;
    z-index: 1;
  }
  #missionToggle {
    display: grid;
    font-size: 22px;
  }
  .mission-card:not(.is-expanded) #missionContent {
    display: none;
  }
  .mission-card:not(.is-expanded) .mission-summary {
    display: flex;
  }
  .mission-summary {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 0 3px;
    text-align: left;
    min-height: 56px;
  }
  .mission-summary b {
    display: block;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.35;
    color: #eef4e8;
  }
  .mission-summary small {
    display: block;
    font-size: 11px;
    line-height: 1.45;
    color: #a9c2c8;
    margin-top: 5px;
  }
  .mission-summary > span:last-child {
    font-size: 20px;
    color: var(--lime);
  }
  .mission-card.is-expanded .mission-description {
    font-size: 12px;
    display: block;
  }
  .mission-card.is-expanded .mission-step {
    font-size: 12px;
    display: flex;
  }
  .mission-card.is-expanded .mission-reward {
    display: flex;
  }
  .mission-card.is-expanded .mission-step small {
    font-size: 11px;
  }
  .mission-card.is-expanded h2 {
    font-size: 21px;
  }
  .destination-hud {
    left: 20px;
  }
  .destination-hud h1 {
    font-size: 46px;
    letter-spacing: -2px;
  }
  .destination-hud p {
    font-size: 12px;
  }
  .location {
    font-size: 9px;
  }
  .resource-hud {
    right: 18px;
    gap: 12px;
  }
  .resource.compact {
    display: none;
  }
  .resource > span {
    display: none;
  }
  .weather-badge {
    left: 20px;
    top: 222px;
    font-size: 7px;
  }
  .weather-badge b {
    font-size: 7px;
  }
  .guide-card {
    width: 246px;
  }
  .guide-card p {
    font-size: 11px;
  }
  .robot-avatar {
    flex-basis: 33px;
    width: 33px;
    height: 35px;
  }
  .movement-deck {
    width: 408px;
    max-width: calc(100% - 205px);
  }
  .movement-deck #modeButtons {
    gap: 5px;
  }
  .mode-btn {
    width: calc((100% - 25px) / 6);
    min-width: 44px;
    min-height: 56px;
    font-size: 10px;
    padding: 11px 4px 9px;
  }
  .mode-btn svg {
    height: 21px;
    width: 21px;
  }
  .mini-map {
    width: 150px;
  }
  .mini-map canvas {
    height: 100px;
  }
  .dock-title {
    display: none;
  }
  .planet-stop {
    font-size: 8px;
  }
  .planet-dock {
    gap: 12px;
  }
  .panel-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .planet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Touch support follows the input device, including tablets and hybrid laptops. */
@media screen and (any-pointer: coarse), screen and (max-width: 640px) {
  .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .mission-tools .mini-btn {
    min-width: 40px;
    min-height: 40px;
  }
  #mobileControls {
    display: flex;
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: calc(var(--dock) + var(--bottom-nav) + 124px);
    justify-content: space-between;
    align-items: flex-end;
    z-index: 4;
  }
  .guide-card,
  .mini-map {
    display: none;
  }
  .movement-deck {
    left: 18px;
    right: 18px;
    width: min(480px, calc(100% - 36px));
    max-width: none;
    bottom: calc(var(--dock) + var(--bottom-nav) + 18px);
  }
  .movement-deck #modeButtons {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
  }
  .mode-btn {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    font-size: 11px;
  }
  .mode-btn kbd {
    display: none;
  }
  .deck-label {
    font-size: 9px;
    min-height: 26px;
    margin-bottom: 5px;
  }
  .deck-label .text-button {
    font-size: 11px;
    min-height: 32px;
    padding-inline: 6px;
  }
  .control-hints {
    display: none;
  }
  #interaction {
    left: 50%;
    right: auto;
    bottom: calc(var(--dock) + var(--bottom-nav) + 240px);
    transform: translateX(-50%);
    min-width: 210px;
    max-width: calc(100% - 32px);
    z-index: 5;
  }
  #interactButton {
    min-width: 44px;
    min-height: 44px;
  }
  #interaction b {
    font-size: 12px;
  }
  #interaction span {
    font-size: 10px;
  }
  .nav-btn {
    min-height: 60px;
  }
  .primary,
  .secondary,
  .danger,
  .panel-tabs button,
  .quiz-option {
    min-height: 44px;
  }
  .crop-select,
  .settings-row select,
  .text-input {
    font-size: 16px;
    min-height: 44px;
  }
  .settings-row input[type='checkbox'] {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
  .dismiss-guide {
    min-width: 44px;
    min-height: 44px;
  }
}

@media screen and (max-height: 790px) and (min-width: 641px) {
  .mini-map {
    display: none;
  }
  .movement-deck {
    max-width: calc(100% - 300px);
  }
  .guide-card {
    bottom: calc(var(--dock) + 122px);
    padding: 12px 14px;
    max-height: 156px;
    overflow: auto;
  }
  .mission-card {
    max-height: calc(100% - var(--dock) - 140px);
  }
}

/* Phone portrait: one bottom navigation bar, six travel modes and two thumb zones. */
@media screen and (max-width: 640px) {
  :root {
    --sidebar: 0px;
    --topbar: 60px;
    --dock: 0px;
    --bottom-nav: calc(64px + var(--safe-bottom));
  }
  .topbar {
    padding-inline: max(12px, var(--safe-left)) max(10px, var(--safe-right));
    gap: 5px;
  }
  .brand {
    gap: 7px;
    font-size: 12px;
    letter-spacing: 1px;
  }
  .brand-mark svg {
    width: 28px;
    height: 28px;
  }
  .brand small {
    font-size: 5px;
    letter-spacing: 1.3px;
    margin-top: 5px;
  }
  .brand-light {
    margin-left: 4px;
  }
  .top-right {
    gap: 2px;
  }
  .xp-pill {
    font-size: 9px;
    padding: 6px 7px;
    gap: 4px;
  }
  .xp-pill svg {
    height: 13px;
    width: 13px;
  }
  .avatar,
  .expedition-label {
    display: none;
  }
  .top-right .icon-btn {
    min-width: 40px;
    min-height: 44px;
  }
  #gameShell {
    left: var(--safe-left);
    right: var(--safe-right);
  }
  #viewport {
    bottom: var(--bottom-nav);
  }
  .sidebar {
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav);
    padding: 3px max(6px, var(--safe-right)) calc(3px + var(--safe-bottom))
      max(6px, var(--safe-left));
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    align-items: center;
    border-right: 0;
    border-top: 1px solid #ffffff20;
  }
  .nav-btn {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    gap: 4px;
    font-size: 9px;
    border-radius: 8px;
  }
  .nav-btn svg {
    width: 21px;
    height: 21px;
  }
  .sidebar-bottom {
    display: contents;
  }
  .class-tag {
    display: none;
  }
  .planet-dock {
    display: none;
  }
  .destination-hud {
    left: 16px;
    top: 14px;
    max-width: calc(100% - 134px);
  }
  .destination-hud h1 {
    font-size: clamp(29px, 8vw, 43px);
    letter-spacing: -1.8px;
    overflow-wrap: anywhere;
    line-height: 1.08;
    margin: 9px 0 6px;
  }
  .destination-hud h1 span {
    font-size: 9px;
    margin: 4px 0 0 6px;
  }
  .destination-hud p {
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 6px;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 0.8px;
    gap: 5px;
  }
  .location {
    font-size: 8px;
    align-items: flex-start;
  }
  .location svg {
    flex: 0 0 12px;
  }
  .destination-hud .text-button {
    font-size: 10px;
    min-height: 32px;
    padding-bottom: 0;
    margin-top: 4px;
  }
  .resource-hud {
    top: 15px;
    right: 14px;
    gap: 12px;
  }
  .resource > div {
    min-width: 42px;
  }
  .resource span:not([data-icon]) {
    font-size: 6px;
    letter-spacing: 0.65px;
  }
  .resource b {
    font-size: 20px;
  }
  .resource b small {
    font-size: 10px;
  }
  .resource i {
    width: 44px;
  }
  .mission-card {
    top: 154px;
    right: 14px;
    width: min(218px, calc(100% - 90px));
    padding: 8px 12px;
    max-height: calc(100% - var(--bottom-nav) - 388px);
    min-height: 108px;
  }
  .mission-card .card-overline {
    top: -8px;
    padding-bottom: 4px;
    font-size: 7px;
  }
  .mission-tools {
    gap: 0;
  }
  .mission-tools .mini-btn {
    min-width: 36px;
    min-height: 36px;
  }
  .mission-summary {
    padding-top: 8px;
    padding-bottom: 5px;
    min-height: 54px;
  }
  .mission-summary b {
    font-size: 12px;
  }
  .mission-summary small {
    font-size: 10px;
  }
  .mission-card.is-expanded {
    max-height: calc(100% - var(--bottom-nav) - 292px);
  }
  .mission-card.is-expanded h2 {
    font-size: 20px;
  }
  .mission-card.is-expanded .chapter {
    font-size: 8px;
    margin-top: 12px;
  }
  .mission-card.is-expanded .mission-description {
    font-size: 12px;
  }
  .mission-card.is-expanded .mission-step {
    margin-block: 12px;
    font-size: 12px;
  }
  .mission-card.is-expanded .mission-step small {
    font-size: 10px;
  }
  .mission-card.is-expanded .primary {
    font-size: 12px;
    min-height: 44px;
  }
  .mission-reward {
    font-size: 8px;
  }
  .weather-badge {
    display: none;
  }
  .movement-deck {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(var(--bottom-nav) + 10px);
  }
  .mode-btn {
    min-height: 58px;
    padding: 9px 3px;
    font-size: 10px;
    border-radius: 8px;
  }
  .mode-btn svg {
    width: 21px;
    height: 21px;
    margin-bottom: 5px;
  }
  .deck-label {
    font-size: 8px;
    margin-bottom: 3px;
    min-height: 24px;
  }
  .deck-label .text-button {
    font-size: 10px;
    min-height: 30px;
  }
  #mobileControls {
    left: 14px;
    right: 14px;
    bottom: calc(var(--bottom-nav) + 112px);
  }
  #interaction {
    bottom: calc(var(--bottom-nav) + 222px);
    padding: 8px 10px;
    gap: 9px;
    min-width: 200px;
  }
  #interaction > kbd {
    display: none;
  }
  #interaction b {
    font-size: 12px;
  }
  #interaction span {
    font-size: 10px;
  }
  #saveStatus {
    right: 14px;
    bottom: calc(var(--bottom-nav) + 210px);
    font-size: 8px;
  }
  #toastRegion {
    top: auto;
    bottom: calc(var(--bottom-nav) + 222px);
    width: calc(100% - 28px);
    max-width: 380px;
    z-index: 31;
  }
  .toast {
    font-size: 11px;
    padding: 10px 13px;
    line-height: 1.5;
  }
  .toast:nth-last-child(n + 2) {
    display: none;
  }
  dialog,
  dialog.wide,
  dialog.onboarding {
    width: calc(100vw - var(--safe-left) - var(--safe-right) - 20px);
    padding: 16px 18px 24px;
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 20px);
    border-radius: 16px;
  }
  .modal-top {
    top: -16px;
    margin-bottom: 14px;
    padding-block: 4px;
  }
  .modal-eyebrow {
    font-size: 8px;
    letter-spacing: 1.4px;
  }
  .modal-intro {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 19px;
  }
  h2 {
    font-size: 27px;
    line-height: 1.2;
  }
  h3 {
    font-size: 17px;
  }
  .onboard-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .onboard-art {
    aspect-ratio: 2.4;
    max-height: 155px;
  }
  .onboard-art svg {
    height: 230px;
    width: 230px;
  }
  .onboard-copy h2 {
    font-size: 29px;
  }
  .onboard-copy p {
    font-size: 13px;
    line-height: 1.75;
  }
  .onboard-copy .pill {
    font-size: 7px;
  }
  .onboard-footer {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
  }
  .onboard-footer .primary {
    font-size: 12px;
    margin-left: auto;
  }
  .onboard-footer .text-button {
    font-size: 11px;
    min-height: 44px;
  }
  .tour-dots {
    font-size: 9px;
  }
  .panel-grid,
  .panel-grid.three {
    grid-template-columns: 1fr;
  }
  .planet-grid,
  .orbit-planet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .planet-tile {
    padding: 16px 14px;
  }
  .planet-tile h3 {
    font-size: 15px;
  }
  .planet-tile p,
  .planet-tile .planet-status {
    font-size: 11px;
  }
  .planet-tile .planet-orb {
    height: 32px;
    width: 32px;
    margin-bottom: 11px;
  }
  .tile {
    padding: 17px;
  }
  .tile p {
    font-size: 13px;
  }
  .tile .primary,
  .tile .secondary {
    font-size: 12px;
    min-height: 44px;
  }
  .info-note {
    font-size: 12px;
    line-height: 1.7;
  }
  .fact-row p {
    font-size: 13px;
  }
  .source-links {
    font-size: 12px;
    gap: 12px;
  }
  .source-links a {
    padding-block: 5px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stat {
    padding: 12px;
  }
  .stat small {
    font-size: 8px;
  }
  .stat b {
    font-size: 13px;
    overflow-wrap: anywhere;
  }
  .atlas-fact {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 17px;
  }
  .atlas-fact .planet-orb {
    height: 60px;
    width: 60px;
  }
  .inventory {
    gap: 8px;
  }
  .inventory > span {
    font-size: 11px;
    padding: 8px;
  }
  .panel-tabs button {
    font-size: 12px;
    padding: 9px;
  }
  .quiz-option {
    font-size: 13px;
    padding: 13px 12px;
  }
  .feedback {
    font-size: 13px;
  }
  .button-row {
    gap: 10px;
  }
  .button-row > .primary,
  .button-row > .secondary,
  .button-row > .danger {
    flex: 1 1 135px;
    font-size: 12px;
  }
  .range-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
  }
  .range-row > input {
    grid-column: 1/-1;
    grid-row: 2;
    width: 100%;
  }
  .range-value {
    font-size: 23px;
    min-width: 90px;
  }
  .range-row > output {
    grid-column: 2;
    grid-row: 1;
  }
  .lab-stage {
    height: 180px;
  }
  .settings-row {
    gap: 14px;
    align-items: center;
    padding-block: 17px;
  }
  .settings-row > div {
    min-width: 0;
    flex: 1;
  }
  .settings-row b {
    font-size: 13px;
  }
  .settings-row p {
    font-size: 12px;
  }
  .settings-row select {
    min-width: 115px;
    max-width: 145px;
    font-size: 16px;
  }
  .control-table {
    grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1fr);
    gap: 12px;
    font-size: 12px;
  }
  .control-table kbd {
    font-size: 10px;
  }
  .completion {
    padding: 4px 0;
  }
  .completion h2 {
    font-size: 29px;
  }
  .completion p {
    font-size: 13px;
  }
  .reward-banner {
    padding: 16px;
    gap: 12px;
  }
  .reward-banner p {
    font-size: 12px;
  }
  .reward-banner h3 {
    font-size: 16px;
  }
}

/* Limited height matters as much as width: use a compact landscape console. */
@media screen and (max-height: 540px) and (min-aspect-ratio: 6/5) {
  :root {
    --sidebar: 56px;
    --topbar: 50px;
    --dock: 0px;
    --bottom-nav: 0px;
  }
  .topbar {
    padding-inline: max(12px, var(--safe-left)) max(10px, var(--safe-right));
  }
  .brand {
    font-size: 12px;
  }
  .brand small {
    display: none;
  }
  .brand-mark svg {
    width: 28px;
    height: 28px;
  }
  .avatar,
  .expedition-label {
    display: none;
  }
  #gameShell {
    left: calc(var(--sidebar) + var(--safe-left));
    right: var(--safe-right);
  }
  #viewport {
    bottom: 0;
  }
  .sidebar {
    top: calc(var(--topbar) + var(--safe-top));
    bottom: 0;
    left: var(--safe-left);
    width: var(--sidebar);
    height: auto;
    display: flex;
    flex-direction: column;
    padding: 3px;
    gap: 0;
    border-right: 1px solid var(--line);
    border-top: 0;
    overflow-y: auto;
  }
  .sidebar-bottom {
    display: block;
    margin-top: 0;
  }
  .class-tag {
    display: none;
  }
  .nav-btn {
    width: 50px;
    min-height: 44px;
    font-size: 7px;
    gap: 2px;
  }
  .nav-btn svg {
    width: 18px;
    height: 18px;
  }
  .planet-dock,
  .guide-card,
  .mini-map,
  .weather-badge {
    display: none;
  }
  .destination-hud {
    left: 16px;
    top: 12px;
    max-width: calc(100% - 260px);
  }
  .destination-hud h1 {
    font-size: 32px;
    margin: 6px 0;
  }
  .destination-hud p {
    font-size: 10px;
    margin-bottom: 4px;
  }
  .location {
    display: none;
  }
  .destination-hud .text-button {
    font-size: 9px;
    min-height: 30px;
    margin-top: 0;
  }
  .eyebrow {
    font-size: 6px;
  }
  .resource-hud {
    top: 13px;
    right: 16px;
  }
  .resource b {
    font-size: 19px;
  }
  .resource span:not([data-icon]) {
    font-size: 6px;
  }
  .mission-card {
    top: 78px;
    right: 14px;
    width: 224px;
    min-height: 0;
    max-height: calc(100% - 184px);
    padding: 6px 12px;
  }
  .mission-card .card-overline {
    top: -6px;
    font-size: 7px;
    padding-bottom: 2px;
  }
  .mission-summary {
    padding: 7px 0;
    min-height: 50px;
  }
  .mission-summary b {
    font-size: 12px;
  }
  .mission-summary small {
    font-size: 10px;
  }
  .mission-card.is-expanded {
    max-height: calc(100% - 174px);
  }
  .movement-deck {
    left: 16px;
    bottom: 12px;
    width: 390px;
    max-width: calc(100% - 280px);
  }
  .deck-label {
    min-height: 24px;
    margin-bottom: 4px;
    font-size: 8px;
  }
  .mode-btn {
    min-height: 50px;
    font-size: 10px;
    padding: 7px 3px;
  }
  .mode-btn svg {
    height: 19px;
    width: 19px;
    margin-bottom: 4px;
  }
  .control-hints {
    display: none;
  }
  #mobileControls {
    bottom: 12px;
    left: 12px;
    right: 12px;
  }
  .touch-actions {
    grid-template-columns: repeat(2, 44px);
    gap: 5px;
  }
  .touch-actions button {
    width: 44px;
    height: 44px;
  }
  .dpad {
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(2, 44px);
    gap: 4px;
  }
  #interaction {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 116px;
    min-width: 180px;
    max-width: 260px;
    padding: 6px 10px;
  }
  #interaction > kbd {
    display: none;
  }
  #interaction b {
    font-size: 11px;
  }
  #interaction span {
    font-size: 9px;
  }
  #saveStatus {
    bottom: 111px;
    font-size: 7px;
    right: 14px;
  }
  #toastRegion {
    top: auto;
    bottom: 116px;
    max-width: 340px;
    width: calc(100% - 40px);
  }
  .toast {
    font-size: 11px;
    padding: 9px 12px;
  }
  .toast:nth-last-child(n + 2) {
    display: none;
  }
  dialog,
  dialog.wide,
  dialog.onboarding {
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 16px);
    padding: 14px 22px 24px;
  }
  .modal-top {
    top: -14px;
    margin-bottom: 8px;
  }
  .modal-intro {
    font-size: 12px;
  }
  .onboard-layout {
    grid-template-columns: minmax(130px, 0.6fr) minmax(0, 1fr);
    gap: 22px;
  }
  .onboard-art {
    aspect-ratio: 1;
    max-height: 200px;
  }
  .onboard-copy h2 {
    font-size: 27px;
  }
  .onboard-copy p {
    font-size: 12px;
  }
  .onboard-copy .info-note {
    font-size: 10px;
  }
  .onboard-footer {
    margin-top: 15px;
    padding-top: 12px;
  }
  .onboard-footer .primary {
    font-size: 12px;
  }
}
@media screen and (max-height: 540px) and (min-aspect-ratio: 6/5) and (any-pointer: coarse),
  screen and (max-height: 540px) and (max-width: 640px) and (min-aspect-ratio: 6/5) {
  .movement-deck {
    left: 172px;
    right: 120px;
    width: auto;
    max-width: none;
    bottom: 12px;
  }
}
@media screen and (max-height: 540px) and (max-width: 800px) and (min-aspect-ratio: 6/5) {
  .movement-deck #modeButtons {
    display: none;
  }
  .movement-deck .deck-label > span {
    display: none;
  }
  .movement-deck {
    left: 172px;
    right: 120px;
    width: auto;
    max-width: none;
    bottom: 12px;
  }
  .movement-deck .deck-label .text-button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    border: 1px solid #ffffff35;
    border-radius: 9px;
    padding: 8px;
    font-size: 12px;
    background: #142735ed;
  }
  .mission-card {
    width: 208px;
    top: 78px;
  }
  .destination-hud {
    max-width: calc(100% - 232px);
  }
}
@media screen and (max-width: 360px) and (min-height: 541px) {
  .brand {
    font-size: 10px;
    letter-spacing: 0.8px;
  }
  .brand small {
    display: none;
  }
  .brand-mark svg {
    width: 25px;
    height: 25px;
  }
  .top-right .icon-btn {
    min-width: 36px;
  }
  .topbar {
    gap: 2px;
  }
  .top-right {
    gap: 0;
  }
  .xp-pill {
    font-size: 8px;
    padding: 6px;
  }
  .mission-card {
    right: 12px;
    top: 164px;
    width: 206px;
    max-height: calc(100% - var(--bottom-nav) - 360px);
  }
  .destination-hud {
    left: 12px;
  }
  .resource-hud {
    right: 12px;
    gap: 8px;
  }
  .settings-row:has(select) {
    flex-wrap: wrap;
  }
  .settings-row select {
    max-width: none;
    width: 100%;
  }
  .onboard-art {
    max-height: 110px;
  }
  .onboard-copy h2 {
    font-size: 26px;
  }
  .nav-btn {
    font-size: 8px;
  }
  .mode-btn {
    font-size: 9px;
  }
  .movement-deck {
    left: 10px;
    right: 10px;
  }
}
@media screen and (max-width: 640px) and (max-height: 700px) and (max-aspect-ratio: 6/5) {
  .destination-hud p,
  .destination-hud .location,
  .destination-hud .text-button {
    display: none;
  }
  .destination-hud h1 {
    font-size: 32px;
  }
  .mission-card {
    top: 90px;
    max-height: calc(100% - var(--bottom-nav) - 300px);
  }
  .mission-card.is-expanded {
    max-height: calc(100% - var(--bottom-nav) - 222px);
  }
  #mobileControls {
    bottom: calc(var(--bottom-nav) + 104px);
  }
}
@media screen {
  .mode-btn .lock-small svg {
    width: 9px;
    height: 9px;
    margin: 0;
  }
}
@media screen and (max-height: 360px) and (min-aspect-ratio: 6/5) {
  .mission-summary {
    min-height: 30px;
    padding-block: 6px;
  }
  .mission-summary small {
    display: none;
  }
  .mission-tools .mini-btn {
    min-width: 32px;
    min-height: 32px;
  }
}

@media screen and (max-width: 640px) {
  .nav-btn {
    padding: 5px 2px;
  }
}
/* Route guidance stays visible even when the compact radar is hidden. */
@media screen {
  .navigation-hud {
    position: absolute;
    left: 50%;
    bottom: calc(var(--dock) + 138px);
    transform: translateX(-50%);
    width: 360px;
    max-width: calc(100% - 36px);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    z-index: 3;
  }
  .navigation-hud[hidden] {
    display: none;
  }
  .navigation-hud > span {
    color: var(--lime);
    font-size: 26px;
    line-height: 1;
    display: block;
    flex: 0 0 24px;
    text-align: center;
  }
  .navigation-hud > div {
    min-width: 0;
    flex: 1;
  }
  .navigation-hud b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 550;
  }
  .navigation-hud small {
    display: block;
    font-size: 10px;
    color: #a9c1c7;
    line-height: 1.5;
    margin-top: 2px;
  }
  .navigation-hud .primary {
    font-size: 10px;
    padding: 9px 11px;
    flex-shrink: 0;
    min-height: 38px;
  }
}
@media screen and (any-pointer: coarse), screen and (max-width: 640px) {
  .navigation-hud {
    bottom: calc(var(--dock) + var(--bottom-nav) + 226px);
    width: 360px;
  }
  .navigation-hud .primary {
    min-height: 44px;
    font-size: 11px;
  }
  .navigation-hud b {
    font-size: 12px;
  }
  .navigation-hud small {
    font-size: 10px;
  }
}
@media screen and (max-width: 640px) and (max-height: 700px) and (max-aspect-ratio: 6/5) {
  .mission-card:not(.is-expanded) {
    display: none;
  }
  .navigation-hud {
    bottom: calc(var(--bottom-nav) + 222px);
  }
}
@media screen and (max-height: 540px) and (min-aspect-ratio: 6/5) {
  .navigation-hud {
    left: 16px;
    transform: none;
    bottom: 116px;
    width: min(270px, calc(100% - 250px));
    padding: 8px;
  }
  .navigation-hud > span {
    font-size: 21px;
    flex-basis: 17px;
  }
  .navigation-hud b {
    font-size: 11px;
  }
  .navigation-hud small {
    font-size: 9px;
  }
  .navigation-hud .primary {
    font-size: 10px;
    min-height: 38px;
    padding: 8px;
  }
}
@media screen {
  .number-prediction {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    color: var(--lime);
  }
  .number-prediction input {
    width: 110px;
    min-height: 44px;
    padding: 7px 9px;
    background: #0e1d29;
    border: 1px solid #78987e88;
    border-radius: 7px;
    color: var(--lime);
    font-size: 19px;
  }
  .number-prediction small {
    font-size: 12px;
    color: var(--muted);
  }
  .evidence-board {
    display: grid;
    gap: 12px;
  }
  .evidence-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 15px;
    background: #ffffff04;
  }
  .evidence-card p {
    color: #dce8e3;
    font-size: 13px;
    margin-bottom: 12px;
  }
  .category-options {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
  }
  .category-options .secondary {
    font-size: 11px;
    min-height: 40px;
    padding: 9px 12px;
  }
  .category-options .selected {
    background: #c7ee8e20;
    border-color: var(--lime);
    color: var(--lime);
  }
  .evidence-card > small {
    display: block;
    font-size: 11px;
    line-height: 1.7;
    margin-top: 9px;
  }
  .evidence-correct {
    color: var(--lime);
  }
  .evidence-retry {
    color: var(--orange);
  }
  .sequence-slots {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
  }
  .sequence-slot {
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #0f1e29;
  }
  .sequence-slot > span {
    color: var(--lime);
    font-size: 10px;
    flex: 0 0 20px;
  }
  .sequence-slot b {
    font-size: 13px;
    font-weight: 450;
  }
  .sequence-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
  }
  .sequence-cards button {
    min-height: 44px;
    font-size: 12px;
    text-align: left;
  }
  .activity-hint {
    margin-top: 22px;
    color: var(--orange);
    font-size: 12px;
  }
  .activity-hint p {
    font-size: 12px;
    line-height: 1.8;
    margin: 10px 0 0;
  }
}
@media screen and (max-width: 640px) {
  .number-prediction {
    grid-row: 1;
    grid-column: 2;
  }
  .number-prediction input {
    width: 90px;
    font-size: 18px;
  }
  .category-options button {
    flex: 1 1 120px;
    min-height: 44px;
  }
  .sequence-slot b {
    font-size: 12px;
  }
  .evidence-card {
    padding: 13px;
  }
}

@media screen and (max-width: 1200px) {
  .guide-card {
    display: none;
  }
}
@media screen {
  .comparison-readings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0 18px;
  }
  .comparison-readings[hidden] {
    display: none;
  }
  .comparison-readings > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 15px;
    background: #c7ee8e07;
  }
  .comparison-readings small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1px;
  }
  .comparison-readings b {
    display: block;
    font-size: 22px;
    font-weight: 500;
    color: var(--lime);
    margin-top: 4px;
  }
}

/* Engineering workshops use native controls and text equivalents for every diagram. */
.skip-link {
  position: fixed;
  left: 12px;
  top: 8px;
  transform: translateY(-200%);
  z-index: 100;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--lime);
  color: #183123;
  font-size: 14px;
}
.skip-link:focus {
  transform: none;
}
.workshop-tile > span[data-icon] {
  display: block;
  color: var(--lime);
  margin-bottom: 15px;
}
.workshop-tile .primary {
  margin-top: 20px;
  width: 100%;
}
.workshop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 24px;
}
.workshop-toolbar .text-button {
  min-height: 44px;
}
.workshop-controls {
  display: flex;
  gap: 22px;
  align-items: center;
  margin: 22px 0;
  flex-wrap: wrap;
}
.workshop-controls > label {
  flex: 1 1 220px;
  display: grid;
  gap: 10px;
  font-size: 13px;
  color: #dce8df;
}
.workshop-controls select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  background: #223947;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  min-height: 44px;
}
.workshop-controls input[type='range'] {
  min-height: 44px;
  width: 100%;
  accent-color: var(--lime);
}
.workshop-check {
  display: flex !important;
  align-items: center;
  line-height: 1.6;
}
.workshop-check input {
  width: 25px;
  height: 25px;
  accent-color: var(--lime);
  flex-shrink: 0;
}
.workshop-controls output {
  float: right;
  color: var(--lime);
}
.sunlight-comparison {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1c29;
  margin-bottom: 16px;
}
.sunlight-comparison > div {
  display: grid;
  grid-template-columns: 65px 1fr 70px;
  align-items: center;
  gap: 16px;
  min-height: 37px;
  font-size: 12px;
}
.sunlight-comparison i {
  height: 13px;
  border-radius: 5px;
  background: #ffffff08;
  overflow: hidden;
}
.sunlight-comparison b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #d0aa61, var(--lime));
  min-width: 2px;
}
.sunlight-comparison strong {
  font-weight: 500;
  text-align: right;
  color: var(--lime);
}
.power-illustration {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 20px 0;
}
.power-illustration span {
  color: #294254;
  font-size: 38px;
  line-height: 1;
}
.power-illustration .lit {
  color: #8dc5de;
  text-shadow: 0 0 20px #8dc5de44;
}
.rover-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: center;
}
.rover-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 18px;
}
.rover-cell {
  aspect-ratio: 1;
  min-height: 38px;
  border: 1px solid #ffffff20;
  background: #68747c22;
  border-radius: 6px;
  font-size: 23px;
  color: #d0dce1;
  position: relative;
}
.rover-cell.rock {
  background: #17252f;
  color: #7a7e86;
}
.rover-cell.rough {
  background: repeating-linear-gradient(
    45deg,
    #bf9c7122,
    #bf9c7122 4px,
    #bf9c7144 4px,
    #bf9c7144 8px
  );
}
.rover-cell.visited {
  border-color: #c7ee8e80;
  background-color: #c7ee8e25;
  color: var(--lime);
}
.rover-cell.rover-now,
.rover-cell.driving {
  background: var(--lime);
  color: #20312a;
  border-color: var(--lime);
}
.rover-directions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.rover-directions button {
  font-size: 11px;
  min-height: 44px;
}
.forecast {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}
.forecast > span {
  flex: 1;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #9eb4be;
  font-size: 10px;
}
.forecast b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #dce6e4;
  margin-top: 6px;
}
.forecast .current {
  border-color: var(--lime);
  background: #c7ee8e12;
  color: var(--lime);
}
.camp-projection {
  padding: 15px 0;
  font-size: 13px;
  color: #bdd0d2;
  line-height: 1.7;
}
.camp-projection b {
  color: var(--lime);
  font-weight: 500;
}
.workshop-table {
  overflow: auto;
  margin-top: 20px;
}
.workshop-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.workshop-table caption {
  text-align: left;
  color: var(--lime);
  padding-bottom: 12px;
  font-weight: 600;
}
.workshop-table th,
.workshop-table td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}
.workshop-table th {
  font-size: 10px;
  color: #aac0c9;
}
.feedback .primary {
  display: block;
  margin-top: 18px;
}
@media screen and (max-width: 640px) {
  .rover-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .rover-cell {
    min-height: 30px;
    font-size: 20px;
  }
  .rover-grid {
    gap: 4px;
  }
  .workshop-controls {
    gap: 14px;
  }
  .sunlight-comparison {
    padding: 12px;
  }
  .sunlight-comparison > div {
    gap: 10px;
    grid-template-columns: 55px 1fr 56px;
  }
  .power-illustration {
    gap: 4px;
  }
  .power-illustration span {
    font-size: 29px;
  }
  .forecast {
    gap: 5px;
  }
  .forecast > span {
    padding: 10px 7px;
  }
  .forecast b {
    font-size: 11px;
  }
  .workshop-table th,
  .workshop-table td {
    padding: 10px 5px;
    font-size: 10px;
  }
}

/* Living expeditions: responsive systems, original learning activities and flight deck. */
#weatherFX {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
#weatherBadge[role='button'] {
  cursor: pointer;
}
#weatherBadge:focus-visible {
  outline: 2px solid #c7ee8e;
  outline-offset: 4px;
}
.weather-badge.is-alert {
  color: #ffe0b3;
  background: #29313de8;
  border: 1px solid #d8ac72;
}
.ex-crew {
  position: absolute;
  left: 28px;
  top: 290px;
  z-index: 6;
  display: grid;
  gap: 4px;
  text-align: left;
  background: #102532e8;
  border: 1px solid #71929855;
  border-radius: 12px;
  padding: 12px 15px;
  color: #e0eee9;
  box-shadow: 0 8px 30px #07101c20;
  cursor: pointer;
  min-width: 190px;
}
.ex-crew span {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #9fced7;
}
.ex-crew b {
  font-size: 12px;
}
.ex-crew i {
  font-style: normal;
  color: #6c9399;
  padding: 0 5px;
}
.ex-crew small {
  font-size: 9px;
  letter-spacing: 0.5px;
  color: #b6ccc9;
}
.ex-crew.is-danger {
  border-color: #e9aa81;
  color: #ffd1b4;
}
.ex-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 24px;
}
.ex-nav button {
  padding: 9px 13px;
  font-size: 12px;
}
.ex-inventory {
  padding: 15px;
  border: 1px solid #a9c5ca22;
  border-radius: 10px;
  color: #c7ee8e;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.7;
}
.ex-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 18px 0;
}
.ex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}
.ex-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ex-columns > * {
  min-width: 0;
}
.ex-grid .tile,
.ex-columns .tile {
  min-width: 0;
  padding: 22px;
}
.ex-meter {
  margin: 15px 0;
}
.ex-meter > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #bed1d6;
  margin-bottom: 7px;
}
.ex-meter b {
  color: #e7f3e8;
}
.ex-meter progress,
.ex-grid progress,
.ex-flight-caption progress {
  width: 100%;
  height: 7px;
  accent-color: #c7ee8e;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #29414c;
}
.ex-meter progress::-webkit-progress-bar,
.ex-grid progress::-webkit-progress-bar,
.ex-flight-caption progress::-webkit-progress-bar {
  background: #29414c;
}
.ex-meter progress::-webkit-progress-value,
.ex-grid progress::-webkit-progress-value,
.ex-flight-caption progress::-webkit-progress-value {
  background: #c7ee8e;
}
.ex-range {
  display: grid;
  gap: 10px;
  font-size: 13px;
  margin: 18px 0;
}
.ex-range input {
  width: 100%;
  accent-color: #c7ee8e;
  min-height: 28px;
}
.ex-range output {
  font-size: 12px;
  color: #c7ee8e;
}
.ex-check {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
  font-size: 13px;
}
.ex-check input {
  width: 18px;
  height: 18px;
  accent-color: #c7ee8e;
}
.ex-big-stat strong {
  display: block;
  font-size: 36px;
  letter-spacing: -1px;
  color: #c7ee8e;
  margin: 12px 0;
}
.ex-big-stat small {
  font-size: 10px;
  letter-spacing: 1.5px;
}
.ex-big-stat p {
  margin-bottom: 0;
}
.ex-source {
  font-size: 11px;
  color: #9dcfda;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ex-guide-callout {
  border: 1px solid #7faab344;
  background: linear-gradient(110deg, #243e4433, #162b3a88);
  padding: 22px;
  border-radius: 14px;
  margin-top: 24px;
}
.ex-guide-callout p {
  font-size: 13px;
  line-height: 1.7;
  color: #b6cbd1;
}
.ex-guide-callout .ex-nav {
  margin-bottom: 0;
}
.ex-module-icon {
  font-size: 29px;
  color: #c7ee8e;
}
.ex-weather-card {
  border-top: 3px solid var(--hazard) !important;
}
.ex-question {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #b2d0d422;
  font-size: 13px;
}
.ex-question .button-row {
  margin-top: 15px;
}
.ex-build-toolbar {
  position: absolute;
  z-index: 16;
  left: 50%;
  bottom: 235px;
  transform: translateX(-50%);
  width: min(650px, calc(100% - 30px));
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 15px;
  border-radius: 12px;
}
.ex-build-toolbar[hidden] {
  display: none;
}
.ex-build-toolbar span {
  flex: 1;
  font-size: 12px;
  line-height: 1.5;
}
.ex-build-toolbar button {
  flex-shrink: 0;
  padding: 10px;
  font-size: 12px;
}
.ex-starfield {
  position: relative;
  aspect-ratio: 4/3;
  background: #0a1523;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #8ca9bf44;
}
.ex-starfield > svg {
  display: block;
  width: 100%;
  height: 100%;
}
.ex-star {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #fff6ce;
  cursor: pointer;
  opacity: 1 !important;
  padding: 0;
}
.ex-star span {
  font-size: 19px;
  filter: drop-shadow(0 0 5px #f2de97);
}
.ex-star small {
  position: absolute;
  top: 31px;
  font-size: 8px;
  color: #b8c9d7;
  white-space: nowrap;
  text-shadow: 0 1px 3px #07111d;
}
.ex-star:disabled {
  cursor: default;
}
.ex-star:focus-visible {
  outline: 2px solid #c7ee8e;
  border-radius: 50%;
}
.ex-success {
  color: #c7ee8e !important;
}
.ex-rock-stage {
  height: 190px;
  border: 1px solid #91aeb722;
  background: radial-gradient(#314b5f, #11202f);
  border-radius: 10px;
}
.ex-rock-stage svg {
  height: 100%;
  width: 100%;
}
.ex-readings {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 12px;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 24px;
}
.ex-readings dt {
  color: #91aeb9;
}
.ex-readings dd {
  margin: 0;
  color: #d1e0df;
}
.ex-classification {
  padding: 14px 0;
  border-bottom: 1px solid #b3cbd022;
}
.ex-classification b {
  font-size: 14px;
}
.ex-classification p {
  font-size: 12px !important;
  margin: 6px 0 10px !important;
}
.ex-wave {
  height: 80px;
  display: grid;
  place-items: center;
  font-size: 55px;
  color: #a1d8dc;
  letter-spacing: 6px;
  overflow: hidden;
}
.ex-ship-mark {
  height: 100px;
  display: grid;
  place-items: center;
  font-size: 80px;
  color: #acd9df;
  background: radial-gradient(#35586d66, transparent);
}
.ex-transit {
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: #07121f;
  color: #edf3ec;
  overflow: hidden;
}
.ex-transit::backdrop {
  background: #07121f;
}
.ex-transit canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.ex-flight-caption {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 40px));
  background: linear-gradient(#102330f0, #102330fa);
  border: 1px solid #8bc2d033;
  border-radius: 18px;
  padding: 24px;
  text-align: center;
}
.ex-flight-caption h2 {
  font-size: 28px;
  letter-spacing: -1px;
  margin: 8px 0;
}
.ex-flight-caption h2 span {
  color: #b9ebd2;
}
.ex-flight-caption p {
  color: #b6ccd3;
  line-height: 1.6;
  font-size: 13px;
  margin: 12px 0;
}
.ex-flight-caption .button-row {
  justify-content: center;
}
.ex-flight-caption .button-row button {
  min-height: 44px;
}
.ex-flight-caption progress {
  height: 4px;
}
.ex-flight-caption .small {
  font-size: 11px;
}
.ex-columns label select {
  max-width: 100%;
}
@media (min-width: 1700px) {
  .ex-crew {
    left: 38px;
    top: 305px;
  }
}
@media (max-width: 1200px) {
  .ex-crew {
    top: 270px;
    left: 22px;
    min-width: 170px;
    padding: 10px;
  }
  .ex-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1024px) {
  .ex-crew {
    top: auto;
    bottom: 305px;
    left: 20px;
    min-width: 160px;
  }
  .ex-crew small {
    font-size: 8px;
  }
  .ex-build-toolbar {
    bottom: 230px;
  }
  .ex-columns {
    grid-template-columns: 1fr;
  }
  .ex-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .ex-crew {
    top: 117px;
    bottom: auto;
    left: 14px;
    right: 14px;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    padding: 7px 10px;
    border-radius: 8px;
  }
  .ex-crew span {
    font-size: 8px;
    letter-spacing: 0.4px;
  }
  .ex-crew b {
    font-size: 9px;
  }
  .ex-crew small {
    font-size: 8px;
    letter-spacing: 0;
  }
  .ex-grid,
  .ex-grid.three {
    grid-template-columns: 1fr;
  }
  .ex-nav {
    gap: 6px;
    margin: 14px 0 18px;
  }
  .ex-nav button {
    font-size: 11px;
    padding: 8px 10px;
    min-height: 38px;
  }
  .ex-columns .tile,
  .ex-grid .tile {
    padding: 18px;
  }
  .ex-build-toolbar {
    bottom: 245px;
    flex-wrap: wrap;
    padding: 12px;
  }
  .ex-build-toolbar span {
    flex-basis: 100%;
  }
  .ex-flight-caption {
    padding: 18px;
    bottom: 16px;
  }
  .ex-flight-caption h2 {
    font-size: 23px;
  }
  .ex-flight-caption p {
    font-size: 12px;
  }
  .ex-flight-caption .small {
    font-size: 10px;
  }
  .ex-guide-callout {
    padding: 18px;
  }
  .ex-inventory {
    font-size: 12px;
  }
  .ex-star small {
    font-size: 7px;
  }
  .deck-label {
    gap: 8px;
  }
  .deck-label > span {
    margin-right: auto;
  }
}
@media (max-height: 540px) and (orientation: landscape) {
  .ex-crew {
    display: none;
  }
  .ex-flight-caption {
    left: auto;
    right: 16px;
    transform: none;
    width: 320px;
    padding: 14px;
    bottom: 16px;
  }
  .ex-flight-caption h2 {
    font-size: 20px;
  }
  .ex-flight-caption .small {
    font-size: 9px;
    margin: 6px 0;
  }
  .ex-flight-caption .eyebrow {
    font-size: 8px;
  }
  .ex-build-toolbar {
    bottom: 90px;
  }
  .ex-flight-caption p {
    margin: 6px 0;
  }
}
#interaction.ex-with-navigation {
  margin-bottom: 78px;
}
@media (max-width: 700px) {
  .ex-crew small {
    max-width: 120px;
    font-size: 7px;
  }
  .ex-crew b {
    white-space: nowrap;
  }
  .ex-crew span {
    white-space: nowrap;
  }
  .ex-crew.is-danger {
    background: #3b2b27ed;
  }
}
.world-label.is-refuge .label-name {
  color: #a9f2ff;
  background: #103b4be8;
  border-color: #69d7eaaa;
}
.ex-transit button:focus-visible {
  outline: 2px solid #c7ee8e;
  outline-offset: 4px;
}

/* Cosmic Frontier: full-viewport streamed open world and service interfaces. */
body.frontier-active > .topbar,
body.frontier-active > .sidebar,
body.frontier-active > #gameShell,
body.frontier-active > .skip-link {
  visibility: hidden;
  pointer-events: none;
}
#frontier {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: #091522;
  width: 100%;
  height: 100dvh;
  color: #edf3ec;
}
#frontier[hidden] {
  display: none;
}
#frontierCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline-offset: -3px;
}
#fLabels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.f-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(#08142199, transparent 24%, transparent 65%, #081421bb),
    radial-gradient(ellipse at 50% 50%, transparent 35%, #07121b55);
}
.f-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 max(28px, env(safe-area-inset-left));
  border-bottom: 1px solid #b4d3dd1a;
  background: #101f2ade;
  z-index: 3;
}
.f-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  flex-shrink: 0;
}
.f-brand > span {
  font-size: 35px;
  color: #c7ee8e;
}
.f-brand b {
  font-size: 15px;
  letter-spacing: 2px;
}
.f-brand em {
  font-weight: 400;
  font-style: normal;
}
.f-brand small {
  display: block;
  font-size: 6px;
  letter-spacing: 2.5px;
  color: #a9c3d0;
  margin-top: 4px;
}
.f-top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.f-top-actions button {
  border: 1px solid #a1c1d233;
  border-radius: 9px;
  min-width: 38px;
  min-height: 38px;
  background: #19313b77;
}
.f-top-actions button:hover {
  background: #2b4d5c;
}
#fCoordinates {
  color: #a1bdca;
  font-size: 10px;
  letter-spacing: 1px;
}
.f-zone {
  position: absolute;
  left: 30px;
  top: 100px;
  max-width: 420px;
  pointer-events: none;
}
.f-zone > span {
  font-size: 9px;
  letter-spacing: 2px;
  color: #b7d5db;
}
.f-zone h1 {
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1.05;
  letter-spacing: -2px;
  margin: 12px 0;
}
.f-zone p {
  color: #b6cbd3;
  font-size: 11px;
  margin: 8px 0;
}
.f-zone button {
  pointer-events: auto;
  font-size: 10px;
  margin-top: 2px;
}
.f-vitals {
  position: absolute;
  right: 28px;
  top: 100px;
  width: 300px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid #a0ced133;
  border-radius: 13px;
  text-align: left;
}
.f-vitals > span {
  font-size: 8px;
  letter-spacing: 1px;
  color: #9cb7c7;
}
.f-vitals b {
  display: block;
  font-size: 19px;
  letter-spacing: -0.5px;
  color: #d4efc6;
  margin-top: 4px;
}
.f-vitals small {
  grid-column: 1/-1;
  color: #abc6ce;
  font-size: 9px;
  letter-spacing: 0.7px;
}
.f-tutorial {
  position: absolute;
  left: 30px;
  bottom: 220px;
  width: 260px;
  padding: 18px;
  border: 1px solid #b7d5d124;
  border-radius: 14px;
}
.f-tutorial b {
  display: block;
  margin-top: 10px;
  font-size: 15px;
}
.f-tutorial p {
  font-size: 12px;
  color: #aec7ce;
  line-height: 1.6;
  margin: 8px 0 14px;
}
.f-tutorial button {
  font-size: 11px;
  padding: 10px 12px;
  min-height: 38px;
}
.f-tutorial .eyebrow {
  font-size: 8px;
}
.f-target {
  position: absolute;
  right: 28px;
  top: 230px;
  width: 300px;
  padding: 20px;
  border: 1px solid #b7d5d124;
  border-radius: 14px;
}
.f-target h3 {
  font-size: 18px;
  line-height: 1.3;
  margin: 10px 0;
}
.f-target p {
  font-size: 12px;
  line-height: 1.6;
  color: #acc6cd;
  margin: 9px 0;
}
.f-target .eyebrow {
  font-size: 8px;
}
.f-target button {
  font-size: 11px;
  min-height: 38px;
  padding: 9px 12px;
}
.f-target .button-row {
  gap: 8px;
}
.f-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px;
  font-weight: 200;
  color: #cee2e14a;
  pointer-events: none;
}
.f-alert {
  position: absolute;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 680px));
  background: #43382cd9;
  border: 1px solid #dfb77d66;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-align: center;
  color: #ffe0ab;
  line-height: 1.6;
}
.f-alert[hidden] {
  display: none;
}
.f-route {
  position: absolute;
  bottom: 202px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #aed5bb44;
  padding: 10px 15px;
  border-radius: 9px;
  font-size: 11px;
  color: #c7ee8e;
  max-width: calc(100% - 650px);
  text-align: center;
  line-height: 1.6;
}
.f-route[hidden] {
  display: none;
}
.f-tools {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: #102532ef;
  backdrop-filter: none;
  border: 1px solid #b0ccda33;
  padding: 7px;
  border-radius: 15px;
  gap: 5px;
  box-shadow: 0 16px 40px #0003;
}
.f-tools button {
  width: 85px;
  min-height: 73px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #b9d5dc;
  border-radius: 9px;
  font-size: 21px;
  position: relative;
}
.f-tools button > span {
  font-size: 10px;
}
.f-tools button > kbd {
  position: absolute;
  top: 4px;
  left: 7px;
  font-size: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: #718d9d;
}
.f-tools button:hover,
.f-tools button.active {
  background: #c7ee8e;
  color: #203b35;
}
.f-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 54px;
  padding: 8px max(24px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom));
  background: #10202fe8;
  border-top: 1px solid #9fbdc922;
  display: flex;
  align-items: center;
  gap: 18px;
}
.f-footer > span {
  font-size: 9px;
  letter-spacing: 0.7px;
  color: #c2d5d9;
  white-space: nowrap;
}
.f-footer > div {
  display: flex;
  gap: 4px;
}
.f-footer button {
  font-size: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #9cbdca33;
  min-height: 34px;
}
.f-footer > button {
  margin-left: auto;
}
.f-world-label {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 5px 8px;
  white-space: nowrap;
  border: 1px solid #bdd4d338;
  background: #102330d9;
  border-radius: 5px;
  color: #d4e5de;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f-world-label.service {
  color: #a3e5ef;
  border-color: #6cc6d955;
}
.f-world-label.site {
  color: #dacaf0;
}
.f-world-label[hidden] {
  display: none;
}
#fRadar {
  position: absolute;
  right: 28px;
  bottom: 192px;
  width: 185px;
  height: 158px;
  border: 1px solid #8fb2c533;
  border-radius: 12px;
  background: #102333dd;
  opacity: 0.85;
}
#fTouch {
  display: none;
}
#fToasts {
  position: absolute;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, calc(100% - 36px));
  display: grid;
  gap: 8px;
  z-index: 12;
  pointer-events: none;
}
#fToasts .toast {
  position: static;
  min-width: 0;
  width: 100%;
  font-size: 12px;
  box-shadow: 0 8px 28px #0004;
}
.f-map-banner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border: 1px solid #87b5ca33;
  background: radial-gradient(ellipse at 90% 30%, #3e627c55, transparent), #112531;
  border-radius: 15px;
  margin-bottom: 22px;
}
.f-map-banner > div:first-child {
  flex: 1;
  min-width: 0;
}
.f-map-banner h3 {
  font-size: 20px;
  margin: 10px 0;
}
.f-map-banner p {
  font-size: 12px;
  color: #aac4ce;
  line-height: 1.7;
}
.f-map-orbit {
  position: relative;
  width: 150px;
  height: 130px;
  flex: 0 0 150px;
  display: grid;
  place-items: center;
}
.f-map-orbit span {
  font-size: 38px;
  color: #c7ee8e;
}
.f-map-orbit i {
  position: absolute;
  border: 1px solid #9fc7d144;
  border-radius: 50%;
  width: 100%;
  height: 55%;
  transform: rotate(-30deg);
}
.f-map-orbit i:nth-child(3) {
  width: 74%;
  height: 40%;
}
.f-map-orbit i:nth-child(4) {
  width: 45%;
  height: 25%;
}
.f-map-controls {
  display: flex;
  gap: 16px;
  margin: 20px 0;
}
.f-map-controls label {
  display: grid;
  gap: 7px;
  font-size: 11px;
  color: #b7ccd4;
  flex: 1;
}
.f-map-controls input,
.f-map-controls select {
  width: 100%;
  min-height: 44px;
  background: #1a3040;
  color: #edf3ec;
  border: 1px solid #adcbd433;
  border-radius: 8px;
  padding: 10px 12px;
}
.f-zone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.f-zone-tile {
  border: 1px solid #adcbd422;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #1a2e3a44;
  min-width: 0;
}
.f-zone-tile[hidden] {
  display: none;
}
.f-card-world {
  position: relative;
  min-height: 125px;
  background: radial-gradient(ellipse at 65% 35%, #42617d55, transparent), #0c1e2c;
  overflow: hidden;
}
.f-card-world .pill {
  position: absolute;
  left: 12px;
  top: 13px;
  font-size: 7px;
  z-index: 1;
}
.f-card-world > i,
.f-brief-world > i {
  position: absolute;
  display: block;
  width: 115px;
  height: 115px;
  border-radius: 50%;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  background: radial-gradient(circle at 28% 25%, var(--world), #112532 85%);
  box-shadow: 0 0 50px #96c9df18;
}
.f-card-world > i.field {
  border-radius: 35% 55% 40% 60%;
  width: 90px;
  height: 80px;
  bottom: -10px;
  box-shadow:
    60px -40px 0 -25px var(--world),
    -85px 10px 0 -28px var(--world);
}
.f-card-copy {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.f-card-copy h3 {
  font-size: 20px;
  line-height: 1.25;
  margin: 8px 0;
}
.f-card-copy p {
  font-size: 12px;
  line-height: 1.65;
  color: #a7c1cc;
  margin: 8px 0 18px;
  flex: 1;
}
.f-card-copy .small {
  font-size: 9px;
}
.f-card-copy button {
  font-size: 11px;
  align-self: flex-start;
}
.f-visited {
  font-size: 12px;
  color: #c7ee8e;
}
.f-brief-world {
  height: 190px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(#34557277, #091d2c);
  border-radius: 10px;
  margin-bottom: 22px;
}
.f-brief-world > i {
  width: 165px;
  height: 165px;
  bottom: -25px;
}
.f-guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.f-guide-steps b {
  color: #c7ee8e;
  font-size: 15px;
}
.f-guide-steps p {
  color: #b3c8d1;
  font-size: 13px;
  line-height: 1.7;
}
.f-station-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #d2ae6b55;
  background: #3c322c66;
  border-radius: 10px;
  padding: 15px;
  margin: 18px 0;
}
.f-station-status.ready {
  border-color: #99bf7455;
  background: #597e4522;
}
.f-station-status > span {
  font-size: 10px;
  letter-spacing: 1px;
}
.f-station-status button {
  font-size: 11px;
  padding: 9px 12px;
}
.f-market-list {
  border: 1px solid #acc7d422;
  border-radius: 12px;
  overflow: hidden;
}
.f-market-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px;
  border-bottom: 1px solid #acc7d415;
}
.f-market-row:last-child {
  border: 0;
}
.f-market-row > i {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  flex: 0 0 24px;
}
.f-market-row > div:first-of-type {
  flex: 1;
  min-width: 0;
}
.f-market-row b {
  font-size: 13px;
}
.f-market-row small {
  display: block;
  font-size: 10px;
  color: #a2bcc8;
  margin-top: 4px;
}
.f-market-row button {
  font-size: 11px;
  padding: 8px 11px;
  min-height: 36px;
}
.f-market-row .button-row {
  margin: 0;
  gap: 7px;
}
.f-cargo-list {
  display: grid;
  gap: 0;
}
.f-cargo-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #abc8d01a;
  font-size: 12px;
}
.f-cargo-list b {
  color: #c7ee8e;
}
.f-nearby-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.f-nearby-list .tile {
  padding: 19px;
}
.f-nearby-list h3 {
  margin: 12px 0;
  font-size: 18px;
}
.f-nearby-list p {
  font-size: 12px;
  line-height: 1.6;
}
.f-instrument > svg {
  width: 100%;
  display: block;
  aspect-ratio: 500/220;
}
.f-instrument p {
  font-size: 12px !important;
  line-height: 1.6 !important;
}
.f-antenna-art {
  font-size: 80px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  color: #a6dbe3;
  min-height: 170px;
  background: radial-gradient(#314b68, #102332);
  border-radius: 12px;
}
.f-antenna-art > span {
  font-size: 40px;
  color: #c7ee8e;
}
.f-reading {
  padding: 15px;
  background: #102534;
  border: 1px solid #9ebdce22;
  border-radius: 10px;
}
.f-reading p {
  font-size: 12px !important;
  margin: 12px 0 0 !important;
}
.f-onboard-choice {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid #adc6d022;
  padding-top: 18px;
  margin-top: 22px;
}
.f-onboard-choice button {
  font-size: 12px;
}
.ex-transit {
  z-index: 30;
}
@media (max-width: 1250px) {
  .f-zone {
    left: 22px;
    top: 98px;
    max-width: 350px;
  }
  .f-vitals {
    width: 270px;
    right: 22px;
  }
  .f-target {
    width: 270px;
    right: 22px;
  }
  .f-tutorial {
    left: 22px;
    width: 230px;
    bottom: 198px;
  }
  .f-tools button {
    width: 74px;
    min-height: 64px;
  }
  .f-tools {
    bottom: 66px;
  }
  .f-route {
    max-width: calc(100% - 570px);
    bottom: 180px;
  }
  #fRadar {
    width: 150px;
    height: 128px;
    right: 22px;
    bottom: 182px;
  }
  .f-alert {
    top: 82px;
    width: min(470px, calc(100% - 580px));
    font-size: 9px;
  }
  .f-zone h1 {
    font-size: 43px;
  }
  .f-footer {
    gap: 12px;
  }
  .f-footer button {
    font-size: 9px;
    padding: 7px;
  }
  .f-world-label {
    font-size: 8px;
  }
}
@media (max-width: 1024px) {
  #fCoordinates {
    display: none;
  }
  .f-target {
    top: 214px;
  }
  .f-zone h1 {
    font-size: 36px;
  }
  .f-tutorial {
    width: 215px;
    bottom: 250px;
    padding: 14px;
  }
  .f-tutorial p {
    font-size: 11px;
  }
  .f-tutorial button {
    font-size: 10px;
  }
  .f-route {
    bottom: 170px;
    max-width: calc(100% - 440px);
    font-size: 10px;
  }
  .f-alert {
    top: 77px;
    width: calc(100% - 30px);
    font-size: 9px;
    padding: 6px;
  }
  #fRadar {
    display: none;
  }
  .f-tools button {
    width: 67px;
    min-height: 60px;
  }
  .f-footer > span {
    font-size: 8px;
  }
  .f-footer {
    padding-inline: 14px;
    gap: 8px;
  }
  .f-footer button {
    font-size: 8px;
    padding: 6px;
  }
  .f-vitals {
    padding: 12px;
    gap: 8px;
  }
  .f-vitals b {
    font-size: 16px;
  }
  .f-vitals small {
    font-size: 8px;
  }
  .f-zone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .f-target h3 {
    font-size: 16px;
  }
  .f-target p {
    font-size: 11px;
  }
  .f-map-banner {
    padding: 20px;
  }
}
@media (any-pointer: coarse) {
  #fTouch {
    display: flex;
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 190px;
    justify-content: space-between;
    pointer-events: none;
  }
  .f-dpad,
  .f-height {
    pointer-events: auto;
  }
  .f-dpad {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(2, 44px);
    gap: 5px;
  }
  .f-dpad button:first-child {
    grid-column: 2;
  }
  .f-dpad button:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }
  .f-dpad button:nth-child(3) {
    grid-row: 2;
    grid-column: 2;
  }
  .f-dpad button:nth-child(4) {
    grid-row: 2;
    grid-column: 3;
  }
  .f-height {
    display: grid;
    grid-template-columns: repeat(2, 44px);
    gap: 5px;
  }
  .f-height button:last-child {
    grid-column: 1/3;
  }
  .f-dpad button,
  .f-height button {
    border: 1px solid #a2c9da66;
    border-radius: 10px;
    background: #173248eb;
    min-height: 44px;
    min-width: 44px;
    font-size: 21px;
    padding: 3px;
    line-height: 1;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .f-height small {
    display: block;
    font-size: 8px;
    margin-top: 3px;
  }
  .f-tutorial {
    bottom: 315px;
  }
  .f-height button.is-held,
  .f-dpad button.is-held {
    background: #c7ee8e;
    color: #263d35;
  }
  .f-route {
    bottom: 300px;
  }
  .f-tools {
    bottom: 72px;
  }
}
@media (max-width: 700px) {
  .f-top {
    height: 60px;
    padding: 0 max(14px, env(safe-area-inset-left));
    gap: 10px;
  }
  .f-brand {
    gap: 8px;
    padding: 0;
  }
  .f-brand > span {
    font-size: 28px;
  }
  .f-brand b {
    font-size: 11px;
    letter-spacing: 1.1px;
  }
  .f-brand small {
    font-size: 5px;
    letter-spacing: 1.5px;
  }
  .f-top-actions {
    gap: 5px;
  }
  .f-top-actions button {
    min-width: 32px;
    min-height: 34px;
    font-size: 11px;
  }
  .f-top-actions button:first-child {
    padding: 0 8px;
  }
  .f-zone {
    left: 14px;
    right: 14px;
    top: 77px;
    max-width: none;
    pointer-events: none;
  }
  .f-zone > span {
    font-size: 7px;
    letter-spacing: 1.2px;
  }
  .f-zone h1 {
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -1px;
    margin: 8px 0;
  }
  .f-zone p {
    font-size: 9px;
    margin: 5px 0;
  }
  .f-zone button {
    display: none;
  }
  .f-vitals {
    left: 14px;
    right: 14px;
    top: 176px;
    width: auto;
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px;
  }
  .f-vitals > span {
    font-size: 6px;
    letter-spacing: 0.5px;
  }
  .f-vitals b {
    font-size: 12px;
    display: inline;
    margin-left: 3px;
    letter-spacing: 0;
  }
  .f-vitals small {
    display: none;
  }
  .f-target {
    right: 14px;
    left: 14px;
    top: 226px;
    width: auto;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 8px;
    border-radius: 10px;
  }
  .f-target > .eyebrow {
    font-size: 6px;
    grid-column: 1/-1;
    letter-spacing: 0.8px;
  }
  .f-target h3 {
    font-size: 13px;
    margin: 3px 0;
    line-height: 1.3;
  }
  .f-target p {
    font-size: 9px;
    margin: 2px 0;
  }
  .f-target > p:last-of-type {
    grid-column: 1/-1;
    font-size: 8px;
  }
  .f-target .button-row {
    grid-column: 2;
    grid-row: 2/4;
    align-self: center;
    gap: 4px;
    margin: 0;
  }
  .f-target button {
    font-size: 9px;
    padding: 7px;
    min-height: 34px;
  }
  .f-target > button {
    grid-column: 2;
    grid-row: 2/4;
  }
  .f-tutorial {
    left: 14px;
    right: 14px;
    width: auto;
    bottom: 218px;
    padding: 9px 12px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 8px;
  }
  .f-tutorial > .eyebrow {
    font-size: 6px;
    letter-spacing: 0.6px;
  }
  .f-tutorial b {
    font-size: 11px;
    margin: 3px 0;
  }
  .f-tutorial p {
    font-size: 9px;
    line-height: 1.4;
    margin: 0;
    max-width: 235px;
    grid-column: 1;
  }
  .f-tutorial button {
    grid-column: 2;
    grid-row: 1/4;
    align-self: center;
    min-height: 34px;
    font-size: 9px;
    padding: 7px;
    max-width: 100px;
  }
  .f-tools {
    left: 10px;
    right: 10px;
    bottom: 69px;
    transform: none;
    padding: 4px;
    gap: 1px;
    border-radius: 11px;
    justify-content: space-around;
  }
  .f-tools button {
    flex: 1;
    min-width: 0;
    width: auto;
    min-height: 48px;
    font-size: 17px;
    gap: 3px;
  }
  .f-tools button > span {
    font-size: 8px;
  }
  .f-tools button > kbd {
    display: none;
  }
  .f-footer {
    min-height: 58px;
    flex-wrap: wrap;
    gap: 5px;
    padding: 6px 12px max(7px, env(safe-area-inset-bottom));
  }
  .f-footer > span {
    font-size: 7px;
    flex: 1;
  }
  .f-footer > div {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 5px;
  }
  .f-footer button {
    font-size: 7px;
    min-height: 24px;
    padding: 4px 7px;
  }
  .f-footer > button {
    font-size: 7px;
    min-height: 24px;
  }
  .f-route {
    bottom: 315px;
    max-width: calc(100% - 28px);
    width: calc(100% - 28px);
    font-size: 8px;
    padding: 6px;
    line-height: 1.5;
  }
  .f-alert {
    top: 151px;
    width: calc(100% - 28px);
    font-size: 7px;
    line-height: 1.3;
    padding: 4px 7px;
    border-radius: 5px;
  }
  .f-crosshair {
    font-size: 20px;
  }
  .f-world-label {
    font-size: 7px;
    padding: 4px 6px;
    max-width: 150px;
  }
  .f-map-banner {
    padding: 16px;
    gap: 12px;
  }
  .f-map-banner h3 {
    font-size: 18px;
  }
  .f-map-banner p {
    font-size: 11px;
  }
  .f-map-orbit {
    width: 60px;
    flex-basis: 60px;
    height: 95px;
  }
  .f-map-controls {
    gap: 10px;
  }
  .f-map-controls label {
    font-size: 10px;
  }
  .f-map-controls > label:first-child {
    flex: 1.3;
  }
  .f-map-controls input,
  .f-map-controls select {
    font-size: 11px;
    padding: 8px;
  }
  .f-zone-grid {
    gap: 12px;
  }
  .f-card-world {
    min-height: 90px;
  }
  .f-card-world .pill {
    left: 8px;
    top: 8px;
    font-size: 5px;
    padding: 4px;
  }
  .f-card-world > i {
    width: 90px;
    height: 90px;
  }
  .f-card-copy {
    padding: 12px;
  }
  .f-card-copy h3 {
    font-size: 16px;
  }
  .f-card-copy .small {
    font-size: 8px;
  }
  .f-card-copy p {
    font-size: 10px;
    line-height: 1.6;
  }
  .f-card-copy button {
    font-size: 9px;
    padding: 8px 9px;
    min-height: 36px;
  }
  .f-guide-steps,
  .f-nearby-list {
    grid-template-columns: 1fr;
  }
  .f-market-row {
    flex-wrap: wrap;
    padding: 12px;
    gap: 10px;
  }
  .f-market-row > div:first-of-type {
    flex-basis: calc(100% - 40px);
  }
  .f-market-row .button-row {
    margin-left: 34px;
    flex-wrap: nowrap;
  }
  .f-market-row button {
    font-size: 10px;
    min-height: 36px;
  }
  .f-station-status {
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    flex-wrap: wrap;
  }
  .f-station-status > span {
    font-size: 9px;
  }
  .f-onboard-choice {
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
  }
  .f-onboard-choice button {
    font-size: 10px;
    min-height: 38px;
    padding: 8px 11px;
  }
  .f-antenna-art {
    font-size: 50px;
    min-height: 130px;
  }
  #fToasts {
    top: 65px;
    width: calc(100% - 24px);
  }
  #fToasts .toast {
    font-size: 10px;
    padding: 11px;
  }
  #fTouch {
    display: flex;
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 127px;
    justify-content: space-between;
    pointer-events: none;
  }
  .f-dpad,
  .f-height {
    pointer-events: auto;
  }
  .f-dpad {
    display: grid;
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(2, 40px);
    gap: 5px;
  }
  .f-dpad button:first-child {
    grid-column: 2;
  }
  .f-dpad button:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }
  .f-dpad button:nth-child(3) {
    grid-row: 2;
    grid-column: 2;
  }
  .f-dpad button:nth-child(4) {
    grid-row: 2;
    grid-column: 3;
  }
  .f-height {
    display: grid;
    grid-template-columns: repeat(2, 40px);
    gap: 5px;
  }
  .f-height button:last-child {
    grid-column: 1/3;
  }
  .f-dpad button,
  .f-height button {
    border: 1px solid #9ac3d077;
    border-radius: 9px;
    background: #132d40eb;
    min-height: 40px;
    min-width: 40px;
    font-size: 20px;
    padding: 3px;
    line-height: 1;
    touch-action: none;
    user-select: none;
  }
  .f-height small {
    display: block;
    font-size: 7px;
    margin-top: 3px;
  }
  .f-dpad button.is-held,
  .f-height button.is-held {
    background: #c7ee8e;
    color: #20362c;
  }
}
@media (max-width: 380px) {
  .f-zone h1 {
    font-size: 26px;
  }
  .f-vitals {
    gap: 5px;
    padding-inline: 9px;
  }
  .f-vitals > span {
    font-size: 5px;
  }
  .f-vitals b {
    font-size: 10px;
  }
  .f-target h3 {
    font-size: 11px;
  }
  .f-tutorial p {
    font-size: 8px;
    max-width: 180px;
  }
  .f-target button {
    font-size: 8px;
  }
  .f-zone-grid {
    grid-template-columns: 1fr;
  }
  .f-card-world {
    min-height: 115px;
  }
  .f-card-copy h3 {
    font-size: 20px;
  }
  .f-card-copy p {
    font-size: 12px;
  }
  .f-card-copy button {
    font-size: 11px;
  }
  .f-map-orbit {
    display: none;
  }
}
@media (max-height: 700px) and (min-width: 701px) {
  .f-tutorial {
    bottom: 158px;
    padding: 12px;
  }
  .f-tutorial p {
    font-size: 10px;
    margin: 6px 0;
  }
  .f-tutorial b {
    font-size: 12px;
  }
  .f-target {
    top: 205px;
    padding: 15px;
  }
  .f-target p {
    font-size: 10px;
  }
  .f-target h3 {
    font-size: 15px;
  }
  #fRadar {
    display: none;
  }
  .f-zone h1 {
    font-size: 37px;
  }
  .f-route {
    bottom: 155px;
  }
  .f-tools button {
    min-height: 55px;
  }
  .f-tools {
    bottom: 62px;
  }
}
@media (max-height: 650px) and (max-width: 700px) and (orientation: portrait) {
  .f-zone {
    top: 70px;
  }
  .f-zone h1 {
    font-size: 24px;
    margin: 5px 0;
  }
  .f-zone p {
    font-size: 8px;
  }
  .f-vitals {
    top: 148px;
  }
  .f-alert {
    top: 126px;
  }
  .f-target {
    top: 192px;
    padding: 8px 10px;
  }
  .f-target > p:last-of-type {
    display: none;
  }
  .f-target h3 {
    font-size: 11px;
  }
  .f-target .eyebrow {
    font-size: 5px;
  }
  .f-tutorial {
    display: none;
  }
  .f-route {
    bottom: 223px;
    padding: 5px;
    font-size: 7px;
  }
  #fTouch {
    bottom: 126px;
  }
  .f-world-label {
    font-size: 6px;
  }
  .f-tools button {
    font-size: 16px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .f-top {
    height: 48px;
    padding: 0 14px;
  }
  .f-brand > span {
    font-size: 24px;
  }
  .f-brand b {
    font-size: 10px;
  }
  .f-brand small {
    display: none;
  }
  .f-top-actions button {
    min-height: 30px;
    min-width: 31px;
  }
  #fCoordinates {
    font-size: 8px;
  }
  .f-zone {
    left: 14px;
    top: 60px;
    max-width: 300px;
  }
  .f-zone > span {
    font-size: 6px;
  }
  .f-zone h1 {
    font-size: 24px;
    margin: 5px 0;
  }
  .f-zone p {
    font-size: 8px;
  }
  .f-zone button {
    display: none;
  }
  .f-vitals {
    top: 58px;
    right: 14px;
    left: auto;
    width: 235px;
    padding: 9px;
    gap: 7px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
  .f-vitals > span {
    font-size: 6px;
  }
  .f-vitals b {
    font-size: 12px;
    display: block;
    margin: 3px 0 0;
  }
  .f-vitals small {
    font-size: 6px;
    display: block;
  }
  .f-target {
    top: 143px;
    left: auto;
    right: 14px;
    width: 230px;
    padding: 10px;
    display: block;
  }
  .f-target h3 {
    font-size: 12px;
    margin: 5px 0;
  }
  .f-target p {
    font-size: 8px;
    margin: 4px 0;
  }
  .f-target > p:last-of-type {
    display: none;
  }
  .f-target .eyebrow {
    font-size: 6px;
  }
  .f-target button {
    font-size: 8px;
    min-height: 28px;
    padding: 6px 8px;
  }
  .f-target .button-row {
    margin: 7px 0 0;
  }
  .f-tutorial {
    display: none;
  }
  .f-tools {
    bottom: 44px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 3px;
    gap: 1px;
  }
  .f-tools button {
    width: 48px;
    min-height: 43px;
    font-size: 15px;
  }
  .f-tools button > span {
    font-size: 6px;
  }
  .f-tools button > kbd {
    display: none;
  }
  .f-footer {
    min-height: 35px;
    padding: 4px 14px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .f-footer > span {
    font-size: 7px;
    flex: 0 0 auto;
  }
  .f-footer > div {
    width: auto;
    order: 0;
    gap: 3px;
  }
  .f-footer button {
    min-height: 24px;
    font-size: 7px;
    padding: 4px 6px;
  }
  .f-route {
    left: 14px;
    transform: none;
    bottom: 100px;
    width: 200px;
    max-width: calc(100% - 270px);
    font-size: 8px;
    padding: 6px;
  }
  .f-alert {
    top: 120px;
    left: 14px;
    transform: none;
    max-width: calc(100% - 270px);
    width: 260px;
    font-size: 6px;
    padding: 5px;
  }
  .f-world-label {
    font-size: 6px;
  }
  .f-crosshair {
    font-size: 18px;
  }
  #fTouch {
    bottom: 98px;
    left: 14px;
    right: 14px;
  }
  .f-dpad {
    grid-template-columns: repeat(3, 34px);
    grid-template-rows: repeat(2, 34px);
    gap: 3px;
  }
  .f-height {
    grid-template-columns: repeat(2, 34px);
    gap: 3px;
  }
  .f-dpad button,
  .f-height button {
    min-width: 34px;
    min-height: 34px;
    font-size: 18px;
  }
  .f-height small {
    font-size: 6px;
  }
  #fRadar {
    display: none;
  }
  #fToasts {
    top: 53px;
    max-width: 370px;
  }
  #fToasts .toast {
    font-size: 9px;
    padding: 9px;
  }
}
/* Keep the selected target clear of the height pad on short phones. */
.f-tools button.active,
.f-tools button.active > span,
.f-tools button.active > kbd {
  color: #20382c;
}
@media (max-height: 420px) and (orientation: landscape) {
  .f-target {
    padding: 8px 10px;
    top: 145px;
  }
  .f-target > .eyebrow,
  .f-target > p,
  .f-target > .button-row,
  .f-target > button {
    display: none;
  }
  .f-target h3 {
    font-size: 11px;
    margin: 0;
    line-height: 1.5;
  }
  .f-target {
    min-height: 35px;
  }
}
@media (max-height: 360px) and (orientation: landscape) {
  .f-target {
    display: none;
  }
  .f-route {
    left: 160px;
    right: 110px;
    bottom: 91px;
    width: auto;
    max-width: none;
    font-size: 7px;
  }
}

/* Audio controls stay reachable in both exploration modes. */
[data-sound-toggle] {
  display: inline-grid;
  place-items: center;
  padding: 0;
  width: 38px;
}
[data-sound-toggle] svg {
  width: 18px;
  height: 18px;
}
.sound-volume-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sound-volume-controls input[type='range'] {
  width: 160px;
  min-height: 44px;
  accent-color: var(--lime);
}
.sound-volume-controls output {
  font-size: 12px;
  color: var(--lime);
  min-width: 36px;
}
.sound-volume-controls button {
  min-height: 40px;
  font-size: 11px;
}
@media (max-width: 700px) {
  [data-sound-toggle] {
    width: 32px;
  }
  .sound-volume-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .sound-volume-controls {
    width: 100%;
    justify-content: flex-start;
  }
  .sound-volume-controls input[type='range'] {
    flex: 1;
    min-width: 90px;
    width: 120px;
  }
}
@media (max-width: 380px) {
  .f-brand {
    gap: 6px;
  }
  .f-brand > span {
    font-size: 23px;
  }
  .f-brand b {
    font-size: 9px;
    letter-spacing: 0.6px;
  }
  .f-brand small {
    font-size: 4px;
    letter-spacing: 0.9px;
  }
  .f-top-actions {
    gap: 4px;
  }
}
/* Pocket worlds: route map, research trail and connected field records. */
.p-map {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(230px, 1fr);
  gap: 24px;
  align-items: center;
  padding: 20px;
  margin: 0 0 24px;
  border: 1px solid #9bc4d52b;
  border-radius: 14px;
  background: #10222e;
}
.p-map svg {
  width: 100%;
  height: auto;
  stroke: none;
  fill: none;
  overflow: visible;
}
.p-map p {
  font-size: 12px;
  line-height: 1.8;
}
.p-map .pill {
  font-size: 8px;
}
.p-map h3 {
  font-size: 24px;
  margin-top: 15px;
}
.p-rumour-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.p-rumour-board > .p-network {
  grid-column: 1/-1;
}
.p-rumour-board .tile {
  position: relative;
}
.p-network {
  border-color: #c7ee8e55 !important;
  background: #c7ee8e0a !important;
}
.p-journal {
  border-left: 3px solid #c7ee8e !important;
}
.p-journal > p {
  line-height: 2;
  color: #d3e3df;
}
.p-power-track {
  height: 25px;
  border: 1px solid #a1c4cf44;
  border-radius: 6px;
  overflow: hidden;
  margin: 15px 0;
  background: #071725;
}
.p-power-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #619eaa, #c7ee8e);
}
.p-prediction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0;
  font-size: 13px;
  color: #d5e4e1;
}
.p-prediction input {
  width: 140px;
  min-height: 44px;
  padding: 10px;
  background: #112532;
  border: 1px solid #a1bdcb66;
  border-radius: 7px;
  color: #c7ee8e;
  font-size: 18px;
}
.p-signal {
  font-size: 22px;
  color: #c7ee8e;
  padding: 18px;
  border: 1px solid #8bbfca44;
  border-radius: 8px;
  margin: 18px 0;
  background: repeating-linear-gradient(
    90deg,
    #73aab708,
    #73aab708 2px,
    transparent 2px,
    transparent 8px
  );
}
#pFeedback {
  margin: 20px 0;
  color: #c7ee8e;
  font-size: 13px;
  line-height: 1.8;
}
.f-area {
  color: #c7ee8e !important;
  font-size: 10px !important;
  min-height: 0 !important;
  flex: 0 !important;
}
@media (max-width: 700px) {
  .p-map {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
  }
  .p-map svg {
    max-height: 300px;
  }
  .p-map h3 {
    font-size: 20px;
  }
  .p-rumour-board {
    grid-template-columns: 1fr;
  }
  .p-prediction {
    flex-wrap: wrap;
  }
  .p-prediction input {
    width: 100%;
  }
  .p-map .pill {
    font-size: 7px;
  }
  .p-rumour-board .tile {
    padding: 16px;
  }
  .f-area {
    font-size: 9px !important;
  }
}

/* Hazard instructions have a reserved strip above the camp/region HUD. */
@media (min-width: 1251px) {
  .f-alert {
    width: min(620px, calc(100% - 940px));
  }
}
@media (min-width: 1025px) and (max-width: 1250px) {
  .f-alert {
    width: calc(100% - 780px);
  }
}
@media (min-width: 701px) and (max-width: 1024px) and (min-height: 521px) {
  .f-alert {
    top: 73px;
    padding: 4px 6px;
    font-size: 8px;
    line-height: 1.4;
  }
}
#frontier:has(.f-alert:not([hidden])) .f-zone p {
  display: none;
}
/* Original exploration atlas and always-visible crossing status. */
.f-region-status {
  position: absolute;
  top: 260px;
  left: 30px;
  max-width: 310px;
  text-align: left;
  min-height: 36px;
  padding: 8px 12px;
  background: #0b2536e8;
  border: 1px solid #4fbbf466;
  border-radius: 8px;
  font-size: 10px;
  color: #a8e3ff;
  z-index: 2;
  box-shadow: 0 0 20px #0875bb12;
}
.f-region-status.danger {
  color: #ffd0b7;
  border-color: #fa936e88;
}
.f-health {
  position: absolute;
  top: 199px;
  right: 34px;
  padding: 4px 9px;
  border-radius: 7px;
  background: #102632e8;
  color: #cfedb3;
  font: 11px monospace;
  pointer-events: none;
}
.f-health.danger {
  color: #ff9e8c;
}
.f-vignette {
  box-shadow: inset 0 0 110px rgba(189, 46, 27, var(--hazard, 0));
  transition: box-shadow 0.7s ease;
}
#fRadar[role='button'] {
  cursor: pointer;
}
#fRadar:focus-visible {
  outline: 2px solid #7bd7ff;
  outline-offset: 3px;
}
.f-chart-button {
  font-size: 10px;
  padding: 0 9px;
}
.survey-atlas {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: start;
  margin: 18px 0 24px;
}
.survey-chart {
  border: 1px solid #3c7189;
  border-radius: 16px;
  overflow: hidden;
  background: #071626;
  box-shadow: 0 16px 60px #0004;
}
.survey-chart svg {
  display: block;
  width: 100%;
  height: auto;
}
.survey-map-zone {
  cursor: pointer;
  outline: none;
}
.survey-map-zone:hover circle,
.survey-map-zone:focus circle {
  stroke: #e9ffcf;
  stroke-width: 3;
}
.survey-map-info {
  padding: 6px 0;
  font-size: 12px;
  color: #acc6d5;
  line-height: 1.8;
}
.survey-map-info h3 {
  font-size: 25px;
  color: #e5f4f6;
  line-height: 1.2;
}
.survey-map-info .eyebrow {
  font-size: 8px;
  color: #8bd9f6;
}
.survey-key {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
}
.survey-key.blue {
  background: #58cdff;
  box-shadow: 0 0 10px #58cdff;
}
.survey-key.red {
  background: #745952;
}
.survey-destinations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.survey-destinations h3 {
  font-size: 15px;
}
.survey-destinations p {
  font-size: 11px;
}
.survey-destinations .pill {
  font-size: 8px;
}
@media (max-width: 1024px) {
  .f-region-status {
    top: 235px;
    left: 20px;
    max-width: 240px;
    font-size: 9px;
  }
  .survey-atlas {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 16px;
  }
  .survey-destinations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .f-region-status {
    top: 221px;
    left: 14px;
    right: 14px;
    width: calc(100% - 28px);
    max-width: none;
    min-height: 28px;
    padding: 5px 9px;
    font-size: 9px;
  }
  .f-health {
    top: 182px;
    right: 19px;
    font-size: 9px;
    background: transparent;
    padding: 0;
  }
  .f-top-actions .f-chart-button {
    min-width: 36px;
    font-size: 0;
    padding: 0;
  }
  .f-top-actions .f-chart-button::before {
    content: '◎';
    font-size: 22px;
  }
  .survey-atlas {
    display: block;
  }
  .survey-map-info {
    margin-top: 20px;
  }
  .survey-map-info h3 {
    font-size: 22px;
  }
  .survey-destinations {
    grid-template-columns: 1fr;
  }
  .survey-map-info .small {
    font-size: 10px;
  }
  #frontier:has(.f-alert:not([hidden])) .f-region-status {
    top: 231px;
  }
}
@media (max-height: 520px) and (min-width: 701px) {
  .f-region-status {
    top: 176px;
    left: 16px;
    max-width: 220px;
    font-size: 8px;
    min-height: 28px;
    padding: 5px 8px;
  }
  .f-health {
    top: 160px;
    right: 20px;
    font-size: 9px;
  }
  .survey-atlas {
    grid-template-columns: 1fr 220px;
  }
  .f-chart-button {
    min-width: 34px;
  }
}
/* Health belongs in the systems strip; reserve a separate line for the region. */
.f-vitals {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.f-vitals > span {
  min-width: 0;
}
.f-vitals b {
  font-size: 16px;
}
#fHealth.danger b {
  color: #ff9e8c;
}
@media (max-width: 700px) {
  .f-region-status,
  #frontier:has(.f-alert:not([hidden])) .f-region-status {
    top: 221px;
  }
  .f-target {
    top: 258px;
  }
  .f-vitals {
    gap: 5px;
    padding-inline: 10px;
  }
  .f-vitals b {
    font-size: 12px;
  }
  .f-vitals > span {
    font-size: 6px;
  }
}
@media (max-width: 380px) {
  .f-vitals b {
    font-size: 10px;
  }
  .f-vitals > span {
    font-size: 5px;
  }
}
@media (max-height: 650px) and (max-width: 700px) and (orientation: portrait) {
  .f-region-status,
  #frontier:has(.f-alert:not([hidden])) .f-region-status {
    top: 194px;
  }
  .f-target {
    top: 230px;
  }
}
@media (max-height: 520px) and (min-width: 701px) {
  .f-vitals b {
    font-size: 12px;
  }
}
@media (max-width: 480px) {
  .f-top-actions [data-panel='frontier-log'] {
    display: none;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .f-target {
    top: 143px;
  }
  .f-region-status,
  #frontier:has(.f-alert:not([hidden])) .f-region-status {
    top: 147px;
    left: 14px;
    right: auto;
    width: 230px;
    max-width: 230px;
    min-height: 25px;
    padding: 5px 8px;
    font-size: 8px;
  }
}
@media (max-height: 340px) and (orientation: landscape) {
  .f-region-status {
    display: none;
  }
}
/* Planet-wide charts: the eight worlds share the blue-ring exploration language. */
.planetary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 0;
}
.planetary-card {
  border: 1px solid #6da9c440;
  border-radius: 16px;
  overflow: hidden;
  background: #102534;
}
.planetary-mini {
  height: 245px;
  overflow: hidden;
  background: #0b2232;
  pointer-events: none;
}
.planetary-mini svg {
  width: 100%;
  height: auto;
  display: block;
  transform: translateY(-16%);
}
.planetary-copy {
  padding: 22px;
}
.planetary-copy h3 {
  font-size: 28px;
  margin: 12px 0 7px;
}
.planetary-copy p {
  font-size: 12px;
  color: #b4cfda;
  line-height: 1.7;
}
.planetary-copy .pill {
  font-size: 8px;
}
.planetary-copy button {
  margin-top: 8px;
}
.planet-map-ring {
  filter: drop-shadow(0 0 3px #4dcbff88);
}
.planet-map-zone {
  cursor: pointer;
  outline: none;
}
.planet-map-zone:hover > circle,
.planet-map-zone:focus > circle {
  stroke: #dcffb7;
  stroke-width: 2.5;
}
.planetary-chart-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 18px 0;
  color: #add3df;
  font-size: 11px;
}
.planetary-chart-nav button {
  font-size: 11px;
  padding: 10px 13px;
}
.survey-chart {
  position: relative;
}
.survey-chart > svg {
  touch-action: none;
  user-select: none;
}
.chart-controls {
  position: relative;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 10px;
  background: #0b1e2f;
  border-top: 1px solid #87c3d635;
  align-items: center;
}
.chart-controls button {
  min-width: 35px;
  min-height: 36px;
  border: 1px solid #87c3d640;
  background: #173449;
  border-radius: 6px;
  color: #cbe9f3;
  font-size: 16px;
  padding: 5px;
}
.chart-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}
.chart-controls .chart-reset {
  font-size: 10px;
  padding: 5px 9px;
}
.chart-controls output {
  margin-left: auto;
  font-size: 10px;
  color: #a4cbdc;
  font-variant-numeric: tabular-nums;
}
.planetary-region-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0;
}
.planetary-region {
  padding: 12px;
  text-align: left;
  display: grid;
  grid-template-columns: 23px 1fr;
  gap: 4px 8px;
  background: #17314166;
  border: 1px solid #78b4cc22;
  border-radius: 9px;
  min-height: 70px;
}
.planetary-region > span {
  grid-row: 1/3;
  color: #7db9d3;
  font-size: 10px;
}
.planetary-region b {
  font-size: 11px;
  color: #c8e6ec;
  line-height: 1.5;
}
.planetary-region small {
  font-size: 7px;
  color: #83b3ca;
  letter-spacing: 0.6px;
}
.planetary-region.selected {
  border-color: #80dcff;
  background: #24495f;
}
.planetary-preview {
  align-self: start;
}
.panel-tabs {
  flex-wrap: wrap;
}
@media (max-width: 800px) {
  .planetary-mini {
    height: 190px;
  }
  .planetary-copy {
    padding: 16px;
  }
  .planetary-copy h3 {
    font-size: 23px;
  }
  .planetary-region-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chart-controls {
    gap: 4px;
    padding: 7px;
  }
  .chart-controls button {
    min-width: 30px;
    min-height: 34px;
  }
}
@media (max-width: 520px) {
  .planetary-grid {
    grid-template-columns: 1fr;
  }
  .planetary-mini {
    height: 205px;
  }
  .planetary-region-list {
    grid-template-columns: 1fr;
  }
  .chart-controls .chart-reset {
    font-size: 9px;
  }
  .chart-controls button {
    min-width: 28px;
    min-height: 34px;
  }
  .chart-controls output {
    font-size: 9px;
  }
  .planetary-chart-nav {
    gap: 10px;
    font-size: 10px;
  }
  .planetary-copy button {
    width: 100%;
  }
}

.planetary-preview svg text,
.planetary-mini svg text {
  stroke: none;
}

.planet-map-zone.selected > circle {
  stroke: #d5ffab;
  stroke-width: 2;
  fill: #8fe4ae24;
}

/* Shared spacing for menus and learning panels. Compact HUD layouts stay independent. */
#modal {
  --panel-inset: clamp(20px, 3vw, 40px);
  --card-inset: 24px;
  --section-gap: 28px;
  --grid-gap: 24px;
  --panel-top: 28px;
  padding: var(--panel-top) var(--panel-inset) 36px;
  scroll-padding-block: 28px;
}
#modal.wide {
  width: min(1120px, calc(100vw - 40px));
}
#modal .modal-top {
  top: calc(-1 * var(--panel-top));
  margin-bottom: 24px;
  padding-block: 6px;
  gap: 16px;
}
#modalTitle {
  margin-bottom: 16px;
}
#modal .modal-intro {
  max-width: 76ch;
  margin-bottom: var(--section-gap);
  line-height: 1.8;
}
#modalBody > :last-child {
  margin-bottom: 0;
}
#modal :is(.primary, .secondary, .danger) {
  min-height: 44px;
  min-width: 0;
  padding: 12px 16px;
  font-size: 12px;
  white-space: normal;
}
#modal .ex-nav {
  gap: 10px;
  margin: 24px 0 32px;
}
#modal .button-row {
  gap: 12px;
  margin-top: 24px;
}
#modal .stack {
  gap: 16px;
}
#modal .panel-tabs {
  gap: 8px;
  padding: 6px;
  margin-block: 24px;
}
#modal .panel-tabs button {
  min-height: 44px;
  padding: 12px 16px;
}
#modal
  :is(
    .ex-grid,
    .ex-columns,
    .f-guide-steps,
    .f-nearby-list,
    .f-zone-grid,
    .planetary-grid,
    .p-rumour-board
  ) {
  gap: var(--grid-gap);
}
#modal :is(.ex-grid, .ex-columns, .f-guide-steps, .planetary-grid) {
  margin-block: var(--section-gap);
}
#modal :is(.tile, .f-card-copy, .planetary-copy, .f-reading) {
  padding: var(--card-inset);
}
#modal .tile p {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 16px;
}
#modal .tile > :last-child {
  margin-bottom: 0;
}
#modal .tile .pill {
  margin-bottom: 16px;
}
#modal .f-guide-steps .tile > b + p {
  margin-top: 16px;
}
#modal .info-note {
  padding: 16px 20px;
  margin-block: 24px;
}
#modal :is(.settings-row, .fact-row) {
  padding-block: 22px;
  gap: 24px;
}
#modal .settings-row select {
  min-height: 44px;
  padding: 10px 12px;
}
#modal .sound-volume-row {
  flex-wrap: wrap;
  row-gap: 16px;
}
#modal .f-map-banner {
  padding: var(--card-inset);
  margin-bottom: 28px;
}
#modal .f-map-controls {
  gap: 20px;
  margin-block: 24px;
}
#modal .f-map-controls label {
  gap: 10px;
}
#modal .f-map-controls :is(input, select) {
  padding: 12px 14px;
}
#modal .f-card-copy h3 {
  margin-block: 12px;
}
#modal .f-card-copy p {
  margin: 8px 0 20px;
  line-height: 1.8;
}
#modal .f-market-row {
  padding: 20px;
  gap: 16px;
}
#modal .f-market-row .button-row {
  margin: 0;
  gap: 10px;
}
#modal .f-cargo-list > div {
  padding-block: 16px;
}
#modal .planetary-copy p {
  margin-block: 12px;
  line-height: 1.8;
}
#modal .planetary-copy button {
  margin-top: 16px;
}
#modal .planetary-chart-nav {
  gap: 16px;
  margin-block: 24px;
}
#modal .survey-atlas {
  gap: 32px;
  margin: 24px 0 32px;
}
#modal .survey-map-info {
  padding: 0;
}
#modal .survey-map-info h3 {
  margin: 12px 0 16px;
  line-height: 1.3;
}
#modal .survey-map-info p {
  margin: 0 0 16px;
}
#modal .survey-map-info > .primary {
  width: 100%;
  margin: 8px 0 16px;
}
#modal .chart-controls {
  padding: 12px;
  gap: 8px;
}
#modal .chart-controls button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
}
#modal .chart-controls .chart-reset {
  min-width: 80px;
  padding-inline: 12px;
}
#modal .chart-controls output {
  min-height: 36px;
  display: flex;
  align-items: center;
}
#modal .planetary-region-list {
  gap: 12px;
  margin-block: 28px;
}
#modal .planetary-region {
  padding: 16px;
  min-height: 84px;
  gap: 6px 12px;
}
#modal .planetary-region b {
  font-size: 12px;
}
#modal .planetary-region small {
  font-size: 8px;
  line-height: 1.6;
}
#modal .p-map {
  padding: var(--card-inset);
  gap: 32px;
  margin-bottom: 28px;
}
#modal .onboard-layout {
  gap: 32px;
}
#modal .onboard-footer {
  padding-top: 24px;
  margin-top: 28px;
  gap: 16px;
}
@media (min-width: 1100px) and (min-height: 800px) {
  .f-target {
    padding: 24px;
  }
  .f-target .button-row {
    gap: 12px;
    margin-top: 20px;
  }
  .f-tutorial {
    padding: 20px;
  }
  .f-tools {
    gap: 8px;
    padding: 10px;
    bottom: 74px;
  }
}
@media (min-width: 701px) and (max-width: 1050px) {
  #modal {
    --card-inset: 22px;
    --grid-gap: 20px;
  }
  #modal .ex-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #modal .survey-atlas {
    gap: 24px;
  }
}
@media (max-width: 700px) {
  #modal {
    --panel-inset: 20px;
    --card-inset: 20px;
    --section-gap: 24px;
    --grid-gap: 20px;
    --panel-top: 20px;
    padding-bottom: 28px;
  }
  #modal,
  #modal.wide,
  #modal.onboarding {
    width: calc(100vw - var(--safe-left) - var(--safe-right) - 24px);
  }
  #modal .modal-top {
    margin-bottom: 20px;
  }
  #modal .modal-eyebrow {
    line-height: 1.6;
  }
  #modal .ex-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0 28px;
  }
  #modal .ex-nav button {
    padding: 12px 8px;
    font-size: 11px;
  }
  #modal .button-row {
    gap: 12px;
  }
  #modal .panel-tabs button {
    padding: 12px;
    font-size: 12px;
  }
  #modal .tile p {
    font-size: 13px;
  }
  #modal :is(.settings-row, .fact-row) {
    padding-block: 20px;
    gap: 16px;
  }
  #modal .settings-row:has(select) {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  #modal .settings-row > select {
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  #modal .settings-row > .sound-volume-controls {
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }
  #modal .info-note {
    padding: 16px;
    line-height: 1.8;
  }
  #modal .f-map-controls {
    flex-wrap: wrap;
    gap: 16px;
  }
  #modal .f-map-controls label {
    flex: 1 1 170px;
  }
  #modal .f-map-controls :is(input, select) {
    font-size: 13px;
  }
  #modal .f-market-row {
    padding: var(--card-inset);
    row-gap: 16px;
  }
  #modal .f-market-row .button-row {
    flex: 1 1 100%;
    margin: 0;
    flex-wrap: wrap;
  }
  #modal .f-market-row .button-row button {
    flex: 1 1 60px;
    padding-inline: 10px;
  }
  #modal .f-card-copy p {
    font-size: 12px;
  }
  #modal .survey-map-info {
    margin-top: 28px;
  }
  #modal .survey-map-info h3 {
    margin-top: 12px;
  }
  #modal .planetary-region-list {
    margin-top: 28px;
  }
  #modal .p-map {
    gap: 24px;
  }
  #modal .onboard-layout {
    gap: 24px;
  }
  #modal .onboard-footer {
    padding-top: 20px;
    margin-top: 24px;
  }
}
@media (max-width: 380px) {
  #modal {
    --panel-inset: 16px;
    --card-inset: 16px;
    --grid-gap: 16px;
  }
  #modal .ex-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #modal .panel-tabs button {
    flex-basis: 100px;
  }
  #modal .planetary-region {
    padding: 16px 12px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  #modal {
    --panel-top: 16px;
    padding-bottom: 24px;
  }
  #modal .modal-top {
    margin-bottom: 16px;
  }
  #modal .ex-nav {
    display: flex;
    gap: 10px;
    margin-block: 20px;
  }
  #modal .onboard-layout {
    gap: 24px;
  }
}

/* Terrain field notes share the panel's existing spacious rhythm. */
#modal .terrain-note {
  margin-block: 0 clamp(20px, 2.4vw, 28px);
}

/* Expedition crew: spacious conversations, accessible profiles and optional commissions. */
.crew-menu {
  color: var(--lime);
  cursor: pointer;
}
.crew-menu svg,
.f-top-actions [data-panel='crew'] svg {
  width: 21px;
  height: 21px;
  display: block;
}
.f-top-actions [data-panel='crew'] {
  display: grid;
  place-items: center;
  padding: 6px;
  color: #b8dccc;
}
.world-label.crew .label-name,
.f-world-label.crew {
  background: #183c46e8;
  color: #cfefe4;
  border: 1px solid #97dbd34d;
  letter-spacing: 1px;
}
.crew-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  padding: 20px 24px;
  margin: 0 0 24px;
  border: 1px solid #91d5c638;
  border-radius: 14px;
  background: #8dccb508;
}
.crew-summary span {
  max-width: 430px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.crew-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.crew-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.crew-card > p {
  flex: 1;
}
.crew-card-head,
.crew-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.crew-card-head > div {
  min-width: 0;
}
.crew-card-head h3 {
  margin: 8px 0 0 !important;
}
.crew-portrait {
  flex: 0 0 58px;
  width: 58px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 24px 24px 16px 16px;
  color: var(--crew-color);
  background:
    radial-gradient(ellipse at 50% 38%, #102c39 0 33%, transparent 34%),
    linear-gradient(145deg, #668b94, #263f50);
  border: 1px solid var(--crew-color);
  box-shadow:
    inset 0 -13px #18343d,
    0 0 28px #75c6c80c;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}
.crew-portrait.robot {
  border-radius: 14px;
}
.crew-portrait.large {
  flex-basis: 84px;
  width: 84px;
  height: 94px;
  font-size: 20px;
}
.crew-identity {
  padding: 22px;
  margin-bottom: 24px;
  border: 1px solid #97c4d12b;
  background: linear-gradient(135deg, #80c9bd0c, transparent);
  border-radius: 14px;
}
.crew-identity p {
  margin: 8px 0 12px !important;
}
.crew-status {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--crew-color);
  margin: 12px 0;
  line-height: 1.8;
}
.crew-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.crew-speech {
  border-left: 2px solid var(--crew-color);
  background: #a4d7cd08;
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 0 12px 12px 0;
}
.crew-speech > b {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--crew-color);
}
.crew-speech p {
  margin: 10px 0 0 !important;
  line-height: 1.85;
}
.crew-check {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.crew-check summary {
  cursor: pointer;
  color: var(--lime);
  line-height: 1.7;
  font-size: 12px;
  min-height: 44px;
  display: list-item;
  padding-block: 10px;
}
.crew-check .stack {
  gap: 12px;
}
.crew-dialogue .secondary,
.crew-card .secondary {
  white-space: normal;
  line-height: 1.6;
  text-align: left;
  min-height: 46px;
  padding: 12px 16px;
}
.crew-dialogue [aria-pressed='true'] {
  border-color: var(--crew-color);
  background: #9dcfca16;
}
.crew-success {
  color: var(--lime);
}
.crew-progress {
  height: 7px;
  background: #7392a325;
  border-radius: 9px;
  overflow: hidden;
  margin: 24px 0 16px;
}
.crew-progress i {
  display: block;
  height: 100%;
  background: var(--crew-color);
  border-radius: inherit;
}
.crew-feedback {
  margin-top: 24px;
  line-height: 1.8;
  color: var(--lime);
}
.crew-feedback:empty {
  display: none;
}
.crew-commission > .primary {
  width: 100%;
  white-space: normal;
  line-height: 1.6;
  min-height: 48px;
}
.crew-commission > p:last-child {
  margin-bottom: 0 !important;
}
@media (max-width: 700px) {
  .crew-grid,
  .crew-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .crew-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
  }
  .crew-card-head {
    gap: 14px;
  }
  .crew-identity {
    padding: 18px;
    gap: 16px;
  }
  .crew-portrait.large {
    flex-basis: 64px;
    width: 64px;
    height: 76px;
    font-size: 16px;
  }
  .crew-speech {
    padding: 16px;
  }
  .crew-identity .pill {
    font-size: 8px;
    white-space: normal;
    line-height: 1.8;
  }
  .f-top-actions [data-panel='crew'] {
    padding: 5px;
    min-width: 32px;
  }
}
.crew-greeting {
  border-left: 2px solid var(--crew-color);
  padding: 10px 18px;
  margin: 0 0 24px !important;
  color: #c0d5d9;
  font-size: 13px;
  line-height: 1.8;
  font-style: italic;
}
@media (max-width: 480px) {
  .f-top {
    gap: 8px;
  }
  .f-brand {
    gap: 0;
    min-width: 32px;
    flex-shrink: 0;
  }
  .f-brand b {
    display: none;
  }
  .f-brand > span {
    font-size: 28px;
  }
  .f-top-actions {
    gap: 4px;
  }
  .f-top-actions button,
  .f-top-actions [data-panel='crew'] {
    min-width: 40px;
    min-height: 44px;
    padding: 5px;
  }
  .f-top-actions button:first-child {
    padding-inline: 7px;
  }
}

/* 2.11: quieter glass, dimensional edges and readable emergency telemetry. */
#frontier .glass {
  background: linear-gradient(135deg, #172b36f7, #101f2bf5);
  border-color: #b0d4d728;
  box-shadow:
    0 16px 48px #0000001c,
    inset 0 1px #dcefea08;
  backdrop-filter: none;
}
#frontier .f-top {
  background: linear-gradient(#0d1c29f2, #0d1c29d9);
  border-bottom-color: #c3e2e41a;
}
#frontier .f-footer {
  background: #0d1b27ee;
  border-top-color: #c3e2e41a;
}
#frontier .f-tools {
  background: linear-gradient(160deg, #142d3aee, #10232fe8);
  border-color: #b0d4d736;
  box-shadow:
    0 12px 44px #02091040,
    inset 0 1px #e5faff09;
}
#frontier .f-zone h1 {
  font-weight: 650;
  letter-spacing: -2px;
  text-shadow: 0 2px 24px #07142130;
}
#frontier .f-world-label {
  background: #112a36cc;
  border-color: #abdfe72e;
  box-shadow: 0 3px 15px #05131d25;
  backdrop-filter: none;
}
#frontier .f-vignette {
  background:
    linear-gradient(#0814214d, transparent 24%, transparent 72%, #08142188),
    radial-gradient(ellipse at 50% 50%, transparent 45%, #07121b30);
}
#fHealth.danger {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-weight: inherit;
  box-shadow: none;
  color: #ffb09e;
}
#fHealth.danger b {
  margin-top: 4px;
  color: #ffad98;
}
#fVitals > span {
  font-variant-numeric: tabular-nums;
}
.environment-inline {
  grid-column: 1/-1;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid #91d0dd38;
  border-radius: 7px;
  background: #8bd8e309;
  color: #bedde0;
  font: inherit;
  font-size: 9px;
  line-height: 1.6;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.environment-inline:hover,
.environment-inline:focus-visible {
  background: #8bd8e319;
  border-color: #91d0dd88;
}
.environment-inline.is-danger,
#academyEnvironment.is-danger {
  color: #ffb298;
}
#academyEnvironment {
  max-width: 260px;
  white-space: normal !important;
  line-height: 1.6;
  letter-spacing: 0.3px;
  font-size: 9px;
}
.environment-panel {
  margin-top: 22px;
  padding: 24px;
}
.environment-panel h3 {
  margin-top: 15px;
}
.environment-panel p {
  line-height: 1.8;
}
.environment-panel .ex-meter {
  margin-block: 15px;
}
@media (max-width: 700px) {
  .environment-inline {
    min-height: 44px;
    font-size: 7px;
    padding: 5px 7px;
    line-height: 1.4;
  }
  #academyEnvironment {
    max-width: 150px;
    font-size: 7px;
  }
  .environment-panel {
    padding: 18px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .environment-inline {
    font-size: 7px;
    min-height: 44px;
    padding: 4px 6px;
  }
}
@media (max-width: 700px) {
  #fHealth.danger b {
    margin-top: 0;
  }
  #frontier .f-zone h1 {
    letter-spacing: -1px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #frontier .glass,
  #frontier .f-world-label {
    backdrop-filter: none;
  }
}

#photoStatus {
  position: fixed;
  z-index: 75;
  left: 50%;
  top: max(82px, env(safe-area-inset-top));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 9px;
  border: 1px solid #97d9e441;
  background: #102632ee;
  color: #d9edef;
  font-size: 12px;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 32px #0003;
  pointer-events: none;
}
#photoStatus[hidden] {
  display: none;
}
@media (max-width: 700px) {
  #photoStatus {
    top: 63px;
    font-size: 10px;
    padding: 7px 12px;
  }
}

/* Connected expeditions: roomy evidence cards, an ordered trail and an accessible trial plot. */
.fieldwork-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.fieldwork-summary p {
  margin: 0;
  color: var(--muted);
}
.fieldwork-route {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 28px 0;
}
.fieldwork-route li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 30, 41, 0.45);
}
.fieldwork-route li > span {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border: 1px solid #6e939c;
  border-radius: 50%;
  color: #c5dadb;
}
.fieldwork-route li.current {
  border-color: #b8d98a;
  background: rgba(128, 166, 91, 0.1);
}
.fieldwork-route li.done > span {
  background: #b8d98a;
  color: #132731;
}
.fieldwork-route p {
  margin: 8px 0 0;
  font-size: 12px;
  color: #adbec3;
}
.fieldwork-location {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.fieldwork-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.fieldwork-grid > .tile {
  min-width: 0;
}
.fieldwork-evidence {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.fieldwork-evidence p {
  margin: 16px 0 0;
  line-height: 1.7;
}
.fieldwork-trial {
  margin: 24px 0;
  padding: 16px;
  background: #102530;
  border: 1px solid #35505b;
  border-radius: 16px;
}
.fieldwork-trial svg {
  width: 100%;
  height: auto;
  display: block;
  font: 14px sans-serif;
}
.fieldwork-trial figcaption {
  margin: 14px 0 0;
  font-size: 12px;
  color: #adbec3;
  line-height: 1.6;
}
.fieldwork-records {
  margin: 24px 0;
  display: grid;
  gap: 12px;
}
.fieldwork-records details {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.fieldwork-records summary {
  cursor: pointer;
  min-height: 28px;
}
.fieldwork-feedback {
  min-height: 24px;
  margin: 24px 0;
  color: #d3e6ba;
  line-height: 1.7;
}
.fieldwork-promo {
  margin-top: 24px;
}
.crew-duty {
  color: #b8d9d2;
}
@media (max-width: 760px) {
  .fieldwork-route,
  .fieldwork-grid {
    grid-template-columns: 1fr;
  }
  .fieldwork-location {
    align-items: stretch;
    flex-direction: column;
  }
  .fieldwork-tabs {
    flex-wrap: wrap;
  }
}
.fieldwork-trial table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 13px;
}
.fieldwork-trial caption {
  text-align: left;
  color: #adbec3;
  margin: 12px 0;
}
.fieldwork-trial th,
.fieldwork-trial td {
  padding: 12px 6px;
  text-align: left;
  border-top: 1px solid var(--line);
}

/* Local crew conversations: native modal controls beside an unblurred world. */
body.crew-conversation #frontier > :not(#frontierCanvas),
body.crew-conversation #gameShell > :not(#viewport),
body.crew-conversation #viewport > :not(#world),
body.crew-conversation > .topbar,
body.crew-conversation > .sidebar {
  visibility: hidden;
  pointer-events: none;
}
#modal.crew-cinematic {
  --panel-inset: clamp(20px, 2vw, 32px);
  position: fixed;
  inset: 16px 16px 16px auto;
  margin: 0;
  width: clamp(350px, 44vw, 620px);
  max-width: calc(100vw - 32px);
  height: calc(100dvh - 32px);
  max-height: calc(100dvh - 32px);
  background: #10222bf5;
  box-shadow: 0 20px 90px #0005;
  border-color: #a9c6d24a;
}
#modal.crew-cinematic::backdrop {
  backdrop-filter: none;
  background: linear-gradient(90deg, #07111b08 20%, #07111b22 55%, #07111b88);
}
#modal.crew-cinematic .modal-top {
  position: sticky;
  z-index: 3;
  background: #10222b;
}
#modal.crew-cinematic .crew-columns {
  grid-template-columns: minmax(0, 1fr);
}
#modal.crew-cinematic .crew-portrait {
  display: none;
}
#modal.crew-cinematic .crew-identity {
  padding: 18px;
}
#modal.crew-cinematic .modal-intro {
  font-size: 13px;
}
.conversation-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 0 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.conversation-controls > span {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
#modal .conversation-controls button {
  flex: 0 0 auto;
}
#conversationVeil {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: #07111b;
  opacity: 0;
}
#conversationVeil[hidden] {
  display: none;
}
#conversationVeil.is-fading {
  animation: conversation-cut 0.32s ease-out both;
}
@keyframes conversation-cut {
  from {
    opacity: 0.95;
  }
  to {
    opacity: 0;
  }
}
@media (max-width: 760px) and (min-height: 560px) {
  #modal.crew-cinematic {
    inset: auto 10px 10px;
    width: auto;
    max-width: none;
    height: 60dvh;
    max-height: 60dvh;
    border-radius: 18px;
    --panel-top: 18px;
  }
  #modal.crew-cinematic::backdrop {
    background: linear-gradient(#07111b00 20%, #07111b44 45%, #07111b88);
  }
}
@media (max-height: 559px) {
  #modal.crew-cinematic {
    inset: 10px 10px 10px auto;
    width: 49vw;
    min-width: 260px;
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    --panel-top: 16px;
    --panel-inset: 18px;
  }
  #modal.crew-cinematic .conversation-controls {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  #conversationVeil {
    display: none !important;
  }
}
/* Keep camera choice beside Close; reading choices get the panel's space. */
#modal.crew-cinematic .modal-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}
#modal.crew-cinematic .modal-eyebrow {
  line-height: 1.7;
}
#modal.crew-cinematic .conversation-controls {
  padding-bottom: 14px;
  margin-bottom: 16px;
}
#modal.crew-cinematic .crew-identity {
  padding: 12px 16px;
  margin-bottom: 16px;
}
#modal.crew-cinematic .crew-identity > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
#modal.crew-cinematic .crew-identity p {
  display: none;
}
#modal.crew-cinematic .crew-greeting {
  margin-block: 16px;
}
@media (max-width: 760px), (max-height: 559px) {
  #modal.crew-cinematic .modal-intro {
    display: none;
  }
  #modal.crew-cinematic .modal-eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  #modal.crew-cinematic .modal-top {
    gap: 6px;
  }
  #modal.crew-cinematic .modal-top #crewCameraToggle {
    padding-inline: 10px;
  }
}

/* Campaign: generous card spacing and wrapping keep requirements readable on touch screens. */
.campaign-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 20px 0 28px;
  padding: 24px;
  border: 1px solid #84c7d43d;
  border-radius: 16px;
  background: #28445240;
}
.campaign-summary > div {
  flex: 1 1 260px;
  min-width: 0;
}
.campaign-chapters {
  display: grid;
  gap: 24px;
}
.campaign-chapters > .tile {
  padding: 28px;
}
.campaign-route {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 18px;
  margin-top: 22px;
}
.campaign-stop {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px;
  border: 1px solid #d3e9e21c;
  border-radius: 12px;
  background: #10212b75;
  min-width: 0;
}
.campaign-stop h3,
.campaign-stop p {
  margin: 0;
}
.campaign-stop p {
  flex: 1;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.campaign-stop button {
  margin-top: 10px;
  width: 100%;
  white-space: normal;
}
.campaign-checklist {
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.campaign-checklist .complete {
  color: #c7ee8e;
}
.campaign-requirements {
  font-size: 12px;
  line-height: 1.65;
  color: #e5cba6;
  padding: 12px 0;
}
.campaign-locked .f-card-world {
  filter: saturate(0.45);
}
@media (max-width: 600px) {
  .campaign-summary,
  .campaign-chapters > .tile {
    padding: 20px;
  }
  .campaign-summary > button {
    width: 100%;
  }
  .campaign-stop {
    padding: 20px;
  }
}

/* Construction plans share the modal's touch sizing and preserve room for readable terrain feedback. */
.outpost-planner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 24px;
}
.outpost-plan-map {
  overflow: hidden;
  border: 1px solid #80bed13d;
  border-radius: 16px;
}
.outpost-plan-map svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
  cursor: crosshair;
}
.outpost-plan-map svg:focus-visible {
  outline: 3px solid #c7ee8e;
  outline-offset: -4px;
}
.outpost-position {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 22px 0;
}
.outpost-position label {
  display: grid;
  gap: 10px;
  font-size: 12px;
  color: #bfd0d4;
}
.outpost-position input {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #7e9da85c;
  background: #102b36;
  color: #e7f2ee;
}
.outpost-fit {
  padding: 16px;
  border: 1px solid #e3b29a55;
  background: #a7754b13;
  border-radius: 10px;
  line-height: 1.7;
}
.outpost-fit.ready {
  border-color: #b4db7f55;
  color: #d1eeae;
  background: #9ad2770c;
}
.outpost-work {
  margin: 28px 0;
}
.outpost-job {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid #c0dfdd22;
}
.outpost-job > div {
  flex: 1 1 240px;
}
.outpost-job p {
  font-size: 12px;
  margin: 8px 0;
}
.outpost-job progress {
  width: 100%;
  height: 8px;
  accent-color: #acdbe7;
}
@media (max-width: 800px) {
  .outpost-planner {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .outpost-plan-controls {
    padding: 20px;
  }
}
@media (max-width: 400px) {
  .outpost-position {
    grid-template-columns: 1fr;
  }
  .outpost-job > button {
    width: 100%;
  }
}

/* Settlement operations retain the same generous panel rhythm on small screens. */
.settlement-entry {
  margin-top: 28px;
}
.settlement-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.settlement-metrics strong {
  display: block;
  font-size: clamp(15px, 1.5vw, 22px);
  line-height: 1.6;
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.settlement-builder {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  margin: 24px 0;
}
.settlement-grid {
  display: grid;
  grid-template-columns: repeat(17, minmax(0, 1fr));
  gap: 2px;
  padding: 12px;
  background: #0b2530;
  border: 1px solid #557c87;
  border-radius: 12px;
  overflow: hidden;
}
.settlement-grid [data-action] {
  padding: 0;
  min-height: 0;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid #294754;
  border-radius: 2px;
  color: #527781;
  background: #12313c;
  font-size: 12px;
}
.settlement-grid [data-action].built {
  background: #347d90;
  color: #d2f2fb;
}
.settlement-grid [data-action].selected {
  background: var(--lime, #c9ef8a);
  color: #17322c;
  border-color: #fff;
}
.settlement-piece-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.settlement-piece-list .tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.settlement-builder label,
#modalBody label:has(#settlementTemp) {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.settlement-builder select,
#settlementTemp {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  background: #132f3b;
  color: #e9f4ef;
  border: 1px solid #4a6570;
  border-radius: 8px;
}
.circuit-stages {
  display: flex;
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 28px 0;
  flex-wrap: wrap;
}
.circuit-stages li {
  flex: 1 1 180px;
  padding: 18px;
  border: 1px solid #36525f;
  border-radius: 12px;
  color: #9cabb1;
}
.circuit-stages .current {
  border-color: #c9ef8a;
  color: #e9f4ef;
}
.circuit-stages .complete {
  color: #c9ef8a;
}
.circuit-answers {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}
.circuit-answers button {
  text-align: left;
  white-space: normal;
  line-height: 1.7;
  padding: 16px 20px;
}
@media (max-width: 800px) {
  .settlement-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settlement-builder,
  .settlement-piece-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .settlement-grid {
    padding: 4px;
    gap: 1px;
  }
  .settlement-grid [data-action] {
    font-size: 10px;
  }
}

.architecture-coordinates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.architecture-coordinates input {
  width: 100%;
  min-height: 48px;
  background: #132f3b;
  color: #e9f4ef;
  border: 1px solid #4a6570;
  border-radius: 8px;
  padding: 12px;
}
.settlement-grid [data-action] {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
}

/* Instrument UI: spacious desktop comparison with a single-column reading path. */
.research-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0;
  color: var(--muted);
}
.research-bench {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  margin: 24px 0;
}
.research-controls {
  display: grid;
  gap: 18px;
  margin: 24px 0;
}
.research-controls label {
  display: grid;
  gap: 9px;
}
.research-controls select {
  width: 100%;
  min-height: 46px;
}
.research-chart {
  width: 100%;
  height: auto;
  display: block;
  margin: 18px 0;
  font:
    14px system-ui,
    sans-serif;
}
.research-table-wrap {
  overflow: auto;
}
.research-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  text-align: left;
}
.research-table th,
.research-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #ffffff1c;
}
.research-table caption {
  text-align: left;
  padding: 8px 14px;
  color: var(--muted);
}
.research-conclusion {
  margin: 24px 0;
}
.research-answers {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.research-answers button {
  white-space: normal;
  text-align: left;
  min-height: 48px;
  line-height: 1.55;
  padding: 14px 18px;
}
.research-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.research-records {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 20px;
  margin-top: 24px;
}
.research-entry {
  margin: 24px 0;
}
@media (max-width: 720px) {
  .research-bench,
  .research-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .research-table th,
  .research-table td {
    padding: 10px 8px;
  }
}

/* Case notebooks and anonymous pilot tools share the instrument panel rhythm. */
.case-leads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 20px;
  margin: 24px 0;
}
.case-note {
  margin: 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line, #344854);
}
.case-switches,
.case-fields {
  display: grid;
  gap: 18px;
  margin: 20px 0;
}
.case-switches label {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
}
.case-switches input {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}
.case-puzzle output {
  display: block;
  margin: 20px 0;
  font-weight: 700;
}
.case-fields label {
  display: grid;
  gap: 10px;
}
.review-capabilities {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  padding: 16px;
}
#reviewNotes {
  width: 100%;
  min-height: 110px;
  padding: 14px;
  background: var(--bg, #101f29);
  color: inherit;
  border: 1px solid #5b7481;
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}
#modal .case-fields select,
#modal #reviewGrade,
#modal .case-puzzle input[type='number'] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #587482;
  border-radius: 8px;
  background: #162b37;
  color: #edf4ec;
  font: inherit;
}
#modal label:has(> #reviewGrade) {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}
#modal .case-fields label {
  min-width: 0;
}

/* Voice controls remain separate from the written lesson and wrap on phones. */
.dialogue-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}
.dialogue-auto {
  margin-bottom: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Keep ambience controls together and readable at both desktop and touch sizes. */
#modal .audio-settings {
  margin-block: 24px;
}
#modal .audio-settings .settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  align-items: center;
  gap: 24px;
}
#modal .audio-settings .sound-volume-controls {
  width: 100%;
  min-width: 0;
}
#modal .audio-settings select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
#modal .audio-settings .button-row {
  margin-block: 20px 14px;
}
@media (max-width: 700px) {
  #modal .audio-settings .settings-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

#modal .progress-copies {
  margin-block: 24px;
}
