/* Invasion HUD + base console + deploy overlay — the jet-canopy language
   (Share Tech Mono, cyan/orange), solid clickable command surfaces. */
:root {
  --inv-cyan: #65e4e3;
  --inv-orange: #ff5a32;
  --inv-dim: #7d9a99;
  --inv-ink: #c4d8d5;
  --inv-bg: rgba(4, 16, 20, 0.86);
  --inv-line: rgba(101, 228, 227, 0.35);
}

/* ---------- strip (right side, under the visor) ---------- */
#invhud {
  position: fixed; top: 76px; right: 24px; z-index: 6; width: 300px;
  box-sizing: border-box; padding: 10px 12px;
  color: var(--inv-ink); font: 400 11px/1.35 "Share Tech Mono", ui-monospace, monospace;
  letter-spacing: .04em; font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px #031114, 0 0 5px #031114; pointer-events: none;
  background: linear-gradient(180deg, rgba(4,16,20,.55), rgba(4,16,20,.25));
  border-left: 1px solid var(--inv-line);
}
#invhud .inv-title { display: flex; justify-content: space-between; color: var(--inv-cyan); font-size: 12px; letter-spacing: .12em; margin-bottom: 6px; }
#invhud .inv-row { display: flex; justify-content: space-between; gap: 8px; }
#invhud .inv-row b { color: var(--inv-cyan); font-weight: 400; }
#invhud .inv-bases { margin-top: 8px; border-top: 1px solid var(--inv-line); padding-top: 6px; }
#invhud .inv-base { display: grid; grid-template-columns: 14px 1fr 34px 54px; gap: 6px; align-items: center; padding: 1px 0; }
#invhud .inv-base .dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa7ad; box-shadow: 0 0 6px #9aa7ad; }
#invhud .inv-base.red .dot { background: var(--inv-orange); box-shadow: 0 0 6px var(--inv-orange); }
#invhud .inv-base.blue .dot { background: var(--inv-cyan); box-shadow: 0 0 6px var(--inv-cyan); }
#invhud .inv-base .st { color: var(--inv-dim); text-align: right; }
#invhud .inv-base.alerted .st, #invhud .inv-base.allout .st { color: var(--inv-orange); }
#invhud .inv-base.engineer .st { color: #a0ff70; }
#invhud .inv-base.here { outline: 1px solid var(--inv-line); outline-offset: 1px; }
#invhud .inv-events { margin-top: 8px; border-top: 1px solid var(--inv-line); padding-top: 5px; color: var(--inv-dim); min-height: 3.9em; }
#invhud .inv-events div:last-child { color: var(--inv-ink); }
#invhud .inv-pocket { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
#invhud .inv-pocket span, .inv-chip { padding: 1px 6px; border: 1px solid var(--inv-line); color: var(--inv-cyan); font-size: 10px; }
#invhud.tele { animation: invTele .35s steps(2) 4; }
@keyframes invTele { 50% { border-left-color: var(--inv-orange); background: rgba(255,90,50,.18); } }

#invprompt {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 6;
  color: var(--inv-cyan); font: 400 13px/1.3 "Share Tech Mono", ui-monospace, monospace; letter-spacing: .12em;
  padding: 6px 14px; border: 1px solid var(--inv-line); background: var(--inv-bg); pointer-events: none;
}
#invprompt[hidden] { display: none !important; }

/* ---------- base console ---------- */
#invconsole, #invdeploy {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 10, 14, 0.62); color: var(--inv-ink);
  font: 400 12px/1.35 "Share Tech Mono", ui-monospace, monospace; letter-spacing: .05em;
}
#invconsole[hidden], #invdeploy[hidden] { display: none !important; }
.inv-panel {
  width: min(980px, 94vw); max-height: 92vh; overflow: auto; box-sizing: border-box; padding: 16px 20px;
  background: var(--inv-bg); border: 1px solid var(--inv-line); box-shadow: 0 0 40px rgba(101,228,227,.12), inset 0 0 60px rgba(0,0,0,.4);
}
.inv-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--inv-line); padding-bottom: 8px; margin-bottom: 12px; }
.inv-head h2 { margin: 0; font-size: 16px; font-weight: 400; letter-spacing: .18em; color: var(--inv-cyan); }
.inv-head .sub { color: var(--inv-dim); }
.inv-head .sub b { color: var(--inv-orange); font-weight: 400; }
.inv-body { display: grid; grid-template-columns: auto 1fr; gap: 18px; }
.inv-gridwrap { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.inv-grid { display: grid; gap: 3px; background: rgba(101,228,227,.08); padding: 6px; border: 1px solid var(--inv-line); }
.inv-cell {
  width: 62px; height: 62px; box-sizing: border-box; border: 1px solid rgba(101,228,227,.22); background: rgba(6,24,30,.9);
  color: var(--inv-ink); font: inherit; font-size: 10px; cursor: pointer; position: relative; padding: 0; text-align: left;
}
.inv-cell.mech { background: rgba(70, 110, 130, .55); }
.inv-cell.weapon { background: rgba(140, 90, 60, .55); }
.inv-cell.utility { background: rgba(90, 130, 90, .55); }
.inv-cell.sel { outline: 2px solid var(--inv-cyan); outline-offset: -2px; }
.inv-cell.ok { background: rgba(101,228,227,.35); }
.inv-cell.bad { background: rgba(255,90,50,.35); }
.inv-cell.linked::after { content: ""; position: absolute; inset: 3px; border: 1px dashed rgba(160,255,112,.6); pointer-events: none; }
.inv-cell .nm { position: absolute; left: 4px; top: 3px; color: #fff; letter-spacing: .08em; }
.inv-cell .hp { position: absolute; left: 4px; bottom: 3px; color: var(--inv-dim); }
.inv-cell .ck { position: absolute; right: 4px; bottom: 3px; color: var(--inv-cyan); }
.inv-cell .ck.ready { color: #a0ff70; }
.inv-side { display: flex; flex-direction: column; gap: 10px; min-width: 300px; }
.inv-sec h3 { margin: 0 0 6px; font-size: 11px; font-weight: 400; letter-spacing: .16em; color: var(--inv-dim); }
.inv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-chip { cursor: pointer; background: none; font: inherit; padding: 4px 8px; }
.inv-chip.sel { background: rgba(101,228,227,.25); }
.inv-chip:disabled { opacity: .45; cursor: default; }
.inv-btn {
  cursor: pointer; font: inherit; letter-spacing: .12em; padding: 6px 12px; color: var(--inv-cyan);
  background: rgba(101,228,227,.08); border: 1px solid var(--inv-line);
}
.inv-btn:hover:not(:disabled) { background: rgba(101,228,227,.22); }
.inv-btn:disabled { opacity: .4; cursor: default; }
.inv-btn.warn { color: var(--inv-orange); border-color: rgba(255,90,50,.5); }
.inv-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-list { display: grid; gap: 4px; }
.inv-item { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 3px 0; border-bottom: 1px dotted rgba(101,228,227,.18); }
.inv-item small { color: var(--inv-dim); }
.inv-hint { color: var(--inv-dim); font-size: 10px; }
.inv-foot { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--inv-line); padding-top: 8px; }

/* ---------- deploy ---------- */
.inv-options { display: grid; gap: 6px; margin: 6px 0 12px; }
.inv-opt { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; text-align: left; cursor: pointer;
  font: inherit; color: var(--inv-ink); background: rgba(6,24,30,.9); border: 1px solid var(--inv-line); padding: 8px 12px; }
.inv-opt small { color: var(--inv-dim); display: block; }
.inv-opt.sel { background: rgba(101,228,227,.22); }
.inv-opt:disabled { opacity: .4; cursor: default; }
.inv-opt .tag { color: var(--inv-orange); letter-spacing: .12em; }
.inv-launch { font-size: 14px; padding: 10px 26px; }

/* ---------- hangar screen: the service bay IS the backdrop ----------
   edge arrows cycle berths, bottom-centre dock = route toggle + departure,
   everything else is decorative frame. */
#invdeploy { --hg-y: #eed56d; --hg-ink: #f1efe4; --hg-dim: #a1a19a; --hg-plate: #191b1cd9; --hg-line: #85857766; --hg-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --inv-cyan: var(--hg-y); --inv-orange: var(--hg-y); --inv-dim: var(--hg-dim); --inv-ink: #e7e6de; --inv-line: #77776a55;
  padding: 0; pointer-events: none; color: var(--hg-ink); font-family: var(--hg-mono);
  background: linear-gradient(90deg, #0009, transparent 15%, transparent 85%, #0009), linear-gradient(0deg, #000b, transparent 32%); }
#invdeploy [hidden] { display: none !important; }
#invdeploy button { font-family: var(--hg-mono); }
#invdeploy kbd { display: inline-block; min-width: 1.4em; padding: 2px 5px; border: 1px solid currentColor; border-radius: 2px; font: 9px/1.2 var(--hg-mono); letter-spacing: .08em; opacity: .7; text-align: center; }
#invdeploy :is(button, select):focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@keyframes hg-blink { 50% { opacity: .25; } }
@keyframes hg-march { to { background-position: 22.63px 0; } }

/* decorative frame */
.hangar-frame { position: absolute; inset: 0; pointer-events: none; }
.hf-corner { position: absolute; width: 26px; height: 26px; border: 0 solid #eed56d99; }
.hf-corner.tl { left: 16px; top: 16px; border-width: 2px 0 0 2px; }
.hf-corner.tr { right: 16px; top: 16px; border-width: 2px 2px 0 0; }
.hf-corner.bl { left: 16px; bottom: 16px; border-width: 0 0 2px 2px; }
.hf-corner.br { right: 16px; bottom: 16px; border-width: 0 2px 2px 0; }
.hf-ruler { position: absolute; top: 22px; left: 50%; width: min(361px, 44vw); height: 10px; transform: translateX(-50%);
  background: repeating-linear-gradient(90deg, #f1efe499 0 1px, transparent 1px 60px) bottom / 100% 10px no-repeat,
              repeating-linear-gradient(90deg, #f1efe444 0 1px, transparent 1px 12px) bottom / 100% 5px no-repeat; }
.hf-ruler::after { content: ""; position: absolute; left: 50%; top: 14px; border: 5px solid transparent; border-top-color: var(--hg-y); transform: translateX(-50%); }
.hf-ruler span { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10px; letter-spacing: .24em; color: var(--hg-dim); text-shadow: 0 1px 6px #000; }
.hf-ruler b { font-weight: 400; color: var(--hg-y); font-variant-numeric: tabular-nums; }
.bay-moving .hangar-bay-count::before { content: "TRAVERSING / "; }
.hf-readout { position: absolute; bottom: 34px; font-size: 9px; line-height: 1.9; letter-spacing: .16em; color: #a1a19acc; text-shadow: 0 1px 6px #000; }
.hf-readout b { font-weight: 400; color: var(--hg-y); }
.hf-left { left: 44px; }
.hf-right { right: 44px; text-align: right; }

/* top-left: bay + mech identity */
.hangar-title { position: absolute; left: 44px; top: 40px; text-shadow: 0 2px 12px #000; }
.hangar-title > span { color: #c6c5b8; font-size: 10px; letter-spacing: .19em; }
.hangar-title h1 { margin: 10px 0 14px; font: 500 clamp(26px, 4vw, 48px)/1.1 system-ui, sans-serif; letter-spacing: .06em; }
.hangar-title h1 b { font-weight: 300; color: var(--hg-y); }
.hangar-mech-name { margin: 0 0 6px; padding-left: 10px; border-left: 2px solid var(--hg-y); font-size: 17px; letter-spacing: .12em; text-transform: uppercase; }
.hangar-mech-arms { display: block; padding-left: 12px; color: #c7c7bb; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* top-right: supply telemetry */
.hangar-telemetry { position: absolute; right: 44px; top: 40px; display: grid; justify-items: end; gap: 6px; text-shadow: 0 2px 10px #000; }
.hangar-telemetry .inv-title-text { font-size: 11px; letter-spacing: .22em; }
.hangar-telemetry .inv-dsub { font-size: 20px; font-weight: 400; letter-spacing: .06em; color: var(--hg-y); }
.hangar-live { display: flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: .2em; color: var(--hg-dim); }
.hangar-live i { width: 6px; height: 6px; border-radius: 50%; background: #7fdc8a; box-shadow: 0 0 8px #7fdc8a; animation: hg-blink 1.6s steps(1) infinite; }

/* edge arrows */
.hangar-arrow { position: absolute; top: 50%; transform: translateY(-50%); display: block; padding: 0; border: 0; background: none; color: var(--hg-ink); cursor: pointer; pointer-events: auto; }
.hangar-arrow[data-step="-1"] { left: 32px; }
.hangar-arrow[data-step="1"] { right: 32px; }
.hangar-arrow::before { content: ""; position: absolute; left: 50%; bottom: calc(100% + 10px); width: 1px; height: 44px; background: linear-gradient(transparent, #eed56d99); }
.ha-plate { display: grid; place-items: center; width: 62px; height: 118px; background: var(--hg-plate); border: 1px solid var(--hg-line); transition: background .15s, color .15s, transform .1s;
  clip-path: polygon(0 12px, 12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
.ha-plate svg { width: 22px; height: 44px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: square; }
.hangar-arrow[data-step="1"] svg { transform: scaleX(-1); }
.hangar-arrow:hover:not(:disabled) .ha-plate { background: var(--hg-y); color: #1d1f1a; }
.hangar-arrow[data-step="-1"]:active .ha-plate { transform: translateX(-3px); }
.hangar-arrow[data-step="1"]:active .ha-plate { transform: translateX(3px); }
.hangar-arrow:disabled { opacity: .35; cursor: default; }
.ha-text { position: absolute; top: 50%; transform: translateY(-50%); display: grid; gap: 3px; width: max-content; max-width: 140px; text-shadow: 0 2px 8px #000; }
.hangar-arrow[data-step="-1"] .ha-text { left: calc(100% + 14px); justify-items: start; text-align: left; }
.hangar-arrow[data-step="1"] .ha-text { right: calc(100% + 14px); justify-items: end; text-align: right; }
.ha-bay { font-size: 10px; font-weight: 400; letter-spacing: .2em; color: var(--hg-y); }
.ha-name { font-size: 10px; letter-spacing: .06em; color: #c7c7bb; }
.hangar-arrow kbd { position: absolute; left: 50%; top: calc(100% + 10px); transform: translateX(-50%); color: var(--hg-dim); }

/* bottom-centre dock */
.hangar-dock { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); width: min(400px, calc(100vw - 32px)); display: grid; gap: 10px; pointer-events: auto; }
.hangar-bays { display: flex; justify-content: center; gap: 6px; }
.hangar-weapons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; border: 1px solid var(--hg-line); background: var(--hg-plate); }
.hangar-weapons label { display: grid; min-width: 0; gap: 5px; color: var(--hg-dim); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.hangar-weapons select { width: 100%; min-width: 0; padding: 7px 4px; border: 1px solid var(--hg-line); border-radius: 0; background: #202a2c; color: var(--hg-ink); font: 11px var(--hg-mono); cursor: pointer; }
.hangar-weapons select:focus-visible { outline: 1px solid var(--hg-y); }
.hangar-weapons select:disabled { opacity: .45; cursor: wait; }
.hangar-bay { display: grid; justify-items: center; gap: 5px; padding: 2px 4px; border: 0; background: none; color: var(--hg-dim); cursor: pointer; font-size: 9px; letter-spacing: .12em; text-shadow: 0 1px 6px #000; }
.hangar-bay::after { content: ""; width: 30px; height: 4px; background: #f1efe433; transition: background .15s; }
.hangar-bay .hangar-berth-name { display: none; }
.hangar-bay:hover::after { background: #f1efe4aa; }
.hangar-bay[aria-pressed="true"] { color: var(--hg-y); }
.hangar-bay[aria-pressed="true"]::after { background: var(--hg-y); box-shadow: 0 0 10px #eed56d88; }
.bay-moving .hangar-bay[aria-pressed="true"]::after { animation: hg-blink .5s steps(1) infinite; }
#invdeploy .inv-options { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; margin: 0; padding: 3px; border: 1px solid var(--hg-line); background: var(--hg-plate); }
#invdeploy .inv-opt { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 8px; border: 0; background: transparent; color: var(--hg-dim); font-size: 10px; letter-spacing: .14em; }
#invdeploy .inv-opt .route-icon { font-size: 13px; }
#invdeploy .inv-opt .tag { padding: 1px 4px; border: 1px solid currentColor; color: inherit; font-size: 8px; letter-spacing: .12em; opacity: .8; }
#invdeploy .inv-opt.sel { background: #eed56d1f; color: var(--hg-y); box-shadow: inset 0 -2px var(--hg-y); }
#invdeploy .inv-opt:hover:not(:disabled, .sel) { color: var(--hg-ink); }
#invdeploy .inv-opt:disabled { opacity: .45; cursor: not-allowed; }
#invdeploy .inv-launch { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 60px; padding: 0 24px; border: 0; border-radius: 0; background: var(--hg-y); color: #1d1f1a; cursor: pointer; transition: background .15s;
  font: 600 17px/1 var(--hg-mono); letter-spacing: .42em;
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%); }
#invdeploy .inv-launch::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, #1d1f1a 0 8px, transparent 8px 16px); opacity: .85;
  -webkit-mask: linear-gradient(90deg, #000 0 36px, transparent 36px calc(100% - 36px), #000 calc(100% - 36px));
          mask: linear-gradient(90deg, #000 0 36px, transparent 36px calc(100% - 36px), #000 calc(100% - 36px)); }
#invdeploy .inv-launch .launch-label { position: relative; padding-left: .42em; }
#invdeploy .inv-launch kbd { position: absolute; right: 48px; color: #1d1f1a; font-weight: 400; }
#invdeploy .inv-launch:hover:not(:disabled) { background: #fbeaa9; }
#invdeploy .inv-launch:disabled { background: #54564e; color: #c7c7bb; cursor: default; }
#invdeploy .inv-launch:disabled::before { background: repeating-linear-gradient(-45deg, #2c2d29 0 8px, transparent 8px 16px) 0 0 / 22.63px 22.63px; -webkit-mask: none; mask: none; opacity: .6; animation: hg-march .6s linear infinite; }
#invdeploy .inv-launch:disabled kbd { display: none; }
.hangar-dock .inv-dstatus { display: none; }
.hangar-keys { font-size: 9px; letter-spacing: .14em; text-align: center; white-space: pre; color: #a1a19a99; }

/* departure cinematic */
#hangar-cinema { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
#hangar-cinema[hidden] { display: none; }
.hc-bar { position: absolute; left: 0; right: 0; height: 8vh; background: #101111; }
.hc-top { top: 0; }
.hc-bottom { bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 5vw; color: #f1efe4; font: 11px/1.5 ui-monospace, monospace; letter-spacing: .13em; }
.hc-stage { color: #a1a19a; letter-spacing: .03em; }
.hc-fade { position: absolute; inset: 0; background: #101111; opacity: 0; }
body:is(.in-hangar, .hangar-departure) :is(#hud, #flight-heading, #flight-console, #vitals, #ring, #predict, #coronal-status, #weaponbar, #weaponbar-labels, #lock, #mmwrap, #hint, #invhud, #invprompt, #mobamarks, #mobalaser-source, #mobaoff, #touch) { visibility: hidden !important; }
body.paused #hangar-cinema { display: none; }
body:is(.in-hangar, .hangar-departure) :is(.cockpit-frame, #hud-detail-toggle) { visibility: hidden !important; }

@media (max-width: 1000px) { .hf-readout { display: none; } }
@media (max-width: 760px) {
  .hangar-title { left: 20px; top: 24px; }
  .hangar-title h1 { margin: 6px 0 8px; }
  .hangar-title > span { font-size: 8px; }
  .hangar-mech-name { font-size: 13px; }
  .hangar-mech-arms { display: none; }
  .hangar-telemetry { right: 20px; top: 24px; }
  .hangar-telemetry .inv-title-text { display: none; }
  .hangar-telemetry .inv-dsub { font-size: 15px; }
  .hf-ruler { display: none; }
  .hangar-arrow { top: 46%; }
  .hangar-arrow[data-step="-1"] { left: 10px; }
  .hangar-arrow[data-step="1"] { right: 10px; }
  .hangar-arrow::before, .ha-text, .hangar-arrow kbd { display: none; }
  .ha-plate { width: 42px; height: 84px; }
  .hangar-dock { bottom: 18px; gap: 8px; }
  #invdeploy .inv-launch { height: 52px; font-size: 15px; }
  .hangar-keys { display: none; }
}
@media (max-height: 580px) and (min-width: 761px) {
  .hangar-title { top: 24px; }
  .hangar-mech-arms, .hf-readout, .hangar-keys, .hangar-arrow::before { display: none; }
  .ha-plate { height: 84px; }
  .hangar-dock { bottom: 16px; gap: 7px; }
}
@media (hover: none) { #invdeploy kbd, .hangar-keys { display: none; } }

/* the MOBA battle strip is retired (its sky banner + marker canvas stay) */
#mobahud { display: none !important; }

/* ---------- build view (top-down yard) ---------- */
#invbuildlabels { position: fixed; inset: 0; z-index: 29; pointer-events: none; }
#invbuildlabels[hidden] { display: none !important; }
.ib-label {
  position: absolute; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: none;
  color: #fff; font: 400 11px/1.2 "Share Tech Mono", ui-monospace, monospace; letter-spacing: .08em;
  padding: 2px 6px; background: rgba(4,16,20,.7); border-left: 2px solid var(--inv-cyan);
}
.ib-label.weapon { border-left-color: var(--inv-orange); }
.ib-label.ib-production { width: 46px; height: 46px; transform: translate(-50%,-50%); padding: 0; border: 0; background: none; color: #74e4e8; }
.ib-production.weapon { color: #ffb76b; }
.ib-production[data-state="ready"] { color: #d4f4a0; }
.ib-production[data-state="idle"] { color: #9bb1b6; }
.ib-production svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 3px #001014); }
.ib-ring-track { fill: #06171ac9; stroke: #112a32; stroke-width: 5; }
.ib-ring-fill { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; transform: rotate(-90deg); transform-origin: 32px 32px; }
.ib-ring-value { position: absolute; inset: 0; display: grid; place-items: center; font: 700 10px/1 ui-monospace,monospace; }
.ib-ring-caption { position: absolute; top: 47px; left: 50%; transform: translateX(-50%); border-radius: 3px; padding: 3px 5px; background: #061419f2; color: #dbe9e9; font: 9px/1.3 ui-monospace,monospace; white-space: nowrap; }
.ib-label.utility { border-left-color: #90e090; }
#invbuildghost {
  position: fixed; z-index: 120; pointer-events: none; color: #061a1e; background: var(--inv-cyan);
  font: 400 11px/1.2 "Share Tech Mono", ui-monospace, monospace; letter-spacing: .1em; padding: 3px 8px;
  max-width: none; overflow: visible; isolation: isolate;
}
#invbuildghost[hidden] { display: none !important; }

/* A dedicated build workspace; combat instruments return on exit. */
body.invasion-building :is(#flight-heading, #flight-console, #ring, #predict, #coronal-status, #weaponbar, #weaponbar-labels, #lock, #mmwrap, #hint, #invhud, #invprompt, #mobamarks, #mobalaser-source, #mobaoff) { visibility: hidden !important; }
body.invasion-building #vitals { bottom: calc(var(--ib-dock-h, 180px) + 30px); opacity: .8; }
body.invasion-building #hud-detail-toggle { visibility: hidden !important; }
/* Workshop HUD: header (identity + orders) · production card · dock
   (command column + pocket row over shop row; hand card floats above).
   Full-screen click-through layer; only widgets take the pointer. */
#invbuild { position: fixed; inset: 0; z-index: 30; pointer-events: none; color: #d6e9e4; font: 13px/1.4 system-ui, sans-serif; letter-spacing: 0;
  --ib-panel: linear-gradient(180deg, #0b2129f2, #061318f5); --ib-edge: #2f5a62; --ib-cyan: #65e4e3; --ib-gold: #ffd36b;
  --ib-merge: #7dff6a; --ib-swap: #ffc24a; --ib-display: "Big Shoulders Stencil", "Arial Narrow", system-ui, sans-serif;
  --ib-cut: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
#invbuild[hidden] { display: none !important; }
#invbuild > :is(.ib-header, .ib-prod, .ib-dock) { pointer-events: auto; }
.ib-eyebrow, #invbuild .ib-h { font: 700 10px/1.3 system-ui, sans-serif; letter-spacing: .16em; color: #8fb2b6; text-transform: uppercase; }
#invbuild :is(.inv-btn, .inv-chip) { border-radius: 3px; letter-spacing: .06em; font: 700 12px/1.2 system-ui, sans-serif; transition: background .12s, transform .08s, box-shadow .12s; }
#invbuild :is(.inv-btn, .inv-chip):active:not(:disabled) { transform: translateY(1px); }
#invbuild :is(.inv-btn, .inv-chip):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#invbuild kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 8px; padding: 0 4px; box-sizing: border-box; border: 1px solid currentColor; border-radius: 3px; font: 700 10px/1 ui-monospace, monospace; opacity: .75; vertical-align: middle; }
@media (hover: none) { #invbuild kbd { display: none; } }
.ib-level { font: 800 10px/1.2 system-ui, sans-serif; font-style: normal; border: 1px solid currentColor; border-radius: 3px; padding: 1px 5px; white-space: nowrap; }

/* header */
#invbuild .ib-header { position: absolute; top: 20px; right: 20px; max-width: calc(100vw - 400px); box-sizing: border-box; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px 16px; padding: 10px 12px 10px 18px; background: var(--ib-panel); border: 1px solid var(--ib-edge); border-top: 2px solid var(--ib-cyan); border-radius: 4px; box-shadow: 0 8px 26px #0006; }
#invbuild .ib-ident { min-width: 0; display: grid; margin-right: auto; }
#invbuild .ib-name { margin: 0; font: 900 28px/1 var(--ib-display); letter-spacing: .06em; color: #eafffb; white-space: nowrap; text-transform: uppercase; }
#invbuild .ib-sub { font: 700 11px/1.5 system-ui, sans-serif; letter-spacing: .12em; color: #7ee6b0; white-space: nowrap; }
#invbuild .ib-metric { display: grid; justify-items: center; padding: 0 16px; border-left: 1px solid #2f5a62; border-right: 1px solid #2f5a62; }
#invbuild .ib-metric span { font: 700 9px/1.3 system-ui, sans-serif; color: #8fb2b6; letter-spacing: .16em; }
#invbuild .ib-metric strong { font: 900 30px/1 var(--ib-display); color: #bce6ff; white-space: nowrap; letter-spacing: .04em; }
#invbuild .ib-orders { gap: 8px; }
#invbuild .ib-header .inv-btn { min-height: 44px; padding: 0 18px; white-space: nowrap; font-size: 13px; clip-path: var(--ib-cut); }
#invbuild .ib-header .inv-btn.warn { background: #ff5a3214; }
#invbuild .ib-header .inv-btn.warn:hover:not(:disabled) { background: #ff5a3240; }
#invbuild .ib-close { color: #041a1c; background: var(--ib-cyan); border-color: var(--ib-cyan); }
#invbuild .ib-close:hover { background: #a8fffb !important; }

/* production card (right, under the header) */
#invbuild .ib-prod { position: absolute; right: 20px; top: calc(var(--ib-header-b, 90px) + 10px); width: 250px; box-sizing: border-box; max-height: calc(100vh - var(--ib-header-b, 90px) - var(--ib-dock-h, 180px) - 46px); overflow: hidden; display: grid; align-content: start; gap: 7px; padding: 10px; background: var(--ib-panel); border: 1px solid var(--ib-edge); border-radius: 4px; }
.ib-lines { display: grid; gap: 6px; }
.ib-line { padding: 7px 9px; background: #10252b; border-left: 4px solid var(--piece-color); border-radius: 3px; display: grid; gap: 2px; }
.ib-line b { display: flex; align-items: center; gap: 6px; font: 800 12px/1.3 system-ui, sans-serif; color: var(--piece-color); text-transform: uppercase; }
.ib-line span { font-size: 11px; color: #b7cbcd; }
.ib-line .ib-line-weapon { color: var(--weapon-color); font-style: normal; font-weight: 700; }
.ib-line small { font-size: 10px; color: #a4b9bd; }
.ib-line progress { width: 100%; height: 4px; margin-top: 3px; accent-color: var(--piece-color); }
.ib-empty { font: 12px/1.4 system-ui, sans-serif; color: #7f999d; margin: 0; }

/* toast */
#invbuild .ib-status { position: absolute; left: 50%; bottom: calc(var(--ib-dock-h, 180px) + 28px); transform: translateX(-50%); padding: 9px 20px; border-radius: 3px; background: #061419f2; border: 1px solid #c79a3d; border-left-width: 4px; color: #ffd98f; font: 800 13px/1.3 system-ui, sans-serif; letter-spacing: .1em; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 20px #0007; }
#invbuild .ib-status:empty { display: none; }

/* dock */
#invbuild .ib-dock { position: absolute; left: 20px; right: 20px; bottom: 14px; display: grid; grid-template-columns: 190px minmax(0, 1fr); grid-template-rows: 80px 80px; gap: 8px 10px; padding: 10px; background: var(--ib-panel); border: 1px solid var(--ib-edge); border-top: 2px solid var(--ib-cyan); border-radius: 4px; box-shadow: 0 -8px 30px #0006; }
#invbuild .ib-cmd { grid-column: 1; grid-row: 1 / 3; display: grid; grid-template-rows: auto 1fr; gap: 8px; min-width: 0; }
#invbuild .ib-wallet { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 8px; padding: 2px 4px 6px; border-bottom: 1px solid #2f5a62; }
#invbuild .ib-credits { font: 900 34px/1 var(--ib-display); color: var(--ib-gold); letter-spacing: .03em; text-shadow: 0 0 14px #ffd36b44; }
#invbuild .ib-wallet .ib-h { padding-bottom: 3px; white-space: nowrap; }
#invbuild .ib-pocket-count { font: 900 17px/1 var(--ib-display); color: #eafffb; letter-spacing: .04em; }
#invbuild .ib-shop-notice { grid-column: 1 / -1; font: 800 10px/1.4 system-ui, sans-serif; letter-spacing: .12em; color: #ff9c80; text-transform: uppercase; }
#invbuild .ib-shop-notice:empty { display: none; }
#invbuild .ib-autoall { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 12px; font: 900 24px/1 var(--ib-display); letter-spacing: .08em; color: #041a1c; background: linear-gradient(180deg, #8ff5f3, #45c9c7); border: 0; clip-path: var(--ib-cut); box-shadow: inset 0 -3px #0003; }
#invbuild .ib-autoall kbd { font-size: 11px; opacity: .7; }
#invbuild .ib-autoall:hover:not(:disabled) { background: linear-gradient(180deg, #c3fffd, #6ae2e0); }
#invbuild .ib-autoall:disabled { color: #6f8e92; background: #15303a; opacity: 1; }
#invbuild .ib-slots { grid-column: 2; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; min-width: 0; }
#invbuild .ib-dock[data-carry="piece"] .ib-pocket { border-radius: 4px; box-shadow: 0 0 0 2px #65e4e388; }
#invbuild .ib-dock[data-carry="piece"] .ib-slot-empty { border-color: #65e4e3cc; background: #65e4e314; }
#invbuild .ib-dock :is(.inv-chip, .ib-slot-empty) { position: relative; min-width: 0; height: 100%; box-sizing: border-box; margin: 0; }
#invbuild .ib-slot-empty { border: 2px dashed #22404a; border-radius: 4px; background: #0a1b1f80; }
#invbuild :is(.ib-piece-card, .ib-offer) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr auto; align-items: center; gap: 4px 6px; padding: 8px 10px 8px 12px; text-align: left; color: var(--piece-color);
  background: linear-gradient(135deg, color-mix(in srgb, var(--piece-color) 16%, #0f252c), #0c1d23 60%); border: 1px solid color-mix(in srgb, var(--piece-color) 35%, #1f3a42); border-left: 4px solid var(--piece-color); cursor: grab; user-select: none; touch-action: none; }
#invbuild :is(.ib-piece-card, .ib-offer):hover:not(:disabled, .is-disabled) { background: linear-gradient(135deg, color-mix(in srgb, var(--piece-color) 30%, #12303a), #12303a 70%); border-color: var(--piece-color); transform: translateY(-2px); box-shadow: 0 6px 16px #0007; }
#invbuild .ib-piece-card.sel { opacity: .45; border-style: dashed; }
#invbuild .ib-offer { background: linear-gradient(135deg, color-mix(in srgb, var(--piece-color) 12%, #1d2420), #14191a 65%); }
#invbuild .ib-offer.is-disabled { opacity: .4; cursor: not-allowed; filter: saturate(.4); }
#invbuild .ib-offer.ib-sold { display: grid; place-content: center; opacity: .3; background: #0a1b1f80; border: 2px dashed #2f4a52; cursor: default; }
#invbuild .ib-offer.ib-sold small { font: 900 14px/1 var(--ib-display); letter-spacing: .12em; color: #7f999d; }
.ib-card-name { grid-column: 1; grid-row: 1; align-self: start; display: flex; align-items: center; gap: 5px; min-width: 0; font: 800 13px/1.15 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.ib-card-name > span { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ib-card-meta { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 6px; min-width: 0; }
#invbuild .ib-dock .ib-shape { grid-column: 2; grid-row: 1; align-self: start; width: 26px; height: 26px; flex: none; fill: currentColor; opacity: .85; }
#invbuild .ib-dock .ib-family-symbol { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; }
#invbuild .ib-price { margin-left: auto; font: 900 20px/1 var(--ib-display); letter-spacing: .03em; color: var(--ib-gold); }
#invbuild .ib-merge-badge { position: absolute; top: -8px; right: 6px; display: none; padding: 2px 6px; border-radius: 3px; font: 900 9px/1.3 system-ui, sans-serif; font-style: normal; letter-spacing: .1em; color: var(--ib-merge); background: #061419; border: 1px solid var(--ib-merge); pointer-events: none; }
#invbuild :is(.has-partner, .can-merge) .ib-merge-badge { display: block; }
#invbuild .can-merge .ib-merge-badge { color: #062010; background: var(--ib-merge); }
#invbuild .can-merge { border-color: var(--ib-merge); animation: ib-merge-pulse .7s ease-in-out infinite alternate; }
@keyframes ib-merge-pulse { from { box-shadow: 0 0 0 1px var(--ib-merge), 0 0 6px #7dff6a55; } to { box-shadow: 0 0 0 2px var(--ib-merge), 0 0 20px #7dff6aaa; } }
#invbuild .ib-roll { display: grid; grid-template-columns: auto auto; place-content: center; align-items: center; gap: 0 8px; text-align: left; color: var(--ib-cyan); background: linear-gradient(180deg, #123840, #0c252b); border: 1px solid #3d7a80; }
#invbuild .ib-roll i { grid-row: 1 / 3; font: 900 30px/1 system-ui, sans-serif; font-style: normal; }
#invbuild .ib-roll b { font: 900 18px/1 var(--ib-display); letter-spacing: .1em; }
#invbuild .ib-roll small { font: 900 16px/1 var(--ib-display); color: var(--ib-gold); }
#invbuild .ib-roll:hover:not(:disabled) { background: linear-gradient(180deg, #1b5059, #123840); border-color: var(--ib-cyan); }
#invbuild .ib-roll:disabled { opacity: .4; cursor: default; }
#invbuild .ib-sell { grid-column: span 2; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #8a5f55; background: #1a0f0d60; border: 2px dashed #4f2e27; cursor: default; }
#invbuild .ib-sell b { font: 900 22px/1 var(--ib-display); letter-spacing: .14em; }
#invbuild .ib-sell small { font: 900 20px/1 var(--ib-display); color: var(--ib-gold); }
#invbuild .ib-sell.is-armed { color: #ffc2b0; background: #3a17109e; border: 2px solid #ff7a5c; cursor: pointer; }
#invbuild .ib-sell.is-armed:hover { background: #5a2012c0; }

/* hand card: the held / hovered piece, floating above the dock */
#invbuild .ib-hand { position: absolute; right: 0; bottom: calc(100% + 10px); width: 340px; display: grid; grid-template-rows: auto auto auto; gap: 6px; box-sizing: border-box; padding: 10px 12px; border-radius: 4px; background: var(--ib-panel); border: 1px solid #2f5a62; border-left: 4px solid var(--piece-color, #38555a); box-shadow: 0 8px 26px #0007; overflow: hidden; }
#invbuild .ib-hand[data-mode="idle"] { display: none; }
#invbuild .ib-hand[data-mode="hand"] { border-color: #4f8088; border-left-color: var(--piece-color); }
.ib-hand-head { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--piece-color, #d6e9e4); }
.ib-hand-head > div { min-width: 0; display: grid; flex: 1; }
.ib-hand-head b { display: flex; align-items: center; gap: 5px; font: 800 15px/1.2 system-ui, sans-serif; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-hand-head small { font: 800 10px/1.4 system-ui, sans-serif; color: #9fb5b9; letter-spacing: .14em; white-space: nowrap; }
#invbuild .ib-hand-head .ib-shape { width: 30px; height: 30px; flex: none; fill: currentColor; }
#invbuild .ib-hand-head .ib-family-symbol { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; }
.ib-hand-info { margin: 0; font: 11px/1.4 system-ui, sans-serif; color: #9fb5b9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib-hand-info:empty { display: none; }
#invbuild .ib-hand-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
#invbuild .ib-hand-actions:empty { display: none; }
#invbuild .ib-hand-actions .inv-btn { min-height: 40px; padding: 0 8px; font-size: 12px; white-space: nowrap; }

/* drag ghost states beyond fit / no-fit */
#invbuildghost[data-fit="swap"] { color: #ffc24a; }
#invbuildghost[data-fit="merge"] { color: #7dff6a; }
#invbuildghost[data-fit="sell"] { color: #ff9c80; }
#invbuildghost rect.ib-displace-cell { fill: #ffc24a; fill-opacity: .55; stroke: #ffc24a; stroke-opacity: 1; }
#invbuildghost .ib-ghost-keys { opacity: .6; font-size: 10px; }

@media (max-width: 1200px) {
  #invbuild .ib-dock { grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: 70px 70px; }
  #invbuild .ib-credits { font-size: 28px; }
  #invbuild .ib-autoall { font-size: 20px; }
  #invbuild .ib-dock .ib-shape { display: none; }
  #invbuild .ib-prod { max-height: calc(100vh - var(--ib-header-b, 90px) - var(--ib-dock-h, 180px) - 170px); }
  #invbuild .ib-header { max-width: calc(100vw - 340px); }
}
@media (max-width: 760px) {
  #invbuild .ib-dock { left: 8px; right: 8px; bottom: 8px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  #invbuild .ib-cmd { grid-row: auto; grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  #invbuild .ib-wallet { border: 0; }
  #invbuild .ib-autoall { min-height: 48px; }
  #invbuild .ib-slots { grid-column: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 56px; }
  #invbuild .ib-sell { grid-column: span 4; }
  #invbuild .ib-hand { width: 100%; }
  #invbuild .ib-header { left: 8px; right: 8px; top: 8px; max-width: none; }
  #invbuild .ib-name { font-size: 22px; }
  #invbuild .ib-prod { display: none; }
}
.ib-board-heading { position: absolute; left: 24px; top: 24px; display: flex; align-items: center; gap: 16px; padding: 9px 12px; background: #061419dc; border: 1px solid #315057; border-radius: 5px; max-width: calc(100vw - 420px); color: #d6e9e4; box-shadow: 0 6px 22px #0003; }
.ib-legend, .ib-team-key { display: flex; gap: 9px; margin: 0; padding-left: 13px; border-left: 1px solid #38555a; font: 9px/1.5 ui-monospace, monospace; }
.ib-legend span { font-weight: 700; text-shadow: 0 1px 4px #000; }
.ib-team-key span { display: inline-flex; align-items: center; gap: 4px; }
.ib-team-key i { width: 10px; height: 3px; background: currentColor; box-shadow: 0 0 5px currentColor; }
.ib-cellmark { position: absolute; transform: translate(-50%,-100%); color: #dcfffa; background: #082228e8; border: 1px solid #79d9d5a0; border-radius: 3px; padding: 3px 5px; font: 10px/1 ui-monospace, monospace; box-shadow: 0 2px 8px #00101480; }
.ib-cellmark.is-locked { color: #a9b6b8; border-color: #64757a80; }
.ib-label { font: 11px/1.4 ui-monospace, monospace; letter-spacing: 0; border-radius: 3px; padding: 5px 8px; background: #061419ed; }
#invbuildghost { border-radius: 6px; background: #082228dc; border: 1px solid currentColor; color: #b9f9ef; padding: 10px; min-width: 130px; pointer-events: none; box-shadow: 0 8px 28px #0007; }
#invbuildghost svg { display: block; margin: 0 auto 8px; overflow: visible; }
#invbuildghost rect { fill: currentColor; fill-opacity: .32; stroke: currentColor; stroke-width: 1.5; }
#invbuildghost rect.ib-invalid-cell { fill: #ff5a32; fill-opacity: .62; stroke: #ff5a32; stroke-opacity: 1; }
#invbuildghost rect.ib-invalid-rest { fill: #ffa38f; fill-opacity: .14; stroke: #ffa38f; stroke-opacity: .5; }
#invbuildghost rect.ib-grab-cell { fill-opacity: .62; stroke: #fff; stroke-width: 3; }
#invbuildghost b, #invbuildghost small { display: block; font: 11px/1.6 'Consolas', monospace; letter-spacing: .04em; }
#invbuildghost b { font-weight: 700; }
#invbuildghost[data-fit="no"] { color: #ff8c79; }
#invbuildghost[data-fit="yes"] { color: #a7ffda; }
@media (max-width: 1000px) {
  .ib-board-heading { left: 12px; top: 12px; max-width: calc(100vw - 340px); padding: 8px 10px; }
  .ib-board-heading { flex-wrap: wrap; gap: 6px 10px; }
  .ib-legend, .ib-team-key { gap: 6px; padding-left: 9px; }
}

#invhud .inv-ship { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; margin: 8px 0; font-size: 10px; }
#invhud .ship-values { text-align: right; }
#invhud .inv-ship progress { width: 100%; height: 5px; grid-column: 1 / -1; border: 0; appearance: none; }
#invhud .inv-ship progress::-webkit-progress-bar { background: #18292d; }
#invhud .ship-hull::-webkit-progress-value { background: #d8b27b; }
#invhud .ship-shield::-webkit-progress-value { background: #65e4e3; }

/* Tier colour is supplied by piecevisuals.js; family stays in the line icon. */
#invbuildghost, #invbuildghost[data-fit="yes"] { color: var(--piece-color, #b9f9ef); }
#invbuildghost[data-fit="no"] { color: #ff8c79; }
.ib-family-symbol { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
#invhud .inv-pocket span { color: var(--piece-color); border-color: var(--piece-color); display: inline-flex; align-items: center; gap: 4px; }
#invhud .inv-pocket .ib-family-symbol { width: 13px; height: 13px; flex-basis: 13px; }
.ib-label.ib-production { color: var(--piece-color); }
.ib-production .ib-progress-ring { width: 100%; height: 100%; }
.ib-production > .ib-family-symbol { position: absolute; left: 14px; top: 7px; width: 18px; height: 18px; filter: none; }
.ib-production .ib-ring-value { inset: 22px 0 0; font-size: 8px; }
.ib-production[data-state="ready"] .ib-ring-value { color: #e4ffd4; }
.ib-production[data-state="idle"] .ib-ring-fill { opacity: .45; }
.ib-ring-caption { border-bottom: 2px solid var(--piece-color); }
.ib-label.ib-utility-label { display: flex; align-items: center; gap: 5px; border-color: var(--piece-color); color: var(--piece-color); }
#invbuildlabels .ib-production { width: 0; height: 0; }
#invbuildlabels .ib-production > :is(.ib-progress-ring, .ib-family-symbol, .ib-ring-value) { display: none; }
#invbuildlabels .ib-ring-caption { display: none; }
#invbuildlabels .ib-production.is-focused { z-index: 3; }
#invbuildlabels .ib-production.is-focused .ib-ring-caption { display: block; }
#invbuildlabels .ib-utility-label { width: 0; height: 0; box-sizing: border-box; justify-content: center; transform: translate(-50%,-50%); padding: 0; border: 0; background: none; }
#invbuildlabels .ib-utility-label .ib-family-symbol { display: none; width: 18px; height: 18px; flex-basis: 18px; }
#invbuildlabels .ib-utility-label .ib-utility-text { display: none; }
#invbuildlabels .ib-utility-label.is-focused { z-index: 3; width: auto; height: auto; justify-content: flex-start; transform: translate(-50%,-100%); padding: 5px 8px; background: #061419f5; box-shadow: 0 5px 14px #0008; }
#invbuildlabels .ib-utility-label.is-focused .ib-family-symbol { display: block; }
#invbuildlabels .ib-utility-label.is-focused .ib-utility-text { display: block; }
#invbuildlabels .ib-piece-hp { position: absolute; width: 72px; left: -36px; top: 12px; margin: 0; }
#invworldlabels { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
#invworldlabels[hidden] { display: none !important; }
#invworldlabels .ib-production { width: 44px; height: 44px; }
#invworldlabels .ib-production > .ib-family-symbol { width: 16px; height: 16px; top: 8px; left: 14px; }
#invworldlabels .ib-ring-value { font-size: 8px; inset: 21px 0 0; }
#invworldlabels .ib-ring-caption { top: 43px; font-size: 8px; padding: 2px 4px; }
#invworldlabels .ib-utility-label { font-size: 9px; padding: 3px 5px; }
#invworldlabels .ib-utility-label .ib-family-symbol { width: 15px; height: 15px; flex-basis: 15px; }
@media(max-width:1000px){
  #invworldlabels .ib-production{width:38px;height:38px}
  #invworldlabels .ib-production>.ib-family-symbol{left:12px;top:6px;width:14px;height:14px}
  #invworldlabels .ib-production .ib-ring-value{inset:18px 0 0;font-size:7px}
  #invworldlabels .ib-production .ib-ring-caption{top:39px}
}
.ib-dome-status { position: absolute; transform: translate(-50%,-100%); min-width: 104px; display: grid; grid-template-columns: auto 48px; align-items: center; gap: 7px; padding: 5px 7px; border: 1px solid currentColor; border-radius: 3px; background: #061419e8; color: #65e4e3; font: 9px/1.3 ui-monospace, monospace; white-space: nowrap; }
.ib-dome-status[data-team="red"] { color: #ff8c69; }
.ib-dome-status[data-broken="true"] { color: #a8b4b8; }
.ib-dome-status progress { width: 48px; height: 3px; accent-color: currentColor; }
#invbuildlabels .ib-dome-status { opacity: .86; }
#invworldlabels .ib-dome-status { font-size: 9px; min-width: 104px; }

/* Resource and deployment decisions stay readable in either cockpit density. */
#invhud { width: 320px; }
#invhud .inv-economy { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; }
#invhud .inv-metric { position: relative; display: grid; align-content: start; gap: 6px; min-width: 0; padding: 11px 10px 10px; border: 1px solid #63878188; border-radius: 4px; background: #06171af5; box-shadow: 0 3px 15px #0003; }
#invhud .inv-metric > span { color: #b9d2cf; font-size: 10px; letter-spacing: .08em; }
#invhud .inv-metric b { color: #edf7e9; font: 500 26px/1.1 "Share Tech Mono", ui-monospace, monospace; letter-spacing: -.03em; white-space: nowrap; }
#invhud .inv-credit-metric { border-top: 3px solid #edcf7a; }
#invhud .inv-credit-metric b { color: #ffe39b; }
#invhud .inv-deploy-metric { border-top: 3px solid #7fc5f4; }
#invhud .inv-deploy-metric b { color: #bce6ff; }
#invhud .inv-metric small { color: #a9c9be; font-size: 9px; line-height: 1.35; min-height: 12px; white-space: nowrap; }
#invhud .inv-cap-meter { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 3px; border: 0; appearance: none; accent-color: #7fc5f4; }
#invhud .inv-cap-meter::-webkit-progress-bar { background: #233737; }
#invhud .inv-cap-meter::-webkit-progress-value { background: #7fc5f4; }
#invhud .inv-deploy-metric.at-cap { border-color: #edbf7a; }
#invhud .inv-deploy-metric.at-cap :is(b, small) { color: #ffe09d; }
#invhud .inv-deploy-metric.at-cap .inv-cap-meter::-webkit-progress-value { background: #edbf7a; }
@media (max-width: 760px) {
  #invhud { width: 276px; right: 10px; padding: 9px; }
  #invhud .inv-metric { padding: 9px 7px; }
  #invhud .inv-metric b { font-size: 23px; }
  #invhud .inv-metric > span { font-size: 9px; }
  #invhud .inv-metric small { font-size: 8px; }
}
/* Outpost services and support controls remain available in the field. */
#inv-support{position:fixed;left:18px;top:125px;z-index:31;max-width:300px;display:grid;gap:7px;color:#d1f8ff;font:12px Consolas,monospace;pointer-events:auto;text-shadow:0 1px 3px #071720}
#inv-support button,#inv-support summary{background:rgba(8,24,32,.86);color:#bfeef5;border:1px solid #527781;padding:7px 9px;cursor:pointer}
#inv-support button:disabled{opacity:.45;cursor:default}
#inv-support .inv-site-nav{display:flex;flex-wrap:wrap;gap:3px}
#inv-support [data-team=red]{border-color:#be5e4c;color:#ffbdb2}
#inv-support [data-team=blue]{border-color:#5ccee4}
#inv-support .inv-skill-list{display:grid;gap:4px;max-height:40vh;overflow:auto;background:#10252eee;padding:6px}
#inv-support .inv-skill-aim{background:#122c35ee;padding:10px;border:1px solid #7bdeeb;display:flex;gap:6px;flex-wrap:wrap}
#inv-support [hidden],.inv-bay[hidden],.ib-piece-hp[hidden]{display:none!important}
body.in-hangar #inv-support,body.hangar-departure #inv-support{display:none}
.ib-piece-hp{display:block;width:100%;height:5px;accent-color:#70dbe8;margin-top:4px}
.inv-bay{gap:8px;font-size:10px;align-items:center}
.inv-bay-ring{display:inline-block;width:25px;height:25px;flex:none;border-radius:50%;background:conic-gradient(#64d8e8 var(--progress,0deg),#283d49 0);mask:radial-gradient(circle,transparent 48%,#000 53%)}
body.invasion-building #inv-support{left:24px;top:70px;max-width:300px;gap:0}
body.invasion-building #inv-support>.inv-map{display:none}
body.invasion-building #inv-support .inv-site-nav{gap:4px}
body.invasion-building #inv-support .inv-site-nav button{min-width:28px;padding:5px 7px;font-size:9px}
@media(max-width:900px){#inv-support{top:90px;left:8px;max-width:190px;font-size:10px}body.invasion-building #inv-support{left:12px;top:60px;max-width:260px}}

/* A second, growing row beside the weapon rack; no empty skill slots. */
#inv-support .inv-skill-rack{position:fixed;right:24px;bottom:24px;width:min(460px,calc(100vw - 36px));max-height:28vh;overflow:auto;}
#inv-support .inv-skill-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:5px;padding:0;background:none;max-height:none;}
#inv-support .inv-skill-list button{min-height:40px;font-size:10px;text-align:left;border-color:#796951;background:linear-gradient(90deg,#23464eee var(--ready),#101b23f5 0);}
#inv-support .inv-skill-list button.selected{border-color:#a7f6ff;box-shadow:inset 0 -3px #7ee5f2;}
#inv-support .inv-skill-rack:has(.inv-skill-list:empty){display:none;}
body.invasion-building #inv-support .inv-skill-rack{position:static;width:250px;margin-top:8px;max-height:calc(100vh - 200px - var(--ib-dock-h,150px) - 110px);overflow:hidden;}
body.invasion-building #inv-support .inv-skill-list{grid-template-columns:1fr;}
body.invasion-combat #weaponbar,body.invasion-combat #weaponbar-labels{bottom:calc(45px + var(--support-rack-height,0px));}
body.invasion-combat #weaponbar,body.invasion-combat #weaponbar-labels{width:min(460px,calc(100vw - 36px));right:24px;}
body.invasion-combat #weaponbar-labels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
body.invasion-combat #weaponbar-labels .wb-num{font-size:10px;letter-spacing:0;}
#inv-primary-weapon{position:fixed;left:24px;bottom:116px;z-index:8;max-width:300px;padding:9px 12px;border-left:2px solid #8ce5e7;background:#11262ddd;color:#c1f5f5;font:12px/1.7 Consolas,monospace;white-space:pre-line;pointer-events:none;}
body:is(.in-hangar,.hangar-departure,.invasion-building,.paused) #inv-primary-weapon{visibility:hidden;}
@media(max-width:700px){#inv-primary-weapon{left:12px;bottom:155px;font-size:10px;max-width:240px;}}
#inv-damage-numbers{position:fixed;inset:0;z-index:15;pointer-events:none;overflow:hidden;}
.inv-damage{position:absolute;left:0;top:0;color:#ffe8b5;font:bold 22px Consolas,monospace;text-shadow:0 2px 3px #000,0 0 9px #fa632d;will-change:transform;}
.inv-damage[data-team=blue]{color:#9edfff;text-shadow:0 2px 3px #000,0 0 9px #168bdc;}
body.in-hangar #inv-damage-numbers{display:none;}
.ib-utility-label{max-width:155px}
.ib-utility-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:135px;display:block}

/* Pause menu owns the screen. The invasion command layer is refreshed from the
   LIVE branch of the frame loop, and the paused branch returns before any of
   those per-frame hide checks run — so without this every one of these panels
   stays frozen on top of the cinematic pause frame (the other HUDs each carry
   their own body.paused rule; this is the invasion one). */
body.paused :is(#invhud, #invprompt, #inv-support, #invworldlabels, #invbuildlabels,
                #invbuildghost, #invbuild, #inv-damage-numbers) { visibility: hidden !important; }


/* ---------- touch devices ---------- */
/* The on-screen controls (#touch-ui) sit at z 50 over the whole screen; panels
   that must stay tappable during live play ride above them. */
body.touch #invprompt.tappable {
  pointer-events: auto; z-index: 55; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  padding: 11px 20px; font-size: 14px; border-color: var(--inv-cyan); box-shadow: 0 0 16px rgba(101,228,227,.35);
}
body.touch #invprompt.tappable:active { background: rgba(101,228,227,.28); }
body.touch #inv-support { z-index: 55; }
body.touch #inv-support .inv-btn { min-height: 34px; }
/* build view: drags must not pan/zoom the page */
body.touch #invbuild :is(.ib-dock, .ib-piece-card, .ib-offer) { touch-action: none; }
