/* Workflow pages (matter Workflow tab, step page, record proof). Trust marks
   are shapes, not only colors; every row action is at least 44px high. */
.rd-wf-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.rd-wf-tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.4rem 0.9rem;
  border: 1px solid var(--rd-border-input); border-radius: 6px; color: var(--rd-text); text-decoration: none;
}
.rd-wf-tabs a[aria-current="page"] { border: 2px solid var(--rd-link); background: #e7f1ff; font-weight: 600; }
.rd-wf-tabs a.rd-wf-ended { color: var(--rd-text-muted); border-color: var(--rd-border); }

.rd-wf-draft { background: #fff4e6; border: 1px solid #f0b37e; border-radius: 6px; padding: 0.5rem 0.9rem; font-size: 0.925rem; margin-bottom: 1rem; }

.rd-wf-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.rd-wf-views { display: inline-flex; border: 1px solid var(--rd-border-input); border-radius: 6px; overflow: hidden; }
.rd-wf-views a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; color: var(--rd-text); text-decoration: none; }
.rd-wf-views a + a { border-left: 1px solid var(--rd-border-input); }
.rd-wf-views a[aria-current="true"] { background: var(--rd-text); color: #fff; }

.rd-wf-target { min-height: 44px; display: inline-flex; align-items: center; }
/* Disclosure summaries keep their marker and a 44px target. */
summary.rd-wf-target { display: list-item; padding-top: 0.6rem; }
.rd-wf-trust { display: inline-flex; gap: 0.4rem; align-items: center; }
.rd-wf-mark { vertical-align: -2px; }
.rd-wf-section { margin-top: 1.75rem; }
.rd-wf-section h2 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.rd-wf-box { border: 1px solid var(--rd-border); border-radius: 8px; }
.rd-wf-list { list-style: none; margin: 0; padding: 0; }
.rd-wf-list > li { padding: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: center; }
.rd-wf-list > li + li { border-top: 1px solid var(--rd-border); }
.rd-wf-phases details { padding: 0.6rem 0.75rem; }
.rd-wf-phases details + details { border-top: 1px solid var(--rd-border); }
.rd-wf-phases summary { min-height: 32px; }
.rd-wf-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.85rem; color: #495057; margin-top: 1.25rem; }
.rd-wf-legend span { display: inline-flex; gap: 0.4rem; align-items: center; }
.rd-wf-sub { font-size: 0.85rem; color: var(--rd-text-muted); }

/* Step page */
.rd-wf-status { border: 1px solid var(--rd-border); border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem; }
.rd-wf-date { font-size: 1.5rem; font-weight: 600; }
.rd-wf-trace { list-style: none; padding: 0; margin: 0; }
.rd-wf-trace li { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: 0.25rem 1rem; padding: 0.4rem 0; }
.rd-wf-trace li + li { border-top: 1px dashed var(--rd-border); }
.rd-wf-trace .rd-wf-when { font-family: var(--bs-font-monospace); white-space: nowrap; }
.rd-wf-quote { border-left: 3px solid var(--rd-border-input); padding-left: 0.75rem; color: #495057; margin: 0.5rem 0 0; }
.rd-wf-corrected { color: var(--rd-text-muted); }
.rd-wf-corrected .rd-wf-what { text-decoration: line-through; }

/* Tables become stacked rows at phone width. */
@media (max-width: 575.98px) {
  .rd-wf-table thead { display: none; }
  .rd-wf-table tr { display: block; border-top: 1px solid var(--rd-border); padding: 0.5rem 0; }
  .rd-wf-table td { display: block; border: 0; padding: 0.15rem 0.75rem; }
  .rd-wf-table td[data-label]::before { content: attr(data-label) ": "; color: var(--rd-text-muted); font-size: 0.8rem; }
  .rd-wf-trace li { grid-template-columns: 1fr; }
}

/* Timeline (WorkflowTimeline): positioned HTML on one date scale. Each mark
   is a link with a shape and words; the table below has the same data. */
.rd-tl-scroll { overflow-x: auto; border: 1px solid var(--rd-border); border-radius: 8px; background: #fff; }
.rd-tl-scroll:focus-visible { outline: 2px solid var(--rd-link); outline-offset: 2px; }
.rd-tl-canvas { position: relative; }
.rd-tl-shade { position: absolute; background: #eceef0; }
.rd-tl-tick { position: absolute; top: 8px; border-left: 1px solid var(--rd-border); }
.rd-tl-tick span { position: absolute; left: 4px; top: 0; font-size: 0.8rem; font-weight: 600; color: #495057; white-space: nowrap; }
.rd-tl-row-label { position: absolute; left: 0; width: 190px; padding: 0.6rem 0.75rem; font-size: 0.875rem; line-height: 1.25; background: #fff; }
.rd-tl-row-line { position: absolute; height: 0; border-top: 1px solid var(--rd-border); }
.rd-tl-today { position: absolute; width: 2px; background: #0b5ed7; }
.rd-tl-today-label { position: absolute; font-size: 0.8rem; font-weight: 600; color: #0b5ed7; white-space: nowrap; }
.rd-tl-range { position: absolute; height: 0; border-top: 2px dashed #0b5ed7; }
.rd-tl-mark {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px;
  color: var(--rd-text); text-decoration: none; text-align: center; font-size: 0.75rem; line-height: 1.2; border-radius: 6px;
}
.rd-tl-mark:hover, .rd-tl-mark:focus-visible { background: #e7f1ff; color: var(--rd-text); outline: 2px solid var(--rd-link); z-index: 2; }
.rd-tl-shape { flex-shrink: 0; }
.rd-tl-text { display: block; max-width: 100%; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #495057; }
.rd-tl-legal .rd-tl-text { color: var(--rd-text); }
.rd-tl-done .rd-tl-text { color: var(--rd-text-muted); }
.rd-tl-undated { border: 1px dashed #adb5bd; border-radius: 8px; padding: 0.75rem 1rem; }
.rd-tl-undated ul { padding-left: 1.1rem; }

/* Map with this workflow's state: words on every station, and a shape or
   line style for each state (not only a color). */
.rd-wf-map-phone { display: none; }
.rd-pb-state { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: #495057; }
.rd-pb-paint-active { border: 4px solid #0b5ed7; background: #e7f1ff; }
.rd-pb-paint-active .rd-pb-state { color: #084298; }
.rd-pb-paint-waiting { border: 2px dashed #0b5ed7; }
.rd-pb-paint-done { background: #f1f3f5; color: #495057; }
.rd-pb-paint-done .rd-pb-state::before { content: "\2713  "; }
.rd-pb-paint-not-reached { opacity: 0.72; border-style: dotted; }
.rd-pb-paint-not-applicable { opacity: 0.6; border-style: dotted; }
.rd-pb-paint-not-applicable .rd-pb-name { text-decoration: line-through; }
.rd-pb-paint-key { width: 22px; height: 14px; border-radius: 3px; border: 2px solid var(--rd-pb-main); }
.rd-pb-paint-key.rd-pb-paint-active { border: 4px solid #0b5ed7; }
.rd-pb-paint-key.rd-pb-paint-waiting { border: 2px dashed #0b5ed7; }
.rd-pb-paint-key.rd-pb-paint-not-reached, .rd-pb-paint-key.rd-pb-paint-not-applicable { border-style: dotted; }

@media (max-width: 575.98px) {
  .rd-tl-chart { display: none; }
  .rd-wf-map { display: none; }
  .rd-wf-map-phone { display: block; }
}

/* Workflow chooser: one card per playbook. The fit is a word with a symbol,
   not only a color. Cards stack on a phone and sit two across when wide. */
.rd-wf-choices { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 992px) { .rd-wf-choices { grid-template-columns: 1fr 1fr; } }
.rd-wf-choice { display: flex; flex-direction: column; border: 1px solid var(--rd-border); border-left-width: 4px; border-radius: 8px; padding: 1rem; min-width: 0; overflow-wrap: anywhere; background: #fff; transition: box-shadow 0.15s, border-color 0.15s; }
.rd-wf-choice:hover,
.rd-wf-choice:focus-within { border-color: #6c757d; box-shadow: 0 0 0 1px #6c757d, 0 4px 12px rgba(0, 0, 0, 0.12); }
.rd-wf-choice-fits { border-left-color: #1e7b45; }
.rd-wf-choice-unknown { border-left-color: #b4590a; }
.rd-wf-choice-running { border-left-color: #0b5ed7; }
.rd-wf-choice-does-not-fit { border-left-color: #adb5bd; }
.rd-wf-choice h4 { margin-top: 0.75rem; }
.rd-wf-choice-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 0.75rem; }
.rd-wf-fit { display: inline-flex; gap: 0.35rem; align-items: center; }
.rd-wf-fit-fits { color: #1e7b45; }
.rd-wf-fit-unknown { color: #8a4508; }
.rd-wf-fit-running { color: #0b5ed7; }
.rd-wf-fit-no { color: #495057; }
.rd-wf-reason-word { font-weight: 600; }
.rd-wf-another > summary h2 { font-size: 1.125rem; }

/* Who acts (playbook `actor`): a chip with the word, never color alone.
   "You" is the attorney. A review gate's state is a word too. */
.rd-wf-actor { display: inline-block; font-size: 0.75rem; font-weight: 600; line-height: 1.4; padding: 0 0.45rem; border-radius: 999px;
  border: 1px solid #adb5bd; color: #343a40; background: #fff; white-space: nowrap; vertical-align: 1px; }
.rd-wf-actor-attorney { border-color: #0b5ed7; color: #0a58ca; background: #e7f1ff; }
.rd-wf-actor-client { border-color: #6f42c1; color: #59359a; background: #f3eefc; }
.rd-wf-actor-court { border-color: #495057; color: #343a40; background: #f1f3f5; }
.rd-wf-actor-counterparty { border-color: #b4590a; color: #8a4508; background: #fff4e6; }
.rd-wf-gate { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0 0.45rem; border-radius: 4px; border: 1px solid #adb5bd; color: #495057; }
.rd-wf-gate-open { border-color: #997404; background: #fff3cd; color: #664d03; }
.rd-wf-filter { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.rd-wf-filter .form-check { min-height: 44px; display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; }

/* Who view: lanes side by side from 992px, stacked below. */
.rd-wf-lane-head { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--rd-text-muted); margin: 0.75rem 0 0.25rem; }
.rd-wf-lane-item { padding: 0.35rem 0; }
.rd-wf-lane-item + .rd-wf-lane-item { border-top: 1px solid var(--rd-border); }

/* Timeline: an open review gate is an open square ("Review before"). */
.rd-tl-review .rd-tl-text { color: #664d03; }
