/* CHAMP Within Me — staff dashboards. Mobile-first; matches the approved design canvas. */

@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/newsreader-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/newsreader-latin-500-normal.woff2') format('woff2'); }

:root {
  --bg: #F7F3F1;
  --surface: #FFFFFF;
  --ink: #1E1B2E;
  --muted: #5E5A6B;
  --line: #EEEAF0;
  --line-strong: #E2DDE6;
  --indigo: #2E2B57;
  --indigo-soft: #3E3A6E;
  --indigo-text: #D6D3F0;
  --accent: #6C63B5;
  --lavender: #ECE9F7; --lavender-ink: #3A3570;
  --peach: #FBE7E1;    --peach-ink: #7A3A28;
  --sky: #E3EDF7;      --sky-ink: #23496E;
  --sand: #F8EDDA;     --sand-ink: #6E4A12;
  --sage: #E5EFE7;     --sage-ink: #2C5A3A;
  --danger: #8E2F22;
  --surface-2: #F7F3F1;
  --link: #3A3570;
  --hover: #F4F0F6;
  --pop-bg: rgba(255, 255, 255, .92);
  --pop-shadow: 0 18px 50px -12px rgba(30, 27, 46, .28);
  --brand-word: #3A2A8C;
  --brand-sub: #6C5BD6;
  --scroll: #C9C4D2;
  color-scheme: light;
  --radius: 22px;
  --radius-sm: 14px;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
a { color: var(--lavender-ink); }
a:hover { color: var(--indigo); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.15; }
h1 { font-size: 30px; }
h2 { font-size: 22px; font-weight: 500; }
h3 { font-size: 18px; font-weight: 500; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.serif-num { font-family: var(--serif); font-size: 36px; line-height: 1; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Thin scrollbars, visible on hover only */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover { scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }
*:hover::-webkit-scrollbar-thumb { background: var(--scroll); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- App shell ---------- */
/* Phones and tablets: a top bar with a menu button; the menu slides in from the left.
   Wide screens: the menu is a fixed sidebar. */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; min-width: 0; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.topbar .who { display: flex; align-items: center; gap: 10px; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--lavender); color: var(--lavender-ink); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 18px; }
.brand { font-family: var(--serif); font-size: 26px; }

.mobile-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: rgba(247, 243, 241, .86); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.mobile-bar .mb-title { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.mobile-bar .mb-title .brand { font-size: 22px; }
.mobile-bar .mb-title .mb-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-bar .mb-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mobile-bar .avatar { width: 38px; height: 38px; font-size: 16px; }
.menu-btn { position: relative; flex: none; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.menu-btn:hover { background: var(--lavender); }
.menu-btn .burger { position: relative; width: 18px; height: 12px; }
.menu-btn .burger span { position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease, top .2s ease; }
.menu-btn .burger span:nth-child(1) { top: 0; }
.menu-btn .burger span:nth-child(2) { top: 5px; }
.menu-btn .burger span:nth-child(3) { top: 10px; }
.menu-btn[aria-expanded="true"] .burger span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .burger span:nth-child(3) { top: 5px; transform: rotate(-45deg); }
.menu-btn .menu-dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger, #B4413C); border: 2px solid var(--surface); }

.sidebar { display: flex; flex-direction: column; gap: 4px; background: var(--surface); padding: 28px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar:hover { scrollbar-color: var(--line-strong) transparent; }
.sidebar .sb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sidebar .brand { padding: 0 12px; }
.sidebar .facility { font-size: 13px; color: var(--muted); padding: 2px 12px 24px; }
.sidebar .sb-close { display: none; }
.sidebar a { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-radius: 14px; color: var(--ink); text-decoration: none; }
.sidebar a:hover { background: var(--bg); }
.sidebar a[aria-current="page"] { background: var(--indigo); color: #fff; font-weight: 700; }
.sidebar .spacer { flex: 1; min-height: 16px; }
.sidebar form button { width: 100%; text-align: left; min-height: 46px; padding: 0 14px; border-radius: 14px; background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 10px; }
.sidebar form button:hover { background: var(--bg); color: var(--ink); }
.sidebar .sb-user { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 899px) {
  .sidebar { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); padding: calc(20px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 24px 60px rgba(46, 43, 87, .22); border-radius: 0 28px 28px 0; transform: translateX(-104%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); visibility: hidden; }
  .shell.nav-open .sidebar { transform: none; visibility: visible; }
  .sidebar .sb-close { display: inline-flex; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--bg); color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }
  .sidebar .sb-user { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; padding: 12px; border-radius: 20px; background: var(--bg); }
  .sidebar .sb-user strong { display: block; font-size: 15px; }
  .sidebar .sb-user span { font-size: 12px; color: var(--muted); }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(46, 43, 87, .12); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .shell.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-locked { overflow: hidden; }
  .topbar .who, .topbar .topbar-facility { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .nav-backdrop, .menu-btn .burger span { transition: none; } }

@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .mobile-bar { display: none; }
  .sidebar { flex: 0 0 248px; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; }
  .main { padding: 32px 40px 48px; gap: 24px; }
  h1 { font-size: 40px; }
}

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3E8E63; margin-left: 6px; vertical-align: middle; box-shadow: 0 0 0 0 rgba(62, 142, 99, .5); animation: live-pulse 2.4s ease-out infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(62, 142, 99, .45); } 70% { box-shadow: 0 0 0 7px rgba(62, 142, 99, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 142, 99, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.msg-send-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
@media (hover: none) { .msg-send-row .tiny { display: none; } }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.grid-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .grid-tiles { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; } }
.tile { border-radius: var(--radius); padding: 16px; }
.tile .label { font-size: 13px; font-weight: 700; }
.tile .value { margin-top: 8px; font-family: var(--serif); font-size: 34px; line-height: 1; }
.tile .note { margin-top: 8px; font-size: 13px; }
.t-lavender { background: var(--lavender); color: var(--ink); } .t-lavender .label, .t-lavender .note { color: var(--lavender-ink); }
.t-peach { background: var(--peach); } .t-peach .label, .t-peach .note { color: var(--peach-ink); }
.t-sky { background: var(--sky); } .t-sky .label, .t-sky .note { color: var(--sky-ink); }
.t-sand { background: var(--sand); } .t-sand .label, .t-sand .note { color: var(--sand-ink); }
.t-sage { background: var(--sage); } .t-sage .label, .t-sage .note { color: var(--sage-ink); }
.hero { background: var(--indigo); color: #fff; border-radius: 28px; padding: 24px; }
.hero .muted { color: var(--indigo-text); }

.row-split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row-split > .wide { flex: 999 1 520px; min-width: 0; }
.row-split > .narrow { flex: 1 1 320px; min-width: 0; }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.p-ok { background: var(--sage); color: var(--sage-ink); }
.p-warn { background: var(--sand); color: var(--sand-ink); }
.p-info { background: var(--sky); color: var(--sky-ink); }
.p-bad { background: var(--peach); color: var(--peach-ink); }
.p-neutral { background: var(--line); color: var(--muted); }

/* Buttons and forms */
.btn { min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: #24214A; color: #fff; }
.btn-quiet { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); font-weight: 400; }
.btn-block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 700; }
.field .hint { font-size: 13px; color: var(--muted); }
.input, select.input { min-height: 52px; width: 100%; border: 1.5px solid var(--line-strong); border-radius: 16px; padding: 0 16px; font: inherit; font-size: 16px; background: var(--surface); color: var(--ink); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(108, 99, 181, .2); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232E2B57' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.error { color: var(--danger); font-size: 14px; font-weight: 700; }
.input.has-error { border-color: var(--danger); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--indigo); }

.flash { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 15px; line-height: 1.45; background: var(--sky); color: var(--sky-ink); }
.flash-ok { background: var(--sage); color: var(--sage-ink); }
.flash-bad { background: var(--peach); color: var(--peach-ink); }

/* Tables that become cards on phones */
.rtable { width: 100%; border-collapse: collapse; font-size: 15px; }
.rtable th { text-align: left; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rtable td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
@media (max-width: 899px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { background: var(--bg); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; }
  .rtable td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; }
  .rtable td::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
  .rtable td.primary { font-size: 16px; font-weight: 700; }
  .rtable td.primary::before { content: none; }
}

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-plain li .when { flex: 0 0 72px; color: var(--muted); }

/* ---------- Signed-out screens: brand panel + centred form ---------- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .auth-split { grid-template-columns: minmax(380px, 46%) 1fr; } }
.auth-art { display: none; position: relative; overflow: hidden; color: #fff; padding: 56px 48px;
  background:
    radial-gradient(80% 60% at 85% 0%, rgba(176, 150, 255, .40) 0%, rgba(176, 150, 255, 0) 60%),
    radial-gradient(70% 50% at 0% 100%, rgba(20, 14, 60, .7) 0%, rgba(20, 14, 60, 0) 70%),
    linear-gradient(155deg, #1B1748 0%, #2C2378 50%, #4B3AA8 100%); }
@media (min-width: 960px) { .auth-art { display: flex; flex-direction: column; justify-content: space-between; position: sticky; top: 0; height: 100vh; } }
.aa-inner { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 18px; max-width: 420px; }
.auth-art .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.aa-title { font-family: var(--serif); font-size: clamp(34px, 3.4vw, 46px); line-height: 1.08; }
.aa-points { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.aa-points li { display: flex; align-items: center; gap: 12px; font-size: 15.5px; color: rgba(255, 255, 255, .88); }
.aa-points li span { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); }
.aa-plant { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(110%, 560px); height: auto; z-index: 1; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 16px calc(32px + env(safe-area-inset-bottom)); }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 20px; }
.auth-brand { display: flex; justify-content: center; text-decoration: none; margin-bottom: 4px; }
.auth-card .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 30px 26px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 60px -40px rgba(46, 39, 110, .45); }
@media (max-width: 480px) { .auth-card .panel { padding: 24px 18px; } }
.auth-card .panel > h1:first-child, .auth-card .panel > h1:first-child + p.muted { text-align: center; }
.auth-card .panel h1 { font-size: 32px; }
.auth-intro { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.auth-badge { width: 56px; height: 56px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; background: var(--lavender); color: var(--lavender-ink); margin-bottom: 6px; }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-tagline { text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); opacity: .8; }
.auth-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.auth-note .an-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--lavender); color: var(--lavender-ink); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row a { font-weight: 700; color: var(--link); text-decoration: none; }
.label-row a:hover { text-decoration: underline; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 46px; }
.input-icon .input.has-end { padding-right: 52px; }
.input-icon .input-end { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.input-icon .input-end:hover, .input-icon .input-end[aria-pressed="true"] { color: var(--ink); background: var(--hover); }
.input-code { text-align: center; font-size: 26px; letter-spacing: .3em; font-variant-numeric: tabular-nums; min-height: 60px; }
.disclose-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--link); cursor: pointer; min-height: 40px; padding: 0; }
.disclose-btn svg { transition: transform .15s ease; }
.disclose-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
:root[data-theme="dark"] .auth-card .panel { box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .9); }
.auth-orb { width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8F88D6 0%, var(--indigo) 80%); }
.qr { background: #fff; border-radius: 16px; padding: 12px; width: fit-content; }
.qr svg { display: block; width: 200px; height: 200px; }
.code-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: 1px; background: var(--bg); border-radius: 12px; padding: 12px 14px; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.codes span { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }

/* Sheets / dialogs: transparent blurred backdrop */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: transparent; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; border-radius: 28px 28px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 40px rgba(30, 27, 46, .12); max-height: 90vh; overflow: auto; }
@media (min-width: 900px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 28px; } }
[x-cloak], [hidden] { display: none !important; }

/* ---------- CHAMP custom controls (no browser-native UI) ---------- */
.field-label { font-size: 15px; font-weight: 700; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #75261B; color: #fff; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.ui-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ui-icon-btn:hover { background: var(--bg); }
.ui-link-btn { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--lavender-ink); cursor: pointer; min-height: 40px; padding: 0 8px; }

/* Dropdown */
.ui-select, .ui-date { position: relative; }
.ui-select-trigger { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1.5px solid var(--line-strong); border-radius: 16px; padding: 0 14px 0 16px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.ui-select-trigger:hover { border-color: #CFC9D8; }
.ui-select-trigger[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 99, 181, .18); }
.ui-select-trigger.has-error { border-color: var(--danger); }
.ui-select-trigger:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.ui-select-trigger .is-placeholder { color: var(--muted); }
.ui-select-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-chevron { flex: none; color: var(--indigo); transition: transform .15s ease; }
.ui-select-trigger[aria-expanded="true"] .ui-chevron { transform: rotate(180deg); }
.ui-pop { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); background: var(--pop-bg, var(--surface)); border-radius: 18px; box-shadow: 0 12px 40px rgba(30, 27, 46, .16), 0 0 0 1px var(--line); padding: 6px; backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
.ui-pop.flip-x { left: auto; right: 0; }
.ui-pop.flip-y { top: auto; bottom: calc(100% + 6px); }
.ui-pop-backdrop { display: none; }
.ui-sheet-head { display: none; }
.ui-pop-search { display: flex; align-items: center; gap: 8px; margin: 2px 2px 6px; padding: 0 12px; min-height: 42px; border-radius: 12px; background: var(--bg); color: var(--muted); }
.ui-pop-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); outline: none; height: 40px; }
.ui-pop-search input::placeholder { color: var(--muted); }
.ui-pop-search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.ui-select-list { margin: 0; padding: 0; list-style: none; max-height: 280px; overflow-y: auto; outline: none; overscroll-behavior: contain; }
.ui-select-list .ui-empty { justify-content: center; color: var(--muted); cursor: default; font-size: 14px; }
.ui-select-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; cursor: pointer; font-size: 15px; }
.ui-select-list li.is-active { background: var(--lavender); }
.ui-select-list li[aria-selected="true"] { font-weight: 700; color: var(--lavender-ink); }
.ui-check { visibility: hidden; color: var(--accent); }
.ui-select-list li[aria-selected="true"] .ui-check { visibility: visible; }
.ui-field-compact .ui-select-trigger { min-height: 40px; border-radius: 999px; font-size: 14px; }

/* Date picker */
.ui-pop.ui-date-pop { right: auto; width: 304px; max-width: calc(100vw - 32px); border-radius: 20px; padding: 12px; }
.ui-pop.ui-date-pop.flip-x { left: auto; right: 0; }

/* Phones: dropdowns and the date picker open as a bottom sheet (moved to <body> while open). */
.ui-pop-backdrop.is-sheet { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(30, 27, 46, .18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: uiFade .18s ease-out; }
.ui-pop.is-sheet { position: fixed; z-index: 81; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; margin: 0 auto; max-height: 82vh; display: flex; flex-direction: column;
  border-radius: 26px 26px 0 0; padding: 6px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(30, 27, 46, .18); animation: uiSheetUp .24s cubic-bezier(.2, .8, .2, 1); }
.ui-pop.is-sheet .ui-sheet-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 18px 2px 10px; position: relative; }
.ui-sheet-handle { position: absolute; top: 6px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 999px; background: var(--line-strong); }
.ui-sheet-title { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-sheet-x { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ui-sheet-x:hover { background: var(--lavender); }
.ui-pop.is-sheet .ui-pop-search { margin: 0 0 10px; min-height: 48px; border-radius: 14px; }
.ui-pop.is-sheet .ui-pop-search input { font-size: 16px; } /* 16px stops iOS zooming in */
.ui-pop.is-sheet .ui-select-list { max-height: none; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; }
.ui-pop.is-sheet .ui-select-list li { min-height: 52px; padding: 0 16px; border-radius: 14px; font-size: 16px; }
.ui-pop.is-sheet .ui-select-list li.is-active:not([aria-selected="true"]) { background: transparent; }
.ui-pop.is-sheet .ui-select-list li[aria-selected="true"] { background: var(--lavender); }
.ui-pop.is-sheet.ui-date-pop .ui-date-cell { min-height: 46px; font-size: 16px; }
.ui-pop.is-sheet.ui-date-pop .ui-date-foot { margin-top: 10px; }
@media (min-width: 560px) { .ui-pop.is-sheet { max-width: 520px; } }
html.ui-sheet-open, html.ui-sheet-open body { overflow: hidden; }
@keyframes uiSheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes uiFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ui-pop.is-sheet, .ui-pop-backdrop.is-sheet { animation: none; } }
.ui-date-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ui-date-title { border: 0; background: none; font-family: var(--serif); font-size: 18px; color: var(--ink); cursor: pointer; min-height: 40px; padding: 0 10px; border-radius: 999px; }
.ui-date-title:hover { background: var(--bg); }
.ui-date-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.ui-date-grid.is-years { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ui-date-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; }
.ui-date-cell { min-height: 40px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; }
.ui-date-cell:hover:not(:disabled) { background: var(--lavender); }
.ui-date-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.ui-date-cell.is-selected { background: var(--indigo); color: #fff; font-weight: 700; }
.ui-date-cell:disabled { color: #C9C4D2; cursor: not-allowed; }
.ui-date-foot { display: flex; justify-content: space-between; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }

/* Tags */
.ui-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 52px; border: 1.5px solid var(--line-strong); border-radius: 16px; padding: 6px 8px; background: var(--surface); }
.ui-tags:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 99, 181, .18); }
.ui-tag-list { display: contents; }
.ui-tag { display: inline-flex; align-items: center; gap: 2px; background: var(--lavender); color: var(--lavender-ink); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: 14px; font-weight: 700; }
.ui-tag-remove { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.ui-tag-remove:hover { background: rgba(58, 53, 112, .12); }
.ui-tags-input { flex: 1 1 140px; min-width: 120px; border: 0; outline: none; font: inherit; font-size: 16px; min-height: 38px; background: transparent; color: var(--ink); padding: 0 6px; }

/* Toggle switch */
.ui-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.ui-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.ui-switch { flex: none; position: relative; width: 52px; height: 32px; border-radius: 999px; border: 0; background: #D9D4DE; cursor: pointer; transition: background .15s ease; }
.ui-switch[aria-checked="true"] { background: var(--indigo); }
.ui-switch-knob { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s ease; }
.ui-switch[aria-checked="true"] .ui-switch-knob { transform: translateX(20px); }

/* Day chips */
.ui-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ui-day { min-height: 44px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.ui-day[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: #fff; font-weight: 700; }

/* File drop */
.ui-file-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; padding: 20px; border: 2px dashed #CFC9D8; border-radius: 20px; background: var(--bg); color: var(--lavender-ink); text-align: center; cursor: pointer; }
.ui-file-zone:hover, .ui-file.is-over .ui-file-zone { border-color: var(--accent); background: var(--lavender); }
.ui-file-prompt { color: var(--ink); }
.ui-file-name { font-weight: 700; color: var(--ink); word-break: break-all; }

/* Sheets */
.sheet h2 { margin-bottom: 4px; }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.sheet-actions .btn { flex: 1 1 140px; }

/* Page furniture used by the facility screens */
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; }
.search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search .input { flex: 1 1 220px; min-height: 44px; border-radius: 999px; }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--lavender); color: var(--lavender-ink); border-radius: 999px; padding: 6px 6px 6px 14px; font-size: 14px; font-weight: 700; }
.chip.plain { padding: 6px 14px; }
.empty { color: var(--muted); padding: 8px 0; }
.pagination { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.pagination a, .pagination span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 0 14px; text-decoration: none; background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--ink); font-size: 14px; }
.pagination .current { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.pagination .disabled { color: #C9C4D2; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.plan-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.plan-goal { background: var(--bg); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.plan-activity { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; background: var(--surface); border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.textarea { min-height: 110px; padding: 12px 16px; line-height: 1.5; resize: vertical; }
.matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.matrix th, .matrix td { padding: 8px; border-bottom: 1px solid #F3F0F4; text-align: left; vertical-align: middle; }
.matrix th { color: var(--muted); font-size: 13px; }
.matrix-wrap { overflow-x: auto; }
.matrix .ui-pop:not(.is-sheet) { min-width: 200px; }

/* ---- Navigation extras */
.nav-label { display: inline-flex; align-items: center; gap: 12px; }
.sidebar a[aria-current="page"] svg { color: #fff; }
.sheet-menu { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sheet-menu a, .sheet-menu button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 14px; border-radius: 16px; background: none; border: 0; font: inherit; font-size: 16px; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; }
.sheet-menu a:hover, .sheet-menu button:hover { background: var(--bg); }
.sheet-menu a[aria-current="page"] { background: var(--lavender); color: var(--lavender-ink); font-weight: 700; }

/* ---- Page furniture */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); font-size: 14px; }
.segmented a[aria-current="page"] { background: var(--indigo); border-color: var(--indigo); color: #fff; font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); } }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows > li + li { border-top: 1px solid var(--line); }
.row-link, .row-item { display: flex; align-items: center; gap: 14px; padding: 12px 4px; min-height: 64px; text-decoration: none; color: var(--ink); }
.row-link:hover { background: var(--bg); border-radius: 14px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-main strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: 14px; }
.row-end { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.row-link > svg { color: var(--muted); flex: none; }
.avatar.sm { width: 38px; height: 38px; font-size: 15px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { flex: 1 1 200px; }
.note-box { background: var(--lavender); color: var(--lavender-ink); border-radius: 18px; padding: 14px 16px; font-size: 15px; }
.note-box.warn { background: var(--sand); color: var(--sand-ink); }
.note-box.bad { background: var(--peach); color: var(--peach-ink); }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.goal-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.goal-head h4 { margin: 0; font-size: 17px; }
.activity-meta { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.version-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.version-list a { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--bg); text-decoration: none; color: var(--ink); }
.filters { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: end; }
@media (min-width: 700px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .filters { grid-template-columns: repeat(5, minmax(0, 1fr)) auto; } }
.filters .btn { min-height: 48px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.badge-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--peach); color: var(--ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.draft-banner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; background: var(--sand); color: var(--sand-ink); border-radius: 18px; padding: 14px 16px; }
.lib-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lib-card { background: var(--surface); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); }
.lib-card.is-retired { opacity: .6; }
.lib-card h3 { margin: 0; font-size: 18px; }
.lib-card .lib-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.matrix td.changed .ui-select-trigger { border-color: var(--indigo); }
.matrix .default-note { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }
@media (max-width: 520px) {
  .row-item { flex-wrap: wrap; }
  .row-item .row-main strong, .row-link .row-main strong { white-space: normal; }
  .row-item .row-end { margin-left: auto; }
}

/* ---- Alerts, check-in chart, safety plan */
.alert-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; padding: 14px 4px 14px 14px; border-left: 4px solid var(--line-strong); }
.alert-row.sev-urgent { border-left-color: var(--danger); }
.alert-row.sev-elevated { border-left-color: var(--sand-ink); }
.alert-row.sev-watch { border-left-color: var(--sky-ink); }
.alert-row .row-main { flex: 1 1 260px; }
.alert-row .row-end { flex: 0 0 auto; }
.ci-chart { margin-top: 4px; }
.ci-chart svg { display: block; max-height: 190px; }
.ci-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.ci-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.ci-swatch { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.ci-swatch.round { width: 10px; height: 10px; border-radius: 50%; }
.plain-list { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.contact-row { gap: 10px; }
.tile-link { text-decoration: none; color: inherit; }

/* ---- Weekly AI summaries */
.sum-card { border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.sum-card.is-draft { border-color: var(--sand-ink); border-style: dashed; background: #FFFCF6; }
.sum-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sum-head .muted { flex-basis: 100%; }
.sum-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
@media (min-width: 900px) { .sum-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.sum-stat { border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sum-stat .label { font-size: 12px; font-weight: 700; }
.sum-stat .value { font-family: var(--serif); font-size: 20px; line-height: 1.15; overflow-wrap: anywhere; }
.sum-overview { margin-top: 14px; font-family: var(--serif); font-size: 18px; line-height: 1.4; }
.sum-section { margin-top: 16px; }
.sum-points { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sum-points li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 10px 12px; background: var(--bg); border-radius: 14px; }
.sum-points li > span:first-child { flex: 1 1 240px; }
.sum-when { font-size: 12px; font-weight: 700; color: var(--lavender-ink); background: var(--lavender); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.sum-edit { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--bg); border-radius: 14px; }

/* ---- Messages and sessions */
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--peach); color: var(--peach-ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sidebar a[aria-current="page"] .nav-count { background: #fff; color: var(--indigo); }
.sidebar a .nav-label { width: 100%; }
.tab-ico { position: relative; display: inline-flex; }
.tab-dot { position: absolute; top: -2px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.msg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.msg-list:hover { scrollbar-color: var(--line-strong) transparent; }
.msg { max-width: 85%; display: flex; flex-direction: column; gap: 4px; }
.msg.is-theirs { align-self: flex-start; }
.msg.is-mine { align-self: flex-end; align-items: flex-end; }
.msg-body { padding: 10px 14px; border-radius: 18px; white-space: pre-line; overflow-wrap: anywhere; }
.msg.is-theirs .msg-body { background: var(--bg); border-bottom-left-radius: 6px; }
.msg.is-mine .msg-body { background: var(--indigo); color: #fff; border-bottom-right-radius: 6px; }
.msg-meta { font-size: 12px; color: var(--muted); }
.ses-row { align-items: center; gap: 12px; flex-wrap: wrap; }
.ses-row .row-main { flex: 1 1 200px; min-width: 0; }
@media (max-width: 520px) { .ses-row .row-end { flex-basis: 100%; justify-content: flex-start; padding-left: 64px; margin-left: 0; } }
.ses-date { flex: 0 0 52px; height: 56px; border-radius: 14px; background: var(--lavender); color: var(--lavender-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ses-date span { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.ses-date strong { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.ses-day { margin-top: 18px; }
.ses-day:first-child { margin-top: 0; }

/* ---- Instant alerts */
.push-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; margin-bottom: 16px; }
.push-banner-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--peach); color: var(--peach-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.push-banner-text { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; }

/* ---------- Dashboards (platform, facility admin, professional) ---------- */
.dash { display: grid; gap: 16px; }
@media (min-width: 1100px) { .dash { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; } .dash-hero { grid-column: 1 / -1; } }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.dash-hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 28px; padding: 22px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(176, 160, 255, .42) 0%, rgba(176, 160, 255, 0) 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(32, 26, 74, .55) 0%, rgba(32, 26, 74, 0) 60%),
    linear-gradient(150deg, #2B2758 0%, #3F3684 46%, #6656B3 100%);
  box-shadow: 0 18px 40px -24px rgba(46, 39, 110, .8);
  display: flex; flex-direction: column; gap: 18px;
}
.dash-hero h2 { font-size: 26px; line-height: 1.15; }
.dash-hero .hero-sub { color: rgba(255, 255, 255, .78); font-size: 14px; margin-top: 4px; }
.hero-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .hero-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hero-figures.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero-fig { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); color: #fff; text-decoration: none; min-width: 0; }
a.hero-fig:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.hero-fig .n { font-family: var(--serif); font-size: 30px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.hero-fig .l { font-size: 12.5px; color: rgba(255, 255, 255, .8); font-weight: 700; }
.hero-fig.alarm { background: rgba(255, 196, 180, .22); border-color: rgba(255, 196, 180, .45); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions .btn, .hero-actions > div > .btn { background: rgba(255, 255, 255, .95); color: var(--indigo); }
.hero-actions .btn.ghost, .hero-actions > div > .btn.ghost { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }

.attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attn a, .attn > li > div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--bg); color: var(--ink); text-decoration: none; }
.attn .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--sky-ink); }
.attn .dot.urgent { background: var(--danger); box-shadow: 0 0 0 4px rgba(142, 47, 34, .14); }
.attn .dot.soon { background: var(--sand-ink); }
.attn .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attn .txt strong { font-size: 15px; }
.attn .txt span { color: var(--muted); font-size: 13px; }
.all-clear { display: flex; align-items: center; gap: 10px; color: var(--sage-ink); font-weight: 700; padding: 6px 2px; }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.people > li + li { border-top: 1px solid var(--line); }
.people a, .people .prow { display: flex; align-items: center; gap: 12px; padding: 12px 2px; color: var(--ink); text-decoration: none; }
.people .avatar { width: 42px; height: 42px; font-size: 17px; }
.people .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.people .who strong { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .who span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .end { display: flex; align-items: center; gap: 8px; flex: none; color: var(--muted); }
.people a:hover .who strong { color: var(--indigo); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.timeline .when { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.timeline .what strong { font-weight: 700; }

.facility-row .fac-ico { width: 42px; height: 42px; border-radius: 14px; background: var(--lavender); color: var(--lavender-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; font-family: var(--serif); font-size: 18px; }
.people .who span { white-space: normal; }
@media (max-width: 560px) {
  .facility-row .prow { flex-wrap: wrap; }
  .facility-row .end { flex-basis: 100%; padding-left: 54px; justify-content: space-between; }
  .people .who strong { white-space: normal; }
}

/* ---- Clinical notes */
.notes-timeline { display: flex; flex-direction: column; gap: 14px; }
.note-card { gap: 12px; }
.note-card.is-draft { border: 1.5px dashed var(--sand-ink); background: #FFFCF6; }
.note-card.is-discharge { border-left: 5px solid var(--sand-ink); }
.note-head { display: flex; flex-direction: column; gap: 6px; }
.note-head h2 { font-size: 20px; }
.note-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.soap { margin: 0; display: grid; gap: 10px; }
.soap > div { display: grid; grid-template-columns: 1fr; gap: 2px; }
@media (min-width: 700px) { .soap > div { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; } }
.soap dt { font-weight: 700; font-size: 13.5px; color: var(--lavender-ink); }
.soap dd { margin: 0; white-space: pre-line; line-height: 1.55; }
.note-text { white-space: pre-line; line-height: 1.6; }
.note-correction { font-size: 13.5px; color: var(--sand-ink); background: var(--sand); border-radius: 12px; padding: 8px 12px; }
.note-history { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.note-old { border-left: 3px solid var(--line-strong); padding: 4px 0 4px 14px; opacity: .85; }
.note-sheet { max-width: 680px; }

/* ---- Progress report (screen and print) */
.report-body { background: var(--bg); padding: 16px; }
.report-controls { max-width: 820px; margin: 0 auto 16px; display: flex; flex-direction: column; gap: 12px; }
.report-form { background: var(--surface); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.report-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.report-quick .chip { text-decoration: none; }
.report { max-width: 820px; margin: 0 auto; background: #fff; border-radius: 22px; padding: 32px 28px; color: var(--ink); }
@media (max-width: 600px) { .report { padding: 22px 16px; } }
.report-head { border-bottom: 2px solid var(--indigo); padding-bottom: 16px; margin-bottom: 20px; }
.report-brand { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.report-head h1 { font-size: 32px; margin-top: 4px; }
.report-who { margin-top: 8px; }
.report-period { color: var(--indigo); font-weight: 700; margin-top: 4px; }
.report-team { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.report-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 8px; }
.report-figures > div { border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.report-figures .n { font-family: var(--serif); font-size: 26px; line-height: 1; }
.report-figures .n small { font-size: 14px; color: var(--muted); }
.report-figures .l { font-size: 12.5px; color: var(--muted); }
.report-bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.55; }
.report-chart-title { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.report-chart + .report-chart { margin-top: 12px; }
.report-section { margin-top: 26px; break-inside: avoid-page; }
.outcomes-report .report-section { break-inside: auto; }
.outcomes-report .report-section h2 { break-after: avoid; }
.outcomes-report .report-chart { break-inside: avoid; }
.report-section h2 { font-size: 20px; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.report-lead { line-height: 1.6; margin-bottom: 10px; }
.report-chart { margin: 8px 0 10px; }
.report-chart svg { width: 100%; height: auto; display: block; }
.report-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.report-legend i { display: inline-block; width: 12px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.report-table th { text-align: left; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line-strong); padding: 6px 8px; }
.report-table td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; width: 80px; }
.report-summary { margin-bottom: 10px; line-height: 1.6; }
.report-note { border-left: 3px solid var(--lavender); padding: 4px 0 4px 14px; margin-bottom: 14px; break-inside: avoid; }
.report-note h3 { font-size: 16px; }
.report-note.is-discharge { border-left-color: var(--sand-ink); }
.report-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); line-height: 1.5; }
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  .no-print { display: none !important; }
  .report-body { background: #fff; padding: 0; }
  .report { max-width: none; border-radius: 0; padding: 0; }
  .report-table tr, .report-figures > div { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Notifications checklist ---------- */
.health-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.health-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 18px; background: var(--bg); }
.health-list li > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.health-ico { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.health-list li.is-ok .health-ico { background: var(--sage); color: var(--sage-ink); }
.health-list li.is-off .health-ico { background: #F6E3D3; color: #8A4B17; }

/* ---------- Outcomes dashboard ---------- */
.out-hero-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hero-fig .n small { font-size: 15px; opacity: .75; margin-left: 2px; }
.hero-fig .delta { margin-top: 6px; }
.delta { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.delta.good { background: var(--sage); color: var(--sage-ink); }
.delta.bad { background: var(--peach); color: var(--peach-ink); }
.delta.on-hero { background: rgba(255, 255, 255, .14); color: #fff; }
.delta.on-hero.good { background: rgba(196, 238, 208, .22); color: #DDF6E4; }
.delta.on-hero.bad { background: rgba(255, 196, 180, .24); color: #FFE1D8; }

.out-filters { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 14px 16px; }
.range-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.range-chip { padding: 8px 14px; border-radius: 999px; background: var(--bg); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; }
.range-chip:hover { background: var(--lavender); }
.range-chip[aria-current="true"] { background: var(--indigo); color: #fff; }
.out-filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; flex: 1 1 420px; max-width: 620px; }
.out-filter-form > :nth-child(3) { grid-column: 1 / -1; }
@media (min-width: 700px) { .out-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); } .out-filter-form > :nth-child(3) { grid-column: auto; } }
.out-filter-form .field { margin: 0; }

.out-lead { line-height: 1.6; margin-bottom: 14px; }
.out-charts { display: grid; gap: 18px; }
.tchart { margin: 0; }
.tchart-title { font-size: 13.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.tchart-wrap { position: relative; }
.tchart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.tc-grid { stroke: #ECE8EF; stroke-width: 1; }
.tc-axis { font-size: 11px; fill: #6E6A7A; font-variant-numeric: tabular-nums; }
.tc-cross { stroke: #B9B3C6; stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.tchart.is-hover .tc-cross { opacity: 1; }
.tc-tip { position: absolute; top: 0; left: 0; transform: translate(-50%, -110%); pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 10px; white-space: nowrap; opacity: 0; transition: opacity .12s ease; box-shadow: 0 8px 20px rgba(46, 43, 87, .18); }
.tchart.is-hover .tc-tip { opacity: 1; }
.tc-table { margin-top: 4px; }
.tchart .tc-narrow { display: none; }
@media (max-width: 560px) { .tchart .tc-wide { display: none; } .tchart .tc-narrow { display: block; } }

.out-triggers { margin-top: 18px; }
.trigger-bars { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trigger-bars li { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 32px; align-items: center; gap: 10px; font-size: 14px; }
.tb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-bar { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.tb-bar i { display: block; height: 100%; background: #5B54B0; border-radius: 999px; }
.tb-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--bg); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .n { font-family: var(--serif); font-size: 28px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.stat .n small { font-size: 15px; color: var(--muted); }
.stat .l { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat.warn { background: var(--peach); }
.stat.warn .n, .stat.warn .l { color: var(--peach-ink); }

.meter { margin-top: 14px; }
.meter-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.meter-track, .mini-track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.meter-track i, .mini-track i { display: block; height: 100%; background: #5B54B0; border-radius: 999px; }
.mini-meter { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.mini-track { width: 72px; height: 8px; display: inline-block; }

.prog-compare { display: grid; gap: 10px; }
@media (min-width: 560px) { .prog-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prog-card { display: block; background: var(--bg); border-radius: 18px; padding: 14px; color: var(--ink); text-decoration: none; }
.prog-card:hover { background: var(--lavender); }
.prog-name { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 10px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.prog-card dl { margin: 0; display: grid; gap: 6px; }
.prog-card dl > div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.prog-card dt { color: var(--muted); }
.prog-card dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.split-bar { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg); }
.split-bar i { display: block; min-width: 6px; }
.sb-a { background: #5B54B0; } .sb-m { background: #C2662A; } .sb-c { background: #B9B3C6; } .sb-u { background: #E2DDE6; }
.split-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 14px; }
.split-legend li { display: flex; align-items: center; gap: 8px; }
.split-legend li strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.split-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.rtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.rtable th.num { text-align: right; }
.warn-text { color: var(--peach-ink); font-weight: 700; }
@media (max-width: 899px) { .rtable td.num { text-align: right; } }

/* ---------- Logos ---------- */
.logo-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { width: 96px; height: 96px; border-radius: 24px; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; border: 1px solid var(--line); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview.is-empty span { font-family: var(--serif); font-size: 40px; color: var(--lavender-ink); }
.brand-logo { display: block; max-height: 40px; max-width: 160px; object-fit: contain; }
.fac-logo { width: 28px; height: 28px; object-fit: contain; background: transparent; flex: none; }
.sidebar .facility { display: flex; align-items: center; gap: 8px; }
.mobile-bar .mb-logo { width: 36px; height: 36px; object-fit: contain; background: transparent; flex: none; }
.auth-logo { max-height: 56px; max-width: 200px; object-fit: contain; display: block; }
.report-logo { max-height: 48px; max-width: 160px; object-fit: contain; display: block; margin-bottom: 8px; }
.billing-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 20px; background: var(--sand); color: var(--sand-ink); }
.billing-banner.is-hold { background: var(--peach); color: var(--peach-ink); }
.billing-banner .bb-text { flex: 1 1 260px; font-size: 14.5px; line-height: 1.5; }

/* ---------- Billing ---------- */
.model-list { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 0; border-top: 1px solid var(--line); }
.paystack-status { margin-top: 14px; font-size: 14px; background: var(--sand); color: var(--sand-ink); border-radius: 16px; padding: 12px 14px; line-height: 1.55; overflow-wrap: anywhere; }
.paystack-status.is-ok { background: var(--sage); color: var(--sage-ink); }
.paystack-status code { font-size: 12.5px; background: rgba(255, 255, 255, .6); padding: 1px 6px; border-radius: 6px; }
.sub-h { font-family: inherit; font-size: 14px; font-weight: 800; color: var(--lavender-ink); margin-top: 6px; text-transform: none; }
@media (min-width: 900px) { .form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 16px; margin-bottom: 18px; }
.invoice-status { font-weight: 800; padding: 8px 14px; border-radius: 999px; background: var(--sky); color: var(--sky-ink); white-space: nowrap; }
.invoice-status.is-paid { background: var(--sage); color: var(--sage-ink); }
.invoice-status.is-overdue { background: var(--peach); color: var(--peach-ink); }
.invoice-meta { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 18px; }
@media (min-width: 600px) { .invoice-meta { grid-template-columns: 1.4fr 1fr; } }
.invoice-meta > div { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.invoice-meta .label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 6px; font-weight: 700; }
.invoice-lines tfoot td { font-weight: 700; }
.invoice-lines tfoot tr.total td { font-size: 17px; border-top: 2px solid var(--ink); }
.bank-box { background: var(--bg); border-radius: 14px; padding: 12px 14px; line-height: 1.6; }
.pay-form { display: flex; flex-direction: column; gap: 10px; background: var(--surface); padding: 14px; border-radius: 20px; max-width: 520px; }
.admin-invoice-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.plan-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .plan-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.est-lines { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.est-lines td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.est-lines td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.est-lines tr.total td { font-weight: 800; border-bottom: 0; font-size: 16px; }
.card-saved { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg); border-radius: 16px; flex-wrap: wrap; }
@media print { .invoice-head { border-color: #000; } }
.pay-head { display: flex; gap: 12px; align-items: center; }
.pay-amount { display: flex; flex-direction: column; gap: 4px; background: var(--bg); border-radius: 18px; padding: 16px; }
.pay-amount .n { font-family: var(--serif); font-size: 36px; line-height: 1; }

/* ---------- Photos ---------- */
img.avatar.is-photo { object-fit: cover; padding: 0; background: var(--lavender); }
.avatar.sm { width: 36px; height: 36px; font-size: 15px; }
.avatar.xl { width: 96px; height: 96px; font-size: 36px; }
.avatar-preview { flex: none; }

/* ---------- Discharge and aftercare ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 16px; background: var(--bg); }
.checklist li > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.checklist .ck { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: transparent; }
.checklist li.is-done .ck { background: var(--sage); border-color: var(--sage); color: var(--sage-ink); }
.contact-rows { display: flex; flex-direction: column; gap: 14px; }
.aftercare-hero { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 20px; background: linear-gradient(140deg, #EEF6F0, #E6EEF8); }
.aftercare-hero .day { font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--sage-ink); }
.aftercare-hero .day small { display: block; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--muted); }
.kv-list { margin: 12px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.kv-list dt { color: var(--muted); }
.kv-list dd { margin: 0; }
.progress-mini { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-top: 10px; }
.progress-mini i { display: block; height: 100%; background: #3E8E63; border-radius: 999px; }
.checklist.compact li { padding: 6px 10px; font-size: 14px; } .checklist.compact .ck { width: 20px; height: 20px; font-size: 11px; }
.retention { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.ret-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ret-row > span:first-child { width: 64px; flex: none; color: var(--muted); }
.ret-row strong { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.ret-row .muted { width: 70px; flex: none; text-align: right; }


/* =====================================================================================
   Shared furniture: brand lockup, top-bar bell and account menu, stat icons, timeline, mission
   ===================================================================================== */
.brand-lockup { display: inline-flex; align-items: center; max-width: 100%; }
.brand-lockup.is-center { justify-content: center; width: 100%; }
.brand-img { display: block; object-fit: contain; }
.bl-sm .brand-img { max-height: 30px; max-width: 150px; }
.bl-md .brand-img { max-height: 46px; max-width: 184px; }
.bl-lg .brand-img { max-height: 76px; max-width: 260px; }
.brand-img.for-dark { display: none; }
.champ-mark { display: inline-flex; align-items: center; gap: 10px; }
.cm-icon { flex: none; width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #9A7BFF 0%, #6A47EE 52%, #43289F 100%); box-shadow: 0 8px 18px -8px rgba(91, 63, 214, .75), inset 0 1px 0 rgba(255, 255, 255, .28); }
.cm-icon svg { width: 68%; height: 68%; }
.cm-word { display: flex; flex-direction: column; line-height: 1; }
.cm-name { font-family: var(--sans); font-weight: 700; font-size: 25px; letter-spacing: .03em; color: var(--brand-word); }
.cm-sub { font-size: 9.5px; font-weight: 700; letter-spacing: .34em; text-transform: uppercase; color: var(--brand-sub); margin-top: 5px; }
.bl-sm .cm-icon { width: 32px; height: 32px; border-radius: 10px; } .bl-sm .cm-name { font-size: 19px; } .bl-sm .cm-sub { font-size: 7.5px; letter-spacing: .3em; margin-top: 3px; }
.bl-lg .cm-icon { width: 64px; height: 64px; border-radius: 19px; } .bl-lg .champ-mark { gap: 14px; } .bl-lg .cm-name { font-size: 36px; } .bl-lg .cm-sub { font-size: 12px; margin-top: 7px; }
.sidebar .sb-brand { display: block; padding: 0 6px 6px; text-decoration: none; min-width: 0; }
.sidebar .facility { padding-top: 10px; }

/* Bell and account menu */
.topbar .who { display: flex; align-items: center; gap: 6px; }
@media (max-width: 899px) { .topbar .who { display: none; } }
.mobile-bar .mb-title { flex: 1 1 auto; }
.mobile-bar .mb-title .brand { display: block; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-bar .mb-end { gap: 2px; }
.mobile-bar .icon-btn { width: 40px; height: 40px; }
.icon-btn { position: relative; flex: none; width: 44px; height: 44px; border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface); border-color: var(--line); }
.icon-dot { position: absolute; top: 9px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.acct-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { background: var(--surface); border-color: var(--line); }
.mobile-bar .acct-btn { padding: 2px; }
.acct-chev { display: inline-flex; transition: transform .15s ease; }
.acct-btn[aria-expanded="true"] .acct-chev { transform: rotate(180deg); }
.pop { position: relative; }
.pop-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(352px, calc(100vw - 24px)); background: var(--pop-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--pop-shadow); padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: min(72vh, 540px); overflow-y: auto; text-align: left; }
.mobile-bar .pop-panel { position: fixed; top: calc(66px + env(safe-area-inset-top)); right: 12px; background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px; font-size: 15px; }
.pop-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; color: var(--ink); text-decoration: none; width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.pop-item:hover, .pop-item:focus-visible { background: var(--hover); color: var(--ink); }
.pop-item > svg { flex: none; margin: 0 8px; color: var(--muted); }
.pi-ico { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--lavender); color: var(--lavender-ink); }
.tone-urgent .pi-ico { background: var(--peach); color: var(--danger); }
.tone-soon .pi-ico { background: var(--sand); color: var(--sand-ink); }
.tone-ok .pi-ico { background: var(--sage); color: var(--sage-ink); }
.pi-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pi-txt strong { font-size: 14.5px; }
.pi-txt span { font-size: 12.5px; color: var(--muted); }
.pop-empty { display: flex; align-items: center; gap: 8px; padding: 12px 10px 14px; color: var(--sage-ink); font-weight: 700; font-size: 14px; }
.acct-who { display: flex; align-items: center; gap: 12px; padding: 8px 10px 12px; }
.acct-who strong { display: block; font-size: 15px; }
.acct-who span { font-size: 12.5px; color: var(--muted); }
.theme-pick { padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0; }
.tp-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tp-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.tp-seg button { min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.tp-seg button:hover { color: var(--ink); }
.tp-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }

/* Menu footer */
.sidebar .sb-signout button { border: 1px solid var(--line); }
.sb-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 8px 4px; text-align: center; }
.sb-leaf { width: 54px; height: 40px; }
.sb-foot span { font-size: 10.5px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); max-width: 170px; line-height: 1.7; }

/* Card titles with an icon, and "View all" links */
.card-title { display: flex; align-items: center; gap: 10px; }
.card-title > svg { color: var(--accent); flex: none; }
.card-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--link); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

/* Hero figures with an icon and a comparison line */
.hero-fig .fi { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .14); color: #fff; margin-bottom: 10px; }
.hero-fig .fi.rose { background: rgba(255, 110, 145, .22); color: #FFC2D0; }
.hero-fig .fi.sky { background: rgba(120, 170, 255, .2); color: #CFE0FF; }
.hero-fig .cmp { margin-top: 10px; font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, .72); display: flex; align-items: center; gap: 5px; }
.hero-fig .cmp { flex-wrap: wrap; } .hero-fig .cmp b { font-weight: 700; white-space: nowrap; }
.hero-fig .cmp .up { color: #A6F0C4; } .hero-fig .cmp .down { color: #FFB3B3; } .hero-fig .cmp .flat { color: rgba(255, 255, 255, .6); }
.hero-fig .cmp.bad .up { color: #FFB3C1; } .hero-fig .cmp.bad .down { color: #A6F0C4; }
.dash-hero::after { content: ""; position: absolute; right: -18px; top: -26px; width: 230px; height: 190px; pointer-events: none; opacity: .32; z-index: 0;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 200'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23B9A4FF' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%236B4EF0' stop-opacity='.05'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M150 190C120 150 118 92 160 40c30 44 32 104-10 150z' fill='url(%23a)'/%3E%3Cpath d='M160 196c4-50 34-90 80-104-4 54-34 92-80 104z' fill='url(%23a)'/%3E%3Cpath d='M146 196C116 172 88 160 46 166c22 30 56 40 100 30z' fill='url(%23a)'/%3E%3C/svg%3E"); }
.dash-hero > * { position: relative; z-index: 1; }

/* Needs attention, with icons */
.attn .ai { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sky); color: var(--sky-ink); }
.attn .ai.urgent { background: var(--peach); color: var(--danger); }
.attn .ai.soon { background: var(--sand); color: var(--sand-ink); }
.attn a { border: 1px solid transparent; }
.attn a:hover { border-color: var(--line-strong); }
.attn a > svg:last-child { color: var(--muted); flex: none; }

/* Timeline with dots */
.timeline.dots { gap: 14px; }
.timeline.dots li { position: relative; grid-template-columns: 46px 16px minmax(0, 1fr); gap: 8px; }
.timeline.dots .tdot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; justify-self: center; background: var(--accent); box-shadow: 0 0 0 3px var(--surface); position: relative; z-index: 1; }
.timeline.dots .tdot.td-auth { background: #2FB574; } .timeline.dots .tdot.td-client { background: #4B8DFF; } .timeline.dots .tdot.td-alert { background: var(--danger); }
.timeline.dots li:not(:last-child)::before { content: ""; position: absolute; left: 61.5px; top: 12px; bottom: -16px; width: 1px; background: var(--line-strong); }

/* Mission banner */
.mission { position: relative; overflow: hidden; border-radius: var(--radius); padding: 26px 24px; min-height: 190px; display: flex; align-items: center;
  background: linear-gradient(100deg, var(--surface) 0%, var(--surface) 46%, rgba(108, 99, 181, .10) 100%); border: 1px solid var(--line); }
.mission-text { position: relative; z-index: 2; max-width: 440px; display: flex; flex-direction: column; gap: 8px; }
.mission .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.mission h2 { font-size: 30px; }
.mission p { color: var(--muted); }
.mission-rule { width: 46px; height: 3px; border-radius: 3px; background: var(--accent); margin-top: 8px; }
.mission-art { position: absolute; right: 0; top: 0; bottom: 0; width: min(55%, 460px); z-index: 1; pointer-events: none; }
.mission-art svg { width: 100%; height: 100%; display: block; }
.mission-cta { position: absolute; right: 22px; bottom: 22px; z-index: 3; }
.btn-line { background: rgba(255, 255, 255, .06); color: var(--ink); border: 1px solid var(--line-strong); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn-line:hover { border-color: var(--accent); color: var(--ink); }
@media (max-width: 699px) {
  .mission { flex-direction: column; align-items: flex-start; padding-bottom: 140px; }
  .mission-art { top: auto; height: 160px; width: 100%; }
  .mission h2 { font-size: 25px; }
}

/* Billing banner with an icon disc */
.billing-banner .bb-ico { flex: none; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .55); }

/* Two logos in platform settings */
.logo-pair { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 800px) { .logo-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.logo-slot { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.logo-slot .field { width: 100%; }
.logo-preview.on-light, .logo-preview.on-dark { width: 100%; height: 110px; border-radius: 20px; padding: 14px; }
.logo-preview.on-light { background: #F7F3F1; }
.logo-preview.on-dark { background: #0B0B1A; border-color: #232145; }
.logo-preview.on-light .cm-name { color: #3A2A8C; }

/* =====================================================================================
   Dark theme (Light / Dark / Match my device, per person). Modelled on the night palette:
   deep navy-black, violet light, soft off-white text, quiet borders instead of shadows.
   ===================================================================================== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0A17;
  --surface: #11112A;
  --surface-2: #15143A;
  --ink: #EDEBFA;
  --muted: #A3A0BF;
  --line: #222047;
  --line-strong: #2E2B5C;
  --indigo: #6B4EF0;
  --indigo-soft: #5A40D6;
  --indigo-text: #CFC8FF;
  --accent: #8F70FF;
  --link: #A88EFF;
  --lavender: #1D1946; --lavender-ink: #CBBFFF;
  --peach: #3A1427;    --peach-ink: #FFA3B8;
  --sky: #10223F;      --sky-ink: #9EC4FF;
  --sand: #2D2310;     --sand-ink: #F3C66E;
  --sage: #0E2A20;     --sage-ink: #82E2B1;
  --danger: #FF6B8C;
  --hover: rgba(143, 112, 255, .10);
  --pop-bg: rgba(17, 17, 42, .88);
  --pop-shadow: 0 26px 60px -14px rgba(0, 0, 0, .75);
  --brand-word: #8F73FF;
  --brand-sub: #A994FF;
  --scroll: #3A3666;
}
:root[data-theme="dark"] body { background: radial-gradient(1100px 620px at 78% -8%, rgba(107, 78, 240, .10), transparent 62%), var(--bg); background-attachment: fixed; }
:root[data-theme="dark"] a:hover { color: #D8CEFF; }
:root[data-theme="dark"] .brand-img.for-light, :root[data-theme="dark"] .champ-mark.for-light { display: none; }
:root[data-theme="dark"] .brand-img.for-dark { display: block; }
/* Only a light-background logo uploaded: no tile behind it, just a faint halo so dark ink stays readable. */
:root[data-theme="dark"] .brand-img.needs-chip { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .55)) drop-shadow(0 0 8px rgba(255, 255, 255, .12)); }

/* Shell */
:root[data-theme="dark"] .sidebar { background: #0C0B20; }
:root[data-theme="dark"] .sidebar a:hover { background: rgba(255, 255, 255, .04); }
:root[data-theme="dark"] .sidebar a[aria-current="page"] { background: linear-gradient(135deg, #7556F6 0%, #6343E8 100%); box-shadow: 0 10px 24px -12px rgba(107, 78, 240, .9), inset 0 1px 0 rgba(255, 255, 255, .14); }
:root[data-theme="dark"] .sidebar form button:hover { background: rgba(255, 255, 255, .04); }
:root[data-theme="dark"] .mobile-bar { background: rgba(10, 10, 23, .8); }
:root[data-theme="dark"] .nav-backdrop { background: rgba(4, 4, 12, .35); }
:root[data-theme="dark"] .menu-btn { background: var(--surface); }
:root[data-theme="dark"] .avatar:not(.is-photo) { background: #12382C; color: #BDF2D8; }
:root[data-theme="dark"] .icon-dot { background: #8F70FF; box-shadow: 0 0 10px rgba(143, 112, 255, .8); }

/* Surfaces */
:root[data-theme="dark"] .card, :root[data-theme="dark"] .panel, :root[data-theme="dark"] .push-banner { border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .018), rgba(255, 255, 255, 0) 120px), var(--surface); }
:root[data-theme="dark"] .attn a, :root[data-theme="dark"] .attn > li > div { background: var(--surface-2); border-color: var(--line); }
:root[data-theme="dark"] .attn a:hover { border-color: #3D3878; }
:root[data-theme="dark"] .rtable tr { background: transparent; }
@media (max-width: 899px) { :root[data-theme="dark"] .rtable tr { background: var(--surface-2); border: 1px solid var(--line); } }

/* Hero */
:root[data-theme="dark"] .dash-hero {
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(150, 120, 255, .30) 0%, rgba(150, 120, 255, 0) 55%),
    linear-gradient(140deg, #17143F 0%, #1F1957 48%, #2A2178 100%);
  border: 1px solid rgba(143, 112, 255, .28); box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .9); }
:root[data-theme="dark"] .hero-fig { background: rgba(255, 255, 255, .035); border-color: rgba(255, 255, 255, .10); }
:root[data-theme="dark"] a.hero-fig:hover { background: rgba(255, 255, 255, .07); }
:root[data-theme="dark"] .hero-fig.alarm { background: rgba(255, 90, 130, .08); border-color: rgba(255, 120, 150, .35); }
:root[data-theme="dark"] .hero-fig .fi { background: rgba(143, 112, 255, .22); color: #D6CBFF; }
:root[data-theme="dark"] .hero-fig .fi.rose { background: rgba(255, 90, 130, .2); color: #FF9DB5; }
:root[data-theme="dark"] .hero-fig .fi.sky { background: rgba(110, 150, 255, .2); color: #B8CCFF; }
:root[data-theme="dark"] .hero-actions .btn, :root[data-theme="dark"] .hero-actions > div > .btn { background: linear-gradient(135deg, #C7A9FF 0%, #A47BFF 100%); color: #170F3A; box-shadow: 0 10px 24px -12px rgba(164, 123, 255, .9); }
:root[data-theme="dark"] .hero-actions .btn.ghost, :root[data-theme="dark"] .hero-actions > div > .btn.ghost { background: rgba(255, 255, 255, .03); color: #fff; border: 1px solid rgba(255, 255, 255, .22); box-shadow: none; }
:root[data-theme="dark"] .hero { background: linear-gradient(140deg, #17143F, #2A2178); border: 1px solid rgba(143, 112, 255, .28); }

/* Buttons and controls */
:root[data-theme="dark"] .btn-primary { background: linear-gradient(135deg, #7A5CFA 0%, #6443EA 100%); color: #fff; box-shadow: 0 10px 22px -14px rgba(107, 78, 240, .95); }
:root[data-theme="dark"] .btn-primary:hover { background: linear-gradient(135deg, #8669FF 0%, #6F50F2 100%); color: #fff; }
:root[data-theme="dark"] .btn-quiet { background: transparent; border-color: var(--line-strong); color: var(--ink); }
:root[data-theme="dark"] .btn-quiet:hover { border-color: #46418A; }
:root[data-theme="dark"] .btn-danger { background: #C2385A; } :root[data-theme="dark"] .btn-danger:hover { background: #D14467; }
:root[data-theme="dark"] .input, :root[data-theme="dark"] .ui-select-trigger, :root[data-theme="dark"] .ui-tags, :root[data-theme="dark"] .ui-day { background: #0D0C23; border-color: var(--line-strong); }
:root[data-theme="dark"] .input::placeholder { color: #6F6B92; }
:root[data-theme="dark"] .input:focus, :root[data-theme="dark"] .ui-tags:focus-within, :root[data-theme="dark"] .ui-select-trigger[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(143, 112, 255, .25); }
:root[data-theme="dark"] .ui-select-trigger:hover { border-color: #46418A; }
:root[data-theme="dark"] .ui-select-trigger:disabled { background: var(--surface-2); }
:root[data-theme="dark"] .ui-chevron { color: var(--accent); }
:root[data-theme="dark"] .ui-pop, :root[data-theme="dark"] .sheet { background: rgba(19, 18, 46, .96); box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .75), 0 0 0 1px var(--line-strong); }
:root[data-theme="dark"] .ui-date-cell:disabled, :root[data-theme="dark"] .pagination .disabled { color: #4B4772; }
:root[data-theme="dark"] .ui-switch { background: #2B2856; }
:root[data-theme="dark"] .ui-file-zone { border-color: var(--line-strong); background: var(--surface-2); color: var(--lavender-ink); }
:root[data-theme="dark"] .ui-tag-remove:hover { background: rgba(255, 255, 255, .1); }
:root[data-theme="dark"] select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238F70FF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .tp-seg button[aria-pressed="true"] { background: #2A2560; box-shadow: none; }

/* Banners, notes, drafts */
:root[data-theme="dark"] .billing-banner { background: linear-gradient(90deg, rgba(20, 70, 60, .35), rgba(17, 17, 42, .6)); border: 1px solid #1F5C4E; color: var(--ink); }
:root[data-theme="dark"] .billing-banner strong { color: #F3C66E; }
:root[data-theme="dark"] .billing-banner .bb-ico { background: rgba(31, 92, 78, .45); color: #CFEFE5; }
:root[data-theme="dark"] .billing-banner.is-hold { background: linear-gradient(90deg, rgba(110, 24, 52, .35), rgba(17, 17, 42, .6)); border-color: #6A2440; }
:root[data-theme="dark"] .billing-banner.is-hold strong { color: #FFA3B8; }
:root[data-theme="dark"] .billing-banner.is-hold .bb-ico { background: rgba(106, 36, 64, .5); color: #FFD0DB; }
:root[data-theme="dark"] .sum-card.is-draft, :root[data-theme="dark"] .note-card.is-draft { background: #1C1810; }
:root[data-theme="dark"] .health-list li.is-off .health-ico { background: #3A2618; color: #F0B98A; }
:root[data-theme="dark"] .paystack-status code { background: rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .aftercare-hero { background: linear-gradient(140deg, #10261D, #121F38); }
:root[data-theme="dark"] .attn .dot.urgent { box-shadow: 0 0 0 4px rgba(255, 107, 140, .18); }
:root[data-theme="dark"] .fac-logo, :root[data-theme="dark"] .mobile-bar .mb-logo { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .5)); }

/* Charts */
:root[data-theme="dark"] .tc-grid { stroke: #211F45; }
:root[data-theme="dark"] .tc-axis { fill: #8D89AE; }
:root[data-theme="dark"] .tc-cross { stroke: #4A4580; }
:root[data-theme="dark"] .tc-tip { background: #EDEBFA; color: #0A0A17; }
:root[data-theme="dark"] .tb-bar i, :root[data-theme="dark"] .meter-track i, :root[data-theme="dark"] .mini-track i, :root[data-theme="dark"] .sb-a { background: linear-gradient(90deg, #6B4EF0, #A486FF); }
:root[data-theme="dark"] .sb-m { background: #F08A4B; } :root[data-theme="dark"] .sb-c { background: #5D5891; } :root[data-theme="dark"] .sb-u { background: #2E2B5C; }

/* Mission banner */
:root[data-theme="dark"] .mission { background: linear-gradient(100deg, #0F0E27 0%, #100F2A 44%, #1A1446 100%); border-color: var(--line); }
:root[data-theme="dark"] .mission-rule { background: linear-gradient(90deg, #8F70FF, #6B4EF0); }

/* Printed things stay on white paper */
:root[data-theme="dark"] .report { color: #1E1B2E; --ink: #1E1B2E; --muted: #5E5A6B; --line: #EEEAF0; --line-strong: #E2DDE6; --bg: #F7F3F1; --surface: #fff;
  --lavender: #ECE9F7; --lavender-ink: #3A3570; --peach: #FBE7E1; --peach-ink: #7A3A28; --sky: #E3EDF7; --sky-ink: #23496E; --sand: #F8EDDA; --sand-ink: #6E4A12; --sage: #E5EFE7; --sage-ink: #2C5A3A; --indigo: #2E2B57; --accent: #6C63B5; --danger: #8E2F22; }
@media print { :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --ink: #1E1B2E; --muted: #5E5A6B; } :root[data-theme="dark"] body { background: #fff; } }

/* =====================================================================================
   Family portal
   ===================================================================================== */
.fam-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.fam-switch a { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.fam-switch a[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--hover); }
.fam-switch .avatar { width: 30px; height: 30px; font-size: 14px; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 24px; }
.es-ico { width: 64px; height: 64px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; background: var(--lavender); color: var(--lavender-ink); }
.empty-state p { max-width: 460px; }

.fam-hero .fh-top { display: flex; align-items: center; gap: 14px; }
.fh-avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 26px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); }
.hero-fig .n small { font-size: 16px; opacity: .7; margin-left: 2px; }
.fh-bar { display: block; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .16); overflow: hidden; margin-top: 10px; }
.fh-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #A6F0C4, #7EE0A0); }

.week-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.week-strip li { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.week-strip .ws-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.week-strip strong { font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.15; }
.week-strip .tone-ok { background: var(--sage); border-color: transparent; } .week-strip .tone-ok strong { color: var(--sage-ink); }
.week-strip .tone-mixed { background: var(--sand); border-color: transparent; } .week-strip .tone-mixed strong { color: var(--sand-ink); }
.week-strip .tone-hard { background: var(--peach); border-color: transparent; } .week-strip .tone-hard strong { color: var(--peach-ink); }
.ws-dots { display: flex; gap: 4px; }
.ws-dots i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .18; }
.ws-dots i.on { opacity: .75; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--sage); color: var(--sage-ink); font-weight: 700; font-size: 14px; }
.fam-cta { display: flex; flex-direction: column; gap: 8px; background: linear-gradient(135deg, var(--lavender), var(--surface)); }
.fam-cta.is-done { background: linear-gradient(135deg, var(--sage), var(--surface)); }
.worry-card { display: flex; gap: 14px; align-items: flex-start; background: var(--peach); border: 1px solid transparent; }
.worry-card h2 { font-size: 20px; color: var(--peach-ink); }
.worry-card p { color: var(--peach-ink); }
.wc-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--danger); }
:root[data-theme="dark"] .worry-card { background: linear-gradient(135deg, rgba(110, 24, 52, .45), var(--surface)); border-color: #5A2040; }
:root[data-theme="dark"] .fam-cta { background: linear-gradient(135deg, #1D1946, var(--surface)); }
:root[data-theme="dark"] .fam-cta.is-done { background: linear-gradient(135deg, #0E2A20, var(--surface)); }
.share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.share-list li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14.5px; }
.share-list li.on { color: var(--ink); font-weight: 700; }
.share-list li.on svg { color: var(--sage-ink); }

/* Choice cards and chips: CHAMP's own radio buttons and checkboxes */
.choice-cards { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 18px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.choice:hover { border-color: var(--accent); }
.choice[aria-checked="true"] { border-color: var(--accent); background: var(--hover); box-shadow: 0 0 0 3px var(--hover); }
.choice .ch-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice .ch-txt span { font-size: 13.5px; color: var(--muted); }
.ch-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); position: relative; background: var(--surface); }
.choice[aria-checked="true"] .ch-dot { border-color: var(--accent); }
.choice[aria-checked="true"] .ch-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.seems-5 .ch-dot, .seems-4 .ch-dot { box-shadow: inset 0 0 0 999px rgba(47, 181, 116, .14); }
.seems-2 .ch-dot, .seems-1 .ch-dot { box-shadow: inset 0 0 0 999px rgba(255, 107, 140, .14); }
.urg-danger[aria-checked="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 140, .18); }
.urg-danger[aria-checked="true"] .ch-dot { border-color: var(--danger); } .urg-danger[aria-checked="true"] .ch-dot::after { background: var(--danger); }
@media (min-width: 900px) { .choice-cards.row { flex-direction: row; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.chip svg { display: none; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--lavender); border-color: var(--accent); color: var(--lavender-ink); font-weight: 700; }
.chip[aria-pressed="true"] svg { display: inline; }

.danger-strip { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 20px; background: var(--peach); color: var(--peach-ink); }
.danger-strip h2 { font-size: 19px; }
.danger-strip a { color: inherit; }
.ds-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--danger); }
:root[data-theme="dark"] .danger-strip { background: linear-gradient(90deg, rgba(110, 24, 52, .45), rgba(17, 17, 42, .6)); border: 1px solid #5A2040; }
.sent-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 8px; }
.sb-ico { width: 60px; height: 60px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sage); color: var(--sage-ink); }
.steps-small { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.note-box.ok { background: var(--sage); color: var(--sage-ink); display: flex; align-items: center; gap: 8px; }

.guide-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 1000px) { .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.guide { padding: 6px; }
.guide-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border: 0; border-radius: 18px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.guide-head:hover { background: var(--hover); }
.gh-ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--lavender); color: var(--lavender-ink); }
.gh-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.gh-txt strong { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.gh-txt span { font-size: 13.5px; color: var(--muted); }
.gh-chev { color: var(--muted); transition: transform .15s ease; }
.guide-head[aria-expanded="true"] .gh-chev { transform: rotate(180deg); }
.guide-body { margin: 0; padding: 4px 22px 18px 76px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.55; }
@media (max-width: 560px) { .guide-body { padding-left: 34px; } }

.pay-block + .pay-block { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.pay-block h3 { margin-bottom: 10px; }
.plan-facts > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.plan-facts .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.aa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.aa-list li { display: flex; gap: 10px; align-items: flex-start; }
.aa-list li svg { flex: none; margin-top: 3px; color: var(--sage-ink); }
.aa-list li.off { color: var(--muted); } .aa-list li.off svg { color: var(--muted); }

/* Staff: family check-ins on the client page */
.fam-checkins { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fam-checkins li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border-left: 4px solid var(--line-strong); }
.fam-checkins li.seems-5, .fam-checkins li.seems-4 { border-left-color: #2FB574; }
.fam-checkins li.seems-3 { border-left-color: var(--sand-ink); }
.fam-checkins li.seems-2, .fam-checkins li.seems-1 { border-left-color: var(--danger); }
.fc-week { font-size: 12.5px; color: var(--muted); padding-top: 2px; }
.fc-body { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.fc-signs { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-note { font-style: italic; color: var(--muted); }
.fam-list .who .tiny { color: var(--muted); }
.fam-list .end { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .fam-list .prow { flex-wrap: wrap; } .fam-list .end { width: 100%; justify-content: flex-start; } }
@media (max-width: 599px) { .hero-figures.three { grid-template-columns: 1fr; } .hero-figures.three .hero-fig { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; } .hero-figures.three .hero-fig .fi { grid-row: span 2; margin: 0; } .hero-figures.three .hero-fig .cmp, .hero-figures.three .hero-fig .fh-bar { grid-column: 1 / -1; } }

/* =====================================================================================
   CHAMP Renew: rehabilitation cards on the client page
   ===================================================================================== */
.rn-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .rn-figs { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.rn-fig { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.rn-fig .l { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rn-fig .n { font-family: var(--serif); font-size: 28px; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.rn-fig .n.sm { font-size: 22px; }
.rn-fig .n small { font-size: 14px; color: var(--muted); margin-left: 2px; }
.rn-fig .s { font-size: 12px; color: var(--muted); }
.rn-fig.is-bad { background: var(--peach); border-color: transparent; } .rn-fig.is-bad .n { color: var(--peach-ink); }
.rn-spark { width: 100%; height: 70px; margin-top: 12px; display: block; }
.rn-line { stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rn-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.rn-limit { stroke: var(--danger); stroke-dasharray: 4 4; stroke-width: 1; opacity: .5; vector-effect: non-scaling-stroke; }

.adh-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 92px; }
.adh-day { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.adh-track { position: relative; flex: 1; width: 100%; max-width: 22px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.adh-track i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 8px; }
.adh-track i.planned { background: var(--line-strong); }
.adh-track i.done { background: var(--accent); opacity: .75; }
.adh-track i.done.full { background: #2FB574; opacity: 1; }
.adh-lbl { font-size: 11px; color: var(--muted); }

.ex-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ex-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.ex-ico { flex: none; width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--sage); color: var(--sage-ink); }
.ex-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ex-txt span { font-size: 13.5px; color: var(--muted); }
.ex-txt .ex-note { font-style: italic; }
.ex-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .ex-list li { flex-wrap: wrap; } .ex-actions { width: 100%; justify-content: flex-start; padding-left: 48px; } }

.measure-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.measure-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 120px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.measure-list li:last-child { border-bottom: 0; }
@media (max-width: 700px) { .measure-list li { grid-template-columns: 1fr; gap: 6px; } }
.m-name { display: flex; flex-direction: column; gap: 2px; }
.m-name span { font-size: 13px; color: var(--muted); }
.m-score { display: flex; flex-direction: column; gap: 2px; }
.m-score strong { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.m-trend { font-size: 12.5px; font-weight: 700; }
.m-trend.up { color: var(--sage-ink); } .m-trend.down { color: var(--peach-ink); }
.m-spark { width: 120px; height: 36px; }
.m-spark polyline { stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* Exercise library (facility) */
.lib-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lib-card { display: flex; flex-direction: column; gap: 10px; }
.lib-card.is-off { opacity: .6; }
.lib-head { display: flex; gap: 12px; align-items: flex-start; }
.lib-head .ex-ico { width: 44px; height: 44px; border-radius: 14px; }
.lib-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.lib-caution { font-size: 13px; color: var(--sand-ink); background: var(--sand); border-radius: 12px; padding: 8px 10px; }
.fx-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.fx-week span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.fx-week i { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1.5px dashed var(--line-strong); }
.fx-week .on i { background: var(--sage-ink); border: 0; }
.fx-week .miss i { border-style: solid; }
:root[data-theme="dark"] .ui-pop-backdrop.is-sheet { background: rgba(3, 3, 12, .45); }
:root[data-theme="dark"] .ui-pop.is-sheet { box-shadow: 0 -16px 50px rgba(0, 0, 0, .6), 0 0 0 1px var(--line-strong); }
:root[data-theme="dark"] .ui-pop-search { background: #0D0C23; }

/* ---------------------------------------------------------------- Group sessions */
.grp-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 900px) { .grp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card.grp-card { display: flex; flex-direction: row; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.card.grp-card:hover { box-shadow: 0 0 0 1.5px var(--accent); }
.grp-kind { flex: none; width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--lavender); color: var(--lavender-ink); }
.grp-kind.k-exercise { background: var(--sage); color: var(--sage-ink); }
.grp-kind.k-family, .grp-kind.k-peer { background: var(--peach, #FBE7DA); color: var(--peach-ink, #7A3E1D); }
.grp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.grp-name { font-family: var(--serif); font-size: 19px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.grp-due { border: 1.5px solid var(--warn-line, #F1D9A6); margin-bottom: 16px; }

.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-list .ui-pop-search { margin: 0; min-height: 46px; }
.pick-rows { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.pick-row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border: 0; border-radius: 14px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pick-row:hover { background: var(--bg); }
.pick-row[aria-pressed="true"] { background: var(--lavender); }
.pick-box { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: transparent; background: var(--surface); }
.pick-row[aria-pressed="true"] .pick-box { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.pick-txt { display: flex; flex-direction: column; min-width: 0; }

.reg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.reg-row { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.reg-row:first-child { border-top: 0; }
@media (min-width: 900px) { .reg-row { grid-template-columns: minmax(160px, 1fr) auto; align-items: center; } .reg-note { grid-column: 1 / -1; } }
.reg-who { display: flex; flex-direction: column; min-width: 0; }
.reg-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 900px) { .reg-seg { display: flex; } }
.reg-seg button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.reg-seg button:hover { border-color: var(--accent); }
.reg-seg button[aria-checked="true"].rs-present { background: var(--sage); border-color: var(--sage-ink); color: var(--sage-ink); font-weight: 700; }
.reg-seg button[aria-checked="true"].rs-late { background: var(--sky, #E1EEFA); border-color: var(--sky-ink, #1F4E79); color: var(--sky-ink, #1F4E79); font-weight: 700; }
.reg-seg button[aria-checked="true"].rs-absent { background: #FBE3E6; border-color: var(--danger); color: var(--danger); font-weight: 700; }
.reg-seg button[aria-checked="true"].rs-excused { background: var(--lavender); border-color: var(--lavender-ink); color: var(--lavender-ink); font-weight: 700; }
.reg-note textarea { margin-top: 6px; }
.reg-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 999px;
  background: var(--pop-bg, var(--surface)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(30, 27, 46, .14), 0 0 0 1px var(--line); }
.grp-att { display: flex; flex-direction: column; gap: 2px; }
.by-family { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--lavender-ink); background: var(--lavender); border-radius: 999px; padding: 2px 8px; }
:root[data-theme="dark"] .reg-seg button { background: #0D0C23; }
:root[data-theme="dark"] .reg-seg button[aria-checked="true"].rs-absent { background: rgba(255, 107, 140, .14); }
:root[data-theme="dark"] .pick-box { background: #0D0C23; }

/* ---------------------------------------------------------------- Caregiver mode */
.rec-who { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.rec-who svg { flex: none; margin-top: 2px; }
.note-box.ok[role="status"] { margin-bottom: 16px; }
.danger-strip { margin-bottom: 16px; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.cc-chip:hover { border-color: var(--accent); }
.cc-chip[aria-checked="true"] { background: var(--indigo); border-color: var(--indigo); color: #fff; font-weight: 700; }
.scale-row { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.scale-row button { min-height: 42px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; padding: 0; font-variant-numeric: tabular-nums; }
.scale-row button:hover { border-color: var(--accent); }
.scale-row button[aria-checked="true"].sc-lo { background: var(--sage); border-color: var(--sage-ink); color: var(--sage-ink); font-weight: 700; }
.scale-row button[aria-checked="true"].sc-mid { background: var(--sand); border-color: var(--sand-ink); color: var(--sand-ink); font-weight: 700; }
.scale-row button[aria-checked="true"].sc-hi { background: var(--peach); border-color: var(--peach-ink); color: var(--peach-ink); font-weight: 700; }
.rf-chips .chip[aria-pressed="true"] { background: var(--peach); border-color: var(--peach-ink); color: var(--peach-ink); font-weight: 700; }
.rec-ex { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rec-ex li { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.rec-ex li:first-child { border-top: 0; }
.rec-ex li.is-extra .rec-ex-name strong { color: var(--muted); }
.rec-ex-name { display: flex; flex-direction: column; }
:root[data-theme="dark"] .cc-chip, :root[data-theme="dark"] .scale-row button { background: #0D0C23; }
:root[data-theme="dark"] .scale-row button[aria-checked="true"].sc-hi, :root[data-theme="dark"] .rf-chips .chip[aria-pressed="true"] { background: rgba(255, 140, 120, .16); }
