:root {
  color-scheme: dark;
  --body: #131522;
  --ink: #f9eedb;
  --muted: #c4c0be;
  --mint: #a9e5cb;
  --brass: #f3c887;
  --danger: #ffae82;
  --rule: #67636e;
  --panel: #21232ef4;
  --mono: "Cascadia Mono", "Consolas", monospace;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--body); }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: radial-gradient(ellipse at 77% 9%, #363044, transparent 57%), var(--body);
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
button { font: inherit; color: inherit; border-radius: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .47; }
canvas { display: block; }
kbd {
  display: inline-grid; place-items: center; min-width: 22px; min-height: 21px;
  padding: 2px 5px; border: 1px solid #627783; background: #202d37;
  color: #f2f3e8; box-shadow: 0 2px 0 #080d14; font: 750 11px/1.05 var(--mono);
}

.workstation { min-width: 0; width: min(1500px, calc(100% - 48px)); margin: 12px auto; }
.station-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 13px;
  min-height: 48px; padding: 0 0 10px;
}
.station-name {
  display: flex; align-items: center; gap: 10px; color: #e7edec;
  font-size: 15px; font-weight: 850; letter-spacing: .07em; white-space: nowrap;
}
.station-name small {
  border-left: 1px solid #617481; padding-left: 9px; margin-left: 8px;
  font-size: 11px; font-weight: 550; color: #afbec6; letter-spacing: .04em;
}
.station-mark {
  display: grid; place-items: center; width: 32px; height: 31px; position: relative;
  background: #c9895c;
  border: 1px solid #edbd84; color: #261f2a; box-shadow: inset 0 0 0 2px #754d49;
}
.station-mark::before { content: ""; position: absolute; inset: 7px 10px 8px 6px; border: 2px solid currentColor; border-right: 0; }
.station-mark::after { content: ""; width: 15px; height: 2px; background: currentColor; position: absolute; top: 14px; left: 11px; }
.station-mark i { position: absolute; width: 1px; height: 5px; top: 12px; background: #65473e; }
.station-mark i:nth-child(1) { left: 12px; }.station-mark i:nth-child(2) { left: 17px; }.station-mark i:nth-child(3) { left: 22px; }
.station-actions { display: flex; align-items: center; justify-content: end; gap: 6px; }
.switch {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 33px; min-width: 67px; padding: 0 10px; white-space: nowrap;
  border: 1px solid #5e596a; box-shadow: inset 0 1px #968c975c;
  background: #272633; color: #ede6db;
  font-size: 11px; font-weight: 800;
}
.switch:hover { border-color: #c7ab73; color: #fff3ce; background: #443744; }
.switch-dot { width: 6px; height: 6px; background: var(--mint); box-shadow: 0 0 8px #8ffac480; }
.switch[aria-pressed="false"] .switch-dot { background: #778694; box-shadow: none; }
.full-icon { width: 9px; height: 9px; outline: 1px solid #aebec7; outline-offset: 1px; }
.pause-icon { width: 8px; height: 10px; border-inline: 2px solid #b8c7cf; }
#skip-training { color: #f3d9a9; border-color: #8b7759; background: #332f29; }

.stage {
  --inset: 15px;
  --alerts: 72px;
  --contexts: 68px;
  display: block; position: relative; isolation: isolate; overflow: hidden; min-width: 0;
  width: 100%; height: min(84dvh, 860px); min-height: 482px;
  background: #2c2936; border: 1px solid #857786;
  box-shadow: 0 0 0 3px #15121cbb, 0 20px 55px #0a071299;
}
.game-view, .stage-lines { position: absolute; inset: 0; }
.game-view { touch-action: none; }
.game-view canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.stage-lines {
  z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 0 3px #1c172960, inset 0 0 48px 4px #190d2152;
}
.stage.hurt .stage-lines {
  box-shadow: inset 0 0 0 3px #1c172960, inset 0 0 70px 12px #ff4a2a80;
}
@keyframes alarm-pulse {
  0%, 100% { box-shadow: inset 0 0 0 3px #3d141499, inset 0 0 54px 8px #d8362244; }
  50% { box-shadow: inset 0 0 0 3px #7a221acc, inset 0 0 76px 14px #ff452670; }
}
.stage.boss-enraged .stage-lines { animation: alarm-pulse 1.5s ease-in-out infinite; }
.stage.boss-enraged .stage-corner { border-color: #ff7e5f; }
.stage-corner {
  z-index: 5; position: absolute; width: 18px; height: 14px; pointer-events: none;
  border: 0 solid #b8b09a;
}
.corner-tl { top: 4px; left: 4px; border-top-width: 2px; border-left-width: 2px; }
.corner-tr { top: 4px; right: 4px; border-top-width: 2px; border-right-width: 2px; }
.corner-bl { bottom: 4px; left: 4px; border-bottom-width: 2px; border-left-width: 2px; }
.corner-br { bottom: 4px; right: 4px; border-bottom-width: 2px; border-right-width: 2px; }

.title-screen {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center;
  background:
    radial-gradient(ellipse at 77% 44%, transparent 21%, #18142253 76%),
    linear-gradient(90deg, #171322 1%, #1b1625f2 21%, #201a2bd6 37%, #271e2d49 55%, transparent 74%);
}
.title-content { width: min(560px, 58%); margin-left: clamp(27px, 6.2vw, 100px); padding: 6px 0 13px; }
.title-line { display: flex; align-items: center; gap: 7px; height: 7px; margin-bottom: 18px; }
.title-line b {
  width: 56px; height: 6px; border-left: 2px solid #ffe2a5;
  background: repeating-linear-gradient(115deg,#e9a969 0 6px,#603c42 6px 10px);
}
.title-line i { width: 8px; height: 2px; background: #9b7669; }
.title-eyebrow { color: var(--brass); font: 800 12px/1.2 var(--mono); letter-spacing: .3em; margin-bottom: 10px; }
.title-content h1 {
  margin: 0 0 18px; color: #fff0d6;
  font-size: clamp(46px, 5.6vw, 85px); font-weight: 950;
  line-height: 1; letter-spacing: -.04em;
  text-shadow: 2px 4px #473044, 4px 9px #130f1bb0;
}
.title-content h1 span { display: block; color: #ffc477; font-size: 1.21em; margin-top: 3px; }
.title-content p { width: min(365px, 100%); color: #e1d6d2; margin: 0 0 24px; font-size: clamp(13px, 1.28vw, 16px); line-height: 1.83; }
.title-content .boot-message { color: #ffd7b6; margin: 12px 0 0; padding: 9px; background: #381f1de5; border-left: 3px solid var(--danger); font-size: 13px; }
.title-actions { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }
.action {
  display: inline-flex; position: relative; align-items: center; justify-content: center; gap: 9px;
  min-height: 47px; padding: 0 16px; border: 1px solid transparent;
  font-size: 14px; font-weight: 850; letter-spacing: .07em;
}
.action.primary {
  min-width: 157px; color: #2e2027; background: #f5c176;
  border-color: #ffe1aa; box-shadow: inset 0 0 0 2px #ba784e87, 0 4px 0 #995639;
}
.action.primary:hover { background: #ffdc9f; }
.action.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #995639; }
.action.secondary { color: #f2e4dc; border-color: #90818b; background: #312933; box-shadow: inset 0 0 0 2px #211b2990; }
.action.secondary:hover { color: #fff0cf; border-color: #d5a372; background: #493746; }
.title-content .primary { min-height: 56px; min-width: 204px; justify-content: start; }
.title-content .secondary { min-height: 54px; }
.action .play-icon { font-size: 12px; }
.enter-hint { margin-left: auto; padding-left: 14px; font: 700 16px/1 var(--mono); opacity: .64; }
.control-legend { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 22px; color: #bacad2; font-size: 12px; }
.control-legend span { display: flex; align-items: center; gap: 6px; }
.touch-legend { display: none; }
.title-shift {
  position: absolute; right: 19px; bottom: 19px; display: flex; gap: 10px; align-items: center;
  color: #eadac8; background: #28212ce8; border: 1px solid #9f826b;
  box-shadow: inset 0 0 0 2px #181421a6;
  padding: 8px 10px; font-size: 11px; letter-spacing: .05em;
}
.title-shift strong { color: var(--brass); font: 800 16px/1 var(--mono); }

.hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; font-variant-numeric: tabular-nums; }
.hud-top {
  position: absolute; display: grid; left: var(--inset); right: var(--inset); top: 11px;
  grid-template-columns: 1fr auto 1fr; align-items: start; gap: 9px;
}
.health-panel, .count-panel, .time-panel, .boss-meter, .equipment, .risk-panel, .dash-panel {
  border: 1px solid var(--rule); background: var(--panel);
  box-shadow: inset 0 1px #ecded323, 0 2px 0 #14111d9e;
}
.health-panel { width: min(200px, 100%); padding: 8px 10px 7px; }
.meter-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  color: #c6d4d9; font-size: 11px; line-height: 1.25;
}
.meter-label strong { font: 750 11px/1.25 var(--mono); color: #eef3e6; white-space: nowrap; }
.meter { height: 6px; padding: 1px; background: #080d16; border: 1px solid #586d79; margin-top: 5px; overflow: hidden; }
.meter > div { height: 100%; width: 100%; transform-origin: left center; background: var(--mint); }
.health-meter > div { background: linear-gradient(90deg, #4baf97,#a5edcf); }
.xp-meter { height: 3px; padding: 0; border: 0; margin-top: 5px; }
.xp-meter > div { background: #87b8ed; transform: scaleX(0); }
.hud.low-health .health-panel { border-color: #d28368; }
.hud.low-health .health-meter > div { background: #fa9c77; }
.time-panel {
  min-width: 106px; padding: 5px 10px 6px; text-align: center;
  border-color: #927c6b; background: linear-gradient(160deg,#493742f8,#2a2635f5);
}
.time-panel span, .count-panel span { color: #b4c4cc; font-size: 10px; font-weight: 750; letter-spacing: .055em; }
.time-panel strong { display: block; color: #ffd79d; font: 850 clamp(22px,2.3vw,31px)/1.06 var(--mono); margin-top: 2px; }
.count-panel { min-width: 98px; justify-self: end; padding: 6px 9px 7px; text-align: right; }
.count-panel strong { display: block; color: #ecf2f4; white-space: nowrap; margin-top: 3px; font-size: 13px; }

.boss-meter {
  position: absolute; top: 82px; left: 50%; transform: translateX(-50%);
  width: min(560px, 64%); padding: 8px 12px 9px;
  border: 2px solid #d5885e;
  background: linear-gradient(180deg, #322127f8, #1e1824f5);
  box-shadow: 0 4px 18px #0a050ec8, inset 0 1px #ffd3a840;
}
.boss-meter .meter-label { font-size: 13px; }
.boss-meter .meter-label > span { color: #ffe3c2; font-weight: 900; letter-spacing: .06em; }
.boss-meter .meter-label strong { color: #ffc596; font-family: inherit; font-size: 12px; }
.boss-meter .meter { height: 14px; padding: 2px; border: 1px solid #c77b58; background: #120c14; margin-top: 6px; }
.boss-meter .meter > div { background: linear-gradient(90deg, #e04d38, #f28c4b 58%, #ffd27a); box-shadow: 0 0 10px #ff7b4766; }
.boss-meter.press-active { border-color: #ffd399; box-shadow: 0 0 22px #eb6b4266; }
.boss-meter.enraged { border-color: #ff6b4a; box-shadow: 0 0 24px #e8442a66; }
.boss-meter.enraged .meter-label > span { color: #ffba99; }

.incident-panel, .toast, .training-panel {
  position: absolute; top: var(--alerts); border: 1px solid var(--rule);
  background: var(--panel); box-shadow: 0 3px 10px #050b14a0;
}
.incident-panel {
  left: var(--inset); width: min(298px, 45%); display: grid; gap: 4px;
  padding: 8px 10px; border-color: #bd9463; border-left: 3px solid #e3ae68; background: #2d2425f2;
}
.incident-panel[data-stage="warning"], .incident-panel[data-stage="surge"] { border-left-color: #ff9771; }
.incident-panel > div, .inspection-card > div:first-child {
  display: flex; justify-content: space-between; align-items: baseline; gap: 7px;
}
.incident-panel strong, .inspection-card strong { color: #ffe3b6; font-size: 12px; }
.incident-panel time, .inspection-card > div:first-child span { color: #f9dca6; font: 750 11px/1.2 var(--mono); white-space: nowrap; }
.incident-panel p { margin: 0; color: #decdba; font-size: 11px; line-height: 1.48; }
.incident-panel .incident-direction { color: #ffd492; font-weight: 800; }
.incident-panel .batch-reading, .training-panel .batch-reading {
  white-space: pre-line; border-block: 1px solid #a788674f; padding-block: 4px;
  color: #ffe2b2; font-size: 11px; font-variant-numeric: tabular-nums;
}
.objective-marker {
  position: absolute; display: flex; align-items: center; gap: 5px;
  left: var(--inset); top: 48%; transform: translateY(-50%);
  padding: 4px 7px; border: 1px solid #7daea0; background: #132a2bf5;
  color: #d0f5e2; font-size: 11px; line-height: 1.3; font-weight: 800;
}
.objective-marker[data-side="right"] { left: auto; right: var(--inset); flex-direction: row-reverse; }
.objective-arrow::before { content: "←"; color: var(--mint); font: 800 14px/1 var(--mono); }
.objective-marker[data-side="right"] .objective-arrow::before { content: "→"; }
.toast {
  right: var(--inset); width: max-content; max-width: min(246px, 42%); display: grid; gap: 3px;
  padding: 7px 9px; text-align: left; border-right: 3px solid #80baac; background: #131f2bf0;
}
.stage.boss-active .toast { top: 128px; }
.toast strong { color: #e4f1e7; font-size: 12px; }
.toast span { color: #c1d1d8; font-size: 11px; line-height: 1.43; }
.toast[data-tone="warning"] { border-color: #bd875e; background: #312327f5; }
.toast[data-tone="warning"] strong { color: #ffdda9; }

.training-panel {
  left: var(--inset); width: min(319px, calc(100% - 30px)); padding: 9px 11px;
  border-color: #78a89e; border-left: 3px solid #a5edcf; display: grid; gap: 5px;
  background: linear-gradient(145deg,#293c44fa,#1b2735fa 67%);
}
.stage.boss-active .training-panel { top: 128px; }
.training-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--mint); font-size: 11px; font-weight: 850; }
.training-header span:first-child::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: currentColor; }
.training-header span:last-child { color: #b2c9cb; }
.training-panel > strong { color: #ecf6ee; font-size: 15px; }
.training-panel p { margin: 0; color: #cad9d9; font-size: 12px; line-height: 1.5; }
.training-panel kbd { justify-self: start; min-height: 21px; margin-top: 2px; background: #192b31; color: #d7f0e5; }
.training-panel .action { justify-self: start; min-height: 36px; font-size: 12px; margin-top: 4px; pointer-events: auto; }

.hud-bottom {
  position: absolute; display: grid; grid-template-columns: minmax(0, 1fr) minmax(128px, .58fr) minmax(0, 1fr);
  align-items: end; gap: 8px; left: var(--inset); right: var(--inset); bottom: 12px;
}
.equipment, .risk-panel, .dash-panel { padding: 6px 8px; min-height: 40px; }
.equipment { display: flex; gap: 6px; align-items: center; justify-self: start; }
.equipment .weapon-icons { display: flex; gap: 3px; min-width: 0; }
.weapon-chip {
  position: relative; display: grid; place-items: center; width: 33px; min-height: 31px;
  padding: 0; pointer-events: none;
  color: #e9e9d2; border: 1px solid var(--mint); background: linear-gradient(145deg,#2d484d,#1f313b);
}
.weapon-chip.calibrated { border-color: #e1b878; background: linear-gradient(135deg,#4d4133,#2c3339); }
.weapon-chip canvas { width: 22px; height: 22px; margin-bottom: 4px; image-rendering: pixelated; }
.weapon-chip b { position: absolute; right: 2px; bottom: 1px; font: 750 7px/1 var(--mono); color: #fce6b2; }
.gear-details { display: grid; gap: 2px; min-width: 55px; }
.gear-details strong { color: #e8f1ed; font-size: 11px; }.gear-details span { color: #bdcdd2; font-size: 9px; }
.risk-panel { width: min(204px, 100%); justify-self: center; }
.risk-panel > div:first-child, .review-count {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: #d3e0e3; font-size: 11px;
}
.risk-panel strong { color: #f5dcaa; font: 850 12px/1.1 var(--mono); white-space: nowrap; }
.review-count { margin-top: 4px; color: #c3dbd2; }
.review-count strong { color: var(--mint); }
.risk-segments { display: flex; gap: 3px; margin-top: 6px; }
.risk-segments i { flex: 1; height: 5px; border: 1px solid #657683; background: #253643; }
.risk-segments i.filled { background: repeating-linear-gradient(120deg,#fac276 0 4px,#c67553 4px 7px); border-color: #f4bf85; }
.risk-panel.risk-raised { border-color: #b18c69; }
.dash-panel { min-width: 90px; justify-self: end; }
.dash-panel > div:first-child { display: flex; align-items: center; gap: 5px; color: #cbdce3; font-size: 11px; white-space: nowrap; }
.dash-panel .meter { height: 5px; }
.dash-panel .meter > div { background: #88c8ed; }
.dash-panel kbd { min-height: 15px; font-size: 9px; }

.shortcut-card, .inspection-card, .tool-card {
  position: absolute; bottom: var(--contexts); display: grid; gap: 4px;
  padding: 8px 10px; border: 1px solid #a77c5a; box-shadow: 0 4px 12px #060d18b0;
  background: #2a2025f2;
}
.shortcut-card { left: var(--inset); width: max-content; max-width: min(390px, calc(100% - 30px)); color: #f0ddbd; }
.shortcut-card[data-kind="beautifier"] { border-color: #ae88bd; background: #2e2436f2; }
.shortcut-card[data-kind="beautifier"] .shortcut-card-top strong { color: #f2d1ef; }
.shortcut-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.shortcut-card-top strong { color: #ffe2ae; font-size: 14px; }
.shortcut-card-top span { color: #ffc2a0; font-size: 10px; font-weight: 850; white-space: nowrap; }
.shortcut-card > span, .shortcut-instruction { font-size: 11px; line-height: 1.35; }
.shortcut-card > span:nth-of-type(2) { color: #ffb699; }
.shortcut-instruction { display: flex; gap: 5px; align-items: center; color: #f9eddb; }
.shortcut-instruction kbd { border-color: #b68a69; background: #48362e; }
.inspection-card, .tool-card {
  left: 50%; transform: translateX(-50%); width: min(252px, 62%);
  color: #e2f1e7; border-color: #7daea0; background: #132a2bf3;
}
.inspection-card strong, .tool-card strong { color: #c3f2da; }
.inspection-card > span, .tool-card > span { color: #bddbd3; font-size: 11px; }
.inspection-card > div:first-child span { color: #c1f8df; }
.inspection-card .meter { margin-top: 2px; }
.inspection-card .meter > div { transform: scaleX(0); }
.tool-card { width: max-content; max-width: 56%; text-align: center; }
.tool-card strong { font-size: 13px; }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 17px; z-index: 4; background: #161222cc; }
.dialog {
  width: min(100%, 620px); max-height: 100%; overflow: auto; padding: clamp(16px,3vw,32px);
  border: 1px solid #8a7e83; border-top: 3px solid #d8aa7b;
  background: linear-gradient(153deg,#453743,#292733 62%,#222435);
  box-shadow: inset 0 0 0 4px #201a2b8f, 0 18px 60px #120d1ba8;
}
.dialog h2 { margin: 0 0 7px; color: #f2f4e9; font-size: clamp(25px,3.7vw,44px); font-weight: 900; line-height: 1.14; letter-spacing: -.033em; }
.dialog-eyebrow { margin: 0 0 7px; color: #f5c791; font: 800 11px/1.2 var(--mono); letter-spacing: .14em; }
.dialog-text { margin: 0 0 13px; color: #c3d2d6; font-size: 13px; line-height: 1.52; }
.upgrade-dialog { width: min(100%, 874px); }
.upgrade-options { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.upgrade-choice {
  display: grid; position: relative; align-content: start; justify-items: start; gap: 5px;
  min-height: 170px; padding: 11px 11px 12px; border: 1px solid #859398;
  background: linear-gradient(150deg,#364853,#28313e 58%);
  box-shadow: inset 0 0 0 3px #202630ad, inset 0 -2px #808b8f65, 0 3px 0 #191523;
  color: #f1f3e5; text-align: left;
}
.upgrade-choice:hover, .upgrade-choice:focus-visible { border-color: #efcd87; color: #fff4cc; }
.upgrade-choice.calibration-choice { border-color: #bc926e; background: linear-gradient(145deg,#62473f,#333042 81%); }
.upgrade-choice canvas {
  width: 45px; height: 45px; image-rendering: pixelated; margin-bottom: 2px; padding: 3px;
  background: #1e222b9e; border: 1px solid #c2af966b; box-shadow: inset 0 1px #0e1119;
}
.upgrade-choice kbd { position: absolute; top: 9px; right: 9px; }
.upgrade-choice strong { color: inherit; font-size: 15px; }
.upgrade-choice .item-rank { color: var(--brass); font: 800 11px/1.15 var(--mono); }
.upgrade-choice .item-description { color: #ccdadc; font-size: 11px; line-height: 1.5; }
.upgrade-choice .item-stats { width: 100%; display: grid; grid-template-columns: .9fr 1.24fr 1.12fr; gap: 3px; }
.item-stats > span { min-width: 0; display: grid; gap: 2px; padding: 4px; border-top: 1px solid #758890; background: #0e1822aa; }
.item-stats > span > span { color: #b9c9ce; font-size: 9px; white-space: nowrap; }
.item-stats b { color: #edf1e3; font: 750 9px/1.3 var(--mono); white-space: nowrap; }
.small-dialog { width: min(100%, 395px); }
.intro-dialog { width: min(100%, 560px); border-top-color: var(--brass); }
.intro-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.intro-list li {
  display: grid; gap: 3px; padding: 8px 11px;
  border-left: 3px solid var(--mint); background: #141c26cc;
  color: #d5e0e2; font-size: 12px; line-height: 1.55;
}
.intro-list li.intro-warn { border-left-color: #ee986b; }
.intro-list li.intro-tech { border-left-color: var(--brass); }
.intro-list strong { color: #f7ebd2; font-size: 13px; }
.dialog-buttons { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.end-dialog { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.end-dialog h2 { padding-right: 110px; }
.report-stamp {
  position: absolute; top: 18px; right: 20px; transform: rotate(-12deg);
  padding: 6px 12px; border: 3px double currentColor;
  font: 900 22px/1 inherit; letter-spacing: .2em; opacity: .85; pointer-events: none;
}
.report-stamp[data-outcome="qualified"] { color: var(--mint); }
.report-stamp[data-outcome="pending"] { color: var(--brass); }
.report-stamp[data-outcome="repair"], .report-stamp[data-outcome="stopped"] { color: #ff8a6a; }
.end-motto {
  margin: 12px 0 0; padding: 8px 12px; border-left: 3px solid var(--brass);
  background: #1a1622aa; color: #f3e6cf; font-size: 13px; line-height: 1.6;
}
.end-dialog[data-outcome="repair"] .end-motto, .end-dialog[data-outcome="stopped"] .end-motto { border-left-color: #ee986b; }
.end-dialog .dialog-buttons { flex: none; }
.end-dialog .report-history { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.report-history:focus-visible { outline: 1px solid var(--mint); outline-offset: 2px; }
.end-dialog[data-outcome="qualified"] { border-top-color: #a9e5cb; }
.end-dialog[data-outcome="qualified"] .dialog-eyebrow { color: #a9e5cb; }
.end-dialog[data-outcome="repair"], .end-dialog[data-outcome="stopped"] { border-top-color: #ee986b; }
.end-dialog[data-outcome="repair"] .dialog-eyebrow, .end-dialog[data-outcome="stopped"] .dialog-eyebrow { color: #f4c892; }
.result-stats { display: flex; margin: 0 0 13px; border: 1px solid #788b8e; background: #101d27; }
.result-stats div { flex: 1; min-width: 0; padding: 7px 9px; border-right: 1px solid #536a75; }
.result-stats div:last-child { border-right: 0; }
.result-stats dt { color: #bfced1; font-size: 11px; }
.result-stats dd { margin: 4px 0 0; color: #f5e5bc; font: 850 19px/1.1 var(--mono); }
.report-impact { margin: 0 0 11px; color: #f1c69d; font-size: 11px; }
.report-history h3 { margin: 0 0 5px; color: #e8e0d3; font-size: 12px; }
.report-history ul { margin: 0; padding: 0; list-style: none; }
.report-history li { display: grid; gap: 2px; padding: 6px 0; color: #dce3e0; font-size: 11px; line-height: 1.43; border-top: 1px solid #69707a; }
.report-row { display: flex; gap: 6px; align-items: baseline; }
.report-row time { color: #f1c98e; font-family: var(--mono); }
.report-row b { color: #f0e9d9; }
.report-row strong { margin-left: auto; color: #ffcc96; white-space: nowrap; }
.report-history li[data-status="reviewed"] strong { color: var(--mint); }
.report-history li[data-status="shortcut"] strong { color: #ffb497; }
.report-history p { margin: 0; }
.report-history .report-reading { color: #bfcbd1; font-variant-numeric: tabular-nums; }

.station-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px 0; color: #abbec7; font-size: 10px; }
.station-foot strong { margin-right: 5px; color: #d3e0de; }
.station-foot kbd { min-height: 17px; font-size: 9px; margin-right: 4px; }
.touch-controls { display: none; position: absolute; z-index: 3; left: var(--inset); right: var(--inset); bottom: 65px; align-items: end; justify-content: space-between; pointer-events: none; }
.joystick { width: 77px; height: 77px; position: relative; touch-action: none; pointer-events: auto; border: 1px solid #90b6c6b5; border-radius: 50%; background: #0c1b2c99; }
.joystick i { width: 25px; height: 25px; position: absolute; left: 25px; top: 25px; border-radius: 50%; background: #9ed6c7be; pointer-events: none; }
.floating-joystick { position: absolute; z-index: 3; left: 0; top: 0; transform: translate(-50%,-50%); pointer-events: none; }
.touch-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.touch-actions button {
  width: 61px; height: 44px; touch-action: none; pointer-events: auto;
  border: 1px solid #9cb6bb; background: linear-gradient(#2f4657ee,#192b3aee);
  color: #f2f6ee; font-size: 12px; font-weight: 850;
}
#touch-accept { min-width: 72px; touch-action: manipulation; border-color: #c9a36e; color: #ffe3b8; white-space: nowrap; }
#touch-accept:active { background: #503b2c; }
#touch-accept[data-kind="beautifier"] { border-color: #b887c3; color: #f2d1ef; }
#touch-accept[data-kind="beautifier"]:active { background: #493151; }
#touch-dash { position: relative; padding-bottom: 5px; }
#touch-dash:disabled { opacity: .72; }
.touch-dash-meter { position: absolute; inset: auto 6px 4px; height: 3px; background: #0f1a27; }
.touch-dash-meter i { display: block; height: 100%; transform-origin: left center; background: #88c8ed; }
#touch-dash.dash-ready { border-color: var(--mint); color: #d9f8e5; }
#touch-dash.dash-ready .touch-dash-meter i { background: var(--mint); }

.workstation:fullscreen { width: 100%; margin: 0; padding: 6px 9px; display: grid; grid-template-rows: auto minmax(0,1fr); background: var(--body); }
.workstation:fullscreen .stage { height: 100%; min-height: 0; }
.workstation:fullscreen .station-foot { display: none; }

@media (max-width: 920px) {
  .workstation { width: calc(100% - 28px); }
  .weapon-chip { width: 28px; }
}
@media (max-width: 640px) {
  .workstation { width: calc(100% - 16px); margin: 8px auto; }
  .station-bar { min-height: 38px; gap: 5px; flex-wrap: wrap; padding-bottom: 6px; }
  .station-name { gap: 6px; font-size: 11px; letter-spacing: .025em; }
  .station-name small { display: none; }
  .station-mark { width: 24px; height: 24px; }
  .station-mark::before { inset: 5px 7px 6px 5px; }
  .station-mark::after { width: 12px; left: 8px; top: 11px; }
  .station-mark i { display: none; }
  .station-actions { margin-left: auto; gap: 3px; }
  .switch { min-width: 0; height: 29px; padding: 0 6px; gap: 4px; font-size: 9px; }
  .stage { --inset: 8px; --alerts: 60px; --contexts: 60px; height: min(calc(100dvh - 76px), 840px); min-height: 391px; }
  .title-screen { align-items: end; padding-bottom: 28px; background: linear-gradient(0deg,#191422f7 2%,#20192bdc 30%,#231a2b1c 66%,transparent 92%); }
  .title-content { width: calc(100% - 31px); margin-left: 16px; }
  .title-content h1 { font-size: clamp(39px, 11vw, 66px); margin-bottom: 10px; }
  .title-content h1 span { display: inline; font-size: 1em; margin-top: 0; }
  .title-content p { max-width: 311px; margin-bottom: 15px; font-size: 12px; }
  .title-line { margin-bottom: 12px; }
  .title-content .primary { min-width: 145px; min-height: 47px; }.title-content .secondary { min-height: 46px; }
  .title-shift { right: 9px; top: 9px; bottom: auto; padding: 6px 7px; font-size: 9px; }
  .title-shift strong { font-size: 13px; }
  .control-legend { gap: 8px; margin-top: 15px; font-size: 10px; }
  .control-legend span { gap: 4px; }
  kbd { min-width: 17px; min-height: 16px; padding: 2px 4px; font-size: 9px; }
  .hud-top { top: 8px; grid-template-columns: minmax(0,1fr) auto minmax(0,.74fr); gap: 4px; }
  .health-panel, .time-panel, .count-panel { min-width: 0; padding: 5px 6px; }
  .time-panel { min-width: 67px; }.time-panel strong { font-size: 22px; }
  .meter-label, .meter-label strong, .time-panel span, .count-panel span { font-size: 9px; letter-spacing: 0; }
  .count-panel strong { font-size: 10px; }
  .boss-meter { top: 63px; width: min(92%, 350px); padding: 6px 8px 7px; }
  .boss-meter .meter { height: 11px; }
  .stage.boss-active .toast, .stage.boss-active .training-panel { top: 118px; }
  .incident-panel { width: min(236px,58%); padding: 5px 6px; }
  .incident-panel strong, .toast strong { font-size: 11px; }
  .incident-panel time, .incident-panel p, .toast span { font-size: 11px; }
  .incident-panel .batch-reading, .training-panel .batch-reading { font-size: 11px; }
  .toast { max-width: min(172px,41%); padding: 5px 7px; gap: 2px; }
  .training-panel { padding: 6px 7px; width: min(235px, 74%); gap: 4px; }
  .training-panel > strong { font-size: 13px; }.training-panel p { font-size: 11px; }
  .training-header, .training-panel kbd { font-size: 10px; }
  .hud-bottom { bottom: 8px; gap: 4px; grid-template-columns: minmax(0,1fr) minmax(76px,.83fr) minmax(0,.67fr); }
  .equipment, .risk-panel, .dash-panel { padding: 4px; min-height: 34px; }
  .equipment { gap: 2px; }.equipment .weapon-icons { flex-wrap: wrap; gap: 2px; max-width: 116px; }
  .weapon-chip { width: 33px; min-height: 32px; }.weapon-chip canvas { width: 21px; height: 21px; }
  .equipment .gear-details { display: none; }
  .risk-panel > div:first-child, .review-count, .risk-panel strong, .dash-panel > div:first-child { font-size: 10px; gap: 3px; }
  .dash-panel { min-width: 54px; }
  .shortcut-card, .inspection-card, .tool-card { padding: 6px 7px; gap: 3px; }
  .shortcut-card { width: min(245px,calc(100% - 16px)); }
  .shortcut-card-top strong, .inspection-card strong, .tool-card strong { font-size: 12px; }
  .shortcut-card > span, .shortcut-instruction, .inspection-card > span, .tool-card > span { font-size: 11px; }
  .overlay { padding: 10px; }.dialog { padding: 13px; }.dialog-text { font-size: 11px; margin-bottom: 9px; }
  .action { min-height: 42px; padding: 0 10px; font-size: 12px; }.action.primary { min-width: 109px; }
  .upgrade-options { grid-template-columns: 1fr; gap: 6px; }
  .upgrade-choice { min-height: 55px; padding: 7px 26px 8px 52px; gap: 3px; }
  .upgrade-choice canvas { position: absolute; top: 8px; left: 8px; width: 36px; height: 36px; }
  .upgrade-choice strong { font-size: 13px; }.upgrade-choice .item-rank, .upgrade-choice .item-description { font-size: 10px; }
  .upgrade-choice kbd { top: 7px; right: 7px; }
  .dialog-buttons { margin-top: 12px; }.station-foot { padding-top: 6px; font-size: 9px; }
  .result-stats div { padding-inline: 5px; }.result-stats dd { font-size: 16px; }
  .end-dialog h2 { padding-right: 80px; }
  .report-stamp { top: 10px; right: 10px; font-size: 16px; }
  .intro-list li { padding: 7px 9px; font-size: 11px; }
  .intro-list strong { font-size: 12px; }
}
@media (pointer: coarse) {
  .touch-controls:not([hidden]) { display: flex; }
  .enter-hint, .keyboard-tip, .control-legend, .shortcut-instruction kbd, .dash-panel { display: none; }
  .touch-legend { display: flex; }
  .stage { --contexts: 168px; }
  .switch { height: 38px; }
  .weapon-chip { width: 36px; min-height: 36px; }
}
@media (max-height: 490px) and (orientation: landscape) {
  .workstation { margin-block: 4px; }
  .station-bar { min-height: 34px; padding-bottom: 4px; }
  .station-foot { display: none; }
  .stage { height: calc(100dvh - 43px); min-height: 249px; --contexts: 62px; --alerts: 66px; }
  .title-content h1 { font-size: clamp(35px, 6.2vw, 61px); margin-bottom: 7px; }
  .title-content h1 span { display: inline; font-size: 1em; margin-top: 0; }
  .title-content p { margin-bottom: 10px; }.title-line, .control-legend { margin-bottom: 6px; margin-top: 8px; }
  .title-content .action { min-height: 42px; }
  .joystick { width: 68px; height: 68px; }.joystick i { top: 21px; left: 21px; }
  .touch-controls { bottom: 48px; }.touch-actions { gap: 4px; }
  .shortcut-card { left: 50%; transform: translateX(-50%); }
  .inspection-card { width: min(197px, 40%); left: 67%; }
  .upgrade-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .upgrade-choice { min-height: 118px; padding: 7px 8px; }
  .upgrade-choice canvas { position: static; width: 30px; height: 30px; }
  .item-stats b { font-size: 8px; }
  .dialog { padding: 10px 14px; }.dialog h2 { font-size: 25px; }
  .end-dialog .dialog-text, .end-dialog .result-stats, .report-impact { margin-bottom: 7px; }
  .report-history li { padding-block: 4px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
