/* Customers and a customer's card (customers/customers.js): the exact rebuild of the design's /customers (Oct 23, 2026).
   The design's own parts (.ds-page-header, .ds-split-layout--customers, .ds-list-card, .ds-customer-row,
   .ds-customer-detail, .ds-customer-hero, .ds-stat-pair, .ds-timeline, .ds-field-label, .ds-accordion-row, the
   master-detail) are in styles.css. This file holds only what the Hub has and the design doesn't. Loaded after
   styles.css; colours only from the tokens. */

/* The screen: the design's page (its 22 px between the header and the split). styles.css still has the old list's and
   page's own rules (no gap, the list to the screen's edges, a 760 px page); these undo them for the rebuilt screen. */
.screen.ds-page:is([data-screen="customers"], [data-screen="customer"]) { gap: 22px; max-width: none; margin: 0; padding: 22px 0 40px; }
/* customers.js puts the card beside the list from 900 px (its WIDE); styles.css stacks the split up to 1050 px, which put
   the card under the whole list. In between, two narrower columns (as Replies does, replies.css). */
@media screen and (min-width: 900px) and (max-width: 1050px) {
  .ds-split-layout--customers { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); }
}

/* ---------- The list card ---------- */
/* Brandon's stages to review: one slim line above the search (a dot, a few words, Review). */
.cu-review-line { display: flex; align-items: center; gap: 10px; margin: 6px 6px 10px; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--surface-2); }
.cu-review-line p { flex: 1; min-width: 0; margin: 0; color: var(--text); font-size: 0.82rem; font-weight: 600; }
.cu-review-line .ds-button { min-height: 36px; }
.cu-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--alert); }
/* Brandon's chips under the search: All, Owes, To confirm, No stage and each stage; one line that scrolls sideways. */
.cu-chips { display: flex; gap: 6px; margin: -2px 6px 8px; padding-block: 2px; overflow-x: auto; scrollbar-width: none; }
.cu-chips::-webkit-scrollbar { display: none; }
.cu-chip { flex: none; min-height: 32px; padding: 0 12px; border: 1px solid var(--ds-line); border-radius: 999px; background: transparent; color: var(--text-3); font-size: 0.74rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.cu-chip:hover { color: var(--text); background: var(--surface-2); }
.cu-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-cta); }
.cu-none { padding: 6px; }
.cu-none .ds-empty-state { min-height: 180px; }
.ds-customer-rows[hidden], .cu-none[hidden] { display: none; }
.ds-customer-row strong { color: var(--text); overflow-wrap: anywhere; }
.ds-customer-row .ds-badge { flex: none; }
/* Hidden (N), Brandon's, at the bottom of the list. */
.cu-hidden { margin: 8px 6px 0; }
.cu-hidden > summary, .cu-acc > summary { list-style: none; }
.cu-hidden > summary::-webkit-details-marker, .cu-acc > summary::-webkit-details-marker { display: none; }
.cu-hidden > summary { color: var(--text-3); }

/* ---------- A customer's card ---------- */
.cu-line { margin: 0; color: var(--text-3); font-size: 0.78rem; line-height: 1.5; }
.cu-warn { color: var(--rt-bad); }
.ds-customer-detail > .cu-line { margin-bottom: 12px; }
.ds-customer-hero h2 { margin-bottom: 4px; overflow-wrap: anywhere; }
/* The stage and what they owe, under "town · source". */
.cu-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cu-note p { margin: 0; color: var(--text); }
.cu-note .ds-button-row { margin-top: 12px; }
.cu-pair { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ds-line); }

/* The timeline: the design's rows, with every word of a message and who, the channel and the topic under it. */
.cu-ev-w { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.cu-ev-t { overflow-wrap: anywhere; white-space: pre-line; }
.cu-ev-s { color: var(--text-3); font-size: 0.72rem; }
.ds-timeline time { flex: none; padding-left: 12px; white-space: nowrap; }
.ds-timeline .cu-ev.is-us i { background: var(--text-3); }
.ds-timeline .cu-ev-none { border-left: 0; padding-left: 0; color: var(--text-3); }
.ds-timeline .cu-ev-more { margin-left: 18px; }

/* The notes' save line. */
.cu-notes .ds-field-label { margin-bottom: 6px; }
.cu-notes-b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 20px; color: var(--text-3); font-size: 0.78rem; }
.cu-notes-err { flex: 1 1 220px; margin: 0; color: var(--text); font-size: 0.8rem; line-height: 1.4; }
.cu-notes-theirs:empty { display: none; }
.cu-notes-theirs p { margin: 0 0 6px; color: var(--text-3); font-size: 0.78rem; }
.cu-notes-theirs q { color: var(--text); white-space: pre-line; }
[data-notes-saved] { color: var(--rt-ok); font-weight: 600; }
.cu-notes-b:empty { min-height: 0; }
.cu-notes { margin-bottom: 14px; }
.cu-notes:has(.cu-notes-b:empty) .ds-field-label { margin-bottom: 0; }

/* The accordion rows (Follow-ups · N, Invoices · N, Customer details): the chevron turns when open. */
.ds-accordion-row .ic { width: 18px; height: 18px; color: var(--text-3); transition: transform 160ms ease; }
.cu-acc[open] > summary .ic, .cu-hidden[open] > summary .ic { transform: rotate(180deg); }
.cu-acc-b { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 16px; }
.cu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cu-item > span { display: flex; min-width: 0; flex-direction: column; gap: 2px; color: var(--text); font-size: 0.8rem; }
.cu-item small, .cu-inv small { color: var(--text-3); font-size: 0.74rem; }
.cu-steps { margin: 4px 0 0; padding-left: 18px; color: var(--text-3); font-size: 0.74rem; }
/* One invoice: its number, day, total and paid; Owes or Paid; its lines and payments open with a tap. */
.cu-inv { border-top: 1px solid var(--ds-line); }
.cu-inv > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; list-style: none; cursor: pointer; }
.cu-inv > summary::-webkit-details-marker { display: none; }
.cu-inv > summary > span:first-child { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; color: var(--text); font-size: 0.8rem; }
.cu-inv > summary .ic { width: 16px; height: 16px; color: var(--text-3); transition: transform 160ms ease; }
.cu-inv[open] > summary .ic { transform: rotate(180deg); }
.cu-lines { margin: 0 0 8px; padding: 0; list-style: none; }
.cu-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--text); font-size: 0.78rem; }
.cu-inv > .cu-line { margin-bottom: 8px; }
/* Customer details: every phone and email, the address, where they came from, the first day. */
.cu-detail { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); font-size: 0.82rem; overflow-wrap: anywhere; }
.cu-detail .ic { flex: none; width: 16px; height: 16px; color: var(--text-3); }
.cu-detail a { color: var(--link); }
/* Brandon's buttons; after the first tap, Not a customer says what it will do. */
.cu-actions { margin-top: 6px; }
.cu-actions .ds-button .ic { width: 16px; height: 16px; }
.cu-hide { display: contents; }
.cu-hide-s { flex: 1 1 100%; margin: 0; color: var(--text-3); font-size: 0.78rem; line-height: 1.4; }

/* The placeholders keep their room below the header. */
[data-screen="customers"] .skel, [data-screen="customer"] .skel { padding-block: 0 24px; }
