:root { --retention-max: 880px; }
html { min-height: 100%; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { min-height: 100vh; min-height: 100svh; padding-bottom: 78px; overflow-x: hidden; }
.retention-hero { min-height: 191px; padding: calc(12px + env(safe-area-inset-top)) 20px 26px; }
.retention-hero::before { bottom: -29px; height: 33px; }
.retention-hero .dusk-disc { right: max(26px, calc((100vw - var(--retention-max)) / 2 + 26px)); top: 72px; width: 34px; height: 34px; box-shadow: 0 0 28px rgba(242,181,126,.72); }
.retention-hero-inner { position: relative; z-index: 4; width: 100%; max-width: var(--retention-max); margin: 0 auto; }
.retention-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.retention-wordmark { color: var(--sky-ink); font: 600 16px/1 'Source Serif 4',serif; letter-spacing: .115em; text-transform: uppercase; white-space: nowrap; }
.retention-topline > div:first-child p { max-width: 270px; margin-top: 8px; color: rgba(248,238,231,.9); font-size: 11px; }
.retention-actions { display: flex; align-items: center; gap: 8px; }
.retention-icon-button,.retention-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; color: var(--sky-ink); background: rgba(255,255,255,.08); }
.retention-icon-button .material-symbols-rounded { font-size: 18px; font-variation-settings: 'FILL' 0,'wght' 350; }
.retention-avatar { overflow: hidden; padding: 2px; border-color: rgba(255,255,255,.62); background: #fff8f0; box-shadow: 0 0 0 2px rgba(231,161,120,.34); }
.retention-avatar img { width: 100%; height: 100%; display: block; object-fit: contain; transform: scale(.88); }
.retention-hero-copy { margin-top: 11px; padding-right: 45px; }
.retention-admin-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: rgba(255,241,231,.92); background: rgba(255,255,255,.11); font-size: 9px; font-weight: 600; }
.retention-admin-badge .material-symbols-rounded { font-size: 12px; }
.retention-admin-badge .filled { font-variation-settings: 'FILL' 1,'wght' 400; }
.retention-hero h1 { margin-top: 12px; color: var(--sky-ink); font: 600 29px/1.02 'Source Serif 4',serif; letter-spacing: -.025em; }
.retention-hero-copy > p { margin-top: 8px; color: rgba(248,238,231,.9); font-size: 10.5px; line-height: 1.35; }
.retention-hero-copy .retention-trust { display: flex; align-items: center; gap: 7px; }
.retention-trust .material-symbols-rounded { font-size: 14px; }
.retention-tabs {
  position: relative;
  z-index: 7;
  width: calc(100% - 40px);
  max-width: 600px;
  height: 40px;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 3px;
  margin: 10px auto 0;
  padding: 5px;
  border: 1px solid var(--dusk-line);
  border-radius: 999px;
  background: rgba(255,250,245,.98);
  box-shadow: 0 12px 28px -25px rgba(58,45,39,.55);
}
.retention-tabs button { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 7px; border: 0; border-radius: 999px; color: #947a6b; background: transparent; font-size: 10px; font-weight: 600; }
.retention-tabs button[aria-disabled="true"] { cursor: default; }
.retention-tabs .material-symbols-rounded { font-size: 16px; }
.retention-tabs button.active { color: var(--dusk-pill-text); background: var(--dusk-pill); }

.retention-main { width: 100%; max-width: var(--retention-max); margin: 0 auto; padding: 14px 18px 44px; }
[data-retention-panel][hidden] { display: none; }
[data-retention-panel="progress"] { padding-bottom: 26px; }
[data-retention-panel="cohorts"] { padding-bottom: 26px; }
.retention-metric-card,
.retention-glance-card,
.retention-functional-card,
.retention-takeaways-card,
.retention-sync-note { border: 1px solid var(--dusk-line); background: var(--dusk-card-2); box-shadow: 0 12px 30px -28px rgba(58,45,39,.45); }
.retention-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.retention-metric-card { min-width: 0; min-height: 90px; display: flex; flex-direction: column; align-items: center; padding: 8px 6px; border-radius: 14px; text-align: center; }
.retention-metric-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; }
.retention-metric-icon .material-symbols-rounded { font-size: 18px; }
.retention-metric-card.green .retention-metric-icon { color: #60885b; background: rgba(101,137,92,.13); }
.retention-metric-card.blue .retention-metric-icon { color: #5f83ab; background: rgba(97,132,171,.13); }
.retention-metric-card.purple .retention-metric-icon { color: #705aa0; background: rgba(123,104,170,.13); }
.retention-metric-card.amber .retention-metric-icon { color: #e37b23; background: rgba(224,124,42,.13); }
.retention-metric-card.neutral .retention-metric-icon { color: #6f5aa2; background: rgba(123,104,170,.13); }
.retention-metric-card h2 { min-height: 18px; display: flex; align-items: center; margin-top: 6px; color: var(--dusk-ink); font-size: 7px; line-height: 1.15; letter-spacing: .08em; text-transform: uppercase; }
.retention-metric-card strong { margin-top: 4px; font: 500 22px/1 'Source Serif 4',serif; }
.retention-metric-card.green strong { color: #60885b; }
.retention-metric-card.blue strong { color: #5f83ab; }
.retention-metric-card.purple strong { color: #705aa0; }
.retention-metric-card.amber strong { color: #df781f; }
.retention-metric-card.neutral strong { color: var(--dusk-ink); }

.retention-section-title { margin: 14px 2px 6px; color: var(--dusk-ink); font: 600 13px/1 'Source Serif 4',serif; }
.retention-glance-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.retention-glance-card { min-width: 0; min-height: 132px; padding: 9px 10px 7px; border-radius: 13px; }
.retention-glance-card h3 { color: var(--dusk-ink); font: 600 11px/1 'Source Serif 4',serif; }
.comparison-head { display: grid; grid-template-columns: minmax(0,1fr) 64px 58px; align-items: center; margin-top: 7px; color: var(--dusk-copy); font-size: 6.7px; text-align: right; }
.comparison-head strong:first-of-type { color: #735fa4; }
.comparison-head strong:last-child { color: #9b7b68; }
.comparison-list > div { min-height: 29px; display: grid; grid-template-columns: minmax(0,1fr) 64px 58px; align-items: center; border-top: 1px solid var(--dusk-line); }
.comparison-list > div:first-child { border-top: 0; }
.comparison-list dt { display: flex; align-items: center; gap: 6px; color: var(--dusk-copy); font-size: 7px; }
.comparison-list dd { color: var(--dusk-ink); font: 600 12px/1 'Source Serif 4',serif; text-align: right; }
.comparison-list dd.purple { color: #735fa4; }
.comparison-list dd.amber { color: #df7216; }
.signal-icon { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; }
.signal-icon .material-symbols-rounded { font-size: 12px; }
.signal-icon.green { color: #62885c; background: rgba(101,137,92,.13); }
.signal-icon.blue { color: #5f83ab; background: rgba(97,132,171,.13); }
.signal-icon.purple { color: #705aa0; background: rgba(123,104,170,.13); }
.signal-icon.amber { color: #e37b23; background: rgba(224,124,42,.13); }
.signal-list { margin-top: 7px; }
.signal-list > div { min-height: 26px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; border-top: 1px solid var(--dusk-line); }
.signal-list > div:first-child { border-top: 0; }
.signal-list dt { display: flex; align-items: center; gap: 8px; color: var(--dusk-copy); font-size: 7.4px; }
.signal-list dd { color: var(--dusk-ink); font: 600 12px/1 'Source Serif 4',serif; }

.functional-heading { margin-top: 13px; }
.retention-functional-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.retention-functional-card { min-width: 0; min-height: 98px; padding: 8px 7px; border-radius: 13px; }
.retention-functional-card header { display: grid; grid-template-columns: 27px minmax(0,1fr); align-items: start; gap: 6px; }
.retention-functional-card .functional-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; }
.retention-functional-card .functional-icon .material-symbols-rounded { font-size: 16px; }
.retention-functional-card .filled { font-variation-settings: 'FILL' 1,'wght' 400; }
.retention-functional-card.purple .functional-icon { color: #745ea3; background: rgba(123,104,170,.13); }
.retention-functional-card.green .functional-icon { color: #62885c; background: rgba(101,137,92,.13); }
.retention-functional-card.blue .functional-icon { color: #5f83ab; background: rgba(97,132,171,.13); }
.retention-functional-card.amber .functional-icon { color: #e37b23; background: rgba(224,124,42,.13); }
.retention-functional-card header span:last-child { min-width: 0; display: flex; flex-direction: column; }
.retention-functional-card header strong { color: var(--dusk-ink); font: 500 7.8px/1.15 'Source Serif 4',serif; }
.retention-functional-card header small { margin-top: 3px; font-size: 6.7px; font-weight: 700; }
.retention-functional-card > b { display: block; margin-top: 8px; text-align: center; font: 500 16px/1 'Source Serif 4',serif; }
.retention-functional-card > p { margin-top: 8px; color: var(--dusk-ink); font-size: 7px; text-align: center; }
.retention-functional-card.purple small,.retention-functional-card.purple > b { color: #745ea3; }
.retention-functional-card.green small,.retention-functional-card.green > b { color: #62885c; }
.retention-functional-card.blue small,.retention-functional-card.blue > b { color: #5f83ab; }
.retention-functional-card.amber small,.retention-functional-card.amber > b { color: #e37b23; }
.retention-functional-note { margin-top: 6px; color: var(--dusk-muted); font-size: 7.5px; text-align: center; }

.takeaways-heading { margin-top: 11px; }
.retention-takeaways-card { padding: 3px 10px; border-radius: 13px; }
.retention-takeaways-card ul { list-style: none; }
.retention-takeaways-card li { min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid var(--dusk-line); color: var(--dusk-copy); font-size: 8.5px; line-height: 1.25; }
.retention-takeaways-card li:first-child { border-top: 0; }
.takeaway-icon { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; }
.takeaway-icon .material-symbols-rounded { font-size: 18px; }
.takeaway-icon.purple { color: #745ea3; background: rgba(123,104,170,.13); }
.takeaway-icon.green { color: #62885c; background: rgba(101,137,92,.13); }
.takeaway-icon.amber { color: #e37b23; background: rgba(224,124,42,.13); }
.retention-sync-note { min-height: 30px; display: flex; align-items: center; gap: 9px; margin-top: 8px; padding: 6px 12px; border-color: rgba(123,104,170,.2); border-radius: 10px; color: #65577b; background: rgba(123,104,170,.08); font-size: 8.5px; }
.retention-sync-note .material-symbols-rounded { color: #765fa4; font-size: 18px; }
.retention-sync-note .filled { font-variation-settings: 'FILL' 1,'wght' 400; }

/* Retention progress */
.retention-progress-card,
.retention-caseload-card { border: 1px solid var(--dusk-line); border-radius: 14px; background: var(--dusk-card-2); box-shadow: 0 12px 30px -28px rgba(58,45,39,.45); }
.progress-client-title { margin-top: 14px; }
.retention-progress-card { padding: 10px; }
.retention-progress-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,.82fr); gap: 10px; }
.retention-improvement-chart { min-width: 0; padding-right: 10px; border-right: 1px solid var(--dusk-line); }
.retention-improvement-chart h3,
.retention-review-queue h3,
.retention-caseload-card > h2 { color: var(--dusk-ink); font: 600 12px/1 'Source Serif 4',serif; }
.retention-review-queue h3 { font-size: 11px; white-space: nowrap; }
#retention-progress-chart { width: 100%; height: 188px; display: block; margin-top: 5px; }
.retention-chart-legend { display: flex; justify-content: space-around; gap: 9px; margin: 4px 3px 0 28px; color: var(--dusk-ink); font-size: 8px; }
.retention-chart-legend span { display: flex; align-items: center; gap: 4px; }
.retention-chart-legend i { width: 15px; height: 2px; display: block; border-radius: 3px; }
.retention-chart-legend .blue i { background: #5b83b6; }
.retention-chart-legend .green i { background: #6e8e55; }
.retention-chart-legend .purple i { background: #7c5bb8; }
.retention-chart-legend .amber i { background: #ef7417; }
.retention-review-queue { min-width: 0; }
.retention-review-queue ul { margin-top: 7px; list-style: none; }
.retention-review-queue li { min-height: 49px; display: grid; grid-template-columns: 31px minmax(0,1fr); align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--dusk-line); }
.retention-review-queue li:first-child { border-top: 0; }
.retention-client-initial { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 600; }
.retention-client-initial.purple { color: #7656b1; background: rgba(123,104,170,.14); }
.retention-client-initial.blue { color: #547ca9; background: rgba(97,132,171,.14); }
.retention-client-initial.green { color: #62885c; background: rgba(101,137,92,.14); }
.retention-client-initial.amber { color: #eb6e12; background: rgba(224,124,42,.14); }
.retention-review-queue li > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.retention-review-queue strong { color: var(--dusk-ink); font-size: 8.2px; font-weight: 600; }
.retention-review-queue small { margin-top: 2px; color: var(--dusk-copy); font-size: 6.8px; line-height: 1.25; }

.retention-caseload-card { margin-top: 9px; padding: 11px 14px 9px; }
.retention-caseload-grid { display: grid; grid-template-columns: 152px minmax(0,1fr); align-items: center; gap: 18px; margin-top: 8px; }
.retention-donut { position: relative; width: 132px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: conic-gradient(#8063b6 0 38%,#7c915c 38% 67%,#ed7c1c 67% 88%,#5a85b7 88% 100%); }
.retention-donut::after { content: ''; position: absolute; inset: 34%; border-radius: 50%; background: var(--dusk-card-2); box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.retention-donut > span { position: absolute; z-index: 1; color: #fff; font-size: 10px; }
.retention-donut .eri { top: 28%; right: 11%; }
.retention-donut .asi { right: 31%; bottom: 10%; }
.retention-donut .bsi { left: 9%; bottom: 31%; }
.retention-donut .csfi { top: 10%; left: 28%; }
.retention-caseload-list > div { min-height: 34px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; border-top: 1px solid var(--dusk-line); }
.retention-caseload-list > div:first-child { border-top: 0; }
.retention-caseload-list dt { display: flex; align-items: center; gap: 10px; color: var(--dusk-ink); font-size: 8.5px; }
.retention-caseload-list dt i { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; }
.retention-caseload-list dt i.purple { background: #8063b6; }
.retention-caseload-list dt i.green { background: #7c915c; }
.retention-caseload-list dt i.amber { background: #ed7c1c; }
.retention-caseload-list dt i.blue { background: #5a85b7; }
.retention-caseload-list dd { color: var(--dusk-ink); font: 600 13px/1 'Source Serif 4',serif; }
.retention-caseload-note { min-height: 36px; display: flex; align-items: center; gap: 9px; margin-top: 6px; padding: 6px 8px; border-radius: 8px; color: #554b6a; background: rgba(123,104,170,.08); font-size: 7.5px; line-height: 1.3; }
.retention-caseload-note .material-symbols-rounded { color: #806aad; font-size: 16px; }
.retention-caseload-note .filled { font-variation-settings: 'FILL' 1,'wght' 400; }

/* Retention cohorts */
.retention-cohort-metrics .retention-metric-card { min-height: 105px; padding-top: 10px; }
.retention-cohort-metrics .retention-metric-card h2 { min-height: 24px; margin-top: 7px; }
.retention-cohort-metrics .retention-metric-card strong { min-height: 24px; display: flex; align-items: baseline; justify-content: center; gap: 4px; white-space: nowrap; }
.retention-cohort-metrics .retention-metric-card strong span { font: inherit; }
.retention-cohort-metrics .retention-metric-card strong small { color: var(--dusk-copy); font: 500 8px/1 'Albert Sans',sans-serif; }
.retention-cohort-metrics .retention-metric-card strong .purple { color: #7453b5; }
.retention-cohort-metrics .retention-metric-card strong .blue { color: #4f7fb5; }
.retention-cohort-metrics .retention-metric-card strong .amber { color: #ef6812; }
.retention-cohort-metrics .retention-metric-card strong .comparison { color: #93664f; }
.retention-cohort-pair { display: grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); gap: 9px; margin-top: 11px; }
.retention-cohort-card,
.retention-cohort-insight,
.retention-cohort-note { border: 1px solid var(--dusk-line); background: var(--dusk-card-2); box-shadow: 0 12px 30px -28px rgba(58,45,39,.45); }
.retention-cohort-card { min-width: 0; min-height: 288px; padding: 11px 10px 8px; border-radius: 14px; }
.retention-cohort-card > h2,
.retention-cohort-insight h2 { color: var(--dusk-ink); font: 600 12px/1.08 'Source Serif 4',serif; }
.retention-cohort-comparison > p { min-height: 35px; margin-top: 7px; color: var(--dusk-copy); font-size: 8px; line-height: 1.35; }
.cohort-table-head { min-height: 25px; display: grid; grid-template-columns: minmax(0,1fr) 57px 55px; align-items: end; gap: 4px; color: var(--dusk-copy); font-size: 6.8px; text-align: center; }
.cohort-table-head strong:first-of-type { color: #7453b5; }
.cohort-table-head strong:last-of-type { color: #93664f; }
.cohort-table > div { min-height: 28px; display: grid; grid-template-columns: minmax(0,1fr) 57px 55px; align-items: center; gap: 4px; border-top: 1px solid var(--dusk-line); }
.cohort-table dt { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--dusk-copy); font-size: 7px; line-height: 1.15; }
.cohort-table .signal-icon { width: 20px; height: 20px; border-radius: 7px; }
.cohort-table .signal-icon .material-symbols-rounded { font-size: 12px; }
.cohort-table dd { color: var(--dusk-ink); font: 600 11.5px/1 'Source Serif 4',serif; text-align: center; white-space: nowrap; }
.cohort-table dd.purple { color: #7453b5; }
.cohort-table dd.amber { color: #ef6812; }
.cohort-table dd.comparison { color: #93664f; }
.retention-over-time-card { display: flex; flex-direction: column; }
.retention-cohort-legend { display: flex; justify-content: center; gap: 17px; margin-top: 11px; color: var(--dusk-copy); font-size: 7.5px; }
.retention-cohort-legend span { display: flex; align-items: center; gap: 6px; }
.retention-cohort-legend i { width: 19px; height: 3px; display: block; border-radius: 4px; }
.retention-cohort-legend .engaged i { background: #7453b5; }
.retention-cohort-legend .comparison i { background: #93664f; }
#retention-cohort-chart { width: 100%; height: 228px; display: block; margin-top: 2px; }
.retention-cohort-insight { min-height: 68px; display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 12px; margin-top: 10px; padding: 10px 18px; border-radius: 14px; }
.cohort-insight-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #7453b5; background: rgba(123,104,170,.13); }
.cohort-insight-icon .material-symbols-rounded { font-size: 23px; }
.retention-cohort-insight p { margin-top: 4px; color: var(--dusk-copy); font-size: 9px; line-height: 1.35; }
.retention-cohort-note { min-height: 42px; display: flex; align-items: center; gap: 11px; margin-top: 8px; padding: 7px 13px; border-color: rgba(123,104,170,.2); border-radius: 10px; color: #65577b; background: rgba(123,104,170,.08); font-size: 8px; line-height: 1.35; }
.retention-cohort-note .material-symbols-rounded { flex: 0 0 auto; color: #765fa4; font-size: 19px; }
.retention-cohort-note .filled { font-variation-settings: 'FILL' 1,'wght' 400; }

.retention-dock { position: fixed; z-index: 70; left: 50%; bottom: calc(9px + env(safe-area-inset-bottom)); width: calc(100% - 22px); max-width: 618px; min-height: 47px; display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; padding: 5px; border: 1px solid var(--dusk-line); border-radius: 999px; background: rgba(255,252,248,.96); box-shadow: 0 13px 34px -18px rgba(58,45,39,.45); transform: translateX(-50%); backdrop-filter: blur(12px); }
.retention-dock a { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border-radius: 999px; color: #9a7f70; font-size: 10.5px; font-weight: 700; text-decoration: none; }
.retention-dock > span { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border-radius: 999px; color: #9a7f70; font-size: 10.5px; font-weight: 700; }
.retention-dock .retention-dock-disabled { opacity: .46; cursor: not-allowed; }
.retention-dock .material-symbols-rounded { font-size: 17px; }
.retention-dock .active { color: var(--dusk-pill-text); background: var(--dusk-pill); }
.retention-dock .active .material-symbols-rounded { color: var(--dusk-pill-icon); font-variation-settings: 'FILL' 1,'wght' 450; }

.retention-unavailable-main { padding-top: 26px; }
.retention-unavailable-card,
.retention-safety-note { border: 1px solid var(--dusk-line); background: var(--dusk-card-2); box-shadow: 0 18px 42px -34px rgba(58,45,39,.5); }
.retention-unavailable-card { padding: 34px; border-radius: 24px; text-align: center; }
.retention-unavailable-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 22px; color: #745ca7; background: rgba(116,92,167,.12); }
.retention-unavailable-icon .material-symbols-rounded { font-size: 34px; }
.retention-unavailable-eyebrow { margin: 0 0 7px; color: #806ba0; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.retention-unavailable-card h2 { margin: 0; color: var(--dusk-ink); font: 600 29px/1.12 'Source Serif 4',serif; }
.retention-unavailable-copy { max-width: 650px; margin: 12px auto 0; color: var(--dusk-copy); font-size: 12px; line-height: 1.6; }
.retention-unavailable-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 26px; text-align: left; }
.retention-unavailable-grid > div { min-width: 0; padding: 15px; border: 1px solid var(--dusk-line); border-radius: 16px; background: rgba(116,92,167,.045); }
.retention-unavailable-grid .material-symbols-rounded { display: block; margin-bottom: 9px; color: #806ba0; font-size: 21px; }
.retention-unavailable-grid strong,.retention-unavailable-grid small { display: block; }
.retention-unavailable-grid strong { color: var(--dusk-ink); font-size: 11px; }
.retention-unavailable-grid small { margin-top: 4px; color: var(--dusk-muted); font-size: 9px; line-height: 1.35; }
.retention-unavailable-actions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 26px; }
.retention-unavailable-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; font-size: 10px; font-weight: 700; text-decoration: none; }
.retention-primary-action { color: var(--dusk-pill-text); background: var(--dusk-pill); }
.retention-secondary-action { color: var(--dusk-ink); border: 1px solid var(--dusk-line); background: transparent; }
.retention-safety-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 16px 18px; border-radius: 17px; }
.retention-safety-note > .material-symbols-rounded { color: #68855f; font-size: 22px; }
.retention-safety-note p { margin: 0; color: var(--dusk-copy); font-size: 10px; line-height: 1.5; }
.retention-safety-note strong,.retention-safety-note span { display: block; }
.retention-safety-note strong { margin-bottom: 3px; color: var(--dusk-ink); font-size: 11px; }
html.dark .retention-tabs,
html.dark .retention-metric-card,
html.dark .retention-glance-card,
html.dark .retention-functional-card,
html.dark .retention-takeaways-card,
html.dark .retention-sync-note,
html.dark .retention-progress-card,
html.dark .retention-caseload-card,
html.dark .retention-cohort-card,
html.dark .retention-cohort-insight,
html.dark .retention-cohort-note,
html.dark .retention-dock { background: rgba(33,30,44,.95); }
html.dark .retention-unavailable-card,
html.dark .retention-safety-note { background: rgba(33,30,44,.95); }
.retention-reveal { animation: retentionReveal .52s cubic-bezier(.22,1,.36,1) var(--retention-delay,0ms) both; }
@keyframes retentionReveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width:419px) {
  .retention-hero { min-height: 204px; padding-inline: 16px; }
  .retention-wordmark { font-size: 14px; }
  .retention-topline > div:first-child p { max-width: 200px; font-size: 9.5px; }
  .retention-icon-button,.retention-avatar { width: 32px; height: 32px; }
  .retention-hero-copy { padding-right: 28px; }
  .retention-hero h1 { font-size: 27px; }
  .retention-hero-copy > p { font-size: 9.5px; }
  .retention-main { padding-inline: 12px; }
  .retention-tabs { width: calc(100% - 22px); }
  .retention-tabs button { gap: 4px; padding-inline: 3px; font-size: 9px; }
  .retention-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .retention-glance-grid { grid-template-columns: 1fr; }
  .retention-functional-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .retention-progress-grid { grid-template-columns: 1fr; }
  .retention-improvement-chart { padding-right: 0; padding-bottom: 10px; border-right: 0; border-bottom: 1px solid var(--dusk-line); }
  .retention-caseload-grid { grid-template-columns: 1fr; }
  .retention-cohort-pair { grid-template-columns: 1fr; }
  .retention-cohort-card { min-height: auto; }
  #retention-cohort-chart { height: 240px; }
  .retention-dock a { gap: 4px; padding-inline: 5px; font-size: 9px; }
  .retention-dock > span { gap: 4px; padding-inline: 5px; font-size: 9px; }
  .retention-unavailable-card { padding: 24px 16px; border-radius: 20px; }
  .retention-unavailable-card h2 { font-size: 24px; }
  .retention-unavailable-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .retention-unavailable-actions { flex-direction: column; }
  .retention-unavailable-actions a { width: 100%; }
}

@media (prefers-reduced-motion:reduce) {
  .retention-reveal { animation: none !important; }
}

/* Wide desktop: same 1160px shell as the rest of the practice admin app. */
@media (min-width: 1000px) {
  :root { --retention-max: 1160px; }

  /* The dock is a phone pattern: pinned to the bottom of the viewport, it
     floats over the content and is the first thing anything else on screen
     covers. On a desktop it belongs in the page, under the UI it navigates, which is what the clinician workspace does when it swaps its hotbar
     for inline tabs above 820px. */
  /* Back on the viewport, because each admin page is its own document:
     in flow the dock landed at a different height on every tab, so the
     nav you just clicked jumped hundreds of pixels. Lifted clear of the
     preview banner rather than hidden behind it. */
  .retention-dock {
    position: fixed;
    bottom: calc(16px + var(--ed-preview-banner-h, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: min(618px, 100%);
    box-shadow: 0 10px 28px -20px rgba(58,45,39,.45);
  }

  /* One hero height across the four admin pages. They are separate
     documents, so an uneven hero moves the whole page down as you
     switch tabs and the change reads as a glitch. */
  /* One hero across the four admin pages: same height and the same
     type. Home was running a 38px h1 and an 18px wordmark against
     29px and 16px everywhere else, so the banner visibly changed
     weight as you moved between tabs. */
  .retention-hero { min-height: 172px; padding-bottom: 26px; }
  .retention-hero h1 { font-size: 29px; line-height: 1.08; }
  .retention-wordmark { font-size: 16px; }

  /* The dock floats over the page, so the last card needs room to
     scroll out from under it, banner included. */
  .retention-main { padding-bottom: calc(104px + var(--ed-preview-banner-h, 0px)); }

  /* Density pass so the page fits a laptop screen. */
  .retention-main { padding-bottom: calc(72px + var(--ed-preview-banner-h, 0px)); }
}
