@font-face {
  font-family: "DM Serif Display";
  src: url("assets/dm-serif.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-weight: 400;
  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 {
  --bg: #0b110d;
  --bg-raised: #101912;
  --bg-panel: #121c15;
  --cream: #f1e6cd;
  --cream-bright: #f8efd9;
  --cream-dim: #e1d3b4;
  --ink: #182019;
  --ink-soft: #334035;
  --amber: #f2b44e;
  --amber-bright: #ffd078;
  --amber-ink: #936000;
  --muted: #93a091;
  --muted-dim: #7e8c7e;
  --line: rgba(241, 230, 205, 0.16);
  --line-strong: rgba(241, 230, 205, 0.3);
  --status-todo: #556b59;
  --status-in-progress: #8f5500;
  --status-blocked: #a03b26;
  --status-done: #2c6a4b;
  --status-todo-bright: #a9c1ac;
  --status-in-progress-bright: #ffbd52;
  --status-blocked-bright: #ff8266;
  --status-done-bright: #7dd4a8;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --shadow-paper: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 18px 38px rgba(0, 0, 0, 0.28);
  --focus: #ffd078;
}

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

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

body {
  margin: 0;
  min-height: 100%;
  color: var(--cream);
  background:
    radial-gradient(900px 520px at 82% -8%, rgba(74, 107, 61, 0.28), transparent 62%),
    radial-gradient(700px 440px at -5% 22%, rgba(120, 80, 25, 0.13), transparent 70%),
    var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.28;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0,
    rgba(255, 255, 255, 0.022) 1px,
    transparent 1px,
    transparent 4px
  );
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.modal-open { overflow: hidden; }

[hidden] { display: none !important; }

button,
input,
select { font: inherit; }

button { color: inherit; }

::selection {
  color: #171207;
  background: var(--amber-bright);
}

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

.sr-only {
  position: absolute !important;
  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;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--amber);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}
.skip-link:focus { transform: none; }

.wrap {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

/* ---------- ticker ---------- */

.ticker {
  position: relative;
  z-index: 2;
  overflow: hidden;
  color: #191307;
  background: var(--amber);
  border-bottom: 1px solid #6b4c14;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 44s linear infinite;
}

.ticker-seg {
  display: inline-block;
  flex: none;
  padding: 8px 0;
  white-space: nowrap;
}

.ticker-seg::before {
  content: "◆";
  margin: 0 18px;
  font-size: 0.52rem;
  opacity: 0.7;
}

.ticker-seg::after {
  content: "◆";
  margin: 0 18px;
  font-size: 0.52rem;
  opacity: 0.7;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  text-decoration: none;
}

.brand:hover .brand-mark { color: var(--amber-bright); transform: rotate(-8deg); }

.brand-mark {
  width: 42px;
  height: 42px;
  color: var(--amber);
  transition: transform 260ms ease, color 200ms ease;
}

.brand-word {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.015em;
}

.mast-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(242, 180, 78, 0.12), 0 0 12px rgba(242, 180, 78, 0.75);
  animation: live-pulse 2.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.78); }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 48px;
  padding-block: 46px 34px;
}

.hero-copy { min-width: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow-rule {
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 5vw, 4.9rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.025em;
}

.hero h1 em {
  position: relative;
  display: inline-block;
  color: var(--amber);
  font-style: normal;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 1%;
  right: -2%;
  bottom: 0.01em;
  height: 0.15em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='10' viewBox='0 0 120 10'%3E%3Cpath d='M1 6c14-5 23 5 38 0s24 4 39 0 25 5 41 0' fill='none' stroke='%23f2b44e' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
  background-size: 120px 10px;
  opacity: 0.75;
}

.lede {
  max-width: 52ch;
  margin: 24px 0 0;
  color: #c6c4ab;
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  gap: 34px;
  padding-bottom: 6px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
}

.stat-num {
  font-family: var(--serif);
  font-size: 3.35rem;
  line-height: 0.9;
  color: var(--amber);
  font-variant-numeric: lining-nums tabular-nums;
}

.stat-num-muted { color: var(--cream-dim); }

.stat-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- console ---------- */

.console {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 224px auto;
  align-items: end;
  gap: 26px;
  padding: 20px 22px 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(241, 230, 205, 0.055), rgba(241, 230, 205, 0.015)),
    rgba(9, 15, 10, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 20px 55px rgba(0, 0, 0, 0.18);
}

.console::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  width: 74px;
  height: 2px;
  background: var(--amber);
}

.search-field,
.filter-field { min-width: 0; }

.search-field > label,
.filter-field > label {
  display: block;
  margin-bottom: 8px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.59rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 160ms ease, background 160ms ease;
}

.search-input-wrap:focus-within {
  border-color: var(--amber);
  background: rgba(242, 180, 78, 0.05);
  box-shadow: 0 1px 0 var(--amber);
}

.search-icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--amber);
  opacity: 0.8;
}

#search {
  width: 100%;
  min-width: 0;
  padding: 8px 0 10px;
  border: 0;
  border-radius: 0;
  color: var(--cream-bright);
  background: transparent;
  font-family: var(--sans);
  font-size: 1.04rem;
  outline: none;
}

#search::placeholder { color: var(--muted-dim); }
#search::-webkit-search-cancel-button { filter: invert(0.8) sepia(0.4); }

.key-hint {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.select-wrap,
.routing-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

#filter,
#status-control {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  cursor: pointer;
}

#filter {
  padding: 10px 36px 10px 12px;
  color: var(--cream-bright);
  background: #162018;
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.03em;
}

#filter:hover { border-color: var(--amber); }
#filter option { color: var(--cream); background: #162018; }

.select-chevron,
.routing-select-wrap svg {
  position: absolute;
  right: 12px;
  width: 11px;
  height: 7px;
  color: var(--amber);
  pointer-events: none;
}

.result-count {
  margin: 0;
  padding-bottom: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- workspace ---------- */

.workspace {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  align-items: start;
  gap: 30px;
  padding-block: 34px 54px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.list-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.list-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 9px rgba(242, 180, 78, 0.75);
}

.list-count {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wire-list {
  position: relative;
  padding: 18px 0 4px 34px;
}

.wire-list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 9px;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(242, 180, 78, 0.48) 0,
    rgba(242, 180, 78, 0.48) 10px,
    transparent 10px,
    transparent 19px
  );
  animation: wire-flow 26s linear infinite;
}

@keyframes wire-flow {
  to { background-position-y: 190px; }
}

/* ---------- dispatch cards ---------- */

.dispatch-card {
  position: relative;
  margin-bottom: 16px;
  padding: 18px 22px 17px;
  color: var(--ink);
  border: 1px solid rgba(24, 32, 25, 0.22);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.35), transparent 48%),
    repeating-linear-gradient(to bottom, rgba(77, 60, 31, 0.035) 0, rgba(77, 60, 31, 0.035) 1px, transparent 1px, transparent 4px),
    var(--cream);
  box-shadow: var(--shadow-paper);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dispatch-card::before {
  content: "";
  position: absolute;
  top: 30px;
  left: -30px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--status, var(--status-todo));
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 4px rgba(11, 17, 13, 0.55), 0 0 12px var(--status, var(--status-todo));
}

.dispatch-card::after {
  content: "";
  position: absolute;
  top: 36px;
  left: -20px;
  width: 20px;
  height: 1px;
  background: linear-gradient(to left, rgba(242, 180, 78, 0.65), rgba(242, 180, 78, 0.08));
}

.dispatch-card[data-status="todo"] { --status: var(--status-todo); --status-bright: var(--status-todo-bright); }
.dispatch-card[data-status="in-progress"] { --status: var(--status-in-progress); --status-bright: var(--status-in-progress-bright); }
.dispatch-card[data-status="blocked"] { --status: var(--status-blocked); --status-bright: var(--status-blocked-bright); }
.dispatch-card[data-status="done"] { --status: var(--status-done); --status-bright: var(--status-done-bright); }

.dispatch-card:hover,
.dispatch-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(24, 32, 25, 0.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 24px 46px rgba(0, 0, 0, 0.34);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.card-ident {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: #6b624f;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #716753;
  font-size: 0.56rem;
  letter-spacing: 0.13em;
}

.priority::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a3977f;
}

.priority[data-priority="high"] { color: #9d3d25; }
.priority[data-priority="high"]::before { background: #bb4a2e; }
.priority[data-priority="medium"]::before { background: #a8842d; }
.priority[data-priority="low"]::before { background: #7e8d7f; }

.detail-stamp,
.stamp {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px 2px;
  border: 1px solid currentColor;
  border-radius: 1px;
  color: var(--status, var(--status-todo));
  font-family: var(--mono);
  font-size: 0.55rem;
  line-height: 1.25;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  transform: rotate(-2.2deg);
  opacity: 0.92;
  box-shadow: 0 0 0 1px rgba(241, 230, 205, 0.55) inset;
}

.stamp[data-status="todo"],
.detail-stamp[data-status="todo"] { color: var(--status-todo); --status: var(--status-todo); }
.stamp[data-status="in-progress"],
.detail-stamp[data-status="in-progress"] { color: var(--status-in-progress); --status: var(--status-in-progress); }
.stamp[data-status="blocked"],
.detail-stamp[data-status="blocked"] { color: var(--status-blocked); --status: var(--status-blocked); }
.stamp[data-status="done"],
.detail-stamp[data-status="done"] { color: var(--status-done); --status: var(--status-done); }

.stamp.is-stamping {
  animation: stamp-hit 360ms cubic-bezier(0.2, 0.9, 0.3, 1.35);
}

@keyframes stamp-hit {
  0% { transform: rotate(-2.2deg) scale(1.35); opacity: 0.3; }
  60% { transform: rotate(-2.2deg) scale(0.95); opacity: 1; }
  100% { transform: rotate(-2.2deg) scale(1); opacity: 0.92; }
}

.dispatch-card h3 {
  margin: 0;
  max-width: 46ch;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.1vw, 1.62rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}

.card-summary {
  display: -webkit-box;
  max-width: 66ch;
  margin: 9px 0 15px;
  overflow: hidden;
  color: #4e5548;
  font-size: 0.86rem;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(24, 32, 25, 0.26);
  color: #6a6755;
  font-family: var(--mono);
  font-size: 0.59rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.person {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  color: var(--cream);
  background: #2c3a2e;
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.04em;
}

.due-label { white-space: nowrap; }
.due-label.is-soon { color: #9d3d25; }

.comment-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.comment-count svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 8px 11px 7px;
  border: 1px solid #263025;
  border-radius: 0;
  color: var(--cream);
  background: #202a21;
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.open-btn svg {
  width: 12px;
  height: 12px;
  transition: transform 150ms ease;
}

.open-btn:hover {
  color: #1c160a;
  background: var(--amber);
  border-color: #a57316;
}

.open-btn:hover svg { transform: translateX(3px); }
.open-btn:active { transform: translateY(1px); }
.open-btn:focus-visible { outline-color: #5a3600; outline-offset: 2px; }

.signal-panel .channel:focus-visible,
.due-item:focus-visible { outline-offset: 1px; }

/* ---------- empty state ---------- */

.empty-state {
  position: relative;
  margin: 20px 0 0 34px;
  padding: 42px 34px 38px;
  border: 1px dashed rgba(24, 32, 25, 0.4);
  color: var(--ink);
  background:
    repeating-linear-gradient(to bottom, rgba(77, 60, 31, 0.035) 0, rgba(77, 60, 31, 0.035) 1px, transparent 1px, transparent 4px),
    var(--cream);
  box-shadow: var(--shadow-paper);
}

.empty-state::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 42%;
  width: 76px;
  height: 18px;
  background: rgba(215, 198, 158, 0.72);
  border-left: 1px dashed rgba(24, 32, 25, 0.14);
  border-right: 1px dashed rgba(24, 32, 25, 0.14);
  transform: rotate(-1.5deg);
}

.empty-kicker {
  margin: 0 0 12px;
  color: var(--status-blocked);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.empty-state h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1;
}

.empty-state p:not(.empty-kicker) {
  max-width: 42ch;
  margin: 15px 0 22px;
  color: #59604f;
  font-size: 0.9rem;
}

.reset-btn {
  padding: 11px 15px;
  border: 1px solid #263025;
  border-radius: 0;
  color: var(--cream);
  background: #202a21;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.reset-btn:hover { background: var(--amber); color: #1c160a; border-color: #a57316; }
.reset-btn:focus-visible { outline-color: #5a3600; }

/* ---------- sidebar ---------- */

.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(140deg, rgba(241, 230, 205, 0.05), transparent 55%),
    rgba(9, 15, 10, 0.38);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px 10px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-note {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.signal-list { padding: 5px 6px 6px; }

.channel {
  width: 100%;
  padding: 9px 9px 11px;
  border: 1px solid transparent;
  color: #d6d2ba;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.channel + .channel { margin-top: 1px; }

.channel:hover { background: rgba(241, 230, 205, 0.05); }
.channel[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: rgba(242, 180, 78, 0.08);
}

.channel-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.channel-lamp {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lamp) 15%, transparent), 0 0 10px color-mix(in srgb, var(--lamp) 65%, transparent);
}

.channel-name {
  font-family: var(--sans);
  font-size: 0.79rem;
  letter-spacing: 0.01em;
}

.channel-count {
  margin-left: auto;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.69rem;
  font-variant-numeric: tabular-nums;
}

.channel-meter {
  display: block;
  height: 2px;
  margin: 7px 0 0 17px;
  background: rgba(241, 230, 205, 0.09);
  overflow: hidden;
}

.channel-meter > span {
  display: block;
  height: 100%;
  width: var(--meter, 0%);
  background: var(--lamp);
  transition: width 320ms ease;
}

.channel[data-channel="todo"] { --lamp: var(--status-todo-bright); }
.channel[data-channel="in-progress"] { --lamp: var(--status-in-progress-bright); }
.channel[data-channel="blocked"] { --lamp: var(--status-blocked-bright); }
.channel[data-channel="done"] { --lamp: var(--status-done-bright); }

.panel-foot {
  margin: 0;
  padding: 0 15px 13px;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
}

.due-list { padding: 4px 6px 7px; }

.due-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid transparent;
  color: var(--cream);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.due-item:hover { background: rgba(241, 230, 205, 0.055); }
.due-item + .due-item { border-top-color: rgba(241, 230, 205, 0.08); }

.due-date {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: 32px;
  padding: 4px 0 3px;
  border: 1px solid var(--line-strong);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.56rem;
  line-height: 1.05;
  letter-spacing: 0.04em;
}

.due-date strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--cream);
}

.due-title {
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.due-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.due-empty {
  margin: 0;
  padding: 14px 15px 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.manual-panel { padding-bottom: 14px; }

.manual-list {
  margin: 0;
  padding: 11px 15px 4px;
  list-style: none;
}

.manual-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  color: #b9b9a3;
  font-size: 0.73rem;
}

.manual-list kbd {
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.56rem;
}

.manual-lamp {
  width: 8px;
  height: 8px;
  margin-left: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px rgba(242, 180, 78, 0.8);
}

.manual-quote {
  margin: 12px 15px 0;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
  color: var(--muted-dim);
  font-family: var(--serif);
  font-size: 0.89rem;
  line-height: 1.35;
}

/* ---------- footer ---------- */

.footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 20px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.footer-mark {
  color: var(--amber);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}

/* ---------- detail sheet ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background:
    radial-gradient(circle at 70% 20%, rgba(50, 79, 52, 0.28), transparent 50%),
    rgba(3, 7, 4, 0.76);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.detail {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(670px, 100vw);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--cream);
  box-shadow: -30px 0 90px rgba(0, 0, 0, 0.52);
  transform: translateX(100%);
  transition: transform 360ms cubic-bezier(0.22, 0.85, 0.24, 1);
  overscroll-behavior: contain;
}

.detail.is-open { transform: translateX(0); }

.detail::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1;
  width: min(670px, 100vw);
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sheet-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 8px 20px 8px 26px;
  color: #d9d0b9;
  background: #172019;
  border-bottom: 1px solid #364136;
}

.sheet-bar-id {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.mini-mark { width: 24px; height: 24px; flex: none; color: var(--amber); }

.sheet-line {
  padding-left: 9px;
  border-left: 1px solid #4a5548;
  color: var(--amber);
  white-space: nowrap;
}

.close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #596451;
  border-radius: 0;
  color: #e7dfc9;
  background: transparent;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.close-btn svg { width: 17px; height: 17px; }
.close-label { font-family: var(--mono); font-size: 0.57rem; letter-spacing: 0.1em; text-transform: uppercase; }
.close-btn:hover { color: #171207; background: var(--amber); border-color: var(--amber); }

.sheet {
  position: relative;
  z-index: 2;
  padding: 32px 42px 48px;
}

.sheet-ghost {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: -1;
  color: #d9c9a5;
  font-family: var(--serif);
  font-size: 11rem;
  line-height: 0.8;
  letter-spacing: -0.07em;
  pointer-events: none;
  user-select: none;
}

.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #756a55;
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.priority-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a8842d;
}

.priority-pill[data-priority="high"] { color: #9d3d25; }
.priority-pill[data-priority="high"]::before { background: #bb4a2e; }
.priority-pill[data-priority="low"]::before { background: #7e8d7f; }

.detail-stamp {
  padding: 5px 11px 4px;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  box-shadow: 0 0 0 1px var(--cream) inset, 0 0 0 2px currentColor inset;
}

.detail-eyebrow {
  margin: 0 0 12px;
  color: #6f6552;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

#detail-title {
  max-width: 18ch;
  margin: 0;
  color: #1a211a;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 3.65rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 28px 0 26px;
  border-top: 1px solid rgba(24, 32, 25, 0.26);
  border-left: 1px solid rgba(24, 32, 25, 0.18);
}

.meta-grid > div {
  padding: 11px 13px 10px;
  border-right: 1px solid rgba(24, 32, 25, 0.18);
  border-bottom: 1px solid rgba(24, 32, 25, 0.18);
}

.meta-grid dt {
  margin-bottom: 4px;
  color: #6f6552;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.meta-grid dd {
  margin: 0;
  color: #263027;
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* ---------- routing block ---------- */

.routing {
  position: relative;
  margin: 0 0 32px;
  padding: 20px 20px 17px;
  color: #e9e1ca;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 4px),
    #19211a;
  border: 1px solid #2e3a2e;
  box-shadow: 0 8px 20px rgba(44, 37, 20, 0.18);
}

.routing::before,
.routing::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 10px;
  height: 10px;
  border: 1px solid #4d5a4b;
  border-radius: 50%;
  background: var(--cream);
}

.routing::before { left: -6px; }
.routing::after { right: -6px; }

.routing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.routing-head h3 {
  margin: 0;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.routing-lamp {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--routing-lamp, var(--status-in-progress-bright));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--routing-lamp, var(--status-in-progress-bright)) 13%, transparent), 0 0 12px var(--routing-lamp, var(--status-in-progress-bright));
}

.routing > label {
  display: block;
  margin-bottom: 7px;
  color: #a9b0a2;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

#status-control {
  padding: 12px 42px 12px 13px;
  border-color: #66745f;
  color: var(--ink);
  background: var(--cream-bright);
  font-family: var(--sans);
  font-size: 1rem;
}

#status-control:hover { border-color: var(--amber); }
#status-control:focus-visible { outline-color: var(--amber-bright); }
#status-control option { color: var(--ink); background: var(--cream-bright); }

.routing-select-wrap svg { color: #4b5a49; }

.routing-hint {
  margin: 8px 0 0;
  color: #9eab9b;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.03em;
}

.routing-feedback {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: var(--amber-bright);
  font-family: var(--mono);
  font-size: 0.6rem;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

.routing-feedback:not(:empty) {
  padding-top: 10px;
  border-top: 1px dashed #445043;
}

/* ---------- body ---------- */

.body-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 15px;
}

.body-head h3 {
  margin: 0;
  color: #6f6552;
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 400;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  white-space: nowrap;
}

.body-rule {
  width: 100%;
  height: 1px;
  background: rgba(24, 32, 25, 0.24);
}

.body-text {
  margin: 0;
  color: #313a30;
  font-size: 1.02rem;
  line-height: 1.72;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.body-text::first-letter {
  float: left;
  margin: 0.04em 8px 0 0;
  color: #9a5b00;
  font-family: var(--serif);
  font-size: 3.25em;
  line-height: 0.78;
}

.sheet-foot {
  margin-top: 34px;
  padding-top: 17px;
  border-top: 1px dashed rgba(24, 32, 25, 0.28);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  padding: 4px 8px 3px;
  border: 1px solid rgba(24, 32, 25, 0.3);
  color: #5e5d49;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sheet-foot-note {
  margin: 13px 0 0;
  color: #6f6552;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 16px 11px;
  border: 1px solid #66745f;
  color: var(--cream);
  background: #182119;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
  font-family: var(--mono);
  font-size: 0.63rem;
  line-height: 1.4;
  letter-spacing: 0.03em;
  pointer-events: none;
  transform: translateX(-50%);
  animation: toast-in 220ms ease both;
}

.toast-lamp {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(242, 180, 78, 0.8);
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .wrap { width: min(1240px, calc(100% - 48px)); }
  .hero { gap: 28px; }
  .console { grid-template-columns: minmax(0, 1fr) 200px; }
  .result-count { grid-column: 1 / -1; padding: 0; }
  .workspace { grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; }
  .hero-stats { gap: 22px; }
  .stat { min-width: 80px; }
}

@media (max-width: 880px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .manual-panel { grid-column: 1 / -1; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .hero-stats { padding-bottom: 0; }
  .hero h1 { max-width: 12ch; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }

  .masthead { padding-block: 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-word { font-size: 1.35rem; }
  .mast-desk { display: none; }
  .mast-meta { gap: 12px; font-size: 0.56rem; }

  .hero { padding-block: 32px 23px; gap: 18px; }
  .hero h1 { font-size: clamp(2.65rem, 12.5vw, 3.5rem); max-width: 12ch; }
  .eyebrow { margin-bottom: 13px; font-size: 0.57rem; letter-spacing: 0.13em; }
  .lede { margin-top: 15px; font-size: 0.91rem; line-height: 1.55; }
  .hero-stats { gap: 24px; }
  .stat { min-width: 0; padding-left: 13px; }
  .stat-num { font-size: 2.7rem; }

  .console {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
    padding: 15px 15px 13px;
  }
  .console::before { left: 16px; }
  .result-count { padding: 0; }
  #search { font-size: 1rem; }
  #filter { font-size: 0.7rem; }

  .workspace { gap: 24px; padding-block: 25px 38px; }
  .list-head { position: sticky; top: 0; z-index: 5; padding-block: 9px; background: var(--bg); }
  .list-head h2 { font-size: 0.61rem; }
  .list-count { font-size: 0.58rem; }

  .wire-list { padding-left: 23px; }
  .wire-list::before { left: 5px; }
  .dispatch-card { padding: 15px 15px 14px; }
  .dispatch-card::before { left: -21px; top: 26px; width: 8px; height: 8px; }
  .dispatch-card::after { left: -13px; top: 31px; width: 13px; }
  .card-top { margin-bottom: 8px; gap: 8px; }
  .card-ident { gap: 7px; font-size: 0.55rem; letter-spacing: 0.075em; }
  .priority { font-size: 0.52rem; letter-spacing: 0.08em; }
  .stamp { font-size: 0.53rem; padding: 3px 6px 2px; }
  .dispatch-card h3 { font-size: 1.42rem; line-height: 1.08; }
  .card-summary { margin: 8px 0 12px; font-size: 0.8rem; }
  .card-foot { gap: 7px 12px; padding-top: 10px; font-size: 0.56rem; }
  .avatar { width: 20px; height: 20px; font-size: 0.46rem; }
  .open-btn { padding: 8px 9px 7px; font-size: 0.51rem; }
  .empty-state { margin-left: 23px; padding: 33px 20px 28px; }
  .empty-state h2 { font-size: 2.15rem; }

  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .manual-panel { grid-column: auto; }
  .panel-head { padding: 12px 13px 9px; }
  .signal-list { padding: 4px 5px 5px; }
  .channel { padding: 8px 8px 9px; }
  .panel-foot { padding-inline: 13px; }

  .footer { flex-wrap: wrap; gap: 7px 16px; font-size: 0.53rem; }
  .footer span:nth-child(2) { order: 3; flex-basis: 100%; }

  .detail { width: 100vw; }
  .detail::before { width: 100vw; }
  .sheet-bar { padding-inline: 15px 10px; min-height: 54px; }
  .sheet-bar-id { font-size: 0.55rem; letter-spacing: 0.1em; gap: 7px; }
  .mini-mark { width: 20px; height: 20px; }
  .close-label { display: none; }
  .close-btn { min-width: 44px; min-height: 44px; padding: 0; }

  .sheet { padding: 24px 20px 40px; }
  .sheet-ghost { top: 20px; right: 16px; font-size: 7.5rem; }
  .detail-topline { margin-bottom: 21px; }
  #detail-title { font-size: clamp(2.25rem, 11vw, 3.1rem); max-width: 100%; }
  .meta-grid { margin: 23px 0 22px; }
  .meta-grid > div { padding: 9px 10px 8px; }
  .meta-grid dd { font-size: 0.78rem; }
  .routing { padding: 17px 15px 15px; margin-bottom: 27px; }
  .body-text { font-size: 0.97rem; line-height: 1.68; }
  .toast { bottom: 14px; font-size: 0.61rem; }
}

@media (max-width: 380px) {
  .card-ident { gap: 5px; }
  .priority { display: none; }
  .open-btn { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .ticker-track { animation: none; }
  .live-dot { animation: none; }
  .wire-list::before { animation: none; }
}
