/* ============================================================
   MERIDIAN — team inbox
   A working ledger: warm paper, ink, clay accent.
   Type roles: Space Grotesk (UI), IBM Plex Mono (data), Literata (prose).
   ============================================================ */

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* canvas + ink */
  --paper: #f4f0e6;
  --paper-2: #efe9db;
  --surface: #fbf9f3;
  --surface-raised: #fffdf7;
  --ink: #18160f;
  --ink-2: #3a352a;
  --muted: #736c5b;
  --muted-2: #9a9180;
  --line: #e0d8c4;
  --line-2: #d2c8b0;
  --hair: #e9e3d3;

  /* accent */
  --clay: #b4451f;
  --clay-2: #8f3617;
  --clay-tint: #f3e0d4;

  /* status — muted editorial */
  --st-todo: #8a8270;
  --st-todo-tint: #e6e1d4;
  --st-prog: #b07d1f;
  --st-prog-tint: #f0e2c6;
  --st-block: #a23a2a;
  --st-block-tint: #f0d8d2;
  --st-done: #3f6a4c;
  --st-done-tint: #d9e6dc;

  --radius: 3px;
  --radius-lg: 10px;
  --shadow: 0 1px 0 rgba(24, 22, 15, 0.04), 0 18px 40px -22px rgba(24, 22, 15, 0.28);
  --shadow-panel: 0 1px 0 rgba(24, 22, 15, 0.05), 0 40px 80px -30px rgba(24, 22, 15, 0.45);

  --font-ui: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-prose: "Literata", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

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

body { min-height: 100vh; }

::selection { background: var(--clay); color: #fff; }

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

/* status helpers */
[data-status="todo"]        { --st: var(--st-todo);   --st-tint: var(--st-todo-tint); }
[data-status="in-progress"] { --st: var(--st-prog);   --st-tint: var(--st-prog-tint); }
[data-status="blocked"]      { --st: var(--st-block);  --st-tint: var(--st-block-tint); }
[data-status="done"]        { --st: var(--st-done);   --st-tint: var(--st-done-tint); }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* ---- Operations board (left rail) ---- */
.board {
  border-right: 1px solid var(--line);
  padding: 30px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  background:
    linear-gradient(180deg, var(--paper-2), var(--paper) 140px);
  position: relative;
}
.board::after {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 24px;
  right: -1px;
  width: 1px;
  background: repeating-linear-gradient(
    180deg, var(--line-2) 0 6px, transparent 6px 12px
  );
  opacity: 0.5;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brand-mark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-mark .dot {
  width: 8px; height: 8px;
  background: var(--clay);
  display: inline-block;
  border-radius: 50%;
  transform: translateY(-1px);
}
.brand-name {
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.brand-sub {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: 14.5px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.board-section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.board-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

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

.tally-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 4px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--ink-2);
  font-family: var(--font-ui);
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
}
.tally-row:hover { background: rgba(24, 22, 15, 0.04); }
.tally-row[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.tally-row[aria-pressed="true"] .tally-count { color: #fff; }
.tally-row[aria-pressed="true"] .tally-swatch { box-shadow: 0 0 0 2px var(--ink); }

.tally-swatch {
  width: 4px;
  height: 26px;
  background: var(--st);
  border-radius: 2px;
}
.tally-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.tally-count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.tally-row[aria-pressed="true"] .tally-count { font-family: var(--font-mono); }

.tally-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 4px 0;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.tally-total .k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.tally-total .v {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.board-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.board-foot .row { display: flex; justify-content: space-between; gap: 8px; }
.board-foot .row span:last-child { color: var(--ink-2); }

/* ============================================================
   Workspace (main)
   ============================================================ */
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 30px 40px 60px;
}

.workspace-header {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.workspace-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.workspace-title h1 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}
.workspace-title h1 .ord {
  font-family: var(--font-mono);
  font-size: 0.36em;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--clay);
  vertical-align: 0.5em;
  margin-right: 0.4em;
}
.workspace-title .ledger-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.workspace-title .ledger-meta b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.field input,
.field select {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 11px 12px;
  width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--surface-raised);
}
.field--search { flex: 1 1 280px; min-width: 220px; position: relative; }
.field--search input { padding-left: 38px; }
.field--search .search-icon {
  position: absolute;
  left: 12px;
  bottom: 11px;
  width: 16px; height: 16px;
  color: var(--muted-2);
  pointer-events: none;
}
.field--filter { flex: 0 1 230px; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%23736c5b' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.clear-btn {
  align-self: flex-end;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 6px;
  border-radius: var(--radius);
  transition: color 0.15s ease;
}
.clear-btn:hover { color: var(--clay); }
.clear-btn:disabled { opacity: 0; pointer-events: none; }

/* ---- list ---- */
.list-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.list-summary .count { color: var(--ink); font-weight: 600; }
.list-summary .query { color: var(--clay); }

.list {
  display: flex;
  flex-direction: column;
}

.task {
  position: relative;
  border-bottom: 1px solid var(--hair);
}
.task:first-child { border-top: 1px solid var(--hair); }

.open-item {
  display: grid;
  grid-template-columns: 14px 64px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 18px;
  row-gap: 4px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 16px 14px 16px 8px;
  cursor: pointer;
  color: inherit;
  font-family: var(--font-ui);
  transition: background 0.16s ease;
  align-items: start;
}
.open-item:hover { background: rgba(24, 22, 15, 0.028); }
.open-item:active { background: rgba(24, 22, 15, 0.05); }

.rail {
  grid-row: 1 / span 2;
  width: 4px;
  height: 100%;
  min-height: 38px;
  background: var(--st);
  border-radius: 2px;
  align-self: stretch;
  transition: background 0.25s ease, width 0.15s ease;
}
.open-item { position: relative; }
.open-item:hover .rail { width: 6px; }

.tnum {
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-top: 5px;
  white-space: nowrap;
}
.tnum .hash { color: var(--line-2); }

.t-title {
  grid-row: 1;
  font-family: var(--font-ui);
  font-size: 18.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.3;
  color: var(--ink);
  padding-top: 2px;
}
.t-meta {
  grid-row: 2;
  grid-column: 2 / span 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.t-meta .sep { color: var(--line-2); }
.t-meta .assignee { color: var(--ink-2); font-weight: 500; }
.t-meta .due.overdue { color: var(--st-block); font-weight: 600; }
.t-meta .due.soon { color: var(--st-prog); font-weight: 600; }

.t-right {
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-top: 4px;
  white-space: nowrap;
}

.pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 2px;
  background: var(--st-tint);
  color: var(--st);
  border: 1px solid color-mix(in srgb, var(--st) 30%, transparent);
}
.pill.priority {
  background: transparent;
  border-color: var(--line-2);
  color: var(--muted);
}
.pill.priority.high { color: var(--clay); border-color: color-mix(in srgb, var(--clay) 40%, transparent); }

.t-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  max-width: 260px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 6px;
}
.comments {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.comments svg { width: 12px; height: 12px; }

/* done tasks get a quiet treatment */
.task[data-status="done"] .t-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--line-2);
  text-decoration-thickness: 1.5px;
}
.task[data-status="done"] .tnum { color: var(--muted-2); }

/* ---- empty state ---- */
.empty-state {
  padding: 70px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}
.empty-state .mark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clay);
}
.empty-state h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.empty-state p {
  margin: 0;
  font-family: var(--font-prose);
  font-size: 16px;
  max-width: 38ch;
  line-height: 1.55;
}
.empty-state .reset {
  margin-top: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.empty-state .reset:hover { background: var(--clay); border-color: var(--clay); }
.empty-state .reset:active { transform: translateY(1px); }

/* ============================================================
   Detail dialog
   ============================================================ */
dialog {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  position: fixed;
  inset: 0;
  overflow: visible;
  color: inherit;
}
dialog::backdrop {
  background: rgba(24, 22, 15, 0.42);
  backdrop-filter: blur(2px);
}
dialog[open] .detail { animation: slideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.detail {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(620px, 94vw);
  background: var(--surface-raised);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-left: 1px solid var(--line-2);
}

.detail-topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 26px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.detail-topbar .crumb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-topbar .crumb b { color: var(--ink); font-weight: 600; }

.close-detail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 11px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.close-detail:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.close-detail svg { width: 12px; height: 12px; }

.detail-head {
  padding: 28px 26px 18px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--hair);
}
.detail-head .head-rail {
  width: 5px;
  align-self: stretch;
  min-height: 56px;
  background: var(--st);
  border-radius: 3px;
}
.detail-head .head-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
}
.detail-head .head-num .id { color: var(--clay); }
.detail-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--ink);
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
  padding: 20px 26px;
  border-bottom: 1px solid var(--hair);
  margin: 0;
}
.detail-meta dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 3px;
}
.detail-meta dd {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--ink-2);
  font-weight: 500;
}
.detail-meta dd .st-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 2px;
  background: var(--st-tint);
  color: var(--st);
  border: 1px solid color-mix(in srgb, var(--st) 30%, transparent);
}
.detail-meta .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.detail-meta .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 7px;
}

.detail-section-label {
  padding: 22px 26px 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.detail-body {
  padding: 12px 26px 8px;
  font-family: var(--font-prose);
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--ink-2);
}
.detail-body p { margin: 0 0 14px; }
.detail-body .outcome {
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper-2);
  border-left: 3px solid var(--clay);
  padding: 12px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 6px;
}
.detail-body .outcome .olabel {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-status {
  padding: 22px 26px 30px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.detail-status .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-control-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.status-control-row .field { flex: 1 1 260px; }
.status-control-row select {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  background: var(--surface-raised);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%2318160f' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--ink);
}
.status-control-row select:focus { border-color: var(--ink); outline: none; }

.feedback {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--st-done);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding-bottom: 12px;
}
.feedback.show { opacity: 1; transform: translateY(0); }
.feedback svg { width: 13px; height: 13px; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px 12px 14px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 100;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--st, var(--clay));
  flex-shrink: 0;
}
.toast b { font-weight: 700; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .board {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 22px 22px 18px;
    gap: 16px;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
  .board::after { display: none; }
  .board-section-label { display: none; }
  .brand { flex: 1 1 200px; }
  .brand-name { font-size: 24px; }
  .brand-sub { display: none; }
  .tally {
    flex-direction: row;
    flex: 1 1 100%;
    gap: 6px;
  }
  .tally-row {
    flex: 1;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    row-gap: 2px;
    padding: 8px 8px;
    justify-items: start;
  }
  .tally-row .tally-swatch { height: 4px; width: 100%; grid-row: 1; grid-column: 1 / span 2; }
  .tally-row .tally-label { grid-row: 2; grid-column: 1; font-size: 12px; }
  .tally-row .tally-count { grid-row: 2; grid-column: 2; justify-self: end; font-size: 12px; }
  .tally-total { display: none; }
  .board-foot { display: none; }
  .workspace { padding: 22px 22px 50px; }
}

@media (max-width: 620px) {
  .workspace-title h1 { font-size: 30px; }
  .open-item {
    grid-template-columns: 12px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 14px;
    row-gap: 4px;
    padding: 15px 70px 15px 6px;
  }
  .rail { grid-row: 1 / span 3; }
  .tnum {
    grid-row: 1; grid-column: 2;
    padding-top: 2px;
    font-size: 11px;
  }
  .t-title { grid-row: 2; grid-column: 2; font-size: 16.5px; padding-top: 0; }
  .t-meta { grid-row: 3; grid-column: 2; font-size: 11.5px; gap: 4px 10px; }
  .t-right {
    position: absolute;
    top: 14px;
    right: 8px;
    grid-row: auto;
    grid-column: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-top: 0;
  }
  .t-right .pill.priority { display: none; }
  .t-tags { display: none; }
  .detail { width: 100vw; }
  .detail-title { font-size: 23px; }
  .detail-meta { grid-template-columns: 1fr; gap: 12px; }
  .detail-body { font-size: 16.5px; }
  .field--filter { flex: 1 1 100%; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  dialog[open] .detail { animation: none; }
}
