:root {
  color-scheme: dark;
  --ink: #0d1314;
  --text: #edf0e9;
  --muted: #b3c0ba;
  --accent: #ffbf79;
  --accent-line: #ce9f68a6;
  --line: #83939047;
  --green: #9fddca;
  --bad: #ffa48d;
  --mono: Consolas, 'Courier New', monospace;
  --display: Tektur, 'Golos Text', 'Segoe UI', sans-serif;
  --type: 'Golos Text', 'Segoe UI', Arial, sans-serif;
  --edge: clamp(16px, 3vw, 45px);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--text); background: var(--ink); font: 15px/1.55 var(--type); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 47%, transparent 41%, #080d1091 100%);
}

.cover {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: clamp(19px, 3.8vh, 40px) var(--edge);
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 49%, #071012d6 0%, #0b1113ae 29%, #0d14165c 59%, #0a1011b3 100%),
    linear-gradient(0deg, #081011dc 0%, transparent 38%, transparent 65%, #0a1114a1 100%);
}
.cover-mast, .cover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #d2dcd5;
  font: 11px/1.35 var(--mono);
  letter-spacing: .14em;
  text-align: left;
}
.cover-mast { padding-top: 13px; border-top: 1px solid #b2c0b35c; }
.cover-mast b { color: #f2f2e8; }
.cover-mast span:last-child { color: #ebcaa5; white-space: nowrap; }
.signal {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  background: #ffae66;
  box-shadow: 0 0 13px #ffa553b0;
  vertical-align: .08em;
}
.cover-footer { padding-bottom: 12px; border-bottom: 1px solid #b2c0b34b; color: #b6c4bc; font-size: 10px; }
.cover-footer span:last-child { text-align: right; }
.cover-main {
  align-self: center;
  justify-self: center;
  width: min(100%, 740px);
  padding-bottom: clamp(6px, 1.4vh, 16px);
  animation: menu-in .48s ease-out both;
}
.cover-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: 100%;
  margin: 0 0 9px;
  color: var(--accent);
  font: 650 clamp(10px, 1.45vw, 13px)/1.2 var(--mono);
  letter-spacing: .26em;
}
.cover-kicker::before, .cover-kicker::after {
  content: '';
  display: block;
  width: clamp(22px, 4.2vw, 54px);
  height: 1px;
  background: var(--accent-line);
}
.cover-main h1 {
  margin: 0;
  color: #f2f1e7;
  font: 840 clamp(52px, 11.6vw, 166px)/.99 var(--display);
  letter-spacing: -.035em;
  text-shadow: 0 7px 50px #030809b3;
}
.cover-main h2 {
  margin: 6px 0 19px;
  color: #f3d9ba;
  font: 680 clamp(17px, 2.4vw, 33px)/1.2 var(--display);
  text-transform: uppercase;
  letter-spacing: .235em;
  text-indent: .235em;
}
.intro {
  max-width: 420px;
  margin: 0 auto 27px;
  color: #d6ded4;
  font-size: clamp(14px, 1.25vw, 17px);
  text-wrap: balance;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 46px;
  border: 1px solid #f9c78d;
  background: var(--accent);
  color: #22170f;
  padding: 10px 18px;
  font-weight: 740;
  transition: background .17s, box-shadow .17s, transform .17s;
}
.primary:hover:enabled { background: #ffcb94; box-shadow: 0 0 22px #ffaa5c4b; transform: translateY(-1px); }
.primary.start {
  min-width: 246px;
  min-height: 55px;
  justify-content: space-between;
  padding: 10px 20px;
  font: 710 16px/1.25 var(--display);
  letter-spacing: .042em;
}
.primary.start::after { content: '→'; font: 22px/1 var(--mono); }
.player-form { display: grid; justify-items: center; gap: 10px; }
.callsign { display: grid; gap: 4px; width: min(100%, 246px); text-align: left; }
.callsign span, .returning-operator { color: #c8d8cf; font: 700 10px/1.35 var(--mono); letter-spacing: .16em; }
.callsign input {
  width: 100%; min-height: 41px; padding: 7px 11px; color: var(--text);
  border: 1px solid #669688; background: #0b181bea; border-radius: 0;
}
.callsign input::placeholder { color: #a0b2a9; }
.returning-operator { margin: 0; }
.profile-status { max-width: 450px; margin: 0; color: #ffc1aa; font-size: 13px; }
.mission-select {
  align-self: center; justify-self: center; width: min(100%, 630px); padding: clamp(17px, 4vw, 36px);
  border: 1px solid var(--accent-line); border-top: 3px solid var(--accent);
  background: #0c181bf6; box-shadow: 0 16px 70px #0008; animation: menu-in .32s ease-out both;
}
.mission-select .cover-kicker { width: auto; font-size: 11px; margin-bottom: 6px; overflow-wrap: anywhere; }
.mission-select h2 { margin: 0 0 24px; color: #f1efdf; font: 760 clamp(26px, 5vw, 46px)/1.1 var(--display); }
.mission-select h2:focus { outline: none; }
.mission-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  width: 100%; min-height: 74px; gap: clamp(7px, 2vw, 16px); padding: 10px 12px;
  text-align: left; color: var(--text); background: #192d2b; border: 1px solid #7faaa0;
  transition: background .16s, border-color .16s;
}
.mission-card:hover { background: #2c3930; border-color: var(--accent); }
.mission-card:disabled { cursor: wait; opacity: .84; }
.mission-number { padding: 6px 9px; border: 1px solid #7faaa0; color: #b8e0d1; font: 700 15px var(--mono); }
.mission-card-info { display: grid; gap: 3px; }
.mission-card-info b { font: 750 clamp(16px, 3vw, 22px)/1.15 var(--display); }
.mission-card-info > span { color: #bbd1c7; font-size: 11px; }
.mission-card-action { color: var(--accent); font: 700 11px/1.15 var(--mono); }
.mission-card-action::after { content: ' →'; }
.mission-card:disabled .mission-card-action::after { content: ''; }
.mission-load { margin: 8px 0 0; color: #c7d8ce; font-size: 12px; }
.mission-back { min-height: 34px; padding: 4px 9px; margin-top: 14px; border: 1px solid #668a7d; background: #172424; color: #e1e9de; }
.save-status {
  position: absolute; right: var(--edge); bottom: 61px; max-width: min(370px, 82vw); margin: 0;
  padding: 6px 10px; background: #311e16ed; border: 1px solid var(--accent-line); color: #ffe0be; font-size: 12px;
}
.cover-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.cover-channel, .cover-wind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid #92a99e55;
  background: #0c1719db;
  color: #c0cec5;
  font: 11px/1.2 var(--mono);
  text-decoration: none;
  transition: border-color .16s, background .16s, color .16s;
}
.cover-channel .signal { width: 4px; height: 4px; margin: 0; }
.cover-channel b { color: #f0d6b8; }
.external-arrow { font-size: 14px; color: var(--accent); }
.cover-channel:hover, .cover-wind:hover:enabled { border-color: var(--accent-line); background: #1c2725; color: var(--text); }
.cover-channel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.cover-wind b { color: #a5b3ab; font-weight: 600; }
.cover-wind[aria-pressed="true"] b, .cover-wind[aria-pressed="true"] .wind-wave { color: var(--green); }
.wind-wave { position: relative; width: 12px; height: 8px; border-block: 1px solid currentColor; }
.wind-wave::after { content: ''; position: absolute; inset: 2px 3px auto 0; border-top: 1px solid currentColor; }
#boot-error { max-width: 450px; margin: 12px auto 0; padding: 9px 13px; color: #ffdfd8; background: #572d2b; }

.hud { position: fixed; inset: 0; pointer-events: none; }
.hud-top {
  position: absolute;
  inset: 21px var(--edge) auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #b8c5bb68;
}
.hud-identity {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #e9ede6;
  font: 650 12px var(--mono);
  letter-spacing: .12em;
  white-space: nowrap;
  text-shadow: 0 1px 6px #050908;
}
.hud-identity b { color: var(--accent); }
.mark {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  transform: rotate(45deg);
  margin: 0 5px 0 2px;
  border: 1px solid #ffd09b;
}
.mark i { width: 5px; height: 5px; background: var(--accent); }
.route { display: flex; justify-content: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.route li {
  display: grid;
  place-items: center;
  width: clamp(20px, 2.7vw, 34px);
  min-height: 23px;
  border: 1px solid #84948b77;
  background: #111a1cdb;
  color: #d0d8d0;
  font: 11px var(--mono);
}
.route li.active { border-color: #ffc78c; background: var(--accent); color: #221a10; font-weight: 800; }
.route li.done { color: var(--green); border-color: #8cbbab91; }
.hud-menu {
  justify-self: end;
  pointer-events: auto;
  white-space: nowrap;
  padding: 5px 9px;
  border: 1px solid #89998d7d;
  background: #121b1ddc;
  color: #e5eae3;
  font: 12px/1.45 var(--type);
}
.hud-menu:hover { border-color: var(--accent); }
.objective {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(680px, 88vw);
  padding: 8px 19px 10px;
  border-top: 1px solid #ffd39a9c;
  background: linear-gradient(#101819ed, #0b1216cf);
  text-align: center;
  box-shadow: 0 5px 21px #090f1045;
}
.eyebrow { color: var(--accent); font: 650 11px/1.4 var(--mono); letter-spacing: .13em; }
.objective strong { display: block; margin-top: 3px; color: #f3f3eb; font-size: 14px; font-weight: 630; }
.objective div:not(:empty) { margin-top: 3px; color: #c0cfc5; font: 11px/1.32 var(--mono); }
.threat {
  position: absolute;
  top: 49%;
  left: var(--edge);
  width: min(190px, 24vw);
  padding: 8px 11px;
  border-left: 2px solid var(--bad);
  background: #301715e8;
  color: #ffd8c6;
  font: 650 11px/1.3 var(--mono);
  letter-spacing: .06em;
}
.threat .meter { background: #7b3d33; }
.threat .meter i { background: #ff805e; }
.drone-threat {
  position: absolute; top: calc(50% - 80px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 92vw; padding: 5px 10px;
  border: 1px solid #e98962; background: #331b17ef; color: #ffdbbc;
  font: 700 12px/1.35 var(--mono); text-align: center;
}
.boss-hud {
  position: absolute; top: clamp(143px, 17vh, 160px); left: 50%; transform: translateX(-50%);
  width: min(430px, 76vw); padding: 7px 10px 9px; border: 1px solid #cb8a5e;
  background: #171b1bef; color: #f1d9bd; font: 700 12px/1.3 var(--mono);
}
.boss-hud > div:first-child { display: flex; gap: 8px; justify-content: space-between; }
.boss-hud span { color: #ffd49b; }
.boss-hud .meter { height: 4px; margin-top: 6px; background: #3e3028; }
.boss-hud .meter i { height: 100%; background: #ff9562; }
.damage-flash {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 53%, #bc362b8a);
}
.integrity {
  position: absolute; right: var(--edge); bottom: 57px;
  width: clamp(112px, 15vw, 183px); color: #dbede5;
  display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; padding: 7px 9px;
  border: 1px solid #728e8096; background: #101b19eb; font: 700 11px/1.25 var(--mono);
}
.integrity strong { color: #ace2c9; }
.integrity .meter { grid-column: 1 / -1; height: 4px; background: #30483e; }
.integrity .meter i { display: block; height: 100%; background: #a5e0c2; }
.integrity.critical strong { color: #ffb294; }
.integrity.critical .meter i { background: #ff946e; }

.reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  opacity: .83;
  background:
    linear-gradient(#e1efe8, #e1efe8) center 0 / 1px 5px no-repeat,
    linear-gradient(#e1efe8, #e1efe8) center bottom / 1px 5px no-repeat,
    linear-gradient(#e1efe8, #e1efe8) left center / 5px 1px no-repeat,
    linear-gradient(#e1efe8, #e1efe8) right center / 5px 1px no-repeat;
}
.reticle::after { content: ''; position: absolute; inset: 9px; background: #e3eedf; border-radius: 50%; }
.reticle.active { outline: 1px solid #ffd190; outline-offset: 3px; }
.reticle.scanning { outline-color: var(--green); box-shadow: 0 0 22px #6afbd76b; }
.reticle.hostile { outline-color: #ffa77d; }
.reticle.hit { outline: 2px solid #fff3da; outline-offset: 6px; }
.target, .notice {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  text-align: center;
  background: #101a1beb;
}
.target {
  top: calc(50% + 28px);
  max-width: 78vw;
  padding: 7px 11px;
  border: 1px solid #d7ad777d;
  color: #f0eee6;
  line-height: 1.35;
}
.meter { margin-top: 7px; height: 3px; background: #546963; overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; background: var(--green); transition: width .1s linear; }
.notice {
  top: calc(50% + 91px);
  max-width: min(440px, 86vw);
  padding: 8px 13px;
  border-bottom: 1px solid var(--accent-line);
  color: #f3d6b0;
  font-size: 13px;
}
.flash { animation: notice-in .45s ease both; }
.subtitle {
  position: absolute;
  bottom: 67px;
  left: 50%;
  transform: translateX(-50%);
  width: min(665px, 86vw);
  padding: 8px 15px 11px;
  border-top: 1px solid #b6c3b976;
  background: #0e1719ee;
  color: #edf0e9;
  text-align: center;
}
.subtitle span { display: block; margin-bottom: 4px; color: var(--accent); font: 10px var(--mono); letter-spacing: .11em; }
.controls, .scanner-status {
  position: absolute;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d2ded5;
  text-shadow: 0 1px 4px #070e0e;
  font: 11px var(--mono);
}
.controls { left: var(--edge); }
.controls span { white-space: nowrap; }
kbd {
  padding: 2px 4px;
  border: 1px solid #a3aa96a6;
  background: #1b2527;
  color: #f3e7d7;
  font: 11px/1.16 var(--mono);
}
.scanner-status { right: var(--edge); gap: 7px; letter-spacing: .08em; white-space: nowrap; }
.led { display: inline-block; width: 6px; height: 6px; background: var(--green); box-shadow: 0 0 10px #73e7d5; }

.veil {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 19px;
  z-index: 4;
  background: #050b10ab;
  backdrop-filter: blur(4px);
}
.panel {
  position: relative;
  width: min(790px, 100%);
  max-height: calc(100dvh - 38px);
  overflow: auto;
  padding: clamp(20px, 3vh, 31px) clamp(19px, 3.6vw, 37px);
  outline: none;
  border: 1px solid #887a66;
  background: linear-gradient(143deg, #1b2224, #0f1719 58%);
  box-shadow: 0 18px 85px #000a;
  scrollbar-color: #80725c #131b1d;
  animation: menu-in .2s ease-out both;
}
.panel::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 104px;
  height: 2px;
  content: '';
  background: var(--accent);
}
.panel h2 {
  margin: 7px 0 12px;
  font: 710 clamp(24px, 3.65vw, 40px)/1.12 var(--display);
  letter-spacing: -.025em;
}
.panel h3 { margin: 15px 0 7px; font-size: 16px; font-weight: 680; }
.panel .desc { margin: 0 0 13px; max-width: 655px; color: var(--muted); }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-top button, .secondary {
  padding: 7px 11px;
  border: 1px solid #77878472;
  background: #202a2b;
  color: #e5ece4;
}
.panel-top button { font-size: 12px; white-space: nowrap; }
.panel-top button:hover, .secondary:hover { border-color: var(--accent); }
.panel-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 13px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.panel-footer .secondary { min-height: 46px; }

.record { padding: 8px 1px; border-top: 1px solid var(--line); }
.record b { display: block; color: #e0e8e1; font-weight: 660; }
.record span { display: block; margin-top: 3px; color: #b7c4bd; font-size: 13px; }
.options { display: grid; gap: 6px; margin-top: 8px; }
.option {
  position: relative;
  display: block;
  width: 100%;
  min-height: 43px;
  padding: 8px 11px 8px 34px;
  border: 1px solid #69807879;
  background: #1d2a2c;
  color: #edf1e9;
  text-align: left;
  line-height: 1.35;
}
.option::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 13px;
  width: 8px;
  height: 8px;
  border: 1px solid #b3c3b7;
  transform: rotate(45deg);
}
.option:hover, .option.selected { border-color: #e4b37d; background: #373025; }
.option.selected::before { border-color: var(--accent); background: var(--accent); }
.option small { display: block; margin-top: 2px; color: #c4cec4; font-size: 12px; }
.warning, .ok {
  padding: 8px 11px;
  margin-top: 8px;
  border-left: 2px solid var(--bad);
  background: #4b282779;
  color: #ffdbc9;
  font-size: 13px;
}
.ok { border-color: var(--green); background: #24403990; color: #cfefe1; }
.guide div {
  display: flex;
  justify-content: space-between;
  gap: 13px;
  width: min(560px, 100%);
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.guide div b { flex: 0 0 auto; }
.guide div span { color: var(--muted); text-align: right; }
.hint-form { display: flex; gap: 6px; margin-top: 10px; }
.hint-form input {
  width: 100%;
  min-height: 40px;
  padding: 6px 9px;
  border: 1px solid #697e76;
  background: #182526;
  color: var(--text);
}
.hint-output { max-height: 120px; overflow: auto; margin-top: 9px; color: var(--green); white-space: pre-wrap; }
.hud.at-terminal > :not(.subtitle) { visibility: hidden; }
.station-veil {
  padding: clamp(12px, 3vw, 30px);
  background: radial-gradient(ellipse at 50% 48%, #060c1026 31%, #04080dbc 100%);
  backdrop-filter: none;
}
.station-console {
  --console-metal: #363a36;
  --console-amber: #f9c381;
  width: min(908px, 100%);
  max-height: calc(100dvh - 2 * clamp(12px, 3vw, 30px));
  padding: 0 13px;
  border: 2px solid #565a4f;
  border-radius: 10px;
  background:
    radial-gradient(circle at 7px 7px, #a3a596 0 1px, #1c211d 1px 3px, transparent 3px) left 1px top 1px / 14px 14px no-repeat,
    radial-gradient(circle at 7px 7px, #a3a596 0 1px, #1c211d 1px 3px, transparent 3px) right 1px top 1px / 14px 14px no-repeat,
    linear-gradient(155deg, #52544a, var(--console-metal) 35%, #272b28 85%);
  box-shadow: 0 16px 0 -8px #111612, 0 24px 65px #000c, inset 0 0 0 2px #242925;
  animation: console-in .18s ease-out both;
}
.station-console::before { content: none; }
.console-rail, .console-deck { display: flex; align-items: center; gap: 12px; padding-inline: clamp(9px, 2vw, 23px); }
.console-rail { min-height: 57px; justify-content: space-between; }
.console-brand {
  display: flex; align-items: center; flex-wrap: wrap; column-gap: 10px;
  color: #f4e5cc; font: 720 14px/1.35 var(--display); letter-spacing: .09em;
}
.console-brand span { color: #dad4bf; font: 700 11px/1.3 var(--mono); }
.console-brand i, .console-state i { display: inline-block; flex: none; border-radius: 50%; }
.console-brand i { width: 7px; height: 7px; background: #e9ad67; box-shadow: 0 0 11px #eb965d89; }
.console-exit {
  padding: 6px 9px;
  color: #f2e9d7;
  border: 1px solid #7d7c6a;
  border-radius: 3px;
  box-shadow: 0 2px #1c211c;
  background: #353a35;
  font-size: 12px;
  white-space: nowrap;
}
.console-exit:hover { background: #484c41; }
.console-exit kbd { margin-left: 4px; color: #d7c9b1; font: 11px var(--mono); }
.console-screen {
  --signal-color: #f7c486;
  position: relative;
  padding: clamp(13px, 2.4vw, 26px);
  border: 3px solid #171e1b;
  border-radius: 5px;
  background:
    repeating-linear-gradient(0deg, #00000019 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 24% 12%, #212d26, #101a19 68%);
  box-shadow: 0 0 0 1px #7b7a67, inset 0 0 20px #0009;
}
.console-screen[data-tone="ready"] { --signal-color: #a9e5c9; }
.console-screen[data-tone="danger"] { --signal-color: #ffa887; }
.console-screen-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: 7px 14px;
}
.console-screen h2 {
  margin: 0 0 5px;
  color: #f9ead1;
  font-size: clamp(24px, 3.7vw, 42px);
  text-shadow: 0 0 18px #eacb9560;
}
.console-state {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid #7b87765b;
  color: var(--signal-color);
  background: #0d1716;
  font: 700 11px/1.25 var(--mono);
  letter-spacing: .06em;
}
.console-state i { width: 6px; height: 6px; background: currentColor; box-shadow: 0 0 10px currentColor; }
.console-desc { max-width: 66ch; margin: 7px 0 15px; color: #d5dacd; font-size: 14px; line-height: 1.48; }
.console-label { display: block; color: #e7c594; font: 700 11px/1.35 var(--mono); letter-spacing: .07em; }
.console-deck { min-height: 71px; flex-wrap: wrap; padding-block: 9px 12px; }
.console-deck button { min-height: 39px; }
.console-deck .primary {
  padding: 6px 14px;
  color: #241a11;
  border: 1px solid #f2be83;
  border-radius: 3px;
  background: linear-gradient(#f2be80, #d79757);
  box-shadow: 0 4px #714829, 0 0 0 2px #212721;
  font: 730 15px var(--display);
}
.console-deck .primary:not(:disabled):hover { background: #f6cb90; }
.console-deck .primary:not(:disabled):active { transform: translateY(2px); box-shadow: 0 2px #714829; }
.console-vents {
  width: clamp(25px, 10vw, 108px); height: 17px; margin-left: auto;
  background: repeating-linear-gradient(90deg, #1a201c 0 3px, #666657 3px 4px, transparent 4px 7px);
  opacity: .88;
}
.assignment { display: grid; grid-template-columns: 1fr 1.05fr; gap: 10px; }
.assignment-system {
  min-width: 0;
  padding: 12px;
  border: 1px solid #63756882;
  background: #0c1716b7;
}
.assignment-route { display: grid; gap: 5px; padding: 0; margin: 7px 0 0; list-style: none; }
.assignment-route li { display: flex; gap: 9px; align-items: baseline; color: #e7e8d9; font-size: 14px; }
.assignment-route li span { color: #a9c5ae; font: 700 12px var(--mono); }
.channel-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  width: 100%; min-height: 41px; margin: 8px 0 7px; padding: 4px;
  border: 1px solid #777f6c; border-radius: 4px; background: #0b1414;
  color: #c2cec0; font: 720 15px var(--display);
}
.channel-switch span { display: grid; place-items: center; background: #252e29; border: 1px solid transparent; }
.channel-switch .is-live { color: #ffcead; border-color: #b9785c; background: #523324; }
.channel-switch[aria-pressed="true"] .is-live { color: #c5f4dd; border-color: #7cab91; background: #22453b; }
.channel-switch:hover { border-color: var(--console-amber); }
.channel-message { min-height: 2.7em; margin: 0; color: #d4ddce; font-size: 13px; line-height: 1.42; }
.signal-rack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.signal-card {
  display: grid; gap: 3px; min-height: 106px; padding: 10px 12px;
  border: 1px solid #687d72; text-align: left; background: #142322; color: #c6d7ca;
}
.signal-card strong { color: #f1e4c5; font: 720 clamp(19px, 3vw, 35px)/1.14 var(--display); }
.signal-card > span:last-child { font-size: 12px; }
.signal-card[aria-pressed="true"] { border-color: #edba79; background: #393023; }
.signal-card:not(:disabled):hover { border-color: #f9ce94; }
.console-readback {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 12px;
  margin-top: 9px; padding: 8px 10px; border-left: 2px solid #e0a96e;
  background: #151e1a; color: #e7d1af; font: 700 12px/1.4 var(--mono);
}
.console-readback strong { color: #edf2e5; font-family: var(--type); }
.trace-records, .pipe-routes { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.trace-records button, .pipe-routes button {
  display: grid;
  grid-template-columns: minmax(68px, auto) minmax(100px, 1fr) minmax(68px, auto);
  align-items: center;
  gap: clamp(7px, 2vw, 20px);
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #9dbbae55;
  background: #0b1718;
  color: #e0efe5;
  text-align: left;
  font-size: 13px;
}
.trace-records button:hover, .pipe-routes button:hover,
.trace-records button[aria-pressed="true"], .pipe-routes button[aria-pressed="true"] {
  border-color: var(--console-amber);
  background: #342a20;
}
.trace-records time, .trace-records em, .pipe-routes small { color: #a4cabb; font: 11px/1.3 var(--mono); }
.trace-records time { font-variant-numeric: tabular-nums; }
.trace-records small { display: block; color: #a4b6ad; font-size: 11px; }
.pipe-start { margin: 0 0 4px; color: #a4cabb; font: 700 12px var(--mono); }
.pipe-start span { color: #c2eedb; }
.pipe-segment { position: relative; display: grid; place-items: center; padding: 0 0 3px; }
.pipe-segment::before { content: ''; position: absolute; inset: 9px 0 auto; height: 3px; background: #79a79a; }
.pipe-segment[data-break="true"]::before { background: repeating-linear-gradient(90deg, #ca7562 0 5px, transparent 5px 9px); }
.pipe-segment i { z-index: 1; min-width: 22px; background: #182627; color: #bcf2d8; text-align: center; font: 18px/20px var(--mono); }
.pipe-segment[data-break="true"] i { color: #ffa48d; }
.console-modules { display: grid; grid-template-columns: repeat(var(--modules), minmax(0, 1fr)); gap: 7px; }
.console-modules button {
  display: grid; align-content: center; gap: 4px; min-height: 64px; min-width: 0; padding: 7px 8px;
  border: 1px solid #677568; background: #192623; color: #e2eadd;
  text-align: left; font-size: 12px; line-height: 1.25;
}
.console-modules button:hover, .console-modules button[aria-pressed="true"] { border-color: #e8b579; background: #3a3023; }
.module-position { display: flex; align-items: center; gap: 7px; color: #cedbce; font: 700 11px var(--mono); }
.module-position i { width: 7px; height: 7px; border-radius: 50%; background: #54655d; }
[data-module-state="ready"] .module-position i { background: #9cdbb8; box-shadow: 0 0 9px #9cdbb864; }
[data-module-state="fault"] .module-position i { background: #ff9d7d; box-shadow: 0 0 9px #ff9d7d6d; }
.console-work { padding: 10px; margin-top: 9px; border: 1px solid #54665a; background: #0d1717a6; }
.console-work h3 { margin: 0 0 5px; }
.console-work .option { background: #1b2925; }
.console-work .option.selected, .console-work .option:hover { background: #3a3023; }
.test-console-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 9px; }
.case-input { margin: 0; color: #d5dfd1; font-size: 13px; line-height: 1.45; }
.console-trace .case-input { margin-top: 9px; }
.test-chain { display: grid; gap: 5px; list-style: none; margin: 8px 0 0; padding: 0; }
.test-chain li {
  padding: 5px 8px; border-left: 2px solid #a4cfb6; background: #20352d;
  color: #e2efe5; font-size: 12px; animation: notice-in 220ms ease-out both;
}
.test-chain li:nth-child(2) { animation-delay: 100ms; }
.test-chain li:nth-child(3) { animation-delay: 200ms; }
.console-trace .warning, .console-trace .ok { margin-bottom: 0; }
.interlock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.interlock li { min-height: 61px; padding: 9px; border: 1px solid #63756882; background: #0c1716b7; }
.interlock li span { display: block; margin-bottom: 4px; color: #f7b18e; font: 700 11px/1.25 var(--mono); }
.interlock li[data-ready="true"] span { color: #b2dec8; }
.interlock li b { color: #f0edde; font-size: 14px; }
.field-notes { display: grid; gap: 5px; margin: 0 0 12px; padding: 0; list-style: none; }
.field-notes li { display: grid; grid-template-columns: minmax(135px, .42fr) 1fr; gap: 8px; padding: 6px 9px; background: #0c1716; border-left: 2px solid #709b85; }
.field-notes span { color: #c8d9ce; }
.entry-field { display: grid; gap: 5px; color: #f1d6ae; font-size: 13px; }
.entry-field input, .entry-field select { width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid #8aa095; background: #152322; color: #f7ead5; font: inherit; }
#archive-code { width: 120px; font: 700 20px var(--mono); letter-spacing: .19em; }
.agent-setup { display: grid; grid-template-columns: 1fr 1.45fr; gap: 10px; margin-top: 12px; }
.workbench { display: grid; grid-template-columns: minmax(175px, .39fr) 1fr; gap: 12px; }
.bench-tray { display: grid; align-content: start; gap: 7px; min-width: 0; }
.bench-tray > .console-label { margin: 2px 0 1px; }
.bench-part {
  display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center;
  min-width: 0; min-height: 66px; padding: 5px 6px;
  border: 1px solid #5d7469; background: #142321; color: #e9e6d7; text-align: left;
  cursor: grab; touch-action: none; user-select: none;
}
.bench-part:not(:disabled):hover, .bench-part[aria-pressed="true"] {
  border-color: #ffcc92; background: #322c21;
}
.bench-part:disabled { opacity: .63; }
.bench-part.bench-drag-source { opacity: .46; }
.bench-part b, .bench-part small { display: block; }
.bench-part b { margin-block: 2px; font-size: 12px; line-height: 1.25; }
.bench-part small { color: #cedccd; font: 700 10px var(--mono); }
.bench-part small.bench-installed { color: #a8e0c4; }
.bench-part-visual {
  display: grid; place-items: center; min-height: 51px; border: 1px solid #526a5d65;
  background: radial-gradient(ellipse, #314846, #14221f);
}
.bench-part-visual img { display: block; max-width: 60px; max-height: 45px; pointer-events: none; }
.bench-drawing {
  display: grid; place-items: center; min-width: 0; border: 1px solid #6375689e; overflow: hidden;
  background:
    linear-gradient(#7d9e861b 1px, transparent 1px) 50% 50% / 19px 19px,
    linear-gradient(90deg, #7d9e861b 1px, transparent 1px) 50% 50% / 19px 19px,
    radial-gradient(ellipse, #263b36, #101c1a 76%);
}
.bench-chassis { position: relative; width: min(100%, 454px, max(255px, calc(133dvh - 395px))); aspect-ratio: 4/3; }
.bench-chassis > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.bench-seat { animation: module-seat .22s ease-out both; }
.bench-socket {
  position: absolute; left: var(--socket-x); top: var(--socket-y); transform: translate(-50%, -50%);
  width: 25%; height: 20%; display: grid; place-items: center;
  padding: 0; border: 2px dashed #f3bf87; border-radius: 3px; background: #1b302b9e; color: #ffe3be;
}
.bench-socket[data-assembly-socket="part-core"] { width: 22%; height: 19%; }
.bench-socket[data-assembly-socket="part-memory"] { width: 15%; height: 15%; }
.bench-socket:not(:disabled):hover, .bench-socket.bench-drop-target { background: #594628b6; border-color: #ffe5af; }
.bench-socket[data-installed="true"] { border: 1px solid #a5e2c67d; background: transparent; color: #b3efd1; opacity: 1; }
.bench-connector { border: 1px solid currentColor; background: #131d19; padding: 2px 4px; font: 700 11px/1.1 var(--mono); }
.bench-socket[data-installed="true"] .bench-connector { align-self: end; justify-self: end; }
.bench-socket-name {
  position: absolute; left: calc(100% + 5px); top: 50%; transform: translateY(-50%);
  padding: 3px 5px; background: #101d1ae8; color: #f0dfc6;
  font: 700 clamp(8px, 1vw, 11px)/1.1 var(--mono); pointer-events: none; white-space: nowrap;
}
.bench-status { margin: 6px 0 0; min-height: 1.45em; color: #c5dcce; font-size: 12px; }
.bench-status.bench-error { color: #ffbc98; }
.bench-ghost {
  position: fixed; z-index: 9; transform: translate(-50%, -50%); width: auto; height: auto;
  max-width: 106px; max-height: 74px; pointer-events: none; filter: drop-shadow(0 4px 9px #000d);
}
@keyframes module-seat { from { opacity: .45; } to { opacity: 1; } }
@keyframes console-in {
  from { opacity: .55; transform: translateY(6px) scale(.989); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 560px) {
  .station-console { padding: 0 8px; }
  .assignment { grid-template-columns: 1fr; }
  .console-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .test-console-grid { grid-template-columns: 1fr; gap: 0; }
  .agent-setup, .field-notes li { grid-template-columns: 1fr; }
  .workbench { grid-template-columns: 1fr; }
  .bench-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bench-tray > .console-label { grid-column: 1 / -1; }
  .bench-part { grid-template-columns: 1fr; text-align: center; }
  .signal-rack, .interlock { grid-template-columns: 1fr; }
  .signal-card, .interlock li { min-height: 0; }
  .console-rail { min-height: 47px; }
}
@media (prefers-reduced-motion: reduce) {
  .station-console, .test-chain li, .bench-seat { animation: none; }
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes notice-in {
  from { opacity: .22; }
  to { opacity: 1; }
}
@media(max-width: 600px) {
  .cover-mast, .cover-footer { font-size: 9px; letter-spacing: .06em; gap: 8px; }
  .cover-main h1 { font-size: clamp(43px, 13vw, 74px); }
  .hud-top { gap: 5px; }
  .hud-identity { font-size: 9px; letter-spacing: .02em; gap: 3px; }
  .hud-menu { font-size: 9px; padding: 4px; }
  .hud-menu kbd { font-size: 9px; }
  .controls, .scanner-status { gap: 5px; font-size: 9px; }
  .controls kbd { font-size: 9px; padding-inline: 2px; }
  .controls span:last-child { display: none; }
  .panel { padding: 15px; font-size: 13px; }
}
@media(max-height: 650px) {
  .cover { padding-block: 16px; }
  .cover-main { padding-bottom: 0; }
  .cover-main h1 { font-size: clamp(43px, min(19vh, 13vw), 114px); }
  .cover-main h2 { margin: 3px 0 11px; }
  .intro { margin-bottom: 16px; }
  .primary.start { min-height: 47px; }
  .cover-links { margin-top: 15px; }
  .hud-top { top: 11px; }
  .objective { top: 58px; }
  .notice { top: calc(50% + 76px); }
  .subtitle { bottom: 42px; font-size: 13px; }
  .controls, .scanner-status { bottom: 13px; }
}
@media(max-height: 430px) {
  .cover { padding-block: 9px; }
  .cover-mast { padding-top: 5px; }
  .cover-footer { padding-bottom: 5px; }
  .cover-kicker { margin-bottom: 3px; }
  .cover-main h1 { font-size: clamp(43px, min(14.5vh, 13vw), 77px); }
  .cover-main h2 { font-size: 17px; }
  .intro { max-width: 510px; margin-bottom: 8px; font-size: 13px; line-height: 1.4; }
  .primary.start { min-height: 42px; }
  .cover-links { margin-top: 7px; }
  .player-form { gap: 5px; }
  .callsign input { min-height: 32px; padding-block: 3px; }
  .mission-select h2 { margin-bottom: 13px; }
  .notice { top: 119px; }
}
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
