/* ==================================================================
   Team queues, My Work and the work panel (th-wq-*)
   ------------------------------------------------------------------
   Lifted from the approved Teams, routing, ownership, My Work handoff
   (handoff/threshold-ops.css: work queue table, drawer / work panel,
   pills, chips and menus) and the values Work Queues.dc.html sets
   inline on the page head, rail, strip, filter row, meta strip,
   waiting panel and pager, on production tokens:

     --th-sunk         -> --th-paper-sunk
     --th-mono / serif -> --th-font-mono / --th-font-serif
     --th-radius / -sm -> --th-radius-5 / --th-radius-3

   Banners, the empty and denied states, cards, the offline strip and
   the avatar come from threshold-operational-components.css. No token
   is declared here; shadows are the handoff's literal values.

   The table folds by its own width (a container query on .th-wq-list),
   not the window's: with the sidenav and the rail beside it the list
   can be narrow on a wide window. Its kind label wraps rather than
   running into the next column (External integration canon carry,
   2026-10-09).
   ================================================================== */

.th-wq-page { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; font-size: 13.5px; color: var(--th-ink); }
.th-wq-page input::placeholder { color: var(--th-ink-2); opacity: 1; }
.th-wq-mono { font-family: var(--th-font-mono); }

/* ---------- "Working across" band (the AppDef band, not a selector here) ---------- */
.th-wq-across {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 6px 24px;
  background: linear-gradient(to right, var(--th-marigold-soft) 0, var(--th-marigold-soft) 8px, var(--th-paper-sunk) 8px);
  border-bottom: 1px solid var(--th-line);
  position: relative;
  flex: none;
  flex-wrap: wrap;
}
.th-wq-across::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--th-marigold-deep); }
.th-wq-across__verb { font-family: var(--th-font-serif); font-style: italic; font-size: 12.5px; color: var(--th-marigold-deep); font-weight: 500; }
.th-wq-across__defs {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--th-line-2);
  border-radius: var(--th-radius-3);
  background: var(--th-paper);
  font-size: 13.5px;
  color: var(--th-ink);
}
.th-wq-across__defs > svg { color: var(--th-marigold-deep); flex: none; }
.th-wq-across__names { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.th-wq-across__label, .th-wq-across__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-wq-across__label { font-weight: 600; }
.th-wq-across__meta { font-size: 11px; color: var(--th-ink-2); font-family: var(--th-font-mono); }
.th-wq-across__note { font-size: 11.5px; color: var(--th-ink-2); }

/* ---------- page head ---------- */
.th-wq-head { padding: 18px 24px 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex: none; }
.th-wq-head > div { min-width: 0; }
.th-wq-title { margin: 0; font-family: var(--th-font-serif); font-weight: 500; font-size: 23px; letter-spacing: -0.012em; color: var(--th-ink); line-height: 1.25; }
.th-wq-sub { margin-top: 4px; font-size: 12.5px; color: var(--th-ink-2); line-height: 1.45; max-width: 760px; }
.th-wq-head__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.th-wq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--th-radius-3);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--th-line-2);
  background: var(--th-paper-sunk);
  color: var(--th-ink);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.th-wq-btn:hover { background: var(--th-paper-2); border-color: var(--th-ink-4); color: var(--th-ink); }
.th-wq-btn:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
.th-wq-btn[disabled], .th-wq-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.th-wq-btn--primary { border-color: var(--th-advant-deep); background: var(--th-advant-deep); color: var(--th-advant-fg); }
.th-wq-btn--primary:hover { background: var(--th-advant-deep); border-color: var(--th-advant-deep); color: var(--th-advant-fg); filter: brightness(1.08); }
.th-wq-btn--quiet { border-color: transparent; background: transparent; color: var(--th-ink-2); font-size: 11.5px; font-weight: 400; padding: 4px 9px; }
.th-wq-btn--quiet:hover { color: var(--th-ink); border-color: var(--th-line-2); background: transparent; }
.th-wq-btn--lg { padding: 7px 12px; }

/* ---------- body: rail beside the list ---------- */
.th-wq-body { display: flex; flex: 1; min-height: 0; border-top: 1px solid var(--th-line); }
.th-wq-rail {
  width: 208px;
  flex: none;
  border-right: 1px solid var(--th-line);
  background: var(--th-paper-2);
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.th-wq-rail__head { padding: 0 8px 6px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--th-ink-2); }
.th-wq-rail__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--th-radius-3);
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--th-ink-2);
  cursor: pointer;
  text-decoration: none;
}
.th-wq-rail__item:hover { background: var(--th-paper); color: var(--th-ink); }
.th-wq-rail__item[aria-current="page"] { background: var(--th-paper-sunk); color: var(--th-ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--th-line); }
.th-wq-rail__item:focus-visible { outline: 2px solid var(--th-advant); outline-offset: -2px; }
.th-wq-rail__name { overflow: hidden; text-overflow: ellipsis; }
.th-wq-rail__count { font-family: var(--th-font-mono); font-size: 11px; color: var(--th-ink-2); }
.th-wq-rail__count.is-warn { display: inline-flex; align-items: center; gap: 4px; color: var(--th-warn-ink); }
.th-wq-rail__none { padding: 4px 10px 8px; font-size: 11.5px; color: var(--th-ink-2); line-height: 1.45; white-space: normal; }
.th-wq-rail__note { padding: 14px 10px 0; font-size: 11px; color: var(--th-ink-2); line-height: 1.45; }

.th-wq-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }

/* ---------- strips above the list ---------- */
.th-wq-strip-wrap { padding: 10px 24px 0; }
.th-wq-strip {
  border: 1px solid var(--th-line);
  border-radius: var(--th-radius-5);
  background: var(--th-paper-sunk);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.th-wq-strip__line { color: var(--th-ink-2); flex: 1 1 260px; min-width: 0; line-height: 1.45; }
.th-wq-strip a { white-space: nowrap; color: var(--th-advant); text-decoration: none; }
.th-wq-strip a:hover { color: var(--th-advant-deep); }
.th-wq-notice {
  margin: 10px 24px 0;
  border-radius: var(--th-radius-5);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  font-size: 12.5px;
  line-height: 1.5;
}
.th-wq-notice > svg { margin-top: 2px; }
.th-wq-notice b { font-weight: 600; }
.th-wq-notice.is-neutral { border: 1px solid var(--th-line-2); background: var(--th-paper-2); color: var(--th-ink-2); }
.th-wq-notice.is-neutral b { color: var(--th-ink); }
.th-wq-notice.is-warn { border: 1px solid var(--th-warn); background: var(--th-warn-soft); color: var(--th-warn-ink); }
.th-wq-notice.is-line { grid-template-columns: 16px minmax(0, 1fr); padding: 8px 14px; border: 1px solid var(--th-line-2); background: var(--th-paper-2); color: var(--th-ink-2); }
.th-wq-notice a { white-space: nowrap; }
.th-wq-notice__btn {
  font: inherit;
  font-size: 12px;
  padding: 2px 9px;
  border: 1px solid currentColor;
  border-radius: var(--th-radius-3);
  background: transparent;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.th-wq-notice__btn:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }

/* ---------- search, chips, reset ---------- */
.th-wq-filters { padding: 12px 24px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-wq-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--th-paper-sunk);
  border: 1px solid var(--th-line-2);
  border-radius: var(--th-radius-3);
  padding: 5px 10px;
  flex: 0 1 260px;
  min-width: 160px;
  font-size: 12.5px;
  color: var(--th-ink-2);
}
.th-wq-search:focus-within { border-color: var(--th-advant); }
.th-wq-search > svg { color: var(--th-ink-2); flex: none; }
.th-wq-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--th-ink); }
.th-wq-chipwrap { position: relative; display: inline-block; }
.th-wq-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--th-line-2);
  background: var(--th-paper);
  color: var(--th-ink-2);
}
.th-wq-chip:hover { border-color: var(--th-ink-4); }
.th-wq-chip:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
.th-wq-chip.is-set { border-color: var(--th-advant); background: var(--th-advant-soft); color: var(--th-advant-deep); }
.th-wq-chip__label { color: var(--th-ink-2); }
.th-wq-chip.is-set .th-wq-chip__label { color: var(--th-ink-2); }
.th-wq-chip__value { font-weight: 500; }
.th-wq-chip > svg { color: var(--th-ink-2); }
.th-wq-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: var(--th-paper-sunk);
  border: 1px solid var(--th-line-2);
  border-radius: var(--th-radius-5);
  box-shadow: 0 8px 24px oklch(20% 0.01 255 / 0.12);
  padding: 4px;
}
.th-wq-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--th-radius-3);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: var(--th-ink);
  cursor: pointer;
  text-align: left;
}
.th-wq-menu__item:hover, .th-wq-menu__item:focus-visible { background: var(--th-paper-2); outline: none; }
.th-wq-menu__mark { font-family: var(--th-font-mono); font-size: 11px; color: var(--th-advant-deep); }
.th-wq-filters__spacer { flex: 1; }

/* ---------- meta strip: count, order, freshness ---------- */
.th-wq-meta { margin: 10px 24px 0; display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; font-size: 12px; color: var(--th-ink-2); min-height: 26px; flex: none; }
.th-wq-meta__count { font-weight: 600; color: var(--th-ink); font-family: var(--th-font-mono); }
.th-wq-meta__spacer { flex: 1; }
.th-wq-meta__fresh { display: inline-flex; align-items: center; gap: 6px; }
.th-wq-meta__fresh > svg { color: var(--th-ink-2); }
.th-wq-meta__iconbtn {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: var(--th-radius-3);
  background: transparent;
  color: var(--th-ink-2);
  cursor: pointer;
}
.th-wq-meta__iconbtn:hover { background: var(--th-paper-2); color: var(--th-ink); }
.th-wq-meta__iconbtn:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 1px; }
.th-wq-meta__failed { display: inline-flex; align-items: center; gap: 6px; color: var(--th-warn-ink); }
.th-wq-meta__updates { display: inline-flex; align-items: center; gap: 6px; color: var(--th-advant-deep); font-weight: 500; }
.th-wq-meta__small {
  font: inherit;
  font-size: 11.5px;
  padding: 1px 8px;
  border: 1px solid var(--th-warn-ink);
  border-radius: var(--th-radius-3);
  background: transparent;
  color: var(--th-warn-ink);
  cursor: pointer;
}
.th-wq-meta__small.is-info { font-weight: 500; border-color: var(--th-advant); background: var(--th-advant-soft); color: var(--th-advant-deep); }
.th-wq-meta__small:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
.th-wq-reading { margin: 10px 24px 0; font-size: 12px; color: var(--th-ink-2); min-height: 26px; flex: none; display: flex; align-items: center; }

/* ---------- the list ---------- */
.th-wq-list {
  margin: 10px 24px 8px;
  border: 1px solid var(--th-line);
  border-radius: var(--th-radius-5);
  background: var(--th-paper-sunk);
  overflow: hidden;
  flex: none;
  container-type: inline-size;
  container-name: th-wq-list;
}
.th-wq-grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.th-wq-grid th {
  text-align: left;
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--th-ink-2);
  background: var(--th-paper-2);
  border-bottom: 1px solid var(--th-line);
  padding: 8px 10px;
}
.th-wq-grid th:first-child, .th-wq-grid td:first-child { padding-left: 16px; }
.th-wq-grid th:last-child, .th-wq-grid td:last-child { padding-right: 16px; }
.th-wq-grid td { padding: 9px 10px; vertical-align: top; min-width: 0; }
.th-wq-row { cursor: pointer; border-bottom: 1px solid var(--th-line-soft); }
.th-wq-row:hover { background: var(--th-paper-2); }
.th-wq-row.is-open { background: var(--th-advant-soft); box-shadow: inset 2px 0 0 var(--th-advant); }
.th-wq-row:focus-visible { outline: 2px solid var(--th-advant); outline-offset: -2px; }
.th-col-when { width: 124px; }
.th-col-file { width: 24%; }
.th-col-resp { width: 21%; }
.th-col-dest { width: 128px; }
.th-wq-when { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 0; }
.th-wq-when .th-pill { max-width: 100%; text-align: left; line-height: 1.35; padding-top: 2px; padding-bottom: 2px; }
.th-wq-when .th-pill.is-wrap { white-space: normal; }
.th-wq-when__meta { font: 11px/1.4 var(--th-font-mono); color: var(--th-ink-2); overflow-wrap: anywhere; }
.th-wq-action { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.th-wq-action__kinds { display: flex; align-items: center; gap: 4px 8px; min-width: 0; flex-wrap: wrap; }
.th-kind { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.th-kind--task { color: var(--th-ink-2); }
.th-kind--routing { color: var(--th-marigold-deep); }
.th-kind--deadline { color: var(--th-advant-deep); }
.th-kind--wait { color: var(--th-warn-ink); }
.th-kind--escalation { color: var(--th-risk-ink); }
.th-kind--verify { color: var(--th-advant-deep); }
.th-kind--repair { color: var(--th-warn-ink); }
.th-kind--incoming { color: var(--th-marigold-deep); }
.th-kind--held { color: var(--th-warn-ink); }
/* Correction consequences: the canon's neutral Consequence pill (Amendments AM-C16). */
.th-kind--consequence { color: var(--th-ink-2); }
.th-kind--gone { color: var(--th-ink-2); }

/* ---------- admission work (handoff threshold-ops.css, 3 Oct round and round 3) ----------
   Rows are projections of Decisions and Payments work; every class is display only. The kind
   label is the handoff's .th-wq-kind with its modifier; tones reuse existing tokens (no new accent). */
.th-wq-kind { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.th-wq-kind.is-decision-ready { color: var(--th-advant-deep); }
.th-wq-kind.is-release-blocked { color: var(--th-risk-ink); }
.th-wq-kind.is-finalize, .th-wq-kind.is-release-ready { color: var(--th-ok-ink); }
.th-wq-kind.is-payment { color: var(--th-warn-ink); }
/* menu group header inside a chip popover (Kind › Admissions) */
.th-menu-group {
  padding: 8px 10px 3px;
  margin-top: 4px;
  border-top: 1px solid var(--th-line-soft);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--th-ink-2);
}
/* team / definition health (a missing route): never a silent assignment; spaced as the page's other notices */
.th-adm-health {
  margin: 10px 24px 0;
  border: 1px solid var(--th-warn);
  border-radius: var(--th-radius-5);
  background: var(--th-warn-soft);
  color: var(--th-warn-ink);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  font-size: 12.5px;
  line-height: 1.5;
}
.th-adm-health > svg { margin-top: 2px; }
.th-adm-health b { font-weight: 600; }
.th-adm-health a { white-space: nowrap; color: var(--th-warn-ink); text-decoration: underline; }
/* panel · decision authority on the definition, each authority named on its own (held / not held) */
.th-auth-list { margin: 14px 18px 0; border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-sunk); }
.th-auth-list__head { padding: 8px 12px; border-bottom: 1px solid var(--th-line-soft); font-size: 12px; color: var(--th-ink-2); line-height: 1.45; }
.th-auth-list__head b { color: var(--th-ink); font-weight: 600; }
.th-auth-row { display: grid; grid-template-columns: 16px 72px minmax(0, 1fr); gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--th-line-soft); font-size: 12px; align-items: start; }
.th-auth-row:last-child { border-bottom: 0; }
.th-auth-row > svg { margin-top: 1px; }
.th-auth-row.is-held { color: var(--th-ok-ink); }
.th-auth-row.is-missing { color: var(--th-risk-ink); }
.th-auth-row__label { color: var(--th-ink); font-weight: 500; }
.th-wq-action__title {
  font-weight: 500;
  color: var(--th-ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.th-wq-action__sub { font-size: 11.5px; color: var(--th-ink-2); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-wq-fold { display: none; font-size: 11.5px; color: var(--th-ink-2); line-height: 1.4; overflow-wrap: anywhere; }
.th-wq-fold b { color: var(--th-ink); font-weight: 500; }
.th-wq-fold span { font-family: var(--th-font-mono); font-size: 11px; }
.th-wq-file { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.th-wq-file__name { color: var(--th-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-wq-file__ref { font-family: var(--th-font-mono); font-size: 11px; color: var(--th-ink-2); line-height: 1.4; overflow-wrap: anywhere; }
.th-wq-resp { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.th-wq-resp__team { color: var(--th-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-wq-resp__who { display: flex; align-items: center; gap: 5px; min-width: 0; }
.th-wq-resp__text { font-size: 11.5px; color: var(--th-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35; }
.th-wq-resp__text.is-warn { color: var(--th-warn-ink); }
.th-wq-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: oklch(50% 0.08 220);
  color: var(--th-paper);
  display: inline-grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 600;
  flex: none;
}
[data-theme="dark"] .th-wq-avatar { background: oklch(70% 0.08 220); }
.th-wq-avatar.is-gone { background: var(--th-paper-2); color: var(--th-ink-2); box-shadow: inset 0 0 0 1px var(--th-line-2); }
.th-wq-dest { display: inline-flex; align-items: flex-start; gap: 5px; font-size: 12px; color: var(--th-advant-deep); white-space: nowrap; line-height: 1.35; }
.th-wq-dest > svg { flex: none; margin-top: 2px; }
/* A destination longer than the 128px column wraps, as the canon's Requirements & documents does (destWs). */
.th-wq-dest.is-wrap { white-space: normal; }

/* the pills the queue uses (handoff th-pill, existing tones only) */
.th-pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 999px; font: 500 11px/1.6 var(--th-font-sans); border: 1px solid transparent; white-space: nowrap; }
.th-pill.is-ok { background: var(--th-ok-soft); color: var(--th-ok-ink); }
.th-pill.is-warn { background: var(--th-warn-soft); color: var(--th-warn-ink); }
.th-pill.is-risk { background: var(--th-risk-soft); color: var(--th-risk-ink); }
.th-pill.is-info { background: var(--th-advant-soft); color: var(--th-advant-deep); }
.th-pill.is-neutral { background: var(--th-paper-2); color: var(--th-ink-2); border-color: var(--th-line); }
.th-pill.is-quiet { background: transparent; color: var(--th-ink-2); padding-left: 0; }

/* skeleton: nothing counted until the sources answer */
.th-wq-skeleton { margin: 10px 24px 24px; border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-sunk); overflow: hidden; flex: none; }
.th-wq-skeleton__row {
  display: grid;
  grid-template-columns: 90px minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) 110px;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--th-line-soft);
  animation: th-wq-shimmer 1.4s ease-in-out infinite;
}
.th-wq-skeleton__row > span { height: 12px; border-radius: 3px; background: var(--th-paper-2); }
.th-wq-skeleton__note { padding: 10px 16px; font-size: 12px; color: var(--th-ink-2); }
@keyframes th-wq-shimmer { 0% { opacity: .55; } 50% { opacity: 1; } 100% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .th-wq-skeleton__row { animation: none; } }

/* empty states inside the list (the shared th-empty plus the canon's icon tones) */
.th-wq-list .th-empty__icon.is-ok { background: var(--th-ok-soft); color: var(--th-ok-ink); }
.th-wq-list .th-empty__icon.is-warn { background: var(--th-warn-soft); color: var(--th-warn-ink); }
.th-wq-list .th-empty__body { max-width: 420px; }

/* ---------- Waiting: collapsed, separate from active work and counts ---------- */
.th-wq-waiting { margin: 4px 24px 8px; border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-2); }
.th-wq-waiting__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: var(--th-ink-2);
  cursor: pointer;
  text-align: left;
}
.th-wq-waiting__head:focus-visible { outline: 2px solid var(--th-advant); outline-offset: -2px; }
.th-wq-waiting__head > svg { color: var(--th-ink-2); flex: none; transition: transform 120ms ease; }
.th-wq-waiting__head[aria-expanded="false"] > svg { transform: rotate(-90deg); }
.th-wq-waiting__head b { font-weight: 600; color: var(--th-ink); }
.th-wq-waiting__count { font-family: var(--th-font-mono); font-size: 11px; color: var(--th-ink-2); }
.th-wq-waiting__row {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 9px 16px;
  border-top: 1px solid var(--th-line-soft);
  font-size: 12.5px;
  color: inherit;
  align-items: baseline;
  text-decoration: none;
}
.th-wq-waiting__row:hover { background: var(--th-paper-sunk); color: inherit; }
.th-wq-waiting__row:focus-visible { outline: 2px solid var(--th-advant); outline-offset: -2px; }
.th-wq-waiting__until { font-family: var(--th-font-mono); font-size: 11px; color: var(--th-ink-2); min-width: 0; overflow-wrap: anywhere; }
.th-wq-waiting__what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.th-wq-waiting__title { color: var(--th-ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-wq-waiting__file { font-size: 11.5px; color: var(--th-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-wq-waiting__why { font-size: 11.5px; color: var(--th-ink-2); line-height: 1.4; }
.th-wq-waiting__state { padding: 9px 16px; border-top: 1px solid var(--th-line-soft); font-size: 12px; color: var(--th-ink-2); }
.th-wq-waiting__more { display: flex; justify-content: flex-end; padding: 6px 16px 8px; border-top: 1px solid var(--th-line-soft); }

/* ---------- pager ---------- */
.th-wq-pager { margin: 0 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--th-ink-2); flex-wrap: wrap; }
.th-wq-pager__nav { display: inline-flex; align-items: center; gap: 4px; }
.th-wq-pager__btn { padding: 3px 9px; border: 1px solid var(--th-line-2); border-radius: var(--th-radius-3); background: var(--th-paper-sunk); font: inherit; font-size: 12px; color: var(--th-ink-2); cursor: pointer; }
.th-wq-pager__btn[disabled] { opacity: 0.45; cursor: default; }
.th-wq-pager__btn:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
.th-wq-pager__label { font-family: var(--th-font-mono); font-size: 11px; padding: 0 6px; }

/* ---------- work panel (non-modal drawer, ADR-0063 family) ---------- */
.th-wq-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
  background: var(--th-paper-sunk);
  border-left: 1px solid var(--th-line-2);
  box-shadow: -12px 0 36px oklch(20% 0.01 255 / 0.14);
  z-index: 55;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--th-ink);
}
.th-wq-panel__head { padding: 14px 18px 12px; border-bottom: 1px solid var(--th-line); display: flex; align-items: flex-start; gap: 12px; flex: none; }
.th-wq-panel__head > div { flex: 1; min-width: 0; }
.th-wq-panel__title { margin: 3px 0 0; font: 600 17px/1.3 var(--th-font-serif); color: var(--th-ink); overflow-wrap: anywhere; }
.th-wq-panel__meta { margin-top: 3px; font: 11.5px var(--th-font-mono); color: var(--th-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-wq-panel__close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--th-radius-3);
  color: var(--th-ink-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  flex: none;
}
.th-wq-panel__close:hover { background: var(--th-paper-2); color: var(--th-ink); }
.th-wq-panel__close:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
.th-wq-panel__scroll { flex: 1; overflow-y: auto; min-height: 0; }
.th-wq-panel__denied {
  margin: 18px;
  border: 1px solid var(--th-line);
  border-radius: var(--th-radius-5);
  background: var(--th-paper-2);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.th-wq-panel__denied-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--th-paper); border: 1px solid var(--th-line); color: var(--th-ink-2); }
.th-wq-panel__denied b { font-weight: 600; color: var(--th-ink); }
.th-wq-panel__denied span { font-size: 12.5px; color: var(--th-ink-2); line-height: 1.5; }
.th-wq-panel__alert {
  margin: 14px 18px 0;
  border-radius: var(--th-radius-5);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.5;
}
.th-wq-panel__alert > svg { margin-top: 2px; }
.th-wq-panel__alert b { font-weight: 600; }
.th-wq-panel__alert.is-warn { border: 1px solid var(--th-warn); background: var(--th-warn-soft); color: var(--th-warn-ink); }
.th-wq-panel__alert.is-risk { border: 1px solid var(--th-risk); background: var(--th-risk-soft); color: var(--th-risk-ink); }
.th-wq-panel__alert.is-info { border: 1px solid var(--th-advant); background: var(--th-advant-soft); color: var(--th-advant-deep); }
.th-wq-panel__alert button {
  font: inherit;
  font-size: 12px;
  padding: 1px 8px;
  border: 1px solid currentColor;
  border-radius: var(--th-radius-3);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.th-wq-facts { padding: 14px 18px 0; display: grid; grid-template-columns: 118px minmax(0, 1fr); row-gap: 9px; column-gap: 12px; font-size: 12.5px; margin: 0; }
.th-wq-facts dt { color: var(--th-ink-2); margin: 0; }
.th-wq-facts dd { margin: 0; color: var(--th-ink); line-height: 1.45; min-width: 0; }
.th-wq-facts__when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-wq-facts__mono { font-family: var(--th-font-mono); font-size: 11.5px; color: var(--th-ink-2); }
.th-wq-facts__file { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.th-wq-facts__file a { color: var(--th-ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.th-wq-facts__file a:hover { color: var(--th-advant-deep); }
.th-wq-facts__ref { font-family: var(--th-font-mono); font-size: 11px; color: var(--th-ink-2); }
.th-wq-facts__people { display: flex; flex-direction: column; gap: 4px; }
.th-wq-facts__person { display: flex; align-items: center; gap: 8px; }
.th-wq-facts__note { font-size: 11px; color: var(--th-ink-2); }
.th-wq-facts dd.th-wq-facts__quiet { font-size: 11.5px; color: var(--th-ink-2); line-height: 1.45; }
.th-wq-facts dd.th-wq-facts__secondary { color: var(--th-ink-2); }
.th-wq-facts__sub { display: block; font-size: 11px; color: var(--th-ink-2); }
.th-wq-source { margin: 16px 18px 0; border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-2); }
.th-wq-source__head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--th-line-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--th-ink-2);
  flex-wrap: wrap;
}
.th-wq-source__head span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--th-ink-2); }
.th-wq-source__body { padding: 10px 12px; font-size: 12.5px; color: var(--th-ink); line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.th-wq-source__body.is-quiet { font-size: 12px; color: var(--th-ink-2); white-space: normal; }
.th-wq-panel__actions { margin: 16px 18px 0; padding-top: 14px; border-top: 1px solid var(--th-line); display: flex; flex-direction: column; gap: 8px; }
.th-wq-panel__note { font-size: 11.5px; color: var(--th-ink-2); line-height: 1.5; }
.th-wq-panel__layers { margin: 16px 18px 20px; padding-top: 14px; border-top: 1px solid var(--th-line); font-size: 11.5px; color: var(--th-ink-2); line-height: 1.55; }
.th-wq-panel__layers b { font-weight: 600; color: var(--th-ink-2); }

/* ---------- responsive: the list folds by its own width ---------- */
@container th-wq-list (max-width: 800px) {
  .th-col-dest { display: none; }
}
@container th-wq-list (max-width: 560px) {
  .th-col-resp { display: none; }
}
@container th-wq-list (max-width: 440px) {
  .th-col-file { display: none; }
  .th-wq-fold { display: block; }
}
@media (max-width: 1100px) {
  .th-wq-rail { width: 176px; }
}
@media (max-width: 720px) {
  /* Stacked, the head, the Working-across band and the wrapped rail can fill the viewport: the list keeps a usable
     height and the page scrolls, rather than the list collapsing under the rail. */
  .th-wq-body { flex-direction: column; flex: 1 0 auto; }
  .th-wq-main { min-height: 360px; }
  .th-wq-rail { width: auto; border-right: 0; border-bottom: 1px solid var(--th-line); flex-direction: row; flex-wrap: wrap; overflow: visible; padding: 8px 12px; gap: 6px; }
  .th-wq-rail__head, .th-wq-rail__note { display: none; }
  .th-wq-panel { width: 100vw; }
  .th-wq-head { flex-direction: column; align-items: stretch; }
  .th-adm-health { grid-template-columns: 16px minmax(0, 1fr); }
  .th-adm-health > a { grid-column: 2; }
  .th-auth-row { grid-template-columns: 16px minmax(0, 1fr); }
  .th-auth-row > :last-child { grid-column: 2; }
}
