:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ink: #20202a;
  --muted: #5a5b68;
  --line: #dedee5;
  --paper: #f7f7f4;
  --accent: #5235d9;
  --pass: #24563d;
  --fail: #8b3526;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button { font: inherit; }
button:focus-visible { outline: 3px solid #846cff; outline-offset: 3px; }
.shell { width: min(1168px, calc(100% - 80px)); margin-inline: auto; }

.masthead { border-bottom: 1px solid #dfdfda; }
.masthead-inner, .brand, .mode { display: flex; align-items: center; }
.masthead-inner { justify-content: space-between; min-height: 68px; gap: 12px; }
.brand { gap: 12px; font-weight: 720; letter-spacing: -.025em; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-content: center;
  width: 30px;
  height: 30px;
  position: relative;
  border-radius: 8px;
  background: #242331;
  box-shadow: 0 1px 2px #24233125;
}
.brand-mark i { grid-area: 1 / 1; width: 10px; height: 10px; rotate: 45deg; border: 2px solid #fbfaff; }
.brand-mark i:first-child { translate: -3px 0; }
.brand-mark i:last-child { translate: 3px 0; border-color: #b6a6ff; }
.brand-section { border-left: 1px solid #d4d4d0; padding-left: 12px; color: var(--muted); font-weight: 500; }
.mode { gap: 8px; color: #4d4c5a; font: .8125rem var(--mono); white-space: nowrap; }
.mode i { width: 7px; height: 7px; background: #7555eb; border-radius: 50%; }

.intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 33px 0 26px; }
.intro h1 { margin: 0; font-size: clamp(2.4rem, 4.55vw, 4.25rem); line-height: .99; font-weight: 740; letter-spacing: -.075em; }
.intro p { margin: 0 0 3px; color: var(--muted); font-size: 1.0625rem; line-height: 1.48; }

.instrument {
  background: #fff;
  border: 1px solid #d8d8de;
  border-radius: 18px;
  overflow: clip;
  box-shadow: 0 26px 50px -35px #30294d4d, 0 3px 8px #29263b0b;
}
.instrument-header {
  padding: 15px 24px;
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.instrument-header h2 { margin: 0; font-size: 1rem; letter-spacing: -.015em; }
.event-id { display: flex; align-items: center; gap: 10px; color: var(--muted); font: .8125rem var(--mono); }
.event-id code { padding: 4px 7px; border-radius: 4px; color: #342477; background: #efebff; font: inherit; }
.delivery-count { white-space: nowrap; }

.machine {
  --columns: minmax(0, 1fr) minmax(0, 1.28fr) minmax(0, 1fr);
  --machine-gutter: 28px;
  padding: 0 var(--machine-gutter) 13px;
  background: radial-gradient(circle, #a8a6b95b .75px, transparent 1px) 1px 1px / 14px 14px, #f2f1f6;
  border-block: 1px solid #dedce7;
}
.column-labels { display: grid; grid-template-columns: var(--columns); align-items: center; min-height: 38px; color: #555465; font: .75rem var(--mono); text-transform: uppercase; letter-spacing: .075em; }
.column-labels span:nth-child(2) { text-align: center; }
.column-labels span:last-child { padding-inline-start: 22%; }
.lanes { position: relative; isolation: isolate; }
.chassis {
  position: absolute;
  inset: 0 auto 0 50%;
  translate: -50% 0;
  width: 34%;
  max-width: 282px;
  border: 1px solid #88829d;
  border-radius: 18px;
  background: linear-gradient(105deg, #747185, #9893aa 6%, #b4aec5 8%, #918ba5 10%, #79738f 90%, #625c76 97%, #918ba6);
  box-shadow: inset 0 1px 0 #ffffff80, inset 0 -2px 0 #35314464, 0 5px 12px #33294828;
}
.chassis::before, .chassis::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  height: 6px;
  background: radial-gradient(circle at 3px 3px, #4b465c 0 2px, #bab4c9 2.5px 3px, transparent 3px) left / 6px no-repeat,
              radial-gradient(circle at 3px 3px, #4b465c 0 2px, #bab4c9 2.5px 3px, transparent 3px) right / 6px no-repeat;
}
.chassis::before { top: 10px; }
.chassis::after { bottom: 10px; }
.lane {
  position: relative;
  display: grid;
  align-items: center;
  grid-template-columns: var(--columns);
  min-height: 118px;
}
.lane + .lane { border-top: 1px solid #b6b1c465; }
.lane::before {
  content: "";
  position: absolute;
  top: calc(50% - 5px);
  left: 15px;
  width: calc(86% - 15px);
  height: 10px;
  border-block: 1px solid #b4afc6;
  background: repeating-linear-gradient(90deg, #aaa3c0 0 3px, #dedbe8 3px 8px);
  box-shadow: 0 0 0 3px #eeecf5;
}
.input, .gate, .output { position: relative; z-index: 1; }
.input { justify-self: start; min-width: 0; max-width: 100%; }
.input h3 { position: absolute; bottom: calc(100% + 8px); margin: 0; font: 700 .9375rem var(--mono); letter-spacing: .03em; white-space: nowrap; }
.input h3 span { margin-left: 6px; color: #555263; font: 500 .875rem "Inter", "Segoe UI", system-ui, sans-serif; letter-spacing: 0; }
.token {
  display: flex;
  align-items: center;
  min-height: 35px;
  width: fit-content;
  max-width: 100%;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid #c4b4fe;
  border-radius: 6px;
  background: #f0eaff;
  color: #45318c;
  font: 700 .8125rem var(--mono);
  box-shadow: inset 0 1px 0 #fff, 0 2px 1px #7f64cf28;
}
.bolt {
  display: inline-block;
  flex: none;
  width: 12px;
  height: 16px;
  background: #6243da;
  clip-path: polygon(53% 0, 10% 55%, 47% 55%, 39% 100%, 96% 38%, 57% 38%, 69% 0);
}
.machine[data-phase="ready"] .token { background: #eeedf3; border-color: #d0cadb; box-shadow: none; }
.machine[data-phase="ready"] .token .bolt { background: #7b758c; }

.gate { align-self: center; justify-self: center; width: min(65%, 194px); margin-top: -1px; }
.gate-body {
  display: grid;
  grid-template-columns: 1fr minmax(44px, 1.9fr) 1fr;
  align-items: center;
  justify-items: center;
  min-height: 54px;
  padding: 5px;
  border: 1px solid #282538;
  border-radius: 9px;
  background: linear-gradient(#424054, #2b293c 49%, #36334a);
  box-shadow: inset 0 1px 0 #a7a1bd7d, inset 0 -2px 0 #1715228f, 0 4px 7px #201c2d55;
}
.vents {
  width: min(60%, 22px);
  height: 18px;
  border-radius: 1px;
  background: repeating-linear-gradient(0deg, #171523 0 2px, #646077 2px 3px, transparent 3px 6px);
}
.actuator {
  position: relative;
  display: block;
  width: 100%;
  height: 38px;
  overflow: hidden;
  border: 1px solid #706981;
  border-radius: 5px;
  background: linear-gradient(#151321 0 33%, #625a77 34% 37%, #322b48 38% 62%, #625a77 63% 66%, #151321 67%);
  box-shadow: inset 0 1px 5px #0b0917;
}
.actuator::before, .actuator::after {
  content: "";
  position: absolute;
  top: 45%;
  width: 12%;
  height: 13%;
  border-radius: 1px;
  background: #998bc8;
}
.actuator::before { left: 8%; }
.actuator::after { right: 8%; }
.actuator i {
  display: block;
  width: 32%;
  height: 82%;
  position: absolute;
  top: 9%;
  left: 34%;
  transform: translateY(-85%);
  border: 1px solid #e2d9ff;
  border-radius: 0 0 3px 3px;
  background: repeating-linear-gradient(135deg, #b2a0f0 0 4px, #8270c5 4px 8px);
  box-shadow: 0 1px 5px #cabbff;
  transition: transform 240ms ease;
}
.lane[data-gate="blocked"] .actuator i { transform: translateY(0); }
.lane[data-gate="leak"] .actuator::before, .lane[data-gate="leak"] .actuator::after { background: #ffae92; }
.gate-status {
  display: block;
  position: absolute;
  width: max-content;
  max-width: 145%;
  left: 50%;
  translate: -50% 0;
  margin-top: 7px;
  border: 1px solid #4e475c;
  border-radius: 4px;
  padding: 4px 7px;
  background: #302b3f;
  color: #f0edf6;
  font: 700 .75rem/1.15 var(--mono);
  text-align: center;
}
.lane[data-gate="blocked"] .gate-status { background: #ded3ff; border-color: #7e6fad; color: #3b2778; }
.lane[data-gate="leak"] .gate-status { background: #ffe4d8; border-color: #ca8779; color: #793020; }

.output {
  min-width: 0;
  width: 78%;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #d0ccdf;
  border-radius: 8px;
  background: #fbfaff;
  box-shadow: 0 2px 0 #d4cfe3ab;
}
.order-total { display: flex; gap: 5px; align-items: baseline; flex: none; font-size: .875rem; color: var(--muted); }
.order-total strong { font: 740 clamp(1.75rem, 3.2vw, 2.7rem)/1 var(--mono); color: var(--ink); letter-spacing: -.12em; }
.lane[data-gate="leak"] .order-total strong { color: var(--fail); }
.receipts { display: flex; gap: 5px; min-width: 0; }
.receipt {
  flex: 0 1 24px;
  width: 24px;
  height: 32px;
  border: 1px solid #a7a1b7;
  border-radius: 3px;
  background: repeating-linear-gradient(180deg, #858093 0 1px, transparent 1px 4px) 5px 7px / calc(100% - 10px) 12px no-repeat, #f3f0f8;
  box-shadow: 0 1px 0 #b6b0c6;
}
.receipt-extra { border-color: #bc6e5a; background-color: #ffe8df; box-shadow: 0 1px 0 #bc6e5a; }
.travel {
  position: absolute;
  z-index: 2;
  top: calc(50% - 8px);
  left: 14%;
  opacity: 0;
  pointer-events: none;
  background: #7855ed;
}
.machine.is-delivering .travel { animation: travel 430ms ease-in-out both; }
.machine.is-delivering .lane[data-gate="blocked"] .travel { animation-name: bounce; }
.machine.is-delivering .lane[data-gate="blocked"] .actuator { animation: stop-flash 410ms 100ms ease both; }
.machine.is-delivering .output { animation: order-flash 440ms 240ms ease both; }
.machine.is-delivering .lane[data-gate="blocked"] .output { animation: none; }
@keyframes travel {
  0% { left: 14%; opacity: 0; }
  15% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: 76%; opacity: 0; }
}
@keyframes bounce {
  0% { left: 14%; opacity: 0; }
  14% { opacity: 1; }
  67% { left: 48%; opacity: 1; }
  84% { left: 43%; opacity: 1; }
  100% { left: 41%; opacity: 0; }
}
@keyframes stop-flash { 50% { box-shadow: inset 0 0 9px #c0a4ff, 0 0 11px #d0baff; } }
@keyframes order-flash { 40% { background-color: #ebe3ff; border-color: #a192d5; } }

.checks { padding: 6px 24px 10px; }
.checks table { width: 100%; border-spacing: 0; text-align: left; font-size: .875rem; }
.checks :is(th, td) { padding: 6px 10px; }
.checks :is(th, td):first-child { width: 42%; padding-left: 0; }
.checks :is(th, td):nth-child(2), .checks :is(th, td):nth-child(3) { width: 13%; }
.checks thead { color: var(--muted); font: .75rem var(--mono); letter-spacing: .055em; }
.checks tbody th { font-weight: 680; }
.checks tbody small { margin-left: 8px; color: var(--muted); font-size: .8125rem; font-weight: 450; }
.checks tbody tr + tr :is(th, td) { border-top: 1px solid #eceaf1; }
.checks tbody tr.is-active { background: #f5f1ff; }
.checks tbody tr.is-active th:first-child { box-shadow: -4px 0 #7151e8; }
.result { display: inline-block; min-width: 53px; padding: 3px 6px; border-radius: 4px; font: 700 .8125rem/1.2 var(--mono); text-align: center; }
.result[data-result="pass"] { color: var(--pass); background: #e6f3eb; }
.result[data-result="fail"] { color: var(--fail); background: #fce8df; }
.result[data-result="pending"] { color: #64616c; background: #f4f2f7; }
.check-summary { color: #4d4859; font-weight: 560; }

.console { padding: 12px 24px; min-height: 65px; display: flex; justify-content: space-between; align-items: center; gap: 12px 18px; background: #fbfbfd; border-top: 1px solid #e6e4ed; }
.steps { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 19px; margin: 0; padding: 0; list-style: none; color: #575463; }
.steps li { display: flex; align-items: center; gap: 6px; font-size: .8125rem; white-space: nowrap; }
.steps li span { display: grid; place-items: center; height: 21px; width: 21px; border: 1px solid #dcdae5; border-radius: 50%; font: .75rem var(--mono); }
.steps .is-complete span { color: #4a347e; background: #efebf8; border-color: #dcd3ef; }
.steps [aria-current="step"] { color: #392189; font-weight: 690; }
.steps [aria-current="step"] span { color: #fff; background: #6341df; border-color: #6341df; }
.controls { display: flex; justify-content: end; align-items: center; gap: 7px; white-space: nowrap; }
.button { display: grid; place-items: center; min-height: 40px; padding: 6px 13px; border: 1px solid #dfdcea; border-radius: 7px; color: #272438; background: #fff; font-weight: 650; font-size: .875rem; cursor: pointer; }
.button-reset { display: flex; align-items: center; justify-content: center; gap: 5px; }
.button-reset span { font-size: 1.15rem; line-height: 1; }
.button:hover:not(:disabled) { background: #f0ecff; }
.button:active:not(:disabled) { translate: 0 1px; }
.button-primary { min-width: 155px; background: var(--accent); border-color: #4529c8; color: #fff; box-shadow: inset 0 1px 0 #ffffff38, 0 2px 3px #3522792b; }
.button-primary:hover:not(:disabled) { background: #4328c4; }
.button:disabled { cursor: default; color: #64606f; background: #f0eef4; border-color: #e6e3ee; box-shadow: none; }
.notes { padding: 13px 1px 17px; color: var(--muted); font: .75rem/1.5 var(--mono); }
.sr-only { position: absolute; height: 1px; width: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.script-note { padding-inline: 24px; font-size: .875rem; }

@media (max-width: 930px) {
  .shell { width: calc(100% - 48px); }
  .console { flex-wrap: wrap; }
  .controls { margin-left: auto; }
  .output { flex-wrap: wrap; gap: 5px 9px; width: 87%; }
  .column-labels span:last-child { padding-inline-start: 13%; }
}
@media (max-width: 630px) {
  .shell { width: calc(100% - 24px); }
  .masthead-inner { min-height: 52px; }
  .brand { gap: 7px; font-size: .9375rem; }
  .brand-mark { width: 24px; height: 24px; border-radius: 6px; }
  .brand-section { padding-left: 7px; }
  .mode { font-size: .6875rem; gap: 4px; }
  .intro { display: block; padding: 23px 1px 16px; }
  .intro h1 { font-size: clamp(2.15rem, 8vw, 3.2rem); letter-spacing: -.065em; }
  .intro p { font-size: .9375rem; margin: 9px 0 0; }
  .intro br { display: none; }
  .instrument { border-radius: 12px; }
  .instrument-header { display: grid; padding: 10px 11px; gap: 5px; }
  .event-id { flex-wrap: wrap; gap: 5px; font-size: .75rem; }
  .event-id code { padding: 3px 4px; }
  .machine { --machine-gutter: 10px; --columns: minmax(0, 1fr) minmax(0, 1.24fr) minmax(0, 1fr); padding-bottom: 8px; }
  .column-labels { min-height: 30px; font-size: .6875rem; letter-spacing: 0; }
  .column-labels span:last-child { text-align: right; padding: 0 7px 0 0; }
  .lane { min-height: 91px; }
  .input h3 { bottom: calc(100% + 5px); font-size: .8125rem; }
  .input h3 span { display: block; margin: 1px 0 0; font-size: .75rem; }
  .token { min-height: 25px; padding: 3px 5px; }
  .token span { display: none; }
  .chassis { width: 35%; border-radius: 10px; }
  .chassis::before, .chassis::after { left: 5px; right: 5px; }
  .chassis::before { top: 6px; }
  .chassis::after { bottom: 6px; }
  .gate { width: 76%; }
  .gate-body { min-height: 39px; border-radius: 6px; padding: 4px; grid-template-columns: 1fr minmax(30px, 2fr) 1fr; }
  .actuator { height: 27px; }
  .vents { height: 13px; }
  .gate-status { font-size: .6875rem; padding: 3px 4px; max-width: 145%; margin-top: 5px; }
  .output { flex-direction: column; justify-content: center; min-height: 55px; padding: 4px 4px 5px; width: min(92%, 126px); gap: 3px; }
  .order-total { font-size: .75rem; gap: 4px; }
  .order-total strong { font-size: 1.55rem; }
  .receipt { width: 17px; height: 21px; background-position: 3px 4px; background-size: calc(100% - 6px) 9px; }
  .checks { padding: 4px 10px 7px; }
  .checks :is(th, td) { padding: 5px 3px; }
  .checks tbody th { font-size: .8125rem; }
  .checks tbody small { display: block; margin-left: 0; font-size: .6875rem; }
  .checks :is(th, td):first-child { width: 37%; }
  .checks :is(th, td):nth-child(2), .checks :is(th, td):nth-child(3) { width: 17%; }
  .result { min-width: 39px; font-size: .75rem; }
  .check-summary { font-size: .6875rem; line-height: 1.2; }
  .console { padding: 9px 10px; gap: 8px; }
  .steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 3px; }
  .steps li { font-size: .6875rem; gap: 3px; white-space: normal; line-height: 1.1; }
  .steps li span { width: 16px; height: 16px; flex: none; font-size: .625rem; }
  .controls { width: 100%; }
  .button { min-height: 44px; }
  .button-primary { margin-left: auto; min-width: min(155px, 57%); }
}
@media (max-width: 440px) {
  .brand-section { display: none; }
}
@media (max-width: 370px) {
  .button { padding-inline: 8px; }
  .button-primary { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
