/* Occasional buyers(2026-10-29): the "Import buyers" sheet on Contacts, the "Bought for you" card on a contact,
   and the quick-add form inside the Bought by picker. New UI: thin wf-kpi-thin cards, pill status, 44px taps, theme tokens only
   (day + night). Spacing 24 / 12 / 16 / 8. Scoped to #occb-modal, #cd-boughtfor and .wfbb-add. */
#occb-modal, #occb-qa, #cd-boughtfor, .wfbb-add { --occb-red: #c0392b; --occb-amber: #b7791f; --occb-green: #1f8a4c; --occb-grey: #7a8494; }
html[data-remodel-mode="night"] #occb-qa, html[data-remodel-mode="night"] #occb-modal, html[data-remodel-mode="night"] #cd-boughtfor, html[data-remodel-mode="night"] .wfbb-add { --occb-red: #ef6b5c; --occb-amber: #e0a94b; --occb-green: #4caf85; --occb-grey: #9aa4b2; }
[data-occbtone="red"] { --occb-tone: var(--occb-red); } [data-occbtone="amber"] { --occb-tone: var(--occb-amber); } [data-occbtone="green"] { --occb-tone: var(--occb-green); } [data-occbtone="grey"] { --occb-tone: var(--occb-grey); } [data-occbtone="gold"] { --occb-tone: var(--gold); }
.occb-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.35; white-space: nowrap; color: var(--occb-tone, var(--occb-grey)); background: color-mix(in srgb, var(--occb-tone, var(--occb-grey)) 13%, transparent); }
.occb-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--occb-tone, var(--occb-grey)); }

/* the import sheet */
#occb-modal .modal { width: 760px; max-width: 96vw; padding: 24px; }
#occb-modal .modal-sub { margin: 4px 0 16px; }
.occb-label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--white); }
.occb-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
#occb-text { width: 100%; box-sizing: border-box; min-height: 168px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-raised); color: var(--white); font: inherit; font-size: 14px; line-height: 20px; resize: vertical; }
#occb-text:focus { outline: none; border-color: var(--gold); }
.occb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0 16px; }
.occb-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.occb-seg button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.occb-seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }
.occb-file { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--white); cursor: pointer; }
.occb-file input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.occb-file:focus-within { border-color: var(--gold); }
.occb-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.occb-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.occb-item { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.occb-item:last-child { border-bottom: 0; }
.occb-nm { min-width: 0; font-size: 14px; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.occb-sub { min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.occb-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin: 16px 0 0; }
.occb-foot .btn { min-height: 44px; }
.occb-err { margin: 12px 0 0; font-size: 13px; color: var(--occb-red); }
.occb-done { padding: 8px 0 0; font-size: 15px; color: var(--white); }
@media (max-width: 640px) {
  #occb-modal .modal { padding: 16px; }
  .occb-item { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .occb-item .occb-sub { grid-column: 1 / 2; grid-row: 2; white-space: normal; }
  .occb-item .occb-pill { grid-column: 2; grid-row: 1 / 3; }
  .occb-foot .btn { flex: 1 1 100%; }
}

/* "Bought for you" card on a contact */
#cd-boughtfor .card-body { padding-top: 4px; }
#cd-boughtfor .wf-kpi-rail { display: flex; margin: 0 0 16px; }
#cd-boughtfor .occb-bf-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 0; border-top: 1px solid var(--border); cursor: pointer; }
#cd-boughtfor .occb-bf-item:first-of-type { border-top: 0; }
#cd-boughtfor .occb-bf-t { min-width: 0; font-size: 14px; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cd-boughtfor .occb-bf-m { font-size: 13px; color: var(--muted); }
#cd-boughtfor .occb-bf-more { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
#cd-boughtfor .occb-bf-empty { font-size: 14px; color: var(--muted); }

/* quick add inside the Bought by picker */
.wfbb-add { margin-top: 8px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-panel); text-align: left; }
.wfbb-add-t { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--white); }
.wfbb-add label { display: block; margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.wfbb-add input { width: 100%; box-sizing: border-box; min-height: 44px; margin: 0 0 12px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-base); color: var(--white); font: inherit; font-size: 14px; }
.wfbb-add input:focus { outline: none; border-color: var(--gold); }
.wfbb-add-btns { display: flex; gap: 12px; }
.wfbb-add-btns .btn { flex: 1 1 0; min-height: 44px; }
.wfbb-add-err { margin: 0 0 12px; font-size: 13px; color: var(--occb-red); }
.wfbb-opt-add { color: var(--gold); font-weight: 600; }
#occb-qa .modal { width: 440px; max-width: 94vw; padding: 24px; } #occb-qa .modal-sub { margin: 4px 0 16px; } @media (max-width: 640px) { #occb-qa .modal { padding: 16px; } #occb-qa .occb-foot .btn { flex: 1 1 100%; } }
#cd-boughtfor { grid-column: 1 / -1; }

#cd-boughtfor .wf-kpi-rail { --wf-kpi-basis: min(230px, 78%); }
@media (min-width: 601px) { #cd-boughtfor .wf-kpi-rail { --wf-kpi-basis: 0px; --wf-kpi-cap: none; } #cd-boughtfor .wf-kpi-rail > .pay-kpi { flex: 1 1 0 !important; max-width: none !important; min-width: 0; } }
@media (max-width: 600px) { html body #cd-boughtfor .wf-kpi-rail.wf-kpi-thin { --wf-kpi-basis: min(232px, 100%); --wf-kpi-cap: min(232px, 100%); } }

/* pay terms (optional) in the New buyer dialog and the import sheet; the terms line on the Bought for you card */
.occb-terms { margin: 4px 0 12px; padding: 16px 0 0; border-top: 1px solid var(--border); }
.occb-terms-t { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--white); }
.occb-terms-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.occb-terms-row input { margin-bottom: 0; }
.occb-terms .occb-hint { margin: 8px 0 0; }
#occb-modal .occb-terms label { display: block; margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
#occb-modal .occb-terms input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); color: var(--white); font: inherit; font-size: 14px; }
#occb-modal .occb-terms input:focus { outline: none; border-color: var(--gold); }
@media (max-width: 640px) { .occb-terms-row { grid-template-columns: minmax(0, 1fr); } }
#cd-boughtfor .occb-bf-terms { margin: 12px 0 8px; font-size: 13px; color: var(--muted); }
#cd-boughtfor .occb-bf-terms strong { color: var(--white); }

/* one field colour in the New buyer dialog and the import sheet, day and night: the global text-input skin and the tel / email skin differ
   (the Name box was see-through slate, Phone and Email pure black), so every box here sets the same background and border itself. */
html body #occb-qa .wfbb-add input[data-f], html body #occb-modal .occb-terms input { background-color: var(--bg-raised) !important; border: 1px solid var(--border); color: var(--white); }
html body #occb-qa .wfbb-add input[data-f]:focus, html body #occb-modal .occb-terms input:focus { background-color: var(--bg-raised) !important; border-color: var(--gold); box-shadow: none; }
html body #occb-modal #occb-text, html body #occb-modal #occb-text:focus { background-color: var(--bg-raised) !important; }
