/* Starforge slice — one client, two shapes.
   PC: the sector fills the screen, the ship is a narrow rail, the skill tree is a drawer.
   Phone: three full-screen panes snap horizontally, with one thumb-sized control per job. */

:root {
  --bg: #04070c;
  --bg-2: #060c14;
  --panel: #08111b;
  --panel-2: #0a1621;
  --ink: #d9f6ff;
  /* D293: the readable floor. A label has to clear 4.5:1 against the panels' own plate; the old
     faint (#415866) sat near 2.7:1, which is a smudge at 8 px, not a word. */
  --muted: #93aebc;
  --faint: #6f8492;
  --cyan: #6fe7ff;
  --cyan-dim: rgba(111, 231, 255, 0.22);
  --amber: #ffb454;
  --amber-dim: rgba(255, 180, 84, 0.22);
  --red: #ff6060;
  --green: #74f0b0;
  --line: rgba(111, 231, 255, 0.16);
  --hud: 48px;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
  overscroll-behavior: none;
  /* This is a cockpit, not a document. A drag that starts on the sector or a panel must fly, steer
     or press, never turn into a browser text selection across the HUD. Inputs opt back in below. */
  user-select: none;
  -webkit-user-select: none;
}

body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }

input, textarea, select, [contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

button:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }
h1, h2, p { margin: 0; }
kbd {
  font: 12px/1 var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 3px;
}

/* ---------- header ---------- */

#hud {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--hud);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  /* At a large UI scale a narrow window cannot hold every button; scroll the row instead of cutting
     the last one off the right edge (same as the phone HUD). */
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
  scrollbar-width: none;
  background: rgba(4, 7, 12, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  font-size: 15px;
  letter-spacing: 0.28em;
  color: var(--cyan);
  white-space: nowrap;
}
.brand span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--faint);
  margin-top: 2px;
}

/* The tavern injects its own back link at the body root. Keep it tucked under the brand
   instead of floating as a pill at the bottom edge; it is navigation, not a HUD control. */
body #pft-back {
  position: fixed;
  left: 10px;
  top: 37px;
  right: auto;
  bottom: auto;
  z-index: 2147483647;
  display: inline-block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-decoration: none;
  opacity: 0.72;
}
body #pft-back:hover,
body #pft-back:focus-visible {
  color: var(--ink);
  background: none;
  border-color: transparent;
  outline: none;
  text-decoration: underline;
  opacity: 1;
}
/* D235: #pft-back is our own link now (index.html); on a phone it moves to MENU and the login screen (phone/layout.css). */

.pilot {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.pilot b { font-size: 13px; letter-spacing: 0.12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pilot span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pilot .signin {
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 192, 106, 0.45);
  white-space: nowrap;
}
.pilot .signin:hover { color: var(--cyan); border-color: var(--cyan); }

.hull {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-left: auto;
  min-width: 0;
}
.hull-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
/* The frame is fixed to the ship's real hull max. A scar never shortens the whole bar; it grows
   in from the right as a darker, fractured band over the part of the frame that cannot be repaired. */
.hullbar {
  position: relative;
  width: 120px;
  height: 9px;
  flex: none;
  background: linear-gradient(180deg, #0b141d, #05090d);
  border: 1px solid rgba(111, 231, 255, 0.22);
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}
.hullbar > i { position: absolute; top: 0; bottom: 0; display: block; }
#hullFill {
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, #f07065 0, #c94a49 45%, #8d2931 100%);
  transition: width 0.25s linear, background 0.25s;
}
.hullbar.is-low #hullFill {
  background: linear-gradient(180deg, #ff8b7a 0, #e24b48 45%, #8f1924 100%);
  box-shadow: 0 0 8px rgba(255, 80, 80, 0.55);
}
#hullScar {
  right: 0;
  z-index: 1;
  width: 0;
  background:
    linear-gradient(112deg, transparent 0 42%, rgba(255, 235, 220, 0.6) 43% 44%, transparent 45% 100%),
    linear-gradient(74deg, transparent 58%, rgba(255, 190, 175, 0.42) 59% 60%, transparent 61% 100%),
    linear-gradient(148deg, transparent 28%, rgba(255, 210, 190, 0.28) 29% 30%, transparent 31% 100%),
    repeating-linear-gradient(102deg, #8f222b 0 5px, #5d121b 5px 7px);
  box-shadow: inset 2px 0 0 rgba(255, 196, 180, 0.48);
  transition: width 0.25s linear;
}
#hullScar[hidden] { display: none; }
.hull-slices {
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(20% - 2px), rgba(4, 7, 12, 0.88) calc(20% - 2px), rgba(4, 7, 12, 0.88) 20%);
}
#hullText { font-size: 12px; color: var(--muted); min-width: 56px; text-align: right; white-space: nowrap; }
.hull.is-low #hullText { color: var(--red); }
/* D270: the redline is its own instrument directly under the hull bar, not a footnote on the speed.
   The fill is heat; the label is the lit band and its clock, or the heat percentage. */
.drive-gauge {
  position: relative;
  width: 120px;
  /* D293: the gauge carries its own 11 px label, so the box has to hold a line of type. */
  height: 16px;
  flex: none;
  overflow: hidden;
  background: linear-gradient(180deg, #0b141d, #05090d);
  border: 1px solid rgba(255, 180, 84, 0.3);
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(0, 0, 0, 0.42);
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s;
}
#driveFill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(180deg, #ffd08a 0, #ff9d3d 45%, #b4521a 100%);
  box-shadow: 0 0 6px rgba(255, 180, 84, 0.4);
  transition: width 0.15s linear, background 0.2s;
}
#driveText {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #ffe0b6;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
  white-space: nowrap;
  pointer-events: none;
}
.drive-gauge.is-lit {
  border-color: rgba(255, 180, 84, 0.8);
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.82), 0 0 9px rgba(255, 143, 60, 0.45);
}
.drive-gauge.is-hot #driveFill {
  background: linear-gradient(180deg, #ff9a7a 0, #ff4d45 50%, #8f1924 100%);
  box-shadow: 0 0 8px rgba(255, 80, 70, 0.5);
}
.drive-gauge.is-idle { opacity: 0.7; }
.hull-status { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.hull-status[hidden] { display: none; }
.hull-sym {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* D293: 18 px so the damage count in the corner stays legible beside its own glyph. */
  width: 18px;
  height: 18px;
  color: var(--amber);
  border: 1px solid currentColor;
  background: rgba(4, 8, 13, 0.86);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.hull-sym svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.hull-sym.fire { color: var(--red); }
.hull-sym.board { color: var(--red); }
.hull-sym.breach { color: var(--amber); }
.hull-sym.ion { color: var(--cyan); }
.hull-sym.oxygen { color: #8fb8ff; }
.hull-sym.tracked { color: var(--amber); }
.hull-sym.scar { color: #d08a88; }
.hull-sym.board svg, .hull-sym.breach svg, .hull-sym.oxygen svg, .hull-sym.tracked svg, .hull-sym.scar svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: square;
}
.hull-sym.tracked { animation: hull-track 1.6s ease-in-out infinite; }
@keyframes hull-track {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 0 0 transparent; }
  50% { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 7px rgba(255, 180, 84, 0.5); }
}
@media (prefers-reduced-motion: reduce) {
  .hull-sym.tracked { animation: none; }
}
.hull-sym b {
  position: absolute;
  right: 1px;
  bottom: 0;
  font: 600 10px/1 var(--mono);
  color: inherit;
}
.scrap-hud {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 192, 106, 0.28);
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.scrap-hud b { font-size: 12px; font-weight: 500; letter-spacing: 0.04em; }
.scrap-label { color: var(--faint); }

.hud-btn {
  min-height: 24px;
  font-size: 11px;
  letter-spacing: 0.1em;
  line-height: 1;
  border: 1px solid var(--line);
  padding: 4px 6px;
  color: var(--muted);
}
.hud-btn kbd { font-size: 11px; padding: 1px 2px; }
.hud-btn:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.hud-btn.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.42); background: rgba(255, 180, 84, 0.08); }
.hud-tools { display: flex; align-items: center; gap: 4px; min-width: 0; }
.hud-tools-group { position: relative; flex: 0 0 auto; }
.hud-tools-group > summary {
  display: flex; align-items: center; gap: 7px; min-height: 28px; padding: 4px 7px;
  list-style: none; cursor: pointer; border: 1px solid var(--line); color: var(--muted);
  background: rgba(6, 12, 18, 0.72); font-size: 11px; letter-spacing: 0.12em;
}
.hud-tools-group > summary::-webkit-details-marker { display: none; }
.hud-tools-group > summary::after { content: '+'; color: var(--faint); font-size: 12px; }
.hud-tools-group[open] > summary { color: var(--cyan); border-color: var(--cyan-dim); }
.hud-tools-group[open] > summary::after { content: '−'; color: var(--cyan); }
/* D294: the popup is measured against the window, not the bar. #hud clips its own 48 px row, and while
   a backdrop filter is live it is also the containing block for a fixed child, so a panel laid out
   inside the bar was cut to a sliver under the view (the map painted over it). hudnav.js lifts the
   open panel to the body; fixed positioning is what keeps it outside both the clip and the bar. */
.hud-tools-items {
  position: fixed; top: calc(var(--hud) + 6px); left: auto; right: 8px; z-index: 92;
  display: grid; grid-template-columns: repeat(2, minmax(112px, 1fr)); gap: 5px;
  width: min(270px, calc(100vw - 24px)); padding: 8px;
  border: 1px solid var(--line); background: rgba(4, 9, 15, 0.98);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}
.hud-tools-pop { right: auto; }
.hud-tools-items .hud-btn { display: flex; align-items: center; justify-content: flex-start; min-height: 36px; text-align: left; white-space: nowrap; }
.hud-tools-items .hud-btn[hidden] { display: none !important; }
/* Bedop's own control wears the cool violet-cyan the director beats already use for his voice, so the
   channel is findable in the strip (and in the phone MENU, which moves this same button) without
   competing with the amber action buttons. Text and edge only; no new size or glow. */
#companionBtn {
  color: #bdb2f2;
  border-color: rgba(176, 160, 255, 0.32);
}
#companionBtn:hover { color: #d8d0ff; border-color: rgba(190, 175, 255, 0.6); }
#companionBtn kbd { color: inherit; border-color: rgba(176, 160, 255, 0.32); }

.net { font-size: 12px; color: var(--faint); transition: color 0.3s; }
.net.ok { color: var(--green); }
.net.bad { color: var(--red); }

.fleet-chip {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--green);
  border: 1px solid rgba(116, 240, 176, 0.28);
  padding: 5px 7px;
  white-space: nowrap;
  cursor: pointer;
}
.fleet-chip.together { background: rgba(116, 240, 176, 0.1); box-shadow: 0 0 12px rgba(116, 240, 176, 0.16); }

.focus-bar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 180, 84, 0.3);
  background: rgba(5, 11, 18, 0.86);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.focus-bar b { color: var(--amber); letter-spacing: 0.18em; }
.focus-bar[hidden] { display: none; }

/* ---------- layout ---------- */

#layout {
  position: fixed;
  top: var(--hud);
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
}

.pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }

#space { width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- sector overlay ---------- */

.space-top {
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.readout {
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-shadow: 0 0 18px rgba(111, 231, 255, 0.28);
}
.readout em { font-style: normal; font-size: 12px; color: var(--muted); letter-spacing: 0.16em; }

.throttle { display: flex; gap: 4px; pointer-events: auto; }
.throttle button {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--faint);
  min-height: 28px;
  border: 1px solid var(--line);
  padding: 5px 7px;
  background: rgba(4, 7, 12, 0.7);
}
.throttle button.on { color: var(--amber); border-color: var(--amber-dim); }
/* D258: FULL is a burst, and the gauge has to be cold to spend it. */
.throttle button.locked { opacity: 0.45; }
.readout em.drive { color: var(--amber-dim); }

/* D153 → D227: the ability hotbar's styles live in abilities/abilities.css. */
.broker-ctl b { color: var(--green); }

/* D103: per-section type scale. Each section is scaled as a whole with `zoom`, so the hundreds of
   hand-set pixel sizes do not need to become variables; the value is a CSS custom property, so a
   change repaints on the next frame. */
:root {
  --ui-scale: 1;
}
/* D110: one page zoom, the way the browser does it. Scaling the HUD, the rail and each sheet on its
   own broke their layout boxes (clipped text) and multiplied every 1 px bevel into an uneven hairline.
   Scaling the root keeps every panel in proportion and leaves the text crisp. */
html { zoom: var(--ui-scale); }
/* D110: zoom enlarges the drawing but leaves the layout viewport at full size, so a 150% cockpit
   would hang off the screen. The shell is sized to the inverse of the scale and lays out at that
   smaller size — exactly what browser zoom does — then the zoom magnifies it back to fill the window.
   --vh/--vw are 1% of that shell, so anything sized in viewport units still fits. */
#app {
  position: fixed;
  top: 0;
  left: 0;
  /* sizeShell() overwrites these in px once the UI scale is known */
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  transform: translateZ(0);
  --vh: calc(100vh / 100);
  --vw: calc(100vw / 100);
}
/* D114: the mix is a panel you keep open, not a modal. The game stays visible and clickable behind it. */
#audioOverlay { background: transparent; pointer-events: none; }
#audioOverlay .audio-card { pointer-events: auto; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65); }
#audioOverlay .sheet-head { cursor: grab; touch-action: none; }
#audioOverlay .sheet-head.dragging { cursor: grabbing; }

.font-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.font-row {
  display: grid;
  grid-template-columns: 1fr 26px 46px 26px;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.font-row b { font-size: 12px; font-weight: 500; color: var(--amber); text-align: center; }
.font-row button {
  min-height: 26px;
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.7);
  color: var(--faint);
  font-size: 14px;
  line-height: 1;
}
.font-row button:hover { color: var(--amber); border-color: var(--amber-dim); }
.font-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.font-reset {
  border: 1px solid var(--amber-dim);
  background: rgba(4, 7, 12, 0.7);
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 5px 8px;
}
.font-hint { font-size: 11px; color: var(--faint); letter-spacing: 0.06em; }

/* D125: the PIN-gated room clock. The three rows are measurements, not presets: each shows the rate's
   step in ms and the last measured cost per tick. */
.tune-lock { display: flex; gap: 8px; margin-top: 8px; }
.tune-lock[hidden], .tune-panel[hidden] { display: none; }
.tune-lock input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.7);
  color: var(--amber);
  font-size: 13px;
  letter-spacing: 0.2em;
  padding: 6px 8px;
}
.tune-lock button {
  border: 1px solid var(--amber-dim);
  background: rgba(4, 7, 12, 0.7);
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 5px 10px;
}
.tune-panel { margin-top: 8px; }
.tune-copy { margin: 6px 0 10px; }
.tune-rows { display: flex; flex-direction: column; gap: 4px; }
.tune-row {
  display: grid;
  grid-template-columns: 50px 54px 1fr 52px;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border: 1px solid transparent;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.tune-row.on { border-color: var(--amber-dim); background: rgba(255, 180, 84, 0.05); padding: 3px 5px; }
.tune-row b { color: var(--amber); font-size: 12px; font-weight: 500; }
.tune-row em { font-style: normal; color: var(--faint); text-align: right; }
.tune-row button {
  min-height: 24px;
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.7);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.tune-row button.on { color: var(--green); border-color: rgba(116, 240, 176, 0.35); }
.tune-row button:hover { color: var(--amber); border-color: var(--amber-dim); }

/* D101: the escape warp. The button is the whole gauge: a spin-up ring, then the recharge clock. */
.warp-ctl {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 5px;
  pointer-events: auto;
  padding: 5px 7px;
  min-height: 28px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--faint);
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.7);
  overflow: hidden;
}
.warp-ctl b { color: var(--amber); font-weight: 400; }
.warp-ctl::before {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(from -90deg, rgba(255, 180, 84, 0.35) calc(var(--p, 0) * 360deg), transparent 0);
  opacity: 0;
  transition: opacity 120ms linear;
  pointer-events: none;
}
.warp-ctl.charging::before { opacity: 1; }
.warp-ctl.charging { border-color: var(--amber); }
.warp-ctl.hot { opacity: 0.62; }
.warp-ctl.hot b { color: var(--faint); }
/* D189: after the committed opening seconds the button becomes the way out of the burn. */
.warp-ctl.can-cancel { border-color: var(--red); }
.warp-ctl.can-cancel b { color: var(--red); }

.track-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid rgba(116, 240, 176, 0.34);
  background: rgba(4, 7, 12, 0.76);
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0.12em;
  pointer-events: auto;
}
.track-chip[hidden] { display: none; }
.track-chip span { color: var(--faint); font-size: 10px; }
.track-chip b {
  max-width: 112px;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-chip i { font-style: normal; color: var(--muted); font-size: 12px; }
.track-chip:hover { border-color: var(--green); }

/* A course can be paused by a hand on the stick, a hail, or a contact close to the lane. The
   destination stays here until the pilot either resumes it or sets a new one. */
.course-resume {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  max-width: 214px;
  min-height: 29px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 180, 84, 0.42);
  background: rgba(10, 20, 28, 0.9);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: left;
  pointer-events: auto;
}
.course-resume[hidden] { display: none; }
.course-resume span { flex: 0 0 auto; color: var(--amber); font-size: 10px; letter-spacing: 0.1em; }
.course-resume b { min-width: 0; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.course-resume i { flex: 0 0 auto; margin-left: auto; color: var(--green); font-style: normal; font-size: 11px; letter-spacing: 0.1em; }
.course-resume:hover { border-color: var(--amber); background: rgba(255, 180, 84, 0.12); }
.course-resume:focus-visible { outline-color: var(--amber); }
.course-resume.detour { border-color: rgba(199, 166, 255, 0.55); }
.course-resume.detour span { color: #c7a6ff; }
.course-resume.hail { border-color: rgba(255, 180, 84, 0.7); }

.minimap {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px;
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.72);
}
.minimap canvas { display: block; width: 116px; height: 116px; }
.minimap {
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.minimap:hover,
.minimap:focus-visible { border-color: rgba(111, 231, 255, 0.6); background: rgba(8, 17, 26, 0.9); }
.minimap:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
/* A new contact pulls the eye to the scope, not to a card over the sector. The glow follows the
   highest threat in the ping set: cyan for a sweep, amber for a caution, red for an alarm. */
.minimap.has-ping {
  --ping-color: rgba(111, 231, 255, 0.55);
  border-color: var(--ping-color);
  box-shadow: 0 0 0 1px var(--ping-color), 0 0 18px var(--ping-color);
  animation: minimap-ping 1.2s ease-in-out infinite;
}
  .minimap.has-ping.ping-warn { --ping-color: rgba(255, 180, 84, 0.6); }
.minimap.has-ping.ping-alarm { --ping-color: rgba(255, 96, 96, 0.65); }
/* D215: a detected meteor sweep keeps the scope itself on alarm until the train passes. */
.minimap.meteor {
  border-color: rgba(255, 96, 80, 0.82);
  box-shadow: 0 0 18px rgba(255, 70, 60, 0.32), inset 0 0 12px rgba(255, 70, 60, 0.14);
  animation: minimap-meteor 1.1s steps(2, end) infinite;
}
@keyframes minimap-meteor {
  50% { border-color: rgba(255, 180, 84, 0.85); }
}
@keyframes minimap-ping {
  50% { border-color: var(--ping-color); box-shadow: 0 0 0 1px var(--ping-color), 0 0 24px var(--ping-color); }
}
.minimap span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-align: center;
}

/* ---------- large sector radar ---------- */

.radar-overlay {
  position: fixed;
  inset: 0;
  z-index: 68;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(2, 5, 9, 0.82);
  backdrop-filter: blur(8px);
}
.radar-overlay[hidden] { display: none; }
.radar-panel {
  display: flex;
  flex-direction: column;
  width: min(850px, 100%);
  max-height: min(calc(92 * var(--vh)), 800px);
  border: 1px solid rgba(111, 231, 255, 0.32);
  background: #061018;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.8), inset 0 0 60px rgba(111, 231, 255, 0.025);
  overflow: hidden;
}
.radar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.radar-head h1 { margin-top: 2px; font-size: 23px; font-weight: 500; letter-spacing: 0.22em; }
.radar-panel .close { display: block; }
.radar-body {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.92fr);
  gap: 16px;
  min-height: 0;
  padding: 14px 16px 16px;
  overflow: hidden;
}
.radar-map { min-width: 0; }
#radarBig { touch-action: none; }
.radar-map canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(111, 231, 255, 0.16);
  background: #04070c;
  touch-action: manipulation;
}
.radar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.radar-legend .dot { width: 7px; height: 7px; display: inline-block; margin-right: -8px; }
.radar-legend .dot.poi { background: var(--green); }
.radar-legend .dot.hostile { background: var(--red); transform: rotate(45deg); }
.radar-legend .dot.fleet { border-radius: 50%; background: var(--cyan); }
.radar-legend .dot.course { background: var(--amber); }
.radar-legend .dot.pod { background: #7ee0a1; }
.radar-legend .dot.fog { background: rgba(8, 12, 16, 0.95); box-shadow: inset 0 0 0 1px rgba(111, 231, 255, 0.2); }
.radar-side { min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.radar-selected {
  min-height: 82px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.55);
}
.radar-selected .eyebrow { display: block; margin-bottom: 4px; }
.radar-selected h3 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 500; letter-spacing: 0.06em; line-height: 1.3; overflow-wrap: anywhere; }
.radar-selected p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.radar-selected .hint { color: var(--faint); }
.radar-selected .state { color: var(--amber); }
.radar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 10px 0 14px; }
.radar-action {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(111, 231, 255, 0.3);
  background: rgba(111, 231, 255, 0.06);
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.radar-action.path { grid-column: 1 / -1; border-color: rgba(255, 180, 84, 0.5); color: var(--amber); background: rgba(255, 180, 84, 0.08); }
.radar-action:hover:not(:disabled) { background: rgba(111, 231, 255, 0.14); }
.radar-action.path:hover:not(:disabled) { background: rgba(255, 180, 84, 0.16); }
.radar-action:disabled { opacity: 0.32; cursor: not-allowed; }
.radar-filter { display: flex; gap: 5px; margin: 2px 0 6px; }
.radar-chip {
  flex: 1; padding: 5px 0; font: inherit; font-size: 11px; letter-spacing: 0.12em;
  color: var(--faint); background: rgba(8, 14, 20, 0.6); cursor: pointer;
  border: 1px solid rgba(111, 231, 255, 0.18); border-radius: 3px;
}
.radar-chip:hover { color: var(--ink); border-color: rgba(111, 231, 255, 0.4); }
.radar-chip.on { color: var(--cyan); border-color: rgba(111, 231, 255, 0.6); background: rgba(111, 231, 255, 0.1); }
.radar-list { display: flex; flex-direction: column; gap: 5px; max-height: 290px; overflow-y: auto; padding-right: 2px; }
.radar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.4);
  color: var(--muted);
  text-align: left;
}
.radar-row:hover { border-color: rgba(111, 231, 255, 0.45); background: rgba(111, 231, 255, 0.05); }
.radar-row.selected { border-color: rgba(255, 180, 84, 0.72); background: rgba(255, 180, 84, 0.07); }
.radar-row b { display: block; color: var(--ink); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-row span { display: block; margin-top: 2px; color: var(--faint); font-size: 11px; letter-spacing: 0.1em; }
.radar-row .dist { color: var(--cyan); font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; }
.radar-row .tag { color: var(--green); }
.radar-empty { padding: 14px 10px; border: 1px dashed var(--line); color: var(--faint); font-size: 12px; line-height: 1.5; }
.radar-help { margin: 12px 0 0; color: var(--faint); font-size: 11px; line-height: 1.55; }

.radar-overlay.is-open .radar-panel { animation: radar-in 0.18s ease-out; }
@keyframes radar-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

/* Bedop's quiet watch. This sits over the sector, not over the helm or fire controls: the card is
   small and has no backdrop. The card itself catches taps so reading it cannot steer the hull; the
   rest of the sector stays fully interactive. */
.coach {
  --coach-accent: var(--cyan);
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 24;
  width: min(390px, calc(100% - 380px));
  padding: 9px 11px 10px;
  border: 1px solid rgba(111, 231, 255, 0.28);
  border-left: 2px solid var(--coach-accent);
  background: linear-gradient(180deg, rgba(8, 19, 29, 0.94), rgba(5, 11, 18, 0.9));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 18px rgba(111, 231, 255, 0.06);
  pointer-events: auto;
}
.coach[hidden] { display: none; }
.coach[data-tone="training"] {
  --coach-accent: var(--amber);
  border-color: rgba(255, 180, 84, 0.28);
  border-left-color: var(--amber);
}
.coach-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.coach-tools, .intro-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.coach-id { display: inline-flex; align-items: center; gap: 6px; color: var(--coach-accent); font-size: 11px; letter-spacing: 0.18em; }
/* The voice toggle sits in the same upper-right corner on every Bedop window, so the choice never
   hides in a settings sheet. */
.voice-toggle {
  min-height: 24px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.7);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.1em;
  line-height: 1.1;
  white-space: nowrap;
}
.voice-toggle:hover { color: var(--ink); border-color: var(--muted); }
.voice-toggle.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.5); background: rgba(255, 180, 84, 0.1); }
.voice-toggle[disabled] { opacity: 0.55; cursor: not-allowed; }
.coach-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coach-accent);
  box-shadow: 0 0 8px var(--coach-accent);
  animation: coach-dot 2.4s ease-in-out infinite;
}
@keyframes coach-dot { 50% { opacity: 0.35; } }
.coach-close {
  width: 24px;
  height: 24px;
  line-height: 1;
  color: var(--faint);
  font-size: 15px;
  pointer-events: auto;
}
.coach-close:hover { color: var(--ink); }
#coachText { color: var(--ink); font-size: 13px; line-height: 1.55; letter-spacing: 0.01em; }
.coach-actions { display: flex; align-items: center; gap: 7px; margin-top: 8px; pointer-events: auto; }
.coach-action {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--coach-accent);
  background: rgba(111, 231, 255, 0.06);
  color: var(--coach-accent);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.coach[data-tone="training"] .coach-action { background: rgba(255, 180, 84, 0.08); }
/* The cue's own button is the way to the thing Bedop is naming (OPEN MINE, OPEN STARWELL,
   OPEN ABILITIES). A static bordered button disappears into the card, so it breathes in the cue's own
   accent; one slow rise and fall is a call for attention, not a strobe. */
.coach-action:not([hidden]) { animation: coach-call 1.8s ease-in-out infinite; }
@keyframes coach-call {
  0%, 100% { border-color: var(--coach-accent); box-shadow: 0 0 0 0 rgba(255, 224, 138, 0); }
  50% { border-color: #ffe08a; box-shadow: 0 0 0 3px rgba(255, 224, 138, 0.2), 0 0 18px rgba(255, 180, 84, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  /* Still alerting, just still: the ring stays, the motion stops. */
  .coach-action:not([hidden]) { animation: none; border-color: #ffe08a; box-shadow: 0 0 0 3px rgba(255, 224, 138, 0.22); }
}
.coach-action:hover { background: rgba(111, 231, 255, 0.13); }
.coach-later {
  min-height: 30px;
  padding: 5px 2px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.coach-later:hover { color: var(--muted); }
.coach.coach-in { animation: coach-in 0.32s ease-out; }
@keyframes coach-in {
  from { opacity: 0; transform: translate(-50%, -5px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Incoming hail. Anchored in a reserved band that stays clear of the HUD, the left scope
   (readout/throttle), the minimap, the ship rail and the bottom weapon rack. Helm stays usable. */
.hail {
  --hail-accent: var(--amber);
  position: absolute;
  top: 12px;
  left: 200px;
  width: min(400px, calc(100% - 200px - 148px));
  max-height: min(calc(42 * var(--vh)), calc(100% - 170px));
  overflow: auto;
  z-index: 36;
  padding: 10px 12px 11px;
  border: 1px solid rgba(255, 180, 84, 0.38);
  border-left: 3px solid var(--hail-accent);
  background: linear-gradient(180deg, rgba(24, 17, 14, 0.97), rgba(7, 11, 17, 0.95));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45), 0 0 22px rgba(255, 180, 84, 0.08);
  pointer-events: auto;
}
.hail[hidden] { display: none; }
.hail[data-tone="raider"] {
  --hail-accent: var(--red);
  border-color: rgba(255, 96, 96, 0.42);
  background: linear-gradient(180deg, rgba(30, 14, 17, 0.98), rgba(8, 10, 16, 0.96));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 24px rgba(255, 96, 96, 0.12);
}
.hail[data-tone="friend"] { --hail-accent: var(--green); border-color: rgba(116, 240, 176, 0.34); }
.hail-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.hail-top .eyebrow { color: var(--hail-accent); }
.hail-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.hail-queue { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; }
.hail-min, .hail-close {
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  line-height: 1;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.12em;
  border: 1px solid var(--line);
}
.hail-close { font-size: 16px; padding: 0; width: 32px; }
.hail-min:hover, .hail-close:hover { color: var(--ink); border-color: var(--muted); }
.hail.is-min { max-height: none; overflow: hidden; width: min(280px, calc(100% - 200px - 148px)); }
.hail.is-min .hail-body { display: none; }
#hailTitle { margin: 1px 0 5px; color: var(--ink); font-size: 15px; font-weight: 500; letter-spacing: 0.14em; }
#hailText { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.hail-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.hail-action {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--hail-accent);
  color: var(--hail-accent);
  background: rgba(255, 180, 84, 0.06);
  font-size: 11px;
  letter-spacing: 0.13em;
}
.hail-action:hover { background: rgba(255, 180, 84, 0.13); }
.hail-action.bad { color: var(--red); border-color: rgba(255, 96, 96, 0.65); background: rgba(255, 96, 96, 0.08); }
.hail-action.good { color: var(--green); border-color: rgba(116, 240, 176, 0.55); }
.hail-action.quiet { color: var(--faint); border-color: var(--line); }

/* D182: the trader's hand. Three compact rows inside the existing hail sheet; the phone lane and the
   sheet's own scroll already cover the small screen, so no new overlay. */
.hail-meta {
  margin-top: 6px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.hail-meta[hidden], .hail-offers[hidden] { display: none; }
.hail-offers { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; }
.hail-shipid { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(111, 231, 255, 0.1); }
.hail-shipid[hidden] { display: none; }
.hail-name { display: flex; align-items: center; gap: 8px; }
.hail-name > span { flex: 0 0 auto; font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.hail-name input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--ink);
  background: rgba(8, 17, 27, 0.9);
  border: 1px solid var(--line);
}
.hail-name input:focus { outline: none; border-color: rgba(111, 231, 255, 0.55); }
.hail-name input::placeholder { color: var(--faint); letter-spacing: 0.08em; }
.hail-name-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hail-name-row .hail-action { flex: 0 0 auto; }
.hail-name-row > span { font-size: 11px; letter-spacing: 0.08em; color: var(--faint); }
.hail-palette-head { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.hail-palette-head span { color: var(--faint); }
.hail-palettes { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 5px; margin-top: 5px; }
.hail-palette {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 5px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(8, 17, 27, 0.8);
}
.hail-palette i {
  width: 22px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: linear-gradient(135deg, var(--hull) 0 46%, var(--wing) 46% 72%, var(--accent) 72%);
}
.hail-palette span { font-size: 11px; line-height: 1.15; letter-spacing: 0.08em; color: var(--muted); }
.hail-palette b { margin-left: auto; font-size: 11px; letter-spacing: 0.06em; color: var(--amber); white-space: nowrap; }
.hail-palette.on { border-color: rgba(116, 240, 176, 0.5); background: rgba(116, 240, 176, 0.06); }
.hail-palette.on b { color: var(--green); }
.hail-offer {
  padding: 7px 8px;
  border: 1px solid rgba(255, 180, 84, 0.22);
  background: rgba(255, 180, 84, 0.035);
}
.hail-offer.is-locked { opacity: 0.72; border-color: var(--line); }
.offer-head { display: flex; align-items: baseline; gap: 7px; }
.offer-head b { flex: 1; color: var(--ink); font-size: 12px; font-weight: 500; line-height: 1.35; }
.offer-shape { color: var(--hail-accent); font-size: 11px; letter-spacing: 0.14em; }
.offer-tag { font-style: normal; font-size: 11px; letter-spacing: 0.1em; color: var(--amber); }
.offer-tag.steal { color: var(--green); }
.offer-tag.fair { color: var(--ink); }
.offer-tag.collector { color: #c084fc; }
.offer-detail { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.offer-price { display: flex; gap: 12px; margin: 5px 0 6px; color: var(--faint); font-size: 11px; letter-spacing: 0.1em; }
.offer-price b { color: var(--ink); font-weight: 500; }
.hail-offer .hail-action { width: 100%; }
.hail-action[disabled] { opacity: 0.55; cursor: not-allowed; }

/* FTL-style fire control: a row of independent mounts, each with its own charge and auto toggle. */
.weapon-rack {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 18;
  width: min(330px, calc(100% - 40px));
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}
.weapon-rack[hidden] { display: none; }
.weapon-rack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--faint);
}
/* The phone head carries WEAPONS, GUNS ON and the live AUTO-SEEK hint in one 330 px lane. Let the
   hint ellipsis instead of wrapping and growing the rack over the flight stack. */
.weapon-rack-head #weaponHint {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.weapon-arm {
  pointer-events: auto;
  padding: 2px 6px;
  border: 1px solid rgba(255, 180, 84, 0.3);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--amber);
  touch-action: manipulation;
}
.weapon-arm.off { color: rgba(159, 196, 211, 0.8); border-color: rgba(159, 196, 211, 0.24); }
.weapon-arm.arming { color: var(--red); border-color: rgba(255, 96, 96, 0.4); }
.weapon-lead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--faint);
  pointer-events: none;
}
.weapon-lead button {
  pointer-events: auto;
  width: 18px;
  padding: 1px 0;
  border: 1px solid rgba(255, 180, 84, 0.26);
  color: var(--amber);
  touch-action: manipulation;
}
.weapon-lead b { min-width: 30px; text-align: center; font-weight: 500; color: var(--amber); }
/* Fire control is its own strip above the guns: a focused contact, a thumb-sized cycle, and a clear. */
.weapon-target-row {
  display: grid;
  grid-template-columns: auto 22px minmax(0, 1fr) 22px 40px 22px;
  align-items: stretch;
  gap: 3px;
  pointer-events: auto;
}
.weapon-target-label {
  display: flex;
  align-items: center;
  padding-right: 2px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.weapon-target-row button {
  min-height: 22px;
  border: 1px solid rgba(255, 180, 84, 0.26);
  color: var(--faint);
  touch-action: manipulation;
}
.weapon-target-step { color: var(--amber); font-size: 14px; line-height: 1; }
.weapon-target-pick {
  padding: 2px 5px;
  overflow: hidden;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.weapon-target-pick.locked { color: var(--green); border-color: rgba(116, 240, 176, 0.42); }
.weapon-target-clear { color: rgba(255, 143, 131, 0.9); font-size: 15px; line-height: 1; }
/* D238: the bearing order. It sits in the target row because lining the guns up is a fire-control
   question, not a navigation one, and it has to be reachable mid-fight on both shapes. */
.weapon-target-bear { font-size: 10px; letter-spacing: 0.06em; padding: 0 2px; }
.weapon-target-bear.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.6); background: rgba(255, 180, 84, 0.1); }
.weapon-target-row button[disabled] { opacity: 0.35; cursor: default; }
#weaponSlots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  pointer-events: auto;
}
.weapon-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  min-height: 96px;
  border: 1px solid rgba(255, 180, 84, 0.26);
  /* Gun one and gun two carry one colour each; the rack paints --gun inline from GUN_COLORS. */
  box-shadow: inset 2px 0 0 var(--gun, var(--amber));
  background: rgba(4, 7, 12, 0.84);
  transition: border-color 0.18s, background 0.18s, opacity 0.18s;
}
.weapon-card.active {
  outline: 1px solid var(--gun, var(--amber));
  outline-offset: -1px;
  background: rgba(255, 255, 255, 0.025);
}
.weapon-gun {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--gun, var(--amber));
  vertical-align: 1px;
}
.weapon-gun-id {
  margin-left: 3px;
  font-size: 10px;
  letter-spacing: 0;
  color: var(--gun, var(--amber));
}
.weapon-card.ready { border-color: rgba(255, 180, 84, 0.64); }
.weapon-card.in-arc { border-color: rgba(116, 240, 176, 0.56); }
.weapon-card.blocked { border-color: rgba(255, 96, 96, 0.46); }
.weapon-card.hot { opacity: 0.55; border-color: rgba(255, 96, 96, 0.28); }
.weapon-card.cold { opacity: 0.55; border-color: rgba(159, 196, 211, 0.22); }
.weapon-fire {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 6px 7px;
  text-align: left;
  touch-action: manipulation;
}
.weapon-fire:hover { background: rgba(255, 180, 84, 0.07); }
.weapon-head { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; }
.weapon-head b { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; color: var(--gun, var(--amber)); }
.weapon-head em { font-style: normal; font-size: 10px; color: var(--faint); white-space: nowrap; }
.weapon-spec { font-size: 10px; letter-spacing: 0.04em; color: rgba(159, 196, 211, 0.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weapon-feed { font-size: 10px; letter-spacing: 0.06em; color: rgba(255, 180, 84, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weapon-feed:empty { display: none; }
.weapon-target { font-size: 10px; letter-spacing: 0.05em; color: var(--gun, rgba(116, 240, 176, 0.8)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weapon-target:empty { display: none; }
.weapon-charge { height: 3px; background: #12202b; overflow: hidden; }
.weapon-charge i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.18s linear; }
.weapon-card.ready .weapon-charge i { box-shadow: 0 0 7px rgba(255, 180, 84, 0.55); }
.weapon-heat { height: 2px; background: rgba(255, 96, 96, 0.12); overflow: hidden; }
.weapon-heat i { display: block; height: 100%; width: 0; background: rgba(255, 120, 96, 0.82); transition: width 0.18s linear; }
.weapon-card.hot .weapon-heat i { background: var(--red); }
.weapon-state { font-size: 10px; letter-spacing: 0.08em; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weapon-card.ready .weapon-state { color: var(--amber); }
.weapon-card.in-arc .weapon-state { color: var(--green); }
.weapon-card.blocked .weapon-state { color: rgba(255, 143, 131, 0.9); }
.weapon-side {
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 180, 84, 0.18);
}
.weapon-side-btn, .weapon-auto, .weapon-target-btn {
  flex: 1;
  padding: 2px 1px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--faint);
  touch-action: manipulation;
}
.weapon-side-btn { color: var(--faint); border-bottom: 1px solid rgba(255, 180, 84, 0.12); }
.weapon-side-btn:hover { color: var(--amber); }
.weapon-auto { border-bottom: 1px solid rgba(255, 180, 84, 0.12); }
.weapon-auto.on { color: var(--green); background: rgba(116, 240, 176, 0.08); }
.weapon-target-btn { color: rgba(159, 196, 211, 0.76); }
.weapon-target-btn.on {
  color: var(--gun, var(--amber));
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--gun, var(--amber));
}

/* A locked contact is also the target picker for a flight plan. This sits over the lower-left of the
   sector, away from the weapon rack; selecting any contact opens it with the two learned profiles. */
.move-panel {
  position: absolute;
  left: 16px;
  bottom: 118px;
  z-index: 16;
  width: min(286px, calc(100% - 32px));
  padding: 9px 10px 8px;
  border: 1px solid rgba(111, 231, 255, 0.28);
  background: rgba(5, 11, 18, 0.92);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.move-panel[hidden] { display: none; }
.move-head { display: flex; align-items: center; gap: 8px; }
.move-target {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.move-min {
  flex: 0 0 auto;
  min-width: 34px;
  height: 24px;
  padding: 0 5px;
  border: 1px solid var(--line);
  background: rgba(111, 231, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.move-min:hover { border-color: var(--cyan); color: var(--ink); }
.move-hint { margin: 5px 0 7px; color: var(--muted); font-size: 11px; line-height: 1.45; }
/* D119: a live orbit's tracking readout. It updates in place every snapshot, so it must never rebuild
   the profile buttons under a press (D118). */
.move-track { margin: 4px 0 6px; color: var(--green); font-size: 11px; letter-spacing: 0.05em; line-height: 1.4; }
.move-track[hidden] { display: none; }
/* D207: the flight plan folds to the target and live track so the sector stays usable in a fight.
   The compact strip keeps the same lane and never becomes the full-width phone sheet. */
.move-panel.is-min { width: min(230px, calc(100% - 32px)); padding: 7px 8px; }
.move-panel.is-min .move-hint,
.move-panel.is-min .move-choices,
.move-panel.is-min .move-size-row,
.move-panel.is-min .move-chain-row,
.move-panel.is-min .move-actions,
.move-panel.is-min .move-foot { display: none; }
.move-panel.is-min .move-track {
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.move-engage.is-live { border-color: rgba(255, 184, 92, 0.55); background: rgba(255, 184, 92, 0.12); color: var(--amber); }
.move-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.move-choice {
  display: flex;
  min-height: 56px;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 7px;
  border: 1px solid rgba(111, 231, 255, 0.28);
  background: rgba(111, 231, 255, 0.055);
  text-align: left;
}
.move-choice:hover { border-color: var(--cyan); background: rgba(111, 231, 255, 0.11); }
.move-choice b { color: var(--cyan); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; }
.move-choice span { color: var(--amber); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.move-choice em { color: var(--faint); font-size: 10px; font-style: normal; line-height: 1.35; }
.move-choice.in-plan { border-color: rgba(255, 180, 84, 0.6); background: rgba(255, 180, 84, 0.09); }
.move-chain-row { display: flex; align-items: center; gap: 5px; min-height: 23px; margin-top: 7px; }
.move-chain-label { flex: 0 0 auto; color: var(--faint); font-size: 10px; letter-spacing: 0.14em; }
.move-chain { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; gap: 3px; }
.move-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(255, 180, 84, 0.35);
  background: rgba(255, 180, 84, 0.08);
  padding: 3px 4px;
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.move-chip i { color: var(--muted); font-size: 12px; font-style: normal; line-height: 1; }
.move-empty { color: var(--faint); font-size: 11px; }
.move-clear {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  padding: 3px 4px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.move-clear:disabled { opacity: 0.35; cursor: default; }
.move-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.move-engage {
  flex: 1;
  min-height: 34px;
  border: 1px solid rgba(116, 240, 176, 0.45);
  background: rgba(116, 240, 176, 0.11);
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0.14em;
}
.move-engage:disabled { border-color: var(--line); background: transparent; color: var(--faint); cursor: default; }
.move-count { color: var(--faint); font-size: 11px; }
.move-foot { margin-top: 5px; color: var(--faint); font-size: 10px; letter-spacing: 0.11em; }

/* A crew call is a named receipt, not a combat alarm: it stays until the player opens the deck, so a
   child who was looking at the sector does not miss a person finishing a job. */
.crew-call {
  position: absolute;
  z-index: 18;
  top: calc(var(--hud) + 170px);
  right: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 240px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 180, 84, 0.55);
  background: rgba(12, 16, 22, 0.94);
  color: var(--amber);
  text-align: left;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.38);
}
.crew-call[hidden] { display: none; }
.crew-call:hover { background: rgba(255, 180, 84, 0.10); }
.crew-call.ping { animation: crew-call-in 0.24s ease-out, crew-call-glow 0.9s ease-in-out 2; }
.crew-call-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 9px var(--amber); }
.crew-call-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crew-call-copy b { font-size: 11px; font-weight: 500; letter-spacing: 0.16em; }
.crew-call-copy em { color: var(--muted); font-size: 11px; font-style: normal; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-call > i { flex: 0 0 auto; min-width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: #17100a; font-size: 11px; font-style: normal; }
@keyframes crew-call-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes crew-call-glow { 50% { border-color: var(--amber); box-shadow: 0 0 20px rgba(255, 180, 84, 0.28); } }

.diag {
  position: absolute;
  left: 14px;
  bottom: 14px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--faint);
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: pre;
}
/* A running tick/fps readout is dev noise behind the HAUL and notice buttons: the element stays for
   a sign-in prompt or a lost link, and a healthy link keeps it hidden (app.js setDiag). */
.diag[hidden] { display: none; }

/* Notices keep to the quiet corner above the log, out of the middle of the view. */
.toasts {
  position: absolute;
  left: 14px;
  bottom: 76px;
  z-index: 29;
  display: flex;
  flex-direction: column-reverse;
  gap: 5px;
  align-items: flex-start;
  pointer-events: none;
  width: min(340px, 52%);
}
.toast {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--amber);
  background: rgba(4, 7, 12, 0.92);
  border: 1px solid var(--amber-dim);
  padding: 6px 10px;
  animation: toast-in 0.18s ease-out;
}
.toast.rank { color: var(--green); border-color: rgba(116, 240, 176, 0.3); }
.toast.bad { color: var(--red); border-color: rgba(255, 96, 96, 0.3); }
/* Director beats (D46) read as Bedop talking: cool violet-cyan, never the red of a hit. */
.toast.pulse { color: #c9c0ff; border-color: rgba(176, 160, 255, 0.34); }
.toast.warn { color: var(--amber); }
@keyframes toast-in { from { opacity: 0; transform: translateY(4px); } }

/* Quiet notices: the same corner as the log, one compact card that plays and then folds away.
   The threat colour is the only thing that changes for an attack or a warning. */
.notice-ticker-card {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 7px;
  width: 100%;
  padding: 7px 10px 8px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--ticker-accent, var(--cyan));
  background: rgba(4, 7, 12, 0.94);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  animation: toast-in 0.18s ease-out;
}
.notice-ticker-card b { flex: 0 0 auto; color: var(--ticker-accent, var(--cyan)); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; }
.notice-ticker-card span { flex: 1 1 auto; }
.notice-ticker-card.t-alarm { --ticker-accent: var(--red); border-color: rgba(255, 96, 96, 0.34); background: rgba(18, 6, 8, 0.95); }
.notice-ticker-card.t-warn { --ticker-accent: var(--amber); border-color: rgba(255, 180, 84, 0.34); background: rgba(16, 11, 5, 0.95); }
.notice-ticker-card.t-pulse { --ticker-accent: #c9c0ff; border-color: rgba(176, 160, 255, 0.34); background: rgba(10, 8, 18, 0.95); }
.notice-ticker-card.t-rank { --ticker-accent: var(--green); border-color: rgba(116, 240, 176, 0.3); }
.notice-ticker-card.t-log { --ticker-accent: var(--cyan); }
.notice-ticker-life {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ticker-accent, var(--cyan));
  opacity: 0.55;
  transform-origin: left;
  animation: ticker-life 6.5s linear forwards;
}
.notice-ticker-card.out { animation: ticker-out 0.26s ease-in forwards; }
@keyframes ticker-life { to { transform: scaleX(0); } }
@keyframes ticker-out { to { opacity: 0; transform: translateY(22px) scale(0.92); } }

/* A radio call is a small mail card, not a second chat sheet (D144). The host is click-through so the
   sector stays playable; only the card itself takes the pointer. The envelope rises out of the card
   when a voice clip arrives and opens its flap while the clip is playing. */
.radio-toast {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 86;
  width: min(360px, calc(100% - 28px));
  pointer-events: none;
}
.radio-toast[hidden] { display: none; }
.radio-card {
  pointer-events: auto;
  padding: 8px 10px 7px;
  border: 1px solid rgba(111, 231, 255, 0.4);
  background: rgba(4, 10, 14, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.62);
  animation: radio-in 0.26s ease-out;
}
.radio-card.voice { border-color: rgba(255, 180, 84, 0.44); }
.radio-card.echo { border-color: rgba(176, 160, 255, 0.44); }
.radio-toast.out .radio-card { animation: radio-out 0.24s ease-in forwards; }
/* A live radio card owns the notification lane: Bedop's card and the quadrant banner wait behind it
   instead of stacking on top. comms.js sets the class for the life of the toast. */
body.radio-live #coach,
body.radio-live #quadBanner { visibility: hidden; }
.radio-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.radio-tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--cyan);
  white-space: nowrap;
}
.radio-card.voice .radio-tag { color: var(--amber); }
.radio-card.echo .radio-tag { color: #c9c0ff; }
.radio-head b {
  font-size: 12px;
  letter-spacing: 0.08em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.radio-head em {
  margin-left: auto;
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--faint);
  white-space: nowrap;
}
.radio-close {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: -4px -4px -4px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 15px;
  line-height: 1;
}
.radio-close:hover { color: var(--red); }
.radio-copy {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  max-height: 3em;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.radio-card.fleet { border-color: rgba(111, 231, 255, 0.5); }
.radio-card.fleet .radio-tag { color: var(--cyan); }
.radio-fleet-card { margin-top: 6px; padding: 6px 7px; }
.radio-fleet-card .comms-fleet-copy b { font-size: 13px; }
.radio-fleet-card .comms-fleet-copy span { font-size: 11px; }
.radio-fleet-card .comms-fleet-join { min-height: 28px; padding: 3px 9px; font-size: 11px; }
.radio-fleet-card .comms-fleet-linked { font-size: 11px; }
.radio-mail {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 42px;
  margin-top: 7px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 180, 84, 0.4);
  background: linear-gradient(180deg, rgba(255, 180, 84, 0.14), rgba(255, 180, 84, 0.04));
  color: var(--amber);
  overflow: hidden;
  animation: radio-mail-up 0.36s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.radio-mail.inert { cursor: default; opacity: 0.82; }
.radio-mail:not(.inert):hover { background: linear-gradient(180deg, rgba(255, 180, 84, 0.22), rgba(255, 180, 84, 0.08)); }
.radio-mail.rec { border-color: rgba(255, 96, 96, 0.55); animation: radio-hold 1.3s ease-in-out infinite; }
.radio-flap {
  position: absolute;
  inset: 0 0 auto;
  height: 22px;
  background: linear-gradient(180deg, rgba(255, 180, 84, 0.3), rgba(255, 180, 84, 0.08));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform 0.28s ease;
}
.radio-mail.open .radio-flap { transform: rotateX(180deg); }
.radio-stamp {
  position: relative;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 2px 5px;
  border: 1px solid currentColor;
}
.radio-face {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-left: auto;
}
.radio-face b { font-size: 11px; letter-spacing: 0.12em; }
.radio-face em { font-size: 11px; font-style: normal; color: var(--muted); }
.radio-copy + .radio-mail { margin-top: 6px; }
.radio-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.radio-foot kbd {
  font: inherit;
  color: var(--cyan);
  border: 1px solid rgba(111, 231, 255, 0.28);
  padding: 0 3px;
}
@keyframes radio-in { from { opacity: 0; transform: translateY(-7px); } }
@keyframes radio-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes radio-mail-up { from { opacity: 0; transform: translateY(16px); } }
@keyframes radio-hold { 50% { border-color: rgba(255, 96, 96, 0.18); } }

/* The notice button and its drawer: everything the sector said, kept out of the helm's way. */
/* The haul desk sits beside the notices: same corner, same drawer, one more button. */
.haul-bar {
  position: absolute;
  left: 118px;
  bottom: 38px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: auto;
}
.haul-tray {
  width: min(360px, calc(calc(100 * var(--vw)) - 28px));
  max-height: calc(46 * var(--vh));
  overflow: auto;
  padding: 8px 10px 10px;
  border: 1px solid rgba(111, 231, 255, 0.3);
  border-left: 2px solid var(--cyan);
  background: linear-gradient(180deg, rgba(10, 18, 26, 0.98), rgba(6, 9, 14, 0.97));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  animation: notice-slide 0.2s ease-out;
}
.haul-tray[hidden] { display: none; }
.haul-body { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--muted); }
.haul-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.haul-row b { color: var(--ink); font-weight: 500; letter-spacing: 0.08em; }
.haul-row em { color: var(--faint); font-style: normal; }
.haul-ship { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px dashed var(--line); }
.haul-transfer { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 7px; grid-column: 1 / -1; }
.haul-transfer span { color: var(--faint); font-size: 11px; letter-spacing: 0.08em; }
.haul-transfer select { min-height: 34px; background: rgba(6,12,20,.82); color: var(--ink); border: 1px solid var(--line); }
.haul-ship.transfer { border-top-color: rgba(255,180,84,.35); }
.haul-ship.transfer .haul-action { min-height: 28px; padding: 4px 7px; }
.haul-ship b { color: var(--cyan); font-weight: 500; }
.haul-ship.sale b { color: var(--green); }
.haul-ship em { color: var(--amber); font-style: normal; }
.haul-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.haul-action {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.14em;
}
.haul-action:hover { border-color: var(--cyan); color: var(--ink); }
.haul-action.good { color: var(--green); border-color: rgba(116, 240, 176, 0.45); }
.haul-action.quiet { color: var(--faint); }
.haul-note { color: var(--faint); line-height: 1.5; }

.notice-bar {
  position: absolute;
  left: 14px;
  bottom: 38px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: auto;
}
.notice-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.82);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.16em;
}
.notice-btn:hover, .notice-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--muted); }
.notice-btn b { font-weight: 500; letter-spacing: 0.16em; }
/* The notices control is a square: the ticker folds down into it. HAUL keeps the wider label. */
.notice-square { position: relative; width: 32px; height: 32px; padding: 0; justify-content: center; }
.notice-bell { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.notice-square.has-new { color: var(--amber); border-color: rgba(255, 180, 84, 0.5); box-shadow: 0 0 10px rgba(255, 180, 84, 0.18); }
.notice-square i { position: absolute; top: -5px; right: -5px; border: 1px solid rgba(255, 180, 84, 0.4); }
.notice-btn i {
  font-style: normal;
  min-width: 15px;
  padding: 1px 4px;
  border-radius: 8px;
  background: rgba(255, 180, 84, 0.16);
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
}
.notice-btn i[hidden] { display: none; }
.notice-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.notice-btn.has-new .notice-dot { background: var(--amber); box-shadow: 0 0 6px rgba(255, 180, 84, 0.7); }

/* The mining controls pick up the nearest field as the hull closes on it. The phase and the cutter
   range come from `miningPayload.approach`; these styles only turn the server read into a light. */
#mineBtn.field-near, #mineBtn2.field-near, #haulBtn.field-near {
  color: var(--amber);
  border-color: rgba(255, 180, 84, 0.4);
  background: linear-gradient(180deg, rgba(255, 180, 84, 0.14), rgba(255, 180, 84, 0.04));
  filter: drop-shadow(0 0 4px rgba(255, 180, 84, 0.18));
}
#haulBtn.field-near .notice-dot { background: var(--amber); }
#mineBtn.field-close, #mineBtn2.field-close, #haulBtn.field-close {
  color: var(--amber);
  border-color: rgba(255, 180, 84, 0.68);
  background: linear-gradient(180deg, rgba(255, 180, 84, 0.22), rgba(255, 180, 84, 0.07));
  filter: drop-shadow(0 0 7px rgba(255, 180, 84, 0.28));
  animation: field-close 1.8s ease-in-out infinite;
}
#haulBtn.field-close .notice-dot { background: var(--amber); box-shadow: 0 0 6px rgba(255, 180, 84, 0.7); }
#mineBtn.field-ready, #mineBtn2.field-ready, #haulBtn.field-ready {
  color: var(--green);
  border-color: rgba(116, 240, 176, 0.72);
  background: linear-gradient(180deg, rgba(116, 240, 176, 0.18), rgba(116, 240, 176, 0.05));
  filter: drop-shadow(0 0 9px rgba(116, 240, 176, 0.3));
  animation: field-ready 1.2s ease-in-out infinite;
}
#haulBtn.field-ready .notice-dot { background: var(--green); box-shadow: 0 0 7px rgba(116, 240, 176, 0.8); }
@keyframes field-close {
  50% { border-color: var(--amber); filter: drop-shadow(0 0 11px rgba(255, 180, 84, 0.4)); }
}
@keyframes field-ready {
  50% { border-color: var(--green); filter: drop-shadow(0 0 14px rgba(116, 240, 176, 0.48)); }
}
.notice-tray {
  width: min(340px, calc(calc(100 * var(--vw)) - 28px));
  max-height: calc(44 * var(--vh));
  overflow: auto;
  padding: 8px 10px 9px;
  border: 1px solid rgba(255, 180, 84, 0.28);
  border-left: 2px solid var(--amber);
  background: linear-gradient(180deg, rgba(12, 16, 24, 0.98), rgba(6, 9, 14, 0.97));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  animation: notice-slide 0.2s ease-out;
}
.notice-tray[hidden] { display: none; }
@keyframes notice-slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.notice-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.notice-quiet, .coach-quiet {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.notice-quiet input, .coach-quiet input { width: 12px; height: 12px; margin: 0; accent-color: var(--cyan); }
.notice-quiet:hover, .coach-quiet:hover { color: var(--ink); }
.notice-head .notice-quiet { margin-left: auto; }
.coach-quiet { margin-left: auto; }
.notice-clear {
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.14em;
}
.notice-clear:hover { color: var(--ink); border-color: var(--muted); }
.notice-list { display: flex; flex-direction: column; gap: 5px; }
.notice-row { display: flex; gap: 7px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.notice-row time { flex: 0 0 auto; padding-top: 1px; color: var(--faint); font-size: 11px; }
.notice-row.unread { color: var(--ink); }
.notice-row.unread time { color: var(--amber); }
.notice-row.k-bad { color: var(--red); }
.notice-row.k-rank { color: var(--green); }
.notice-row.k-warn { color: var(--amber); }
.notice-row.k-pulse { color: #c9c0ff; }
.notice-empty { margin: 0; color: var(--faint); font-size: 12px; }

.destroyed {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(circle, rgba(80, 8, 8, 0.36), rgba(3, 5, 9, 0.82));
  pointer-events: none;
}
.destroyed[hidden] { display: none; }
.destroyed b { font-size: 26px; letter-spacing: 0.24em; color: var(--red); }
.destroyed span { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }

.zen-exit {
  display: none;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.72);
  padding: 6px 9px;
}
body.zen #hud, body.zen #rail { display: none; }
body.zen #layout { top: 0; grid-template-columns: 1fr; }
body.zen #zenExit { display: inline-flex; align-items: center; gap: 6px; }
.zen-only { display: none; }

/* ---------- rail ---------- */

#rail {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--bg-2);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.railPane {
  padding: 14px 16px 26px;
  border-bottom: 1px solid var(--line);
}

.pane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.eyebrow { font-size: 11px; letter-spacing: 0.24em; color: var(--faint); }
.pane-head h1 { font-size: 15px; letter-spacing: 0.16em; font-weight: 500; margin-top: 2px; }
/* The Vessel strip holds a state chip and five controls beside the title. It is a control row, not a
   reading surface: keep it compact and let it wrap rather than push a horizontal scrollbar into the
   rail when the window or the type floor makes the row tight. */
.pane-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.pane-actions .deck-open { padding: 3px 5px; }
.pane-tool-menu { position: relative; }
.pane-tool-menu > summary { list-style: none; cursor: pointer; }
.pane-tool-menu > summary::-webkit-details-marker { display: none; }
.pane-tool-items {
  position: absolute; top: calc(100% + 5px); right: 0; z-index: 24;
  display: grid; grid-template-columns: repeat(2, minmax(100px, 1fr)); gap: 5px;
  width: min(250px, calc(100vw - 32px)); padding: 7px;
  border: 1px solid var(--line); background: rgba(4, 9, 15, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.52);
}
.pane-tool-items .deck-open { min-height: 36px; text-align: left; white-space: normal; }
.deck-open {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  padding: 4px 6px;
  white-space: nowrap;
}
.deck-open:hover { background: rgba(111, 231, 255, 0.08); }
.deck-open.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.55); background: rgba(255, 180, 84, 0.09); }
.chip {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--green);
  border: 1px solid rgba(116, 240, 176, 0.28);
  padding: 4px 6px;
}
.chip.bad { color: var(--red); border-color: rgba(255, 96, 96, 0.3); }
.chip.warn { color: var(--amber); border-color: var(--amber-dim); }

#deck {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.48;
  background: #07080d;
  border: 1px solid var(--line);
  cursor: pointer;
  touch-action: manipulation;
}

.deck-hint {
  margin: 7px 0 5px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.crew-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 7px;
}
.crew-chip {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 6px;
  border: 1px solid rgba(111, 231, 255, 0.12);
  background: rgba(8, 17, 27, 0.78);
  text-align: left;
}
.crew-chip:hover { border-color: var(--cyan-dim); }
.crew-chip.on {
  border-color: rgba(255, 180, 84, 0.65);
  background: rgba(255, 180, 84, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 180, 84, 0.12);
}
.crew-chip.down { opacity: 0.38; }
.crew-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--crew-accent, var(--cyan));
  box-shadow: 0 0 6px var(--crew-accent, var(--cyan));
}
.crew-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crew-copy b {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crew-copy em {
  font-style: normal;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crew-mastery { display: flex; align-items: center; gap: 4px; min-width: 0; margin-top: 1px; }
.crew-mastery > i { display: block; flex: 0 1 34px; height: 2px; background: #12202b; }
.crew-mastery > i > i { display: block; height: 100%; background: var(--crew-accent, var(--cyan)); transition: width 0.35s linear; }
.crew-mastery small { flex: 0 0 auto; max-width: 62%; color: var(--muted); font-size: 10px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew-hp {
  display: block;
  height: 3px;
  background: #12202b;
}
.crew-hp i { display: block; height: 100%; background: var(--crew-accent, var(--green)); }
/* D128: needs appear only when low, as three thin bars. Amber fed, cyan rested, accent steady. */
.crew-life { display: flex; gap: 3px; margin-top: 1px; }
.crew-life .life-bar { display: block; flex: 1 1 0; height: 2px; background: #12202b; }
.crew-life .life-bar > i { display: block; height: 100%; }
.crew-life .life-bar.food > i { background: var(--amber); }
.crew-life .life-bar.rest > i { background: var(--cyan); }
.crew-life .life-bar.morale > i { background: var(--crew-accent, var(--green)); }

.salvage-modules { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; }
.module-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid rgba(116, 240, 176, 0.24);
  background: rgba(116, 240, 176, 0.055);
}
.module-chip b { color: var(--green); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; }
.module-chip em { color: var(--faint); font-size: 10px; font-style: normal; line-height: 1.25; }
.salvage-empty { color: var(--faint); font-size: 11px; letter-spacing: 0.08em; }
.refit-label { display: block; margin-top: 7px; }
.refit-list { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.refit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 5px 6px;
  border: 1px solid rgba(111, 231, 255, 0.12);
  background: rgba(8, 17, 27, 0.72);
  text-align: left;
}
.refit-row:hover:not(:disabled) { border-color: var(--cyan-dim); background: rgba(111, 231, 255, 0.07); }
.refit-row:disabled { opacity: 0.48; }
.refit-row span:first-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.refit-row b { color: var(--ink); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; }
.refit-row em { color: var(--faint); font-size: 10px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.refit-level { color: var(--amber); font-size: 11px; letter-spacing: 0.08em; }
.refit-cost { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; white-space: nowrap; }

.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 7px 0 12px; font-size: 11px; color: var(--faint); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.sw { width: 6px; height: 6px; display: inline-block; }
.sw.crew { background: var(--cyan); border-radius: 50%; }
.sw.fire { background: var(--amber); }
.sw.breach { background: var(--red); border-radius: 50%; border: 1px solid #fff6; }
.sw.power { background: var(--green); }

/* A compact contract card turns the lane into a short horizon. It lives above power so a player
   reads the next goal before the ship's internal paperwork. */
.contract {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px 7px;
  border: 1px solid rgba(255, 180, 84, 0.30);
  background:
    linear-gradient(135deg, rgba(255, 180, 84, 0.075), rgba(255, 180, 84, 0.015) 62%),
    rgba(8, 17, 27, 0.78);
  overflow: hidden;
}
.contract::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--amber);
}
.contract.done { border-color: rgba(116, 240, 176, 0.28); background: rgba(116, 240, 176, 0.045); }
.contract.done::before { background: var(--green); }
.contract-head { display: flex; align-items: center; justify-content: space-between; }
.contract-head .eyebrow { color: var(--amber); }
.contract.done .contract-head .eyebrow { color: var(--green); }
.contract-head span:last-child { color: var(--faint); font-size: 11px; letter-spacing: 0.06em; }
.contract b { color: var(--ink); font-size: 12px; font-weight: 500; letter-spacing: 0.11em; }
.contract p { color: var(--muted); font-size: 11px; line-height: 1.3; }
.contract-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; color: var(--faint); font-size: 11px; letter-spacing: 0.04em; }
.contract-foot span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contract-foot span:last-child { color: var(--amber); white-space: nowrap; }
.contract.done .contract-foot span:last-child { color: var(--green); }
.contract-bar { display: block; height: 3px; margin-top: 2px; background: #12202b; }
.contract-bar > i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.3s linear; }
.contract.done .contract-bar > i { background: var(--green); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(111, 231, 255, 0.09);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.section-head span:last-child { color: var(--faint); letter-spacing: 0.06em; }

.systems { display: flex; flex-direction: column; gap: 2px; }
.sys {
  display: grid;
  grid-template-columns: 48px 1fr 38px 24px 24px;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  font-size: 11px;
}
/* D100/D120: a refused action shakes the control that asked for it, and the screen rim pulses once, so
   the answer is visible without reading the log line. */
.deny-shake { animation: pwr-deny 420ms ease-in-out; }
#app.deny::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 96, 96, 0.6), inset 0 0 30px rgba(255, 96, 96, 0.16);
  animation: deny-rim 440ms ease-out;
}
@keyframes deny-rim {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes pwr-deny {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
.sys .abbr { color: var(--muted); letter-spacing: 0.1em; }
.sys .pips { display: flex; gap: 2px; }
.sys .pip { flex: 1; height: 5px; background: #12202b; }
.sys .pip.on { background: var(--green); box-shadow: 0 0 4px rgba(116, 240, 176, 0.3); }
.sys .pwr { text-align: right; color: var(--faint); font-size: 11px; }
.sys button {
  width: 20px;
  height: 18px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}
.sys button:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.sys.dark .abbr { color: var(--faint); }
.sys.dark .pip.on { background: var(--faint); box-shadow: none; }

.queue-mini { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); min-height: 20px; }
.queue-mini .q { display: grid; grid-template-columns: 1fr 42px; gap: 6px; align-items: center; }
.queue-mini .bar { height: 3px; background: #12202b; grid-column: 1 / -1; }
.queue-mini .bar i { display: block; height: 100%; background: var(--cyan); }
.queue-mini .q.waiting { opacity: 0.55; }
.queue-mini .q.waiting .bar i { background: var(--faint); }
.queue-mini .none { color: var(--faint); }

.log { display: flex; flex-direction: column; gap: 3px; font-size: 11px; line-height: 1.5; color: var(--faint); max-height: 100px; overflow: hidden; }
.log .ev { color: var(--muted); }
.log .ev b { color: var(--amber); font-weight: 500; }

.wide-btn {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.16em;
  background: rgba(111, 231, 255, 0.04);
}

/* ---------- skills ---------- */

.disc-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.disc-tabs button {
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 5px 7px;
  color: var(--faint);
  border: 1px solid rgba(111, 231, 255, 0.1);
}
.disc-tabs button.on { color: var(--cyan); border-color: var(--cyan-dim); background: rgba(111, 231, 255, 0.06); }
.disc-tabs button.locked { opacity: 0.38; cursor: not-allowed; }

.tree-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
#treeSvg { display: block; width: 100%; height: auto; min-width: 320px; }
#treeSvg .wire {
  stroke: rgba(111, 231, 255, 0.14);
  stroke-width: 1.4;
  fill: none;
  stroke-dasharray: 2 9;
  animation: wire 7s linear infinite;
}
#treeSvg .wire.live {
  stroke: var(--cyan);
  stroke-dasharray: 3 7;
  animation: wire 2.2s linear infinite;
  filter: drop-shadow(0 0 2px rgba(111, 231, 255, 0.5));
}
#treeSvg .wire.queued { stroke: var(--amber); stroke-dasharray: 2 6; animation: wire 1.4s linear infinite; }
@keyframes wire { to { stroke-dashoffset: -20; } }
#treeSvg .branch-name { fill: var(--ink); font: 15px var(--mono); letter-spacing: 0.03em; }
#treeSvg .branch-stat { fill: var(--faint); font: 12px var(--mono); letter-spacing: 0.03em; }
#treeSvg .node .node-disc { fill: #071018; stroke: rgba(111, 231, 255, 0.2); stroke-width: 1.4; }
#treeSvg .node text { fill: var(--faint); font: 13px var(--mono); text-anchor: middle; dominant-baseline: central; }
#treeSvg .node { cursor: pointer; }
#treeSvg .node.locked .node-disc { stroke: rgba(111, 231, 255, 0.1); }
#treeSvg .node.next .node-disc { stroke: var(--cyan); }
#treeSvg .node.next text { fill: var(--cyan); }
#treeSvg .node.queued .node-disc { stroke: var(--amber); stroke-width: 2; animation: pulse 1.6s ease-in-out infinite; }
#treeSvg .node.queued text { fill: var(--amber); }
#treeSvg .node.achieved .node-disc { fill: var(--cyan); stroke: #f2ffff; stroke-width: 2; filter: drop-shadow(0 0 7px rgba(111, 231, 255, 0.65)); }
#treeSvg .node.achieved text { fill: #04131c; font-weight: 700; }
#treeSvg .node .done-badge { fill: #06121b; stroke: var(--cyan); stroke-width: 1.6; }
#treeSvg .node .done-tick { fill: none; stroke: var(--cyan); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#treeSvg .node.selected .node-disc { stroke: #fff; stroke-width: 2.2; }
#treeSvg .node.familiar .node-disc { filter: drop-shadow(0 0 5px rgba(111, 231, 255, 0.7)); }
/* D77-D80: deep ranks, gates and specializations */
#treeSvg .node.milestone .milestone-ring { fill: none; stroke: rgba(255, 180, 84, 0.45); stroke-width: 1; stroke-dasharray: 3 3; }
#treeSvg .node.achieved.milestone .milestone-ring { stroke: var(--amber); stroke-dasharray: none; }
#treeSvg .node.gated .node-disc { stroke: rgba(255, 180, 84, 0.35); stroke-dasharray: 3 3; }
#treeSvg .lock-badge { fill: #1a1006; stroke: var(--amber); stroke-width: 1.1; }
#treeSvg .lock-loop { fill: none; stroke: var(--amber); stroke-width: 1.1; }
#treeSvg .fold rect { fill: rgba(111, 231, 255, 0.22); stroke: var(--cyan); stroke-width: 1.4; }
#treeSvg .fold text { fill: var(--cyan); font: 12px var(--mono); text-anchor: middle; dominant-baseline: central; }
#treeSvg .tail { fill: var(--faint); font: 12px var(--mono); letter-spacing: 0.04em; }
#treeSvg .gate-chip { font: 11px var(--mono); letter-spacing: 0.02em; }
#treeSvg .gate-chip.unmet { fill: var(--amber); }
#treeSvg .gate-chip.met { fill: var(--green); }
#treeSvg .gate-wire { fill: none; stroke-width: 1.3; }
#treeSvg .gate-wire.unmet { stroke: rgba(255, 180, 84, 0.55); stroke-dasharray: 4 4; }
#treeSvg .gate-wire.met { stroke: rgba(126, 240, 160, 0.6); }
#treeSvg .spec-head path { stroke: rgba(196, 140, 255, 0.4); stroke-width: 1; }
#treeSvg .spec-head text { fill: #c48cff; font: 12px var(--mono); letter-spacing: 0.12em; }
#treeSvg .row-gated { opacity: 0.62; }
#treeSvg .row-locked { opacity: 0.4; }
#treeSvg .beyond { fill: var(--faint); font: 12px var(--mono); letter-spacing: 0.04em; font-style: italic; }
.node-card .gate-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; }
.node-card .gate-list span { color: var(--faint); letter-spacing: 0.12em; width: 100%; }
.node-card .gate-list li.met { color: var(--green); }
.node-card .gate-list li.unmet { color: var(--amber); }
.node-card .spec-box { margin-top: 7px; padding: 6px 8px; border: 1px solid rgba(196, 140, 255, 0.4); font-size: 11px; line-height: 1.5; display: flex; flex-direction: column; gap: 3px; }
.node-card .spec-box b { color: #c48cff; font-weight: 500; letter-spacing: 0.1em; }
.node-card .spec-box span { color: var(--muted); }
.node-card .spec-box.warn { border-color: rgba(255, 180, 84, 0.6); background: rgba(255, 180, 84, 0.06); }
.node-card .spec-box.warn b { color: var(--amber); }
.node-card .spec-box.locked { opacity: 0.7; }
.node-card .spec-box button { align-self: flex-start; margin-top: 3px; border-color: rgba(196, 140, 255, 0.6); color: #c48cff; }
.sf-confirm { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(2, 5, 9, 0.72); padding: 16px; }
.sf-confirm-card { width: min(420px, 100%); background: #07101a; border: 1px solid var(--cyan-dim); padding: 14px 16px; box-shadow: 0 18px 80px rgba(0, 0, 0, 0.7); }
.sf-confirm-card.danger { border-color: rgba(255, 180, 84, 0.7); }
.sf-confirm-card .eyebrow { display: block; color: var(--amber); margin-bottom: 4px; }
.sf-confirm-card h2 { font-size: 15px; font-weight: 500; letter-spacing: 0.06em; }
.sf-confirm-card .warn { margin-top: 8px; font-size: 12px; line-height: 1.55; color: var(--ink); }
.sf-confirm-card .detail { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.sf-confirm-card .actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
.sf-confirm-card button { padding: 9px 12px; font-size: 12px; letter-spacing: 0.12em; border: 1px solid var(--line); color: var(--muted); background: transparent; min-height: 40px; }
.sf-confirm-card button.ok { border-color: var(--amber); color: var(--amber); background: rgba(255, 180, 84, 0.08); }
@keyframes pulse { 50% { opacity: 0.55; } }

.node-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: rgba(9, 19, 29, 0.8);
  padding: 10px 11px;
  min-height: 78px;
}
.node-card .eyebrow { display: block; margin-bottom: 3px; }
.node-card h2 { font-size: 14px; letter-spacing: 0.08em; font-weight: 500; }
.node-card p { margin-top: 4px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.node-card .effect { margin-top: 6px; font-size: 12px; color: var(--cyan); letter-spacing: 0.04em; }
.node-card .actions { margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.node-card button {
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  background: rgba(111, 231, 255, 0.07);
  padding: 6px 9px;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.node-card button:disabled { color: var(--faint); border-color: var(--line); background: transparent; cursor: default; }
.node-card .time { font-size: 11px; color: var(--faint); }

.queue-list { display: flex; flex-direction: column; gap: 5px; }
.queue-row { font-size: 11px; }
.queue-row .top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.queue-row .top b { color: var(--ink); font-weight: 500; }
.queue-row .bar { height: 3px; margin-top: 4px; background: #12202b; }
.queue-row .bar i { display: block; height: 100%; background: var(--green); transition: width 0.2s linear; }
.queue-row.waiting { opacity: 0.55; }
.queue-row.waiting .bar i { background: var(--faint); }
.queue-row.empty { color: var(--faint); }
/* D104: a queued rank can be dropped; the time already spent is lost with it. */
.queue-row .drop {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  font-size: 13px;
  line-height: 1;
  padding: 1px 5px;
  margin-left: 6px;
}
.queue-row .drop:hover { color: var(--red); border-color: var(--red); }
.node-hint { color: var(--faint); font-size: 12px; line-height: 1.45; margin: 8px 0 0; }

/* ---------- full deck ---------- */

.deck-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(2, 5, 9, 0.92);
  backdrop-filter: blur(9px);
}
.deck-overlay[hidden] { display: none; }
/* The deck lesson asks for the crew roster, which owns the bottom of the full deck. Lift the
   non-modal card to the top-left so the target row and its focus tag stay visible. */
#deckOverlay:not([hidden]) ~ #intro { align-items: flex-start; justify-content: flex-start; }
#deckOverlay:not([hidden]) ~ #intro .intro-card {
  width: min(400px, calc(100% - 40px));
  margin-top: calc(var(--hud) + 16px);
  margin-bottom: 0;
}
/* The repair lesson rings a bay inside the deck, not the roster. Put the card on the far side of
   the deck so the bay and its focus tag are not underneath it. */
#deckOverlay:not([hidden]) ~ #intro.deck-focus-right {
  align-items: flex-start;
  justify-content: flex-end;
}
.deck-shell {
  width: min(1120px, calc(96 * var(--vw)));
  /* A definite height gives the stage a real box to fill: with max-height alone the shell is
     content-sized, and an absolutely-filled canvas has nothing left to stretch into. */
  height: calc(94 * var(--vh));
  max-height: calc(94 * var(--vh));
  display: flex;
  flex-direction: column;
  gap: 9px;
  border: 1px solid rgba(111, 231, 255, 0.2);
  background: #060a10;
  padding: 14px;
  box-shadow: 0 24px 100px rgba(0, 0, 0, 0.78);
}
.deck-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.deck-head-actions { display: flex; align-items: center; gap: 5px; }
.deck-tool {
  min-height: 26px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.deck-tool:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.deck-tool.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.55); background: rgba(255, 180, 84, 0.08); }
.deck-tool.off { opacity: 0.62; }
.deck-head h1 { font-size: 16px; letter-spacing: 0.18em; font-weight: 500; margin-top: 2px; }
.deck-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#deckBig {
  display: block;
  /* Fill the stage and let the art fit inside it: sizing the canvas from the viewport width made it
     taller than the space left by a full crew roster, and the stage clipped the top rooms away. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(111, 231, 255, 0.13);
  background: #07080d;
  cursor: pointer;
  touch-action: manipulation;
}
.deck-help { color: var(--muted); font-size: 11px; line-height: 1.5; letter-spacing: 0.03em; }
.crew-watch { min-height: 14px; color: var(--amber); font-size: 11px; line-height: 1.4; letter-spacing: 0.03em; }
.crew-roster.big {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  /* A capped, scrollable roster instead of one that squeezes the deck out of the overlay. */
  max-height: 208px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.crew-roster.big .crew-chip { min-height: 42px; padding: 7px 9px; }
.crew-roster.big .crew-copy b { font-size: 12px; }
.crew-roster.big .crew-copy em { font-size: 11px; }
.crew-roster.big .crew-mastery small { font-size: 11px; }

/* ---------- focus, first-run and fleet ---------- */

body.focusMode #rail { display: none; }
body.focusMode #layout { grid-template-columns: 1fr; }
body.focusMode #treeBtn, body.focusMode #treeBtn2 { display: none; }
body.focusMode #layout { overflow: hidden; }
/* Bedop's first-run card is non-modal. It may cover part of the sector, but it must never hide the
   rail or refuse a control: a child can walk away from the card and keep flying, then come back. */
/* The first-run mark has to be visible while the child is looking straight at the control, so it is a
   hard blink rather than a slow fade: a bright 4px ring, an inset ring inside the control (an ancestor
   can clip the outer outline), and a second ring drawn by ::after. 0.9s on/off stays well under the
   three-flashes-per-second limit. */
.focus-target {
  z-index: 45;
  outline-width: 4px !important;
  outline-style: solid !important;
  outline-color: #ffe08a;
  outline-offset: 4px !important;
  animation: targetPulse 0.9s step-end infinite !important;
}
.focus-target:not(#space) { position: relative; }
/* Outline and ::after do not paint reliably on an SVG <g>, so the branch node gets its own ring. */
#treeSvg .node.focus-target .node-disc {
  stroke: #ffe08a;
  stroke-width: 3.5;
  filter: drop-shadow(0 0 7px rgba(255, 224, 138, 0.95));
  animation: nodeTarget 0.9s step-end infinite;
}
#treeSvg .node.focus-target text { fill: #ffe08a; }
@keyframes nodeTarget {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0.4; }
}
.focus-target:not(#space)::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 2px solid #ffe08a;
  border-radius: inherit;
  pointer-events: none;
  animation: targetRing 0.9s step-end infinite;
}
#space.focus-target {
  outline: none !important;
  box-shadow: inset 0 0 0 4px #ffe08a, inset 0 0 120px rgba(255, 180, 84, 0.16);
  animation: targetGlow 1.1s step-end infinite !important;
}
@keyframes targetPulse {
  0%, 49.9% {
    outline-color: #ffe08a;
    box-shadow: inset 0 0 0 2px #ffe08a, 0 0 0 2px rgba(4, 7, 12, 0.9), 0 0 0 7px rgba(255, 224, 138, 0.55), 0 0 26px rgba(255, 180, 84, 0.5);
  }
  50%, 100% {
    outline-color: rgba(255, 180, 84, 0.12);
    box-shadow: inset 0 0 0 2px rgba(255, 180, 84, 0.12), 0 0 0 2px rgba(4, 7, 12, 0.9), 0 0 0 7px rgba(255, 224, 138, 0.06), 0 0 0 rgba(255, 180, 84, 0);
  }
}
@keyframes targetRing {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes targetGlow {
  0%, 49.9% { box-shadow: inset 0 0 0 4px #ffe08a, inset 0 0 120px rgba(255, 180, 84, 0.16); }
  50%, 100% { box-shadow: inset 0 0 0 4px rgba(255, 180, 84, 0.14), inset 0 0 40px rgba(255, 180, 84, 0.03); }
}
@media (prefers-reduced-motion: reduce) {
  .focus-target, .focus-target::after, #space.focus-target { animation: none !important; }
}

/* D127: the second channel. The ring says "here"; the tag says what it is and which input to use.
   It is placed from #app's rect, so it survives the page zoom (D110) and the phone pane swipe. */
.focus-tag {
  position: absolute;
  z-index: 72;
  transform: translate(-50%, -100%);
  padding: 4px 8px 5px;
  border: 1px solid rgba(255, 224, 138, 0.72);
  background: rgba(5, 11, 18, 0.96);
  color: #ffe08a;
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 0 14px rgba(255, 180, 84, 0.35);
}
.focus-tag[hidden] { display: none; }
.focus-tag.below { transform: translate(-50%, 0); }
.focus-tag.center { transform: translate(-50%, -50%); }
.focus-tag::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  background: inherit;
  border-right: 1px solid rgba(255, 224, 138, 0.72);
  border-bottom: 1px solid rgba(255, 224, 138, 0.72);
  transform: rotate(45deg);
}
.focus-tag.below::after {
  top: -4px;
  bottom: auto;
  transform: rotate(225deg);
}
.focus-tag.center::after { display: none; }
#introShow.stuck {
  color: #ffe08a;
  border-color: rgba(255, 224, 138, 0.75);
  background: rgba(255, 180, 84, 0.12);
}
#introSkip.stuck {
  color: var(--amber);
  border: 1px solid rgba(255, 180, 84, 0.55);
  padding: 6px 9px;
  text-decoration: none;
}
.intro-hint.stuck { color: #ffe08a; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 5, 9, 0.8);
  backdrop-filter: blur(8px);
}
.sheet[hidden] { display: none; }
.sheet-card {
  width: min(520px, 100%);
  max-height: min(calc(88 * var(--vh)), 760px);
  overflow-y: auto;
  border: 1px solid rgba(116, 240, 176, 0.3);
  background: #07110f;
  padding: 20px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(116, 240, 176, 0.06);
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h1 { font-size: 24px; letter-spacing: 0.22em; font-weight: 500; margin-top: 2px; }
.sheet .close { display: block; }
.sheet-copy { margin: 14px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.or { margin: 14px 0 8px; font-size: 11px; letter-spacing: 0.16em; color: var(--faint); text-align: center; }
.big-btn {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(116, 240, 176, 0.45);
  background: rgba(116, 240, 176, 0.1);
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.14em;
}
.big-btn:hover { background: rgba(116, 240, 176, 0.18); }
.ghost-btn {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.link-btn {
  padding: 8px 0;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--amber); }
.join-row { display: flex; gap: 8px; align-items: stretch; }
.join-row .big-btn { flex: 1; }
#fleetCodeInput {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 180, 84, 0.38);
  background: #040a08;
  color: var(--amber);
  font: 18px/1 var(--mono);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
#fleetCodeInput::placeholder { color: var(--faint); letter-spacing: 0.14em; }
#fleetCodeInput:focus { outline: 2px solid var(--amber); outline-offset: 2px; }
.fleet-code { margin: 4px 0 14px; color: var(--amber); font-size: 34px; letter-spacing: 0.3em; line-height: 1.2; }
.fleet-members { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 8px; }
.fleet-member {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.fleet-member.leader { border-color: rgba(255, 180, 84, 0.3); color: var(--ink); }
.fleet-member.you { background: rgba(111, 231, 255, 0.05); }
.fleet-member b { color: var(--ink); font-weight: 500; }
.fleet-member i { font-style: normal; margin-left: 5px; font-size: 11px; letter-spacing: 0.08em; color: var(--cyan); }
.fleet-member em { font-style: normal; font-size: 11px; color: var(--faint); letter-spacing: 0.08em; }
.fleet-member .near { color: var(--green); }
.fleet-rank-action { border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 11px; letter-spacing: 0.1em; padding: 3px 6px; cursor: pointer; }
.fleet-rank-action:hover { border-color: var(--amber); color: var(--amber); }
.fleet-votes { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.fleet-vote { border: 1px solid var(--line); padding: 9px 10px; font-size: 12px; line-height: 1.6; color: var(--muted); letter-spacing: 0.04em; }
.fleet-vote b { color: var(--amber); font-weight: 500; }
.fleet-vote .fleet-vote-actions { display: flex; gap: 6px; margin-top: 6px; }
.fleet-status { margin-top: 12px; font-size: 12px; line-height: 1.5; color: var(--amber); letter-spacing: 0.03em; }
.fleet-status.linked { color: var(--green); }
.fleet-error { margin-top: 12px; color: var(--red); font-size: 12px; line-height: 1.5; }
.fleet-error[hidden] { display: none; }
#replayIntro { display: block; margin-top: 18px; }

/* The first-use choice is a notification, not a modal: it never covers the whole screen, and the
   X settles on text. The same choice is always available from the VOICE toggle on each Bedop card. */
.voice-prompt {
  position: fixed;
  z-index: 74;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, calc(100vw - 24px));
  padding: 10px 12px 11px;
  border: 1px solid rgba(255, 180, 84, 0.5);
  border-left: 3px solid var(--amber);
  background: linear-gradient(180deg, rgba(24, 19, 14, 0.97), rgba(5, 11, 18, 0.96));
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 24px rgba(255, 180, 84, 0.1);
  pointer-events: auto;
}
.voice-prompt[hidden] { display: none; }
.voice-prompt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.voice-prompt-top span { color: var(--amber); font-size: 11px; letter-spacing: 0.18em; }
.voice-prompt-close { width: 28px; height: 28px; color: var(--faint); font-size: 17px; line-height: 1; }
.voice-prompt-close:hover { color: var(--ink); }
#voicePromptTitle { margin-top: 4px; color: var(--ink); font-size: 15px; line-height: 1.35; }
.voice-prompt-copy { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.voice-prompt-actions { display: flex; gap: 7px; margin-top: 9px; }
.voice-prompt-choice {
  min-height: 36px;
  flex: 1;
  padding: 6px 8px;
  border: 1px solid rgba(255, 180, 84, 0.6);
  background: rgba(255, 180, 84, 0.1);
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.voice-prompt-choice:hover { background: rgba(255, 180, 84, 0.18); }
.voice-prompt-choice.quiet { color: var(--muted); border-color: var(--line); background: transparent; }
.voice-prompt-choice.quiet:hover { color: var(--ink); }

.intro {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.intro[hidden] { display: none; }
.intro-card {
  width: min(660px, 100%);
  pointer-events: auto;
  cursor: pointer;
  margin-bottom: 96px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 180, 84, 0.42);
  background: rgba(5, 11, 18, 0.96);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 180, 84, 0.06);
}
.intro-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.intro-top #introStep { color: var(--amber); font-size: 11px; letter-spacing: 0.12em; }
#introText { color: var(--ink); font-size: 17px; line-height: 1.55; letter-spacing: 0.01em; }
.intro-hint { min-height: 16px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
/* Voice mode is a rolling window: the whole lesson is still in the DOM, but only the active words
   stay in view. The lit word follows the browser's speech boundary, not a second clock. */
.voice-copy { max-height: 4.8em; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; scroll-behavior: smooth; }
.voice-copy::-webkit-scrollbar { display: none; }
.voice-word { border-radius: 2px; transition: background 0.12s ease, color 0.12s ease; }
.voice-word.on { background: rgba(255, 180, 84, 0.34); color: #fff5dc; box-shadow: 0 0 9px rgba(255, 180, 84, 0.35); }
.intro-card .voice-copy { max-height: 4.8em; }
.coach .voice-copy { max-height: 4.4em; }
.intro-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.intro-actions .big-btn { flex: 1; min-width: 150px; background: rgba(255, 180, 84, 0.12); border-color: rgba(255, 180, 84, 0.5); color: var(--amber); }
.intro-actions .ghost-btn { min-width: 110px; }
.intro-actions .link-btn { margin-left: auto; }
.intro-dots { display: flex; gap: 5px; margin-top: 14px; }
.intro-dots i { width: 6px; height: 6px; border-radius: 50%; background: #1a2c38; }
.intro-dots i.done { background: var(--cyan); }
.intro-dots i.on { background: var(--amber); box-shadow: 0 0 8px rgba(255, 180, 84, 0.6); }
/* The HAUL desk (D97) opens in the same bottom-left lane as Bedop's first-run card. The card is
   non-modal and yields the lane while the desk is open — lifted to the top-left, as it does for the
   deck lesson — and comes back when the desk closes, so the two panels never interleave. */
body:has(#haulTray:not([hidden])) #intro { align-items: flex-start; justify-content: flex-start; }
body:has(#haulTray:not([hidden])) #intro .intro-card {
  width: min(420px, calc(100% - 40px));
  margin-top: calc(var(--hud) + 12px);
  margin-bottom: 0;
}

/* Narrow desktop: the sector is too tight for a three-column top row, so the coach becomes a
   horizontal strip below the minimap instead of between the speed and radar controls. */
@media (min-width: 880px) and (max-width: 1100px) {
  .coach { top: 164px; left: 12px; right: 12px; width: auto; transform: none; }
  .hail { top: auto; left: 12px; right: auto; bottom: 96px; width: min(400px, calc(100% - 24px)); max-height: calc(34 * var(--vh)); }
  .coach.coach-in { animation: coach-in-narrow 0.32s ease-out; }
}
@keyframes coach-in-narrow {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .coach, .coach.coach-in { animation: none; }
  .coach-dot { animation: none; }
}

/* ---------- mobile ---------- */

.dots { display: none; }
.close { display: none; border: 1px solid var(--line); width: 28px; height: 28px; color: var(--muted); font-size: 16px; line-height: 1; }

@media (pointer: coarse), (max-width: 879px) {
  :root { --hud: 44px; }
  #hud { gap: 9px; padding: 0 10px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #hud::-webkit-scrollbar { display: none; }
  #hud > * { flex-shrink: 0; }
  .brand { font-size: 13px; letter-spacing: 0.18em; }
  .brand span { display: none; }
  .pilot { gap: 5px; }
  .pilot b { font-size: 12px; }
  .pilot span { font-size: 11px; }
  .hullbar { width: 58px; height: 8px; }
  #hullText { font-size: 11px; min-width: 44px; }
  .hull-sym { width: 16px; height: 16px; }
  .hull-sym svg { width: 10px; height: 10px; }
  .scrap-hud { gap: 3px; padding: 4px 5px; font-size: 11px; }
  .scrap-hud b { font-size: 12px; }
  .hud-btn { display: none; }
  #fleetBtn, #focusBtn, #commsBtn, #cargoBtn, #outfitBtn, #hireBtn, #mineBtn {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    min-height: 32px;
    font-size: 11px;
    letter-spacing: 0.08em;
  }
  #fleetBtn kbd, #focusBtn kbd, #commsBtn kbd, #cargoBtn kbd, #outfitBtn kbd, #hireBtn kbd, #mineBtn kbd { display: none; }
  /* D217: the flare is a new top-lane control, kept out of the MINE whitelist rule above. */
  #flareBtn {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    min-height: 32px;
    font-size: 11px;
    letter-spacing: 0.08em;
  }
  #flareBtn kbd { display: none; }
  #fleetChip { display: none !important; }
  .net { font-size: 12px; }

  #layout {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  /* One animator while a pane settles: JS owns the glide, the browser's snap stays out of it. */
  #layout.pane-glide { scroll-snap-type: none; }
  #layout::-webkit-scrollbar { display: none; }
  #spacePane { flex: 0 0 100%; scroll-snap-align: start; }
  #rail { display: contents; }
  .railPane {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-align: start;
    border-left: 0;
    border-top: 0;
    padding: 14px 16px 96px;
    background: var(--bg-2);
  }
  #skillsPane { display: block; }
  .close { display: none; }

  /* The flight stack stops before the minimap: a long pacing line must not grow the column under the
     radar. Buttons wrap rather than push the stack into it. */
  .space-top { top: 10px; left: 12px; right: 148px; gap: 7px; }
  .readout { font-size: 18px; }
  .objective-chip { max-width: 100%; }
  .throttle { flex-wrap: wrap; }
  .throttle button { min-height: 32px; padding: 6px 9px; font-size: 12px; letter-spacing: 0.04em; }
  .focus-tag { font-size: 12px; padding: 5px 9px; }
  .track-chip { min-height: 28px; font-size: 11px; }
  .course-resume { min-height: 32px; max-width: 226px; font-size: 11px; }
  .minimap { top: 10px; right: 10px; padding: 5px; min-width: 98px; min-height: 98px; }
  .minimap canvas { width: 88px; height: 88px; }
  .minimap span { font-size: 10px; }
  .quad-banner { top: 86px; padding: 6px 12px 7px; }
  .quad-banner b { font-size: 13px; }
  .radar-overlay { align-items: flex-start; padding: 8px; overflow-y: auto; }
  .radar-panel { max-height: none; margin: 0; width: 100%; }
  .radar-head { padding: 12px 12px 9px; }
  .radar-head h1 { font-size: 20px; }
  .radar-body { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 18px; overflow: visible; }
  .radar-map canvas { max-height: calc(42 * var(--vh)); }
  .radar-side { overflow: visible; }
  .radar-list { max-height: none; }
  .radar-action { min-height: 48px; }
  .radar-row { min-height: 52px; }
  .radar-help { font-size: 12px; }
  .radar-overlay.is-open .radar-panel { animation: none; }
  /* Phone cards get their own lane under the flight stack, never on top of the throttle or radar. The
     lane ends above the weapon rack, whose measured height is --rack-h (set by renderWeapons). */
  .coach {
    top: 340px; left: 12px; right: 12px; width: auto; transform: none;
    max-height: calc(100% - 426px - var(--rack-h, 96px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
  }
  .hail {
    top: auto; left: 12px; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    width: auto; max-height: min(calc(42 * var(--vh)), calc(100% - 148px - env(safe-area-inset-bottom, 0px))); transform: none;
  }
  .hail.is-min { width: auto; }
  .coach.coach-in { animation: coach-in-narrow 0.32s ease-out; }
  .coach-close, .hail-close, .hail-min, .move-min { width: 44px; height: 44px; min-width: 44px; min-height: 44px; margin: 0; }
  .move-min { padding: 0; font-size: 11px; }
  .coach-action, .coach-later, .hail-action { min-height: 44px; }
  .refit-row { min-height: 40px; }
  .refit-row b { font-size: 12px; }
  .refit-row em { font-size: 11px; }
  .diag { display: none; }
  /* The rack sits above the notice/HAUL bar, and every card that used to share its strip is measured
     from the rack's own height so a third or fourth mount cannot grow back over it. */
  .weapon-rack { left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); width: auto; }
  .weapon-rack-head { font-size: 10px; }
  .weapon-target-row { grid-template-columns: auto 34px minmax(0, 1fr) 34px 48px 34px; }
  .weapon-target-row button { min-height: 34px; }
  .weapon-target-pick { font-size: 11px; }
  .weapon-card { min-height: 92px; }
  .weapon-fire { min-height: 58px; padding: 5px 6px; }
  body.focusMode .weapon-rack { bottom: calc(148px + env(safe-area-inset-bottom, 0px)); }
  .move-panel { left: 12px; right: 12px; bottom: calc(78px + var(--rack-h, 96px) + 18px + env(safe-area-inset-bottom, 0px)); width: auto; padding: 8px 9px 7px; }
  .move-panel.is-min { left: 12px; right: auto; width: min(230px, calc(100% - 24px)); padding: 6px 7px; }
  .move-hint { margin: 4px 0 6px; font-size: 11px; }
  .move-choice { min-height: 54px; padding: 6px; }
  .move-choice b { font-size: 12px; }
  body.focusMode .move-panel { bottom: calc(148px + var(--rack-h, 96px) + 18px + env(safe-area-inset-bottom, 0px)); }
  .intro-card { margin-bottom: 150px; }
  .toasts { top: 108px; width: 90%; bottom: calc(78px + var(--rack-h, 96px) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 15; }
  body.focusMode .toasts { bottom: calc(148px + var(--rack-h, 96px) + 16px + env(safe-area-inset-bottom, 0px)); }
  .radio-toast {
    top: 340px; left: 12px; right: 12px; width: auto; transform: none;
    max-height: calc(100% - 426px - var(--rack-h, 96px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto; pointer-events: auto; z-index: 29;
  }
  body.focusMode .coach, body.focusMode .radio-toast {
    max-height: calc(100% - 496px - var(--rack-h, 96px) - env(safe-area-inset-bottom, 0px));
  }
  .notice-bar, .haul-bar { bottom: calc(38px + env(safe-area-inset-bottom, 0px)); }
  .haul-bar { left: auto; right: 12px; align-items: flex-end; }
  body.radio-live .move-panel { visibility: hidden; }
  /* The flight plan is the player's own request, and a cue that arrives while it is open waits too. */
  #spacePane:has(.move-panel:not([hidden])) #coach { visibility: hidden; }
  .destroyed b { font-size: 20px; }

  .dots {
    display: flex;
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    gap: 8px;
    z-index: 35;
    padding: 5px 8px;
    background: rgba(4, 7, 12, 0.72);
    border: 1px solid var(--line);
    border-radius: 20px;
  }
  .dots button {
    position: relative;
    width: 26px;
    height: 22px;
    border-radius: 50%;
    background: transparent;
    padding: 0;
  }
  .dots button::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: var(--faint);
  }
  .dots button.on::after { background: var(--cyan); box-shadow: 0 0 7px rgba(111, 231, 255, 0.7); }

  .focus-bar { left: 12px; bottom: 112px; transform: none; font-size: 11px; padding: 7px 9px; gap: 7px; }
  body.focusMode .railPane { display: none; }
  body.focusMode #layout { display: block; }
  body.focusMode #dots { display: none; }
  body.focusMode #spacePane { flex: none; width: 100%; height: 100%; }

  .intro { padding: 10px; }
  .crew-call { top: calc(var(--hud) + 164px); right: 12px; max-width: 202px; padding: 7px; }
  .crew-call-copy em { font-size: 10px; }
  .deck-head-actions { gap: 4px; }
  .deck-tool { padding: 4px 5px; font-size: 10px; }
  /* The mobile `.close { display: none }` rule hid the deck's only exit: the backdrop is 7 px wide
     here. 36 px is the largest × that still shares a tool row; 44 px forced a fourth row and cost the
     deck plan 48 px of height. The plan itself also dismisses on a fit-zoom swipe. */
  .deck-head .close { display: block; min-width: 36px; min-height: 36px; font-size: 18px; }
  .crew-watch { font-size: 11px; }
  .intro-card { padding: 14px; margin-bottom: 116px; }
  #introText { font-size: 15px; line-height: 1.5; }
  .intro-hint { font-size: 11px; }
  .intro-actions { gap: 7px; margin-top: 10px; }
  .intro-actions .big-btn { min-width: 120px; }
  .intro-actions .ghost-btn { min-width: 86px; }
  .intro-dots { margin-top: 10px; }

  .sheet { padding: 10px; }
  .sheet-card { padding: 16px; max-height: calc(calc(100 * var(--vh)) - 20px); }
  .sheet-head h1 { font-size: 20px; }
  .sheet-copy { font-size: 12px; }
  .fleet-code { font-size: 28px; }

  #deck { max-height: none; }
  .pane-actions { gap: 4px; }
  .deck-open { font-size: 10px; padding: 4px 5px; }
  .pane-tool-menu { flex: 1 0 100%; }
  .pane-tool-menu > summary, .pane-tool-items .deck-open { min-height: 44px; }
  .pane-tool-items { position: static; width: min(250px, 100%); padding: 5px 0 0; box-shadow: none; }
  .deck-overlay { padding: 7px; }
  .deck-shell { padding: 10px; height: calc(97 * var(--vh)); max-height: calc(97 * var(--vh)); }
  .crew-roster.big { grid-template-columns: 1fr; }
  .crew-chip { min-height: 44px; padding: 7px; grid-template-columns: 9px minmax(0, 1fr) 32px; }
  .crew-copy b { font-size: 12px; }
  .crew-copy em { font-size: 11px; }
  .deck-hint { font-size: 11px; }
  #treeSvg { min-width: 0; }
  .node-card { position: sticky; bottom: 0; background: rgba(5, 11, 18, 0.97); }
  .sys { grid-template-columns: 54px 1fr 40px 32px 32px; padding: 6px 2px; }
  .sys button { width: 30px; height: 28px; font-size: 15px; }
  .sys .abbr { font-size: 12px; }
  .zen-only { display: none; }
}

/* A short phone cannot fit both the card lane and a weapon rack. The card wins the lane for its short
   life and the rack yields, rather than being drawn underneath a scrolling card. */
@media (max-height: 700px) and (pointer: coarse), (max-height: 700px) and (max-width: 879px) {
  .coach, .radio-toast {
    max-height: max(96px, calc(100% - 426px - var(--rack-h, 96px) - env(safe-area-inset-bottom, 0px)));
  }
  #spacePane:has(#coach:not([hidden])) .weapon-rack,
  body.radio-live .weapon-rack { visibility: hidden; }
}

@media (min-width: 880px) and (pointer: fine) {
  .intro { justify-content: flex-start; }
  .intro-card { width: min(480px, calc(46 * var(--vw))); }
  #skillsPane {
    position: fixed;
    top: calc(var(--hud) + 12px);
    right: 12px;
    bottom: 12px;
    width: min(850px, calc(calc(100 * var(--vw)) - 390px));
    z-index: 30;
    background: #07101a;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow-y: auto;
    transform: translateX(calc(100% + 30px));
    transition: transform 0.22s ease;
    box-shadow: 0 18px 80px rgba(0, 0, 0, 0.6);
    padding-bottom: 40px;
  }
  body.treeOpen #skillsPane { transform: none; }
  /* The skills sheet owns the right lane. Narrow the intro card to the free lane on the left so
     neither the card nor its SHOW ME button sits on top of the tabs, tree or node card. */
  body.treeOpen .intro-card {
    width: min(340px, calc(calc(100 * var(--vw)) - 430px));
    padding: 14px 16px;
  }
  body.treeOpen #introText { font-size: 15px; }
  .starwell-wrap { height: min(520px, calc(calc(100 * var(--vh)) - 400px)); }
  .close { display: block; }
  #treeSvg { min-width: 620px; }
  .zen-only { display: block; }
}

@media (max-width: 420px) {
  .hullbar { width: 44px; }
  .hull-sym { width: 15px; height: 15px; }
  .pilot span { display: none; }
  .scrap-label { display: none; }
  .minimap canvas { width: 74px; height: 74px; }
}


/* ---------- generated art: crew faces, pacing chip, unpowered guns (D45–D48) ---------- */

.crew-face {
  width: 24px;
  height: 26px;
  image-rendering: pixelated;
  border: 1px solid var(--crew-accent, var(--line));
  background: #0b1824;
}
.crew-chip { grid-template-columns: 26px minmax(0, 1fr) 26px; }
.crew-copy b .crew-person { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

.pacing-chip {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 7px;
  max-width: 260px;
  padding: 4px 8px 6px;
  border: 1px solid rgba(111, 231, 255, 0.14);
  background: rgba(4, 7, 12, 0.66);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  overflow: hidden;
}
.pacing-chip[hidden] { display: none; }
.pacing-chip b { font-weight: 600; color: var(--cyan); }
.pacing-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pacing-chip i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.6;
  transition: width 0.25s linear;
}
.pacing-chip.beat-calm b { color: var(--green); }
.pacing-chip.beat-buildup { border-color: rgba(176, 160, 255, 0.4); color: #c9c0ff; }
.pacing-chip.beat-buildup b { color: #c9c0ff; animation: pacing-pulse 1.2s ease-in-out infinite; }
.pacing-chip.beat-encounter b { color: var(--amber); }
.pacing-chip.beat-encounter.hostile { border-color: rgba(255, 96, 96, 0.4); }
.pacing-chip.beat-encounter.hostile b { color: var(--red); }
.pacing-chip.beat-recovery b { color: var(--cyan); }
@keyframes pacing-pulse { 50% { opacity: 0.45; } }

/* The current lesson, repeated in the sector where the pilot is already looking. The in-world ring
   carries the same amber language to a target that has a position; this line covers the steps that
   live in a panel, so the next action never disappears behind the tutorial card. */
.objective-chip {
  display: inline-flex;
  align-self: flex-start;
  align-items: baseline;
  gap: 6px;
  max-width: 260px;
  min-width: 0;
  padding: 4px 8px 5px;
  border: 1px solid rgba(255, 180, 84, 0.36);
  border-left: 2px solid var(--amber);
  background: rgba(4, 7, 12, 0.76);
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.1em;
  pointer-events: none;
}
.objective-chip[hidden] { display: none; }
.objective-chip span { flex: 0 0 auto; color: var(--faint); font-size: 10px; }
.objective-chip b {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.objective-chip.pulse { animation: objective-pulse 0.42s ease-out; }
@keyframes objective-pulse {
  0% { opacity: 0.35; transform: translateX(-4px); box-shadow: 0 0 0 rgba(255, 180, 84, 0); }
  45% { opacity: 1; box-shadow: 0 0 16px rgba(255, 180, 84, 0.24); }
  100% { opacity: 1; transform: none; box-shadow: 0 0 0 rgba(255, 180, 84, 0); }
}

/* D215: the meteor warning is a standing alarm, not a toast. It carries the server's own pass
   solution and never ticks a countdown on the client. */
.meteor-warning {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 2px 8px;
  max-width: 300px;
  padding: 6px 10px 7px;
  border: 1px solid rgba(255, 96, 80, 0.7);
  border-left: 3px solid var(--red);
  background:
    repeating-linear-gradient(-45deg, rgba(255, 96, 80, 0.08) 0 6px, transparent 6px 14px),
    rgba(18, 6, 8, 0.82);
  color: #ffb0a8;
  font-size: 11px;
  letter-spacing: 0.12em;
  pointer-events: none;
  animation: meteor-warning 1.25s steps(2, end) infinite;
}
.meteor-warning[hidden] { display: none; }
.meteor-warning .meteor-warning-tag { color: var(--red); font-size: 11px; letter-spacing: 0.18em; }
.meteor-warning b { color: #ff7a66; font-size: 15px; line-height: 1; letter-spacing: 0.04em; }
.meteor-warning em { grid-column: 1 / -1; color: #ffb0a8; font-size: 11px; font-style: normal; letter-spacing: 0.1em; }
@keyframes meteor-warning {
  50% { border-color: rgba(255, 180, 84, 0.9); box-shadow: 0 0 18px rgba(255, 70, 60, 0.18); }
}

/* D217: a warning flare is a local answer, not a storm. The strip names the sender and the share of
   the answer the server classified; a hostile answer takes the red alarm language. */
.flare-warning {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 2px 8px;
  max-width: 300px;
  padding: 6px 10px 7px;
  border: 1px solid rgba(255, 180, 84, 0.6);
  border-left: 3px solid var(--amber);
  background: rgba(18, 12, 6, 0.82);
  color: #ffd0a0;
  font-size: 11px;
  letter-spacing: 0.12em;
  pointer-events: none;
}
.flare-warning[hidden] { display: none; }
.flare-warning .flare-warning-tag { color: var(--amber); font-size: 11px; letter-spacing: 0.18em; }
.flare-warning b { color: #ffdca8; font-size: 14px; line-height: 1; letter-spacing: 0.04em; }
.flare-warning em { grid-column: 1 / -1; color: #ffd0a0; font-size: 11px; font-style: normal; letter-spacing: 0.1em; }
.flare-warning[data-mood="hostile"] {
  border-color: rgba(255, 96, 80, 0.7);
  border-left-color: var(--red);
  color: #ffb0a8;
  animation: meteor-warning 1.25s steps(2, end) infinite;
}
.flare-warning[data-mood="hostile"] .flare-warning-tag,
.flare-warning[data-mood="hostile"] b { color: #ff7a66; }
.flare-warning[data-mood="peace"] {
  border-color: rgba(116, 240, 176, 0.45);
  border-left-color: var(--green);
  color: #b8f7d4;
}
.flare-warning[data-mood="peace"] .flare-warning-tag,
.flare-warning[data-mood="peace"] b { color: var(--green); }

.weapon-card.unpowered { opacity: 0.6; border-color: rgba(126, 152, 166, 0.3); }
.weapon-card.unpowered .weapon-state { color: var(--muted); }
.weapon-card.unpowered .weapon-charge i { background: var(--faint); box-shadow: none; }

/* ---------- shipyard / crew locker ---------- */

.yard-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(2, 5, 9, 0.84);
  backdrop-filter: blur(8px);
}
.yard-overlay[hidden] { display: none; }
.yard-panel {
  display: flex;
  flex-direction: column;
  width: min(1040px, 100%);
  height: min(calc(92 * var(--vh)), 780px);
  border: 1px solid rgba(111, 231, 255, 0.32);
  background: #061018;
  box-shadow: 0 24px 90px rgba(1, 2, 4, 0.8);
  overflow: hidden;
}
.yard-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.yard-head h1 { margin: 2px 0 0; font-size: 15px; letter-spacing: 0.18em; font-weight: 600; }
.yard-head .eyebrow { font-size: 11px; letter-spacing: 0.2em; color: var(--muted); }
.yard-tabs { display: flex; gap: 4px; margin-left: auto; }
.yard-head .close { display: block; min-width: 40px; min-height: 40px; }
.yard-tabs button, .yard-seg button {
  min-height: 40px;
  min-width: 74px;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(8, 17, 27, 0.8);
}
.yard-tabs button.on, .yard-seg button.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.5); background: rgba(255, 180, 84, 0.08); }
.yard-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}
.yard-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  min-height: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 38%, rgba(111, 231, 255, 0.07), transparent 60%),
    repeating-linear-gradient(0deg, rgba(111, 231, 255, 0.03) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(111, 231, 255, 0.03) 0 1px, transparent 1px 24px);
}
.yard-preview { width: 100%; height: 340px; flex: 0 0 auto; display: block; }
.yard-meta { display: flex; flex-direction: column; gap: 3px; text-align: center; }
.yard-meta b { font-size: 15px; letter-spacing: 0.16em; color: var(--ink); font-weight: 600; }
.yard-meta span { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.yard-name { display: flex; align-items: center; justify-content: center; gap: 8px; }
.yard-name > span { flex: 0 0 auto; font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.yard-name input {
  width: min(260px, 62%);
  min-width: 0;
  min-height: 38px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--ink);
  background: rgba(8, 17, 27, 0.9);
  border: 1px solid var(--line);
}
.yard-name input:focus { outline: none; border-color: rgba(111, 231, 255, 0.55); box-shadow: 0 0 0 1px rgba(111, 231, 255, 0.18); }
.yard-name input::placeholder { color: var(--faint); letter-spacing: 0.08em; }
.yard-palette-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(111, 231, 255, 0.08);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.yard-palette-head span { color: var(--faint); }
.yard-palettes { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 5px; }
.yard-palette {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 5px 7px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(8, 17, 27, 0.8);
}
.yard-palette i {
  width: 26px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: linear-gradient(135deg, var(--hull) 0 46%, var(--wing) 46% 72%, var(--accent) 72%);
}
.yard-palette span { font-size: 11px; line-height: 1.2; letter-spacing: 0.1em; color: var(--muted); }
.yard-palette.on { border-color: rgba(255, 180, 84, 0.55); background: rgba(255, 180, 84, 0.07); }
.yard-palette.on span { color: var(--amber); }
.yard-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.yard-btn {
  min-height: 44px;
  min-width: 104px;
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(8, 17, 27, 0.9);
}
.yard-btn kbd { font-size: 11px; color: var(--faint); margin-left: 4px; }
.yard-btn.primary { color: var(--cyan); border-color: rgba(111, 231, 255, 0.45); }
.yard-btn.apply { color: var(--green); border-color: rgba(116, 240, 176, 0.5); }
.yard-btn:disabled { opacity: 0.35; }
.yard-note, .yard-rule { margin: 0; font-size: 11px; letter-spacing: 0.1em; text-align: center; color: var(--muted); }
.yard-rule { color: var(--amber); }
.yard-history { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.yard-thumb {
  width: 48px;
  height: 56px;
  padding: 3px;
  border: 1px solid var(--line);
  background: rgba(8, 17, 27, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.yard-thumb img { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.yard-parts {
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding: 8px 10px 14px;
  -webkit-overflow-scrolling: touch;
}
.yard-row {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) 40px minmax(96px, 1.4fr) 40px 66px;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(111, 231, 255, 0.06);
}
.yard-axis { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.yard-value { font-size: 12px; letter-spacing: 0.08em; text-align: center; font-weight: 500; color: var(--ink); }
.yard-row.locked .yard-value { color: var(--amber); }
.yard-row.blocked .yard-value { color: var(--amber); }
.yard-cycle {
  min-height: 40px;
  font-size: 18px;
  color: var(--cyan);
  border: 1px solid var(--line);
  background: rgba(8, 17, 27, 0.9);
}
.yard-cycle-spacer { display: block; }
.yard-lock {
  min-height: 40px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--faint);
  border: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.yard-lock.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.45); background: rgba(255, 180, 84, 0.07); }
.yard-crew-pick { display: flex; gap: 8px; justify-content: center; }
.yard-crew {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 76px;
  min-height: 44px;
  padding: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(8, 17, 27, 0.85);
}
.yard-crew img { width: 48px; height: 52px; image-rendering: pixelated; }
.yard-crew.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.5); }
.yard-person { display: flex; align-items: flex-end; justify-content: center; gap: 18px; padding: 8px 0; }
.yard-person .yard-fullbody { width: 192px; height: 288px; image-rendering: pixelated; }
.yard-person .yard-face { width: 120px; height: 130px; image-rendering: pixelated; border: 1px solid var(--line); background: #0b1824; }
.yard-empty { padding: 30px; color: var(--muted); font-size: 12px; }

.yard-body:has(.yard-gallery) { display: flex; flex-direction: column; }
.yard-gallery-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.yard-seg { display: flex; gap: 4px; }
.yard-gallery {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding: 12px 14px;
}
.yard-gallery.crew { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.yard-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid rgba(111, 231, 255, 0.12);
  background: rgba(8, 17, 27, 0.75);
}
.yard-card-art { height: 150px; display: flex; align-items: center; justify-content: center; }
.yard-gallery.crew .yard-card-art { height: 148px; }
.yard-card-art img { image-rendering: pixelated; max-height: 146px; }
.yard-gallery.crew .yard-card-art img { width: 96px; height: 144px; }
.yard-card b { font-size: 11px; letter-spacing: 0.14em; color: var(--ink); font-weight: 500; }
.yard-card em { font-style: normal; font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-align: center; }

@media (pointer: coarse), (max-width: 879px) {
  .yard-overlay { padding: 0; align-items: stretch; }
  .yard-panel { height: 100%; width: 100%; border: 0; }
  .yard-head { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .yard-tabs { order: 3; width: 100%; margin: 0; }
  .yard-head > div:first-child { flex: 1; }
  .yard-head .close { order: 2; min-width: 44px; min-height: 44px; }
  .yard-tabs button { flex: 1; min-height: 44px; }
  .yard-body { display: flex; flex-direction: column; overflow-y: auto; }
  .yard-stage { overflow: visible; padding: 10px; flex: 0 0 auto; }
  .yard-preview { height: 220px; }
  .yard-parts { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .yard-row { grid-template-columns: minmax(70px, 1fr) 44px minmax(84px, 1.3fr) 44px 62px; }
  .yard-cycle, .yard-lock { min-height: 44px; }
  .yard-person .yard-fullbody { width: 128px; height: 192px; }
  .yard-person .yard-face { width: 96px; height: 104px; }
  .yard-gallery { overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yard-gallery.crew { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .yard-gallery.crew .yard-card-art img { width: 64px; height: 96px; }
  .yard-gallery.crew .yard-card-art { height: 100px; }
}

/* ---------- pixel sci-fi skin (D52) ----------
   Beveled, chamfered panels in the spirit of a pixel cockpit: a 1px light top-left edge, a dark
   bottom-right edge, a 6px clipped corner, and hard (never blurred) shadows. No webfont download:
   the system monospace, upper-cased with tracking, reads crisp at every size. Every control is a
   real button with a visible pressed state, so nothing depends on hover. */
:root {
  --bevel-hi: rgba(170, 230, 255, 0.16);
  --bevel-lo: rgba(0, 0, 0, 0.7);
  --plate: #0a1520;
  --plate-2: #0d1b28;
  --rivet: rgba(111, 231, 255, 0.28);
  --chamfer: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  --chamfer-s: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

#hud::-webkit-scrollbar { display: none; }

#hud {
  background:
    linear-gradient(180deg, rgba(22, 40, 56, 0.96) 0, rgba(8, 15, 23, 0.97) 60%, rgba(5, 9, 14, 0.98) 100%);
  border-bottom: 2px solid #0f2433;
  box-shadow: inset 0 1px 0 var(--bevel-hi), 0 2px 0 rgba(0, 0, 0, 0.6), 0 3px 0 rgba(111, 231, 255, 0.08);
  backdrop-filter: none;
}

.hud-btn, .deck-open, .wide-btn, .big-btn, .ghost-btn, .throttle button, .zoom-ctl button, .chip, .deck-tool, .radar-action, .comms-ptt, .comms-ch {
  clip-path: var(--chamfer-s);
  background: linear-gradient(180deg, var(--plate-2), var(--plate));
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo);
  text-transform: uppercase;
  image-rendering: pixelated;
}
.hud-btn:active, .deck-open:active, .wide-btn:active, .big-btn:active, .ghost-btn:active,
.throttle button:active, .zoom-ctl button:active, .deck-tool:active, .radar-action:active {
  box-shadow: inset 1px 1px 0 var(--bevel-lo), inset -1px -1px 0 var(--bevel-hi);
  transform: translateY(1px);
}
.throttle button.on, .hud-btn.on {
  background: linear-gradient(180deg, rgba(255, 180, 84, 0.22), rgba(255, 180, 84, 0.07));
  box-shadow: inset 1px 1px 0 rgba(255, 220, 160, 0.35), inset -1px -1px 0 var(--bevel-lo);
}

.railPane {
  background:
    linear-gradient(90deg, rgba(111, 231, 255, 0.05) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(0deg, rgba(111, 231, 255, 0.035) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(180deg, #08121c, #050a10);
  box-shadow: inset 2px 0 0 #0f2433, inset 3px 0 0 rgba(0, 0, 0, 0.7);
}

.weapon-card, .contract, .coach, .minimap, .readout, .crew-roster > *, .move-panel, .sheet-card, .radar-panel, .yard-panel, .track-chip, .course-resume, .comms-card, .comms-tx, .cargo-card, .cargo-row, .crew-route, .crew-post, .loot-sheet, .hire-card, .hire-row, .board-card, .board-ready {
  clip-path: var(--chamfer);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo), inset 0 0 0 2px rgba(0, 0, 0, 0.25);
}
.weapon-card, .minimap, .coach { background-color: rgba(6, 12, 19, 0.9); }

.section-head {
  position: relative;
  padding-left: 12px;
  text-transform: uppercase;
}
.section-head::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  background: var(--cyan);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

#deck, #deckBig {
  image-rendering: pixelated;
  border: 2px solid #0f2433;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(111, 231, 255, 0.12);
}

#space { image-rendering: pixelated; }

/* Zoom chips: on the sector, under the minimap. Big enough for a thumb; tap the % to reset. */
.zoom-ctl {
  position: absolute;
  top: 204px;
  right: 14px;
  display: flex;
  gap: 3px;
  z-index: 6;
}
.zoom-ctl button {
  min-width: 34px;
  height: 30px;
  padding: 0 6px;
  color: var(--cyan);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.zoom-ctl button[data-zoom="reset"] { min-width: 52px; font-size: 12px; color: var(--muted); }

@media (pointer: coarse), (max-width: 879px) {
  .zoom-ctl { top: auto; bottom: 186px; right: 10px; flex-direction: column-reverse; }
  .zoom-ctl button { min-width: 40px; height: 36px; }
  .zoom-ctl button[data-zoom="reset"] { min-width: 40px; height: 26px; }
}

/* Door bulk controls (D54): QUEUE, SHUT ALL and OPEN ALL share one compact row in the side deck.
   The full deck's header is also one scrolling row; wrapping it into three rows ate the plan. */
.deck-doors-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}
.deck-doors-bar .deck-tool {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
}
#deckQueueMini { margin-right: auto; }
.deck-head-actions {
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.deck-head-actions::-webkit-scrollbar { display: none; }
@media (pointer: coarse), (max-width: 879px) {
  .deck-doors-bar .deck-tool { min-height: 36px; padding: 4px 5px; font-size: 12px; }
  .deck-head-actions .deck-tool { min-height: 40px; }
}

.move-size-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.move-radius {
  width: 100%;
  accent-color: var(--amber);
  cursor: pointer;
}


/* ---------- delayed radio panel (D56) ---------- */
#commsBtn, #commsBtn2 { position: relative; }
#commsBtn.has-mail::after, #commsBtn2.has-mail::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  background: var(--amber);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.comms-overlay { z-index: 85; }
.comms-card {
  width: min(560px, 100%);
  max-height: min(calc(90 * var(--vh)), 820px);
  background: var(--plate);
  border: 1px solid rgba(111, 231, 255, 0.28);
  padding: 16px 16px 18px;
}
.comms-card .sheet-copy { margin: 10px 0 12px; }
.comms-banner {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 180, 84, 0.4);
  background: rgba(255, 180, 84, 0.08);
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-transform: uppercase;
}
.comms-channel { margin-bottom: 12px; }
.comms-channel .eyebrow { display: block; margin-bottom: 6px; }
.comms-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.comms-ch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 44px;
  padding: 7px 10px;
  color: var(--muted);
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.comms-ch b {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.comms-ch.dim { opacity: 0.45; }
.comms-ch.on {
  color: var(--cyan);
  background: linear-gradient(180deg, rgba(111, 231, 255, 0.18), rgba(111, 231, 255, 0.06));
}
.comms-ch.on b { color: var(--cyan); }
.comms-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-bottom: 10px;
}
#commsText {
  grid-column: 1;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #050b11;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#commsSend { grid-column: 2; min-width: 84px; }
/* D108: the mask is a mode, not a send button — it stays lit while the hull is quiet. */
.comms-mask {
  grid-column: 1 / -1;
  min-height: 34px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.16em;
  border: 1px solid var(--line);
  background: rgba(5, 11, 17, 0.7);
  cursor: pointer;
}
.comms-mask.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.5); background: rgba(255, 180, 84, 0.1); }
.comms-reply {
  margin-left: 6px;
  padding: 2px 7px;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.1em;
  border: 1px solid rgba(111, 231, 255, 0.35);
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}
.comms-reply:hover { background: rgba(111, 231, 255, 0.12); }
.comms-item.link { border-color: rgba(116, 240, 176, 0.25); }
.comms-item.link.fixed { border-color: rgba(116, 240, 176, 0.55); }
.comms-item.link.fixed .comms-item-top b { color: var(--green); }
.comms-ptt {
  grid-column: 1 / -1;
  min-height: 48px;
  color: var(--amber);
  font-size: 13px;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.comms-ptt kbd {
  margin-left: 8px;
  padding: 1px 5px;
  border: 1px solid rgba(255, 180, 84, 0.35);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.comms-ptt.on {
  color: #fff;
  background: linear-gradient(180deg, rgba(200, 40, 40, 0.55), rgba(120, 16, 16, 0.4));
  box-shadow: inset 1px 1px 0 rgba(255, 180, 180, 0.35), inset -1px -1px 0 var(--bevel-lo);
}
.comms-rec {
  grid-column: 1 / -1;
  color: #ff6b6b;
  font-size: 13px;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.comms-autoplay {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.comms-autoplay input { accent-color: var(--amber); width: 16px; height: 16px; }
/* The operator sheet. The server re-checks the account on every admin route; the panel is hidden for
   ordinary pilots. */
.admin-tools {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}
.admin-tool {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(103, 232, 249, 0.04);
  color: var(--cyan);
  font: inherit;
  text-align: left;
  text-decoration: none;
}
.admin-tool:hover { border-color: var(--cyan-dim); }
.admin-tool b { font-size: 12px; letter-spacing: 0.16em; font-weight: 600; }
.admin-tool span { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.admin-tp {
  margin: 0 0 14px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 180, 84, 0.35);
  background: rgba(255, 180, 84, 0.05);
}
.admin-tp[hidden] { display: none; }
.admin-tp-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.admin-tp-head .eyebrow { color: var(--amber); }
.admin-tp-head span:last-child { margin-left: auto; }
.admin-tp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.admin-tp select {
  flex: 1 1 190px;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #050b11;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.admin-tp .big-btn {
  min-height: 40px;
  min-width: 92px;
  font-size: 12px;
}
.admin-tp-step {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.admin-tp-step input {
  width: 74px;
  min-height: 40px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  background: #050b11;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.admin-tp-row .ghost-btn {
  min-height: 40px;
  padding: 7px 9px;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.admin-tp-status {
  margin: 7px 0 0;
  min-height: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.comms-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.comms-lists .eyebrow { display: block; margin-bottom: 6px; }
.comms-list { display: flex; flex-direction: column; gap: 6px; min-height: 48px; }
.comms-empty { color: var(--faint); font-size: 12px; letter-spacing: 0.06em; }
.comms-item {
  padding: 8px 8px 7px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 16, 0.8);
}
.comms-item-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.comms-item-top b {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--cyan);
  text-transform: uppercase;
}
.comms-item-top span { color: var(--faint); font-size: 11px; letter-spacing: 0.08em; margin-left: auto; white-space: nowrap; }
.comms-item p, .comms-voice span {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  word-break: break-word;
}
.comms-bar {
  height: 3px;
  margin: 4px 0 6px;
  background: rgba(111, 231, 255, 0.12);
}
.comms-bar i {
  display: block;
  height: 100%;
  background: var(--cyan);
}
.comms-item.done .comms-bar i { background: var(--green); }
.comms-item.echo { border-color: rgba(255, 180, 84, 0.35); }
.comms-item.echo .comms-item-top b { color: var(--amber); }
.comms-item.fleet { border-color: rgba(111, 231, 255, 0.45); }
.comms-item.fleet .comms-item-top span { color: var(--cyan); white-space: normal; text-align: right; }
.comms-fleet-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(111, 231, 255, 0.32);
  background: rgba(111, 231, 255, 0.07);
}
.comms-fleet-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.comms-fleet-copy b { color: var(--cyan); font-size: 15px; letter-spacing: 0.18em; }
.comms-fleet-copy span { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.comms-fleet-join {
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid rgba(116, 240, 176, 0.5);
  background: rgba(116, 240, 176, 0.1);
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.14em;
  flex: 0 0 auto;
}
.comms-fleet-join:hover { background: rgba(116, 240, 176, 0.2); }
.comms-fleet-linked { color: var(--green); font-size: 11px; letter-spacing: 0.12em; white-space: nowrap; }
.comms-fleet-linked.other { color: var(--faint); }
.comms-voice { display: flex; align-items: center; gap: 8px; }
.comms-voice .ghost-btn { min-height: 32px; padding: 4px 10px; font-size: 11px; }
.comms-dismiss {
  width: 22px;
  height: 22px;
  margin-left: 4px;
  color: var(--faint);
  font-size: 15px;
  line-height: 1;
  flex: 0 0 auto;
}
.comms-dismiss:hover { color: var(--ink); }
.comms-tx {
  position: absolute;
  left: 50%;
  top: 58px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(80, 10, 10, 0.88);
  color: #ffd0d0;
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 700;
  pointer-events: none;
}
.comms-tx[hidden] { display: none; }
.comms-tx span { color: #ff6b6b; }
.comms-tx b { color: #fff; letter-spacing: 0.12em; }

@media (pointer: coarse), (max-width: 879px) {
  .comms-card { width: 100%; max-height: none; height: 100%; padding: 14px 12px 24px; border: 0; }
  .comms-overlay { padding: 0; align-items: stretch; }
  .comms-lists { grid-template-columns: 1fr; }
  .comms-ptt, #commsText, #commsSend { min-height: 48px; }
  .comms-ch { min-height: 48px; }
  .comms-tx { top: auto; bottom: 196px; }
}


/* ---------- cargo hold (D57) ---------- */

.scrap-hud {
  cursor: pointer;
}
.scrap-hud:hover { border-color: var(--cyan-dim); color: var(--cyan); }
.cargo-hud-cap {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 1px;
}
.cargo-overlay { z-index: 86; }
.cargo-card {
  width: min(520px, calc(96 * var(--vw)));
  max-height: min(calc(86 * var(--vh)), 720px);
  overflow: auto;
  background: linear-gradient(180deg, #0a1621, #071018);
  padding: 16px 18px 20px;
}
.cargo-card .sheet-copy { margin: 8px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.cargo-caps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.cargo-cap {
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.7);
  padding: 8px 10px 10px;
  clip-path: var(--chamfer-s);
}
.cargo-cap span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.cargo-cap b {
  display: block;
  margin: 4px 0 7px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cyan);
}
.cargo-bar {
  display: block;
  height: 6px;
  background: rgba(111, 231, 255, 0.1);
  position: relative;
  overflow: hidden;
}
.cargo-bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2a8aa0, var(--cyan));
}
.cargo-cap.full b { color: var(--amber); }
.cargo-cap.full .cargo-bar > i { background: linear-gradient(90deg, #a06a20, var(--amber)); }
.cargo-bays {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}
.cargo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 14px;
}
.cargo-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.55);
  text-align: left;
}
.cargo-main { display: flex; align-items: flex-start; gap: 8px; flex: 1 1 180px; min-width: 0; }
.cargo-copy { min-width: 0; }
.cargo-kind {
  flex: 0 0 auto;
  padding: 2px 4px;
  border: 1px solid currentColor;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.cargo-row.k-weapon .cargo-kind { color: #f2a541; }
.cargo-row.k-module .cargo-kind { color: #6fe7ff; }
.cargo-row.k-implant .cargo-kind { color: #c79bff; }
.cargo-row.k-chip .cargo-kind { color: #7ee0a1; }
.cargo-row.k-writ .cargo-kind { color: #ffd166; }
.cargo-row.k-ability .cargo-kind { color: #ff8fa3; }
.cargo-row.k-material .cargo-kind,
.cargo-row.k-other .cargo-kind { color: #9fb3c8; }
.cargo-manifest { margin: 0 0 10px; }
.hold-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr));
  gap: 3px;
  padding: 6px;
  max-width: 420px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.55);
}
.hold-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(111, 231, 255, 0.12);
  background: rgba(111, 231, 255, 0.03);
  color: var(--cyan);
  font-size: 11px;
  line-height: 1;
}
.hold-cell.empty { border-style: dashed; border-color: rgba(111, 231, 255, 0.07); background: transparent; }
.hold-cell.k-weapon { color: #f2a541; border-color: rgba(242, 165, 65, 0.4); background: rgba(242, 165, 65, 0.08); }
.hold-cell.k-module { color: #6fe7ff; border-color: rgba(111, 231, 255, 0.35); background: rgba(111, 231, 255, 0.07); }
.hold-cell.k-implant { color: #c79bff; border-color: rgba(199, 155, 255, 0.4); background: rgba(199, 155, 255, 0.08); }
.hold-cell.k-chip { color: #7ee0a1; border-color: rgba(126, 224, 161, 0.4); background: rgba(126, 224, 161, 0.08); }
.hold-cell.k-writ { color: #ffd166; border-color: rgba(255, 209, 102, 0.4); background: rgba(255, 209, 102, 0.08); }
.hold-cell.k-ability { color: #ff8fa3; border-color: rgba(255, 143, 163, 0.4); background: rgba(255, 143, 163, 0.08); }
.hold-cell.k-material,
.hold-cell.k-other { color: #9fb3c8; border-color: rgba(159, 179, 200, 0.3); background: rgba(159, 179, 200, 0.06); }
.cargo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.hold-key { display: inline-flex; align-items: center; gap: 3px; }
.hold-key i { width: 6px; height: 6px; display: inline-block; background: currentColor; }
.hold-key.k-weapon { color: #f2a541; }
.hold-key.k-module { color: #6fe7ff; }
.hold-key.k-implant { color: #c79bff; }
.hold-key.k-chip { color: #7ee0a1; }
.hold-key.k-writ { color: #ffd166; }
.hold-key.k-ability { color: #ff8fa3; }
.hold-key.k-material,
.hold-key.k-other { color: #9fb3c8; }
.cargo-hold-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.cargo-hold-tools .cargo-bays { margin: 0; }
.cargo-group { margin: 0 0 10px; }
.cargo-group .section-head { margin-top: 2px; }
.cargo-actions button.good { color: #7ee0a1; border-color: rgba(126, 224, 161, 0.5); }
@media (max-width: 640px) {
  .cargo-row .cargo-actions { flex: 1 0 100%; margin-left: 0; justify-content: flex-end; }
}
.cargo-row b { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0.03em; }
.cargo-row em { display: block; color: var(--muted); font-style: normal; font-size: 12px; line-height: 1.35; }
.cargo-row .cargo-qty {
  margin-left: auto;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.cargo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 6px; }
.cargo-link {
  border: 1px solid var(--line);
  background: rgba(8, 16, 24, 0.8);
  color: var(--amber);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  cursor: pointer;
  text-transform: uppercase;
}
.cargo-link:hover { border-color: var(--amber); background: rgba(255, 180, 84, 0.12); }
.cargo-actions button {
  padding: 5px 8px;
  min-height: 28px;
  font-size: 11px;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  color: var(--ink);
}
.cargo-actions button:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.cargo-actions button.bad { color: var(--red); border-color: rgba(255, 96, 96, 0.5); }
.cargo-actions button:disabled { opacity: 0.45; cursor: default; }
.cargo-empty { color: var(--faint); font-size: 11px; letter-spacing: 0.08em; padding: 8px 2px; }
.cargo-line {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 7px 8px;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--cyan);
  border: 1px solid var(--line);
  background: rgba(111, 231, 255, 0.05);
  clip-path: var(--chamfer-s);
}
.cargo-line:hover { border-color: var(--cyan-dim); background: rgba(111, 231, 255, 0.1); }
.hail-cargo {
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.55);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  line-height: 1.45;
}
.hail-cargo b { color: var(--cyan); font-weight: 500; }
.hail-cargo button {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--cyan);
  vertical-align: middle;
}
.hail-cargo button:hover { border-color: var(--cyan-dim); }

/* ---------- crew room queue (D58) ---------- */

.crew-post {
  margin: 6px 0 4px;
  padding: 7px 8px 8px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.55);
  font-size: 12px;
}
.crew-post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.crew-post-head b { color: var(--amber); font-weight: 600; }
.crew-post-back {
  border: 1px solid var(--line);
  background: rgba(8, 16, 24, 0.8);
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  cursor: pointer;
}
.crew-post-back:hover { border-color: var(--amber); color: var(--amber); }
.crew-post-rooms { display: flex; flex-wrap: wrap; gap: 4px; }
.crew-post-chip {
  border: 1px solid rgba(111, 231, 255, 0.18);
  background: rgba(8, 16, 24, 0.6);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 4px 6px;
  cursor: pointer;
  text-transform: uppercase;
}
.crew-post-chip.on { border-color: var(--amber); background: rgba(255, 180, 84, 0.14); color: var(--amber); }
.crew-post-chip:hover { color: var(--ink); border-color: var(--ink); }
.crew-route {
  margin: 6px 0 4px;
  padding: 7px 8px 8px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.55);
  font-size: 12px;
}
.crew-route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.crew-route-head label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  cursor: pointer;
}
.crew-route-list { display: flex; flex-direction: column; gap: 4px; }
.crew-route-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 6px;
  border: 1px solid rgba(111, 231, 255, 0.12);
  background: rgba(8, 16, 24, 0.6);
}
.crew-route-row.on { border-color: rgba(255, 180, 84, 0.55); }
.crew-route-row .n {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-size: 11px;
  flex: 0 0 auto;
}
.crew-route-row.on .n { background: var(--amber); color: #041018; }
.crew-route-row b { flex: 1; font-weight: 500; letter-spacing: 0.04em; font-size: 12px; }
.crew-route-row button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}
.crew-route-row button:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.crew-route-empty { color: var(--faint); font-size: 11px; letter-spacing: 0.06em; }
.crew-route-clear {
  padding: 2px 6px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.crew-route-clear:hover { color: var(--red); border-color: rgba(255, 96, 96, 0.5); }

@media (max-width: 720px) {
  .cargo-card { width: 100%; max-height: none; height: 100%; padding: 14px 12px 24px; border: 0; }
  .cargo-overlay { padding: 0; align-items: stretch; }
  .cargo-actions button, .crew-route-row button { min-height: 36px; min-width: 36px; }
  .cargo-hud-cap { font-size: 10px; }
  .hail-cargo button { min-height: 34px; padding: 6px 10px; }
}


/* ---------- starwell + outfit + loot + hire (D59–D64) ---------- */

.skill-view-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
}
.skill-view-tabs button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  clip-path: var(--chamfer-s);
}
.skill-view-tabs button.on { color: var(--amber); border-color: rgba(255, 180, 84, 0.55); background: rgba(255, 180, 84, 0.08); }
.starwell-wrap {
  height: 280px;
  border: 1px solid var(--line);
  background: #05080e;
  margin-bottom: 8px;
  overflow: hidden;
}
#starwell { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.starwell-chips { margin: 0 0 9px; }
.starwell-chip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(196, 140, 255, 0.16);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--faint);
}
.starwell-chip-list { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.starwell-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 6px;
  border: 1px solid rgba(196, 140, 255, 0.22);
  background: rgba(196, 140, 255, 0.055);
}
.starwell-chip b { color: #c48cff; font-size: 11px; font-weight: 500; letter-spacing: 0.06em; }
.starwell-chip em { color: var(--faint); font-size: 10px; font-style: normal; }

.cargo-tabs { display: flex; gap: 6px; margin: 0 0 10px; }
.cargo-tabs button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  clip-path: var(--chamfer-s);
}
.cargo-tabs button.on { color: var(--cyan); border-color: var(--cyan-dim); background: rgba(111, 231, 255, 0.08); }
.cargo-deltas {
  margin: 0 0 10px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.55);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  min-height: 1.4em;
}
.cargo-deltas b { color: var(--cyan); font-weight: 500; }
.cargo-deltas .up { color: var(--green); }
.cargo-deltas .down { color: var(--amber); }
.cargo-mount {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cargo-mount .stats { color: var(--faint); font-size: 11px; letter-spacing: 0.04em; }

.loot-sheet {
  position: absolute;
  top: 12px;
  left: 200px;
  transform: none;
  width: min(420px, calc(100% - 200px - 148px));
  z-index: 37;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, #0a1621, #071018);
  border: 1px solid var(--line);
}
.loot-sheet[hidden] { display: none; }
.loot-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.loot-sheet h2 { font-size: 16px; letter-spacing: 0.08em; font-weight: 500; margin: 0 0 6px; }
.loot-copy { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0 0 10px; }
.loot-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: calc(40 * var(--vh)); overflow: auto; }
.loot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.55);
}
.loot-row b { display: block; font-size: 13px; font-weight: 500; }
.loot-row em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.loot-row button {
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--cyan);
  white-space: nowrap;
}
.loot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loot-auto { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }

.hire-overlay { z-index: 86; }
.hire-card { width: min(560px, calc(96 * var(--vw))); max-height: min(calc(86 * var(--vh)), 720px); overflow: auto; background: linear-gradient(180deg, #0a1621, #071018); padding: 16px 18px 20px; }
.hire-list { display: flex; flex-direction: column; gap: 8px; }
.hire-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.55);
}
.hire-row b { display: block; font-size: 14px; font-weight: 500; }
.hire-row em { display: block; color: var(--muted); font-style: normal; font-size: 12px; line-height: 1.35; }
.hire-row .hire-cost { margin-left: auto; color: var(--amber); font-size: 13px; letter-spacing: 0.06em; white-space: nowrap; }
.hire-row button { padding: 6px 10px; border: 1px solid var(--line); font-size: 11px; letter-spacing: 0.1em; color: var(--cyan); }

@media (max-width: 720px) {
  .starwell-wrap { height: calc(52 * var(--vh)); }
  .loot-sheet { top: 140px; left: 12px; right: 12px; width: auto; transform: none; }
  .loot-row button, .loot-actions button, .hire-row button { min-height: 36px; }
  .hire-card { width: 100%; max-height: none; height: 100%; padding: 14px 12px 24px; border: 0; }
  .hire-overlay { padding: 0; align-items: stretch; }
  .pane-actions .deck-open { font-size: 11px; padding: 4px 6px; }
}

.contract.ready { border-color: rgba(255, 180, 84, 0.55); background: rgba(255, 180, 84, 0.07); }
.contract.ready .contract-head .eyebrow { color: var(--amber); }
.contract-jobs { margin-top: 7px; display: flex; flex-direction: column; gap: 4px; }
.contract-job { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.contract-job.ready { color: var(--amber); }
.contract-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.contract-btn {
  padding: 5px 8px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--cyan);
  clip-path: var(--chamfer-s);
}
.contract-btn.good { color: var(--green); border-color: rgba(116, 240, 176, 0.45); }
.board-overlay { z-index: 86; }
.board-card { width: min(560px, calc(96 * var(--vw))); max-height: min(calc(86 * var(--vh)), 720px); overflow: auto; background: linear-gradient(180deg, #0a1621, #071018); padding: 16px 18px 20px; }
.board-ready { margin: 0 0 10px; padding: 8px 10px; border: 1px solid rgba(255, 180, 84, 0.4); background: rgba(255, 180, 84, 0.06); }
.board-ready b { display: block; font-size: 13px; font-weight: 500; color: var(--amber); }
.board-ready em { display: block; color: var(--muted); font-style: normal; font-size: 12px; margin-bottom: 6px; }
@media (max-width: 720px) {
  .board-card { width: 100%; max-height: none; height: 100%; padding: 14px 12px 24px; border: 0; }
  .board-overlay { padding: 0; align-items: stretch; }
  .contract-btn { min-height: 36px; }
}


/* Procedural audio mix (D74) */
.audio-overlay { z-index: 88; }
.audio-card { width: min(420px, 100%); }
.audio-mute {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.audio-mute input { width: 18px; height: 18px; accent-color: var(--green); }
.audio-sliders { display: grid; gap: 12px; }
.audio-sliders label {
  display: grid;
  grid-template-columns: 72px 1fr 32px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.audio-sliders input[type="range"] {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: var(--green);
}
.audio-sliders span { text-align: right; color: var(--green); font-variant-numeric: tabular-nums; }
.audio-voice-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 16px; }
.audio-voice-row .font-hint { line-height: 1.4; }
.audio-voice-select {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.audio-voice-select select {
  min-height: 30px;
  padding: 0 8px;
  color: var(--ink);
  background: rgba(6, 12, 20, 0.82);
  border: 1px solid var(--line);
  border-radius: 3px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.audio-voice-note {
  margin: 0 0 4px;
  min-height: 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
@media (max-width: 720px) {
  .audio-card { width: 100%; max-height: none; height: 100%; padding: 16px 14px 28px; border: 0; }
  .audio-overlay { padding: 0; align-items: stretch; }
  .audio-sliders label { grid-template-columns: 70px 1fr 32px; }
}

.death-lost, .death-kept {
  max-width: min(520px, calc(100% - 32px));
  margin: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--muted);
}
.death-lost { color: var(--amber); }
.death-kept { color: var(--green); }

.signout { cursor: pointer; }
.login-gate {
  z-index: 95;
  background:
    radial-gradient(circle at 22% 20%, rgba(111, 231, 255, 0.08), transparent 44%),
    radial-gradient(circle at 78% 76%, rgba(255, 180, 84, 0.07), transparent 46%),
    rgba(2, 5, 9, 0.9);
}
.login-card {
  width: min(430px, 100%);
  border: 1px solid rgba(111, 231, 255, 0.34);
  background: linear-gradient(180deg, rgba(8, 17, 27, 0.98), rgba(4, 9, 15, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(111, 231, 255, 0.14);
}
.login-badges {
  display: grid;
  gap: 6px;
  justify-items: end;
  align-self: flex-start;
}
.login-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 21px;
  padding: 4px 8px;
  border: 1px solid rgba(111, 231, 255, 0.28);
  background: rgba(111, 231, 255, 0.08);
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.16em;
  line-height: 1.2;
  white-space: nowrap;
}
/* Guest keeps the same badge footprint; the pulse changes only its color/glow, never its size. */
.guest-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 21px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  cursor: pointer;
}
.guest-badge-face {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 21px;
  padding: 4px 8px;
  border: 1px solid rgba(116, 240, 176, 0.42);
  background: rgba(116, 240, 176, 0.08);
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.16em;
  line-height: 1.2;
  white-space: nowrap;
  animation: guestPulse 4s ease-in-out infinite;
}
.guest-badge:hover .guest-badge-face, .guest-badge:focus-visible .guest-badge-face { border-color: rgba(116, 240, 176, 0.68); }
@keyframes guestPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(116, 240, 176, 0); border-color: rgba(116, 240, 176, 0.42); }
  50% { box-shadow: 0 0 10px 0 rgba(116, 240, 176, 0.2); border-color: rgba(116, 240, 176, 0.68); }
}
.guest-notice {
  display: grid;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(116, 240, 176, 0.26);
  background: rgba(116, 240, 176, 0.05);
}
.guest-notice[hidden] { display: none; }
.guest-copy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.guest-actions { display: flex; align-items: center; gap: 12px; }
.guest-continue {
  flex: 1;
  min-height: 42px;
  border-color: rgba(116, 240, 176, 0.55);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.login-form { display: grid; gap: 13px; }
.login-form[hidden], .login-switch[hidden] { display: none; }
.login-field { display: grid; gap: 6px; }
.login-field > span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.login-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(111, 231, 255, 0.24);
  background: #04080f;
  color: var(--ink);
  font: 15px/1.3 var(--mono);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.login-field input::placeholder { color: var(--faint); }
.login-field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(111, 231, 255, 0.16);
}
.login-pin-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.login-pin-wrap input { flex: 1; min-width: 0; letter-spacing: 0.16em; }
.login-pin-toggle {
  min-width: 60px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(111, 231, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
}
.login-pin-toggle:hover { color: var(--cyan); border-color: rgba(111, 231, 255, 0.4); }
.login-remember {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.login-remember input { width: 17px; height: 17px; margin: 0; accent-color: var(--cyan); }
.login-switch {
  justify-self: start;
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 0.14em;
}
.signup-copy { margin: 0; font-size: 12px; line-height: 1.5; }
.signup-captcha {
  display: grid;
  place-items: center;
  min-height: 76px;
  padding: 6px;
  border: 1px solid rgba(111, 231, 255, 0.24);
  background: #04080f;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.signup-captcha svg { display: block; max-width: 100%; height: auto; }
.signup-captcha-refresh { justify-self: start; font-size: 12px; letter-spacing: 0.12em; }
.login-error {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 96, 96, 0.45);
  background: rgba(255, 96, 96, 0.1);
  color: var(--red);
  font-size: 13px;
  line-height: 1.45;
}
.login-submit {
  width: 100%;
  min-height: 46px;
  border-color: rgba(116, 240, 176, 0.55);
  font-size: 13px;
  letter-spacing: 0.2em;
  font-weight: 600;
}
.login-submit:disabled { opacity: 0.55; cursor: progress; }
.login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(111, 231, 255, 0.12);
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.08em;
}
@media (prefers-reduced-motion: reduce) {
  .guest-badge-face { animation: none; }
}
@media (max-width: 720px) {
  .login-gate { padding: 12px; }
  .login-card { padding: 18px 16px; }
  .login-field input { font-size: 16px; min-height: 46px; }
  .login-pin-toggle, .login-submit { min-height: 46px; }
  .login-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (max-width: 360px) {
  .login-card .sheet-head { flex-wrap: wrap; }
  .login-card .login-badges { display: flex; flex-direction: row; flex-wrap: wrap; justify-items: initial; justify-content: flex-start; width: 100%; gap: 6px; }
  .login-card .login-badge, .login-card .guest-badge-face { padding: 4px 6px; font-size: 11px; letter-spacing: 0.1em; }
}

/* Safe areas and 40px touch targets on phones */
@media (pointer: coarse), (max-width: 879px) {
  #hud { padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); padding-top: env(safe-area-inset-top, 0px); height: calc(var(--hud) + env(safe-area-inset-top, 0px)); }
  #layout { top: calc(var(--hud) + env(safe-area-inset-top, 0px)); }
  .hud-btn, .deck-open, .deck-tool, .sheet .close, .loot-row button, .loot-actions button {
    min-height: 40px;
  }
  /* The top strip is 44 px; a 40 px button leaves no breathing room. Keep the 32 px bar control
     and the 40 px target on the panels that are actually touched in a list. */
  #hud .hud-btn { min-height: 32px; }
}

@media (max-width: 720px) {
  .loot-sheet {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    width: auto;
    transform: none;
    max-height: min(calc(48 * var(--vh)), calc(100% - 148px - env(safe-area-inset-bottom, 0px)));
    z-index: 37;
  }
}

.quad-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 6px;
  width: 100%;
}
.quad-map i {
  display: block;
  height: 8px;
  background: rgba(111, 231, 255, 0.08);
  border: 1px solid rgba(111, 231, 255, 0.16);
}
.quad-map i.explored { background: rgba(111, 231, 255, 0.22); }
.quad-map i.current { background: rgba(255, 180, 84, 0.55); border-color: var(--amber); }
.quad-map i.home { box-shadow: inset 0 0 0 1px rgba(116, 240, 176, 0.7); }
.quad-map i.charted { background: rgba(111, 231, 255, 0.32); }
.quad-map i.current.charted { background: rgba(255, 180, 84, 0.7); }

.quad-banner {
  position: absolute;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px 9px;
  background: rgba(4, 7, 12, 0.82);
  border: 1px solid rgba(111, 231, 255, 0.28);
  color: var(--ink);
  letter-spacing: 0.12em;
  text-align: center;
}
.quad-banner[hidden] { display: none; }
.quad-banner .eyebrow { color: var(--cyan); font-size: 11px; }
.quad-banner b { font-size: 15px; font-weight: 500; letter-spacing: 0.16em; }
.quad-banner em { color: var(--muted); font-size: 12px; font-style: normal; letter-spacing: 0.18em; }
.quad-banner.is-in { animation: quad-banner-in 0.28s ease-out; }
.quad-banner.is-out { animation: quad-banner-out 0.4s ease-in forwards; }
@keyframes quad-banner-in { from { opacity: 0; transform: translateX(-50%) translateY(-6px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes quad-banner-out { from { opacity: 1; } to { opacity: 0; } }

/* D198: the mercenary contract strip. It sits below the quadrant banner, is read-only, and never
   takes a tap from the flight surface. */
.merc-bar {
  position: absolute;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 27;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  background: rgba(4, 7, 12, 0.86);
  border: 1px solid rgba(255, 209, 102, 0.34);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  max-width: calc(100% - 16px);
  overflow: hidden;
}
.merc-bar[hidden] { display: none; }
.merc-bar .merc-company { color: var(--amber); font-size: 11px; letter-spacing: 0.14em; }
.merc-bar b { color: var(--green); font-size: 12px; font-weight: 600; }
.merc-bar .merc-clock { color: var(--cyan); }
.merc-bar .merc-pay { color: var(--muted); font-size: 11px; }
@media (max-width: 720px) {
  .merc-bar { top: 122px; gap: 6px; padding: 4px 8px; font-size: 11px; }
  .merc-bar .merc-pay { display: none; }
}

.comms-garble { margin: 4px 0 0; color: var(--amber); font-size: 11px; letter-spacing: 0.08em; }

/* ---- Dashboard lamps (soft notices) and deck emergency sirens -------------------- */
#shipPane,
.deck-shell {
  position: relative;
  padding-top: 22px;
}
#rail { overflow-x: hidden; }

.dash-lamps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  align-self: flex-start;
  max-width: 240px;
}
.dash-lamps[hidden] { display: none; }

/* D293: the lamp is a word first (HOLD, RING, TIP), so the square holds a readable glyph. */
.dash-lamp {
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid rgba(111, 231, 255, 0.28);
  background: rgba(4, 8, 14, 0.82);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
.dash-lamp[data-tone="ready"] { border-color: rgba(116, 240, 176, 0.4); color: var(--green); }
.dash-lamp[data-tone="hint"] { border-color: rgba(255, 180, 84, 0.4); color: var(--amber); }
.dash-lamp .lamp-glyph {
  position: relative;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 600;
  pointer-events: none;
}
.dash-lamp .lamp-bulb {
  position: absolute;
  inset: 5px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.18;
  pointer-events: none;
}
.dash-lamp.is-on .lamp-bulb {
  animation: lamp-pulse 2.8s ease-in-out infinite;
}
.dash-lamp:hover,
.dash-lamp:focus-visible,
.dash-lamp.is-open {
  border-color: currentColor;
  background: rgba(8, 16, 24, 0.95);
}
.dash-lamp .lamp-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: max-content;
  max-width: 220px;
  padding: 7px 22px 7px 8px;
  border: 1px solid var(--line);
  background: rgba(6, 12, 18, 0.96);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-align: left;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
.dash-lamp .lamp-tip b {
  display: block;
  color: currentColor;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 600;
  margin-bottom: 3px;
}
.lamp-tip-x {
  position: absolute;
  top: 3px;
  right: 5px;
  color: var(--faint);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
}
.dash-lamp.is-open .lamp-tip { pointer-events: auto; cursor: pointer; }
.dash-lamp.is-open .lamp-tip:hover { border-color: currentColor; }
.dash-lamp.is-open .lamp-tip-x { color: var(--muted); }
.dash-lamp:hover .lamp-tip,
.dash-lamp:focus-visible .lamp-tip,
.dash-lamp.is-open .lamp-tip { display: block; }

@keyframes lamp-pulse {
  0%, 100% { opacity: 0.14; box-shadow: 0 0 0 0 transparent; }
  50% { opacity: 0.55; box-shadow: 0 0 10px 1px currentColor; }
}

#shipPane.is-alert,
.deck-shell.is-alert {
  outline: 2px solid rgba(255, 70, 70, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 80, 80, 0.35), inset 0 0 22px rgba(255, 40, 40, 0.12);
  animation: alert-outline 1.6s ease-in-out infinite;
}
#shipPane.is-alert[data-alert-tone="amber"],
.deck-shell.is-alert[data-alert-tone="amber"] {
  outline-color: rgba(255, 180, 84, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 180, 84, 0.35), inset 0 0 22px rgba(255, 160, 40, 0.12);
}
@keyframes alert-outline {
  0%, 100% { outline-color: rgba(255, 70, 70, 0.55); }
  50% { outline-color: rgba(255, 90, 90, 1); }
}
#shipPane.is-alert[data-alert-tone="amber"],
.deck-shell.is-alert[data-alert-tone="amber"] {
  animation-name: alert-outline-amber;
}
@keyframes alert-outline-amber {
  0%, 100% { outline-color: rgba(255, 180, 84, 0.5); }
  50% { outline-color: rgba(255, 200, 90, 1); }
}

.deck-siren {
  position: absolute;
  top: 4px;
  left: 14px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 2px 8px 2px 4px;
  border: 1px solid rgba(255, 70, 70, 0.7);
  background: rgba(12, 6, 8, 0.94);
  color: #ff6b6b;
  cursor: pointer;
  pointer-events: auto;
}
.deck-siren[hidden] { display: none; }
.deck-siren[data-tone="amber"] {
  border-color: rgba(255, 180, 84, 0.7);
  color: var(--amber);
}
.deck-siren .siren-stack {
  position: relative;
  width: 22px;
  height: 18px;
  flex: 0 0 22px;
  image-rendering: pixelated;
}
.deck-siren .siren-base {
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 14px;
  height: 4px;
  background: #3a2428;
  box-shadow: 1px 0 0 #1a1012, 0 1px 0 #1a1012, inset 0 1px 0 #6a4448;
}
.deck-siren .siren-dome {
  position: absolute;
  left: 5px;
  bottom: 3px;
  width: 12px;
  height: 10px;
  background: #c01418;
  border-radius: 6px 6px 1px 1px;
  box-shadow:
    inset 2px 2px 0 #ff5a5a,
    inset -1px 0 0 #7a0c10,
    0 0 6px rgba(255, 40, 40, 0.7);
}
.deck-siren[data-tone="amber"] .siren-dome {
  background: #c06010;
  box-shadow: inset 2px 2px 0 #ffb454, inset -1px 0 0 #7a3a0c, 0 0 6px rgba(255, 160, 40, 0.7);
}
.deck-siren .siren-beam {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 28px;
  height: 8px;
  margin-left: -3px;
  background: linear-gradient(90deg, rgba(255, 40, 40, 0.85), rgba(255, 40, 40, 0));
  clip-path: polygon(0 40%, 0 60%, 100% 100%, 100% 0);
  transform-origin: 3px 50%;
  animation: siren-spin 1.05s steps(8, end) infinite;
  pointer-events: none;
  filter: drop-shadow(0 0 3px rgba(255, 40, 40, 0.8));
}
.deck-siren[data-tone="amber"] .siren-beam {
  background: linear-gradient(90deg, rgba(255, 180, 84, 0.85), rgba(255, 180, 84, 0));
  filter: drop-shadow(0 0 3px rgba(255, 180, 84, 0.8));
}
@keyframes siren-spin {
  to { transform: rotate(360deg); }
}
.deck-siren .siren-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 600;
  white-space: nowrap;
}
.deck-siren.space-siren {
  position: relative;
  top: auto;
  left: auto;
  align-self: flex-start;
}

#dots button.is-alert {
  box-shadow: 0 0 0 2px rgba(255, 70, 70, 0.85);
  animation: lamp-pulse 1.6s ease-in-out infinite;
}

@media (pointer: coarse), (max-width: 879px) {
  .dash-lamp { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .dash-lamp .lamp-glyph { font-size: 11px; }
  .dash-lamps { max-width: min(240px, calc(calc(100 * var(--vw)) - 160px)); }
  .deck-siren { min-height: 44px; top: 4px; padding: 4px 10px 4px 6px; }
  .deck-siren .siren-label { font-size: 11px; }
  .dash-lamp .lamp-tip { max-width: min(240px, calc(calc(100 * var(--vw)) - 24px)); pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-lamp.is-on .lamp-bulb,
  #shipPane.is-alert,
  .deck-shell.is-alert,
  .deck-siren .siren-beam,
  #dots button.is-alert {
    animation: none;
  }
  .dash-lamp.is-on .lamp-bulb { opacity: 0.45; }
  .deck-siren .siren-beam { transform: rotate(25deg); }
}

/* --- station services (D83–D86): shop, storage grid, courier, bays --------------------------- */
.station-overlay { z-index: 60; }
.station-card {
  width: min(760px, calc(96 * var(--vw)));
  max-height: min(calc(90 * var(--vh)), 860px);
  overflow: auto;
  background: linear-gradient(180deg, #0a1621, #071018);
  padding: 16px 18px 22px;
  clip-path: var(--chamfer);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo), 0 24px 90px rgba(0, 0, 0, 0.75);
}
.station-tabs { margin-top: 10px; flex-wrap: wrap; }
.station-tabs button { min-height: 32px; min-width: 64px; }
.faction-row { align-items: flex-start; }
.faction-swatch { width: 12px; height: 12px; margin-top: 7px; border-radius: 50%; background: var(--faction-color, #8c9bb0); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08); flex: 0 0 auto; }
.faction-row .shop-body em { line-height: 1.45; }
.station-body .section-head { margin-top: 12px; }
.shop-list { display: flex; flex-direction: column; gap: 6px; }
.shop-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--r, var(--line));
  background: rgba(4, 8, 14, 0.55);
  clip-path: var(--chamfer-s);
}
.shop-row.sold { opacity: 0.5; }
.shop-tag { font-size: 11px; letter-spacing: 0.12em; color: var(--r, var(--muted)); text-align: center; border: 1px solid var(--r, var(--line)); padding: 4px 0; }
.shop-body { min-width: 0; }
.shop-body b { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-body em { display: block; color: var(--muted); font-style: normal; font-size: 12px; line-height: 1.35; }
.shop-price { color: var(--amber); font-size: 15px; text-align: right; white-space: nowrap; }
.shop-price small { display: block; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; }
.shop-acts { display: flex; gap: 6px; }
.shop-acts button, .stash-acts button, .stash-tools button, .stash-acts select {
  min-height: 34px; padding: 6px 10px; border: 1px solid var(--cyan-dim); font-size: 11px; letter-spacing: 0.1em; color: var(--cyan);
  background: rgba(111, 231, 255, 0.06); clip-path: var(--chamfer-s);
}
.shop-acts button.ghost, .stash-acts button.ghost, .stash-tools button.ghost { border-color: var(--line); color: var(--muted); background: transparent; }
.shop-acts button:disabled, .stash-tools button:disabled { opacity: 0.4; cursor: default; }
.stash-acts select { color: var(--ink); background: #071018; max-width: 100%; flex: 1 1 auto; }
.r-common { --r: #9fb3c8; }
.r-uncommon { --r: #7ee0a1; }
.r-rare { --r: #6fe7ff; }
.r-scarce { --r: #c084fc; }
.r-unique { --r: #ffb454; }
.r-core { --r: #d9f6ff; }
.r-writ { --r: #f2d16b; }

/* the storage grid: cells are a CSS grid; tiles span w×h cells on the same grid */
.stash-caps { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.stash-tools { display: flex; gap: 6px; }
.stash-wrap { overflow-x: auto; padding-bottom: 4px; }
.stash {
  --cell: 38px;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-template-rows: repeat(var(--rows), var(--cell));
  gap: 0;
  width: max-content;
  border: 1px solid rgba(111, 231, 255, 0.28);
  background: #050b11;
  image-rendering: pixelated;
}
.stash-cell { border: 1px solid rgba(111, 231, 255, 0.07); background: rgba(10, 22, 33, 0.6); padding: 0; min-width: 0; min-height: 0; }
.stash-cell.can { background: rgba(126, 224, 161, 0.16); border-color: rgba(126, 224, 161, 0.4); }
.stash-item {
  position: relative;
  z-index: 1;
  margin: 2px;
  padding: 3px;
  border: 1px solid var(--r, var(--line));
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 4px, transparent 4px 8px),
    linear-gradient(180deg, rgba(20, 34, 48, 0.95), rgba(8, 16, 24, 0.95));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 12px color-mix(in srgb, var(--r, #9fb3c8) 22%, transparent);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 0;
}
.stash-item i { font-style: normal; font-size: 11px; letter-spacing: 0.1em; color: var(--r, var(--muted)); }
.stash-item span { font-size: 11px; line-height: 1.2; color: var(--ink); word-break: break-word; }
.stash-item b { position: absolute; right: 3px; bottom: 2px; font-size: 12px; color: var(--amber); }
.stash-item.sel { outline: 2px solid var(--amber); outline-offset: -2px; }
.stash-sel { margin-top: 10px; padding: 10px; border: 1px solid rgba(255, 180, 84, 0.35); background: rgba(255, 180, 84, 0.05); clip-path: var(--chamfer-s); }
.stash-sel b { display: block; font-size: 14px; font-weight: 500; }
.stash-sel em { display: block; color: var(--muted); font-style: normal; font-size: 12px; margin: 2px 0 8px; }
.stash-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.stash-hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.stash-hold { display: flex; flex-wrap: wrap; gap: 6px; }
.hold-chip { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-left: 3px solid var(--r, var(--line)); background: rgba(4, 8, 14, 0.55); color: var(--ink); font-size: 12px; clip-path: var(--chamfer-s); }
.hold-chip i { font-style: normal; font-size: 11px; color: var(--r, var(--muted)); letter-spacing: 0.1em; }
.hold-chip small { color: var(--muted); font-size: 11px; }
.hold-chip.sel { outline: 2px solid var(--amber); outline-offset: -2px; }

.courier-store { margin-top: 10px; }
.courier-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.courier-head b { font-size: 14px; font-weight: 500; }
.courier-head em { color: var(--muted); font-style: normal; font-size: 12px; }

.bay-top { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.bay-top .sheet-copy { margin: 0; flex: 1 1 auto; }
.bay-grid { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 40px); gap: 3px; flex: 0 0 auto; }
.bay-cell { display: flex; align-items: center; justify-content: center; font-size: 11px; letter-spacing: 0.08em; border: 1px solid var(--line); background: rgba(10, 22, 33, 0.7); color: var(--muted); }
.bay-cell.extra { color: #7ee0a1; border-color: rgba(126, 224, 161, 0.45); cursor: pointer; }
.bay-cell.free { border-style: dashed; color: var(--cyan); cursor: pointer; font-size: 16px; }
.bay-cell.none { border-color: transparent; background: transparent; }
.bay-cell.sel { outline: 2px solid var(--amber); outline-offset: -2px; color: var(--amber); }

@media (max-width: 720px) {
  .station-overlay { padding: 0; align-items: stretch; }
  .station-card { width: 100%; max-height: none; height: 100%; padding: 14px 10px 28px; border: 0; }
  .shop-row { grid-template-columns: 38px 1fr auto; gap: 8px; }
  .shop-acts { grid-column: 1 / -1; justify-content: flex-end; }
  .stash { --cell: min(34px, calc((calc(100 * var(--vw)) - 34px) / var(--cols))); }
  .bay-top { flex-direction: column; align-items: flex-start; }
}

/* --- journal: generated activities (D90–D93) --------------------------------------------------- */
.explore-overlay { z-index: 60; }

/* D130: the away team takes the whole screen, like the chart and the station, because the pilot has
   left the cockpit. One canvas, one USE, one RECALL. */
.away-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #04070c;
}
.away-overlay[hidden] { display: none; }
.away-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.away-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.away-title b { font-size: 14px; letter-spacing: 0.08em; }
.away-title em { font-style: normal; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; }
.away-clock { display: flex; flex-direction: column; gap: 1px; padding: 4px 9px; border: 1px solid var(--amber-dim); background: rgba(255, 180, 84, 0.06); }
.away-clock[hidden] { display: none; }
.away-clock b { font-size: 15px; letter-spacing: 0.08em; color: var(--amber); }
.away-clock b.low { color: var(--red); }
.away-obj { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; }
.away-obj[hidden] { display: none; }
.away-hp { flex: 1 1 auto; height: 6px; max-width: 260px; background: #12202b; border: 1px solid var(--line); }
.away-hp i { display: block; height: 100%; width: 100%; background: var(--green); transition: width 0.2s linear; }
.away-btn {
  padding: 8px 12px;
  border: 1px solid var(--cyan-dim);
  background: rgba(111, 231, 255, 0.08);
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.away-btn:disabled { opacity: 0.35; }
.away-btn.quiet { color: var(--muted); border-color: var(--line); background: transparent; }
.away-overlay canvas { display: block; width: 100%; height: 100%; min-height: 0; touch-action: none; }
.away-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.away-log { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.away-log p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.away-log p:last-child { color: var(--ink); }
body.awayOpen .ship-rail, body.awayOpen .pane-controls { visibility: hidden; }
@media (max-width: 720px) {
  .away-head { gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
  .away-clock b { font-size: 15px; }
  .away-obj { order: 5; width: 100%; }
}

/* D131: the carrier card is a conversation in the rail, not a modal. It shows the last line, how many
   replies have tightened the fix, and one button. Closing it hides it until the next line arrives. */
.mystery-card {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 111, 216, 0.35);
  background: rgba(255, 111, 216, 0.06);
}
.mystery-card[hidden] { display: none; }
.mystery-card header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mystery-card b { display: block; margin-top: 4px; font-size: 12px; letter-spacing: 0.08em; color: var(--ink); }
.mystery-card p { margin: 4px 0 6px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.mystery-close { color: var(--muted); font-size: 14px; line-height: 1; padding: 0 2px; }
.mystery-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mystery-meta span { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; }
.mystery-reply {
  padding: 5px 9px;
  border: 1px solid rgba(255, 111, 216, 0.5);
  color: #ff9be6;
  background: rgba(255, 111, 216, 0.1);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.mystery-reply:disabled { opacity: 0.35; }
.explore-card {
  width: min(720px, calc(96 * var(--vw)));
  max-height: min(calc(90 * var(--vh)), 860px);
  overflow: auto;
  background: linear-gradient(180deg, #0a1621, #071018);
  padding: 16px 18px 22px;
  clip-path: var(--chamfer);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo), 0 24px 90px rgba(0, 0, 0, 0.75);
}
.hud-btn.lit, .wide-btn.lit { color: #74f0b0; box-shadow: inset 0 -2px 0 #74f0b0; }
.ex-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: #8fa6b6; margin: 4px 0 6px; }
.ex-h { font: 700 13px ui-monospace, monospace; letter-spacing: 0.14em; color: #8fa6b6; margin: 14px 0 6px; display: flex; gap: 8px; }
.ex-h span { color: var(--cyan, #6fe7ff); }
.ex-card {
  border: 1px solid rgba(111, 231, 255, 0.16);
  border-left: 3px solid var(--tone);
  background: rgba(8, 20, 30, 0.7);
  padding: 8px 10px;
  margin-bottom: 6px;
}
.ex-card.on { background: rgba(14, 30, 42, 0.92); }
.ex-card header, .ex-detail header { display: flex; align-items: center; gap: 8px; }
.ex-card header b, .ex-detail header b { flex: 1; font-size: 15px; color: #e8f4fb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-chip { font: 700 12px ui-monospace, monospace; letter-spacing: 0.08em; color: #04070c; background: var(--tone); padding: 2px 5px; white-space: nowrap; }
.ex-dist { font: 13px ui-monospace, monospace; color: #8fa6b6; }
.ex-hook, .ex-step, .ex-lore { margin: 6px 0; font-size: 14px; color: #b9cbd6; line-height: 1.4; }
.ex-step em { color: var(--tone); font-style: normal; }
.ex-warn { display: block; font: 700 12px ui-monospace, monospace; color: #ffb454; margin: 2px 0 4px; }
.ex-bar { display: block; height: 5px; background: rgba(111, 231, 255, 0.12); margin: 4px 0 6px; }
.ex-bar > i { display: block; height: 100%; background: var(--tone); transition: width 0.25s; }
.ex-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ex-actions button, .ex-top button, .ex-detail header button {
  min-height: 32px; padding: 0 10px; font: 700 12px ui-monospace, monospace; letter-spacing: 0.08em;
  background: #0d1d29; color: #cfe3ee; border: 1px solid rgba(111, 231, 255, 0.25); cursor: pointer;
}
.ex-actions .ex-go, .ex-top .ex-go { background: #123528; color: #74f0b0; border-color: #2c7a59; }
.ex-actions button:disabled { opacity: 0.4; cursor: default; }
.ex-quiet { opacity: 0.75; }
.ex-log { margin: 0; padding-left: 18px; font: 13px ui-monospace, monospace; color: #9fb3c8; line-height: 1.5; }
.ex-detail { border-left: 3px solid var(--tone); padding: 4px 0 4px 10px; }
.ex-who { font-size: 14px; color: #cfe3ee; margin: 4px 0; }
.ex-stages { margin: 8px 0; padding-left: 20px; font-size: 14px; color: #8fa6b6; }
.ex-stages li.done { color: #74f0b0; text-decoration: line-through; }
.ex-stages li.now { color: #e8f4fb; font-weight: 700; }
.ex-traits { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: #cfe3ee; }
.ex-traits li { background: rgba(111, 231, 255, 0.08); padding: 3px 6px; }
.ex-traits li span { color: #8fa6b6; margin-right: 5px; text-transform: uppercase; font-size: 12px; letter-spacing: 0.08em; }
.ex-interior { margin-top: 10px; }
.ex-sub { font: 700 12px ui-monospace, monospace; letter-spacing: 0.1em; color: #8fa6b6; margin-bottom: 6px; }
.ex-interior svg { max-width: 100%; height: auto; background: rgba(4, 10, 16, 0.8); border: 1px solid rgba(111, 231, 255, 0.12); }
.ex-interior line { stroke: rgba(143, 166, 182, 0.35); stroke-width: 3; }
.ex-interior line.seen { stroke: var(--tone); }
.ex-room rect { fill: #0c1822; stroke: rgba(143, 166, 182, 0.4); stroke-width: 1.5; }
.ex-room.seen rect { fill: #142b3a; stroke: var(--tone); }
.ex-room.goal rect { stroke-dasharray: 3 2; }
.ex-room.f-hazard.seen rect { stroke: #ff6b5e; }
.ex-room text { font: 700 13px ui-monospace, monospace; fill: #cfe3ee; text-anchor: middle; }

@media (max-width: 720px) {
  .explore-overlay { padding: 0; align-items: stretch; }
  .explore-card { width: 100%; max-height: none; height: 100%; padding: 14px 10px 28px; border: 0; }
  .ex-top { flex-direction: column; align-items: stretch; }
  .ex-actions button { flex: 1 1 auto; min-height: 38px; }
}

.explore-signal {
  font: 700 12px ui-monospace, monospace;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  background: rgba(4, 10, 16, 0.78);
  border: 1px solid rgba(116, 240, 176, 0.35);
  color: #8fa6b6;
  pointer-events: none;
}
.explore-signal.band-cold { color: #8fd3ff; border-color: rgba(143, 211, 255, 0.45); }
.explore-signal.band-warm { color: #ffb454; border-color: rgba(255, 180, 84, 0.55); }
.explore-signal.band-hot { color: #ff6b5e; border-color: rgba(255, 107, 94, 0.6); }
.explore-signal.band-lock { color: #74f0b0; border-color: #74f0b0; }
.ex-signal { font: 700 12px ui-monospace, monospace; letter-spacing: 0.1em; margin: 4px 0 2px; color: #8fa6b6; }
.ex-signal.band-cold { color: #8fd3ff; }
.ex-signal.band-warm { color: #ffb454; }
.ex-signal.band-hot { color: #ff6b5e; }
.ex-signal.band-lock { color: #74f0b0; }
.ex-signal .ex-bar { margin-top: 3px; }

/* ---------- mining (D160) ---------- */
.haul-mode { display: inline-flex; gap: 4px; margin-left: 6px; }
.haul-mode .haul-action { min-height: 28px; padding: 3px 6px; }

.mine-sheet { width: min(520px, 94vw); z-index: 38; }
.mine-body { display: flex; flex-direction: column; gap: 7px; max-height: 52vh; overflow: auto; }
.mine-predict { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.mine-cell { border: 1px solid rgba(255,192,106,.18); background: rgba(8,17,27,.78); padding: 7px 8px; }
.mine-cell span { display: block; font: 700 11px ui-monospace, monospace; letter-spacing: .08em; color: var(--muted); }
.mine-cell b { display: block; margin-top: 2px; color: var(--ink); font-size: 15px; }
.mine-cell em { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-style: normal; }
.mine-site { display: grid; gap: 2px; padding: 7px 8px; border: 1px solid var(--line); background: rgba(6,12,20,.55); }
.mine-site.on { border-color: rgba(255,180,84,.45); }
.mine-site b { color: var(--ink); font-size: 12px; }
.mine-site em { color: var(--muted); font-size: 11px; font-style: normal; }
.mine-site span { color: var(--muted); font-size: 11px; }
.mine-seam.spent { opacity: .55; }
.mine-seam.hard { border-color: rgba(255,107,94,.4); color: rgba(255,107,94,.8); }
.mine-rock { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px; border: 1px solid rgba(255,192,106,.18); background: rgba(8,17,27,.78); }
.mine-rock b { color: var(--ink); font-size: 13px; }
.mine-rock em { color: var(--muted); font-size: 12px; font-style: normal; }
.mine-seams { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.mine-seam { min-width: 112px; border: 1px solid var(--line); background: rgba(6,12,20,.75); color: var(--muted); padding: 6px; }
.mine-seam.ready { border-color: rgba(255,180,84,.35); color: var(--ink); }
.mine-seam button { width: 100%; margin-top: 5px; }
.mine-cut { border-color: rgba(255,180,84,.45); color: var(--amber); }
@media (max-width: 720px) {
  /* The phone opens the same sheet from the ship pane; let the whole sheet scroll and stack the
     prediction cards two across. */
  .mine-sheet { left: 12px; right: 12px; width: auto; max-height: calc(100% - 148px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
  .mine-body { max-height: none; overflow: visible; }
  .mine-predict { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- workshop (D136) ---------- */

.craft-card { width: min(980px, 94vw); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.craft-body { flex: 1 1 auto; min-height: 0; padding: 10px 14px 20px; overflow: auto; }
.craft-top { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.craft-level, .craft-bench, .craft-space {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(8, 17, 27, 0.72);
}
.craft-level b, .craft-bench b, .craft-space b { font-size: 15px; letter-spacing: 0.06em; }
.craft-level em, .craft-bench em, .craft-space em { font-size: 12px; font-style: normal; color: var(--muted); }
.craft-bar { display: block; height: 5px; margin-top: 4px; background: rgba(111, 231, 255, 0.12); }
.craft-bar > i { display: block; height: 100%; background: var(--amber); }
.craft-xp { font-size: 12px; color: var(--amber); letter-spacing: 0.08em; }
.craft-hint { font-size: 11px; color: var(--faint); }
.craft-mats { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 6px; margin-bottom: 10px; }
.craft-mat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 6px 8px;
  border: 1px solid rgba(111, 231, 255, 0.12);
  background: rgba(6, 12, 20, 0.6);
}
.craft-mat.full { border-color: rgba(255, 180, 84, 0.35); }
.craft-mat-name { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.craft-mat b { font-size: 15px; color: var(--ink); text-align: right; }
.craft-pips { grid-column: 1 / -1; display: flex; gap: 2px; margin-top: 2px; }
.craft-pips i { width: 100%; height: 5px; background: rgba(111, 231, 255, 0.1); border: 1px solid rgba(111, 231, 255, 0.12); }
.craft-pips i.part { background: rgba(255, 180, 84, 0.35); }
.craft-pips i.on { background: var(--amber); border-color: var(--amber); }
.craft-mat em { grid-column: 1 / -1; font-size: 11px; font-style: normal; color: var(--faint); }
.craft-list { display: flex; flex-direction: column; gap: 5px; }
.craft-row {
  display: grid;
  grid-template-columns: 34px 1fr 74px 112px;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(111, 231, 255, 0.12);
  background: rgba(6, 12, 20, 0.62);
}
.craft-row.can { border-color: rgba(255, 180, 84, 0.3); }
.craft-row.locked { opacity: 0.72; }
.craft-tier { font-size: 12px; color: var(--amber); border: 1px solid rgba(255, 180, 84, 0.35); padding: 3px 4px; text-align: center; }
.craft-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.craft-info b { font-size: 13px; letter-spacing: 0.05em; }
.craft-info b small { font-size: 11px; color: var(--muted); margin-left: 6px; }
.craft-info em { font-size: 12px; font-style: normal; color: var(--muted); }
.craft-parts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--faint); }
.craft-parts .low { color: var(--red); }
.craft-cost { font-size: 15px; text-align: right; color: var(--ink); }
.craft-cost small { display: block; font-size: 11px; color: var(--muted); }
.craft-row button { min-height: 34px; border: 1px solid var(--amber); color: var(--amber); font-size: 12px; letter-spacing: 0.06em; }
.craft-row button:disabled { border-color: rgba(111, 231, 255, 0.12); color: var(--faint); }
@media (max-width: 720px) {
  .craft-top { grid-template-columns: 1fr; }
  .craft-row { grid-template-columns: 30px 1fr; }
  .craft-cost, .craft-row button { grid-column: 2; text-align: left; }
  .craft-row button { min-height: 40px; }
}

/* D150: a low hull has a way out. PING answers with a station and a course; the cradle heals under a
   station shield. */
.distress-btn { color: var(--amber); border-color: rgba(255, 180, 84, 0.34); }
.distress-btn.critical {
  color: #ff6b5e;
  border-color: rgba(255, 107, 94, 0.72);
  background: rgba(255, 107, 94, 0.12);
  animation: distressPulse 1.4s ease-in-out infinite;
}
@keyframes distressPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 107, 94, 0); }
  50% { box-shadow: 0 0 14px rgba(255, 107, 94, 0.45); }
}
.station-repair { margin: 14px 0 0; }
.repair-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid rgba(255, 180, 84, 0.3);
  background: rgba(255, 180, 84, 0.06);
}
.repair-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 220px; }
.repair-copy b { font-size: 12px; letter-spacing: 0.12em; color: var(--amber); font-weight: 500; }
.repair-copy em { font-style: normal; font-size: 12px; line-height: 1.5; color: var(--muted); }
.repair-go {
  flex: none;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 180, 84, 0.55);
  background: rgba(255, 180, 84, 0.14);
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.repair-go:hover { background: rgba(255, 180, 84, 0.24); }
.repair-bar { display: block; width: 100%; height: 3px; background: #12212c; margin-top: 2px; }
.repair-bar i { display: block; height: 100%; background: var(--amber); transition: width 0.25s linear; }
.repair-drone {
  flex: 1 1 100%;
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 180, 84, 0.16);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* D225: notification router (client/web/notify/). Calls held in a fight wait as a slow amber lamp;
   repeats collapse into a ×n badge; an emergency frames the whole cockpit in a pulsing red/amber rim. */
.dash-lamp[data-tone="call"] { border-color: rgba(255, 180, 84, 0.55); color: var(--amber); }
.dash-lamp[data-tone="call"].is-on .lamp-bulb { animation: lamp-pulse 3.6s ease-in-out infinite; }
.dash-lamp[data-tone="idle"] { border-color: rgba(160, 176, 196, 0.3); color: #a9b6c6; }
.dash-lamp[data-tone="idle"].is-on .lamp-bulb { animation-duration: 4.4s; }
.toast-count,
.notice-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 4px;
  border: 1px solid currentColor;
  font-size: 11px;
  line-height: 12px;
  opacity: 0.8;
}
.notice-row.held time { color: var(--amber); }
body.sf-emergency::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  border: 3px solid rgba(255, 64, 64, 0.85);
  box-shadow: inset 0 0 36px rgba(255, 40, 40, 0.28);
  animation: sf-emergency-rim 1.4s ease-in-out infinite;
}
body.sf-emergency[data-emergency-tone="amber"]::after {
  border-color: rgba(255, 180, 84, 0.85);
  box-shadow: inset 0 0 36px rgba(255, 160, 60, 0.24);
}
@keyframes sf-emergency-rim { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  body.sf-emergency::after { animation: none; }
  .dash-lamp[data-tone="call"].is-on .lamp-bulb { animation: none; opacity: 0.5; }
}
/* D239: generated icons in the hold grid and the ability energy cost. */
.hold-cell .gen-icon { width: 86%; height: 86%; object-fit: contain; image-rendering: pixelated; pointer-events: none; }
.gen-icon.ic-energy { width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-left: 2px; image-rendering: pixelated; }
.ex-room image { pointer-events: none; }

/* D260: the cockpit's smallest type is legible at a desk. Hundreds of hand-set sizes bottom out at
   6-8 px, and the D110 UI SCALE control zooms the whole view (a layout change), so it cannot fix
   type on its own. Same selectors, one to three pixels larger, on the desktop shape only: the phone
   layout was drawn for thumbs and keeps its own sizes. */
@media (min-width: 900px) {
  kbd { font-size: 12px; }
  .brand span { font-size: 12px; }
  .pilot b { font-size: 14px; }
  .pilot span { font-size: 12px; }
  #hullText { font-size: 14px; }
  .scrap-hud b { font-size: 13px; }
  .net { font-size: 13px; }
  /* The HUD is a key strip, not a reading panel. D260's desktop floor raises the rest of the type, but
     this row is duplicated navigation and must stay compact rather than become a bank of 10 px buttons. */
  .hud-btn { font-size: 11px; }
  .readout em { font-size: 12px; }
  .eyebrow { font-size: 12px; }
  .chip { font-size: 12px; }
  .deck-open { font-size: 12px; }
  /* The Vessel top bar is one line of small controls. Hold it at the 8 px floor so the wider rail can
     fit the title, the state chip and all five buttons without a horizontal scrollbar. */
  .pane-actions .chip,
  .pane-actions .deck-open { font-size: 11px; padding: 3px 5px; }
  .deck-hint { font-size: 12px; }
  .legend { font-size: 12px; }
  /* Crew: the room line and the drill percent are the two things a captain reads mid-fire. */
  .crew-copy b { font-size: 12px; }
  .crew-copy em { font-size: 11px; }
  .crew-mastery small { font-size: 11px; }
  .module-chip b { font-size: 12px; }
  .module-chip em { font-size: 11px; }
  .salvage-empty { font-size: 12px; }
  .refit-row b { font-size: 12px; }
  .refit-row em { font-size: 11px; }
  .refit-level { font-size: 12px; }
  .refit-cost { font-size: 12px; }
  .contract-head span:last-child { font-size: 12px; }
  .contract b { font-size: 13px; }
  .contract p { font-size: 12px; }
  .contract-foot { font-size: 12px; }
  .contract-job { font-size: 12px; }
  .section-head { font-size: 12px; }
  .sys { font-size: 12px; }
  .sys .pwr { font-size: 12px; }
  .queue-mini { font-size: 12px; }
  .log { font-size: 12px; }
  /* The gun rack: a card says why it is not firing, and that line has to be readable. */
  .weapon-rack-head { font-size: 12px; }
  .weapon-arm { font-size: 12px; }
  .weapon-lead { font-size: 12px; }
  .weapon-target-label { font-size: 12px; }
  .weapon-target-pick { font-size: 12px; }
  .weapon-target-bear { font-size: 11px; }
  .weapon-head b { font-size: 12px; }
  .weapon-head em { font-size: 11px; }
  .weapon-gun-id { font-size: 11px; }
  .weapon-spec { font-size: 11px; }
  .weapon-feed { font-size: 11px; }
  .weapon-target { font-size: 11px; }
  .weapon-state { font-size: 11px; }
  .weapon-side-btn, .weapon-auto, .weapon-target-btn { font-size: 11px; }
}

/* D263: the station sponsor board's card. The board itself is a truss in the sector; this is the sheet a
   tap opens, styled as a hail so it never reads as a second kind of window. */
.hail.billboard { border-color: rgba(255, 180, 84, 0.35); }
#billboardText { color: #9fb4c8; }
.ad-slot { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(3, 6, 10, 0.88); }
.ad-slot-card { width: min(420px, 86vw); padding: 18px; display: grid; gap: 10px; background: #0b1018; border: 1px solid #1b2735; text-align: center; }
.ad-slot-copy { margin: 0; color: #9fb4c8; }
.ad-slot-clock { font-size: 28px; color: #ffb454; }
