:root {
  color-scheme: dark;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --ink: #e8e9df;
  --muted: #a7ad9f;
  --paper: rgba(23, 27, 23, 0.94);
  --line: rgba(226, 231, 213, 0.18);
  --accent: #e0b75b;
  --danger: #d5785b;
  --drawer-collapsed-visible-height: 54px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #171b17;
  color: var(--ink);
}

body.prologue-resources-hidden .resources {
  opacity: 0;
}

body.prologue-resources-hidden .mobile-resource-hud {
  opacity: 0;
  pointer-events: none;
}

body.resources-revealed .resources {
  animation: resources-reveal 900ms ease-out;
}

body.resources-revealed .mobile-resource-hud {
  animation: resources-reveal 900ms ease-out;
}

/* Mission prep focus mode: dim the surrounding HUD so crew selection reads as a
   deliberate, weighty step, while the live map stays interactive underneath
   (not a blocking dialog). */
body.mission-crew-focus .topbar,
body.mission-crew-focus .run-status,
body.mission-crew-focus .map-hint {
  opacity: 0.35;
  filter: saturate(0.6);
  transition: opacity 180ms ease;
}

body.mission-crew-focus .dispatch-panel {
  border-color: rgba(224, 183, 91, 0.85);
  box-shadow: 0 0 26px rgba(224, 183, 91, 0.2);
}

/* During mission prep/planning, keep the end-day shortcut out of the way so
   the plan is the focus. Section visibility is handled by renderSidebar(). */
body.mission-crew-focus #end-day-button {
  display: none;
}

.mission-crew-picker-step {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crew-picker-list {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.crew-tile {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: inherit;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
}

.crew-tile:hover:not(:disabled) {
  border-color: rgba(224, 183, 91, 0.55);
}

.crew-tile.selected {
  border-color: var(--accent);
  background: rgba(224, 183, 91, 0.1);
}

.crew-tile:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.crew-tile-title {
  color: var(--ink);
  font-size: 12px;
}

.crew-tile-sub {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
}

.crew-tile-badge {
  margin-left: auto;
  color: var(--accent);
  font-size: 10px;
  font-style: normal;
}

.mission-crew-diagram {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  padding: 10px 0;
}

.crew-comms-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 154px;
  padding: 6px 9px;
  border: 1px solid rgba(77, 153, 179, 0.55);
  border-radius: 7px;
  background: rgba(18, 31, 39, 0.86);
  color: #cfeefa;
  box-shadow: 0 0 0 1px rgba(7, 12, 14, 0.4) inset;
}

.crew-comms-radio {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 18px;
  border: 1px solid rgba(207, 238, 250, 0.55);
  border-radius: 4px;
  color: #cfeefa;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.crew-comms-label {
  flex: 1 1 auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.crew-car-body {
  --car-seat-size: 32px;
  --crew-car-shell-left: 103px;
  --crew-car-shell-width: 126px;
  position: relative;
  display: grid;
  justify-items: center;
  width: 336px;
  min-height: 168px;
  /* Deep rear: the trunk is a real cargo grid now, not a bumper strip. */
  padding: 50px 0 80px;
  overflow: visible;
}

.crew-car-body::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--crew-car-shell-left);
  z-index: 1;
  width: var(--crew-car-shell-width);
  border: 2px solid rgba(224, 183, 91, 0.7);
  border-radius: 42px 42px 20px 20px;
  background:
    linear-gradient(180deg, rgba(31, 38, 45, 0.94), rgba(20, 24, 31, 0.9) 34%, rgba(18, 21, 27, 0.92));
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(0, 0, 0, 0.34) inset;
}

/*
.crew-car-body::after {
  content: "";
  position: absolute;
  top: 18px;
  left: calc(var(--crew-car-shell-left) + 22px);
  z-index: 1;
  width: calc(var(--crew-car-shell-width) - 44px);
  height: 25px;
  border-radius: 20px 20px 8px 8px;
  background: rgba(30, 38, 47, 0.76);
  box-shadow:
    inset 0 -1px 0 rgba(224, 183, 91, 0.22),
    inset 0 1px 0 rgba(246, 241, 228, 0.08);
}*/

.crew-car-wheel {
  position: absolute;
  z-index: 0;
  width: 13px;
  height: 31px;
  border-radius: 8px;
  background: #0b0d10;
  box-shadow: 0 0 0 1px rgba(224, 183, 91, 0.22);
}

.crew-car-wheel.front-left {
  top: 47px;
  left: 99px;
}

.crew-car-wheel.front-right {
  top: 47px;
  right: 99px;
}

.crew-car-wheel.rear-left {
  bottom: 35px;
  left: 99px;
}

.crew-car-wheel.rear-right {
  right: 99px;
  bottom: 35px;
}

.crew-car-mirror {
  position: absolute;
  top: 38px;
  z-index: 0;
  width: 13px;
  height: 7px;
  border-radius: 3px;
  background: #151a1e;
  box-shadow: 0 0 0 1px rgba(224, 183, 91, 0.28);
}

.crew-car-mirror.left {
  left: 91px;
}

.crew-car-mirror.right {
  right: 91px;
}


/*
.crew-car-hood {
  position: absolute;
  top: 5px;
  left: calc(var(--crew-car-shell-left) + 20px);
  z-index: 2;
  width: calc(var(--crew-car-shell-width) - 40px);
  height: 24px;
  border-radius: 28px 28px 7px 7px;
  border-top: 1px solid rgba(246, 241, 228, 0.1);
  background: rgba(33, 41, 48, 0.58);
}*/

.crew-car-windshield {
  position: relative;
  z-index: 2;
  top: -14px;
  width: 96px;
  height: 20px;
  border: 1px solid rgba(102, 200, 176, 0.42);
  border-radius: 14px 14px 14px 14px;
  background: rgba(11, 20, 24, 0.82);
  box-shadow: inset 0 0 0 1px rgba(102, 200, 176, 0.08);
}

.crew-car-steering-wheel {
  position: absolute;
  top: 47px;
  left: 139px;
  z-index: 2;
  width: 17px;
  height: 17px;
  border: 3px solid rgba(207, 212, 198, 0.72);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(20, 24, 31, 0.85);
}

.crew-car-steering-wheel::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 2px;
  height: 8px;
  background: rgba(207, 212, 198, 0.72);
  transform: translateX(-50%);
}

.crew-car-trunk {
  position: absolute;
  right: calc(var(--crew-car-shell-left) + 20px);
  bottom: 4px;
  left: calc(var(--crew-car-shell-left) + 20px);
  z-index: 1;
  display: grid;
  place-items: center;
  height: 66px;
  padding: 4px 0;
  border: 1px solid rgba(224, 183, 91, 0.26);
  border-radius: 3px;
  background: rgba(12, 15, 20, 0.18);
}

.crew-car-seat-rows {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
}

.crew-car-seat-row {
  display: grid;
  grid-template-columns: 96px var(--car-seat-size) var(--car-seat-size) 96px;
  align-items: center;
  gap: 8px;
  width: max-content;
}

.crew-car-seat {
  display: grid;
  place-items: center;
  width: var(--car-seat-size);
  height: var(--car-seat-size);
  border: 1px solid rgba(207, 212, 198, 0.28);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.crew-car-seat.driver-seat {
  border-color: rgba(102, 200, 176, 0.55);
}

.crew-car-seat.filled {
  border-color: rgba(224, 183, 91, 0.42);
  background: rgba(224, 183, 91, 0.08);
}

.crew-car-seat.missing {
  visibility: hidden;
}

.crew-seat-pip {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 3px solid var(--survivor-stroke, #111511);
  border-radius: 50%;
  background: var(--survivor-fill, #e8e9df);
  color: var(--survivor-text, #171b17);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.42);
}

.crew-seat-pip.empty {
  border-width: 1px;
  border-style: dashed;
  border-color: rgba(207, 212, 198, 0.34);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(207, 212, 198, 0.52);
  box-shadow: none;
}

.crew-seat-pip.role-driver {
  box-shadow: 0 0 0 2px rgba(102, 200, 176, 0.22);
}

.crew-seat-pip.role-coordinator {
  box-shadow: 0 0 0 2px rgba(77, 153, 179, 0.26);
}

.crew-seat-job {
  min-width: 0;
  color: #cdd4c6;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: normal;
}

.crew-seat-job.left {
  /* Keep clear of the jerry can standing at the car's left flank. */
  padding-left: 42px;
  text-align: right;
}

.crew-seat-job.right {
  text-align: left;
}

/* --- Fuel jerry can: the sortie's action points as countable pips. ------- */
.fuel-gauge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0; /* the spout shoulder sits flush on the can body */
}

/* Jerry-can shoulder: ribbed pour spout (left) + carry-handle arch (right),
   drawn above the body so the whole thing reads as a fuel can, not a battery.
   Its base overlaps the body's top border by 2px so the parts connect. */
.fuel-gauge-spout {
  display: block;
  width: 52px;
  height: 22px;
  margin-bottom: -2px;
  position: relative;
  z-index: 1;
}

.fuel-gauge-spout svg {
  display: block;
}

.fuel-gauge-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 52px;
  padding: 7px 0;
  border: 2.5px solid rgba(224, 183, 91, 0.7);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(31, 38, 45, 0.94), rgba(18, 21, 27, 0.92));
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.34) inset;
}

.fuel-pip {
  width: 24px;
  height: 6px;
  border: 1px solid rgba(224, 183, 91, 0.5);
  border-radius: 3px;
  background: rgba(224, 183, 91, 0.88);
  box-shadow: inset 0 1px 0 rgba(246, 241, 228, 0.3);
}

/* Driver-skill bonus fuel rides on top with the driver's teal ring. */
.fuel-pip.bonus {
  border-color: rgba(102, 200, 176, 0.85);
  box-shadow: inset 0 1px 0 rgba(246, 241, 228, 0.3), 0 0 0 1px rgba(102, 200, 176, 0.4);
}

/* Pips the current plan is about to burn: lit ember, gently pulsing. */
.fuel-pip.pending {
  border-color: rgba(229, 133, 91, 0.9);
  background: #e0855b;
  animation: fuel-pip-pulse 1.2s ease-in-out infinite alternate;
}

/* Already burned this sortie: an empty socket. */
.fuel-pip.spent {
  border: 1px dashed rgba(207, 212, 198, 0.3);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  animation: none;
}

@keyframes fuel-pip-pulse {
  from { opacity: 1; }
  to { opacity: 0.45; }
}

.fuel-gauge-label {
  color: #cdd4c6;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.fuel-gauge-count {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.fuel-gauge.overdrawn .fuel-gauge-count {
  color: #e5675b;
}

.fuel-gauge-over {
  color: #e5675b;
  font-size: 10px;
  font-weight: 800;
}

/* The can stands at the car's left flank, full height to play with. */
.crew-car-fuel {
  position: absolute;
  top: 50%;
  left: 4px;
  z-index: 2;
  transform: translateY(-50%);
}

/* --- Trunk cargo: a rectangular grid of cargo slots. --------------------- */
.trunk-pips {
  display: grid;
  gap: 3px;
  justify-items: center;
}

.trunk-pip-row {
  display: flex;
  gap: 3px;
}

.trunk-pip {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(207, 212, 198, 0.26);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
}

.trunk-pip.loaded {
  border-color: rgba(224, 183, 91, 0.6);
  background: rgba(224, 183, 91, 0.85);
  box-shadow: inset 0 1px 0 rgba(246, 241, 228, 0.3);
}

/* Slots the plan will pack (food for lookouts) glow like pending fuel. */
.trunk-pip.pending {
  border-color: rgba(229, 133, 91, 0.9);
  background: #e0855b;
  animation: fuel-pip-pulse 1.2s ease-in-out infinite alternate;
}

/* Fuzzy estimated scavenge haul: hatched ghost slots, not a promise. */
.trunk-pip.ghost {
  border-color: rgba(224, 183, 91, 0.5);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(224, 183, 91, 0.42) 0,
      rgba(224, 183, 91, 0.42) 1.5px,
      rgba(224, 183, 91, 0.08) 1.5px,
      rgba(224, 183, 91, 0.08) 3px
    );
}

/* Trunk tops out: the surplus crates at the site. Sits above the bumper. */
.trunk-overflow {
  position: absolute;
  right: -6px;
  bottom: -14px;
  padding: 1px 4px;
  border: 1px solid rgba(224, 183, 91, 0.55);
  border-radius: 4px;
  background: rgba(23, 27, 23, 0.94);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

/* --- Live mission dashboard: same gauges, out in the field. -------------- */
.mission-vehicle-status {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 22px;
  margin: 4px 0 10px;
  padding: 10px 8px;
  border: 1px solid rgba(207, 212, 198, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
}

.mission-trunk {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* TODO: design a compact touch layout for the crew car diagram. */
@media (max-width: 720px) {
  .mission-crew-diagram {
    display: none;
  }
}

/* Cursor-anchored stop popup (pick a survivor, then an action). */
.stop-action-popup .maplibregl-popup-content {
  padding: 8px;
  border: 1px solid rgba(224, 183, 91, 0.55);
  border-radius: 9px;
  background: #14181f;
  color: var(--ink);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

.stop-action-popup .maplibregl-popup-tip {
  border-top-color: #14181f;
  border-bottom-color: #14181f;
}

.stop-action-popup .maplibregl-popup-close-button {
  color: var(--muted);
  font-size: 16px;
}

.stop-popup-title {
  margin: 2px 4px 6px;
  color: var(--muted);
  font-size: 11px;
}

.stop-popup-list {
  display: grid;
  gap: 4px;
}

.stop-popup-option {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.stop-popup-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(224, 183, 91, 0.12);
}

.stop-popup-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stop-popup-back {
  margin-top: 6px;
  padding: 2px;
  color: var(--muted);
  font-size: 11px;
}

/* Map-anchored building inspection popup (reuses .stop-action-popup chrome). */
.building-inspect-guidance {
  margin: 0 4px 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}

.selected-tile-card {
  width: 174px;
  max-width: 174px;
}

.selected-tile-name {
  display: block;
  margin: 0 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-tile-name {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}

.selected-tile-name.fallback {
  font-size: 12px;
}

.selected-tile-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 22px;
  margin-top: 8px;
  margin-bottom: 2px;
}

.selected-tile-status i {
  display: grid;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.selected-tile-status-check {
  color: #0f2519;
  background: #8de1a9;
  font-weight: 900;
}

.selected-tile-status-muted {
  border: 1px solid rgba(207, 212, 198, 0.48);
  color: var(--muted);
  font-weight: 900;
}

.selected-tile-status-spinner {
  border-width: 2px;
}

.building-inspect-establish {
  width: 100%;
  margin-bottom: 6px;
}

.review-plan-list {
  margin: 6px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.review-plan-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(54px, auto) minmax(66px, auto);
  align-items: end;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 0 9px;
  color: rgba(207, 212, 198, 0.62);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-plan-header.editable {
  grid-template-columns: 16px minmax(0, 1fr) minmax(54px, auto) minmax(66px, auto) 24px;
}

.review-plan-heading-fuel,
.review-plan-heading-supplies {
  text-align: center;
}

.review-plan-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(54px, auto) minmax(66px, auto);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid rgba(207, 212, 198, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.review-plan-list.editable .review-plan-step {
  grid-template-columns: 16px minmax(0, 1fr) minmax(54px, auto) minmax(66px, auto) 24px;
}

.review-plan-step[draggable="true"] {
  cursor: grab;
}

/* The implicit last leg: fuel home is spent like any other row, so it's
   priced on the track too — just not draggable or removable. */
.review-plan-step.review-plan-return {
  border-style: dashed;
  color: var(--muted);
}

/* Per-row fuel price: countable mini pips matching the jerry-can gauge. */
.plan-step-cost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 54px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.plan-step-cost.empty,
.plan-step-supplies.empty {
  color: rgba(207, 212, 198, 0.38);
}

.plan-step-supplies.negative {
  color: #e6a08b;
}

.fuel-mini-pip {
  display: inline-block;
  width: 9px;
  height: 6px;
  border: 1px solid rgba(224, 183, 91, 0.65);
  border-radius: 2px;
  background: rgba(224, 183, 91, 0.8);
}

.review-plan-step.dragging {
  opacity: 0.45;
}

.review-plan-step.drag-over {
  border-color: rgba(224, 183, 91, 0.65);
  background: rgba(224, 183, 91, 0.1);
}

.plan-step-handle {
  color: rgba(207, 212, 198, 0.56);
  font-size: 14px;
  letter-spacing: -0.12em;
  cursor: grab;
}

.plan-step-text {
  min-width: 0;
}

.plan-step-supplies {
  display: inline-flex;
  justify-content: center;
  min-width: 66px;
  color: #cfeefa;
  font-size: 11px;
  font-weight: 800;
}

.plan-step-remove {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(213, 120, 91, 0.38);
  border-radius: 50%;
  background: rgba(213, 120, 91, 0.08);
  color: #e6a08b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.plan-step-remove:hover {
  border-color: rgba(213, 120, 91, 0.76);
  background: rgba(213, 120, 91, 0.18);
}

.review-plan-empty {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
}

.review-plan-stats {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.plan-eta {
  color: var(--ink);
  font-weight: 700;
}

/* Trip lands after dark — the daylight envelope is about to bind. */
.plan-eta.past-dusk {
  color: var(--accent);
}

.plan-step-warn {
  color: #e5675b;
  font-weight: 700;
}

.review-plan-warn {
  margin: 8px 0 0;
  padding: 7px 9px;
  border: 1px solid rgba(229, 103, 91, 0.5);
  border-radius: 7px;
  color: #f0a79c;
  background: rgba(229, 103, 91, 0.12);
  font-size: 11px;
  line-height: 1.35;
}

@keyframes resources-reveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  60% {
    opacity: 1;
    transform: translateY(0);
    filter: drop-shadow(0 0 12px rgba(224, 183, 91, 0.42));
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: none;
  }
}

#map {
  position: fixed;
  inset: 0;
}

.day-title-card {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-content: center;
  gap: 10px;
  color: var(--ink);
  background: #020302;
  text-align: center;
  pointer-events: none;
}

.day-title-card.visible {
  animation: day-title-card 1500ms ease-in-out forwards;
}

.day-title-card p {
  margin: 0;
}

.day-title-card p {
  color: var(--accent);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

@keyframes day-title-card {
  0% {
    opacity: 0;
  }
  18%,
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.name-reveal-card {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-content: center;
  gap: 12px;
  color: var(--ink);
  background: rgba(2, 3, 2, 0.88);
  text-align: center;
  pointer-events: none;
}

.name-reveal-card.visible {
  animation: name-reveal-card 2100ms ease-in-out forwards;
}

.name-reveal-card p {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.name-reveal-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 180px);
  align-items: baseline;
  gap: 16px;
}

.name-reveal-row span,
.name-reveal-row b {
  display: block;
}

.name-reveal-row span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  text-align: right;
}

.name-reveal-row b {
  color: var(--ink);
  font-size: 34px;
  font-weight: 900;
  text-align: left;
}

@keyframes name-reveal-card {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  16%,
  76% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.01);
  }
}

#map::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at center, transparent 35%, rgba(9, 12, 9, 0.34) 100%),
    repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(0, 0, 0, 0.025) 4px);
}

#map::before {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  content: "";
  background: #020302;
  opacity: 0;
}

body.prologue-day1-map-hidden #map::before {
  opacity: 1;
}

body.prologue-day1-map-hidden .maplibregl-control-container {
  display: none;
}

.maplibregl-marker,
.maplibregl-marker * {
  pointer-events: none !important;
}

.pharmacy-search-marker {
  --pharmacy-search-radius: 88px;
  position: relative;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none !important;
}

.pharmacy-search-marker-fill,
.pharmacy-search-marker-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--pharmacy-search-radius);
  height: var(--pharmacy-search-radius);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.pharmacy-search-marker-fill {
  border: 3px solid #c96d73;
  background: rgba(201, 109, 115, 0.14);
  opacity: 0.78;
  box-shadow: 0 0 18px rgba(201, 109, 115, 0.16);
}

.pharmacy-search-marker-pulse {
  border: 2px solid rgba(242, 219, 165, 0.72);
  background: transparent;
  opacity: 0.42;
  transform: translate(-50%, -50%) scale(1.08);
}

.building-clear-marker {
  --clear-marker-ring-size: 28px;
  position: relative;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none !important;
}

.building-clear-marker-pulse,
.building-clear-marker-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--clear-marker-ring-size);
  height: var(--clear-marker-ring-size);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.building-clear-marker-pulse {
  /* Potential perf hot spot: active building work can overlap with map source
     updates, so keep this pulse simple or static if operation UI gets janky. */
  border: 2px solid rgba(224, 183, 91, 0.8);
  background: rgba(224, 183, 91, 0.08);
  animation: building-clear-marker-pulse 1200ms ease-out infinite;
}

.building-clear-marker[data-mode="stakeout"] .building-clear-marker-pulse {
  animation-duration: 1500ms;
}

.building-clear-marker-ring {
  border: 4px solid rgba(224, 183, 91, 0.95);
  background: rgba(224, 183, 91, 0.06);
  box-shadow: 0 0 16px rgba(224, 183, 91, 0.2);
}

.building-clear-marker-label {
  position: absolute;
  left: 50%;
  top: calc(50% + 20px);
  max-width: 112px;
  color: #f2dba5;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-shadow:
    0 0 3px #252b24,
    0 0 3px #252b24,
    0 1px 2px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  transform: translateX(-50%);
  white-space: normal;
}

@keyframes building-clear-marker-pulse {
  from {
    opacity: 0.46;
    transform: translate(-50%, -50%) scale(1.25);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2);
  }
}

.noisemaker-ring-marker {
  position: relative;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none !important;
}

.noisemaker-ring-marker-pulse {
  /* Potential perf hot spot: each active noisemaker owns an infinite scaling
     ring, so stacked noisemakers multiply the animation cost. */
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 3px solid #66c8b0;
  border-radius: 50%;
  background: rgba(102, 200, 176, 0.05);
  animation: noisemaker-ring-marker-pulse 1800ms linear infinite;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

@keyframes noisemaker-ring-marker-pulse {
  from {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(8.25);
  }
}

#map-veil {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: #020302;
}

body:not(.map-booting):not(.fog-pending):not(.saved-game-restoring) #map-veil {
  display: none;
}

body.saved-game-restoring #map-veil {
  z-index: 12;
  pointer-events: auto;
}

body.saved-game-restoring .topbar,
body.saved-game-restoring .mobile-resource-hud,
body.saved-game-restoring .utility-menu,
body.saved-game-restoring .event-log-panel,
body.saved-game-restoring .release-log-panel,
body.saved-game-restoring .map-hint,
body.saved-game-restoring .poi-research-legend,
body.saved-game-restoring .dispatch-panel {
  pointer-events: none;
  user-select: none;
}

.map-veil-status {
  display: grid;
  gap: 6px;
  width: min(300px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid rgba(224, 183, 91, 0.34);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(17, 21, 17, 0.92);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42);
}

.map-veil-status b {
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
}

.map-veil-status span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.map-veil-cancel {
  justify-self: start;
  margin-top: 6px;
  padding: 6px 0;
  color: #f0d98f;
}

.maplibregl-ctrl-bottom-right {
  bottom: calc(var(--drawer-visible-height, 120px) + 5px);
  transition: bottom 220ms ease;
}

.maplibregl-ctrl-attrib {
  font-size: 9px;
}

.topbar,
.resources,
.mobile-resource-hud,
.map-hint,
.poi-research-legend,
.dispatch-panel,
.utility-menu,
.event-log-panel,
.release-log-panel,
.toast {
  position: fixed;
  z-index: 5;
}

.utility-menu {
  top: calc(48px + env(safe-area-inset-top));
  right: 10px;
  z-index: 20;
  width: min(250px, calc(100% - 20px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(23, 27, 23, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

.utility-action {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 38px;
  color: var(--ink);
  text-align: left;
}

.utility-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(242, 219, 165, 0.14);
}

.utility-section-label {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.utility-section-danger {
  border-top-color: rgba(232, 86, 75, 0.28);
}

.danger-action {
  color: #ffb1a9;
  border-color: rgba(232, 86, 75, 0.38);
}

.report-lag-status {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-soft, rgba(242, 219, 165, 0.75));
}

.report-lag-note {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(242, 219, 165, 0.22);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
  font: inherit;
  resize: vertical;
}

.report-lag-mute-toggle {
  margin-top: 8px;
}

.auth-menu-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  width: 100%;
  min-height: 48px;
  margin: 10px 0 8px;
  padding: 9px 10px;
  border: 1px solid rgba(242, 219, 165, 0.22);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
}

.auth-menu-card:hover {
  border-color: rgba(242, 219, 165, 0.48);
  background: rgba(242, 219, 165, 0.08);
}

.auth-menu-card.signed-in {
  border-color: rgba(102, 200, 176, 0.36);
  background: rgba(102, 200, 176, 0.08);
}

.auth-menu-card span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.auth-menu-card b {
  align-self: center;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#end-day-button.blocked-action {
  border-color: rgba(212, 83, 74, 0.55);
}

/* Compound selector so these win over the later `.dispatch-button` primary
   rules (equal single-class specificity would otherwise let the filled accent
   background/dark text override). Keeps End day as a yellow outline button. */
.dispatch-button.end-day-secondary-button {
  border: 1px solid rgba(224, 183, 91, 0.65);
  color: var(--accent);
  background: transparent;
}

.dispatch-button.end-day-secondary-button:hover:not(:disabled) {
  background: rgba(224, 183, 91, 0.08);
  filter: none;
}

.mission-action-note {
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.build-version {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.build-version b {
  color: var(--ink);
}

.build-version code {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.poi-research-legend {
  display: none;
  top: calc(108px + env(safe-area-inset-top));
  left: 8px;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(23, 27, 23, 0.9);
  font-size: 10px;
}

body.show-poi-legend .poi-research-legend {
  display: grid;
}

.poi-research-legend b,
.poi-research-legend span,
.poi-research-legend small {
  display: flex;
  align-items: center;
  gap: 5px;
}

.poi-research-legend small {
  color: var(--muted);
}

.poi-research-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.potential-dot {
  border: 1px solid #f2dba5;
  background: transparent;
}

.poi-research-legend .resource-icon {
  width: 12px;
  height: auto;
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  line-height: 1;
  text-align: center;
}

.research-poi-popup .maplibregl-popup-content {
  min-width: 190px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(23, 27, 23, 0.98);
}

.research-poi-popup p,
.research-poi-popup h3,
.research-poi-popup span {
  display: block;
  margin: 0;
}

.research-poi-popup p {
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.research-poi-popup h3 {
  margin: 3px 0 7px;
  font-size: 14px;
}

.research-poi-popup span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.topbar {
  top: 0;
  left: 0;
  width: 100%;
  padding: calc(9px + env(safe-area-inset-top)) 12px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(to bottom, rgba(17, 21, 17, 0.96), rgba(17, 21, 17, 0.76), transparent);
  pointer-events: none;
}

.topbar h1 {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.topbar h1 b {
  color: var(--accent);
  font-size: 17px;
  letter-spacing: 0.12em;
}

#game-clock {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.event-log-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-log-toggle b {
  display: inline-grid;
  min-width: 18px;
  min-height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #171b17;
  background: var(--accent);
  font-size: 10px;
}

.event-log-toggle b:empty {
  display: none;
}

.event-log-panel {
  top: calc(86px + env(safe-area-inset-top));
  right: 10px;
  z-index: 18;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100% - 20px));
  max-height: min(62vh, 520px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(23, 27, 23, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.release-log-panel {
  top: calc(86px + env(safe-area-inset-top));
  right: 10px;
  z-index: 18;
  display: flex;
  flex-direction: column;
  width: min(520px, calc(100% - 20px));
  max-height: min(70vh, 680px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(23, 27, 23, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.event-log-header,
.release-log-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.event-log-header h2,
.release-log-header h2 {
  margin: 3px 0 0;
  font-size: 16px;
}

.event-log-list,
.release-log-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.event-log-empty,
.release-log-empty,
.release-log-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.release-log-list {
  gap: 0;
}

.release-log-entry {
  display: grid;
  grid-template-columns: minmax(96px, 124px) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(226, 231, 213, 0.11);
}

.release-log-entry:last-child {
  border-bottom: 0;
}

.release-log-time {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

.release-log-main {
  min-width: 0;
}

.release-log-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.release-log-title a {
  color: inherit;
  text-decoration: none;
}

.release-log-title a:hover,
.release-log-title a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.release-log-pr {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.release-log-highlight {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.event-log-entry {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(226, 231, 213, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.event-log-entry.urgent {
  border-color: rgba(224, 183, 91, 0.46);
  background: rgba(224, 183, 91, 0.08);
}

.event-log-entry header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.event-log-entry h3 {
  margin: 0;
  font-size: 12px;
}

.event-log-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-log-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(224, 183, 91, 0.82);
  outline-offset: 2px;
}

.icon-button,
.text-button {
  border: 1px solid var(--line);
  background: rgba(25, 30, 25, 0.86);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  pointer-events: auto;
}

.topbar h1 .icon-button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  font-size: 18px;
}

.center-base-button {
  display: none;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  font-size: 17px;
}

.resources {
  position: static;
  display: none;
  gap: 4px;
  width: auto;
  margin-bottom: 8px;
  padding: 2px;
  overflow-x: auto;
  border: 1px solid rgba(226, 231, 213, 0.1);
  border-radius: 7px;
  background: rgba(17, 21, 17, 0.72);
  scrollbar-width: none;
}

.mobile-resource-hud[hidden] {
  display: none;
}

.resources span {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(23, 27, 23, 0.86);
  font-size: 10px;
  text-transform: uppercase;
}

.resources b {
  color: var(--ink);
}

.resources em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.06em;
}

.mobile-resource-hud {
  top: calc(50px + env(safe-area-inset-top));
  left: 8px;
  pointer-events: auto;
}

.mobile-resource-toggle {
  display: grid;
  gap: 4px;
  width: 50px;
  padding: 4px;
  border: 1px solid rgba(226, 231, 213, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(17, 21, 17, 0.82);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: width 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mobile-resource-hud.expanded .mobile-resource-toggle {
  width: 138px;
  border-color: rgba(224, 183, 91, 0.34);
  background: rgba(17, 21, 17, 0.92);
}

.mobile-resource-toggle span {
  display: grid;
  grid-template-columns: 16px minmax(22px, 1fr);
  align-items: center;
  gap: 3px;
  min-height: 22px;
}

.mobile-resource-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
}

.mobile-resource-toggle b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
}

.mobile-resource-toggle em {
  display: none;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-resource-hud.expanded .mobile-resource-toggle span {
  grid-template-columns: 16px minmax(0, 1fr) auto;
}

.mobile-resource-hud.expanded .mobile-resource-toggle em {
  display: block;
}

.resource-food {
  border: 2px solid #d6b24a;
  transform: rotate(45deg) scale(0.74);
}

.resource-materials::before,
.resource-materials::after {
  position: absolute;
  content: "";
  border: 1px solid #a7ad9f;
  background: rgba(167, 173, 159, 0.34);
}

.resource-materials::before {
  top: 2px;
  left: 1px;
  width: 9px;
  height: 6px;
}

.resource-materials::after {
  right: 1px;
  bottom: 2px;
  width: 9px;
  height: 6px;
}

.resource-fuel {
  border-radius: 70% 45% 70% 45%;
  background: #7fb8a9;
  transform: rotate(45deg) scale(0.78);
}

.resource-medicine::before,
.resource-medicine::after {
  position: absolute;
  content: "";
  border-radius: 1px;
  background: #9fd08e;
}

.resource-medicine::before {
  top: 1px;
  left: 6px;
  width: 3px;
  height: 12px;
}

.resource-medicine::after {
  top: 6px;
  left: 1px;
  width: 12px;
  height: 3px;
}

.map-hint {
  top: calc(86px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 7px 8px 7px 11px;
  transform: translateX(-50%);
  border: 1px solid rgba(224, 183, 91, 0.4);
  border-radius: 20px;
  color: #f2dba5;
  background: rgba(32, 32, 24, 0.88);
  font-size: 12px;
  text-align: center;
  transition: opacity 180ms ease;
  pointer-events: auto;
}

.map-hint button {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(242, 219, 165, 0.28);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(17, 21, 17, 0.72);
  font-size: 12px;
  line-height: 1;
}

body.toast-visible .map-hint {
  opacity: 0;
  pointer-events: none;
}

.dispatch-panel {
  position: fixed;
  display: flex;
  flex-direction: column;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: min(68vh, calc(100vh - 116px));
  padding: 6px 14px calc(9px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  background: var(--paper);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  transform: translateY(0);
  transition: transform 220ms ease;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.dispatch-panel.collapsed {
  padding-bottom: 0;
  transform: translateY(calc(100% - var(--drawer-collapsed-visible-height) - env(safe-area-inset-bottom)));
  overflow: hidden;
}

@supports (height: 100dvh) {
  .dispatch-panel {
    max-height: min(68dvh, calc(100dvh - 116px));
  }
}

.dispatch-panel.drawer-scrollable:not(.collapsed):not(.drawer-at-bottom)::after {
  position: sticky;
  order: 999;
  bottom: calc(-9px - env(safe-area-inset-bottom));
  display: block;
  height: 34px;
  margin: -34px -14px calc(-9px - env(safe-area-inset-bottom));
  pointer-events: none;
  content: "";
  background: linear-gradient(to bottom, rgba(23, 27, 23, 0), rgba(23, 27, 23, 0.94));
}

.grabber {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 28px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(242, 219, 165, 0.16);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.dispatch-panel.collapsed .grabber {
  width: 42px;
  color: #171b17;
  border-color: rgba(224, 183, 91, 0.58);
  background: var(--accent);
}

.dispatch-panel.collapsed .panel-heading {
  align-items: center;
}

.dispatch-panel.collapsed .panel-heading .eyebrow,
.dispatch-panel.collapsed .selection-detail,
.dispatch-panel.collapsed .state-guidance,
.dispatch-panel.collapsed #screen-territory,
.dispatch-panel.collapsed #character-creation,
.dispatch-panel.collapsed #tab-mission,
.dispatch-panel.collapsed #tab-survivors,
.dispatch-panel.collapsed #tab-bases,
.dispatch-panel.collapsed #clear-button {
  display: none;
}

.dispatch-panel.collapsed .panel-heading h2 {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  margin: 2px 46px 10px 0;
  padding: 3px;
  border: 1px solid rgba(226, 231, 213, 0.12);
  border-radius: 8px;
  background: rgba(17, 21, 17, 0.72);
}

.drawer-tabs[hidden],
.dispatch-panel.collapsed .drawer-tabs {
  display: none;
}

.drawer-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.drawer-tab.active {
  color: #171b17;
  background: var(--accent);
}

body.drawer-collapsed .maplibregl-ctrl-bottom-right {
  bottom: 73px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 42px;
}

.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.text-button {
  padding: 5px 9px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.text-button:hover,
.icon-button:hover {
  border-color: rgba(224, 183, 91, 0.52);
  color: var(--ink);
  background: rgba(35, 41, 35, 0.94);
}

.selection-detail {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.state-guidance {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.cargo-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.cargo-summary span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cargo-summary b {
  font-size: 13px;
}

.building-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 7px;
}

.building-actions .dispatch-button {
  flex: 1 1 auto;
  min-width: 0;
}

.building-actions .stakeout-action {
  color: #10261f;
  background: #66c8b0;
  box-shadow: 0 0 0 1px rgba(191, 241, 229, 0.28) inset;
}

.building-debug {
  margin-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.building-debug summary {
  padding: 9px 0 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.building-debug-fields {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.building-debug-fields span {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
}

.building-debug-fields i {
  color: var(--muted);
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.building-debug-fields b {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.discovery-route-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 11px;
}

.location-search {
  margin: 0 0 10px;
}

.location-search label {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.location-search div {
  display: flex;
  gap: 5px;
}

.location-search input {
  min-width: 0;
  flex: 1;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 12px;
}

.location-search input:focus {
  border-color: var(--accent);
  outline: none;
}

.location-search small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.gated-search-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid rgba(242, 219, 165, 0.28);
  border-radius: 5px;
  color: var(--accent);
  background: rgba(242, 219, 165, 0.08);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.search-ready-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(102, 200, 176, 0.36);
  border-radius: 5px;
  color: #bff1d8;
  background: rgba(102, 200, 176, 0.1);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.territory-picker {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.territory-picker-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.territory-picker-heading::-webkit-details-marker {
  display: none;
}

.territory-picker-heading::after {
  color: var(--muted);
  content: "+";
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.territory-picker[open] .territory-picker-heading::after {
  content: "-";
}

.territory-picker-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.territory-load-actions {
  display: grid;
  margin: 2px 0 8px;
}

.territory-load-actions .dispatch-button {
  width: 100%;
}

.territory-list {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.territory-option {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 7px 58px 17px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.territory-option:hover {
  border-color: rgba(224, 183, 91, 0.45);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

.territory-option.active {
  border-color: rgba(224, 183, 91, 0.76);
  background: rgba(224, 183, 91, 0.09);
  box-shadow: 0 0 0 1px rgba(224, 183, 91, 0.22) inset;
}

.territory-option.older-version {
  border-color: rgba(213, 120, 91, 0.58);
}

.territory-option.generated-ready {
  animation: generated-territory-pulse 1300ms ease-in-out 5;
  border-color: rgba(159, 208, 142, 0.86);
  background: rgba(159, 208, 142, 0.1);
}

.territory-option:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.territory-label {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.territory-ready {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 6px;
  border: 1px solid rgba(226, 231, 213, 0.14);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.15;
  background: rgba(255, 255, 255, 0.035);
  text-transform: uppercase;
  white-space: nowrap;
}

.territory-option.ready .territory-ready {
  border-color: rgba(159, 208, 142, 0.34);
  color: #9fd08e;
  background: rgba(159, 208, 142, 0.1);
}

.territory-option.not-ready .territory-ready {
  border-color: rgba(213, 120, 91, 0.28);
  color: #e0b75b;
  background: rgba(224, 183, 91, 0.08);
}

.territory-note,
.territory-tile,
.territory-version,
.territory-version-warning {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
}

.territory-version {
  position: absolute;
  right: 8px;
  bottom: 5px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.territory-version:empty {
  display: none;
}

.territory-version-part.outdated {
  color: #d5785b;
}

.territory-version-warning {
  position: absolute;
  right: 8px;
  bottom: 5px;
  color: #d5785b;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
}

.territory-note {
  display: block;
  overflow: hidden;
  padding-right: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.territory-empty-state {
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 10px;
  place-content: center start;
  border: 1px dashed rgba(226, 231, 213, 0.18);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.territory-empty-state b {
  color: var(--ink);
  font-size: 12px;
}

.territory-empty-state span {
  font-size: 11px;
  line-height: 1.35;
}

.territory-uploader-note {
  grid-column: 1;
  grid-row: 3;
  text-align: left;
}

.poi-load-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 6px;
}

.poi-load-row .text-button {
  flex: 1;
  color: var(--ink);
}

.poi-load-row span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.poi-load-row b {
  color: var(--ink);
}

.route-editor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.route-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 3px;
}

.route-summary span {
  color: var(--muted);
  font-size: 11px;
}

.route-summary b {
  font-size: 11px;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.route-actions .text-button {
  color: var(--ink);
}

.route-actions .text-button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.survivor-roster {
  margin: 8px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 231, 213, 0.12);
}

.play-mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0 10px;
}

.play-mode-option {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: inherit;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
}

.play-mode-option.active {
  border-color: var(--accent);
  background: rgba(224, 183, 91, 0.1);
}

.play-mode-option b,
.play-mode-option span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-mode-option b {
  color: var(--ink);
  font-size: 11px;
}

.play-mode-option span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.play-mode-option.campaign-disabled {
  opacity: 0.74;
  cursor: not-allowed;
}

.play-mode-option.campaign-disabled::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: 50%;
  border-top: 2px solid rgba(255, 63, 63, 0.9);
  transform: rotate(-14deg);
  transform-origin: center;
  pointer-events: none;
}

.play-mode-option.campaign-disabled b,
.play-mode-option.campaign-disabled span {
  color: #ff8888;
}

.play-mode-lock-note {
  display: block;
  margin: 4px 2px 6px;
  color: #ff7b7b;
  font-size: 11px;
  font-weight: 700;
}

.play-mode-option.campaign-available {
  opacity: 1;
}

.survivor-roster-list {
  display: flex;
  gap: 7px;
  margin-top: 6px;
  padding: 1px 2px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.survivor-roster-card {
  position: relative;
  display: grid;
  flex: 0 0 68px;
  grid-template-rows: 32px auto;
  justify-items: center;
  gap: 4px;
  min-width: 68px;
  width: 68px;
  padding: 6px 5px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: inherit;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.survivor-roster-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background:
    linear-gradient(
      to right,
      #e0b75b 0 calc(var(--survivor-health-ratio, 0) * 100%),
      rgba(224, 183, 91, 0.16) calc(var(--survivor-health-ratio, 0) * 100%) 100%
    );
}

.survivor-roster-card.selected {
  border-color: var(--accent);
  background: rgba(224, 183, 91, 0.1);
}

.survivor-roster-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.survivor-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--survivor-stroke, rgba(242, 219, 165, 0.46));
  border-radius: 6px;
  color: var(--survivor-text, var(--ink));
  background: var(--survivor-fill, rgba(23, 27, 23, 0.88));
  font-size: 12px;
  font-weight: 700;
}

.survivor-roster-card b,
.survivor-roster-card span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.survivor-roster-card > div {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.survivor-roster-card b,
.survivor-roster-card span:not(:first-of-type) {
  display: none;
}

.survivor-roster-card b {
  color: var(--ink);
  font-size: 12px;
}

.survivor-roster-card span {
  margin-top: 0;
  color: var(--muted);
  font-size: 10px;
}

.survivor-roster-status:empty {
  display: none;
}

.survivor-detail {
  margin-top: 7px;
}

.survivor-detail-accordion {
  border: 1px solid rgba(242, 219, 165, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.survivor-detail-accordion summary {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  list-style: none;
}

.survivor-detail-accordion summary::-webkit-details-marker {
  display: none;
}

.survivor-detail-accordion summary::after {
  content: "v";
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 5px;
  color: #f6f4ea;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  font-weight: 900;
  transition: transform 160ms ease;
}

.survivor-detail-accordion[open] summary::after {
  transform: rotate(180deg);
}

.survivor-detail-accordion summary b,
.survivor-detail-accordion summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.survivor-detail-accordion summary b {
  color: var(--accent);
  font-size: 11px;
}

.survivor-detail-accordion summary span,
.survivor-detail-grid span {
  color: var(--muted);
  font-size: 10px;
}

.survivor-detail-summary-health {
  display: none;
}

.survivor-detail-summary-background {
  color: var(--muted);
}

.survivor-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  padding: 0 8px 8px;
}

.survivor-detail-grid b,
.survivor-detail-grid span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.survivor-detail-grid b {
  margin-top: 1px;
  color: var(--ink);
  font-size: 11px;
}

.survivor-detail-more {
  padding: 2px 0 7px;
}

.survivor-detail-more .survivor-detail-grid {
  margin-top: 2px;
}

.survivor-detail-alert {
  padding: 3px 5px;
  margin: -3px -5px;
  border-radius: 5px;
  animation: survivor-health-pulse 900ms ease-out 3;
}

.survivor-detail-alert span,
.survivor-detail-alert b {
  color: #ffd0bc;
}

@keyframes survivor-health-pulse {
  0% {
    background: rgba(240, 100, 69, 0.28);
    box-shadow: 0 0 0 0 rgba(240, 100, 69, 0.55);
  }

  100% {
    background: rgba(240, 100, 69, 0);
    box-shadow: 0 0 0 8px rgba(240, 100, 69, 0);
  }
}

.character-creation {
  display: grid;
  gap: 9px;
  margin: 0 0 10px;
  padding: 9px;
  border: 1px solid rgba(242, 219, 165, 0.18);
  border-radius: 7px;
  background: rgba(23, 27, 23, 0.72);
}

.character-creation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dispatch-panel.intake-open .panel-heading {
  display: none;
}

.character-creation-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.15;
}

.starter-load-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid rgba(242, 219, 165, 0.16);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.starter-load-status[data-status="ready"] {
  border-color: rgba(102, 200, 176, 0.44);
  color: #bff1d8;
  background: rgba(102, 200, 176, 0.1);
}

.starter-load-status[data-status="starting"] {
  border-color: rgba(224, 183, 91, 0.52);
  color: var(--accent);
  background: rgba(224, 183, 91, 0.12);
}

.starter-load-status[data-status="failed"] {
  border-color: rgba(240, 100, 69, 0.48);
  color: #ffd0bc;
  background: rgba(240, 100, 69, 0.1);
}

.starter-load-status i {
  display: grid;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  line-height: 1;
}

.status-spinner {
  border: 2px solid rgba(242, 219, 165, 0.18);
  border-top-color: var(--accent);
  animation: status-spin 800ms linear infinite;
}

@keyframes status-spin {
  to {
    transform: rotate(360deg);
  }
}

.starter-step-panel {
  display: grid;
  gap: 8px;
}

.starter-step-panel[hidden] {
  display: none;
}

.starter-preset-list,
.starter-slot-list {
  display: grid;
  gap: 6px;
}

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

.starter-preset-option,
.starter-slot-option {
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: inherit;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
}

.starter-preset-option {
  position: relative;
  min-height: 58px;
}

.starter-preset-option.active,
.starter-slot-option.active {
  border-color: var(--accent);
  background: rgba(224, 183, 91, 0.1);
}

.starter-preset-option:disabled {
  cursor: wait;
}

.starter-preset-option:disabled:not(.starting) {
  opacity: 0.58;
}

.starter-preset-option.starting {
  padding-right: 36px;
  border-color: rgba(224, 183, 91, 0.62);
  background: rgba(224, 183, 91, 0.14);
}

.starter-preset-option.custom {
  border-color: rgba(102, 200, 176, 0.42);
  background: rgba(102, 200, 176, 0.08);
}

.starter-preset-option.custom.active {
  border-color: rgba(102, 200, 176, 0.72);
  background: rgba(102, 200, 176, 0.14);
}

.starter-preset-option.custom b {
  color: #bff1d8;
}

.starter-preset-spinner {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
}

.starter-slot-add {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-color: rgba(102, 200, 176, 0.42);
  color: #bff1d8;
  background: rgba(102, 200, 176, 0.08);
  text-align: center;
}

.starter-slot-add:hover {
  border-color: rgba(102, 200, 176, 0.72);
  background: rgba(102, 200, 176, 0.14);
}

.starter-preset-option b,
.starter-preset-option span,
.starter-slot-option b,
.starter-slot-option span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.starter-preset-option b,
.starter-slot-option b {
  color: var(--ink);
  font-size: 11px;
}

.starter-slot-add b {
  color: #bff1d8;
  font-size: 20px;
  line-height: 1;
}

.starter-preset-option span,
.starter-slot-option span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.starter-preset-option span {
  color: rgba(226, 231, 213, 0.58);
  font-weight: 650;
}

.starter-preset-option .starter-preset-summary {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.starter-preset-option .starter-preset-detail {
  color: rgba(226, 231, 213, 0.58);
}

.starter-slot-add span {
  color: #bff1d8;
}

.starter-slot-option span {
  white-space: nowrap;
}

.starter-back-button {
  justify-self: start;
}

.starter-roster-actions {
  display: grid;
  grid-template-columns: minmax(104px, 0.42fr) minmax(0, 1fr);
  gap: 7px;
}

.starter-roster-actions .text-button,
.starter-roster-actions .dispatch-button {
  min-height: 38px;
}

.starter-roster-panel,
.starter-slot-list {
  min-width: 0;
}

.starter-roster-panel {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(242, 219, 165, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.starter-slot-list {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.starter-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 9px;
  border-top: 1px solid rgba(242, 219, 165, 0.22);
  background: rgba(2, 3, 2, 0.2);
}

.starter-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  order: 4;
}

.starter-detail-actions .text-button {
  flex: 1 1 120px;
}

.starter-detail-actions .text-button,
.dialog-actions .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.starter-remove-button {
  border-color: rgba(240, 100, 69, 0.42);
  color: #ffd0bc;
  background: rgba(240, 100, 69, 0.08);
}

.starter-remove-button:hover {
  border-color: rgba(240, 100, 69, 0.72);
  background: rgba(240, 100, 69, 0.14);
}

.danger-button {
  background: #d5785b;
}

.starter-editor label {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.starter-hometown-field {
  grid-column: 1 / -1;
}

.starter-profession-field {
  grid-column: 1 / -1;
}

.starter-hometown-field span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
}

.starter-hometown-field .text-button {
  min-height: 31px;
  padding: 0;
}

.starter-editor input,
.starter-editor select {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  padding: 6px 7px;
  border: 1px solid rgba(242, 219, 165, 0.2);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(2, 3, 2, 0.62);
  font: inherit;
  font-size: 12px;
}

.starter-background-flavor {
  grid-column: 1 / -1;
  box-sizing: border-box;
  min-height: 82px;
  margin: 0;
  padding: 8px 9px;
  border: 1px solid rgba(242, 219, 165, 0.12);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  line-height: 1.45;
}

.skill-modifier {
  font-weight: 800;
}

.skill-modifier.positive {
  color: #9fe8ba;
}

.skill-modifier.negative {
  color: #f0a389;
}

.skill-modifier.neutral {
  color: rgba(167, 173, 159, 0.68);
}

.starter-skill-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.starter-summary-label {
  grid-column: 1 / -1;
  margin: 2px 0 -3px;
  color: rgba(167, 173, 159, 0.74);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.starter-trait-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
}

.starter-trait-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.starter-trait-none {
  color: rgba(167, 173, 159, 0.62);
  font-size: 10px;
}

.starter-skill-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 6px 7px 11px;
  border: 1px solid rgba(242, 219, 165, 0.14);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  text-align: left;
}

.starter-skill-row::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 4px;
  left: 7px;
  height: 3px;
  border-radius: 99px;
  pointer-events: none;
}

.starter-skill-row.level-1::after {
  background: linear-gradient(to right, #9fe8ba 1% 24%, transparent 24% 100%);
}

.starter-skill-row.level-2::after {
  background: linear-gradient(to right, #9fe8ba 1% 24%, transparent 24% 26%, #9fe8ba 26% 49%, transparent 49% 100%);
}

.starter-skill-row.level-3::after {
  background: linear-gradient(to right, #9fe8ba 1% 24%, transparent 24% 26%, #9fe8ba 26% 49%, transparent 49% 51%, #9fe8ba 51% 74%, transparent 74% 100%);
}

.starter-skill-row.level-4::after {
  background: linear-gradient(to right, #9fe8ba 1% 24%, transparent 24% 26%, #9fe8ba 26% 49%, transparent 49% 51%, #9fe8ba 51% 74%, transparent 74% 76%, #9fe8ba 76% 99%);
}

.starter-skill-row.empty {
  border-style: dashed;
  color: rgba(167, 173, 159, 0.42);
}

.starter-skill-row i {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starter-skill-row.empty i {
  color: rgba(167, 173, 159, 0.42);
}

.starter-skill-formula {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: rgba(167, 173, 159, 0.74);
  font-size: 10px;
}

.starter-skill-formula em {
  color: rgba(167, 173, 159, 0.68);
  font-style: normal;
}

.starter-skill-formula b {
  flex: 0 0 auto;
  min-width: 18px;
  margin-top: 0;
  color: var(--ink);
  font-size: 12px;
  text-align: right;
}

.starter-skill-row.empty .starter-skill-formula,
.starter-skill-row.empty .starter-skill-formula b {
  color: rgba(167, 173, 159, 0.42);
}

.starter-trait-row {
  min-width: 0;
  padding: 7px;
  overflow: hidden;
  border: 1px solid rgba(242, 219, 165, 0.14);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starter-trait-row.positive {
  border-color: rgba(102, 200, 176, 0.54);
  color: #bff1d8;
}

.starter-trait-row.negative {
  border-color: rgba(240, 100, 69, 0.56);
  color: #ffd0bc;
}

.survivor-list {
  display: flex;
  gap: 7px;
  margin-top: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.survivor-card {
  min-width: 116px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.survivor-card.selected {
  border-color: var(--accent);
  color: var(--ink);
  background: rgba(224, 183, 91, 0.1);
}

.survivor-card b,
.survivor-card span {
  display: block;
}

.survivor-card span {
  margin-top: 2px;
  font-size: 10px;
}

.dispatch-button {
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 7px;
  color: #221d10;
  background: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:
    filter 160ms ease,
    transform 160ms ease;
}

.dispatch-button.generation-loading {
  position: relative;
  padding-left: 38px;
}

.dispatch-button.generation-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 15px;
  width: 13px;
  height: 13px;
  margin-top: -8px;
  border: 2px solid rgba(34, 29, 16, 0.24);
  border-top-color: rgba(34, 29, 16, 0.82);
  border-radius: 50%;
  animation: status-spin 800ms linear infinite;
}

.dispatch-button.generation-ready-pulse {
  animation: generated-load-button-pulse 1100ms ease-in-out infinite;
  background: #9fd08e;
}

.dispatch-button:hover:not(:disabled) {
  filter: brightness(1.08);
}

.dispatch-button:disabled {
  opacity: 0.45;
}

.dispatch-button.generation-loading:disabled {
  opacity: 0.82;
}

@keyframes generated-load-button-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(159, 208, 142, 0.0);
    filter: brightness(1);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(159, 208, 142, 0.18);
    filter: brightness(1.08);
  }
}

@keyframes generated-territory-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(159, 208, 142, 0.0);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(159, 208, 142, 0.16);
  }
}

.building-actions .secondary-base-action {
  flex: 0 1 118px;
  width: auto;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.base-summary,
.base-card {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
}

/* Highlight the card/row jumped to from a map click on an owned asset. */
.base-card.selected {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.base-card .base-card-row.selected {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
  background: rgba(224, 183, 91, 0.1);
}

.base-summary > div,
.base-card > div {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(23, 27, 23, 0.58);
}

.base-summary span,
.base-card span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.base-summary i,
.base-card i {
  font-style: normal;
}

.base-summary b,
.base-card b {
  color: var(--ink);
}

.base-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.base-card-name {
  font-size: 15px;
}

.base-card-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.scenario-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.scenario-actions .dispatch-button {
  grid-column: 1 / -1;
}

.discovery-actions {
  display: grid;
  gap: 8px;
}

.tactical-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.tactical-actions .active {
  border-color: rgba(102, 200, 176, 0.7);
  color: #bff1e5;
  background: rgba(102, 200, 176, 0.1);
}

.tactical-actions .action-button {
  display: grid;
  align-content: center;
  gap: 2px;
}

.tactical-actions .action-button small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.tactical-actions .action-button.resource-blocked {
  border-color: rgba(242, 219, 165, 0.14);
  color: rgba(226, 231, 213, 0.58);
  background: rgba(255, 255, 255, 0.018);
  cursor: not-allowed;
}

.tactical-actions .action-button.resource-flash {
  animation: resource-blocked-flash 720ms ease-out;
}

.action-button.resource-flash {
  animation: resource-blocked-flash 720ms ease-out;
}

@keyframes resource-blocked-flash {
  0% {
    border-color: rgba(240, 100, 69, 0.9);
    background: rgba(240, 100, 69, 0.16);
  }

  100% {
    border-color: rgba(242, 219, 165, 0.14);
    background: rgba(255, 255, 255, 0.018);
  }
}

.action-button {
  min-height: 40px;
  color: var(--ink);
}

.action-button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.danger-action {
  border-color: var(--danger);
  color: #f2b7a5;
}

.run-status {
  margin: 9px 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.run-status div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.run-status b {
  color: var(--ink);
}

.run-status progress {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  accent-color: var(--accent);
}

.run-status progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.1);
}

.run-status progress::-webkit-progress-value {
  background: var(--accent);
}

.debug-details {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.debug-details summary {
  width: max-content;
  margin-left: auto;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.debug-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 9px;
  margin-top: 4px;
}

.debug-stats span {
  white-space: nowrap;
}

.debug-stats b {
  color: var(--ink);
  font-weight: 600;
}

.debug-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  margin-top: 9px;
  color: #e690d7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.debug-toggle input {
  accent-color: #d95dc5;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  top: calc(126px + env(safe-area-inset-top));
  left: 50%;
  max-width: calc(100% - 36px);
  padding: 8px 8px 8px 12px;
  transform: translate(-50%, -10px);
  border: 1px solid var(--line);
  border-radius: 7px;
  opacity: 0;
  background: rgba(23, 27, 23, 0.96);
  font-size: 12px;
  text-align: left;
  transition: 180ms ease;
  pointer-events: none;
}

.toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

#toast-message {
  flex: 1 1 auto;
}

.toast-dismiss {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  line-height: 1;
}

.toast-copy {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(187, 205, 168, 0.42);
  border-radius: 6px;
  color: var(--text);
  background: rgba(118, 154, 93, 0.18);
  font-size: 11px;
  font-weight: 700;
}

.toast-copy:hover {
  background: rgba(118, 154, 93, 0.28);
}

.day-report,
.auth-dialog,
.auth-connected-dialog,
.welcome-dialog,
.end-day-dialog,
.starter-remove-dialog,
.tactical-confirm-dialog {
  width: min(360px, calc(100% - 28px));
  padding: 0;
  border: 1px solid rgba(224, 183, 91, 0.58);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(23, 27, 23, 0.98);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.58);
}

.day-report::backdrop,
.auth-dialog::backdrop,
.auth-connected-dialog::backdrop,
.welcome-dialog::backdrop,
.end-day-dialog::backdrop,
.starter-remove-dialog::backdrop,
.tactical-confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.54);
}

.day-report form,
.auth-dialog form,
.auth-connected-dialog form,
.welcome-dialog form,
.end-day-dialog form,
.starter-remove-dialog form,
.tactical-confirm-dialog form {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
}

.day-report h2,
.auth-dialog h2,
.auth-connected-dialog h2,
.welcome-dialog h2,
.end-day-dialog h2,
.starter-remove-dialog h2,
.tactical-confirm-dialog h2 {
  margin: 0;
  font-size: 20px;
}

.auth-dialog,
.welcome-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  border-color: rgba(102, 200, 176, 0.58);
}

.auth-connected-dialog {
  width: min(540px, calc(100% - 28px));
  border-color: rgba(102, 200, 176, 0.58);
}

.auth-dialog form,
.auth-connected-dialog form,
.welcome-dialog form {
  gap: 16px;
  padding: 22px;
}

.auth-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-dialog-header .text-button {
  min-width: 72px;
  justify-content: center;
}

.auth-dialog-copy {
  display: grid;
  gap: 12px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

.auth-dialog-copy p,
.auth-dialog-error,
.auth-dialog-note,
.auth-data-list {
  margin: 0;
}

.auth-data-list {
  display: grid;
  gap: 8px;
}

.auth-data-list div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(242, 219, 165, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.auth-data-list dt {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-data-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.auth-connected-done {
  justify-self: start;
  width: auto;
}

.auth-dialog-note {
  padding: 9px 10px;
  border: 1px solid rgba(224, 183, 91, 0.36);
  border-radius: 7px;
  color: var(--accent);
  background: rgba(224, 183, 91, 0.08);
  font-size: 13px;
  line-height: 1.35;
}

.auth-dialog-error {
  padding: 10px 12px;
  border: 1px solid rgba(212, 83, 74, 0.62);
  border-radius: 6px;
  color: #ffd1cd;
  background: rgba(90, 27, 24, 0.28);
  font-size: 13px;
  line-height: 1.35;
}

.auth-discord-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 9px;
  width: auto;
  min-width: 0;
  color: #fff;
  background: #5865f2;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  letter-spacing: 0;
  text-transform: none;
}

.auth-discord-button:hover:not(:disabled) {
  filter: brightness(1.03);
  background: #4752c4;
}

.auth-discord-logo {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.auth-discord-logo svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.tactical-confirm-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tactical-confirm-stats span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.tactical-confirm-stats i {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tactical-confirm-dialog {
  width: min(280px, calc(100% - 24px));
  margin: auto 12px 12px auto;
  border-color: rgba(102, 200, 176, 0.62);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.46);
}

.tactical-confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.18);
}

.tactical-confirm-dialog form {
  gap: 8px;
  padding: 10px;
}

.tactical-confirm-dialog .section-label {
  margin-bottom: -2px;
}

.tactical-confirm-dialog h2 {
  font-size: 15px;
  line-height: 1.15;
}

.tactical-confirm-dialog .selection-detail {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.tactical-confirm-dialog .action-button,
.tactical-confirm-dialog .dispatch-button {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 11px;
}

.tactical-confirm-dialog .tactical-confirm-stats {
  gap: 6px;
}

.tactical-confirm-dialog .tactical-confirm-stats span {
  padding: 6px;
}

.day-report-body {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.day-report-body span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.day-report-body .nested-report-row {
  margin-top: -3px;
  padding-left: 16px;
  font-size: 12px;
}

.day-report-body .muted-report-row {
  opacity: 0.68;
}

.day-report-body .positive-report-row b {
  color: #9fd08e;
}

.day-report-body .negative-report-row b {
  color: #e08278;
}

.mission-report-group {
  display: grid;
  gap: 7px;
}

.mission-report-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-left: 16px;
}

.mission-report-resource-box {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 42px;
  padding: 6px 7px;
  border: 1px solid rgba(226, 231, 213, 0.12);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(23, 27, 23, 0.9);
}

.mission-report-resource-box em {
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mission-report-resource-box b {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.tooltip-help {
  display: inline-grid;
  width: 16px;
  height: 16px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(226, 231, 213, 0.2);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  line-height: 1;
}

.day-report-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (min-width: 760px) {
  :root {
    --desktop-panel-right: 0px;
    --desktop-panel-width: clamp(320px, 34vw, 390px);
    --desktop-panel-top: 0px;
    --desktop-map-left: 18px;
    --desktop-map-center: calc((100vw - var(--desktop-panel-right) - var(--desktop-panel-width)) / 2);
  }

  .topbar {
    justify-content: flex-start;
    gap: 14px;
    width: calc(100% - var(--desktop-panel-right) - var(--desktop-panel-width));
    padding: calc(13px + env(safe-area-inset-top)) 18px 28px;
  }

  .topbar h1 {
    flex: 0 0 auto;
    gap: 10px;
  }

  .center-base-button:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar h1 b {
    font-size: 21px;
  }

  #game-clock {
    font-size: 15px;
  }

  .icon-button {
    width: 42px;
    height: 42px;
  }

  .topbar h1 .icon-button {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .dispatch-panel {
    top: var(--desktop-panel-top);
    right: var(--desktop-panel-right);
    bottom: 0;
    left: auto;
    width: var(--desktop-panel-width);
    max-height: none;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
    transform: none;
    touch-action: auto;
    scrollbar-color: rgba(224, 183, 91, 0.42) rgba(255, 255, 255, 0.06);
  }

  .drawer-tabs {
    margin-right: 0;
    margin-bottom: 14px;
  }

  .survivor-roster-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .survivor-roster-card {
    grid-template-rows: none;
    grid-template-columns: 34px minmax(0, 1fr);
    justify-items: stretch;
    gap: 8px;
    min-width: 0;
    width: 100%;
    padding: 7px;
    text-align: left;
  }

  .survivor-roster-card b,
  .survivor-roster-card span:not(:first-of-type) {
    display: block;
  }

  .survivor-avatar {
    width: 34px;
    height: 34px;
  }

  .panel-heading {
    align-items: center;
    padding-right: 0;
  }

  .panel-heading h2 {
    font-size: 20px;
    line-height: 1.15;
  }

  .selection-detail,
  .state-guidance {
    margin: 8px 0 12px;
    font-size: 13px;
  }

  .location-search {
    margin-bottom: 14px;
  }

  .location-search div {
    gap: 8px;
  }

  .location-search input {
    min-height: 40px;
    font-size: 13px;
  }

  .location-search small {
    font-size: 10px;
  }

  .grabber {
    display: none;
  }

  .building-actions,
  .route-editor,
  .cargo-summary,
  .discovery-route-summary {
    gap: 10px;
  }

  .building-actions {
    flex-wrap: wrap;
  }

  .building-actions .dispatch-button {
    min-width: 150px;
  }

  .building-actions .stakeout-action {
    flex-basis: 100%;
  }

  .scenario-actions,
  .discovery-actions,
  .tactical-actions {
    gap: 9px;
  }

  .discovery-actions:has(#prologue-continue-button:not([hidden])) {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(226, 231, 213, 0.12);
  }

  #prologue-continue-button {
    border-radius: 8px;
    background: #bff1d8;
    box-shadow: 0 8px 22px rgba(102, 200, 176, 0.14);
  }

  .run-status {
    margin: 12px 0;
    padding: 10px;
  }

  .dispatch-button {
    min-height: 42px;
  }

  .resources {
    display: none;
  }

  .mobile-resource-hud {
    top: calc(72px + env(safe-area-inset-top));
    left: var(--desktop-map-left);
    display: block;
    width: 142px;
    max-width: min(142px, calc(100vw - var(--desktop-panel-width) - 54px));
  }

  .mobile-resource-toggle,
  .mobile-resource-hud.expanded .mobile-resource-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    padding: 5px;
    border-radius: 8px;
    background: rgba(17, 21, 17, 0.86);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  }

  .mobile-resource-toggle span,
  .mobile-resource-hud.expanded .mobile-resource-toggle span {
    display: grid;
    grid-template-columns: 16px minmax(42px, 1fr) auto;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 34px;
    padding: 6px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(23, 27, 23, 0.9);
  }

  .mobile-resource-toggle em,
  .mobile-resource-hud.expanded .mobile-resource-toggle em {
    display: block;
    min-width: 0;
    overflow: hidden;
    font-size: 9px;
    letter-spacing: 0.05em;
    text-align: left;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .mobile-resource-toggle b {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1;
    text-align: right;
    text-overflow: ellipsis;
  }

  .map-hint {
    top: calc(72px + env(safe-area-inset-top));
    left: var(--desktop-map-center);
    max-width: min(520px, calc(100vw - var(--desktop-panel-width) - 110px));
    padding: 9px 11px 9px 14px;
    transform: translateX(-50%);
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  }

  .poi-research-legend {
    top: calc(122px + env(safe-area-inset-top));
    left: var(--desktop-map-left);
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(23, 27, 23, 0.94);
    font-size: 11px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  }

  .utility-menu {
    top: calc(70px + env(safe-area-inset-top));
    right: auto;
    left: 16px;
    width: 280px;
    border-radius: 8px;
  }

  .event-log-panel,
  .release-log-panel {
    top: calc(78px + env(safe-area-inset-top));
    right: auto;
    left: 16px;
    width: min(410px, 32vw);
    max-height: min(70vh, 680px);
    border-radius: 8px;
  }

  .release-log-panel {
    width: min(560px, calc(100vw - var(--desktop-panel-width) - 54px));
  }

  .toast {
    top: calc(92px + env(safe-area-inset-top));
    left: var(--desktop-map-center);
    max-width: min(520px, calc(100vw - var(--desktop-panel-width) - 110px));
    transform: translate(-50%, -10px);
  }

  .toast.visible {
    transform: translate(-50%, 0);
  }

  .maplibregl-ctrl-bottom-right {
    bottom: 12px;
    right: calc(var(--desktop-panel-right) + var(--desktop-panel-width) + 12px);
  }

  .maplibregl-ctrl-bottom-left {
    left: 12px;
    bottom: 8px;
  }

  .day-report,
  .end-day-dialog {
    width: min(500px, calc(100% - 48px));
  }

  .tactical-confirm-dialog {
    width: 320px;
    margin: auto 18px 18px auto;
  }
}

.mission-staffing {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}

.mission-staffing .starter-profession-field {
  position: relative;
  display: grid;
  gap: 6px;
  color: #cdd4c6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mission-staffing .starter-profession-field::after {
  position: absolute;
  right: 13px;
  bottom: 15px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #e0b75b;
  border-bottom: 2px solid #e0b75b;
  content: "";
  pointer-events: none;
  transform: rotate(45deg);
}

.mission-staffing select {
  width: 100%;
  min-height: 44px;
  padding: 10px 36px 10px 12px;
  border: 1px solid rgba(224, 183, 91, 0.28);
  border-radius: 8px;
  appearance: none;
  color: #f6f1e4;
  background:
    linear-gradient(180deg, rgba(41, 45, 35, 0.96), rgba(17, 21, 17, 0.96)),
    #171b17;
  box-shadow: inset 0 1px 0 rgba(246, 241, 228, 0.08), 0 8px 18px rgba(0, 0, 0, 0.18);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.mission-staffing select:focus {
  outline: 2px solid rgba(224, 183, 91, 0.38);
  outline-offset: 2px;
  border-color: rgba(224, 183, 91, 0.7);
}

.mission-staffing select:disabled {
  opacity: 0.55;
}

.mission-plan-summary {
  font-size: 0.9rem;
  color: #cdd4c6;
  min-height: 1.2em;
}

.mission-plan-errors {
  color: #d5785b;
}

/* Pinned to the bottom-center of the map instead of anchored to the car —
   anchoring it there covered the very roads/car the player needs to click
   to reroute, and drifted with map pan. !important overrides the inline
   transform MapLibre re-applies on every render for the geo anchor. */
.radio-call-popup {
  top: auto !important;
  right: auto !important;
  left: 50% !important;
  bottom: calc(24px + env(safe-area-inset-bottom)) !important;
  transform: translateX(-50%) !important;
}

.radio-call-popup .maplibregl-popup-tip {
  display: none;
}

.radio-call-popup .maplibregl-popup-content {
  background: rgba(18, 22, 15, 0.88);
  backdrop-filter: blur(2px);
  border: 1px solid #3a4232;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.radio-call-card .section-label {
  color: #cdd4c6;
  margin: 0 0 2px;
}

.radio-call-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #f6f1e4;
}

.radio-call-body {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: #cdd4c6;
}

.radio-call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-call-button {
  flex: 1 1 auto;
  min-width: 84px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  color: #f6f1e4;
  background: #26301f;
}

.radio-call-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.radio-call-button.radio-detour {
  border-color: #4aa3c4;
  color: #cfeefa;
}

.radio-call-button.radio-push {
  background: #d5785b;
  color: #221009;
  border-color: #d5785b;
}

.radio-call-button.radio-wait {
  border-color: #4a5340;
}

.radio-call-button:not(:disabled):hover {
  filter: brightness(1.12);
}

.mission-crew-list {
  display: flex;
  gap: 8px;
  margin: 8px 0;
  padding: 1px 2px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.mission-crew-row {
  display: grid;
  flex: 0 0 84px;
  grid-template-rows: 38px auto auto;
  justify-items: center;
  gap: 5px;
  align-items: start;
  width: 84px;
  min-width: 0;
  padding: 7px 6px;
  scroll-snap-align: start;
  border: 1px solid #3a4232;
  border-radius: 8px;
  background: #161b13;
  text-align: center;
  overflow: hidden;
}

.mission-crew-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--survivor-stroke, rgba(224, 183, 91, 0.28));
  border-radius: 7px;
  color: var(--survivor-text, var(--accent));
  background: var(--survivor-fill, rgba(224, 183, 91, 0.08));
  font-size: 13px;
  font-weight: 900;
}

.mission-crew-info {
  display: grid;
  justify-items: center;
  width: 100%;
  min-width: 0;
  gap: 1px;
  color: #cdd4c6;
  font-size: 0.68rem;
  line-height: 1.15;
}

.mission-crew-name,
.mission-crew-meta,
.mission-crew-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-crew-name {
  color: #f6f1e4;
  font-size: 0.76rem;
}

.mission-crew-meta {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mission-crew-status {
  max-width: 100%;
  color: #cdd4c6;
  font-size: 0.64rem;
}

.mission-crew-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.mission-crew-actions:empty {
  display: none;
}

.mission-crew-actions .action-button {
  width: 100%;
  min-height: 30px;
  padding: 5px 6px;
  font-size: 0.68rem;
}

.mission-crew-abort {
  color: #d5785b;
  border-color: #d5785b;
}

@media (min-width: 760px) {
  .mission-crew-list {
    flex-direction: column;
    gap: 7px;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .mission-crew-row {
    display: flex;
    width: auto;
    flex: 0 1 auto;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    scroll-snap-align: none;
    text-align: left;
    overflow: visible;
  }

  .mission-crew-avatar {
    display: none;
  }

  .mission-crew-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
  }

  .mission-crew-meta,
  .mission-crew-status {
    font-size: inherit;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
  }

  .mission-crew-meta::before,
  .mission-crew-status::before {
    content: "\00b7";
    margin-right: 6px;
    color: var(--muted);
  }

  .mission-crew-actions {
    grid-column: auto;
    justify-content: flex-end;
    width: auto;
  }

  .mission-crew-actions .action-button {
    width: auto;
    min-height: 32px;
    padding: 7px 9px;
    font-size: 0.8rem;
  }
}

.radio-call-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.call-in-ring {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  transform: rotate(-90deg);
}

.call-in-ring-track {
  fill: none;
  stroke: #3a4232;
  stroke-width: 3;
}

.call-in-ring-fill {
  fill: none;
  stroke: #e0b75b;
  stroke-width: 3;
  stroke-linecap: round;
}

.radio-call-arrows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.radio-call-button.radio-arrow {
  border-color: #4aa3c4;
  color: #cfeefa;
  background: #16222a;
}

.mission-car-marker {
  /* MapLibre's .maplibregl-marker provides position:absolute; overriding it
     breaks the marker's coordinate anchoring (transform becomes relative to
     the element's flow position). Only add the smoothing here. */
  transition: transform 180ms linear;
  will-change: transform;
}

body.map-moving .mission-car-marker {
  transition: none;
}

.mission-car-body {
  width: 34px;
  height: 34px;
  display: block;
}

.mission-car-heading {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  margin-left: -6px;
  margin-top: -5px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid #e0b75b;
  transform-origin: 6px 5px;
  filter: drop-shadow(0 0 1px #2c2417);
  transition: transform 180ms linear;
}

.unload-ring {
  position: absolute;
  inset: -3px;
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity 200ms linear;
  pointer-events: none;
}

.unload-ring-fill {
  fill: none;
  stroke: #66c8b0;
  stroke-width: 3;
  stroke-linecap: round;
}

.mission-itinerary {
  list-style: none;
  margin: 6px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.itinerary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid rgba(207, 212, 198, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.95rem;
  color: #cdd4c6;
  line-height: 1.25;
}

.itinerary-number {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #26301f;
  border: 1px solid #4a5340;
  color: #e0b75b;
  font-size: 0.78rem;
}

.itinerary-row.itinerary-done {
  opacity: 0.5;
  text-decoration: line-through;
}

.itinerary-row.itinerary-current {
  border-color: rgba(213, 120, 91, 0.48);
  background: rgba(213, 120, 91, 0.1);
  color: #f6f1e4;
  font-weight: 600;
}

.itinerary-row.itinerary-current .itinerary-number {
  background: #d5785b;
  border-color: #d5785b;
  color: #221009;
}

.itinerary-row.itinerary-deferred {
  color: #d9c389;
}

.itinerary-now {
  margin-left: auto;
  font-size: 0.78rem;
  color: #66c8b0;
  font-style: normal;
}

.itinerary-deferred-note {
  color: #d9c389;
}

.mission-itinerary-toggle {
  font-size: 0.78rem;
  color: #9fb0d5;
}


.itinerary-row.itinerary-held .itinerary-now {
  color: #d5785b;
}

.mission-plan-wrap {
  position: relative;
}

.mission-plan-wrap.plan-hot .mission-itinerary {
  opacity: 0.4;
  filter: grayscale(0.4);
}

.mission-hot-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid #d5785b;
  border-radius: 10px;
  background: rgba(213, 120, 91, 0.16);
  animation: hot-banner-pulse 1.1s ease-in-out infinite;
}

@keyframes hot-banner-pulse {
  0%, 100% { border-color: #d5785b; background: rgba(213, 120, 91, 0.16); }
  50% { border-color: #f0987b; background: rgba(213, 120, 91, 0.28); }
}

/* De-escalating: sight is broken, the tail is cooling off — calmer than the
   pulsing "escaping" state, distinct from the fully-cleared (hidden) state. */
.mission-hot-banner.losing {
  animation: none;
  border-color: #c8a35b;
  background: rgba(200, 163, 91, 0.14);
}

.mission-hot-banner.losing .mission-hot-icon {
  color: #d9bd7c;
}

.mission-hot-icon {
  font-size: 1.2rem;
  color: #f0987b;
  flex: 0 0 auto;
}

.mission-hot-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mission-hot-copy b {
  color: #f6f1e4;
  font-size: 0.92rem;
}

.mission-hot-copy em {
  color: #e6a08b;
  font-style: normal;
  font-size: 0.8rem;
}
