:root {
  color-scheme: light;
  --bg: #f0f4f8;
  --panel: #ffffff;
  --panel-soft: #eaf0f6;
  --ink: #0f1f35;
  --ink-2: #3b4f68;
  --muted: #5a6e85;
  --line: #d5e0eb;
  --grid: #e6edf4;
  --accent: #1a4480;
  --accent-strong: #0f2d5e;
  --accent-soft: rgba(26, 68, 128, 0.08);
  --teal: #0d7a6e;
  --teal-soft: rgba(13, 122, 110, 0.1);
  --on-accent: #ffffff;
  --s1: #2a78d6;
  --s2: #eb6834;
  --good: #0a7a2f;
  --good-bg: rgba(12, 163, 12, 0.1);
  --warn: #8a5a00;
  --warn-bg: rgba(250, 178, 25, 0.18);
  --crit: #b3261e;
  --crit-bg: rgba(208, 59, 59, 0.1);
  --ramp-1: #86b6ef; --ramp-2: #5598e7; --ramp-3: #2a78d6; --ramp-4: #1c5cab; --ramp-5: #104281;
  --shadow: 0 1px 2px rgba(15, 31, 53, 0.05), 0 4px 16px rgba(15, 31, 53, 0.06);
  --radius: 12px;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1424;
    --panel: #121e33;
    --panel-soft: #18263f;
    --ink: #e8eef6;
    --ink-2: #b9c6d8;
    --muted: #8a9bb3;
    --line: #22334f;
    --grid: #1c2b44;
    --accent: #7fa8e0;
    --accent-strong: #0a1a33;
    --accent-soft: rgba(127, 168, 224, 0.12);
    --teal: #3cc2b0;
    --teal-soft: rgba(60, 194, 176, 0.12);
    --on-accent: #0b1424;
    --s1: #3987e5;
    --s2: #d95926;
    --good: #4cc76a;
    --good-bg: rgba(12, 163, 12, 0.16);
    --warn: #f5c04a;
    --warn-bg: rgba(250, 178, 25, 0.14);
    --crit: #f08080;
    --crit-bg: rgba(208, 59, 59, 0.18);
    --ramp-1: #184f95; --ramp-2: #1c5cab; --ramp-3: #2a78d6; --ramp-4: #3987e5; --ramp-5: #6da7ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1424;
  --panel: #121e33;
  --panel-soft: #18263f;
  --ink: #e8eef6;
  --ink-2: #b9c6d8;
  --muted: #8a9bb3;
  --line: #22334f;
  --grid: #1c2b44;
  --accent: #7fa8e0;
  --accent-strong: #0a1a33;
  --accent-soft: rgba(127, 168, 224, 0.12);
  --teal: #3cc2b0;
  --teal-soft: rgba(60, 194, 176, 0.12);
  --on-accent: #0b1424;
  --s1: #3987e5;
  --s2: #d95926;
  --good: #4cc76a;
  --good-bg: rgba(12, 163, 12, 0.16);
  --warn: #f5c04a;
  --warn-bg: rgba(250, 178, 25, 0.14);
  --crit: #f08080;
  --crit-bg: rgba(208, 59, 59, 0.18);
  --ramp-1: #184f95; --ramp-2: #1c5cab; --ramp-3: #2a78d6; --ramp-4: #3987e5; --ramp-5: #6da7ec;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--accent-strong);
  color: #dfe8f5;
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: #0d7a6e; color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 15px;
}
.brand b { display: block; font-family: var(--display); font-size: 16px; color: #fff; line-height: 1.15; }
.brand small { color: #9fb4d3; font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; text-align: left; cursor: pointer;
  padding: 9px 10px; border-radius: 8px; color: #c9d6ea; font-size: 14.5px;
}
.nav button:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav button[aria-current="page"] { background: rgba(255,255,255,0.12); color: #fff; font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .count { margin-left: auto; background: #0d7a6e; color: #fff; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 0 8px; }
.side-foot { margin-top: auto; font-size: 12px; color: #8ea4c4; padding: 0 8px; }
.side-foot .lock {
  width: 100%; margin-bottom: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: #dfe8f5;
}

.main { padding-inline: 28px; padding-block: 18px 40px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.demo-pill { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--warn); background: var(--warn-bg); padding: 3px 10px; border-radius: 99px; }
.topbar .spacer { flex: 1; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; stroke: var(--ink-2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.menu-btn { display: none; }

.greet h1 { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.greet p { margin: 2px 0 0; color: var(--muted); }

/* ---------- cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: baseline; gap: 10px; padding: 16px 18px 0; flex-wrap: wrap; }
.panel-h h2 { font-size: 16.5px; font-weight: 700; }
.panel-h .sub { color: var(--muted); font-size: 13.5px; }
.panel-h .end { margin-left: auto; }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  text-align: left; cursor: pointer; padding: 14px 16px 10px;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; gap: 2px 8px;
  transition: border-color .15s, transform .15s;
}
.kpi:hover { border-color: var(--s1); }
.kpi[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.kpi .label { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.kpi .val small { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi .delta { align-self: end; justify-self: end; font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.delta.good { color: var(--good); background: var(--good-bg); }
.delta.bad { color: var(--crit); background: var(--crit-bg); }
.delta.warn { color: var(--warn); background: var(--warn-bg); }
.kpi .spark { grid-column: 1 / -1; height: 40px; margin-top: 4px; }
.kpi .foot { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }

.row { display: grid; gap: 20px; }
.row.hero { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row.two { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }

.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.chart { height: 290px; }

/* to-do */
.todo { list-style: none; margin: 0; padding: 8px 10px 12px; }
.todo li label { display: flex; gap: 12px; align-items: flex-start; padding: 9px 8px; border-radius: 8px; cursor: pointer; }
.todo li label:hover { background: var(--panel-soft); }
.todo input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); flex: none; }
.todo .t { font-weight: 600; }
.todo .m { font-size: 13px; color: var(--muted); }
.todo input:checked ~ span .t { text-decoration: line-through; color: var(--muted); }
.todo-progress { margin: 0 18px; height: 6px; border-radius: 99px; background: var(--panel-soft); overflow: hidden; }
.todo-progress div { height: 100%; background: var(--teal); border-radius: 99px; transition: width .3s; }

/* pipeline */
.pipe { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.pipe-row { display: grid; grid-template-columns: 128px minmax(0, 1fr) 34px; gap: 10px; align-items: center; font-size: 14px; }
.pipe-row .bar { height: 14px; border-radius: 0 4px 4px 0; transform-origin: left; }
.pipe-row .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pipe-note { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

/* lists */
.list { list-style: none; margin: 0; padding: 6px 0 10px; }
.list li { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--grid); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 600; }
.list .m { font-size: 13px; color: var(--muted); }
.pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.pill svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pill.good { color: var(--good); background: var(--good-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.crit { color: var(--crit); background: var(--crit-bg); }
.pill.info { color: var(--accent); background: var(--accent-soft); }
.doc-ic { width: 34px; height: 40px; border-radius: 6px; background: var(--crit-bg); color: var(--crit); font-size: 10px; font-weight: 800; display: grid; place-items: center; flex: none; }
.doc-ic.xl { background: var(--good-bg); color: var(--good); }
.doc-ic.dc { background: var(--accent-soft); color: var(--accent); }
.ann-date { width: 44px; flex: none; text-align: center; border-radius: 8px; background: var(--teal-soft); color: var(--teal); padding: 4px 0; line-height: 1.1; }
.ann-date b { display: block; font-size: 18px; }
.ann-date span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* cert timeline */
.cert-bar { height: 8px; border-radius: 99px; background: var(--panel-soft); overflow: hidden; margin-top: 6px; }
.cert-bar div { height: 100%; border-radius: 99px; }

/* admin */
.admin-only[hidden] { display: none !important; }
.table-wrap { overflow-x: auto; padding: 8px 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 18px; }
td { padding: 9px 18px; border-top: 1px solid var(--grid); white-space: nowrap; }

/* toast + lock */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.lockscreen { position: fixed; inset: 0; z-index: 60; background: rgba(8, 18, 36, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: grid; place-items: center; padding: 16px; }
.lock-card { background: var(--panel); border-radius: 16px; padding: 28px; width: 100%; max-width: 360px; text-align: center; border: 1px solid var(--line); }
.lock-card h2 { font-family: var(--display); font-size: 24px; margin: 10px 0 4px; }
.lock-card p { color: var(--muted); margin: 0 0 18px; }
.btn { background: var(--accent); color: var(--on-accent); border: 0; padding: 10px 18px; border-radius: 9px; font-weight: 700; cursor: pointer; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--panel-soft) 0%, var(--grid) 50%, var(--panel-soft) 100%); background-size: 200% 100%; animation: sh 1.2s infinite linear; border-radius: 8px; }
@keyframes sh { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .row.three > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; height: 100%; padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.4); }
  .menu-btn { display: grid; }
  .row.hero, .row.two, .row.three { grid-template-columns: minmax(0, 1fr); }
  .row.three > :last-child { grid-column: auto; }
}
@media (max-width: 560px) {
  .main { padding-inline: 16px; gap: 16px; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 12px 8px; }
  .kpi .val { font-size: 28px; }
  .kpi .delta { grid-column: 1 / -1; justify-self: start; }
  .greet h1 { font-size: 25px; }
  .chart { height: 240px; }
  .pipe-row { grid-template-columns: 100px minmax(0, 1fr) 30px; font-size: 13.5px; }
  .hide-sm { display: none; }
}
/* intakes */
tr.click { cursor: pointer; }
tr.click:hover td, tr.click:focus-visible td { background: var(--panel-soft); }
tr.click:focus-visible { outline: none; }
td .m { font-size: 12.5px; color: var(--muted); }
.pill.status-new { color: var(--accent); background: var(--accent-soft); }
.pill.status-waiting_docs { color: var(--warn); background: var(--warn-bg); }
.pill.status-in_review { color: var(--teal); background: var(--teal-soft); }
.pill.none { color: var(--muted); background: var(--panel-soft); }
.drawer-bg { position: fixed; inset: 0; z-index: 55; background: rgba(8, 18, 36, 0.5); display: flex; justify-content: flex-end; }
.drawer { width: min(720px, 100%); height: 100%; background: var(--bg); overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,0.2); padding: calc(18px + env(safe-area-inset-top, 0px)) 22px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.drawer-top { display: flex; align-items: flex-start; gap: 12px; }
.drawer-top h2 { font-family: var(--display); font-size: 25px; }
.drawer-top .sub { color: var(--muted); font-size: 13.5px; }
.drawer-top .x { margin-left: auto; flex: none; }
.phi-note { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.phi-note svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; padding: 14px 18px; }
.facts b { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.drawer .panel-h { padding-top: 14px; }
.drawer details { border-top: 1px solid var(--grid); }
.drawer details:first-child { border-top: 0; }
.drawer summary { cursor: pointer; padding: 12px 18px; font-weight: 700; }
.drawer details table td { white-space: normal; vertical-align: top; }
.drawer details table td:first-child { color: var(--muted); width: 36%; }
.drawer .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 9px; padding: 9px 16px; font-weight: 700; cursor: pointer; background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.lightbox { position: fixed; inset: 0; z-index: 58; background: rgba(8, 18, 36, 0.8); display: grid; place-items: center; padding: 16px; }
.lightbox figure { margin: 0; max-width: min(860px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 10px; background: #fff; }
.lightbox figcaption { color: #fff; display: flex; gap: 12px; align-items: center; justify-content: space-between; font-weight: 600; }
.lightbox .pages { display: flex; gap: 8px; }
@media (max-width: 560px) { .facts { grid-template-columns: minmax(0, 1fr); } .drawer { padding-inline: 16px; } }
/* sign-in gate */
body.signed-out .shell { visibility: hidden; }
.signin .lock-card .brand-mark { margin: 0 auto; width: 52px; height: 52px; font-size: 18px; }
.signin .err { color: var(--crit); font-size: 14px; margin: 12px 0 0; }
.topbar .who { font-size: 13px; color: var(--muted); }
.list .m.loading { padding: 4px 0; }
/* access log filters */
.audit-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 12px 18px 0; }
.audit-filters label { font-size: 13px; font-weight: 600; color: var(--muted); }
.audit-filters select, .audit-filters input { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-height: 38px; }
.audit-filters input { flex: 1; min-width: 180px; }
.audit-filters select:focus, .audit-filters input:focus { outline: 2px solid var(--s1); outline-offset: 1px; }
.audit-summary { margin: 12px 18px 0; padding: 12px 14px; border-radius: 10px; background: var(--panel-soft); display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; }
.audit-summary b.big { display: block; font-size: 20px; line-height: 1.2; }
.audit-summary .who-name { font-weight: 700; font-size: 15px; flex-basis: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* client progress (sample ABA graphs) */
.prog-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 18px 0; font-size: 14px; color: var(--ink-2); }
.prog-meta b { color: var(--ink); }
.goal-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px 18px 4px; }
.goal-tile { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.goal-tile .t { font-weight: 700; font-size: 14.5px; }
.goal-tile .m { font-size: 12.5px; color: var(--muted); }
.goal-tile .v { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.goal-tile .v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.goal-tile .chg { font-size: 13px; color: var(--ink-2); }
.multiples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 12px 18px; }
.mult { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; min-width: 0; }
.mult h3 { font-size: 15px; margin: 0; }
.mult .m { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mult .chart { height: 230px; }
.auth { padding: 4px 18px 6px; }
.auth h3 { font-size: 15px; margin: 10px 0 4px; }
.auth-row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--grid); font-size: 14px; }
.auth-row:first-of-type { border-top: 0; }
.auth-bar { position: relative; height: 12px; border-radius: 99px; background: var(--panel-soft, var(--grid)); }
.auth-bar > div { height: 100%; border-radius: 99px; background: var(--s1); }
.auth-bar i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.auth-row .n { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.auth-key { font-size: 12.5px; color: var(--muted); padding: 2px 0 6px; display: flex; gap: 6px; align-items: center; }
.auth-key i { display: inline-block; width: 2px; height: 12px; background: var(--ink); }
.sample-ask { margin: 6px 18px 16px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink-2); font-size: 14px; }
@media (max-width: 1100px) { .goal-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .multiples { grid-template-columns: minmax(0, 1fr); }
  .auth-row { grid-template-columns: minmax(0, 1fr) auto; }
  .auth-row .auth-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* clients area, attention list, session flow */
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--grid); }
.attn li:first-child { border-top: 0; }
.attn .lvl { width: 8px; align-self: stretch; border-radius: 4px; flex: none; }
.attn .lvl.crit { background: var(--crit); } .attn .lvl.warn { background: #e2a400; } .attn .lvl.info { background: var(--s1); }
.attn .grow { flex: 1; min-width: 0; }
.attn .t { font-weight: 600; }
.attn .m { font-size: 13px; color: var(--muted); }
.attn .btn { padding: 7px 12px; font-size: 13.5px; white-space: nowrap; }
.today-list li .when { font-variant-numeric: tabular-nums; font-weight: 700; width: 74px; flex: none; }
.clients-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 16px; }
.clients-head h1 { font-family: var(--display); font-size: 30px; margin: 0; }
.clients-head .search { margin-left: auto; min-width: 220px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font: inherit; }
.back { background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; margin-bottom: 10px; font: inherit; }
.chead { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-start; padding: 18px; }
.chead h1 { font-family: var(--display); font-size: 30px; margin: 0; }
.chead .pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chead .meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 22px; font-size: 14px; flex: 1; min-width: 300px; }
.chead .meta b { display: block; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.chead .acts { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.tabbar { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 6px 0 16px; scrollbar-width: none; }
.tabbar button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabbar button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tl { list-style: none; margin: 0; padding: 0 18px 12px; }
.tl li { border-top: 1px solid var(--grid); padding: 12px 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 14px; }
.tl li:first-child { border-top: 0; }
.tl .d { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl .who { font-weight: 700; }
.tl .txt { color: var(--ink-2); font-size: 14.5px; white-space: normal; }
.chipbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px 4px; }
.chipbar button { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.chipbar button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.plan-goal { padding: 14px 18px; border-top: 1px solid var(--grid); }
.plan-goal:first-child { border-top: 0; }
.plan-goal h3 { font-size: 16px; margin: 0 0 6px; }
.plan-goal dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 14px; }
.plan-goal dt { color: var(--muted); }
.plan-goal dd { margin: 0; }
td.wrap { white-space: normal; }
.flagtxt { font-size: 12.5px; color: var(--warn); white-space: normal; }
.sess { position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow-y: auto; }
.sess-in { max-width: 980px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 40px; }
.sess-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.sess-top h2 { font-family: var(--display); font-size: 24px; margin: 0; }
.sess-top .x { margin-left: auto; }
.checks { list-style: none; margin: 0; padding: 4px 18px 12px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--grid); font-size: 15px; }
.checks li:first-child { border-top: 0; }
.checks .ok { color: var(--good); font-weight: 800; }
.clock { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; padding: 18px; }
.clock .big { font-size: 54px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.clock .live { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: var(--good); }
.clock .live i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 1.4s infinite; }
.clock.paused .live { color: var(--warn); } .clock.paused .live i { background: #e2a400; animation: none; }
@keyframes pulse { 50% { opacity: .3; } }
.clock .btns { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.btn.big { min-height: 52px; padding: 12px 22px; font-size: 16px; }
.btn.stop { background: var(--crit); color: #fff; }
.tcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tcard h3 { font-size: 16px; margin: 0; }
.tcard .m { font-size: 12.5px; color: var(--muted); }
.tcard .val { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0; }
.tbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.tbtns button { min-height: 52px; min-width: 64px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-soft, var(--grid)); color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; padding: 6px 14px; }
.tbtns button.pos { background: var(--good-bg); color: var(--good); border-color: transparent; }
.tbtns button.neg { background: var(--crit-bg); color: var(--crit); border-color: transparent; }
.tbtns button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.actlog { font-size: 13px; color: var(--muted); max-height: 140px; overflow-y: auto; padding: 0 18px 12px; }
.sumgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px 18px; }
.sumgrid div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sumgrid b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sumgrid span { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nf { padding: 6px 18px 16px; display: grid; gap: 14px; }
.nf label.l { font-weight: 700; display: block; margin-bottom: 4px; }
.nf textarea, .nf select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font: inherit; min-height: 70px; }
.nf .from { font-size: 12px; font-weight: 700; color: var(--teal, var(--accent)); text-transform: uppercase; letter-spacing: .05em; }
.ntarget { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ntarget .data { font-weight: 700; margin: 2px 0 6px; }
.ntarget label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.payer-check { display: flex; flex-wrap: wrap; gap: 8px; }
.sigpad { border: 1px dashed var(--line); border-radius: 10px; background: #fff; height: 130px; position: relative; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; }
.sigpad span { position: absolute; left: 12px; bottom: 8px; font-size: 12px; color: #6b7a8c; pointer-events: none; }
.sample-ask { margin: 6px 18px 16px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink-2); font-size: 14px; }
.ntab td, .ntab th { white-space: normal; vertical-align: top; }
.ntab .rcol { border-left: 2px solid var(--line); }
.ntab select { font: inherit; padding: 4px 6px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.tl .ntab-wrap { padding: 4px 0 6px; }
.tl .ntab td, .tl .ntab th { padding: 5px 10px; font-size: 13px; }
.nhead { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.nhead div { padding: 8px 12px; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); min-width: 0; }
.nhead b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.nhead span { font-weight: 600; }
.rh { font-size: 15px; margin: 8px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.src { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 99px; background: var(--good-bg); color: var(--good); }
.src.you { background: var(--warn-bg); color: var(--warn); }
.checkgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-size: 14px; }
.checkgrid label { display: flex; gap: 8px; align-items: flex-start; }
:root { --c3: #1baf7a; --c4: #eda100; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c3: #199e70; --c4: #c98500; } }
:root[data-theme="dark"] { --c3: #199e70; --c4: #c98500; }
@media (max-width: 900px) { .nhead { grid-template-columns: repeat(2, minmax(0, 1fr)); } .checkgrid { grid-template-columns: minmax(0, 1fr); } }
.glance td { vertical-align: middle; }
.gl { display: flex; gap: 14px; align-items: center; }
.gl b { font-size: 18px; font-variant-numeric: tabular-nums; }
.gl .spk { flex: none; }
@media (max-width: 700px) { .gl { flex-direction: column; align-items: flex-start; gap: 4px; } }
@media (max-width: 900px) { .chead .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sumgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .tcards { grid-template-columns: minmax(0, 1fr); }
  .chead .meta { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .clock .big { font-size: 44px; } .clock .btns { margin-left: 0; width: 100%; }
  .tl li { grid-template-columns: minmax(0, 1fr); }
  .plan-goal dl { grid-template-columns: minmax(0, 1fr); }
  .clients-head .search { margin-left: 0; width: 100%; }
}

/* home layout: announcements strip at the top */
.ann-top .list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ann-top .list li { border-top: 0; border-left: 1px solid var(--grid); }
.ann-top .list li:first-child { border-left: 0; }
@media (max-width: 900px) { .ann-top .list { grid-template-columns: minmax(0, 1fr); } .ann-top .list li { border-left: 0; border-top: 1px solid var(--grid); } .ann-top .list li:first-child { border-top: 0; } }

/* staff view: home sections reordered (admins keep the page order) */
#homeView { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
#homeView:not(.as-admin) > .greet { order: 0; }
#homeView:not(.as-admin) > #sec-ann { order: 1; }
#homeView:not(.as-admin) > .kpis { order: 2; }
#homeView:not(.as-admin) > #sec-attention { order: 3; }
#homeView:not(.as-admin) > #sec-intakes { order: 4; }
#homeView:not(.as-admin) > .row.hero { order: 5; }
#homeView:not(.as-admin) > #sec-docrow { order: 6; }
#homeView:not(.as-admin) > #sec-certs, #homeView:not(.as-admin) > #sec-audit { order: 7; }
#homeView:not(.as-admin) > #sec-pipeline { order: 8; }

/* announcements: pronounced navy band (fixed brand colors so it reads the same in light and dark) */
.ann-top { background: linear-gradient(135deg, #0f2d5e 0%, #1a4480 70%, #0d7a6e 140%); border: 0; color: #fff; box-shadow: 0 6px 22px rgba(15, 45, 94, 0.28); }
.ann-top .panel-h { padding-top: 16px; }
.ann-top .panel-h h2 { color: #fff; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.ann-top .panel-h h2 svg { width: 26px; height: 26px; stroke: #ffd166; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ann-top .panel-h .sub { color: #c9d6ea; }
.ann-top .link { color: #ffd166; }
.ann-top .list { gap: 12px; padding: 4px 16px 16px; }
.ann-top .list li, .ann-top .list li:first-child { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 12px; padding: 14px; align-items: flex-start; }
.ann-top .list li:first-child { background: rgba(255, 209, 102, 0.14); border-color: #ffd166; }
.ann-top .t { color: #fff; font-size: 16px; font-weight: 700; line-height: 1.3; }
.ann-top .m { color: #c9d6ea; margin-top: 2px; }
.ann-top li:first-child .t::before { content: "New"; display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 99px; background: #ffd166; color: #231a00; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; vertical-align: 2px; }
.ann-top .ann-date { background: #fff; color: #0f2d5e; width: 48px; padding: 6px 0; }
.ann-top .ann-date b { font-size: 20px; }
@media (max-width: 900px) { .ann-top .list li, .ann-top .list li:first-child { border-top: 1px solid rgba(255, 255, 255, 0.16); } .ann-top .list li:first-child { border-color: #ffd166; } }

/* staff directory (admin) */
.tg-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--grid); }
.tg-row:first-child { border-top: 0; }
.tg-row .t { font-weight: 600; }
.tg-row .m { font-size: 12.5px; color: var(--muted); }
.tg-bar { height: 10px; border-radius: 99px; background: var(--panel-soft, var(--grid)); position: relative; overflow: hidden; }
.tg-bar > div { height: 100%; border-radius: 99px; }
.tg-bar.good > div { background: var(--good); } .tg-bar.warn > div { background: #e2a400; } .tg-bar.crit > div { background: var(--crit); }
.tg-val { font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); margin-top: 3px; }
.tag-sample { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; margin-left: 6px; }
@media (max-width: 700px) { .tg-row { grid-template-columns: minmax(0, 1fr) auto; } .tg-row .tg-mid { grid-column: 1 / -1; grid-row: 2; } }

/* sidebar: section jumps nested under Home */
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 0 0 6px; }
.nav-sub[hidden] { display: none; }
.nav .nav-sub button { padding-top: 6px; padding-bottom: 6px; padding-left: 44px; font-size: 13.5px; color: rgba(255,255,255,0.72); }
.nav .nav-sub button .arr { width: 14px; flex: none; opacity: .7; font-size: 12px; }
.nav .nav-sub button[aria-current="page"] { background: rgba(255,255,255,0.08); }
/* intake timeline: first-contact clock, 24-hour staleness, time-to-complete metrics */
.iclock { min-width: 128px; }
.iclock .bar { height: 7px; border-radius: 99px; background: var(--panel-soft); overflow: hidden; margin-top: 4px; }
.iclock .bar > div { height: 100%; border-radius: 99px; background: var(--good); }
.iclock.risk .bar > div { background: var(--warn); }
.iclock.over .bar > div { background: var(--crit); }
.iclock b { font-variant-numeric: tabular-nums; }
.iclock.risk b { color: var(--warn); }
.iclock.over b { color: var(--crit); }
.who-wait { font-size: 12.5px; color: var(--muted); }
.stale { color: var(--warn); font-weight: 700; }
.it-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 18px 4px; }
.it-tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.it-tile .label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.it-tile .v { font-size: 26px; font-weight: 700; line-height: 1.15; }
.it-tile .v small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.it-tile .m { font-size: 13px; color: var(--muted); }
.steps-v { list-style: none; margin: 8px 0 0; padding: 0 18px 14px; }
.steps-v li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 6px 0; position: relative; }
.steps-v li::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: -6px; width: 2px; background: var(--line); }
.steps-v li:last-child::before { display: none; }
.steps-v .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); display: grid; place-items: center; font-size: 12px; font-weight: 700; z-index: 1; }
.steps-v li.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.steps-v li.now .dot { border-color: var(--accent); color: var(--accent); }
.steps-v li.now .t { font-weight: 700; }
.steps-v .d { color: var(--muted); font-size: 13px; white-space: nowrap; }
.callform { display: grid; gap: 10px; padding: 0 18px 16px; }
.callform select, .callform textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }
@media (max-width: 720px) { .it-tiles { grid-template-columns: 1fr; } .iclock { min-width: 96px; } }
/* intake workspace page */
.iws { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.iws-list { position: sticky; top: 14px; max-height: calc(100vh - 28px); display: flex; flex-direction: column; overflow: hidden; }
.iws-filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 6px; }
.chipbtn { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 99px; padding: 4px 11px; cursor: pointer; }
.chipbtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.iws-items { list-style: none; margin: 0; padding: 4px 8px 10px; overflow-y: auto; }
.iws-item { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 10px; border: 1.5px solid transparent; border-radius: 10px; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.iws-item:hover { background: var(--panel-soft); }
.iws-item.on { border-color: var(--accent); background: var(--accent-soft); }
.iws-item .r b { font-variant-numeric: tabular-nums; }
.iws-item .day { font-size: 12.5px; font-weight: 700; color: var(--good); text-align: right; }
.iws-item .day.risk { color: var(--warn); } .iws-item .day.over { color: var(--crit); }
.iws-item .s { font-size: 13px; color: var(--ink-2); }
.iws-item .stale, .iws-item .m { font-size: 12.5px; text-align: right; }
.iws-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.iws-main > .row.two { margin: 0; }
.iws-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; padding: 18px 18px 6px; align-items: start; }
.iws-head h1 { font-family: var(--display); font-size: 28px; margin: 2px 0 0; }
.iws-head .pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.iws-nav { display: flex; gap: 6px; }
.iws-clock { grid-column: 1 / -1; max-width: 420px; }
.iws-contact { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 18px; padding: 12px 18px; margin: 8px 18px 0; background: var(--panel-soft); border-radius: 12px; font-size: 14.5px; }
.iws-contact b { display: block; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.iws-contact a { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.iws-acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 18px; }
.iws-next { margin: 10px 18px 14px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.iws-next.warn { background: var(--warn-bg); }
.iws-next b { font-size: 16px; } .iws-next p { margin: 4px 0 0; color: var(--ink-2); }
.iws-progress { padding: 14px 18px 18px; display: grid; gap: 6px; }
.iws-progress .bar { height: 10px; border-radius: 99px; background: var(--panel-soft); overflow: hidden; max-width: 420px; }
.iws-progress .bar > div { height: 100%; background: var(--accent); border-radius: 99px; }
.iws-empty { padding: 40px 18px; text-align: center; color: var(--muted); }
.iws-back { display: none; }
/* the side panel version (home page → click an intake) */
#drawerBody.jw { width: min(900px, 100%); display: flex; flex-direction: column; gap: 14px; }
.dsteps { list-style: none; margin: 0; padding: 4px 18px 6px; display: flex; flex-direction: column; gap: 2px; }
.dsteps li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.dsteps li:last-child { border-bottom: 0; }
.dsteps .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--panel-soft); color: var(--muted); }
.dsteps li.done .ic { background: var(--good); color: #fff; }
.dsteps li.partial .ic { background: var(--warn-bg); color: var(--warn); }
.dsteps .miss { font-size: 13.5px; color: var(--warn); margin-top: 2px; }
@media (max-width: 640px) { .dsteps li { grid-template-columns: 26px minmax(0, 1fr); } .dsteps li .pill, .dsteps li .link { grid-column: 2; justify-self: start; } }
.helpov { position: fixed; inset: 0; z-index: 70; background: var(--bg); }
.helpov iframe { width: 100%; height: 100%; border: 0; display: block; }
#drawerBody.jw > * { flex-shrink: 0; } /* the scrolling tab bar would otherwise collapse to 1px in the column */
#drawerBody.jw .tabbar { margin: 0; }
#drawerBody.jw .jw-top { display: flex; justify-content: flex-end; margin-bottom: -6px; }
#drawerBody.jw .iws-back { display: none !important; }
#drawerBody.jw .iws-contact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#drawerBody.jw .row.two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (max-width: 640px) { #drawerBody.jw .iws-contact { grid-template-columns: minmax(0, 1fr); } #drawerBody.jw .iws-head { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .iws-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .iws { grid-template-columns: 1fr; }
  .iws-list { position: static; max-height: none; }
  .iws.has .iws-list { display: none; }
  .iws-back { display: inline-block; }
  .iws-head { grid-template-columns: 1fr; }
}
/* key numbers block: cards are tabs for the chart right below them */
.numbers { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.numbers .kpis { position: relative; z-index: 1; }
.numbers .kpi { position: relative; }
.numbers .kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.numbers .kpi[aria-pressed="true"]::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 16px; height: 16px; background: var(--panel);
  border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); transform: translateX(-50%) rotate(45deg); }
.kpi-more { grid-column: 1 / -1; justify-self: start; margin-top: 4px; background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--accent); cursor: pointer; }
.kpi-more:hover { text-decoration: underline; }
.numbers-chart { margin-top: 14px; border-top: 3px solid var(--accent); }
.numbers-chart .hint { color: var(--muted); font-size: 13px; }
.mswitch { display: none; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.kd-list { list-style: none; margin: 0; padding: 0 8px 10px; }
.kd-row { width: 100%; text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.kd-row:hover { background: var(--panel-soft); }
.kd-row .m { grid-column: 1 / -1; }
.kd-row.static { cursor: default; } .kd-row.static:hover { background: none; }
.kd-bar { height: 8px; border-radius: 99px; background: var(--panel-soft); overflow: hidden; grid-column: 1 / -1; }
.kd-bar > div { height: 100%; border-radius: 99px; background: var(--good); }
.kd-bar.under > div { background: var(--warn); }
.kd-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 18px 12px; }
#homeView:not(.as-admin) > #sec-numbers { order: 2; }
@media (max-width: 720px) {
  .numbers .kpi[aria-pressed="true"]::after { display: none; }
  .mswitch { display: flex; width: 100%; }
}
/* RowanLux signature (tools/add_rowanlux_brand.py) */
:root { --rl: #6c3fc5; --rl-soft: rgba(108, 63, 197, 0.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --rl: #b79af0; --rl-soft: rgba(183, 154, 240, 0.14); } }
:root[data-theme="dark"] { --rl: #b79af0; --rl-soft: rgba(183, 154, 240, 0.14); }
.rl-mark { width: 26px; height: 26px; flex: none; border-radius: 7px; }
.rl-foot { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.10); color: #e4e9f2; width: 100%; font: inherit; text-align: left; cursor: pointer; }
.rl-foot:hover { background: rgba(255, 255, 255, 0.11); }
.rl-foot b { display: block; font-size: 13px; letter-spacing: .01em; color: #fff; }
.rl-foot small { display: block; font-size: 12px; color: #b9c7dd; }
.rl-sign { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.rl-sign b { color: var(--rl); }
.rl-help .rules { margin: 6px 0 0; padding: 0 18px 14px 36px; display: grid; gap: 6px; color: var(--ink-2); }
.rl-help .facts { padding: 4px 18px 16px; }
.rl-brandline { display: flex; align-items: center; gap: 12px; padding: 16px 18px 6px; }
.rl-brandline .rl-mark { width: 40px; height: 40px; border-radius: 10px; }
.rl-brandline b { font-size: 18px; } .rl-brandline span { color: var(--muted); font-size: 13.5px; display: block; }

/* admin view: home sections reordered (tools/admin_home_order.py) */
#homeView.as-admin > .greet { order: 0; }
#homeView.as-admin > #sec-ann { order: 1; }
#homeView.as-admin > #sec-attention { order: 2; }
#homeView.as-admin > #sec-intakes { order: 3; }
#homeView.as-admin > #sec-numbers { order: 4; }
#homeView.as-admin > #sec-intaketime { order: 5; }
#homeView.as-admin > #sec-pipeline { order: 6; }
#homeView.as-admin > #sec-docrow { order: 7; }
#homeView.as-admin > #sec-audit { order: 8; }

/* admin: Certifications sits beside My staff file */
/* Needs attention fills its column (as tall as Today + My to-do) and scrolls inside, in both views */
#attLeft { position: relative; min-height: 340px; }
#attLeft > .panel:has(#attnList) { position: absolute; inset: 0; display: flex; flex-direction: column; }
#attLeft #attnList { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
@media (max-width: 900px) { #attLeft { min-height: 0; } #attLeft > .panel:has(#attnList) { position: static; } #attLeft #attnList { max-height: 440px; } }
/* admin: the access log scrolls inside its box; the column headings stay visible */
#sec-audit .table-wrap { max-height: 440px; overflow-y: auto; }
#sec-audit thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
/* admin: Documents is its own page */
#docsView #sec-docs .list li { display: flex; }
/* end admin_home_order */
/* sample documents (tools/embed_documents.py) */
#homeView:not(.as-admin) .adm-doc { display: none; }
#sec-docrow #sec-docs .list { max-height: 330px; overflow-y: auto; }
.doc-ic.dc { font-size: 9.5px; }
/* end sample documents */

/* ---------- chart tooltip and empty state (behavior trends) ---------- */
.nm-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 9px; padding: 8px 10px; font-size: 13px; color: var(--ink); white-space: nowrap; }
.nm-tip b { display: block; margin-bottom: 2px; }
.nm-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.nm-empty { padding: 30px 18px; text-align: center; color: var(--muted); }

/* ---------- client page: behavior trends (one series per view, picked from a list) ---------- */
.tr-staff { border-top: 1px solid var(--line); padding: 12px 18px 16px; }
.tr-staff h3 { font-size: 15px; margin: 0 0 2px; }
.tr-row { display: grid; grid-template-columns: minmax(110px, 200px) 1fr auto; gap: 12px; align-items: center; padding: 6px 0; }
.tr-row .who b { display: block; font-size: 14px; }
.tr-row .who span { font-size: 12.5px; color: var(--muted); }
.tr-row .track { height: 16px; }
.tr-row .fill { height: 16px; background: var(--s1); border-radius: 0 4px 4px 0; min-width: 2px; }
.tr-row .v { font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .tr-row { grid-template-columns: 1fr auto; } .tr-row .track { grid-column: 1 / -1; order: 3; } }
.tr-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 18px 0; }
.tr-tools select { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); max-width: 100%; }
.tr-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 12px 18px 0; }
.tr-stats div { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tr-stats b { display: block; font-size: 22px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.tr-stats .delta { font-size: 12.5px; margin-left: 6px; vertical-align: 3px; }
.tr-plot { position: relative; padding: 6px 12px 12px; }
.tr-plot svg { display: block; width: 100%; overflow: visible; }
.tr-plot text { font: 11.5px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.tr-plot .lbl { fill: var(--ink); font-weight: 700; font-size: 12.5px; }
.tr-reasons { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 14px; }

/* access log on the Admin page: fixed-height scroll box with a sticky header */
.au-scroll { max-height: 460px; overflow: auto; margin-top: 8px; border-top: 1px solid var(--line); }
.au-scroll thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
@media (max-width: 640px) { .au-scroll { max-height: 60vh; } }

/* Admin page: employee report. Dot plot per client: filled = with this person, hollow = everyone else, same scale */
.er-head { margin: 12px 18px 4px; padding: 12px 14px; border-radius: 10px; background: var(--panel-soft); }
.er-head ul { list-style: none; margin: 6px 0 0; padding: 0; }
.er-head li { padding: 3px 0 3px 22px; position: relative; font-size: 14.5px; }
.er-head li::before { position: absolute; left: 0; top: 3px; font-weight: 700; }
.er-head li.warn::before { content: "!"; color: var(--warn); }
.er-head li.info::before { content: "i"; color: var(--accent); }
.er-head li.good::before { content: "✓"; color: var(--good); }
.er-head li.none::before { content: "–"; color: var(--muted); }
.er-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 18px 2px; font-size: 13px; color: var(--ink-2); }
.er-legend .er-dot { position: static; display: inline-block; transform: none; margin-right: 6px; vertical-align: -2px; }
.er-card { border-top: 1px solid var(--line); padding: 10px 18px 8px; margin-top: 8px; }
.er-who { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.er-who b { display: block; font-size: 15px; }
.er-who .m { font-size: 12.5px; color: var(--muted); }
.er-row { display: grid; grid-template-columns: minmax(100px, 170px) 1fr minmax(150px, 190px); gap: 14px; align-items: center; padding: 5px 0; }
.er-client { color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.er-client:hover { color: var(--accent); text-decoration: underline; }
.er-track { position: relative; height: 22px; border-radius: 99px; background: linear-gradient(var(--grid), var(--grid)) center / 100% 2px no-repeat; }
.er-link { position: absolute; top: 50%; height: 2px; transform: translateY(-50%); background: var(--muted); }
.er-link.bad { height: 6px; border-radius: 3px; background: var(--warn); opacity: .55; }
.er-dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); box-sizing: border-box; }
.er-dot.me { background: var(--s1); box-shadow: 0 0 0 2px var(--panel); z-index: 2; }
.er-dot.me.few { background: var(--panel); border: 2px dashed var(--s1); }
.er-dot.them { background: var(--panel); border: 2px solid var(--muted); z-index: 1; }
.er-gap { font-size: 13px; font-weight: 700; }
.er-gap.bad { color: var(--warn); }
.er-gap.good { color: var(--good); }
.er-note { font-size: 13px; color: var(--muted); }
.er-axis { margin: 0 18px; padding-top: 0; }
.er-axis > div { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
@media (max-width: 640px) { .er-row { grid-template-columns: 1fr auto; } .er-track, .er-axis > div { grid-column: 1 / -1; order: 3; } }
.er-name { font-size: inherit; font-weight: 700; }
#erStaff { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); max-width: 100%; }
.er-legend b { color: var(--ink); font-weight: 600; }
.er-legend span { cursor: default; }
.er-end { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.er-who-btn { font-size: 12.5px; }
.er-others { margin: -2px 0 6px calc(min(170px, 30%) + 14px); padding: 8px 12px; border-radius: 9px; background: var(--panel-soft); font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.er-other .er-dot { position: static; display: inline-block; transform: none; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 640px) { .er-others { margin-left: 0; } }

/* employee report, simple version: two bars per client (top = this employee, bottom = everyone else, same client) */
.er-how { margin: 4px 0 6px; font-size: 13.5px; color: var(--ink-2); }
.er-client-block { padding: 10px 0; border-top: 1px solid var(--grid); }
.er-client-h { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 6px; }
.er-say { font-size: 14px; color: var(--muted); }
.er-say.bad { color: var(--warn); font-weight: 700; }
.er-say.good { color: var(--good); font-weight: 600; }
.er-bars { display: grid; grid-template-columns: 120px 1fr 44px; gap: 6px 12px; align-items: center; max-width: 720px; }
.er-lab { font-size: 13px; color: var(--ink-2); }
.er-bar { height: 18px; }
.er-bar > div { height: 18px; border-radius: 0 4px 4px 0; min-width: 3px; }
.er-bar .me { background: var(--s1); }
.er-bar .me.few { background: var(--panel); border: 2px dashed var(--s1); box-sizing: border-box; }
.er-bar .them { background: var(--muted); opacity: .45; }
.er-num { font-size: 15px; font-variant-numeric: tabular-nums; }
.er-client-block .er-who-btn { margin-top: 6px; }
.er-client-block .er-others { margin: 6px 0 0; }
@media (max-width: 640px) { .er-bars { grid-template-columns: 96px 1fr 36px; } }

/* employee report as a pivot-style trend chart */
:root { --e1: #2a78d6; --e2: #eb6834; --e3: #1baf7a; --e4: #eda100; --e5: #e87ba4; --e6: #008300; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --e1: #3987e5; --e2: #d95926; --e3: #199e70; --e4: #c98500; --e5: #d55181; } }
:root[data-theme="dark"] { --e1: #3987e5; --e2: #d95926; --e3: #199e70; --e4: #c98500; --e5: #d55181; }
.er-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 18px 0; }
.er-flabel { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 84px; }
.er-fnote { font-size: 12.5px; margin-left: 6px; }
.er-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 4px 11px; font: inherit; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.er-chip i { width: 10px; height: 10px; border-radius: 50%; }
.er-chip[aria-pressed="true"] { border-color: var(--ink-2); color: var(--ink); font-weight: 600; background: var(--panel-soft); }
.er-chip[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
.er-chart { position: relative; padding: 12px 18px 4px; }
.er-chart-h { font-size: 14px; margin-bottom: 4px; }
.er-chart-h .m { color: var(--muted); font-size: 12.5px; }
.er-chart svg text { font: 11.5px var(--sans); fill: var(--muted); }
.er-chart svg .er-end-lbl { font-weight: 700; font-size: 12.5px; }
.er-chart .nm-tip div { white-space: nowrap; }
.er-howto { margin: 6px 18px 0; padding: 10px 12px; border-radius: 9px; background: var(--panel-soft); font-size: 13.5px; color: var(--ink-2); }
.er-heat { border-collapse: separate; border-spacing: 2px; }
.er-heat th { font-size: 12px; }
.er-heat td:first-child { white-space: nowrap; font-weight: 600; }
.er-sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.er-hc { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; border-radius: 4px; min-width: 70px; }
.er-hc.none { color: var(--muted); font-weight: 400; background: transparent; }
.er-hc small { display: block; font-size: 10.5px; font-weight: 400; opacity: .8; }

/* employee report filters: Excel-style dropdowns with a checkbox per item */
.er-dd { position: relative; }
.er-dd-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 7px 12px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.er-dd-btn .er-flabel { min-width: 0; }
.er-dd-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.er-dd-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 220px; max-height: 300px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.er-dd-menu label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.er-dd-menu label:hover { background: var(--panel-soft); }
.er-dd-menu input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.er-dd-menu .er-dd-all { border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; margin-bottom: 4px; font-weight: 600; }
.er-dd-menu .er-sw { margin-right: 0; }
.er-dd-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 8px 2px; }
.dr { border-top: 1px solid var(--line); padding: 12px 18px 14px; }
.dr-h { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.dr .list { margin-top: 8px; }
.cjump { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 14px 2px 0; font-size: 14px; }
.cjump .m { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
#cjDocs, #cjTeam, #ctTrends, #cjTargets, #cjSessions { scroll-margin-top: 16px; }

/* long lists (session notes, a client's sessions): fixed-height scroll box with the headings pinned */
.scroll-box { max-height: 520px; overflow: auto; padding-top: 0; }  /* no gap above the sticky header, or rows show through it */
.scroll-box thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; box-shadow: 0 1px 0 var(--line); }
@media (max-width: 640px) { .scroll-box { max-height: 65vh; } }

/* Home: needs-attention heat map (office). Shade = age of the oldest item; works in light and dark. */
table.heat th { white-space: normal; font-size: 11.5px; vertical-align: bottom; min-width: 92px; }
table.heat td.hc { text-align: center; padding: 6px; }
table.heat td.hc button { width: 100%; border: 0; border-radius: 8px; padding: 6px 4px; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
table.heat td.hc button b { font-size: 18px; line-height: 1.1; }
table.heat td.hc button span { font-size: 11.5px; }
.h1 { background: rgba(233, 162, 59, 0.16); }
.h2 { background: rgba(233, 162, 59, 0.42); }
.h3 { background: rgba(214, 110, 20, 0.82); }
table.heat td.hc button.h3, .heat-key .h3 { color: #fff; }
table.heat td.hc button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.heat-key { margin: 0; padding: 10px 18px 14px; font-size: 13px; color: var(--muted); }
.heat-key span { display: inline-block; padding: 1px 8px; border-radius: 6px; color: var(--ink); margin-right: 4px; }
/* On / Off switch (practice settings) */
.switch { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 99px; padding: 3px; background: var(--panel-soft); }
.switch button { border: 0; border-radius: 99px; padding: 5px 14px; font: inherit; font-weight: 700; font-size: 13.5px; background: transparent; color: var(--muted); cursor: pointer; }
.switch button[aria-pressed="true"] { background: var(--teal); color: #fff; }
.switch button[aria-pressed="true"][data-v="off"] { background: var(--ink); }
.switch button:disabled { cursor: default; }
/* Intake: ask for what's missing (document picker) */
.askchecks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; margin-top: 4px; }
.form .askchecks label { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 15px; margin: 0; cursor: pointer; }
.form .askchecks input { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; accent-color: var(--teal); }
