/* ==========================================================================
   List view (/list) - the list-first surface.
   Owned by the list-view slice; builds on app.css tokens (the --bg-N,
   --border, --text, --muted, --accent and --status families) and its
   .chip vocabulary. NOTE: never write "star slash" inside a CSS
   comment - it closes the comment early and eats the next rule.

   v2 (notes/makeover_design_language.md): even row rhythm (a uniform
   minimum height so pills and chips never wobble a row), quiet grid
   lines, quiet count badge, chips/pills on --r-pill, inputs on the
   --r-sm/--r-pill discipline, and the bulk bar as a raised surface
   (--shadow-2, --r-md). New §2 tokens carry working fallbacks until
   M1 lands them in app.css.
   ========================================================================== */

/* -- page column ------------------------------------------------------------
   The table area stretches to fill the viewport so the footer pins to
   the bottom instead of dead-ending mid-screen with raw black below. */

.list-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3, 12px);
  min-height: calc(100dvh - 240px);
}

/* -- header ----------------------------------------------------------------- */

.list-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2, 8px);
  flex-wrap: wrap;
}

.list-title {
  font-size: var(--size-lg, 18px);
  line-height: var(--lh-lg, 1.4);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2, 8px);
}

/* Count badge - QUIET in v2: the title is the hierarchy, the number
   is metadata. Tabular figures, no pill chrome. */
.list-count {
  background: transparent;
  border: 0;
  border-radius: var(--r-pill, 999px);
  padding: 0 var(--sp-1, 4px);
  font-family: var(--font-body);
  font-size: var(--size-xs, 11px);
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* -- toolbar ----------------------------------------------------------------
   Progressive disclosure: ONE search input, ONE Filter button, ONE
   Sort button - plus the ACTIVE filters as compact removable chips.
   The 22-pill wall lives on in the Filter popover (grouped checkbox
   lists, the label-picker's recipe). */

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2, 8px);
}

.list-search input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill, 999px);
  padding: 4px var(--sp-3, 12px);
  color: var(--text);
  font-size: var(--size-sm, 12.5px);
  outline: none;
  width: 200px;
  transition: border-color var(--dur-fast, 120ms) var(--ease, ease),
    box-shadow var(--dur-fast, 120ms) var(--ease, ease), width 160ms ease;
}

.list-search input:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
  width: 280px;
}

.list-search input::placeholder {
  color: var(--faint);
}

/* The anchor every popover hangs from */
.popover-anchor {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

/* Ghost toolbar buttons (Filter ▾ / Sort: … ▾) */
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1, 4px);
  height: 28px;
  padding: 0 var(--sp-3, 12px);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-pill, 999px);
  color: var(--muted);
  font-size: var(--size-sm, 12.5px);
  font-weight: 550;
  white-space: nowrap;
  transition: border-color var(--dur-fast, 120ms) var(--ease, ease),
    color var(--dur-fast, 120ms) var(--ease, ease),
    background var(--dur-fast, 120ms) var(--ease, ease);
}

.tool-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.tool-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

.tool-btn[aria-expanded='true'] {
  border-color: var(--accent-dim);
  color: var(--text);
  background: var(--bg-1);
}

.tool-btn[aria-expanded='true'] .lp-caret {
  transform: rotate(180deg);
}

/* The Filter / Sort popover - the label-picker recipe, grouped. v2:
   popover tier = bg-3 + --shadow-2 (§3 rule 1). */
.flt-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 76;
  min-width: 240px;
  max-width: 300px;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md, 8px);
  box-shadow: var(--shadow-2);
  padding: var(--sp-1, 4px);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-hover) transparent;
}

.sort-popover {
  min-width: 200px;
}

.flt-group {
  padding: 4px 2px;
}

.flt-group + .flt-group {
  border-top: 1px solid var(--border);
}

.flt-group--last {
  border-top: 1px dashed var(--border);
  margin-top: 2px;
}

.flt-group-title {
  font-size: var(--size-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  padding: 4px 6px 3px;
}

.flt-popover .lp-row {
  font-size: 12px;
}

.flt-popover .dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

/* The direction pair inside the Sort popover */
.sort-dir {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill, 999px);
  padding: 2px;
  margin: 2px var(--sp-2, 8px) var(--sp-1, 4px);
}

.sort-dir .scope-btn {
  padding: 2px var(--sp-3, 12px);
  font-size: 11px;
}

/* Active-filter chips - compact, removable (click the chip or its ×) */
.fchip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1, 4px);
  height: 24px;
  padding: 0 4px 0 var(--sp-3, 12px);
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-pill, 999px);
  color: var(--accent);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  max-width: 240px;
  min-width: 0;
  transition: border-color var(--dur-fast, 120ms) var(--ease, ease),
    color var(--dur-fast, 120ms) var(--ease, ease);
  /* The ADD half of the chip motion (wave 35 R3): a chip the patch
     inserts grows in from zero width - max-width + padding-inline
     interpolate, so the row's chips part around the newcomer. The
     REMOVE half is LiveView's DOM removal (reactive.css's doctrine:
     what leaves, leaves - no exit theater). Keyframes shared with the
     motion layer, nothing local. */
  animation: fchip-in var(--transition-base, var(--dur-base, 200ms) var(--ease, ease));
}

@keyframes fchip-in {
  from {
    max-width: 0;
    padding-inline: 0;
    opacity: 0;
  }
}

.fchip:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

.fchip:hover {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger-text);
}

.fchip > :first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fchip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--r-pill, 999px);
  font-size: 12px;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
  flex-shrink: 0;
}

.fchip:hover .fchip-x {
  opacity: 1;
}

.fchip--dashed {
  border-style: dashed;
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill, 999px);
  display: inline-block;
  flex-shrink: 0;
}

.clear-all {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-pill, 999px);
  color: var(--muted);
  padding: 3px var(--sp-3, 12px);
  font-size: 11px;
  transition: border-color var(--dur-fast, 120ms) var(--ease, ease),
    color var(--dur-fast, 120ms) var(--ease, ease);
}

.clear-all:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

.clear-all:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger-text);
}

/* -- table ------------------------------------------------------------------ */

.list-table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md, var(--radius-md, 10px));
  overflow-x: auto;
  box-shadow: var(--shadow-1);
}

/* On wide viewports the table fits - let the wrap overflow visible so
   the sticky header can track the page scroll (an overflow-x:auto wrap
   would become its own scrollport and defeat position:sticky). */
@media (min-width: 1080px) {
  .list-table-wrap {
    overflow: visible;
  }
}

.list-table {
  /* Fixed layout + explicit column widths: the table always fits its
     container (the shell's board-area column) - cells ellipsize instead
     of pushing the page wider than the viewport. */
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: var(--size-sm, 12.5px);
}

.list-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 9px var(--sp-2, 8px);
  font-size: var(--size-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-1) 88%, var(--bg-0));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
  user-select: none;
  transition: color var(--dur-fast, 120ms) var(--ease, ease),
    background var(--dur-fast, 120ms) var(--ease, ease),
    box-shadow var(--dur-fast, 120ms) var(--ease, ease);
}

/* RHYTHM (v2): a uniform minimum row height - a row carrying pills,
   chips or bare text all measure the same, so the column of rows
   reads as a grid. `height` on a table cell is a minimum, so a
   wrapped title still grows. */
.list-table td {
  height: 38px;
  padding: var(--sp-1, 4px) var(--sp-2, 8px);
  /* quiet grid lines: half-strength --border, never a hard rule */
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  color: var(--text-2);
}

.list-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Clean, zebra-less rows - hover is the only state, --dur-fast */
.row {
  cursor: pointer;
  transition: background var(--dur-fast, 120ms) var(--ease, ease);
}

.row:hover td {
  background: var(--bg-2);
  color: var(--text);
}

/* Keyboard walkers get the same row highlight (the j/k roving
   tabindex) - the outline stays (never removed without replacement);
   this adds the hover-equivalent fill plus a mint edge at the row's
   start so the cursor row is findable at a glance. */
.row:focus-visible td {
  background: var(--bg-2);
  color: var(--text);
}

.row:focus-visible td:first-child {
  box-shadow: inset 2px 0 0 var(--accent);
}

/* -- the empty state (§3 rule 9) ---------------------------------------------
   The calm voice: one line explaining why, one quiet action to get
   unstuck. Never "No data". */

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: var(--sp-7, 32px) var(--sp-3, 12px) !important;
  font-size: var(--size-sm, 12.5px);
  line-height: var(--lh-sm, 1.5);
}

.empty-actions {
  margin-top: var(--sp-3, 12px);
  display: flex;
  justify-content: center;
  gap: var(--sp-2, 8px);
}

.empty-act {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm, var(--radius-sm, 6px));
  padding: var(--sp-1, 4px) var(--sp-3, 12px);
  font-family: inherit;
  font-size: var(--size-sm, 12.5px);
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: border-color var(--dur-fast, 120ms) var(--ease, ease),
    color var(--dur-fast, 120ms) var(--ease, ease);
}

.empty-act:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.empty-act:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

/* -- the empty list's loading alternates (wave 35 R3) -----------------------
   Row-shaped placeholders (ui.skeleton's table-row variant) under the
   empty stage; display:none at rest, lit by a [data-loading] CONTAINER
   (the :not(body) doctrine - R2's per-patch bridge attribute must never
   flash these; a real async fetch path sets the state and this rule is
   listening). */

.list-skeletons {
  display: none;
  flex-direction: column;
  gap: var(--sp-2, 8px);
  width: min(420px, 80%);
}

[data-loading='true']:not(body) .list-skeletons {
  display: flex;
}

[data-loading='true']:not(body) .empty-stage .empty-copy {
  display: none;
}

/* -- the ui-field wrapper vs the search row ----------------------------------
   Same doctrine as the board's sheets: the search box sizes its input
   (the focus widening below keys on it), so R1's wrapper steps out of
   layout. */

.list-search .ui-field {
  display: contents;
}

/* -- cells -------------------------------------------------------------------- */
/* Fixed-layout column widths: everything except Title is pinned; Title
   takes the remainder and wraps. */

th.col-num,
.col-num {
  width: 84px;
}

.issue-link {
  font-family: var(--font-mono);
  font-size: var(--size-2xs);
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--r-sm, var(--radius-sm, 6px));
}

.issue-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.issue-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

th.th-title {
  width: auto;
}

.col-title {
  white-space: normal;
  line-height: 1.4;
  color: var(--text);
}

/* Landed and struck cargo reads quieter, mirroring the board cards. */
.row.s-done .col-title {
  color: var(--muted);
}

.row.s-canceled .col-title {
  color: var(--muted);
  text-decoration: line-through;
}

.indent-mark {
  color: var(--faint);
  margin-right: 4px;
  font-size: 11px;
}

th.th-status {
  width: 100px;
}

th.th-priority {
  width: 64px;
}

.col-pri {
  font-family: var(--font-mono);
  font-size: var(--size-2xs);
  font-weight: 700;
  color: var(--accent);
}

.col-pri:first-letter {
  color: var(--muted);
}

th.th-labels {
  width: 118px;
}

th.col-team,
th.th-team {
  width: 52px;
}

th.th-project {
  width: 112px;
}

th.th-cycle {
  width: 96px;
}

th.th-assignee {
  width: 92px;
}

th.th-updated {
  width: 72px;
}

.col-team {
  color: var(--muted);
  font-size: 11px;
}

.col-project,
.col-cycle {
  color: var(--muted);
  font-size: 11.5px;
}

.col-assignee {
  color: var(--muted);
  font-size: 11.5px;
}

.col-updated {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* -- laptop band (B3): keep the title column alive on 1080–1712px ------
   The pinned columns sum to 966px while the canvas (.work-surface
   minus the project rail) is only 894px at 1440 - under
   table-layout: fixed the title column's remainder went NEGATIVE, it
   computed to width: 0, and the title text painted under the status
   pill. Every common laptop width was unreadable
   (notes/w37_e2_browser_findings.md §3, B3).
   The fix mirrors Linear at narrow widths: secondary columns step
   out in bands, the title keeps the remainder. Below 1720:
   labels/project/cycle go (966 → 640 pinned). Below 1200: team and
   updated follow (640 → 516) - at 1080 the title keeps ~280px.
   Scoped to .list-table (triage/settings tables own their pages)
   and to ≥768px (the phone card fold below keeps its cells). The
   min-width floor is the safety net for custom-field-heavy orgs:
   the title can never again compute to zero. */

@media (min-width: 768px) and (max-width: 1719px) {
  .list-table th.th-labels,
  .list-table td.col-labels,
  .list-table th.th-project,
  .list-table td.col-project,
  .list-table th.th-cycle,
  .list-table td.col-cycle {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .list-table th.th-team,
  .list-table td.col-team,
  .list-table th.th-updated,
  .list-table td.col-updated {
    display: none;
  }
}

.list-table th.th-title,
.list-table td.col-title {
  min-width: 200px;
}

/* Status pills - workflow hues, backlog dashed (the dock, not the sea).
   v2 refines the TREATMENT only (pill radius, padding rhythm); the
   hues and their meaning are untouched (the contract's one fixed
   thing). */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1, 4px);
  border-radius: var(--r-pill, 999px);
  padding: 1px var(--sp-2, 8px);
  font-size: var(--size-2xs);
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill, 999px);
  background: currentColor;
}

.pill.s-backlog {
  color: var(--status-backlog);
  background: color-mix(in srgb, var(--status-backlog) 9%, transparent);
  border-color: color-mix(in srgb, var(--status-backlog) 32%, transparent);
  border-style: dashed;
}

.pill.s-todo {
  color: var(--text-2);
  background: var(--todo-wash);
  border-color: var(--todo-border);
}

.pill.s-in_progress {
  color: var(--info);
  background: color-mix(in srgb, var(--info) 10%, transparent);
  border-color: color-mix(in srgb, var(--info) 32%, transparent);
}

.pill.s-done {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-dim);
}

.pill.s-canceled {
  color: var(--danger-text-soft);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
}

/* -- footer ---------------------------------------------------------------------
   Pinned to the bottom of the flex column (margin-top:auto) - the
   page never dead-ends in raw black below a short table. */

.list-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-3, 12px);
  margin-top: auto;
  padding-top: var(--sp-1, 4px);
  color: var(--muted);
  font-size: var(--size-sm, 12.5px);
}

.load-more {
  border-radius: var(--r-sm, var(--radius-sm, 6px));
  padding: var(--sp-1, 4px) var(--sp-4, 16px);
  font-size: var(--size-sm, 12.5px);
  font-weight: 500;
  transition: border-color var(--dur-fast, 120ms) var(--ease, ease),
    color var(--dur-fast, 120ms) var(--ease, ease),
    background var(--dur-fast, 120ms) var(--ease, ease);
}

.load-more:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

/* -- narrow viewports -------------------------------------------------------------- */

@media (max-width: 860px) {
  .list-search input,
  .list-search input:focus-visible {
    width: 100%;
  }

  .list-search {
    width: 100%;
  }

  .clear-all {
    margin-left: 0;
  }
}

/* -- fq query box (notes/query_routes.md §a) -------------------------------- */

/* The query box is an anchor for the inline parse/resolution error -
   the error renders under the input, inside the toolbar's flow. */
.list-search {
  position: relative;
}

.list-search-error {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  max-width: 340px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border));
  background: var(--bg-2);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-soft);
  white-space: normal;
}

.list-search input[aria-invalid="true"] {
  border-color: var(--danger);
}

/* -- responsive (mobile pass, notes/mobile_pass.md) ----------------------------
   Phones: the toolbar becomes a full-width search row + one horizontally
   scrollable chip line, and the table folds into two-line cards -
   mono id + title on top, the rest as wrapping meta chips below.
   Scoped away from .triage-page (sticky-column table there) and the
   settings pages (their delivery log stays a table). */

@media (max-width: 767px) {
  .list-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .list-toolbar::-webkit-scrollbar {
    display: none;
  }

  /* The search owns row 1 outright; chips + Filter/Sort share row 2,
     which scrolls sideways instead of wrapping the page tall. */
  .list-toolbar .list-search {
    flex: 0 0 100%;
    margin-bottom: 8px;
  }

  .fchip {
    height: 44px;
    flex: 0 0 auto;
  }

  .fchip-x {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  /* -- the table folds into cards ------------------------------------------- */

  .list-page:not(.triage-page):not(.settings-page) .list-table-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow-x: visible;
  }

  .list-page:not(.triage-page):not(.settings-page) .list-table {
    display: block;
    min-width: 0;
  }

  .list-page:not(.triage-page):not(.settings-page) .list-table thead {
    display: none;
  }

  .list-page:not(.triage-page):not(.settings-page) .list-table tbody {
    display: block;
  }

  /* One row = one card: id chip + title line, then wrapping meta */
  .list-page:not(.triage-page):not(.settings-page) .list-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .list-page:not(.triage-page):not(.settings-page) .list-table td {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: auto;
    padding: 0;
    border-bottom: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }

  /* id first, then the title claims its own full line */
  .list-page:not(.triage-page):not(.settings-page) .list-table td.col-num {
    order: -1;
  }

  .list-page:not(.triage-page):not(.settings-page) .list-table td.col-title {
    flex-basis: 100%;
    white-space: normal;
    font-size: 13.5px;
    line-height: 1.4;
  }

  .list-page:not(.triage-page):not(.settings-page) .list-table td.col-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 100%;
  }

  .list-page:not(.triage-page):not(.settings-page) .list-table tr:hover td {
    background: transparent;
    color: var(--text);
  }

  .list-page:not(.triage-page):not(.settings-page) .list-table tr:hover {
    border-color: var(--border-strong);
  }

  .list-page:not(.triage-page):not(.settings-page) td.empty-cell {
    display: block;
    padding: 28px 12px;
  }

  .list-header {
    flex-wrap: nowrap;
    overflow: hidden;
  }
}

/* -- tablets: the table keeps its scroll, but the toolbar may wrap ------------- */

@media (min-width: 768px) and (max-width: 1023px) {
  .list-table {
    min-width: 640px;
  }
}

/* -- archive (notes/archive_routes.md) ---------------------------------------- */

/* The archived banner chip - same filter-chip anatomy, muted-violet
   "parked" tint to read as a mode, not a filter like status. */
.fchip.fchip--archived {
  border-color: color-mix(in srgb, var(--violet, #8b7cf6) 45%, transparent);
  color: color-mix(in srgb, var(--violet, #8b7cf6) 85%, var(--text));
}

/* The working set's entry link into the archive - quiet, right of the
   query box, only when there is something archived to visit. */
.list-archived-link {
  text-decoration: none;
  white-space: nowrap;
}

/* Row actions: the actions column is narrow and its button sits quiet
   until the row is hovered or focused - discoverable, not shouting. */
th.th-actions {
  width: 70px;
}

td.col-actions {
  text-align: right;
}

.row-action {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm, 6px);
  color: var(--muted);
  font-size: var(--size-2xs);
  font-weight: 600;
  padding: 2px var(--sp-2, 8px);
  opacity: 0;
  transition: opacity var(--dur-fast, 120ms) var(--ease, ease),
    border-color var(--dur-fast, 120ms) var(--ease, ease),
    color var(--dur-fast, 120ms) var(--ease, ease);
}

.row:hover .row-action,
.row-action:focus-visible {
  opacity: 1;
}

.row-action:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

.row-action:hover {
  border-color: color-mix(in srgb, var(--violet, #8b7cf6) 45%, transparent);
  color: color-mix(in srgb, var(--violet, #8b7cf6) 85%, var(--text));
}

/* Keyboard and touch keep the action reachable without hover. */
@media (hover: none) {
  .row-action {
    opacity: 1;
  }
}

/* -- bulk multi-select (the triage pattern, list's own classes) -------------
   Checkbox column + the floating bar. Local lbulk-* classes so the page
   needs no new stylesheet link (triage keeps its own triage-* set for
   the same reason). Tokens only - mint selection accent, danger red on
   Delete, glass bar with upward popovers and ONE shared sibling
   backdrop (the bar's backdrop-filter would clip a fixed child). */

th.th-lcheck,
td.col-lcheck {
  width: 30px;
  text-align: center;
}

input.lcheck {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.lbulk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: transparent;
}

.lbulk-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  /* Centering rides the `translate` property, NOT transform, so the
     shared fade-slide-up entry can animate `transform` underneath it
     (the individual properties compose: translate applies first, the
     animated transform stacks after) - the vocabulary's from-frame
     needs no per-surface keyframes. */
  translate: -50% 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: var(--sp-3, 12px);
  max-width: min(880px, calc(100vw - 32px));
  padding: var(--sp-2, 8px) var(--sp-3, 12px);
  background: var(--bar-panel, var(--bg-2));
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--r-md, var(--radius-md, 10px));
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  /* The slide-up (wave 35 R3): re-pointed onto the shared entry - the
     old local lbulk-rise keyframes were the same motion (translateY
     8px = --sp-2 + fade) hand-rolled; the vocabulary owns it now and
     the reduced-motion kill-switch covers this surface with the rest
     of the system (the local exemption below retires). */
  animation: fade-slide-up var(--transition-base, var(--dur-base, 200ms) var(--ease, ease));
}

.lbulk-side {
  display: flex;
  align-items: center;
  gap: var(--sp-1, 4px);
  flex-shrink: 0;
}

.lbulk-side-right {
  margin-left: auto;
}

.lbulk-count {
  font-size: var(--size-sm, 12.5px);
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.lbulk-n {
  color: var(--accent);
  font-weight: 700;
}

.lbulk-link {
  background: transparent;
  border: 0;
  border-radius: var(--r-sm, var(--radius-sm, 6px));
  padding: var(--sp-1, 4px) var(--sp-2, 8px);
  font-family: inherit;
  font-size: var(--size-sm, 12.5px);
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-fast, 120ms) var(--ease, ease),
    background var(--dur-fast, 120ms) var(--ease, ease);
}

.lbulk-link:hover {
  color: var(--text);
  background: var(--wash-4);
}

.lbulk-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

.lbulk-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  /* Visible - the upward-opening .lbulk-popover children must escape
     paint + hit-testing (an overflow container clips both). */
  overflow: visible;
  scrollbar-width: none;
  padding: 0 var(--sp-3, 12px);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.lbulk-actions::-webkit-scrollbar {
  display: none;
}

.lbulk-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1, 4px);
  height: 32px;
  padding: 0 var(--sp-3, 12px);
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm, var(--radius-sm, 6px));
  font-family: inherit;
  font-size: var(--size-sm, 12.5px);
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast, 120ms) var(--ease, ease),
    color var(--dur-fast, 120ms) var(--ease, ease),
    border-color var(--dur-fast, 120ms) var(--ease, ease);
}

.lbulk-btn:hover {
  background: var(--wash-5);
  color: var(--text);
}

.lbulk-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

.lbulk-btn[aria-expanded='true'] {
  background: var(--bg-3);
  border-color: var(--border);
  color: var(--text);
}

.lbulk-caret {
  font-size: 9px; /* glyph metric */
  color: var(--faint);
  transition: transform var(--dur-fast, 120ms) var(--ease, ease);
}

.lbulk-btn[aria-expanded='true'] .lbulk-caret {
  transform: rotate(180deg);
}

.lbulk-danger {
  color: var(--danger);
}

.lbulk-danger:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.lbulk-confirm {
  font-size: var(--size-sm, 12.5px);
  font-weight: 500;
  color: var(--danger);
  white-space: nowrap;
}

.lbulk-menu {
  position: relative;
  display: inline-flex;
}

/* Popover tier in v2: bg-3 + --shadow-2 (§3 rule 1 - the floating
   bar already owns the --shadow-2 raised layer; a menu stacking on it
   reads by position, not by stacking a third shadow). */
.lbulk-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 81;
  min-width: 210px;
  max-width: 300px;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-3);
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--r-md, 8px);
  box-shadow: var(--shadow-2);
  padding: var(--sp-1, 4px);
  scrollbar-width: thin;
}

/* Menus near the bar's right edge would overflow the viewport - the
   last ones anchor right instead of left. */
.lbulk-actions > .lbulk-menu:nth-last-child(-n + 2) .lbulk-popover {
  left: auto;
  right: 0;
}

.lbulk-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2, 8px);
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm, 6px);
  padding: var(--sp-1, 4px) var(--sp-2, 8px);
  font-family: inherit;
  font-size: var(--size-sm, 12.5px);
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast, 120ms) var(--ease, ease),
    color var(--dur-fast, 120ms) var(--ease, ease);
}

.lbulk-row:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent));
}

.lbulk-row:hover {
  background: var(--wash-4);
  color: var(--text);
}

.lbulk-empty {
  padding: var(--sp-2, 8px) var(--sp-3, 12px);
  font-size: var(--size-sm, 12.5px);
  color: var(--faint);
}

.lbulk-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: var(--r-pill, 999px);
}

.lbulk-dot.s-backlog {
  background: var(--status-backlog);
}

.lbulk-dot.s-todo {
  background: var(--status-todo);
}

.lbulk-dot.s-in_progress {
  background: var(--status-in_progress);
}

.lbulk-dot.s-done {
  background: var(--status-done);
}

.lbulk-dot.s-canceled {
  background: var(--status-canceled);
}

.lbulk-prio {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-sm, 4px);
  padding: 0 5px;
  line-height: 1.6;
}

.lbulk-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: var(--r-pill, 999px);
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-size: 9px; /* glyph metric */
  font-weight: 700;
}

.lbulk-none {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: var(--r-pill, 999px);
  background: var(--bg-2);
  border: 1px dashed var(--border-strong, var(--border));
  color: var(--faint);
  font-size: 11px;
}

/* Small screens: the bar spans the edge and wraps. */
@media (max-width: 860px) {
  .lbulk-bar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
    flex-wrap: wrap;
    max-width: none;
  }
}

/* -- the Due column (wave 33 lane V1) - quiet dates, quiet-red
   overdue (base .list-due lives in app.css; the cell shares the
   muted metadata vocabulary its neighbors use) -- */
th.th-due {
  width: 76px;
}

.col-due {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
