/* ==========================================================================================================
   PEOPLE-1669 (lane/1669-rd-people, owner 2026-11-04 / 2026-11-09): the new-look Clients / Patients lists and the client /
   patient detail pages (js/modules/people-redesign.js). Namespaced .pp-*; uses the ChiroApp "cx" tokens from css/index.css
   (--cx-brand follows the practice's Primary Color). Nothing here applies unless the module draws #ppRoot (new look on).
   --pp-ready tells the module this stylesheet is loaded (a missing / stale one keeps the classic page).
   No pills / chips (status and counts are plain coloured words), no emoji. Same app on phone, tablet and desktop: the detail
   panel is a right column at 1200px and wider, the SAME content in a bottom sheet below; detail pages are two columns there.
   ========================================================================================================== */
:root {
    --pp-ready: 1;
    --pp-head: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --pp-line: var(--cx-border, #dfe5e1);
    --pp-surface: var(--cx-surface, #fff);
    --pp-ok: #15803d;
    --pp-warn: #b45309;
    --pp-follow: #c2410c;
    --pp-danger: #b91c1c;
    --pp-info: #1d4ed8;
    --pp-muted: #64748b;
    --pp-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 18px rgba(15, 23, 42, 0.05);
}
[data-theme="dark"] { --pp-ok: #4ade80; --pp-warn: #fbbf24; --pp-follow: #fb923c; --pp-danger: #f87171; --pp-info: #93c5fd; --pp-muted: #94a3b8; }

#page-clients > .pp-classic-hidden, #page-patients > .pp-classic-hidden { display: none !important; }

.pp { color: var(--cx-text); display: flex; flex-direction: column; gap: 16px; padding-bottom: 28px; min-width: 0; --pp-brand: var(--cx-brand, #355e3b); }
.pp *, .pp-sheet * { box-sizing: border-box; }
.pp-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pp-muted { color: var(--cx-text-2); }
.pp-small { font-size: 0.82rem; }
.pp-nowrap { white-space: nowrap; }
.pp-break { overflow-wrap: anywhere; }
.pp-pre { white-space: pre-wrap; }
.pp-tone-ok { color: var(--pp-ok); }
.pp-tone-warn { color: var(--pp-warn); }
.pp-tone-follow { color: var(--pp-follow); }
.pp-tone-danger { color: var(--pp-danger); }
.pp-tone-info { color: var(--pp-info); }
.pp-tone-muted { color: var(--pp-muted); }

/* links in the practice accent */
.pp-link, .pp-inline-link, .pp-link-text, .pp-linkish { color: var(--pp-brand); }
.pp-link { text-decoration: none; }
.pp-link:hover, .pp-inline-link:hover, .pp-linkish:hover { text-decoration: underline; }
.pp-inline-link, .pp-linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; text-align: left; display: inline-flex; align-items: center; gap: 6px; }
.pp-linkish.pp-tone-danger { color: var(--pp-danger); }

/* header */
.pp-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 6px 4px; margin: 0 0 -8px -4px;
    color: var(--pp-brand); font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; min-height: 40px; }
.pp-back:hover { text-decoration: underline; }
.pp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pp-titles { min-width: 0; }
.pp-crumb { margin: 0 0 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cx-brand-ink); display: flex; align-items: center; gap: 6px; }
.pp-head h1 { margin: 0; font-family: var(--pp-head); font-size: 2.1rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: var(--primary-text, inherit); }   /* BRAND-1677 */
.pp-subtitle { margin: 4px 0 0; color: var(--cx-text-2); font-size: 0.95rem; }
.pp-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* buttons */
.pp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
    border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none; color: inherit;
    background: var(--pp-surface); transition: background 120ms ease, box-shadow 120ms ease, border-color 120ms ease; white-space: nowrap; }
.pp-btn:active { transform: translateY(1px); }
.pp-btn i { font-size: 1.15em; }
.pp-btn--brand { background: var(--pp-brand); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--pp-brand) 30%, transparent); }
.pp-btn--brand:hover { background: var(--cx-brand-strong, var(--pp-brand)); }
.pp-btn--outline { border-color: var(--pp-line); background: var(--pp-surface); color: var(--cx-text); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }
.pp-btn--outline:hover { border-color: var(--pp-brand); }
.pp-btn--soft { background: var(--cx-brand-soft); color: var(--cx-brand-ink); }
.pp-btn--sm { min-height: 36px; padding: 0 12px; font-size: 0.875rem; border-radius: 10px; }
.pp-btn--danger { color: var(--pp-danger); }
.pp-btn--danger:hover { border-color: var(--pp-danger); }
.pp-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 12px; }
.pp-btn:focus-visible, .pp-row:focus-visible, .pp-tab:focus-visible, .pp-sp:focus-visible, .pp-dtab:focus-visible, .pp-tile:focus-visible, .pp-xrow-head:focus-visible,
.pp-mini-row:focus-visible, .pp-menu-item:focus-visible, .pp-back:focus-visible, .pp-inline-link:focus-visible { outline: 3px solid var(--cx-focus); outline-offset: 2px; }

/* numbers-first tiles */
.pp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pp-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--pp-line);
    background: var(--pp-surface); color: var(--cx-text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--pp-shadow); min-width: 0; transition: border-color 120ms ease, box-shadow 120ms ease; }
.pp-tile:hover { border-color: color-mix(in srgb, var(--pp-brand) 45%, var(--pp-line)); }
.pp-tile.is-active { border-color: var(--pp-brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pp-brand) 30%, transparent); }
.pp-tile-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 6px; }
.pp-tile-icon--people { background: var(--cx-scheduling-icon, #d1f0e0); color: var(--cx-scheduling-ink, #065f46); }
.pp-tile-icon--billing { background: var(--cx-billing-icon, #fde9bf); color: var(--cx-billing-ink, #8a3c0c); }
.pp-tile-icon--info { background: var(--cx-info-bg, #dbeafe); color: var(--cx-info-ink, #1e3a8a); }
.pp-tile-icon--clinical { background: var(--cx-clinical-icon, #e4dcff); color: var(--cx-clinical-ink, #5b21b6); }
.pp-tile-label { font-size: 0.82rem; color: var(--cx-text-2); font-weight: 600; }
.pp-tile-n { font-family: var(--pp-head); font-size: 1.6rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.pp-tile-n.pp-tone-danger { color: var(--pp-danger); }

/* toolbar */
.pp-toolbar { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.pp-search, .pp-select { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--pp-line);
    background: var(--pp-surface); color: var(--cx-text-2); min-width: 0; }
.pp-search { flex: 1 1 280px; max-width: 520px; }
.pp-search input, .pp-select select { border: 0; background: transparent; font: inherit; font-size: 0.95rem; color: var(--cx-text); outline: none; min-width: 0; padding: 0; height: 44px; }
.pp-search input { flex: 1; width: 100%; }
.pp-search input::-webkit-search-cancel-button { display: none; }
.pp-select select { cursor: pointer; padding-right: 4px; }
.pp-search:focus-within, .pp-select:focus-within { border-color: var(--cx-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-focus) 25%, transparent); }
.pp-clear { background: none; border: 0; color: var(--cx-text-2); cursor: pointer; font-size: 1.15rem; padding: 4px; display: inline-flex; }

/* underlined word tabs (no pills) */
.pp-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--pp-line); align-items: center; }
.pp-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 0 9px; margin-bottom: -1px; font: inherit; font-weight: 600; font-size: 0.95rem;
    color: var(--cx-text-2); cursor: pointer; white-space: nowrap; }
.pp-tab.is-active { color: var(--cx-brand-ink); border-bottom-color: var(--pp-brand); }

/* species strip: line icons, species-first */
.pp-species { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; }
.pp-species::-webkit-scrollbar { display: none; }
.pp-sp { flex: 0 0 auto; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-width: 108px;
    padding: 10px 14px; border-radius: 14px; border: 1px solid var(--pp-line); background: var(--pp-surface); color: var(--cx-text); font: inherit; cursor: pointer; text-align: left; }
.pp-sp-icon { grid-row: 1 / span 2; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
    background: var(--cx-brand-soft); color: var(--cx-brand-ink); }
.pp-sp-label { font-weight: 600; font-size: 0.9rem; }
.pp-sp-n { font-family: var(--pp-head); font-weight: 700; font-size: 1.05rem; color: var(--cx-text-2); }
.pp-sp:hover { border-color: color-mix(in srgb, var(--pp-brand) 45%, var(--pp-line)); }
.pp-sp.is-active { border-color: var(--pp-brand); box-shadow: inset 0 -3px 0 var(--pp-brand); }
.pp-sp.is-active .pp-sp-icon { background: var(--pp-brand); color: #fff; }
.pp-sp.is-active .pp-sp-n { color: var(--cx-brand-ink); }

/* body + panel */
.pp-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.pp-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; container-type: inline-size; }
@media (min-width: 1200px) {
    .pp-body.has-panel { grid-template-columns: minmax(0, 1fr) minmax(340px, 380px); }
    .pp-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; border-radius: 20px; }
}
.pp-count { margin: 0; color: var(--cx-text-2); font-size: 0.88rem; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.pp-empty { margin: 0; padding: 28px 12px; text-align: center; color: var(--cx-text-2); }
.pp-more { align-self: center; margin-top: 6px; }

/* rows */
.pp-rows { display: flex; flex-direction: column; gap: 8px; }
.pp-row { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr) minmax(0, 200px) 118px 104px 18px; align-items: center; gap: 14px;
    width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--pp-line); background: var(--pp-surface); color: var(--cx-text);
    cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); transition: box-shadow 120ms ease, border-color 120ms ease; min-height: 70px; }
.pp-rows--patients .pp-row { grid-template-columns: 46px minmax(0, 1fr) minmax(0, 170px) 100px 104px 18px; }
.pp-row:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08); border-color: color-mix(in srgb, var(--pp-brand) 35%, var(--pp-line)); }
.pp-row.is-selected { border-color: var(--pp-brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pp-brand) 30%, transparent); background: color-mix(in srgb, var(--cx-brand-soft) 55%, var(--pp-surface)); }
.pp-row.is-dim .pp-name { color: var(--cx-text-2); }
.pp-avatar { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: 0 0 auto;
    background: var(--cx-surface-2, #f8faf9); border: 1px solid var(--pp-line); color: var(--cx-text-2); }
.pp-avatar svg { width: 1em; height: 1em; }
.pp-avatar--species { background: var(--cx-brand-soft); border-color: color-mix(in srgb, var(--pp-brand) 22%, transparent); color: var(--cx-brand-ink); }
.pp-avatar--sm { width: 38px; height: 38px; font-size: 1.15rem; }
.pp-avatar--lg { width: 56px; height: 56px; font-size: 1.7rem; }
.pp-avatar--xl { width: 68px; height: 68px; font-size: 2.1rem; }
.pp-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pp-name { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.pp-sub { font-size: 0.86rem; color: var(--cx-text-2); line-height: 1.3; }
.pp-status { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.01em; text-transform: none; }
.pp-pet { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; }
.pp-pet i, .pp-pet svg { color: var(--cx-brand-ink); }
.pp-col { font-size: 0.88rem; min-width: 0; }
.pp-col--contact { display: flex; flex-direction: column; gap: 2px; }
.pp-col--last { color: var(--cx-text-2); }
.pp-col--owner { color: var(--cx-text-2); }
.pp-balance { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.pp-chev { color: var(--cx-text-2); font-size: 1rem; }
@container (max-width: 600px) {
    .pp-row, .pp-rows--patients .pp-row { grid-template-columns: 46px minmax(0, 1fr) auto 18px; }
    .pp-row .pp-col--contact, .pp-row .pp-col--last, .pp-row .pp-col--owner { display: none; }
    .pp-rows--patients .pp-row .pp-col--missing { display: none; }
}
@container (max-width: 420px) {
    .pp-row, .pp-rows--patients .pp-row { gap: 10px; padding: 10px 12px; min-height: 64px; }
    .pp-row .pp-avatar { width: 40px; height: 40px; font-size: 1.2rem; }
    .pp-row, .pp-rows--patients .pp-row { grid-template-columns: 40px minmax(0, 1fr) auto 14px; }
    .pp-row .pp-balance { font-size: 0.8rem; }
    .pp-row .pp-balance i { display: none; }
}

/* detail card (panel + sheet content) */
.pp-detail-card { background: var(--pp-surface); border: 1px solid var(--pp-line); border-radius: 20px; overflow: hidden; box-shadow: var(--pp-shadow); }
.pp-sheet .pp-detail-card { border: 0; border-radius: 0; box-shadow: none; }
.pp-phero { display: flex; gap: 14px; align-items: center; padding: 20px 20px 18px; color: #fff;
    background: linear-gradient(135deg, var(--pp-brand), color-mix(in srgb, var(--pp-brand) 72%, #0b1a0e)); }
.pp-phero .pp-avatar { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.pp-phero-text { min-width: 0; }
.pp-phero h2 { margin: 0; font-family: var(--pp-head); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.pp-phero p { margin: 2px 0 0; opacity: 0.88; font-size: 0.9rem; }
.pp-flags { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 8px; }
.pp-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 600; color: #fff; opacity: 0.95; }
.pp-phero .pp-tone-ok, .pp-phero .pp-tone-info, .pp-phero .pp-tone-muted, .pp-phero .pp-tone-danger, .pp-phero .pp-tone-warn { color: #fff; }
.pp-phero .pp-flag.pp-tone-danger::before, .pp-phero .pp-flag.pp-tone-muted::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fca5a5; }
.pp-phero .pp-flag.pp-tone-muted::before { background: #cbd5e1; }
.pp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px 16px 0; }
.pp-fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--cx-surface-2, #f8faf9); border: 1px solid var(--pp-line); min-width: 0; }
.pp-fact-v { font-family: var(--pp-head); font-weight: 700; font-size: 1.05rem; }
.pp-fact-k { font-size: 0.76rem; color: var(--cx-text-2); }
.pp-primary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px 4px; }
.pp-detail-card > .pp-inline-link { margin: 10px 16px 0; font-size: 0.9rem; }
.pp-missing { display: flex; gap: 8px; align-items: flex-start; margin: 12px 16px 0; padding: 10px 12px; border-radius: 12px; font-size: 0.86rem;
    background: color-mix(in srgb, var(--pp-warn) 9%, var(--pp-surface)); color: var(--cx-text); }
.pp-missing > i { color: var(--pp-warn); margin-top: 2px; }
.pp-section { padding: 14px 16px 0; }
.pp-section:last-child { padding-bottom: 18px; }
.pp-section h3 { margin: 0 0 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cx-text-2); }
.pp-section p { margin: 4px 0; }
.pp-contact { display: flex; flex-direction: column; gap: 8px; }
.pp-contact-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.92rem; min-width: 0; }
.pp-contact-line > i { color: var(--cx-text-2); }
.pp-last { display: inline-flex; align-items: center; gap: 6px; color: var(--cx-text-2); }
.pp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pp-actions .pp-btn { min-height: 40px; padding: 0 12px; font-size: 0.88rem; }
.pp-mini-rows { display: flex; flex-direction: column; }
.pp-mini-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--pp-line); background: none;
    font: inherit; color: inherit; text-align: left; cursor: pointer; }
.pp-mini-row:last-child { border-bottom: 0; }
.pp-mini-row .pp-who { flex: 1; }
.pp-mini-row:hover .pp-name { text-decoration: underline; }
.pp-mini-row .pp-name { color: var(--pp-brand); }

/* classic blocks shown inside (care team, invoice details, moved loaders): calmer, same controls */
.pp-classic-block { font-size: 0.9rem; }
.pp-classic-block .card-subsection { display: flex; flex-direction: column; gap: 6px; }
.pp-classic-block .subsection-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cx-text-2); }
.pp-classic-block .subsection-label .btn { text-transform: none; letter-spacing: 0; }
.pp .btn, .pp-sheet .btn { border-radius: 10px; }
.pp-classic-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.pp-classic-actions .btn { min-height: 38px; border-radius: 10px; font-weight: 600; }
.pp [data-pp-slot] .collapsible-content-wrapper, .pp [data-pp-slot] > * { max-height: none; }

/* bottom sheet (phone / tablet) */
.pp-sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.42); z-index: 1190; animation: pp-fade 160ms ease; }
.pp-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200; max-height: 88vh; overflow-y: auto; background: var(--pp-surface); border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.25); padding: 0 0 calc(12px + env(safe-area-inset-bottom)); animation: pp-up 200ms ease; display: block; gap: 0; }
@media (min-width: 700px) { .pp-sheet { left: 50%; right: auto; width: 640px; transform: translateX(-50%); animation: none; } }
.pp-sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.6); position: absolute; top: 8px; left: 50%; margin-left: -22px; z-index: 2; }
.pp-sheet-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 1.2rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pp-sheet .pp-phero { padding-top: 26px; padding-right: 60px; }
body.pp-sheet-open { overflow: hidden; }
@keyframes pp-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes pp-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── detail pages ── */
/* one column (phone / tablet): hero, tiles, tabs, then the open tab; two columns at desktop width (profile left, tabs right) */
.pp-detail-grid { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pp-detail-left, .pp-detail-right { display: contents; }
.pp-detail-grid .pp-hero { order: 1; }
.pp-detail-grid .pp-tiles { order: 2; }
.pp-detail-grid .pp-dtabs { order: 3; }
.pp-detail-grid .pp-tabpanel { order: 4; }
.pp-detail.is-wide .pp-detail-grid { display: grid; grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.pp-detail.is-wide .pp-detail-left, .pp-detail.is-wide .pp-detail-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pp-detail.is-wide .pp-dtab--overview { display: none; }
.pp-hero { background: var(--pp-surface); border: 1px solid var(--pp-line); border-radius: 22px; overflow: visible; box-shadow: var(--pp-shadow); }
.pp-hero-band { position: relative; display: flex; gap: 16px; align-items: center; padding: 22px 20px 20px; color: #fff; border-radius: 21px 21px 0 0;
    background: linear-gradient(135deg, var(--pp-brand), color-mix(in srgb, var(--pp-brand) 70%, #0b1a0e)); }
.pp-hero-band .pp-avatar { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.pp-hero-text { min-width: 0; flex: 1; }
.pp-hero-eyebrow { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.pp-hero-text h1 { margin: 2px 0 0; font-family: var(--pp-head); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.pp-hero-status { margin: 8px 0 0; display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 0.86rem; font-weight: 600; }
.pp-hero-status span { display: inline-flex; align-items: center; gap: 5px; }
.pp-icon-btn--hero { align-self: flex-start; background: rgba(255, 255, 255, 0.16); color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); font-size: 1.2rem; }
.pp-icon-btn--hero:hover { background: rgba(255, 255, 255, 0.26); }
.pp-hero-band .pp-menu-wrap { align-self: flex-start; }
.pp-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 16px 16px; }

/* menus (status / more) */
.pp-menu-wrap { position: relative; display: inline-flex; }
.pp-caret { font-size: 0.85em; margin-left: -2px; }
.pp-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--pp-surface);
    border: 1px solid var(--pp-line); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18); color: var(--cx-text); }
.pp-hero-band .pp-menu { left: auto; right: 0; }
.pp-menu.is-open { display: flex; flex-direction: column; }
.pp-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 0.95rem;
    color: inherit; text-align: left; cursor: pointer; white-space: nowrap; }
.pp-menu-item:hover { background: var(--cx-brand-soft); }
.pp-menu-item i { color: var(--cx-text-2); font-size: 1.1rem; }
.pp-menu-item--danger, .pp-menu-item--danger i { color: var(--pp-danger); }

/* detail tiles + tabs */
.pp-tiles--detail .pp-tile { padding: 12px 14px; }
.pp-tiles--detail .pp-tile-n { font-size: 1.4rem; }
.pp-dtabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--cx-text-2) 10%, transparent); overflow-x: auto; scrollbar-width: none; }
.pp-dtabs::-webkit-scrollbar { display: none; }
.pp-dtab { flex: 1 0 auto; min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--cx-text-2); font: inherit; font-weight: 600; font-size: 0.92rem;
    cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pp-dtab.is-active { background: var(--pp-surface); color: var(--cx-brand-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.pp-dtab-n { font-weight: 700; color: var(--cx-text-2); font-size: 0.82rem; }
.pp-tabpanel { min-width: 0; }
.pp-tabpanel[hidden] { display: none !important; }
.pp-overview { display: flex; flex-direction: column; gap: 16px; }
.pp-detail-right > .pp-tabpanel { background: var(--pp-surface); border: 1px solid var(--pp-line); border-radius: 18px; padding: 8px 14px; box-shadow: var(--pp-shadow); }

/* cards + key / value rows */
.pp-card { background: var(--pp-surface); border: 1px solid var(--pp-line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--pp-shadow); min-width: 0; }
.pp-card-title { margin: 0 0 8px; font-family: var(--pp-head); font-size: 1.12rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pp-card-title i { color: var(--cx-brand-ink); }
.pp-kvs { display: flex; flex-direction: column; }
.pp-block { display: block; flex-basis: 100%; text-align: right; }
.pp-kv { display: grid; grid-template-columns: minmax(96px, 32%) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--pp-line); font-size: 0.93rem; align-items: baseline; }
.pp-kv:last-child { border-bottom: 0; }
.pp-kv-k { color: var(--cx-text-2); }
.pp-kv-v { text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 8px; }
.pp-kv-v .pp-inline-link { font-weight: 700; }
.pp-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.pp-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 2px; }
.pp-sub-head h3 { margin: 0; font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pp-note { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--pp-warn) 9%, var(--pp-surface)); font-size: 0.88rem; }
.pp-pref { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--pp-line); }
.pp-pref:last-child { border-bottom: 0; }
.pp-pref-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; background: var(--cx-surface-2, #f8faf9); }
.pp-pref-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; min-width: 0; }
.pp-pref-text strong { font-size: 0.95rem; }
.pp-pref-text span { color: var(--cx-text-2); }

/* expandable rows (appointments, invoices, notes, intakes) */
.pp-xrows { display: flex; flex-direction: column; }
.pp-xrow { border-bottom: 1px solid var(--pp-line); }
.pp-xrow:last-child { border-bottom: 0; }
.pp-xrow-head { display: grid; grid-template-columns: auto 38px minmax(0, 1fr) auto auto 16px; gap: 12px; align-items: center; width: 100%; padding: 12px 2px; border: 0; background: none;
    font: inherit; color: inherit; text-align: left; cursor: pointer; }
.pp-xrow[data-kind="invoice"] .pp-xrow-head, .pp-xrow[data-kind="note"] .pp-xrow-head { grid-template-columns: 38px minmax(0, 1fr) auto auto 16px; }
.pp-xrow[data-kind="note"] .pp-xrow-head { grid-template-columns: 38px minmax(0, 1fr) auto 16px; }
.pp-xrow-head--static { grid-template-columns: 38px minmax(0, 1fr) auto; cursor: default; }
.pp-xrow.is-open .pp-xrow-head .pp-chev { transform: rotate(180deg); }
.pp-when { display: flex; flex-direction: column; min-width: 112px; font-size: 0.86rem; }
.pp-when strong { font-size: 0.9rem; }
.pp-when span { color: var(--cx-text-2); }
.pp-amount { font-weight: 700; white-space: nowrap; }
.pp-xrow-body { padding: 0 2px 14px 50px; display: flex; flex-direction: column; gap: 8px; }
.pp-xrow[data-kind="appt"] .pp-xrow-body { padding-left: 2px; }
.pp-xrow-line { margin: 0; font-size: 0.9rem; display: flex; gap: 6px; align-items: flex-start; }
.pp-xrow-details { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--cx-surface-2, #f8faf9); }
@media (max-width: 640px) {
    .pp-xrow-head { grid-template-columns: 38px minmax(0, 1fr) auto 14px; }
    .pp-xrow[data-kind="appt"] .pp-xrow-head { grid-template-columns: 38px minmax(0, 1fr) auto 14px; }
    .pp-xrow[data-kind="appt"] .pp-when { display: none; }
    .pp-xrow[data-kind="invoice"] .pp-xrow-head { grid-template-columns: 38px minmax(0, 1fr) auto 14px; }
    .pp-xrow[data-kind="invoice"] .pp-amount { display: none; }
    .pp-xrow-body { padding-left: 2px; }
}
.pp-xrow[data-kind="appt"] .pp-sub::before { content: none; }
.pp-appt-when-narrow { display: none; }

/* phone */
@media (max-width: 640px) {
    .pp { gap: 14px; }
    .pp-head h1 { font-size: 1.85rem; }
    .pp-tiles { gap: 8px; }
    .pp-tile { padding: 10px 10px 12px; border-radius: 14px; }
    .pp-tile-icon { width: 30px; height: 30px; font-size: 1.05rem; margin-bottom: 4px; }
    .pp-tile-label { font-size: 0.74rem; line-height: 1.2; }
    .pp-tile-n { font-size: 1.3rem; }
    .pp-toolbar { gap: 10px; }
    .pp-search { flex-basis: 100%; max-width: none; }
    .pp-tabs { width: 100%; }
    .pp-select { width: 100%; }
    .pp-select select { flex: 1; }
    .pp-sp { min-width: 96px; padding: 8px 10px; column-gap: 8px; }
    .pp-sp-icon { width: 32px; height: 32px; font-size: 1.15rem; }
    .pp-hero-text h1 { font-size: 1.55rem; }
    .pp-avatar--xl { width: 56px; height: 56px; font-size: 1.7rem; }
    .pp-hero-actions .pp-btn { flex: 1 1 auto; }
    .pp-kv { grid-template-columns: minmax(84px, 30%) minmax(0, 1fr); font-size: 0.9rem; }
    .pp-card { padding: 14px 14px; }
    .pp-pref { grid-template-columns: 32px minmax(0, 1fr); }
    .pp-pref > .pp-btn, .pp-pref > .pp-tone-danger { grid-column: 2; justify-self: start; }
    .pp-dtab { padding: 0 12px; font-size: 0.88rem; }
}

/* classic blocks shown inside keep their controls; their small inline "chip" words become plain words (owner: no pills) */
.pp-classic-block span[style*="border-radius"], .pp-xrow-details span[style*="border-radius"], .pp-xrow-details div[style*="border-radius"] {
    background: none !important; border: 0 !important; border-radius: 0 !important; padding: 0 !important; }

/* the classic card controls shown in an expanded row: same buttons, one calm style (the classic tinted backgrounds read as pills) */
.pp-classic-actions .btn { background: var(--pp-surface) !important; color: var(--cx-text) !important; border: 1px solid var(--pp-line) !important; box-shadow: none !important;
    white-space: nowrap; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; }
.pp-classic-actions .btn { flex: 0 0 auto !important; width: auto !important; margin: 0 !important; }
.pp-classic-actions .btn:hover { border-color: var(--pp-brand) !important; }
.pp-classic-actions .btn-primary { background: var(--pp-brand) !important; color: #fff !important; border-color: var(--pp-brand) !important; }
.pp-classic-actions .btn[class*="delete-"], .pp-classic-actions .delete-note-btn { color: var(--pp-danger) !important; }
.pp-fact-v { font-size: 0.98rem; line-height: 1.25; }

/* patient photos: view-only gallery (owner 2026-11-09), tap to enlarge */
.pp-photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pp-photo { position: relative; padding: 0; border: 1px solid var(--pp-line); border-radius: 14px; overflow: hidden; background: var(--cx-surface-2, #f8faf9); cursor: zoom-in; aspect-ratio: 1 / 1; }
.pp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-photo-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: 0.78rem; font-weight: 600; color: #fff; text-align: left;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.6)); }
.pp-photo.is-broken img { visibility: hidden; }
.pp-photo.is-broken::before { content: 'Photo unavailable'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 6px; font-size: 0.75rem; color: var(--cx-text-2); text-align: center; }
.pp-photo.is-broken .pp-photo-label { color: var(--cx-text); background: none; }
.pp-photo:focus-visible { outline: 3px solid var(--cx-focus); outline-offset: 2px; }
.pp-photo-view { position: fixed; inset: 0; z-index: 1300; background: rgba(10, 15, 13, 0.88); display: flex; align-items: center; justify-content: center; padding: 56px 16px 24px; animation: pp-fade 160ms ease; }
.pp-photo-view figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; max-height: 100%; }
.pp-photo-view img { max-width: min(92vw, 1100px); max-height: calc(100vh - 120px); object-fit: contain; border-radius: 12px; background: #111; }
.pp-photo-view figcaption { color: #fff; font-weight: 600; }
.pp-photo-view-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 1.3rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 640px) { .pp-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* IOS-16PX (lane/1674-rd-int; owner rule for the redesign: iOS inputs are at least 16px). iOS Safari zooms the whole page when
   a field under 16px gets focus; on phones / tablets / touch screens every field of this page and its sheet is 16px.
   Measured by tests/journeys/redesign1674_fit_browser.cjs F2 at 360 / 390. */
@media (max-width: 1024px), (pointer: coarse) {
    #ppRoot input, #ppRoot select, #ppRoot textarea, #ppSheet input, #ppSheet select, #ppSheet textarea { font-size: 16px; }
}

/* COPY-1677 (owner Q21): copy icon + "Copied" message in the client's Contact and address card. */
.pp .copy-btn { margin-left: 8px; vertical-align: middle; border-radius: 10px; color: var(--cx-text-2); border-color: var(--cx-border, var(--border-color, #d1d5db)); }
.pp .copy-btn:hover, .pp .copy-btn:focus-visible { color: var(--pp-brand); border-color: var(--pp-brand); }
.pp .copy-flash { margin-left: 8px; font-size: 0.8rem; font-weight: 600; color: var(--pp-brand); }
.pp .copy-flash-fail { color: var(--pp-danger); }
/* the email / address text takes the line and wraps inside itself, so the copy icon stays on the same line (phone keeps its own wrap) */
.pp .pp-kv-v:has(> .copy-btn) > .pp-break, .pp .pp-kv-v:has(> .copy-btn) > a.pp-link { flex: 1 1 0; min-width: 0; }
.pp .pp-kv-v > .copy-btn { margin-left: 0; }
