:root {
  --station-ink: #f9e8d1;
  --station-nixie: #ffad68;
  --station-signal: #a0eddb;
  --station-edge: linear-gradient(178deg, #e4b498, #79543f 16%, #3b2520 37%, #3b221c 80%, #af7858);
  --station-enamel: radial-gradient(ellipse at 10% 0%, #a245293d, transparent 65%),
    repeating-linear-gradient(96deg, #f5c68906 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #4c2421, #311917 58%, #251614);
  --station-switch: linear-gradient(180deg, #594139, #3b2b26 28%, #271c19 68%, #33251f);
  --station-display: repeating-linear-gradient(0deg, #fa986813 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 36% 98%, #502a15, #251610 72%);
  --station-light: radial-gradient(circle at 36% 30%, #d5fff1, #84dfce 24%, #309889 52%, #164a44 76%);
  --station-screw: radial-gradient(ellipse at center, #1c110d 0 16%, transparent 24%),
    linear-gradient(140deg, #f4c4a2, #6d4939 46%, #a97d64 55%, #261813 74%);
}

/* The cover behind the console is independent of the button layout. */
.ws-home {
  align-content: center;
  min-height: 100%;
  padding: max(38px, env(safe-area-inset-top)) max(25px, env(safe-area-inset-right))
    max(38px, env(safe-area-inset-bottom)) max(clamp(34px, 6vw, 118px), env(safe-area-inset-left));
}
.ws-home .ws-world {
  background: var(--night-cover, none) 58% center / cover no-repeat, #281711;
}
.ws-home .ws-shade {
  background: linear-gradient(90deg, #180e0cef, #1b100dd4 26%, #21151175 47%, transparent 71%),
    linear-gradient(0deg, #140a09ad, transparent 28%, transparent 86%, #1b0d09a6);
}
.ws-bench-frame {
  inset: clamp(10px, 1.5vw, 22px);
  border-color: #db9e7269;
  box-shadow: 0 0 0 3px #180e0aa6, inset 0 0 0 1px #100a0780;
}
.ws-bench-frame::before, .ws-bench-frame::after {
  width: min(22%, 240px);
  height: 10px;
  background: repeating-linear-gradient(90deg, #e4b28d9c 0 1px, transparent 1px 20px) center / 100% 100% no-repeat,
    repeating-linear-gradient(90deg, #c58c6266 0 1px, transparent 1px 5px) top / 100% 5px no-repeat;
}
.ws-bench-frame i {
  width: 19px;
  height: 19px;
  background: var(--sa-screw) 2px 2px / 10px 10px no-repeat,
    linear-gradient(90deg, #e1ad88, #96634626) left top / 100% 2px no-repeat,
    linear-gradient(#e1ad88, #96634626) left top / 2px 100% no-repeat;
}
.ws-intro {
  display: grid;
  gap: clamp(24px, 4.1vh, 44px);
  width: min(100%, 492px);
}
.ws-nameplate { align-self: start; }
.ws-setting {
  gap: 12px;
  max-width: 100%;
  margin: 0 0 19px;
  padding: 7px 13px 7px 10px;
  border: 1px solid #9e6b4b;
  border-radius: 3px;
  background: linear-gradient(180deg, #553026, #2d1a16 80%);
  box-shadow: inset 0 1px #f2b88535, 0 3px 8px #12090985;
  color: #ffd5af;
  font: 800 clamp(10px, .85vw, 13px)/1.4 var(--sa-engraving);
  letter-spacing: .08em;
}
.ws-setting::before {
  width: 8px;
  height: 8px;
  border: 1px solid #294c43;
  background: var(--station-light);
  box-shadow: 0 0 0 2px #382a20, 0 0 0 3px #a77758, 0 0 12px #7ff5d575;
}
.ws-title {
  font: 800 clamp(59px, 7vw, 108px)/.86 var(--sa-engraving);
  color: #fee4c5;
  letter-spacing: -.055em;
  text-shadow: 0 1px #fff4dc, 0 3px #8e5d42, 0 6px #22110e, 0 10px 23px #100705f2;
}
.ws-title span {
  margin: 0;
  color: #e7a773;
  letter-spacing: -.055em;
  text-shadow: 0 1px #f0c69e, 0 3px #754831, 0 6px #21110e, 0 10px 23px #100705f2;
}
.ws-console {
  position: relative;
  padding: clamp(11px, 1.4vw, 17px);
  border: 1px solid #bd8c6c;
  border-radius: 7px 7px 10px 10px;
  background: var(--station-enamel);
  box-shadow: 0 0 0 3px #1c110e, 0 0 0 4px #6a4937, 0 12px 0 -3px #150c0a, 0 24px 44px #100705bb,
    inset 0 0 0 2px #fff0df20, inset 0 -4px #180d0b;
}
.ws-console::before, .ws-console::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -27px;
  top: 24%;
  width: 39px;
  height: 12px;
  border: 1px solid #704c3c;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(#786050, #e0baa1 25%, #846854 39%, #35261e 74%, #a77960);
  box-shadow: 0 4px 7px #140906b0;
}
.ws-console::after { top: 36%; width: 30px; right: -18px; }
.ws-console-bank {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: stretch;
  gap: 10px;
}
.sa-mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 5px;
  width: 100%;
  margin: 0;
  padding: 7px;
  border: 1px solid #92694f;
  border-radius: 4px;
  background: linear-gradient(178deg, #2b201a, #1e1512);
  box-shadow: inset 0 2px 5px #1a100e, 0 1px #e8ad7b35;
}
.sa-mode-picker legend {
  padding: 0 5px;
  color: #f6c8a1;
  font: 700 10px/1.3 var(--night-meter);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sa-mode-picker label span {
  position: relative;
  align-content: center;
  gap: 5px;
  min-height: 53px;
  padding: 5px 3px 7px;
  border-color: #88624b;
  border-radius: 4px;
  background: var(--station-switch);
  box-shadow: inset 0 1px #ffe7cf25, inset 0 -4px #201513, 0 2px 4px #140a08;
  color: var(--station-ink);
  font: 600 clamp(10px, 1vw, 13px)/1.12 var(--sa-control-face);
  overflow-wrap: anywhere;
  transition: border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}
.sa-mode-picker input:checked + span {
  border-color: #95bbad;
  background: linear-gradient(#22362f, #202924 45%, #1a231e);
  box-shadow: inset 0 2px 6px #100d0b, 0 1px #ffc79432;
  color: #dcfae9;
}
.sa-mode-picker input:focus-visible + span { outline-color: var(--station-signal); }
#sa-mode-guide {
  min-height: 1.5em;
  margin: 1px 0 0;
  color: #dfc8b4;
  font: 600 12px/1.3 var(--sa-control-face);
  text-shadow: 0 1px #140d0a;
}
.ws-keywell {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.ws-launch, .ws-launch:hover, .ws-launch:active {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 5px;
  place-items: center;
  height: 100%;
  min-height: 93px;
  padding: 7px 6px 8px;
  border: 1px solid #a8714f;
  border-radius: 5px;
  background: radial-gradient(ellipse at 50% 28%, #552720, #301916 74%);
  box-shadow: inset 0 1px #f1bc8e47, inset 0 -3px #261513, 0 2px 5px #180a08a6;
  color: #ffe4bc;
  font: 800 clamp(10px, 1.15vw, 14px)/1.2 var(--sa-engraving);
  letter-spacing: .02em;
}
.ws-launch::before, .ws-launch::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--station-screw);
  box-shadow: 0 0 0 1px #281915;
}
.ws-launch::before { left: 8px; }
.ws-launch::after { right: 8px; }
.ws-launch-label {
  display: grid;
  place-items: center;
  min-height: 25px;
  width: 100%;
  padding: 3px 2px;
  border-block: 1px solid #7e4b36;
  border-radius: 2px;
  background: #1f140f;
  color: var(--station-nixie);
  text-shadow: 0 0 6px #e95d3a99;
}
.ws-lever {
  position: relative;
  display: block;
  align-self: center;
  width: 32px;
  height: 57px;
  border: 1px solid #cf9c79;
  border-radius: 9px;
  background: linear-gradient(90deg, #d7a587, #754b36 18%, #24130f 24% 76%, #583928 82%, #ae7656);
  box-shadow: 0 0 0 2px #271811, inset 0 0 0 1px #fcd6b860, 0 4px 7px #1a0d09bd;
}
.ws-lever::before {
  content: "";
  position: absolute;
  inset: 5px 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, #120b08, #020201 75%, #553a2b);
  box-shadow: inset 0 2px 5px #080403;
}
.ws-lever i {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 11px;
  height: 39px;
  transform: translateX(-50%) rotate(25deg);
  transform-origin: 50% 92%;
  border: 1px solid #794e3d;
  border-radius: 4px;
  background: linear-gradient(90deg, #7e5745, #f5d9c1 31%, #c29c87 47%, #645143 75%, #352520);
  box-shadow: 2px 3px 5px #0e0806bd;
  transition: transform 100ms cubic-bezier(.2, .72, .37, 1.15);
}
.ws-lever i::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 46px;
  height: 17px;
  border: 1px solid #c07f62;
  border-radius: 5px;
  background:
    linear-gradient(180deg, #ffb99665, transparent 35%, #270b09a4 83%),
    repeating-linear-gradient(90deg, #8a2f27 0 4px, #b35541 5px, #581a18 7px);
  box-shadow: inset 0 1px #eeb1917d, 0 3px 3px #180908;
  transform: translateX(-50%) rotate(-25deg);
  transition: transform 100ms cubic-bezier(.2, .72, .37, 1.15);
}
.ws-launch:is(:active, [data-lever-pressed]) .ws-lever i { transform: translateX(-50%) rotate(-26deg); }
.ws-launch:is(:active, [data-lever-pressed]) .ws-lever i::before { transform: translateX(-50%) rotate(26deg); }
@media (hover: hover) {
  .ws-launch:hover { border-color: #ffd394; }
  .ws-launch:hover .ws-launch-label { color: #ffd398; text-shadow: 0 0 9px #ff8658; }
  .sa-mode-picker label:hover span { border-color: #efa87a; }
}
.ws-home .sa-home-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin: 11px 0 0;
  padding: 9px 0 0;
  border-top: 1px solid #d8a17a60;
  box-shadow: inset 0 1px #21140f;
}
.ws-home .sa-home-tools .sa-control { min-width: 0; padding-inline: 5px; font-size: 12px; }

/* Enamel switch faces, indicator bulbs and orange numerical tubes. */
.sa-control, .ws-button:not(.ws-launch) {
  border-color: #a17556;
  background: var(--station-switch);
  box-shadow: inset 0 1px #f9c49b38, inset 0 -3px #1b100d, 0 3px 6px #160a08a6;
  color: var(--station-ink);
}
.sa-control[aria-pressed]::before {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  border: 1px solid #6e4e3f;
  border-radius: 50%;
  background: #211510;
  box-shadow: 0 0 0 1px #170e0b;
}
.sa-control[aria-pressed="true"] {
  border-color: #a2ad90;
  background: linear-gradient(#4a4535, #30271e 58%, #271a15);
  color: #e5f7e7;
}
.sa-control[aria-pressed="true"]::before {
  border-color: #76b9a9;
  background: var(--station-light);
  box-shadow: 0 0 7px #91eec4a6;
}
.sa-control--primary, .ws-button:not(.ws-launch) {
  border-color: #f1bf94;
  background: linear-gradient(#f6c8a0, #d69669 60%, #c4865a);
  box-shadow: inset 0 1px #ffe0bc, inset 0 -4px #925338, 0 3px #48291e, 0 5px 9px #170d0abb;
  color: #281611;
}
.sa-control:active:enabled, .ws-button:not(.ws-launch):active {
  box-shadow: inset 0 2px 5px #29100ead, 0 1px #40251b;
}
.sa-control:disabled { color: #dec3ad; }
#sa-open-help, #sa-open-profile { border-color: #a17556; }
.sa-control:focus-visible, .ws-button:focus-visible { border-color: var(--station-signal); }
@media (hover: hover) {
  .sa-control:hover:enabled { border-color: #ffd3a3; filter: brightness(1.08); }
  .sa-control:hover[aria-pressed="true"] { border-color: var(--station-signal); }
  .sa-control--primary:hover:enabled, .ws-button:not(.ws-launch):hover {
    border-color: #ffebcb;
    box-shadow: inset 0 1px #fff4d8, inset 0 -4px #925338, 0 3px #48291e, 0 7px 14px #170d0abb;
  }
}

/* Run log, guide and profile use the same station hardware. */
.ws-result .ws-shade {
  background: radial-gradient(ellipse at center, #1d100a36, #140a0abd 87%), #180c0b38;
}
.ws-report, .sa-dialog {
  border: 1px solid #ba8a6b;
  border-radius: 8px;
  background:
    var(--sa-screw) left 8px top 8px / 10px 10px no-repeat,
    var(--sa-screw) right 8px top 8px / 10px 10px no-repeat,
    var(--sa-screw) left 8px bottom 8px / 10px 10px no-repeat,
    var(--sa-screw) right 8px bottom 8px / 10px 10px no-repeat,
    var(--station-enamel);
  box-shadow: 0 0 0 3px #1d110e, 0 0 0 4px #805740, 0 18px 45px #100706c7,
    inset 0 0 0 3px #341c15, inset 0 0 0 4px #d0a07a45;
}
.ws-report, #sa-profile, #sa-paused {
  background:
    var(--sa-screw) left 8px top 8px / 10px 10px no-repeat,
    var(--sa-screw) right 8px top 8px / 10px 10px no-repeat,
    var(--sa-screw) left 8px bottom 8px / 10px 10px no-repeat,
    var(--sa-screw) right 8px bottom 8px / 10px 10px no-repeat,
    linear-gradient(145deg, #341a1380, #2d171269),
    var(--induction-panel, none) center / 100% 100% no-repeat local,
    var(--station-enamel);
}
.ws-report h1, .sa-dialog h2 {
  color: var(--station-ink);
  font: 800 clamp(21px, 2.65vw, 34px)/1.13 var(--sa-engraving);
  letter-spacing: -.045em;
  text-shadow: 0 2px #311910;
  overflow-wrap: anywhere;
}
.ws-result-main, .sa-dialog-head { border-bottom-color: #ba8a6b8c; }
.ws-result-mode {
  margin-bottom: 5px;
  color: #ffd19e;
  font: 700 12px/1.25 var(--night-meter);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ws-boundary-hint { color: #f7c898; }
.ws-result-header > div:last-child { min-width: 0; }
.sa-optic {
  --sa-lens-color: #a8f2d9;
  --sa-lens-core: #318477;
  border-color: #493226;
  background: repeating-conic-gradient(#371d1460 0deg 2deg, transparent 2deg 7deg),
    conic-gradient(from 25deg, #ecc2a6, #76503c, #ad765b, #f4d2b3, #674334, #ecc2a6);
  box-shadow: 0 0 0 1px #e7b9909c, inset 0 0 0 2px #ffe2c37e, 0 4px 8px #1a0b08bd;
}
.sa-optic::before {
  border-color: #b48062;
  border-bottom-color: #614235;
  background: linear-gradient(142deg, transparent 17%, #e7fff857 24%, #e7fff81c 38%, transparent 52%),
    radial-gradient(circle at 56% 60%, var(--sa-lens-color), var(--sa-lens-core) 25%, #221714 70%);
  box-shadow: inset 0 0 8px 3px #140a0880, 0 0 0 2px #341c14;
}
.ws-report[data-signal="stop"] .sa-chassis-lens { --sa-lens-color: #ff9b68; --sa-lens-core: #963f2b; }
.sa-chassis-lens canvas {
  inset: auto;
  background: radial-gradient(circle at 39% 30%, #554337, #2c201a 65%, #120a08);
  box-shadow: inset 0 1px 6px #21140d, 0 0 0 1px #e6a97f9e;
}
.ws-report[data-signal="complete"] .sa-chassis-lens canvas {
  background: radial-gradient(circle at 39% 30%, #3b5b4c, #203227 65%, #120e0a);
  box-shadow: inset 0 1px 6px #21140d, 0 0 0 1px #9bddb9;
}
.ws-stats, .sa-result-metrics, .sa-profile-metrics {
  gap: 3px;
  padding: 3px;
  border-color: #a57659;
  background: var(--station-edge);
  box-shadow: 0 0 0 2px #251710, inset 0 1px #edbf94a6;
}
.ws-stats div, .sa-result-metrics div, .sa-profile-metrics div {
  border-color: #7a5039;
  border-radius: 3px;
  background: var(--station-display);
  box-shadow: inset 0 2px 6px #1a0c08c4;
}
.ws-stats dd, .sa-result-metrics dd, .sa-profile-metrics dd, #sa-map-panel b, html #mass {
  color: var(--station-nixie);
  text-shadow: 0 0 7px #ff673c87;
}
.ws-stats dd {
  position: relative;
  display: flex;
  gap: .09em;
  font-size: clamp(22px, 4.8vw, 36px);
}
.ws-reading {
  position: absolute;
  overflow: hidden;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  white-space: nowrap;
}
.ws-nixie {
  display: grid;
  flex: 0 1 .84em;
  min-width: 0;
  height: 1.24em;
  padding: .06em 0 .13em;
  place-items: center;
  border: 1px solid #bc87604d;
  border-bottom-color: #b67f54;
  border-radius: .31em .31em .18em .18em;
  background: linear-gradient(0deg, #b77750 0 2px, #43271d 3px, transparent 4px),
    linear-gradient(105deg, #ffdfbd35, transparent 18% 81%, #e3b8a328),
    radial-gradient(ellipse at 52% 39%, #8f412f61, #170c0a 79%);
  box-shadow: inset 0 1px #eed3c04f, 0 2px 3px #1b0c08a6;
  color: #ffb773;
  text-shadow: 0 0 3px #ff522a, 0 0 9px #fa6e3a;
}
.ws-nixie::before { content: attr(data-glyph); }
.ws-nixie[data-glyph=":"] { flex-basis: .39em; }
.ws-result-actions {
  border-color: #a77556;
  background: linear-gradient(#503228, #2d1e19 50%, #352119);
  box-shadow: inset 0 1px #f7c29448, inset 0 -2px #1e110e, 0 3px 7px #1b0b08a6;
}
.sa-record { border-color: #b58b6d82; }
.sa-record p + p { margin-top: 4px; }
.sa-record strong { color: #ffe0bc; }
.sa-record span[data-new="true"] { color: #abf2d8; }
.sa-dialog::backdrop { background: radial-gradient(ellipse at center, #1b121192, #170d0be0 88%); }
#sa-help { width: min(768px, calc(100% - 34px)); }
#sa-help .sa-optic { --sa-lens-color: #f7d688; --sa-lens-core: #925e36; }
#sa-profile .sa-optic { --sa-lens-color: #a7f6de; --sa-lens-core: #408874; }
#sa-paused .sa-optic { --sa-lens-color: #ffb57c; --sa-lens-core: #ae5a32; }
#sa-help .sa-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
#sa-profile { width: min(805px, calc(100% - 34px)); }
#sa-profile-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 10px 13px;
}
#sa-profile-form .sa-dialog-head, #sa-profile-form .sa-actions, .sa-profile-records { grid-column: 1 / -1; }
#sa-profile-form .sa-dialog-head { margin-bottom: 0; }
.sa-profile-identity, .sa-upgrades, .sa-profile-records {
  min-width: 0;
  margin-bottom: 0;
  padding: 10px;
  border: 1px solid #9f755a;
  border-radius: 4px;
  background: linear-gradient(132deg, #513128, #2b1b16 88%);
  box-shadow: inset 0 1px #f3c9a42e, 0 2px 5px #170c09b0;
}
.sa-profile-name, .fleet-selector {
  border-color: #a47757;
  background: radial-gradient(ellipse at 50% 98%, #543522, #241913 76%);
  box-shadow: inset 0 2px 6px #160b08ad, 0 0 0 2px #3e271e;
}
.fleet-selector button { padding-inline: 4px; }
.fleet-selector small { color: #ecbe98; }
.sa-progress {
  border-color: #9a6a50;
  background: radial-gradient(ellipse at 41% 100%, #523022, #251711 78%);
  box-shadow: inset 0 2px 6px #170a08, 0 0 0 2px #3d281f;
}
.sa-progress-header span, .sa-upgrade-header output { color: #ffbd8b; }
.sa-progress progress {
  border-color: #a6795e;
  background: repeating-linear-gradient(90deg, #9d735348 0 1px, transparent 1px 9px), #241610;
  accent-color: #ec9864;
}
.sa-progress progress::-webkit-progress-value {
  background: repeating-linear-gradient(90deg, #57291777 0 1px, transparent 1px 9px), linear-gradient(#fac297, #b8673f);
}
.sa-progress progress::-moz-progress-bar {
  background: repeating-linear-gradient(90deg, #57291777 0 1px, transparent 1px 9px), linear-gradient(#fac297, #b8673f);
}
.sa-dialog .sa-progress-rules { margin: 0; }
.sa-upgrade-header output { font: 700 12px/1.3 var(--night-meter); }
.sa-upgrade {
  padding: 7px 8px;
  border-color: #8c644d;
  border-inline-start: 3px solid #ba845c;
  background: linear-gradient(135deg, #472d24, #2d1b15);
}
.sa-upgrade small { color: #f1c6a0; }
.sa-upgrade .sa-control[aria-disabled="true"] { filter: none; border-color: #876750; }
.sa-profile-records .sa-profile-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sa-profile-records .sa-profile-metrics div:nth-child(n+3) dd { color: #ffbb82; }
.sa-pause-hint kbd {
  border-color: #b78968;
  background: var(--station-switch);
  box-shadow: 0 2px #593425;
}

/* Match controls stay small enough to leave sightlines open. */
html .plate {
  border-color: #b58261;
  background: linear-gradient(155deg, #492e24f5, #2c1c16fa 69%, #3c271ff5);
  box-shadow: inset 0 0 0 2px #241510, inset 0 0 0 3px #cd9e7152, 0 3px #231411, 0 5px 11px #1b0a07b8;
}
html .mass-mark {
  border-color: #c2926f;
  background: var(--station-light);
  box-shadow: 0 0 0 1px #281611, 0 0 8px #6ed1bf4d, inset 0 0 4px #14201b;
}
html .mass-mark::before { border-color: #c4ffeb9c; }
html .label { color: #f4d6b9; }
html #mass { line-height: 1.08; }
html .board .label { border-color: #b48b6c87; }
#ranks li span:nth-child(3) { padding-block: 2px; line-height: 1.16; overflow-wrap: anywhere; }
#ranks li span:last-child { color: #ffd6ac; }
#sa-pause {
  border-color: #ba8762;
  background: radial-gradient(circle at 45% 32%, #664338, #37221a 65%);
  box-shadow: 0 0 0 2px #281811, inset 0 0 0 3px #c39b7440, 0 3px 8px #1d100cc4;
}
html #boost {
  border-color: #dcaa7d;
  background: radial-gradient(circle at 43% 26%, #a14c36, #5a2922 54%, #271514 75%) center / 80% 80% no-repeat,
    repeating-conic-gradient(#281611a3 0deg 3deg, transparent 3deg 8deg),
    conic-gradient(from 12deg, #ecc2a0, #674839, #af8066, #ecc2a0, #805240, #ecc2a0);
  box-shadow: 0 5px 16px #1c0d09b8, inset 0 0 0 3px #9b7456, inset 0 0 13px #e9a77755;
}
.sa-boost-label { color: #ffe1b9; }
html #boost[data-ready="true"] { box-shadow: inset 0 0 0 3px #cc966d, 0 0 0 2px #d08852, 0 0 14px #ee8a548c; }
html #boost[data-active="true"] {
  border-color: #b8e6cf;
  background: radial-gradient(circle at 43% 25%, #4d765f, #244337 55%, #18261d 77%) center / 81% 81% no-repeat,
    repeating-conic-gradient(#16231c96 0deg 3deg, transparent 3deg 8deg), #7a9b82;
  box-shadow: inset 0 0 0 3px #7dc1ab, 0 0 15px #a3f9d57d;
}
html #boost[data-empty="true"] { border-color: #a6836c; background: #3b2a22; }
html #boost[data-empty="true"]::after { background: #352119; color: #e8c0a1; }
#sa-map-panel {
  border-color: #b38362;
  background: linear-gradient(#60402e, #35221a 53%, #493025);
  box-shadow: inset 0 0 0 2px #94664640, 0 4px 10px #190b09ae;
}
#sa-map-panel canvas { border-color: #8c8f71; box-shadow: 0 0 0 2px #251b14, 0 0 7px #64b6a14d; }
#sa-objective {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 2px;
  max-width: none;
  margin: 0 0 5px;
  padding: 4px 3px;
  border: 1px solid #8c5f43;
  border-radius: 3px;
  background: var(--station-display);
  color: #f6cead;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
#sa-objective b { font-size: 17px; }
.sa-notice {
  border-color: #ba8663;
  border-radius: 5px;
  background: #39251c;
  box-shadow: 0 3px 8px #1b0d08a6;
  color: #ffe0be;
}
#sa-lesson {
  border-color: #ba8968;
  background: var(--station-enamel);
  box-shadow: inset 0 0 0 2px #160c0b, 0 6px 15px #190b08b8;
}
.sa-lesson-steps { gap: 7px; }
.sa-lesson-steps i {
  width: 17px;
  height: 7px;
  border: 1px solid #a3765a;
  border-radius: 4px;
  background: #271915;
  box-shadow: inset 0 1px #100907;
}
.sa-lesson-steps i[data-state="current"] {
  border-color: #9bd8bd;
  background: var(--station-light);
  box-shadow: 0 0 7px #8fe2c680;
}
.sa-lesson-steps i[data-state="done"] { background: #c3875e; }
.arena-power {
  border-color: color-mix(in srgb, var(--power-color) 54%, #543027);
  border-inline-start-color: var(--power-color);
  background: linear-gradient(145deg, color-mix(in srgb, var(--power-color) 18%, #32221a), #231710 85%);
  box-shadow: 0 3px 5px #160a08a6;
}
.arena-power-icon { background: #231612; }

@keyframes station-lamp {
  50% { box-shadow: 0 0 0 2px #382a20, 0 0 0 3px #a77758, 0 0 13px #7ff5d5b0; }
}
@media (prefers-reduced-motion: no-preference) {
  .ws-home:not([hidden]) .ws-setting::before { animation: station-lamp 570ms ease-in-out; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-lever i, .ws-lever i::before, .sa-mode-picker label span { transition: none; }
}
@media (max-width: 680px) and (orientation: portrait) {
  .ws-home {
    align-content: stretch;
    padding: max(29px, env(safe-area-inset-top)) max(21px, env(safe-area-inset-right))
      max(26px, env(safe-area-inset-bottom)) max(21px, env(safe-area-inset-left));
  }
  .ws-home .ws-world {
    background: var(--night-cover-portrait, var(--night-cover, none)) 61% center / cover no-repeat, #281711;
  }
  .ws-home .ws-shade {
    background: linear-gradient(180deg, #1b0e0bdd 0%, #22120ec4 16%, #21120e48 29%, transparent 43%,
      #1b100d18 53%, #1f110df0 78%, #160b09 100%);
  }
  .ws-intro { align-content: space-between; gap: clamp(105px, 20dvh, 230px); width: min(100%, 488px); margin-inline: auto; }
  .ws-setting { margin-bottom: 13px; }
  .ws-title { font-size: clamp(43px, 13.5vw, 82px); }
  .ws-title span { margin-top: 2px; }
  .ws-console::before, .ws-console::after { display: none; }
  .ws-console-bank { grid-template-columns: minmax(0, 1fr) 84px; gap: 7px; }
  #sa-profile-form { grid-template-columns: minmax(0, 1fr); }
  .sa-profile-records .sa-profile-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 350px) and (orientation: portrait) {
  .ws-home { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .ws-console { padding: 8px; }
  .ws-console-bank { grid-template-columns: minmax(0, 1fr) 66px; gap: 5px; }
  .ws-lever i::before { width: 36px; }
  .sa-mode-picker { padding-inline: 4px; gap: 3px; }
  .sa-mode-picker label span { padding-inline: 1px; }
  .ws-home .sa-home-tools .sa-control { gap: 4px; font-size: 11px; }
  #sa-pause { left: 47%; }
  .ws-result { padding: 12px max(15px, env(safe-area-inset-right)) 12px max(15px, env(safe-area-inset-left)); }
  .ws-report { padding: 14px; }
  .ws-result-main { padding-bottom: 9px; gap: 9px; }
  .ws-result-header, .sa-dialog-head { gap: 9px; }
  .ws-result-header .sa-optic { width: 38px; }
  .ws-report h1 { margin-bottom: 4px; font-size: 19px; }
  .ws-reason { font-size: 13px; }
  .ws-boundary-hint { font-size: 12px; }
  .ws-stats div, .sa-result-metrics div { padding-block: 5px; }
  .ws-stats dd { font-size: 23px; }
  .sa-result-details { gap: 8px; padding-block: 9px; }
  .ws-result-actions .ws-button { gap: 6px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ws-home { padding: max(15px, env(safe-area-inset-top)) max(25px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(26px, env(safe-area-inset-left)); }
  .ws-intro { grid-template-columns: minmax(0, 1fr); gap: 12px; width: min(100%, 428px); }
  .ws-setting { margin-bottom: 9px; padding-block: 4px; }
  .ws-title { font-size: clamp(30px, 8vh, 46px); }
  .ws-title span { display: inline; margin-inline-start: .15em; }
  .ws-console { padding: 9px; }
  .ws-console-bank { grid-template-columns: minmax(0, 1fr) 98px; }
  .ws-home .sa-home-tools { margin-top: 8px; padding-top: 6px; }
  .ws-home .sa-home-tools .sa-control { min-height: 44px; font-size: 11px; gap: 4px; }
  .sa-profile-records, .sa-upgrades { margin-bottom: 0; }
}
@media (max-width: 680px) and (orientation: portrait), (max-height: 520px) {
  #sa-profile { scroll-padding-bottom: 64px; }
  #sa-profile-form .sa-actions {
    position: sticky;
    z-index: 1;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
    border: 1px solid #ab795a;
    border-radius: 5px;
    background: linear-gradient(#4c2d23, #2e1d17);
    box-shadow: 0 -4px 12px #25130fb3;
  }
  #sa-profile-form .sa-actions .sa-control--primary { margin-inline-end: 0; }
}
@media (max-height: 430px) and (orientation: landscape) {
  .ws-result { padding-block: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-bottom)); }
  .ws-report { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; padding: 12px; }
  .ws-result-main, .sa-result-details { display: contents; }
  .ws-result-header, .ws-result-actions { grid-column: 1 / -1; }
  .ws-result-header .sa-optic { width: 39px; }
  .ws-report h1 { margin-bottom: 3px; font-size: 23px; }
  .ws-reason { font-size: 13px; }
  .ws-boundary-hint { margin-top: 3px; font-size: 12px; }
  .ws-stats div, .sa-result-metrics div { padding-block: 4px; }
  .ws-stats dt, .sa-result-metrics dt { font-size: 12px; }
  .ws-stats dd, .sa-result-metrics dd { font-size: 20px; }
  #sa-result-progress { align-self: start; padding: 5px 7px; font-size: 12px; line-height: 1.25; }
  #sa-result-progress progress { margin: 4px 0; }
  .sa-record { grid-column: 2; font-size: 12px; line-height: 1.3; }
  .ws-result-actions { padding: 6px; }
  .ws-result-actions .ws-button { min-height: 44px; padding-block: 5px 8px; font-size: 16px; }
}
@media (forced-colors: active) {
  .ws-setting::before, .ws-lever, .ws-lever i, .ws-lever i::before { border: 1px solid ButtonText; }
  .sa-mode-picker input:checked + span { border: 2px solid Highlight; }
  .sa-mode-picker input:checked + span::before, .sa-control[aria-pressed="true"]::before,
  .sa-lesson-steps i[data-state="current"] { forced-color-adjust: none; border-color: Highlight; background: Highlight; }
  .ws-nixie { border-color: ButtonText; color: ButtonText; text-shadow: none; }
}
#sa-decks { width: min(545px,94vw); max-height: 94dvh; overflow-y:auto; }
#sa-decks h2 { margin: 0 0 12px; }
.sa-deck-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.sa-deck-grid button {
  min-width: 0; padding:4px; border:1px solid #946f53; border-radius:5px; color:#f9e8d1;
  background:#2a1b16; font:600 13px/1.25 Onest,sans-serif; cursor:pointer;
}
.sa-deck-grid button[aria-pressed=true] { outline:2px solid #96dacc; outline-offset:-2px; }
.sa-deck-grid button:focus-visible { outline:3px solid #fff3bc; outline-offset:1px; }
.sa-deck-grid button>i {
  display:flex; height:clamp(38px,9vh,74px); border-radius:3px;
  overflow:hidden; background-size:cover; background-position:center; border:1px solid #7b5944;
}
.sa-deck-grid i i { flex:1; background-size:auto 180%; }
.sa-deck-grid button { touch-action:manipulation; }
.sa-deck-grid span { display:block; padding:5px 1px 3px; }
#sa-decks .sa-deck-back { margin-top:12px; min-height:44px; }

.sa-symbols { position: absolute; pointer-events: none; }
.sa-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.sa-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Mode selector and console switches. */
.sa-mode-picker .sa-mode-face { gap: 3px; padding-block: 6px; }
.sa-mode-face b { font-weight: 600; }
.sa-mode-face .sa-icon { color: #e9ba8d; }
.sa-mode-picker input:checked + .sa-mode-face .sa-icon { color: var(--station-signal); }
.sa-mode-track {
  grid-column: 1 / -1;
  position: relative;
  height: 7px;
  margin: 4px 0 0;
  border: 1px solid #88664d;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, #72533b80 0 1px, transparent 1px 33.333%), #19100c;
  box-shadow: inset 0 1px 2px #100906;
}
.sa-mode-track i {
  position: absolute;
  inset-inline-start: 16.667%;
  top: 50%;
  width: 20px;
  height: 9px;
  transform: translate(-50%, -50%);
  border: 1px solid #9cd7c1;
  border-radius: 3px;
  background: linear-gradient(#a5e4cd, #529383 55%, #275247);
  box-shadow: 0 0 5px #72caae;
  transition: inset-inline-start 160ms ease-out;
}
.sa-mode-track[data-mode="sprint"] i { inset-inline-start: 50%; }
.sa-mode-track[data-mode="salvage"] i { inset-inline-start: 83.333%; }
.ws-home .sa-home-tools .sa-control {
  min-height: 44px;
  gap: 6px;
  transition-duration: 100ms;
}
.ws-home .sa-home-tools .sa-icon { color: #e8ba93; }
.ws-home .sa-home-tools .sa-console-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  text-align: start;
}
.sa-console-toggle[aria-pressed]::before { display: none; }
.sa-toggle-text { display: grid; gap: 1px; min-width: 0; }
.sa-toggle-state { color: #eab48b; font-size: .83em; overflow-wrap: anywhere; }
.sa-console-toggle[aria-pressed="true"] .sa-toggle-state { color: #b8e2ce; }
.sa-console-toggle .sa-icon-off { stroke: #ffe3c1; stroke-width: 2.4; }
.sa-console-toggle[aria-pressed="true"] .sa-icon-off { display: none; }
.sa-console-toggle i {
  position: relative;
  width: 17px;
  height: 9px;
  border: 1px solid #9d7860;
  border-radius: 9px;
  background: #1f140f;
}
.sa-console-toggle i::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e2a782;
  transition: transform 100ms ease;
}
.sa-console-toggle[aria-pressed="true"] i::after {
  transform: translateX(8px);
  background: var(--station-signal);
  box-shadow: 0 0 3px var(--station-signal);
}

/* Rules and the short intercept demonstration. */
#sa-help, #sa-profile { scroll-padding-block: 10px 66px; }
.sa-help-intercept {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid #9b7355;
  border-radius: 5px;
  background: linear-gradient(135deg, #553126, #2d1d17);
}
#sa-help .sa-help-overview {
  margin: 0 0 7px;
  color: #fff0d6;
  font: 600 clamp(14px, 2.15vw, 24px)/1.16 var(--sa-control-face);
}
#sa-show-intercept { padding-inline: 6px; font-size: 12px; gap: 5px; }
#sa-show-intercept .sa-icon { width: 18px; height: 18px; flex-basis: 18px; }
.sa-intercept-diagram { display: block; width: 100%; max-height: 126px; }
.sa-intercept-impact { opacity: .64; }
.sa-intercept-diagram[data-demonstration] .sa-intercept-impact {
  opacity: 1;
  filter: drop-shadow(0 0 3px #ffaa6b);
}
.sa-help-parts, .sa-help-warnings { list-style: none; padding: 0; }
.sa-help-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 8px;
}
.sa-help-parts li {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 1px solid #80604b;
  border-radius: 4px;
  background: var(--station-display);
  color: #ffd0a0;
  font: 700 17px/1 var(--night-meter);
  font-variant-numeric: tabular-nums;
}
.sa-part-sprite {
  width: 37px;
  height: 37px;
  background-image: var(--sa-guide-food);
  background-size: 400% 200%;
}
.sa-part-sprite[data-part="spool"] { background-position: 0 0; }
.sa-part-sprite[data-part="cell"] { background-position: 33.333% 100%; }
.sa-part-sprite[data-part="salvage"] { background-position: 100% 100%; }
#sa-help .sa-guide-grid section {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #86694f;
  border-inline-start: 2px solid #9ac4b2;
  border-radius: 4px;
  background: linear-gradient(130deg, #423224, #251a15 77%);
}
#sa-help .sa-guide-grid :is(.sa-guide-boost, .sa-guide-modules) { border-inline-start-color: #d89d72; }
.sa-guide-grid h3 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 4px;
  color: #eef6e7;
  font: 600 14px/1.2 var(--sa-control-face);
}
.sa-guide-grid h3 .sa-icon { color: #f4c397; }
#sa-help .sa-guide-grid p { margin: 0; font-size: 13px; line-height: 1.3; }
#sa-help .sa-guide-grid .sa-help-cost { margin-top: 3px; color: #ffd3a8; font-variant-numeric: tabular-nums; }
.sa-guide-touch { display: none; }
.sa-guide-module-options {
  display: grid;
  grid-template-columns: repeat(4, 44px);
  gap: 4px;
}
.sa-guide-module-options button { min-width: 44px; padding: 4px; }
.sa-guide-module-options button::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  background-image: var(--sa-guide-module);
  background-size: 400% 100%;
}
.sa-guide-module-options [data-module-guide="zoom"]::before { background-position: 33.333% 0; }
.sa-guide-module-options [data-module-guide="speed"]::before { background-position: 66.667% 0; }
.sa-guide-module-options [data-module-guide="multiplier"]::before { background-position: 100% 0; }
.sa-guide-module-options [aria-expanded="true"] {
  border-color: #9cdec7;
  outline: 1px solid #9cdec7;
  outline-offset: -4px;
  background: #293a30;
}
#sa-help #sa-module-action { min-height: 1.3em; margin-top: 4px; color: #c3eada; }
.sa-help-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 8px 0;
  padding: 7px 8px;
  border: 1px solid #936648;
  border-radius: 4px;
  background: #2b1912;
  color: #ffdebc;
  font-size: 13px;
}
.sa-help-warnings li::before { content: "⚠"; margin-inline-end: 5px; color: #f4bc86; }
#sa-help .sa-help-actions { gap: 6px; margin: 0; }
#sa-help .sa-help-actions .sa-control { min-width: 88px; }

/* Profile readouts, upgrades and records. */
.sa-profile-alias {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 3px 6px;
  margin-bottom: 11px;
}
.sa-profile-alias .sa-profile-name { grid-column: 1 / -1; margin: 0; }
#sa-name-length { color: #ffd7aa; font: 700 12px/1.2 var(--night-meter); font-variant-numeric: tabular-nums; }
#sa-profile-progress .sa-progress-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0 4px;
}
.sa-xp-info { grid-area: 1 / 2 / span 2; width: 44px; min-width: 44px; padding: 0; }
#sa-profile .sa-progress-rules { margin: 6px 0 0; padding: 7px 8px; border-inline-start: 2px solid #c69e7b; }
#sa-profile .sa-upgrade {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 2px 7px;
}
.sa-upgrade > .sa-icon { color: #f5bd91; }
.sa-upgrade .sa-control { grid-column: 3; grid-row: 1 / 3; gap: 4px; min-width: 49px; }
.sa-upgrade .sa-control .sa-icon { width: 17px; height: 17px; flex-basis: 17px; }
.sa-upgrade .sa-upgrade-maxed .sa-icon { display: none; }
#sa-profile .sa-upgrade p { grid-column: 2; margin: 0; color: #f7caa2; font-variant-numeric: tabular-nums; }
.sa-upgrade-meter { display: flex; align-items: center; gap: 6px; }
.sa-upgrade-meter > span { display: flex; gap: 3px; }
.sa-upgrade-meter i {
  display: block;
  width: 11px;
  height: 5px;
  border: 1px solid #987157;
  border-radius: 1px;
  background: #291913;
  transition: background-color 300ms, box-shadow 300ms;
}
.sa-upgrade-meter i[data-filled] {
  border-color: #f5b27a;
  background-color: var(--station-nixie);
  box-shadow: 0 0 4px #e67d46;
}
.sa-profile-metrics dt { display: flex; align-items: center; gap: 4px; }
.sa-profile-metrics dt .sa-icon { width: 19px; height: 19px; flex-basis: 19px; color: #e7b38d; }
.sa-profile-records .sa-profile-metrics div:nth-child(n) dd {
  margin: 1px 0 0;
  font: 700 clamp(17px, 4vw, 24px)/1.2 var(--night-meter);
  font-variant-numeric: tabular-nums;
}

@media (pointer: coarse) {
  .sa-guide-touch { display: block; }
  .sa-guide-desktop { display: none; }
}
@media (max-width: 680px) {
  #sa-profile-form { grid-template-columns: minmax(0, 1fr); }
  .sa-profile-records .sa-profile-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #sa-help .sa-guide-modules { grid-column: 1 / -1; }
  .sa-guide-module-options { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
  .sa-help-warnings { flex-direction: column; }
}
@media (max-width: 385px) {
  .ws-home .sa-home-tools .sa-console-toggle { grid-template-columns: auto minmax(0, 1fr); }
  .sa-console-toggle i { display: none; }
}
@media (max-width: 680px) and (orientation: portrait) {
  .ws-intro { gap: clamp(65px, 14dvh, 150px); }
  #sa-help, #sa-profile { padding: 13px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ws-home .sa-home-tools { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ws-home .sa-home-tools .sa-console-toggle { grid-template-columns: auto minmax(0, 1fr); }
  .sa-console-toggle i { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  #sa-profile[open], #sa-help[open] { animation-duration: 170ms; }
}
@media (prefers-reduced-motion: reduce) {
  .sa-mode-track i, .sa-console-toggle i::after, .sa-upgrade-meter i,
  .ws-home .sa-home-tools .sa-control { transition: none; }
}
@media (forced-colors: active) {
  .sa-mode-track i, .sa-console-toggle i::after, .sa-upgrade-meter i[data-filled] { background: Highlight; forced-color-adjust: none; }
}

/* Shared controls on the live field and on the pause panel. */
#sa-pause .sa-icon, #sa-paused .sa-optic .sa-icon {
  z-index: 1;
  color: #fff0d2;
  filter: drop-shadow(0 0 3px #ffa15d88);
}
html #boost .sa-icon {
  width: clamp(24px, 4vw, 39px);
  height: auto;
  stroke-width: 1;
  fill: currentColor;
  color: #ffd7a1;
  filter: drop-shadow(0 0 4px #ffb2639c);
}
html #boost[data-active="true"] .sa-icon { color: var(--station-signal); }
#sa-paused :is(#sa-resume, #sa-pause-menu) {
  grid-column: auto;
  min-width: 0;
  gap: 5px;
}
#sa-paused .sa-pause-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(65px, .8fr);
  gap: 6px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #aa795866;
}
.sa-pause-settings .sa-control {
  min-width: 0;
  width: 100%;
  gap: 4px;
  padding-inline: 4px;
  font-size: 11px;
}
.sa-pause-settings .sa-console-toggle { justify-content: start; text-align: start; }
.sa-pause-settings .sa-icon { color: #e8ba93; }
@media (max-width: 480px) {
  html .board { width: clamp(124px, calc(50vw - 38px), 156px); }
}

/* Only the next practice cue is shown. The field already marks the ring and pickup. */
#sa-lesson .sa-lesson-prompt {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 34px;
}
#sa-lesson .sa-lesson-prompt p { grid-column: 2; }
.sa-lesson-prompt > .sa-icon { color: var(--station-signal); }
.sa-lesson-prompt .sa-part-sprite { display: none; width: 27px; height: 27px; }
html[data-lesson="pickup"] .sa-lesson-prompt .sa-icon { display: none; }
html[data-lesson="pickup"] .sa-lesson-prompt .sa-part-sprite { display: block; }
#sa-lesson button { gap: 5px; }
#sa-lesson button .sa-icon { width: 18px; height: 18px; flex-basis: 18px; }
html[data-lesson="boost"] #boost {
  outline: 3px solid var(--station-signal);
  outline-offset: 4px;
  opacity: 1;
}
@keyframes sa-boost-lesson {
  from { outline-offset: 9px; }
  to { outline-offset: 4px; }
}

/* Race results expose the final XP value immediately while the fill catches up. */
.ws-result-mode, .ws-stats dt, .sa-result-metrics dt, .sa-record-badge {
  display: flex;
  align-items: center;
  gap: 5px;
}
.ws-result-mode .sa-icon, .ws-stats dt .sa-icon, .sa-result-metrics dt .sa-icon, .sa-record-badge .sa-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  color: #f5bf94;
}
.sa-record-badge { width: 100%; }
.sa-record-lamp {
  width: 9px;
  height: 9px;
  border: 1px solid #ac7f62;
  border-radius: 50%;
  background: #322018;
}
.sa-record-lamp[data-lit] {
  background: var(--station-light);
  box-shadow: 0 0 6px #79cfb0bf;
}
.sa-result-meter {
  position: relative;
  height: 10px;
  margin: 6px 0 4px;
}
#sa-result-progress .sa-result-meter progress {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
}
.sa-result-meter::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #a6795e;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, #9d735348 0 1px, transparent 1px 9px), #241610;
}
.sa-result-meter i {
  position: absolute;
  inset: 1px;
  border-radius: 1px;
  background: repeating-linear-gradient(90deg, #57291777 0 1px, transparent 1px 9px), linear-gradient(#fac297, #b8673f);
  transform: scaleX(0);
  transform-origin: left;
}
.ws-result-actions :is(.ws-button, .sa-control) { gap: 6px; }
.ws-result-actions .sa-icon { width: 20px; height: 20px; flex-basis: 20px; }

@media (max-height: 430px) and (orientation: landscape) {
  .sa-result-meter { margin-block: 4px; }
  .sa-record-badge { width: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  #sa-paused[open], .ws-result:not([hidden]) .ws-report { animation-duration: 170ms; }
  html[data-lesson="boost"] #boost { animation: sa-boost-lesson 170ms ease-out; }
}
@media (forced-colors: active) {
  #sa-result-progress .sa-result-meter progress { opacity: 1; }
  .sa-result-meter :is(i), .sa-result-meter::before { display: none; }
  .sa-record-lamp[data-lit] { background: Highlight; forced-color-adjust: none; }
}

/* The day of the station (plan stage G): the tasks chip above Play, the big start key under it, the tasks window. The same
   station hardware as the profile's rows; a lamp lights on the chip when something can be taken. Sizes - readable.css. */
.ws-home .ws-keywell { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ws-home .ws-keywell > :is(.ws-launch, .sa-start-big-note) { grid-column: 1 / -1; }
.ws-home .ws-keywell:has(.sa-start-big[hidden]) .sa-tasks-chip { grid-column: 1 / -1; }
.sa-tasks-chip, .sa-start-big { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-width: 0; }
/* a word is never cut (Japanese and Korean break only at a space - the lesson of stage E) */
.sa-tasks-chip span, .sa-start-big span, .sa-gift-week small, .sa-task-claim span { min-width: 0; word-break: keep-all; overflow-wrap: normal; }
.sa-tasks-chip { border-color: #8c644d; background: linear-gradient(135deg, #472d24, #2d1b15); color: #ffe4bc; }
.sa-tasks-chip::after {
  content: "";
  flex: 0 0 9px;
  height: 9px;
  border: 1px solid #6e4e3f;
  border-radius: 50%;
  background: #211510;
}
.sa-tasks-chip[data-ready] { border-color: var(--station-signal); }
.sa-tasks-chip[data-ready]::after { border-color: #76b9a9; background: var(--station-light); box-shadow: 0 0 8px #91eec4c0; }
.sa-start-big { border-color: #a2ad90; background: linear-gradient(#4a4535, #30271e 58%, #271a15); color: #e5f7e7; }
.sa-start-big[data-kind="video"] { border-color: #a17556; background: var(--station-switch); color: var(--station-ink); }
.sa-start-big-note { margin: 0; color: #dfc8b4; text-align: center; }

#sa-tasks .sa-optic { --sa-lens-color: #91eec4; --sa-lens-core: #2b554c; }
.sa-tasks-note { padding: 7px 9px; border: 1px solid #a17556; border-radius: 4px; background: #241610; color: #ffd394; }
.sa-task-list { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.sa-task-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 10px;
  padding: 7px 8px;
  border: 1px solid #8c644d;
  border-inline-start: 3px solid #ba845c;
  border-radius: 4px;
  background: linear-gradient(135deg, #472d24, #2d1b15);
}
.sa-task-list li[data-state="ready"] { border-inline-start-color: var(--station-signal); }
.sa-task-list li[data-state="claimed"] { opacity: .78; border-inline-start-color: #76b9a9; }
.sa-task-text { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.sa-task-text b { color: #fee4c5; }
.sa-task-count { color: #ffbd8b; font-variant-numeric: tabular-nums; }
.sa-task-list progress {
  grid-column: 1;
  width: 100%;
  height: 9px;
  border: 1px solid #a6795e;
  border-radius: 2px;
  background: #241610;
  accent-color: #ec9864;
  appearance: none;
}
.sa-task-list progress::-webkit-progress-bar { background: #241610; }
.sa-task-list progress::-webkit-progress-value { background: linear-gradient(#fac297, #b8673f); }
.sa-task-list progress::-moz-progress-bar { background: linear-gradient(#fac297, #b8673f); }
.sa-task-claim { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 5px; padding-inline: 10px; }
.sa-task-claim:enabled, #sa-chest-open:enabled, #sa-gift-take:enabled {
  border-color: #f1bf94;
  background: linear-gradient(#f6c8a0, #d69669 60%, #c4865a);
  color: #281611;
}
.sa-chest, .sa-gift { margin: 0 0 12px; padding: 8px 9px; border: 1px solid #9a6a50; border-radius: 4px;
  background: radial-gradient(ellipse at 41% 100%, #523022, #251711 78%); }
.sa-chest h3, .sa-gift h3 { margin: 0 0 4px; color: #fee4c5; }
.sa-dialog .sa-chest-rule, .sa-dialog .sa-gift-rule { margin: 0 0 8px; }
#sa-chest-open, #sa-gift-take { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.sa-gift-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 4px 0 8px; padding: 0; list-style: none; }
.sa-gift-week li {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 4px 1px;
  border: 1px solid #6e4e3f;
  border-radius: 4px;
  background: #211510;
  color: #dfc8b4;
  text-align: center;
}
.sa-gift-week li b { color: #ffbd8b; font-variant-numeric: tabular-nums; }
.sa-gift-week li[data-state="taken"] { border-color: #76b9a9; background: #1d2a24; }
.sa-gift-week li[data-state="taken"] b { color: #a0eddb; }
.sa-gift-week li[data-today] { border-color: var(--station-signal); box-shadow: 0 0 0 2px #91eec466; }
.sa-tasks-wallet { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: #ffbd8b; }
.sa-result-tasks { display: flex; align-items: center; gap: 6px; margin: 0; color: #dfc8b4; }

/* Stage Zh (owner 25.11.2026: "less text, more icons and colours you can tell apart - now everything melts into brown"): the
   colours of meaning stay with their thing everywhere - credits gold, experience blue, records bronze, tasks green, every
   module the colour of its face. The cue "press this now" is not a colour: a light ring, the same on any ground.
   The brass icons keep their metal (gate icons); the colour is the plate and the lamps around them. Sizes - readable.css. */
:root {
  --mean-credit: #f5c84c;
  --mean-xp: #86bcff;
  --mean-record: #e7a066;
  --mean-task: #8fe07a;
  --mean-magnet: #ff6f61;
  --mean-zoom: #52d6ec;
  --mean-speed: #ffb648;
  --mean-multiplier: #bf93ff;
  --cue-ring: #f2fff9;
}
.sa-cue, #sa-result-modules[data-ready], .sa-tasks-chip[data-ready] {
  position: relative;
  outline: 2px solid var(--cue-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #f2fff933, 0 0 16px #c9fff0aa;
}
@media (prefers-reduced-motion: no-preference) {
  .sa-cue, #sa-result-modules[data-ready], .sa-tasks-chip[data-ready] { animation: sa-cue 1.4s ease-in-out infinite; }
}
@keyframes sa-cue { 50% { box-shadow: 0 0 0 9px #f2fff911, 0 0 22px #c9fff0dd; } }

/* the tabs of the profile */
#sa-profile { width: min(560px, calc(100% - 30px)); }
#sa-profile-form { grid-template-columns: minmax(0, 1fr); }
#sa-profile-form > [data-panel], #sa-profile-form > .sa-profile-tabs { grid-column: 1 / -1; }
.sa-profile-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sa-profile-tabs [role="tab"] {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 4px 6px;
  border: 1px solid #8c644d; border-radius: 4px; background: linear-gradient(#3a261f, #24160f); color: #e9cbb0;
  font: inherit; font-weight: 700; cursor: pointer; word-break: keep-all;
}
.sa-profile-tabs [role="tab"][aria-selected="true"] { border-color: #f1c49a; background: linear-gradient(#6a4330, #3b2519); color: #fff1dc;
  box-shadow: inset 0 -3px var(--tab-mean, #f1c49a); }
#sa-tab-pilot { --tab-mean: var(--mean-xp); }
#sa-tab-upgrades { --tab-mean: var(--mean-credit); }
#sa-tab-records { --tab-mean: var(--mean-record); }
.sa-profile-tabs [role="tab"] { position: relative; }
.sa-tab-count { position: absolute; inset-block-start: -9px; inset-inline-end: -5px; min-width: 22px; padding: 1px 6px; border-radius: 11px;
  background: var(--mean-credit); color: #2a1a0c; box-shadow: 0 0 0 2px #24160f; font-variant-numeric: tabular-nums; line-height: 20px; }
.sa-tab-count[hidden] { display: none; }
.sa-profile-panel { display: grid; gap: 10px; }
.sa-profile-panel[hidden], #sa-profile-form > [data-panel][hidden] { display: none; }

/* colours of meaning in the profile */
#sa-credit-balance { color: var(--mean-credit); }
#sa-upgrade-points { color: var(--mean-xp); }
#sa-profile-progress .sa-progress-header span, #sa-profile-progress .sa-progress-header strong { color: var(--mean-xp); }
#sa-profile-progress progress { accent-color: var(--mean-xp); }
#sa-profile-progress progress::-webkit-progress-value { background: linear-gradient(#bcd9ff, #4f86d6); }
#sa-profile-progress progress::-moz-progress-bar { background: linear-gradient(#bcd9ff, #4f86d6); }
.sa-profile-records .sa-profile-metrics div:nth-child(n) dd { color: var(--mean-record); }
.sa-upgrade-header { display: flex; align-items: center; gap: 8px; }
.sa-upgrade-header output { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; white-space: nowrap; }
.sa-upgrade-header output .sa-icon { width: 24px; height: 24px; }
#sa-credit-balance { color: var(--mean-credit); }
#sa-upgrade-points { color: var(--mean-xp); }
.sa-upgrade-header h3 { margin-inline-end: auto; }
.sa-rule-info { width: 40px; min-width: 40px; min-height: 40px; padding: 0; }
.sa-module { --mean: var(--mean-credit); }
.sa-module[data-module="magnet"] { --mean: var(--mean-magnet); }
.sa-module[data-module="zoom"] { --mean: var(--mean-zoom); }
.sa-module[data-module="speed"] { --mean: var(--mean-speed); }
.sa-module[data-module="multiplier"] { --mean: var(--mean-multiplier); }
#sa-profile .sa-module { border-inline-start: 4px solid var(--mean); }
.sa-module .sa-module-face { border-radius: 50%; box-shadow: 0 0 0 2px var(--mean), 0 0 10px var(--mean); }
.sa-module h4 { color: var(--mean); }
.sa-module .sa-upgrade-meter i[data-filled] { border-color: var(--mean); background: var(--mean); box-shadow: 0 0 4px var(--mean); }
#sa-upgrade-list .sa-upgrade { border-inline-start: 4px solid var(--mean-xp); }
#sa-upgrade-list .sa-upgrade-meter i[data-filled] { border-color: var(--mean-xp); background: var(--mean-xp); box-shadow: 0 0 4px var(--mean-xp); }
#sa-profile .sa-module p { display: flex; flex-wrap: wrap; gap: 2px 12px; white-space: normal; }
.sa-fx { display: inline-flex; align-items: center; gap: 4px; }
.sa-fx .sa-icon { width: 16px; height: 16px; flex: 0 0 16px; }
/* the price: bright when there is enough, dim with a lock when there is not */
.sa-upgrade .sa-control > .sa-icon:last-child { display: none; }
.sa-upgrade .sa-control[aria-disabled="true"]:not(.sa-upgrade-maxed) > .sa-icon:last-child { display: block; }
.sa-upgrade .sa-control[aria-disabled="true"]:not(.sa-upgrade-maxed) > .sa-icon:first-child { display: none; }
.sa-upgrade .sa-control[aria-disabled="true"] { opacity: .72; color: #cdb39d; background: #261812; }
.sa-modules .sa-control[aria-disabled="false"] { border-color: #ffe08a; background: linear-gradient(#ffe7a0, #e2a92e 62%, #b9801c); color: #2a1a0c; }
#sa-upgrade-list .sa-control[aria-disabled="false"] { border-color: #cfe3ff; background: linear-gradient(#d8e8ff, #7eaef0 62%, #4f7fc4); color: #10203a; }

/* the result: the door to the upgrades - big, with its number or the way to the first module */
.sa-result-credits p .sa-icon { color: var(--mean-credit); }
#sa-result-credit-line { color: var(--mean-credit); }
#sa-result-modules { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 8px; min-height: 52px;
  padding: 6px 14px; text-align: start; white-space: normal; }
#sa-result-modules[data-ready] { border-color: #ffe08a; background: linear-gradient(#ffe7a0, #e2a92e 62%, #b9801c); color: #2a1a0c; }
.sa-save-bar { grid-column: 2; display: block; width: 100%; height: 6px; overflow: hidden; border: 1px solid #a6795e; border-radius: 3px; background: #241610; }
.sa-save-bar b { display: block; width: calc(var(--fill, 0) * 100%); height: 100%; background: linear-gradient(#ffe7a0, #e2a92e); }
.sa-save-bar[hidden] { display: none; }
.ws-result[data-lead-upgrades] .sa-result-credits { flex-direction: column; align-items: stretch; }
.ws-result[data-lead-upgrades] #sa-result-modules { width: 100%; min-height: 58px; }
.ws-result[data-lead-upgrades] .ws-result-actions .ws-button { filter: saturate(.55) brightness(.82); }

/* tasks: a green of their own; the lamp is bigger and lights when there is something to take */
.sa-tasks-chip { border-color: #5f9a52; background: linear-gradient(135deg, #24361f, #172413); color: #e6ffd9; }
.sa-tasks-chip::after { flex-basis: 12px; height: 12px; }
.sa-tasks-chip[data-ready]::after { border-color: #c9f3b8; background: radial-gradient(circle at 36% 30%, #f2ffe9, #8fe07a 40%, #2f6a24); box-shadow: 0 0 10px #8fe07a; }
#sa-tasks .sa-task-count { color: var(--task-mean, var(--mean-task)); }
#sa-tasks .sa-task-list progress::-webkit-progress-value { background: var(--task-mean, linear-gradient(#d4f8c5, #5fae4d)); }
#sa-tasks .sa-task-list progress::-moz-progress-bar { background: var(--task-mean, linear-gradient(#d4f8c5, #5fae4d)); }
#sa-tasks-credits { color: var(--mean-credit); }

/* the card of a mode */
.sa-mode-picker { position: relative; }
.sa-mode-info { position: absolute; inset-block-start: -8px; inset-inline-end: 6px; width: 40px; min-width: 40px; min-height: 40px; padding: 0; }
.sa-mode-info[hidden] { display: none; }
#sa-mode-card { width: min(460px, calc(100% - 30px)); }
#sa-mode-card[data-mode="sprint"] { --mean: var(--mean-speed); }
#sa-mode-card[data-mode="salvage"] { --mean: var(--mean-record); }
.sa-mode-scheme { margin: 0 0 12px; padding: 8px; border: 1px solid #8c644d; border-radius: 4px; background: radial-gradient(ellipse at 50% 100%, #3b2a22, #1a110d 80%); }
.sa-mode-scheme svg { display: block; width: 100%; height: auto; }
.sa-mode-scheme .sa-scheme-dial { fill: #241610; stroke: var(--mean); stroke-width: 4; }
.sa-mode-scheme .sa-scheme-hand { stroke: #fff1dc; stroke-width: 4; stroke-linecap: round; transform-origin: 196px 48px; }
.sa-mode-scheme .sa-scheme-snake { fill: none; stroke: #6fe0b8; stroke-width: 9; stroke-linecap: round; }
.sa-mode-scheme .sa-scheme-head { fill: #b9ffe6; }
.sa-mode-scheme .sa-scheme-points text { fill: var(--mean-credit); font: 800 15px Onest, system-ui, sans-serif; }
.sa-mode-scheme .sa-scheme-wreck { fill: none; stroke: #ff8a7a; stroke-width: 7; stroke-linecap: round; opacity: .8; }
.sa-mode-scheme .sa-scheme-loot circle { fill: var(--mean-record); stroke: #fff1dc; stroke-width: 2; }
.sa-mode-scheme .sa-scheme-slots rect { fill: #241610; stroke: var(--mean-record); stroke-width: 2; }
@media (prefers-reduced-motion: no-preference) {
  .sa-mode-scheme .sa-scheme-hand { animation: sa-hand 3s linear infinite; }
  .sa-mode-scheme .sa-scheme-points text { animation: sa-pop 1.5s ease-out infinite; }
  .sa-mode-scheme .sa-scheme-points text:nth-child(2) { animation-delay: .5s; }
  .sa-mode-scheme .sa-scheme-points text:nth-child(3) { animation-delay: 1s; }
  .sa-mode-scheme .sa-scheme-loot circle { animation: sa-pull 2.4s ease-in infinite; }
  .sa-mode-scheme .sa-scheme-slots rect { animation: sa-slot 2.4s steps(1) infinite; }
  .sa-mode-scheme .sa-scheme-slots rect:nth-child(n+3) { animation-delay: .8s; }
}
@keyframes sa-hand { to { transform: rotate(360deg); } }
@keyframes sa-pop { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes sa-pull { 70%, 100% { transform: translate(70px, -12px); opacity: 0; } }
@keyframes sa-slot { 50% { fill: var(--mean-record); } }
.sa-mode-facts { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.sa-mode-facts li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #8c644d; border-inline-start: 4px solid var(--mean);
  border-radius: 4px; background: linear-gradient(135deg, #3a251d, #24160f); color: #fff1dc; font-weight: 700; }
.sa-mode-facts .sa-icon { width: 26px; height: 26px; flex: 0 0 26px; }

/* the cue on the field (plan stage Zh2): one at a time, a sign and a few words, the cross takes it off for good */
.sa-coach {
  position: fixed; z-index: 30; inset-inline: 0; inset-block-end: max(230px, 30vh); width: max-content; max-width: calc(100% - 32px);
  margin-inline: auto; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 14px;
  border: 2px solid var(--cue-ring); border-radius: 10px; background: #1d120ee8; color: #fff6ea;
  box-shadow: 0 0 0 5px #f2fff922, 0 6px 22px #000a; font: 800 clamp(18px, 4.6vw, 24px)/1.2 Onest, system-ui, sans-serif;
}
.sa-coach[hidden] { display: none; }
.sa-coach-sign { display: block; width: 44px; height: 44px; flex: 0 0 44px; }
.sa-coach-sign .sa-icon { width: 44px; height: 44px; }
@media (prefers-reduced-motion: no-preference) {
  .sa-coach[data-step="steer"] .sa-coach-sign { animation: sa-drag 1.6s ease-in-out infinite; }
}
@keyframes sa-drag { 0%, 100% { transform: translate(-10px, 4px) rotate(-8deg); } 50% { transform: translate(12px, -6px) rotate(6deg); } }
/* the profile window (stage Zh7, owner 25.11.2026): one frame on every tab - the screen sets its height, the head, the tabs and
   the key stand, only the tab's area scrolls; the computer shows the upgrades in two columns, the phone says "more below" */
#sa-profile { width: min(900px, calc(100% - 30px)); }
#sa-profile[open] { display: flex; flex-direction: column; height: min(790px, calc(100dvh - 14px)); max-height: none; overflow: hidden; }
#sa-profile[open] > #sa-profile-form { display: flex; flex-direction: column; align-items: stretch; flex: 1 1 auto; min-height: 0; gap: 10px; }
#sa-profile-form > .sa-dialog-head, #sa-profile-form > .sa-profile-tabs, #sa-profile-form > .sa-actions { flex: none; }
#sa-profile-form > [data-panel] { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; }
#sa-profile-form > [data-panel] > * { flex: none; }
#sa-profile-form > .sa-profile-identity { display: grid; gap: 10px; align-content: start; }
#sa-profile-form > .sa-profile-records { align-self: stretch; }
#sa-profile-form .sa-actions { position: static; display: flex; justify-content: center; margin: 0; }
#sa-profile-form .sa-actions .sa-control { min-width: min(260px, 100%); justify-content: center; }
#sa-panel-upgrades { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "mods ups" "mods cue"; align-items: start; }
#sa-panel-upgrades > .sa-modules { grid-area: mods; }
#sa-panel-upgrades > .sa-upgrades:not(.sa-modules) { grid-area: ups; }
#sa-panel-upgrades > .sa-profile-cue { grid-area: cue; margin: 0; }
/* the computer's columns are wide enough for a module's effects on one line */
#sa-profile .sa-module p { grid-column: 2 / 4; flex-wrap: wrap; gap: 2px 10px; }
#sa-profile .sa-fx, #sa-profile .sa-fx > span { white-space: nowrap; }
#sa-profile-form .sa-actions .sa-control--primary { margin-inline: auto; }
.sa-profile-metrics dt span { overflow-wrap: normal; hyphens: auto; }
.sa-profile-more { position: relative; z-index: 2; flex: none; height: 34px; margin: -44px 1px 0; display: flex; align-items: center;
  justify-content: center; gap: 6px; border-radius: 0 0 4px 4px; background: linear-gradient(#1b100c00, #1b100ce6 55%);
  color: #fff1dc; font: 800 16px/1 var(--night-meter, inherit); cursor: pointer; transition: opacity 160ms; }
.sa-profile-more[data-off] { opacity: 0; pointer-events: none; }
.sa-profile-more i { width: 12px; height: 12px; margin-top: -6px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor;
  transform: rotate(45deg); }
@media (prefers-reduced-motion: no-preference) {
  .sa-profile-more:not([data-off]) i { animation: sa-more 900ms ease-in-out 2; }
}
@keyframes sa-more { 50% { transform: translateY(5px) rotate(45deg); } }
@media (max-width: 680px) {
  #sa-profile { width: calc(100% - 20px); }
  #sa-profile[open] { height: calc(100dvh - 28px); }
  #sa-panel-upgrades { grid-template-columns: minmax(0, 1fr); grid-template-areas: "cue" "mods" "ups"; }
}
/* the tasks window in signs and numbers (stage Zh7c, owner 25.11.2026: "много текста, мало иконок - сделать наоборот") */
.sa-task-list li { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; }
.sa-task-sign { grid-column: 1; grid-row: 1 / span 2; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; font: inherit;
  background: radial-gradient(#3b241b, #1f130e); box-shadow: 0 0 0 2px var(--task-mean, var(--mean-task)); color: var(--task-mean, var(--mean-task)); }
.sa-task-sign .sa-icon { width: 28px; height: 28px; }
.sa-task-list li[data-task="chips"] { --task-mean: var(--mean-credit); }
.sa-task-list li[data-task="kos"] { --task-mean: #ff8a6b; }
.sa-task-list li[data-task="modes"] { --task-mean: var(--mean-xp); }
.sa-task-list li[data-task="mass"] { --task-mean: var(--mean-task); }
.sa-task-list li[data-task="parts"] { --task-mean: #c9a4ff; }
.sa-task-list li[data-task="top3"] { --task-mean: var(--mean-record); }
.sa-task-list .sa-task-text { grid-column: 2; }
.sa-task-list progress { grid-column: 2; }
.sa-task-list .sa-task-claim { grid-column: 3; }
.sa-task-sign[aria-expanded="true"] { outline: 2px solid var(--cue-ring); outline-offset: 2px; }
.sa-task-full { grid-column: 1 / -1; color: #f3dcc8; font-size: 16px; line-height: 1.3; }
.sa-task-full[hidden] { display: none; }
.sa-task-text b { font-size: 18px; }
.sa-task-list .sa-task-count { font: 800 16px/1.2 var(--night-meter, inherit); font-variant-numeric: tabular-nums; }
.sa-tasks-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sa-tasks-head > .sa-icon { width: 26px; height: 26px; flex: 0 0 26px; color: var(--mean-credit); }
.sa-tasks-head h3 { flex: 1; margin: 0; }
.sa-chest-line { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px 0 10px; }
.sa-chest-lamps { display: flex; gap: 6px; }
.sa-chest-lamps i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--mean-task); background: #1f130e; }
.sa-chest-lamps i[data-on] { background: var(--mean-task); box-shadow: 0 0 8px var(--mean-task); }
.sa-chest-arrow { width: 22px; height: 3px; background: #e7b38d; position: relative; }
.sa-chest-arrow::after { content: ""; position: absolute; inset-inline-end: -2px; top: -5px; width: 9px; height: 9px;
  border-top: 3px solid #e7b38d; border-right: 3px solid #e7b38d; transform: rotate(45deg); }
.sa-chest-gain { display: inline-flex; align-items: center; gap: 4px; color: var(--mean-credit); font: 800 20px/1 var(--night-meter, inherit); }
.sa-chest-gain .sa-icon { width: 26px; height: 26px; }
.sa-chest-charge { color: #ffbd8b; }
.sa-gift-week small { font-weight: 800; }
.sa-tasks-wallet > span { display: inline-flex; align-items: center; gap: 6px; font: 800 18px/1 var(--night-meter, inherit); }
.sa-tasks-wallet > span .sa-icon { width: 24px; height: 24px; }
#sa-tasks-charges { color: #ffbd8b; }
/* the gift's "i" is a target too (theme 11 web p. 13): 48 px on the phone, 52 px on the computer */
#sa-tasks .sa-rule-info { width: 48px; min-width: 48px; min-height: 48px; }
/* the computer: two columns - tasks on the left, chest and gift on the right - so the whole day fits above the key */
@media (min-width: 900px) {
  #sa-tasks .sa-rule-info, #sa-tasks .sa-task-sign { width: 52px; min-width: 52px; min-height: 52px; height: 52px; }
  #sa-tasks[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; align-content: start;
    width: min(920px, calc(100vw - 48px)); max-width: none; }
  #sa-tasks > .sa-dialog-head, #sa-tasks > .sa-tasks-note, #sa-tasks > .sa-tasks-wallet, #sa-tasks > .sa-actions { grid-column: 1 / -1; }
  #sa-tasks > .sa-task-list { grid-column: 1; grid-row: 3 / span 2; align-content: start; }
  #sa-tasks > .sa-chest { grid-column: 2; grid-row: 3; }
  #sa-tasks > .sa-gift { grid-column: 2; grid-row: 4; }
  #sa-tasks > .sa-tasks-wallet { grid-row: 5; }
  #sa-tasks > .sa-actions { grid-row: 6; }
}
/* touch targets and text of theme 11 web p. 13 (screen-density): 48 px on the phone, 52 px and 18 px text on the computer */
.sa-profile-tabs [role="tab"] { font-size: 18px; }
@media (max-width: 680px) {
  /* three tabs share 390 px: the sign over the word, so a 10-letter word (uk, pl, tr) fits whole */
  .sa-profile-tabs [role="tab"] { flex-direction: column; gap: 2px; min-height: 56px; padding: 4px 2px; font-size: inherit; }
  .sa-profile-tabs [role="tab"] > span:not(.sa-tab-count) { max-width: 100%; white-space: nowrap; }
}

/* the cue of the first entries into Upgrades (plan stage Zh3): a sign and a few words over the list, the light ring on its target */
.sa-profile-cue { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 12px; border: 2px solid var(--cue-ring);
  border-radius: 8px; background: #1d120ee8; color: #fff6ea; font: 800 17px/1.25 Onest, system-ui, sans-serif; }
.sa-profile-cue[hidden] { display: none; }
.sa-profile-cue > .sa-icon { width: 30px; height: 30px; flex: 0 0 30px; }
.sa-profile-cue > span { flex: 1; }

/* the way to the tasks (plan stage Zh4): the result's tasks key, the toast of a task closed in the run */
.sa-result-tasks { width: 100%; justify-content: flex-start; min-height: 44px; padding: 6px 10px; text-align: start;
  border-color: color-mix(in srgb, var(--mean-task) 45%, #6b4a38); }
.sa-result-tasks .sa-icon { color: var(--mean-task); }
.sa-result-tasks[data-ready] { border-color: var(--mean-task); background: linear-gradient(#2f5a25, #1d3a17); color: #f1ffe9;
  outline: 2px solid var(--cue-ring); outline-offset: 2px; }
.sa-task-toast { position: fixed; z-index: 30; inset-inline: 0; inset-block-start: max(150px, 20vh); width: max-content; max-width: calc(100% - 32px);
  margin-inline: auto; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid var(--mean-task);
  border-radius: 10px; background: #1d3a17ee; color: #f1ffe9; font: 800 clamp(17px, 4.4vw, 22px)/1.2 Onest, system-ui, sans-serif;
  pointer-events: none; }
.sa-task-toast[hidden] { display: none; }
.sa-task-toast .sa-icon { width: 28px; height: 28px; color: var(--mean-task); }

/* the goal of a mode at the start of its run (plan stage Zh5): the cue's light, not the task's green */
.sa-mode-banner { border-color: var(--cue-ring); background: #1d120ee8; color: #fff6ea; inset-block-start: max(110px, 15vh); }
.sa-mode-banner .sa-icon { color: #ffd2a6; }
/* the modes in the Rules (plan stage Zh5): a sign, the name, the card's lines */
.sa-guide-mode { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; margin: 0 0 6px; }
.sa-guide-mode .sa-icon { grid-row: span 3; width: 28px; height: 28px; }
.sa-guide-mode span { grid-column: 2; }
