/* ==================================================================
   All Files > Routing bulk (th-rb-*)
   ------------------------------------------------------------------
   Lifted from the approved Routing Bulk canon (Routing Bulk.dc.html,
   states B01-B09) on production tokens, mapped as in
   threshold-operational-components.css:
     --advant* -> --th-advant* · --sunk -> --th-paper-sunk ·
     --paper2 -> --th-paper-2 · --line2 / lineSoft -> --th-line-2 /
     --th-line-soft · --ink2 -> --th-ink-2 · --mono -> --th-font-mono.
   The selection column is th-grid's own (th-grid-cb, is-selected).
   Pills, the modal shell and the radio rows are production atoms
   (cc-pill, th-scrim / th-modal, th-radio) and are not redefined.
   ================================================================== */

/* ---------- bulk bar: between the toolbar and the meta strip, which stays ---------- */
.th-grid-bulkbar.th-rb-bar {
  gap: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--th-ink);
  background: var(--th-advant-soft);
  border: 1px solid var(--th-line);
  border-bottom: none;
  border-top: 1px solid var(--th-line-soft);
  flex-wrap: wrap;
}
.th-rb-bar__count { font-weight: 600; font-family: var(--th-font-mono); }
.th-rb-bar__scope { font-size: 11px; color: var(--th-ink-2); }
.th-rb-bar__sep { width: 1px; height: 18px; background: var(--th-line-2); margin: 0 4px; }
.th-rb-bar__spacer { flex: 1; }
.th-rb-act {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border: 1px solid var(--th-line-2);
  border-radius: var(--th-radius-3);
  background: var(--th-paper-sunk);
  color: var(--th-ink);
  cursor: pointer;
  white-space: nowrap;
}
.th-rb-act.is-primary { border-color: var(--th-advant-deep); background: var(--th-advant-deep); color: var(--th-advant-fg); }
.th-rb-bar__clear {
  font: inherit;
  font-size: 11.5px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: var(--th-radius-3);
  background: transparent;
  color: var(--th-ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.th-rb-bar__clear:hover { color: var(--th-ink); }
.th-rb-act:focus-visible,
.th-rb-bar__clear:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
.th-rb-bar + .th-grid-meta { border-top: 1px solid var(--th-line-soft); }
.th-grid-cb:disabled { cursor: not-allowed; opacity: .45; }

/* ---------- B08 restricted and B09 offline notes, under the page head ---------- */
.th-rb-note {
  margin: 0 24px 14px;
  border: 1px solid var(--th-line);
  border-radius: var(--th-radius-5);
  background: var(--th-paper-2);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  font-size: 12.5px;
  color: var(--th-ink-2);
  line-height: 1.5;
}
.th-rb-note > svg { margin-top: 2px; color: var(--th-ink-2); }
.th-rb-note__code { font-family: var(--th-font-mono); font-size: 11.5px; }
.th-rb-offline {
  margin: 0 24px 14px;
  border: 1px solid var(--th-warn);
  border-radius: var(--th-radius-5);
  background: var(--th-warn-soft);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--th-warn-ink);
}
.th-rb-offline > svg { flex: none; }

/* ---------- B03-B04 preview and confirmation sheet ---------- */
.th-rb-scrim { background: oklch(20% 0.01 255 / 0.45); padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; }
.th-rb-modal { width: 640px; border-radius: var(--th-radius-8); box-shadow: 0 24px 60px oklch(20% 0.01 255 / 0.3); font-size: 13.5px; max-height: calc(100vh - 24px); }
.th-rb-body { display: flex; flex-direction: column; gap: 12px; font-size: 13px; color: var(--th-ink-2); line-height: 1.55; }
.th-rb-pick { border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper); }
.th-rb-pick__head,
.th-rb-kicker { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--th-ink-2); }
.th-rb-pick__head { padding: 8px 12px; border-bottom: 1px solid var(--th-line); }
.th-rb-opt {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid var(--th-line-soft); background: transparent;
  font: inherit; font-size: 12.5px; color: var(--th-ink); cursor: pointer;
}
.th-rb-opt:hover { background: var(--th-paper-2); }
.th-rb-opt[aria-checked="true"] { background: var(--th-advant-soft); }
.th-rb-opt:disabled { opacity: .55; cursor: not-allowed; }
.th-rb-opt:disabled:hover { background: transparent; }
.th-rb-opt:focus-visible { outline: 2px solid var(--th-advant); outline-offset: -2px; }
.th-rb-opt.is-stacked { align-items: flex-start; }
.th-rb-opt__dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--th-line-2); display: grid; place-items: center; flex: none; }
.th-rb-opt__dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.th-rb-opt[aria-checked="true"] .th-rb-opt__dot { border-color: var(--th-advant); }
.th-rb-opt[aria-checked="true"] .th-rb-opt__dot::after { background: var(--th-advant); }
.th-rb-opt.is-stacked .th-rb-opt__dot { margin-top: 2px; }
.th-rb-opt__name { flex: 1; font-weight: 500; }
.th-rb-opt__text { display: flex; flex-direction: column; gap: 1px; }
.th-rb-opt__text .th-rb-opt__name { flex: none; }
.th-rb-opt__note { font-size: 11px; color: var(--th-ink-2); }
.th-rb-pick__alert,
.th-rb-pick__loading { padding: 12px; font-size: 12.5px; color: var(--th-ink-2); line-height: 1.5; }
.th-rb-pick__alert b { color: var(--th-ink); font-weight: 600; }
.th-rb-inline-btn { font: inherit; font-size: 12px; font-weight: 500; padding: 1px 8px; border: 1px solid var(--th-line-2); border-radius: var(--th-radius-3); background: var(--th-paper-sunk); color: var(--th-ink); cursor: pointer; }
.th-rb-reason { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--th-ink-2); }
.th-rb-reason__req { color: var(--th-risk); }
.th-rb-reason textarea {
  font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--th-line-2); border-radius: var(--th-radius-3);
  background: var(--th-paper); color: var(--th-ink); resize: vertical; line-height: 1.45;
}
.th-rb-reason textarea::placeholder { color: var(--th-ink-2); opacity: 1; }
.th-rb-reason textarea:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 1px; }
.th-rb-preview { border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper); }
.th-rb-preview__head { padding: 8px 12px; border-bottom: 1px solid var(--th-line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-rb-preview__sub { font-family: var(--th-font-mono); font-size: 10.5px; color: var(--th-ink-2); }
.th-rb-preview__row {
  display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); gap: 8px; padding: 7px 12px;
  border-bottom: 1px solid var(--th-line-soft); font-size: 12px; align-items: start;
}
.th-rb-preview__row.is-blocked { background: var(--th-risk-soft); }
.th-rb-preview__row.is-warn { background: var(--th-warn-soft); }
.th-rb-preview__file,
.th-rb-preview__to { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.th-rb-preview__name { color: var(--th-ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-rb-preview__ref { font-family: var(--th-font-mono); font-size: 11px; color: var(--th-ink-2); font-weight: 400; }
.th-rb-preview__before { color: var(--th-ink-2); }
.th-rb-preview__arrow { color: var(--th-ink-2); text-align: center; }
.th-rb-preview__after { color: var(--th-ink); }
.th-rb-preview__row.is-blocked .th-rb-preview__after { color: var(--th-ink-2); }
.th-rb-preview__note { font-size: 11px; color: var(--th-ink-2); line-height: 1.4; }
.th-rb-preview__row.is-blocked .th-rb-preview__note { color: var(--th-risk-ink); }
.th-rb-preview__row.is-warn .th-rb-preview__note { color: var(--th-warn-ink); }
.th-rb-facts { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.th-rb-fact { display: flex; gap: 8px; }
.th-rb-fact > svg { color: var(--th-ink-2); flex: none; margin-top: 2px; }
.th-rb-modal .th-modal__foot { flex-wrap: wrap; }
.th-rb-foot__counts { font-family: var(--th-font-mono); font-size: 10.5px; color: var(--th-ink-2); margin-right: auto; }
.th-rb-modal .cc-btn { font-size: 12.5px; white-space: nowrap; }

/* ---------- B05-B07 run ---------- */
.th-rb-mono { font-family: var(--th-font-mono); }
.th-rb-run__back { padding: 16px 24px 0; }
.th-rb-run__back a { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--th-ink-2); }
.th-rb-run__head { padding: 10px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.th-rb-run__heading { min-width: 0; }
.th-rb-run__title {
  margin: 0; font-family: var(--th-font-serif); font-weight: 500; font-size: 23px; letter-spacing: -0.012em; color: var(--th-ink);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.th-rb-run__title:focus { outline: none; }
.th-rb-run__status { font-family: var(--th-font-sans); font-size: 11px; letter-spacing: 0; }
.th-rb-run__sub { margin-top: 4px; font-size: 12.5px; color: var(--th-ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-rb-run__actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
.th-rb-run__actions .cc-btn { font-size: 12.5px; white-space: nowrap; }
/* Canon's secondary button reads in ink; the page's link colour would make it a link inside a button frame. */
.th-rb-run__actions a.cc-btn,
.th-rb-run__actions a.cc-btn:hover { color: var(--th-ink); }
.th-rb-run__summary {
  margin: 14px 24px 0; border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-sunk);
  padding: 12px 16px; display: flex; flex-direction: column; gap: 8px;
}
.th-rb-run__tally { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.th-rb-run__tally-item { display: inline-flex; align-items: center; gap: 6px; }
.th-rb-run__tally-n { color: var(--th-ink); }
.th-rb-run__done { margin-left: auto; font-size: 11px; color: var(--th-ink-2); }
.th-rb-run__bar { height: 6px; border-radius: 3px; background: var(--th-paper-2); overflow: hidden; }
.th-rb-run__fill { height: 100%; background: var(--th-advant); transition: width 300ms ease; }
.th-rb-run__note { font-size: 11.5px; color: var(--th-ink-2); line-height: 1.5; }
.th-rb-run__check { font-size: 11.5px; color: var(--th-warn-ink); }
.th-rb-run__gutter { padding: 16px 24px 0; }
.th-rb-run__gutter.is-last { padding-bottom: 28px; }
.th-rb-run__loading { font-size: 12.5px; color: var(--th-ink-2); }
.th-rb-run__table-wrap { border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-sunk); overflow-x: auto; }
.th-rb-run__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 720px; }
.th-rb-run__table th {
  text-align: left; padding: 8px 14px; font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--th-ink-2); background: var(--th-paper-2); border-bottom: 1px solid var(--th-line);
}
.th-rb-run__table th.is-resp { width: 200px; white-space: nowrap; }
.th-rb-run__table td { padding: 9px 14px; border-bottom: 1px solid var(--th-line-soft); vertical-align: top; }
.th-rb-run__table tr.is-attention { background: var(--th-warn-soft); }
.th-rb-run__table td.is-before { font-size: 12.5px; color: var(--th-ink-2); }
.th-rb-run__table td.is-requested { font-size: 12.5px; color: var(--th-ink); }
.th-rb-run__file { display: flex; flex-direction: column; gap: 1px; }
.th-rb-run__file a { font-weight: 500; color: var(--th-ink); white-space: nowrap; }
.th-rb-run__file a:hover { color: var(--th-advant-deep); }
.th-rb-run__file a:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; border-radius: 2px; }
.th-rb-run__ref { font-size: 11.5px; color: var(--th-ink-2); }
.th-rb-run__outcome { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.th-rb-run__outcome-note { font-size: 11.5px; color: var(--th-ink-2); line-height: 1.45; }
.th-rb-run__applying { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--th-ink-2); }
.th-rb-run__queued { font-size: 12px; color: var(--th-ink-2); }
.th-rb-run__withheld {
  border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-2); padding: 10px 14px;
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 12.5px; color: var(--th-ink-2); line-height: 1.5;
}
.th-rb-run__withheld > svg { margin-top: 2px; }

/* ---------- B06 return-to-progress strip, in the Viewing bar ---------- */
.th-rb-resume {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--th-advant); background: var(--th-advant-soft); color: var(--th-advant-deep);
  font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.th-rb-resume:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
/* The production Viewing bar has a fixed height and does not wrap as the prototype's does: the strip yields its width
   rather than pushing the page sideways, and keeps its full words in its title and accessible name. */
.th-rb-resume { flex: 0 1 auto; min-width: 150px; overflow: hidden; }
/* Canon's 720 rule lets the definition button shrink (.th-appdef-btn { min-width:0; flex:1 }); with the strip present
   below 1000px the two share the bar instead of the strip collapsing to its spinner. */
@media (max-width: 1000px) {
  .apdsw-bar:has(.th-rb-resume) button.apdsw-anchor { min-width: 180px; flex: 1 1 0; }
  .apdsw-bar:has(.th-rb-resume) .apdsw-anchor-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.th-rb-resume__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- the canon's spinner ---------- */
@keyframes th-rb-spin { to { transform: rotate(360deg); } }
.th-rb-spin {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--th-line-2); border-top-color: var(--th-advant);
  animation: th-rb-spin .9s linear infinite; display: inline-block; flex: none;
}
.th-rb-spin.is-small { width: 10px; height: 10px; }
@media (prefers-reduced-motion: reduce) { .th-rb-spin { animation: none; } }

/* ---------- narrow: canon's 720px reading ---------- */
@media (max-width: 720px) {
  .th-rb-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
  .th-rb-run__head { flex-direction: column; align-items: stretch; }
}
