/* Shared styles for the RiverSync DATA WORKFLOW document set (SPEC-DWF):
   master + eight bounded-context drill-downs. Layered on ../prd/prd-doc.css
   (A4 paper, type scale, tables — never restated here). Self-contained surface
   pills + the state-transition diagram styling the DWF renderer draws into. */

/* ---- context chips (tone per bounded context, mirrors the DDD/ERD tones) -- */
.dwfchip{display:inline-block; font-family:var(--rs-font-mono, ui-monospace, monospace);
  font-size:8.5px; font-weight:700; letter-spacing:.05em; padding:1px 6px; border-radius:2px;
  border:1px solid; vertical-align:1px;}
.dwfchip--blue{color:#3679AC; background:#E8F1F8; border-color:#C9DDEE;}
.dwfchip--purple{color:#7363A3; background:#F0EDF7; border-color:#D8D0E8;}
.dwfchip--teal{color:#4C7C8A; background:#E9F2F4; border-color:#C7DDE2;}
.dwfchip--green{color:#3F8A45; background:#EAF4EB; border-color:#C8E2CA;}
.dwfchip--ochre{color:#9C7A1E; background:#FAF1D8; border-color:#EBD9A4;}
.dwfchip--red{color:#B0474B; background:#F9ECED; border-color:#EBC8CA;}
.dwfchip--cyan{color:#2C7B93; background:#E5F3F6; border-color:#BEE0E7;}
.dwfchip--slate{color:#66737F; background:#F1F4F7; border-color:#D7DEE4;}

/* ---- operation pills (the verb that fires a transition) ------------------- */
.oppill{display:inline-block; font-family:var(--rs-font-mono, ui-monospace, monospace);
  font-size:8.5px; font-weight:700; letter-spacing:.04em; padding:2px 6px; border-radius:2px;
  border:1px solid; white-space:nowrap; text-transform:uppercase;}
.oppill--create{color:#3F8A45; background:#EAF4EB; border-color:#C8E2CA;}
.oppill--update{color:#9C7A1E; background:#FAF1D8; border-color:#EBD9A4;}
.oppill--archive{color:#66737F; background:#F1F4F7; border-color:#D7DEE4;}
.oppill--delete{color:#B0474B; background:#F9ECED; border-color:#EBC8CA;}
.oppill--read{color:#3679AC; background:#E8F1F8; border-color:#C9DDEE;}

/* ---- inline mono reference tokens (event · rule · process) ---------------- */
.dwfref{font-family:var(--rs-font-mono, ui-monospace, monospace); font-size:9.5px;
  font-weight:600; color:var(--ink-2); white-space:nowrap;}
.dwfref--evt{color:#3F8A45;}
.dwfref--rule{color:#7363A3;}
.dwfref--pwf{color:#B0474B;}
.dwfref--none{color:#C3CCD4;}

/* ---- the lifecycle figure (diagram + table per entity) -------------------- */
.life{margin:14px 0 20px; break-inside:avoid;}
.life__h{display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:0 0 2px;}
.life__h b{font-size:14px;}
.life__h .mono{font-size:9.5px; color:var(--ink-3);}
.life__sub{margin:0 0 8px; font-size:12px; color:var(--ink-2);}
.life__sub i{color:var(--ink-3); font-style:normal;}

.lifesvg{margin:6px 0 4px;}
.lifesvg svg{display:block; width:100%; height:auto;}

/* state-diagram nodes (drawn by the renderer as <rect class> + <text>) */
.st-box{stroke-width:1.4px; rx:4;}
.st-box.k-start{fill:#E8F1F8; stroke:#9CC0DD;}
.st-box.k-active{fill:#EAF4EB; stroke:#A6D0AA;}
.st-box.k-hold{fill:#FAF1D8; stroke:#E2CB85;}
.st-box.k-done{fill:#E5EEF6; stroke:#92B6D6;}
.st-box.k-term{fill:#F1F4F7; stroke:#CBD4DC;}
.st-box.k-gone{fill:#F9ECED; stroke:#E3B6B8;}
.st-label{font-family:var(--rs-font, system-ui, sans-serif); font-size:11px; font-weight:600;
  fill:var(--ink); text-anchor:middle; dominant-baseline:central;}
.st-edge{fill:none; stroke:#9AA7B2; stroke-width:1.3px;}
.st-edge--entry{stroke:#3F8A45;}
.st-edge--term{stroke:#B7C0C8; stroke-dasharray:3 3;}
.st-arrow{fill:#9AA7B2;}
.st-arrow--entry{fill:#3F8A45;}
.st-elabel{font-family:var(--rs-font, system-ui, sans-serif); font-size:9.5px; font-weight:600;
  fill:var(--ink-2); text-anchor:middle; paint-order:stroke; stroke:#FFFFFF; stroke-width:3px;
  stroke-linejoin:round;}

/* the per-entity transition table */
.trtab{width:100%; border-collapse:collapse; font-size:12px; margin:4px 0 2px;}
.trtab th{text-align:left; font-size:9.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--ink-3); padding:5px 10px 5px 0; border-bottom:1px solid var(--hairline-strong); white-space:nowrap;}
.trtab td{padding:7px 10px 7px 0; border-bottom:1px solid var(--hairline); vertical-align:top;}
.trtab td.tr-path{white-space:nowrap; font-weight:600; color:var(--ink);}
.trtab td.tr-path .ar{color:var(--ink-3); font-weight:400; padding:0 3px;}
.trtab td.tr-op{white-space:nowrap; width:1%;}
.trtab td.tr-who{white-space:normal; min-width:74px; color:var(--ink-2);}
.trtab td.tr-refs{line-height:1.85;}
.trtab td.tr-refs .sep{color:#C3CCD4; padding:0 2px;}

/* "other records" compact list (config / reference / derived) */
.dwfother{margin:8px 0 4px; padding:0; list-style:none;}
.dwfother li{padding:6px 0; border-bottom:1px solid var(--hairline); font-size:12px; color:var(--ink-2);}
.dwfother li b{color:var(--ink); font-weight:600;}
.dwfother li .mono{font-size:9.5px; color:var(--ink-3);}

/* master matrix */
.dwfmx{width:100%; border-collapse:collapse; font-size:12px; margin:12px 0 4px;}
.dwfmx th{text-align:left; font-size:9.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--ink-3); padding:6px 8px 6px 0; border-bottom:1px solid var(--hairline-strong);}
.dwfmx td{padding:7px 8px 7px 0; border-bottom:1px solid var(--hairline); vertical-align:top;}
.dwfmx td.mxg{font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--ink-3); padding:14px 0 5px; border-bottom:1px solid var(--hairline-strong);}
.dwfmx td:first-child{font-weight:600; color:var(--ink); white-space:nowrap;}
.mxdot{display:inline-block; width:15px; text-align:center; font-weight:700;}
.mxdot--y{color:#3F8A45;} .mxdot--n{color:#CDD5DC;} .mxdot--s{color:#9C7A1E;}

/* lifecycle legend */
.dwfleg{display:flex; flex-wrap:wrap; gap:8px 16px; margin:10px 0 4px; font-size:11px; color:var(--ink-2);}
.dwfleg span{display:inline-flex; align-items:center; gap:6px;}
.dwfleg i{width:13px; height:13px; border-radius:3px; border:1.4px solid; display:inline-block;}
.lg-start{background:#E8F1F8; border-color:#9CC0DD;}
.lg-active{background:#EAF4EB; border-color:#A6D0AA;}
.lg-hold{background:#FAF1D8; border-color:#E2CB85;}
.lg-done{background:#E5EEF6; border-color:#92B6D6;}
.lg-term{background:#F1F4F7; border-color:#CBD4DC;}
.lg-gone{background:#F9ECED; border-color:#E3B6B8;}

@media print{
  .life, .lifesvg, .dwfmx tr, .trtab tr, .dwfother li{break-inside:avoid;}
  .lifesvg svg, .dwfchip, .oppill, .mxdot, .dwfleg i{print-color-adjust:exact; -webkit-print-color-adjust:exact;}
}
