/* Commander identity and live ship vitals share the left HUD column. */
.right-hud {
  position: fixed;
  top: 105px;
  right: 24px;
  bottom: 40px;
  width: 225px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  pointer-events: none;
}
.right-hud-top {
  flex: 0 0 auto;
}
.right-hud .contacts,
.right-hud .navigation,
.right-hud .weapon-hud {
  position: static;
  display: block;
  width: 100%;
  margin: 0;
  flex: 0 0 auto;
  pointer-events: auto;
}
.right-hud .contacts {
  max-height: 180px;
  overflow-y: auto;
}
.right-hud .navigation {
  max-height: none;
  overflow: visible;
  padding: 18px;
  border-top: 0;
}
.right-hud .weapon-hud {
  margin-top: auto;
}
@media (max-height: 820px) {
  .right-hud .contacts,
  .right-hud .navigation {
    padding: 10px;
  }
  .right-hud .contacts p {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.4;
  }
  .right-hud .navigation .eyebrow {
    margin-bottom: 8px;
  }
  .right-hud .navigation select {
    margin: 4px 0;
    padding: 7px 6px;
  }
  .right-hud .navigation button {
    margin: 8px 0 0;
    padding: 8px 10px;
  }
  .right-hud .navigation .stat {
    margin: 8px 0;
  }
}
@media (max-width: 700px) {
  .right-hud {
    top: 100px;
    right: 16px;
    width: 190px;
  }
}
.target-hud {
  position: absolute;
  top: 105px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 230px);
  gap: 10px;
  align-items: start;
  width: 230px;
  pointer-events: none;
}
.target-hud.has-mining-target,
.target-hud.has-dual-targets {
  width: 470px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.target-hud > .panel {
  position: static;
  transform: none;
  width: 100%;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  padding: 12px;
  pointer-events: auto;
}
.target-hud > .target-panel {
  grid-column: 1;
  grid-row: 1;
}
.target-hud > .mining-panel {
  grid-column: 2;
  grid-row: 1;
}
.target-hud.has-dual-targets > .friendly-target {
  grid-column: 2;
  grid-row: 1;
}
.target-hud.has-dual-targets > .mining-panel {
  grid-column: 2;
  grid-row: 2;
}
.target-hud .mining-panel p {
  margin: 6px 0;
  font-size: 11px;
}
.target-hud .mining-panel select {
  margin: 6px 0;
  padding: 7px;
}
.target-hud .mining-panel button {
  padding: 5px 10px;
  font-size: 9px;
}
@media (max-width: 1000px) {
  .target-hud {
    top: auto;
    bottom: 125px;
    max-width: calc(100vw - 32px);
  }
  .target-hud > .panel {
    max-height: calc(100vh - 240px);
  }
}
.left-hud > .hud-card {
  position: static;
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px;
  flex: 0 0 auto;
  text-align: left;
  text-transform: none;
  font: inherit;
  letter-spacing: normal;
  color: #dce7ed;
  background: #07131eea;
  border: 1px solid #2d4556;
  border-radius: 0;
  cursor: pointer;
  pointer-events: auto;
}
.left-hud > .hud-card:not(.ship-panel):hover {
  border-color: #80b6ba;
  background: #102332ee;
}
.left-hud > .ship-panel {
  padding: 0;
  cursor: default;
}
.ship-panel-summary,
.ship-panel .ship-cargo {
  display: block;
  width: 100%;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
}
.ship-panel-summary {
  padding: 14px;
}
.ship-panel .ship-cargo {
  margin: 0;
  padding: 10px 14px 12px;
  border-top: 1px solid #2d4556;
}
.ship-panel-summary:hover,
.ship-panel .ship-cargo:hover {
  background: #102332ee;
  box-shadow: inset 0 0 0 1px #80b6ba;
}
.ship-panel-summary:focus-visible,
.ship-panel .ship-cargo:focus-visible {
  outline: 2px solid #aee8d6;
  outline-offset: -3px;
}
.left-hud > .hud-card:focus-visible {
  outline: 2px solid #aee8d6;
  outline-offset: 3px;
}
.hud-card h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.hud-card .eyebrow {
  display: block;
  margin-bottom: 12px;
}
.hud-commander-identity {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.hud-commander-identity img {
  width: 52px;
  height: 64px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid #425b70;
}
.hud-card .stat {
  gap: 8px;
  font-size: 10px;
}
.hud-card .stat strong {
  text-align: right;
}
.hud-card .ship-cargo {
  margin-top: 0;
}
.hud-card small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
}
.ship-dialog {
  width: min(640px, calc(100vw - 40px));
}
.cargo-dialog {
  width: min(820px, calc(100vw - 40px));
  overflow: hidden;
}
.cargo-dialog-volume {
  margin: 8px 0 16px;
}
.cargo-dialog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  height: min(520px, calc(100vh - 190px));
}
.cargo-dialog-list,
.cargo-dialog .storage-inspector {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.cargo-dialog .storage-inspector {
  position: static;
}
@media (max-width: 650px) {
  .cargo-dialog-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .cargo-dialog .storage-inspector {
    display: none;
  }
}
@media (max-width: 700px) {
  .left-hud > .hud-card {
    padding: 12px;
  }
  .left-hud > .ship-panel {
    padding: 0;
  }
  .hud-commander-identity {
    flex-wrap: wrap;
  }
}

/* Portrait fills the card height, with commander details alongside it. */
body .left-hud > .pilot.hud-card {
  padding: 0;
  overflow: hidden;
}
.hud-commander-layout {
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  min-height: 132px;
}
.hud-commander-portrait {
  position: relative;
  overflow: hidden;
  background: #08121d;
}
.hud-commander-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hud-commander-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px;
}
.hud-commander-details .eyebrow {
  margin: 0;
  font-size: 9px;
}
.left-hud .hud-commander-details .stat {
  margin: 0;
  flex-wrap: wrap;
}

.support-module .module-hotkey {
  display: inline-block;
  min-width: 18px;
  padding: 1px 4px;
  border: 1px solid #46616e;
  border-radius: 3px;
  background: #101f2b;
  color: #c0e8e0;
  font: 11px monospace;
  text-align: center;
}
.item-preview-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
}
.item-preview-title-row h2 {
  flex: 1 1 140px;
  min-width: 0;
  margin: 0;
}
.jettison-control {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.jettison-button {
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #ffb08a;
  border-color: #7a4a35;
}
.jettison-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-basis: 100%;
  justify-content: flex-end;
}
.jettison-form input {
  width: 96px;
}
.jettison-form button {
  padding: 4px 10px;
  font-size: 11px;
}
