/* OS2 Clients (2026-11-03): the client page that opens from the client list (public/os2/clients.js).
   Uses the app's tokens (style.css) and the shared os2- pieces (os2.css); every selector here starts
   with .os2-clients-. Nothing is wider than a 375 px phone: tables sit in .os2-scroll. */
.os2-clients-open { font-weight: 600; color: var(--ink, inherit); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.os2-clients-open:hover { color: var(--accent, #1397d4); }
.os2-clients-open:focus-visible, .os2-clients-backlink:focus-visible { outline: 2px solid var(--accent, #1397d4); outline-offset: 2px; border-radius: 4px; }
.os2-clients-back { margin: 0 0 8px; }
.os2-clients-backlink { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink-2, inherit);
  text-decoration: none; }
.os2-clients-backlink:hover { color: var(--ink, inherit); text-decoration: underline; text-underline-offset: 3px; }
.os2-clients-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; }
.os2-clients-title { margin: 0; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; min-width: 0; }
.os2-clients-title:focus { outline: none; }
.os2-clients-title:focus-visible { outline: 2px solid var(--accent, #1397d4); outline-offset: 2px; border-radius: 4px; }
.os2-clients-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.os2-clients-facts { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.os2-clients-facts dt { color: var(--muted, #6b7280); font-size: 13px; }
.os2-clients-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.os2-clients-sub { margin: 16px 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted, #6b7280); }
.os2-clients-bar { height: 8px; max-width: 320px; margin: 6px 0 0; border-radius: 999px; overflow: hidden;
  background: var(--chip, rgba(127, 127, 127, .18)); }
.os2-cl-table .os2-cl-srl { display: none; }
.os2-clients-bar > span { display: block; height: 100%; background: var(--accent, #1397d4); }
.os2-clients-foot { margin: 8px 0 0; font-size: 13px; }
/* Where a column's figures come from ("GoHighLevel: synced 12 min ago", "as of the Nov 3 roster"), under its heading. */
.os2-clients-th-note { margin-top: 2px; font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--ink-3, #606c80); white-space: normal; }
.os2-clients-from { margin-top: 2px; font-size: 12px; }
.os2-clients-pages td:first-child { min-width: 180px; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .os2-clients-title { font-size: 20px; }
}

.os2-calls-top { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.os2-calls-title { overflow-wrap: anywhere; }
.os2-calls-sum { margin-top: 6px; }
.os2-calls-sum > summary { cursor: pointer; font-size: 13px; color: var(--ink-3, #606c80); min-height: 32px; display: flex; align-items: center; }

/* ── uiclients-1126: the list. Figures and chips first, one table, detail behind a tap. ───────────────── */
/* every source on one quiet line */
.os2-cl-syncs { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0 0 12px; }
.os2-cl-syncs .os2-sync { margin: 0; font-size: 12px; }
.os2-cl-note { margin: 0 0 12px; font-size: 13px; }
/* filter chips: the figure leads, the word follows; the pressed one is solid ink (the system's primary) */
.os2-cl-kpis { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.os2-cl-card { padding-top: 16px; }
.os2-cl-kpi { display: inline-flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 6px 14px; border: 1px solid var(--rule, #e5e9f0);
  border-radius: var(--radius-sm, 8px); background: var(--paper, #fff); color: var(--ink, #0f172a); font: inherit; cursor: pointer;
  transition: background-color var(--dur-1, .12s) ease, border-color var(--dur-1, .12s) ease; }
.os2-cl-kpi b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.os2-cl-kpi span { font-size: 13px; color: var(--ink-2, #475569); }
.os2-cl-kpi.is-alert b { color: var(--alert, #c2261d); }
.os2-cl-kpi:hover { border-color: var(--rule-strong, #cbd3de); background: var(--wash, #eef2f6); }
.os2-cl-kpi:focus-visible { outline: 2px solid var(--ink, #0f172a); outline-offset: 2px; }
.os2-cl-kpi[aria-pressed="true"] { background: var(--ink, #0f172a); border-color: var(--ink, #0f172a); color: var(--paper, #fff); }
.os2-cl-kpi[aria-pressed="true"] span, .os2-cl-kpi[aria-pressed="true"] b { color: var(--paper, #fff); }
.os2-cl-filter-none { margin: 10px 0 0; font-size: 13px; }
/* one table; each group is a tbody with a quiet header row */
.os2-cl-table td { padding-top: 8px; padding-bottom: 8px; }
.os2-cl-table .os2-cl-grp th { padding: 14px 8px 6px; font-size: 12px; color: var(--ink, #0f172a); background: var(--paper-2, #f8fafc);
  border-bottom: 1px solid var(--rule, #e5e9f0); }
.os2-cl-grp-n { margin-left: 4px; font-weight: 500; color: var(--ink-3, #606c80); font-variant-numeric: tabular-nums; }
.os2-cl-name { min-width: 190px; }
.os2-cl-contact { font-size: 13px; }
.os2-cl-day { font-size: 12px; white-space: nowrap; }
.os2-cl-nowrap { white-space: nowrap; }
/* health: dot + word, red words in the alert ink so the colour is never the only signal */
.os2-cl-health { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.os2-cl-hp { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2, #475569); white-space: nowrap; }
.os2-cl-hp-red .os2-cl-hp-l { color: var(--alert, #c2261d); font-weight: 600; }
.os2-cl-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* the onboarding work: "7 items" in the row, the chips behind the tap */
.os2-cl-more > summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink, #0f172a);
  text-decoration: underline; text-decoration-color: var(--rule-strong, #cbd3de); text-underline-offset: 3px; }
.os2-cl-more-body { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; max-width: 320px; }
.os2-cl-left { margin: 4px 0 12px; font-size: 14px; }
.os2-cl-left > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--ink-2, #475569); }

/* phone: each client is a compact card (name across, then a two-column grid of labelled facts) — no sideways scroll */
@media (max-width: 640px) {
  .os2-cl-wrap { overflow: visible; background: none; }
  .os2-cl-table, .os2-cl-table tbody, .os2-cl-table tr, .os2-cl-table td, .os2-cl-table th { display: block; width: auto; }
  .os2-cl-table thead { display: none; }
  .os2-cl-table tbody[hidden], .os2-cl-table tr[hidden] { display: none; }
  .os2-cl-table .os2-cl-grp th { padding: 12px 0 6px; background: none; }
  .os2-cl-table tbody > tr:not(.os2-cl-grp) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px;
    padding: 12px 0; border-bottom: 1px solid var(--rule, #e5e9f0); }
  .os2-cl-table tbody > tr:not(.os2-cl-grp) > td { padding: 0; border: 0; min-width: 0; }
  /* name and health run across; ClickUp, agreement and onboarding share a row; pages and billing share the last */
  .os2-cl-table td.os2-cl-name, .os2-cl-table td.os2-cl-c-health, .os2-cl-table td.os2-cl-c-posts { grid-column: 1 / -1; min-width: 0; }
  .os2-cl-table td.os2-cl-c-billing { grid-column: span 2; }
  .os2-cl-table td.os2-cl-c-agreement .os2-cl-day { display: block; }
  /* rel-1128 a11y: on a phone the column name is read from this span (CSS ::before text is not), and the ::before is
     hidden from the accessibility tree by being presentational text only. */
  .os2-cl-table .os2-cl-srl { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .os2-cl-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 11.5px; font-weight: 600; color: var(--ink-3, #606c80); }
  .os2-cl-table td.os2-cl-c-health[data-label]::before { display: none; }   /* the words beside each dot say it */
  .os2-cl-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .os2-cl-kpi { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 10px; text-align: left; }
  .os2-cl-kpi span { font-size: 12px; line-height: 1.25; }
  .os2-cl-more-body { max-width: none; }
}

/* ── uiclients-1126: the client page. A glance row under the name, denser facts, tabs that slide on a phone. ── */
.os2-clients-head { margin-bottom: 10px; }
.os2-cl-glance { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--rule, #e5e9f0);
  border-radius: var(--radius-sm, 8px); background: var(--paper, #fff); }
.os2-cl-glance > div { min-width: 0; }
.os2-cl-glance dt { font-size: 11.5px; font-weight: 600; color: var(--ink-3, #606c80); margin: 0 0 3px; }
.os2-cl-glance dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.os2-cl-num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink, #0f172a); }
a.os2-cl-num { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.os2-cl-num.is-alert { color: var(--alert, #c2261d); }
/* what onboarding produced: link chips */
.os2-cl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.os2-cl-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 2px 10px; border: 1px solid var(--rule, #e5e9f0); border-radius: 999px;
  background: var(--paper-2, #f8fafc); color: var(--ink, #0f172a); font-size: 13px; text-decoration: none; }
a.os2-cl-chip:hover { border-color: var(--ink, #0f172a); }
a.os2-cl-chip:focus-visible { outline: 2px solid var(--ink, #0f172a); outline-offset: 2px; }
/* facts two pairs to a row on a wide screen (overview here, and the scorecard / client-details facts in the same panels) */
@media (min-width: 1100px) {
  .os2-clients-facts.os2-cl-2up, [data-os2-cpanel] .os2-csm-facts { grid-template-columns: minmax(90px, max-content) minmax(0, 1fr) minmax(90px, max-content) minmax(0, 1fr); column-gap: 18px; }
}
@media (max-width: 640px) {
  /* tabs: one row that slides sideways instead of four wrapped rows */
  .os2-ctabs[role="tablist"] { flex-wrap: nowrap; overflow-x: auto; padding-right: 28px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    /* a soft edge on the right says more tabs sit off screen */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .os2-ctabs[role="tablist"]::-webkit-scrollbar { display: none; }
  .os2-ctabs[role="tablist"] .os2-ctab { flex: none; white-space: nowrap; min-height: 44px; }
  /* label and value side by side on a phone too: half the height of stacked pairs */
  .os2-clients-facts, [data-os2-cpanel] .os2-csm-facts { grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; }
  .os2-clients-facts dd, [data-os2-cpanel] .os2-csm-facts dd { margin-bottom: 0; }
  .os2-cl-glance { gap: 8px 18px; padding: 10px 12px; }
}
/* the scorecard's post lists, folded (public/os2/csm.js posting): a 44 px summary row with its count */
.os2-csm-fold { margin: 6px 0 0; border-top: 1px solid var(--rule, #e5e9f0); }
.os2-csm-fold > summary.os2-ops-h4 { cursor: pointer; margin: 0; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.os2-csm-fold[open] > summary.os2-ops-h4 { margin-bottom: 4px; }
