:root {
  --paper: #f2efe6;
  --ink: #151515;
  --blue: #1647ff;
  --signal: #c8ff48;
  --alert: #ff5a45;
  --line: #252525;
  --display:
    "Bahnschrift Condensed", "Aptos Display", "Arial Narrow", sans-serif;
  --mono:
    "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --paper-bright: #fffdf6;
  --page-gutter: clamp(1rem, 3vw, 3rem);
  --max-width: 1600px;
}

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

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  line-height: 1.45;
}

body,
button,
input,
textarea {
  font-synthesis: none;
}

body::selection,
body *::selection {
  background: var(--signal);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

[hidden],
.hidden {
  display: none !important;
}

:where(a, button, input, textarea):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border: 2px solid var(--ink);
  background: var(--signal);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  display: grid;
  grid-template-columns:
    minmax(220px, 2.3fr)
    minmax(340px, 4fr)
    minmax(230px, 2.4fr)
    minmax(140px, 1.3fr);
  min-height: 74px;
  border-bottom: 3px solid var(--line);
  background: var(--paper);
  position: relative;
  z-index: 10;
}

.topbar > * {
  min-width: 0;
  border-right: 2px solid var(--line);
}

.topbar .brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--page-gutter);
  background: var(--blue);
  color: var(--paper-bright);
  font-size: clamp(1.8rem, 3vw, 3.1rem);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
  text-transform: uppercase;
}

.topbar .brand span {
  display: inline-block;
  padding: 0.35rem 0.55rem 0.28rem;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.topbar nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topbar nav a,
.topbar > a:last-child,
.system-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  font-family: var(--mono);
  font-size: clamp(0.68rem, 0.95vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.045em;
  text-align: center;
}

.topbar nav a + a {
  border-left: 2px solid var(--line);
}

.topbar nav a {
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.topbar nav a:hover {
  background: var(--signal);
}

.system-state {
  gap: 0.65rem;
  background: var(--ink);
  color: var(--paper-bright);
}

.system-state i,
.dispatch-status i {
  display: block;
  width: 0.68rem;
  height: 0.68rem;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  background: var(--signal);
  animation: signal-pulse 1.8s steps(2, end) infinite;
}

.topbar > a:last-child {
  border-right: 0;
  background: var(--alert);
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.topbar > a:last-child:hover {
  background: var(--signal);
}

.workstation {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.2vw, 2.5rem);
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: clamp(2.25rem, 5vw, 5.75rem) var(--page-gutter) 0;
}

.workstation::before {
  position: absolute;
  top: 0;
  right: var(--page-gutter);
  width: clamp(5.5rem, 12vw, 12rem);
  height: 0.8rem;
  background: var(--blue);
  content: "";
}

.dispatch-copy {
  grid-column: 1 / span 7;
  min-width: 0;
  padding-top: 0.35rem;
  animation: desk-enter 520ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.eyebrow,
.job-id,
.rail-label,
.dispatch-index,
.panel-register,
.input-help,
.panel-footnote,
.result-register,
.footer-brand span {
  font-family: var(--mono);
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: clamp(0.7rem, 1vw, 0.84rem);
  font-weight: 800;
  letter-spacing: 0.055em;
}

.dispatch-index {
  width: max-content;
  margin: 1.6rem 0 0 auto;
  padding: 0.45rem 0.65rem;
  border: 2px solid var(--line);
  background: var(--alert);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.dispatch-copy h1 {
  max-width: none;
  margin: clamp(1rem, 2.4vw, 2.5rem) 0 0;
  font-size: clamp(4.7rem, 7.7vw, 8.7rem);
  font-stretch: condensed;
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 0.78;
  text-wrap: balance;
}

.dispatch-copy h1 span {
  display: inline-block;
  padding: 0 0.05em 0.02em;
  background: var(--signal);
  box-decoration-break: clone;
  white-space: nowrap;
  -webkit-box-decoration-break: clone;
}

.dispatch-lead {
  width: min(75%, 42rem);
  margin: clamp(2.1rem, 4vw, 4.5rem) 0 0 12%;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 0.75rem solid var(--blue);
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  font-weight: 600;
  line-height: 1.55;
}

.dispatch-status {
  display: flex;
  align-items: stretch;
  width: min(88%, 44rem);
  margin-top: clamp(2rem, 4vw, 4.25rem);
  border: 2px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.dispatch-status > span,
.dispatch-status > strong {
  display: flex;
  align-items: center;
  min-height: 2.65rem;
  padding: 0.65rem 0.8rem;
}

.dispatch-status > span {
  flex: 1 1 auto;
  background: var(--ink);
  color: var(--paper-bright);
}

.dispatch-status > strong {
  gap: 0.55rem;
  border-left: 2px solid var(--line);
  background: var(--paper-bright);
}

.rail-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2.5rem, 6vw, 6.5rem);
  padding-bottom: 0.55rem;
  font-size: 0.66rem;
  letter-spacing: 0.055em;
}

.rail-label b {
  color: var(--blue);
}

.platform-rail {
  display: grid;
  grid-template-columns: repeat(var(--platform-count, 6), minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border: 2px solid var(--line);
  list-style: none;
}

.platform-rail li {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.platform-rail li:last-child {
  border-right: 0;
}

.platform-rail a {
  display: flex;
  min-height: 5.35rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.7rem 0.62rem;
  background: var(--paper-bright);
  transition:
    background-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.platform-rail a:hover {
  background: var(--signal);
  transform: translateY(-0.25rem);
}

.platform-rail a[aria-current="page"] {
  background: var(--blue);
  color: var(--paper-bright);
}

.platform-rail a[aria-current="page"] strong {
  font-weight: 950;
}

.platform-rail span {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 800;
}

.platform-rail strong {
  overflow: hidden;
  font-size: clamp(0.76rem, 1.05vw, 0.95rem);
  font-weight: 850;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-panel {
  grid-column: 8 / -1;
  min-width: 0;
  align-self: start;
  margin-top: clamp(4rem, 7vw, 8.25rem);
  border: 3px solid var(--line);
  background: var(--paper-bright);
  box-shadow: 0.75rem 0.75rem 0 var(--ink);
  animation: panel-enter 620ms 100ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.panel-register {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.75rem clamp(1rem, 2vw, 1.5rem);
  border-bottom: 3px solid var(--line);
  background: var(--blue);
  color: var(--paper-bright);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.job-id {
  margin: 0;
}

.panel-register > span {
  padding: 0.3rem 0.45rem;
  background: var(--signal);
  color: var(--ink);
}

.panel-body {
  padding: clamp(1.3rem, 3vw, 2.5rem);
}

.panel-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  margin-bottom: clamp(2rem, 4vw, 3.4rem);
}

.panel-heading > span {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--signal);
  font-family: var(--mono);
  font-weight: 900;
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3.6rem);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
}

#parse-form {
  margin: 0;
}

.panel-body > #parse-form > label {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.055em;
}

.input-frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  border: 3px solid var(--line);
  border-radius: 4px;
  background: var(--paper-bright);
  overflow: hidden;
  transition: box-shadow 140ms ease;
}

.input-frame:focus-within {
  box-shadow: 0 0 0 4px var(--signal);
}

.input-frame > span {
  display: grid;
  min-width: 3.8rem;
  place-items: center;
  border-right: 2px solid var(--line);
  background: var(--ink);
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
}

.input-frame input {
  width: 100%;
  min-width: 0;
  min-height: 4.15rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 0 3px 3px 0;
  background: transparent;
  font-family: var(--mono);
  font-size: clamp(0.88rem, 1.35vw, 1rem);
}

.input-frame input::placeholder {
  color: #6f6c63;
  opacity: 1;
}

.input-frame input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

.input-help {
  margin: 0.7rem 0 0;
  color: #5a5851;
  font-size: 0.66rem;
  letter-spacing: 0.025em;
}

.command-actions {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.command-actions button {
  min-height: 3.4rem;
  padding: 0.75rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: var(--paper-bright);
  font-family: var(--mono);
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.025em;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.command-actions button:hover {
  background: var(--signal);
  box-shadow: 0.23rem 0.23rem 0 var(--ink);
  transform: translate(-0.12rem, -0.12rem);
}

.command-actions .primary-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 1rem;
  background: var(--blue);
  color: var(--paper-bright);
}

.command-actions .primary-command:hover {
  background: var(--signal);
  color: var(--ink);
}

#clear-btn:hover {
  background: var(--alert);
}

.error-box {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--line);
  background: var(--alert);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.result-box {
  min-width: 0;
  min-height: 7.7rem;
  margin-top: 1.4rem;
  border: 2px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}

.result-register {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 2px solid var(--line);
  background: var(--ink);
  color: var(--paper-bright);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.result-register strong {
  color: var(--signal);
}

.result-box > p {
  margin: 0;
  padding: 1.2rem;
  color: #5a5851;
  font-size: 0.92rem;
}

#parse-form[data-state="loading"] .primary-command {
  background: var(--ink);
  color: var(--signal);
}

#parse-form[aria-busy="true"] .input-frame {
  box-shadow: inset 0 -0.35rem 0 var(--signal);
}

.result-box[data-state="loading"] {
  box-shadow: inset 0.45rem 0 0 var(--signal);
}

.result-loading {
  min-height: 6.2rem;
  display: flex;
  align-items: center;
  border-left: 0.7rem solid var(--signal);
  background: var(--paper-bright);
  font-family: var(--mono);
  font-weight: 750;
}

.result-job {
  min-width: 0;
  background: var(--paper-bright);
}

.job-register strong {
  white-space: nowrap;
}

.job-summary {
  display: grid;
  grid-template-columns: minmax(9.5rem, 0.8fr) minmax(0, 1.45fr);
  min-width: 0;
}

.job-preview {
  display: flex;
  min-width: 0;
  min-height: 15rem;
  flex-direction: column;
  margin: 0;
  border-right: 2px solid var(--line);
  background: var(--ink);
  color: var(--paper-bright);
}

.job-preview img,
.job-preview-empty {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  aspect-ratio: 4 / 5;
}

.job-preview img {
  display: block;
  object-fit: cover;
}

.job-preview-empty {
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.job-preview figcaption {
  padding: 0.55rem 0.65rem;
  border-top: 1px solid var(--paper);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.04em;
}

.job-details {
  min-width: 0;
  padding: clamp(1rem, 2.5vw, 1.6rem);
}

.job-kicker {
  margin: 0;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.055em;
}

.job-details h3 {
  margin: 0.7rem 0 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  font-weight: 950;
  letter-spacing: -0.045em;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.job-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.4rem 0 0;
  border: 2px solid var(--line);
}

.job-facts div {
  min-width: 0;
  padding: 0.6rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.job-facts div:nth-child(2n) {
  border-right: 0;
}

.job-facts div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.job-facts dt,
.job-facts dd {
  margin: 0;
}

.job-facts dt {
  color: #68655e;
  font-family: var(--mono);
  font-size: 0.56rem;
}

.job-facts dd {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.job-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}

.job-download,
.quality-action {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 0.7rem;
  border: 2px solid var(--line);
  border-radius: 1px;
  background: var(--paper-bright);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.job-download:hover,
.quality-action:hover {
  background: var(--signal);
  transform: translateY(-0.12rem);
}

.job-download-primary {
  background: var(--blue);
  color: var(--paper-bright);
}

.job-empty-note {
  grid-column: 1 / -1;
  margin: 0;
  color: #5a5851;
  font-family: var(--mono);
  font-size: 0.66rem;
}

.quality-output,
.image-output {
  min-width: 0;
  border-top: 3px solid var(--line);
}

.job-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  background: var(--signal);
}

.image-output .job-section-heading {
  background: var(--alert);
}

.job-section-heading h4,
.job-section-heading span {
  margin: 0;
}

.job-section-heading h4 {
  font-size: 1rem;
  font-weight: 950;
}

.job-section-heading span {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 850;
  white-space: nowrap;
}

.quality-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.quality-table {
  width: 100%;
  min-width: 31rem;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.65rem;
}

.quality-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

.quality-table th,
.quality-table td {
  padding: 0.65rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.quality-table th:last-child,
.quality-table td:last-child {
  border-right: 0;
}

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

.quality-table th {
  background: var(--ink);
  color: var(--paper-bright);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}

.quality-label {
  font-weight: 900;
}

.quality-action {
  width: 100%;
  padding: 0.45rem 0.55rem;
  white-space: nowrap;
}

.quality-empty {
  color: #5a5851;
  text-align: center !important;
}

.image-queue {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.image-queue li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.image-queue li:last-child {
  border-bottom: 0;
}

.image-index {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  background: var(--ink);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 900;
}

.image-queue strong {
  min-width: 0;
  font-size: 0.82rem;
}

.image-download {
  padding-block: 0.5rem;
  white-space: nowrap;
}

.panel-footnote {
  display: flex;
  gap: 0.65rem;
  margin: 1.2rem 0 0;
  color: #5a5851;
  font-size: 0.63rem;
  letter-spacing: 0.01em;
}

.panel-footnote span {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 900;
}

.platform-workstation .dispatch-copy h1,
.batch-workstation .dispatch-copy h1 {
  max-width: 16ch;
  font-size: clamp(2.5rem, 4.6vw, 5.2rem);
  letter-spacing: -0.05em;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.batch-form {
  margin: 0;
}

.batch-form > label {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.055em;
}

#batch-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 13rem;
  padding: 0.9rem 1rem;
  border: 3px solid var(--line);
  border-radius: 4px;
  background: var(--paper-bright);
  font-family: var(--mono);
  font-size: clamp(0.88rem, 1.35vw, 1rem);
  line-height: 1.65;
  resize: vertical;
}

#batch-input:focus {
  box-shadow: 0 0 0 4px var(--signal);
}

#batch-input::placeholder {
  color: #6f6c63;
  opacity: 1;
}

.batch-progress {
  margin: 1.2rem 0 0;
  padding: 0.9rem 1rem;
  border: 2px solid var(--line);
  background: var(--ink);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}

.batch-ledger-wrap {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: clamp(2rem, 5vw, 5rem);
  border: 3px solid var(--line);
  background: var(--paper-bright);
  box-shadow: 0.75rem 0.75rem 0 var(--signal);
}

.batch-ledger-wrap > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 2px solid var(--line);
  background: var(--blue);
  color: var(--paper-bright);
}

.batch-ledger-wrap > header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  font-weight: 950;
  letter-spacing: -0.04em;
}

.batch-ledger-wrap > header span {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  color: var(--signal);
}

.batch-ledger-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

#batch-ledger {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.66rem;
}

#batch-ledger caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

#batch-ledger th,
#batch-ledger td {
  padding: 0.65rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

#batch-ledger th:last-child,
#batch-ledger td:last-child {
  border-right: 0;
}

#batch-ledger tbody tr:last-child td {
  border-bottom: 0;
}

#batch-ledger th {
  background: var(--ink);
  color: var(--paper-bright);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.batch-number {
  width: 4rem;
  font-weight: 900;
}

.batch-url {
  max-width: 22rem;
  overflow-wrap: anywhere;
}

.batch-status {
  white-space: nowrap;
}

.batch-chip {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--ink);
  color: var(--paper-bright);
  font-size: 0.62rem;
  font-weight: 900;
}

.batch-chip[data-status="success"] {
  background: var(--signal);
  color: var(--ink);
}

.batch-chip[data-status="fail"] {
  background: var(--alert);
  color: var(--ink);
}

.batch-title {
  max-width: 24rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.batch-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  white-space: nowrap;
}

.batch-actions .batch-action {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.55rem;
  border: 2px solid var(--line);
  border-radius: 1px;
  background: var(--paper-bright);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.batch-actions .batch-action:hover {
  background: var(--signal);
  transform: translateY(-0.12rem);
}

.process-strip {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(210px, 2.5fr) minmax(0, 9.5fr);
  margin-top: clamp(2rem, 5vw, 5rem);
  border: 3px solid var(--line);
  background: var(--paper-bright);
}

.process-strip > header {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2.2vw, 2rem);
  background: var(--blue);
  color: var(--paper-bright);
}

.process-strip > header .eyebrow {
  color: var(--signal);
}

.process-strip h2 {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3.8rem);
  font-weight: 950;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.process-strip ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-strip li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 1rem;
  min-width: 0;
  min-height: 10rem;
  padding: clamp(1rem, 2.2vw, 2rem);
  border-left: 2px solid var(--line);
}

.process-strip li > span {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
}

.process-strip li > div {
  align-self: start;
}

.process-strip li strong,
.process-strip li small {
  display: block;
}

.process-strip li strong {
  font-size: clamp(1.1rem, 1.8vw, 1.55rem);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.process-strip li small,
.process-strip li > b {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.process-strip li small {
  margin-top: 0.3rem;
  color: #67645c;
}

.process-strip li > b {
  grid-column: 1 / -1;
  align-self: end;
  justify-self: end;
  padding: 0.3rem 0.45rem;
  background: var(--signal);
}

.process-strip li:last-child > b {
  background: var(--alert);
}

.site-footer {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: clamp(4rem, 8vw, 9rem);
  border-top: 4px solid var(--line);
  background: var(--ink);
  color: var(--paper-bright);
}

.footer-brand,
.site-footer nav,
.footer-note {
  min-width: 0;
  padding: clamp(1.5rem, 3.2vw, 3.2rem) var(--page-gutter);
}

.footer-brand {
  display: flex;
  grid-column: 1 / span 4;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  border-right: 2px solid var(--paper);
  background: var(--blue);
}

.footer-brand span {
  color: var(--signal);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.055em;
}

.footer-brand strong {
  font-size: clamp(2.8rem, 5vw, 5.5rem);
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.site-footer nav {
  display: grid;
  grid-column: 5 / span 5;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 0;
  border-right: 2px solid var(--paper);
}

.site-footer nav a {
  padding: 0.8rem 0.6rem;
  border-bottom: 1px solid #77746b;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 750;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.site-footer nav a:hover {
  background: var(--signal);
  color: var(--ink);
}

.footer-note {
  display: flex;
  grid-column: 10 / -1;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.65;
}

.footer-note p {
  margin: 0;
  color: #c8c4b9;
}

@keyframes desk-enter {
  from {
    opacity: 0;
    transform: translateY(1.2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translate(1.2rem, 1.2rem);
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes signal-pulse {
  50% {
    background: var(--paper-bright);
  }
}

/* ---- legal documents: sticky index + anchored body ---- */

.legal-page {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  width: min(100%, var(--max-width));
  min-height: 62vh;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 7rem) var(--page-gutter);
}

.legal-header {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 1rem;
  border-top: 0.8rem solid var(--blue);
  animation: desk-enter 520ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.legal-header h1 {
  max-width: 13ch;
  margin: clamp(1.5rem, 3vw, 3.5rem) 0 0;
  font-size: clamp(3.6rem, 7vw, 8rem);
  font-weight: 950;
  letter-spacing: -0.07em;
  line-height: 0.91;
  text-wrap: balance;
}

.legal-deck {
  max-width: 42rem;
  margin: clamp(1.5rem, 3vw, 3rem) 0 0;
  padding-left: 1.2rem;
  border-left: 0.7rem solid var(--signal);
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  font-weight: 600;
  line-height: 1.55;
}

.legal-index {
  grid-column: 1 / span 3;
  align-self: start;
  position: sticky;
  top: 1rem;
  min-width: 0;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 3px solid var(--line);
  background: var(--paper-bright);
  box-shadow: 0.65rem 0.65rem 0 var(--signal);
  animation: panel-enter 620ms 100ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.legal-index > span {
  display: block;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--line);
  background: var(--ink);
  color: var(--paper-bright);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.045em;
}

.legal-index ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-index li {
  border-bottom: 1px solid var(--line);
}

.legal-index li:last-child {
  border-bottom: 0;
}

.legal-index a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  font-weight: 750;
  line-height: 1.35;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.legal-index a:hover {
  background: var(--signal);
}

.legal-index a span {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: #68655e;
}

.legal-body {
  grid-column: 4 / -1;
  min-width: 0;
  border-top: 3px solid var(--line);
}

.legal-body section {
  padding: clamp(1.4rem, 3vw, 2.8rem) 0;
  border-bottom: 2px solid var(--line);
  scroll-margin-top: 1rem;
}

.legal-body h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(1.25rem, 2.2vw, 1.8rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.legal-body p {
  max-width: 60ch;
  margin: 0 0 0.85rem;
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.legal-body p:last-child {
  margin-bottom: 0;
}

.legal-note {
  max-width: 60ch;
  margin-top: 2rem !important;
  color: #68655e;
  font-size: 0.85rem !important;
}

/* ---- contact: single security feedback entry ---- */

.contact-page,
.feedback-page {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  width: min(100%, var(--max-width));
  min-height: 62vh;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 7rem) var(--page-gutter);
}

.contact-header,
.feedback-header {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 1rem;
  border-top: 0.8rem solid var(--blue);
  animation: desk-enter 520ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.contact-header h1,
.feedback-header h1 {
  max-width: 13ch;
  margin: clamp(1.5rem, 3vw, 3.5rem) 0 0;
  font-size: clamp(3.6rem, 7vw, 8rem);
  font-weight: 950;
  letter-spacing: -0.07em;
  line-height: 0.91;
  text-wrap: balance;
}

.contact-card,
.feedback-card {
  grid-column: 3 / span 8;
  min-width: 0;
  padding: clamp(1.8rem, 3.5vw, 3.2rem);
  border: 3px solid var(--line);
  background: var(--paper-bright);
  box-shadow: 0.65rem 0.65rem 0 var(--signal);
  animation: panel-enter 620ms 100ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.contact-card h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.contact-card p,
.feedback-card p {
  max-width: 56ch;
  margin: 0 0 1.2rem;
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.contact-entry,
.feedback-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 3.4rem;
  padding: 0.75rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: var(--alert);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.025em;
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.contact-entry:hover,
.feedback-link:hover {
  background: var(--signal);
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
  transform: translate(-0.12rem, -0.12rem);
}

.feedback-merged {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

  .topbar .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar > a:last-child {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar nav {
    grid-column: 1;
    grid-row: 2;
    border-top: 2px solid var(--line);
  }

  .system-state {
    grid-column: 2;
    grid-row: 2;
    border-top: 2px solid var(--line);
    border-right: 0;
  }

  .workstation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.25rem, 3vw, 2rem);
  }

  .dispatch-copy {
    grid-column: 1;
  }

  .dispatch-copy h1 {
    font-size: clamp(3.5rem, 7.2vw, 5.5rem);
  }

  .dispatch-lead {
    width: 92%;
    margin-left: 0;
  }

  .dispatch-status {
    width: 100%;
  }

  .rail-label {
    margin-top: 3.5rem;
  }

  .platform-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-rail li {
    border-bottom: 1px solid var(--line);
  }

  .platform-rail li:nth-child(2n) {
    border-right: 0;
  }

  .platform-rail li:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .platform-rail a {
    min-height: 4.6rem;
  }

  .command-panel {
    grid-column: 2;
    margin-top: 5rem;
  }

  .command-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-actions .primary-command {
    grid-column: 1 / -1;
  }

  .process-strip {
    grid-column: 1 / -1;
    grid-template-columns: minmax(180px, 1fr) minmax(0, 3fr);
  }

  .process-strip li {
    grid-template-columns: 1fr;
  }

  .process-strip li > b {
    grid-column: 1;
    justify-self: start;
  }

  .legal-page,
  .contact-page,
  .feedback-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-index {
    grid-column: 1;
  }

  .legal-body {
    grid-column: 2;
  }

  .contact-card,
  .feedback-card {
    grid-column: 1 / -1;
  }

  .footer-brand {
    grid-column: 1 / span 5;
  }

  .site-footer nav {
    grid-column: 6 / span 7;
    border-right: 0;
  }

  .footer-note {
    grid-column: 1 / -1;
    flex-direction: row;
    border-top: 2px solid var(--paper);
  }
}

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

  .topbar .brand {
    padding-left: 1rem;
    border-right: 2px solid var(--line);
  }

  .topbar > a:last-child {
    padding-inline: 0.85rem;
  }

  .topbar nav {
    grid-column: 1 / -1;
    grid-row: 2;
    border-right: 0;
  }

  .system-state {
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: 2.7rem;
  }

  .workstation {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding: 2.7rem 1rem 0;
  }

  .workstation::before {
    right: 1rem;
    height: 0.55rem;
  }

  .dispatch-copy,
  .command-panel,
  .process-strip {
    grid-column: 1;
  }

  .dispatch-copy h1 {
    font-size: clamp(2.65rem, 13.8vw, 5.5rem);
    letter-spacing: -0.07em;
  }

  .dispatch-index {
    margin-top: 1rem;
  }

  .dispatch-lead {
    width: 100%;
    margin-top: 2.5rem;
  }

  .dispatch-status > span,
  .dispatch-status > strong {
    padding-inline: 0.65rem;
  }

  .rail-label {
    margin-top: 3rem;
  }

  .command-panel {
    margin: 0 0.65rem 0 0;
    box-shadow: 0.55rem 0.55rem 0 var(--ink);
  }

  .panel-heading h2 {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
  }

  .panel-footnote {
    align-items: flex-start;
    flex-direction: column;
  }

  .job-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-preview {
    min-height: 0;
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .job-preview img,
  .job-preview-empty {
    max-height: 24rem;
    aspect-ratio: 16 / 10;
  }

  .process-strip {
    display: block;
    margin-top: 1rem;
  }

  .process-strip > header {
    min-height: 9rem;
  }

  .process-strip ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .process-strip li {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    min-height: 0;
    align-items: center;
    border-top: 2px solid var(--line);
    border-left: 0;
  }

  .process-strip li:first-child {
    border-top: 0;
  }

  .process-strip li > b {
    grid-column: 3;
    justify-self: end;
  }

  .legal-page,
  .contact-page,
  .feedback-page {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding: 2.7rem 1rem 0;
  }

  .legal-header,
  .contact-header,
  .feedback-header {
    grid-column: 1;
  }

  .legal-header h1,
  .contact-header h1,
  .feedback-header h1 {
    font-size: clamp(2.65rem, 13.8vw, 5.5rem);
  }

  .legal-index {
    grid-column: 1;
    position: static;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }

  .legal-index ol {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .legal-index li {
    flex: 0 0 auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .legal-index li:last-child {
    border-right: 0;
  }

  .legal-index a {
    grid-template-columns: auto minmax(0, 1fr);
    white-space: nowrap;
  }

  .legal-body {
    grid-column: 1;
    border-top: 3px solid var(--line);
  }

  .contact-card,
  .feedback-card {
    grid-column: 1;
  }

  .site-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-brand,
  .site-footer nav,
  .footer-note {
    grid-column: 1;
    padding: 1.6rem 1rem;
    border-right: 0;
  }

  .footer-brand {
    min-height: 13rem;
    border-bottom: 2px solid var(--paper);
  }

  .site-footer nav {
    border-bottom: 2px solid var(--paper);
  }

  .footer-note {
    flex-direction: column;
    border-top: 0;
  }
}

@media (max-width: 430px) {
  .topbar .brand {
    gap: 0.55rem;
    font-size: 1.75rem;
  }

  .topbar .brand span {
    padding-inline: 0.35rem;
    font-size: 0.58rem;
  }

  .platform-rail strong {
    font-size: 0.74rem;
  }

  .dispatch-status {
    display: block;
  }

  .dispatch-status > strong {
    border-top: 2px solid var(--line);
    border-left: 0;
  }

  .command-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .command-actions .primary-command {
    grid-column: 1;
  }

  .job-primary-actions,
  .job-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-facts div,
  .job-facts div:nth-child(2n),
  .job-facts div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .job-facts div:last-child {
    border-bottom: 0;
  }

  .image-queue li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .image-download {
    grid-column: 1 / -1;
  }

  .process-strip li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .process-strip li > b {
    display: none;
  }

  .contact-entry,
  .feedback-link {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
