/* claude-sales-20261118: Sales and People presentation (Customers, Deals, Leads, Commissions, the
   Team list and the customer, deal and lead records). Presentation only: every rule is scoped to
   one page (#content#content[data-bux-page=…]) or one record sheet (#drawer#drawer…), uses the
   shell's own tokens, and changes no control, permission, read or write. The doubled id gives each
   rule (2,n,n) specificity, so it wins over the live page rules (at most one id) whatever the
   stacking order; the !important declarations are only where a live rule is itself !important.
   Focus rings are the shell's own (not overridden here). Shipped as a hashed asset with sha384 SRI. */

#content#content:is([data-bux-page="customers"],[data-bux-page="deals"],[data-bux-page="wsleads"],[data-bux-page="commissions"],[data-bux-page="team"]){--cs-quiet:var(--mut,var(--stone));--cs-line:var(--hairline,var(--line))}

/* ---------- Customers list ---------- */
#content#content[data-bux-page="customers"] .cpp-page>p[data-status]{margin:8px 0 4px!important;font-size:13px;line-height:20px;color:var(--cs-quiet)}
#content#content[data-bux-page="customers"] .cpp-page>.onc-toolbar{margin:0 0 8px;min-height:20px}
#content#content[data-bux-page="customers"] .cpp-page>.onc-toolbar output{font-size:13px;color:var(--cs-quiet)}
/* Kind is stored lowercase ("person", "dealer"): sentence case through the first letter only, so
   "Unknown type" and "LLC" read as written. */
#content#content[data-bux-page="customers"] .cpp-kind{display:block;font-size:12px;line-height:16px;color:var(--cs-quiet)}
#content#content[data-bux-page="customers"] .cpp-kind::first-letter{text-transform:uppercase}
/* Person and company faces share one size and one filled shape; companies keep a squarer corner. */
#content#content[data-bux-page="customers"] .cpp-page [data-results] .ori-customer-face>.cu2-face,#content#content[data-bux-page="customers"] .cu2-face{width:32px!important;height:32px!important;min-width:32px!important;flex:0 0 32px!important;display:inline-grid;place-items:center;border-radius:50%;background:var(--well,var(--surface));color:var(--ink);font:600 12px/1 var(--font-ui);font-size:12px!important;box-shadow:inset 0 0 0 1px var(--cs-line)!important}
#content#content[data-bux-page="customers"] .cpp-page [data-results] .ori-customer-face>.cu2-face.company,#content#content[data-bux-page="customers"] .cu2-face.company{border-radius:8px!important}
#content#content[data-bux-page="customers"] .cpp-page [data-results] .ori-customer-face{width:32px!important;height:32px!important;min-width:32px;flex:none}
#content#content[data-bux-page="customers"] .ori-customer-identity{display:flex!important;align-items:center;gap:12px;min-width:0}
#content#content[data-bux-page="customers"] .ori-customer-copy{min-width:0}
#content#content[data-bux-page="customers"] .cpp-page .cpp-name{display:inline-flex;align-items:center;padding:0;text-align:left;font-weight:600;overflow-wrap:break-word}
@media (max-width:1199px){#content#content[data-bux-page="customers"] .cpp-page .cpp-name{min-height:44px!important}}
#content#content[data-bux-page="customers"] table[data-bux-table] td{font-variant-numeric:tabular-nums}
/* Money columns (the renderer's own column keys 4 and 5, "We sold them" and "We bought from them";
   a role without money never renders them) are right-aligned from 1100px, where the table fits
   without scrolling sideways (at tablet widths the figures stay at the column start, so none is cut
   off on the first screen). The header keeps the framework's sort control at its end (56px end padding), and
   the figures take the same end inset, so each figure sits under its label. Keyed by data-onc-key
   and position, not by the English labels. */
@media (min-width:1100px){
  #content#content[data-bux-page="customers"] table[data-bux-cards="customers"]:has(thead th:nth-child(5) .onc-column[data-onc-key="4"]) :is(th,td):nth-child(5),
  #content#content[data-bux-page="customers"] table[data-bux-cards="customers"]:has(thead th:nth-child(6) .onc-column[data-onc-key="5"]) :is(th,td):nth-child(6){text-align:right}
  #content#content[data-bux-page="customers"] table[data-bux-cards="customers"]:has(thead th:nth-child(5) .onc-column[data-onc-key="4"]) td:nth-child(5),
  #content#content[data-bux-page="customers"] table[data-bux-cards="customers"]:has(thead th:nth-child(6) .onc-column[data-onc-key="5"]) td:nth-child(6){padding-inline-end:56px}
}
#content#content[data-bux-page="customers"] table[data-bux-table] tbody tr{transition:background-color .12s ease}
#content#content[data-bux-page="customers"] table[data-bux-table] tbody tr:hover{background:var(--well,var(--surface))}

/* ---------- Deals list ---------- */
#content#content[data-bux-page="deals"] .cd-heading{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px 24px}
#content#content[data-bux-page="deals"] .cd-heading>div:last-child{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}
#content#content[data-bux-page="deals"] .cd-heading .btn{min-height:44px;white-space:nowrap}
/* Signing set-up and the internal signing test are tools, not the page's job: quiet text actions. */
#content#content[data-bux-page="deals"] .cd-heading :is([data-bos-account],[data-signing-test]){background:transparent;border-color:transparent;color:var(--ink);text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 45%,transparent);text-underline-offset:4px;padding-inline:10px}
#content#content[data-bux-page="deals"] .cd-heading :is([data-bos-account],[data-signing-test]):hover{background:var(--well,var(--surface));text-decoration-color:currentColor}
#content#content[data-bux-page="deals"] .cd-count{margin:12px 0 8px;font-size:13px;color:var(--cs-quiet)}
#content#content[data-bux-page="deals"] [data-cd-list]>.card{overflow:hidden}
#content#content[data-bux-page="deals"] .cd-row{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:72px;padding:12px 20px;text-align:left}
#content#content[data-bux-page="deals"] .cd-row+.cd-row{border-top:1px solid var(--cs-line)}
#content#content[data-bux-page="deals"] .cd-row:hover{background:var(--well,var(--surface))}
#content#content[data-bux-page="deals"] .cd-row>span:first-child{min-width:0;flex:1 1 auto}
/* Rows without a linked car keep the text column of rows with a photo, only in a list that has photos. */
#content#content[data-bux-page="deals"] [data-cd-list]>.card:has(.bleu-deal-identity) .cd-row>span:first-child:not(.bleu-deal-identity){padding-left:112px}
#content#content[data-bux-page="deals"] .bleu-deal-identity{display:flex;align-items:center;gap:16px;min-width:0}
#content#content[data-bux-page="deals"] .bleu-deal-identity>span:last-child{min-width:0}
#content#content[data-bux-page="deals"] .cd-row strong{display:block;font-weight:600;overflow-wrap:break-word}
#content#content[data-bux-page="deals"] .cd-row small{display:block;font-size:13px;line-height:18px;color:var(--cs-quiet);overflow-wrap:break-word}
#content#content[data-bux-page="deals"] .cd-row .cs-nowrap{white-space:nowrap}
#content#content[data-bux-page="deals"] .cd-row>span:last-child{flex:none;text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:2px}
#content#content[data-bux-page="deals"] .cd-row>span:last-child b{font-weight:600;font-size:13px;line-height:18px;padding:3px 10px;border-radius:999px;background:var(--well,var(--surface));box-shadow:inset 0 0 0 1px var(--cs-line)}
#content#content[data-bux-page="deals"] .cd-page-footer{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;margin-top:12px}
#content#content[data-bux-page="deals"] .cd-tabs button{min-height:44px}
@media (max-width:640px){
  /* Phone: New deal and New buy on one row, the two tools on the next; a smaller photo with its
     placeholder centred; stage and salesperson under the deal text. */
  #content#content[data-bux-page="deals"] .cd-heading>div:last-child{display:grid!important;grid-template-columns:repeat(2,auto);justify-content:start;align-items:center;gap:8px;width:100%}
  #content#content[data-bux-page="deals"] .cd-heading :is([data-bos-account],[data-signing-test]){padding-inline:4px;width:auto!important;justify-self:start}
  #content#content[data-bux-page="deals"] .cd-row{flex-direction:column;align-items:stretch;gap:8px;padding:12px 16px}
  #content#content[data-bux-page="deals"] .bleu-deal-identity{align-items:flex-start;gap:12px}
  #content#content[data-bux-page="deals"] .bleu-deal-photo{width:64px!important;height:48px!important;flex:none;overflow:hidden;border-radius:var(--radius-control,8px)}
  #content#content[data-bux-page="deals"] .bleu-deal-photo :is(.cph,img,picture,.car-placeholder){width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;max-width:100%;object-fit:cover;flex:0 0 100%!important}
  #content#content[data-bux-page="deals"] .bleu-deal-photo .cph{display:grid!important;place-items:center}
  #content#content[data-bux-page="deals"] .bleu-deal-photo .car-placeholder{display:grid;place-items:center}
  #content#content[data-bux-page="deals"] .bleu-deal-photo .car-placeholder>svg{place-self:center;margin:0}
  #content#content[data-bux-page="deals"] [data-cd-list]>.card:has(.bleu-deal-identity) .cd-row>span:first-child:not(.bleu-deal-identity){padding-left:76px}
  #content#content[data-bux-page="deals"] .cd-row>span:last-child{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start;align-self:stretch;width:auto!important;max-width:none!important;gap:8px;text-align:left}
  #content#content[data-bux-page="deals"] [data-cd-list]>.card:has(.bleu-deal-identity) .cd-row>span:last-child{padding-left:76px}
}

/* ---------- Leads ---------- */
#content#content[data-bux-page="wsleads"] .lx-sales-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 12px}
#content#content[data-bux-page="wsleads"] .lx-sales-coverage{flex-basis:100%;max-width:72ch;margin:0;font-size:13px;line-height:20px;color:var(--cs-quiet)}
#content#content[data-bux-page="wsleads"] :is(.lx-kbd,kbd){font-size:12px}
#content#content[data-bux-page="wsleads"] .ment.mcar{font-size:12px;line-height:20px;min-height:24px;display:inline-flex;align-items:center}
#content#content[data-bux-page="wsleads"] .lx-link{min-height:44px;min-width:44px;justify-content:center;display:inline-flex;align-items:center}
/* The list header's shortest segment ("All") was one pixel under the 44px target on this page. */
#content#content[data-bux-page="wsleads"] .blh-chip.is-segment{min-width:44px;justify-content:center}
#content#content[data-bux-page="wsleads"] .lx-tabs{display:flex;overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity}
#content#content[data-bux-page="wsleads"] .lx-tabs::-webkit-scrollbar{display:none}
#content#content[data-bux-page="wsleads"] .lx-tab{flex:none;scroll-snap-align:start;min-height:44px}
#content#content[data-bux-page="wsleads"] .lx-row{min-height:64px}
#content#content[data-bux-page="wsleads"] .lx-detail dl .lx-prop{align-items:baseline}
#content#content[data-bux-page="wsleads"] .lx-detail :is(.lx-menu,[role=menu]){max-width:calc(100vw - 32px)}
@media (max-width:640px){
  #content#content[data-bux-page="wsleads"] .lx-sales-filters label{flex:1 1 100%}
  #content#content[data-bux-page="wsleads"] .lx-sales-filters select{width:100%}
  /* Email and phone each get their own line instead of a separator that wraps alone. */
  #content#content[data-bux-page="wsleads"] .lx-detail .lx-prop dd:has(> .lx-sep) .lx-sep{display:none}
  #content#content[data-bux-page="wsleads"] .lx-detail .lx-prop dd:has(> .lx-sep){display:flex;flex-direction:column;align-items:flex-start;gap:4px}
}
@media (max-width:1199px){
  #content#content[data-bux-page="wsleads"] .lx-detail .ment.mcar{min-height:44px;padding-block:0}
}

/* ---------- Commissions ---------- */
#content#content[data-bux-page="commissions"] .cw-toolbar{flex-wrap:wrap}
#content#content[data-bux-page="commissions"] :is(.cw-more-filters,.cw-options)>summary{min-height:44px;border:1px solid var(--field-border,var(--line));border-radius:var(--radius-control,8px);background:var(--card);color:var(--ink);font-size:14px;font-weight:500}
#content#content[data-bux-page="commissions"] .cw-description{display:flex;flex-wrap:wrap;gap:4px 16px;color:var(--cs-quiet)}
#content#content[data-bux-page="commissions"] .cw-results>.onc-toolbar{padding:12px 16px 0;box-sizing:border-box}
#content#content[data-bux-page="commissions"] .cw-results>.onc-toolbar output{font-size:13px;color:var(--cs-quiet)}
#content#content[data-bux-page="commissions"] .cw-results small{font-size:12px}
#content#content[data-bux-page="commissions"] :is(.cw-stat strong,td.cw-number,th.cw-number){font-variant-numeric:tabular-nums}
@media (max-width:640px){
  /* The month picker and More filters overlapped (two older layers placed both in grid row 2):
     each filter gets its own row, and the secondary filters stack so their labels never clip. */
  #content#content[data-bux-page="commissions"] .cw .cw-toolbar form.cw-filters{display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:auto;width:100%;max-width:none}
  #content#content[data-bux-page="commissions"] .cw .cw-toolbar form.cw-filters>.cw-search{grid-column:1;grid-row:1;width:100%;min-width:0}
  #content#content[data-bux-page="commissions"] .cw .cw-toolbar form.cw-filters>.cw-month-label{grid-column:1;grid-row:2;width:100%;max-width:none;min-width:0}
  #content#content[data-bux-page="commissions"] .cw .cw-toolbar form.cw-filters>.cw-month-label select{width:100%!important;max-width:none!important}
  #content#content[data-bux-page="commissions"] .cw .cw-toolbar form.cw-filters>.cw-more-filters{grid-column:1;grid-row:3;width:100%;min-width:0}
  #content#content[data-bux-page="commissions"] .cw-more-filters .cw-secondary-filters{display:grid;grid-template-columns:minmax(0,1fr);width:100%;box-sizing:border-box}
  #content#content[data-bux-page="commissions"] .cw-more-filters .cw-secondary-filters :is(label,select){width:100%;max-width:none;min-width:0}
  #content#content[data-bux-page="commissions"] .cw-more-filters>summary{justify-content:space-between;padding:10px 36px 10px 12px;font-size:14px;white-space:nowrap}
  #content#content[data-bux-page="commissions"] .cw-toolbar>.cw-options{width:100%}
  #content#content[data-bux-page="commissions"] .cw .cw-options .cw-export-tools{left:0;right:auto;width:auto;min-width:min(300px,calc(100vw - 32px))}
  #content#content[data-bux-page="commissions"] .cw-heading-actions{display:flex;flex-wrap:wrap;gap:8px}
}
/* In card view (phones) there is nothing to scroll sideways. */
@media (max-width:640px){
  #content#content:is([data-bux-page="customers"],[data-bux-page="commissions"]) .bux-scroll-hint{display:none}
}

/* ---------- Team list (#/team and #/admin; the member editor is another lane's) ---------- */
/* The "People / Team" kicker repeated the navigation the page already shows. */
#content#content[data-bux-page="team"] .ac-heading .ac-kicker{display:none}
/* Add teammate is the page's one primary action. */
#content#content[data-bux-page="team"] .ac-heading [data-ac-add]{background:var(--miami);border-color:var(--miami);color:var(--on-miami,#fff)}
#content#content[data-bux-page="team"] .ac-heading [data-ac-add] svg{color:currentColor}
/* Group headings in sentence case on screen ("Power admins"); the words themselves are unchanged. */
/* ::first-letter needs a block container: the heading was a flex row, so it becomes a block with
   its count kept inline at the same 10px gap. */
#content#content[data-bux-page="team"] .ac-team-group>h2{display:block;text-transform:lowercase}
#content#content[data-bux-page="team"] .ac-team-group>h2::first-letter{text-transform:uppercase}
#content#content[data-bux-page="team"] .ac-team-group>h2>span{display:inline-block;margin-left:10px;text-transform:none}
/* Stats keep their figures on one line whatever the label wraps to. */
#content#content[data-bux-page="team"] .ac-stats .ac-stat{display:flex;flex-direction:column;justify-content:flex-start;gap:4px}
#content#content[data-bux-page="team"] .ac-stats .ac-stat>b{font-variant-numeric:tabular-nums;line-height:1.15}
/* Round avatars, as in Customers. */
#content#content[data-bux-page="team"] .ac-member .ac-avatar{border-radius:50%}
#content#content[data-bux-page="team"] .ac-member .ac-person{min-width:0}
#content#content[data-bux-page="team"] .ac-member .ac-person *{overflow-wrap:break-word}
/* Status pills were 11px on phones. */
#content#content[data-bux-page="team"] .ac-member .ac-pill{font-size:12px}
#content#content[data-bux-page="team"] .ac-search input{text-overflow:ellipsis}
@media (max-width:640px){
  #content#content[data-bux-page="team"] .ac-member .ac-avatar{width:40px!important;height:40px!important;min-width:40px;font-size:14px}
  #content#content[data-bux-page="team"] .ac-search input::placeholder{font-size:13px}
}

/* ---------- Customer record ---------- */
#drawer#drawer[data-brs="customer"] .bsm-gap[data-cs-code]{display:none}
#drawer#drawer.brs.customer-profile[data-brs="customer"] .rx-chip{font-size:12px}
/* Contact details: one 96px label column and 14px values (the live rule set 72px and 13.5px). */
#drawer#drawer.brs.customer-profile[data-brs="customer"] [data-ppanel="overview"]>.pcontact .dfield{grid-template-columns:96px minmax(0,1fr)!important;align-items:baseline;column-gap:12px}
#drawer#drawer.brs.customer-profile[data-brs="customer"] [data-ppanel="overview"]>.pcontact .dfield :is(.v,.v a){font-size:14px!important;line-height:20px;overflow-wrap:anywhere}
#drawer#drawer.brs.customer-profile[data-brs="customer"] .pbyct{font-size:14px;line-height:20px}
#drawer#drawer.brs.customer-profile[data-brs="customer"] :is(.pbyctag,.srctag){font-size:12px;color:var(--mut,var(--stone))}
/* Want-list field labels were 9.5px; key-fact and summary-time labels 11px on tablets. */
#drawer#drawer.brs.customer-profile[data-brs="customer"] :is(.lf label.fl>span,.dbig .c .k,.brs-fact-k,.bsm-at){font-size:12px!important;line-height:16px}
@media (max-width:1199px){
  #drawer#drawer.brs.customer-profile[data-brs="customer"] details>summary{min-height:44px;display:flex;align-items:center}
  #drawer#drawer.brs.customer-profile[data-brs="customer"] input.fin{min-height:44px}
  /* The want list's own rule fixes these at 32px with !important: matched here. */
  #drawer#drawer.brs.customer-profile[data-brs="customer"] #wantscard .wantadd .fin{min-height:44px!important;height:44px!important}
}

/* ---------- Deal record ---------- */
#drawer#drawer.brs:has(> .cd-editor) :is(.dw-eyebrow,.dw-eyebrow span){font-size:12px!important;line-height:16px;letter-spacing:.02em}
@media (max-width:1199px){
  #drawer#drawer.brs:has(> .cd-editor) :is(button,select,input,summary){min-height:44px}
}

@media (prefers-reduced-motion:reduce){
  #content#content[data-bux-page="customers"] table[data-bux-table] tbody tr{transition:none}
}
@media (forced-colors:active){
  #content#content[data-bux-page="customers"] .cu2-face{forced-color-adjust:none;background:Canvas;color:CanvasText;box-shadow:inset 0 0 0 1px CanvasText}
  #content#content[data-bux-page="deals"] .cd-row>span:last-child b{box-shadow:inset 0 0 0 1px CanvasText;background:Canvas;color:CanvasText}
  #content#content[data-bux-page="deals"] .cd-heading :is([data-bos-account],[data-signing-test]){border-color:ButtonText}
  #content#content[data-bux-page="team"] .ac-heading [data-ac-add]{forced-color-adjust:auto;background:ButtonFace;color:ButtonText;border-color:ButtonText}
}
