:root {
  color-scheme: dark;
  --ink: #eff4e5;
  --muted: #9daea7;
  --panel: #142c2cef;
  --line: #46605b;
  --gold: #f4ca66;
  --green: #9ee2ba;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: #101f20;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
select {
  font: inherit;
}
button,
select {
  border: 1px solid #64766c;
  border-radius: 6px;
  background: #263f3b;
  color: var(--ink);
  padding: 10px 14px;
  font-size: 12px;
  cursor: pointer;
}
button:hover:not(:disabled) {
  background: #3b5749;
  border-color: var(--gold);
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
a {
  color: inherit;
}
kbd {
  font-family: inherit;
  font-size: 9px;
  border: 1px solid #92a99b55;
  padding: 2px 4px;
  border-radius: 3px;
  color: #d7e4d5;
}
small,
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.5px;
}
.eyebrow {
  font-weight: 750;
  color: var(--gold);
}
#game {
  height: 100dvh;
  position: relative;
  overflow: hidden;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  outline: 0;
  touch-action: none;
}
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 180px #09191835;
  background: linear-gradient(
    #0c25283b,
    transparent 18%,
    transparent 78%,
    #0b202f66
  );
}
.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 28px;
  background: linear-gradient(#122c2ee8, transparent);
}
.brand {
  font-size: 11px;
  line-height: 1;
  letter-spacing: 3px;
  font-weight: 800;
  text-decoration: none;
  margin-right: auto;
}
.brand span {
  display: block;
  font-size: 23px;
  letter-spacing: 2px;
  margin-top: 4px;
}
.wallet strong,
.career strong {
  display: block;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.wallet strong {
  color: var(--gold);
}
.wallet small,
.career small {
  color: #c9d4cb;
  font-size: 8px;
}
.hud-top button {
  background: #1c3535c9;
}
.mission {
  position: absolute;
  left: 28px;
  top: 106px;
  width: 285px;
  background: var(--panel);
  border-left: 3px solid var(--gold);
  padding: 18px 20px;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 5px 25px #0b1c2033;
}
.mission h1 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 9px 0;
}
.mission p {
  font-size: 11px;
  color: #b8cac0;
  line-height: 1.5;
  margin: 8px 0 12px;
}
.objective {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 17px;
}
#bearing {
  font-size: 25px;
  color: var(--gold);
  display: block;
  width: 24px;
  text-align: center;
}
.objective strong {
  font-size: 24px;
}
#cargo-label {
  font-size: 8px;
  letter-spacing: 1px;
  color: #bacfc3;
  margin-left: auto;
}
progress {
  width: 100%;
  height: 5px;
  accent-color: var(--gold);
  margin: 15px 0 9px;
}
.reward {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  font-size: 10px;
  color: var(--green);
}
#choose-job {
  margin-top: 14px;
  width: 100%;
}
.minimap {
  position: absolute;
  right: 28px;
  bottom: 134px;
  width: 180px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid #687e6c7c;
  border-radius: 10px;
}
.minimap > div {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  letter-spacing: 0.8px;
  margin-bottom: 7px;
}
#map {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.88;
  border-radius: 4px;
  cursor: crosshair;
}
#route-job {
  font-size: 9px;
  width: 100%;
  padding: 7px 4px;
  margin-top: 7px;
}
.reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  color: #fffd;
  pointer-events: none;
  text-shadow: 0 0 3px black;
}
.cockpit {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: calc(100% - 56px);
  max-width: 1100px;
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 16px 24px;
  border-radius: 18px 18px 8px 8px;
  border: 1px solid #71847b;
  background: linear-gradient(130deg, #203d3deb, #0e2226ed);
  box-shadow: 0 6px 30px #0004;
}
.speed {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-right: 24px;
  border-right: 1px solid #58746b;
  min-width: 110px;
}
.speed strong {
  font-size: 40px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.speed small {
  letter-spacing: 0;
  color: #aec4b8;
}
.drive-status {
  flex: 1;
  min-width: 0;
}
#robot-mode {
  font-size: 8px;
  letter-spacing: 1.8px;
  color: var(--gold);
}
#robot-status {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}
.keys {
  font-size: 8px;
  color: #a8b9b0;
  margin-top: 10px;
}
.keys kbd {
  margin-left: 8px;
}
.keys kbd:first-child {
  margin-left: 0;
}
.camera-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.camera-controls button,
.camera-controls select {
  font-size: 10px;
  max-width: 155px;
  background: #223c38;
}
#notice,
#assist,
#hazard {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 145px;
  padding: 13px 19px;
  border-radius: 8px;
  background: #edc66b;
  color: #243a35;
  font-size: 12px;
  box-shadow: 0 3px 15px #071b1f44;
  max-width: min(520px, 90vw);
  text-align: center;
}
#assist {
  display: flex;
  align-items: center;
  gap: 15px;
  bottom: 200px;
}
#assist button {
  white-space: nowrap;
}
#hazard {
  bottom: 265px;
  background: #bd4e33;
  color: #fff7e8;
}
#paused {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 5px;
  text-shadow: 0 2px 6px #17322c;
}
#paused small {
  display: block;
  font-size: 10px;
  letter-spacing: 0;
  text-align: center;
  margin-top: 10px;
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  align-items: center;
  padding: 40px;
  background: linear-gradient(
    90deg,
    #0d242af5 0%,
    #0d242adf 37%,
    #0d242a22 100%
  );
  overflow: auto;
}
.intro-card {
  max-width: 535px;
  margin-left: 4vw;
}
.intro-card h2 {
  font-size: clamp(48px, 6.5vw, 90px);
  line-height: 0.92;
  letter-spacing: -4px;
  margin: 24px 0 25px;
  font-weight: 900;
}
.intro-card h2 em {
  font-style: normal;
  color: var(--gold);
}
.intro-tag {
  font-size: 23px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 15px;
}
#intro-detail {
  font-size: 13px;
  color: #c1d2c8;
  max-width: 390px;
  line-height: 1.7;
}
.starter-stats {
  display: flex;
  gap: 28px;
  margin: 28px 0;
  font-size: 10px;
  color: #b3c6ba;
}
.starter-stats b {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
  color: var(--ink);
}
.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c352d;
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: 800;
  padding: 16px 22px;
  display: block;
  width: 100%;
  max-width: 390px;
  text-align: left;
}
.primary span {
  float: right;
}
.primary:hover:not(:disabled) {
  color: var(--ink);
}
.text-button {
  border: 0;
  background: transparent;
  margin: 8px 0 18px;
  padding-left: 0;
  color: #d1ddcd;
}
.intro-controls {
  display: block;
  font-size: 10px;
  letter-spacing: 0;
  color: #9eb5a8;
  line-height: 1.8;
}
.completion-card {
  margin: auto;
  width: min(460px, 100%);
  padding: 35px;
  border: 1px solid #84927b;
  background: #163131f5;
  border-radius: 16px;
  box-shadow: 0 8px 80px #081b1fc9;
}
.completion-card h2 {
  font-size: 35px;
  margin: 14px 0 7px;
  letter-spacing: -1px;
}
#delivery-earned {
  display: block;
  font-size: 56px;
  font-weight: 500;
  color: var(--gold);
}
.completion-card p {
  font-size: 13px;
  color: #b7cdbf;
  line-height: 1.5;
}
.completion-card button {
  width: 100%;
  margin-top: 14px;
}
.touch-controls {
  display: none;
}
dialog {
  padding: 0;
  color: var(--ink);
  background: #142c2e;
  width: min(960px, 94vw);
  max-height: 90dvh;
  border: 1px solid #637a6c;
  border-radius: 16px;
  box-shadow: 0 30px 100px #0008;
  overflow: auto;
}
dialog::backdrop {
  background: #031416a9;
  backdrop-filter: blur(4px);
}
dialog > header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px 17px;
}
dialog > header small {
  font-size: 8px;
  color: var(--muted);
}
dialog h2 {
  font-size: 31px;
  letter-spacing: -1px;
  margin: 4px 0;
}
#garage-balance {
  color: var(--gold);
  font-size: 28px;
  margin-left: auto;
}
dialog nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 0 28px 16px;
}
dialog nav button {
  background: transparent;
  border-color: transparent;
  color: #aabdb2;
}
dialog nav .active {
  background: #385546;
  color: var(--ink);
}
dialog > section {
  padding: 18px 28px 26px;
}
.garage-intro {
  font-size: 12px;
  color: #b8c9be;
  margin: 0 0 20px;
}
#upgrade-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.upgrade-card {
  padding: 20px 17px;
  background: #1d3838;
  border: 1px solid #426158;
  border-radius: 9px;
}
.upgrade-icon {
  display: inline-grid;
  place-content: center;
  width: 40px;
  height: 40px;
  background: #2f5049;
  border: 1px solid #5b7661;
  border-radius: 9px;
  font-size: 25px;
  color: var(--gold);
}
.upgrade-card h3 {
  font-size: 17px;
  margin: 15px 0 8px;
}
.tier-track {
  display: flex;
  gap: 4px;
  margin-bottom: 17px;
}
.tier-track i {
  height: 6px;
  flex: 1;
  background: #0e2628;
  border: 1px solid #4c6658;
  border-radius: 2px;
}
.tier-track i.owned {
  background: var(--gold);
  border-color: var(--gold);
}
.installed {
  font-size: 10px;
  color: #a6bdb0;
  margin-bottom: 13px;
}
.upgrade-card h4 {
  font-size: 14px;
  margin: 9px 0;
}
.upgrade-card p {
  font-size: 11px;
  line-height: 1.65;
  color: #b3c5ba;
  min-height: 74px;
}
.buy {
  width: 100%;
  background: var(--gold);
  color: #1d3930;
  font-weight: 800;
  border: 0;
  margin-top: 10px;
  min-height: 40px;
}
.upgrade-card details {
  font-size: 10px;
  margin-top: 15px;
  color: #adbfaf;
}
.upgrade-card li {
  margin: 8px 0;
  line-height: 1.5;
}
.upgrade-card ol {
  padding-left: 15px;
}
.fineprint {
  font-size: 10px;
  line-height: 1.7;
  color: #9bafa6;
  margin-top: 20px;
}
#contracts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.contract {
  padding: 18px;
  text-align: left;
  background: #213d37;
}
.contract span {
  float: right;
  color: var(--gold);
  font-weight: 800;
}
.contract strong {
  font-size: 13px;
}
.contract small {
  display: block;
  font-size: 10px;
  letter-spacing: 0;
  line-height: 1.5;
  margin-top: 10px;
  color: #bfd1bd;
}
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.career-totals {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
  color: var(--green);
  font-size: 12px;
}
#ledger {
  list-style: none;
  padding: 0;
  font-size: 12px;
}
#ledger li {
  border-bottom: 1px solid #3d554d;
  padding: 13px 0;
}
#ledger b {
  float: right;
}
.fee {
  color: #f39270;
}
details {
  margin-top: 20px;
  font-size: 12px;
  color: #b9cbbd;
}
details p {
  line-height: 1.7;
}
summary {
  cursor: pointer;
}
#save-status {
  font-size: 10px;
  color: #99b3a2;
  margin-top: 22px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1050px) {
  .hud-top {
    padding: 15px 18px;
    gap: 16px;
  }
  .mission {
    left: 18px;
    top: 95px;
    width: 245px;
    padding: 14px;
  }
  .mission h1 {
    font-size: 17px;
  }
  .minimap {
    right: 18px;
    width: 155px;
    bottom: 145px;
  }
  .cockpit {
    width: calc(100% - 36px);
    gap: 15px;
    padding: 14px 18px;
  }
  .camera-controls {
    flex-direction: column;
    gap: 5px;
  }
  .camera-controls button,
  .camera-controls select {
    padding: 6px 8px;
  }
  .keys {
    font-size: 7px;
  }
  .keys kbd {
    font-size: 8px;
    margin-left: 4px;
  }
}
@media (max-width: 700px), (pointer: coarse) {
  .hud-top {
    gap: 12px;
    padding: 12px;
  }
  .brand {
    font-size: 8px;
    letter-spacing: 2px;
  }
  .brand span {
    font-size: 17px;
  }
  .career {
    display: none;
  }
  .wallet strong {
    font-size: 20px;
  }
  .wallet small {
    font-size: 6px;
  }
  .hud-top button {
    padding: 8px;
    font-size: 10px;
  }
  .hud-top kbd {
    display: none;
  }
  .mission {
    top: 78px;
    left: 12px;
    width: 210px;
    padding: 12px;
    background: #142c2ce8;
  }
  .mission h1 {
    font-size: 14px;
    margin: 7px 0;
  }
  .mission p {
    display: none;
  }
  .mission .eyebrow {
    font-size: 7px;
  }
  .objective {
    margin-top: 7px;
    gap: 6px;
  }
  .objective strong {
    font-size: 18px;
  }
  #cargo-label {
    font-size: 6px;
  }
  .objective span {
    font-size: 19px;
  }
  progress {
    margin: 9px 0 6px;
  }
  .reward {
    font-size: 8px;
  }
  .minimap {
    right: 12px;
    top: 78px;
    bottom: auto;
    width: 110px;
    padding: 7px;
  }
  .minimap > div {
    font-size: 5px;
  }
  #map-help {
    display: none;
  }
  #route-job {
    font-size: 7px;
    padding: 6px 2px;
  }
  .cockpit {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 10px 12px;
    gap: 10px;
    border-radius: 12px;
  }
  .speed {
    min-width: 67px;
    padding-right: 10px;
    gap: 3px;
  }
  .speed strong {
    font-size: 25px;
  }
  .speed small {
    font-size: 8px;
  }
  .keys {
    display: none;
  }
  #robot-mode {
    font-size: 6px;
    letter-spacing: 0.6px;
  }
  #robot-status {
    font-size: 9px;
  }
  .camera-controls button,
  .camera-controls select {
    font-size: 8px;
    max-width: 105px;
  }
  .camera-controls kbd {
    display: none;
  }
  .touch-controls {
    display: flex;
    justify-content: space-between;
    position: absolute;
    bottom: 100px;
    left: 12px;
    right: 12px;
    pointer-events: none;
  }
  .touch-controls > div {
    display: grid;
    grid-template-columns: repeat(2, 42px);
    gap: 6px;
    pointer-events: auto;
  }
  .touch-controls button {
    padding: 7px;
    font-size: 24px;
    background: #163937dc;
    border-color: #a0b5a6;
    touch-action: none;
  }
  .touch-controls button[data-look] {
    font-size: 17px;
  }
  #touch-brake {
    grid-column: span 2;
    font-size: 9px;
    padding: 11px;
  }
  .overlay {
    padding: 24px;
    background: linear-gradient(90deg, #0d242af5, #0d242a90);
  }
  .intro-card {
    margin: 0;
  }
  .intro-card h2 {
    font-size: 58px;
    letter-spacing: -3px;
    margin: 22px 0;
  }
  .intro-tag {
    font-size: 20px;
  }
  .starter-stats {
    gap: 20px;
    margin: 22px 0;
  }
  .starter-stats b {
    font-size: 17px;
  }
  .starter-stats span {
    font-size: 8px;
  }
  #intro-detail {
    font-size: 12px;
  }
  .intro-controls {
    font-size: 9px;
  }
  .primary {
    font-size: 11px;
  }
  #notice,
  #assist,
  #hazard {
    bottom: 230px;
    max-width: 90vw;
    width: max-content;
    padding: 10px;
    font-size: 10px;
  }
  #assist {
    bottom: 280px;
  }
  #assist button {
    font-size: 9px;
    padding: 7px;
  }
  #hazard {
    bottom: 330px;
  }
  .completion-card {
    padding: 25px;
  }
  .completion-card h2 {
    font-size: 28px;
  }
  #delivery-earned {
    font-size: 45px;
  }
  dialog {
    width: 95vw;
    max-height: 94dvh;
    border-radius: 12px;
  }
  dialog > header {
    padding: 16px;
    gap: 10px;
  }
  dialog h2 {
    font-size: 26px;
  }
  #garage-balance {
    font-size: 22px;
  }
  dialog nav {
    padding: 0 12px 12px;
    gap: 0;
  }
  dialog nav button {
    font-size: 10px;
    padding: 9px;
  }
  dialog > section {
    padding: 15px;
  }
  #upgrade-cards {
    grid-template-columns: 1fr;
  }
  .upgrade-card {
    padding: 16px;
  }
  .upgrade-icon {
    float: right;
  }
  .upgrade-card h3 {
    margin-top: 0;
  }
  .upgrade-card p {
    min-height: 0;
  }
  .tier-track {
    max-width: 180px;
  }
  .upgrade-card details {
    margin-top: 12px;
  }
  #contracts {
    grid-template-columns: 1fr;
  }
  .career-totals {
    gap: 12px;
    font-size: 10px;
  }
}
@media (max-height: 550px) {
  .intro-card h2 {
    font-size: 44px;
    margin: 10px 0;
  }
  .intro-tag {
    font-size: 16px;
  }
  #intro-detail {
    font-size: 11px;
    margin: 8px 0;
  }
  .starter-stats {
    margin: 13px 0;
  }
  .intro-controls {
    font-size: 8px;
  }
  .text-button {
    margin: 3px 0;
  }
  .overlay {
    padding: 20px;
  }
  .mission {
    top: 76px;
  }
  .mission p {
    display: none;
  }
  .minimap {
    width: 100px;
    top: 76px;
    bottom: auto;
  }
  .cockpit {
    padding: 10px 16px;
    bottom: 10px;
  }
  .keys {
    display: none;
  }
  .touch-controls {
    bottom: 90px;
  }
  #notice {
    bottom: 110px;
  }
  #assist {
    bottom: 155px;
  }
  #hazard {
    bottom: 210px;
  }
}

#game.impact .vignette {
  box-shadow: inset 0 0 85px #e94b33bc;
}
#game:has(#intro:not([hidden])) > .hud-top,
#game:has(#intro:not([hidden])) > .mission,
#game:has(#intro:not([hidden])) > .cockpit,
#game:has(#intro:not([hidden])) > .minimap,
#game:has(#intro:not([hidden])) > .reticle,
#game:has(#intro:not([hidden])) > .touch-controls {
  visibility: hidden;
}

/* Route planning and operator cameras share the same world and HUD. */
#game .minimap {
  width: 310px;
  bottom: 134px;
  top: auto;
  z-index: 5;
}
#game .minimap > div {
  font-size: 10px;
}
#game #map {
  height: 250px;
  opacity: 1;
}
#game .map-tools {
  gap: 5px;
  margin: 8px 0;
}
#game .map-tools button {
  font-size: 11px;
  padding: 6px 9px;
}
#game #route-job {
  font-size: 11px;
}
#game .minimap.expanded {
  position: fixed;
  left: 50%;
  right: auto;
  top: 75px;
  bottom: auto;
  transform: translateX(-50%);
  width: min(90vw, 1000px);
  padding: 16px;
  background: #183432;
  z-index: 35;
  box-shadow: 0 0 0 100vmax #061c20b8;
}
#game .minimap.expanded #map {
  height: min(66dvh, 650px);
}
#camera-feeds {
  position: absolute;
  left: 28px;
  right: 360px;
  top: 300px;
  bottom: 134px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  pointer-events: none;
}
.feed {
  border: 2px solid #a5b9a6;
  position: relative;
  box-shadow: inset 0 0 22px #0005;
}
.feed span {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 5px 8px;
  background: #0c252bea;
  color: #f7e9c3;
  font-size: 10px;
  letter-spacing: 1px;
}
#camera-feeds > small {
  position: absolute;
  top: -25px;
  color: #fff4d8;
  letter-spacing: 1px;
  font-size: 10px;
  background: #183333dd;
  padding: 3px 8px;
}
#game[data-camera="operator"] #world {
  filter: blur(0.5px) saturate(0.72) contrast(0.92);
}
#game[data-camera="operator"] .mission {
  max-height: 175px;
  overflow: auto;
}
#game:has(#intro:not([hidden])) > #camera-feeds {
  visibility: hidden;
}
@media (max-width: 1050px) {
  #game .minimap {
    width: 265px;
    right: 18px;
  }
  #game #map {
    height: 205px;
  }
  #camera-feeds {
    right: 300px;
    left: 18px;
  }
}
@media (max-width: 700px), (pointer: coarse) {
  #game .minimap {
    width: 216px;
    right: 12px;
    top: 220px;
    bottom: auto;
  }
  #game #map {
    height: 165px;
  }
  #game .minimap > div {
    font-size: 8px;
  }
  #game .map-tools button {
    padding: 5px;
    font-size: 9px;
  }
  #game #route-job {
    font-size: 9px;
  }
  #game .minimap.expanded {
    top: 75px;
    width: calc(100vw - 24px);
    right: auto;
    left: 50%;
  }
  #game .minimap.expanded #map {
    height: 60dvh;
  }
  #camera-feeds {
    left: 12px;
    right: 12px;
    top: 235px;
    bottom: 215px;
    gap: 6px;
  }
  #game[data-camera="operator"] .minimap:not(.expanded) {
    display: none;
  }
  #game[data-camera="operator"] .mission {
    width: calc(100% - 24px);
  }
  .feed span {
    font-size: 8px;
    left: 4px;
    top: 4px;
  }
  #camera-feeds > small {
    font-size: 8px;
  }
}
@media (max-height: 550px) {
  #game .minimap {
    width: 205px;
    top: 70px;
    bottom: auto;
  }
  #game #map {
    height: 80px;
  }
  #game .minimap > div {
    font-size: 7px;
    margin-bottom: 3px;
  }
  #game .map-tools {
    margin: 3px 0;
  }
  #game .map-tools button {
    font-size: 8px;
    padding: 3px 6px;
  }
  #game #route-job {
    font-size: 8px;
    padding: 4px;
  }
  #game .minimap.expanded {
    top: 60px;
  }
  #game .minimap.expanded #map {
    height: 50dvh;
  }
  #camera-feeds {
    top: 80px;
    bottom: 105px;
    right: 245px;
  }
  #game[data-camera="operator"] .mission {
    display: none;
  }
}
@media (max-height: 550px) and (pointer: coarse) {
  #camera-feeds {
    right: 12px;
  }
}

@media (min-width: 701px) and (min-height: 551px) and (pointer: fine) {
  #game[data-camera="operator"] .mission {
    width: calc(100% - 388px);
    max-height: none;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 18px;
    padding: 12px 18px;
  }
  #game[data-camera="operator"] .mission .eyebrow,
  #game[data-camera="operator"] .mission progress,
  #game[data-camera="operator"] .mission .reward {
    grid-column: 1/-1;
    margin: 0;
  }
  #game[data-camera="operator"] .mission h1 {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }
  #game[data-camera="operator"] .mission p {
    grid-column: 1;
    grid-row: 3;
    margin: 0;
  }
  #game[data-camera="operator"] .mission .objective {
    grid-column: 2;
    grid-row: 2/4;
    margin: 0;
  }
  #camera-feeds {
    top: 280px;
  }
}

#guidance-label {
  font-size: 10px;
  color: #acc7b9;
  display: block;
  margin-top: 5px;
}
#game[data-camera="operator"] #guidance-label {
  grid-column: 1/-1;
}
@media (max-width: 700px) {
  #guidance-label {
    font-size: 8px;
  }
}

/* Fleet controls remain compact in the driving HUD; details live in the garage. */
.robot-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 9px;
  letter-spacing: 1px;
}
.robot-picker select {
  min-width: 0;
  max-width: 130px;
  padding: 5px;
  font-size: 11px;
}
.robot-picker button {
  padding: 5px 8px;
  font-size: 10px;
  margin-left: auto;
}
.map-route-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
}
.map-route-tools span {
  font-size: 10px;
  letter-spacing: 0;
}
.map-route-tools button {
  font-size: 10px;
  padding: 6px;
  white-space: nowrap;
}
#fleet-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
}
.fleet-card {
  padding: 18px;
  border: 1px solid #8ca6a1;
  border-radius: 12px;
  background: #e1e9df;
  color: #183d38;
}
.fleet-card h3 {
  margin: 0 0 8px;
}
.fleet-card p {
  font-size: 12px;
  line-height: 1.5;
}
.fleet-card small {
  display: block;
  font-size: 10px;
  line-height: 1.6;
  margin: 12px 0;
}
.fleet-card button {
  width: 100%;
  padding: 10px;
  background: #245c52;
  color: #fff6df;
  border-radius: 7px;
}
.purchase-bot {
  background: #f2dfac;
}
#game[data-camera="operator"] .mission .robot-picker {
  grid-column: 1/-1;
}
@media (max-width: 700px), (pointer: coarse) {
  .robot-picker {
    margin-top: 6px;
    gap: 5px;
  }
  .robot-picker select {
    font-size: 10px;
    padding: 3px;
  }
  .robot-picker button {
    font-size: 9px;
    padding: 4px;
  }
  #game .minimap {
    top: 250px;
  }
  #camera-feeds {
    top: 270px;
  }
  .map-route-tools span {
    font-size: 8px;
  }
  .map-route-tools button {
    font-size: 9px;
    padding: 4px;
  }
}
@media (max-height: 550px) {
  #game .minimap {
    top: 70px;
  }
  #camera-feeds {
    top: 80px;
  }
  .robot-picker {
    margin-top: 4px;
  }
}

@media (min-height: 551px) {
  #game[data-camera="operator"] .mission {
    max-height: none;
    overflow: visible;
  }
}

/* Live operations are bounded and scroll independently of driving controls. */
.operations-panel {
  position: absolute;
  right: 28px;
  top: 96px;
  width: 310px;
  max-height: 190px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: auto;
  z-index: 2;
}
#orders-open {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  font-size: 11px;
  color: var(--gold);
}
#fleet-monitor {
  margin: 0;
}
#fleet-monitor summary {
  padding: 9px 12px;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
}
#fleet-monitor-rows {
  max-height: 130px;
  overflow: auto;
}
#fleet-monitor-rows button {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  border-radius: 0;
  border-width: 1px 0 0;
  padding: 8px 12px;
  text-align: left;
  font-size: 10px;
}
#fleet-monitor-rows button.selected {
  border-left: 3px solid var(--gold);
  background: #3a5141;
}
#fleet-monitor-rows button.needs-help span {
  color: #ffb998;
}
#fleet-monitor-rows small {
  grid-column: 1/-1;
  font-size: 9px;
  letter-spacing: 0;
  margin-top: 3px;
}
#fleet-monitor-rows progress {
  grid-column: 1/-1;
  height: 3px;
  margin: 5px 0 0;
}
#order-board p {
  font-size: 12px;
  line-height: 1.6;
  border-bottom: 1px solid #46605b55;
  padding-bottom: 8px;
}
#order-board .order-event {
  font-size: 11px;
  color: var(--muted);
}
#game:has(#intro:not([hidden])) .operations-panel,
#game:has(.minimap.expanded) .operations-panel {
  display: none;
}
@media (max-width: 1050px) {
  .operations-panel {
    right: 18px;
    width: 265px;
  }
}
@media (max-height: 780px) and (min-width: 701px) {
  .operations-panel {
    max-height: 140px;
  }
  #fleet-monitor-rows {
    max-height: 80px;
  }
}
@media (max-width: 700px), (pointer: coarse) {
  .operations-panel {
    top: 250px;
    left: 12px;
    right: auto;
    width: 138px;
    max-height: 210px;
  }
  #fleet-monitor summary {
    font-size: 9px;
    padding: 8px;
  }
  #fleet-monitor summary kbd {
    display: none;
  }
  #orders-open {
    font-size: 9px;
    padding: 8px;
  }
  #fleet-monitor-rows {
    max-height: 150px;
  }
  #fleet-monitor-rows button {
    display: block;
    padding: 8px;
    font-size: 9px;
  }
  #fleet-monitor-rows span,
  #fleet-monitor-rows small {
    display: block;
    font-size: 8px;
  }
  #game[data-camera="operator"] .operations-panel {
    top: auto;
    bottom: 205px;
    max-height: 100px;
  }
  #game[data-camera="operator"] #fleet-monitor-rows {
    max-height: 45px;
  }
}
@media (max-height: 550px) {
  .operations-panel {
    top: 70px;
    left: calc(50% - 90px);
    right: auto;
    width: 180px;
    max-height: 110px;
  }
  #fleet-monitor-rows {
    max-height: 45px;
  }
}

#game .minimap .map-legend {
  font-size: 9px;
  letter-spacing: 0;
  margin: 6px 0 0;
  line-height: 1.4;
  color: #c5d9ce;
  display: block;
}

#fleet-stall-alert {
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
  border: 0;
  border-top: 1px solid #ffb998;
  border-bottom: 1px solid #ffb998;
  border-radius: 0;
  background: #663b2f;
  color: #ffdfb7;
  text-align: left;
  padding: 7px 10px;
  font-size: 10px;
  line-height: 1.4;
}
#fleet-stall-alert span {
  display: block;
}
#fleet-stall-alert b {
  font-size: 9px;
}
#fleet-stall-alert:hover {
  background: #7b4937;
}
#fleet-monitor-rows button.no-progress {
  border-left: 3px solid #ffac79;
}
#fleet-monitor-rows button.no-progress span {
  color: #ffc09b;
  font-weight: 800;
}

/* A small, actionable next rung, separate from the current order. */
.progression-goal {
  position: absolute;
  left: 28px;
  bottom: 128px;
  width: 285px;
  text-align: left;
  padding: 14px 16px;
  background: rgba(22, 48, 48, 0.94);
  border: 1px solid #52716c;
  border-radius: 10px;
  display: grid;
  gap: 7px;
  color: #e8efe1;
  z-index: 4;
}
.progression-goal strong {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #f0c65e;
}
.progression-goal span {
  font-size: 11px;
  line-height: 1.5;
}
.progression-goal progress {
  width: 100%;
  height: 4px;
  accent-color: #ecc75d;
}
@media (max-width: 1050px), (max-height: 760px) {
  .progression-goal {
    display: none;
  }
}

.fleet-affinity {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #4c6658;
}
.fleet-affinity label {
  display: block;
  font-size: 11px;
  color: #456257;
}
.fleet-affinity select {
  display: block;
  width: 100%;
  margin: 8px 0;
}
.fleet-affinity button {
  width: 100%;
}
.fleet-affinity small {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: normal;
  line-height: 1.5;
}

/* Territory advice stays scrollable inside both the map and garage. */
#reward-detail {
  display: block;
  font-size: 11px;
  line-height: 1.5;
  color: #b8d0c3;
  margin: 5px 0;
}
.affinity-guide {
  grid-column: 1 / -1;
  background: #e5ece0;
  color: #183d38;
  border: 1px solid #8ca6a1;
  border-radius: 8px;
}
.affinity-guide summary {
  padding: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.affinity-guide-content {
  padding: 0 12px 12px;
}
.affinity-guide p {
  font-size: 12px;
  line-height: 1.5;
  margin: 6px 0;
}
.affinity-risk-key {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-weight: 700;
}
.affinity-area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.affinity-area-grid article {
  border-left: 4px solid;
  background: #f7f8ef;
  padding: 10px;
  font-size: 12px;
}
.affinity-area-grid strong {
  font-size: 13px;
}
.affinity-preview {
  border-left: 3px solid;
  padding-left: 8px;
}
#map-affinity-guide {
  display: none;
}
#game .minimap.expanded {
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
}
#game .minimap.expanded #map-affinity-guide {
  display: block;
  margin-top: 10px;
}
#map-affinity-guide .affinity-guide-content {
  max-height: 28dvh;
  overflow-y: auto;
}
#game .minimap.expanded:has(#map-affinity-guide[open]) #map {
  height: min(38dvh, 380px);
}
@media (max-height: 650px) {
  #game .minimap.expanded {
    top: 52px;
    max-height: calc(100dvh - 64px);
  }
}
#reward-detail {
  letter-spacing: normal;
}
#fleet-affinity-guide .affinity-guide-content {
  max-height: 300px;
  overflow-y: auto;
}
@media (min-height: 651px) and (max-width: 700px),
  (min-height: 651px) and (pointer: coarse) {
  #game .minimap:not(.expanded),
  #game .operations-panel {
    top: 306px;
  }
}

.operations-links {
  display: flex;
}
.operations-links #orders-open {
  flex: 1;
  width: auto;
}
#business-open {
  border: 0;
  border-radius: 0;
  padding: 8px;
  font-size: 10px;
}
#garage nav {
  flex-wrap: wrap;
}
.business-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.business-kpis article {
  background: #e5ece0;
  color: #183d38;
  padding: 14px;
  border-radius: 8px;
}
.business-kpis small {
  display: block;
  font-size: 10px;
  letter-spacing: normal;
  line-height: 1.5;
}
.business-kpis strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}
.business-summary,
.business-note,
.business-chart p {
  font-size: 12px;
  line-height: 1.6;
}
.business-note {
  color: #bfd1c7;
}
.business-chart {
  padding: 14px;
  background: #102e2b;
  border-radius: 8px;
  margin: 18px 0;
}
.business-chart h3 {
  margin: 0;
}
.business-graph {
  overflow-x: auto;
}
.business-chart svg {
  display: block;
  width: 100%;
  min-width: 640px;
}
.business-table-scroll {
  overflow-x: auto;
}
.business-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 880px;
  font-size: 12px;
}
.business-table th {
  text-align: left;
  font-size: 10px;
  color: #ecc75d;
}
.business-table td,
.business-table th {
  padding: 10px 8px;
  border-bottom: 1px solid #51716a;
}
.business-table small {
  display: block;
  font-size: 10px;
  letter-spacing: normal;
  line-height: 1.5;
  margin-top: 3px;
}
.business-table button {
  padding: 5px 8px;
}
.business-loss {
  color: #ffb3a3;
}
.business-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.business-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.business-periods button[aria-pressed="true"] {
  background: #e6c75f;
  color: #183d38;
  border-color: #e6c75f;
}
@media (max-width: 700px) {
  #business-open {
    font-size: 9px;
    padding: 5px;
  }
  .business-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .business-kpis strong {
    font-size: 20px;
  }
}

.garage-live-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
  font-size: 11px;
  color: #ecc75d;
}
.garage-live-controls button {
  white-space: nowrap;
}
