/* A plain, unglamorous industrial control console. Not a game.
   Monospace throughout, uppercase labels, thin rules, colour used only as
   state: open = green, closed = red, alert = amber. Nothing decorative. */

:root {
  --bg:        #0a0a0a;
  --panel:     #141617;
  --panel-2:   #1b1e1f;
  --rule:      #2a2e30;
  --text:      #d8dcdc;
  --dim:       #868e90;
  --open:      #00ff40;
  --closed:    #ff1a1a;
  --alert:     #ffb000;
  --cyan:      #00e5ff;
  --font:      "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: none;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- top bar */

#topbar {
  display: flex; align-items: baseline; gap: 14px;
  padding: 6px 12px;
  background: #000;
  border-bottom: 1px solid var(--rule);
}
#topbar .brand { color: var(--alert); font-weight: bold; letter-spacing: 2px; }
#topbar .sub { color: var(--dim); font-size: 11px; letter-spacing: 1px; }
#topbar nav { margin-left: auto; display: flex; gap: 16px; font-size: 11px; }

main { padding: 12px; }
.loading { color: var(--dim); padding: 40px; letter-spacing: 3px; }

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

.cols { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.col { flex: 1 1 320px; min-width: 300px; }
.grow { flex: 3 1 640px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  margin-bottom: 12px;
}
.panel > h2 {
  margin: 0; padding: 4px 8px;
  font-size: 11px; letter-spacing: 2px; font-weight: normal;
  color: #000; background: var(--dim);
  text-transform: uppercase;
}
.panel > .body { padding: 8px; }
.panel.alert > h2 { background: var(--alert); }

/* ---------------------------------------------------------------- controls */

label { display: block; font-size: 11px; color: var(--dim); letter-spacing: 1px; margin: 6px 0 2px; }
input, select, textarea {
  width: 100%; padding: 6px 8px;
  background: #000; color: var(--text);
  border: 1px solid var(--rule);
  font-family: var(--font); font-size: 14px;
}
input:focus, select:focus { outline: 1px solid var(--cyan); }

button {
  font-family: var(--font); font-size: 13px; letter-spacing: 1px;
  padding: 8px 14px; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--rule);
  text-transform: uppercase;
}
button:hover:not(:disabled) { background: #24282a; }
button:disabled { color: #4a4f52; cursor: not-allowed; }
button.primary { background: var(--alert); color: #000; border-color: var(--alert); font-weight: bold; }
button.primary:hover:not(:disabled) { background: #ffc733; }
/* A disabled primary must not still read as the thing to press. */
button.primary:disabled { background: var(--rule); color: #6b7375; border-color: var(--rule); }
button.big { width: 100%; padding: 14px; font-size: 16px; }

/* ---------------------------------------------------------------- station */

.stationbox { background: #000; border: 1px solid var(--rule); padding: 4px; }
.stationbox canvas { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- readouts */

.readouts { display: flex; gap: 1px; background: var(--rule); flex-wrap: wrap; }
.readout { flex: 1 1 110px; background: #000; padding: 6px 10px; }
.readout .k { font-size: 10px; color: var(--dim); letter-spacing: 2px; }
.readout .v { font-size: 26px; line-height: 1.1; }
.readout .v.warn { color: var(--alert); }
.readout .v.bad { color: var(--closed); }

/* ------------------------------------------------------------ notification */

#notify {
  width: 100%; padding: 18px; margin-bottom: 12px;
  font-size: 16px; letter-spacing: 2px;
  border: 1px solid var(--rule); background: var(--panel-2); color: var(--dim);
}
#notify.waiting {
  background: var(--alert); color: #000; border-color: var(--alert);
  font-weight: bold;
}
#notify .count { float: right; }

/* ---------------------------------------------------------------- modal */

#veil {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal {
  width: min(760px, 94vw);
  background: var(--panel);
  border: 2px solid var(--dim);
}
.modal.alert { border-color: var(--alert); }
.modal .head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 5px 10px; background: var(--dim); color: #000;
  font-size: 11px; letter-spacing: 2px;
}
.modal.alert .head { background: var(--alert); }
.modal .head .chan { margin-left: auto; }
.modal .content { display: flex; gap: 12px; padding: 12px; }
.modal .portrait {
  width: 160px; height: 160px; flex: 0 0 160px;
  background: #000; border: 1px solid var(--rule); image-rendering: pixelated;
}
.modal .body { flex: 1; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.modal .foot { padding: 8px 12px; border-top: 1px solid var(--rule); text-align: right; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.modal.shake { animation: shake 0.28s linear; }

/* radio: audio only, no transcript, ever */
.radio { text-align: center; padding: 10px 0; }
.radio .bars {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  height: 64px; background: #000; border: 1px solid var(--rule); padding: 0 10px;
}
.radio .bars span {
  width: 6%; background: var(--rule); height: 12%; border-radius: 1px;
  animation: eq 0.8s ease-in-out infinite; animation-play-state: paused;
  transition: background 0.2s;
}
.radio .bars.playing span { background: var(--cyan); animation-play-state: running; }
@keyframes eq { 0%, 100% { height: 12%; } 50% { height: 85%; } }
.radio .state { font-size: 11px; letter-spacing: 3px; color: var(--cyan); margin-top: 8px; }
.radio .state.done { color: var(--dim); }

/* the typewriter caret on a text message while it is being revealed */
.caret { display: inline-block; width: 0.5em; background: var(--cyan); animation: blink 0.8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* a quiet, dismiss-itself confirmation -- unlike the modal, nothing needs
   acknowledging and it never blocks the station canvas */
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  background: var(--panel-2); border: 1px solid var(--open); color: var(--open);
  padding: 10px 14px; font-size: 12px; letter-spacing: 1px;
  opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------------------------------------------------------------- options */

.options { display: flex; flex-direction: column; gap: 6px; }
.options button { text-align: left; text-transform: none; letter-spacing: 0; white-space: normal; }
.options button.correct { border-color: var(--open); color: var(--open); }
.options button.wrong { border-color: var(--closed); color: var(--closed); }
.options button.dunno { color: var(--dim); font-style: italic; }
.verdict { margin-top: 10px; padding: 8px; border: 1px dashed var(--rule); font-size: 13px; }
.verdict .ok { color: var(--open); }
.verdict .no { color: var(--closed); }

/* ---------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { color: var(--dim); font-weight: normal; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
tr.bad td { color: var(--closed); }
tr:hover td { background: var(--panel-2); }

.tag { font-size: 10px; padding: 1px 5px; border: 1px solid var(--rule); letter-spacing: 1px; }
.tag.ok { color: var(--open); border-color: var(--open); }
.tag.no { color: var(--closed); border-color: var(--closed); }
.tag.warn { color: var(--alert); border-color: var(--alert); }

.note { color: var(--dim); font-size: 12px; line-height: 1.6; }
.note strong { color: var(--text); }
.mono-block {
  background: #000; border: 1px solid var(--rule); padding: 8px;
  font-size: 11px; white-space: pre; overflow-x: auto; max-height: 420px; color: var(--dim);
}
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--dim); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 18px; height: 5px; vertical-align: middle; margin-right: 4px; }
