/* Relay — team task inbox. Operate surface, restrained palette. */

@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype-variations");
  font-weight: 400 1000;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400 600;
  font-display: swap;
  font-style: normal;
}

:root {
  --app-bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --sidebar-bg: #fbfbfd;
  --ink: #14171e;
  --ink-2: #414756;
  --muted: #5b6271;
  --faint: #6a7283;
  --border: #e3e7ee;
  --border-strong: #d3d9e3;
  --ring: #0b6a50;

  --brand: #0b6a50;
  --brand-2: #0a5d47;
  --brand-tint: #e7f3ee;
  --brand-tint-2: #d3e9df;

  --todo: #6b7280;
  --todo-bg: #eef0f4;
  --todo-ink: #4b5160;
  --prog: #b4630c;
  --prog-bg: #fbf0dd;
  --prog-ink: #8a4d09;
  --blocked: #c0354a;
  --blocked-bg: #fbe6ea;
  --blocked-ink: #962136;
  --done: #1c7a3c;
  --done-bg: #e6f1ea;
  --done-ink: #165d2e;

  --shadow-1: 0 1px 2px rgba(20, 23, 30, 0.04), 0 1px 1px rgba(20, 23, 30, 0.03);
  --shadow-2: 0 6px 18px rgba(20, 23, 30, 0.08), 0 2px 6px rgba(20, 23, 30, 0.04);
  --shadow-3: 0 22px 48px rgba(18, 22, 30, 0.18), 0 6px 16px rgba(18, 22, 30, 0.08);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --ui: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --sidebar-w: 264px;
  --detail-w: 540px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--ui);
  background: var(--app-bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

::selection { background: var(--brand-tint-2); color: var(--brand-2); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ring) 45%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.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: -48px; left: 12px; z-index: 200;
  background: var(--ink); color: #fff;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
  transition: top 150ms ease;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 22px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 0;
}
.brand__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(155deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 3px 8px rgba(11, 106, 80, 0.32);
}
.brand__name {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.nav { display: flex; flex-direction: column; gap: 8px; }
.nav__label {
  margin: 0 0 2px;
  padding: 0 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.nav__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.nav__item:hover { background: var(--surface); color: var(--ink); }
.nav__item.is-active {
  background: var(--brand-tint);
  color: var(--brand-2);
  border-color: var(--brand-tint-2);
  font-weight: 600;
}
.nav__icon { color: inherit; display: inline-flex; }
.nav__text { flex: 1; }
.nav__count {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--faint);
  background: var(--surface);
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.nav__item.is-active .nav__count { color: var(--brand-2); border-color: var(--brand-tint-2); background: #fff; }

.nav__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.nav--team .nav__item { gap: 9px; }
.nav__avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 0.6875rem; font-weight: 700; color: #fff;
  letter-spacing: 0.01em;
}
.nav__avatar small { font-family: var(--mono); }

.sidebar__foot { margin-top: auto; padding: 10px 10px 2px; }
.sidebar__note { font-size: 0.75rem; color: var(--faint); margin: 0; line-height: 1.45; }

/* ---------- Main ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 26px 32px 40px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.topbar__title h1 {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.topbar__sub {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.topbar__search { flex: 1; max-width: 420px; }
.search {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-1);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint), var(--shadow-1);
}
.search__icon { color: var(--muted); display: inline-flex; flex: none; }
.search__input {
  flex: 1; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 0.9375rem; color: var(--ink);
  caret-color: var(--brand);
  min-width: 0;
}
.search__input::placeholder { color: var(--faint); }
.search__input::-webkit-search-cancel-button { display: none; }

/* ---------- Controls ---------- */
.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 16px;
}
.control { display: flex; flex-direction: column; gap: 5px; }
.control__label {
  font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--faint);
  padding-left: 2px;
}
.select { position: relative; display: inline-flex; }
.select__el {
  appearance: none;
  font: inherit; font-size: 0.875rem; font-weight: 500;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 34px 8px 12px;
  cursor: pointer;
  min-width: 150px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.select__el:hover { border-color: var(--ink-2); }
.select__el:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); outline: none; }
.select__chevron {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; display: inline-flex;
}
.control__clear { margin-left: 4px; }

.result-count {
  margin: 0 0 0 auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 0.875rem; font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(11,106,80,0.28); }
.btn--primary:hover { background: var(--brand-2); }
.btn--ghost { background: transparent; color: var(--muted); border-color: var(--border-strong); }
.btn--ghost:hover { color: var(--ink); border-color: var(--ink-2); background: var(--surface-2); }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }
.icon-btn:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); outline: none; }

/* ---------- Task list ---------- */
.list-wrap { flex: 1; min-height: 0; }
.list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.task {
  position: relative;
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 0 18px;
  padding: 16px 18px 16px 0;
  border-top: 1px solid var(--border);
  transition: background-color 130ms ease;
}
.task:first-child { border-top: 0; }
.task:hover { background: var(--surface-2); }
.task__bar { background: transparent; }
.task[data-status="todo"] .task__bar { background: var(--todo); }
.task[data-status="in-progress"] .task__bar { background: var(--prog); }
.task[data-status="blocked"] .task__bar { background: var(--blocked); }
.task[data-status="done"] .task__bar { background: var(--done); }

.task__open {
  position: absolute; inset: 0;
  border: 0; background: transparent; padding: 0; margin: 0;
  cursor: pointer; z-index: 1;
  border-radius: 0;
}
.task__open:focus-visible { outline: none; }
.task__open:focus-visible ~ .task__main,
.task:has(.task__open:focus-visible) {
  background: var(--brand-tint);
}
.task:has(.task__open:focus-visible) {
  box-shadow: inset 0 0 0 2px var(--brand-tint-2);
}
.task__open:focus-visible::after {
  content: ""; position: absolute; inset: 6px;
  border-radius: var(--radius-sm);
  outline: 3px solid color-mix(in srgb, var(--ring) 50%, transparent);
  outline-offset: 2px;
}

.task__main { min-width: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.task__title-row { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.task__title {
  font-size: 1rem; font-weight: 600; color: var(--ink);
  letter-spacing: -0.005em;
  margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task[data-status="done"] .task__title { color: var(--muted); }
.task[data-status="done"] .task__title { text-decoration: line-through; text-decoration-color: var(--faint); text-decoration-thickness: 1.5px; }

.task__id {
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  color: var(--faint); letter-spacing: 0.02em; flex: none;
}

.task__meta {
  display: flex; align-items: center; gap: 8px 14px;
  flex-wrap: wrap;
  font-size: 0.8125rem; color: var(--muted);
}
.task__project { font-weight: 600; color: var(--ink-2); }
.task__sep { color: var(--border-strong); }
.task__assignee { display: inline-flex; align-items: center; gap: 7px; }
.task__avatar {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.625rem; font-weight: 700; color: #fff; letter-spacing: 0.01em;
}
.tags { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 0.6875rem; font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

.task__aside {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
.task__due {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.task__due[data-urgent="true"] { color: var(--blocked-ink); font-weight: 600; }
.task__due[data-overdue="true"] { color: #fff; background: var(--blocked); padding: 2px 8px; border-radius: 999px; }
.task__due .cal { color: inherit; opacity: 0.85; }
.task__priority {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.prio-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prio-high { background: var(--blocked); }
.prio-medium { background: var(--prog); }
.prio-low { background: var(--faint); }
.task__comments {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 5px;
}

.status-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 10px 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-chip .chip-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-chip[data-status="todo"] { background: var(--todo-bg); color: var(--todo-ink); border-color: color-mix(in srgb, var(--todo) 22%, transparent); }
.status-chip[data-status="todo"] .chip-dot { background: var(--todo); }
.status-chip[data-status="in-progress"] { background: var(--prog-bg); color: var(--prog-ink); border-color: color-mix(in srgb, var(--prog) 22%, transparent); }
.status-chip[data-status="in-progress"] .chip-dot { background: var(--prog); }
.status-chip[data-status="blocked"] { background: var(--blocked-bg); color: var(--blocked-ink); border-color: color-mix(in srgb, var(--blocked) 22%, transparent); }
.status-chip[data-status="blocked"] .chip-dot { background: var(--blocked); }
.status-chip[data-status="done"] { background: var(--done-bg); color: var(--done-ink); border-color: color-mix(in srgb, var(--done) 22%, transparent); }
.status-chip[data-status="done"] .chip-dot { background: var(--done); }

/* ---------- Empty ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px;
  padding: 56px 24px;
  color: var(--muted);
}
.empty__art { color: var(--border-strong); margin-bottom: 4px; }
.empty__title { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--ink-2); }
.empty__text { margin: 0 0 10px; max-width: 38ch; }

/* ---------- Skeleton ---------- */
.skeleton-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sk { height: 78px; border-top: 1px solid var(--border); }
.sk:first-child { border-top: 0; }
.sk { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%); background-size: 400% 100%; animation: sk 1.3s ease-in-out infinite; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Detail dialog ---------- */
.detail {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none; max-height: none;
  width: 100%; height: 100%;
  overflow: visible;
  color: var(--ink);
}
.detail::backdrop {
  background: rgba(16, 20, 26, 0.42);
  backdrop-filter: blur(3px);
}
.detail[open] { animation: detail-in 220ms cubic-bezier(0.22, 1, 0.36, 1); }
.detail[open]::backdrop { animation: fade-in 220ms ease; }
@keyframes detail-in {
  from { transform: translateX(28px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.detail__inner {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--detail-w);
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail__head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.detail__chip { min-height: 26px; }

.detail__body { padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 20px; }
.detail__id {
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase;
  margin: 0 0 4px;
}
.detail__title {
  margin: 0;
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink); line-height: 1.2;
}

.detail__status-row { display: flex; flex-direction: column; gap: 8px; padding: 14px 0 6px; }
.detail__status-control { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.select--status .select__el { min-width: 188px; font-weight: 600; }
.detail__feedback {
  margin: 0;
  font-size: 0.8125rem; font-weight: 500;
  color: var(--brand-2);
  display: inline-flex; align-items: center; gap: 7px;
  opacity: 0; transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.detail__feedback.is-shown { opacity: 1; transform: translateY(0); }
.detail__feedback::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); display: inline-block;
}

.detail__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 22px;
  margin: 6px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meta--full { grid-column: 1 / -1; }
.meta dt {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--faint);
}
.meta dd {
  margin: 0; font-size: 0.9375rem; color: var(--ink); font-weight: 500;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.meta dd[data-detail-due] { font-family: var(--mono); font-size: 0.875rem; }

.detail__section { display: flex; flex-direction: column; gap: 8px; }
.detail__section-title {
  margin: 0;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint);
}
.detail__summary { margin: 0; font-size: 0.9375rem; color: var(--ink-2); line-height: 1.55; }
.detail__body-text { font-size: 0.9375rem; color: var(--ink-2); line-height: 1.6; white-space: pre-line; }
.detail__comment-count { margin: 0; font-size: 0.875rem; color: var(--muted); font-family: var(--mono); }

.detail__assignee-row { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem; font-weight: 500;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  display: inline-flex; align-items: center; gap: 9px;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.22,1,0.36,1);
  z-index: 300;
  max-width: calc(100vw - 32px);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.toast__dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd9a6; }

/* ---------- Scrollbars ---------- */
.list, .sidebar, .detail__inner { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.list::-webkit-scrollbar, .sidebar::-webkit-scrollbar, .detail__inner::-webkit-scrollbar { width: 10px; height: 10px; }
.list::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb, .detail__inner::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 999px; border: 3px solid var(--surface);
}
.sidebar::-webkit-scrollbar-thumb { border-color: var(--sidebar-bg); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 120;
    width: 280px; transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.22,1,0.36,1);
    box-shadow: var(--shadow-3);
  }
  .sidebar.is-open { transform: translateX(0); }
  .main { padding: 16px 16px 32px; }
  .topbar { flex-wrap: wrap; }
  .topbar__search { order: 3; max-width: none; width: 100%; }
}

@media (max-width: 620px) {
  .main { padding: 14px 14px 28px; }
  .topbar__title h1 { font-size: 1.375rem; }
  .controls { gap: 10px; padding: 10px 12px; }
  .control { flex: 1 1 auto; min-width: 130px; }
  .select__el { min-width: 0; width: 100%; }
  .control__clear { flex: none; margin-left: 0; }
  .result-count { width: 100%; text-align: left; margin: 4px 0 0; }

  .task {
    grid-template-columns: 4px 1fr;
    grid-template-areas: "bar main" "bar aside";
    gap: 6px 0;
    padding: 14px 14px 14px 0;
  }
  .task__bar { grid-area: bar; }
  .task__main { grid-area: main; padding-left: 14px; padding-right: 6px; }
  .task__aside {
    grid-area: aside; border-left: 0; padding-left: 14px;
    flex-direction: row; align-items: center; justify-content: flex-start;
    flex-wrap: wrap; gap: 6px 14px;
  }
  .task__title { white-space: normal; }

  .detail__inner { width: 100vw; }
  .detail__head { padding: 14px 16px; }
  .detail__body { padding: 18px 16px 32px; }
  .detail__title { font-size: 1.25rem; }
  .detail__meta { grid-template-columns: 1fr; gap: 12px; }
}

/* Mobile menu trigger (shown under 980px) */
.menu-btn {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 130;
}
@media (max-width: 980px) {
  .menu-btn { display: grid; }
  .main { padding-top: 64px; }
  .scrim {
    position: fixed; inset: 0; z-index: 110;
    background: rgba(16,20,26,0.38); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity 200ms ease;
  }
  .scrim.is-shown { opacity: 1; pointer-events: auto; }
}

@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;
  }
  .detail[open] { animation: none; }
}
