* { box-sizing:border-box; }
body { margin:var(--zero); background:var(--c-ground); color:var(--c-ink); font-family:var(--font-ui); font-size:var(--text-base); line-height:var(--body-line); font-variant-numeric:tabular-nums; }
header, nav { background:var(--c-shell); color:var(--c-surface); padding:var(--s4) var(--s6); display:flex; gap:var(--s5); align-items:center; flex-wrap:wrap; }
header strong, h1, h2 { font-family:var(--font-heading); }
header strong, h2 { font-size:var(--text-xl); } h1 { font-size:var(--text-title); }
main { padding:var(--s5) var(--s6); display:grid; gap:var(--s5); }
footer { padding:var(--s5) var(--s6); color:var(--c-muted); font-size:var(--text-sm); }
button, input, select { font:inherit; color:var(--c-ink); background:var(--c-surface); border:var(--line) solid var(--c-rule); border-radius:var(--radius); padding:var(--s2) var(--s3); }
button { cursor:pointer; } button[aria-selected="true"], button[aria-pressed="true"] { background:var(--c-now-tint); color:var(--c-now-ink); }
:focus-visible { outline:var(--focus) solid var(--c-focus); outline-offset:var(--s1); }
::selection { background:var(--c-tint); color:var(--c-ink); }
* { scrollbar-color:var(--c-series-2) var(--c-ground); }
a { color:var(--c-link); } .range, form { display:flex; flex-wrap:wrap; gap:var(--s3); align-items:center; }
label { display:flex; gap:var(--s2); align-items:center; }
.card, dialog { background:var(--c-surface); border:var(--line) solid var(--c-rule); border-radius:var(--radius); padding:var(--s5); }
.card h2 { margin-top:var(--zero); } .notice { background:var(--c-now-tint); padding:var(--s4); }
table { width:var(--full); border-collapse:collapse; } th, td { padding:var(--s3); border-bottom:var(--line) solid var(--c-rule); text-align:left; }
.num { text-align:right; }
.muted, .footnotes { color:var(--c-muted); } .worse { color:var(--c-bad); }
.skeleton { background:var(--c-tint); padding:var(--s3); margin:var(--s2); }
.sr-only { position:absolute; left:var(--offscreen); width:var(--hidden); height:var(--hidden); overflow:hidden; }
dialog { width:var(--overlay-width); max-height:var(--overlay-height); box-shadow:var(--shadow); } dialog::backdrop { background:var(--c-shell-deep); }
.chart { width:var(--full); height:auto; } .attended { fill:var(--c-series); } .booked { fill:var(--c-surface); stroke:var(--c-series); } .consult { fill:var(--c-series-2); } .now { fill:var(--c-now-tint); } .average { stroke:var(--c-ink); stroke-dasharray:var(--s1) var(--s1); } .chart text { fill:var(--c-ink); font-size:var(--text-sm); }
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto; } }

body { font-size:var(--text-sm); }
header { min-height:var(--header-height); padding:var(--s2) var(--s5); gap:var(--s4); flex-wrap:nowrap; }
header strong { font-size:var(--text-lg); white-space:nowrap; }
.clinic { border-left:var(--line) solid var(--c-series-2); padding-left:var(--s4); }
.header-right { margin-left:auto; display:flex; gap:var(--s5); align-items:center; font-size:var(--text-xs); }
header button { background:var(--clear); color:var(--c-surface); border-color:var(--clear); padding:var(--zero); }
nav { height:var(--nav-height); padding:var(--zero) var(--s4); align-items:flex-end; }
[role="tablist"] { display:flex; height:var(--full); align-items:flex-end; }
[role="tab"] { height:var(--tab-height); background:var(--clear); color:var(--c-surface); border:var(--zero); border-top:var(--focus) solid var(--clear); border-radius:var(--radius) var(--radius) var(--zero) var(--zero); padding:var(--zero) var(--s4); }
[role="tab"][aria-selected="true"] { background:var(--c-ground); color:var(--c-ink); border-top-color:var(--c-now); }
main { padding:var(--zero) var(--s5); gap:var(--s3); }
h1 { font-size:var(--text-xl); margin:var(--zero); }
h2 { font-size:var(--text-lg); }
.heading-row { min-height:var(--heading-height); display:flex; align-items:center; gap:var(--s3); }
.heading-row h1 { margin-right:auto; }
.range { gap:var(--s3); }
.presets { display:flex; border:var(--line) solid var(--c-rule); border-radius:var(--radius); }
.presets button { border:var(--zero); border-left:var(--line) solid var(--c-rule); border-radius:var(--zero); height:var(--control-height); padding:var(--zero) var(--s3); font-size:var(--text-xs); }
.presets button:first-child { border-left:var(--zero); border-radius:var(--radius) var(--zero) var(--zero) var(--radius); }
.presets button:last-child { border-radius:var(--zero) var(--radius) var(--radius) var(--zero); }
.presets button[aria-pressed="true"] { background:var(--c-now); color:var(--c-ink); }
.range input { height:var(--control-height); padding:var(--zero) var(--s2); font-size:var(--text-xs); }
.card { padding:var(--s4); } .card p { margin:var(--zero); }
.primary { background:var(--c-shell); color:var(--c-surface); }
.sign-in { max-width:var(--signin-width); margin:var(--s6) auto; padding:var(--s5); background:var(--c-surface); border:var(--line) solid var(--c-rule); border-radius:var(--radius); }
.sign-in form, .sign-in label { display:flex; flex-direction:column; align-items:stretch; gap:var(--s2); }
.sign-in form { gap:var(--s4); } .sign-in button { width:var(--full); }

#app:has(.sign-in) { min-height:var(--viewport-height); display:grid; place-items:center; padding:var(--s5); }
.sign-in { width:var(--full); margin:var(--zero); }

.summary { display:grid; gap:var(--s4); }
.summary-alerts { display:flex; gap:var(--s5); flex-wrap:wrap; padding:var(--s3) var(--s4); background:var(--c-now-tint); border:var(--line) solid var(--c-rule); border-radius:var(--radius); }
.summary-top, .summary-lists { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(var(--full),calc(16 * var(--s6) + 1.5 * var(--s1))),1fr)); gap:var(--s4); }
.summary .card { min-width:var(--zero); overflow-x:auto; }
.summary .card h2 { margin-bottom:var(--s3); }
.summary th, .summary td { padding:var(--s2) var(--s3); }
.summary th button { border:var(--zero); padding:var(--zero); background:var(--clear); }
.summary td a { display:inline-block; }
.summary td a + a { display:block; font-size:var(--text-xs); }
.summary .footnotes, .summary-hours { font-size:var(--text-xs); color:var(--c-muted); }
.summary meter { display:block; width:var(--full); height:var(--s2); accent-color:var(--c-series); }
.summary-pace { color:var(--c-now-ink); background:var(--c-now-tint); padding:var(--s2); }
.summary .card > button { float:right; }

.summary-alerts { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--zero); background:var(--c-surface); padding:var(--zero); }
.alert-cell { display:flex; align-items:center; gap:var(--s2); padding:var(--s2) var(--s4); }
.alert-cell + .alert-cell { border-left:var(--line) solid var(--c-rule); }
.alert-cell b { font-family:var(--font-heading); font-size:var(--text-xl); }
.alert-cell a { margin-left:auto; white-space:nowrap; font-size:var(--text-xs); }
th { background:var(--c-tint); font-weight:normal; }
th button { font-weight:normal; }
.summary th, .summary td { padding:var(--s1) var(--s2); height:calc(var(--control-height) - var(--line) - var(--line)); white-space:nowrap; }
.figure-label { display:flex; align-items:baseline; white-space:nowrap; font-family:var(--font-heading); font-size:var(--text-sm); }
.figure-label small { margin-left:var(--s1); font-family:var(--font-ui); font-size:var(--text-xs); }
.card h2 { display:flex; align-items:center; gap:var(--s2); }
.expand { margin-left:auto; font-size:var(--text-xs); padding:var(--zero) var(--s1); border-color:var(--clear); background:var(--clear); font-family:var(--font-ui); font-weight:normal; }
.expand:hover, .expand:focus-visible { background:var(--c-tint); }
.show-all { color:var(--c-link); border:var(--zero); background:var(--clear); padding:var(--s2) var(--zero) var(--zero); text-decoration:underline; }
.worse { white-space:nowrap; }
.worse-tag, .tag { margin-left:var(--s1); border-radius:var(--radius); padding:var(--zero) var(--s1); font-size:var(--text-xs); }
.worse-tag { background:var(--c-bad-tint); }
.tag { background:var(--c-tint); }
.summary-hours { text-align:right; }
.summary meter { height:var(--s2); }
.summary .footnotes { margin-top:var(--s2); }
.gridline { stroke:var(--c-rule); }
.period-label.current { font-weight:bold; }
.chart-legend { display:flex; gap:var(--s3); font-size:var(--text-xs); color:var(--c-muted); flex-wrap:wrap; }
.chart-legend svg { margin-right:var(--s1); }
.chart-legend i { display:inline-block; width:var(--s3); height:var(--s3); margin-right:var(--s1); background:var(--c-series); }
.chart-legend .booked { background:var(--c-surface); border:var(--line) solid var(--c-series); }
.chart-legend .consult { background:var(--c-series-2); }
.chart-legend .average { height:var(--zero); background:var(--clear); border-top:var(--line) dashed var(--c-ink); }
.summary-pace { display:flex; align-items:center; gap:var(--s2); font-size:var(--text-xs); }
.status-tag { background:var(--c-shell); color:var(--c-surface); border-radius:var(--radius); padding:var(--s1); white-space:nowrap; }



thead th button { background:var(--clear); border:var(--zero); padding:var(--zero); font-weight:normal; }

th, td { padding:var(--s1) var(--s2); height:calc(var(--control-height) - var(--line) - var(--line)); }

.chart .now-label { fill:var(--c-now-ink); font-weight:bold; }

.summary-alerts { grid-template-columns:repeat(auto-fit,minmax(min(var(--full),calc(10 * var(--s6))),1fr)); }

.figure-label { display:block; white-space:normal; }
.figure-label sup { vertical-align:super; font-size:var(--text-xs); }
.figure-label small { display:inline-block; }
.summary-hours { white-space:normal; overflow-wrap:anywhere; }
.summary-hours meter { display:block; width:var(--full); height:var(--s2); }
.summary-hours span { display:block; }
.admin { display:grid; gap:var(--s4); }
.admin .card { min-width:var(--zero); overflow-x:auto; }
.admin-filters { display:flex; flex-wrap:wrap; gap:var(--s3); }
.admin .tag { display:inline-block; }
.admin .card h3 { font-size:var(--text-base); }

.admin .client-reference > span + span { display:block; font-size:var(--text-xs); }

.revenue { display:grid; gap:var(--s4); grid-template-columns:repeat(auto-fit,minmax(min(var(--full),calc(16 * var(--s6))),1fr)); }
.revenue .card { min-width:var(--zero); overflow-x:auto; }
.revenue .figures small { display:block; }
.revenue .footnotes { margin-top:var(--s3); font-size:var(--text-xs); }
.revenue meter { display:block; width:var(--full); height:var(--s2); accent-color:var(--c-series); }

.clients { display:grid; gap:var(--s4); grid-template-columns:repeat(auto-fit,minmax(min(var(--full),calc(16 * var(--s6))),1fr)); }
.clients .card { min-width:var(--zero); overflow-x:auto; }
.clients .client-bars { width:var(--full); height:var(--s4); display:block; }
.clients .client-bars rect { fill:var(--c-series); }
.clients .muted { margin-bottom:var(--s3); }

.clinicians { display:grid; gap:var(--s4); min-width:var(--zero); }
.clinicians .card { min-width:var(--zero); }
.clinicians-scroll { overflow-x:auto; }
.clinicians-table { table-layout:auto; }
.clinicians-table th, .clinicians-table td { padding:var(--s1); overflow-wrap:normal; word-break:normal; hyphens:none; }
.clinicians-table thead th { min-width:calc(2 * var(--s6)); }
.clinicians-table button { white-space:normal; padding:var(--zero); border:var(--zero); }
.clinicians-table thead th:nth-child(3), .clinicians-table thead th:last-child { min-width:calc(3 * var(--s6)); }
.clinicians-table th:first-child { width:calc(4 * var(--s6)); position:sticky; left:var(--zero); background:var(--c-surface); }
.clinicians-table thead th:first-child { background:var(--c-tint); }
.clinicians-table tfoot { font-weight:bold; }
.clinicians-table button { text-align:inherit; }
.clinicians-bars { list-style:none; padding:var(--zero); margin:var(--zero); display:grid; gap:var(--s3); }
.clinicians-bars li { display:grid; grid-template-columns:1fr 1fr; gap:var(--s1); }
.clinicians-bars li > span:nth-child(2) { text-align:right; }
.clinician-bar { grid-column:1 / -1; width:var(--full); height:var(--s4); }
.clinician-bar .offered { fill:var(--c-tint); }
.clinicians-table { min-width:var(--zero); }

.operations { display:grid; gap:var(--s4); grid-template-columns:repeat(auto-fit,minmax(min(var(--full),calc(16 * var(--s6))),1fr)); }
.operations .card { min-width:var(--zero); overflow-x:auto; }
.operations details, .operations .footnotes { margin-top:var(--s3); }
.heatmap { min-width:calc(20 * var(--s6)); }
.heatmap td { text-align:center; }
.heatmap-legend { display:flex; gap:var(--s2); align-items:center; flex-wrap:wrap; }
.heat-shade { padding:var(--s1) var(--s2); }
.heat-0 { background:var(--c-tint); color:var(--c-ink); }
.heat-1 { background:color-mix(in srgb,var(--c-tint) calc(var(--full) * .75),var(--c-series)); color:var(--c-ink); }
.heat-2 { background:color-mix(in srgb,var(--c-tint) calc(var(--full) * .5),var(--c-series)); color:var(--c-ink); }
.heat-3 { background:color-mix(in srgb,var(--c-tint) calc(var(--full) * .25),var(--c-series)); color:var(--c-surface); }
.heat-4 { background:var(--c-series); color:var(--c-surface); }

.retention { display:grid; gap:var(--s4); }
.retention .card { overflow-x:auto; }
.retention-cohorts td { text-align:right; font-variant-numeric:tabular-nums; }
.retention-bar { width:var(--full); height:var(--s2); display:block; }
.retention-bar rect { fill:var(--c-series); }

/* Shared side navigation and headline cards. */
.dashboard-shell { display:grid; grid-template-columns:var(--sidebar-width) minmax(var(--zero),1fr); min-height:var(--viewport-height); }
.side { background:var(--c-shell); color:var(--c-surface); padding:var(--s4) var(--s3); display:flex; flex-direction:column; gap:var(--s3); }
.brand { display:flex; align-items:center; gap:var(--s2); font-size:var(--text-base); }
.product-mark { background:var(--c-shell-deep); color:var(--c-now); padding:var(--s1) var(--s2); border-radius:var(--radius); }
.side .clinic { border-left:var(--zero); padding:var(--zero) var(--s1) var(--s3); border-bottom:var(--line) solid var(--c-series-2); margin:var(--zero); }
.side nav { display:block; height:auto; padding:var(--zero); }
.nav-links { display:flex; flex-direction:column; gap:var(--s1); }
.nav-links a { color:var(--c-surface); text-decoration:none; padding:var(--s2) var(--s3); border-left:var(--focus) solid var(--clear); border-radius:var(--radius); white-space:nowrap; }
.nav-links a[aria-current], .nav-links a:hover { background:var(--c-shell-deep); }
.nav-links a[aria-current] { border-left-color:var(--c-now); }
.user { margin-top:auto; border-top:var(--line) solid var(--c-series-2); padding-top:var(--s3); display:flex; flex-direction:column; gap:var(--s1); overflow-wrap:anywhere; }
.user button { background:var(--clear); color:var(--c-surface); text-align:left; }
.dashboard-shell main { min-width:var(--zero); padding:var(--s4) var(--s5); display:flex; flex-direction:column; gap:var(--s3); }
.heading-row { background:var(--clear); color:var(--c-ink); padding:var(--zero); flex-wrap:wrap; gap:var(--s3); }
.heading-row h1 { margin-right:var(--zero); font-size:var(--text-title); }
.collection-status { color:var(--c-muted); margin-right:auto; font-size:var(--text-xs); }
.heading-row .range { margin-left:auto; }
.dashboard-shell footer { padding:var(--zero); font-size:var(--text-xs); }
.summary-top { display:flex; flex-direction:column; gap:var(--s3); }
.headline { min-width:var(--zero); }
.figures { display:grid; width:var(--full); }
.figures .figure-card { display:flex; flex-direction:column; padding:var(--s2); min-width:var(--zero); }
.figures .figure-label { font-family:var(--font-heading); font-size:var(--text-base); }
.figures .figure-current { color:var(--c-shell); background:var(--clear); font-size:var(--text-xl); font-weight:bold; line-height:var(--body-line); }
.figure-current small { font-size:var(--text-xs); font-weight:normal; }
.figures .figure-line { color:var(--c-muted); font-size:var(--text-xs); }
.figure-line > :last-child { color:var(--c-ink); font-weight:bold; }
.figures .so-far { margin-top:auto; background:var(--c-now-tint); color:var(--c-now-ink); }
.figures .so-far > :last-child { color:var(--c-now-ink); }
.figures .bad { background:var(--c-bad-tint); color:var(--c-bad); }
.figures .bad > :last-child, .figures .worse { color:var(--c-bad); }
.footnotes { font-size:var(--text-xs); margin:var(--s1) var(--zero) var(--zero); }
.main-chart .chart { height:var(--chart-summary-height); display:block; }
.summary-lists { grid-template-columns:minmax(var(--zero),1.18fr) minmax(var(--zero),1fr); gap:var(--s3); }
.external-icon { width:var(--s3); height:var(--s3); margin-left:var(--s1); fill:none; stroke:currentColor; stroke-width:var(--line); }
.revenue .headline, .clients .headline, .operations .headline { grid-column:1 / -1; }
 .dashboard-shell { display:var(--shell-display); }
.side nav { overflow-x:auto; }
.nav-links { flex-direction:var(--nav-direction); }
.user { flex-direction:var(--user-direction); }
.summary-lists { grid-template-columns:var(--list-columns); }

.product-mark { width:var(--s6); height:var(--s6); padding:var(--s1); fill:none; stroke-width:var(--focus); }
.mark-bars { stroke:var(--c-surface); } .mark-now { stroke:var(--c-now); }
.figures .figure-label small { display:block; margin:var(--zero); font-family:var(--font-ui); font-size:var(--text-xs); font-weight:normal; line-height:calc(var(--text-xl) * var(--body-line)); }
.figures .has-window .figure-current { justify-content:flex-end; margin-top:calc(var(--zero) - var(--text-xl) * var(--body-line)); }

.headline-heading { font-size:var(--text-xs); color:var(--c-muted); margin:var(--zero) var(--zero) var(--s1); display:flex; align-items:center; }


/* Shared follow-up strip and compact Daily Admin grid. */
.alert-strip { display:flex; flex-wrap:wrap; gap:var(--zero); background:var(--c-surface); border:var(--line) solid var(--c-rule); border-radius:var(--radius); }
.alert-strip[hidden] { display:none; }
.alert-strip .alert-cell { flex:1 1 calc(var(--full) / 4); min-width:var(--zero); border:var(--line) solid var(--c-rule); }
/* Two compact tracks plus the shell, page padding and gap fit at the ticket breakpoint.
   The existing narrow-screen column token keeps the mobile shell stacked. */
.admin-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(var(--full),max(calc((var(--full) - var(--s3)) / 2),calc(13 * var(--s6) + var(--s2) + 2 * var(--line)),calc((4 - var(--card-columns)) * (13 * var(--s6) + var(--s2) + 2 * var(--line))))),1fr)); gap:var(--s3); align-items:start; }
.admin-wide { grid-column:1 / -1; min-width:var(--zero); }
.admin-billing { display:grid; gap:var(--s3); }
.admin .card h2 { margin-bottom:var(--s3); }
.admin-empty-sections, .admin-schedule-empty { margin:var(--zero); }

/* Approved chosen-summary component rules, after legacy tab/table rules. */
.side { color:var(--c-on-shell); padding:var(--side-top) var(--s3) var(--side-bottom); gap:var(--zero); }
.brand { gap:var(--tile-pad-y); padding:var(--zero) var(--side-inset) var(--side-top); }
.brand strong { color:var(--c-surface); font-size:var(--text-base); font-weight:var(--weight-semibold); }
.brand svg { flex:none; }
.side .clinic { padding:var(--zero) var(--side-inset) var(--side-bottom); margin-bottom:var(--s3); border-bottom-color:var(--c-shell-rule); }
.side nav { background:var(--clear); }
.side .nav-links { align-items:stretch; gap:var(--zero); }
.side .nav-links a { display:block; height:auto; text-align:left; color:var(--c-on-shell); background:var(--clear); font-size:var(--text-sm); font-weight:var(--weight-medium); border:var(--zero); padding:var(--s2) var(--s3); margin-bottom:var(--nav-gap); border-radius:var(--radius); }
.side .nav-links a:hover, .side .nav-links a[aria-current] { background:var(--c-shell-deep); color:var(--c-surface); text-decoration:none; }
.side .nav-links a[aria-current] { font-weight:var(--weight-bold); box-shadow:inset var(--focus) var(--zero) var(--c-now); }
.user { gap:var(--tile-pad-y); align-items:flex-start; padding:var(--s3) var(--side-inset) var(--zero); border-top-color:var(--c-shell-rule); }
.user strong { color:var(--c-surface); font-weight:var(--weight-semibold); }
.heading-row .presets { background:var(--c-surface); overflow:hidden; }
.heading-row .presets button { color:var(--c-ink); background:var(--c-surface); font-weight:var(--weight-medium); }
.heading-row .presets button:hover { background:var(--c-tint); }
.heading-row .presets button[aria-pressed="true"] { color:var(--c-ink); background:var(--c-now); font-weight:var(--weight-bold); }
.figures .figure-card { padding:var(--tile-pad-y) var(--tile-pad-x); white-space:nowrap; min-height:var(--tile-height); }
.figures .figure-card .figure-label,
.figures .figure-card h2 { display:block; white-space:normal; text-wrap:balance; overflow:visible; margin:var(--zero); font-size:var(--tile-title); line-height:var(--tile-line); font-weight:var(--weight-semibold); }
.figures .figure-card .figure-current, .figures .has-window .figure-current { margin:var(--zero); justify-content:space-between; align-items:baseline; font-size:var(--text-sm); font-weight:normal; line-height:var(--tile-number-line); background:var(--clear); }
.figures .figure-current > :last-child { margin-left:auto; font-size:var(--text-xl); letter-spacing:var(--tile-tracking); color:var(--c-shell); font-weight:var(--weight-semibold); text-align:right; }
.figures .figure-current small { font-size:var(--text-xs); color:var(--c-muted); }
.figures .figure-line { justify-content:space-between; color:var(--c-muted); line-height:var(--tile-line); }
.figures .figure-line > :last-child { font-weight:var(--weight-semibold); text-align:right; }
.figures .so-far, .figures .figure-line.bad { margin:auto calc(var(--zero) - var(--tile-run-pad)) var(--zero); padding:var(--zero) var(--tile-run-pad); border-radius:var(--radius); }
.figures .so-far { background:var(--c-now-tint); color:var(--c-now-ink); }
.figures .so-far > :last-child { color:var(--c-now-ink); font-weight:var(--weight-bold); }
.figures .figure-current.worse > :last-child { color:var(--c-bad); }
.figures .figure-line.bad { background:var(--c-bad-tint); color:var(--c-bad); }
.footnotes { white-space:nowrap; }
.main-chart .chart { width:var(--full); height:auto; display:block; }
.chart .bar-value, .chart .estimate-value, .chart .current-value { text-anchor:middle; paint-order:stroke; stroke:var(--c-surface); stroke-width:calc(2 * var(--s1)); stroke-linejoin:round; }
.summary-pace { display:block; background:var(--clear); color:var(--c-ink); padding:var(--zero); font-size:var(--text-sm); margin-top:var(--s2); }
.status-tag { display:inline-block; margin-right:var(--s2); padding:var(--zero) var(--s2); border-radius:var(--pill-radius); background:var(--c-now-tint); color:var(--c-now-ink); border:var(--line) solid var(--c-now); font-weight:var(--weight-bold); }
.list-heading { display:flex; align-items:center; gap:var(--s2); min-height:var(--list-heading-height); }
.summary .list-heading h2 { margin:var(--zero); font-size:var(--text-base); }
.count-pill { padding:var(--zero) var(--s2); border-radius:var(--pill-radius); background:var(--c-tint); font-weight:var(--weight-semibold); }
.list-more { margin-left:auto; color:var(--c-muted); font-size:var(--text-xs); white-space:nowrap; }

.user { flex-direction:row; align-items:center; }
.user i { flex:none; width:var(--tile-number-line); height:var(--tile-number-line); border-radius:var(--full); background:var(--c-now-tint); color:var(--c-ink); font-style:normal; font-weight:var(--weight-semibold); line-height:var(--tile-number-line); text-align:center; }
.user-details strong, .user-details span, .user-details button { display:block; }
.user-details { min-width:var(--zero); flex:1; }
.user-details strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.dashboard-shell main { padding:var(--s4) var(--main-inset) var(--zero); gap:var(--section-gap); }
.summary, .summary-top, .summary-lists { gap:var(--section-gap); }
.brand strong { line-height:var(--brand-line); }
.brand .product-mark { width:var(--mark-size); height:var(--mark-size); }

/* Use compact native UI faces for the sketch's dense, single-line figures. */
.headline { font-family:var(--font-figures); }

.list-heading .expand { margin-left:var(--zero); }

.figures.tiles { grid-template-columns:repeat(auto-fit,minmax(min(var(--full),calc(5 * var(--s6) + var(--s4) + var(--s1))),1fr)); gap:var(--s2); }
.summary .figures.tiles:has(> :nth-child(7)) { grid-template-columns:var(--summary-columns); }
.figures.tiles .figure-card { overflow:visible; }
.figures.tiles p { display:flex; justify-content:space-between; gap:var(--tile-gap); white-space:nowrap; font-size:var(--text-xs); }
.figures.tiles .figure-current { line-height:var(--tile-number-line); }
.figures.tiles .figure-current small { flex:none; }
.figures.tiles .figure-line { line-height:var(--tile-line); }
.figures.tiles .so-far, .figures.tiles .bad { margin-top:auto; }

.revenue, .clients, .operations, .retention, .clinicians { align-items:start; grid-template-columns:minmax(var(--zero),1fr); }
.retention > .headline, #clinicians-table { grid-column:1 / -1; }
.clinician-bar { height:var(--s3); }
meter::-webkit-meter-optimum-value { background:var(--c-series); }
meter::-moz-meter-bar { background:var(--c-series); }
.revenue, .clients, .operations, .retention, .clinicians { grid-template-columns:repeat(auto-fit,minmax(min(var(--full),max(calc((var(--full) - var(--s3)) / 2),calc(13 * var(--s6) + var(--s2) + 2 * var(--line)),calc((4 - var(--card-columns)) * (13 * var(--s6) + var(--s2) + 2 * var(--line))))),1fr)); }

details > .chart-data { position:static; width:auto; height:auto; overflow:visible; clip:auto; white-space:normal; }

.summary-lists { align-items:start; }

/* D-21: fixed shell and pixel-sized chart surfaces. */
.dashboard-shell { display:var(--shell-display); }
.side { box-sizing:border-box; width:var(--side-width); flex:none; height:var(--side-height); max-height:var(--viewport-height); position:sticky; top:var(--zero); overflow-y:auto; padding:var(--side-top) var(--s3) var(--side-bottom); }
.side > * { flex-shrink:var(--zero); }
.dashboard-shell main { box-sizing:border-box; width:var(--full); max-width:var(--page-max); }
.user { overflow-wrap:normal; }
.user-details span { color:var(--c-on-shell); white-space:nowrap; }
.user-details button { white-space:nowrap; }
.chart, .main-chart .chart { width:auto; height:auto; display:block; }
.chart text { font-size:var(--chart-label); }
.chart .tick-label { font-size:var(--chart-tick); }

/* Keep labels beside each bar, with a fixed gap between bar edges. */
.clinicians-bars { gap:var(--bar-gap); }
.clinicians-bars li { display:grid; grid-template-columns:minmax(var(--zero),1fr) minmax(var(--zero),2fr) minmax(var(--zero),2fr); align-items:center; height:var(--s3); gap:var(--s2); }
.clinicians-bars li > span { font-size:var(--chart-label); line-height:var(--s3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.clinicians-bars li > span:nth-child(2) { grid-column:3; grid-row:1; }
.clinician-bar { grid-column:2; grid-row:1; height:var(--s3); display:block; }

/* The main chart shares one heading row, as in the approved sketch. */
.summary .main-chart { padding:var(--s3) var(--s4); }
.summary .main-chart > h2 { float:left; margin:var(--zero) var(--s3) var(--zero) var(--zero); font-size:var(--text-base); }
.main-chart .chart-legend { min-height:var(--s5); align-items:center; justify-content:flex-end; }
.main-chart .chart { clear:both; }

/* D-23: keep tinted figures inside the card and let long list content grow. */
.figures.tiles .so-far { margin:auto var(--zero) var(--zero); padding:var(--zero); min-width:var(--zero); }
.figures.tiles .so-far > :first-child { min-width:var(--zero); white-space:normal; overflow-wrap:anywhere; }
.figures.tiles .so-far > :last-child { flex-shrink:var(--zero); white-space:nowrap; }
.summary-lists table { table-layout:fixed; }
.summary-lists th, .summary-lists td { white-space:normal; overflow-wrap:anywhere; overflow:visible; }
.summary-lists th button { white-space:normal; }

#retention-stops tbody td { height:auto; padding-top:calc(1.125 * var(--s1)); padding-bottom:calc(1.125 * var(--s1)); line-height:var(--s3); }
.retention-stack { display:block; width:var(--full); height:var(--s3); }
.retention-lapsed rect { fill:var(--c-shell); }
.retention-at_risk rect { fill:var(--c-now); }
.retention-active rect { fill:var(--c-tint); stroke:var(--c-rule); stroke-width:var(--line); }
.chart-legend .retention-lapsed { background:var(--c-shell); }
.chart-legend .retention-at_risk { background:var(--c-now); }
.chart-legend .retention-active { background:var(--c-tint); border:var(--line) solid var(--c-rule); }
.retention-segment-label { container-type:inline-size; height:var(--s3); text-align:center; font-size:var(--text-xs); line-height:var(--s3); color:var(--c-ink); }
.retention-lapsed .retention-segment-label { color:var(--c-surface); }
.retention-segment-label span { display:none; }
@container (min-width: 3ch) { .retention-segment-label span { display:inline; } }

#retention-stops tbody td:first-child { display:grid; grid-template-columns:var(--s6) minmax(var(--zero),1fr); gap:var(--s3); align-items:center; }

.users { display:grid; gap:var(--s3); }
.users-add { display:flex; flex-wrap:wrap; align-items:end; gap:var(--s2); }
.users-add label { display:grid; gap:var(--s1); }
.users .card { overflow-x:auto; }
.users td { overflow-wrap:anywhere; }
.users td button { margin-left:var(--s2); }
.users-message { display:block; color:var(--c-bad); }

.chart .estimate { fill:var(--c-surface); stroke:var(--c-shell); stroke-width:var(--line); }
.chart-legend .estimate { background:var(--c-surface); border:var(--line) solid var(--c-shell); }
.chart .estimate-value, .chart .current-value { fill:var(--c-now-ink); }
.status-tag.neutral { background:var(--c-ground); color:var(--c-muted); border-color:var(--c-rule); }

.chart .beside-value { text-anchor:end; }

.admin-rebook-heading { display:flex; align-items:center; flex-wrap:wrap; gap:var(--s3); margin-bottom:var(--s3); }
.admin .admin-rebook-heading h2 { margin:var(--zero); }

/* Measure colours stay inside each monthly chart, including its legend. */
[data-measure="revenue"] { --c-series:var(--c-revenue); }
[data-measure="sessions"] { --c-series:var(--c-sessions); }
[data-measure="clients"] { --c-series:var(--c-clients); }
[data-measure] .chart .consult { fill:color-mix(in srgb,var(--c-series),var(--c-surface) calc(var(--full) * .55)); }
[data-measure] .chart-legend .consult { background:color-mix(in srgb,var(--c-series),var(--c-surface) calc(var(--full) * .55)); }
[data-measure] .chart .estimate { stroke:var(--c-series); }
[data-measure] .chart-legend .estimate { border-color:var(--c-series); }

.chart-current-summary { font-size:var(--text-xs); }


.trends-spans, .trends-switch { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.trends-spans button[aria-pressed="true"], .trends-switch button[aria-pressed="true"] { background: var(--c-ink); color: var(--c-surface); }
.trends-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(var(--full), var(--signin-width)), 1fr)); gap: var(--s4); margin: var(--s5) var(--zero); }
.trends-section > h2 { grid-column: 1 / -1; margin: 0; }
.trends-card { min-width: 0; }
.trends-takeaway { color: var(--c-ink); }

.cat-trend-1 { fill:var(--c-trend-1); background:var(--c-trend-1); }
.cat-trend-2 { fill:var(--c-trend-2); background:var(--c-trend-2); }
.cat-trend-3 { fill:var(--c-trend-3); background:var(--c-trend-3); }
.cat-trend-4 { fill:var(--c-trend-4); background:var(--c-trend-4); }
.cat-trend-other { fill:var(--c-trend-other); background:var(--c-trend-other); }
.trend-stroke { fill:none; }
.trend-stroke.cat-trend-1 { stroke:var(--c-trend-1); }
.trend-stroke.cat-trend-2 { stroke:var(--c-trend-2); }
.trend-stroke.cat-trend-3 { stroke:var(--c-trend-3); }
.trend-stroke.cat-trend-4 { stroke:var(--c-trend-4); }
.trend-previous { opacity:.5; }
#trends-comparison rect.cat-trend-2.trend-previous { fill:var(--c-trend-1); }
.trends-card svg[aria-label="Values by month and year"] { width:var(--full); }
.trends-referral-row { display:flex; align-items:center; gap:var(--s2); margin:var(--s2) 0; }
.trends-row-label { flex:0 0 calc(var(--s4) * 5); font-size:var(--text-xs); }
.trends-referral-bar { display:flex; gap:calc(var(--s1) / 2); flex:1; min-width:0; height:var(--mark-size); }
.trends-segment.cat-trend-3, .trends-segment.cat-trend-other { color:var(--c-ink); }
.trends-segment { flex-basis:0; min-width:0; overflow:hidden; white-space:nowrap; color:var(--c-surface); text-align:center; font-size:var(--text-xs); line-height:var(--mark-size); }
.trends-segment span { display:inline-block; }
.trends-capacity-row { display:grid; grid-template-columns:minmax(calc(var(--s4) * 5.625), 1fr) minmax(calc(var(--s4) * 5), 2fr) auto; align-items:center; gap:var(--s2); margin:var(--s3) 0; }
.trends-capacity-bars { height:calc(var(--s4) * 2.25); display:flex; gap:calc(var(--s1) / 2); align-items:end; }
.trends-capacity-bar { flex:1; background:var(--c-trend-1); min-width:0; }

.capacity-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(var(--full), calc(var(--s4) * 12)),1fr)); gap:var(--s3); margin:var(--s3) 0 var(--s4); }
.capacity-tile { padding:var(--s3); border:var(--line) solid var(--c-rule); border-radius:var(--s2); }
.capacity-tile h3, .capacity-tile p { margin:0 0 var(--s1); }
.capacity-tile strong { font-size:var(--text-title); }
.capacity-legend, .capacity-sort { display:flex; flex-wrap:wrap; gap:var(--s3); margin:var(--s3) 0; }
.capacity-legend span { display:flex; align-items:center; gap:var(--s1); }
.capacity-legend i { width:var(--s3); height:var(--s3); display:inline-block; }
.capacity-legend .capacity-line-key { height:0; border-top:calc(var(--line) * 2) dashed currentColor; }
.capacity-sort button[aria-pressed="true"] { font-weight:700; outline:calc(var(--line) * 2) solid currentColor; }
.capacity-scroll { overflow-x:auto; }
.capacity-table { width:var(--full); min-width:calc(var(--s4) * 53); }
.capacity-table th, .capacity-table td { padding:var(--s2); text-align:left; }
.capacity-table small { display:block; }
.capacity-bars { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:calc(var(--s1) / 2) var(--s2); min-width:calc(var(--s4) * 16); }
.capacity-month { font-size:var(--text-xs); line-height:1; }
.capacity-bar { position:relative; display:flex; height:calc(var(--s1) * 2.5); gap:calc(var(--s1) / 2); }
.capacity-segment { display:block; flex-shrink:0; }
.capacity-threshold { position:absolute; z-index:1; top:calc(var(--s1) * -0.5); bottom:calc(var(--s1) * -0.5); border-left:var(--line) dashed currentColor; }
.capacity-chip { display:inline-block; padding:calc(var(--s1) / 2) var(--s2); border:var(--line) solid currentColor; border-radius:var(--s4); }

.view-as-select { display:grid; min-width:var(--zero); gap:var(--s1); margin-top:var(--s3); padding:var(--zero) var(--side-inset); font-size:var(--text-sm); }
.view-as-select select { width:var(--full); min-width:var(--zero); }
.view-as-strip { background:var(--c-now-tint); padding:var(--s2) var(--s3); margin-bottom:var(--s3); }
.view-as-strip button { margin-left:var(--s1); }

.benchmark-card { overflow-x:auto; }
.benchmark-card table { width:var(--full); }
.benchmark-card th, .benchmark-card td { white-space:normal; }
.benchmark-switch { display:flex; align-items:center; gap:var(--s2); }

/* Keep Summary content within the phone viewport. */
@media (max-width:calc(700 * 1in / 96)) {
  .summary .figures.tiles p { flex-wrap:wrap; white-space:normal; }
  .summary .footnotes { white-space:normal; }
  .summary .alert-cell a { min-width:var(--zero); white-space:normal; overflow-wrap:anywhere; }
}
@media (max-width:calc(599 * 1in / 96)) {
  .summary .figures.tiles:has(> :nth-child(7)) { grid-template-columns:minmax(var(--zero),1fr); }
}
@media (max-width:calc(599 * 1in / 96)) {
  /* Preset labels wrap on phones; let the buttons grow instead of clipping the second line. */
  .presets button { height:auto; min-height:var(--control-height); padding:var(--s1) var(--s2); }
}

.demo-strip { display:flex; flex-wrap:wrap; align-items:center; gap:var(--s2) var(--s3); padding:var(--s2) var(--s3); margin-bottom:var(--s3); background:var(--c-tint); border-radius:var(--radius); }
.demo-strip form { display:flex; flex-wrap:wrap; align-items:end; gap:var(--s2); min-width:0; }
.demo-strip label { display:grid; gap:var(--s1); }
.demo-strip input { max-width:var(--full); }
.demo-status { flex-basis:var(--full); margin:var(--zero); }
.demo-status:empty { display:none; }
@media (max-width:calc(599 * 1in / 96)) { .demo-strip form { flex-basis:var(--full); } }

.collection-log { margin-top: var(--s4); }
.collection-log summary { cursor: pointer; }
.collection-table { max-width: var(--full); overflow-x: auto; }
.collection-table table { min-width: calc(18 * var(--s6)); }

.connect-chrome { margin: var(--s4) var(--zero); padding: var(--s4); border: var(--line) solid var(--c-rule); border-radius: var(--s2); }
.connect-chrome li { margin: var(--s3) var(--zero); }
.activation-code { display: inline-block; font-size: var(--text-title); margin: var(--s3); overflow-wrap: anywhere; }
.setup-strip { display: block; padding: var(--s3) var(--s4); background: var(--c-tint); color: var(--c-shell); }

.sign-in [hidden] { display: none; }
