/* ---------------------------------------------------------------
   PATCH — team switchboard
   A dark exchange panel, cream call slips, and status patched by desk.
   --------------------------------------------------------------- */

@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: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-weight: 100 900;
  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 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #12110d;
  --bg-2: #18160f;
  --panel: #1f1c15;
  --panel-2: #262218;
  --panel-3: #2d281c;
  --line: #393326;
  --line-strong: #514834;
  --ink: #f4eddd;
  --muted: #b7ac94;
  --muted-2: #8f8672;
  --accent: #f3a83b;
  --accent-soft: #ffc46d;
  --accent-ink: #1b1406;
  --accent-deep: #8a4b00;

  --paper: #f2e9d7;
  --paper-2: #e9ddc7;
  --paper-3: #fbf6ea;
  --paper-ink: #221e16;
  --paper-muted: #675d4c;
  --paper-line: #cbbca1;

  --todo: #d4cab5;
  --in-progress: #f3a83b;
  --blocked: #ff8766;
  --done: #8bd9a9;

  --todo-paper: #665d4b;
  --in-progress-paper: #8a5300;
  --blocked-paper: #a63318;
  --done-paper: #276a44;

  --status: var(--todo);
  --radius: 5px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-card: 0 8px 18px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(1000px 460px at 68% -8%, rgba(243, 168, 59, 0.11), transparent 68%),
    radial-gradient(700px 500px at 8% 104%, rgba(139, 217, 169, 0.045), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255, 255, 255, 0.013) 39px 40px),
    var(--bg);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

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

button {
  cursor: pointer;
}

svg {
  display: block;
}

:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sheet :focus,
.sheet :focus-visible {
  outline-color: var(--accent-deep);
}

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

.skip-link {
  position: fixed;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-radius: 3px;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: translateY(0);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(230px, 460px) minmax(160px, 196px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(18, 17, 13, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(243, 168, 59, 0.15), transparent 68%),
    var(--bg-2);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.18);
}
.brand__mark svg {
  width: 30px;
  height: 30px;
}

.brand__name {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}
.brand__sub {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.field {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--muted);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.field > label {
  flex: none;
  padding: 0 11px;
  border-right: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(243, 168, 59, 0.24);
}

.field--search {
  min-width: 0;
}
.field--search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.field--search input::placeholder {
  color: var(--muted-2);
  opacity: 1;
}
.field--search input:focus {
  outline: none;
}
.field--search input::-webkit-search-cancel-button {
  filter: invert(0.8);
}

.field__key {
  margin-right: 10px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted-2);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: 16px;
}

.field--filter {
  min-width: 0;
}
.field--filter .select {
  flex: 1;
  min-width: 0;
}

.select {
  position: relative;
  display: flex;
  align-items: center;
}
.select select {
  width: 100%;
  min-width: 0;
  height: 44px;
  appearance: none;
  border: 0;
  border-radius: 0;
  padding: 0 28px 0 11px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.select select:focus {
  outline: none;
}
.select::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  color: var(--muted);
}
.select select option {
  background: var(--panel);
  color: var(--ink);
}

.topbar__status {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}

.lamp {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.lamp--open {
  background: var(--done);
  box-shadow: 0 0 0 3px rgba(139, 217, 169, 0.13), 0 0 9px rgba(139, 217, 169, 0.45);
}

/* ---------------------------------------------------------------
   Shell + rail
   --------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  align-items: start;
}

.rail {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
  padding: 20px 18px 30px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.plate {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 46%),
    var(--panel);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}
.plate::before,
.plate::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.7);
}
.plate::before {
  left: 7px;
}
.plate::after {
  right: 7px;
}

.plate__label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.plate__number {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 12px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--accent);
}
.plate__unit {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.occupancy {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.occupancy__cell {
  height: 9px;
  border-radius: 1px;
  background: var(--line-strong);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
  transition: background-color 240ms var(--ease), box-shadow 240ms var(--ease);
}
.occupancy__cell.is-todo {
  background: var(--todo);
}
.occupancy__cell.is-in-progress {
  background: var(--in-progress);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 7px rgba(243, 168, 59, 0.32);
}
.occupancy__cell.is-blocked {
  background: var(--blocked);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), 0 0 7px rgba(255, 135, 102, 0.3);
}
.occupancy__cell.is-done {
  background: var(--done);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), 0 0 7px rgba(139, 217, 169, 0.25);
}

.plate__note {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.rail-block {
  min-width: 0;
}

.rail-title {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.desk-list {
  margin-top: 10px;
}
.desk-list li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
}
.desk-list li + li {
  border-top: 1px dashed rgba(81, 72, 52, 0.55);
}
.desk-list__name {
  display: block;
  font-size: 13px;
  color: var(--ink);
}
.desk-list__sub {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.desk-list__count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.status-lamp {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status);
}
.status-lamp--todo {
  --status: var(--todo);
}
.status-lamp--in-progress {
  --status: var(--in-progress);
  box-shadow: 0 0 6px rgba(243, 168, 59, 0.5);
}
.status-lamp--blocked {
  --status: var(--blocked);
  box-shadow: 0 0 6px rgba(255, 135, 102, 0.45);
}
.status-lamp--done {
  --status: var(--done);
}

.operator-list {
  margin-top: 8px;
}
.operator-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.operator-list__initials {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--panel);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.operator-list__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operator-list__count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.log {
  margin-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.log__item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(81, 72, 52, 0.45);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}
.log__time {
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.log__empty {
  padding-top: 7px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--muted-2);
}

.rail__note {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------------------------------------------------------------
   Board
   --------------------------------------------------------------- */

.board-main {
  min-width: 0;
  padding: 20px 24px 30px;
}

.board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.board-head__title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(26px, 2.2vw, 32px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.board-head__sub {
  margin-top: 5px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--muted-2);
}
.board-head__sub .dot {
  padding: 0 6px;
  color: var(--line-strong);
}

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

.lane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(0, 0, 0, 0.06) 72%),
    var(--bg-2);
}

.lane__head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 13px;
  border-top: 3px solid var(--status);
  border-bottom: 1px solid var(--line);
  border-radius: 4px 4px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--panel);
}

.lane__jack {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--status);
  border-radius: 50%;
  color: var(--status);
  background: var(--bg);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.35);
}
.lane__jack::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status);
  box-shadow: 0 0 8px color-mix(in srgb, var(--status) 70%, transparent);
}

.lane__name {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--ink);
}
.lane__desk {
  margin-top: 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.lane__count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--status);
}

.lane--todo {
  --status: var(--todo);
}
.lane--in-progress {
  --status: var(--in-progress);
}
.lane--blocked {
  --status: var(--blocked);
}
.lane--done {
  --status: var(--done);
}

.lane__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 120px;
  padding: 14px 10px 18px 26px;
}
.lane__body::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 16px;
  left: 12px;
  width: 2px;
  border-radius: 1px;
  background: var(--status);
  opacity: 0.3;
}

.lane__empty {
  padding: 18px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 3px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  line-height: 1.6;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted-2);
}

.lane.is-routed .lane__head {
  animation: lane-flash 480ms var(--ease);
}
@keyframes lane-flash {
  0% {
    background-color: color-mix(in srgb, var(--status) 26%, var(--panel));
  }
  100% {
    background-color: var(--panel);
  }
}

/* Call slip */
.line-card {
  position: relative;
  padding: 11px 12px 10px;
  border: 1px solid #d5c7ae;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 30%),
    linear-gradient(178deg, var(--paper), var(--paper-2));
  color: var(--paper-ink);
  box-shadow: var(--shadow-card);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}
.line-card::before {
  content: "";
  position: absolute;
  top: 27px;
  left: -16px;
  width: 14px;
  height: 2px;
  background: var(--status);
  opacity: 0.75;
}
.line-card::after {
  content: "";
  position: absolute;
  top: 23px;
  left: -20px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--status);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 0 0 2px var(--panel);
}

.line-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 1px;
}
.line-card__no {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.priority__bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}
.priority__bars span {
  width: 2.5px;
  background: var(--paper-ink);
  border-radius: 0.5px;
}
.priority__bars span:nth-child(1) {
  height: 4px;
}
.priority__bars span:nth-child(2) {
  height: 7px;
}
.priority__bars span:nth-child(3) {
  height: 10px;
}
.priority--medium .priority__bars span:nth-child(3) {
  background: var(--paper-line);
}
.priority--low .priority__bars span:nth-child(2),
.priority--low .priority__bars span:nth-child(3) {
  background: var(--paper-line);
}

.open-item {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 1px 0 3px;
  padding: 5px 0 6px;
  border: 0;
  background: transparent;
  color: var(--paper-ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-align: left;
  border-radius: 2px;
  transition: color 150ms var(--ease), transform 150ms var(--ease);
}
.open-item:active {
  transform: scale(0.985);
}
.open-item:focus,
.open-item:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 1px;
}

.line-card__summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0 0 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--paper-muted);
}
.line-card__project {
  overflow: hidden;
  margin-bottom: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--paper-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding-top: 7px;
  border-top: 1px dashed var(--paper-line);
}
.line-card__owner {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
  color: var(--paper-ink);
}
.line-card__initials {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 2px;
  background: #2b261c;
  color: var(--paper);
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.02em;
}
.line-card__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-card__facts {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  color: var(--paper-muted);
  white-space: nowrap;
}
.line-card__due {
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 120ms var(--ease), color 160ms var(--ease);
}
.btn:active {
  transform: scale(0.97);
}
.btn--quiet {
  background: transparent;
  color: var(--muted);
}
.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn--primary:active {
  background: var(--accent-soft);
}

.board-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* Empty state */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 540px;
  margin: 44px auto 30px;
  padding: 36px 28px 34px;
  border: 1px dashed var(--line-strong);
  border-radius: 5px;
  background:
    radial-gradient(420px 200px at 50% 0%, rgba(243, 168, 59, 0.07), transparent 70%),
    rgba(31, 28, 21, 0.55);
  text-align: center;
}
.empty__jack {
  display: block;
  width: 92px;
  height: 92px;
  margin-bottom: 18px;
  color: var(--accent);
  opacity: 0.75;
}
.empty__jack svg {
  width: 100%;
  height: 100%;
}
.kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.empty__title {
  margin: 6px 0 8px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.empty__copy {
  max-width: 40ch;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------------------------------------------------------------
   Detail — the call sheet
   --------------------------------------------------------------- */

.sheet {
  width: min(760px, calc(100vw - 40px));
  max-width: 760px;
  max-height: min(92dvh, 940px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--paper-ink);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.58), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  overflow: visible;
}
.sheet[open] {
  animation: sheet-in 220ms var(--ease);
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.sheet::backdrop {
  background: rgba(8, 7, 5, 0.74);
  backdrop-filter: blur(3px);
}

.sheet__scroll {
  max-height: min(92dvh, 940px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--paper-line) transparent;
}

.sheet__head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 22px 11px 44px;
  border-bottom: 1px solid var(--paper-line);
  background: rgba(242, 233, 215, 0.97);
  backdrop-filter: blur(6px);
}
.sheet__kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.sheet__lineno {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--paper-line);
  border-radius: 2px;
  color: var(--paper-ink);
  letter-spacing: 0.08em;
}

.sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #bfae90;
  border-radius: 3px;
  background: var(--paper-3);
  color: var(--paper-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color 150ms var(--ease), transform 120ms var(--ease), border-color 150ms var(--ease);
}
.sheet__close:active {
  transform: scale(0.97);
}
.sheet__close-x {
  font-size: 13px;
  line-height: 1;
}

.sheet__wrap {
  position: relative;
  padding: 22px 34px 30px 44px;
}
.sheet__wrap::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 21px;
  width: 1px;
  background: #d7a28f;
}

.sheet__project {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.sheet__title {
  max-width: 24ch;
  margin: 7px 0 18px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

.meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 24px;
  padding: 15px 0;
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
}
.meta__item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
}
.meta dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.meta dd {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--paper-ink);
}
.meta__initials {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  background: #2b261c;
  color: var(--paper);
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
}
.priority--paper .priority__bars span {
  background: var(--paper-ink);
}
.priority--paper.priority--medium .priority__bars span:nth-child(3),
.priority--paper.priority--low .priority__bars span:nth-child(2),
.priority--paper.priority--low .priority__bars span:nth-child(3) {
  background: var(--paper-line);
}

.route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: center;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--paper-line);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent),
    var(--paper-2);
}
.route__label {
  margin-bottom: 9px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.field--paper {
  border-color: #bfae90;
  background: var(--paper-3);
  color: var(--paper-ink);
}
.field--paper > label {
  border-right-color: var(--paper-line);
  color: var(--paper-muted);
}
.field--paper .select select {
  color: var(--paper-ink);
  font-size: 16px;
}
.field--paper .select::after {
  color: var(--paper-muted);
}
.field--paper .select select option {
  background: var(--paper-3);
  color: var(--paper-ink);
}
.field--paper:focus-within {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(138, 75, 0, 0.22);
}
.route__caption {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--paper-muted);
}
.route__caption strong {
  font-weight: 600;
  color: var(--paper-ink);
}

.route__diagram {
  min-width: 0;
}
.patch {
  width: 100%;
  height: auto;
  overflow: visible;
}
.patch__track {
  fill: none;
  stroke: #c7b79a;
  stroke-width: 1.4;
  stroke-dasharray: 3 4;
}
.patch__cable {
  fill: none;
  stroke: var(--paper-ink);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.patch__cable.is-new {
  animation: cable-draw 300ms var(--ease);
}
@keyframes cable-draw {
  from {
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
  }
  to {
    stroke-dasharray: 320;
    stroke-dashoffset: 0;
  }
}
.patch__jack {
  fill: var(--paper-3);
  stroke: #a99878;
  stroke-width: 1.4;
}
.patch__jack.is-live {
  stroke-width: 2;
}
.patch__label {
  fill: var(--paper-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.05em;
}
.patch__label.is-live {
  fill: var(--paper-ink);
  font-weight: 600;
}
.patch__line-label {
  fill: var(--paper-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.07em;
}

.brief {
  padding-top: 4px;
}
.brief__label {
  margin-bottom: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.brief__body {
  max-width: 64ch;
  font-size: 16px;
  line-height: 1.68;
  color: var(--paper-ink);
}
.brief__body p {
  white-space: pre-line;
}
.brief__body p + p {
  margin-top: 12px;
}

.sheet__foot {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--paper-line);
}
.sheet__foot-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.sheet__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid #bfae90;
  border-radius: 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-muted);
  background: var(--paper-3);
}
.sheet__notes {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--paper-muted);
  white-space: nowrap;
}
.sheet__stamp {
  display: inline-block;
  margin-top: 18px;
  padding: 5px 9px;
  border: 2px solid rgba(166, 51, 24, 0.6);
  border-radius: 2px;
  color: rgba(166, 51, 24, 0.78);
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  transform: rotate(-4deg);
}
.sheet__stamp b {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

/* Feedback toast (lives inside the dialog, above its top layer) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(560px, calc(100vw - 28px));
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #1b1811;
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  animation: toast-in 200ms var(--ease);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.toast__lamp {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(243, 168, 59, 0.55);
}
.toast__message {
  flex: 1;
  min-width: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink);
}
.toast__action {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}
.toast__action:active {
  transform: scale(0.96);
}
.toast__action:focus,
.toast__action:focus-visible {
  outline-color: var(--accent);
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 300;
  padding: 16px;
  border: 1px solid var(--accent);
  background: var(--panel);
  font-size: 14px;
  text-align: center;
}

/* ---------------------------------------------------------------
   Hover states (pointer devices only)
   --------------------------------------------------------------- */

@media (hover: hover) and (pointer: fine) {
  .line-card:hover {
    transform: translateY(-2px);
    border-color: #b9a481;
    box-shadow: 0 13px 26px rgba(0, 0, 0, 0.31), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }
  .open-item:hover {
    color: #000;
    text-decoration: underline;
    text-decoration-color: var(--accent-deep);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
  }
  .btn:hover {
    border-color: var(--muted-2);
    background: var(--panel-2);
    color: var(--ink);
  }
  .btn--quiet:hover {
    border-color: var(--line-strong);
    background: var(--panel);
  }
  .btn--primary:hover {
    border-color: var(--accent-soft);
    background: var(--accent-soft);
    color: var(--accent-ink);
  }
  .sheet__close:hover {
    border-color: var(--paper-ink);
    background: #fffaf0;
  }
  .toast__action:hover {
    background: var(--accent);
    color: var(--accent-ink);
  }
  .field--paper:hover {
    border-color: #a99878;
  }
  .field--search:hover,
  .field--filter:hover {
    border-color: #6b6047;
  }
  .skip-link:hover {
    background: var(--accent-soft);
  }
}

html.sheet-open {
  overflow: hidden;
}

.board-error {
  grid-column: 1 / -1;
  padding: 40px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  color: var(--muted);
}

.patch__cable.is-todo {
  stroke: var(--todo-paper);
}
.patch__cable.is-in-progress {
  stroke: var(--in-progress-paper);
}
.patch__cable.is-blocked {
  stroke: var(--blocked-paper);
}
.patch__cable.is-done {
  stroke: var(--done-paper);
}
.patch__jack.is-todo.is-live {
  fill: var(--todo-paper);
  stroke: var(--todo-paper);
}
.patch__jack.is-in-progress.is-live {
  fill: var(--in-progress-paper);
  stroke: var(--in-progress-paper);
}
.patch__jack.is-blocked.is-live {
  fill: var(--blocked-paper);
  stroke: var(--blocked-paper);
}
.patch__jack.is-done.is-live {
  fill: var(--done-paper);
  stroke: var(--done-paper);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  .line-card:hover {
    transform: none;
  }
}

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

@media (max-width: 1180px) {
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: minmax(190px, 250px) minmax(220px, 1fr) minmax(160px, 196px);
  }
  .topbar__status {
    display: none;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    display: none;
  }
  .board-main {
    padding: 18px 20px 28px;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand brand"
      "search filter";
    gap: 9px 10px;
    padding: 10px 20px 11px;
  }
  .brand {
    grid-area: brand;
  }
  .brand__mark {
    width: 36px;
    height: 36px;
  }
  .brand__mark svg {
    width: 26px;
    height: 26px;
  }
  .brand__name {
    font-size: 21px;
  }
  .field--search {
    grid-area: search;
  }
  .field--filter {
    grid-area: filter;
    width: 170px;
  }
  .field__key {
    display: none;
  }
  .field > label {
    padding: 0 8px;
    font-size: 9.5px;
  }
  .field--search input {
    padding: 0 8px;
    font-size: 16px;
  }
  .field--filter .select select {
    padding-left: 8px;
    padding-right: 24px;
    font-size: 16px;
  }
  .board-main {
    padding: 15px 20px 26px;
  }
  .board-head {
    margin-bottom: 13px;
  }
  .board-head__title {
    font-size: 27px;
  }
  .board-head__sub {
    font-size: 10px;
  }
  .board {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .board.is-querying .lane.is-empty {
    display: none;
  }
  .lane__body {
    padding: 14px 12px 18px 28px;
  }
  .line-card {
    padding: 12px 14px 11px;
  }
  .open-item {
    font-size: 16px;
  }
  .empty {
    margin: 28px auto;
    padding: 28px 20px;
  }
  .sheet {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .sheet__scroll {
    max-height: 100dvh;
    height: 100dvh;
  }
  .sheet__head {
    padding: 9px 14px 9px 26px;
  }
  .sheet__close span:first-child {
    display: none;
  }
  .sheet__close {
    padding: 0 11px;
  }
  .sheet__wrap {
    padding: 18px 20px 28px 26px;
  }
  .sheet__wrap::before {
    left: 12px;
  }
  .sheet__title {
    max-width: none;
    font-size: clamp(26px, 8vw, 32px);
  }
  .meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .route {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }
  .route__diagram {
    max-width: 100%;
  }
  .sheet__foot-row {
    flex-direction: column;
    gap: 10px;
  }
  .toast {
    bottom: 14px;
  }
}

@media (max-width: 390px) {
  .field--filter {
    width: 170px;
  }
  .board-head__sub {
    max-width: 34ch;
  }
  .sheet__wrap {
    padding-right: 20px;
  }
}

/* ---------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .open-item:active,
  .btn:active,
  .sheet__close:active,
  .toast__action:active {
    transform: none;
  }
  .sheet[open] {
    animation: none;
  }
  .toast {
    animation: none;
  }
}
