/* Charts and chart cards (ERP-style, 10 Oct 2026), shared by the Overview, the patient Progress tab and the Reports
   centre: KPI cards with change and sparkline, chart cards, agenda timeline.
   Chart colours are deeper steps of the brand colours (Marigold, Sky Blue, Meadow Mint, Warm Peach) so bars and
   slices keep contrast on white; every chart also has its numbers in text. */
.dashboard-main { max-width: 1800px; width: 100%; margin: auto; }
/* Chart grids follow the room they have (the side menu may be hidden), not the window width. Only the board is a
   size container: a container also holds position:fixed boxes (the search results), so never put it on the page. */
.chart-board { container: board / inline-size; }
.dash-heading h1 { font-size: 34px; }
.dash-heading p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.dash-heading .page-actions .button { min-height: 40px; }
.local-chip { background: var(--soft-mint); margin: 0; align-self: center; }

/* The app gives every svg a currentColor stroke (for line icons); charts draw with fills, so they start with none. */
.column-chart svg, .donut, .donut-legend svg, .hbar-track, .funnel svg, .sparkline { stroke: none; }

/* KPI cards */
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 0 0 22px; }  /* 7 in one row on a wide screen, none left alone (UI-1) */
.kpi-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 18px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); box-shadow: inset 0 3px 0 var(--tone, var(--line)), 0 1px 2px #3d3d3d0a; transition: box-shadow .15s, transform .15s; }
a.kpi-card:hover { box-shadow: inset 0 3px 0 var(--tone, var(--line)), 0 8px 24px #3d3d3d14; transform: translateY(-1px); }
.kpi-value { font-variant-numeric: tabular-nums; }
.kpi-head { display: flex; align-items: center; gap: 10px; }
.kpi-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; }
.kpi-icon svg { width: 18px; height: 18px; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kpi-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi-value { font: 700 30px/1.1 Baloo, sans-serif; letter-spacing: -.3px; }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kpi-foot small { font-size: 11px; color: var(--muted); }
/* Past sessions not marked: the card's centre popup (templates/operations/sessions_not_marked.html, static/not-marked.js). */
.nm-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0 12px; background: var(--paper); }
.nm-find { flex: 1 1 240px; min-width: 0; }
.nm [hidden] { display: none !important; }  /* .button would show "Save anyway" before a warning */
.nm-all { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; }
.nm-all input, .nm-row input[type=checkbox] { width: 18px; height: 18px; min-height: 0; margin: 0; flex: 0 0 auto; }
.nm-ticked { font-size: 13px; color: var(--muted); }
.nm-reason { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--peach); border-radius: 12px; background: var(--soft-peach); }
.nm-reason p { margin: 0 0 8px; }
.nm-reason-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nm-reason-row input { flex: 1 1 220px; min-width: 0; }
.nm-message { margin: 0 0 10px; font-weight: 700; color: var(--mint-ink); }
.nm-message.is-error { color: var(--peach-ink); }
.nm-day { margin: 0 0 16px; }
.nm-day h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; font-size: 17px; }
.nm-day h2 small, .nm-day h2 a { font: 700 13px Nunito, sans-serif; color: var(--muted); }
.nm-day h2 a { margin-left: auto; }
.nm-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.nm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-top: 1px solid var(--line); }
.nm-row:first-child { border-top: 0; }
.nm-time { width: 72px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nm-who { display: grid; flex: 1 1 180px; min-width: 0; }
.nm-who small { font-size: 12.5px; color: var(--muted); }
.nm-state { font-size: 13px; font-weight: 700; }
.nm-row[data-mark=present] { background: var(--soft-mint); } .nm-row[data-mark=present] .nm-state { color: var(--mint-ink); }
.nm-row[data-mark=absent] { background: var(--soft-peach); } .nm-row[data-mark=absent] .nm-state { color: var(--peach-ink); }
.nm-actions { display: flex; gap: 6px; }
.nm-actions [aria-pressed=true] { box-shadow: inset 0 0 0 2px currentColor; }
.kpi-change { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: #f1efe8; color: #5f5b52; }
.kpi-change.up { background: #e6f1e9; color: var(--mint-ink); }
.kpi-change.down { background: var(--soft-peach); color: var(--peach-ink); }
.sparkline { width: 100%; height: 34px; display: block; margin-top: 4px; }
.spark-area { stroke: none; opacity: .18; }
.spark-line { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-note { font-size: 10px; color: var(--muted); }
.kpi-card.tone-yellow { --tone: var(--yellow); } .kpi-card.tone-mint { --tone: var(--mint); } .kpi-card.tone-peach { --tone: var(--peach); } .kpi-card.tone-blue { --tone: var(--blue); }
.tone-yellow .kpi-icon { background: var(--soft-yellow); } .tone-yellow .kpi-icon svg, .tone-yellow .spark-line { stroke: #c08414; } .tone-yellow .spark-area { fill: #c08414; }
.tone-mint .kpi-icon { background: var(--soft-mint); } .tone-mint .kpi-icon svg, .tone-mint .spark-line { stroke: #3d8a59; } .tone-mint .spark-area { fill: #4fa36b; }
.tone-peach .kpi-icon { background: var(--soft-peach); } .tone-peach .kpi-icon svg, .tone-peach .spark-line { stroke: #b5482a; } .tone-peach .spark-area { fill: #b5482a; }
.tone-blue .kpi-icon { background: var(--soft-blue); } .tone-blue .kpi-icon svg, .tone-blue .spark-line { stroke: #2f82b0; } .tone-blue .spark-area { fill: #2f82b0; }

/* Chart cards */
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0 0 20px; }
.dash-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.dash-card { container-type: inline-size; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; min-width: 0; box-shadow: 0 1px 2px #3d3d3d0a; }
.dash-card.span-2 { grid-column: span 2; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.card-head h2 { font-size: 19px; margin-top: 2px; }
.card-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-head a { font-size: 12px; font-weight: 700; white-space: nowrap; text-underline-offset: 4px; }
.card-note { font-size: 11px; color: var(--muted); margin-top: 12px; }
.chart-empty { font-size: 13px; color: var(--muted); padding: 30px 0; text-align: center; background: #fbfaf6; border-radius: 10px; }
.column-chart { margin: 0; }
.column-chart > svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: #efece3; stroke-width: 1; }
.chart-table summary { font-size: 12px; color: var(--muted); }
.chart-table .records-table-wrap { margin-top: 8px; max-height: 260px; overflow: auto; }
.chart-table .records-table th, .chart-table .records-table td { padding: 7px 12px; font-size: 12px; }

/* Series and status colours */
.series-a { fill: #c08414; } .series-b { fill: #2f82b0; }
.st-present { fill: #4fa36b; stroke: #4fa36b; } .st-absent { fill: #b5482a; stroke: #b5482a; }
.st-booked { fill: #8fb8cb; stroke: #8fb8cb; } .st-cancelled { fill: #cfcabd; stroke: #cfcabd; }
.cat-1 { fill: #c08414; stroke: #c08414; } .cat-2 { fill: #2f82b0; stroke: #2f82b0; } .cat-3 { fill: #4fa36b; stroke: #4fa36b; }
.cat-4 { fill: #b5482a; stroke: #b5482a; } .cat-5 { fill: #8b62b8; stroke: #8b62b8; } .cat-6 { fill: #9a958a; stroke: #9a958a; }
.st-assess { fill: #8cc29e; stroke: #8cc29e; }
.donut-part.st-present, .donut-part.st-absent, .donut-part.st-booked, .donut-part.st-cancelled, .donut-part.st-assess,
.donut-part[class*="cat-"] { fill: none; }

/* Donut */
.donut-chart { margin: 0; }
.donut-wrap { display: grid; grid-template-columns: minmax(104px, 140px) minmax(0, 1fr); gap: 16px; align-items: center; }
.donut { width: 100%; height: auto; display: block; }
.donut-ring { stroke: #f1efe8; }
.donut-value { font: 700 7.5px Baloo, sans-serif; fill: var(--ink); }
.donut-caption { font: 700 3px Nunito, sans-serif; fill: var(--muted); letter-spacing: .2px; }
.donut-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.donut-legend li { display: grid; grid-template-columns: 10px minmax(56px, 1fr) auto 32px; align-items: center; gap: 6px; font-size: 12px; }
.donut-legend svg { width: 10px; height: 10px; }
.donut-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend small { color: var(--muted); text-align: right; }
@container (max-width: 330px) {
  .donut-wrap { grid-template-columns: minmax(0, 1fr); }
  .donut { max-width: 150px; margin: 0 auto; }
}

/* Horizontal bars (ageing, therapist load) */
.hbar-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 11px; }
.hbar-list li { display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.hbar-label small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.hbar-track { width: 100%; height: 10px; display: block; }
.hbar-list strong { font-size: 12px; text-align: right; white-space: nowrap; }
.hbar-list strong small { font-weight: 400; color: var(--muted); }
.fill-ok { fill: #8fb8cb; } .fill-late { fill: #d9653f; } .fill-load { fill: #4fa36b; }

/* Funnel */
.funnel { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 10px; }
.funnel-text { display: flex; align-items: baseline; gap: 8px; font-size: 12px; margin-bottom: 3px; }
.funnel-text strong { margin-left: auto; font-size: 14px; }
.funnel-text small { color: var(--muted); min-width: 32px; text-align: right; }
.funnel svg { width: 100%; height: 22px; display: block; }
.funnel-bar.step-1 { fill: #cfe2ea; } .funnel-bar.step-2 { fill: #8fb8cb; } .funnel-bar.step-3 { fill: #4f93b5; } .funnel-bar.step-4 { fill: #2e7daa; }

/* Heatmap */
.heatmap-wrap { position: relative; overflow-x: auto; }  /* relative: its hidden cell labels stay inside on a phone (UI-1) */
.heatmap { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 460px; font-size: 11px; }
.heatmap th { font-weight: 700; color: var(--muted); padding: 0 4px; text-align: center; }
.heatmap tbody th { text-align: left; width: 40px; }
.heatmap td { height: 34px; border-radius: 6px; text-align: center; font-weight: 700; color: #5f5b52; }
.heat-0 { background: #f6f4ee; } .heat-1 { background: #fcf3dd; } .heat-2 { background: #f7dfa3; }
.heat-3 { background: #f0c463; } .heat-4 { background: #c08414; color: #fff !important; } .heat-5 { background: #8f6410; color: #fff !important; }
.heatmap-scale { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: 10px; color: var(--muted); margin-top: 8px; }
.heatmap-scale i { width: 16px; height: 10px; border-radius: 3px; display: inline-block; }
.heatmap-scale span { margin: 0 4px; }

/* Today's sessions timeline */
.agenda-line { list-style: none; padding: 0; margin: 4px 0 0; }
.agenda-line li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 0 11px 12px; border-bottom: 1px solid var(--line); border-left: 3px solid #8fb8cb; }
.agenda-line li.state-present { border-left-color: #3f8f5a; } .agenda-line li.state-absent { border-left-color: #d0704f; }
.agenda-when strong { display: block; font-size: 14px; } .agenda-when small { font-size: 11px; color: var(--muted); }
.agenda-what a { font-weight: 700; font-size: 14px; }
.agenda-what p { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 12px; background: var(--soft-blue); }
.status-pill.present { background: #e6f1e9; color: var(--mint-ink); } .status-pill.absent { background: var(--soft-peach); color: var(--peach-ink); }
.dash-card .attention-list { margin-top: 4px; }

/* Empty state, departments, footer (kept from the earlier overview) */
.dashboard-empty { text-align: center; padding: 26px 20px 10px; }
.empty-calendar { display: inline-grid; place-items: center; background: var(--soft-yellow); width: 50px; height: 50px; border-radius: 14px; font-size: 30px; margin-bottom: 14px; }
.dashboard-empty p { font-size: 13px; color: #706c62; max-width: 380px; margin: 10px auto 20px; }
.dashboard-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 10px; color: #706c62; padding: 28px 0 0; }
.department-section { margin: 8px 0 20px; }
.department-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 6px; }
.department-card { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--yellow); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.department-card:nth-child(5n+2) { border-top-color: var(--peach); }
.department-card:nth-child(5n+3) { border-top-color: var(--mint); }
.department-card:nth-child(5n+4) { border-top-color: var(--blue); }
.department-card p { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: #706c62; }
.department-card p strong { font: 700 22px/1.1 Baloo, sans-serif; color: var(--ink); }
.department-card a { margin-top: auto; font-size: 12px; font-weight: 700; text-underline-offset: 4px; }
.not-connected { margin-bottom: 8px; }
.not-connected h2 { font-size: 17px; } .not-connected p { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* Grid columns follow the room the page has (the side menu may be hidden), not the window width. */
@container board (max-width: 1050px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container board (max-width: 700px) {
  .dash-grid, .dash-grid.two { grid-template-columns: minmax(0, 1fr); }
  .dash-card.span-2 { grid-column: auto; }
}
@media (max-width: 800px) {
  .dashboard-main { padding: 0 16px 24px; }
  .dash-heading { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dash-heading h1 { font-size: 28px; }
  .dash-card { padding: 16px; }
  .card-head { flex-wrap: wrap; }
  .kpi-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 24px; }
  .skip-link { left: 10px; }
}
@media (max-width: 420px) {
  .kpi-cards { grid-template-columns: minmax(0, 1fr); }
  .donut-wrap { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
  .hbar-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar-list .hbar-track { grid-column: 1 / -1; grid-row: 2; }
}
@container (max-width: 500px) {
  .column-chart .chart-axis { font-size: 17px; }
}

/* ERP pages (10 Oct 2026): mini figures, patient tabs + progress, discharge, calendar, waitlist, reports, notifications */
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 18px; }
.mini-stats > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.mini-stats strong { display: block; font: 700 24px/1.1 Baloo, sans-serif; }
.mini-stats span { font-size: 11px; font-weight: 700; color: var(--muted); }
.main-content .child-bar { top: 74px; }
.child-bar .child-bar-out { margin-left: 0; background: #fbfaf6; color: #5f5b52; }
.child-bar .child-bar-out:first-of-type { margin-left: auto; }
.tab-panel[hidden] { display: none; }
.achieved-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.achieved-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.achieved-list li:last-child { border-bottom: 0; }
.achieved-mark { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 50%; background: #e3f1e7; color: #2f6f45; font-weight: 700; font-size: 13px; }
.achieved-list strong { display: block; font-size: 14px; }
.achieved-list small { color: var(--muted); font-size: 11px; }
.discharge-card { border-left: 4px solid #d0704f; }
.discharge-card form { margin: 0; }
.discharge-form summary { cursor: pointer; }
.discharge-form summary small { color: var(--muted); }
.discharge-form form { margin-top: 14px; display: grid; gap: 12px; }
.discharge-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.check-line { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.check-line input { width: 18px; height: 18px; }
.block-note { display: block; color: var(--muted); font-size: 11px; }
.status-pill.priority-high { background: #fbe5dc; color: #a2482a; }
.status-pill.priority-normal { background: var(--soft-yellow); }
.status-pill.priority-low { background: #f1efe8; color: #5f5b52; }
.status-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; grid-template-columns: none; }
.status-tabs .button { min-height: 36px; font-size: 13px; padding: 6px 12px; }
.status-tabs .button[aria-current=page] { background: var(--hl); border-color: var(--hl-line); box-shadow: inset 0 0 0 1px var(--hl-line); }

/* Calendar */
.calendar-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 12px; }
.calendar-nav { display: flex; align-items: center; gap: 6px; }
.calendar-nav .button { min-height: 36px; padding: 6px 14px; }
.calendar-legend { display: flex; align-items: center; gap: 5px; margin-left: auto; font-size: 11px; color: var(--muted); }
.calendar-legend i { width: 16px; height: 10px; border-radius: 3px; display: inline-block; }
.calendar-wrap { background: #fff; }
.calendar-week, .calendar-month { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.calendar-week th, .calendar-week td, .calendar-month th, .calendar-month td { border: 1px solid var(--line); vertical-align: top; }
.calendar-week thead th, .calendar-month thead th { background: #fdfcf8; padding: 8px 6px; text-align: left; font-size: 12px; }
.calendar-week thead th a { font-weight: 700; text-decoration: none; }
.calendar-week thead th small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.calendar-week .cal-time { width: 62px; text-align: center; color: var(--muted); font-weight: 700; background: #fdfcf8; }
.calendar-week td { height: 40px; padding: 3px; }
.calendar-week:not(.detail) td { text-align: center; vertical-align: middle; font-weight: 700; }
.calendar-week:not(.detail) td a { display: block; text-decoration: none; padding: 8px 0; }
.calendar-week th.is-today { background: var(--soft-yellow); }
.calendar-week.detail { min-width: 760px; }
.cal-chip { display: block; margin: 0 0 3px; padding: 4px 6px; border-radius: 6px; border-left: 3px solid #8fb8cb; background: var(--soft-blue); text-decoration: none; font-size: 11px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip small { display: block; color: var(--muted); font-size: 10px; }
.cal-chip.present { background: #e3f1e7; border-left-color: #3f8f5a; }
.cal-chip.absent { background: #fbe5dc; border-left-color: #d0704f; }
.cal-chip.cancelled { background: #f4f2ec; border-left-color: #cfcabd; text-decoration: line-through; color: var(--muted); }
.calendar-legend .cal-chip { display: inline-block; margin: 0; }
.calendar-month td { height: 92px; padding: 0; }
.calendar-month td a { display: flex; flex-direction: column; height: 100%; padding: 6px 8px; text-decoration: none; gap: 2px; }
.calendar-month td strong { font: 700 20px/1.1 Baloo, sans-serif; margin-top: auto; }
.calendar-month td small { font-size: 10px; color: #5f5b52; }
.calendar-month td.heat-4 small, .calendar-month td.heat-5 small { color: #fff; }
.calendar-month .cal-day { font-weight: 700; font-size: 12px; }
.calendar-month .cal-holiday { color: #a2482a !important; font-weight: 700; }
.calendar-month td.out-month { opacity: .45; }
.calendar-month td.is-today { box-shadow: inset 0 0 0 2px var(--accent); }

/* Reports centre and notifications */
.report-grid, .notification-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.notification-groups { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
.report-card { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 14px; text-decoration: none; transition: box-shadow .15s; }
.report-card:nth-child(4n+2) { border-top-color: var(--mint); } .report-card:nth-child(4n+3) { border-top-color: var(--yellow); } .report-card:nth-child(4n+4) { border-top-color: var(--peach); }
.report-card:hover { box-shadow: 0 8px 24px #3d3d3d14; }
.report-card h2 { font-size: 19px; }
.report-card p { font-size: 13px; color: var(--muted); }
.report-card span { margin-top: auto; font-size: 12px; font-weight: 700; }
.report-chart { margin-bottom: 14px; }
.report-chart .hbar-list li { grid-template-columns: minmax(120px, 30%) minmax(0, 1fr) auto; }
.report-more { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 20px 0; font-size: 13px; font-weight: 700; }
.top-bell { position: relative; }
.notify-badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #c0623f; color: #fff; font: 700 10px/19px Nunito, sans-serif; text-align: center; }
.notify-badge[hidden] { display: none; }
@media (max-width: 800px) {
  .main-content .child-bar { top: 0; }
  .calendar-legend { margin-left: 0; }
  .calendar-month td { height: 70px; }
  .calendar-month td strong { font-size: 16px; }
}
/* Links to a tab or a section land below the sticky top bar and child bar. */
.tab-panel, .tab-panel [id] { scroll-margin-top: 150px; }
.discharge-form .button { justify-self: start; }
@media (max-width: 800px) {
  .child-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .child-bar a, .child-bar strong { flex: 0 0 auto; white-space: nowrap; }
  .child-bar .child-bar-out:first-of-type { margin-left: 0; }
  .tab-panel, .tab-panel [id] { scroll-margin-top: 70px; }
}
@media (max-width: 480px) {
  .calendar-month td small:not(.cal-holiday) { display: none; }
  .calendar-month td { height: 58px; }
}

/* Sessions hub tabs (clinic/navigation.py SESSION_HUB) and "Children who fit here" on the day grid */
.hub-tabs { margin: 18px 0 4px; }
.hub-main { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.hub-main a { padding: 10px 16px; border-radius: 10px 10px 0 0; font-weight: 700; font-size: 14px; text-decoration: none; color: #6e6a60; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.hub-main a:hover { color: var(--ink); background: #fbfaf6; }
.hub-main a[aria-current=page] { color: var(--ink); background: #fff; border-color: var(--line); box-shadow: inset 0 3px 0 var(--accent); }
.hub-sub { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 0; }
.hub-sub a { padding: 5px 12px; border-radius: 16px; font-size: 12px; font-weight: 700; text-decoration: none; background: #fff; border: 1px solid var(--line); color: #5f5b52; }
.hub-sub a[aria-current=page] { background: var(--soft-yellow); border-color: var(--yellow); color: var(--ink); }
.hub-tabs + .page-heading { margin-top: 18px; }
.fits { margin: 4px 0 18px; padding: 14px; border: 1px solid var(--yellow); border-radius: 14px; background: #fffaf0; }
.fits-head h3 { font-size: 18px; margin: 2px 0; }
.fits-head p { font-size: 12px; }
.fits-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; max-height: 340px; overflow-y: auto; }
.fit-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.fit-who { flex: 1; min-width: 0; }
.fit-who strong { display: block; font-size: 14px; }
.fit-who small { color: var(--muted); font-size: 11px; }
.fit-reasons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fit-reason { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 9px; background: var(--soft-mint); color: #2f6f45; }
.fit-card .button.compact { min-height: 34px; padding: 6px 14px; margin: 0; }
.fits-or { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 11px; color: var(--muted); }
.fits-or::before, .fits-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
@media (max-width: 800px) {
  .hub-main { flex-wrap: nowrap; overflow-x: auto; }
  .hub-main a { white-space: nowrap; padding: 8px 12px; }
}

/* Day grid header (11 Oct 2026): title + one-line help, actions in one row, compact stat strip, tidy toolbar */
.grid-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 18px 0 16px; }
.grid-title h1 { font-size: 34px; }
.grid-help { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.grid-help li { position: relative; padding-left: 12px; }
.grid-help li::before { content: ""; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.grid-help strong { color: var(--ink); }
.action-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.action-bar .button { min-height: 40px; padding: 8px 16px; margin: 0; font-size: 14px; }
.grid-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.grid-stats > div { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.grid-stats strong { display: block; font: 700 22px/1.1 Baloo, sans-serif; }
.grid-stats small { font-size: 11px; font-weight: 700; color: var(--muted); }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; }
.stat-icon svg { width: 18px; height: 18px; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.grid-stats .tone-yellow .stat-icon { background: var(--soft-yellow); } .grid-stats .tone-yellow svg { stroke: #c08414; }
.grid-stats .tone-blue .stat-icon { background: var(--soft-blue); } .grid-stats .tone-blue svg { stroke: #2e7daa; }
.grid-stats .tone-peach .stat-icon { background: #fbece5; } .grid-stats .tone-peach svg { stroke: #c0623f; }
.grid-stats .tone-mint .stat-icon { background: var(--soft-mint); } .grid-stats .tone-mint svg { stroke: #3f8f5a; }
.schedule-workspace .workspace-heading { padding: 16px 20px 12px; }
.schedule-workspace .workspace-heading h2 { font-size: 20px; }
.schedule-workspace .toolbar { padding: 10px 20px; background: #fdfcf8; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.schedule-workspace .toolbar .icon-button, .schedule-workspace .toolbar .button, .schedule-workspace .toolbar input { min-height: 36px; }
@media (max-width: 1100px) {
  .grid-header { flex-direction: column; align-items: flex-start; }
  .action-bar { justify-content: flex-start; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1101px) {
  .grid-title { min-width: 0; flex: 1 1 auto; }
  .action-bar { flex: 0 0 auto; flex-wrap: nowrap; }
}

/* Sessions dashboard (11 Oct 2026): quick links, period chips, day-by-day break-up */
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.quick-links a { padding: 7px 14px; border-radius: 18px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 700; text-decoration: none; }
.quick-links a:hover { background: var(--soft-yellow); border-color: var(--yellow); }
.dash-filters .records-filters { flex-wrap: wrap; }
.dash-filters .records-filters > div { min-width: 150px; }
.period-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.period-chips a { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: #f4f2ec; text-decoration: none; }
.period-chips a:hover { background: var(--soft-yellow); }
.chart-board > .dash-card { margin-bottom: 20px; }
.breakup-card { margin-bottom: 14px; }
.breakup-table th, .breakup-table td { padding: 8px 10px; font-size: 13px; white-space: nowrap; text-align: right; }
.breakup-table thead th:first-child, .breakup-table tbody th { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; }
.breakup-table thead th:first-child { background: var(--head); }
.breakup-table .records-table-wrap { max-height: 520px; }
.breakup-card .records-table-wrap { max-height: 520px; overflow: auto; }

/* Older automatic sessions still waiting for the removed approval step (before 13 Oct 2026) are dashed on the grid */
.grid-appointment.awaiting { border-style: dashed; border-color: #b7811c; background-image: repeating-linear-gradient(135deg, transparent 0 6px, #fcf3dd 6px 12px); }
.grid-appointment.awaiting::after { content: "Not shown yet"; display: block; margin-top: 2px; font: 700 9px Nunito, sans-serif; color: #8a5f12; letter-spacing: .3px; }
.chip.awaiting-chip { background: var(--soft-yellow); color: #8a5f12; }
/* A session's weekly slot with its standby children, priority 1 / 2 / 3 (Day grid, 13 Oct 2026). */
.slot-priority { margin: 10px 0; padding: 10px 12px; border: 1px solid #E9E6DC; border-radius: 12px; background: #FFFCF4; }
.slot-priority-title { display: block; font-size: .8rem; letter-spacing: .02em; margin-bottom: 6px; }
.slot-priority-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.slot-priority-list li { display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; align-items: center; }
.slot-priority-list li.is-here .slot-priority-name { font-weight: 700; }
.slot-priority-rank { grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: #F0C463; color: #3D3D3D; font-weight: 700; font-size: .8rem; }
.slot-priority-list li:not(.is-here) .slot-priority-rank { background: #EFEDE6; }
.slot-priority-today { color: #6b6b6b; font-size: .78rem; }

/* Leads workspace (LEADS-1, 12 Oct 2026): tabs, smart views, filters, bulk bar, table, board, lead page */
.lead-tabs { margin: 0 0 16px; }
.lead-filters .lead-filter-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; align-items: end; }
.lead-filters .lead-filter-row > div { min-width: 0; }
.lead-filters .lead-filter-row > .lead-search { grid-column: span 2; }
@media (max-width: 480px) { .lead-filters .lead-filter-row > .lead-search { grid-column: 1 / -1; } }
.more-filters { margin-top: 12px; }
.more-filters > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: #5f5b52; }
.more-filters[open] > summary { margin-bottom: 4px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0 !important; }
.filter-chips a { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 14px; background: var(--soft-yellow); border: 1px solid #f0dfae; text-decoration: none; color: var(--ink); }
.filter-chips a:hover { background: #f8e7b8; }
.filter-chips a.clear-chips { background: #fff; border-color: var(--line); color: #5f5b52; }

.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; margin: 0 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.bulk-bar.has-ticks { background: var(--soft-yellow); border-color: var(--yellow); position: sticky; top: 8px; z-index: 6; box-shadow: 0 6px 20px #3d3d3d14; }
.bulk-bar select, .bulk-bar input { width: auto; min-height: 38px; padding: 6px 10px; font-size: 13px; }
.bulk-bar [hidden] { display: none; }
.bulk-count { font-size: 13px; margin-right: 4px; }
.bulk-help { color: var(--muted); flex-basis: 100%; }

.lead-table td { vertical-align: top; }
.lead-table th, .lead-table td { padding: 11px 12px; }
.lead-table .tick { width: 34px; padding-right: 0; }
.lead-table .tick input { min-height: 18px; width: 18px; height: 18px; margin-top: 2px; }
.lead-name { font-size: 15px; }
.lead-cell { min-width: 230px; }
.lead-concern { color: #5f5b52 !important; font-style: italic; }
.missing-note { display: block; margin-top: 3px; font-size: 11px; font-weight: 700; color: #8a5f12; }
.lead-table tr.is-overdue { background: #fff8f4; }
.lead-table tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 #d0704f; }
.row-actions { white-space: nowrap; font-size: 13px; }
.empty-cell { text-align: center; padding: 28px !important; color: var(--muted); }

.stage-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; background: #f1efe8; color: #4f4b43; }
.stage-pill.stage-new { background: #e4eff5; color: #1f5f86; }
.stage-pill.stage-contacted { background: var(--soft-yellow); color: #7a5410; }
.stage-pill.stage-follow_up { background: #f8e7bd; color: #6b4c0c; }
.stage-pill.stage-assessment { background: #e3f1e7; color: #2f6f45; }
.stage-pill.stage-converted { background: #cfe8d7; color: #1f5a35; }
.stage-pill.stage-lost { background: #efedea; color: #6b675e; }
.stage-pill.stage-future { background: #fbe9e2; color: #9a4a2e; }
.temp-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 12px; white-space: nowrap; }
.temp-chip.temp-hot { background: #fbe0d5; color: #9a3a1c; }
.temp-chip.temp-warm { background: var(--soft-yellow); color: #7a5410; }
.temp-chip.temp-cold { background: #e8f0f4; color: #3c6479; }
.due { font-size: 12px; font-weight: 700; white-space: nowrap; }
.due-overdue { color: #a2482a; }
.due.due-overdue::before { content: "! "; }
.due-today { color: #8a5f12; }
.due-priya { color: #2f6f45; }
.due-none { color: #8a5f12; font-weight: 400; font-style: italic; }

.compact-table th, .compact-table td { padding: 9px 12px; font-size: 13px; }
.source-table .bar-col { min-width: 180px; display: flex; align-items: center; gap: 8px; border-bottom: 0; }
.source-table .bar-col svg { flex: 1 1 auto; }
.source-table tbody tr { border-bottom: 1px solid var(--line); }

.bulk-toggle { align-self: flex-end; min-width: 0 !important; flex: 0 0 auto !important; }
.bulk-toggle label { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; white-space: nowrap; font-weight: 700; }
.bulk-toggle input { width: 18px; height: 18px; min-height: 0; }

.lead-ident { display: flex; gap: 14px; align-items: flex-start; }
.lead-ident .avatar { margin-top: 18px; background: var(--soft-blue); }
.lead-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lead-head .page-actions form { margin: 0; }
.stage-path { display: flex; flex-wrap: wrap; margin: 0 0 8px; }
.path-step { position: relative; flex: 1 1 120px; min-width: 0; }
.path-step > span, .path-step button, .path-step a { display: block; width: 100%; padding: 10px 14px 10px 22px; border: 0; background: #efede6; font: 700 13px Nunito, sans-serif; color: #5f5b52; text-align: center; text-decoration: none; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.path-step:first-child > span, .path-step:first-child button, .path-step:first-child a { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.path-step button:hover, .path-step a:hover { background: #e4e1d6; color: var(--ink); }
.path-step form { margin: 0; }
.path-step.is-done > span, .path-step.is-done button, .path-step.is-done a { background: #dcebe0; color: #2f6f45; }
.path-step.is-current > span { background: var(--yellow); color: var(--ink); }
.path-step.is-parked > span { background: #f2d3c6; color: #7d3a22; }
.close-lead { margin: 0 0 18px; font-size: 13px; }
.close-lead > summary { cursor: pointer; font-weight: 700; color: #5f5b52; }
.close-lead-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 6px 0 0; }
.close-lead-form > div { flex: 1 1 180px; }
.close-lead-form label { margin-top: 8px; }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.lead-layout .records-card { margin: 0 0 18px; }
.next-card h2 { margin: 6px 0 4px; font-size: 24px; }
.next-card p { color: var(--muted); font-size: 13px; }
.next-card.is-overdue { border-color: #e7b3a0; background: #fff8f4; }
.next-card.is-overdue h2 { color: #a2482a; }
.followup-form .record-form-grid .span-all { grid-column: 1 / -1; }
.followup-form .button { margin-top: 18px; }
.lead-timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.lead-timeline li { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 0 0 16px; }
.lead-timeline li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.lead-timeline li:last-child::before { display: none; }
.tl-dot { width: 13px; height: 13px; margin-top: 4px; border-radius: 50%; background: #cfcabd; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfcabd; }
.tl-call .tl-dot { background: #c08414; box-shadow: 0 0 0 1px #c08414; }
.tl-whatsapp .tl-dot { background: #3f8f5a; box-shadow: 0 0 0 1px #3f8f5a; }
.tl-note .tl-dot { background: #2e7daa; box-shadow: 0 0 0 1px #2e7daa; }
.tl-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 14px; }
.tl-tag { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: #f1efe8; color: #5f5b52; }
.tl-whatsapp .tl-tag { background: #e3f1e7; color: #2f6f45; }
.tl-call .tl-tag { background: var(--soft-yellow); color: #7a5410; }
.tl-when { color: var(--muted); font-size: 12px; }
.tl-line { font-size: 13px; color: #5f5b52; margin-top: 2px; }
.tl-text { font-size: 13px; margin-top: 4px; padding: 8px 10px; background: #faf8f2; border-radius: 8px; }
.lead-facts dl { margin: 10px 0 0; display: grid; gap: 0; }
.lead-facts dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.lead-facts dl > div:last-child { border-bottom: 0; }
.lead-facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.lead-facts dd { margin: 0; overflow-wrap: anywhere; }
.lead-notes { margin-top: 10px; font-size: 13px; padding: 10px; background: #faf8f2; border-radius: 8px; }
.score-card h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score-bar { margin: 12px 0 6px; height: 10px; }
.score-hot { fill: #d0704f; } .score-warm { fill: #c08414; } .score-cold { fill: #8fb8cb; }
.score-why { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; font-size: 13px; }
.score-why li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
.score-why strong { text-align: right; }
.score-why .plus { color: #2f6f45; } .score-why .minus { color: #a2482a; }
.dup-card { border-color: #f0dfae; background: #fffcf3; }
.dup-card .card-list small { color: var(--muted); }
.scripts-card > summary { cursor: pointer; list-style: none; }
.scripts-card > summary::-webkit-details-marker { display: none; }
.scripts-card > summary h2 { display: inline; font-size: 21px; }
.scripts-card > summary::after { content: " ▾"; color: var(--muted); }
@media (max-width: 1100px) {
  .lead-layout { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .stage-path { flex-wrap: nowrap; overflow-x: auto; }
  .path-step { flex: 0 0 auto; }
  .lead-table .lead-cell { min-width: 200px; }
  .bulk-bar.has-ticks { position: static; }
}

/* Leads v2 (12 Oct 2026): CRM layout — quick links, left panel of views and filters, list toolbar, one-tap call log,
   3-column lead page (details · activity · next step), board drag and drop, grouped source table, team table */
.lead-heading p strong { color: var(--ink); }
.lead-quick-links { align-items: center; }
/* Leads & enquiries: the Child / Hearing and All / Child / Hearing / Team switches, one New enquiry menu. */
.lead-switch { margin: 0 0 14px; }
.lead-switch .view-option { padding: 8px 20px; font-size: 14px; }
.dash-parts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.dash-parts .lead-switch, .dash-parts .quick-links { margin: 0; }
.dash-more > summary { cursor: pointer; font-weight: 700; padding: 10px 0; margin: 0 0 10px; }
.new-enquiry > summary { list-style: none; }
.quick-caption { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; margin-right: 4px; }

.lead-workspace { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; align-items: start; }
.lead-rail { position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 14px; }
.rail-caption { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; color: var(--muted); text-transform: uppercase; margin: 12px 8px 4px; }
.rail-views ul { list-style: none; margin: 0; padding: 0; }
.rail-views a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 13px; text-decoration: none; color: #3d3d3d; }
.rail-views a:hover { background: #f5f3ec; }
.rail-views a strong { font-size: 11px; min-width: 24px; text-align: center; padding: 1px 6px; border-radius: 9px; background: #f4f2ec; color: #5f5b52; }
.rail-views a[aria-current=page] { background: var(--soft-yellow); font-weight: 700; }
.rail-views a[aria-current=page] strong { background: #fff; color: var(--ink); }
.rail-views a.is-alert strong { background: #fbe5dc; color: #a2482a; }
.rail-filters { border-top: 1px solid var(--line); margin-top: 10px; padding: 0 6px; }
.rail-filter-box > summary { cursor: pointer; list-style: none; }
.rail-filter-box > summary::-webkit-details-marker { display: none; }
.rail-filter-box > summary::after { content: " ▾"; }
.rail-filter-box[open] > summary::after { content: " ▴"; }
.rail-filters label { font-size: 12px; margin: 10px 0 4px; }
.rail-filters select, .rail-filters input { min-height: 36px; padding: 6px 9px; font-size: 13px; }
.rail-filters .more-filters { margin-top: 10px; }
.rail-actions { display: flex; gap: 8px; margin-top: 14px; }
.rail-actions .button { flex: 1; }

.lead-main { min-width: 0; }
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 10px; }
.list-title { flex: 1 1 220px; min-width: 0; }
.list-title h2 { font-size: 22px; }
.list-title p { font-size: 12px; color: var(--muted); }
.list-search { display: flex; gap: 6px; flex: 1 1 300px; max-width: 420px; }
.list-search input { min-height: 38px; padding: 6px 12px; font-size: 13px; }
.list-sort { display: flex; align-items: center; gap: 6px; }
.list-sort label { margin: 0; font-size: 12px; color: var(--muted); }
.list-sort select { width: auto; min-height: 38px; padding: 6px 10px; font-size: 13px; }
.list-sort .button[hidden] { display: none; }
.lead-main .filter-chips { margin: 0 0 10px !important; }
.bulk-bar:not(.has-ticks) { padding: 8px 12px; }
.leads-js .bulk-bar:not(.has-ticks) [data-bulk-action], .leads-js .bulk-bar:not(.has-ticks) > .button { display: none; }
.leads-js .bulk-bar:not(.has-ticks) .bulk-count { color: var(--muted); font-weight: 400; }
.leads-js .bulk-bar:not(.has-ticks) .bulk-help { flex-basis: auto; }
.row-actions .log-button { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.last-cell { font-size: 13px; white-space: nowrap; }
.stage-cell { min-width: 150px; }
.stage-cell .temp-chip { display: table; margin-top: 6px; }
.source-cell { font-size: 13px; min-width: 120px; }
.owner-note { margin-top: 3px; color: #5f5b52 !important; }
.lead-table .lead-cell { min-width: 190px; }

/* One-tap call log */
.call-form fieldset { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.call-form legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.choice-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-pills legend { width: 100%; }
.pill { position: relative; margin: 0; font-size: 13px; font-weight: 700; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 7px 12px; border-radius: 18px; border: 1px solid #dcd9cf; background: #fff; line-height: 1.2; }
.pill span small { font-weight: 400; color: var(--muted); font-size: 10px; margin-top: 2px; }
.pill:hover span { border-color: var(--yellow); }
.pill input:checked + span { background: var(--hl); border-color: var(--hl-line); box-shadow: inset 0 0 0 1px var(--hl-line); }
.pill input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.pill.pill-negative input:checked + span { background: #fbe5dc; border-color: #d0704f; box-shadow: inset 0 0 0 1px #d0704f; }
.pill.pill-positive input:checked + span { background: #e3f1e7; border-color: #3f8f5a; box-shadow: inset 0 0 0 1px #3f8f5a; }
.call-dial { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 !important; }
.call-dial small { color: var(--muted); }
.call-who { font-size: 13px; color: var(--muted); margin: 0 0 10px !important; }
.call-help { font-size: 11px; color: var(--muted); margin: 10px 0 0 !important; }
.call-form .button.primary { margin-top: 14px; }
.call-form textarea { min-height: 64px; }
.leads-js .call-form:not(.wants-when) .call-when { display: none; }
.leads-js .call-form:not(.wants-reason) .call-reason { display: none; }
.leads-js .call-form.is-closing .call-next { display: none; }

/* Lead page */
.record-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin: 12px 0 14px; }
.record-head h1 { margin: 4px 0 6px; font-size: 34px; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.record-actions form { margin: 0; }
.record-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin: 0 0 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.record-facts > div { padding: 10px 14px; border-right: 1px solid var(--line); min-width: 0; }
.record-facts dt { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.record-facts dd { margin: 3px 0 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.record-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "center right" "center left"; gap: 18px; align-items: start; }
.record-left { grid-area: left; min-width: 0; }
.record-center { grid-area: center; min-width: 0; }
.record-right { grid-area: right; min-width: 0; }
.record-layout .records-card { margin: 0 0 16px; padding: 18px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-title-row a { font-size: 13px; font-weight: 700; }
.composer { padding-top: 6px !important; }
.composer-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -18px 12px; padding: 0 12px; }
.composer-tabs a { padding: 10px 12px; font-size: 13px; font-weight: 700; text-decoration: none; color: #6e6a60; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.composer-tabs a:hover { color: var(--ink); }
.composer-tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--accent); }
.note-form .button, .whatsapp-send .button { margin-top: 12px; }
.timeline-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; }
.timeline-filter[hidden] { display: none; }
.timeline-filter .chip-button { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.timeline-filter .chip-button[aria-pressed=true] { background: var(--soft-yellow); border-color: var(--yellow); }
.lead-timeline li[hidden] { display: none; }
.tl-note .tl-tag { background: #e4eff5; color: #1f5f86; }
.tl-change .tl-dot { background: #cfcabd; }
@media (min-width: 1500px) {
  .record-layout { grid-template-columns: 270px minmax(0, 1fr) 300px; grid-template-areas: "left center right"; }
}
@media (max-width: 1000px) {
  .lead-workspace { grid-template-columns: 1fr; }
  .lead-rail { position: static; max-height: none; }
  .rail-views ul { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .rail-views a { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 16px; padding: 5px 10px; font-size: 12px; }
  .rail-views .rail-caption { margin-top: 8px; }
  .record-layout { grid-template-columns: 1fr; grid-template-areas: "center" "right" "left"; }
}

/* Board: drag and drop */

/* Dashboard tables */
.source-table .channel-row th, .source-table .channel-row td { background: #faf8f2; font-weight: 700; }
.source-table .channel-row svg { width: 10px; height: 10px; stroke: none; vertical-align: -1px; margin-right: 8px; }
.source-table .channel-row td.bar-col { display: table-cell; }
.source-table .channel-row small { font-weight: 400; color: var(--muted); }
.source-table .source-name { padding-left: 30px; font-weight: 400; }
.team-table td, .team-table th { white-space: nowrap; }

/* Family journey (J1, 12 Oct 2026): pipeline chevrons, stage chips with progress dots, the child's journey bar */
.journey-pipeline { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; margin: 0 0 14px; }
.journey-stage { display: flex; flex-direction: column; justify-content: center; min-width: 118px; flex: 1 1 118px; padding: 10px 16px 10px 24px; background: #efede6; color: #4f4b43; text-decoration: none; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); margin-right: -6px; }
.journey-stage:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 10px 0 0 10px; padding-left: 16px; }
.journey-stage strong { font: 700 24px/1.1 Baloo, sans-serif; }
.journey-stage span { font-size: 12px; font-weight: 700; }
.journey-stage:hover { background: #e4e1d6; }
.journey-stage[aria-current=page] { background: var(--yellow); color: var(--ink); }
.journey-stage.stage-enquiry { background: #e4eff5; } .journey-stage.stage-assessment { background: #d9e9f1; }
.journey-stage.stage-decision { background: #fbe9e2; } .journey-stage.stage-onboarding { background: var(--soft-yellow); }
.journey-stage.stage-therapy { background: #e3f1e7; } .journey-stage.stage-completed { background: #efede6; }
.journey-stage[aria-current=page] { box-shadow: inset 0 -4px 0 var(--accent); }
/* Future prospect + Lost: one framed box headed "Left the enquiry", as tall as the chevrons (17 Oct review) */
.journey-pipeline { row-gap: 10px; }
.journey-stage:has(+ .journey-exit-group) { margin-right: 16px; }
.journey-exit-group { display: flex; flex-direction: column; gap: 5px; flex: 0 1 260px; min-width: 214px; padding: 7px; background: #faf8f2; border: 1px dashed #d9d4c6; border-radius: 12px; }
.journey-exits { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
.journey-exit-items { display: flex; gap: 6px; flex: 1; }
.journey-stage.is-exit { flex: 1 1 0; min-width: 0; background: #fff; border: 1px solid var(--line); clip-path: none; border-radius: 9px; margin: 0; padding: 6px 12px; }
.journey-stage.is-exit:hover { background: #f4f1e8; }
.journey-stage.is-exit[aria-current=page] { background: var(--yellow); }
.journey-note { font-size: 13px; padding: 10px 14px; border-radius: 10px; background: #fff8f4; border: 1px solid #f0d2c4; margin: 0 0 14px !important; }
.journey-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: #f1efe8; white-space: nowrap; }
.journey-chip.stage-enquiry { background: #e4eff5; color: #1f5f86; } .journey-chip.stage-assessment { background: #d9e9f1; color: #24566e; }
.journey-chip.stage-decision { background: #fbe9e2; color: #9a4a2e; } .journey-chip.stage-onboarding { background: var(--soft-yellow); color: #7a5410; }
.journey-chip.stage-therapy { background: #e3f1e7; color: #2f6f45; } .journey-chip.stage-completed { background: #efede6; color: #6b675e; }
.journey-chip.stage-future, .journey-chip.stage-lost { background: #f6f4ee; color: #6b675e; }
/* Hearing care (HCC) track, 13 Oct 2026 */
.journey-stage.stage-test { background: #d9e9f1; } .journey-stage.stage-trial { background: #fbe9e2; }
.journey-stage.stage-fitting { background: var(--soft-yellow); } .journey-stage.stage-aftercare { background: #e3f1e7; }
.journey-chip.stage-test { background: #d9e9f1; color: #24566e; } .journey-chip.stage-trial { background: #fbe9e2; color: #9a4a2e; }
.journey-chip.stage-fitting { background: var(--soft-yellow); color: #7a5410; } .journey-chip.stage-aftercare { background: #e3f1e7; color: #2f6f45; }
.journey-tracks { margin: 0 0 12px; }
.journey-checklist small { font-weight: 400; color: var(--muted); }
.journey-dots { display: flex; gap: 4px; margin-top: 6px; }
.journey-dots i { width: 14px; height: 4px; border-radius: 2px; background: #e4e1d6; }
.journey-dots i.dot-done { background: #8cc29e; } .journey-dots i.dot-current { background: var(--accent-strong); }
.journey-table td { vertical-align: top; }
.journey-cell { min-width: 150px; }
.next-button { white-space: nowrap; }
.list-search select { width: auto; min-height: 38px; padding: 6px 10px; font-size: 13px; }
.recent-leads li { align-items: center; flex-wrap: nowrap; }
.recent-leads li > span { min-width: 0; flex: 1; }
.recent-leads .button { flex: 0 0 auto; min-height: 32px; padding: 4px 10px; font-size: 12px; }
.next-button { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.journey-bar { display: grid; gap: 10px; margin: 0 0 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.journey-steps { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; gap: 0; }
.journey-steps li { flex: 1 1 100px; padding: 8px 12px 8px 20px; font-size: 12px; font-weight: 700; background: #efede6; color: #6e6a60; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); margin-right: -5px; white-space: nowrap; }
.journey-steps li:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 8px 0 0 8px; padding-left: 12px; }
.journey-steps li.step-done { background: #dcebe0; color: #2f6f45; }
.journey-steps li.step-current { background: var(--yellow); color: var(--ink); }
.journey-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.journey-next-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.journey-checklist { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted); }
.journey-checklist li.is-done { color: #2f6f45; font-weight: 700; }
.journey-lead { font-size: 13px; font-weight: 700; margin-left: auto; }
@media (max-width: 800px) {
  .journey-pipeline { flex-wrap: nowrap; overflow-x: auto; }
  .journey-stage { min-width: 104px; }
  .journey-exit-group { flex: 0 0 236px; }
  .journey-steps { flex-wrap: nowrap; overflow-x: auto; }
}
/* S2 Patients list (12 Oct 2026) */
.therapy-tag { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 10px; background: #eaf2f6; color: #2c5a72; font-size: 12px; font-weight: 600; white-space: nowrap; }
.warn-note { color: #9a4a2e; font-weight: 700; }
.patient-filters { flex-wrap: wrap; }
.patient-table td:nth-child(3) { max-width: 280px; }
/* S4 Billing dashboard (12 Oct 2026) */
.billing-status { border-left: 4px solid var(--yellow); }
.setup-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.setup-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.setup-mark { flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #efede6; color: #6b675e; }
.setup-list li.is-done .setup-mark { background: #dcebe0; color: #2f6f45; }
/* S5 Administration setup (12 Oct 2026) */
.setup-rows li { padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.setup-rows li:last-child { border-bottom: 0; }
.setup-rows li.is-todo .setup-mark { background: var(--soft-yellow); color: #7a5410; }
.setup-text { flex: 1; min-width: 0; }
.setup-value { font-size: 15px; white-space: nowrap; }
/* Administration setup, organized by area (24 Oct 2026): summary on top, one card per area */
.setup-board { display: grid; gap: 20px; }
.setup-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.setup-progress-head h2 { font-size: 21px; font-weight: 400; }
.setup-progress-head span { font-size: 14px; font-weight: 700; color: var(--muted); }
.setup-progress { height: 12px; }
.setup-todo-title { margin: 16px 0 8px; font-size: 13px; font-weight: 700; }
.setup-todo { margin: 0; }
.setup-todo a { background: var(--soft-yellow); border-color: #f3e2b3; }
.setup-areas { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.setup-area-timetable { grid-row: span 2; }
.setup-count { flex: 0 0 auto; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--soft-yellow); color: #7a5410; }
.setup-count.is-done { background: #dcebe0; color: #2f6f45; }
.setup-sub { margin: 18px 0 2px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 16px; }
.setup-roles { margin-top: 6px; }
.setup-roles li { padding: 7px 0; }
.setup-empty-roles { margin-top: 6px; }
.setup-more { margin-top: 12px; font-size: 13px; font-weight: 700; }
@media (max-width: 900px) {
  .setup-areas { grid-template-columns: minmax(0, 1fr); }
  .setup-area-timetable { grid-row: auto; }
}
.patient-filters { flex: 1 1 100%; max-width: none; flex-wrap: wrap; }
.patient-filters input[type="search"] { flex: 1 1 200px; }
.session-cell { white-space: nowrap; }
.patient-table .next-button { min-height: 34px; padding: 5px 12px; font-size: 13px; white-space: nowrap; text-align: left; }  /* one line: rows stay short (UI-1) */
@media (max-width: 760px) { .patient-table .next-button { white-space: normal; max-width: 170px; } }
/* Upload day sheet (12 Oct 2026) */
.ds-figures { margin: 6px 0 10px; }
.ds-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; }
.ds-therapist { margin: 22px 0 8px; font-size: 16px; }
.ds-therapist:first-of-type { margin-top: 6px; }
.ds-notes { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
/* Owner Overview v2 (17 Oct 2026): filters, today strip, CDC / HCC panels */
.ov-filters { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 0 0 20px; display: grid; gap: 10px; }
.ov-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ov-chips, .ov-sides { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: #f4f1e8; border: 1px solid var(--line); border-radius: 10px; }
.ov-chips a, .ov-sides a { font-size: 12px; font-weight: 700; text-decoration: none; color: #5f5b52; padding: 7px 12px; border-radius: 7px; white-space: nowrap; }
.ov-chips a:hover, .ov-sides a:hover { background: #fff; }
.ov-chips a[aria-current], .ov-sides a[aria-current] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px #3d3d3d14; }
.ov-sides a.side-cdc[aria-current] { background: var(--soft-mint); } .ov-sides a.side-hcc[aria-current] { background: var(--soft-blue); }
.ov-sides { margin-left: auto; }
.ov-date { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; }
.ov-date input { width: 150px; min-height: 38px; padding: 6px 10px; font-size: 13px; }
.ov-filters .button.compact { min-height: 38px; }
.ov-showing { font-size: 12px; color: var(--muted); margin-left: auto; }
.ov-showing strong { color: var(--ink); }
.ov-filters .error-box { margin: 0; }
/* Every Overview row: the boxes side by side end on one line. Today's tiles share the height; opening "Show all" lets the list grow alone. */
.ov-board > .dash-grid.two { align-items: stretch; }
.dash-grid.ov-first { margin-bottom: 22px; }
.ov-board > .dash-grid.ov-first:has(.ov-more[open]) { align-items: start; }
.ov-first > .dash-card { display: flex; flex-direction: column; }
.ov-today { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; flex: 1; }
.ov-today a { display: grid; grid-template-rows: auto auto 1fr; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fdfcf8; text-decoration: none; height: 100%; }
.ov-today small { align-self: end; }
.ov-today a:hover { background: var(--soft-yellow); }
.ov-today span { font-size: 12px; font-weight: 700; color: var(--muted); }
.ov-today strong { font: 700 26px/1.1 Baloo, sans-serif; }
.ov-today small { font-size: 11px; color: #706c62; }
.ov-section-title { font-size: 20px; margin: 4px 0 12px; }
.dash-grid.one { grid-template-columns: minmax(0, 1fr); }
/* Team today (operations/team_today.py): one row per person; on a narrow screen each row becomes a block. */
.ov-filters { scroll-margin-top: 12px; }
.ov-team .card-head p { margin: 4px 0 0; font-size: 13px; color: #706c62; }
.ov-team-links { display: flex; gap: 14px; margin: 0; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ov-team-links a { text-underline-offset: 4px; }
.ov-team-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.ov-team-table th, .ov-team-table td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.ov-team-table thead th { font-size: 11px; font-weight: 700; color: var(--muted); padding-top: 0; }
.ov-team-table tbody th { width: 22%; font-weight: 700; }
.ov-team-table tbody th a { text-underline-offset: 4px; }
.ov-team-table tbody th small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ov-team-table td > strong { font: 700 18px/1.1 Baloo, sans-serif; }
.ov-team-table td > small { font-size: 11px; color: var(--muted); }
.ov-team-list { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.ov-team-list li { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #f6f3ea; white-space: nowrap; }
.ov-team-list b { font-weight: 800; }
.ov-team-list a { color: inherit; text-decoration: none; }
.ov-team-list a:hover { text-decoration: underline; }
.ov-team-list li:has(a):hover { background: var(--soft-yellow); }
.ov-team-none { font-size: 12px; color: var(--muted); }
.ov-late { color: #b03a26; font-weight: 700; }
.ov-team-list .ov-late { font-size: 11px; }
.ov-team-nobody, .ov-team-quiet { font-size: 13px; margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--soft-peach, #fcefe9); }
.ov-team-quiet { background: #f6f3ea; }
.ov-team .ov-more { margin-top: 8px; }
.ov-team .ov-more summary { font-size: 13px; font-weight: 700; cursor: pointer; }
/* The Overview popup (static/peek.js): any link in the Overview opens its page here, in the middle of the screen. */
dialog.peek { width: min(1180px, 94vw); height: min(92vh, 1040px); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 18px; background: var(--paper, #faf8f2); box-shadow: 0 24px 64px #3d3d3d47; overflow: hidden; }
dialog.peek::backdrop { background: #3d3d3d80; }
.peek-box { display: flex; flex-direction: column; height: 100%; }
.peek-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.peek-title { flex: 1; min-width: 0; font: 700 18px/1.2 Baloo, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek-back, .peek-close { border: 1px solid var(--line); background: #fff; border-radius: 10px; min-height: 38px; padding: 0 12px; font: 700 13px Nunito, sans-serif; color: var(--ink); cursor: pointer; }
.peek-close { display: none; font-size: 22px; line-height: 1; min-width: 40px; }  /* user 17 Nov: no × on desktop (Esc / tap outside); the phone's full-screen popup keeps it, its only way out */
.peek-back:hover, .peek-close:hover { background: var(--soft-yellow); }
.peek-loading { margin: 0; padding: 6px 18px; font-size: 12px; color: var(--muted); background: var(--soft-yellow); }
.peek-body { flex: 1; min-height: 0; }
.peek-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--paper, #faf8f2); }
@media (max-width: 700px) {
  dialog.peek { width: 100vw; height: 100dvh; border-radius: 0; margin: 0; }
  .peek-bar { padding: 8px 10px; gap: 6px; }
  .peek-open { font-size: 12px; padding: 0 10px; }
  .peek-close { display: inline-block; }
}
.department-card h3 a { font-size: inherit; margin: 0; text-decoration: none; }
.department-card h3 a:hover { text-decoration: underline; }
.section-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.section-links a { font-weight: 600; margin: 0; }
@container board (max-width: 700px) {
  .ov-team-table thead { display: none; }
  .ov-team-table, .ov-team-table tbody, .ov-team-table tr, .ov-team-table th, .ov-team-table td { display: block; width: auto; }
  .ov-team-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .ov-team-table tbody th, .ov-team-table td { border: 0; padding: 4px 0; width: auto; }
  .ov-team-table td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
  .ov-team .card-head { flex-wrap: wrap; }
}
.ov-panel { border-top: 5px solid var(--mint); }
.ov-panel.ov-hcc { border-top-color: var(--blue); }
.ov-money { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.ov-money > div { display: grid; align-content: start; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--soft-mint); }
.ov-hcc .ov-money > div { background: var(--soft-blue); }
.ov-money span { font-size: 11px; font-weight: 700; color: var(--muted); }
.ov-money strong { font: 700 22px/1.15 Baloo, sans-serif; }
.ov-money .kpi-change { justify-self: start; }
.ov-money small { font-size: 11px; color: #706c62; }
.ov-rows { margin: 0; display: grid; }
.ov-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ov-rows > div:last-child { border-bottom: 0; }
.ov-rows dt a { font-size: 13px; font-weight: 700; text-underline-offset: 4px; }
.ov-rows dd { margin: 0; text-align: right; display: grid; }
.ov-rows dd strong { font: 700 18px/1.1 Baloo, sans-serif; }
.ov-rows dd small { font-size: 11px; color: var(--muted); }
.ov-sub { font-size: 14px; margin: 16px 0 8px; }
.ov-sub small { font: 400 11px Nunito, sans-serif; color: var(--muted); }
.ov-panel .journey-pipeline { margin: 0; }
.ov-actions { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ov-actions li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 10px; background: #fbfaf6; border-radius: 8px; }
.ov-actions a { font-weight: 700; text-underline-offset: 4px; }
.ov-products { width: 100%; border-collapse: collapse; font-size: 12px; }
.ov-products th { text-align: left; color: var(--muted); font-weight: 700; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.ov-products td { padding: 6px; border-bottom: 1px solid var(--line); }
.ov-products td:nth-child(2), .ov-products td:nth-child(3), .ov-products th:nth-child(2), .ov-products th:nth-child(3) { text-align: right; white-space: nowrap; }
.side-cdc { fill: #3f8f5a; stroke: #3f8f5a; } .side-hcc { fill: #2e7daa; stroke: #2e7daa; } .side-other { fill: #cfcabd; stroke: #cfcabd; }
@container board (max-width: 700px) {
  .ov-money { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ov-money > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .ov-filters { padding: 10px; }
  .ov-sides { margin-left: 0; }
  .ov-chips, .ov-sides { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-chips a, .ov-sides a { text-align: center; padding: 8px 4px; white-space: normal; line-height: 1.25; display: grid; place-items: center; }
  .ov-date { flex: 1 1 40%; }
  .ov-date input { width: 100%; }
  .ov-filters .button.compact { flex: 1 1 100%; }
  .ov-showing { margin-left: 0; }
}
@media (max-width: 420px) {
  .ov-today { grid-template-columns: minmax(0, 1fr); }
}
.ov-more summary { cursor: pointer; font-size: 12px; font-weight: 700; padding: 10px 0 0; text-underline-offset: 4px; }
.ov-more summary:hover { text-decoration: underline; }
/* Messages inbox (M2, 17 Oct 2026): chat list and open chat side by side; day lines, New messages line, ✓ / ✓✓ */
.inbox { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); height: max(540px, calc(100dvh - 260px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.inbox-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #fdfcf8; }
.inbox-search { padding: 12px 12px 8px; margin: 0; }
.inbox-search input { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.inbox-tabs { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.inbox-tabs a { font-size: 12px; font-weight: 700; color: #5f5b52; text-decoration: none; padding: 5px 10px; border-radius: 999px; background: #f1eee5; white-space: nowrap; }
.inbox-tabs a b { font-weight: 800; color: var(--muted); margin-left: 2px; }
.inbox-tabs a:hover { background: #e9e5d8; }
.inbox-tabs a[aria-current] { background: var(--hl); border-color: var(--hl-line); box-shadow: inset 0 0 0 1px var(--hl-line); color: var(--ink); }
.inbox-tabs a[aria-current] b { color: var(--marigold-ink); }
.inbox-rows { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.inbox-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.inbox-row:hover { background: #f4f1e8; }
.inbox-row.is-open { background: var(--soft-yellow); box-shadow: inset 3px 0 0 #d9a93e; }
.inbox-row-main { flex: 1; min-width: 0; }
.inbox-row-main strong, .inbox-row-main small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row-main strong { font-size: 14px; font-weight: 700; }
.inbox-row-main small { font-size: 12px; color: var(--muted); }
.inbox-row.is-unread .inbox-row-main small { color: var(--ink); font-weight: 700; }
.inbox-row-side { display: grid; justify-items: end; gap: 4px; flex: 0 0 auto; }
.inbox-row-side small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.waiting-chip { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: #fbe9e2; color: #9a4a2e; }
.inbox-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.app-avatar.kind-desk { background: var(--soft-blue); } .app-avatar.kind-parent { background: #fbe3da; }
.app-avatar.kind-staff { background: var(--soft-yellow); } .app-avatar.kind-alerts { background: var(--soft-mint); }
.inbox-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.inbox-pane-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.inbox-pane-head h2 { font-size: 18px; margin: 0; line-height: 1.2; }
.inbox-pane-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.inbox-pane-head p strong { color: var(--ink); }
.inbox-back { display: none; }
.inbox-thread { flex: 1; min-height: 0; overflow-y: auto; position: relative; padding: 14px 18px; background: #faf8f2; }
.inbox-thread .chat-list { margin: 0; }
.inbox-compose { border-top: 1px solid var(--line); background: #fff; padding: 10px 18px 0; }
.inbox-compose .chat-form { position: static; padding: 0; background: none; }
.inbox-compose .chat-readonly { margin-bottom: 10px; }
.inbox-people { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; }
.inbox-people .app-list { border-radius: 12px; }
.inbox-welcome { margin: auto; max-width: 380px; padding: 24px; display: grid; justify-items: center; gap: 8px; text-align: center; }
.inbox-welcome svg { width: 56px; height: 56px; color: #c9962f; }
.inbox-welcome h2 { margin: 0; font-size: 20px; }
.inbox-welcome p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.chat-day { align-self: center; margin: 6px 0; padding: 3px 12px; border-radius: 999px; background: #efebe0; color: #6b675e; font-size: 11px; font-weight: 700; }
.chat-unread-line { align-self: stretch; display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #b23a2b; }
.chat-unread-line::before, .chat-unread-line::after { content: ''; flex: 1; height: 1px; background: #e6b3a9; }
.chat-receipt { margin-left: 6px; font-weight: 800; color: #8a857a; letter-spacing: -1px; }
.chat-receipt.seen { color: #2e7daa; }
.chat-form textarea { resize: none; max-height: 160px; }
.chat-form-help { display: flex; justify-content: space-between; gap: 10px; margin: 4px 2px 8px; font-size: 11px; color: var(--muted); }
.chat-error { margin: 0 2px 8px; font-size: 12px; font-weight: 700; color: #b23a2b; }
.chat-error:empty { display: none; }
@media (pointer: coarse) { .chat-keys { visibility: hidden; } }
@media (max-width: 900px) {
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; overflow: visible; }
  .inbox.has-pane .inbox-list { display: none; }
  .inbox:not(.has-pane) .inbox-pane { display: none; }
  .inbox-list { border-right: 0; border-radius: 16px; }
  .inbox-rows { overflow: visible; }
  .inbox-back { display: inline-block; font-size: 13px; font-weight: 700; text-decoration: none; }
  .inbox-pane-head { flex-wrap: wrap; border-radius: 16px 16px 0 0; }
  .inbox-thread { overflow: visible; min-height: 45vh; }
  .inbox-compose { position: sticky; bottom: 0; border-radius: 0 0 16px 16px; }
  .inbox-heading p { display: none; }
  body:has(.inbox.has-pane .inbox-compose) .chat-bell { bottom: 110px; }  /* keep the sound bell off the message box */
}
/* Channels and announcements (M3, 17 Oct 2026) */
.app-avatar.kind-channel { background: var(--ink); color: #f0c463; font-weight: 800; }
.chat-message.announcement { max-width: 92%; background: #fff8e6; border: 1px solid #f0c463; border-left: 4px solid #d9a93e; }
.chat-message.announcement.mine { background: #fff3d6; }
.chat-flag { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #8a5a00; }
.chat-seen-by { margin-top: 4px; font-size: 12px; }
.chat-seen-by summary { cursor: pointer; font-weight: 700; color: #6b5a2a; }
.chat-seen-by p { margin: 4px 0 0; font-size: 12px !important; color: var(--muted); }
.inbox-pinned { display: flex; align-items: flex-start; gap: 10px; padding: 9px 18px; background: #fff8e6; border-bottom: 1px solid #f3e0a8; }
.inbox-pinned p { margin: 0; font-size: 13px; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-pinned small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.pin-flag { flex: 0 0 auto; font-size: 11px; font-weight: 800; color: #8a5a00; padding-top: 2px; }
.inbox-pinned .pin-off { flex: 0 0 auto; margin-left: auto; }
.app-pinned { border: 1px solid #f3e0a8; border-radius: 14px; margin: 0 0 10px; padding: 10px 12px; }
.chat-form.can-announce { flex-wrap: wrap; }
.chat-announce { flex: 1 0 100%; order: 3; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #6b5a2a; cursor: pointer; }
.chat-announce input { width: 16px; height: 16px; margin: 0; }
.announce-card { display: grid; gap: 4px; text-decoration: none; color: var(--ink); background: #fff8e6; border-color: #f0c463; border-left: 5px solid #d9a93e; }
.announce-card .small:first-child { font-weight: 800; color: #8a5a00; }
/* Group therapy chats (M3, 17 Oct 2026): the team leader's plan over the chat */
.app-avatar.kind-therapy { background: var(--soft-mint); font-size: 16px; }
.group-chat-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 10px; }
.group-chat-line form { margin: 0; }
.group-plan { margin: 0 0 10px; border: 1px solid #cfe3d5; border-radius: 14px; background: #f5faf6; }
.group-plan > summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 10px 14px; cursor: pointer; font-weight: 800; font-size: 14px; }
.group-plan > summary small { font-weight: 600; font-size: 12px; color: var(--muted); }
.group-plan-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; padding: 0 14px 12px; }
.group-plan h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #2f6f45; }
.group-plan h4 { margin: 8px 0 4px; font-size: 12px; color: var(--muted); }
.plan-roles, .plan-activities { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.plan-roles li, .plan-activities li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; background: #fff; border: 1px solid #e1ece4; font-size: 13px; }
.plan-roles span { font-size: 12px; font-weight: 700; color: #2f6f45; text-align: right; }
.plan-activities li > span { display: grid; min-width: 0; }
.plan-activities small { font-size: 11px; color: var(--muted); }
.plan-activities form { margin: 0; }
.plan-remove { border: 0; background: none; color: #9a4a2e; font-weight: 800; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.plan-remove:hover { background: #fbe9e2; }
.plan-empty { margin: 0; font-size: 12px; color: var(--muted); }
.plan-edit { margin-top: 8px; }
.plan-edit > summary { cursor: pointer; font-size: 12px; font-weight: 800; color: #2f6f45; }
.plan-form { display: grid; gap: 8px; margin-top: 8px; }
.plan-form label { display: grid; gap: 3px; font-size: 12px; font-weight: 700; }
.plan-form input, .plan-form select { min-height: 38px; font-size: 13px; }
.plan-form .field-error { margin: -4px 0 0; font-size: 12px; font-weight: 700; color: #b23a2b; }
.inbox-plan { padding: 10px 18px 0; border-bottom: 1px solid var(--line); background: #fff; max-height: 40%; overflow-y: auto; }
/* Group plan folded by default (17 Oct review): a slim bar; the bell keeps off the message box */
.group-plan > summary { align-items: center; list-style: none; padding: 8px 12px; font-size: 13px; }
.group-plan > summary::-webkit-details-marker { display: none; }
.group-plan > summary > span { flex: 0 0 auto; }
.group-plan > summary > small { flex: 1; }
.plan-toggle::after { content: 'Show ▾'; font-size: 12px; font-weight: 800; color: #2f6f45; }
.group-plan[open] .plan-toggle::after { content: 'Hide ▴'; }
body.staff-app:has([data-chat-form]) .chat-bell, body.parent-app:has([data-chat-form]) .chat-bell { bottom: calc(168px + env(safe-area-inset-bottom)); }  /* just above the one-line box (CHAT-WA) */
/* Profile photos and made groups (M3, 17 Oct 2026) */
.app-avatar.has-photo { padding: 0; overflow: hidden; background: #eee; }
.app-avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.chat-message.with-avatar { position: relative; margin-left: 36px; }
.bubble-avatar { position: absolute; left: -36px; bottom: 0; width: 28px; height: 28px; flex-basis: 28px; font-size: 13px; }
.member-picks { list-style: none; margin: 6px 0 0; padding: 0; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.member-picks li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; font-weight: 600; }
.member-picks li + li { border-top: 1px solid var(--line); }
.member-picks input { width: 16px; height: 16px; margin: 0; }
.member-picks label { display: inline; font-weight: 600; cursor: pointer; }
.group-form fieldset { border: 0; padding: 0; margin: 0; }
.group-form legend { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.new-group-form { max-width: 520px; }
.new-group-link { display: grid; gap: 2px; text-decoration: none; color: var(--ink); border-left: 5px solid var(--mint); }
.group-manage { background: #f7f8fb; border-color: #dde3ee; }
.group-manage .plan-form { padding: 0 14px 12px; }
.photo-card { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.photo-card .app-avatar.large { width: 96px; height: 96px; flex-basis: 96px; font-size: 40px; }
.photo-card p { margin: 0 0 8px; font-size: 14px; }
.photo-remove { margin-top: 10px; }
.photo-page { max-width: 640px; }
/* Reminders (17 Oct 2026): my reminders by time, set one, clinic queues below */
.rem-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; margin-bottom: 26px; }
.rem-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.rem-chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #f1eee5; color: #5f5b52; }
.rem-chip b { font-size: 14px; margin-right: 2px; }
.rem-chip.is-overdue { background: #fbe3dd; color: #9a2f1e; }
.rem-chip.is-today { background: var(--soft-yellow); color: #7a5410; }
.rem-heading { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rem-heading.is-overdue { color: #b23a2b; } .rem-heading.is-today { color: #8a5a00; }
.rem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rem-list li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.rem-list li.is-overdue { border-color: #f0c0b5; background: #fff7f5; box-shadow: inset 4px 0 0 #d4543c; }
.rem-list li.is-today { border-color: #f1dca2; background: #fffbef; box-shadow: inset 4px 0 0 #d9a93e; }
.rem-when { display: grid; justify-items: center; min-width: 54px; }
.rem-when strong { font: 700 16px/1.1 Baloo, sans-serif; }
.rem-when small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.rem-what { flex: 1; min-width: 0; display: grid; }
.rem-what strong { font-size: 14px; overflow-wrap: anywhere; }
.rem-what small { font-size: 12px; color: var(--muted); }
.rem-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.rem-actions form { margin: 0; }
.rem-done { background: var(--soft-mint); border-color: #cfe3d5; }
.rem-snooze { position: relative; }
.rem-snooze > summary { list-style: none; cursor: pointer; }
.rem-snooze > summary::-webkit-details-marker { display: none; }
.rem-snooze form { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: grid; min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px #3d3d3d1f; overflow: hidden; }
.rem-snooze form button { border: 0; background: none; text-align: left; padding: 9px 12px; font: 600 13px Nunito, sans-serif; cursor: pointer; }
.rem-snooze form button:hover { background: var(--soft-yellow); }
.rem-remove { border: 0; background: none; color: #9a4a2e; font-weight: 800; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.rem-remove:hover { background: #fbe9e2; }
.rem-empty { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.rem-more { margin-top: 14px; }
.rem-more > summary { cursor: pointer; font-size: 13px; font-weight: 800; }
.rem-more .rem-list { margin-top: 8px; }
.rem-list.is-done li { opacity: .75; }
.rem-form { display: grid; gap: 10px; }
.rem-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; }
.rem-form input, .rem-form select { min-height: 40px; font-size: 14px; }
.rem-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rem-clinic-head { margin: 6px 0 12px; }
.rem-clinic-head h2 { margin: 2px 0 4px; font-size: 22px; }
.rem-clinic-head p { margin: 0; font-size: 13px; color: var(--muted); }
.reminder-card { border-left: 5px solid #d9a93e; }
.reminder-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rem-list.compact li { padding: 8px 10px; }
.rem-new-app > summary { cursor: pointer; }
.rem-new-app .rem-form { margin-top: 10px; }
.chat-toast.reminder-toast { border: 1px solid #f0c463; background: #fff8e6; color: #3d3d3d; }
@media (max-width: 900px) { .rem-layout { grid-template-columns: minmax(0, 1fr); } .rem-new { order: -1; } }
@media (max-width: 520px) { .rem-list li { flex-wrap: wrap; } .rem-actions { width: 100%; justify-content: flex-end; } .rem-form-row { grid-template-columns: minmax(0, 1fr); } }

/* ----- Front desk v2 (17 Oct 2026): shortcuts row, closed-day note, insight cards ----- */
.desk-closed { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: #fdeee8; border: 1px solid var(--peach); font-weight: 700; }
.desk-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 18px; }
@media (min-width: 1280px) { .desk-shortcuts { grid-template-columns: repeat(7, minmax(0, 1fr)); } }  /* 17 Nov: 14 daily tiles = two rows of 7 */
.desk-shortcut { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; line-height: 1.25; min-width: 0; }
/* DESK-5 (17 Nov 2026): the Front desk dashboard's work cards — "Needs you now", then "Today". Late = peach, today = marigold,
   info = sky, nothing waiting = grey; each line is one tap to its list. */
.desk-band { margin: 6px 0 26px; }
.desk-band-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.desk-band-head h2 { font-size: 20px; margin: 0; }
.desk-band-head p { margin: 0; font-size: 13px; color: var(--muted); }
.desk-work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.work-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px #3d3d3d0a; }
.work-head { display: flex; align-items: flex-start; gap: 12px; }
.work-head > div { flex: 1; min-width: 0; }
.work-head h3 { font: 700 18px/1.2 'Baloo 2', Baloo, sans-serif; margin: 0; }
.work-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.work-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--soft-yellow); }
.work-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.work-icon.tone-peach { background: var(--soft-peach); } .work-icon.tone-mint { background: var(--soft-mint); } .work-icon.tone-blue { background: var(--soft-blue); }
.work-pill { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.work-pill.tone-late { background: var(--soft-peach); color: var(--peach-ink); border: 1px solid var(--peach); }
.work-pill.tone-today { background: var(--soft-yellow); color: var(--marigold-ink); border: 1px solid var(--yellow); }
.work-pill.is-clear { background: var(--soft-mint); color: var(--mint-ink); border: 1px solid var(--mint); }
.work-rows { display: flex; flex-direction: column; gap: 6px; }
.work-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); border-left-width: 4px; color: var(--ink); text-decoration: none; }
a.work-row:hover, a.work-row:focus-visible { background: var(--row-hover); }
.work-row.tone-late { border-left-color: var(--peach); background: #fffaf7; }
.work-row.tone-today { border-left-color: var(--yellow); background: #fffdf6; }
.work-row.tone-info { border-left-color: var(--blue); }
.work-row.is-clear { min-height: 36px; padding: 4px 12px; border-color: transparent; color: var(--muted); font-size: 13px; }
.work-count { flex: none; min-width: 34px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 9px; font: 800 16px Nunito, sans-serif; background: var(--head); }
.tone-late .work-count { background: var(--soft-peach); color: var(--peach-ink); }
.tone-today .work-count { background: var(--soft-yellow); color: var(--marigold-ink); }
.tone-info .work-count { background: var(--soft-blue); color: var(--sky-ink); }
.is-clear .work-count { min-width: 28px; height: 24px; font-size: 13px; background: transparent; color: var(--muted); }
.work-text { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.3; }
.work-text small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.is-clear .work-text { font-weight: 400; }
.work-go { flex: none; font-weight: 800; color: var(--muted); }
.work-sub { margin: 4px 0 0; font: 800 11px Nunito, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.work-list { list-style: none; margin: 0; padding: 0; }
.work-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.work-list li:first-child { border-top: 0; }
.work-list li > span { font-size: 12px; color: var(--muted); }
.work-list li > span.is-late { color: var(--peach-ink); }
.work-leads li { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.work-leads li > span { display: flex; flex-direction: column; min-width: 0; font-size: 14px; color: var(--ink); }
.work-leads small { font-size: 12px; color: var(--muted); }
.work-all { margin-top: auto; align-self: flex-start; font-size: 12px; font-weight: 700; text-underline-offset: 4px; }
.work-clear { margin: 0; padding: 18px; text-align: center; font-size: 13px; color: var(--mint-ink); background: var(--soft-mint); border-radius: 12px; }
.day-meter { display: block; width: 100%; height: 10px; border-radius: 6px; overflow: hidden; background: var(--head); }
.day-meter rect { stroke: none; }
.day-meter .m-present { fill: var(--mint); } .day-meter .m-absent { fill: var(--peach); } .day-meter .m-booked { fill: var(--yellow); }
.day-meter-key { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; font-size: 12px; color: var(--muted); }
.day-meter-key strong { font-size: 18px; color: var(--ink); }
.day-meter-key span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; }
.k-present::before { background: var(--mint); } .k-absent::before { background: var(--peach); } .k-booked::before { background: var(--yellow); }
@media (max-width: 760px) { .desk-work-grid { grid-template-columns: minmax(0, 1fr); } .work-card { padding: 14px; } }
.desk-shortcut:hover, .desk-shortcut:focus-visible { background: var(--soft-yellow); border-color: var(--yellow); }
.desk-shortcut svg { flex: none; width: 20px; height: 20px; padding: 7px; border-radius: 10px; background: var(--soft-yellow); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; box-sizing: content-box; }
.desk-shortcut.alert svg { background: #fdeee8; color: #a2482a; }
.desk-shortcut span { min-width: 0; }
.desk-shortcut small { display: block; margin-top: 2px; font-weight: 600; font-size: 12px; color: var(--muted); }
.desk-shortcut.alert small { color: #a2482a; }
.desk-list li { align-items: center; flex-wrap: nowrap; }
.desk-list li > strong { flex: none; text-align: right; }
.desk-subhead { font-size: 14px; margin: 16px 0 6px; }
@media (max-width: 480px) { .desk-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .desk-shortcut { flex-direction: row; align-items: center; } }


/* Family requests inbox (18 Oct 2026, operations/family_requests.py): status tabs, kind chips, a split view (list +
   the chosen request with the reply), an empty state that says why and what next, and the last 90 days by kind. */
.fr-heading p { max-width: 720px; }
.fr-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.fr-tabs a { text-decoration: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 700; }
.fr-tabs a strong { margin-left: 4px; font-size: 12px; color: var(--muted); }
.fr-tabs a[aria-current] { background: var(--hl); border-color: var(--hl-line); box-shadow: inset 0 0 0 1px var(--hl-line); }
.fr-tabs a[aria-current] strong { color: var(--ink); }
.fr-oldest { margin-left: auto; font-size: 12px; color: var(--muted); }
.fr-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.fr-chips a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px; background: #f4f1e8; }
.fr-chips a[aria-current] { background: var(--hl); border-color: var(--hl-line); box-shadow: inset 0 0 0 1px var(--hl-line); color: var(--ink); }
.fr-chips svg { width: 14px; height: 14px; }
.fr-search { display: flex; gap: 8px; margin: 0; min-width: min(100%, 340px); }
.fr-search input { flex: 1; min-height: 38px; }
.fr-split { display: grid; grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; margin-bottom: 18px; }
.fr-list, .fr-detail { background: #fff; border: 1px solid var(--line); border-radius: var(--radius, 14px); min-width: 0; }
.fr-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.fr-row:last-of-type { border-bottom: 0; }
.fr-row:hover { background: #fcfaf4; }
.fr-row.is-chosen { background: var(--soft-yellow); box-shadow: inset 4px 0 0 var(--yellow); }
.fr-row.is-complaint { box-shadow: inset 4px 0 0 var(--peach); }
.fr-row-main { display: grid; gap: 2px; min-width: 0; }
.fr-row-top { display: flex; justify-content: space-between; gap: 8px; }
.fr-row-top strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-row-top small, .fr-row-kind { font-size: 11px; color: var(--muted); }
.fr-row-text { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.fr-icon svg { width: 18px; height: 18px; }
.fr-icon.big { width: 46px; height: 46px; }
.fr-icon.big svg { width: 22px; height: 22px; }
.fr-icon.tone-mint { background: var(--soft-mint); color: var(--mint-ink); }
.fr-icon.tone-blue { background: var(--soft-blue); color: var(--sky-ink); }
.fr-icon.tone-yellow { background: var(--soft-yellow); color: var(--marigold-ink); }
.fr-icon.tone-peach { background: var(--soft-peach); color: var(--peach-ink); }
.fr-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status-open { background: #fbece5; color: #a2482a; }
.status-reviewing { background: var(--soft-yellow); color: #8a5f12; }
.status-resolved { background: var(--soft-mint); color: #3f7a52; }
.fr-pages { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; margin: 0; font-size: 12px; border-top: 1px solid var(--line); }
.fr-none { padding: 18px 14px; color: var(--muted); font-size: 13px; margin: 0; }
.fr-detail { padding: 18px 20px; position: sticky; top: 84px; }
.fr-detail-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.fr-detail-head h2 { font-size: 20px; margin: 2px 0 4px; }
.fr-detail-head p { margin: 0; font-size: 12px; color: var(--muted); }
.fr-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 0; padding: 10px 12px; background: #faf8f2; border-radius: 10px; }
.fr-facts dt { font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.fr-facts dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; }
.fr-stars span { color: #ddd6c4; }
.fr-stars span.on, .fr-rating .fr-stars { color: var(--yellow); }
.fr-thread { display: grid; gap: 10px; margin: 16px 0; }
.fr-bubble { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; max-width: 88%; overflow-wrap: anywhere; }
.fr-bubble small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.fr-bubble.family { background: #f4f1e8; border-top-left-radius: 4px; justify-self: start; }
.fr-bubble.desk { background: var(--soft-mint); border-top-right-radius: 4px; justify-self: end; }
.fr-bubble.therapist { background: var(--soft-blue); border-top-right-radius: 4px; justify-self: end; }
/* FN-1: a parent's concern on its way to the therapist (operations/family_notes.py) */
.fr-row-top small.fr-stuck { color: var(--alert); font-weight: 700; }
.fr-steps { display: flex; flex-wrap: wrap; gap: 4px 6px; list-style: none; padding: 0; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.fr-steps li { padding: 3px 10px; border-radius: 12px; background: #f4f1e8; }
.fr-steps li.done { background: var(--soft-mint); color: var(--mint-ink); font-weight: 700; }
.fr-steps li.done::before { content: '✓ '; }
.fr-send { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 14px; }
.fr-send > label { font-weight: 700; font-size: 13px; }
.fr-send .check-row { font-size: 13px; }
.fr-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.fr-reply { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.fr-reply label { font-weight: 700; font-size: 13px; }
.fr-reply-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fr-reply-foot select { width: auto; min-width: 160px; }
.fr-reply-foot .button { margin-left: auto; }
.fr-empty { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; align-items: center; }
.fr-empty h2 { margin-bottom: 6px; }
.fr-empty-art { width: 160px; height: 120px; }
.fr-art-tray { fill: var(--soft-yellow); stroke: var(--yellow); stroke-width: 2; }
.fr-art-card { fill: #fff; stroke: #d9d4c4; stroke-width: 2; }
.fr-art-line { fill: none; stroke: #c9c3b1; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.fr-art-dot { fill: var(--mint); }
.fr-art-plus { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.fr-subhead { font-size: 16px; margin: 0 0 12px; }
.fr-kind-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.fr-kind-tiles li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fdfcf8; }
.fr-kind-tiles strong { display: block; font-size: 13px; }
.fr-kind-tiles small { display: block; font-size: 12px; color: var(--muted); }
.fr-insight { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 24px; align-items: center; }
.fr-rating { display: grid; justify-items: center; text-align: center; gap: 2px; }
.fr-rating-value { font: 700 40px/1 'Baloo 2', Baloo, sans-serif; }
.fr-rating .fr-stars { font-size: 22px; }
.fr-rating small { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .fr-split, .fr-insight { grid-template-columns: 1fr; }
  .fr-detail { position: static; }
  .fr-oldest { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 520px) {
  .fr-empty { grid-template-columns: 1fr; justify-items: start; }
  .fr-detail-head { grid-template-columns: auto minmax(0, 1fr); }
  .fr-detail-head .fr-status { grid-column: 2; justify-self: start; }
  .fr-bubble { max-width: 100%; }
}

/* Therapist assessments (18 Oct 2026, operations/assessments.py): the form (sections, levels with notes, threshold
   grids, a sticky Save / Sign bar), the office list, and the A4 report that prints to PDF. */
.as-narrow { max-width: 640px; }
.as-start { display: grid; gap: 12px; }
.as-for { margin: 0; }
.as-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.as-head h2 { margin: 2px 0 4px; font-size: 22px; }
.as-head p { margin: 0; color: var(--muted); font-size: 13px; }
.as-readonly { background: var(--soft-yellow); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.as-jump { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; }
.as-jump a { flex: none; font-size: 12px; font-weight: 700; text-decoration: none; padding: 5px 10px; border-radius: 999px; background: #f4f1e8; }
.as-section { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; background: #fff; scroll-margin-top: 70px; }
.as-section > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.as-section > summary::-webkit-details-marker { display: none; }
.as-section > summary::after { content: "\25BE"; color: var(--muted); }
.as-section:not([open]) > summary::after { content: "\25B8"; }
.as-section > summary h3 { margin: 0; font-size: 16px; }
.as-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; padding: 0 14px 14px; }
.as-fields .wide { grid-column: 1 / -1; }
.as-plain label, .as-level > label, .as-label, .as-multi legend { font-weight: 700; font-size: 13px; display: block; margin-bottom: 4px; }
.as-plain .field-help, .as-level .field-help, .as-grid .field-help, .as-multi .field-help { margin: 0 0 6px; }
.as-level-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px; align-items: start; }
.as-level-row textarea { min-height: 42px; }
.as-multi { border: 0; padding: 0; margin: 0; }
.as-multi > div { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.as-multi label { font-weight: 400; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.as-grid-scroll { overflow-x: auto; }
.as-grid table { border-collapse: collapse; min-width: 100%; }
.as-grid th { font-size: 12px; color: var(--muted); padding: 4px 6px; text-align: center; white-space: nowrap; }
.as-grid tbody th { text-align: left; color: var(--ink); }
.as-grid td { padding: 3px; }
.as-grid td input { width: 100%; min-width: 58px; min-height: 36px; text-align: center; padding: 4px; }
.as-cell-error { display: block; color: #a2482a; font-size: 10px; }
.as-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 0; background: linear-gradient(rgba(255, 255, 255, 0), #fff 30%); }
.as-status { margin-right: auto; font-size: 12px; color: var(--muted); }
/* Staff app: the bar sits above the fixed tab bar (72 px) and leaves room for the round chat bell on the right. */
.staff-app .as-actions { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); padding-right: 58px; }
.as-list { padding: 0; overflow: hidden; }
.as-list-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.as-list-row:hover { background: #fcfaf4; }
.as-list-main strong, .as-list-meta { display: block; }
.as-list-main small, .as-list-meta small { display: block; color: var(--muted); font-size: 12px; }
.as-list-meta { text-align: right; font-size: 13px; }
.as-list-search { margin-left: auto; }
.fr-empty-inline { padding: 22px 16px; }
.fr-empty-inline p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.segments.five { grid-template-columns: repeat(5, 1fr); }
.segments.five a { font-size: 12px; padding-left: 2px; padding-right: 2px; }
.assess-row { display: block; text-decoration: none; color: inherit; }
@media (max-width: 700px) {
  .as-fields { grid-template-columns: 1fr; }
  .as-level-row { grid-template-columns: 1fr; }
  .as-status { flex-basis: 100%; margin: 0; }
  .as-actions .button { flex: 1 1 0; min-height: 42px; }
  .as-head { flex-direction: column; }
  .as-list-row { grid-template-columns: 1fr; gap: 4px; }
  .as-list-meta { text-align: left; }
}

/* The report: an A4 sheet on screen, the same page in print (Download PDF = the browser's Save as PDF). */
.as-report-body { background: #ebe8de; }
.as-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 10px 16px; background: #fdfcf8; border-bottom: 1px solid var(--line); }
.as-share { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.as-toast { font-size: 12px; background: var(--soft-mint); border-radius: 999px; padding: 4px 10px; }
.as-sheet { position: relative; box-sizing: border-box; width: min(210mm, calc(100% - 24px)); min-height: 297mm; margin: 18px auto; padding: 16mm 15mm; background: #fff; color: var(--ink); box-shadow: 0 6px 30px rgba(61, 61, 61, .12); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.as-watermark { position: absolute; top: 40%; left: 0; right: 0; margin: 0; text-align: center; transform: rotate(-24deg); font-family: "Baloo 2", Baloo, sans-serif; font-weight: 700; font-size: 46px; line-height: 1; color: rgba(242, 181, 160, .35); pointer-events: none; }
.as-letterhead { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding-bottom: 10px; border-bottom: 3px solid var(--yellow); }
.as-letterhead img { height: 52px; width: auto; }
.as-letterhead div { text-align: right; font-size: 11px; color: var(--muted); display: grid; }
.as-letterhead strong { color: var(--ink); font-size: 13px; }
.as-sheet h1 { font-size: 22px; margin: 14px 0 10px; }
.as-sheet h2 { font-size: 15px; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.as-sheet h3 { font-size: 13px; margin: 10px 0 2px; }
.as-sheet p { margin: 0 0 6px; }
.as-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; margin: 0 0 14px; padding: 10px 12px; background: #faf8f2; border-radius: 8px; }
.as-details dt, .as-answers dt { font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.as-details dd { margin: 1px 0 0; font-weight: 700; }
.as-in-short { border-left: 4px solid var(--mint); background: var(--soft-mint); padding: 10px 14px; border-radius: 0 8px 8px 0; margin-bottom: 14px; }
.as-in-short h2 { border: 0; padding: 0; margin-bottom: 4px; }
.as-block { margin-bottom: 14px; }
.as-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; }
.as-answers > div { break-inside: avoid; }
.as-answers > div.long { grid-column: 1 / -1; }
.as-answers dd { margin: 1px 0 0; }
.as-level-value { font-weight: 700; }
.as-notes { display: block; color: #57554e; }
.as-table { border-collapse: collapse; margin: 6px 0 10px; font-size: 11.5px; }
.as-table caption { text-align: left; font-weight: 700; padding-bottom: 3px; }
.as-table th, .as-table td { border: 1px solid var(--line); padding: 3px 8px; text-align: center; }
/* a column heading breaks between syllables ("Attend-ance"), never at any letter (the sheet's overflow-wrap) */
.as-table th { overflow-wrap: normal; hyphens: auto; }
.as-table tbody th { text-align: left; }
.as-audiogram { margin: 4px 0 8px; }
.as-audiogram svg { width: 100%; max-width: 420px; height: auto; display: block; }
.as-audiogram .grid-line { stroke: #e3dfd2; stroke-width: 1; }
.as-audiogram .axis { font-size: 9px; fill: #77766e; }
.as-audiogram .bone { font-size: 12px; font-weight: 700; }
.as-audiogram figcaption { font-size: 10px; color: var(--muted); }
.as-audiogram .right { color: #C0392B; }
.as-audiogram .left { color: #2E6DA4; }
.as-plan-line { background: var(--soft-yellow); border-radius: 6px; padding: 6px 10px; }
/* Indian report parts (AS1b): provisional diagnosis under the case details, the RPwD pointer, the next steps. */
.as-diagnosis { margin: -4px 0 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.as-note { font-size: 11px; color: #57554e; background: #faf8f2; border-radius: 6px; padding: 6px 10px; }
.as-steps { margin: 2px 0 6px; padding-left: 18px; }
.as-steps li { margin-bottom: 2px; }
/* Progress reports (PR1): the level at the last assessment before the level now; the period's goals. */
.as-before { color: #77766e; }
.as-goals td { text-align: left; }
.as-sign { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.as-addendum { border-left: 3px solid var(--blue); padding: 4px 10px; margin-bottom: 8px; }
.as-addendum small, .as-muted, .as-confidential { color: var(--muted); font-size: 10.5px; }
.as-confidential { margin-top: 16px; text-align: center; }
.as-after { width: min(210mm, calc(100% - 24px)); margin: 0 auto 30px; display: grid; }
.as-after form { display: grid; gap: 6px; background: #fff; padding: 14px; border-radius: 12px; }
@media (max-width: 640px) {
  .as-sheet { padding: 18px 14px; min-height: 0; }
  .as-details, .as-answers { grid-template-columns: 1fr 1fr; }
  .as-letterhead { flex-direction: column; align-items: flex-start; }
  .as-letterhead div { text-align: left; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  .as-report-body { background: #fff; }
  .as-toolbar, .as-after, .skip-link { display: none !important; }
  .as-sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; font-size: 11.5px; }
  .as-watermark { position: fixed; top: 45%; }
}

/* Staff files (18 Oct 2026, operations/staff_files.py, docs/HR-PLAN.md HR1): the list with what needs doing, and one
   person's file (job, personal, registration, documents checklist, leave). */
.sf-summary { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sf-summary a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: inherit; height: 100%; box-sizing: border-box; }
.sf-summary strong { font-size: 22px; min-width: 28px; color: var(--muted); }
.sf-summary strong.has-items { color: #a2482a; }
.sf-summary span { font-size: 13px; }
.sf-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 120px minmax(0, 1.4fr); gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.sf-row:hover { background: #fcfaf4; }
.sf-name strong, .sf-name small { display: block; }
.sf-name small, .sf-docs, .sf-flags small { color: var(--muted); font-size: 12px; }
.sf-flags { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.sf-reg { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; justify-self: start; background: #f4f1e8; }
.sf-valid { background: var(--soft-mint); }
.sf-soon, .sf-no_date, .sf-missing { background: var(--soft-yellow); }
.sf-expired { background: #f7d9cf; color: #8a3a20; }
.sf-none { background: transparent; color: var(--muted); font-weight: 400; }
.sf-open { list-style: none; margin: 0; padding: 0; }
.sf-open li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sf-open form { margin: 0; }
.sf-attention { border-left: 4px solid var(--peach); }
.sf-attention ul { margin: 0; padding-left: 18px; }
.sf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.sf-grid .records-card { margin: 0; }
.sf-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.sf-dl .wide { grid-column: 1 / -1; }
.sf-dl dt { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.sf-dl dd { margin: 2px 0 0; }
.sf-checklist { list-style: none; margin: 0 0 10px; padding: 0; }
.sf-checklist li { padding: 4px 0; }
.sf-checklist li.done span { color: #2f7a4f; font-weight: 700; }
.sf-checklist small { color: var(--muted); }
.sf-leave { margin: 0; padding-left: 18px; font-size: 13px; }
@media (max-width: 900px) {
  .sf-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-row { grid-template-columns: 1fr; gap: 4px; }
  .sf-grid, .sf-dl { grid-template-columns: 1fr; }
}

/* Attendance by HR (18 Oct 2026, operations/attendance_hr.py): the day sheet (mark a missing punch with times and why)
   and the month register (person x day, gaps in peach, the name column stays while the days scroll). */
.at-daynav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.at-daynav form { display: flex; gap: 6px; margin: 0; }
.at-counts { margin-left: auto; font-size: 13px; color: var(--muted); }
.at-counts strong { color: var(--ink); }
.at-counts strong.has-items { color: #a2482a; }
.at-mark { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.at-mark select { min-width: 110px; }
.at-mark input[type=time] { width: 104px; }
.at-mark input[type=text] { flex: 1 1 170px; min-width: 150px; }
.at-by { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.at-day tr.at-missing td:first-child, .at-day tr.at-no_login td:first-child { box-shadow: inset 3px 0 0 var(--peach); }
.at-legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.at-legend b { color: var(--ink); }
.at-legend b.gap { color: #a2482a; }
.late-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #c0392b; vertical-align: middle; }
.at-month-wrap { overflow-x: auto; }
.at-month { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.at-month th, .at-month td { padding: 4px 5px; text-align: center; white-space: nowrap; }
.at-month thead a { text-decoration: none; color: inherit; display: grid; line-height: 1.1; }
.at-month thead small { font-size: 9.5px; color: var(--muted); font-weight: 400; }
.at-month th.sun { background: #f4f1e8; }
.at-month .at-name { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; min-width: 140px; box-shadow: 1px 0 0 var(--line); }
.at-month .at-name small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.at-cell { font-weight: 700; color: #57554e; position: relative; }
.at-cell.gap { background: #f7d9cf; color: #8a3a20; }
.at-cell.late::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: #c0392b; }
@media (max-width: 700px) {
  .at-counts { margin-left: 0; flex-basis: 100%; }
  .at-mark input[type=text] { flex-basis: 100%; }
}
.at-cell.out { box-shadow: inset 0 -3px 0 var(--blue); }
/* a punch waiting for review: counted as in, marked by a dotted marigold ring (12 Nov 2026) */
.at-cell.review { outline: 2px dashed var(--accent, #e0a526); outline-offset: -4px; }
.review-box { display: inline-block; padding: 0 5px; font-weight: 700; color: var(--ink); outline: 2px dashed var(--accent, #e0a526); outline-offset: -1px; border-radius: 3px; }
.at-review-count { display: block; font-size: 11px; font-weight: 700; color: var(--marigold-ink, #7a5a12); white-space: nowrap; }
.out-bar { display: inline-block; width: 12px; height: 3px; background: var(--blue); vertical-align: middle; }
.sf-summary .sf-tile { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); height: 100%; box-sizing: border-box; }
.sf-summary .sf-tile strong { color: var(--ink); }
/* Saving without a reload (static/page.js data-inplace): the toast with the saved message, the part being saved,
   and the small "Remove the mark" button. */
.inplace-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; margin: 0; max-width: min(560px, calc(100% - 32px)); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(61, 61, 61, .25); }
section[aria-busy="true"] { opacity: .6; transition: opacity .15s; }
.link-button { border: 0; background: none; padding: 2px 0; color: #a2482a; font-size: 12px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.at-clear { margin: 4px 0 0; }

/* Hiring (18 Oct 2026, operations/hiring.py): quick links, the stage board, the candidate page, the offer letter and
   the public careers page. */
.hr-quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.hr-quick a { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; color: inherit; font-size: 13px; font-weight: 700; }
.hr-quick a:hover { background: #fcfaf4; }
.hr-quick svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: #6e6a60; }
.hire-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.hire-lane { background: #f6f3ea; border-radius: 12px; padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 120px; }
.hire-lane h2 { margin: 0 0 2px; font-size: 14px; display: flex; justify-content: space-between; }
.hire-lane h2 span { color: var(--muted); font-weight: 400; }
.hire-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 3px; }
.hire-card.is-stuck { border-left: 4px solid var(--peach); }
.hire-card small { color: var(--muted); font-size: 12px; }
.hire-card a { text-decoration: none; }
.hire-move { display: grid; grid-template-columns: 1fr auto; gap: 4px; margin-top: 6px; }
.hire-move input { grid-column: 1 / -1; grid-row: 2; font-size: 12px; }
.hire-move select { font-size: 12px; }
.hire-empty { color: var(--muted); margin: 0; text-align: center; }
.hire-closed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hire-closed h3 { margin: 0 0 4px; font-size: 14px; }
.hire-closed ul { margin: 0; padding-left: 18px; font-size: 13px; }
.hire-stage { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hire-stage input { flex: 1 1 200px; }
.hire-interview { border-bottom: 1px solid var(--line); padding: 8px 0; }
.hire-interview p { margin: 0 0 4px; }
.hire-feedback { margin-top: 8px; }
.hire-feedback summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.hire-feedback form { margin-top: 8px; }
.hire-now { margin: 10px 0; }
.letter-date { text-align: right; margin-top: 12px; }
.letter-subject { font-size: 17px; margin: 14px 0 10px; text-decoration: underline; }
.letter-terms th { text-align: left; width: 38%; }
.letter-terms td { text-align: left; }
.letter-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 40px; }
.sign-line { border-top: 1px solid var(--ink); padding-top: 4px; margin-top: 38px; font-size: 12px; }
.careers { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.careers-head { text-align: center; margin-bottom: 18px; }
.careers-head img { height: 64px; width: auto; }
.careers-head h1 { margin: 10px 0 6px; }
.careers-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.careers-card h2 { margin: 0 0 4px; }
.careers-meta { color: var(--muted); margin: 0 0 8px; }
.careers-form { display: grid; gap: 12px; }
.careers-field label { display: block; font-weight: 700; margin-bottom: 4px; }
.careers-field input:not([type=checkbox]) { width: 100%; box-sizing: border-box; }
.careers-field.consent { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 8px; align-items: center; }
.careers-field.consent label { font-weight: 400; margin: 0; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 900px) {
  .hr-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hire-closed, .letter-sign { grid-template-columns: 1fr; }
}

/* Payroll (18 Oct 2026, operations/payroll.py): the salary sheet and the payslip. */
.pay-sheet td, .pay-sheet th { vertical-align: top; font-size: 13px; }
.pay-sheet tr.pay-paid td { background: #f3f8f4; }
.pay-edit td { background: #fcfaf4; }
.pay-line { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 0; }
.pay-line label { display: grid; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); }
.pay-line input { width: 120px; }
.pay-line input[name$=note] { width: 180px; }
.pay-paid .sf-checklist { margin-bottom: 8px; }
.pay-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pay-table { width: 100%; }
.pay-table th { text-align: left; }
.pay-table td { text-align: right; }
.pay-total th, .pay-total td { font-weight: 700; background: #faf8f2; }
.pay-net { font-size: 16px; margin: 14px 0 6px; padding: 10px 12px; background: var(--soft-mint); border-radius: 8px; }
@media (max-width: 640px) { .pay-columns { grid-template-columns: 1fr; } }

/* Payroll — what the law asks, checked by the CRM (operations/payroll.py law_status) */
.pay-law h2 { margin-top: 0; }
.pay-law ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.pay-law li { position: relative; padding: 6px 10px 6px 30px; border-radius: 8px; font-size: 13px; background: #faf8f2; }
.pay-law li::before { position: absolute; left: 11px; top: 6px; font-weight: 700; }
.pay-law li.is-ok::before { content: "✓"; color: #3f7a52; }
.pay-law li.is-warn { background: #fdeee8; }
.pay-law li.is-warn::before { content: "!"; color: #a2482a; }
.pay-law li.is-note::before { content: "i"; color: #4a6f80; }

/* Absence notices in the staff app and the team app (templates/partials/absence_notices.html) */
.notices h2 small { font-weight: 700; color: #a2482a; margin-left: 6px; }
.notice-card { border-left: 4px solid var(--line); }
.notice-card.is-open { border-left-color: #F2B5A0; }
.notice-head { margin: 0 0 6px; }
.notice-card details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.notice-letter { margin-top: 10px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; line-height: 1.5; }
.notice-letter h3 { margin: 0 0 8px; font-size: 16px; }
.notice-letter p { margin: 0 0 8px; }
.notice-letter .notice-sign { margin-top: 12px; font-weight: 700; }
.notice-card .app-form .button + .button { margin-top: 8px; }
.notice-alert { display: grid; gap: 4px; text-decoration: none; color: inherit; border-left: 4px solid #F2B5A0; }

/* CDDC checklist items (18 Oct 2026, operations/cddc.py): age band headings, Haan / Emerging / Nahi as big tap targets on
   the form; on the report a band table and the emerging / not-achieved skills in two columns. */
.as-band { margin: 4px 0 -4px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #7a6a3c; }
.as-item { border: 0; padding: 0; margin: 0; min-width: 0; }
.as-item legend { font-weight: 700; font-size: 13.5px; padding: 0; margin-bottom: 2px; }
.as-item .field-help { margin: 0 0 6px; }
.as-item-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.as-item-choices label { position: relative; display: inline-flex; align-items: center; margin: 0; min-height: 38px; padding: 6px 16px; border: 1px solid #dcd9cf; border-radius: 999px; background: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.as-item-choices input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.as-item-choices label:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.as-item-choices .as-score-1:has(input:checked) { background: var(--soft-mint); border-color: #7fae8e; color: #2f5e3d; }
.as-item-choices .as-score-2:has(input:checked) { background: var(--soft-yellow); border-color: var(--yellow); color: #6b5310; }
.as-item-choices .as-score-3:has(input:checked) { background: #fbece5; border-color: var(--peach); color: #8a3a20; }
.as-item-choices label:has(input:checked)::before { content: "\2713\00a0"; }
.as-checklist th:first-child { white-space: nowrap; }
/* Yes / No statements (paediatric OT assessment, 26 Oct 2026): the statement and two tap targets on one line, like the
   paper intake form; on the report the answer sits at the end of its statement. */
.as-section-help { margin: -4px 14px 10px; }
.as-yesno { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.as-yesno-q { flex: 1 1 160px; font-weight: 700; font-size: 13px; }
.as-yesno .as-item-choices { flex: none; }
.as-yesno .as-item-choices label { min-height: 36px; padding: 4px 16px; }
.as-yesno .as-item-choices label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.as-answers > div.yesno { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px dotted var(--line); padding-bottom: 2px; }
.as-answers > div.yesno dt { text-transform: none; letter-spacing: 0; font-size: 11.5px; font-weight: 400; color: var(--ink); }
.as-answers > div.yesno dd { flex: none; font-weight: 700; }
.as-answers > div.as-subhead dt { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink); margin-top: 4px; }
.as-subhead-form { margin: 6px 0 -4px; font-weight: 800; font-size: 13px; }
.as-rest-no { justify-self: start; }
.as-skill-list { columns: 2; column-gap: 24px; margin: 2px 0 8px; padding-left: 18px; font-size: 11.5px; }
.as-skill-list li { break-inside: avoid; margin-bottom: 2px; }
@media (max-width: 700px) { .as-skill-list { columns: 1; } }

/* OT goal plan sheet (OT report part A, 19 Oct 2026) */
.gp-write p { margin: 6px 0; display: flex; gap: 8px; align-items: flex-end; }
.gp-line { display: inline-block; flex: 1; min-width: 160px; min-height: 18px; border-bottom: 1px solid var(--ink, #3d3d3d); }
.gp-table { width: 100%; }
.gp-table th, .gp-table td { text-align: left; vertical-align: top; }
.gp-table tbody th { width: 22%; background: #faf6ea; }
.gp-table ul { margin: 0; padding-left: 16px; }
/* a cell keeps whole words; the sheet's overflow-wrap: anywhere squeezed phone columns to a letter each ("B al a nc") */
.gp-table td { overflow-wrap: break-word; hyphens: auto; }
.gp-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gp-signs .gp-line { display: block; margin-top: 28px; }
.gp-sign-label { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #77766e); }
@media (max-width: 640px) { .gp-signs { grid-template-columns: 1fr; } }
.gp-report td { font-size: 11px; }
.gp-report th[scope="rowgroup"] { width: 14%; }
.gp-levels { width: auto; min-width: 50%; }
.gr-return { display: grid; gap: 6px; max-width: 820px; margin: 10px auto; }
.gr-return textarea { width: 100%; }
.gr-note { max-width: 820px; margin: 10px auto; padding: 8px 12px; border-radius: 10px; background: #fbece5; }
@media print { .gr-return, .gr-note { display: none; } }
/* NG-1: a long Next goal plan (rowspan cell) crossing a page printed its last line over the next row */
@media print { .gp-report tr, .gp-report td[rowspan] { break-inside: avoid; } .as-block > h2 { break-after: avoid; } }

/* Cases, one filter row (OWN-2, 6 Nov 2026): dates and tag under "More filters"; one Export menu; who does the next
   step and since how long under its button. */
.patient-filters .filter-more { position: relative; }
.patient-filters .filter-more > summary { list-style: none; display: inline-flex; align-items: center; min-height: 38px; margin: 0;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; color: var(--ink); }
.patient-filters .filter-more > summary::after { content: none; }
.patient-filters .filter-more[open] > summary { border-color: var(--yellow); background: var(--soft-yellow); }
.filter-more-body { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; display: grid; gap: 8px; min-width: 260px;
  padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px #3d3d3d22; }
.filter-more-body .filter-inline { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.menu-button { position: relative; display: inline-block; }
.menu-button > summary { list-style: none; margin: 0; }
.menu-button > summary::after { content: " \25BE"; }
.menu-button[open] > summary::after { content: " \25B4"; }
.menu-list { position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); display: grid; min-width: 150px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px #3d3d3d22; }
.menu-list a { padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.menu-list a:hover { background: var(--soft-yellow); }
.rail-foot { margin: 10px 8px 0; font-size: 13px; }
.rail-foot a { color: var(--ink); font-weight: 700; }
.step-owner { margin-top: 4px; color: var(--muted); }
.care-late { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--soft-peach); color: var(--peach-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
a.care-late:hover { text-decoration: underline; }
.care-table td { vertical-align: middle; }
.patient-filters { flex-wrap: nowrap; }
.patient-filters input[type="search"] { flex: 1 1 160px; min-width: 120px; }
.patient-filters > select { flex: 0 1 auto; max-width: 160px; min-width: 0; }
.patient-filters .filter-more-body select { max-width: none; }
@media (max-width: 1100px) { .patient-filters { flex-wrap: wrap; } }
/* Cases below 1500px wide (OWN-2: the table's Next step was cut off beside the rail): the views become chips above
   the table, which then has the whole width. */
@media (max-width: 1500px) {
  .patient-workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .patient-workspace .lead-rail { position: static; max-height: none; padding: 8px 10px; }
  .patient-workspace .rail-views .rail-caption { display: none; }
  .patient-workspace .rail-views ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .patient-workspace .rail-views a { border: 1px solid var(--line); border-radius: 16px; padding: 5px 10px; font-size: 12px; }
  .patient-workspace .rail-foot { margin: 8px 4px 0; }
}

/* TH-APP (13 Nov 2026; user: text "jo normal aps me hota hi vhi rakhna"): on a phone a goal plan / home plan / report sheet
   is read at app text size (13 px the smallest) with phone margins; the A4 paper look stays on wider screens and in print. */
@media screen and (max-width: 699px) {
  .as-sheet { font-size: 14px; padding: 18px 16px; min-height: 0; }
  .as-sheet dt, .as-sheet th, .as-sheet small, .as-sheet .as-muted, .as-sheet .gp-sign-label { font-size: 13px; }
  .as-sheet dd, .as-sheet td, .as-sheet p, .as-sheet li, .as-sheet strong { font-size: 14px; }
}

/* PA-2: Reminders — what families told the clinic in the app (coming / not coming), the past ones too */
.family-news { margin-bottom: 20px; }
.family-news .card-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.family-news-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.family-news-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); }
.family-news-list li.unread { background: var(--soft-yellow); }
.family-news-list a { color: var(--ink); text-decoration: none; }
.family-news-list small { white-space: nowrap; }
.push-office [hidden] { display: none; }
/* DESK-NAV: the long "Get notifications here" button wraps on a phone instead of running off the screen */
.push-office .button { white-space: normal; max-width: 100%; text-align: left; }
/* DESK-NAV (17 Nov 2026, the user: "har page mobile view or desktop view pr sahi ho … usko struggle na krna pade"): the
   leads list on a phone. Each lead is a card (the table was 905 px wide on a 375 px screen, so every row had to be
   scrolled sideways to reach its follow-up and Log call): name and phone, then stage | next follow-up, last activity |
   source, then the buttons; the tick box sits in the card's corner. The views are one-line chips. */
@media (max-width: 700px) {
  .rail-views a { white-space: nowrap; }
  .leads-js .bulk-bar:not(.has-ticks) .bulk-help { display: none; }  /* "0 ticked" only, until a lead is ticked */
  .lead-workspace .records-table-wrap { overflow: visible; border: 0; background: none; box-shadow: none; }
  .lead-table, .lead-table tbody { display: block; width: 100%; min-width: 0; }
  .lead-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lead-table tbody tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px;
    margin: 0 0 10px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
  .lead-table tbody td { display: block; min-width: 0; padding: 0; border: 0; }
  .lead-table .lead-cell { grid-column: 1 / -1; min-width: 0; }
  .lead-table tbody tr:has(td.tick) { padding-left: 42px; }
  .lead-table td.tick { position: absolute; top: 13px; left: 12px; width: auto; }
  .lead-table td.row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .lead-table td.row-actions form { margin: 0; }
  .lead-table td.empty-cell { grid-column: 1 / -1; }
  .lead-table tr.is-overdue td:first-child { box-shadow: none; }
  .lead-table tr.is-overdue { border-left: 4px solid #d0704f; }
}
