/* M3 redesign shared component layer (Matt 17 Nov 2026 8:10 PM MT via Lead). Loaded on every app page after the legacy
   sheets (after plan0-pill.css), right after m3-roles.css; serial M3 batches only. Values come from m3-roles.css roles
   only - no raw colors here. Visual / layout only. ASCII only. */

/* M3A rec 9: one font stack (Inter from ../fonts.css, then system-ui) for the page and its form controls */
:root body{font-family:var(--md-font)}
:root body :is(button,input,select,textarea,optgroup){font-family:var(--md-font)}

/* M3A rec 24 base: one focus-visible ring. Low specificity on purpose: controls that already set their own ring
   (offset -2px inside tabs, tables) keep it; the ui-polish "outline:none" on .btn / inputs no longer hides it. */
:focus-visible{outline:var(--md-focus-ring-width) solid var(--cd-link);outline-offset:2px}

/* ---------------- M3A rec 1: Draw / Scope Change page header (page 13) ----------------
   Title + status chip on one headline-small line, address on its own body-medium on-surface-variant line.
   Markup order is unchanged (h1, address, pill); the grid places them. New Submission (#nsUp) now sits in the tab row. */
:root body[data-page="editdraw"] #b5Top.cdb5-top{display:grid;grid-template-columns:auto 1fr auto;column-gap:12px;row-gap:4px;align-items:center;justify-items:start;margin:0 0 8px}
:root body[data-page="editdraw"] #b5Top > #b5Title{grid-column:1;grid-row:1;margin:0;font-family:var(--md-font);font-size:var(--md-headline-small-size);line-height:var(--md-headline-small-line);font-weight:var(--md-headline-small-weight);color:var(--md-on-surface)}
:root body[data-page="editdraw"] #b5Top > #b5Pill{grid-column:2;grid-row:1}
:root body[data-page="editdraw"] #b5Top > #b5Addr{grid-column:1 / 3;grid-row:2;font-size:var(--md-body-medium-size);line-height:var(--md-body-medium-line);font-weight:var(--md-body-medium-weight);color:var(--md-on-surface-variant)}
:root body[data-page="editdraw"] #b5Top > #b5Addr:empty{display:none}
/* BKL-736 (Matt 19 Nov 2026 9:03 PM MT via Lead 3): page-level actions sit on the heading row, right-aligned in the
   #b5Acts slot (New Submission now; room for later page actions). #nsUp keeps its one plan0-b5up.css size rule (NSB),
   id, handler and owner/editor gating; its message (#nsMsg) shows next to it. */
:root body[data-page="editdraw"] #b5Top > #b5Acts{grid-column:3;grid-row:1;justify-self:end;display:flex;align-items:center;gap:8px}
:root body[data-page="editdraw"] #b5Acts > #nsMsg{order:-1;align-self:center}

/* ---------------- M3A rec 11 + rec 1: ONE primary tab spec (page 12 Project tabs, page 13 Draw / Draw Dashboard /
   Draw Request / Issues). title-small labels, on-surface-variant inactive, primary (navy) active label + 3px primary
   indicator, 8% hover / 10% focus + pressed state layer. Never light blue (that is links / breadcrumbs only). */
:root body:is([data-page="project"],[data-page="editdraw"]) .tabbar.ptabs{gap:0;border-bottom:1px solid var(--md-outline-variant)}
:root body:is([data-page="project"],[data-page="editdraw"]) .ptabs > .tab{position:relative;isolation:isolate;min-height:48px;margin:0 0 -1px;padding:0 16px;border:0;border-bottom:var(--md-tab-primary-indicator) solid transparent;border-radius:0;background:none;font-family:var(--md-font);font-size:var(--md-title-small-size);line-height:var(--md-title-small-line);font-weight:var(--md-title-small-weight);color:var(--md-on-surface-variant)}
:root body:is([data-page="project"],[data-page="editdraw"]) .ptabs > .tab:is(.on,[aria-selected="true"]){color:var(--md-primary);border-bottom-color:var(--md-primary)}
:root body:is([data-page="project"],[data-page="editdraw"]) .ptabs > .tab::after{content:"";position:absolute;inset:0;background:currentColor;opacity:0;pointer-events:none;z-index:-1}
:root body:is([data-page="project"],[data-page="editdraw"]) .ptabs > .tab:hover::after{opacity:var(--md-hover)}
:root body:is([data-page="project"],[data-page="editdraw"]) .ptabs > .tab:focus-visible::after{opacity:var(--md-focus)}
:root body:is([data-page="project"],[data-page="editdraw"]) .ptabs > .tab:active::after{opacity:var(--md-pressed)}
/* M3A rec 11: the Draw tab's name span was light blue (plan3-lay1.css #edTabName); it follows its tab now. Override kept
   here for M3I consolidation (plan3-lay1.css is pinned by many suites). */
:root body[data-page="editdraw"] .ptabs #edTabName{color:inherit}
/* BKL-736: ONE flat tab row on page 13 - six file tabs (#x5Tabs, laid out as items of the row), a 1px divider, then
   Dashboard / Draw # Summary / Issues. Every tab: title-small 14/20/600, 12px sides, 3px primary indicator when
   selected; single row, no wrap (fits 1280 with a 15px scrollbar and 2-digit counts). Red (FX4) flagged tabs keep
   their color (.cdfx4-flag skipped). */
:root body[data-page="editdraw"] .tabbar.ptabs{flex-wrap:nowrap;align-items:center}
:root body[data-page="editdraw"] .ptabs > .tab{padding:0 12px;white-space:nowrap;flex:none}
:root body[data-page="editdraw"] .ptabs > .cdx5-tabs{display:contents}
:root body[data-page="editdraw"] .ptabs > .cdx5-tabs > .cdx5-tab{flex:none;min-height:48px;margin:0 0 -1px;padding:0 12px;white-space:nowrap;border-bottom:var(--md-tab-primary-indicator) solid transparent;font-size:var(--md-title-small-size);line-height:var(--md-title-small-line);font-weight:var(--md-title-small-weight)}
:root body[data-page="editdraw"] .ptabs > .cdx5-tabs > .cdx5-tab.on{border-bottom-color:var(--md-primary);font-weight:var(--md-title-small-weight)}
:root body[data-page="editdraw"] .ptabs > .cdx5-tabs > .cdx5-tab.on:not(.cdfx4-flag){color:var(--md-primary)}
:root body[data-page="editdraw"] .ptabs > .cdx5-tabs > .cdx5-tab > .n{margin-left:6px}
:root body[data-page="editdraw"] .ptabs > .cdx5-tdiv{flex:none;width:1px;height:20px;margin:0 8px;background:var(--md-outline-variant)}

/* ---------------- M3A rec 1: type tabs (.cdx5-tabs "X Files") = M3 SECONDARY tabs ----------------
   body-medium labels, 2px full-width primary indicator, on-surface-variant labels (zero counts too, still "0"),
   trailing count in label-small with no filled badge except on the active tab. Flagged (red) tabs keep their
   plan0-fx4.css / plan0-sumh.css colors: the color rules skip .cdfx4-flag. */
:root body[data-page="editdraw"] .cdx5-card .cdx5-tabs{padding:0;border-bottom:1px solid var(--md-outline-variant);background:var(--md-surface)}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab{position:relative;isolation:isolate;min-height:48px;margin:0;padding:0 16px;border:0;border-bottom:var(--md-tab-secondary-indicator) solid transparent;border-radius:0;background:none;font-family:var(--md-font);font-size:var(--md-body-medium-size);line-height:var(--md-body-medium-line);font-weight:var(--md-body-medium-weight)}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab:not(.cdfx4-flag){color:var(--md-on-surface-variant)}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab.z:not(.cdfx4-flag){color:var(--md-on-surface-variant)}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab.on{border-bottom-color:var(--md-primary);font-weight:var(--md-label-large-weight)}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab.on:not(.cdfx4-flag){color:var(--md-on-surface)}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab::after{content:"";position:absolute;inset:0;background:currentColor;opacity:0;pointer-events:none;z-index:-1}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab:hover::after{opacity:var(--md-hover)}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab:focus-visible::after{opacity:var(--md-focus)}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab:active::after{opacity:var(--md-pressed)}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab > .n{min-width:0;margin-left:8px;padding:0;border-radius:var(--md-shape-full);background:none;color:var(--md-on-surface-variant);font-size:var(--md-label-small-size);line-height:var(--md-label-small-line);font-weight:var(--md-label-small-weight);font-variant-numeric:tabular-nums}
:root body[data-page="editdraw"] .cdx5-tabs > .cdx5-tab.on > .n{min-width:20px;padding:0 6px;background:var(--md-primary);color:var(--md-on-primary)}

/* ---------------- M3B rec 2 (Matt 17 Nov 2026 8:10 PM MT via Lead, M3 redesign): ONE data-table spec ----------------
   Every app data table: My Projects / admin .ptable, Draws / Scope / dashboard .dtable, Bank Budget / Subcontractors /
   Vendors / uploads .mgtab (+ their sub tables), type tabs .cdx5-tbl, Issues, the Draw report (page 17 + the page 13
   inline report), project files / history / extract log / GC code dialogs. Nested line-item tables (.cdx5-dr-litbl /
   .cdx5-bb-litbl) keep their own inset spec in plan0-x5-ed.css (M3B rec 2 there).
   Header: surface-container-high, title-small 14/20/600 on-surface-variant, sentence case (CSS only, label text
   unchanged), outline-variant divider. The table ids in the header / alignment lists out-rank the per-table legacy
   header rules (#issTbl, #bkParsed.bkb1, #vnTable, #sbTable, #b1drReport .drtbl ...: left for M3I to delete). The Draws /
   Scope Changes table ids are never listed (DVL: no font rule may name that table; the .dtable class covers them). Sticky headers, widths,
   cell colors (state colors, the red ($X.XX) negatives) are not set here. */
:root body :is(#projTable,#admTable,#pdDashTbl,#pdTotTab,#bkParsed,#bkUnbFiles,#bkScopeTab,#sbTable,#vnTable,#bkEdits,#sbEdits,#x5Tbl,#issTbl,#drTbl,#p0gcTab,#p0b529tbl,table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.p0b9histtbl,table.exlog-tbl) > thead > tr > th{background:var(--md-surface-container-high);color:var(--md-on-surface-variant);font-family:var(--md-font);font-size:var(--md-title-small-size);line-height:var(--md-title-small-line);font-weight:var(--md-title-small-weight);letter-spacing:normal;text-transform:none;border-bottom:1px solid var(--md-outline-variant);box-shadow:inset 0 -1px 0 var(--md-outline-variant)}
/* M3B rec 2: the header's sort button reads the header's type (page 09's 11px .thsort size is gone) */
:root body :is(#projTable,#admTable,#pdDashTbl,#pdTotTab,#bkParsed,#bkUnbFiles,#bkScopeTab,#sbTable,#vnTable,#bkEdits,#sbEdits,#x5Tbl,#issTbl,#drTbl,#p0gcTab,#p0b529tbl,table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.p0b9histtbl,table.exlog-tbl) > thead > tr > th .thsort{font-size:inherit;font-weight:inherit;line-height:inherit;letter-spacing:inherit;text-transform:none;color:inherit}
/* M3B rec 2: cells 12px horizontal / 8px vertical, dense 40px rows, outline-variant dividers, no zebra (the zebra rules
   are deleted from ui-polish.css). Class-only selectors on purpose: column rules that features depend on (LAP Approve,
   Sub List trash, fixed x5 widths) keep winning. A cell that holds a nested table keeps its own inset. */
:root body :is(table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.p0b9histtbl,table.exlog-tbl) > :is(thead,tbody,tfoot) > tr > :is(th,td):not(:has(table)){padding:8px 12px}
/* M3B rec 2: Issues (plan0-iss.css pads #issTbl 10px by id) gets the same 8px / 12px cells */
:root body #issTbl > :is(thead,tbody) > tr > :is(th,td){padding:8px 12px}
:root body :is(table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.p0b9histtbl,table.exlog-tbl) > tbody > tr > td{height:40px;border-bottom:1px solid var(--md-outline-variant)}
/* M3B rec 2 / rec 24: 8% on-surface hover state layer, drawn as an image over the cell's own background color, so the
   edited / flagged / review / closed colors stay visible under it. A cell that holds a nested table is skipped. */
:root body :is(table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.p0b9histtbl,table.exlog-tbl,table.cdx5-dr-litbl,table.cdx5-bb-litbl) > tbody > tr:hover > td:not(:has(table)){background-image:linear-gradient(color-mix(in srgb,var(--md-on-surface) calc(var(--md-hover) * 100%),transparent),color-mix(in srgb,var(--md-on-surface) calc(var(--md-hover) * 100%),transparent))}

/* ---------------- M3B rec 3: money and number columns are trailing-aligned with tabular figures ----------------
   Header (and its sort button) and cells: Budget / Current Cost / % Spent / Scope Change Cost / Contingency / Draws /
   Scope Changes (09 .bcol / .ncol), Draw Value / Cost / Difference (12 .tdv .dtot / .tir .dir / .tdiff .ddiff),
   every .num / .cdx5-num column (bank, sub list, vendors, scope, dashboard, type tabs, line items, report), Issues #.
   Text columns stay leading-aligned. The left-align locks (ui-polish.css, preview.css) are deleted. */
:root body :is(#projTable,#admTable,#pdDashTbl,#pdTotTab,#bkParsed,#bkUnbFiles,#bkScopeTab,#sbTable,#vnTable,#bkEdits,#sbEdits,#x5Tbl,#issTbl,#drTbl,#p0gcTab,#p0b529tbl,table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.cdx5-dr-litbl,table.cdx5-bb-litbl) > :is(thead,tbody,tfoot) > tr > :is(th,td):is(.num,.cdx5-num,.bcol,.ncol,.tdv,.dtot,.tir,.dir,.tdiff,.ddiff,.cdiss-n,.cdfx8-amt,.cdfx6-sub,.admrep){text-align:right;font-variant-numeric:tabular-nums}
/* M3B rec 3 + rec 18: a money header's label ends on the column's edge; its arrow is a zero-width box drawn into the
   cell's 12px trailing padding (the SORT pattern), for chunk1 / chunk2 flex headers and plan0-sort block headers alike. */
:root body :is(#projTable,#admTable,#pdDashTbl,#pdTotTab,#bkParsed,#bkUnbFiles,#bkScopeTab,#sbTable,#vnTable,#bkEdits,#sbEdits,#x5Tbl,#issTbl,#drTbl,#p0gcTab,#p0b529tbl,table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.cdx5-dr-litbl,table.cdx5-bb-litbl) > thead > tr > th:is(.num,.cdx5-num,.bcol,.ncol,.tdv,.tir,.tdiff,.cdiss-n,.cdfx8-amt,.cdfx6-sub,.admrep) .thsort{justify-content:flex-end;text-align:right;gap:0;padding-right:0;margin-right:0}
:root body :is(#projTable,#admTable,#pdDashTbl,#pdTotTab,#bkParsed,#bkUnbFiles,#bkScopeTab,#sbTable,#vnTable,#bkEdits,#sbEdits,#x5Tbl,#issTbl,#drTbl,#p0gcTab,#p0b529tbl,table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.cdx5-dr-litbl,table.cdx5-bb-litbl) > thead > tr > th:is(.num,.cdx5-num,.bcol,.ncol,.tdv,.tir,.tdiff,.cdiss-n,.cdfx8-amt,.cdfx6-sub,.admrep) .thsort .sarr{display:inline-block;width:0;overflow:visible;white-space:nowrap;position:relative;left:2px}

/* ---------------- M3B rec 18 (Matt rule 1: every column sortable, arrow ALWAYS visible) ----------------
   The neutral arrow stays on every sortable header at full opacity in on-surface-variant (>= 3:1 on the header; the
   .45 opacity rules are deleted from preview.css / plan0-sort.css); the active header's label and arrow are on-surface.
   No label underline on hover: the header gets the 8% state layer instead. Glyphs (set by chunk1 / chunk2 / plan0-sort)
   are unchanged; only their size and color. */
:root body th .thsort .sarr{opacity:1;color:var(--md-on-surface-variant);font-size:var(--md-body-small-size)}
:root body :is(#projTable,#admTable,#pdDashTbl,#pdTotTab,#bkParsed,#bkUnbFiles,#bkScopeTab,#sbTable,#vnTable,#bkEdits,#sbEdits,#x5Tbl,#issTbl,#drTbl,#p0gcTab,#p0b529tbl,table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.p0b9histtbl,table.exlog-tbl,table.cdx5-dr-litbl,table.cdx5-bb-litbl) > thead > tr > th:is([aria-sort="ascending"],[aria-sort="descending"]){color:var(--md-on-surface)}
:root body th:is([aria-sort="ascending"],[aria-sort="descending"]) .thsort .sarr{color:var(--md-on-surface)}
:root body th .thsort:hover .slab{text-decoration:none}
:root body :is(#projTable,#admTable,#pdDashTbl,#pdTotTab,#bkParsed,#bkUnbFiles,#bkScopeTab,#sbTable,#vnTable,#bkEdits,#sbEdits,#x5Tbl,#issTbl,#drTbl,#p0gcTab,#p0b529tbl,table.ptable,table.dtable,table.mgtab,table.cdx5-tbl,table.cdiss-tbl,table.drtbl,table.ftab,table.p0b9histtbl,table.exlog-tbl,table.cdx5-dr-litbl,table.cdx5-bb-litbl) > thead > tr > th:has(.thsort):hover{background-image:linear-gradient(color-mix(in srgb,var(--md-on-surface) calc(var(--md-hover) * 100%),transparent),color-mix(in srgb,var(--md-on-surface) calc(var(--md-hover) * 100%),transparent))}

/* ======================= M3C (Matt 17 Nov 2026 8:10 PM MT via Lead, M3 redesign batch 3) =======================
   Status chips + buttons + state layers + checkbox look + field spec + chart amber. CSS only on the app's real
   selectors; ids, handlers, labels and gating are unchanged. Sizes of the shared chip box live in plan0-pill.css. */

/* ---------------- M3C rec 4: one status chip, colors by meaning (roles only) ----------------
   Tonal chips: no visible border (the 1px border stays, transparent, so every chip is the same box). The default
   (Pending / Not extracted / Extraction NA / Inactive / Closed) is the neutral surface-container-highest chip. */
:root body :is(.pill,.pdpill,.cdx5-st,select.drawst){background-color:var(--md-surface-container-highest);color:var(--md-on-surface-variant);border-color:transparent}
/* M3C rec 4: Active / Open / Approved / Extracted = success container (success is for status only, never buttons) */
/* M3C rec 17: a locked (disabled) Active / Closed dropdown reads as the plain chip at full strength (no UA dimming) */
:root body select.drawst:disabled{opacity:1}
:root body :is(.pill,.pdpill,.cdx5-st,select.drawst):is(.st-active,.p-open,.st-appr,.st-a,.st-x){background-color:var(--md-success-container);color:var(--md-success);border-color:transparent}
/* M3C rec 4: Under Review is defined once (the blue .p-rev in preview.css is removed): secondary container */
:root body :is(.pill,.pdpill,.cdx5-st,select.drawst):is(.st-rev,.p-rev,.st-r){background-color:var(--md-secondary-container);color:var(--md-on-secondary-container);border-color:transparent}
/* M3C rec 4: Extracting / Waiting on Extraction = primary container + a 12px CSS spinner */
:root body :is(.pill,.pdpill,.cdx5-st):is(.st-ext,.p-ext,[data-cdst="Extracting"]){background-color:var(--md-primary-container);color:var(--md-on-primary-container);border-color:transparent}
:root body :is(.pill,.pdpill,.cdx5-st):is(.st-ext,.p-ext,[data-cdst="Extracting"])::before{content:"";display:inline-block;box-sizing:border-box;width:12px;height:12px;margin:0 4px 0 0;vertical-align:-1px;border-radius:var(--md-shape-full);border:2px solid color-mix(in srgb,currentColor 25%,transparent);border-top-color:currentColor;animation:m3c-spin .9s linear infinite}
@keyframes m3c-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion: reduce){:root body :is(.pill,.pdpill,.cdx5-st)::before{animation:none}}
/* M3C rec 4: Failed = error container + error icon */
:root body :is(.pill,.pdpill,.cdx5-st):is(.st-fail,[data-cdst="Failed"]){background-color:var(--md-error-container);color:var(--md-on-error-container);border-color:transparent}
:root body :is(.pill,.pdpill,.cdx5-st):is(.st-fail,[data-cdst="Failed"])::before{content:"";display:inline-block;width:14px;height:14px;margin:0 4px 0 -2px;vertical-align:-3px;background-color:var(--md-error);-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/></svg>") center / contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/></svg>") center / contain no-repeat}
/* M3C rec 4: Partial Extraction = warning container (the white chip with a red outline is gone) */
:root body :is(.pill,.pdpill,.cdx5-st).st-part{background-color:var(--md-warning-container);color:var(--md-on-warning-container);border-color:transparent}
/* M3C rec 4 quick win: Duplicate / Possible duplicate = copy icon, so it never reads as a type chip. The x5 status chip
   (data-cdst) and the type-chip slot of a Duplicate row both use it. B5 Q4 (Matt 19 Nov 2026 5:06 PM MT): neutral
   outline chip (surface fill, outline border, on-surface text, on-surface-variant icon). */
:root body :is(.pill,.cdx5-st):is([data-cdst="Duplicate"],[data-cdst="Possible duplicate"]),:root body tr[data-x5type="Duplicate"] .cdx5-chip{box-sizing:border-box;height:24px;padding:0 8px;border:1px solid var(--md-outline);border-radius:var(--md-shape-sm);background-color:var(--md-surface);color:var(--md-on-surface);font-size:var(--md-label-medium-size);line-height:22px;font-weight:var(--md-label-medium-weight)}
:root body :is(.pill,.cdx5-st):is([data-cdst="Duplicate"],[data-cdst="Possible duplicate"])::before,:root body tr[data-x5type="Duplicate"] .cdx5-chip::before{content:"";display:inline-block;width:14px;height:14px;margin:0 4px 0 -2px;vertical-align:-3px;background-color:var(--md-on-surface-variant);-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/></svg>") center / contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/></svg>") center / contain no-repeat}
/* M3C rec 4: type chips (Invoice, Receipt ... on page 13 rows and the Draw report) are outlined assist chips: no fill,
   outline border, the same 24px height, so they never read as statuses. */
:root body :is(.cdx5-chip,.drty),:root body #b1drReport .drtbl .drty{box-sizing:border-box;display:inline-block;height:24px;padding:0 8px;border:1px solid var(--md-outline);border-radius:var(--md-shape-sm);background:none;color:var(--md-on-surface-variant);font-family:var(--md-font);font-size:var(--md-label-medium-size);line-height:22px;font-weight:var(--md-label-medium-weight);vertical-align:middle;white-space:nowrap}
/* M3C rec 24: the clickable type chip keeps its colors on hover (state layer below, no color jump) */
:root body button.cdx5-chip-btn:hover{background:none;color:var(--md-on-surface-variant)}

/* ---------------- M3C rec 5: buttons - 40px, label-large, one filled per region ----------------
   Default .btn = outlined (surface, outline border, primary label). .btn.primary = filled primary (navy). .btn.green
   is the same navy filled button (green is for success status only, never buttons). .btn.danger = error filled, only
   on the destructive confirms (Close Project / Close Draw). */
:root body .btn{box-sizing:border-box;height:40px;min-height:40px;padding:0 16px;border:1px solid var(--md-outline);border-radius:var(--md-shape-sm);background-color:var(--md-surface);color:var(--md-primary);font-family:var(--md-font);font-size:var(--md-label-large-size);line-height:var(--md-label-large-line);font-weight:var(--md-label-large-weight);letter-spacing:.1px;transition:none;filter:none}
:root body .btn:is(.primary,.green){background-color:var(--md-primary);border-color:var(--md-primary);color:var(--md-on-primary)}
:root body .btn.danger{background-color:var(--md-error);border-color:var(--md-error);color:var(--md-on-error)}
:root body .btn.dl{color:var(--md-error)}
/* M3C rec 5: menu triggers (Options on the Project page, Dashboard and Bank Budget) are outlined; their label keeps its
   trailing dropdown glyph. The fixed 98x34 box (preview.css / plan0-subtot.css) is overridden here for M3I to fold. */
:root body :is(#optBtn,#bmBtn,#smBtn,#dmBtn).btn{width:auto;min-width:0;height:40px;min-height:40px;padding:0 16px;background-color:var(--md-surface);border-color:var(--md-outline);color:var(--md-primary)}
/* M3C rec 5: Sub List Unlock / Lock (#smLock) = outlined toggle with a lock icon, tonal while pressed (locked) */
:root body #smLock.btn{width:auto;min-width:0;height:40px;min-height:40px;padding:0 16px 0 12px;gap:8px;background-color:var(--md-surface);border-color:var(--md-outline);color:var(--md-primary)}
:root body #smLock.btn[aria-pressed="true"]{background-color:var(--md-secondary-container);border-color:var(--md-secondary-container);color:var(--md-on-secondary-container)}
:root body #smLock.btn::before{content:"";display:inline-block;flex:none;width:18px;height:18px;background-color:currentColor;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z'/></svg>") center / contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z'/></svg>") center / contain no-repeat}
/* M3C rec 5: Send Report dialog has exactly one filled button: Send To All filled, Send To Owner outlined */
:root body #srOwner.btn{background-color:var(--md-surface);border-color:var(--md-outline);color:var(--md-primary)}
/* M3C rec 5 quick win: Sign out is a 40px outlined button (the fixed 98x34 box is dropped) */
:root body > header #signout.btn{width:auto;min-width:0;height:40px;min-height:40px;padding:0 16px;background-color:var(--md-surface);border-color:var(--md-outline);color:var(--md-primary)}
/* M3C rec 5 quick win: Create Project = the navy filled primary, 40px like the search field */
:root body #newp.btn{height:40px;min-height:40px;padding:0 16px;line-height:var(--md-label-large-line)}
/* M3C rec 5: the Draw footer Save matches every other button (was 48px / 16px) */
:root body[data-page="editdraw"] #edSave.btn{height:40px;min-height:40px;padding:0 16px;border-radius:var(--md-shape-sm);background-color:var(--md-primary);border-color:var(--md-primary);color:var(--md-on-primary);font-family:var(--md-font);font-size:var(--md-label-large-size);line-height:var(--md-label-large-line);font-weight:var(--md-label-large-weight)}
/* M3C rec 5: the upload Confirm (#ndSubmit, green in upload-gates.css) is the navy filled primary */
:root body #uppop #ndSubmit.btn.primary{background-color:var(--md-primary);border-color:var(--md-primary);color:var(--md-on-primary)}

/* ---------------- M3C rec 24: one shared state layer + one focus-visible ring ----------------
   An inset shadow in the content color (currentColor) over the element's own fill: 8% hover, 10% focus-visible /
   pressed. No scale, no color jump, no opacity change. Buttons, icon buttons, menu items, chips, the Close X.
   (Tabs: M3A rule; table rows: M3B rule.) */
:root body :is(.btn,.optitem,.cdx5-ic,.cdx5-act-btn,.cdx5-dr-chevbtn,button.cdx5-chip-btn,select.drawst,.ficon,.modal .x,.ptable .pdel,.ptable .pchart,.dzip,button.cdx5-dr-cb):not(:disabled,[aria-disabled="true"]):hover{box-shadow:inset 0 0 0 100vmax color-mix(in srgb,currentColor calc(var(--md-hover) * 100%),transparent)}
:root body :is(.btn,.optitem,.cdx5-ic,.cdx5-act-btn,.cdx5-dr-chevbtn,button.cdx5-chip-btn,select.drawst,.ficon,.modal .x,.ptable .pdel,.ptable .pchart,.dzip,button.cdx5-dr-cb):not(:disabled,[aria-disabled="true"]):is(:focus-visible,:active){box-shadow:inset 0 0 0 100vmax color-mix(in srgb,currentColor calc(var(--md-focus) * 100%),transparent)}
/* M3C rec 24: the old hover fills are neutralized where their file is page-scoped (M3I folds them): row icon buttons
   and the page 13 file / type menu items keep their own fill on hover (the shared jumps are deleted at the source). */
:root body[data-page="editdraw"] .cdx5-ic:hover{background-color:transparent}
:root body :is(.cdx3-menu,.cdx3-type-menu) .optitem:is(:hover,:focus):not(:disabled):not([aria-disabled="true"]){background:none}
/* M3C rec 24: 2px focus-visible ring in the link token on every interactive part, incl. row icon buttons, chips,
   menu items and checkboxes (menu items draw it inside so a scrolling menu does not clip it). */
:root body :is(.btn,.cdx5-ic,.cdx5-act-btn,.cdx5-dr-chevbtn,button.cdx5-chip-btn,select.drawst,.ficon,.modal .x,.ptable .pdel,.ptable .pchart,.dzip,button.cdx5-dr-cb,input.cdlap-cb,.dtog,.dname,.cdb12-flagbtn):focus-visible{outline:var(--md-focus-ring-width) solid var(--cd-link);outline-offset:2px}
:root body .optitem:focus-visible,:root body :is(.cdx3-menu,.cdx3-type-menu) .optitem:focus-visible:not(:disabled):not([aria-disabled="true"]),:root body .ftab.ro td.ed:focus-visible{outline:var(--md-focus-ring-width) solid var(--cd-link);outline-offset:-2px}

/* ---------------- M3C rec 16 (look only): one M3 checkbox ----------------
   18px box, 2px on-surface-variant outline, 2px corner, primary fill + on-primary check when checked. Applied to the
   LAP Approve checkbox (PROJECT_SC_LIST_DERIVED_PAID: the lists' Paid box is gone), the line-item Paid by bank control (its existing
   span / button, same handler) and the legacy Approve toggle (.dtog). Each sits centered in a 48px-wide column. */
:root body :is(input.cdlap-cb,td.drpaid input[type="checkbox"]),:root body #x5Tbl input.cdlap-cb{-webkit-appearance:none;appearance:none;box-sizing:border-box;display:inline-grid;place-content:center;width:18px;height:18px;min-height:0;margin:0;padding:0;border:2px solid var(--md-on-surface-variant);border-radius:2px;background-color:var(--md-surface);vertical-align:middle;cursor:pointer;filter:none;opacity:1;accent-color:auto}
:root body :is(input.cdlap-cb,td.drpaid input[type="checkbox"]):checked,:root body #x5Tbl input.cdlap-cb:checked{background-color:var(--md-primary);border-color:var(--md-primary)}
:root body :is(input.cdlap-cb,td.drpaid input[type="checkbox"]):checked::before{content:"";box-sizing:border-box;width:10px;height:6px;border:2px solid var(--md-on-primary);border-top:0;border-right:0;transform:translateY(-1px) rotate(-45deg)}
:root body #x5Tbl input.cdlap-cb{display:grid;margin:0 auto}
:root body input.cdlap-cb:disabled{cursor:default}
/* M3C rec 16: Approve (LAP) column 48px wide, checkbox centered (header sort control centered with it) */
:root body #x5Tbl[data-lap] :is(th,td).cdlap-c{width:48px;min-width:48px;padding-left:0;padding-right:0;text-align:center}
:root body #x5Tbl[data-lap] th.cdlap-th .thsort{margin:0 auto}
/* M3C rec 16: line-item Paid by bank: the existing button (editable) / span (locked) drawn as the checkbox. The text
   check glyph is hidden (title / role / aria-checked unchanged); the cell is at least 48px, centered. */
:root body[data-page="editdraw"] .cdx5-dr-litbl td:has(> .cdx5-dr-cb){min-width:48px;text-align:center}
:root body[data-page="editdraw"] button.cdx5-dr-cb{box-sizing:border-box;display:inline-grid;place-content:center;width:18px;height:18px;min-height:0;margin:0;padding:0;border:2px solid var(--md-on-surface-variant);border-radius:2px;background-color:var(--md-surface);color:transparent;font-size:0;line-height:0;vertical-align:middle;cursor:pointer}
:root body[data-page="editdraw"] button.cdx5-dr-cb.on{background-color:var(--md-primary);border-color:var(--md-primary)}
:root body[data-page="editdraw"] button.cdx5-dr-cb.on::before{content:"";box-sizing:border-box;width:10px;height:6px;border:2px solid var(--md-on-primary);border-top:0;border-right:0;transform:translateY(-1px) rotate(-45deg)}
/* M3C rec 16: read-only views (locked draw line items, the Draw report) show a check icon +
   "Paid" instead of a dimmed box; unpaid shows the app's blank dash. Same elements, CSS only. */
:root body[data-page="editdraw"] span.cdx5-dr-cb,:root body td.drpaid input[type="checkbox"]:disabled{-webkit-appearance:none;appearance:none;box-sizing:border-box;display:inline-flex;align-items:center;gap:4px;width:auto;height:auto;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:none;color:transparent;font-size:0;line-height:0;vertical-align:middle;opacity:1;filter:none}
:root body[data-page="editdraw"] span.cdx5-dr-cb.on::before,:root body td.drpaid input[type="checkbox"]:disabled:checked::before{content:"";flex:none;box-sizing:border-box;width:18px;height:18px;border:0;transform:none;background-color:var(--md-primary);-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>") center / contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>") center / contain no-repeat}
:root body[data-page="editdraw"] span.cdx5-dr-cb.on::after,:root body td.drpaid input[type="checkbox"]:disabled:checked::after{content:"Paid";color:var(--md-on-surface);font-family:var(--md-font);font-size:var(--md-label-medium-size);line-height:var(--md-label-medium-line);font-weight:var(--md-label-medium-weight)}
:root body[data-page="editdraw"] span.cdx5-dr-cb:not(.on)::after,:root body td.drpaid input[type="checkbox"]:disabled:not(:checked)::after{content:"\2014";color:var(--md-on-surface-variant);font-family:var(--md-font);font-size:var(--md-body-medium-size);line-height:var(--md-body-medium-line)}
/* M3C rec 16: the legacy Approve toggle (.dtog, hidden #edTbl) gets the same box look; its label text stays for
   assistive tech (font-size 0), aria-pressed drives the check. */
:root body .dtog,:root body[data-page="editdraw"] #edTbl .dtog{box-sizing:border-box;display:inline-grid;place-content:center;width:18px;min-width:0;height:18px;min-height:0;margin:0;padding:0;border:2px solid var(--md-on-surface-variant);border-radius:2px;background-color:var(--md-surface);color:transparent;font-size:0;line-height:0;vertical-align:middle;opacity:1}
:root body .dtog:is([aria-pressed="true"],.on),:root body[data-page="editdraw"] #edTbl .dtog:is([aria-pressed="true"],.on){background-color:var(--md-primary);border-color:var(--md-primary)}
:root body .dtog:is([aria-pressed="true"],.on)::before{content:"";box-sizing:border-box;width:10px;height:6px;border:2px solid var(--md-on-primary);border-top:0;border-right:0;transform:translateY(-1px) rotate(-45deg)}
:root body[data-page="editdraw"] #edTbl td.dtogc{width:48px;text-align:center}

/* ---------------- M3C rec 21: shared outlined text-field spec (component spec only) ----------------
   Opt-in classes, applied to nothing yet: M3G puts them on the gate / New Project fields (and later batches on the
   dialogs / in-table editors), so no existing field changes in this batch. 40px form field / 32px in-table editor,
   4px corner, outline stroke -> 2px primary on focus, body-small on-surface-variant label, error text in the error role. */
:root body .cd-field{box-sizing:border-box;height:40px;min-height:40px;padding:0 12px;border:1px solid var(--md-outline);border-radius:var(--md-shape-xs);background-color:var(--md-surface);color:var(--md-on-surface);font-family:var(--md-font);font-size:var(--md-body-medium-size);line-height:var(--md-body-medium-line)}
:root body .cd-field.cd-field-dense{height:32px;min-height:32px;padding:0 8px}
:root body .cd-field:hover{border-color:var(--md-on-surface-variant)}
:root body .cd-field:focus-visible{outline:var(--md-focus-ring-width) solid var(--md-primary);outline-offset:-1px;border-color:var(--md-primary)}
:root body .cd-field[aria-invalid="true"]{border-color:var(--md-error)}
:root body .cd-field-label{display:block;margin:0 0 4px;font-size:var(--md-body-small-size);line-height:var(--md-body-small-line);font-weight:var(--md-label-medium-weight);color:var(--md-on-surface-variant)}
:root body .cd-field-help{font-size:var(--md-body-small-size);line-height:var(--md-body-small-line);color:var(--md-on-surface-variant)}
:root body .cd-field-err{font-size:var(--md-body-small-size);line-height:var(--md-body-small-line);color:var(--md-error)}

/* ---------------- M3C rec 13 (bars): the "remaining" fill is the accessible amber (ui-polish.css) with a >= 3:1 boundary
   against the track; the text labels stay; no data / axis change. */
:root body .bs-optA .bsrest{box-shadow:inset 0 0 0 1px var(--md-warning)}
:root body .bsleg i{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--md-on-surface) 30%,transparent)}
