:root { --ink:#13212B; --muted:#3E4F59; --line:#C9D3D0; --soft:#F2F6F5; --accent:#0B6E63; --accent-dark:#084F47;
  --warn-bg:#FBEFD9; --warn:#6B3A0A; --bad:#9F1D1D; --bad-bg:#FDF2F2; }
* { box-sizing: border-box; }
body { margin:0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color:var(--ink); background:#fff; line-height:1.5; font-size:16px; }
.skip { position:absolute; left:-9999px; } .skip:focus { left:8px; top:8px; background:#fff; padding:8px; z-index:10; }
.banner { background:var(--warn-bg); color:var(--warn); padding:8px 16px; text-align:center; font-size:14px; }
.top { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; padding:12px 16px; border-bottom:1px solid var(--line); }
.top p { margin:0; } .brand span { color:var(--muted); font-size:14px; margin-left:8px; } .who { color:var(--muted); font-size:14px; }
main { max-width:1000px; margin:0 auto; padding:24px 16px 64px; outline:none; }
h1 { font-size:28px; margin:0 0 16px; } h2 { font-size:20px; margin:32px 0 12px; }
.status:not(:empty) { max-width:1000px; margin:12px auto 0; padding:8px 16px; color:var(--muted); }
:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
button, .btn { font:inherit; min-height:44px; padding:8px 16px; border-radius:6px; border:1.5px solid var(--ink); background:#fff; color:var(--ink); cursor:pointer; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; } button.primary:hover { background:var(--accent-dark); }
/* UX-021 (founder, 27 Oct 2026: "make all the little buttons visible with a different colour"): every link-style action is a
   clearly visible button in its own colour (action blue #1A4FA0 on #E8F0FE, 6.9:1; white on #1A4FA0 when pointed at, 7.9:1). */
:root { --action:#1A4FA0; --action-bg:#E8F0FE; --action-line:#7FA2DB; }
button.link { display:inline-flex; align-items:center; gap:4px; min-height:32px; padding:4px 12px; margin:2px 0; border:1.5px solid var(--action-line);
  border-radius:999px; background:var(--action-bg); color:var(--action); font-weight:600; text-decoration:none; line-height:1.3; vertical-align:middle; }
button.link:hover { background:var(--action); border-color:var(--action); color:#fff; }
button.link:focus-visible { outline:3px solid var(--action); outline-offset:2px; }
@media print { button.link { border:0; background:none; padding:0; color:inherit; } }
/* Success messages: a green box with a tick, so the result of an action is never missed (founder, 27 Oct 2026). */
p.hint[role="status"]:not(:empty), p.success:not(:empty) { color:#14532D; background:#ECF8F0; border:1.5px solid #2E7D4F; border-radius:8px; padding:10px 14px;
  margin:8px 0 12px; font-size:16px; font-weight:600; }
p.hint[role="status"]:not(:empty)::before, p.success:not(:empty)::before { content:"\2714\00a0 "; }
form { display:grid; gap:12px; padding:16px; border:1px solid var(--line); border-radius:8px; background:var(--soft); }
.row { display:grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap:12px; }
label { display:block; font-weight:600; font-size:15px; margin-bottom:4px; }
input, select { font:inherit; width:100%; min-height:44px; padding:8px 10px; border:1.5px solid #6B7C85; border-radius:6px; background:#fff; }
/* Text boxes as wide as their column and in the screen's font (founder, 21 Oct 2026: the medical necessity box was too small to read). */
textarea { font:inherit; line-height:1.45; width:100%; box-sizing:border-box; min-height:88px; padding:8px 10px; border:1.5px solid #6B7C85; border-radius:6px; background:#fff; resize:vertical; }
textarea[aria-invalid="true"] { border-color:var(--bad); }
input[aria-invalid="true"] { border-color:var(--bad); }
input[type="checkbox"], input[type="radio"] { width:22px; height:22px; min-height:0; padding:0; margin:0 8px 0 0; vertical-align:middle; accent-color:var(--accent, #0F6E5C); }
input[type="checkbox"] + label, input[type="radio"] + label { display:inline; font-weight:500; }
.hint { font-size:14px; color:var(--muted); margin:2px 0 0; }
.error { color:var(--bad); background:var(--bad-bg); border:1.5px solid var(--bad); border-radius:6px; padding:8px 12px; margin:0; }
.error:empty { display:none; }
.empty { padding:24px; border:1px dashed var(--line); border-radius:8px; color:var(--muted); }
.notice { padding:12px 16px; border:2px solid var(--line); border-radius:8px; margin:8px 0; }
.table-wrap { overflow-x:auto; } table { border-collapse:collapse; width:100%; } th, td { text-align:left; padding:10px 8px; border-bottom:1px solid var(--line); }
td.num, th.num { text-align:right; font-variant-numeric: tabular-nums; }
dl.summary { display:grid; grid-template-columns: minmax(180px, 1fr) auto; gap:0; border-top:1.5px solid var(--ink); margin:0; }
dl.summary dt, dl.summary dd { padding:10px 0; border-bottom:1px solid var(--line); margin:0; } dl.summary dd { text-align:right; font-variant-numeric: tabular-nums; font-weight:600; }
.tag { display:inline-block; font-size:13px; font-weight:600; padding:2px 8px; border-radius:4px; border:1px solid currentColor; }
.tag.ok { color:var(--accent); } .tag.warn { color:var(--warn); } .tag.bad { color:var(--bad); }
.issues li { margin:4px 0; } .actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.grid2 { display:grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap:16px; }
.flush { margin:0; } .left { text-align:left; } .mt { margin-top:24px; }
.products { list-style:none; padding:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:6px 16px; }
/* ENERGY-005: printing the daily report (or saving it as PDF) shows the report only. */
@media print { header, #who, .noprint, #status { display: none !important; } main { max-width: none; } }
/* CARE-008: OASIS forms */
.oasis-item { margin:20px 0; }
.oasis-item legend { font-weight:600; }
.oasis-row { margin:12px 0; }
.oasis-row label { display:block; }
.oasis-row select { width:100%; max-width:100%; }
.oasis-sub { margin-left:28px; }
.oasis-group { font-weight:600; margin:12px 0 4px; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
/* CARE-009b: the plan of care printed as the CMS-485 (letter page, CMS grid, black on white) and the CMS-487 addendum */
.cms-wrap { margin:16px 0; overflow:hidden; }
.cms-pages { width:816px; transform-origin:top left; display:flex; flex-direction:column; gap:24px; }
.cms-page { width:816px; height:1056px; box-sizing:border-box; padding:22px 22px 0 22px; background:#fff; color:#000; font-family:Arial, Helvetica, "Liberation Sans", sans-serif; box-shadow:0 0 0 1px #9aa; overflow:hidden; }
.cms-page * { box-sizing:border-box; }
.cms-top { display:flex; justify-content:space-between; font-size:9px; height:16px; align-items:flex-end; }
.cms-test { font-weight:700; letter-spacing:.2px; }
.cms-formname { font-size:11px; font-weight:700; text-align:left; padding:0 0 1px; }
.cms-title { text-align:center; font-weight:700; font-size:14px; letter-spacing:.3px; border-top:1.5px solid #000; border-bottom:1px solid #000; padding:2px 0 1px; display:flex; justify-content:center; align-items:center; gap:4px; }
.cms-r { display:flex; border-bottom:1px solid #000; }
.cms-b { border-right:1px solid #000; padding:1px 3px; overflow:hidden; }
.cms-r > .cms-b:last-child, .cms-r > .cms-col:last-child { border-right:0; }
.cms-t { font-size:10px; line-height:12px; font-weight:400; }
/* CARE-018d (founder, 21 Oct 2026): the entries in a clear print font, not typewriter; headings bold, orders indented. */
.cms-v, .cms-l { font-size:10.5px; line-height:13.5px; font-family:Arial, Helvetica, "Liberation Sans", sans-serif; white-space:pre-wrap; }
.cms-l.cms-hd { font-weight:700; }
.cms-l.cms-in { padding-left:14px; }
.cms-r1 .cms-v { font-size:9px; }
.cms-clip { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cms-see { font-style:italic; font-family:Arial, Helvetica, sans-serif; }
.cms-ft { display:flex; gap:28px; padding-left:16px; }
.w1 { width:22.1%; } .w2 { width:14.5%; } .w3 { width:32.3%; } .w4 { width:17.5%; } .w5 { width:13.6%; }
.wl { width:49%; } .wr { width:51%; } .wf { width:100%; } .w23 { width:68.9%; } .w25 { width:31.1%; }
.w8 { width:66.5%; } .w9 { width:33.5%; border-right:0; }
.cms-r1 { height:33px; } .cms-r2 { height:74px; } .cms-r3 { height:159px; } .cms-r14 { height:31px; } .cms-r16 { height:18px; }
.cms-r18 { height:96px; } .cms-r19 { height:31px; } .cms-r20 { height:17px; } .cms-r21 { height:250px; } .cms-r22 { height:79px; }
.cms-r23 { height:31px; } .cms-r24 { height:74px; } .cms-r27 { height:61px; } .cms-r2s { height:40px; } .cms-r487 { height:690px; }
.cms-col { display:flex; flex-direction:column; border-right:1px solid #000; }
.cms-col .cms-r { border-bottom:1px solid #000; }
.cms-r8 { height:16px; }
.cms-inline { display:flex; gap:6px; align-items:baseline; }
.cms-dx { display:flex; border-right:0; border-bottom:1px solid #000; padding:0; }
.cms-col > .cms-dx:last-child { border-bottom:0; flex:1; }
.cms-col > .cms-dx:nth-of-type(2), .cms-col > .cms-dx:nth-of-type(3) { height:32px; }
.cms-dx-c { width:19.6%; border-right:1px solid #000; padding:1px 3px; } .cms-dx-d { width:59.4%; border-right:1px solid #000; padding:1px 3px; overflow:hidden; } .cms-dx-dt { width:21%; padding:1px 3px; }
.cms-b10 { border-left:0; }
.cms-tick { font-size:12px; line-height:12px; font-family:Arial, sans-serif; }
.cms-ti { display:inline-flex; align-items:center; gap:3px; font-size:8.5px; line-height:11px; }
.cms-tc { font-size:10px; min-width:10px; text-align:right; }
.cms-g18 { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:0 4px; padding-top:1px; }
.cms-g18c { display:flex; flex-direction:column; gap:1px; }
.cms-row19 { display:flex; align-items:flex-start; gap:8px; }
.cms-row19 > .cms-t { width:150px; flex:none; padding-top:2px; }
.cms-g19 { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); flex:1; gap:1px 4px; }
.cms-row20 { display:flex; align-items:center; gap:8px; }
.cms-row20 > .cms-t { width:150px; flex:none; }
.cms-g20 { display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); flex:1; }
.cms-g20 .cms-ti { font-size:10px; }
.cms-small .cms-t { display:inline; float:left; margin-right:4px; }
.cms-cert { font-family:Arial, Helvetica, sans-serif; font-size:8.5px; line-height:10.5px; }
.cms-sex { display:inline-flex; gap:10px; }
.cms-487-items { width:100%; border-right:0; padding:0; }
.cms-487-t { width:100%; border-collapse:collapse; }
.cms-487-t th { text-align:left; border-bottom:1px solid #000; padding:1px 3px; }
.cms-487-t th:first-child, .cms-487-t td:first-child { width:14%; border-right:1px solid #000; vertical-align:top; }
.cms-487-t td { padding:2px 3px; vertical-align:top; }
@media print {
  /* CARE-011c: named page: only the CMS forms print edge to edge; everything else keeps normal margins. */
  @page cms { size:letter; margin:0; }
  .cms-page { page:cms; }
  body:has(.cms-wrap), body:has(.cms-wrap) main { margin:0 !important; padding:0 !important; }
  .banner, .menubar { display:none !important; }
  .cms-wrap { margin:0; height:auto !important; overflow:visible; }
  .cms-pages { transform:none !important; gap:0; }
  .cms-page { box-shadow:none; page-break-after:always; break-after:page; }
  .cms-page:last-child { page-break-after:auto; break-after:auto; }
}
/* CARE-011: OASIS form help: skipped questions, what is missing, possible contradictions, diagnosis look-up. */
.oasis-skipped { background:#ECEFEE; color:#3E4F59; border-radius:4px; }
.oasis-flash { outline:3px solid var(--accent); outline-offset:4px; border-radius:4px; }
.error-summary { border:2px solid var(--bad); background:var(--bad-bg); border-radius:8px; padding:8px 16px; margin:12px 0; }
.error-summary h2 { margin:4px 0 8px; font-size:1.1rem; } .error-summary h3 { margin:8px 0 4px; font-size:1rem; }
.error-summary a, a.oasis-jump { color:var(--bad); }
p.warn { color:var(--warn); background:var(--warn-bg); border-left:4px solid var(--warn); padding:6px 10px; margin:6px 0 0; font-size:14px; }
p.warn a.oasis-jump { color:var(--warn); font-weight:600; }
#oasis-warn-count:empty, p.warn:empty { display:none; }
.oasis-prev { font-style:italic; }
.icd-list { list-style:none; margin:4px 0 0; padding:0; border:1.5px solid var(--ink); border-radius:6px; max-height:260px; overflow-y:auto; background:#fff; }
.icd-list li { padding:8px 10px; cursor:pointer; border-bottom:1px solid var(--line); }
.icd-list li[aria-selected="true"], .icd-list li:hover { background:var(--accent); color:#fff; }
/* CARE-012: the MiaCare menu bar (a row of menus with drop-down lists), My account, and the Today page. */
.menubar { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:6px 16px; border-bottom:1px solid var(--line); background:var(--soft); }
.menubar[hidden] { display:none; }
.menubar .menus { display:flex; flex-wrap:wrap; align-items:center; gap:6px; flex:1; }
.menu { position:relative; display:inline-block; }
.menu-button { min-height:40px; padding:6px 12px; border:1.5px solid transparent; background:transparent; font-weight:600; color:var(--ink); }
.menu-button:hover, .menu-button[aria-expanded="true"] { border-color:var(--ink); background:#fff; }
.menu-button.current { border-color:var(--accent); color:var(--accent); background:#fff; }
.product-switch { display:flex; gap:4px; padding-right:10px; border-right:1px solid var(--line); }
.menu-list { position:absolute; z-index:20; top:100%; left:0; min-width:260px; list-style:none; margin:4px 0 0; padding:6px 0; background:#fff; border:1.5px solid var(--ink); border-radius:8px; }
.menu-list[hidden] { display:none; }
.menu-list.menu-right { left:auto; right:0; }
.menu-list li { margin:0; }
.menu-item, .menu-list .link { display:block; width:100%; text-align:left; border:0; border-radius:0; min-height:40px; padding:8px 14px; background:#fff; color:var(--ink); text-decoration:none; }
.menu-item:hover, .menu-item:focus-visible { background:var(--accent); color:#fff; }
.menu-hint { display:block; padding:6px 14px; font-size:14px; color:var(--muted); }
.menu-search { display:flex; gap:6px; margin-left:auto; padding:0; border:0; background:transparent; }
.menu-search input { width:200px; min-height:40px; } .menu-search button { min-height:40px; }
.menu-toggle { display:none; }
.today-cards { list-style:none; padding:0; margin:16px 0; display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap:10px; }
.today-card a { display:flex; flex-direction:column; gap:2px; padding:12px; border:1.5px solid var(--line); border-radius:8px; color:var(--ink); text-decoration:none; height:100%; }
.today-card a:hover { border-color:var(--ink); }
.today-card.bad a { border-color:var(--bad); color:var(--bad); background:var(--bad-bg); }
.today-card.warn a { border-color:var(--warn); color:var(--warn); background:var(--warn-bg); }
.today-count { font-size:28px; font-weight:600; line-height:1.1; }
/* Narrow screens (phones): the menus fold into one "Menu" button. */
@media (max-width: 760px) {
  .menu-toggle { display:inline-block; }
  .menubar .menus { display:none; flex-direction:column; align-items:stretch; width:100%; }
  .menubar.open .menus { display:flex; }
  .menu-list { position:static; min-width:0; }
  .menu-search { margin-left:0; } .menu-search input { width:100%; }
}
@media print { .menubar { display:none !important; } }

/* CARE-011c: a completed OASIS as a clean document; its printout (named page "oasis": margins, running header, page X of Y). */
.oasis-doc { margin:12px 0 24px; }
.odoc-head { display:grid; grid-template-columns:max-content minmax(0, 1fr) max-content minmax(0, 1fr); gap:4px 16px; margin:0 0 16px; padding:12px 14px; border:1px solid var(--line); border-radius:8px; }
.odoc-head dt { color:var(--muted); } .odoc-head dd { margin:0; font-weight:600; }
@media (max-width: 700px) { .odoc-head { grid-template-columns:max-content minmax(0, 1fr); } }
.odoc-sec h2 { font-size:1.05rem; margin:18px 0 6px; padding-bottom:4px; border-bottom:2px solid var(--ink); }
.odoc-list { list-style:none; margin:0; padding:0; }
.odoc-list li { padding:5px 0; border-bottom:1px solid var(--line); line-height:1.4; break-inside:avoid; }
.odoc-list li.odoc-item { display:grid; grid-template-columns:6.5em minmax(0, 1fr) minmax(0, 1.15fr); gap:2px 14px; align-items:baseline; }
.odoc-list li.odoc-item:not(:has(.odoc-key)) { grid-template-columns:minmax(0, 1fr) minmax(0, 1.15fr); }
@media (max-width: 700px) { .odoc-list li.odoc-item, .odoc-list li.odoc-item:not(:has(.odoc-key)) { grid-template-columns:minmax(0, 1fr); } }
.odoc-key { font-weight:600; color:var(--muted); }
.odoc-label { color:var(--ink); }
.odoc-ans { font-weight:700; }
li.odoc-skip { color:var(--muted); font-style:italic; }
.odoc-meds { width:100%; border-collapse:collapse; margin:6px 0 8px; }
.odoc-meds th, .odoc-meds td { text-align:left; padding:4px 6px; border-bottom:1px solid var(--line); }
.odoc-sign { margin:20px 0 0; padding:10px 14px; border:2px solid var(--ink); border-radius:8px; font-weight:600; break-inside:avoid; }
#oasisform input:disabled, #oasisform select:disabled { color:var(--ink); opacity:1; background:#ECEFEE; }
@media print {
  body:has(#oasis-doc) main { page:oasis; max-width:none; }
  main:has(#oasis-doc:not([hidden])) > :not(#oasis-doc):not(h1):not(style) { display:none !important; }
  .oasis-doc { margin:0; font-size:10pt; }
  .odoc-head { border-color:#000; }
  .odoc-sec h2 { break-after:avoid; }
  .odoc-list li, .odoc-meds td, .odoc-meds th { border-color:#bbb; padding:2px 0; }
  .noprint { display:none !important; }
}

/* ---------- CARE-014: the MiaCare look. MiaEnergy keeps the MIA look above; MiaCare screens (body.theme-care) use the
   MiaCare palette, its own fonts (served by MIA, see fonts/OFL.txt) and the agency's colour bar. Status colours: done
   #0B5A43 on #E3F2EE, due #8A3C0E on #FBEBDD, overdue #9B1C1C on #FBE4E4 (each 6:1 or more). Printouts (CMS-485/487, OASIS)
   keep their own black-on-white styles. ---------- */
@font-face { font-family:"Manrope"; font-style:normal; font-weight:700; font-display:swap; src:url("/fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family:"Manrope"; font-style:normal; font-weight:800; font-display:swap; src:url("/fonts/manrope-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family:"Source Sans 3"; font-style:normal; font-weight:400; font-display:swap; src:url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Source Sans 3"; font-style:normal; font-weight:600; font-display:swap; src:url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
body.theme-care {
  --ink:#13262B; --muted:#3D5A60; --line:#D5E3E1; --soft:#EAF2F0; --accent:#0F6E75; --accent-dark:#0B4F5C; --mint:#7FD6CF;
  --ok:#0B5A43; --ok-bg:#E3F2EE; --warn:#8A3C0E; --warn-bg:#FBEBDD; --bad:#9B1C1C; --bad-bg:#FBE4E4; --paper:#FFFFFF;
  background:#F4F8F7; color:var(--ink); font-family:"Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif; font-size:17px;
}
body.theme-care h1, body.theme-care h2, body.theme-care h3, body.theme-care .agency-name, body.theme-care .today-count, body.theme-care .menu-button {
  font-family:"Manrope", "Segoe UI", system-ui, sans-serif; letter-spacing:-0.01em;
}
body.theme-care h1 { font-weight:800; font-size:30px; } body.theme-care h2 { font-weight:700; }
body.theme-care :focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
/* The agency's bar: its name in white on its own colour (checked to keep 4.5:1 or more), "Powered by MiaCare" on the right. */
body.theme-care .top { background:var(--brand, #0B4F5C); color:#FFFFFF; border-bottom:0; align-items:center; padding:12px 24px; gap:12px 20px; }
body.theme-care .top .brand { flex:1 1 auto; }
body.theme-care .top .brand .agency-name { font-weight:800; font-size:21px; color:#FFFFFF; margin-left:0; }
/* The page heading takes focus after each screen change (so screen readers announce it): no ring on a heading. */
body.theme-care main:focus-visible, body.theme-care main h1[tabindex="-1"]:focus-visible { outline:none; }
body.theme-care .top .who { color:#FFFFFF; display:flex; align-items:center; gap:8px; }
body.theme-care .top .who > .menu > .menu-button, body.theme-care .top .who select { color:#FFFFFF; background:transparent; border-color:rgba(255,255,255,.6); }
body.theme-care .top .who select option { color:var(--ink); background:#FFFFFF; }
body.theme-care .top .who > .menu > .menu-button:hover, body.theme-care .top .who > .menu > .menu-button[aria-expanded="true"] { border-color:#FFFFFF; background:rgba(255,255,255,.12); }
body.theme-care .top :focus-visible { outline-color:#FFFFFF; }
body.theme-care .top .menu-list :focus-visible { outline-color:var(--accent); }
.powered { margin:0; display:flex; align-items:center; gap:8px; font-size:15px; }
.powered[hidden] { display:none; }
body.theme-care .powered strong { font-family:"Manrope", system-ui, sans-serif; font-weight:800; }
.care-mark { flex:none; display:block; }
body.theme-care .banner { background:var(--warn-bg); color:var(--warn); }
body.theme-care .menubar { background:var(--paper); border-bottom:1px solid var(--line); padding:8px 24px; }
body.theme-care .menu-button.current { border-color:var(--accent); color:var(--accent); }
body.theme-care main { max-width:1100px; padding:28px 24px 72px; }
body.theme-care form { background:var(--paper); border-color:var(--line); border-radius:12px; }
body.theme-care input, body.theme-care select { border-color:#6F8A8E; border-radius:8px; }
body.theme-care button, body.theme-care .btn { border-radius:8px; }
body.theme-care button.primary { background:var(--accent); border-color:var(--accent); }
body.theme-care button.primary:hover { background:var(--accent-dark); border-color:var(--accent-dark); }
body.theme-care .table-wrap { background:var(--paper); border:1px solid var(--line); border-radius:12px; }
body.theme-care .table-wrap th { color:var(--muted); font-weight:600; font-size:15px; }
body.theme-care .table-wrap tr:last-child > td { border-bottom:0; }
body.theme-care .empty { background:var(--paper); border-radius:12px; }
body.theme-care .notice { background:var(--paper); border-color:var(--line); border-radius:12px; }
body.theme-care .tag { border:0; border-radius:999px; padding:2px 10px; background:var(--soft); color:var(--ink); }
body.theme-care .tag.ok { color:var(--ok); background:var(--ok-bg); }
body.theme-care .tag.warn { color:var(--warn); background:var(--warn-bg); }
body.theme-care .tag.bad { color:var(--bad); background:var(--bad-bg); }
body.theme-care .today-lead { font-size:18px; margin:-6px 0 12px; color:var(--muted); }
body.theme-care .today-lead strong { color:var(--ink); }
body.theme-care .today-cards { gap:12px; }
body.theme-care .today-card a { background:var(--paper); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
body.theme-care .today-card a:hover { border-color:var(--accent); }
body.theme-care .today-card.ok a { border-color:#A9D8CB; background:var(--ok-bg); color:var(--ok); }
body.theme-care .today-card.bad a { border-color:#E7B3B3; background:var(--bad-bg); color:var(--bad); }
body.theme-care .today-card.warn a { border-color:#EFC6A3; background:var(--warn-bg); color:var(--warn); }
body.theme-care .today-count { font-size:32px; font-weight:800; }
.swatch-row { display:flex; gap:8px; align-items:center; }
.swatch { flex:none; width:44px; height:44px; border-radius:8px; border:1.5px solid #6F8A8E; background:#0B4F5C; }
@media (max-width: 760px) { body.theme-care .top, body.theme-care .menubar { padding-left:16px; padding-right:16px; } body.theme-care main { padding:20px 16px 64px; } }
@media print { body.theme-care { background:#FFFFFF; font-size:16px; } body.theme-care .table-wrap { border:0; } }

/* CARE-015: the patient journey, step by step */
.journey-wrap { margin: 8px 0 16px; }
ol.journey { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 0; margin: 0; }
ol.journey li { counter-increment: step; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper, #fff); }
ol.journey li::before { content: counter(step); font-weight: 700; font-size: 13px; color: var(--muted, #555); }
ol.journey li.ok { border-color: var(--ok, var(--accent)); } ol.journey li.warn { border-color: var(--warn); } ol.journey li.bad { border-color: var(--bad); }
.journey-title { font-weight: 700; }
ol.journey .tag { align-self: flex-start; white-space: normal; }

/* CARE-017a: the patient chart bar (same tabs on every page of a patient) */
.chart-bar { position: sticky; top: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 16px; padding: 8px 12px;
  background: var(--paper, #fff); border: 1px solid var(--line); border-radius: 10px; }
.chart-name { font-weight: 700; }
.chart-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chart-tabs .menu-list { min-width: 320px; }
@media (max-width: 720px) { .chart-bar { position: static; } .chart-tabs .menu-list { min-width: 0; } }
/* CARE-019: PAR readiness (narrative, evidence, checklist, approval) and the printable authorization packet. */
.par-counts { display:flex; flex-wrap:wrap; gap:8px; }
.par-draft { font-weight:600; }
.par-sec { margin:16px 0 24px; }
.par-sec > h3 { margin:0 0 8px; }
.par-sentence { border:1px solid var(--line); border-left:4px solid var(--line); border-radius:6px; padding:10px 12px; margin:0 0 10px; background:#fff; }
.par-sentence.par-verify { border-left-color:var(--bad); background:var(--bad-bg); }
.par-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:6px; }
.par-text { margin:4px 0; line-height:1.5; }
.par-src { margin:6px 0 0; padding-left:18px; font-size:14px; color:var(--muted, #44545A); }
.par-src li { margin:2px 0; }
.par-row-tools { align-items:end; }
.par-ev-in { max-width:16rem; }
.par-tools { margin-top:6px; display:flex; flex-wrap:wrap; gap:6px; }
.par-mark { margin-top:6px; width:100%; }
#par-cl-table th[scope="row"] { font-weight:600; min-width:14rem; }
#par-approval blockquote, .par-packet blockquote { margin:8px 0; padding:8px 12px; border-left:4px solid var(--line); }
.par-packet { font-family:Arial, Helvetica, sans-serif; color:#000; }
.par-packet h1 { font-size:1.4rem; } .par-packet h2 { font-size:1.15rem; margin-top:18px; border-bottom:1px solid #000; } .par-packet h3 { font-size:1rem; margin:10px 0 2px; }
.par-packet table { border-collapse:collapse; width:100%; font-size:13px; } .par-packet th, .par-packet td { border:1px solid #000; padding:4px 6px; text-align:left; vertical-align:top; }
.par-packet .pkt-cite { font-size:12px; color:#333; }
@media print { .par-packet { font-size:12px; } #pkt-open { page-break-after:always; } .par-packet table { page-break-inside:auto; } .par-packet tr { page-break-inside:avoid; } }
.tabs { display:flex; flex-wrap:wrap; gap:4px; border-bottom:2px solid var(--line); margin:16px 0 12px; }
.tabs button.tab { background:none; border:2px solid transparent; border-bottom:0; border-radius:8px 8px 0 0; padding:8px 14px; color:var(--ink); }
.tabs button.tab[aria-selected="true"] { border-color:var(--line); background:var(--soft); color:var(--accent-dark); font-weight:700; margin-bottom:-2px; border-bottom:2px solid var(--soft); }
[role="tabpanel"]:focus-visible { outline-offset:4px; }
.field-error { margin-top:4px; }
.doc-type { display:inline-block; min-width:2.6em; text-align:center; padding:2px 6px; border-radius:4px; background:#B3261E; color:#fff; font-weight:700; font-size:.8rem; }
.doc-actions { white-space:nowrap; }
.ts-sheet table, .ts-print table { margin:8px 0; }
.ts-signatures p { margin:4px 0; }
.ts-print-visit { border-top:2px solid var(--line); padding-top:8px; margin-top:12px; }
@media print { .ts-print-visit { page-break-inside:avoid; } .ts-print { font-size:12px; } }
table.week td { vertical-align:top; min-width:7.5em; }
.wk-visit { margin:2px 0 6px; font-size:.92rem; }
tr.current > *, th.current { background:var(--soft); }
.wd-row { gap:12px; }
li.bad { color:var(--bad); }
#wk-filter { display:flex; flex-wrap:wrap; gap:8px; align-items:center; background:none; border:0; padding:0; margin:8px 0; } #wk-filter select { width:auto; }
.wk-visit button.link { text-align:left; }
.week-grid td, .week-grid th { padding:4px 6px; font-size:.9rem; } .week-grid td.code { text-align:center; font-weight:700; }
tr.wk-group th, th.cp-group { background:var(--soft); font-weight:700; font-size:.85rem; letter-spacing:.03em; }
.notice.bad { border-color:var(--bad); color:var(--bad); }
@media print { .ts-week { font-size:11px; } .week-grid td, .week-grid th { padding:2px 4px; } }
/* CARE-017: the OASIS transmission */
.landed { outline: 3px solid var(--focus, #1d6fd8); outline-offset: 4px; border-radius: 6px; }
#cms-xml { max-height: 420px; overflow: auto; font-size: 0.85rem; background: #f6f8f8; padding: 12px; border-radius: 6px; white-space: pre; }
#cms-withheld li, li.withheld { color: #4a5a5a; }
#cms-list td:nth-child(4), #cms-list td:nth-child(5) { white-space: nowrap; }

/* ---------- BRAND-001: MiaCare styles to compare on the test sites (founder's brand brief, 22 Oct 2026). Human Teal is
   the MiaCare look above (body.theme-care); Executive Navy and Clinical Clarity change only colour tokens, corners and
   spacing. "Recommended mix" = Human Teal on Today, Clinical Clarity on every working screen. Each viewer picks a style
   in My account > Screen style; nothing changes for anyone else. An agency's own colour always keeps its bar; the
   style's bar colour is used only while the agency keeps MiaCare's default. Every pair is checked 4.5:1 (text) or 3:1
   (focus ring) in care-theme-ui.test.ts. Printouts (CMS-485/487, OASIS) are never touched. ---------- */
body.theme-care.style-navy {
  --ink:#141B2D; --muted:#44506A; --line:#D6DBE6; --soft:#EEF1F7; --accent:#1F3A68; --accent-dark:#152A4D; --bar:#14213D; --gold:#B8892B;
  --page:#F5F6F9; --paper:#FFFFFF;
  background:#F5F6F9;
}
body.theme-care.style-navy.bar-default .top { background:var(--bar); }
body.theme-care.style-navy .top { border-bottom:3px solid var(--gold); }
body.theme-care.style-navy h1 { padding-bottom:6px; border-bottom:2px solid var(--gold); display:inline-block; }
body.theme-care.style-navy .today-card a, body.theme-care.style-navy form, body.theme-care.style-navy .table-wrap { border-radius:6px; box-shadow:0 1px 2px rgba(20,27,45,.08); }
body.theme-care.style-navy .menu-button.current { border-color:var(--gold); color:var(--accent); }
body.theme-care.style-clarity {
  --ink:#0B1620; --muted:#384B5A; --line:#B9C6D0; --soft:#F1F5F9; --accent:#0A5BA8; --accent-dark:#084683; --bar:#0A3D6B;
  --page:#FFFFFF; --paper:#FFFFFF;
  background:#FFFFFF; font-size:16px;
}
body.theme-care.style-clarity.bar-default .top { background:var(--bar); }
body.theme-care.style-clarity h1 { font-size:26px; font-weight:700; }
body.theme-care.style-clarity .today-card a, body.theme-care.style-clarity form, body.theme-care.style-clarity .table-wrap,
body.theme-care.style-clarity .notice, body.theme-care.style-clarity .empty { border-radius:4px; border-color:var(--line); }
body.theme-care.style-clarity input, body.theme-care.style-clarity select, body.theme-care.style-clarity textarea { border-color:#5B6B78; border-radius:4px; }
body.theme-care.style-clarity button, body.theme-care.style-clarity .btn { border-radius:4px; }
body.theme-care.style-clarity .table-wrap th { background:var(--soft); color:var(--ink); }
body.theme-care.style-clarity .table-wrap tbody tr:nth-child(even) > td { background:#F7F9FB; }
body.theme-care.style-clarity th, body.theme-care.style-clarity td { padding:8px; }
body.theme-care.style-clarity main { padding-top:20px; }
/* Founder, 31 Oct 2026: the MIA website's chosen looks for MiaCare. Teal and gold (skilled, the default for skilled agencies) and
   Gold and teal (non-skilled, the default for non-skilled agencies). Gold is a line only, never text. Checked in care-theme-ui.test.ts. */
body.theme-care.style-tealgold {
  --ink:#10292A; --muted:#3B5558; --line:#D3E2DF; --soft:#ECF4F1; --accent:#0F6E75; --accent-dark:#0B4F5C; --bar:#0A3F39; --gold:#D4B46A;
  --page:#F7F6F0; --paper:#FFFFFF;
  background:#F7F6F0;
}
body.theme-care.style-tealgold.bar-default .top { background:var(--bar); }
body.theme-care.style-tealgold .top { border-bottom:4px solid var(--gold); box-shadow:0 2px 0 rgba(10,63,57,.25); }
body.theme-care.style-tealgold h1 { padding-bottom:6px; border-bottom:3px solid var(--gold); display:inline-block; }
body.theme-care.style-tealgold .today-card a, body.theme-care.style-tealgold form, body.theme-care.style-tealgold .table-wrap { border-top:3px solid var(--gold); border-radius:10px; box-shadow:0 1px 3px rgba(10,63,57,.10); }
body.theme-care.style-tealgold .menu-button.current { border-color:var(--gold); }
body.theme-care.style-goldteal {
  --ink:#1F2A26; --muted:#4B5650; --line:#E4D9BE; --soft:#F6EEDB; --accent:#0F6E75; --accent-dark:#0B4F47; --bar:#0B4F47; --gold:#D4B46A;
  --page:#FBF6EA; --paper:#FFFFFF;
  background:#FBF6EA;
}
body.theme-care.style-goldteal.bar-default .top { background:var(--bar); }
body.theme-care.style-goldteal .top { border-bottom:4px solid var(--gold); }
body.theme-care.style-goldteal h1 { padding-bottom:6px; border-bottom:3px solid var(--accent); display:inline-block; }
body.theme-care.style-goldteal .today-card a, body.theme-care.style-goldteal form, body.theme-care.style-goldteal .table-wrap { border-top:3px solid var(--accent); border-radius:10px; box-shadow:0 1px 3px rgba(120,96,40,.12); }
body.theme-care.style-goldteal .menu-button.current { border-color:var(--gold); }
/* The demo's start page ("Explore MiaCare as…") in the MIA website look: night navy with gold; each agency in its own line's colours. */
body.demo-start .top { background:#0B0F2E; color:#FFFFFF; border-bottom:4px solid #D4B46A; }
body.demo-start .top .brand strong { color:#F1DDA0; letter-spacing:.12em; font-size:20px; }
body.demo-start .top .brand span { color:#D3D8EE; }
body.demo-start main > h1 { display:block; color:#FFFFFF; background:linear-gradient(120deg,#070A22 0%,#1C2260 45%,#3046C8 80%,#5B3FD0 100%); border-bottom:4px solid #D4B46A; border-radius:12px; padding:18px 22px; }
body.demo-start .demo-agency { border-radius:14px; padding:4px 16px 16px; }
body.demo-start .demo-agency.line-tealgold { background:#0A3F39; color:#FFFFFF; border:2px solid #D4B46A; }
body.demo-start .demo-agency.line-tealgold h2 { color:#F1DDA0; }
body.demo-start .demo-agency.line-goldteal { background:#F6EBCB; color:#1F2A26; border:2px solid #0F6E75; }
body.demo-start .demo-agency.line-goldteal h2 { color:#0B4F47; }
body.demo-start .demo-agency .demo-roles li { background:#FFFFFF; border-color:transparent; }
body.demo-start .demo-agency .demo-roles li .hint { color:#3B4A47; }
.style-choices { display:grid; gap:12px; grid-template-columns:repeat(auto-fit, minmax(min(100%, 240px), 1fr)); border:0; padding:0; margin:0; }
.style-choice { display:flex; gap:10px; align-items:flex-start; padding:12px; border:1.5px solid var(--line); border-radius:8px; background:var(--paper, #fff); }
.style-choice input { flex:none; margin-top:2px; }
.style-choice label { display:block; }
.style-chips { display:flex; gap:4px; margin-top:6px; }
.style-chips span { width:28px; height:18px; border-radius:4px; border:1px solid #6B7C85; }
/* CARE-030: non-skilled care: the stage's requirements */
ul.ns-reqs { list-style:none; padding:0; margin:0 0 12px; display:grid; gap:8px; }
.ns-req { border:1px solid var(--line); border-left:4px solid var(--line); border-radius:8px; padding:10px 12px; background:var(--paper, #fff); }
.ns-req.met { border-left-color:var(--ok, var(--accent)); } .ns-req.missing { border-left-color:var(--bad); }
.ns-req .hint { margin:2px 0 0; }
.ns-tools { margin-top:8px; } .ns-tools input { width:auto; min-width:12rem; flex:1 1 12rem; }
.ns-amend { flex-basis:100%; } .ns-amend > summary { cursor:pointer; color:var(--accent); }
.ns-amend input { margin:6px 6px 0 0; }

/* CARE-032c: QAPI plans read as the agency's document: long lines wrap, tools stay on screen only. */
.qapi-section { max-width:100%; overflow-wrap:anywhere; margin-top:20px; }
.qapi-text p { margin:4px 0; white-space:normal; }
.qapi-tools { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-start; }
.qapi-tools details { flex:1 1 100%; }
.qapi-tools textarea { width:100%; box-sizing:border-box; }
.qapi-more { font-size:1rem; margin:14px 0 4px; }

/* CARE-031d: printed records read cleanly: forms and tools stay on screen; signature lines get room. */
.sigline { margin-top:28px; }
@media print { #cmpp, #cmpr, #cmp-profile, .cmp-recs summary, button { display:none !important; } .cmp-recs[open] ul, .cmp-recs ul { display:block; } }
/* CARE-031e: dates stay on one line on the surveyor's page; printed pages show file names instead of buttons. */
#ep-table td:nth-child(3), #ep-table td:nth-child(4) { white-space:nowrap; }
.print-only { display:none; }
@media print { .print-only { display:inline; } }
/* CARE-017c: OASIS corrections, one box per correction. */
ul.fix-list { list-style: none; padding: 0; margin: 0 0 16px; }
ul.fix-list > li { border: 1px solid var(--line, #c9ced6); border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; }
ul.fix-list h3 { margin: 0 0 4px; }
/* CARE-034: drawn signatures. The box keeps the 3:1 shape of the stored drawing at any width. */
.sig-box canvas.sig-pad { display:block; width:100%; max-width:600px; aspect-ratio:3/1; background:#fff; border:2px dashed var(--line); border-radius:6px; touch-action:none; cursor:crosshair; }
.sig-box canvas.sig-pad:focus { outline:3px solid var(--accent); outline-offset:2px; }
svg.sig-image { display:block; width:220px; max-width:100%; height:auto; aspect-ratio:3/1; color:var(--ink); border-bottom:1px solid var(--line); margin:2px 0 8px; }
.week-grid svg.sig-image, #tw-sigs svg.sig-image { width:120px; }
@media print { .sig-box { display:none; } svg.sig-image { color:#000; } }
.cms-v svg.sig-image { width:160px; margin:0; border:0; }
/* CARE-036: the line under a drawn signature. */
.sig-line { margin:4px 0 16px; padding-top:6px; border-top:1.5px solid var(--ink); max-width:520px; font-size:15px; }
/* CARE-042: the Assign or reassign clinician button beside the patient's name in the chart bar. */
.chart-name .chart-assign { margin-left: 8px; font-size: 0.95rem; }
/* CARE-043: page navigation under the patient list. */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; }
.pager button[disabled] { opacity: 0.45; cursor: default; }

/* CARE-045: the public MiaCare demo: the DEMO bar on every page and the role chooser. */
.demobar { background:#13262B; color:#FFFFFF; padding:6px 16px; font-size:14px; }
/* Founder, 30 Oct 2026: one compact line; the select keeps its normal width (not the 100% of form fields); the text may
   wrap inside itself, the controls never break apart; on a phone the controls move together to a second line. */
.demobar p { margin:0; display:flex; flex-wrap:nowrap; align-items:center; gap:4px 6px; justify-content:center; }
.demobar .demo-about { flex:0 1 auto; min-width:0; }
.demobar .demo-controls { flex:none; display:inline-flex; align-items:center; gap:0 4px; white-space:nowrap; }
.demobar .demo-controls button.link { white-space:nowrap; }
.demobar select { font:inherit; width:auto; max-width:16rem; min-height:32px; padding:2px 8px; border-radius:6px; border:1px solid #FFFFFF; }
@media (max-width: 600px) { .demobar p { flex-wrap:wrap; } .demobar .demo-sep { display:none; } .demobar select { max-width:12rem; } }
.demo-agency { margin:24px 0; }
.demo-roles { list-style:none; padding:0; margin:0; display:grid; gap:12px; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); }
.demo-roles li { border:1px solid var(--line); border-radius:8px; padding:12px; background:var(--soft); }
.demo-role { width:100%; font-weight:600; text-align:left; }

/* CARE-030i: the caregiver's phone (non-skilled care). One card per visit, no tables; every button and choice at least
   48 pixels tall and the full width on a narrow phone (360 pixels), so a finger hits it the first time. */
ul.nsp-list { list-style:none; padding:0; margin:0 0 16px; display:grid; gap:12px; }
.nsp-card { border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:var(--soft, #fff); }
.nsp-card p { margin:4px 0; overflow-wrap:anywhere; }
.nsp-when { font-size:1.1rem; }
.nsp-address { font-weight:600; }
.nsp-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.nsp-actions button, #nsp-out button[type=submit], #nsp-out .sig-box button, .nsp-menus .menu-button { min-height:48px; min-width:48px; padding:10px 18px; font-size:1.05rem; }
.nsp-choice { display:flex; align-items:center; gap:10px; min-height:48px; }
.nsp-choice input[type=radio], .nsp-choice input[type=checkbox] { width:26px; height:26px; flex:none; margin:0; }
.nsp-choice label { flex:1; padding:10px 0; cursor:pointer; }
fieldset.nsp-task { border:1px solid var(--line); border-radius:8px; margin:0 0 12px; padding:8px 12px; }
fieldset.nsp-task legend { font-weight:600; padding:0 4px; }
#nsp-out input, #nsp-out select, #nsp-out textarea { min-height:48px; font-size:1rem; width:100%; max-width:100%; box-sizing:border-box; }
#nsp-out .nsp-choice input { width:26px; min-height:26px; }
ul.nsp-tasks li { margin:6px 0; }
@media (max-width: 480px) { .nsp-actions button { flex:1 1 100%; } }
/* CARE-047: the medication profile and the large-type list for the patient's home folder. */
.med-findings { list-style:none; padding:0; }
.med-findings > li { border:1px solid #c9d1d9; border-radius:6px; padding:8px 12px; margin:8px 0; }
.med-findings > li.open { border-left:6px solid #b42318; }
.med-print { font-size:20px; line-height:1.5; }
.med-print h1 { font-size:32px; }
.med-print h2 { font-size:24px; margin-top:24px; }
.med-print table { width:100%; border-collapse:collapse; }
.med-print th, .med-print td { border:1px solid #333; padding:8px; text-align:left; vertical-align:top; }
@media print { .med-print { font-size:16pt; } .med-print h1 { font-size:24pt; } .med-print h2 { font-size:18pt; } .med-print tr { page-break-inside:avoid; } }

/* Founder, 1 Nov 2026 (polish): boxes with nothing waiting step back; the empty lists fold into one closed box. */
body.theme-care .today-card.zero a { background:transparent; border-style:dashed; color:var(--muted); padding:10px 14px; }
body.theme-care .today-card.zero .today-count { font-size:1em; }
.today-empty { margin:24px 0; border:1px dashed var(--line); border-radius:10px; padding:10px 14px; color:var(--muted); }
.today-empty summary { cursor:pointer; font-weight:600; }
.today-empty h2 { font-size:1rem; margin:14px 0 4px; }
/* Founder, 1 Nov 2026 (polish): on a laptop the menus and the patient search stay on one line. */
@media (min-width: 1260px) {
  body.theme-care .menubar { flex-wrap:nowrap; padding-left:12px; padding-right:12px; gap:6px; }
  body.theme-care .menubar .menus { flex-wrap:nowrap; gap:0; min-width:0; }
  body.theme-care .menubar .menu-button { padding:6px 7px; white-space:nowrap; font-size:15px; }
  body.theme-care .menu-search input { width:140px; }
}
ul.plain { list-style:none; margin:0; padding:0; } ul.plain li + li { margin-top:4px; }
