@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 100 900;
  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 {
  --ink: #14201b;
  --ink-soft: #223129;
  --ink-line: #35483d;
  --paper: #e8e9e1;
  --surface: #f6f5ef;
  --surface-raised: #fbfaf5;
  --surface-sunken: #efeee6;
  --line: #d2d5c9;
  --line-strong: #b6bbad;
  --muted: #5c665f;
  --muted-soft: #606b63;
  --accent: #e24e1b;
  --accent-deep: #a83a12;
  --signal: #d8ec92;
  --todo: #6b756f;
  --progress: #a85c00;
  --blocked: #ad2b20;
  --done: #236f4d;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-low: 0 1px 2px rgba(20, 32, 27, 0.06), 0 6px 18px rgba(20, 32, 27, 0.04);
  --font-ui: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  background: var(--accent-deep);
  color: #fffdf8;
}

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

.rail :focus-visible {
  outline-color: #ff8c60;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.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;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-180%);
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease-out;
}

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

.app {
  display: grid;
  grid-template-columns: clamp(216px, 17vw, 248px) minmax(0, 1fr) clamp(368px, 29vw, 420px);
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  background: var(--paper);
}

/* ---------- Queue rail ---------- */

.rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 16px 18px;
  background: var(--ink);
  color: #f4f3eb;
  border-right: 1px solid #0a130f;
  scrollbar-width: thin;
  scrollbar-color: #45554b transparent;
}

.rail::-webkit-scrollbar {
  width: 8px;
}

.rail::-webkit-scrollbar-thumb {
  background: #45554b;
  border-radius: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 30px;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: #f7f6ee;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #92a097;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rail-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #86968c;
}

.rail-total {
  color: #c7d1c9;
  font-variant-numeric: tabular-nums;
}

.rail-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c8d1c9;
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease-out, color 140ms ease-out, box-shadow 140ms ease-out;
}

.rail-link:hover {
  background: #1c2b24;
  color: #f7f6ee;
}

.rail-link[aria-pressed="true"] {
  background: #f1f0e6;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #fffdf8;
}

.rail-link-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rail-lamp {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.rail-lamp.status-todo {
  background: var(--todo);
}

.rail-lamp.status-in-progress {
  background: var(--progress);
}

.rail-lamp.status-blocked {
  background: var(--blocked);
}

.rail-lamp.status-done {
  background: var(--done);
}

.rail-count {
  min-width: 20px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
  text-align: right;
  color: #829289;
  font-variant-numeric: tabular-nums;
}

.rail-link[aria-pressed="true"] .rail-count {
  color: var(--accent-deep);
}

.rail-foot {
  margin-top: auto;
  padding: 32px 8px 2px;
}

.rail-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
  padding-top: 14px;
  border-top: 1px solid #2c3c33;
  font-size: 10.5px;
  line-height: 1.5;
  color: #93a198;
}

.rail-note .icon {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  stroke-width: 1.8;
}

.rail-session {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #8b9b90;
}

.session-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--signal);
}

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

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}

.workspace:focus {
  outline: none;
}

.masthead {
  padding: 30px 32px 18px;
}

.masthead-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
}

.lede {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.team-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-bottom: 3px;
}

.team-stack {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  padding-left: 8px;
}

.team-stack .avatar {
  margin-left: -8px;
  border: 2px solid var(--paper);
}

.team-caption {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--avatar-bg, #3e5749);
  color: #fffdf7;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
}

.team-stack .avatar {
  width: 29px;
  height: 29px;
  font-size: 9px;
}

/* ---------- Toolbar ---------- */

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 184px auto;
  gap: 16px;
  align-items: end;
  padding: 0 32px 16px;
  border-bottom: 1px solid var(--line-strong);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.input-shell,
.select-shell {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}

.input-shell:focus-within,
.select-shell:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(226, 78, 27, 0.16);
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

#search {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 44px 0 38px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1;
  outline: none;
  caret-color: var(--accent);
}

#search::placeholder {
  color: var(--muted-soft);
  opacity: 1;
}

#search::-webkit-search-cancel-button {
  appearance: none;
}

.search-kbd {
  position: absolute;
  right: 9px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--muted-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}

.select-shell {
  background: var(--surface-raised);
}

#filter {
  appearance: none;
  width: 100%;
  height: 100%;
  padding: 0 34px 0 12px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  outline: none;
}

.select-shell .chevron {
  position: absolute;
  right: 10px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 44px;
}

.result-count {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.reset-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease-out, color 140ms ease-out, border-color 140ms ease-out;
}

.reset-button .icon {
  width: 14px;
  height: 14px;
}

.reset-button:hover {
  border-color: var(--ink);
  background: var(--surface-raised);
  color: var(--ink);
}

/* ---------- Queue ---------- */

.queue-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 32px 24px;
  scrollbar-width: thin;
  scrollbar-color: #b9beb2 transparent;
}

.queue-scroll::-webkit-scrollbar,
.detail-paper::-webkit-scrollbar {
  width: 10px;
}

.queue-scroll::-webkit-scrollbar-thumb,
.detail-paper::-webkit-scrollbar-thumb {
  background: #b9beb2;
  border: 3px solid var(--paper);
  border-radius: 8px;
}

.detail-paper::-webkit-scrollbar-thumb {
  border-color: var(--surface);
}

.table-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 38px 106px minmax(0, 1fr) 130px 72px 18px;
  gap: 12px;
  align-items: end;
  padding: 12px 12px 9px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.col-due {
  text-align: right;
}

.task-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item {
  margin: 0;
  padding: 0;
}

.task-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px 106px minmax(0, 1fr) 130px 72px 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease-out, box-shadow 140ms ease-out;
}

.task-row:hover {
  background: #f2f1e9;
}

.task-row:focus-visible {
  outline-offset: -2px;
}

.task-row.is-updated {
  animation: row-updated 900ms ease-out;
}

@keyframes row-updated {
  0% {
    background-color: #f5ddc4;
  }
  100% {
    background-color: transparent;
  }
}

.task-row:active {
  background: #eae9df;
}

.task-row[aria-current="true"] {
  background: #eff0e4;
  box-shadow: inset 0 0 0 1px #b2b8a6;
}

.task-row[aria-current="true"]:hover {
  background: #eceee0;
}

.cell-details {
  display: contents;
}

.cell-no {
  grid-column: 1;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  color: var(--muted-soft);
  font-variant-numeric: tabular-nums;
}

.cell-status {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.2;
  color: #4f5a53;
  white-space: nowrap;
}

.lamp {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--status-color, #6b756f);
  transition: background-color 180ms ease-out;
}

.status-todo {
  --status-color: var(--todo);
}

.status-in-progress {
  --status-color: var(--progress);
}

.status-blocked {
  --status-color: var(--blocked);
}

.status-done {
  --status-color: var(--done);
}

.cell-main {
  grid-column: 3;
  display: block;
  min-width: 0;
}

.row-title {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.006em;
  color: var(--ink);
}

.row-title mark {
  padding: 0 1px;
  border-radius: 2px;
  background: #f3c28d;
  color: var(--ink);
}

.row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  margin-top: 5px;
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--muted);
}

.meta-project {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #4e5a52;
}

.meta-sep {
  color: #a6aca0;
}

.meta-tag {
  color: var(--muted);
}

.priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.priority-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}

.priority-bars i {
  display: block;
  width: 2.5px;
  border-radius: 1px 1px 0 0;
  background: #c7ccbf;
}

.priority-bars i:nth-child(1) {
  height: 4px;
}

.priority-bars i:nth-child(2) {
  height: 7px;
}

.priority-bars i:nth-child(3) {
  height: 10px;
}

.priority-bars.level-1 i:nth-child(-n + 1),
.priority-bars.level-2 i:nth-child(-n + 2),
.priority-bars.level-3 i:nth-child(-n + 3) {
  background: var(--accent);
}

.priority-label {
  font-size: 10px;
}

.cell-owner {
  grid-column: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  color: #4f5a53;
}

.cell-owner .avatar {
  width: 23px;
  height: 23px;
  font-size: 7.5px;
}

.owner-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-due {
  grid-column: 5;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  text-align: right;
  color: #4f5a53;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-arrow {
  grid-column: 6;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #8a938b;
}

.cell-arrow .icon {
  width: 15px;
  height: 15px;
  transition: transform 140ms ease-out, color 140ms ease-out;
}

.task-row:hover .cell-arrow,
.task-row[aria-current="true"] .cell-arrow {
  color: var(--accent-deep);
}

.task-row:hover .cell-arrow .icon {
  transform: translateX(2px);
}

/* ---------- Empty, loading, error ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 24px 0 12px;
  padding: 42px 28px 44px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(251, 250, 245, 0.42);
  text-align: center;
}

.empty-art {
  width: 230px;
  max-width: 100%;
  margin-bottom: 22px;
  color: var(--muted);
}

.empty-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-grid {
  fill: none;
  stroke: #d5d8cb;
  stroke-width: 1;
}

.diagram-wire {
  fill: none;
  stroke: #7e8b82;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.diagram-node {
  fill: var(--surface);
  stroke: #7e8b82;
  stroke-width: 1.6;
}

.diagram-node.active {
  fill: var(--accent);
  stroke: var(--accent);
}

.diagram-cut {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
}

.empty-state h2,
.load-error h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
}

.empty-state p,
.load-error p {
  max-width: 39ch;
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.empty-state p strong {
  color: var(--ink);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: #f8f7ef;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

.primary-button:hover {
  background: #26372e;
  border-color: #26372e;
}

.load-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 24px 0;
  padding: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.load-error p {
  max-width: 48ch;
}

.loading-list {
  padding-top: 8px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 38px 106px minmax(0, 1fr) 130px;
  gap: 12px;
  align-items: center;
  height: 62px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.skeleton-row span {
  display: block;
  height: 9px;
  border-radius: 4px;
  background: #d7dace;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-row span:nth-child(1) {
  width: 16px;
}

.skeleton-row span:nth-child(2) {
  width: 72px;
}

.skeleton-row span:nth-child(3) {
  width: 72%;
}

.skeleton-row span:nth-child(4) {
  width: 58px;
}

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.95;
  }
}

.queue-foot {
  margin: 0;
  padding: 16px 12px 2px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #818b83;
}

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

.detail-shell {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--line-strong);
  background: var(--surface-sunken);
}

.detail-placeholder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  padding: 44px 34px 50px;
  overflow: hidden;
}

.detail-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(20, 32, 27, 0.055) 1px, transparent 1px), linear-gradient(to bottom, rgba(20, 32, 27, 0.055) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 2%, #000 35%, #000 70%, transparent 98%);
  mask-image: linear-gradient(to bottom, transparent 2%, #000 35%, #000 70%, transparent 98%);
  pointer-events: none;
}

.placeholder-mark {
  position: relative;
  width: 180px;
  max-width: 70%;
  margin-bottom: 26px;
}

.placeholder-mark svg {
  display: block;
  width: 100%;
  height: auto;
}

.ph-grid {
  fill: none;
  stroke: #d4d8cb;
  stroke-width: 1;
}

.ph-wire {
  fill: none;
  stroke: #78867c;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.ph-wire.muted {
  stroke: #a9b0a4;
}

.ph-node {
  fill: var(--surface-sunken);
  stroke: #78867c;
  stroke-width: 1.7;
}

.ph-node.hot {
  fill: var(--accent);
  stroke: var(--accent);
}

.ph-cut {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
}

.detail-placeholder h2 {
  position: relative;
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
}

.detail-placeholder > p {
  position: relative;
  max-width: 31ch;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--muted);
}

.placeholder-hint {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--surface);
  animation: detail-arrive 180ms ease-out both;
}

@keyframes detail-arrive {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail:focus {
  outline: none;
}

.detail-ink {
  flex: 0 0 auto;
  background: var(--ink);
  color: #f5f3ea;
}

.detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 0 24px;
}

.detail-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #a3b0a7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-line .lamp {
  width: 7px;
  height: 7px;
}

.detail-project {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #93a398;
}

.close-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #35483d;
  border-radius: 50%;
  background: #1b2a23;
  color: #d6dfd8;
  cursor: pointer;
  transition: background-color 140ms ease-out, color 140ms ease-out, border-color 140ms ease-out;
}

.close-button:hover {
  border-color: #4b6154;
  background: #273a30;
  color: #fffdf7;
}

.close-button .icon {
  width: 16px;
  height: 16px;
}

.detail-title-block {
  padding: 16px 24px 20px;
}

.detail-status-token {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 9px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #9cac9f;
}

.detail-status-token .lamp {
  width: 7px;
  height: 7px;
}

#detail-title {
  max-width: 30ch;
  margin: 0;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.018em;
  color: #f7f5ec;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 4px 7px 3px;
  border: 1px solid #3b4c41;
  border-radius: 4px;
  color: #c4d0c7;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-block {
  margin: 0 24px 22px;
  padding: 13px;
  border: 1px solid #33453a;
  border-radius: 7px;
  background: #1b2b23;
}

.status-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.status-block-head label {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #e8e5d9;
}

.status-block-head span {
  font-size: 9.5px;
  line-height: 1.2;
  color: #8c9d91;
}

.status-select-shell {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  border-radius: 5px;
  background: #f5f3e9;
  border: 1px solid #f5f3e9;
  transition: box-shadow 140ms ease-out, border-color 140ms ease-out;
}

.status-select-shell:focus-within {
  border-color: #f0a17f;
  box-shadow: 0 0 0 3px rgba(226, 78, 27, 0.33);
}

.status-select-shell > .lamp {
  position: absolute;
  left: 12px;
  width: 7px;
  height: 7px;
  pointer-events: none;
}

#status-control {
  appearance: none;
  width: 100%;
  height: 100%;
  padding: 0 38px 0 27px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  outline: none;
}

.status-select-shell .chevron {
  position: absolute;
  right: 11px;
  width: 17px;
  height: 17px;
  color: #556159;
  pointer-events: none;
}

.status-feedback {
  min-height: 17px;
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--signal);
}

.status-feedback.has-feedback {
  animation: feedback-in 190ms ease-out both;
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-note {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #3a4c41;
}

.filter-note p {
  margin: 0 0 6px;
  font-size: 10.5px;
  line-height: 1.45;
  color: #f0b9a4;
}

.filter-note-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid #d7e2d9;
  background: transparent;
  color: #f5f3ea;
  font-size: 10.5px;
  min-height: 32px;
  line-height: 1.5;
  cursor: pointer;
}

.filter-note-button:hover {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

/* ---------- Detail paper ---------- */

.detail-paper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 24px 34px;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: #b9beb2 transparent;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  margin: 0;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.meta-item {
  min-width: 0;
}

.meta-item-wide {
  grid-column: 1 / -1;
}

.meta-item dt {
  margin: 0 0 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.meta-item dd {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.owner-value,
.priority-value {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.owner-value .avatar {
  width: 24px;
  height: 24px;
  font-size: 7.5px;
}

.priority-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.priority-bars i {
  display: block;
  width: 3px;
  border-radius: 1px 1px 0 0;
  background: #ccd0c4;
}

.priority-bars i:nth-child(1) {
  height: 4px;
}

.priority-bars i:nth-child(2) {
  height: 7px;
}

.priority-bars i:nth-child(3) {
  height: 11px;
}

.priority-bars.level-1 i:nth-child(-n + 1),
.priority-bars.level-2 i:nth-child(-n + 2),
.priority-bars.level-3 i:nth-child(-n + 3) {
  background: var(--accent);
}

.body-block {
  margin-top: 24px;
}

.body-block h3 {
  margin: 0 0 11px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--ink);
}

.detail-body {
  max-width: 62ch;
  color: #2c3932;
  font-size: 14px;
  line-height: 1.66;
  white-space: pre-line;
}

.detail-body p {
  margin: 0 0 14px;
}

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

.detail-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 28px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.detail-foot .icon {
  width: 13px;
  height: 13px;
}

/* ---------- Scrim ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(7, 14, 10, 0.58);
  backdrop-filter: blur(2px);
}

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

@media (max-width: 1279px) {
  .masthead {
    padding: 26px 26px 16px;
  }

  h1 {
    font-size: 42px;
  }

  .toolbar {
    grid-template-columns: minmax(190px, 1fr) 170px auto;
    padding: 0 26px 14px;
  }

  .queue-scroll {
    padding: 0 26px 22px;
  }

  .table-head,
  .task-row {
    grid-template-columns: 34px 99px minmax(0, 1fr) 116px 68px 16px;
    gap: 10px;
  }

  .cell-owner {
    font-size: 10.5px;
  }

  .detail-title-block {
    padding: 15px 20px 18px;
  }

  .detail-bar {
    padding-left: 20px;
  }

  .status-block {
    margin: 0 20px 18px;
  }

  #detail-title {
    font-size: 22px;
  }

  .detail-paper {
    padding: 21px 20px 30px;
  }

  .detail-placeholder {
    padding: 36px 26px 42px;
  }
}

@media (max-width: 1199px) {
  .app {
    display: block;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 60px;
  }

  .rail {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 30;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 60px;
    min-height: 0;
    overflow: visible;
    padding: 0 20px;
    border-right: 0;
    border-bottom: 1px solid #0a130f;
  }

  .brand {
    gap: 10px;
    padding: 0;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .brand-name {
    font-size: 16px;
  }

  .brand-sub {
    display: none;
  }

  .rail-nav,
  .rail-note {
    display: none;
  }

  .rail-foot {
    margin: 0 0 0 auto;
    padding: 0;
  }

  .rail-session {
    font-size: 8px;
    color: #8c9d91;
  }

  .workspace {
    height: auto;
    min-height: calc(100vh - 60px);
    min-height: calc(100svh - 60px);
    overflow: visible;
  }

  .queue-scroll {
    flex: none;
    overflow: visible;
    padding-bottom: 34px;
  }

  .detail-shell {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    width: min(440px, 100%);
    border-left: 1px solid #0b1410;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), visibility 220ms;
  }

  body.detail-open .detail-shell {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  body.detail-open {
    overflow: hidden;
  }

  .detail-placeholder {
    display: none;
  }

  .scrim {
    display: block;
  }
}

@media (max-width: 760px) {
  .masthead {
    padding: 22px 18px 14px;
  }

  h1 {
    font-size: 38px;
  }

  .lede {
    margin-top: 9px;
    font-size: 12px;
  }

  .team-block {
    display: none !important;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 11px;
    padding: 0 18px 14px;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .filter-field {
    grid-column: 1;
    min-width: 0;
  }

  .toolbar-meta {
    grid-column: 2;
    min-height: 42px;
    gap: 8px;
  }

  .result-count {
    font-size: 9px;
    letter-spacing: 0.05em;
  }

  .reset-button {
    padding: 0 8px;
  }

  .queue-scroll {
    padding: 0 10px 30px;
  }

  .table-head {
    display: none;
  }

  .task-row {
    grid-template-columns: 30px minmax(0, 1fr) 18px;
    grid-template-areas:
      "no main arrow"
      "no details arrow";
    gap: 5px 9px;
    align-items: start;
    padding: 13px 10px 14px;
  }

  .cell-no {
    grid-area: no;
    grid-column: auto;
    padding-top: 3px;
  }

  .cell-main {
    grid-area: main;
    grid-column: auto;
  }

  .cell-arrow {
    grid-area: arrow;
    grid-column: auto;
    padding-top: 2px;
  }

  .cell-details {
    grid-area: details;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 10px;
    padding-top: 1px;
  }

  .cell-status {
    grid-column: auto;
    font-size: 10.5px;
  }

  .cell-owner {
    grid-column: auto;
    font-size: 10px;
  }

  .cell-owner .avatar {
    width: 20px;
    height: 20px;
    font-size: 6.5px;
  }

  .cell-due {
    grid-column: auto;
    margin-left: auto;
    font-size: 9.5px;
  }

  .row-title {
    font-size: 14.5px;
  }

  .row-meta {
    margin-top: 4px;
    font-size: 10px;
  }

  .empty-state {
    padding: 34px 20px 38px;
  }

  .empty-art {
    width: 210px;
  }

  .queue-foot {
    padding-left: 10px;
  }

  .detail-shell {
    width: 100%;
  }

  .detail-bar {
    padding: 12px 16px 0 18px;
  }

  .close-button {
    width: 44px;
    height: 44px;
  }

  .reset-button {
    min-height: 44px;
  }

  .detail-title-block {
    padding: 14px 18px 16px;
  }

  #detail-title {
    font-size: 23px;
  }

  .status-block {
    margin: 0 18px 18px;
  }

  .detail-paper {
    padding: 20px 18px 30px;
  }

  .scrim {
    backdrop-filter: blur(1.5px);
  }
}

@media (max-width: 380px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-meta {
    grid-column: 1;
    justify-content: space-between;
    min-height: 0;
  }

  .filter-field {
    grid-column: 1;
  }

  .detail-bar,
  .detail-title-block,
  .status-block,
  .detail-paper {
    padding-left: 14px;
    padding-right: 14px;
  }

  .status-block {
    margin-left: 14px;
    margin-right: 14px;
  }
}

@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;
  }
}
