/* Relay — dispatch console
   Type: Space Grotesk (display/UI) + IBM Plex Mono (metadata)
   Palette: cool paper, ink navy, signal lime */

@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: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0d1b2c;
  --ink-2: #16283e;
  --ink-3: #223954;
  --paper: #e8edf3;
  --surface: #f8fafc;
  --white: #ffffff;
  --line: #c4cfdd;
  --line-soft: #dbe3ed;
  --muted: #526277;
  --muted-dark: #9db0c6;
  --lime: #d7f45c;
  --lime-deep: #a9c92c;
  --blue: #2459ff;
  --rust: #a93c1c;
  --green: #2c6b36;
  --amber: #8a6413;
  --rail-w: 268px;
  --radius: 3px;
  --font-ui: "Space Grotesk", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--paper); }

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

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }

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

.rail :focus-visible,
.detail-bar :focus-visible,
.status-block :focus-visible {
  outline-color: var(--lime);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--white);
  border: 2px solid var(--lime);
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- shell + rail ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  background: var(--ink);
  color: #e8eef6;
  padding: 28px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  position: relative;
  overflow: hidden;
}

.rail::after {
  content: "";
  position: absolute;
  inset: auto -120px -160px auto;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(215, 244, 92, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(215, 244, 92, .045), 0 0 0 70px rgba(215, 244, 92, .03);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  color: var(--lime);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 244, 92, .45);
  border-radius: 50%;
  flex: none;
}
.brand-mark svg { width: 26px; height: 26px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-dark);
  margin-top: 4px;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: #cfdae7;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
}
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover { background: rgba(255, 255, 255, .06); }
.nav-link.is-current {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime);
  font-weight: 600;
}
.nav-link.is-current:hover { background: var(--lime); }
.nav-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  background: rgba(13, 27, 44, .16);
  border-radius: 2px;
  padding: 1px 7px;
}

.rail-section { display: flex; flex-direction: column; gap: 10px; }

.rail-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-dark);
}

.status-list { display: flex; flex-direction: column; gap: 1px; }

.status-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #c6d3e2;
  text-align: left;
  font-size: 13.5px;
  transition: background .14s ease, border-color .14s ease;
}
.status-row:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .08); }
.status-row[aria-pressed="true"] {
  background: rgba(215, 244, 92, .09);
  border-color: rgba(215, 244, 92, .38);
  color: var(--white);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--muted-dark);
}
.status-dot[data-status="todo"] { background: #a8bdd5; }
.status-dot[data-status="in-progress"] { background: #6f9bff; }
.status-dot[data-status="blocked"] { background: #ff8a63; }
.status-dot[data-status="done"] { background: #76c47f; }
.status-row-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-dark);
}
.status-row[aria-pressed="true"] .status-row-count { color: var(--lime); }

.rail-hint {
  font-size: 11.5px;
  line-height: 1.5;
  color: #7f93aa;
  padding: 0 10px;
}

.team-list { display: flex; flex-direction: column; gap: 2px; }
.team-member {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px;
  font-size: 12.5px;
  color: #c6d3e2;
}
.team-member .avatar { width: 24px; height: 24px; font-size: 9px; }
.team-member .team-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #7f93aa;
}

.rail-footer {
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: #91a4ba;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.rail-fineprint { width: 100%; color: #8297ad; }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime) ;
  box-shadow: 0 0 0 3px rgba(215, 244, 92, .18);
  display: inline-block;
  flex: none;
}

/* ---------- main ---------- */

.main {
  padding: 38px clamp(24px, 4.2vw, 62px) 44px;
  max-width: 1280px;
  width: 100%;
  background-image:
    radial-gradient(circle at 88% -8%, rgba(215, 244, 92, .16), transparent 38%),
    linear-gradient(rgba(13, 27, 44, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 27, 44, .035) 1px, transparent 1px);
  background-size: auto, 38px 38px, 38px 38px;
}

.page-head { display: flex; flex-direction: column; gap: 16px; }

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

.kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  vertical-align: middle;
  margin-right: 9px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .65);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 2px;
}
.live-pill .live-dot { background: var(--lime-deep); box-shadow: none; }

.head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
}

h1 {
  font-size: clamp(48px, 6.1vw, 78px);
  line-height: .95;
  font-weight: 600;
  letter-spacing: -.045em;
  color: var(--ink);
  margin: 0 0 14px;
}

.intro {
  color: var(--muted);
  max-width: 47ch;
  font-size: 15px;
  line-height: 1.6;
}

.head-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0;
  border: 1px solid var(--line);
  background: rgba(248, 250, 252, .78);
  border-radius: var(--radius);
}
.head-stats > div {
  padding: 12px 16px 11px;
  min-width: 88px;
  border-left: 1px solid var(--line-soft);
}
.head-stats > div:first-child { border-left: 0; }
.head-stats dt {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.head-stats dd {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
  white-space: nowrap;
}
.head-stats > div:nth-child(2) dd { color: var(--rust); }

/* ---------- toolbar ---------- */

.toolbar {
  margin-top: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 14px;
  align-items: end;
}

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.input-wrap > svg {
  position: absolute;
  left: 14px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.input-wrap input::placeholder { color: #8796a8; }
.input-wrap input:hover { border-color: #9dabbe; }
.input-wrap input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(36, 89, 255, .18);
}
.input-wrap input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.clear-search {
  position: absolute;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
}
.clear-search:hover { background: var(--paper); color: var(--ink); }
.clear-search svg { width: 14px; height: 14px; }

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 48px;
  padding: 0 40px 0 14px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.select-wrap select:hover { border-color: #9dabbe; }
.select-wrap select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(36, 89, 255, .18);
}
.select-wrap select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.select-wrap > svg {
  position: absolute;
  right: 13px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  color: var(--ink-2);
}

/* ---------- list ---------- */

.list-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0 12px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--ink);
}
.list-bar h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.result-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  text-align: right;
}

.task-list { display: flex; flex-direction: column; gap: 9px; }

.task {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 224px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  position: relative;
}
.task:hover {
  border-color: #8ba0b8;
  box-shadow: 4px 4px 0 rgba(13, 27, 44, .08);
}
.task:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(13, 27, 44, .18);
}

.task-index {
  border-right: 1px solid var(--line-soft);
  padding: 19px 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #63758a;
  background: rgba(232, 237, 243, .45);
  border-radius: var(--radius) 0 0 var(--radius);
}

.task-main {
  min-width: 0;
  padding: 17px 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.project-name { color: var(--ink-2); font-weight: 500; }
.eyebrow-sep { color: var(--line); }
.priority-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.priority-flag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9aa9ba;
}
.priority-flag[data-priority="high"] { color: var(--rust); }
.priority-flag[data-priority="high"]::before { background: var(--rust); }
.priority-flag[data-priority="medium"]::before { background: var(--amber); }
.priority-flag[data-priority="low"]::before { background: #7d93a9; }

.open-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--ink);
  font: inherit;
  border-radius: 2px;
}
.open-item .task-title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -.022em;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: text-decoration-color .15s ease;
}
.task:hover .open-item .task-title { text-decoration-color: var(--lime-deep); }
.open-item:hover .task-title { text-decoration-color: var(--ink); }
.open-arrow {
  margin-left: auto;
  align-self: center;
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-2);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.open-arrow svg { width: 14px; height: 14px; }
.task:hover .open-arrow {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--lime);
  transform: translateX(2px);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .65);
  padding: 2px 6px;
  border-radius: 1px;
  white-space: nowrap;
}

.task-meta {
  border-left: 1px solid var(--line-soft);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status-pill[data-status="todo"] { background: #e8edf4; color: #46586d; border-color: #cbd6e3; }
.status-pill[data-status="in-progress"] { background: #e2ebff; color: #1e49b8; border-color: #bccff8; }
.status-pill[data-status="blocked"] { background: #fce6dd; color: #9c3a1c; border-color: #f1c7b7; }
.status-pill[data-status="done"] { background: #e3f1e0; color: #2c6b36; border-color: #c1ddba; }

.meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  min-width: 0;
  max-width: 100%;
}
.meta-line svg { width: 13px; height: 13px; flex: none; color: #7d8ea2; }
.meta-line .meta-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assignee-line { width: 100%; }

.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .02em;
  background: #dbe4ef;
  color: var(--ink-2);
  border: 1px solid #c3d0df;
  flex: none;
}
.avatar[data-person="Maya Chen"] { background: #e6f0cf; border-color: #c8dca2; color: #43541a; }
.avatar[data-person="Theo Martin"] { background: #e3e9ff; border-color: #c0cdf5; color: #2b3f8f; }
.avatar[data-person="Asha Patel"] { background: #fbe8dd; border-color: #eac8b4; color: #7c4325; }
.avatar[data-person="Jon Bell"] { background: #e5f2e4; border-color: #c3ddc2; color: #315f36; }
.avatar[data-person="Luis Romero"] { background: #f3e6f4; border-color: #ddc3df; color: #643a68; }
.avatar[data-person="Sam Ellis"] { background: #e1f0f1; border-color: #bedadc; color: #2a5b5f; }

/* highlight when a status just changed in the open sheet */
.task.just-updated { animation: rowFlash 1.4s ease; }
@keyframes rowFlash {
  0% { background: #f4fbdc; border-color: var(--lime-deep); }
  100% { background: var(--surface); }
}

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

.empty-state {
  margin-top: 8px;
  border: 1px dashed #9dabbe;
  background: rgba(248, 250, 252, .72);
  border-radius: var(--radius);
  padding: 46px 26px 42px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-mark { color: var(--ink-3); display: block; }
.empty-mark svg { width: 48px; height: 48px; }
.empty-state h2 {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.2;
}
.empty-state p { color: var(--muted); font-size: 14px; max-width: 46ch; }

.btn-reset {
  margin-top: 8px;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.btn-reset:hover { background: var(--lime); color: var(--ink); border-color: var(--ink); }

.page-footer {
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .03em;
  color: #718296;
}
.page-footer-note { color: #8b99aa; }

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

.detail-dialog {
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  width: min(620px, 100vw);
  max-width: 620px;
  height: 100dvh;
  max-height: 100dvh;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}
.detail-dialog::backdrop {
  background: rgba(8, 17, 30, .55);
  backdrop-filter: blur(2px);
}

.detail-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid #071321;
  box-shadow: -28px 0 70px rgba(4, 12, 23, .28);
  overflow: hidden;
}

.detail-bar {
  background: var(--ink);
  color: var(--white);
  padding: 16px 22px 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  border-bottom: 3px solid var(--lime);
}
.detail-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lime);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.close-detail {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .3);
  color: var(--white);
  border-radius: 2px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 500;
  flex: none;
  transition: background .15s ease, color .15s ease;
}
.close-detail:hover { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.close-detail svg { width: 14px; height: 14px; }

.detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overscroll-behavior: contain;
}

.detail-heading { display: flex; flex-direction: column; gap: 12px; }
.detail-label-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.detail-project {
  background: var(--lime);
  color: var(--ink);
  padding: 3px 8px;
  font-weight: 400;
  border: 1px solid var(--lime-deep);
}
.detail-priority { color: var(--muted); }
.detail-priority::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8496aa;
  vertical-align: 1px;
  margin-right: 5px;
}
.detail-priority[data-priority="high"] { color: var(--rust); }
.detail-priority[data-priority="high"]::before { background: var(--rust); }
.detail-priority[data-priority="medium"]::before { background: var(--amber); }

.detail-heading h2 {
  font-size: clamp(29px, 3.2vw, 38px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.035em;
}
.detail-heading .tag-row .tag { font-size: 9.5px; padding: 3px 7px; }

.status-block {
  background: var(--ink);
  color: #e9f0f7;
  border-left: 4px solid var(--lime);
  padding: 18px 20px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px 20px;
  align-items: center;
  border-radius: 2px;
}
.status-block h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 3px;
}
.status-block-copy p {
  font-size: 12.5px;
  line-height: 1.5;
  color: #9fb2c8;
  max-width: 30ch;
}
.status-control-wrap { display: flex; flex-direction: column; gap: 5px; }
.status-control-wrap > label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lime);
}
.select-wrap--dark select {
  height: 42px;
  background: #f4f7ed;
  border-color: #f4f7ed;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}
.select-wrap--dark select:hover { border-color: var(--lime); }
.select-wrap--dark > svg { color: var(--ink); }

.status-feedback {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--lime);
  min-height: 0;
}
.status-feedback:empty { display: none; }

.detail-section { display: flex; flex-direction: column; gap: 10px; }
.detail-section h3 {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.detail-body {
  font-size: 16px;
  line-height: 1.68;
  color: #24364b;
  white-space: pre-line;
}

.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.fact-grid > div { background: var(--surface); padding: 12px 14px; }
.fact-grid dt {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.fact-grid dd { font-size: 14px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }

.detail-footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.btn-back:hover { background: var(--ink); color: var(--lime); }
.btn-back svg { width: 16px; height: 16px; }
.detail-footnote {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: .02em;
  color: #8494a6;
  max-width: 26ch;
}

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  max-width: min(360px, calc(100vw - 32px));
  background: var(--ink);
  color: var(--white);
  border-left: 4px solid var(--lime);
  box-shadow: 0 14px 40px rgba(4, 12, 23, .3);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

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

@media (max-width: 1020px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    flex-direction: row;
    align-items: center;
    gap: 22px;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 3px solid var(--lime);
  }
  .rail::after { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 19px; }
  .brand-sub { font-size: 8.5px; }
  .rail-nav { flex-direction: row; }
  .nav-link { padding: 8px 12px; }
  .nav-link.is-current { background: var(--lime); }
  .rail-section, .rail-footer { display: none; }
  .main { padding-top: 28px; }
  .head-grid { grid-template-columns: 1fr; gap: 20px; }
  .head-stats { justify-self: start; }
  .toolbar { grid-template-columns: minmax(0, 1fr) 220px; }
}

@media (max-width: 700px) {
  .rail { padding: 12px 16px; gap: 12px; justify-content: space-between; }
  .brand { gap: 9px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .brand-name { font-size: 18px; }
  .brand-sub { display: none; }
  .nav-link { padding: 7px 10px; font-size: 14px; gap: 7px; }
  .nav-link svg { width: 15px; height: 15px; }
  .nav-count { font-size: 10px; padding: 1px 6px; }

  .main { padding: 22px 16px 32px; }

  .head-topline { padding-bottom: 9px; }
  .kicker { font-size: 9px; letter-spacing: .14em; }
  .kicker::before { width: 12px; }
  .live-pill { font-size: 8.5px; padding: 3px 7px; }
  h1 { font-size: 46px; margin-bottom: 10px; }
  .intro { font-size: 13.5px; line-height: 1.55; }
  .head-stats { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .head-stats > div { padding: 10px 12px; min-width: 0; }
  .head-stats dt { font-size: 8.5px; }
  .head-stats dd { font-size: 19px; }

  .toolbar { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
  .field > label { font-size: 9.5px; }
  .input-wrap input, .select-wrap select { height: 46px; }
  .filter-field { max-width: none; }

  .list-bar { margin-top: 24px; }
  .list-bar h2 { font-size: 11px; }
  .result-count { font-size: 9px; }

  .task { grid-template-columns: 38px minmax(0, 1fr); }
  .task-index { padding-top: 17px; font-size: 9.5px; }
  .task-main { padding: 14px 14px 12px; gap: 7px; }
  .task-eyebrow { font-size: 8.5px; gap: 7px; letter-spacing: .09em; }
  .open-item { gap: 8px; }
  .open-item .task-title { font-size: 17.5px; }
  .open-arrow { width: 26px; height: 26px; }
  .open-arrow svg { width: 12px; height: 12px; }
  .tag { font-size: 8px; padding: 2px 5px; }

  .task-meta {
    grid-column: 2;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
    padding: 10px 14px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px 14px;
    background: rgba(232, 237, 243, .4);
  }
  .status-pill { font-size: 8.5px; }
  .meta-line { font-size: 9.5px; }
  .assignee-line { width: auto; }
  .task-meta .comments { margin-left: auto; }

  .empty-state { padding: 36px 20px 34px; }
  .empty-state h2 { font-size: 20px; }

  .page-footer { font-size: 8.5px; line-height: 1.6; }

  .detail-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }
  .detail-panel { border-left: 0; }
  .detail-bar { padding: 13px 16px; }
  .detail-scroll { padding: 20px 18px 30px; gap: 24px; }
  .detail-heading h2 { font-size: 30px; }
  .status-block { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .status-control-wrap { width: 100%; }
  .fact-grid { grid-template-columns: 1fr; }
  .detail-footer { align-items: flex-start; flex-direction: column; }
  .detail-footnote { max-width: none; }
  .toast { right: 16px; bottom: 16px; left: 16px; max-width: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .detail-dialog[open] { animation: sheetIn .3s cubic-bezier(.2, .7, .2, 1); }
  .detail-dialog[open]::backdrop { animation: backdropIn .3s ease; }
  @keyframes sheetIn {
    from { transform: translateX(36px); opacity: .4; }
    to { transform: translateX(0); opacity: 1; }
  }
  @keyframes backdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

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