/* ============================================================
   dw4-contract.css — DW4 (2026-10-18): F36 + F38, the Contract
   tab (dw4-contract.js). Structure first, then the light skin
   scoped body.skin-billdr; colours through --ds-* tokens only so
   the Navy appearance re-points them (rule 13). The contract
   document dialog lives on body (fxDialog), so its rules scope to
   body.skin-billdr, not #app.
   ============================================================ */

/* ---------- structure ---------- */
.dw4ct { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dw4ct-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.dw4ct-kpis .ds-kpi-v { white-space: nowrap; }
.dw4ct-note { margin: 0; font-size: 13px; }
.dw4ct-sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dw4ct-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dw4ct-h { margin: 0; font-size: 16px; }
.dw4ct-table { width: 100%; border-collapse: collapse; }
.dw4ct-table th, .dw4ct-table td { padding: 10px 12px; text-align: left; vertical-align: middle; }
.dw4ct-table .ds-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dw4ct-table .ds-name, .dw4ct-table .ds-sub { display: block; }
.dw4ct-row { cursor: pointer; }
.dw4ct-c-menu { width: 44px; text-align: right; }
.dw4ct-start { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 20px; }
.dw4ct-start h3 { margin: 4px 0 0; font-size: 18px; }
.dw4ct-start p { margin: 0; max-width: 560px; }
.dw4ct-start-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.dw4ct-start-acts { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; }
.dw4ct-start-src, .dw4ct-start-alt { font-size: 13px; }
.dw4ct-link { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }

.fx-dialog.dw4ct-doc-dlg { width: min(980px, calc(100vw - 32px)); max-width: none; }
.dw4ct-doc-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 12px; }
.dw4ct-doc-acts { display: inline-flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.dw4ct-doc-dates { display: flex; gap: 6px 18px; flex-wrap: wrap; margin: 8px 0 4px; font-size: 13px; }
.dw4ct-doc-consent { margin-top: 8px; }
.dw4ct-doc-consent-ans { margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.dw4ct-ticked { display: inline-grid; place-items: center; font-size: 11px; line-height: 1; font-weight: 700; }
.dw4ct-doc-signrec { margin: 10px 0 0; font-size: 13px; font-weight: 600; }
.dw4ct-consent { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.dw4ct-consent legend { padding: 0; margin-bottom: 4px; }
.dw4ct-consent label { display: flex; align-items: center; gap: 8px; font-weight: 400; }

@media (max-width: 640px) {
  .dw4ct-doc-acts { margin-left: 0; width: 100%; }
  .dw4ct-table th:nth-child(3), .dw4ct-table td:nth-child(3) { display: none; }
}

/* ---------- light skin (tokens) ---------- */
body.skin-billdr #app .dw4ct-note { color: var(--ds-muted); font-size: var(--ds-fs-sm); }
body.skin-billdr #app .dw4ct-h { color: var(--ds-navy); font-size: var(--ds-fs-md); font-weight: 700; }
body.skin-billdr #app .dw4ct-kpis { margin: 0; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
body.skin-billdr #app .dw4ct-kpis .ds-kpi { padding: 14px 16px; }
body.skin-billdr #app .dw4ct-kpis .ds-kpi-v { font-size: clamp(18px, 1.7vw, var(--ds-fs-kpi)); }
body.skin-billdr #app .dw4ct-table th { color: var(--ds-muted); font-weight: 600; font-size: var(--ds-fs-sm); border-bottom: 1px solid var(--ds-line); }
body.skin-billdr #app .dw4ct-table td { border-bottom: 1px solid var(--ds-hair); color: var(--ds-ink); }
body.skin-billdr #app .dw4ct-table .ds-name { color: var(--ds-navy); font-weight: 600; }
body.skin-billdr #app .dw4ct-table .ds-sub { color: var(--ds-muted); font-size: var(--ds-fs-xs); }
body.skin-billdr #app .dw4ct-table tfoot td { font-weight: 700; color: var(--ds-navy); border-bottom: 0; border-top: 1px solid var(--ds-line-strong); }
body.skin-billdr #app .dw4ct-row:hover td { background: var(--ds-tint); }
body.skin-billdr #app .dw4ct-row:focus-visible { outline: none; box-shadow: var(--ds-focus); }
body.skin-billdr #app .dw4ct-earlier td { color: var(--ds-muted); }
body.skin-billdr #app .dw4ct-start { background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-r); }
body.skin-billdr #app .dw4ct-start h3 { color: var(--ds-navy); }
body.skin-billdr #app .dw4ct-start-ico { background: var(--ds-gold-tint); color: var(--ds-gold-ink); }
body.skin-billdr #app .dw4ct-start-src, body.skin-billdr #app .dw4ct-start-alt { color: var(--ds-muted); }
body.skin-billdr #app .dw4ct-link { color: var(--ds-gold-ink); font-weight: 600; }
body.skin-billdr #app .dw4ct-link:hover { color: var(--ds-gold-ink-hover); text-decoration: underline; }
body.skin-billdr #app .dw4ct-link:focus-visible { outline: none; box-shadow: var(--ds-focus); }

body.skin-billdr .dw4ct-doc-dates { color: var(--ds-muted); }
body.skin-billdr .dw4ct-doc-bar .ds-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--ds-r-pill); font-size: var(--ds-fs-xs); font-weight: 600; }
body.skin-billdr .dw4ct-doc-bar .ds-pill.ok { background: var(--ds-ok-bg); color: var(--ds-ok-ink); }
body.skin-billdr .dw4ct-doc-bar .ds-pill.warn { background: var(--ds-orange-bg); color: var(--ds-orange-ink); }
body.skin-billdr .dw4ct-doc-signrec { color: var(--ds-ok-ink); }
body.skin-billdr .dw4ct-consent legend { color: var(--ds-ink); font-weight: 600; font-size: var(--ds-fs-sm); }
body.skin-billdr .dw4ct-consent label { color: var(--ds-ink); font-size: var(--ds-fs-sm); }
