/* MT5 TradeManager — an annunciator panel for a trading account.
 *
 * Ground is blue-ink, descended from the PowerShell console the operator
 * actually types in. Lamps carry the system's own state vocabulary: steel for
 * DRY_RUN and anything held, amber for live execution armed, jade for SUCCESS
 * and PASS, brick for FAILED and blocked, dim for SKIPPED. Lit means attention,
 * which is why arming the interlock makes the page louder, not calmer.
 *
 * Archivo carries language, across its width axis: wide for display lines like
 * an engraved legend plate, normal for everything you read. IBM Plex Mono
 * carries data, always tabular.
 */

@font-face {
  font-family: 'Archivo Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../vendor/fonts/archivo-latin-standard-normal.woff2) format('woff2-variations');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(../vendor/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(../vendor/fonts/ibm-plex-mono-latin-600-normal.woff2) format('woff2');
}

:root {
  color-scheme: dark;

  --void: #060c14;
  --void-2: #091220;
  --panel: #0c1623;
  --panel-2: #122032;
  --panel-3: #16263b;
  --rail: #1d2f47;
  --rail-lit: #2d4765;

  --ink: #e4ecf4;
  --ink-2: #9fb2c7;
  --ink-3: #7892af;

  --amber: #f0a92b;
  --amber-deep: #8a5f12;
  --amber-wash: rgb(240 169 43 / 0.09);
  --steel: #67b3cf;
  --steel-wash: rgb(103 179 207 / 0.1);
  --jade: #3fae8f;
  --brick: #e0624a;
  --brick-wash: rgb(224 98 74 / 0.1);

  --sans: 'Archivo Variable', 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --gutter: clamp(18px, 4.5vw, 64px);
  --measure: 62ch;
  --bar-h: 52px;
  --r: 3px;
  --ease: cubic-bezier(0.2, 0.8, 0.25, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 100%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 20px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  font-variation-settings: 'wdth' 100;
  font-synthesis: none;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul,
figure,
table {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--steel);
  text-decoration-color: rgb(103 179 207 / 0.4);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--steel);
  color: var(--void);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: 10px;
  top: 8px;
  z-index: 60;
  padding: 9px 14px;
  border-radius: var(--r);
  background: var(--amber);
  color: var(--void);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-220%);
}
.skip:focus {
  transform: none;
}

/* ============ lamps ============ */

.lamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--ink-3);
}

.lamp__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 1px rgb(6 12 20 / 0.9), 0 0 7px -1px currentColor;
}

.lamp--off {
  color: var(--ink-3);
}
.lamp--off .lamp__dot {
  background: #243a55;
  box-shadow: inset 0 0 0 1px #2d4765;
}
.lamp--held {
  color: var(--steel);
}
.lamp--live {
  color: var(--amber);
}
.lamp--pass {
  color: var(--jade);
}
.lamp--fail {
  color: var(--brick);
}

.lamp--live .lamp__dot {
  animation: pulse 1.9s var(--ease) infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgb(6 12 20 / 0.9), 0 0 7px -1px currentColor;
  }
  50% {
    box-shadow: 0 0 0 1px rgb(6 12 20 / 0.9), 0 0 12px 1px currentColor;
  }
}

/* The one orchestrated motion on the page: a power-on lamp test, swept across
   every lamp in document order, exactly once. */
.selftest .lamp__dot {
  animation: selftest 620ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 38ms);
}

@keyframes selftest {
  0% {
    background: var(--amber);
    box-shadow: 0 0 0 1px rgb(6 12 20 / 0.9), 0 0 14px 2px var(--amber);
  }
  45% {
    background: var(--amber);
    box-shadow: 0 0 0 1px rgb(6 12 20 / 0.9), 0 0 14px 2px var(--amber);
  }
  100% {
    background: currentColor;
    box-shadow: 0 0 0 1px rgb(6 12 20 / 0.9), 0 0 7px -1px currentColor;
  }
}

@media (prefers-reduced-motion: reduce) {
  .selftest .lamp__dot,
  .lamp--live .lamp__dot {
    animation: none;
  }
}

/* ============ bar ============ */

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  height: var(--bar-h);
  padding-inline: var(--gutter);
  background: rgb(6 12 20 / 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rail);
}

.bar__name {
  font-weight: 600;
  font-size: 0.9375rem;
  font-variation-settings: 'wdth' 108;
  letter-spacing: -0.005em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.bar__state {
  margin-right: auto;
  padding-left: clamp(10px, 2vw, 20px);
  border-left: 1px solid var(--rail);
  min-width: 0;
}

.bar__nav {
  display: flex;
  gap: clamp(12px, 1.8vw, 24px);
  font-size: 0.875rem;
}

.bar__nav a {
  color: var(--ink-2);
  text-decoration: none;
}
.bar__nav a:hover {
  color: var(--ink);
}

.bar__code {
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 11px;
  border: 1px solid var(--rail);
  border-radius: var(--r);
}
.bar__code:hover {
  color: var(--ink);
  border-color: var(--rail-lit);
}

@media (max-width: 860px) {
  .bar__nav {
    display: none;
  }
}

/* ============ layout ============ */

.wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--wide {
  max-width: 1420px;
}

.block {
  padding-block: clamp(56px, 8vw, 104px);
  border-top: 1px solid var(--rail);
}

.block:first-of-type {
  border-top: 0;
}

.head {
  max-width: 48ch;
  margin-bottom: clamp(26px, 3.4vw, 40px);
}

.head__title {
  font-size: clamp(1.7rem, 3.3vw, 2.4rem);
  font-weight: 600;
  font-variation-settings: 'wdth' 106, 'wght' 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.head__sub {
  margin-top: 14px;
  color: var(--ink-2);
  max-width: var(--measure);
}

.note {
  margin-top: 18px;
  font-size: 0.9375rem;
  color: var(--ink-3);
  max-width: var(--measure);
}

.note code,
.prose code,
.panel__body code {
  font-family: var(--mono);
  font-size: 0.875em;
  color: var(--ink-2);
  background: var(--panel-2);
  padding: 1px 4px;
  border-radius: 2px;
}

.prose {
  max-width: var(--measure);
  color: var(--ink-2);
}

.prose p + p {
  margin-top: 14px;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

/* ============ panel ============ */

.panel {
  background: var(--panel);
  border: 1px solid var(--rail);
  border-radius: var(--r);
}

.panel__rail {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  padding: 6px 13px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--rail);
  border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0;
  flex-wrap: wrap;
}

.panel__legend {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  white-space: nowrap;
}

.panel__endpoint {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel__rail .lamp {
  margin-left: auto;
}

.panel__body {
  padding: clamp(14px, 2vw, 22px);
}

.panel__body--flush {
  padding: 0;
}

.panel__foot {
  padding: 11px 13px;
  border-top: 1px solid var(--rail);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* ============ hero ============ */

.hero {
  padding-top: clamp(34px, 5vw, 62px);
  padding-bottom: clamp(44px, 6vw, 76px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

@media (max-width: 1000px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Sized so each of the two sentences holds one line at every width: the
   parallel only reads if the lines stay whole. */
.hero__title {
  font-size: clamp(1.75rem, 3.5vw, 2.95rem);
  font-weight: 600;
  font-variation-settings: 'wdth' 113, 'wght' 600;
  line-height: 0.97;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

/* One column below 1000px, so the headline has the full measure and can scale faster. */
@media (max-width: 1000px) {
  .hero__title {
    font-size: clamp(1.75rem, 5.2vw, 2.95rem);
  }
}

/* The first line is the reader's job and sits back; the second is the product's. */
.hero__title span {
  display: block;
  color: var(--ink-3);
  font-variation-settings: 'wdth' 113, 'wght' 500;
}

.hero__lede {
  margin-top: clamp(20px, 2.6vw, 28px);
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  color: var(--ink-2);
  max-width: 52ch;
}

.hero__lede strong {
  color: var(--ink);
  font-weight: 600;
}

.hero__note {
  margin-top: clamp(22px, 3vw, 30px);
  padding-top: 17px;
  border-top: 1px solid var(--rail);
  font-size: 0.9375rem;
  color: var(--ink-3);
  max-width: 46ch;
}

/* ============ interlock ============ */

.lock__chain {
  display: grid;
  gap: 1px;
  background: var(--rail);
  border-bottom: 1px solid var(--rail);
}

.gate {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  background: var(--panel);
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 140ms var(--ease);
}

.gate:hover {
  background: var(--panel-2);
}

.gate[aria-disabled='true'] {
  cursor: default;
}
.gate[aria-disabled='true']:hover {
  background: var(--panel);
}

/* The link in the chain: a short vertical conductor, lit when the gate passes. */
.gate__link {
  position: relative;
  align-self: stretch;
  width: 22px;
}

.gate__link::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -12px;
  bottom: -12px;
  width: 2px;
  transform: translateX(-50%);
  background: #31496b;
}

.gate:first-child .gate__link::before {
  top: 50%;
}

.gate__link::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--panel);
  border: 2px solid #3a567a;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.gate--pass .gate__link::before {
  background: var(--jade);
}

.gate--pass .gate__link::after {
  background: var(--jade);
  border-color: var(--jade);
}

.gate__key {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.gate__hint {
  display: block;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-top: 1px;
}

/* switch */

.sw {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.sw__track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 100px;
  background: #1a2b40;
  border: 1px solid #2a4260;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.sw__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #557494;
  transition: transform 180ms var(--ease), background 160ms var(--ease);
}

.gate[aria-pressed='true'] .sw__track {
  background: var(--amber-deep);
  border-color: var(--amber);
}

.gate[aria-pressed='true'] .sw__track::after {
  transform: translateX(16px);
  background: var(--amber);
}

.gate[aria-pressed='true'] .sw {
  color: var(--amber);
}

.gate[aria-disabled='true'] .sw {
  color: var(--jade);
}

/* The welded row sits outside the chain: no conductor runs through it. */
.lock__fixed {
  background: var(--panel);
  border-bottom: 1px solid var(--rail);
}

.gate--welded,
.gate--welded:hover {
  cursor: default;
  background: var(--panel);
}

.gate--welded .gate__key {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.gate__none {
  flex: none;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  white-space: nowrap;
}

/* A terminated node, not a link: a ringed slash where a diamond would be.
   The ring is ::before and the slash ::after, so the slash paints on top of it. */
.gate__link--stop::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background-color: transparent;
  border: 2px solid #3a567a;
  transition: none;
}

.gate__link--stop::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 2px;
  border: 0;
  border-radius: 0;
  transform: translate(-50%, -50%) rotate(-45deg);
  background-color: #3a567a;
  transition: none;
}

.lock__out {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 0;
  padding: 15px 13px;
  background: var(--panel-2);
  border: 1px solid var(--rail);
  border-top: 0;
  border-radius: 0 0 var(--r) var(--r);
}

.lock__arrow {
  position: relative;
  width: 22px;
  align-self: stretch;
  min-height: 22px;
}

.lock__arrow::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -16px;
  height: 22px;
  width: 2px;
  transform: translateX(-50%);
  background: #31496b;
}

.lock--armed .lock__arrow::before {
  background: var(--amber);
}

.lock__verdict {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--steel);
}

.lock--armed .lock__verdict {
  color: var(--amber);
}

.lock__detail {
  margin-top: 5px;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.lock--armed .lock__out {
  background: var(--amber-wash);
  border-color: var(--amber-deep);
}

.lock__reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 13px;
  background: transparent;
  border: 1px solid var(--rail-lit);
  border-radius: var(--r);
  font-size: 0.8125rem;
  color: var(--ink-2);
  cursor: pointer;
}

.lock__reset:hover {
  color: var(--ink);
  border-color: var(--steel);
}

/* ============ console ============ */

.con {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.acct {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--rail);
}

.acct div {
  padding: 12px 14px;
  background: var(--panel);
}

.acct dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  white-space: nowrap;
}

.acct dd {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.acct dd.is-pos {
  color: var(--jade);
}
.acct dd.is-neg {
  color: var(--brick);
}

.con__split {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1020px) {
  .con__split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tbl-scroll {
  overflow-x: auto;
  scrollbar-color: var(--rail-lit) transparent;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tbl th {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  background: var(--panel-2);
  border-bottom: 1px solid var(--rail);
  position: sticky;
  top: 0;
}

.tbl td {
  padding: 9px 10px;
  border-bottom: 1px solid #16253a;
  color: var(--ink-2);
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl .num {
  text-align: right;
}

.tbl .t-ticket {
  color: var(--ink-3);
}

.tbl .t-sym {
  color: var(--ink);
}

.tbl .t-buy {
  color: var(--steel);
}
.tbl .t-sell {
  color: var(--amber);
}

.tbl .t-none {
  color: var(--brick);
}

.tbl .t-set {
  color: var(--ink);
}

.tbl .is-pos {
  color: var(--jade);
}
.tbl .is-neg {
  color: var(--brick);
}

/* a value that just changed */
.flash {
  animation: flash 1100ms var(--ease) both;
}

@keyframes flash {
  0% {
    background: rgb(240 169 43 / 0.26);
    color: var(--ink);
  }
  100% {
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flash {
    animation: none;
    box-shadow: inset 2px 0 0 var(--amber);
  }
}

.tbl tr.is-own td:first-child {
  box-shadow: inset 2px 0 0 var(--steel);
}

/* worker */

.work {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rail);
  border-bottom: 1px solid var(--rail);
}

.work div {
  padding: 11px 13px;
  background: var(--panel);
}

.work dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}

.work dd {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.work dd.c-pass {
  color: var(--jade);
}
.work dd.c-held {
  color: var(--steel);
}
.work dd.c-skip {
  color: var(--ink-3);
}
.work dd.c-fail {
  color: var(--brick);
}

.ctl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  background: var(--panel-2);
  border: 1px solid var(--rail-lit);
  border-radius: var(--r);
  font-size: 0.8125rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 140ms var(--ease), color 140ms var(--ease);
}

.btn:hover {
  color: var(--ink);
  border-color: var(--steel);
}

.btn--primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #1a1203;
  font-weight: 600;
  text-decoration: none;
}

.btn--primary:hover {
  color: #1a1203;
  background: #ffbc3f;
  border-color: #ffbc3f;
}

.btn[aria-pressed='true'] {
  border-color: var(--steel);
  color: var(--ink);
}

/* log */

.log {
  max-height: 310px;
  overflow-y: auto;
  scrollbar-color: var(--rail-lit) transparent;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.log__row {
  display: grid;
  grid-template-columns: 58px 76px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 13px;
  border-bottom: 1px solid #142336;
  align-items: baseline;
}

.log__time {
  color: var(--ink-3);
}

.log__status {
  font-weight: 600;
  letter-spacing: 0.03em;
}

.log__status--DRY_RUN {
  color: var(--steel);
}
.log__status--SUCCESS {
  color: var(--jade);
}
.log__status--SKIPPED {
  color: var(--ink-3);
}
.log__status--FAILED {
  color: var(--brick);
}

.log__what {
  color: var(--ink-2);
  overflow-wrap: anywhere;
  white-space: normal;
}

.log__what b {
  color: var(--ink);
  font-weight: 600;
}

.log__what i {
  color: var(--ink-3);
  font-style: normal;
}

.log__empty {
  padding: 22px 13px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  background: var(--amber-wash);
  border: 1px solid var(--amber-deep);
  border-radius: var(--r);
  font-size: 0.875rem;
  color: var(--ink);
}

.banner__list {
  display: block;
  margin-top: 5px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* ============ mechanisms ============ */

.mech {
  display: grid;
  gap: clamp(16px, 2.4vw, 22px);
}

.mech__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  gap: clamp(16px, 2.4vw, 26px);
  align-items: start;
}

@media (max-width: 900px) {
  .mech__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mech__intro {
  max-width: 54ch;
  color: var(--ink-2);
  font-size: 0.9375rem;
  margin-bottom: 18px;
}

.mech__intro strong {
  color: var(--ink);
  font-weight: 600;
}

/* dials */

.dials {
  display: grid;
  gap: 15px;
}

.dial__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dial__key {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-2);
}

.dial__val {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
}

.dial input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 2px 0 0;
  background: transparent;
  cursor: pointer;
}

.dial input[type='range']::-webkit-slider-runnable-track {
  height: 3px;
  background: #22364f;
  border-radius: 2px;
}

.dial input[type='range']::-moz-range-track {
  height: 3px;
  background: #22364f;
  border-radius: 2px;
}

.dial input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--void);
  box-shadow: 0 0 0 1px var(--amber-deep);
}

.dial input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--void);
  box-shadow: 0 0 0 1px var(--amber-deep);
}

.dial__hint {
  font-size: 0.75rem;
  color: var(--ink-3);
  margin-top: 1px;
}

.sel {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--rail);
  border: 1px solid var(--rail);
  border-radius: var(--r);
  overflow: hidden;
}

.sel button {
  flex: 1 1 auto;
  padding: 6px 12px;
  background: var(--panel);
  border: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  cursor: pointer;
}

.sel button:hover {
  color: var(--ink-2);
}

.sel button[aria-pressed='true'] {
  background: var(--panel-3);
  color: var(--ink);
}

/* price track, used by trailing and initial SL/TP */

.track {
  position: relative;
  height: 192px;
  margin: 10px 0 4px;
}

.track__axis {
  position: absolute;
  left: 0;
  right: 0;
  top: 84px;
  height: 1px;
  background: #22364f;
}

.track__zone {
  position: absolute;
  top: 76px;
  height: 29px;
  background: var(--steel-wash);
  border-left: 1px dashed rgb(103 179 207 / 0.5);
  border-right: 1px dashed rgb(103 179 207 / 0.5);
}

.track__mark {
  position: absolute;
  top: 68px;
  width: 0;
  transform: translateX(-0.5px);
}

.track__mark::before {
  content: '';
  position: absolute;
  top: 0;
  height: 45px;
  width: 1px;
  background: var(--ink-3);
}

.track__mark span {
  position: absolute;
  top: calc(-20px - var(--lift, 0px));
  left: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.6875rem;
  white-space: nowrap;
  color: var(--ink-3);
}

.track__mark em {
  position: absolute;
  top: calc(48px + var(--lift, 0px));
  left: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink-2);
}

.track__mark--open::before {
  background: var(--ink-2);
}

.track__mark--price::before {
  width: 2px;
  background: var(--ink);
  height: 52px;
  top: -4px;
}
.track__mark--price span {
  top: calc(-24px - var(--lift, 0px));
  color: var(--ink);
  font-weight: 600;
}
.track__mark--price em {
  top: calc(52px + var(--lift, 0px));
  color: var(--ink);
  font-weight: 600;
}

.track__mark--sl::before {
  width: 3px;
  background: var(--brick);
}
.track__mark--sl span,
.track__mark--sl em {
  color: var(--brick);
}

.track__mark--sl-new::before {
  width: 3px;
  background: var(--jade);
}
.track__mark--sl-new span,
.track__mark--sl-new em {
  color: var(--jade);
}

.track__mark--tp::before {
  width: 3px;
  background: var(--jade);
}
.track__mark--tp span,
.track__mark--tp em {
  color: var(--jade);
}

.track__mark--trigger::before {
  background: repeating-linear-gradient(
    to bottom,
    var(--amber) 0 3px,
    transparent 3px 6px
  );
}
.track__mark--trigger span,
.track__mark--trigger em {
  color: var(--amber);
}

.track__ghost {
  position: absolute;
  top: 56px;
  height: 13px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    135deg,
    rgb(63 174 143 / 0.3) 0 4px,
    transparent 4px 8px
  );
}

/* verdict strip under a mechanism */

.verdict {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--r);
  font-size: 0.875rem;
  border: 1px solid var(--rail);
  background: var(--panel-2);
}

.verdict--act {
  border-color: rgb(63 174 143 / 0.45);
  background: rgb(63 174 143 / 0.08);
}

.verdict--hold {
  border-color: var(--rail-lit);
}

.verdict--warn {
  border-color: var(--amber-deep);
  background: var(--amber-wash);
}

.verdict__text {
  min-width: 0;
}

.verdict__text b {
  color: var(--ink);
  font-weight: 600;
}

.verdict__text code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.verdict__action {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

/* ladder */

.ladder {
  display: grid;
  gap: 1px;
  align-content: start;
  background: var(--rail);
  border: 1px solid var(--rail);
  border-radius: var(--r);
  max-height: 420px;
  overflow-y: auto;
  scrollbar-color: var(--rail-lit) transparent;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.rung {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 8px 12px;
  background: var(--panel);
}

.rung--parent {
  background: var(--panel-3);
}

.rung__lvl {
  color: var(--ink-3);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
}

.rung--parent .rung__lvl {
  color: var(--ink);
}

.rung__price {
  color: var(--ink);
  font-weight: 600;
}

.rung__vol {
  color: var(--steel);
  text-align: right;
}

.rung__tag {
  color: var(--ink-3);
  font-size: 0.6875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 24ch;
}

.rung--skip {
  background: var(--brick-wash);
}
.rung--skip .rung__price,
.rung--skip .rung__vol {
  color: var(--brick);
}

@media (max-width: 560px) {
  .rung {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }
  .rung__tag {
    display: none;
  }
}

.ladder__sum {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 10px 12px;
  background: var(--panel-2);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.ladder__sum b {
  color: var(--ink);
  font-weight: 600;
}

/* ============ preview / apply ============ */

.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  align-items: start;
}

.code {
  margin: 0;
  padding: 13px;
  background: var(--void-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--ink-2);
  overflow-x: auto;
  white-space: pre;
  scrollbar-color: var(--rail-lit) transparent;
}

.code b {
  color: var(--ink);
  font-weight: 400;
}
.code i {
  color: var(--ink-3);
  font-style: normal;
}
.code u {
  color: var(--steel);
  text-decoration: none;
}
.code s {
  color: var(--amber);
  text-decoration: none;
}
.code em {
  color: var(--jade);
  font-style: normal;
}

/* ============ telegram ============ */

.tg {
  display: grid;
  grid-template-columns: minmax(280px, 370px) minmax(0, 1fr);
  gap: clamp(20px, 3.4vw, 44px);
  align-items: start;
}

@media (max-width: 880px) {
  .tg {
    grid-template-columns: minmax(0, 1fr);
  }
}

.phone {
  background: var(--panel);
  border: 1px solid var(--rail-lit);
  border-radius: 14px;
  padding: 9px;
}

.phone__bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 7px 11px;
  border-bottom: 1px solid var(--rail);
  margin-bottom: 11px;
}

.phone__av {
  flex: none;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--panel-3);
  border: 1px solid var(--rail-lit);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--steel);
}

.phone__who {
  min-width: 0;
}

.phone__who b {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.phone__who span {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
}

.phone__msg {
  padding: 11px 12px;
  background: var(--panel-2);
  border-radius: 10px 10px 10px 2px;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 150px;
}

.phone__msg b {
  color: var(--ink);
  font-weight: 600;
}

.phone__keys {
  display: grid;
  gap: 5px;
  margin-top: 9px;
}

.phone__row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
}

.key {
  padding: 8px 9px;
  background: var(--panel-3);
  border: 1px solid var(--rail-lit);
  border-radius: 7px;
  font-size: 0.8125rem;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  line-height: 1.35;
  transition: background 130ms var(--ease);
}

.key:hover {
  background: #1d3350;
}

.key--danger {
  border-color: var(--amber-deep);
  color: var(--amber);
}

.key--back {
  color: var(--ink-3);
}

.tg__side {
  min-width: 0;
}

.tg__rows {
  display: grid;
  gap: 1px;
  background: var(--rail);
  border: 1px solid var(--rail);
  border-radius: var(--r);
  overflow: hidden;
  margin-top: 20px;
}

.tg__row {
  display: grid;
  grid-template-columns: minmax(0, 170px) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 13px;
  background: var(--panel);
  font-size: 0.875rem;
}

@media (max-width: 560px) {
  .tg__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
}

.tg__row b {
  font-weight: 600;
  color: var(--ink);
}

.tg__row span {
  color: var(--ink-2);
}

/* ============ isolation ============ */

.iso {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}

.stack {
  display: grid;
  gap: 1px;
  background: var(--rail);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.stack__row {
  display: grid;
  grid-template-columns: minmax(0, 92px) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 13px;
  background: var(--panel);
}

.stack__row dt {
  color: var(--ink-3);
}

.stack__row dd {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.stack--flags .stack__row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.stack--flags dt {
  color: var(--ink-2);
}

.stack--flags dd {
  text-align: right;
}

/* ============ checklist ============ */

.check {
  counter-reset: step;
  display: grid;
  gap: 1px;
  background: var(--rail);
  border: 1px solid var(--rail);
  border-radius: var(--r);
  overflow: hidden;
}

.check li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 13px;
  background: var(--panel);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.check li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.check li b {
  color: var(--ink);
  font-weight: 600;
}

.check li code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--steel);
  background: none;
  padding: 0;
}

.check li[data-auto] {
  background: var(--panel-2);
}

.check__tag {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--jade);
  white-space: nowrap;
}

/* ============ limits / retcodes ============ */

.limits {
  display: grid;
  gap: 1px;
  background: var(--rail);
  border: 1px solid var(--rail);
  border-radius: var(--r);
  overflow: hidden;
}

.limits li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.limits li::before {
  content: '';
  width: 7px;
  height: 7px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: #243a55;
  box-shadow: inset 0 0 0 1px #35527a;
}

.limits li b {
  color: var(--ink);
  font-weight: 600;
}

.ret {
  display: grid;
  gap: 1px;
  background: var(--rail);
  margin-top: 16px;
  border: 1px solid var(--rail);
  border-radius: var(--r);
  overflow: hidden;
}

.ret__item {
  padding: 14px;
  background: var(--panel);
}

.ret__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.ret__code {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--brick);
}

.ret__msg {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.ret__where {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-left: auto;
  border: 1px solid var(--rail-lit);
  border-radius: 100px;
  padding: 2px 9px;
}

.ret__body {
  margin-top: 9px;
  font-size: 0.9375rem;
  color: var(--ink-2);
  max-width: var(--measure);
}

.ret__fix {
  margin-top: 7px;
  font-size: 0.875rem;
  color: var(--ink-3);
  max-width: var(--measure);
}

/* ============ close / footer ============ */

.close__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
}

@media (max-width: 860px) {
  .close__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.foot {
  padding: 30px var(--gutter) 46px;
  border-top: 1px solid var(--rail);
  background: var(--void-2);
}

.foot__in {
  max-width: 1240px;
  margin-inline: auto;
  display: grid;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.foot__in p {
  max-width: 78ch;
}

.foot__in strong {
  color: var(--ink-2);
  font-weight: 600;
}

/* details */

.more {
  margin-top: 16px;
  border-top: 1px solid var(--rail);
  padding-top: 14px;
}

.more > summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--steel);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.more > summary::-webkit-details-marker {
  display: none;
}

.more > summary::before {
  content: '+';
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--ink-3);
}

.more[open] > summary::before {
  content: '\2212';
}

.more > summary:hover {
  color: var(--ink);
}

.more__body {
  margin-top: 11px;
  font-size: 0.9375rem;
  color: var(--ink-2);
  max-width: var(--measure);
}

.more__body p + p {
  margin-top: 11px;
}

.noscript {
  margin: 0;
  padding: 13px var(--gutter);
  background: var(--amber-wash);
  border-bottom: 1px solid var(--amber-deep);
  font-size: 0.875rem;
  color: var(--ink);
}
