/* Instructor console — same night-console family as the trainee radar, but a
   desk tool rather than an instrument: denser type, more chrome, and the fault
   controls in warning colours so they can never be mistaken for radar controls. */
:root {
  --bg:      #050907;
  --panel:   #0a1310;
  --line:    #173a25;
  --line-hi: #2f7d4b;
  --green:   #00e018;
  --green-br:#7ff0a8;
  --dim:     #6fae86;
  --amber:   #ff9d2e;
  --red:     #ff4a4a;
  --text:    #cfe9d8;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 12px/1.4 ui-monospace, "Cascadia Code", Consolas, monospace;
  overflow: hidden;
}
#app {
  display: grid;
  grid-template-columns: 232px 1fr;    /* fault rail · centre */
  grid-template-rows: 44px 1fr 58px;   /* top bar · work area · bottom strip */
  height: 100vh;
}

/* ── top bar ─────────────────────────────────────────────────────────────── */
#topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line-hi);
}
#brand { font-size: 14px; letter-spacing: .06em; color: var(--text); }
#brand b { color: var(--green-br); }
#topbar .sp { flex: 1; }
#allbar { display: flex; align-items: center; gap: 8px; }
#allbar .lbl { font-size: 10px; letter-spacing: .12em; color: var(--dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.bad { background: var(--red); box-shadow: 0 0 6px var(--red); }

.btn {
  font: 700 11px ui-monospace, monospace; letter-spacing: .06em;
  padding: 6px 12px; cursor: pointer;
  color: var(--text); background: #10241a;
  border: 1px solid var(--line-hi); border-radius: 4px;
}
.btn:hover:not(:disabled) { background: #16351f; color: #fff; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.warn { border-color: #7a3a12; background: #2a1408; color: var(--amber); }
.btn.warn:hover:not(:disabled) { background: #3a1d0b; }
.btn.on { border-color: #7a1414; background: #2a0c0c; color: #ff9c9c; }
.btn.sm { padding: 3px 9px; font-size: 10px; }
/* ALL: PAUSE / RESUME — a split across stations lights neither button, so mark
   both as indeterminate rather than leaving them looking simply "off". */
.btn.mixed { border-color: #7a5a12; background: #2a220c; color: #ffd27a; }
.all-state {
  min-width: 74px; text-align: center; padding: 2px 6px; border-radius: 3px;
  font: 700 10px ui-monospace, monospace; letter-spacing: .06em;
  color: var(--dim); border: 1px solid var(--line-hi);
}
.all-state.run   { color: #7bf29a; border-color: #2f7d4b; background: #0c2c1a; }
.all-state.hold  { color: #ff9c9c; border-color: #7a1414; background: #2a0c0c; }
.all-state.split { color: #ffd27a; border-color: #7a5a12; background: #2a220c; }
.btn.wide { width: 100%; margin-top: 5px; }

/* ── station grid ────────────────────────────────────────────────────────── */
#grid {
  position: absolute; inset: 0;
  overflow: auto; padding: 12px;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  align-content: start;
}
.empty { color: var(--dim); padding: 40px; text-align: center; line-height: 1.8; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; cursor: pointer;
}
.card.sel { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.card.offline { opacity: .65; }
.c-head {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; background: #0d1f16; border-bottom: 1px solid var(--line);
}
.c-name { flex: 1; font-weight: 700; letter-spacing: .05em; color: var(--green-br); }
.pill { font: 700 10px ui-monospace, monospace; letter-spacing: .1em; padding: 2px 8px; border-radius: 3px; }
.pill.run  { color: #04210c; background: var(--green); }
.pill.hold { color: #2a1a00; background: var(--amber); }
.pill.off  { color: #fff; background: #7a1414; }

.c-zoom {
  background: none; border: 1px solid var(--line-hi); border-radius: 3px;
  color: var(--green-br); font-size: 13px; line-height: 1; padding: 2px 7px; cursor: pointer;
}
.c-zoom:hover { background: #16351f; }

.c-body { display: grid; grid-template-columns: 1fr 152px; }
.c-frame { position: relative; aspect-ratio: 16 / 10; background: #000; overflow: hidden; }
/* The console is a fixed 1280×800 page; main.ts scales it to whatever slot the
   tile gives it, so enlarging a station is purely a layout change. */
.c-frame iframe { position: absolute; inset: 0; width: 1280px; height: 800px; border: 0;
  transform-origin: top left; transform: scale(0.45); pointer-events: none; }

/* Enlarged: one station fills the whole grid area. The default grid is
   align-content:start so tiles stay their natural height; in focus mode the
   single row must stretch instead, or the card stays tile-sized. */
#grid.focus-mode {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-content: stretch;
  height: 100%;
  overflow: hidden;
}
.card.focused { display: flex; flex-direction: column; height: 100%; }
.card.focused .c-body { flex: 1; grid-template-columns: 1fr 200px; min-height: 0; }
.card.focused .c-frame { aspect-ratio: auto; height: 100%; }
.card.focused .c-stats { font-size: 12px; }
.f-off { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--red); font-size: 11px; text-align: center; padding: 10px; }

.c-stats { padding: 8px 10px; border-left: 1px solid var(--line); font-size: 11px; }
.c-stats dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 6px 0 0; }
.c-stats dt { color: var(--dim); font-size: 10px; }
.c-stats dd { margin: 0; color: var(--text); }
.s-exer { color: var(--green-br); }
.s-exer.muted, .s-faults.muted { color: var(--dim); }
.s-faults { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 3px; font-size: 10px; }
.fchip { padding: 1px 6px; border-radius: 3px; background: #3a1d0b; color: var(--amber); border: 1px solid #7a3a12; }

/* ── side panels ─────────────────────────────────────────────────────────── */
#rail {
  /* Scroll rather than hide: on a short window overflow:hidden swallowed rows
     silently, which reads as "those faults were removed". */
  overflow-x: hidden; overflow-y: auto; background: var(--panel);
  border-right: 1px solid var(--line-hi); padding: 8px 8px 6px;
  display: flex; flex-direction: column;
}
#rail h2 {
  display: flex; align-items: baseline; gap: 6px; margin: 0 0 4px;
  font-size: 12px; letter-spacing: .12em; color: var(--green-br);
  border-bottom: 1px solid var(--line); padding-bottom: 3px;
}
#rail h2.mt { margin-top: 8px; }
#rail h2 .target { margin-left: auto; font-size: 10px; letter-spacing: 0; color: var(--dim); }
#centre { position: relative; overflow: hidden; }
.panel { margin-bottom: 8px; }
.panel h2 {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 5px;
  font-size: 12px; letter-spacing: .14em; color: var(--green-br);
  border-bottom: 1px solid var(--line); padding-bottom: 3px;
}
.panel h2 .target { margin-left: auto; font-size: 10px; letter-spacing: 0; color: var(--dim); }
.note { font-size: 10px; color: var(--dim); line-height: 1.5; margin: 8px 0 0; }
.row { display: flex; gap: 6px; }
.row .btn { flex: 1; }
.fld { display: block; margin: 5px 0 0; }
.fld span { display: block; font-size: 10px; letter-spacing: .1em; color: var(--dim); margin-bottom: 3px; }
.fld select {
  width: 100%; padding: 5px 6px; border-radius: 3px;
  background: #06180f; color: var(--text); border: 1px solid var(--line-hi);
  font: 11px ui-monospace, monospace;
}

/* No prose — the explanation is the row's tooltip. In the RAIL the name gets a
   line to itself and the controls sit under it, so a long name is never clipped;
   the strip overrides this back to a single line. */
.frow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 3px 5px; border-bottom: 1px solid #102a19;
}
.frow:hover { background: #0b1f14; }
.f-name {
  flex: 1 0 100%;
  font-weight: 700; font-size: 12px; letter-spacing: .04em; color: var(--amber);
}
.f-params { display: flex; gap: 3px; }
.pin {
  width: 58px; padding: 2px 4px; border-radius: 3px;
  background: #06180f; color: var(--text); border: 1px solid var(--line-hi);
  font: 11px ui-monospace, monospace;
}

/* ── bottom strip: sensor / navigation-input faults ──────────────────────── */
#bottombar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px; padding: 0 8px;
  background: var(--panel); border-top: 1px solid var(--line-hi); overflow-x: auto;
}
#bottombar .bb-label {
  font-size: 10px; letter-spacing: .12em; color: var(--dim); white-space: nowrap;
}
#bottombar .bb-label b { color: var(--green-br); font-weight: 700; }
#bottombar .bb-sep { width: 1px; align-self: stretch; margin: 8px 2px; background: var(--line-hi); }
#sensors, #equipment { display: flex; align-items: center; gap: 5px; }
#equipment .frow, #sensors .frow { flex: 0 0 auto; }
/* Reuse the fault-row markup, laid out horizontally for the strip. */
#sensors .frow, #equipment .frow {
  border: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 5px;
  padding: 4px 7px; background: #0a1b12; gap: 5px;
}
#sensors .frow:hover, #equipment .frow:hover { background: #10281a; }
#sensors .f-name, #equipment .f-name { flex: 0 0 auto; font-size: 11px; }
#sensors .pin, #equipment .pin { width: 42px; }

/* ── per-target faults ───────────────────────────────────────────────────── */
#targets { max-height: 128px; overflow-y: auto; }
#targets .t-empty { padding: 8px 4px; font-size: 10px; color: var(--dim); }
#targets .trow {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 5px; border-bottom: 1px solid #102a19;
}
#targets .t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
#targets .t-pos { font-size: 9px; color: var(--dim); white-space: nowrap; }
#targets .tchip {
  padding: 2px 6px; cursor: pointer; white-space: nowrap;
  font: 700 9px ui-monospace, monospace; letter-spacing: .04em;
  color: var(--dim); background: #0a1b12;
  border: 1px solid var(--line); border-radius: 3px;
}
#targets .tchip:hover { border-color: var(--line-hi); color: var(--text); }
#targets .tchip.on { color: #ffd9a8; background: #3a1d0b; border-color: #7a3a12; }
#fault-pending span { color: var(--amber); }

/* ── messages: a movable popup, like the trainee's ───────────────────────── */
#chat-pop {
  position: fixed; left: 240px; top: 110px; width: 380px; height: 380px;
  min-width: 280px; min-height: 240px;
  display: flex; flex-direction: column; z-index: 200;
  background: var(--panel); border: 1px solid var(--line-hi); border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .7);
  resize: both; overflow: hidden;
}
#chat-pop[hidden] { display: none; }
#chat-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; cursor: move;
  background: #0d1f16; border-bottom: 1px solid var(--line-hi);
}
#chat-head #chat-title { font: 700 12px ui-monospace, monospace; letter-spacing: .1em; color: var(--green-br); }
#chat-head .target { font-size: 10px; color: var(--dim); }
#chat-head .sp { flex: 1; }
#chat-head button {
  font: 700 10px ui-monospace, monospace; padding: 3px 9px; cursor: pointer;
  color: var(--text); background: #10241a; border: 1px solid var(--line-hi); border-radius: 3px;
}
.chat-send-row { display: flex; gap: 5px; padding: 7px 8px; border-top: 1px solid var(--line); }
#open-chat.alert { border-color: var(--amber); color: var(--amber); }

#chat-log {
  flex: 1; overflow-y: auto; padding: 7px 8px;
  background: #071410; border: 0;
}
#chat-log .chat-row { margin-bottom: 8px; }
#chat-log .c-who { font: 700 9px ui-monospace, monospace; letter-spacing: .08em; }
#chat-log .chat-row.ins .c-who { color: #7fdcff; }
#chat-log .chat-row.tr  .c-who { color: var(--amber); }
#chat-log .c-time { margin-left: 6px; font-size: 9px; color: var(--dim); }
#chat-log .c-text {
  margin-top: 2px; padding: 4px 7px; border-radius: 4px;
  font: 11px/1.45 ui-monospace, monospace; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
#chat-log .chat-row.ins .c-text { background: #0d2233; border: 1px solid #1d4a66; }
#chat-log .chat-row.tr  .c-text { background: #2a1d08; border: 1px solid #5c4213; }
.chat-to { display: flex; gap: 10px; padding: 6px 8px 0; }
.pick { flex: 1; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.pick span { font-size: 10px; letter-spacing: .06em; color: var(--dim); }
.pick input:checked + span { color: var(--green-br); }
#chat-text {
  flex: 1; min-width: 0; padding: 6px 7px; border-radius: 3px;
  background: #06180f; color: var(--text); border: 1px solid var(--line-hi);
  font: 11px ui-monospace, monospace;
}
#chat-text:focus { outline: none; border-color: var(--green); }

/* ── access gate ─────────────────────────────────────────────────────────── */
#gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #04120a 0%, #000 70%);
}
#gate .g-box {
  width: 430px; padding: 32px 34px 28px; text-align: center;
  background: var(--panel); border: 1px solid var(--line-hi); border-radius: 10px;
}
#gate .g-title { font-size: 21px; font-weight: 700; letter-spacing: .05em; color: var(--green-br); }
#gate .g-sub { font-size: 15px; color: var(--dim); margin: 10px 0 22px; }
#gate .g-cells { display: flex; gap: 10px; justify-content: center; }
#gate .g-cell {
  width: 50px; height: 62px; text-align: center;
  font: 700 30px/1 ui-monospace, monospace; color: var(--green-br);
  background: #06180f; border: 1px solid var(--line-hi); border-radius: 7px;
}
#gate .g-cell:focus { outline: none; border-color: var(--green); box-shadow: 0 0 8px rgba(0, 224, 24, .5); }
#gate .g-msg { min-height: 22px; margin: 16px 0 6px; font-size: 15px; color: var(--dim); }
#gate .g-msg.bad { color: var(--red); }
#gate .g-go {
  width: 100%; padding: 13px 0; border: none; border-radius: 7px; cursor: pointer;
  font: 700 16px/1 ui-monospace, monospace; letter-spacing: .14em;
  color: #000; background: var(--green);
}
#gate .g-go:disabled { background: #0d3a0d; color: #2a6a2a; cursor: default; }


/* ── top-bar tabs ─────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 3px; margin-left: 8px; }
.tab {
  font: 700 11px ui-monospace, monospace; letter-spacing: .08em;
  padding: 5px 14px; cursor: pointer; border-radius: 4px 4px 0 0;
  color: var(--dim); background: #0a1b12; border: 1px solid var(--line);
  border-bottom: none;
}
.tab.on { color: #04210c; background: var(--green); border-color: var(--green); }
#topbar .lbl { font-size: 10px; letter-spacing: .12em; color: var(--dim); }
#topbar .bar-sep { width: 1px; height: 22px; background: var(--line-hi); margin: 0 4px; }

/* ── chart tab ────────────────────────────────────────────────────────────── */
#chart-pane { position: absolute; inset: 0; display: flex; flex-direction: column; background: #04120b; }
#chart-pane[hidden] { display: none; }
#chart-tools {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--panel); border-bottom: 1px solid var(--line-hi);
}
#chart-tools .sp { flex: 1; }
#chart-tools .ct-label { font-size: 10px; letter-spacing: .12em; color: var(--dim); white-space: nowrap; }
#chart-tools .ct-label b { color: var(--green-br); }
#chart-tools .ct-hint { font-size: 10px; color: var(--dim); }
#ct-range { font: 700 11px ui-monospace, monospace; color: var(--green-br); min-width: 56px; text-align: center; }
#chart { flex: 1; width: 100%; display: block; cursor: default; }

/* Floating panel for the selected target. */
#chart-sel {
  position: absolute; right: 14px; bottom: 14px; width: 244px; padding: 9px 10px;
  background: var(--panel); border: 1px solid var(--green); border-radius: 6px;
  box-shadow: 0 6px 22px rgba(0,0,0,.7);
}
#chart-sel[hidden] { display: none; }
#chart-sel .cs-name { font: 700 12px ui-monospace, monospace; color: var(--green-br); }
#chart-sel .cs-pos { font-size: 10px; color: var(--dim); margin: 2px 0 7px; }
/* Three per-ship faults now share this row (AIS FAIL / SART / FALSE ECHO);
   wrapping keeps the longest label readable instead of clipping it. */
#chart-sel .cs-btns { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
#chart-sel .cs-btns .btn { flex: 1 1 62px; padding-inline: 4px; }
#chart-sel .cs-row { display: flex; align-items: flex-end; gap: 5px; }
#chart-sel .cs-row label { font-size: 9px; color: var(--dim); display: flex; flex-direction: column; gap: 2px; }
#chart-sel .cs-row input {
  width: 52px; padding: 2px 4px; border-radius: 3px;
  background: #06180f; color: var(--text); border: 1px solid var(--line-hi);
  font: 11px ui-monospace, monospace;
}
#chart-sel .cs-note { margin-top: 7px; font-size: 9px; color: var(--dim); }

/* ── popups (exercise · sart/ais · messages) ──────────────────────────────── */
.pop {
  position: fixed; left: 280px; top: 110px; width: 340px;
  display: flex; flex-direction: column; z-index: 200;
  background: var(--panel); border: 1px solid var(--line-hi); border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,.7);
  resize: both; overflow: hidden;
}
.pop[hidden] { display: none; }
#chat-pop { width: 380px; height: 380px; min-width: 280px; min-height: 240px; }
#tgt-pop { width: 320px; height: 300px; }
.pop-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; cursor: move;
  background: #0d1f16; border-bottom: 1px solid var(--line-hi);
}
.pop-head .pop-title { font: 700 12px ui-monospace, monospace; letter-spacing: .1em; color: var(--green-br); }
.pop-head .target { font-size: 10px; color: var(--dim); }
.pop-head .sp { flex: 1; }
.pop-head button {
  font: 700 10px ui-monospace, monospace; padding: 3px 9px; cursor: pointer;
  color: var(--text); background: #10241a; border: 1px solid var(--line-hi); border-radius: 3px;
}
.pop-body { padding: 9px 10px; overflow-y: auto; flex: 1; }

/* Strip chips: a single toggle each, so ten fit across without scrolling. */
#equipment .frow, #sensors .frow {
  padding: 3px 4px; gap: 3px;
}
.btn.chip { letter-spacing: 0; padding: 4px 6px; }
.btn.chip.on { border-color: #7a3a12; background: #3a1d0b; color: var(--amber); }
#equipment .pin, #sensors .pin { width: 40px; }

/* Strip rows stay on ONE line — a chip is a single toggle, so it never needs the
   rail's two-line treatment. */
#equipment .frow, #sensors .frow { flex-wrap: nowrap; }
#equipment .f-name, #sensors .f-name { flex: 0 0 auto; }

/* Fault state at a glance: SET lights when the fault IS in force, CLR lights
   when it is not, so a rail row reads without opening anything. */
.btn.sm.lit { border-color: var(--line-hi); background: #10241a; color: var(--green-br); }
.btn.on { border-color: #7a3a12; background: #3a1d0b; color: var(--amber); }
#st-pause.on, #st-resume.on { border-color: var(--green); background: #12401f; color: var(--green-br); }

/* ── parameter fields ─────────────────────────────────────────────────────────
   The spin buttons are what made a narrow field look like it held stray
   characters — at 42px the arrows sat on top of the digits. Off everywhere, and
   the field is wide enough for a signed one-decimal value. */
.pin::-webkit-outer-spin-button,
.pin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pin { -moz-appearance: textfield; appearance: textfield; text-align: center; }

/* Captioned field: the caption sits above so "lat °" and "lat ′" are readable
   without hovering — an offset is meaningless if you cannot see its units. */
.pinw { display: flex; flex-direction: column; gap: 0; }
.pinw > span {
  font-size: 8px; line-height: 1; letter-spacing: .04em; color: var(--dim); text-align: center;
}
#sensors .pinw .pin, #equipment .pinw .pin { width: 48px; }

/* A parameterised strip fault is a GROUP, not a lone chip: give it a darker
   well and a border so it reads as one unit next to plain toggles like GPS LOST
   and GYRO ERR. */
/* Only the parameterised rows get the well — a plain toggle is its own button
   and a box around it just competes with the chip's own border. */
#sensors .frow.grp, #equipment .frow.grp {
  background: #020a06;
  border: 1px solid var(--line-hi);
  border-radius: 5px;
  padding: 2px 5px;
}
#sensors .frow.grp:hover, #equipment .frow.grp:hover { background: #05130c; }
#sensors .frow:not(.grp), #equipment .frow:not(.grp) { background: none; border: 0; padding: 0; }

/* One convention for state across the whole console:
     .on  = this fault IS in force   (amber, lit)
     .lit = the neutral/cleared side (green outline)
   Used by the rail's SET/CLR, the strip chips, the chart's target panel and
   PAUSE/RESUME, so a lit control always means the same thing. */
#chart-sel .btn.on { border-color: #7a3a12; background: #3a1d0b; color: var(--amber); }
#chart-sel .btn.lit { border-color: var(--line-hi); background: #10241a; color: var(--green-br); }

/* Cursor range/bearing from own ship — a measurement, so give it a fixed width
   and tabular figures or it jitters as the digits change. */
#ct-cursor {
  font: 700 11px ui-monospace, monospace; color: var(--green-br);
  min-width: 108px; text-align: right; font-variant-numeric: tabular-nums;
}
#ct-lock.on { border-color: var(--green); background: #12401f; color: var(--green-br); }

/* ── right-click ship menu (chart) ────────────────────────────────────────────
   Built on demand at the cursor and removed on the next click anywhere, so it
   holds no state that could drift from the 2 Hz chart redraw underneath it. */
#ship-menu {
  position: fixed; z-index: 1200; min-width: 208px; padding: 4px;
  background: var(--panel); border: 1px solid var(--green); border-radius: 5px;
  box-shadow: 0 8px 26px rgba(0,0,0,.75);
}
#ship-menu .sm-head {
  padding: 4px 8px 6px; margin-bottom: 3px;
  border-bottom: 1px solid var(--line-hi);
  font: 700 11px ui-monospace, monospace; color: var(--green-br);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#ship-menu .sm-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 5px 8px; border: 0; border-radius: 3px; background: none;
  color: var(--text); font: 600 11px ui-monospace, monospace; letter-spacing: .03em;
}
#ship-menu .sm-item:hover { background: #16351f; color: #fff; }


/* ── exercise builder popup ───────────────────────────────────────────────── */
#build-pop { width: 420px; }
#build-pop .pop-body { max-height: 72vh; overflow-y: auto; }
#build-pop .row { display: flex; gap: 6px; }
#build-pop .fld.sm { flex: 1; }
#build-pop textarea {
  width: 100%; resize: vertical; padding: 3px 5px; border-radius: 3px;
  background: #06180f; color: var(--text); border: 1px solid var(--line-hi);
  font: 11px ui-monospace, monospace;
}
.bx-sec {
  margin: 10px 0 5px; padding-bottom: 3px; border-bottom: 1px solid var(--line-hi);
  font: 700 10px ui-monospace, monospace; letter-spacing: .08em; color: var(--green-br);
}
.bx-dim { font-weight: 400; color: var(--dim); letter-spacing: 0; }
.bx-note { margin: 4px 0 8px; font-size: 10px; line-height: 1.4; color: var(--dim); }
.bx-row {
  display: flex; align-items: center; gap: 5px; margin-bottom: 4px;
}
.bx-row input, .bx-row select {
  padding: 3px 4px; border-radius: 3px; background: #06180f; color: var(--text);
  border: 1px solid var(--line-hi); font: 11px ui-monospace, monospace; min-width: 0;
}
.bx-row .bx-name { flex: 1 1 40%; }
.bx-row .bx-type { flex: 1 1 44%; }
.bx-row .bx-pos { font-size: 9px; color: var(--dim); white-space: nowrap; }
.bx-row .bx-x {
  cursor: pointer; border: 1px solid #7a1414; background: #2a0c0c; color: #ff9c9c;
  border-radius: 3px; padding: 2px 6px; font: 700 11px ui-monospace, monospace;
}
.bx-row .bx-val { width: 56px; }
.bx-row .bx-w { width: 44px; }
.bx-msg { min-height: 16px; margin: 8px 0 2px; font-size: 10px; line-height: 1.4; }
.bx-msg.ok  { color: #7bf29a; }
.bx-msg.bad { color: #ff9c9c; }

/* A ship stopped by charted land. The loudest state on a tile: nothing else
   there needs the instructor to act before the exercise can continue. */
.pill.aground { color: #fff; background: #7a1414; border-color: #ff5a5a; }
