/* Seat gates (2026-10-15) — paired with public/js/wf-seat-gates.js. Every rule here is keyed off a body
   class that wf-seat-gates.js sets ONLY for a team seat that lacks the named grant (never the owner, a
   '*' seat, a solo book or a runner), so for every other seat this file matches nothing. */

/* An action the seat cannot use (matched by its handler in wf-seat-gates.js RULES). */
[data-wfp-hide] { display: none !important; }
/* Shows data but opens an editor on tap: stays, cannot be tapped, loses its pencil / chevron / "tap to" hint. */
[data-wfp-inert] { pointer-events: none !important; cursor: default !important; }
[data-wfp-inert] :is(svg[class*="pencil"], [class*="pencil"], [class*="edit-ic"], [class*="chev"]),
[data-wfp-inert].inv-photo-empty-add .inv-photo-empty-sub { display: none !important; }
[data-wfp-inert].inv-photo-empty-add .inv-photo-empty-title { display: none !important; }
[data-wfp-inert].inv-photo-empty-add::after { content: "No photos yet"; font-family: var(--font-body); font-size: 15px; font-weight: 600; }
[data-wfp-inert].wf-spec-val::before, [data-wfp-inert].wf-spec-val::after { display: none !important; }
/* A date picker trigger made inert: the date (or "—") stays, the calendar icon and the button frame go. */
[data-wfp-inert].qi-datepicker-trigger .qi-dp-icon,
[data-wfp-inert] .qi-dp-clear { display: none !important; }
[data-wfp-inert].qi-datepicker-trigger { background: none !important; border-color: transparent !important; box-shadow: none !important; }
/* No date yet: the "Add month" prompt reads "—" (CSS, so a picker re-mount that rewrites the text can't bring it back). */
[data-wfp-inert] .qi-dp-placeholder { display: none !important; }
[data-wfp-inert].qi-datepicker-trigger:has(.qi-dp-placeholder)::after { content: "\2014"; color: var(--muted); font-family: var(--font-body); }
[data-wfp-inert] .wf-spec-add.wfp-dash::before, [data-wfp-inert] .wf-spec-add.wfp-dash::after { content: none !important; display: none !important; }
[data-wfp-inert] .wf-spec-add.wfp-dash { color: var(--muted) !important; }

/* Money-free seat: no money / pricing / sourcing / deal / invoice section is rendered at all. */
body.wfp-nomoney #inv-detail-acquisition-card,
body.wfp-nomoney #inv-detail-pricing-card,
body.wfp-nomoney #inv-detail-tabs .wf-spec-tab[onclick*="'pricing'"],
body.wfp-nomoney #inv-detail-attachments-card,
body.wfp-nomoney #inv-detail-notes-card,
body.wfp-nomoney [onclick*="JJBlur"],
body.wfp-nomoney .jj-blur-btn,
body.wfp-nomoney .jj-stat[onclick*="'Sold'"],
body.wfp-nomoney #wfwd-notes-row,
body.wfp-nomoney #wfwd-pane-hist { display: none !important; }

/* Sale money: the Sold column (what a piece sold for) goes with payments.view. */
body.wfp-no-pay #page-inventory [data-col="sold"] { display: none !important; }

/* Deal / Invoice link cards on the watch. */
body.wfp-no-deals #wfwd-link-deal,
body.wfp-no-invoice #wfwd-link-invoice,
body.wfp-no-deals.wfp-no-invoice #inv-detail-quickstatus { display: none !important; }

/* No edit grant: nothing that changes the watch. Status reads as a label, not a picker. */
body.wfp-no-edit #inv-detail-status-badge,
body.wfp-no-edit #page-inventory .row-status-picker { pointer-events: none !important; }
body.wfp-no-edit #inv-detail-status-badge svg,
body.wfp-no-edit #inv-detail-status-badge [class*="chev"],
body.wfp-no-edit #page-inventory .row-status-picker svg,
body.wfp-no-edit #page-inventory .row-status-picker [class*="chev"] { display: none !important; }
body.wfp-no-edit .inv-section-edit-btn,
body.wfp-no-edit .inv-photo-cover-btn,
body.wfp-no-edit #wfwd-missing-toggle { display: none !important; }
/* Bulk select only leads to edit / delete actions. */
body.wfp-no-edit.wfp-no-delete #page-inventory .inv-row-check,
body.wfp-no-edit.wfp-no-delete #page-inventory .inv-row-check-box { display: none !important; }

/* Delete. */
body.wfp-no-delete #inv-detail-delete-row { display: none !important; }

/* Row ⋯ with nothing but View behind it, and the + button with nothing to add. */
body.wfp-no-rowmenu #page-inventory [data-col="row-actions"],
body.wfp-no-rowmenu .wf-ct-more,
body.wfp-no-rowmenu [onclick*="showInvActions"] { display: none !important; }
body.wfp-no-fab #unified-fab,
body.wfp-no-fab .unified-fab { display: none !important; }

/* A read-only number box (ship-to limit) shows its value, not stepper arrows. */
input[data-wfp-inert] { -moz-appearance: textfield; appearance: textfield; }
input[data-wfp-inert]::-webkit-inner-spin-button, input[data-wfp-inert]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* One-photo button (onePhotoButton, 2026-10-18 Hal): there is no "From Library" button under it, so the empty drop zone is compact
   instead of a 246px block, and the Money card sits right under it. Same specificity chain as the base rule, plus .is-one-photo. */
@media (min-width: 769px) {
html body #page-inventory-detail#page-inventory-detail.page #wfwd-photos-card #inv-detail-photos.inv-photo-empty.is-one-photo .inv-photo-empty-add,
html body #page-inventory-detail .wfwd-photos-card #inv-detail-photos.inv-photo-empty.is-one-photo .inv-photo-empty-add { min-height: 150px !important; padding: 20px 16px !important; }
}
/* Phone: the phone layout already keeps the drop zone compact (no change there). */
/* Notes: no note write grant (inventory.edit / deals.edit / contacts.edit) = the timeline reads, nothing to add or change. */
body.wfp-no-notes .note-input-row,
body.wfp-no-notes [onclick*="editNote("],
body.wfp-no-notes [onclick*="deleteNoteEntry("] { display: none !important; }

/* Photo star badge ("Invoice photo" flag + the star on the cover thumbnail): it names the photo printed on
   invoices, so a seat with no invoice access (no invoices.create, no payments.view) doesn't get it. */
body.wfp-no-invoice #page-inventory-detail #inv-detail-photos .inv-photo-cover-flag { display: none !important; }
body.wfp-no-invoice #page-inventory-detail #inv-detail-photos .inv-photo-thumb.is-cover::after { display: none !important; content: none !important; }

/* Per-member restrictions (2026-10-19, default OFF; wf-seat-gates.js sets the body class from an explicit restrict.* key). */
body.wfp-hide-totals #invoice-kpi-section,
body.wfp-hide-totals #wfil-sum,
body.wfp-hide-totals #inv-export-btn,
body.wfp-hide-totals #ph-export-btn,
body.wfp-hide-totals .inv-export-header-btn,
body.wfp-hide-totals [onclick*="exportHubInvoicesCSV"],
body.wfp-hide-totals [data-kpi-tile="total_value"],
body.wfp-hide-totals [data-kpi-tile="cost_basis"],
body.wfp-hide-totals [data-kpi-tile="stock_value"],
body.wfp-hide-totals [data-kpi-tile="retail_target"],
body.wfp-hide-totals [data-kpi-tile="wholesale_target"],
body.wfp-hide-totals #inventory-kpis [onclick*="_invOpenOnHand"],
body.wfp-hide-totals #inventory-kpis-v2 [onclick*="'total_value'"],
body.wfp-hide-totals #payment-kpis,
body.wfp-hide-totals .jj-stat[onclick*="_invOpenOnHand"],
body.wfp-hide-totals #nav-expenses-item,
body.wfp-hide-totals [onclick*="showPage('expenses')"],
body.wfp-hide-totals [onclick*="expAddOpen"] { display: none !important; }
