/* The Rookery — M4 (2026-10-19): the Budget build. One sheet for the
 * wave, linked after every other stylesheet. Sections: §A budget
 * view · §B budget documents · §D cost groups + Assembly line +
 * target margin · §E job profit's budget block. Tokens are the
 * design system's (DESIGN-SYSTEM.md); gold stays on the one main
 * action (+ New cost group, + Add chart …), never on figures. */

/* ---------------- §A budget view ---------------- */
body.skin-billdr #app .bud-health { margin-top: 10px; }
body.skin-billdr #app .bud-health .ds-kpi-v { font-size: var(--ds-fs-lg, 18px); }
.bud-table .ds-sub.bud-split, .bud-table .ds-sub.bud-held-sub { display: block; font-size: 11.5px; white-space: nowrap; }
.bud-table .bud-held-sub { color: var(--ds-warn-ink, #9a520c); }
.bud-held { margin: 14px 0 6px; padding: 12px 14px; border: 1px solid var(--ds-line, #e3e7ee); border-left: 3px solid #ecd9ac;
  border-radius: var(--ds-r, 12px); background: #fdf6e7; }
.bud-held.is-clear { background: var(--ds-card, #fff); border-left-color: var(--ds-line, #e3e7ee); }
.bud-held-head { display: flex; align-items: baseline; gap: 12px; }
.bud-held-head h4 { margin: 0; font-size: 14px; color: var(--ds-navy, #0b2235); }
.bud-held-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.bud-held-list > li { margin: 6px 0; }
.bud-held-list .ds-sub { display: block; color: var(--ds-muted, #66717f); }
.bud-held-items { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; }

/* ---------------- §B budget documents ---------------- */
.bud-draw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; }
.bud-draw-bar .rk-err { flex-basis: 100%; margin: 0; }
.bud-draw-sel { margin: 0 6px 0 0; accent-color: var(--ds-gold-strong, #a8853f); width: 16px; height: 16px; flex: none; }
.bud-po-door { font-size: 12px; }

/* ---------------- §D cost groups ---------------- */
.asm-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.asm-h { margin: 0 0 2px; font-size: var(--ds-fs-lg, 18px); color: var(--ds-navy, #0b2235); }
.asm-search { min-width: 220px; }
.asm-note { margin: 6px 0 12px; }
.asm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.asm-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--ds-line, #e3e7ee); border-radius: var(--ds-r, 12px);
  background: var(--ds-card, #fff); overflow: hidden; cursor: pointer; }
.asm-card:hover { border-color: var(--ds-line-strong, #cbd2da); }
.asm-card:focus-visible { outline: none; box-shadow: var(--ds-focus, 0 0 0 3px rgba(192, 160, 96, .35)); }
.asm-pic { aspect-ratio: 16 / 9; background: var(--ds-fill, #f1f4f9); display: flex; align-items: center; justify-content: center; color: var(--ds-faint, #98a1ad); font-size: 12px; }
.asm-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asm-pic.is-missing img { display: none; }
.asm-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.asm-card-t { margin: 0; font-weight: 700; color: var(--ds-navy, #0b2235); }
.asm-card-price { margin: 6px 0 0; font-size: 18px; font-weight: 700; color: var(--ds-navy, #0b2235); font-variant-numeric: tabular-nums; }
.asm-card-price.is-unset, .asm-price-box.is-unset .asm-price { color: var(--ds-muted, #66717f); font-size: 15px; }
.asm-more { position: absolute; top: 8px; right: 8px; background: var(--ds-card, #fff); }
.asm-ed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; margin: 6px 0 14px; }
.asm-ed-grid .qm-field-wide { grid-column: 1 / -1; }
.asm-lines input[type="text"] { width: 100%; min-width: 0; }
.asm-lines .asm-num { width: 90px; text-align: right; }
.asm-lines .asm-unit { width: 70px; }
.asm-add { display: flex; gap: 8px; margin: 10px 0; }
.asm-price-box { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--ds-line, #e3e7ee); border-radius: var(--ds-r, 12px); max-width: 520px; }
.asm-price { margin: 2px 0; font-size: 22px; font-weight: 700; color: var(--ds-navy, #0b2235); font-variant-numeric: tabular-nums; }
.quote-pill.asm-pill { background: #e7effc; color: #1f5fbf; }
.quote-pill.asm-pill-unset { background: #fdf6e7; color: #7a5410; }
.m4-margin-field input { max-width: 140px; }

/* invoice line Source: the budget draw */
.dw4i-src .dw6i-src-budget_line { background: #ecf3ec; color: #1a7343; }

/* ---------------- §E job profit's budget block ---------------- */
.dp-bud-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 14px; margin: 6px 0; }
.dp-bud-cell { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 1px solid var(--ds-line, #e3e7ee); border-radius: var(--ds-r-sm, 8px); }
.dp-bud-cell b { font-variant-numeric: tabular-nums; color: var(--ds-navy, #0b2235); }
