/* GoSpace — Stage 01 Hangar Loadout, Stage 02 Launchpad & Parts Manifest (fluid rem) */

.hangar-loadout {
  width: max(23rem, 340px);
  max-width: min(26rem, 36vw);
  max-height: 100%;
  min-height: 0;
  padding: 0.58rem;
  display: flex;
  flex-direction: column;
  gap: 0.43rem;
  pointer-events: auto;
}

.loadout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.43rem;
  padding-bottom: 0.36rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.loadout-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-bright);
}

.loadout-actions {
  display: flex;
  align-items: center;
  gap: 0.29rem;
}

#hangar-loadout .btn-autobuild,
#hangar-loadout .btn-sci {
  height: 1.75rem;
  min-height: 0;
  padding: 0 0.55rem 0 0.65rem;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 700;
}

#hangar-loadout .btn-autobuild .gi,
#hangar-loadout .btn-sci .gi {
  width: 0.9rem;
  height: 0.9rem;
}

.loadout-nav {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  flex-shrink: 0;
}

.segment-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.29rem;
}

#hangar-loadout .seg-tab {
  height: 1.9rem;
  min-height: 0;
  padding: 0 0.22rem 0 0.32rem;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  justify-content: center;
  gap: 0.22rem;
}

#hangar-loadout .seg-tab .gi {
  width: 0.88rem;
  height: 0.88rem;
}

/* Sub-tabs always sit on one row: chips share the width and shrink
   instead of wrapping a lone chip (e.g. "Hull") onto a second line. */
.sub-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.29rem;
  min-width: 0;
}

#hangar-loadout .sub-chip {
  flex: 1 1 auto;
  min-width: 0;
  height: 1.75rem;
  min-height: 0;
  padding: 0 0.32rem 0 0.4rem;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-dim);
}

#hangar-loadout .sub-chip.active {
  color: var(--accent-bright);
}

.equipment-strip {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  padding-right: 0.14rem;
}

#hangar-loadout .equip-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.29rem;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0.44rem 0.58rem 0.44rem 0.68rem;
  text-align: left;
  white-space: normal;
  flex-shrink: 0;
}

#hangar-loadout .equip-card.compat-bad {
  --rim: var(--rim-crimson);
  --bar: var(--status-bad);
}

#hangar-loadout .equip-card.compat-bad.selected {
  --fill: linear-gradient(180deg, rgba(239, 68, 68, 0.20) 0%, rgba(239, 68, 68, 0.08) 100%), var(--graphite);
  --rim: var(--rim-crimson);
  --bar: var(--status-bad);
}

/* Contract's intended pick: green edge + TARGET tag */
#hangar-loadout .equip-card.is-target:not(.selected) {
  --rim: var(--rim-emerald);
  --bar: var(--status-good);
}

/* Valid but off-contract choice: calm, slightly dimmed, no red */
#hangar-loadout .equip-card.is-off-target {
  --bar: rgba(156, 163, 175, 0.35);
}

#hangar-loadout .equip-card.is-off-target .equip-name {
  color: var(--text-dim);
}

#hangar-loadout .equip-card.is-off-target:not(:disabled):hover .equip-name {
  color: var(--text-main);
}

.equip-target-tag {
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.equip-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.43rem;
  min-width: 0;
  width: 100%;
}

.equip-name {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.equip-check-badge {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink);
  background: var(--accent-bright);
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.equip-check-badge .gi {
  width: 0.8rem;
  height: 0.8rem;
}

.equip-row-stats {
  gap: 0.29rem;
}

/* Stage 01 Bottom-Right Compact 3D View Pill */
.cam-pill-card {
  display: flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.4rem;
}

.cam-pill-card .btn-sci {
  height: 1.9rem;
  min-height: 0;
  padding: 0 0.64rem 0 0.72rem;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* ------------------------------------------------------------------
   STAGE 02 LAUNCHPAD / ASCENT TELEMETRY
   ------------------------------------------------------------------ */
.ascent-card {
  width: max(21.5rem, 320px);
  max-width: calc(100vw - 1.4rem);
  padding: 0.64rem 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.43rem;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-main);
  white-space: nowrap;
}

/* Long phase names (e.g. VACUUM ORBIT INSERTION) drop to a second row
   instead of pushing the Skip button out of the card. */
.ascent-card .card-head {
  flex-wrap: wrap;
  row-gap: 0.36rem;
}

.ascent-head-right {
  display: flex;
  align-items: center;
  gap: 0.36rem;
  flex-shrink: 0;
  margin-left: auto;
  max-width: 100%;
}

.skip-launch-btn {
  height: 1.62rem;
  min-height: 0;
  padding: 0 0.52rem 0 0.58rem !important;
  font-family: var(--font-mono) !important;
  font-size: var(--fs-xs) !important;
}

.skip-launch-btn .gi {
  width: 0.82rem;
  height: 0.82rem;
}

.ascent-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.43rem;
}

.ascent-stat {
  padding: 0.29rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  gap: 0.07rem;
}

.ascent-stat span {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.ascent-stat strong {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-main);
}

.ascent-prog-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--accent-bright);
}

.ascent-prog-track {
  flex: 1;
}

.ascent-prog-fill {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
  transition: width 0.14s linear;
}

.telem-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  padding: 0.29rem 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.callout-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ascent-cam-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.29rem;
}

.ascent-cam-row .btn-sci {
  height: 1.72rem;
  min-height: 0;
  padding: 0 0.2rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

#center-action-hud #lch-ignite-btn.action-prompt.is-ignite {
  height: 2.85rem;
  padding: 0 1.45rem 0 1.55rem;
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 0.72rem;
  box-shadow: 0 0 1.7rem rgba(94, 231, 255, 0.38);
}

/* ------------------------------------------------------------------
   PARTS MANIFEST DRAWER
   ------------------------------------------------------------------ */
.mel-drawer {
  position: fixed;
  left: 0.72rem;
  bottom: 4.4rem;
  z-index: 48;
  width: 22rem;
  max-width: calc(100vw - 1.4rem);
  max-height: 18rem;
  padding: 0.58rem 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 0.43rem;
  pointer-events: auto;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--text-main);
}

.mel-body {
  overflow-y: auto;
  max-height: 14.5rem;
}

.mel-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.mel-table th,
.mel-table td {
  padding: 0.29rem 0.36rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.mel-table th {
  color: var(--text-muted);
  font-weight: 700;
}
