.death-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.12);
  pointer-events: auto;
}
.death-recap {
  width: min(460px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  background: rgba(9, 15, 27, 0.96);
  border: 1px solid #ad6060;
}
.death-recap button {
  width: 100%;
  margin-top: 12px;
}
.navigation {
  max-height: max(140px, calc(100vh - 680px));
  overflow-y: auto;
  position: absolute;
  right: 24px;
  top: 300px;
  width: 225px;
  padding: 20px;
}
.weapon-hud {
  position: fixed;
  right: 24px;
  bottom: 150px;
  width: 225px;
  padding: 14px;
}
.weapon-hud .eyebrow {
  font-size: 9px;
  text-align: center;
  margin-bottom: 10px;
}
.weapon-rack {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.weapon-module {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 88px;
  color: #8094a7;
}
.weapon-dial {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #07131f;
}
.weapon-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.weapon-ring circle {
  fill: none;
  stroke-width: 3;
}
.ring-track {
  stroke: #2c3b49;
}
.ring-fill {
  stroke: #a4c6d7;
}
.weapon-icon {
  position: absolute;
  inset: 16px;
  width: 40px;
  height: 40px;
}
.weapon-module.active {
  color: #aee8d6;
}
.weapon-module.active .weapon-dial {
  box-shadow:
    0 0 14px #68efd144,
    inset 0 0 12px #68efd122;
}
.weapon-module.active .ring-fill {
  stroke: #8dffd8;
}
.weapon-title {
  font-size: 9px;
  letter-spacing: 0.5px;
}
.weapon-state {
  font-size: 8px;
}
.weapon-groups {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.weapon-groups button {
  padding: 4px 8px;
  font-size: 9px;
  border-radius: 3px;
}
.weapon-groups button[aria-pressed='true'] {
  color: #10232c;
  background: #aee8d6;
  border-color: #aee8d6;
}
@media (max-height: 800px) {
  .navigation {
    top: 105px;
  }
}
@media (max-width: 700px) {
  .weapon-hud {
    width: 190px;
    right: 16px;
    padding: 10px;
  }
}
.navigation select {
  display: block;
  width: 100%;
  margin: 10px 0;
  background: #101f2e;
  color: #d8e9ee;
  border: 1px solid #354854;
  padding: 10px 6px;
  font: inherit;
}
.navigation button {
  width: 100%;
  margin: 18px 0 12px;
}
.navigation small {
  display: block;
  font-size: 10px;
}
.jump-countdown {
  margin-top: 15px;
  color: #aee8d6;
  letter-spacing: 1px;
}
@media (max-width: 1100px) {
  .navigation {
    top: 105px;
  }
}
@media (max-width: 700px) {
  .navigation {
    top: 100px;
    right: 16px;
    width: 190px;
    padding: 12px;
  }
  .objective {
    display: none;
  }
}
* {
  box-sizing: border-box;
}
select {
  width: 100%;
  padding: 9px;
  margin: 8px 0;
  background: #101f2e;
  color: #d8e9ee;
  border: 1px solid #354854;
  font: inherit;
}
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.equipment-grid small {
  display: block;
  letter-spacing: 0;
}
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}
.item-row button {
  padding: 8px 12px;
  white-space: nowrap;
}
.recipe {
  padding: 14px 0;
  border-top: 1px solid #293b4b;
}
.recipe p {
  margin: 8px 0;
  font-size: 12px;
}
.mining-panel {
  position: absolute;
  left: 24px;
  top: 380px;
  width: 250px;
  padding: 18px;
  max-height: calc(100vh - 510px);
  overflow-y: auto;
}
.mining-panel p {
  font-size: 12px;
  margin: 8px 0;
}
.mining-panel select {
  font-size: 11px;
}
.mining-status {
  color: #aee8d6;
}
.mining-panel progress {
  width: 100%;
  height: 5px;
  accent-color: #aee8d6;
  margin-top: 12px;
}
body {
  margin: 0;
  background: #030912;
  color: #e5edf4;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
input,
textarea,
[contenteditable='true'] {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  caret-color: auto;
}
input[type='checkbox'],
input[type='radio'],
input[type='range'] {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: #c2d2df;
  background: #142430;
  border: 1px solid #334959;
  padding: 12px 18px;
  letter-spacing: 1px;
  font-size: 11px;
  font-weight: 700;
}
button:hover {
  background: #213849;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.primary {
  background: #aee8d6;
  border-color: #aee8d6;
  color: #112523;
  padding: 15px 24px;
}
button.primary:hover {
  background: #cefbed;
}
input {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 9px 0 20px;
  background: #08111b;
  color: white;
  border: 1px solid #354854;
  outline: none;
}
input:focus {
  border-color: #9cdbc9;
}
label {
  font-size: 10px;
  letter-spacing: 2px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 35px;
  font-weight: 500;
  letter-spacing: -1px;
}
h2 {
  font-size: 21px;
  font-weight: 500;
}
p {
  line-height: 1.6;
}
small {
  font-size: 11px;
  line-height: 1.5;
}
.space {
  position: fixed;
  inset: 0;
}
.space canvas {
  cursor: crosshair;
  display: block;
  touch-action: none;
}
.panel {
  background: rgba(8, 18, 29, 0.92);
  border: 1px solid #2b3c4d;
  box-shadow: 0 20px 60px #0005;
  backdrop-filter: blur(14px);
}
.omni-warning {
  position: fixed;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  padding: 18px 20px;
  z-index: 10;
  border-color: #d9b35a;
  box-shadow: 0 0 28px #d9b35a18, 0 20px 60px #0005;
}
.omni-warning strong {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #d9b35a;
  margin-bottom: 10px;
}
.omni-warning p {
  font-size: 13px;
  line-height: 1.6;
  color: #c3d3df;
  margin: 0 0 16px;
}
.omni-warning-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.omni-warning-actions button {
  padding: 9px 14px;
  font-size: 10px;
}
.topbar {
  position: fixed;
  inset: 0 0 auto;
  height: 82px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid #273544;
  background: #07101bdd;
  gap: 45px;
}
.brand {
  font-size: 21px;
  letter-spacing: 5px;
  font-weight: 800;
}
.brand span {
  font-weight: 400;
  color: #a8dfd1;
}
.sector {
  font-size: 11px;
  letter-spacing: 2px;
  line-height: 1.7;
}
.sector small {
  display: block;
  font-size: 9px;
  color: #8193a6;
  letter-spacing: 1px;
}
.system-map-trigger.bounty-pending {
  animation: bounty-map-pulse 1.2s ease-in-out infinite;
}
@keyframes bounty-map-pulse {
  0%,
  100% {
    box-shadow: 0 0 6px #f2be7c44;
    color: #f2be7c;
  }
  50% {
    box-shadow: 0 0 16px #f2be7ccc;
    color: #ffe5a8;
  }
}
.connection {
  margin-left: auto;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 2px;
  color: #f2be7c;
}
.connection.connected {
  color: #aee8d6;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #a6d8ce;
  margin-bottom: 12px;
}
.muted {
  color: #8596a8;
}
.entry {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
  max-width: 90vw;
  padding: 36px;
}
.entry p {
  color: #9cabbc;
  margin: 20px 0 30px;
}
.entry button {
  width: 100%;
  margin-bottom: 18px;
}
.pilot {
  position: absolute;
  left: 24px;
  top: 105px;
  width: 225px;
  padding: 22px;
}
.ship-name {
  font-size: 10px;
  color: #8d9eaf;
  letter-spacing: 1px;
  margin: 12px 0 25px;
}
.stat {
  display: flex;
  justify-content: space-between;
  margin: 17px 0;
  font-size: 10px;
  gap: 12px;
}
.stat span {
  color: #8f9dad;
}
.bar {
  height: 3px;
  background: #243242;
}
.bar i {
  display: block;
  height: 100%;
  background: #aee8d6;
}
.contacts {
  position: absolute;
  right: 24px;
  top: 105px;
  width: 225px;
  padding: 22px;
}
.contacts p {
  font-size: 12px;
}
.contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 0;
  color: inherit;
  border-top: 1px solid #243545;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  text-align: left;
  gap: 8px;
}
.contact:hover,
.contact[aria-pressed='true'] {
  color: #d7efff;
  background: #4baed80e;
}
.contact small {
  color: #8bb8b0;
  font-size: 9px;
}
.station {
  max-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
  position: absolute;
  left: 50%;
  top: 51%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 550px));
  min-width: 450px;
}
.station-art {
  flex-shrink: 0;
  height: 230px;
  background:
    linear-gradient(0deg, #08121d, transparent),
    url('/assets/massive-starport-hangar.webp.webp') center 47% / cover;
  display: flex;
  align-items: end;
  padding: 28px;
}
.station-heading {
  text-shadow: 0 2px 12px #000;
}
.station-heading p {
  color: #bac8d5;
  margin-top: 12px;
}
.tabs {
  flex-shrink: 0;
  overflow-x: auto;
  display: flex;
  border-bottom: 1px solid #293b4b;
  padding: 0 24px;
}
.tabs button {
  background: none;
  border: none;
  padding: 17px 18px;
  color: #8495a7;
}
.tabs button.active {
  color: #b6ebdd;
  border-bottom: 2px solid #b6ebdd;
}
.station-body {
  overflow-y: auto;
  min-height: 0;
  padding: 24px 28px;
}
.owned-ships {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.owned-ship,
.shipyard {
  border: 1px solid #294451;
  padding: 14px;
  border-radius: 8px;
  background: #08141bb3;
}
.owned-ship h3,
.shipyard h3 {
  margin-top: 0;
}
.ship-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ship-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ship-actions input {
  width: 190px;
  min-width: 0;
}
.hangar-ship {
  display: flex;
  gap: 24px;
  align-items: center;
  min-height: 130px;
}
.hangar-ship img {
  width: 100px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px #69aacc44);
}
.hangar-ship p,
.fitting p {
  margin: 10px 0;
  color: #b1c0cf;
}
.departure {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  margin-top: 24px;
  border-top: 1px solid #2b3c4d;
  padding-top: 20px;
}
.station > .departure {
  margin: 0;
  padding: 16px 28px;
}
@media (max-height: 800px) {
  .station .station-art {
    height: 130px;
  }
  .mining-panel {
    top: 105px;
    max-height: calc(100vh - 270px);
  }
  body:has(.mining-panel) .pilot {
    display: none;
  }
}
@media (max-width: 700px) {
  .mining-panel {
    left: 16px;
    top: 105px;
    width: min(220px, calc(100vw - 230px));
    max-height: calc(100vh - 270px);
    padding: 12px;
  }
  .equipment-grid {
    grid-template-columns: 1fr;
  }
  .station .tabs {
    padding: 0 8px;
  }
  .station .tabs button {
    padding: 14px 10px;
  }
}
.departure span {
  font-size: 11px;
  line-height: 1.5;
  max-width: 300px;
}
.departure button {
  white-space: nowrap;
}
.objective {
  position: absolute;
  left: 24px;
  top: 390px;
  width: 225px;
  padding: 22px;
}
.objective p {
  font-size: 12px;
  color: #8d9eaf;
  margin-top: 10px;
}
.flight-bottom {
  position: absolute;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 38px;
  padding: 16px 24px;
  white-space: nowrap;
}
.flight-bottom span {
  font-size: 10px;
  color: #a6b6c6;
  line-height: 1.8;
  letter-spacing: 1px;
}
.notice {
  position: fixed;
  bottom: 190px;
  left: 50%;
  transform: translateX(-50%);
  background: #32251d;
  border: 1px solid #8b6850;
  padding: 14px 22px;
  z-index: 5;
  color: #ffe0b2;
  max-width: 90vw;
}
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 15px 24px;
  height: 40px;
  box-sizing: border-box;
  line-height: 10px;
  font-size: 9px;
  letter-spacing: 2px;
  color: #687f94;
  background: #06101be0;
  pointer-events: none;
}
.statistics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 16px 0 24px;
}
.statistics-grid > div {
  border-bottom: 1px solid #ffffff18;
  padding-bottom: 8px;
}
.statistics-grid dt {
  color: #9badc0;
  font-size: 11px;
}
.statistics-grid dd {
  margin: 5px 0 0;
  color: #e0efff;
}
.sign-out {
  flex-shrink: 0;
  font-size: 10px;
}
@media (max-width: 1100px) {
  .station {
    width: calc(100vw - 300px);
    min-width: 0;
    left: auto;
    right: 24px;
    transform: translateY(-50%);
  }
  .contacts {
    top: auto;
    bottom: 54px;
    left: 24px;
    right: auto;
  }
  .station-art {
    height: 180px;
  }
  .topbar {
    gap: 24px;
  }
  .flight-bottom {
    left: auto;
    right: 24px;
    transform: none;
    gap: 15px;
  }
  .flight-bottom span:nth-child(2) {
    display: none;
  }
}
@media (max-width: 700px) {
  .pilot {
    display: none;
  }
  .contacts {
    display: none;
  }
  .station {
    width: calc(100vw - 32px);
    right: 16px;
    top: 50%;
  }
  .topbar {
    padding: 0 16px;
  }
  .sector {
    display: none;
  }
  .station-body {
    padding: 18px;
  }
  .station-art {
    height: 150px;
    padding: 20px;
  }
  .station h1 {
    font-size: 27px;
  }
  .departure {
    gap: 10px;
  }
  .departure span {
    max-width: 170px;
  }
  .flight-bottom {
    left: 16px;
    right: 16px;
    justify-content: space-between;
  }
  .objective {
    top: 100px;
    left: 16px;
    width: 220px;
    padding: 16px;
  }
  footer {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .entry {
    padding: 24px;
  }
}

.commander-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.commander-summary img {
  width: 48px;
  height: 58px;
  object-fit: cover;
  border: 1px solid #425b70;
  border-radius: 4px;
}
.commander-dialog {
  color: #dce7ed;
  background: #09131f;
  border: 1px solid #425b70;
  border-radius: 10px;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
}
.commander-dialog::backdrop {
  background: #020812bb;
}
.commander-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.commander-dialog h3 {
  margin-top: 24px;
  color: #aee8d6;
  font-size: 12px;
  letter-spacing: 1px;
}
.commander-dialog p {
  font-size: 12px;
  line-height: 1.5;
}
.commander-identity {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
}
.commander-identity img {
  width: 80px;
  height: 96px;
  object-fit: cover;
  border-radius: 4px;
}
.commander-identity label {
  flex: 1;
  min-width: 0;
  font-size: 10px;
}
.commander-identity input {
  width: 100%;
  margin-top: 8px;
}
.portrait-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0;
}
.portrait-options button {
  padding: 4px;
  background: #101e2b;
  border: 2px solid transparent;
}
.portrait-options button[aria-pressed='true'] {
  border-color: #aee8d6;
}
.portrait-options img {
  display: block;
  width: 64px;
  height: 80px;
  object-fit: cover;
}
.commander-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}
.commander-portrait-button {
  padding: 0;
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid transparent;
}
.commander-portrait-button img {
  display: block;
}
.commander-portrait-button span {
  display: block;
  padding: 5px 0;
  color: #aee8d6;
  font-size: 9px;
  letter-spacing: 1px;
}
.commander-portrait-button:hover,
.commander-portrait-button:focus-visible {
  border-color: #aee8d6;
}
.portrait-dialog {
  width: min(440px, calc(100vw - 40px));
}
.weapon-energy {
  font-size: 8px;
  color: #bed3e3;
  text-align: center;
}
.topbar .commander-summary {
  width: auto;
  max-width: 220px;
  font-size: 12px;
  flex-shrink: 1;
}
.topbar .commander-summary img {
  width: 32px;
  height: 40px;
  flex-shrink: 0;
}
.topbar:has(.commander-summary) .sector {
  display: none;
}
@media (max-width: 700px) {
  .topbar {
    gap: 12px;
  }
  .topbar .brand {
    font-size: 14px;
  }
  .topbar .connection {
    display: none;
  }
  .topbar .commander-summary {
    max-width: 180px;
  }
}

.weapon-capacitor {
  font-size: 10px;
  text-align: center;
  color: #bed3e3;
  margin-bottom: 12px;
}
.target-panel {
  position: absolute;
  top: 105px;
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  padding: 12px;
  font-size: 11px;
}
.target-panel strong {
  color: #ffc879;
  margin-right: 20px;
}
.target-panel p {
  margin: 6px 0;
}
.target-panel progress {
  width: 100%;
}
.target-panel button {
  margin-top: 8px;
  padding: 5px 10px;
  font-size: 9px;
}
.target-panel small {
  color: #a4b8c6;
}
@media (max-width: 800px) {
  .target-panel {
    top: 80px;
    width: 210px;
  }
}

/* Natural document flow keeps variable-height commander and mining panels apart. */
.left-hud {
  position: absolute;
  left: 24px;
  top: 105px;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
  pointer-events: none;
}
.left-hud > .pilot,
.left-hud > .mining-panel {
  position: static;
  display: block;
  width: 100%;
  max-height: none;
  flex: 0 0 auto;
  margin: 0;
  pointer-events: auto;
  overflow: visible;
  padding: 14px;
}
.left-hud .stat {
  margin: 8px 0;
}
.left-hud .ship-name {
  margin: 8px 0 12px;
}
.left-hud .mining-panel p {
  margin: 5px 0;
  font-size: 11px;
}
.left-hud .mining-panel select {
  margin: 6px 0;
  padding: 7px;
}
.left-hud .mining-panel button {
  padding: 6px 10px;
  font-size: 10px;
}
.left-hud .mining-panel progress {
  margin-top: 7px;
}
body:has(.mining-panel) .left-hud > .pilot {
  display: block;
}
@media (max-width: 1100px) {
  .left-hud {
    width: 225px;
  }
}
@media (max-width: 700px) {
  .left-hud {
    left: 16px;
    width: min(220px, calc(100vw - 230px));
  }
  .left-hud > .pilot,
  .left-hud > .mining-panel {
    padding: 12px;
  }
}

@media (max-width: 700px) {
  body:has(.station) .left-hud {
    display: none;
  }
}
.left-hud {
  pointer-events: auto;
}

/* Theme existing scroll areas without adding scrolling to the HUD. */
* {
  scrollbar-width: thin;
  scrollbar-color: #303840 #080e14;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #080e14;
}
::-webkit-scrollbar-thumb {
  background: #303840;
  border: 1px solid #080e14;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4b5965;
}
::-webkit-scrollbar-corner {
  background: #080e14;
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
}
.support-rack {
  display: flex;
  justify-content: center;
  gap: 10px;
  border-top: 1px solid #253c4d;
  margin-top: 10px;
  padding-top: 10px;
}
.support-module {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.support-module small {
  font-size: 8px;
  text-align: center;
}
.support-dial {
  width: 38px;
  height: 38px;
  padding: 6px;
  border-radius: 50%;
  border: 2px solid #3f5262;
  color: #819aaa;
  background: #08141f;
}
.support-dial svg {
  width: 100%;
  height: 100%;
}
.support-dial.active {
  color: #70d5ff;
  border-color: #459dcc;
  animation: support-dial-pulse 1.6s ease-in-out infinite;
}
@keyframes support-dial-pulse {
  0%,
  100% {
    box-shadow: 0 0 6px #298bbb44;
  }
  50% {
    box-shadow: 0 0 14px #59c3f2aa;
  }
}
.support-dial:disabled {
  opacity: 1;
}
.shield-bar i {
  background: #59c4ff;
}
.shield-stat strong {
  color: #8ad8ff;
}
.chat-panel {
  position: fixed;
  bottom: 40px;
  left: 16px;
  z-index: 15;
  width: min(390px, calc(100vw - 32px));
  pointer-events: auto;
}
.chat-toggle {
  padding: 7px 12px;
}
.chat-content {
  background: #08141ff5;
  border: 1px solid #314554;
  padding: 10px;
}
.chat-content nav {
  display: flex;
  gap: 4px;
}
.chat-content nav button {
  flex: 1;
  padding: 7px 3px;
  font-size: 10px;
}
.chat-content .active {
  color: #94dcf4;
  border-color: #68b7d1;
}
.chat-log {
  height: 160px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  margin: 8px 0;
}
.chat-log p {
  margin: 5px 0;
  font-size: 12px;
  line-height: 1.5;
}
.chat-log time {
  color: #758b9a;
  font-size: 10px;
  margin-right: 6px;
}
.chat-sender {
  border: 0;
  background: transparent;
  color: #a2d9ec;
  padding: 0 5px 0 0;
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
}
.chat-content form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding: 0;
}
.chat-content input {
  min-width: 0;
  flex: 1;
  padding: 8px;
}
.chat-content form button {
  padding: 8px 12px;
}
.chat-content select {
  width: 100%;
}
.chat-error {
  color: #f0ad99;
  font-size: 12px;
}
@media (max-height: 700px) {
  .chat-log {
    height: 110px;
  }
}

.social-hud {
  position: fixed;
  left: 16px;
  bottom: 40px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 15;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.social-hud .chat-panel {
  position: relative;
  left: auto;
  bottom: auto;
  flex-shrink: 0;
}
.fleet-hud {
  width: 250px;
  padding: 10px;
  pointer-events: auto;
  max-height: 65vh;
  overflow: auto;
}
.fleet-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.fleet-member {
  border-top: 1px solid #314554;
  padding: 5px 0;
}
.fleet-select {
  width: 100%;
  text-align: left;
  padding: 5px;
  background: transparent;
  border: 1px solid transparent;
}
.fleet-select:disabled {
  opacity: 1;
  cursor: default;
}
.fleet-select.selected {
  border-color: #79efb0;
}
.fleet-select strong,
.fleet-select small {
  display: block;
}
.fleet-select small {
  color: #a8bac7;
  margin: 3px 0;
}
.fleet-vital {
  display: grid;
  grid-template-columns: 42px 1fr 58px;
  align-items: center;
  gap: 5px;
  font-size: 10px;
}
.fleet-vital meter {
  width: 100%;
  height: 9px;
}
.fleet-vital meter::-webkit-meter-optimum-value {
  background: #70dca3;
}
.fleet-vital.shield meter::-webkit-meter-optimum-value {
  background: #73cafa;
}
.fleet-vital.energy meter::-webkit-meter-optimum-value {
  background: #eed47d;
}
.fleet-controls {
  display: flex;
  gap: 6px;
}
.fleet-controls button,
.fleet-heading button,
.fleet-invite button {
  font-size: 10px;
  padding: 4px 7px;
}
.player-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: auto;
}
.player-menu {
  position: absolute;
  width: 220px;
  padding: 10px;
  display: grid;
  gap: 6px;
}
.friendly-target {
  padding: 12px;
  border-color: #79efb0;
  min-width: 230px;
}
@media (max-width: 720px) {
  .social-hud {
    gap: 6px;
    left: 8px;
    max-width: calc(100vw - 16px);
  }
  .social-hud .chat-panel {
    width: min(390px, calc(52vw - 16px));
  }
  .fleet-hud {
    width: calc(48vw - 14px);
    padding: 6px;
  }
  .fleet-vital {
    grid-template-columns: 35px 1fr;
  }
  .fleet-vital > span:last-child {
    display: none;
  }
}
.flight-bottom {
  left: auto;
  right: 264px;
  transform: none;
  gap: 18px;
  padding: 12px 18px;
}
@media (max-width: 1200px) {
  .social-hud {
    bottom: 120px;
  }
  .flight-bottom {
    left: auto;
    right: 24px;
    bottom: 40px;
  }
}
@media (max-width: 700px) {
  .flight-bottom {
    left: 16px;
    right: 16px;
  }
}

.auth-screen .space {
  background: #000;
}
.auth-screen .space canvas {
  visibility: hidden;
}

.commander-profile {
  min-height: min(620px, calc(100vh - 48px));
}
.commander-name-heading,
.commander-rename {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.commander-name-heading h2 {
  margin: 0;
  overflow-wrap: anywhere;
}
.commander-profile .commander-icon {
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  height: 32px;
}
.commander-profile .commander-heading {
  height: 40px;
}
.commander-rename {
  position: relative;
  height: 40px;
}
.commander-rename input {
  min-width: 0;
  width: 100%;
  height: 40px;
  margin: 0;
  padding-right: 76px;
}
.commander-rename .commander-icon {
  position: absolute;
  top: 4px;
  width: 30px;
  padding: 0;
}
.commander-rename-save {
  right: 38px;
}
.commander-rename-cancel {
  right: 4px;
}
.commander-profile .commander-identity img {
  width: 144px;
  height: 172px;
  object-fit: cover;
  object-position: center;
  background: #08121d;
}
.commander-profile-statistics h3 {
  margin-top: 0;
}
.commander-standing {
  margin-bottom: 15px;
}
.commander-standing .stat {
  margin-bottom: 7px;
}
.commander-standing-track {
  height: 4px;
  background: color-mix(in srgb, var(--faction-colour) 18%, #09131f);
  overflow: hidden;
}
.commander-standing-track span {
  display: block;
  height: 100%;
  background: var(--faction-colour);
  transition: width 0.2s ease;
}
@media (max-width: 440px) {
  .commander-profile .commander-identity img {
    width: 110px;
    height: 132px;
  }
  .commander-profile .commander-heading {
    gap: 6px;
  }
  .commander-profile .commander-heading > button {
    padding: 10px;
  }
}

body .station .station-body:has(.storage-layout) {
  padding-left: 28px;
  padding-right: 28px;
}
.storage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(280px, 0.95fr);
  gap: 18px;
  align-items: start;
  max-width: 1800px;
  margin: 0 auto;
}
.storage-pane {
  min-width: 0;
  padding: 18px;
  border: 1px solid #2c4655;
  background: #0b1822;
}
.storage-pane > h3 {
  margin: 0 0 12px;
}
.storage-volume {
  min-height: 18px;
  margin-bottom: 16px;
}
.storage-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #263b49;
}
.storage-item-row.selected {
  background: #152d3a;
  box-shadow: inset 2px 0 #aee8d6;
}
.storage-item-name {
  background: transparent;
  border: 0;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  padding: 8px;
  font-size: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.storage-item-name span,
.storage-item-name small {
  display: block;
}
.storage-item-name small {
  margin-top: 5px;
  color: #9aafbd;
}
.storage-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 154px;
}
.storage-row-actions button {
  padding: 8px 10px;
  min-height: 32px;
  font-size: 10px;
}
.storage-pane[aria-label='Ship cargo'] .storage-row-actions button {
  width: 100px;
}
.storage-unload-row {
  border-bottom: 0;
}
.storage-row-actions .storage-unpack {
  width: 100%;
}
.storage-inspector {
  position: sticky;
  top: 0;
}
.storage-inspector h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.storage-item-facts {
  border-bottom: 1px solid #263b49;
  margin-bottom: 16px;
}
.storage-ship-preview {
  width: 100%;
  max-height: 170px;
  object-fit: contain;
}
@media (max-width: 1050px) {
  .storage-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .storage-inspector {
    grid-column: 1 / -1;
    position: static;
  }
}
@media (max-width: 650px) {
  .storage-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  body .station .station-body:has(.storage-layout) {
    padding: 16px;
  }
}

/* Keep the storage workspace fixed; each pane owns its overflow. */
body .station .station-body:has(.storage-layout) {
  display: flex;
  overflow: hidden;
}
.station-body .storage-layout {
  flex: 1;
  min-height: 0;
  width: 100%;
  align-items: stretch;
  grid-template-rows: minmax(0, 1fr);
}
.station-body .storage-pane {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.station-body .storage-inspector {
  position: static;
}
@media (max-width: 1050px) {
  .station-body .storage-layout {
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .station-body .storage-layout {
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
}

.storage-item-name:hover,
.storage-item-name:active {
  background: transparent;
}
.storage-item-name:focus:not(:focus-visible) {
  outline: none;
}

.syndicate-structure {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #2c4655;
  background: #0b1822;
}
.structure-bar {
  height: 8px;
  margin: 4px 0 10px;
  background: #16262f;
}
.structure-bar > div {
  height: 100%;
  background: #66ffd1;
}
.structure-deliver {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.system-bonus {
  margin: 10px 0;
  padding: 8px 10px;
  border-left: 3px solid #66ffd1;
  background: #0b1822;
}
.system-bonus small {
  display: block;
  margin-top: 4px;
  color: #819aaa;
}
.system-bonus {
  padding: 8px 10px;
  border-left: 3px solid #66ffd1;
  background: #0b1822;
}
.system-bonus strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
}
.bonus-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.syndicate-dialog {
  width: min(880px, calc(100vw - 32px));
}
.syndicate-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 10px 0 14px;
  border-bottom: 1px solid #2c4655;
}
.syndicate-tabs button {
  position: relative;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #819aaa;
  letter-spacing: 0.08em;
}
.syndicate-tabs button.active {
  color: #c5d8e0;
  border-bottom-color: #66ffd1;
}
.tab-badge {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: #ff9a4d;
  color: #10232c;
  font-size: 11px;
}
.syndicate-body {
  min-width: 0;
  padding: 0;
  border: 0;
}
.syndicate-section {
  margin: 0 0 16px;
}
.syndicate-section h3 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #263b49;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.syndicate-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #1c303d;
  background: #0b1822;
  margin-bottom: 6px;
}
.syndicate-member.online {
  border-color: #2c4655;
}
.syndicate-member-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.presence-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4b5b67;
}
.presence-dot.online {
  background: #66ffd1;
  box-shadow: 0 0 6px #66ffd1;
}
.rank-badge {
  padding: 1px 6px;
  border: 1px solid #3f5262;
  border-radius: 3px;
  color: #819aaa;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rank-leader {
  color: #f2c94c;
  border-color: #f2c94c;
}
.rank-officer {
  color: #5fd4ff;
  border-color: #5fd4ff;
}
.syndicate-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 16px;
}
.syndicate-stats > div {
  padding: 10px;
  border: 1px solid #263b49;
  background: #0b1822;
}
.syndicate-stats strong {
  display: block;
  font-size: 18px;
}
.link-button {
  border: 0;
  background: none;
  color: #66ffd1;
  text-decoration: underline;
  padding: 0;
}
.treasury-balance {
  margin: 4px 0;
  font-size: 26px;
  font-weight: 700;
  color: #f2c94c;
}
.treasury-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ledger th,
.ledger td {
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid #1c303d;
}
.ledger .gain {
  color: #66ffd1;
}
.ledger .loss {
  color: #ff8a6b;
}

/* Syndicate window: one fixed size for every tab; only the body scrolls. */
.syndicate-dialog {
  width: min(900px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 32px));
  padding: 24px 28px;
  overflow: hidden;
}
.syndicate-dialog[open] {
  display: flex;
  flex-direction: column;
}
.syndicate-dialog .commander-heading {
  flex: none;
  align-items: flex-start;
}
.syndicate-motto {
  margin: 8px 0 0;
  color: #9db4c2;
  font-style: italic;
}
.syndicate-tabs {
  flex: none;
  gap: 8px;
  margin: 18px 0 20px;
}
.syndicate-tabs button {
  padding: 10px 14px;
}
.syndicate-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-gutter: stable;
  line-height: 1.55;
}
.syndicate-body p,
.syndicate-body li {
  margin: 0 0 10px;
}
.syndicate-body ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.syndicate-body small {
  line-height: 1.5;
}
.syndicate-section {
  margin: 0 0 26px;
}
.syndicate-section h3 {
  margin: 0 0 14px;
  padding-bottom: 8px;
}
.syndicate-rank {
  margin: 0 0 18px;
}
.syndicate-stats {
  gap: 14px;
  margin: 0 0 22px;
}
.syndicate-stats > div {
  padding: 14px 16px;
}
.syndicate-stats small {
  display: block;
  margin-top: 4px;
}
.syndicate-member {
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.syndicate-member-main small {
  margin-top: 4px;
}
.syndicate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.syndicate-structure {
  margin: 0 0 22px;
  padding: 16px 18px;
}
.treasury-form {
  gap: 12px;
  margin-top: 14px;
}
.ledger th,
.ledger td {
  padding: 8px 10px;
}
.syndicate-body label {
  display: block;
  margin: 0 0 14px;
}

/* Syndicate badge: circular icon (artwork later), name, tag and rank. */
.syndicate-badge {
  display: flex;
  align-items: center;
  gap: 18px;
}
.syndicate-icon {
  display: grid;
  flex: none;
  place-items: center;
  overflow: hidden;
  border: 2px solid;
  border-radius: 50%;
  background: #0b1822;
}
.syndicate-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.syndicate-icon-tag {
  font: 700 13px/1 monospace;
  letter-spacing: 0.06em;
}
.syndicate-badge-text {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.syndicate-badge-text strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}
.syndicate-badge-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.syndicate-tag {
  color: #9db4c2;
  font: 700 12px monospace;
  letter-spacing: 0.08em;
}
.syndicate-badge.unaffiliated .syndicate-icon {
  border-style: dashed;
  border-color: #3f5262;
  color: #4b5b67;
}
.commander-syndicate {
  display: grid;
  gap: 22px;
  margin: 12px 0 8px;
  padding: 18px;
  border: 1px solid #263b49;
  background: #0b1822;
}
.commander-syndicate-open {
  justify-self: start;
  padding: 10px 18px;
}
.pilot-profile-syndicate {
  display: grid;
  gap: 12px;
}
.pilot-profile-syndicate .syndicate-badge {
  gap: 14px;
}

.icon-picker {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}
.icon-picker-preview {
  display: flex;
  align-items: center;
  gap: 20px;
}
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-width: 420px;
}
.icon-choice {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid #2c4655;
  border-radius: 50%;
  background: #08141f;
  color: #819aaa;
}
.icon-choice .syndicate-icon {
  border: 0;
  background: none;
}
.icon-choice.selected {
  background: #0b1822;
  box-shadow: 0 0 10px currentColor;
}

.target-meters { display: grid; gap: 6px; margin: 8px 0; }
.target-meter { position: relative; height: 16px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.target-meter span { position: relative; z-index: 1; padding: 0 6px; line-height: 16px; font-size: 10px; }
.target-meter i { position: absolute; inset: 0 auto 0 0; }
.target-meter .shield { background: rgba(95, 212, 255, 0.55); }
.target-meter .hull { background: rgba(255, 154, 77, 0.55); }

.resonance-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 420px;
  margin: 40px auto;
  text-align: center;
}
.resonance-panel h2 {
  margin: 0;
}
.resonance-orb {
  width: 84px;
  height: 84px;
  padding: 0;
  border: 1px solid rgba(160, 108, 255, 0.35);
  border-radius: 50%;
  background: radial-gradient(circle, #f1e6ff 0%, #b58cff 35%, rgba(160, 108, 255, 0) 72%);
  box-shadow: 0 0 40px rgba(160, 108, 255, 0.55);
  cursor: default;
  opacity: 0.55;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.resonance-orb.is-ready {
  opacity: 1;
  cursor: pointer;
}
.resonance-orb.is-ready:hover,
.resonance-orb.is-ready:focus-visible {
  transform: scale(1.12);
  box-shadow: 0 0 70px rgba(190, 140, 255, 0.95), 0 0 24px rgba(255, 255, 255, 0.6);
  animation: resonance-pulse 0.9s ease-in-out infinite;
}
.resonance-orb.is-working {
  animation: resonance-pulse 0.35s ease-in-out infinite;
}
.resonance-reveal {
  position: relative;
}
.resonance-orb.is-burst {
  position: absolute;
  top: -20px;
  pointer-events: none;
  animation: resonance-burst 1.1s ease-out forwards;
}
.resonance-flash {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(190, 140, 255, 0.4) 40%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  animation: resonance-flash 0.9s ease-out;
}
.resonance-card {
  display: grid;
  gap: 8px;
  padding: 18px 22px;
  border: 1px solid rgba(190, 140, 255, 0.5);
  background: rgba(20, 14, 40, 0.75);
  animation: resonance-reveal 0.7s 0.5s ease-out both;
}
.resonance-card small {
  letter-spacing: 0.14em;
  font-size: 10px;
  color: #b9a3f0;
}
.resonance-card h2 {
  color: #f1e6ff;
}
.resonance-reveal > .primary {
  animation: resonance-reveal 0.5s 1.1s ease-out both;
}
@keyframes resonance-pulse {
  50% {
    box-shadow: 0 0 90px rgba(210, 170, 255, 1), 0 0 30px rgba(255, 255, 255, 0.8);
  }
}
@keyframes resonance-burst {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(9);
    opacity: 0;
  }
}
@keyframes resonance-flash {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes resonance-reveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}
@media (prefers-reduced-motion: reduce) {
  .resonance-orb,
  .resonance-orb.is-ready:hover,
  .resonance-orb.is-working,
  .resonance-orb.is-burst,
  .resonance-flash,
  .resonance-card,
  .resonance-reveal > .primary {
    animation: none;
    transition: none;
  }
  .resonance-orb.is-burst,
  .resonance-flash {
    display: none;
  }
}
.resonance-total {
  display: grid;
  gap: 2px;
}
.resonance-total strong {
  font-size: 44px;
  line-height: 1;
  color: #d8c6ff;
}
.resonance-total span {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: #9d86d6;
}
.resonance-panel p {
  margin: 0;
}
.resonance-note {
  font-size: 12px;
}

.major-breach-ring {
  animation: major-breach-pulse 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
}
@keyframes major-breach-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.9);
    filter: drop-shadow(0 0 3px #b58cff);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
    filter: drop-shadow(0 0 10px #b58cff);
  }
}
.major-breach-note {
  color: #d8c6ff;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.pvp-on {
  border-color: #ff8a70;
  color: #ffb8a8;
}

.forgot-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
