@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --room: #15130f;
  --room-2: #1b1813;
  --room-3: #221e18;
  --paper: #f3e9d6;
  --paper-bright: #faf3e5;
  --paper-dim: #e3d5ba;
  --ink: #191710;
  --ink-soft: #514a3b;
  --cream: #f7efe0;
  --muted: #bcb2a0;
  --muted-dark: #8e8474;
  --line: #3d3830;
  --line-strong: #575043;
  --orange: #ef5a16;
  --orange-deep: #b83d06;
  --brass: #c49a4a;
  --focus: #ffd166;
  --shadow: #080705;

  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body.dialog-open {
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 0;
  background:
    radial-gradient(1100px 520px at 78% -10%, rgba(239, 90, 22, 0.09), transparent 62%),
    radial-gradient(900px 600px at -10% 40%, rgba(196, 154, 74, 0.06), transparent 60%),
    var(--room);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

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

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-180%);
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
}
.skip-link:focus {
  transform: translateY(0);
}

.hazard-tape {
  height: 9px;
  background: repeating-linear-gradient(
    135deg,
    var(--orange) 0 16px,
    #1b1813 16px 32px
  );
  border-bottom: 2px solid #060504;
}

/* ---------- Top bar ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #1c1914, #15130f);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 26px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.logo-mark {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  background: var(--orange);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 #060504;
  transform: rotate(-3deg);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 3.4vw, 3.2rem);
  line-height: 0.88;
  letter-spacing: 0.055em;
  color: var(--cream);
  margin-bottom: 7px;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
}

.micro-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.line-readout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 26px;
  border-right: 1px solid var(--line);
}

.line-readout-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.line-readout-text strong {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 400;
  color: var(--cream);
  white-space: nowrap;
}

.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9fd07f;
  box-shadow: 0 0 0 3px rgba(159, 208, 127, 0.16);
  animation: live-pulse 2.8s ease-in-out infinite;
}
.live-dot.small {
  width: 7px;
  height: 7px;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.pressure-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pressure-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pressure-copy strong {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--orange);
}

.pressure-meter {
  display: flex;
  gap: 3px;
  height: 15px;
}

.pressure-meter span {
  width: 9px;
  height: 100%;
  background: #37322a;
  border: 1px solid #4a4438;
}

.pressure-meter span.filled {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 8px rgba(239, 90, 22, 0.35);
}

.shift-ticket {
  margin-left: auto;
  align-self: stretch;
  padding: 5px 0 5px 24px;
  border-left: 1px dashed var(--line-strong);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream);
}

.ticket-serial {
  color: var(--orange);
  font-size: 10.5px;
  letter-spacing: 0.12em;
}

/* ---------- Control bar ---------- */

.control-bar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > label,
.route-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-field {
  flex: 0 1 400px;
}

.input-shell {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--orange);
  pointer-events: none;
}

#search {
  width: 100%;
  height: 50px;
  background: #0d0b08;
  border: 2px solid #6a6252;
  border-radius: 0;
  color: var(--paper);
  padding: 0 16px 0 46px;
  font-size: 16px;
  transition: border-color 160ms ease, background-color 160ms ease;
}

#search::placeholder {
  color: #938a7b;
  opacity: 1;
}

#search:hover,
#search:focus {
  border-color: var(--orange);
  background: #100d09;
}

.filter-field {
  flex: 0 0 250px;
}

.select-shell {
  position: relative;
}

.select-shell::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

#filter,
#status-control {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 50px;
  background: #0d0b08;
  border: 2px solid #6a6252;
  border-radius: 0;
  color: var(--paper);
  padding: 0 44px 0 15px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: border-color 160ms ease;
}

#filter:hover,
#filter:focus,
#status-control:hover,
#status-control:focus {
  border-color: var(--orange);
}

.reset-button {
  height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  background: transparent;
  color: var(--cream);
  border: 2px solid #756b59;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.reset-button:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(239, 90, 22, 0.05);
}

.reset-button:active:not(:disabled) {
  transform: translateY(1px);
}

.reset-button:disabled {
  opacity: 0.42;
  border-style: dashed;
}

.result-readout {
  margin-left: auto;
  padding-bottom: 15px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Workspace / board ---------- */

.workspace {
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 32px 48px;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.station-board {
  position: sticky;
  top: 22px;
  background: linear-gradient(180deg, #1d1a15, #17140f);
  border: 1px solid var(--line);
  padding: 16px;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.board-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #b6d9a0;
}

.board-head + h2 {
  margin-top: 14px;
}

.station-board h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--cream);
}

.board-sub {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.stops {
  list-style: none;
  padding: 14px 0 6px;
  position: relative;
}

.stops::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 40px;
  bottom: 40px;
  width: 2px;
  background: repeating-linear-gradient(180deg, #4c463a 0 5px, transparent 5px 10px);
}

.stops li {
  position: relative;
}

.stop {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 4px;
  background: transparent;
  border: 2px solid transparent;
  color: var(--paper);
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.stop:hover {
  background: #26221b;
}

.stop[aria-pressed="true"] {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 3px 3px 0 #060504;
}

.stop-marker {
  width: 34px;
  height: 34px;
  margin-left: 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--st-fill, #777);
  background: #17140f;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.stop[aria-pressed="true"] .stop-marker {
  background: var(--st-fill);
  color: var(--st-ink);
  border-color: var(--ink);
}

.stop-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.stop-name {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
}

.stop-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.stop[aria-pressed="true"] .stop-sub {
  color: var(--ink-soft);
}

.stop-count {
  font-family: var(--font-mono);
  font-size: 12px;
  min-width: 26px;
  padding: 2px 4px;
  text-align: center;
  border: 1px solid currentColor;
  opacity: 0.9;
}

.stop[aria-pressed="true"] .stop-count {
  background: var(--st-fill);
  border-color: var(--ink);
  color: var(--st-ink);
  opacity: 1;
}

.board-dispatch {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.board-dispatch p {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: #d7cdbb;
}

.board-note {
  margin-top: 14px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted-dark);
}

/* Station palette (marker + lane + detail) */
.st-todo {
  --st-fill: #c99a3c;
  --st-ink: #191710;
  --st-text: #8a6414;
  --st-soft: #efe0bd;
}
.st-in-progress {
  --st-fill: #2f6f66;
  --st-ink: #f7efe0;
  --st-text: #2b645c;
  --st-soft: #d8e7df;
}
.st-blocked {
  --st-fill: #a83a20;
  --st-ink: #fbefdc;
  --st-text: #96311a;
  --st-soft: #f2d8ca;
}
.st-done {
  --st-fill: #4f7045;
  --st-ink: #f7efe0;
  --st-text: #45613c;
  --st-soft: #dce8d3;
}

.stop[data-station="todo"] { --st-fill: #c99a3c; --st-ink: #191710; }
.stop[data-station="in-progress"] { --st-fill: #2f6f66; --st-ink: #f7efe0; }
.stop[data-station="blocked"] { --st-fill: #a83a20; --st-ink: #fbefdc; }
.stop[data-station="done"] { --st-fill: #4f7045; --st-ink: #f7efe0; }

/* ---------- Rack ---------- */

.rack {
  min-width: 0;
  scroll-margin-top: 24px;
}

.rack:focus {
  outline: none;
  box-shadow: none;
}

.rack-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
}

.rack-head h2 {
  margin-top: 3px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--cream);
}

.rack-note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: right;
  padding-bottom: 2px;
}

.lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.lane {
  min-width: 0;
}

.lane-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 64px;
  padding: 9px 11px;
  margin-bottom: 13px;
  background: var(--st-fill);
  color: var(--st-ink);
  border: 2px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--shadow);
}

.lane-num {
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 0.9;
  opacity: 0.72;
  padding-right: 8px;
  border-right: 1.5px solid currentColor;
}

.lane-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lane-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.lane-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.9;
}

.lane-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  border: 1.5px solid currentColor;
}

.lane-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 110px;
  padding: 8px 6px 12px;
  border-left: 1px solid #2f2a22;
  border-right: 1px solid #2f2a22;
  background-image: radial-gradient(rgba(239, 90, 22, 0.15) 1px, transparent 1.4px);
  background-size: 16px 16px;
  background-position: 8px 8px;
}

.canister {
  min-width: 0;
}

.canister-open {
  position: relative;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 13px 13px 12px 21px;
  text-align: left;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.22), transparent 55%),
    var(--paper);
  color: var(--ink);
  border: 2px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.canister-open::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 7px;
  background-image: radial-gradient(circle, rgba(25, 23, 16, 0.5) 0 1.7px, transparent 2.1px);
  background-size: 7px 14px;
  background-repeat: repeat-y;
  background-position: center 2px;
  opacity: 0.6;
}

.canister-open:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.3), transparent 55%),
    var(--paper-bright);
}

.canister-open:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.canister-open:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus), 4px 4px 0 var(--shadow);
}

.empty-reset:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus), 4px 4px 0 var(--shadow);
}

.stop[aria-pressed="true"]:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus), 3px 3px 0 #060504;
}

.canister-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.canister-code {
  color: var(--orange-deep);
  font-weight: 600;
}

.canister-eta {
  white-space: nowrap;
}

.canister-title {
  display: block;
  margin: 7px 0 9px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow-wrap: break-word;
  hyphens: auto;
}

.canister-project {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(25, 23, 16, 0.24);
}

.canister-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 9px;
  min-width: 0;
}

.avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.canister-assignee {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.prio {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 5px;
  border: 1.5px solid var(--ink);
}

.prio-high {
  background: var(--orange);
  color: var(--ink);
  border-color: var(--shadow);
}

.prio-medium {
  background: var(--paper-dim);
  color: var(--ink);
}

.prio-low {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--ink-soft);
}

.canister-cta {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--orange-deep);
  margin-left: 2px;
}

.lane-empty {
  padding: 20px 10px;
  border: 1.5px dashed #4a4438;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
}

.canister.arrived .canister-open {
  animation: canister-arrive 460ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

@keyframes canister-arrive {
  0% { transform: translateY(-14px) rotate(-1.4deg); opacity: 0.2; }
  60% { transform: translateY(2px) rotate(0.4deg); opacity: 1; }
  100% { transform: translateY(0) rotate(0); opacity: 1; }
}

/* ---------- Empty state ---------- */

.empty-state {
  margin: 10px 0 0;
  padding: 42px 24px 44px;
  border: 2px dashed #575043;
  background:
    radial-gradient(420px 220px at 50% 0%, rgba(239, 90, 22, 0.08), transparent 70%),
    #1b1813;
  text-align: center;
}

.empty-tube {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.empty-state h3 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--cream);
}

.empty-state > p:not(.eyebrow) {
  margin: 7px auto 20px;
  max-width: 42ch;
  font-size: 14px;
  color: var(--muted);
}

.empty-reset {
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  background: var(--orange);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.empty-reset:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow);
}

.empty-reset:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

/* ---------- Footer ---------- */

.site-foot {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 32px 34px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted-dark);
}

.site-foot strong {
  color: var(--muted);
  letter-spacing: 0.12em;
}

.foot-serial {
  text-align: right;
  white-space: nowrap;
}

/* ---------- Detail dialog ---------- */

#detail {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  padding: 0;
  width: min(640px, 100vw);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

#detail:not([open]) {
  display: none;
}

#detail::backdrop {
  background: rgba(7, 6, 4, 0.68);
  backdrop-filter: blur(2px);
}

.detail-shell {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(90deg, rgba(25, 23, 16, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 100%;
  border-left: 5px solid var(--orange);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.48);
  animation: drawer-in 260ms cubic-bezier(0.22, 0.7, 0.2, 1) both;
}

@keyframes drawer-in {
  from { transform: translateX(34px); opacity: 0.4; }
  to { transform: translateX(0); opacity: 1; }
}

.detail-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 10px 18px 10px 24px;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--orange);
}

.detail-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d8cebc;
}

.close-detail {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 2px solid #756b59;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.close-detail:hover {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--ink);
}

.detail-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 30px 36px;
  scrollbar-color: var(--ink-soft) var(--paper-dim);
}

.detail-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.station-stamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 3px double var(--st-text, var(--ink));
  color: var(--st-text, var(--ink));
  background: var(--st-soft, transparent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-1.6deg);
}

.detail-route-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  color: var(--ink-soft);
}

.detail-title {
  margin: 18px 0 20px;
  font-size: clamp(1.65rem, 4.6vw, 2.35rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  overflow-wrap: break-word;
  hyphens: auto;
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid rgba(25, 23, 16, 0.28);
}

.detail-meta > div {
  padding: 10px 12px 11px 0;
  border-bottom: 1px solid rgba(25, 23, 16, 0.16);
}

.detail-meta > div:nth-child(even) {
  padding-left: 14px;
  border-left: 1px solid rgba(25, 23, 16, 0.16);
}

.detail-meta > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.detail-meta dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 3px;
}

.detail-meta dd {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: break-word;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.3);
}

.manifest {
  margin-top: 26px;
}

.section-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--ink);
}

.section-rule h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink);
}

.section-rule > span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.manifest-body {
  padding: 16px 0 2px;
  max-width: 58ch;
}

.manifest-body p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.62;
  color: #2a271f;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.manifest-body p:first-child::first-letter {
  font-size: 2.4em;
  font-weight: 600;
  float: left;
  line-height: 0.86;
  padding: 4px 8px 0 0;
  color: var(--orange-deep);
}

.route-box {
  margin-top: 28px;
  padding: 18px 18px 20px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--shadow);
  box-shadow: 5px 5px 0 var(--orange);
}

.route-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.route-box h3 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--cream);
}

.route-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #b6d9a0;
}

.route-help {
  margin: 8px 0 15px;
  font-size: 13px;
  line-height: 1.5;
  color: #c8bfae;
  max-width: 52ch;
}

.route-label {
  display: block;
  margin-bottom: 6px;
  color: #d8cebc;
}

.route-select-shell::after {
  border-color: var(--orange);
}

#status-control {
  height: 52px;
  border-color: #6b6252;
  background: #0d0b08;
  color: var(--paper);
  font-size: 14.5px;
}

.route-feedback {
  margin-top: 13px;
  min-height: 38px;
}

#status-message {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: #d7cdbb;
  max-width: 56ch;
}

#status-message.strong {
  color: #ffd166;
}

.route-view {
  margin-top: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--orange);
  background: transparent;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 150ms ease, color 150ms ease;
}

.route-view:hover {
  background: var(--orange);
  color: var(--ink);
}

.detail-foot {
  margin-top: 26px;
  padding-top: 10px;
  border-top: 1px dashed rgba(25, 23, 16, 0.35);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.stamp-flash {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(640px, 100vw);
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 20;
}

.stamp-flash span {
  opacity: 0;
  transform: rotate(-9deg) scale(1.5);
  padding: 10px 22px;
  border: 5px double var(--orange);
  background: rgba(243, 233, 214, 0.94);
  color: var(--orange-deep);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.stamp-flash.show span {
  animation: stamp-hit 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes stamp-hit {
  0% { opacity: 0; transform: rotate(-9deg) scale(1.5); }
  18% { opacity: 1; transform: rotate(-4deg) scale(0.94); }
  30% { transform: rotate(-4deg) scale(1); }
  75% { opacity: 1; transform: rotate(-4deg) scale(1); }
  100% { opacity: 0; transform: rotate(-4deg) scale(1); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1240px) {
  .lanes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
  }
  .workspace {
    grid-template-columns: 224px minmax(0, 1fr);
  }
  .line-readout {
    display: none;
  }
  .shift-ticket {
    margin-left: 0;
  }
}

@media (max-width: 1020px) {
  .shift-ticket {
    display: none;
  }
  .pressure-block {
    margin-left: auto;
  }
  .topbar-inner {
    gap: 18px;
  }
  .control-bar {
    flex-wrap: wrap;
  }
  .search-field {
    flex: 1 1 320px;
  }
  .result-readout {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .topbar-inner {
    padding: 13px 18px;
    gap: 14px;
  }
  .brand {
    border-right: 0;
    padding-right: 0;
  }
  .logo-mark {
    width: 54px;
    height: 54px;
  }
  .logo-mark svg {
    width: 38px;
    height: 38px;
  }
  .brand-text h1 {
    font-size: 2.55rem;
    margin-bottom: 5px;
  }
  .brand-tag {
    font-size: 9.5px;
    letter-spacing: 0.12em;
  }
  .pressure-copy .micro-label {
    font-size: 9px;
  }
  .pressure-meter span {
    width: 5px;
  }
  .pressure-meter {
    gap: 2px;
  }

  .control-bar {
    padding: 14px 18px;
    gap: 12px;
  }
  .search-field {
    flex: 1 1 100%;
  }
  .filter-field {
    flex: 1 1 170px;
  }
  .reset-button {
    flex: 0 0 auto;
    padding: 0 13px;
  }
  .reset-button span {
    display: none;
  }
  .reset-button {
    width: 50px;
    justify-content: center;
    padding: 0;
  }
  .result-readout {
    flex: 1 1 100%;
    padding-bottom: 0;
    font-size: 10.5px;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 16px 18px 38px;
  }

  .station-board {
    position: static;
    padding: 14px;
  }
  .board-sub {
    font-size: 12px;
  }
  .stops {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 0 4px;
  }
  .stops::before {
    display: none;
  }
  .stop {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 6px;
    border-color: #302b23;
    min-height: 56px;
  }
  .stop-marker {
    width: 28px;
    height: 28px;
    margin-left: 0;
    font-size: 9.5px;
  }
  .stop-name {
    font-size: 13.5px;
  }
  .stop-sub {
    font-size: 9.5px;
  }
  #filter,
  #status-control {
    font-size: 16px;
  }
  .stop-count {
    font-size: 10.5px;
    min-width: 23px;
    padding: 1px 3px;
  }
  .board-dispatch {
    margin-top: 12px;
    padding-top: 11px;
  }
  .board-note {
    display: none;
  }

  .rack-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
  }
  .rack-note {
    text-align: left;
    padding-bottom: 0;
  }
  .lanes {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .lane-head {
    min-height: 58px;
    margin-bottom: 10px;
  }
  .lane-num {
    font-size: 24px;
  }
  .lane-name {
    font-size: 17px;
  }
  .lane-body {
    padding: 8px 8px 12px;
  }
  .canister-title {
    font-size: 17px;
  }
  .site-foot {
    flex-direction: column;
    padding: 18px 18px 30px;
    gap: 8px;
  }
  .foot-serial {
    text-align: left;
  }

  #detail {
    width: 100vw;
    border-left: 0;
  }
  .detail-shell {
    border-left: 0;
    animation: none;
  }
  .detail-top {
    padding: 9px 12px 9px 18px;
    min-height: 60px;
  }
  .detail-scroll {
    padding: 20px 18px 32px;
  }
  .detail-title {
    margin: 15px 0 17px;
  }
  .detail-meta > div {
    padding-right: 8px;
  }
  .detail-meta dd {
    font-size: 13.5px;
  }
  .manifest-body p {
    font-size: 15.5px;
  }
  .route-box {
    padding: 16px 14px 18px;
  }
}

@media (max-width: 600px) {
  .station-board {
    padding: 12px;
  }
  .board-head {
    display: none;
  }
  .station-board h2 {
    font-size: 19px;
    letter-spacing: 0.06em;
  }
  .board-sub {
    display: none;
  }
  .stops {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 0 0;
  }
  .stop {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-rows: 24px auto;
    gap: 3px 4px;
    align-items: center;
    padding: 7px 6px;
    min-height: 62px;
  }
  .stop-marker {
    grid-column: 1;
    grid-row: 1;
    width: 24px;
    height: 24px;
    font-size: 8.5px;
  }
  .stop-copy {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .stop-name {
    font-size: 12.5px;
    line-height: 1.15;
  }
  .stop-sub {
    display: none;
  }
  .stop-count {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    min-width: 21px;
    padding: 0 2px;
    font-size: 10px;
  }
  .board-dispatch,
  .board-note {
    display: none;
  }
  .rack-head {
    padding-bottom: 10px;
  }
  .section-rule > span {
    display: none;
  }
}

@media (max-width: 430px) {
  .brand-text h1 {
    font-size: 2.2rem;
  }
  .brand-tag {
    white-space: normal;
    line-height: 1.35;
  }
  .pressure-copy .micro-label {
    display: none;
  }
  .pressure-block {
    gap: 4px;
  }
  .pressure-copy strong {
    font-size: 18px;
  }
}

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