/* ==========================================================================
   Dispatch — team task inbox
   Fonts from the supplied local pool (public/assets). No remote resources.
   ========================================================================== */

@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: 'Work Sans';
  src: url('assets/work-sans.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/ibm-plex-mono.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------- tokens -- */
:root {
  --display: 'Space Grotesk', 'Work Sans', system-ui, -apple-system, sans-serif;
  --text: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --paper: #f4f2ed;
  --paper-2: #efece5;
  --card: #ffffff;
  --ink: #15171c;
  --ink-2: #474b53;
  --ink-3: #5f646c; /* 5:1 on the warm paper tones — safe for small labels */
  --line: #e3dfd6;
  --line-2: #efece6;

  --accent: #1f4fd8;
  --accent-ink: #15349a;
  --accent-soft: #e9edff;

  --todo: #46505f;
  --todo-bg: #ecf0f4;
  --in-progress: #94530b;
  --in-progress-bg: #fbeedb;
  --blocked: #a92026;
  --blocked-bg: #fbe8e8;
  --done: #0e6b51;
  --done-bg: #e1f2ea;

  --focus: #1f4fd8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.07);
  --shadow-lg: 0 1px 2px rgba(20, 22, 28, 0.06), 0 18px 40px -20px rgba(20, 22, 28, 0.32);

  --rail-w: 268px;
  --detail-w: 428px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101217;
    --paper-2: #171a20;
    --card: #1a1d24;
    --ink: #f2f1ee;
    --ink-2: #c5c9d1;
    --ink-3: #9aa0ab;
    --line: #2b303a;
    --line-2: #232832;

    --accent: #93aaff;
    --accent-ink: #b9c6ff;
    --accent-soft: #1e2740;

    --todo: #b3bdcc;
    --todo-bg: #262c36;
    --in-progress: #efb765;
    --in-progress-bg: #34291a;
    --blocked: #ff9d9d;
    --blocked-bg: #3a2122;
    --done: #76d6b3;
    --done-bg: #14302a;

    --focus: #93aaff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
}

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

/* The `hidden` attribute must win over any display rule below. */
[hidden] {
  display: none !important;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.2;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

p {
  margin: 0;
}

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

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s var(--ease);
}
.skip:focus {
  top: 12px;
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

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

@media (min-width: 1180px) {
  .app {
    height: 100vh;
    height: 100dvh;
  }
  .app.has-detail {
    grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--detail-w);
  }
}

/* ----------------------------------------------------------------- rail -- */
.rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 4px;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  padding: 20px 14px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 18px;
}

.brand__mark svg {
  width: 34px;
  height: 34px;
  display: block;
}
.brand__mark rect {
  fill: var(--accent);
}
.brand__mark path {
  stroke: var(--card);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand__text strong {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand__text small {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 3px;
}

.rail__scroll {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
}

.rail__heading {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 8px 8px;
}

.viewlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.viewbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--ink-2);
  font-weight: 500;
  transition: background-color 0.12s var(--ease), color 0.12s var(--ease);
}
.viewbtn:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
}
.viewbtn[aria-current='true'] {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.viewbtn__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--ink-3);
}
.viewbtn__dot[data-status='all'] {
  background: var(--accent);
}
.viewbtn__dot[data-status='todo'] {
  background: var(--todo);
}
.viewbtn__dot[data-status='in-progress'] {
  background: var(--in-progress);
}
.viewbtn__dot[data-status='blocked'] {
  background: var(--blocked);
}
.viewbtn__dot[data-status='done'] {
  background: var(--done);
}

.viewbtn__label {
  flex: 1 1 auto;
  min-width: 0;
}

.viewbtn__count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.viewbtn[aria-current='true'] .viewbtn__count {
  color: var(--ink-2);
}

.chiplist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 6px;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease),
    background-color 0.12s var(--ease);
}
.chip:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--ink);
}
.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip__n {
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0.7;
}
@media (prefers-color-scheme: dark) {
  .chip[aria-pressed='true'] {
    color: #0f1218;
  }
}

.peoplelist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.person {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 8px;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background-color 0.12s var(--ease);
}
.person:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
}
.person[aria-pressed='true'] {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.person__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person__n {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.avatar--sm {
  width: 21px;
  height: 21px;
  font-size: 9.5px;
}
.avatar--all {
  font-size: 7.5px;
  letter-spacing: 0;
  background: var(--paper);
  color: var(--ink-3);
  border-color: var(--line);
}

.rail__foot {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.45;
}

/* ----------------------------------------------------------------- main -- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 22px 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.topbar__titles h1 {
  font-size: 26px;
  letter-spacing: -0.025em;
}

.topbar__sub {
  color: var(--ink-3);
  font-size: 13.5px;
  margin-top: 4px;
}

.rail-toggle {
  display: none;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.field--grow {
  flex: 1 1 240px;
}

.field__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.field__wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field__icon {
  position: absolute;
  left: 11px;
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  pointer-events: none;
}

.field input[type='search'] {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  -webkit-appearance: none;
  appearance: none;
}
.field input[type='search']::placeholder {
  color: var(--ink-3);
}
.field input[type='search']:focus-visible,
.field select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field__wrap--select::after {
  content: '';
  position: absolute;
  right: 12px;
  width: 9px;
  height: 9px;
  border-right: 1.8px solid var(--ink-3);
  border-bottom: 1.8px solid var(--ink-3);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}

.field select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 170px;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.12s var(--ease), border-color 0.12s var(--ease),
    color 0.12s var(--ease);
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--accent-ink);
}
.btn--ghost {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 25%, var(--line));
}
.btn--link {
  padding: 4px 6px;
  color: var(--accent);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn--link:hover {
  color: var(--accent-ink);
}
@media (prefers-color-scheme: dark) {
  .btn--primary {
    color: #0f1218;
  }
}

/* ------------------------------------------------------- active filters -- */
.activefilters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}
.activefilters__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.activefilters__list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tagbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.tagbtn:hover {
  border-color: var(--accent);
}
.tagbtn svg {
  width: 11px;
  height: 11px;
}

/* ----------------------------------------------------------------- list -- */
.listwrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 28px 40px;
}

.resultline {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 2px 12px;
}

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

.task {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 15px 18px 15px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.14s var(--ease), transform 0.14s var(--ease),
    box-shadow 0.14s var(--ease);
}
.task:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.task.is-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}
.task.is-changed {
  animation: flash 1.1s var(--ease);
}

@keyframes flash {
  0% {
    background: var(--accent-soft);
  }
  100% {
    background: var(--card);
  }
}

.task__bar {
  flex: none;
  width: 4px;
  border-radius: 999px;
  background: var(--todo);
}
.task__bar[data-status='todo'] {
  background: var(--todo);
}
.task__bar[data-status='in-progress'] {
  background: var(--in-progress);
}
.task__bar[data-status='blocked'] {
  background: var(--blocked);
}
.task__bar[data-status='done'] {
  background: var(--done);
}

.task__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.task__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--todo-bg);
  color: var(--todo);
  white-space: nowrap;
}
.pill[data-status='todo'] {
  background: var(--todo-bg);
  color: var(--todo);
}
.pill[data-status='in-progress'] {
  background: var(--in-progress-bg);
  color: var(--in-progress);
}
.pill[data-status='blocked'] {
  background: var(--blocked-bg);
  color: var(--blocked);
}
.pill[data-status='done'] {
  background: var(--done-bg);
  color: var(--done);
}

.task__project {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.prio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-3);
}
.prio::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink-3);
  transform: rotate(45deg);
}
.prio[data-prio='high']::before {
  background: var(--blocked);
}
.prio[data-prio='medium']::before {
  background: var(--in-progress);
}
.prio[data-prio='low']::before {
  background: var(--todo);
  opacity: 0.7;
}

.task__title {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.task__open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.task__open::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.task__open:hover {
  color: var(--accent-ink);
}
.task__open:focus-visible {
  outline: none;
}
.task__open:focus-visible::after {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.task__summary {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.task__who {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-weight: 500;
}

.meta__date {
  font-family: var(--mono);
  font-size: 11.5px;
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line);
  flex: none;
}

.tags {
  display: inline-flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tag {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  font-size: 11px;
  color: var(--ink-2);
}

.task__chev {
  flex: none;
  align-self: center;
  width: 18px;
  height: 18px;
  color: var(--ink-3);
  transition: transform 0.14s var(--ease), color 0.14s var(--ease);
}
.task:hover .task__chev {
  color: var(--accent);
  transform: translateX(2px);
}

/* ---------------------------------------------------------- empty state -- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 46px 24px 56px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty__art {
  width: 132px;
  height: 88px;
}
.empty__row {
  fill: var(--paper-2);
}
.empty__lens {
  fill: var(--card);
  fill: color-mix(in srgb, var(--accent) 10%, var(--card));
  stroke: var(--accent);
  stroke-width: 3;
}
.empty__handle {
  stroke: var(--accent);
  stroke-width: 4;
  fill: none;
}
.empty h2 {
  font-size: 19px;
  margin-top: 4px;
}
.empty p {
  color: var(--ink-2);
  font-size: 14px;
  max-width: 46ch;
}
.empty__actions {
  margin-top: 8px;
}

/* --------------------------------------------------------------- detail -- */
.detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border-left: 1px solid var(--line);
}

.detail[hidden] {
  display: none;
}

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

.detail__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail__scroll:focus {
  outline: none;
}

.detail__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.detail__title {
  font-size: 24px;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 16px;
  padding: 15px 16px;
  background: var(--paper-2);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.facts dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 3px;
}
.facts dd {
  color: var(--ink);
  min-width: 0;
}
.facts .fact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail__body {
  display: flex;
  flex-direction: column;
  gap: 13px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
}
.detail__body p.is-outcome {
  padding: 13px 15px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
}

.statusbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.statusbox__title {
  font-size: 15px;
}
.statusbox .field select {
  min-width: 0;
}

/* Always rendered while the detail is open so the live region is reliable. */
.feedback {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink-3);
}
.feedback.is-done {
  background: var(--done-bg);
  color: var(--done);
}
.feedback.is-done::before {
  content: '';
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border-radius: 50%;
  background: currentColor;
  -webkit-mask: no-repeat center / 11px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.6l3.1 3.1L13 4.9' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask: no-repeat center / 11px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.6l3.1 3.1L13 4.9' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.feedback strong {
  font-weight: 600;
}
.feedback small {
  display: block;
  color: var(--ink-2);
  font-size: 12.5px;
  margin-top: 2px;
}

.activity__title {
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.activity__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.activity__item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.activity__time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  flex: none;
  padding-top: 1px;
}
.activity__empty {
  color: var(--ink-3);
  font-size: 13px;
}

/* ---------------------------------------------------------------- scrim -- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(18, 20, 26, 0.42);
  backdrop-filter: blur(1.5px);
}
.scrim[hidden] {
  display: none;
}

/* ---------------------------------------------------------------- toast -- */
.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: none; /* never intercepts clicks on the list beneath it */
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.22s var(--ease);
}
.toast[hidden] {
  display: none;
}
.toast__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.toast__dot[data-status='todo'] {
  background: #aeb7c6;
}
.toast__dot[data-status='in-progress'] {
  background: #efb765;
}
.toast__dot[data-status='blocked'] {
  background: #ff9d9d;
}
.toast__dot[data-status='done'] {
  background: #76d6b3;
}

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

/* ================================================= detail as overlay === */
@media (max-width: 1179px) {
  .detail {
    position: fixed;
    z-index: 30;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(460px, 100vw);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    animation: slide-in 0.24s var(--ease);
  }
  @keyframes slide-in {
    from {
      transform: translateX(14px);
      opacity: 0.6;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
}

/* ========================================================= narrow ===== */
@media (max-width: 899px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .rail {
    position: fixed;
    z-index: 25;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.24s var(--ease), visibility 0.24s;
  }
  .rail[data-open='true'] {
    transform: translateX(0);
    visibility: visible;
  }

  .rail-toggle {
    display: inline-flex;
    margin-top: 2px;
  }

  .topbar {
    padding: 16px 16px 14px;
    gap: 14px;
  }
  .topbar__titles h1 {
    font-size: 21px;
  }
  .topbar__sub {
    font-size: 12.5px;
  }

  .toolbar {
    gap: 10px;
  }
  .field {
    flex: 1 1 calc(50% - 5px);
  }
  .field--grow {
    flex: 1 1 100%;
  }
  .field select {
    min-width: 0;
  }

  .listwrap {
    padding: 14px 16px 48px;
    overflow: visible;
  }

  .task {
    padding: 14px 14px 14px 12px;
  }
  .task__title {
    font-size: 16px;
  }
  .task__chev {
    display: none;
  }

  .detail {
    width: 100%;
    border-left: 0;
  }
  .detail__scroll {
    padding: 18px 16px 48px;
  }
  .detail__title {
    font-size: 21px;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px 0;
  }
  .facts dt {
    padding-top: 9px;
  }
  .facts dt:first-of-type {
    padding-top: 0;
  }

  @keyframes slide-in {
    from {
      transform: translateY(16px);
      opacity: 0.4;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .toast {
    bottom: 16px;
    width: calc(100% - 32px);
    justify-content: center;
  }
}

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