:root { --navy:#041030; --blue:#0060E4; --muted:#64748b; --line:#e2e8f0; --bg:#f8fafc; --card:#fff; --label:#334155; --input:#7b8798; }
* { box-sizing:border-box; }
html,body { margin:0; }
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background:var(--bg); color:var(--navy); font-size:14px; }
a { color:var(--blue); }
h1 { font-family:"DM Sans", Inter, sans-serif; font-size:26px; letter-spacing:-.03em; margin:0 0 10px; font-weight:700; }
h2 { font-family:"DM Sans", Inter, sans-serif; font-size:15px; margin:0 0 8px; letter-spacing:-.01em; }
.wrap { max-width:1280px; margin:0 auto; padding:28px clamp(16px, 3vw, 36px) 56px; }
.wrap.narrow { max-width:460px; }
.topbar { background:#fff; border-bottom:1px solid var(--line); }
.logo img { height:30px; display:block; }
.testbanner { background:#eef4ff; color:#0b3a8c; border-bottom:1px solid #c7dbff; text-align:center; padding:8px 12px; font-size:13px; font-weight:500; }
.card { background:var(--card); border:1px solid var(--line); border-radius:16px; box-shadow:0 10px 30px rgba(4,16,48,.06); padding:28px 32px 32px; }
.brandhead { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.brandhead img { height:36px; }
.brand-tag { font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); font-weight:600; }
.sub { color:var(--muted); margin:0 0 20px; line-height:1.5; }
label { display:block; font-size:13px; font-weight:600; color:var(--label); margin:14px 0 6px; }
label .req { color:var(--blue); }
input, select { width:100%; padding:12px; border:1px solid var(--input); border-radius:8px; font:inherit; color:var(--navy); background:#fff; }
input:focus, select:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(0,96,228,.12); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline:2px solid #0b63e5; outline-offset:1px; }
.row { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
@media (max-width:640px) { .row { grid-template-columns:1fr; } .card { padding:22px 18px; } }
.btn { display:inline-flex; align-items:center; justify-content:center; height:48px; padding:0 22px; border:0; border-radius:8px; background:var(--blue); color:#fff; font:600 15px Inter, sans-serif; cursor:pointer; margin-top:22px; width:100%; }
.btn.secondary { background:#fff; color:var(--navy); border:1px solid var(--input); width:auto; height:40px; margin-top:0; font-size:14px; }
.btn[disabled] { opacity:.6; cursor:wait; }
button.link { background:none; border:0; color:var(--blue); cursor:pointer; font:inherit; padding:0; }
.err { color:#b91c1c; background:#fef2f2; border:1px solid #fecaca; padding:10px 12px; border-radius:8px; margin-top:16px; }
.ok { color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; padding:10px 12px; border-radius:8px; margin-top:16px; }
.hint { color:var(--muted); font-size:12px; margin-top:6px; }
.badge { display:inline-block; vertical-align:middle; padding:4px 12px; border-radius:99px; font-size:13px; font-weight:600; border:1px solid; margin:0; }
.b-Verified { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.b-Inactive { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }
.b-NeedsCheck, .b-Pending { background:#fffbeb; color:#b45309; border-color:#fde68a; }
.meta { color:var(--muted); font-size:14px; margin:12px 0 0; line-height:1.5; }
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin:22px 0 8px; }
.stat { background:#f8fafc; border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.stat .k { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600; }
.stat .v { font-family:"DM Sans", Inter, sans-serif; font-size:20px; font-weight:700; margin-top:4px; letter-spacing:-.02em; word-break:break-word; }
.stat .s { font-size:12px; color:var(--muted); margin-top:4px; }
table.details { width:100%; border-collapse:collapse; margin:16px 0 8px; }
table.details th, table.details td { text-align:left; padding:10px 0; border-bottom:1px solid var(--line); vertical-align:top; font-size:14px; }
table.details th { width:38%; color:var(--muted); font-weight:500; }
.block { margin-top:22px; }
ul { margin:0; padding-left:18px; }
li { margin:4px 0; font-size:14px; }
.muted { color:var(--muted); font-size:14px; margin:0; }
.flags { background:#fffbeb; border:1px solid #fde68a; border-radius:12px; padding:14px 16px; margin-top:22px; }
.flags h2 { color:#b45309; }
.foot { margin-top:28px; padding-top:16px; border-top:1px solid var(--line); font-size:12px; color:var(--muted); line-height:1.5; }
table.list { width:100%; border-collapse:collapse; }
table.list th { text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); padding:8px 10px; border-bottom:1px solid var(--line); }
table.list td { padding:10px; border-bottom:1px solid var(--line); vertical-align:top; }
table.list tr.click { cursor:pointer; }
table.list tr.click:hover td { background:#f8fafc; }
.toolbar { display:flex; gap:12px; align-items:end; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; }
.toolbar select { width:auto; min-width:220px; }
.spinner { width:36px; height:36px; border:3px solid #dbe6fb; border-top-color:var(--blue); border-radius:50%; animation:spin 1s linear infinite; margin:24px auto; }
@keyframes spin { to { transform:rotate(360deg); } }
.center { text-align:center; }
.mono { font-family: ui-monospace, Menlo, monospace; word-break:break-all; background:#f1f5f9; padding:8px 10px; border-radius:6px; }
.section { margin-top:28px; }
.actions { display:flex; gap:10px; margin-top:22px; flex-wrap:wrap; }
.actions .btn { width:auto; margin-top:0; }
table.list td:first-child { white-space:nowrap; }
.print-only { display:none; }
@media print { .print-only { display:flex; } .topbar, .testbanner, .actions { display:none !important; } body { background:#fff; } .card { box-shadow:none; } }

.testtag { display:inline-block; font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#b45309; background:#fffbeb; border:1px solid #fde68a; border-radius:99px; padding:2px 8px; }
.demogrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; }
button.demo { text-align:left; background:#fff; border:1px dashed #f5c26b; border-radius:12px; padding:12px 14px; cursor:pointer; font:inherit; color:var(--navy); display:flex; flex-direction:column; gap:4px; }
button.demo:hover, button.demo.on { border-color:var(--blue); border-style:solid; background:#f5f9ff; }
button.demo b { font-family:"DM Sans", Inter, sans-serif; font-size:15px; }
button.demo span:last-child { color:var(--muted); font-size:12px; }
button.demo .testtag { align-self:flex-start; }

.dobsel { display:grid; grid-template-columns:1.3fr 1fr 1.2fr; gap:8px; margin-top:8px; }
.dobsel select { padding:9px 8px; font-size:13px; }
.btn.sm { height:32px; padding:0 12px; font-size:13px; }
.btn.danger { color:#b91c1c; border-color:#fecaca; }

/* ---- Light-tier features ---- */
.b-Info { background:#eef4ff; color:#0060E4; border-color:#c7dafc; }
.exportbar { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.exportbar .btn, .callacts .btn, .actions .btn.sm { margin-top:0; width:auto; }
.btn.sm:not(.secondary) { height:32px; padding:0 12px; font-size:13px; width:auto; margin-top:0; }
.filters { padding:14px 18px; display:flex; flex-direction:column; gap:8px; margin-bottom:8px; }
.range { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.range label { margin:0; }
.range input { width:130px; padding:8px; }
.range select { width:auto; padding:8px; }
.callcard { background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px 18px; margin:10px 0; }
.callcard.emerg { border-left:4px solid #dc2626; }
.callhead { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.badges { display:flex; gap:6px; flex-wrap:wrap; align-items:flex-start; }
.badges .badge { font-size:12px; padding:3px 10px; }
.callsum { margin:10px 0 6px; line-height:1.5; }
.insline, .alertline { font-size:13px; margin:6px 0; }
.alertline { color:#b91c1c; }
.callacts { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-top:10px; }
pre.transcript { white-space:pre-wrap; font:13px/1.5 Inter, sans-serif; background:#f8fafc; border:1px solid var(--line); border-radius:8px; padding:12px; }
details.bd { margin-top:22px; border:1px solid var(--line); border-radius:12px; padding:12px 16px; background:#fcfdff; }
details.bd > summary { cursor:pointer; font-family:"DM Sans", Inter, sans-serif; font-weight:700; font-size:15px; }
.psec { margin-top:18px; }
.ptext { margin:6px 0; line-height:1.5; font-size:13px; white-space:pre-wrap; }
.tscroll { overflow-x:auto; }
table.ptable td, table.ptable th { font-size:12px; }
.estimate-box { margin-top:14px; }
#printArea { display:none; }
.pdoc .phead { display:flex; gap:16px; align-items:center; border-bottom:2px solid var(--navy); padding-bottom:10px; margin-bottom:8px; }
.pdoc .phead img { height:34px; }
.ptitle { font-family:"DM Sans", Inter, sans-serif; font-weight:700; font-size:20px; }
.pmeta { color:var(--muted); font-size:12px; }
.pfoot { margin-top:24px; border-top:1px solid var(--line); padding-top:8px; font-size:10px; color:var(--muted); }
@media print {
  body.printing > *:not(#printArea) { display:none !important; }
  body.printing #printArea { display:block; }
  .pdoc table { page-break-inside:auto; } .pdoc tr { page-break-inside:avoid; }
  .pdoc .psec h2 { page-break-after:avoid; }
  @page { margin:14mm; }
}
img.qr { width:200px; height:200px; image-rendering:pixelated; border:1px solid #e2e8f0; border-radius:8px; }

/* ---- Per-clinic Test / Live mode (web/clinicmode.js) ---- */
.modebanner[hidden], .modepill[hidden] { display:none !important; }
.modebanner { position:sticky; top:0; z-index:40; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; padding:9px 16px; font-size:13.5px; line-height:1.35; text-align:center;
  color:#0b3a8c; background:#eef4ff; border-top:3px solid #0b63e5; border-bottom:1px solid #c7dbff; letter-spacing:.01em; }
.modebanner b { font-weight:700; color:#0b4fc0; }
.modebanner .mb-clinic { font-weight:500; color:#334e7a; }
.modebanner .mb-dot { width:9px; height:9px; border-radius:50%; background:#0b63e5; box-shadow:0 0 0 3px rgba(11,99,229,.2); display:inline-block; }
.modepill { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; border-radius:99px; padding:2px 9px; margin-right:8px; vertical-align:middle; }
.modepill .mp-dot { width:7px; height:7px; border-radius:50%; background:#10b981; display:inline-block; }
.modebadge { display:inline-block; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; border-radius:99px; padding:2px 9px; vertical-align:middle; }
.modebadge.test { color:#92400e; background:#fef3c7; border:1px solid #fcd34d; }
.modebadge.live { color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; }
.modecard.is-test { border-left:6px solid #f59e0b; }
.modecard.is-live { border-left:6px solid #10b981; }
.modecard h3 { font-size:15px; margin:18px 0 8px; }
.mc-head { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; }
.mc-note { margin-top:12px; padding:10px 12px; background:#f1f5f9; border-radius:8px; font-size:13px; color:#334155; }
.seg { display:inline-flex; border:2px solid #cbd5e1; border-radius:10px; overflow:hidden; }
.seg-b { border:0; background:#fff; color:#64748b; font:700 14px Inter, sans-serif; letter-spacing:.08em; padding:10px 22px; cursor:pointer; min-width:92px; }
.seg-b.test.on { background:#f59e0b; color:#fff; }
.seg-b.live.on { background:#10b981; color:#fff; }
.seg-b[disabled] { cursor:not-allowed; opacity:.45; }
.whatnow th { width:34%; text-align:left; font-weight:600; color:#334155; }
.checklist { list-style:none; padding:0; margin:0; }
.checklist li { display:flex; gap:10px; align-items:flex-start; padding:9px 0; border-bottom:1px solid #eef2f7; }
.checklist .ck-icon { flex:0 0 24px; height:24px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; }
.checklist li.ok .ck-icon { background:#d1fae5; color:#047857; }
.checklist li.no .ck-icon { background:#fee2e2; color:#b91c1c; }
.checklist li.na .ck-icon { background:#f1f5f9; color:#64748b; }
.ck-who { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; border-radius:99px; padding:1px 7px; margin-left:4px; }
.ck-who.peter { background:#ede9fe; color:#5b21b6; }
.ck-who.admin { background:#e0f2fe; color:#075985; }
.mc-actions { flex-wrap:wrap; gap:8px; margin-top:16px; }
.mc-hist { margin-top:14px; font-size:13px; }
.pvmodal { position:fixed; inset:0; z-index:100; background:rgba(4,16,48,.55); display:flex; align-items:center; justify-content:center; padding:12px; }
.pvmodal-box { background:#fff; border-radius:14px; width:min(560px,96vw); max-height:92vh; overflow:auto; padding:22px 22px 18px; box-shadow:0 20px 50px rgba(0,0,0,.3); border-top:8px solid #10b981; }
.pvmodal-box.gotest { border-top-color:#f59e0b; }
.pvmodal-box h2 { margin:0 0 8px; font-size:20px; }
.pvmodal-box ul { margin:6px 0 12px 18px; padding:0; font-size:14px; }
.pvmodal-box .md-chk { display:flex; gap:8px; align-items:center; font-weight:500; margin:10px 0; }
.btn.danger-solid { background:#b45309; }
@media (max-width: 640px) {
  .modebanner { font-size:12.5px; padding:8px 10px; }
  .modebanner .mb-dot { display:none; }
  .seg-b { padding:9px 14px; min-width:72px; }
  .whatnow th { width:40%; }
}
@media print { .modebanner { position:static; } }

/* ---------- Clinic manager screens (web/manage.js, 17 Nov 2026) ---------- */
.badge.role-mgr { background:#ede9fe; color:#5b21b6; }
.mg-tabs { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 14px; }
.mg-tabs a { padding:8px 14px; border-radius:999px; background:#fff; border:1px solid #d9dee8; color:#334155; text-decoration:none; font-weight:600; font-size:14px; }
.mg-tabs a.on { background:#1d4ed8; border-color:#1d4ed8; color:#fff; }
.mg-team { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.mg-user { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; }
.mg-u1 { display:flex; gap:6px; align-items:center; flex-wrap:wrap; min-width:0; word-break:break-all; }
.mg-acts { display:flex; gap:6px; flex-wrap:wrap; }
.mg-h3 { font-size:15px; margin:16px 0 6px; }
.mg-hours { display:flex; flex-direction:column; gap:6px; }
.mg-hr { display:grid; grid-template-columns:110px 90px 1fr auto 1fr; gap:8px; align-items:center; }
.mg-hr input[type=time] { padding:6px 8px; }
.mg-cl { font-weight:500; display:flex; gap:4px; align-items:center; margin:0; }
.mg-cl input, .mg-checks input { width:auto; }
.mg-checks { display:flex; flex-wrap:wrap; gap:6px 18px; margin:6px 0; }
.mg-checks label { font-weight:500; display:flex; gap:6px; align-items:center; margin:0; }
.mg-payers label { min-width:240px; }
.mg-prov { display:grid; grid-template-columns:2fr 1.2fr 1fr auto; gap:8px; margin:6px 0; }
.mg-ul { margin:6px 0 0 18px; padding:0; line-height:1.6; }
details.ba { margin-top:4px; }
details.ba summary { cursor:pointer; color:#1d4ed8; font-size:12px; }
.ba-g { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ba-g pre { white-space:pre-wrap; word-break:break-word; font-size:11px; background:#f8fafc; padding:6px; border-radius:6px; max-height:220px; overflow:auto; margin:2px 0 0; }
@media (max-width:640px) {
  .mg-hr { grid-template-columns:1fr 1fr; }
  .mg-hr .mg-day { grid-column:1 / -1; font-weight:600; }
  .mg-hr .hint { display:none; }
  .mg-prov { grid-template-columns:1fr; border-bottom:1px solid #e5e7eb; padding-bottom:8px; }
  .mg-user { align-items:flex-start; }
  .mg-acts .btn { flex:1 1 auto; }
  .ba-g { grid-template-columns:1fr; }
  .mg-tabs a { padding:7px 11px; font-size:13px; }
}

/* ---- Top navigation (web/nav.js), 18 Nov 2026: one tidy row on desktop, wraps on tablet, hamburger on phone ---- */
.topbar { position:relative; z-index:50; }
.topbar-in { max-width:1480px; margin:0 auto; padding:10px 20px; display:flex; align-items:center; gap:16px; }
.navpanel { display:flex; align-items:center; gap:16px; flex:1; min-width:0; }
nav#nav { display:flex; align-items:center; flex-wrap:wrap; gap:2px 2px; flex:1; min-width:0; }
nav#nav a, .navgroup-btn { text-decoration:none; color:var(--label); padding:8px 10px; border-radius:8px; font:500 14px Inter, sans-serif; white-space:nowrap; line-height:1.2; }
nav#nav a:hover, .navgroup-btn:hover { background:#f1f5fb; color:var(--blue); }
nav#nav a.on, .navgroup.on > .navgroup-btn { background:#eef4ff; color:var(--blue); }
nav#nav a:focus-visible, .navgroup-btn:focus-visible, .navtoggle:focus-visible, .who button:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
nav#nav a[hidden], .navgroup[hidden] { display:none !important; }
.navgroup { position:relative; }
.navgroup-btn { background:none; border:0; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.caret { width:7px; height:7px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg) translateY(-2px); transition:transform .15s; }
.navgroup.open .caret { transform:rotate(225deg) translate(-2px,-2px); }
.navmenu { display:none; position:absolute; top:calc(100% + 6px); left:0; min-width:220px; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 14px 34px rgba(4,16,48,.14); padding:6px; z-index:60; }
.navmenu-right { left:auto; right:0; }
.navgroup.open .navmenu { display:block; }
nav#nav .navmenu a { display:block; padding:9px 12px; }
.who { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; white-space:nowrap; margin-left:auto; }
#whoami { display:inline-block; max-width:200px; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
.navtoggle { display:none; margin-left:auto; align-items:center; gap:8px; background:#fff; border:1px solid var(--input); border-radius:8px; padding:7px 12px; font:600 14px Inter, sans-serif; color:var(--navy); cursor:pointer; }
.nt-bars { display:inline-flex; flex-direction:column; gap:3px; }
.nt-bars span { width:16px; height:2px; background:currentColor; border-radius:2px; display:block; }
@media (max-width:1380px) and (min-width:901px) {
  .topbar-in { flex-wrap:wrap; row-gap:6px; }
  .navpanel { flex-basis:100%; order:3; }
  .who { position:absolute; top:14px; right:20px; }
}
@media (max-width:900px) {
  .topbar-in { flex-wrap:wrap; padding:10px 14px; }
  .navtoggle { display:inline-flex; }
  .navpanel { display:none; flex-basis:100%; flex-direction:column; align-items:stretch; gap:8px; padding:6px 0 10px; border-top:1px solid var(--line); }
  .topbar.menu-open .navpanel { display:flex; }
  nav#nav { flex-direction:column; align-items:stretch; gap:2px; }
  nav#nav a, .navgroup-btn { padding:11px 12px; font-size:15px; width:100%; text-align:left; justify-content:space-between; }
  .navmenu { position:static; box-shadow:none; border:0; border-left:2px solid var(--line); border-radius:0; margin:2px 0 4px 12px; padding:0 0 0 6px; min-width:0; }
  .who { margin-left:0; padding:8px 12px 0; border-top:1px solid var(--line); justify-content:space-between; }
  #whoami { max-width:70vw; }
}
/* Tables that stay inside their card */
.card { min-width:0; }
.tscroll { overflow-x:auto; max-width:100%; -webkit-overflow-scrolling:touch; }
.rowacts { display:flex; flex-wrap:wrap; gap:6px; min-width:200px; }
.rowacts .btn { margin:0; }
/* STAGING ribbon (app.js stagingRibbon): dark navy, distinct from the blue Test banner */
#stgRibbon { position:fixed; bottom:0; left:0; right:0; z-index:9999; background:#0b1530; color:#e6ecff; text-align:center; font:600 12px/26px Inter, system-ui, sans-serif; letter-spacing:.08em; pointer-events:none; border-top:2px solid #6d5dfc; }
#stgRibbon b { color:#fff; background:#6d5dfc; border-radius:4px; padding:1px 7px; margin-right:8px; letter-spacing:.1em; }
body.is-staging { padding-bottom:28px; }
/* Briefing tiles open their detail view (18 Nov 2026) */
.stat-link { display:block; position:relative; text-align:left; text-decoration:none; color:inherit; font:inherit; width:100%; cursor:pointer; transition:border-color .15s, box-shadow .15s, transform .15s; padding-bottom:30px; }
.stat-link:hover { border-color:#9cc0ff; box-shadow:0 6px 18px rgba(11,99,229,.12); transform:translateY(-1px); background:#fff; }
.stat-link:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.stat-link .go { position:absolute; right:14px; bottom:10px; font-size:12px; font-weight:600; color:var(--blue); }
.stat-link .go .chev { font-size:15px; line-height:1; margin-left:2px; }
.filternote { background:#eef4ff; border:1px solid #c7dbff; color:#0b3a8c; border-radius:10px; padding:9px 12px; margin:0 0 12px; font-size:13.5px; }
#bfIns:focus-visible { outline:2px solid #0b63e5; outline-offset:2px; }

/* ---- App-wide polish (18 Nov 2026): one container, one button scale, aligned controls, tabular numbers ---- */
@media (min-width:1700px) { .wrap { max-width:1320px; } }
body { font-variant-numeric:tabular-nums; }
/* buttons: primary form button 44px, page buttons 40px, small 32px; one gap between buttons */
.btn { height:44px; }
.btn.secondary { height:40px; }
.btn.sm, .btn.small, .btn.secondary.sm { height:32px; padding:0 12px; font-size:13px; width:auto; margin-top:0; }
.btn.danger, .btn.secondary.danger { color:#b91c1c; border-color:#fecaca; }
.btn.danger:not(.secondary) { background:#dc2626; color:#fff; }
.actions, .exportbar, .callacts { gap:10px; align-items:center; }
.actions > *, .rowacts > * { margin:0; }
/* form controls: same height; inline controls in tables/rows stay inline */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select { height:44px; padding:0 12px; }
textarea { width:100%; padding:10px 12px; border:1px solid var(--input); border-radius:8px; font:inherit; }
td input:not([type=checkbox]):not([type=radio]), td select, .range input, .range select, .filters input, .filters select { width:auto; height:36px; padding:0 8px; display:inline-block; vertical-align:middle; }
td select { min-width:84px; }
.range { gap:8px 12px; }
/* checkboxes / radios sit on the line of their label */
input[type=checkbox], input[type=radio] { width:16px; height:16px; margin:0; accent-color:var(--blue); vertical-align:middle; flex:none; }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { display:flex; align-items:center; gap:8px; font-weight:500; }
summary label:has(> input[type=checkbox]) { display:inline-flex; }
/* badges centred */
.badge { display:inline-flex; align-items:center; gap:4px; line-height:1.3; vertical-align:middle; }
/* tables: cells vertically centred; numeric columns right-aligned (nav.js marks them .num) */
table.list td, table.list th, table.tbl td, table.tbl th, table.ptable td { vertical-align:middle; }
table.tbl { width:100%; border-collapse:collapse; }
table.tbl th { text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); padding:8px 10px; border-bottom:1px solid var(--line); }
table.tbl td { padding:10px; border-bottom:1px solid var(--line); }
td.num, th.num { text-align:right; white-space:nowrap; }
/* stat tiles: labels share a 2-line row so every value sits on the same baseline; values right-aligned */
.stats { align-items:stretch; }
.stat { display:flex; flex-direction:column; }
.stat .k { min-height:2.6em; line-height:1.3; }
.stat .v { text-align:right; margin-top:auto; padding-top:4px; }
.stat .s { text-align:right; }
.stat-link .go { left:16px; right:auto; }
/* toolbars + headings */
.toolbar h1 { line-height:1.2; }
@media (max-width:640px) { .toolbar select { min-width:0; width:100%; } .wrap { padding-top:18px; } h1 { font-size:22px; } }
.grid2 { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:4px 16px; align-items:end; }
.grid2 > label { margin:10px 0 0; }
.grid2 > .actions { grid-column:1 / -1; }

/* ---- One on/off switch (web/ui.js) + soft action buttons, 18 Nov 2026 ---- */
.tgl { display:inline-flex; align-items:center; gap:8px; width:84px; height:32px; padding:0 10px 0 6px; border-radius:99px; border:1px solid #cbd5e1; background:#f1f5f9; color:#475569; font:600 13px Inter, sans-serif; cursor:pointer; white-space:nowrap; vertical-align:middle; transition:background .15s, border-color .15s; }
.tgl-track { position:relative; width:30px; height:18px; border-radius:99px; background:#cbd5e1; flex:none; transition:background .15s; }
.tgl-knob { position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.2); transition:left .15s; }
.tgl.is-on .tgl-knob { left:14px; }
.tgl:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.tgl[disabled] { opacity:.5; cursor:not-allowed; }
.tgl-feature.is-on { background:#ecfdf5; border-color:#a7f3d0; color:#047857; } .tgl-feature.is-on .tgl-track { background:#34d399; }
.tgl-emergency { background:#f0fdf4; border-color:#bbf7d0; color:#15803d; } .tgl-emergency .tgl-track { background:#86efac; }
.tgl-emergency.is-on { background:#fffbeb; border-color:#fcd34d; color:#b45309; } .tgl-emergency.is-on .tgl-track { background:#f59e0b; }
.btn.soft { height:32px; min-width:104px; padding:0 12px; border-radius:8px; border:1px solid #c7dbff; background:#eef4ff; color:#0b4fc0; font:600 13px Inter, sans-serif; white-space:nowrap; width:auto; margin:0; }
.btn.soft:hover { background:#e0ebff; }
.em-danger { border:1px solid #fecaca !important; box-shadow:0 0 0 3px #fef2f2, 0 10px 30px rgba(4,16,48,.06); }
table.em-tbl th.c, table.em-tbl td.c { text-align:center; }
table.em-tbl td.c .hint { margin-top:4px; }
table.em-tbl td.pms { min-width:230px; }
table.em-tbl .badge { min-width:74px; justify-content:center; font-size:12px; padding:3px 10px; }
.cellstack { display:flex; flex-direction:column; align-items:center; gap:4px; }
/* checkbox styled as the same switch (Admin editor "On", Manage clinic write-back) */
input[type=checkbox].sw { appearance:none; -webkit-appearance:none; width:34px; height:20px; border-radius:99px; background:#cbd5e1; position:relative; cursor:pointer; transition:background .15s; }
input[type=checkbox].sw::after { content:''; position:absolute; top:3px; left:3px; width:14px; height:14px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.2); transition:left .15s; }
input[type=checkbox].sw:checked { background:#34d399; } input[type=checkbox].sw:checked::after { left:17px; }
input[type=checkbox].sw:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
input[type=checkbox].sw:disabled { opacity:.5; cursor:not-allowed; }
.swdlg { border-top-color:#0b63e5; }
.swdlg.all { border-top-color:#f59e0b; }
.sw-warn { background:#fffbeb; border:1px solid #fcd34d; color:#92400e; border-radius:10px; padding:10px 12px; margin:6px 0 12px; }
.swdlg .actions .btn { width:auto; min-width:110px; }

/* Accessibility (WCAG 2.2 AA, 18 Nov 2026): skip link, visible focus everywhere, reduced motion, target size */
.skiplink { position:absolute; left:12px; top:-60px; z-index:1000; background:#fff; color:#0b3a8c; border:2px solid #0b63e5; border-radius:8px; padding:10px 14px; font-weight:600; text-decoration:none; }
.skiplink:focus, .skiplink:focus-visible { top:10px; outline:2px solid #0b63e5; outline-offset:2px; }
#app:focus { outline:none; }
a:focus-visible, button:focus-visible, [role=switch]:focus-visible, summary:focus-visible, [tabindex]:not([tabindex="-1"]):focus-visible { outline:2px solid #0b63e5; outline-offset:2px; border-radius:6px; }
.navmenu a:focus-visible, #nav a:focus-visible { outline-offset:-2px; }
input[type=checkbox], input[type=radio] { min-width:20px; min-height:20px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration:.001s !important; animation-iteration-count:1 !important; transition-duration:.001s !important; scroll-behavior:auto !important; } }
.sr-only { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
/* Non-text contrast (WCAG 1.4.11): switch outlines at least 3:1 against white */
.tgl { border-color:#7b8798; }
.tgl-feature.is-on { border-color:#059669; }
.tgl-emergency { border-color:#16a34a; }
.tgl-emergency.is-on { border-color:#d97706; }
.btn.soft { border-color:#0b63e5; }
input[type=checkbox].sw { background:#8a96a8; min-width:34px; min-height:20px; } /* off track 3:1 vs white */
input[type=checkbox].sw:checked { background:#059669; }
select, input, textarea { max-width:100%; }
@media (max-width:480px) { .toolbar, .filters, .range { flex-wrap:wrap; } .toolbar select, .filters select { min-width:0; width:100%; } }

/* ---- Briefing chips + charts, Summary report (web/charts.js, web/summary.js; 18 Nov 2026) ---- */
.chipbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:4px 0 14px; }
.chipbar-l { font-size:13px; font-weight:600; color:var(--label); margin-right:2px; }
.chip { display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:0 14px; border-radius:99px; border:1px solid #7b8798; background:#fff; color:var(--navy); font:600 13.5px Inter, sans-serif; text-decoration:none; cursor:pointer; }
.chip:hover { background:#eef4ff; border-color:#0b63e5; color:#0b3a8c; }
.chip span { color:#0b63e5; font-weight:700; }
.chipbar .summary-btn { width:auto; height:36px; margin:0 0 0 auto; padding:0 16px; font-size:13.5px; text-decoration:none; }
@media (max-width:640px) { .chipbar .summary-btn { margin-left:0; width:100%; } }
.charts { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:18px 28px; align-items:start; }
.chart { margin:0; min-width:0; }
.ch-title { font:600 14px "DM Sans", Inter, sans-serif; margin:0 0 8px; color:var(--navy); }
.ch-body { display:flex; flex-wrap:wrap; gap:14px; align-items:center; }
.ch-big { font:700 26px "DM Sans", Inter, sans-serif; fill:#041030; }
.ch-small, .ch-lab { font:500 11px Inter, sans-serif; fill:#475569; }
.ch-val { font:600 11px Inter, sans-serif; fill:#041030; }
.ch-scroll { overflow-x:auto; }
.ch-legend { border-collapse:collapse; font-size:13px; min-width:190px; flex:1; }
.ch-legend th, .ch-legend td { padding:4px 8px; border-bottom:1px solid var(--line); text-align:left; font-weight:500; }
.ch-legend thead th { font-size:11.5px; color:#475569; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.ch-legend tfoot th, .ch-legend tfoot td { font-weight:700; border-bottom:0; }
.ch-legend td.num, .ch-legend th.num { text-align:right; font-variant-numeric:tabular-nums; }
.ch-sw { display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:8px; vertical-align:-1px; border:1px solid rgba(4,16,48,.25); }
.ch-stackbar { display:flex; height:22px; border-radius:6px; overflow:hidden; border:1px solid #94a3b8; margin-bottom:8px; }
.ch-seg { display:block; min-width:3px; } .ch-seg.empty { background:#e2e8f0; }
.sr-only-screen { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.sm-tbl { font-size:13px; }
.sm-tbl td { vertical-align:top; }
.sm-tbl td.nowrap { white-space:nowrap; }
.sm-tbl td.blank { min-width:54px; }
.sm-tbl td.notes { min-width:150px; }
.sm-tbl td.notes input { height:36px; font-size:13px; padding:6px 8px; }
.pri { display:inline-block; font-size:12px; font-weight:700; padding:3px 9px; border-radius:99px; border:1px solid; white-space:nowrap; }
.pri.p1 { background:#fffbeb; color:#92400e; border-color:#d97706; }
.pri.p2 { background:#eef4ff; color:#0b3a8c; border-color:#0b63e5; }
.pri.p3 { background:#f5f3ff; color:#5b21b6; border-color:#8b5cf6; }
.pri.p4 { background:#ecfdf5; color:#065f46; border-color:#059669; }
.pri.p5 { background:#fdf2f8; color:#9d174d; border-color:#db2777; }
.pri.p6 { background:#f1f5f9; color:#334155; border-color:#64748b; }
.outc { display:flex; flex-direction:column; gap:4px; min-width:140px; }
.ob { display:inline-flex; align-items:center; gap:7px; min-height:28px; padding:2px 8px; border:1px solid transparent; border-radius:6px; background:none; font:500 12.5px Inter, sans-serif; color:var(--navy); cursor:pointer; text-align:left; }
button.ob:hover { background:#eef4ff; }
.ob .box { width:16px; height:16px; border:1.5px solid #475569; border-radius:3px; flex:none; position:relative; }
.ob.on { background:#ecfdf5; border-color:#059669; font-weight:700; }
.ob.on .box { background:#059669; border-color:#059669; }
.ob.on .box::after { content:''; position:absolute; left:4px; top:0; width:5px; height:10px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
.sm-print-head { align-items:center; gap:14px; margin-bottom:10px; } .sm-print-head img { height:28px; }
@media print {
  body.print-summary .topbar, body.print-summary #stgRibbon, body.print-summary .testbanner, body.print-summary .modebanner, body.print-summary .no-print, body.print-summary .exportbar, body.print-summary .skiplink, body.print-summary .filternote, body.print-summary .fbbtn { display:none !important; }
  body.print-summary .wrap { max-width:none; padding:0; }
  body.print-summary .card { border:0; padding:0; box-shadow:none; }
  body.print-summary .sm-tbl { font-size:9pt; } body.print-summary .sm-tbl th, body.print-summary .sm-tbl td { padding:5px 4px; border:1px solid #94a3b8; }
  body.print-summary .sm-tbl tr { page-break-inside:avoid; } body.print-summary .sm-tbl thead { display:table-header-group; }
  body.print-summary .tscroll { overflow:visible !important; }
  body.print-summary #smTotals { page-break-before:always; }
  body.print-summary .sr-only-screen { position:static; width:auto; height:auto; clip:auto; }
  body.print-summary .ob { padding:0; min-height:0; font-size:8.5pt; } body.print-summary .ob.on { background:none; border:0; }
  body.print-summary a { color:inherit; text-decoration:none; }
  body.print-summary .print-only { display:flex !important; }
  .chart, .charts svg { page-break-inside:avoid; }
  .fbbtn { display:none !important; }
  @page { size:landscape; margin:10mm; }
}
/* Feedback button + dialog (web/feedback.js) */
.fbbtn { position:fixed; right:16px; bottom:16px; z-index:60; display:inline-flex; align-items:center; gap:6px; height:40px; padding:0 16px; border-radius:99px; border:1px solid #0b63e5; background:#fff; color:#0b3a8c; font:600 14px Inter, sans-serif; box-shadow:0 6px 18px rgba(4,16,48,.14); cursor:pointer; }
.fbbtn:hover { background:#eef4ff; }
body.is-staging .fbbtn { bottom:40px; }
.fbbtn[hidden] { display:none; }
.fbbox textarea { width:100%; min-height:130px; padding:10px 12px; border:1px solid var(--input); border-radius:8px; font:inherit; resize:vertical; }
.fbcount { text-align:right; }
.warnbox { background:#fffbeb; border:1px solid #d97706; color:#92400e; border-radius:8px; padding:8px 10px; margin-top:6px; font-size:13px; }
@media print { .fbbtn { display:none !important; } }
/* Do this first, morning panel, alert banner, find box, header chip, help (UX review P1, 18 Nov 2026) */
.dofirst h2 { margin-top:0; }
.df-list { list-style:none; margin:0; padding:0; }
.df-row { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); }
.df-row:last-child { border-bottom:0; }
.df-n { flex:none; width:32px; height:32px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:#fffbeb; border:1px solid #d97706; color:#92400e; font-weight:700; font-variant-numeric:tabular-nums; }
.df-done .df-n { background:#ecfdf5; border-color:#059669; color:#065f46; }
.df-done .df-t { color:#475569; }
.df-t { flex:1; }
.df-row .btn { width:auto; margin:0; }
.morningpanel { background:#eef4ff; border-color:#c7dbff; }
.morningpanel h2 { margin-top:0; } .morningpanel ol { margin:0 0 6px; padding-left:20px; line-height:1.6; }
.alertbanner { background:#fffbeb; border:1px solid #d97706; border-left:6px solid #d97706; color:#78350f; border-radius:10px; padding:12px 14px; margin:12px 0; }
.findbox { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:10px 0 14px; }
.findbox label { margin:0; }
.findbox input { max-width:360px; height:40px; }
.todochip { display:inline-flex; align-items:center; height:30px; padding:0 12px; border-radius:99px; background:#fffbeb; border:1px solid #d97706; color:#78350f; font-weight:700; font-size:13px; text-decoration:none; margin-right:8px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.todochip.late { background:#fff1e6; border-color:#c2410c; color:#7c2d12; }
.todochip[hidden] { display:none; }
.whohelp { margin-right:8px; font-weight:600; font-size:13.5px; }
.helplist li { margin:6px 0; line-height:1.55; }
#app [hidden] { display:none !important; }
/* Contrast fixes from the axe sweep (WCAG 1.4.3) */
:root { --muted:#566477; }
.btn.danger:not(.secondary), .btn.small.danger, .btn.sm.danger { background:#fef2f2 !important; color:#991b1b !important; border:1px solid #b91c1c !important; }
.seg-b.test.on { background:#fde68a; color:#78350f; }
.seg-b.live.on { background:#a7f3d0; color:#065f46; }
.lp-q a[href^="tel:"] { color:#0b4fc0; }
details > summary { min-height:24px; padding-top:3px; padding-bottom:3px; }
