:root {
  color-scheme: dark;
  font-family: system-ui, 'Yu Gothic', sans-serif;
  background: #0b141a;
  color: #dce8e9;
  font-size: 14px;
}
.fire-modes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 11px;
}
.fire-modes button {
  min-height: 30px;
  padding: 4px 7px;
  font-family: monospace;
}
.fire-modes button small {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.7;
}
.fire-modes button[aria-pressed='true'] {
  border-color: #72ddd4;
  background: #183d42;
  color: #c4fff2;
}
.shot-mode {
  font-weight: bold;
  color: #bbf4df;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  min-height: 90px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #33464d;
  background: #111e25;
}
small {
  font-size: 10px;
  letter-spacing: 3px;
  color: #91a7ae;
}
h1 {
  font-size: 27px;
  letter-spacing: 5px;
  margin: 2px 0;
}
em {
  font-style: normal;
  color: #9fe7c8;
}
nav {
  display: flex;
  gap: 8px;
}
button,
select {
  font: inherit;
  background: #22343e;
  color: #e6efef;
  border: 1px solid #4b646d;
  padding: 9px 12px;
  cursor: pointer;
  border-radius: 3px;
}
button:hover {
  background: #365260;
  border-color: #a2dac5;
}
button:focus-visible {
  outline: 2px solid #f5ce80;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.unit {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 7px;
  padding: 10px 12px;
}
.unit.selected {
  border-color: #a6e6c8;
  background: #30493f;
}
.unit .row {
  display: flex;
  justify-content: space-between;
}
.unit small {
  letter-spacing: 0;
  color: #b5c8ce;
  font-size: 11px;
}
.ap {
  color: #a4e7c8;
}
.danger {
  color: #ff9b81;
}
.muted {
  color: #a0b4bb;
}
dialog {
  background: #14262e;
  color: #e5eded;
  max-width: 760px;
  width: 90%;
  border: 1px solid #8caea8;
  padding: 28px;
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: #000b;
}
dialog h2 {
  margin-top: 0;
}
dialog p {
  line-height: 1.7;
}
.roster {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 15px 0;
}
.roster article {
  padding: 12px;
  border: 1px solid #405760;
}
.roster select {
  width: 100%;
  margin: 7px 0;
}
.armor-choice {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}
.map-choice {
  display: block;
  margin-top: 10px;
}
.map-choice select {
  display: block;
  width: 100%;
  margin-top: 6px;
}
#map-overview {
  position: absolute;
  right: 12px;
  top: 46px;
  z-index: 2;
  width: 152px;
  padding: 8px;
  background: #10212ded;
  border: 1px solid #57717e;
  font-size: 11px;
}
#map-overview summary {
  cursor: pointer;
  min-height: 22px;
}
#map-overview canvas {
  display: block;
  width: 132px;
  height: 132px;
  margin: 6px auto;
  image-rendering: pixelated;
  cursor: crosshair;
}
#map-overview small {
  display: block;
  font-size: 9px;
}
#map-overview > div {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}
#map-overview button {
  flex: 1;
  min-height: 30px;
  padding: 4px;
  font-size: 10px;
}
.armor-choice canvas {
  image-rendering: pixelated;
  width: 72px;
  height: 88px;
  background: #111b22;
  border: 1px solid #405760;
}
.armor-choice label {
  min-width: 0;
}
.armor-choice small {
  display: block;
}
.unit-portrait img {
  display: block;
  width: 36px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}
#armor-warning {
  position: absolute;
  top: 42px;
  left: 12px;
  right: 12px;
  z-index: 2;
  padding: 8px;
  background: #17191fee;
  font-size: 12px;
  pointer-events: none;
}
.primary {
  background: #365e4e;
  border-color: #91cdb1;
  width: 100%;
  margin-top: 10px;
}
.badge {
  display: inline-block;
  padding: 2px 7px;
  background: #334d45;
  font-size: 11px;
  color: #b9e6ce;
}
#mission {
  line-height: 1.7;
  text-align: center;
  color: #b4cbce;
}
.primary-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.primary-actions button {
  padding: 12px 6px;
  font-weight: 650;
  border-color: #5f827f;
}
.primary-actions .move-action {
  background: #315948;
}
.primary-actions .fire-action {
  background: #65503b;
  border-color: #997b50;
}
.primary-actions .watch-action {
  background: #304e61;
}
.stance-group > span {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #b3c8cb;
  margin-bottom: 5px;
}
.stance-group small,
.rescue-group small {
  letter-spacing: 0;
  font-size: 10px;
  color: #89a5ac;
}
.stance-group > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.stance-group button {
  padding: 6px;
  font-size: 11px;
}
.stance-group .current-stance {
  background: #3f5553;
  border-color: #c3d9c7;
}
.utility-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.utility-actions button {
  padding: 7px 4px;
  font-size: 11px;
  background: #1b303b;
}
.rescue-group {
  border: 1px solid #39545c;
  border-radius: 3px;
  background: #12272f;
}
.rescue-group summary {
  cursor: pointer;
  padding: 8px;
  font-size: 12px;
}
.rescue-group summary small {
  margin-left: 10px;
}
.rescue-group > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 6px 7px;
}
.rescue-group button {
  padding: 6px 3px;
  font-size: 10px;
}
.return-action {
  padding: 8px;
  background: #254238;
  border-color: #456c5c;
  font-size: 11px;
}

.unit.bleeding {
  border-color: #ca8a70;
  background: #47322e;
}
.unit.bleeding .ap,
.unit.dead .ap {
  color: #ffab88;
}
.unit.stable {
  border-color: #b39b63;
}
.unit.dead {
  opacity: 0.65;
}
.injury-note {
  margin: 4px 0 7px;
  padding: 6px 8px;
  border: 1px solid #9e7958;
  background: #463a2c;
  font-size: 11px;
  line-height: 1.5;
}

.restart-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  border-top: 1px solid #3b525a;
  padding-top: 12px;
}
.restart-actions button {
  background: #192d35;
  font-size: 12px;
}

.weapon-facts {
  display: block;
  color: #a9c7c5;
  font-size: 12px;
  line-height: 1.6;
  margin: 5px 0;
}

#brief.danger {
  color: #ff9b81;
  background: #302326;
}

/* Tactical command deck: the battlefield and every order stay on one screen. */
body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
header {
  min-height: 48px;
  padding: 5px 14px;
  flex-shrink: 0;
}
header h1 {
  font-size: 20px;
  letter-spacing: 3px;
}
header small {
  font-size: 8px;
}
header button,
.combat-record summary {
  padding: 7px 10px;
  font-size: 12px;
}
#mission {
  font-size: 12px;
  line-height: 1.4;
}
main {
  display: flex;
  flex: 1;
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
}
.field {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}
#brief {
  min-height: 28px;
  padding: 6px 14px;
  font-size: 11px;
  flex-shrink: 0;
}
#battle {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  max-width: none;
  aspect-ratio: auto;
  object-fit: fill;
  flex: 1;
}
.maptools {
  position: absolute;
  top: 34px;
  right: 10px;
  width: auto;
  padding: 4px;
  background: #10232be6;
  border: 1px solid #35505b;
}
.maptools button {
  padding: 4px 8px;
  font-size: 11px;
}
.maptools span {
  display: none;
}
.command-deck {
  flex-shrink: 0;
  padding: 7px 12px;
  background: #13242c;
  border-top: 1px solid #64867d;
}
#squad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.unit {
  margin: 0;
  padding: 5px 8px;
  min-width: 0;
  font-size: 12px;
}
.unit small {
  display: block;
  font-size: 10px;
  white-space: nowrap;
}
.command-row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  margin-top: 7px;
}
#detail {
  margin: 0;
  padding: 0 10px 0 0;
  border-top: 0;
  border-right: 1px solid #3d555c;
  font-size: 11px;
  line-height: 1.65;
}
#detail h2 {
  font-size: 16px;
  margin: 0 0 2px;
}
.injury-note {
  margin: 2px 0;
  padding: 2px 5px;
  line-height: 1.3;
}
#actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.1fr;
  gap: 6px 10px;
  align-content: start;
}
.primary-actions {
  grid-column: 1;
}
.stance-group {
  grid-column: 2;
}
.utility-actions {
  grid-column: 3;
}
.rescue-group {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
}
.rescue-group > span {
  font-size: 11px;
  padding: 0 4px;
  white-space: nowrap;
}
.rescue-group > div {
  flex: 1;
  padding: 0;
}
.return-action {
  grid-column: 3;
}
#actions button,
#actions .primary-actions button,
#actions .stance-group button,
#actions .utility-actions button,
#actions .rescue-group button,
#actions .return-action {
  min-height: 32px;
  padding: 6px 4px;
  font-size: 11px;
}
.stance-group > span {
  margin-bottom: 3px;
}
.utility-actions {
  align-items: end;
}
.decision-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #172a31;
  border-top: 1px solid #3b555b;
  flex-shrink: 0;
}
#preview {
  flex: 1;
  min-height: 35px;
  border: 0;
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
#confirm-action {
  white-space: nowrap;
  background: #496046;
  border-color: #e5ca83;
}
.decision-bar > button {
  white-space: nowrap;
  font-size: 12px;
  padding: 8px 10px;
}
#end {
  background: #3a6152;
  border-color: #80b89f;
}
footer {
  padding: 3px 12px;
  min-height: 23px;
  font-size: 11px;
}
.combat-record {
  position: relative;
}
.combat-record summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid #4b646d;
  border-radius: 3px;
  background: #22343e;
}
.combat-record summary::before {
  content: '▸ ';
}
.combat-record[open] summary::before {
  content: '▾ ';
}
#log {
  position: absolute;
  right: 0;
  top: 38px;
  z-index: 5;
  width: 350px;
  height: 260px;
  min-height: 0;
  margin: 0;
  padding: 12px;
  background: #122730f5;
  border: 1px solid #77988f;
  font-size: 12px;
  overflow: auto;
}
@media (max-width: 1100px) {
  .command-row {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 8px;
  }
  #actions {
    gap: 6px;
  }
  .unit small {
    font-size: 9px;
  }
}
@media (max-width: 850px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    overflow-anchor: none;
  }
  header {
    flex-wrap: wrap;
  }
  main {
    flex: none;
    height: 440px;
  }
  #squad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .command-row {
    grid-template-columns: 1fr;
  }
  #detail {
    border-right: 0;
  }
  .decision-bar {
    flex-wrap: wrap;
  }
  #preview {
    flex-basis: 100%;
  }
}

#actions button.active {
  background: #4a4635;
  outline: 1px solid #ecd395;
  outline-offset: 1px;
}

.mapbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  flex-shrink: 0;
  border-bottom: 1px solid #30464e;
  background: #11232b;
}
#range-legend {
  flex: 1;
  padding: 4px 12px;
  font-size: 11px;
  color: #b9ced0;
}
#range-legend small {
  font-size: 10px;
  letter-spacing: 0;
}
.legend-move {
  color: #e5c34d;
  margin-right: 10px;
}
.legend-fire {
  color: #b4df57;
  margin-right: 10px;
}
.maptools {
  position: static;
  margin-right: 8px;
  background: none;
  border: 0;
  padding: 3px;
  gap: 4px;
  flex-shrink: 0;
}
#turn-note {
  display: block;
  height: 13px;
  color: #e5d9a0;
  font-size: 10px;
  text-align: center;
}
#detail {
  position: relative;
  line-height: 1.5;
}
#detail h2 {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
}
.selected-ap {
  margin-left: auto;
  font-size: 24px;
  line-height: 1.1;
  color: #b7edcd;
  font-variant-numeric: tabular-nums;
}
.selected-ap small {
  font-size: 10px;
  letter-spacing: 0;
  margin-left: 2px;
}
.current-operation {
  color: #f1d491;
  font-size: 12px;
  margin: 3px 0;
}
.secondary-stats {
  color: #bcced0;
  font-size: 10px;
}
.action-reason {
  color: #efba8b;
  font-size: 10px;
}
.unit-stats summary {
  font-size: 10px;
  color: #a1b9bd;
  cursor: pointer;
  margin-top: 2px;
}
.unit-stats > div {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 245px;
  z-index: 6;
  padding: 12px;
  background: #182d35f5;
  border: 1px solid #91b0a3;
  transform: translateY(-27px);
  font-size: 12px;
  line-height: 1.8;
}
.utility-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#face-panel {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
}
.direction-compass {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  gap: 3px;
  flex-shrink: 0;
}
#actions .direction-compass button {
  padding: 4px 2px;
  min-height: 28px;
  font-size: 11px;
}
.direction-compass > span {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bcd6cb;
  font-size: 10px;
}
.direction-compass .current-direction {
  border-color: #ffe082;
  background: #5a5139;
}
.face-guide {
  font-size: 12px;
  color: #c4d6d6;
}
.face-guide strong {
  color: #f5d685;
}
.face-guide p {
  margin: 5px 0;
}
.face-guide small {
  font-size: 10px;
  letter-spacing: 0;
}
.shot-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.5;
}
.shot-chance {
  color: #f3d87f;
  font-size: 24px;
  line-height: 1.15;
  white-space: nowrap;
}
.shot-chance small {
  display: block;
  font-size: 9px;
  letter-spacing: 0;
  color: #b6cdcf;
}
.shot-preview > span {
  font-size: 11px;
  color: #d2e1df;
}
#confirm-action {
  min-height: 34px;
  flex-shrink: 0;
  font-size: 12px;
  padding: 8px 10px;
}
@media (max-width: 1100px) {
  .face-guide {
    font-size: 11px;
  }
  #face-panel {
    gap: 10px;
  }
  .direction-compass {
    grid-template-columns: repeat(3, 52px);
  }
  #preview {
    font-size: 11px;
  }
  .shot-preview {
    gap: 7px;
  }
}
.line-clear {
  color: #78e4f4;
}

#inventory-modal {
  width: min(920px, 92vw);
  max-height: 90vh;
  overflow: auto;
}
.inventory-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.inventory-columns section {
  background: #13252e;
  padding: 12px;
  min-width: 0;
}
.inventory-item {
  display: block;
  width: 100%;
  margin: 6px 0;
  text-align: left;
  overflow-wrap: anywhere;
}
.inventory-item.selected {
  border-color: #e6c77c;
  background: #374235;
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  max-width: 240px;
}
.inventory-grid span {
  height: 22px;
  border: 1px solid #52616a;
  background: #0c1720;
}
.inventory-grid span.occupied {
  background: #61826f;
}
.inventory-details {
  min-height: 280px;
}
.inventory-columns small {
  display: block;
  margin: 4px 0;
  color: #e6c77c;
}
@media (max-width: 650px) {
  .roster {
    grid-template-columns: minmax(0, 1fr);
  }
  #modal {
    box-sizing: border-box;
    padding: 18px;
  }
  .inventory-columns {
    grid-template-columns: 1fr;
  }
}

.unit.bleeding {
  box-shadow: inset 0 0 0 2px #e98d72;
  background: #412a27;
}
#inventory-modal {
  padding: 20px;
  font-size: 13px;
}
#inventory-modal h2 {
  margin: 8px 0 14px;
}
#inventory-modal h3 {
  margin: 8px 0;
}
#inventory-modal p {
  line-height: 1.55;
  margin: 10px 0;
}
#inventory-modal .inventory-columns section {
  padding: 10px;
}

#inventory-modal {
  width: min(1120px, 95vw);
  padding: 14px;
}
.body-inventory-columns {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 350px minmax(200px, 1fr);
  gap: 12px;
}
.body-inventory-columns section {
  min-width: 0;
  padding: 10px;
  background: #13252e;
}
.inventory-soldiers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.inventory-soldiers .selected {
  border-color: #e5c17e;
}
.paperdoll {
  position: relative;
  width: 330px;
  height: 340px;
  margin: auto;
  background: repeating-linear-gradient(0deg, #152b35 0 15px, #1b323b 16px);
  border: 1px solid #4f6670;
}
#paperdoll-placeholder,
.paperdoll-art {
  position: absolute;
  left: 85px;
  top: 48px;
  width: 160px;
  height: 256px;
  image-rendering: pixelated;
  object-fit: contain;
}
.body-slot {
  position: absolute;
  width: 98px;
  min-height: 48px;
  padding: 5px;
  background: #152a35ed;
  white-space: normal;
  text-align: center;
  font-size: 11px;
}
.body-slot strong,
.body-slot span {
  display: block;
}
.body-slot span {
  font-size: 10px;
  color: #b2c3c6;
}
.body-slot.compatible {
  border-color: #b9dfac;
  background: #29443beb;
}
.slot-head {
  top: 4px;
  left: 115px;
}
.slot-body {
  top: 78px;
  left: 4px;
}
.slot-backpack {
  top: 78px;
  right: 4px;
}
.slot-hands {
  top: 152px;
  left: 4px;
}
.slot-support {
  top: 152px;
  right: 4px;
}
.slot-belt {
  top: 230px;
  left: 4px;
}
.slot-cargo {
  top: 278px;
  right: 4px;
}
.equipment-icon {
  width: 48px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  vertical-align: middle;
  margin-right: 4px;
}
.body-slot .equipment-icon {
  height: 22px;
  width: 40px;
}
.inventory-details > img {
  display: block;
  width: 100px;
  height: 64px;
}
.body-inventory-columns .inventory-item {
  min-height: 36px;
  padding: 5px;
  font-size: 12px;
}
@media (max-width: 1000px) {
  .body-inventory-columns {
    grid-template-columns: minmax(160px, 1fr) 310px minmax(180px, 1fr);
  }
  .paperdoll {
    width: 290px;
  }
  .paperdoll-art,
  #paperdoll-placeholder {
    left: 65px;
  }
  .slot-head {
    left: 95px;
  }
  .body-slot {
    width: 85px;
  }
}
@media (max-width: 720px) {
  .body-inventory-columns {
    grid-template-columns: 1fr;
  }
  .body-panel {
    grid-row: 1;
  }
}

#inventory-modal {
  max-width: min(1120px, 95vw);
  box-sizing: border-box;
  overflow-x: hidden;
}
#inventory-close {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #213b48;
  box-shadow: 0 -6px 12px #14252f;
}
#inventory-modal .paperdoll {
  height: 310px;
}
#inventory-modal .slot-cargo {
  top: 256px;
}
#inventory-modal .slot-belt {
  top: 220px;
}

.inventory-art {
  display: inline-block;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  vertical-align: middle;
  flex-shrink: 0;
}
.inventory-item .inventory-art {
  margin-right: 8px;
}
.inventory-details > .inventory-art {
  display: block;
  margin: 12px 0;
}

.inventory-art {
  display: inline-block;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  vertical-align: middle;
  flex-shrink: 0;
}
.inventory-item .inventory-art {
  margin-right: 8px;
}
.inventory-details > .inventory-art {
  display: block;
  margin: 12px 0;
}

.paperdoll-connectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.paperdoll-connectors line {
  stroke: #91a59a;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

#inventory-modal {
  background: #080c0d;
  color: #dce1dc;
}
#inventory-modal h3,
#inventory-modal h4 {
  color: #c2d569;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.equipment-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.equipment-heading h2 {
  margin: 5px 0 !important;
}
.equipment-heading h2 small {
  font-size: 12px;
  color: #c2d569;
}
.inventory-weight {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 5px 0;
  font-size: 12px;
  color: #b7c9a5;
}
.inventory-weight strong {
  border: 1px solid #4d6145;
  border-radius: 4px;
  padding: 3px 7px;
}
.inventory-weight.burdened {
  color: #eed087;
}
.inventory-weight.over-limit strong {
  border-color: #d48276;
  color: #ffb9ab;
}
.grid-instructions,
.grid-help {
  font-size: 12px;
  color: #a5b29d;
}
.equipment-workspace {
  display: grid;
  grid-template-columns: 416px 288px minmax(140px, 1fr);
  gap: 16px;
}
.equipment-workspace section {
  min-width: 0;
}
.grid-paperdoll {
  position: relative;
  width: 416px;
  height: 272px;
}
.grid-paperdoll > .paperdoll-art {
  left: 128px;
  top: 0;
  width: 160px;
  height: 256px;
}
.hand-zone,
.support-zone {
  position: absolute;
  top: 124px;
  left: 0;
}
.support-zone {
  left: auto;
  right: 0;
}
.item-grid {
  --cell: 48px;
  position: relative;
  width: calc(var(--cols) * var(--cell));
  height: calc(var(--rows) * var(--cell));
  background-color: #080c0d;
  background-image:
    linear-gradient(to right, #526057 1px, transparent 1px),
    linear-gradient(to bottom, #526057 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  border-right: 1px solid #526057;
  border-bottom: 1px solid #526057;
  box-sizing: content-box;
}
.grid-cell {
  position: absolute;
  width: var(--cell);
  height: var(--cell);
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}
.grid-cell:focus-visible {
  outline: 2px solid #c2d569;
  outline-offset: -3px;
}
.grid-item {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 1px solid #5d7565;
  outline-offset: -1px;
  background: #14221d;
  z-index: 2;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.grid-item:hover,
.grid-item.selected {
  background: #29382a;
  outline: 2px solid #dbdf83;
  outline-offset: -2px;
}
.grid-item .inventory-art {
  flex-shrink: 0;
  pointer-events: none;
}
.grid-item .inventory-art[aria-label$='Corpse'] {
  transform: scale(2);
}
.inventory-footer {
  position: sticky;
  bottom: -14px;
  background: #080c0d;
  padding: 8px 0;
  margin-top: 8px;
  z-index: 8;
}
.inventory-footer #inventory-close {
  position: static;
}
.grid-item small {
  position: absolute;
  right: 3px;
  bottom: 2px;
  padding: 1px 2px;
  background: #080c0ddd;
  font-size: 10px;
  color: #e2dc82;
  pointer-events: none;
}
.equipment-selection {
  font-size: 12px;
  padding-left: 5px;
}
.selected-item-art {
  display: flex;
  align-items: center;
  min-height: 54px;
}
.equipment-ground {
  margin-top: 16px;
  overflow-x: auto;
}
.two-hand-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  pointer-events: none;
  background: repeating-linear-gradient(
    45deg,
    #1a282388 0,
    #1a282388 5px,
    transparent 5px,
    transparent 10px
  );
  color: #b8c69a;
}
.grid-target {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  border: 2px solid;
  box-sizing: border-box;
}
.grid-target.valid {
  border-color: #9ee28a;
  background: #76cf5125;
}
.grid-target.invalid {
  border-color: #ed8678;
  background: #ea655425;
}
.inventory-drag-ghost {
  position: fixed !important;
  z-index: 10000 !important;
  pointer-events: none;
  opacity: 0.86;
  --cell: 48px;
}
.inventory-drag-ghost.valid {
  outline: 2px solid #9ee28a;
}
.inventory-drag-ghost.invalid {
  outline: 2px solid #ed8678;
}
@media (max-width: 1000px) {
  .equipment-workspace {
    grid-template-columns: 416px 288px;
  }
  .equipment-selection {
    grid-column: 1/-1;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
  }
  .equipment-selection h3 {
    width: 100%;
  }
}
@media (max-width: 760px) {
  .equipment-workspace {
    grid-template-columns: 1fr;
  }
  .equipment-storage {
    display: grid;
    grid-template-columns: max-content;
  }
  .grid-paperdoll {
    max-width: 100%;
  }
  .equipment-body {
    overflow-x: auto;
  }
}

.sound-settings {
  position: relative;
}
.sound-settings > summary {
  cursor: pointer;
  border: 1px solid #36505a;
  border-radius: 3px;
  padding: 8px;
  white-space: nowrap;
}
.sound-panel {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 12;
  width: min(300px, 90vw);
  padding: 14px;
  background: #142730;
  border: 1px solid #567580;
  box-shadow: 0 8px 20px #0009;
  display: grid;
  gap: 10px;
}
.sound-panel label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.sound-panel input[type='range'] {
  width: 100%;
}
.sound-panel input[type='checkbox'] {
  width: auto;
}
.sound-panel a {
  color: #99d5e4;
}
.sound-panel p,
#sound-status {
  font-size: 12px;
  line-height: 1.5;
}

/* Approved icon-led command surface; world coordinates and rules are unchanged. */
.mission-title {
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid #537381;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
header > div:first-child {
  display: flex;
  align-items: center;
}
footer.status-warning {
  position: fixed;
  top: 55px;
  left: 10px;
  width: auto;
  height: auto;
  clip: auto;
  z-index: 100;
  padding: 9px 14px;
  max-width: calc(100vw - 20px);
  background: #412827;
  color: #ffd1b9;
  border: 1px solid #db8a77;
}
@media (max-width: 1100px) {
  .mission-title {
    display: none;
  }
}
:root {
  --cyan: #67eee4;
  --amber: #ffbd50;
}
.ui-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  vertical-align: middle;
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
header {
  height: 48px;
  min-height: 48px;
  background: linear-gradient(90deg, #08151e, #10242d);
  padding: 4px 16px;
  gap: 16px;
}
header > div:first-child small {
  display: none;
}
header h1 {
  font-size: 22px;
  letter-spacing: 2px;
  white-space: nowrap;
}
header em {
  color: var(--cyan);
}
header nav {
  gap: 6px;
}
header nav > button,
header nav > details > summary {
  width: 36px;
  height: 34px;
  padding: 5px !important;
  display: grid;
  place-items: center;
  list-style: none;
}
header .ui-icon {
  width: 22px;
  height: 22px;
}
.combat-record summary::before {
  display: none;
}
#mission {
  font-weight: 650;
  font-size: 13px;
  white-space: nowrap;
}
#brief:not(.danger),
.mapbar #range-legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  padding: 0;
  min-height: 0;
}
#brief.danger {
  min-height: 28px;
}
.mapbar {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  min-height: 0;
  background: transparent;
  border: 0;
  opacity: 0.35;
}
.mapbar:hover,
.mapbar:focus-within {
  opacity: 1;
}
.maptools {
  background: #081922bd;
  border-radius: 4px;
}
.maptools button {
  min-height: 32px;
}
.command-deck {
  background: linear-gradient(#0c202b, #081820);
  padding: 9px 14px 10px;
  border-color: #315966;
}
#squad {
  gap: 10px;
}
.unit {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: 24px 24px;
  gap: 0 8px;
  padding: 8px 10px;
  border: 1px solid #376174;
  border-radius: 4px;
  background: linear-gradient(120deg, #102631, #091a25);
  min-height: 66px;
  color: #eef6f9;
}
.unit.selected {
  border: 2px solid var(--cyan);
  padding: 7px 9px;
  background: linear-gradient(120deg, #14333c, #0a222d);
  box-shadow: 0 0 9px #50e6cf33;
}
.unit strong {
  font-size: 14px;
}
.unit-portrait {
  grid-row: 1/3;
  align-self: center;
}
.unit-portrait .ui-icon {
  width: 28px;
  height: 40px;
}
.unit-metrics {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
  white-space: nowrap;
}
.unit-metrics i {
  font-style: normal;
  font-size: 10px;
  color: #60bfd0;
}
.unit-metrics > .ui-icon {
  width: 15px;
  height: 15px;
}
.hp-meter {
  width: 30px;
  height: 5px;
  background: #233e42;
  flex-shrink: 0;
}
.hp-meter b {
  display: block;
  height: 100%;
  background: #65ed9f;
}
.unit .ammo .ui-icon {
  width: 17px;
  height: 17px;
}
.unit .ap {
  color: #d6f8fd;
}
.unit-metrics .danger {
  font-size: 10px;
  white-space: normal;
}
.command-row {
  display: block;
  position: relative;
  margin-top: 10px;
}
#detail {
  display: none;
  position: absolute;
  right: 0;
  bottom: 100%;
  z-index: 14;
  width: 300px;
  border: 1px solid #426a78;
  background: #0c2029;
  padding: 14px;
  box-shadow: 0 8px 25px #0008;
}
.command-row.info-open #detail {
  display: block;
}
#actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.primary-actions {
  display: contents;
}
#actions .action-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  min-width: 70px;
  min-height: 84px;
  flex: 1;
  padding: 8px 5px;
  background: linear-gradient(#112b38, #0a1d28);
  border: 1px solid #41677a;
  font-size: 12px;
  font-weight: 650;
  border-radius: 4px;
}
#actions .action-tile > .ui-icon,
.action-menu > summary > .ui-icon {
  width: 38px;
  height: 38px;
}
#actions .action-tile.active {
  outline: none;
  border: 2px solid var(--cyan);
  background: linear-gradient(#15454d, #10343d);
  color: #bafff4;
  box-shadow: 0 0 8px #43ffe12a;
}
#actions .fire-action.active {
  border-color: var(--amber);
  color: var(--amber);
  background: linear-gradient(#463923, #201f19);
  box-shadow: 0 0 7px #ffb32850;
}
#actions button:focus-visible,
.action-menu > summary:focus-visible,
header button:focus-visible,
header summary:focus-visible,
.unit:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
kbd {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-family: inherit;
  font-size: 10px;
  border: 1px solid #7195a7;
  padding: 0 3px;
  border-radius: 2px;
  background: #152b37;
  color: #ddf1f8;
}
#actions .stance-group {
  display: flex;
  gap: 0;
  flex: 0 0 155px;
  grid-column: auto;
}
#actions .stance-group .action-tile {
  min-width: 0;
  border-radius: 0;
  font-size: 10px;
  font-weight: 500;
}
#actions .stance-group .action-tile .ui-icon {
  width: 28px;
}
.action-menu {
  position: relative;
  flex: 0 0 82px;
}
.action-menu > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 84px;
  border: 1px solid #41677a;
  border-radius: 4px;
  background: linear-gradient(#112b38, #0a1d28);
  font-size: 12px;
  font-weight: 650;
}
.action-menu > summary:focus-visible {
  outline: 2px solid var(--amber);
}
.action-menu > div {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 15;
  width: 250px;
  padding: 8px;
  background: #0b202b;
  border: 1px solid #557e8a;
  box-shadow: 0 8px 30px #000a;
  display: grid;
  gap: 5px;
}
#actions .action-menu > div .action-tile {
  min-height: 44px;
  flex-direction: row;
  justify-content: flex-start;
  padding: 8px 12px;
  gap: 12px;
}
#actions .action-menu > div .ui-icon {
  width: 24px;
  height: 24px;
}
.more-menu {
  flex-basis: 50px;
}
.decision-bar {
  min-height: 60px;
  padding: 8px 14px;
  background: linear-gradient(#0c202b, #081820);
  border-color: #315966;
  gap: 10px;
}
#mission-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  color: #acc9da;
  font-size: 12px;
  white-space: nowrap;
}
#mission-progress .ui-icon {
  width: 16px;
  height: 16px;
}
#preview {
  flex: 0 1 auto;
  min-height: 40px;
  margin-left: auto;
  gap: 10px;
}
#preview:empty {
  display: none;
}
.shot-preview {
  display: flex;
  align-items: center;
}
.shot-cost {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #37596c;
  border-radius: 3px;
  background: #091a24;
  font-size: 18px;
  white-space: nowrap;
}
.shot-cost .ui-icon {
  width: 22px;
  height: 25px;
}
.shot-cost .ui-icon:nth-of-type(2) {
  color: #56d3ed;
  margin-left: 10px;
}
.shot-cost em {
  color: var(--cyan);
  font-size: 15px;
}
#confirm-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 22px;
  min-height: 43px;
  background: #342b1b;
  border: 2px solid var(--amber);
  color: var(--amber);
  font-size: 17px;
  font-weight: 700;
}
#confirm-action .ui-icon {
  width: 27px;
  height: 27px;
}
#cancel,
#end {
  min-height: 43px;
  padding: 8px 16px;
  border-radius: 4px;
}
#end {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid #67dbbb;
  background: linear-gradient(#1a5b4c, #10392f);
}
footer {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  padding: 0;
  min-height: 0;
}
#target-hud {
  position: absolute;
  z-index: 4;
  width: 155px;
  padding: 9px 12px;
  pointer-events: none;
  border: 1px solid var(--amber);
  border-radius: 4px;
  background: #071824ef;
  box-shadow: 0 0 12px #0005;
  color: #e4eef2;
}
#target-hud[hidden] {
  display: none;
}
#target-hud strong {
  display: block;
  border-bottom: 1px solid #745c29;
  padding-bottom: 5px;
  font-size: 13px;
}
#target-hud > b {
  display: block;
  font-size: 30px;
  line-height: 1.3;
  color: var(--amber);
}
#target-hud > span {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #73cadd;
  border-top: 1px solid #745c29;
  padding-top: 5px;
  gap: 3px;
}
#target-hud .ui-icon {
  width: 16px;
  height: 16px;
}
#target-hud .damage {
  display: flex;
  gap: 3px;
  color: var(--amber);
  margin-left: auto;
}
#target-hud.invalid {
  border-color: #ff807c;
}
#ui-tip {
  position: fixed;
  z-index: 10001;
  max-width: 280px;
  padding: 8px 11px;
  color: #e3f4f9;
  background: #10252ff5;
  border: 1px solid #638899;
  border-radius: 4px;
  box-shadow: 0 4px 12px #0008;
  font-size: 12px;
  pointer-events: none;
}
#face-panel {
  width: 100%;
  max-height: 180px;
}
#face-panel .face-guide p:nth-of-type(2),
#face-panel .face-guide small {
  display: none;
}
@media (max-width: 1100px) {
  .unit-metrics {
    gap: 4px;
    font-size: 11px;
  }
  .hp-meter {
    width: 20px;
  }
  .unit-portrait {
    display: none;
  }
  .unit {
    grid-template-columns: 1fr;
  }
  .unit strong {
    font-size: 13px;
  }
  #actions {
    gap: 5px;
  }
  #actions .action-tile {
    min-width: 58px;
  }
  #actions .stance-group {
    flex-basis: 135px;
  }
  .action-menu {
    flex-basis: 65px;
  }
  .more-menu {
    flex-basis: 40px;
  }
  #mission-progress span {
    display: none;
  }
  .shot-cost {
    padding: 7px 9px;
    font-size: 16px;
  }
}
@media (max-width: 760px) {
  body {
    height: auto;
    min-height: 100svh;
    overflow: auto;
  }
  header {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
  }
  header h1 {
    font-size: 18px;
  }
  header nav {
    margin-left: auto;
  }
  #mission {
    font-size: 11px;
  }
  main {
    height: 330px;
    flex: none;
  }
  #squad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .unit {
    min-height: 58px;
    padding: 5px 7px;
  }
  .unit.selected {
    padding: 4px 6px;
  }
  #actions {
    flex-wrap: wrap;
  }
  #actions .action-tile {
    flex: 1 0 22%;
    min-height: 72px;
  }
  #actions .stance-group {
    flex: 1 0 36%;
  }
  .action-menu {
    flex: 1 0 20%;
  }
  .action-menu > summary {
    height: 72px;
  }
  #actions .action-menu > div {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    max-height: 60vh;
    overflow: auto;
  }
  .decision-bar {
    flex-wrap: wrap;
    padding: 8px;
  }
  #mission-progress {
    font-size: 11px;
    flex-basis: 100%;
  }
  #preview {
    flex-basis: auto;
    margin-left: 0;
    flex-wrap: wrap;
    font-size: 11px;
  }
  .shot-cost {
    gap: 5px;
    font-size: 15px;
  }
  .decision-bar > button {
    padding: 8px 10px;
  }
  #target-hud {
    width: 145px;
  }
  #detail {
    position: fixed;
    bottom: 85px;
    right: 8px;
    max-height: 60vh;
    overflow: auto;
  }
}

#robot-status {
  color: #78dbe7;
  font-size: 12px;
  padding: 4px 12px;
}
#robot-status:empty {
  display: none;
}

#squad-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  min-width: 0;
}
#squad-controls:empty {
  display: none;
}
#squad-controls button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  min-width: 82px;
  white-space: nowrap;
  font-size: 11px;
}
#squad-controls button[aria-pressed='true'] {
  border-color: #54dbd6;
  background: #13454b;
}
#squad-controls .ui-icon {
  width: 19px;
  height: 19px;
}
#squad-status {
  font-size: 11px;
  color: #99cbd1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 760px) {
  #squad-controls {
    flex-wrap: wrap;
  }
  #squad-status {
    flex-basis: 100%;
    white-space: normal;
  }
}
/* Keep fixed defense units readable without consuming the tactical viewport. */
#sentry-status { color:#dfcc8b;font-size:11px;line-height:1.3;max-height:2.6em;overflow:auto; }
#preview label { white-space:nowrap; }
#sentry-direction { font:inherit;max-width:110px;background:#172b35;color:#edd890;border:1px solid #6a745e; }

#base-controls { display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding-top:5px;font-size:11px;color:#9dc9bc; }
#base-controls[hidden] {display:none;}
#base-controls button {font-size:11px;padding:4px 7px;white-space:nowrap;}
#mission-progress b {color:#78e1d0;}
/* Compact controls keep the battlefield tall; the menu stays discoverable. */
#top-bar[hidden] { display:none; }
#topbar-toggle { position:fixed;top:6px;left:8px;z-index:30;min-height:32px;padding:5px 10px;font-size:12px;background:#102833ec;border-color:#638793; }
#top-bar { padding-left:110px; }
.command-deck { padding:5px 10px; }
#squad { gap:6px; }
.unit { min-height:48px;grid-template-rows:19px 19px;padding:4px 8px;gap:0 6px; }
.unit.selected { padding:3px 7px; }
.unit strong { font-size:13px; }
.unit-portrait img { width:28px;height:34px; }
.unit-portrait .ui-icon { width:24px;height:30px; }
.unit-metrics { gap:6px;font-size:12px; }
.command-row { margin-top:5px; }
#squad-controls { margin-top:4px;gap:6px; }
#squad-controls button { min-height:30px; }
#base-controls { padding-top:3px;gap:5px; }
#base-controls button { min-height:28px;padding:3px 6px; }
#actions { gap:5px; }
#actions .action-tile { min-height:48px;min-width:48px;padding:4px 5px;gap:2px;font-size:11px; }
#actions .action-tile > .ui-icon,.action-menu > summary > .ui-icon { width:24px;height:24px; }
#actions .stance-group { flex:0 0 114px; }
#actions .stance-group .action-tile .ui-icon { width:22px;height:24px; }
.action-menu { flex:0 0 60px; }
.action-menu > summary { height:48px;gap:2px;font-size:11px; }
.more-menu { flex-basis:36px; }
#actions kbd { bottom:3px;left:3px;font-size:9px;padding:0 2px; }
.decision-bar { min-height:46px;padding:5px 10px;gap:7px; }
.decision-bar > button { min-height:36px;padding:5px 9px; }
#preview { min-height:34px;gap:7px; }
.fire-modes button { min-height:28px;padding:3px 6px; }
#robot-status { padding:2px 0; }
#sentry-status { max-height:1.3em; }
@media (pointer:coarse) {
  #topbar-toggle,#squad-controls button,#base-controls button,.fire-modes button,.maptools button,.decision-bar > button { min-height:44px; }
  header nav > button,header nav > details > summary { width:44px;height:44px; }
}
@media (max-width:760px) {
  body { height:100svh;min-height:100svh;overflow:auto; }
  main { height:auto;flex:1;min-height:280px; }
  #top-bar { min-height:48px;padding:5px 8px 5px 106px;gap:3px; }
  #top-bar h1 { font-size:16px; }
  .command-deck { padding:4px 6px; }
  #squad { gap:4px; }
  .unit { min-height:46px;padding:3px 5px;grid-template-rows:19px 19px; }
  .unit.selected { padding:2px 4px; }
  .unit strong { font-size:12px; }
  .unit-metrics { font-size:11px;gap:4px;flex-wrap:wrap; }
  .hp-meter { display:none; }
  #actions { gap:4px;flex-wrap:wrap; }
  #actions .action-tile { min-height:46px;flex:1 0 44px;min-width:44px; }
  #actions .stance-group { flex:0 0 108px; }
  .action-menu { flex:0 0 48px; }
  .action-menu > summary { height:46px; }
  .more-menu { flex-basis:32px; }
  .decision-bar { padding:4px 6px;min-height:46px; }
  #mission-progress { flex-basis:auto;margin-right:auto;font-size:11px; }
  #preview { min-height:30px; }
  #squad-controls { gap:4px; }
  #squad-status { white-space:nowrap; }
  #base-controls { font-size:10px; }
  #base-controls small { display:none; }
}

/* Reserve narrow-screen previews so pointer hover cannot move the tile underneath a click. */
@media (max-width:760px) {
  .decision-bar { display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:minmax(44px,auto) 80px; }
  #mission-progress { grid-column:1;grid-row:1;min-width:0; }
  #cancel { grid-column:2;grid-row:1; }
  #end { grid-column:3;grid-row:1; }
  #preview,#preview:empty { display:flex;grid-column:1 / -1;grid-row:2;min-width:0;width:100%;height:80px;min-height:80px;margin:0;overflow:auto;align-content:center; }
}
@media (pointer:coarse) { #confirm-action { min-height:44px; } }

/* Small decision badges use the existing card and preview space. */
.tactical-badge,.cover-badge { display:inline-flex;align-items:center;gap:3px;white-space:nowrap;font-size:11px; }
.tactical-badge .ui-icon,.cover-badge .ui-icon { width:13px;height:13px;flex-shrink:0; }
.cover-badge.covered { color:#8cdbda; }
.cover-badge.exposed { color:#8e9fa5; }
.unit strong .cover-badge { margin-left:5px;vertical-align:middle; }
.spare-magazines { font-size:10px;color:#b8cacf; }
.target-status { display:flex;flex-wrap:wrap;gap:4px 7px;margin-top:3px; }
.target-status .tactical-badge { font-size:10px; }
.shot-preview { flex-wrap:wrap;gap:4px 8px; }
#actions .reload-state { display:inline;margin-left:3px;font-size:9px; }
#actions [data-action="reload"] kbd { display:none; }
@media(max-width:760px) { .spare-magazines { font-size:9px; } }

.unit.critical-patient { border-color:#ff8b72;box-shadow:inset 0 0 0 1px #ff8b7244; }
.unit.critical-patient .ap,#brief.critical { color:#ffd3bf;font-weight:700; }
#end.rescue-critical { border-color:#ff9b81;box-shadow:inset 0 0 0 1px #ff9b8155; }
#mother-alert { display:inline-flex;align-items:center;gap:4px;background:transparent;border:0;padding:0 3px;min-height:0;font:inherit;color:#9de1d7; }
#mother-alert small { font-size:10px; }
#mother-alert.critical,#mother-alert.hit,#overview-signal.mother-critical { color:#ffc2a8;background:#542820; }
#mother-pointer { position:absolute;z-index:5;color:#ffd1b7;background:#472b26ed;border:1px solid #f2967b;border-radius:3px;padding:5px 7px;font-size:11px;min-height:30px; }
#mother-pointer[hidden] { display:none; }
@media(pointer:coarse) { #mother-pointer,#mother-alert { min-height:44px; } }

#wave-banner { position:absolute;top:8px;left:50%;transform:translateX(-50%);z-index:3;padding:5px 12px;border:1px solid #6b989e;background:#0a1e29e8;border-radius:3px;color:#d9ede8;font-size:12px;font-weight:650;pointer-events:none;white-space:nowrap; }
#wave-banner.urgent { border-color:#edbc69;color:#ffe0a0;background:#392e22ed; }
#wave-banner[hidden] { display:none; }
@media(max-width:760px) { #wave-banner { top:52px;font-size:11px;padding:4px 8px; } }
