/* UI refresh (Dr Shah 06-Oct-2026): SCRC mark, grouped side menu with icons, one colour per area, calmer headings, Inter throughout.
   Loaded after app.css on every page (index.php shell). Look only — no screen behaviour lives here. Remove this file + the <link> to undo. */

/* ---------- type: Inter everywhere on screen (print keeps its own fonts) ---------- */
body { font-family: Inter, "Segoe UI", system-ui, Arial, sans-serif; font-size: 14px; }
h1, h2, h3, .hero h1, .phead h1, .ptid h1, .bsec h2, .hsec h2 { font-family: Inter, "Segoe UI", system-ui, sans-serif !important; letter-spacing: -.01em; }

/* ---------- areas: each part of the clinic has its own colour ---------- */
body[data-area="clinic"], .side a[data-area="clinic"] { --a: #0D7A71; --a-d: #0B6B63; --a-l: #E3F4F2; }
body[data-area="desk"],   .side a[data-area="desk"]   { --a: #2261EB; --a-d: #1D4ED8; --a-l: #E8EFFD; }
body[data-area="money"],  .side a[data-area="money"]  { --a: #B35209; --a-d: #92400E; --a-l: #FDF1E2; }
body[data-area="info"],   .side a[data-area="info"]   { --a: #7C3AED; --a-d: #6D28D9; --a-l: #F1EBFD; }
body[data-area="admin"],  .side a[data-area="admin"]  { --a: #475569; --a-d: #334155; --a-l: #EEF1F5; }
body[data-area] { --accent: var(--a); --accent-d: var(--a-d); --accent-2: var(--a-l); --hteal: var(--a); --hteal-d: var(--a-d); }
body.homepage { background: #F4F6F8; }

/* ---------- SCRC mark ---------- */
.scrcmark { flex: none; display: block; }
.scrclock { display: flex; align-items: center; gap: 10px; min-width: 0; }
.scrclock b { display: block; font-size: 16px; font-weight: 600; letter-spacing: .06em; color: #0F2233; line-height: 1.1; }
.scrclock small { display: block; font-size: 11px; color: #626F7B; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- sign-in ---------- */
body.authpage { background: #F4F6F8; min-height: 100vh; }
.authpage main.auth { border-top: 0; border-radius: 16px; box-shadow: 0 1px 2px #0f22330f, 0 8px 32px #0f22331a; padding: 32px; margin: 10vh auto 24px; max-width: 380px; }
.authbrand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 20px; }
.authbrand .scrcmark { margin-bottom: 6px; }
.auth .authbrand h1 { font-size: 22px; font-weight: 600; letter-spacing: .08em; color: #0F2233; margin: 0; }
.auth .authbrand .sub { font-size: 13px; color: #5d6b7a; margin: 0; }
.authpage .auth button { background: #0F8C82; border-color: #0F8C82; } .authpage .auth button:hover { background: #0B6B63; border-color: #0B6B63; }
.authpage .auth input:focus { border-color: #0F8C82; box-shadow: 0 0 0 3px #0F8C8226; }
.authfoot { text-align: center; color: #626F7B; font-size: 12px; margin: 18px 0 0; }

/* ---------- the side menu ---------- */
body.hasside { padding-left: 232px; }
.side { position: fixed; top: 0; left: 0; bottom: 0; width: 232px; z-index: 50; display: flex; flex-direction: column; background: #fff; border-right: 1px solid #E3E8EE; }
.shead { display: flex; align-items: center; gap: 4px; padding-right: 10px; border-bottom: 1px solid #EEF1F5; }
.sbrand { display: block; flex: 1; min-width: 0; padding: 18px 8px 14px 18px; text-decoration: none; }
/* L10.13 the fold button: always at the top of the menu — folds it to icons / opens it again (wide screens), closes it (phones) */
.scol { flex: none; display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 8px; background: #fff;
  border: 1px solid #E3E8EE; color: #33414F; cursor: pointer; box-shadow: none; }
.scol:hover, .scol:focus-visible { background: #F3F5F8; color: #0F2233; border-color: #CBD3DC; }
.scol .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .14s ease; }
.snav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.sgrp { margin-top: 6px; }
.sgl { margin: 14px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #626F7B; }
.snav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; margin: 1px 0; border-radius: 8px; color: #33414F; text-decoration: none; font-weight: 600; font-size: 13.5px; }
.snav a .ic { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--a); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.snav a:hover { background: #F3F5F8; }
.snav a.on { background: var(--a-l); color: var(--a-d); box-shadow: inset 3px 0 0 var(--a); }
.sme { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid #EEF1F5; }
.sme .hav { flex: none; }
.smw { min-width: 0; flex: 1; } .smw b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sout { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #5d6b7a; }
.sout:hover { background: #F3F5F8; color: #b3261e; }
.sout.spk:hover { color: #0F8C82; }   /* fingerprint / face sign-in (passkey.php) — not the red of Sign out */
#pkbox { margin-bottom: 8px; } #pkbox button { width: 100%; } #pklist { padding-left: 18px; } #pklist li { margin: 6px 0; }
.sout .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.smenu, .sscrim, .smback { display: none; }
/* L10.11 Back: first item of the side menu (wide screens); beside the Menu button on phones */
.snav a.sback { color: #0F2233; border: 1px solid #E3E8EE; margin-bottom: 6px; }
.snav a.sback .ic { stroke: #0F2233; }

/* role badge: one colour per role */
.rolechip { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #EEF1F5; color: #475569; }
.role-admin { background: #E9E7FB; color: #4338CA; } .role-doctor { background: #E3F4F2; color: #0B6B63; } .role-nurse { background: #FCE8F1; color: #9D174D; } .role-mo { background: #E0F2FE; color: #075985; }
.role-reception { background: #E8EFFD; color: #1D4ED8; } .role-accounts { background: #FDF1E2; color: #92400E; } .role-staff { background: #FFF4DC; color: #8a5a00; }

/* narrow screens: the menu slides in from the left */
@media (max-width: 1024px) {
  body.hasside { padding-left: 0; }
  .side { transform: translateX(-102%); transition: transform .18s ease; box-shadow: 8px 0 30px #0f223326; }
  body.sopen .side { transform: none; }
  .smenu { display: grid; place-items: center; position: fixed; top: 10px; left: 10px; z-index: 45; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 10px;
    background: #fff; border: 1px solid #E3E8EE; color: #0F2233; box-shadow: 0 2px 8px #0f22331a; }
  .smenu:hover { background: #F3F5F8; border-color: #E3E8EE; }
  .smenu .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .smback { display: flex; align-items: center; gap: 6px; position: fixed; top: 10px; left: 58px; z-index: 45; height: 40px; padding: 0 14px 0 10px; border-radius: 10px;
    background: #fff; border: 1px solid #E3E8EE; color: #0F2233; box-shadow: 0 2px 8px #0f22331a; text-decoration: none; font-weight: 600; font-size: 14px; }
  .smback .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  body.sopen .smback { display: none; }
  body.sopen .sscrim { display: block; position: fixed; inset: 0; z-index: 49; background: #0f223340; }
  body.hasside main.home { padding-top: 56px; }
}
body.qtvmode .side, body.qtvmode .smenu, body.qtvmode .smback { display: none; } body.qtvmode.hasside { padding-left: 0; }
@media print { .side, .smenu, .sscrim, .smback { display: none !important; } body.hasside { padding-left: 0; } }

/* ---------- calmer headings ---------- */
.phead h1, .ptid h1 { font-size: 20px !important; font-weight: 600 !important; line-height: 1.25 !important; display: flex; align-items: center; gap: 10px; }
.phead h1::before { content: ''; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--a-l) var(--pico) center / 18px no-repeat; }
.bsec h2, .hsec h2 { font-size: 15px !important; font-weight: 600 !important; }
.bsec > header, .hsec > header { padding-left: 10px; border-left: 3px solid var(--a); }
.hero h1 { font-size: 24px !important; font-weight: 600 !important; }
.hero.slim { padding: 20px 26px !important; border-radius: 16px; background: var(--a) !important; }
.hero::after { display: none; }
/* B1 (07-Oct-2026): app.css gives .hero overflow:hidden (for the stripes, now off), which cut the search results off at the banner's edge —
   the box opened but no name showed. Let the list hang below the banner, above the sections under it. */
.hero.slim { overflow: visible; z-index: 6; } .hero.slim .hres { z-index: 7; }
main.home h2 { font-size: 15px; } main.home h3 { font-size: 14px; }
.card h2, .hcard h2 { font-size: 15px; }

/* the page-title icon, per screen (data URIs: stroke in each area's colour) */
body[data-area="desk"]   { --pico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11M4 6h1M4 12h1M4 18h1'/%3E%3C/svg%3E"); }
body[data-area="money"]  { --pico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B45309' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4h11M7 8.5h11M7 4h4a4.5 4.5 0 0 1 0 9H7l8 8'/%3E%3C/svg%3E"); }
body[data-area="clinic"] { --pico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F8C82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8zM2 20c0-3.5 3-6 7-6s7 2.5 7 6M16 4.5a4 4 0 0 1 0 7M18.5 14.5c2.4.7 4 2.7 4 5.5'/%3E%3C/svg%3E"); }
body[data-area="info"]   { --pico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C3AED' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1'/%3E%3C/svg%3E"); }
body[data-area="admin"]  { --pico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1'/%3E%3C/svg%3E"); }

/* ---------- the Prescriptions screen: SCRC mark in its own top bar ---------- */
header.top .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
header.top .brand .scrcmark rect { fill: #fff; } header.top .brand .scrcmark path { stroke: #0F8C82; }

/* ---------- the bug board on the side-menu layout ---------- */
.bugslive { margin: 12px 24px 0; font-size: 13px; }

/* ---------- Settings: users & logins ---------- */
.phead { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.setwarn { margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; background: #FFF4DC; border: 1px solid #F2D49B; color: #6b4600; font-size: 13.5px; }
.setlink { border-left: 4px solid #0F8C82; }
.setlinkrow { display: flex; gap: 8px; align-items: center; } .setlinkrow input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.setadd { display: grid; gap: 12px; max-width: 720px; }
.setaddrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 600px) { .setaddrow { grid-template-columns: 1fr; } }
.setf .flabel { margin-bottom: 4px; } .setbtns { display: flex; gap: 8px; }
.setusers td.acts { white-space: nowrap; text-align: right; } .setusers td.acts button { margin-left: 4px; }
.setusers td small { display: block; color: #626F7B; }
.setusers td small.setpof { margin-top: 3px; color: #475569; }   /* D1: whose patients this login opens */
.setusers tr.setoff td { opacity: .55; } .setusers tr.setoff td.acts { opacity: 1; }
button.setdis { color: #b3261e; border-color: #e7b7b2; } button.setdis:hover { background: #fdecea; }
.setcaps-wrap { overflow-x: auto; } .setcaps { width: 100%; min-width: 620px; border-collapse: collapse; /* phone-ok: sits inside .setcaps-wrap, which scrolls sideways */ } .setcaps th, .setcaps td { padding: 7px 10px; border-bottom: 1px solid #EEF1F5; text-align: center; font-size: 13px; }
.setcaps td:first-child { text-align: left; color: #33414F; } .setcaps td.yes { color: #0B6B63; font-weight: 600; } .setcaps td.no { color: #64788B; }
body:has(.envbar) .side { bottom: 30px; }

/* ---------- Billing (06-Oct-2026 declutter): the receipt form in four blocks, icon headings, sections grouped by when they are used ---------- */
.blic { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--a); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.blh { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 15px !important; font-weight: 600; }
.blh > .blic { width: 28px; height: 28px; padding: 5px; border-radius: 8px; background: var(--a-l); box-sizing: border-box; }
.blh small { font-size: 12.5px; font-weight: 400; color: #626F7B; }
.blcnt { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: #EEF1F5; color: #475569; font-size: 12px; font-weight: 600; }
.blcnt:empty { display: none; }
.blgl { margin: 22px 4px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #626F7B; }
#home[data-page="billing"] > .hcard + .hcard { margin-top: 10px; }
#home[data-page="billing"] .hempty { margin: 4px 16px 12px; font-size: 13px; }
/* the day's money as three small tiles */
.blsum { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 0 0 12px; }
.blstat { display: flex; flex-direction: column; justify-content: center; min-width: 120px; padding: 7px 14px; border-radius: 12px; background: #fff; border: 1px solid #E3E8EE; }
.blstat small { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #626F7B; }
.blstat b { font-size: 17px; font-variant-numeric: tabular-nums; color: #0F2233; }
.blstat.net { background: var(--a-l); border-color: transparent; } .blstat.net b { color: var(--a-d); }
.blsumnote { align-self: center; font-size: 12px; }
/* make a receipt: four blocks, two per row on a wide screen */
#blnew { padding: 0 0 4px; }
#blnew > .aph2 { padding: 12px 16px 0; }
.blgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 12px 0; }
.blk { min-width: 0; padding: 10px 12px 4px; border-radius: 12px; background: #F8FAFC; border: 1px solid #EEF1F5; }
.blk h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: #33414F; }
.blk h3 small { font-weight: 400; color: #626F7B; }
.blk .blrow { margin: 4px 0 6px; }
.blk2 { display: grid; grid-template-columns: minmax(200px, 1fr) auto; gap: 10px 14px; align-items: start; margin-bottom: 6px; }
.blk .blsvc { margin: 0 0 4px; }
.blk .blsvc .muted { margin: 4px 0; font-size: 12.5px; }
.blfoot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 10px 12px 8px; padding: 10px 14px; border-radius: 12px; background: var(--a-l); }
.blfoot .bltot { margin: 0; } .blfoot .qchosen { display: block; margin: 2px 0 0; }
.blfoot .bltot:empty { display: none; }
/* folded sections (month file, price list) */
.blfold > summary { cursor: pointer; list-style: none; padding: 12px 16px; margin: 0; }
.blfold > summary::-webkit-details-marker { display: none; }
.blfold > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid #8A97A2; border-bottom: 2px solid #8A97A2; transform: rotate(45deg); transition: transform .15s; }
.blfold[open] > summary::after { transform: rotate(-135deg); }
.blfold[open] > summary { padding-bottom: 4px; }
#blcsv { padding: 0 16px 8px; }
.blfold .blpform { padding: 0 16px; }
@media (max-width: 1024px) { .blgrid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .blk2 { grid-template-columns: 1fr; } }
#bltally > p, #bltally > .blrow { margin-left: 12px; margin-right: 12px; }
.blk .blrow .pmf { min-width: 110px; }
.blfold { padding: 0 !important; } .blfold .bllog { margin: 10px 16px 12px; } .blfold .hempty { margin: 4px 16px 12px; }

/* ---------- review & approve pages (06-Oct-2026 declutter): side menu + calm heading instead of the old "⌂ Home · Prescriptions" bar ---------- */
body.revpage { background: #F4F6F8; --pico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11M3.5 6l1.5 1.5L7.5 5M3.5 12l1.5 1.5 2.5-2.5M3.5 18l1.5 1.5 2.5-2.5'/%3E%3C/svg%3E"); }
body.revpage main.horeview { font-family: inherit; padding: 0 28px 60px; }
.revhead { margin: 24px 0 14px; } .revhead h1 { margin: 0 0 4px; }
.revhead .muted { font-size: 13px; }
body.revpage .horeview > .muted, body.revpage .horeview > .hofilter, body.revpage .horeview > .tabs { margin-left: 0; }
@media (max-width: 1024px) { body.revpage main.horeview { padding: 56px 16px 60px; } .revhead { margin-top: 0; } }
@media (max-width: 600px) { .blstat { flex: 1 1 0; min-width: 0; padding: 7px 10px; } .blstat b { font-size: 15px; } .blsumnote { flex-basis: 100%; } }

/* ---------- the patient bar (Dr Shah 07-Oct-2026): Write · Look back · Tools — on the Rx screen (tabs) and the patient pages (links) ---------- */
.ptbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.pbg { display: flex; align-items: center; gap: 2px; padding-left: 12px; border-left: 1px solid #E3E8EE; }
.pbg:first-child { padding-left: 0; border-left: 0; }
.pbgl { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #626F7B; margin-right: 6px; white-space: nowrap; }
.ptbar button, .ptbar a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; min-height: 30px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: #33414F; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; box-shadow: none; }
.ptbar .pbic { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--a); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ptbar button:hover, .ptbar a:hover { background: var(--a-l); color: var(--a-d); border-color: transparent; }
.ptbar button.on, .ptbar a.on { background: var(--a); color: #fff; border-color: var(--a); } .ptbar .on .pbic { stroke: #fff; }
.ptbar .count:empty { display: none; } .ptbar kbd { display: none; }
/* item 7b (10-Oct-2026): the record's tags at the start of the patient bar (tags.php / tags.js draw them; staff only, never printed) */
.ptbar .pbtags { display: inline-flex; flex-wrap: wrap; gap: 4px; } .ptbar .pbtags:empty { display: none; }
.pbtag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .82em; font-weight: 600; line-height: 1.6; white-space: nowrap; background: #eef4fa; color: #234; }
.pbtag-vip { background: #f3e8fd; color: #5b2a86; } .pbtag-doctor { background: #e3effc; color: #164a7d; } .pbtag-staff { background: #e8f5ec; color: #1d6b38; } .pbtag-unhappy { background: #fdf0dc; color: #8a4b00; }
.tabs { flex-wrap: wrap; row-gap: 6px; } .tabs .ptbar { flex: 0 1 auto; } .tabs .orgbar { flex: 1 1 360px; }
.ptbar-links { background: #fff; border: 1px solid #E3E8EE; border-radius: 12px; padding: 8px 12px; margin: 12px 0 16px; }

/* ---------- the folded side menu: a narrow icon rail that opens over the page on hover (the page keeps its width) ----------
   The Rx screen starts folded; L10.13: every page can fold / open it with the button at the top (ui.php ui_side_rail, kept per login on this
   device). .snopeek = just folded with the mouse still on it: stay folded until the mouse leaves (ui.js). */
@media (min-width: 1025px) {
  body.hasside { transition: padding-left .14s ease; }
  body.hasside:has(.side.srail) { padding-left: 64px; }
  .side.srail { width: 64px; overflow: hidden; transition: width .14s ease, box-shadow .14s ease; }
  .side.srail .sbrand { padding: 14px 8px 12px 15px; }
  .side.srail .scol .ic { transform: scaleX(-1); }   /* points right: open it */
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .shead { flex-direction: column; gap: 2px; padding: 0 0 10px; }
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .sbrand { flex: none; padding: 14px 15px 4px; }
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .scrclock > span, .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .snav a span,
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .smw, .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .sout { display: none; }
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .sgl { height: 0; margin: 8px 8px; border-top: 1px solid #EEF1F5; font-size: 0; }
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .snav a { justify-content: center; padding: 8px 0; }
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .sme { justify-content: center; padding: 12px 0; }
  .side.srail:not(.snopeek):is(:hover, :focus-within) { width: 232px; box-shadow: 8px 0 30px #0f223326; }
}
@media (max-width: 1024px) { body.hasrail header.top { padding-left: 150px; } }   /* L10.11: room for Menu + Back */

/* ---------- past prescriptions (pastrx.js): Rx screen Past Rx, Home Today's prescriptions, the profile, Records cards ---------- */
.pxlist { display: flex; flex-direction: column; }
.pxrow { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid #EEF1F5; }
.pxrow:last-child { border-bottom: 0; }
.pxw { flex: 1; min-width: 0; } .pxw b { display: block; font-size: 13.5px; } .pxw small.pxu { display: inline; color: #626F7B; font-weight: 500; margin-left: 6px; }
.pxw small { display: block; color: #5d6b7a; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxacts { display: inline-flex; gap: 4px; flex: none; }
.pxa { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid #E3E8EE; border-radius: 8px; background: #fff; color: #33414F;
  font-weight: 600; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.pxa:hover { border-color: var(--a); color: var(--a-d); background: var(--a-l); }
.pxa .ic { width: 15px; height: 15px; fill: none; stroke: var(--a); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pxtag { flex: none; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #EEF1F5; color: #475569; }
.pxtag.today { background: var(--a-l); color: var(--a-d); } .pxtag.how-none { background: #FFF4DC; color: #8a5a00; }
.pxopen { flex: none; font-size: 12.5px; font-weight: 600; }
.pxnone { color: #626F7B; margin: 6px 0; }
.pastrx { background: #fff; border: 1px solid #E3E8EE; border-radius: 12px; padding: 12px 16px; margin-top: 10px; }
.pxhead { padding-bottom: 6px; border-bottom: 1px solid #EEF1F5; } .pxhead .muted { margin-left: 6px; }
.card .acts .pxacts { vertical-align: middle; } .card .acts .pxa { padding: 0 8px; font-size: 12px; }
.pxtoday { padding: 4px 18px 12px !important; }
.pxdoc + .pxdoc { margin-top: 8px; border-top: 1px solid #EEF1F5; }
.pxdoc h3 { margin: 12px 0 0; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.pxgrp h4 { margin: 10px 0 0; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: #626F7B; }
.pxgrp.how-none h4 { color: #b45309; }
.ptvacts .pxacts { margin-right: 6px; }

/* ---------- patient pages: Letters / Charts / Summary on their own (?p=ptletters | ptcharts | ptsummary) ---------- */
main.ptshell .ptsline h1 { font-size: 20px; font-weight: 600; margin: 6px 0 2px; }
main.ptshell .ptsline .ptmeta { color: #5d6b7a; margin: 0; }
.ptstool { background: #fff; border: 1px solid #E3E8EE; border-radius: 12px; padding: 14px 16px; }
.ptstool .tsframe { width: 100%; height: calc(100vh - 250px); min-height: 640px; border: 0; }
.ptstool .hotop, .ptstool .calcbar { margin-bottom: 10px; }

@media (max-width: 600px) {
  .pbgl { display: none; } .pbg { padding-left: 6px; } .ptbar button, .ptbar a { padding: 4px 8px; }
  .pxrow { flex-wrap: wrap; } .pxacts { width: 100%; } .pxa { flex: 1; justify-content: center; }
}

/* ---------- My desk (/?p=desk, desk step 1, 07-Oct-2026): the top strip, lists by life area, the task list, one task at the side (desk.js) ---------- */
main.desk { max-width: 1400px; margin: 0 auto; padding: 18px 28px 60px; }
.desk .ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.desk .ic.sm { width: 14px; height: 14px; }
.dkhead { margin-bottom: 12px; }
.dkstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dktile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 12px 14px;
  background: #fff; color: #1b2733; border: 1px solid #E3E8EE; border-radius: 12px; font-weight: 400; min-height: 0; box-shadow: 0 1px 2px #0f22330d; }
.dktile:hover { background: #F7F9FB; border-color: #D3DCE5; color: #1b2733; }
.dktile .ic { grid-row: span 2; width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: #EEF1F5; color: #475569; }
.dktile b { font-size: 22px; font-weight: 600; line-height: 1.1; }
.dktile span { font-weight: 600; font-size: 13px; grid-column: 2; }
.dktile small { grid-column: 1 / -1; color: #5d6b7a; font-size: 11.5px; margin-top: 4px; }
.dktile b + span { grid-row: 2; }
.dktile.red .ic { background: #FDE8E8; color: #B42318; } .dktile.red b { color: #B42318; }
.dktile.amber .ic { background: #FDF1E2; color: #B45309; } .dktile.amber b { color: #B45309; }
.dktile.later { opacity: .7; }
.dkwait { margin-top: 10px; background: #fff; border: 1px solid #E3E8EE; border-radius: 12px; padding: 10px 16px; }
.dkwait ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.dkwait a { color: #33414F; text-decoration: none; } .dkwait a:hover { text-decoration: underline; } .dkwait b { color: #B45309; margin-right: 4px; }
.dkbody { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
body.dkopen .dkbody { grid-template-columns: 230px minmax(0, 1fr) 380px; }
.dknav { position: sticky; top: 12px; background: #fff; border: 1px solid #E3E8EE; border-radius: 12px; padding: 8px; max-height: calc(100vh - 24px); overflow-y: auto; }
.dkng + .dkng { border-top: 1px solid #EEF1F5; margin-top: 6px; padding-top: 6px; }
.dkngl { margin: 8px 8px 2px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--c); }
.dkn { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; color: #33414F; text-decoration: none; font-weight: 600; font-size: 13px; }
.dkn span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dkn em { font-style: normal; font-size: 11.5px; color: #5d6b7a; font-weight: 600; }
.dkn[data-red] em { color: #B42318; }
.dkn:hover { background: #F3F5F8; } .dkn.on { background: var(--a-l); color: var(--a-d); }
.dkn .ic { color: #475569; }
.dkdot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #64748B); margin: 0 4px; }
.dknew { color: #5d6b7a; }
.dksearch { display: flex; align-items: center; gap: 6px; margin: 6px 2px 2px; padding: 0 8px; border: 1px solid #D3DCE5; border-radius: 8px; color: #5d6b7a; }
.dksearch input { border: 0; min-height: 30px; padding: 2px 0; background: transparent; } .dksearch input:focus { outline: none; box-shadow: none; }
.dkadd { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #D3DCE5; border-radius: 12px; padding: 4px 4px 4px 12px; }
.dkadd:focus-within { border-color: var(--a); box-shadow: 0 0 0 3px var(--a-l); }
.dkadd input { border: 0; min-height: 38px; font-size: 15px; } .dkadd input:focus { outline: none; box-shadow: none; }
.dkaddic { color: var(--a); display: grid; }
.dkparse { min-height: 22px; margin: 6px 4px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.dkpc { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; background: #EEF1F5; color: #33414F; font-size: 12px; font-weight: 600; }
.dkpc .dkdot { margin: 0; width: 8px; height: 8px; } .dkpc.warn { background: #FFF4DC; color: #8a5a00; }
.dkptchip { display: inline-flex; align-items: center; gap: 3px; color: #0F8C82; font-size: 12px; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dkptlink { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .dkptlink a { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.dkptin { width: 100%; box-sizing: border-box; } .dkptres { list-style: none; margin: 4px 0 0; padding: 0; } .dkptres button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; font: inherit; }
.dkptres button:hover, .dkptres button:focus { background: #EEF1F5; } .dkptres small { color: #64748B; }
.dkpc.p5 { background: #FDE8E8; color: #B42318; } .dkpc.p3 { background: #FDF1E2; color: #B45309; } .dkpc.p1 { background: #E8EFFD; color: #1D4ED8; }
.dkviewhead { display: flex; align-items: baseline; gap: 10px; margin: 12px 4px 4px; }
.dkviewhead h2 { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.dkviewhead h2 .dkdot { width: 12px; height: 12px; }
.dkviewhead .ghost { margin-left: auto; }
.dkgrp { margin-top: 10px; }
.dkgrp h3 { margin: 0 4px 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #5d6b7a; }
.dkgrp h3 em { font-style: normal; color: #626F7B; margin-left: 4px; }
.dkgrp.red h3 { color: #B42318; } .dkgrp.today h3 { color: var(--a-d); }
.dkrow { display: flex; align-items: flex-start; gap: 10px; background: #fff; border: 1px solid #E3E8EE; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.dkrow:hover { border-color: #C9D3DD; } .dkrow.on { border-color: var(--a); box-shadow: 0 0 0 2px var(--a-l); }
.dkgrp.red .dkrow { border-left: 3px solid #E5484D; }
.dkchk { flex: none; display: grid; place-items: center; width: 22px; height: 22px; min-height: 0; padding: 0; margin-top: 1px; border-radius: 50%; background: #fff;
  border: 2px solid #9AA6B2; color: transparent; }
.dkchk:hover { background: #F3F5F8; border-color: #5d6b7a; color: #606F7E; }
.dkchk .ck { width: 14px; height: 14px; stroke-width: 3; }
.dkchk[aria-checked="true"] { background: #94A3B8; border-color: #94A3B8; color: #fff; }
.p5 > .dkchk { border-color: #E5484D; } .p3 > .dkchk { border-color: #F59E0B; } .p1 > .dkchk { border-color: #3B82F6; }
.dkchk.big { width: 26px; height: 26px; } .dkchk.sm { width: 18px; height: 18px; border-width: 1.5px; } .dkchk.sm .ck { width: 11px; height: 11px; }
/* UX-M1 (23-Oct-2026, found when the phone gate first had tasks on My desk): on a phone the tick is a 44 px target — the same 22 px circle drawn
   inside a transparent 11 px border, its ring an inset shadow (the priority colours follow) */
@media (max-width: 600px) {
  .dkchk:not(.sm) { width: 44px; height: 44px; margin: -11px 0 -11px -11px; border: 11px solid transparent !important; background-clip: padding-box; box-shadow: inset 0 0 0 2px #9AA6B2; }
  .p5 > .dkchk:not(.sm) { box-shadow: inset 0 0 0 2px #E5484D; } .p3 > .dkchk:not(.sm) { box-shadow: inset 0 0 0 2px #F59E0B; } .p1 > .dkchk:not(.sm) { box-shadow: inset 0 0 0 2px #3B82F6; }
  .dkchk:not(.sm)[aria-checked="true"] { box-shadow: none; background-color: #94A3B8; }
  .dkchk.big { width: 48px; height: 48px; }
}
.dkt { flex: 1; min-width: 0; display: block; text-align: left; background: none; border: 0; padding: 0; min-height: 0; color: #1b2733; font-weight: 400; cursor: pointer; }
.dkt:hover { background: none; color: #1b2733; }
.dktitle { display: block; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.dkrow.closed .dktitle { color: #626F7B; text-decoration: line-through; }
.dkmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 12px; color: #5d6b7a; }
.dkmeta > span { display: inline-flex; align-items: center; gap: 3px; }
.dkdue.red { color: #B42318; font-weight: 600; } .dkdue.today { color: var(--a-d); font-weight: 600; }
.dklchip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: 3px; }
.dkdrop, .dksrc { padding: 0 6px; border-radius: 999px; background: #EEF1F5; font-size: 11px; }
.dkempty { margin: 18px 4px; color: #5d6b7a; }
.dkdetail { position: sticky; top: 12px; background: #fff; border: 1px solid #E3E8EE; border-radius: 12px; padding: 12px 14px 14px; max-height: calc(100vh - 24px); overflow-y: auto; }
.dkdhead { display: flex; align-items: center; gap: 10px; }
.dkdhead #dkst { flex: 1; } #dkst.bad { color: #B42318; font-weight: 600; }
.dkclose { display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; background: none; border: 0; color: #5d6b7a; }
.dkclose:hover { background: #F3F5F8; color: #1b2733; }
.dkf { margin-top: 12px; }
.dkfl { display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #626F7B; margin-bottom: 4px; }
.dkftitle input, .dkftitle .rxf-in { font-size: 16px; font-weight: 600; }
.dkdates { display: flex; gap: 8px; align-items: flex-start; } .dkdatein { flex: 1; } .dktime { width: 120px; flex: none; }
.dkmoves { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dkrepfrom { margin-top: 6px; } #dkrepnext { margin: 6px 0 0; }
.dkcustom { margin-top: 6px; } .dkcustom p { margin: 4px 0 0; }
.dkcl { list-style: none; margin: 0; padding: 0; }
.dkcl li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #EEF1F5; }
.dkcl li span { flex: 1; overflow-wrap: anywhere; } .dkcl li.done span { color: #626F7B; text-decoration: line-through; }
.dkix { display: grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 0; background: none; border: 0; color: #606F7E; }
.dkix:hover { background: #FDE8E8; color: #B42318; }
.dkcladd { display: flex; gap: 6px; margin-top: 6px; }
.dkdfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #EEF1F5; }
.dklog { margin-top: 10px; } .dklog ul { margin: 6px 0 0; padding: 0 0 0 4px; list-style: none; font-size: 12px; } .dklog li { padding: 2px 0; } .dklog li > span:first-child { color: #626F7B; margin-right: 6px; }
.dkmodal { position: fixed; inset: 0; z-index: 90; background: #0f223352; display: grid; place-items: center; padding: 16px; }
.dkmform { background: #fff; border-radius: 14px; padding: 18px 20px; width: min(480px, 100%); box-shadow: 0 20px 50px #0f223340; }
.dkmform h2 { margin: 0; font-size: 18px; font-weight: 600; }
.dkmbtn { display: flex; align-items: center; gap: 8px; margin-top: 16px; } .dkmbtn span { flex: 1; }
.deskpage .htoast.on { pointer-events: auto; }
.htoast .dkundo { margin-left: 10px; min-height: 0; padding: 2px 10px; background: #fff; color: #0b2a3a; border: 0; border-radius: 6px; }

@media (max-width: 1024px) { body.dkopen .dkbody { grid-template-columns: 210px minmax(0, 1fr); } body.dkopen .dkdetail { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 60; border-radius: 0; max-height: none; box-shadow: -8px 0 30px #0f223326; } }
@media (max-width: 1024px) { main.desk { padding-top: 60px; } }
@media (max-width: 600px) {
  main.desk { padding: 60px 16px 80px; }
  .dkstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dktile { padding: 8px 10px; } .dktile .ic { width: 28px; height: 28px; padding: 5px; } .dktile b { font-size: 19px; } .dktile small { display: none; } .dktile span { font-size: 12px; line-height: 1.25; }
  .dkbody, body.dkopen .dkbody { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dknav { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 6px; max-height: none; scrollbar-width: none; }
  .dkng { display: contents; } .dkngl { display: none; }
  .dkn { flex: none; border: 1px solid #E3E8EE; border-radius: 999px; padding: 5px 11px; } .dkn span { overflow: visible; }
  .dksearch { flex: none; width: 170px; margin: 0; }
  .dkadd input { font-size: 16px; }
  body.dkopen .dkdetail { width: 100%; }
}

/* ---------- the patient bar as a strip right under the Rx top bar (Dr Shah 07-Oct-2026: "at the top of the page, below the header — not inside the prescription flow") ---------- */
nav.tabs.ptnav { position: sticky; top: 55px; z-index: 29; display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; margin: 0; padding: 6px 18px;
  background: #fff; border-bottom: 1px solid #E3E8EE; box-shadow: 0 1px 3px #0f22330d; }
body:not(.haspt) nav.ptnav { display: none; }
.ptnavwho { font-weight: 600; font-size: 13.5px; color: #0F2233; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.ptnavwho:empty { display: none; }
body.haspt aside.left { top: 108px; max-height: calc(100vh - 124px); }
#tab-rx > .orgbar.rxorg { margin: 10px 0 8px; }
@media (max-width: 1024px) { body.hasrail nav.ptnav { padding-left: 18px; } nav.tabs.ptnav { position: static; } }

/* lane 4 item 4.0 (07-Oct-2026): 'Waiting for you' + one progress bar per lane on the desk (desk.js paintLanes) */
.dklanes { margin-top: 12px; display: grid; gap: 12px; }
.dklcard { background: #fff; border: 1px solid #E3E8EE; border-radius: 12px; padding: 12px 16px; }
.dklcard h2 { font-size: 15px; margin: 0 0 8px; display: inline-flex; gap: 8px; align-items: baseline; }
.dklcard h2 small { color: #626F7B; font-size: 13px; font-weight: 500; margin-left: 4px; }   /* a count beside a heading is plain text, not a pill — it does nothing when clicked (Dr Shah 08-Oct-2026) */
.dklcard summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; list-style: none; }
.dklcard summary::-webkit-details-marker { display: none; }
.dklwait { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.dklwait > li { line-height: 1.4; }
.dklwait .dklk { display: block; font-size: 12px; color: #64748B; }
.dklwait .k-check .dklk { color: #1D4ED8; } .dklwait .k-decision .dklk { color: #B45309; } .dklwait .k-idea .dklk { color: #7C3AED; }
.dklsteps { margin: 4px 0; padding-left: 18px; color: #33414F; }
.dklwait a { font-size: 13px; }
.dklans { margin: 6px 0 0; font-size: 13px; } .dklans.a-works { color: #047857; } .dklans.a-not_yet { color: #B91C1C; }   /* L4.0b */
.dklans .dklchg { font-size: 12px; background: none; border: 0; color: #1D4ED8; text-decoration: underline; cursor: pointer; padding: 0 4px; }
.dkckbig { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; font-size: 17px; font-weight: 600; border-radius: 10px; }
a.dkckgo { background: #2563EB; color: #fff; border-color: #2563EB; text-decoration: none; margin: 4px 0 10px; }
/* L4.5 Decisions inbox: one card per open decision, one big button per choice (phone-sized), answered cards fold to one line */
a.dkdecgo { background: #B45309; color: #fff; border-color: #B45309; text-decoration: none; margin: 4px 0 10px 8px; }
.dklwait > li.k-decision { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 10px; padding: 10px 12px; margin-left: -20px; list-style: none; }
.dkdectext { margin: 4px 0; font-size: 14px; color: #33414F; }
.dkdecdef { margin: 4px 0; font-size: 13px; color: #64748B; }
.dkdecbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dkdecbtn { min-height: 48px; padding: 8px 14px; font-size: 15px; text-align: left; border-radius: 10px; background: #fff; border: 1px solid #D97706; color: #78350F; max-width: 100%; white-space: normal; }
.dkdecbtn .dkdeck { display: inline-block; min-width: 22px; text-align: center; font-weight: 700; background: #FEF3C7; border-radius: 6px; margin-right: 4px; }
.dkdecbtn.dkdecdefault { border-color: #94A3B8; color: #334155; } .dkdecbtn.dkdecother { border-style: dashed; border-color: #94A3B8; color: #334155; }
.dkdecbtn:disabled { opacity: .5; }
.dkdecbtn:hover:not(:disabled), .dkdecbtn:focus-visible { background: #FEF3C7; border-color: #B45309; color: #78350F; }
.dkdecbtn.dkdecdefault:hover:not(:disabled), .dkdecbtn.dkdecother:hover:not(:disabled) { background: #F1F5F9; border-color: #64748B; color: #1E293B; }
/* My Desk regroup (08-Oct-2026): Questions for you (MCQ cards from the MacBook Air, the Mac mini and the Rx lanes) · To check · My tasks */
.dkask, .dklanes { margin-top: 14px; }
.dkgrouph { font-size: 16px; margin: 20px 0 8px; }

.dkqmacs { display: block; font-size: 12px; margin: -4px 0 8px; }
.dkqchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.dkqchip { min-height: 36px; padding: 4px 12px; border-radius: 18px; border: 1px solid #D3DCE5; background: #fff; color: #33414F; font-size: 13px; }
.dkqchip em { font-style: normal; font-weight: 700; margin-left: 2px; }
.dkqchip.on { background: #1b2733; border-color: #1b2733; color: #fff; }
.dkqchip:hover { background: #F1F5F9; border-color: #94A3B8; color: #1b2733; } .dkqchip.on:hover { background: #33414F; color: #fff; }   /* own hover: plain button:hover would paint dark on dark */
.dkqlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dkq { border: 1px solid #E3E8EE; border-left: 4px solid #94A3B8; border-radius: 10px; padding: 12px 14px; background: #fff; }
.dkq.urgent { border-left-color: #B42318; }
.dkq.done { background: #F7F9FB; }
.dkqtop { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 12px; }
.dkqsrc { font-weight: 700; border-radius: 6px; padding: 2px 8px; background: #EEF1F5; color: #334155; }
.dkqsrc.s-air { background: #DBEAFE; color: #1E40AF; } .dkqsrc.s-mini { background: #EDE9FE; color: #5B21B6; } .dkqsrc.s-lanes { background: #DCFCE7; color: #166534; }
.dkqurg { font-weight: 700; border-radius: 6px; padding: 2px 8px; background: #FDE8E8; color: #B42318; }
.dkqid { color: #64748B; overflow-wrap: anywhere; }
.dkqq { margin: 8px 0 4px; font-size: 15.5px; font-weight: 600; line-height: 1.45; color: #1b2733; }
.dkqwhy { font-size: 13px; color: #475569; margin: 2px 0 6px; }
.dkqwhy summary { cursor: pointer; color: #1D4ED8; }
.dkqwhy p { margin: 6px 0 0; line-height: 1.45; }
.dkqopts { display: grid; gap: 8px; margin-top: 10px; }
.dkqopt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; min-height: 48px; padding: 10px 12px; border: 1px solid #D3DCE5; border-radius: 10px; cursor: pointer; background: #fff; }
.dkqopt:hover { border-color: #94A3B8; }
.dkqopt input { position: absolute; opacity: 0; pointer-events: none; }
.dkqopt:focus-within { outline: 2px solid #2563EB; outline-offset: 1px; }
.dkqopt.on { border-color: #1D4ED8; background: #EFF6FF; box-shadow: inset 0 0 0 1px #1D4ED8; }
.dkqk { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid #94A3B8; color: #334155; font-size: 13px; }
.dkqopt.on .dkqk { background: #1D4ED8; border-color: #1D4ED8; color: #fff; }
.dkqol { display: grid; gap: 2px; line-height: 1.4; }
.dkqol b { font-weight: 600; font-size: 14.5px; }
.dkqol small { color: #5d6b7a; font-size: 12.5px; }
.dkqrec { font-style: normal; font-size: 11.5px; font-weight: 700; color: #166534; background: #DCFCE7; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.dkqnote { width: 100%; margin-top: 8px; font: inherit; }
.dkqact { display: flex; gap: 10px; margin-top: 10px; align-items: center; }
.dkqsave { min-height: 48px; padding: 0 22px; font-size: 16px; font-weight: 600; border-radius: 10px; }
.dkqsave:disabled { opacity: .45; }
.dkqlater { min-height: 44px; }
.dkqans { margin: 8px 0 0; font-size: 13.5px; color: #166534; }
.dkqchg { margin-left: 6px; font-size: 12.5px; background: none; border: 0; color: #1D4ED8; text-decoration: underline; padding: 0 4px; min-height: 0; font-weight: 400; }
.dkqchg:hover { background: none; color: #1E3A8A; }
.dkqmore { margin-top: 10px; min-height: 44px; }
.dkqfold { margin-top: 12px; }
.dkqfold summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: #475569; margin-bottom: 8px; }
.dkqfold summary em { font-style: normal; background: #EEF1F5; border-radius: 10px; padding: 0 8px; margin-left: 4px; }
@media (max-width: 600px) { .dkqopt { grid-template-columns: auto 1fr; } .dkqrec { grid-column: 2; justify-self: start; } .dkqact .dkqsave { flex: 1; } }
.dkdecnote { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; } .dkdecnote textarea { flex: 1; min-width: 0; font-size: 15px; }
.dklans.a-dec { color: #92400E; }
.dklans .dkdecchg { font-size: 12px; background: none; border: 0; color: #1D4ED8; text-decoration: underline; cursor: pointer; padding: 0 4px; }
@media (max-width: 600px) { .dkdecbtn { flex: 1 1 100%; } a.dkdecgo { margin-left: 0; } }
.dkcheck { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .55); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow: auto; }
.dkcheck[hidden] { display: none; }
.dkckbox { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; padding: 18px; display: grid; gap: 12px; margin-top: 4vh; }
.dkcktop { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.dkcktop { position: sticky; top: 0; background: #fff; margin: -18px -18px 0; padding: 12px 18px; border-radius: 14px 14px 0 0; border-bottom: 1px solid #E2E8F0; z-index: 1; }
.dkcktop .dkckx { margin-left: auto; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 16px; font-weight: 600; color: #0F172A; background: #F1F5F9; border: 1px solid #94A3B8; border-radius: 10px; cursor: pointer; padding: 0 14px; }
.dkcktop .dkckx:hover, .dkcktop .dkckx:focus-visible { background: #E2E8F0; outline: 2px solid #2563EB; outline-offset: 1px; }
.dkcheck { cursor: pointer; } .dkckbox { cursor: auto; }
body.dkckon { overflow: hidden; }
.dkckbox h2 { margin: 0; font-size: 20px; } .dkckwhy { margin: 0; color: #33414F; }
.dkckopen { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; font-size: 16px; }
.dkcksteps { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 16px; }
.dkcknote { font: inherit; font-size: 16px; padding: 8px; border: 1px solid #CBD5E1; border-radius: 8px; width: 100%; box-sizing: border-box; }
.dkckbtns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.dkckbtns .dklyes { background: #10B981; color: #fff; border-color: #10B981; } .dkckbtns .dklno { background: #fff; color: #B91C1C; border-color: #FCA5A5; }
.dkckbtns .dkcklater { background: #F1F5F9; color: #334155; border-color: #CBD5E1; }
@media (max-width: 600px) { .dkckbtns { grid-template-columns: 1fr; } .dkckbox { margin-top: 0; } }
.dklrow { display: grid; grid-template-columns: 190px minmax(120px, 1fr) 44px minmax(0, 1.3fr); gap: 10px; align-items: center; padding: 5px 0; border-top: 1px solid #F1F4F7; font-size: 13px; }
.dkln b { color: #64748B; margin-right: 4px; }
.dklbar { display: flex; gap: 2px; height: 12px; }
.dklbar i, .dklkey i { flex: 1; border-radius: 3px; display: inline-block; }
.dklpct { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.dklcur { color: #33414F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dklcur em { color: #64748B; font-style: normal; }
.dklkey { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: #64748B; }
.dklkey i { width: 10px; height: 10px; flex: none; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 600px) {
  .dklrow { grid-template-columns: 1fr 44px; }
  .dklrow .dklbar { grid-column: 1 / -1; grid-row: 2; }
  .dklrow .dklcur { grid-column: 1 / -1; white-space: normal; }
}

/* L8.2 patient link (rx-lanes lane 8, 07-Oct-2026): the patient's own page (phone first) and the staff page's tables */
main.plpage { max-width: 720px; }
.plvisit { border-top: 1px solid #d9e2e7; padding-top: 10px; margin-top: 14px; }
.plvisit h2 { font-size: 1.05rem; margin: 0 0 6px; }
.pltbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.pltbl th, .pltbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e6ecef; vertical-align: top; }
.pltbl th { font-weight: 600; color: #42545e; }
.plurl { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: .9rem; }
form.inline { display: inline; }
@media (max-width: 600px) { .pltbl { font-size: .88rem; } .pltbl th, .pltbl td { padding: 5px 4px; } }
/* L8.3 report upload by the patient: the "Send us a report" box (big phone targets) and the new rows on the staff page */
.puform input[type=file], .puform input[type=text] { width: 100%; max-width: 480px; font-size: 1rem; padding: 10px; box-sizing: border-box; }
.puform button { font-size: 1.05rem; padding: 12px 22px; min-height: 48px; }
.puform .ok { color: #157347; background: #e3f4e8; padding: 10px 12px; border-radius: 8px; }
.pusent { margin: 4px 0 0 18px; padding: 0; font-size: .92rem; }
tr.punew td { background: #fff8e6; }
/* L8.5 feedback after visit: 0–10 as big tap targets (no script: the radio sits under its number), and the score badge on the staff page */
.pfscale { border: 0; margin: 0; padding: 0; }
.pfscale legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.pfnums { display: flex; flex-wrap: wrap; gap: 6px; }
.pfn { position: relative; }
.pfn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pfn span { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border: 1px solid #b8c7cf; border-radius: 10px; font-size: 1.1rem; background: #fff; cursor: pointer; }
.pfn input:checked + span { background: #0b6e4f; border-color: #0b6e4f; color: #fff; font-weight: 600; }
.pfn input:focus-visible + span { outline: 3px solid #4d90fe; outline-offset: 2px; }
.pfends { display: flex; justify-content: space-between; max-width: 600px; }
.pfform textarea { width: 100%; max-width: 480px; font-size: 1rem; padding: 10px; box-sizing: border-box; }
.pfform button { font-size: 1.05rem; padding: 12px 22px; min-height: 48px; }
.pfform .ok { color: #157347; background: #e3f4e8; padding: 10px 12px; border-radius: 8px; }
.pfscore { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.pfscore.pfhappy { background: #e3f4e8; color: #157347; }
.pfscore.pfokay { background: #eef2f4; color: #42545e; }
.pfscore.pfunhappy { background: #fde8e8; color: #a61b1b; }
/* L8.4 After-surgery check-ins (ptlink.php pc_*): the answer choices reuse the .pfn buttons with words in them; the call-now line; amber flag */
.pcopt span { padding: 0 14px; }
.pcform .pfscale { margin-bottom: 14px; }
.pcwarn { background: #fff4e5; border-left: 4px solid #b45309; padding: 10px 12px; border-radius: 6px; }
.pfscore.pcamber { background: #fff4e5; color: #8a4b08; }
.pcbad { color: #a61b1b; }

/* L10.16 (Dr Shah 07-Oct-2026: "If I see a popup, I should be able to close it!"): the ✕ ui.js uiOverlay puts in the corner of every popup,
   dialog and panel — big enough to hit on a phone, always the same place. Headings leave room for it. */
/* :where() = no weight, so a panel that is already fixed / absolute (the Checks drawer #rail) keeps its own position (08-Oct-2026: the closed
   Checks panel had dropped into the page under the form, a cream strip showing beside the side menu) */
:where(.uixbox) { position: relative; }
/* 18-Oct-2026 (Dr Shah: "after adding a bundle the page scrolls to the top!"): the rule above beat the browser's own `position: fixed` for an
   open modal <dialog>, so every dialog sat at the top of the page and opening one scrolled the page up there. An open modal stays fixed. */
:where(dialog.uixbox:modal) { position: fixed; }
button.uix { position: absolute; top: 8px; right: 8px; z-index: 3; width: 40px; height: 40px; min-height: 0; padding: 0; margin: 0; display: grid; place-items: center;
  border: 1px solid #CFD8E0; border-radius: 50%; background: #fff; color: #1B2733; font: 600 18px/1 system-ui, sans-serif; box-shadow: none; cursor: pointer; }
button.uix:hover, button.uix:focus-visible { background: #EEF3F6; border-color: #8FA3B3; color: #1B2733; }
.uixbox > form > .dh, .uixbox > h2, .uixbox > h3, .uixbox > .modalh, .uixbox > .ppoph, .uixbox > .railh, .uixbox > form > h2 { padding-right: 50px; }
.ppop > button.uix { top: 4px; right: 4px; width: 32px; height: 32px; font-size: 15px; }
body:not(.drawer) #ptpanel > button.uix, body:not(.checks) #rail > button.uix { display: none; }
@media print { button.uix { display: none !important; } }

/* L10.17 Save must visibly do something (Dr Shah 07-Oct-2026): ui.js uiNote / uiSaveBtn. Lines come in at the top, under the top bar;
   green ones go by themselves, red ones stay until ✕. The Save button turns grey "Saving…" then green "✓ Saved hh:mm". */
.uinotes { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px;
  width: min(620px, calc(100vw - 32px)); pointer-events: none; }
.uinote { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px 11px 16px; border-radius: 12px;
  font-size: 15px; font-weight: 600; line-height: 1.35; box-shadow: 0 8px 24px #0f2a3a2e; animation: uinote-in .18s ease-out; }
.uinote.ok { background: #1d7a3a; color: #fff; }
.uinote.err { background: #fdecea; color: #8c1d18; border: 2px solid #b3261e; }
.uinote.info { background: #0b2a3a; color: #fff; }
.uinote .uintext { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.uinote .uinx { flex: none; min-height: 0; width: 30px; height: 30px; padding: 0; margin: -4px -2px -4px 0; border-radius: 50%; border: 0;
  background: transparent; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; opacity: .85; }
.uinote .uinx:hover, .uinote .uinx:focus-visible { opacity: 1; background: #ffffff33; }
.uinote.err .uinx:hover, .uinote.err .uinx:focus-visible { background: #b3261e1f; }
@keyframes uinote-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
button.uisaving { opacity: .7; cursor: progress; }
button.uisaved, button.ghost.uisaved { background: #1d7a3a !important; border-color: #1d7a3a !important; color: #fff !important; }
@media (max-width: 600px) { .uinotes { top: 56px; } .uinote { font-size: 14px; } }
@media print { .uinotes { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .uinote { animation: none; } }
/* L10.18 Copy icon (Dr Shah 07-Oct-2026): one small button beside a UHID, mobile, email or link (ui.js uiCopyHtml / ui.php ui_copy). The icon is
   drawn here (a mask), so the button needs no script to look right; pressing it turns it into a green tick for 1 s. 26px on a PC, 34px on a phone. */
button.uicopy { display: inline-grid; place-items: center; vertical-align: middle; width: 26px; height: 26px; min-height: 0; min-width: 0; padding: 0;
  margin: -3px 0 -3px 4px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #5d6b7a; cursor: pointer; flex: none; box-shadow: none; position: relative; }
button.uicopy::before { content: ''; width: 15px; height: 15px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11' rx='2'/%3E%3Cpath d='M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11' rx='2'/%3E%3Cpath d='M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1'/%3E%3C/svg%3E") center / contain no-repeat; }
button.uicopy:hover, button.uicopy:focus-visible { background: #E8EEF4; border-color: #D5DCE3; color: var(--accent, #0f6e8c); }
button.uicopy:focus-visible { outline: 2px solid var(--accent, #0f6e8c); outline-offset: 1px; }
button.uicopy.uicopied { background: #e6f4ea; border-color: #8cc8a0; color: #1d7a3a; }
button.uicopy.uicopied::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E"); }
button.uicopy.uicopied::after { content: 'Copied'; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 5; pointer-events: none;
  padding: 2px 7px; border-radius: 6px; background: #1d7a3a; color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }   /* a bubble above: nothing beside it moves */
button.uicopy.uicopyno { background: #fdecea; border-color: #b3261e; color: #b3261e; }
.ptbar button.uicopy, .ptnavwho button.uicopy { margin-left: 2px; }
p:has(> .plurl) { display: flex; align-items: center; gap: 4px; } p:has(> .plurl) > .plurl { flex: 1 1 auto; min-width: 0; }
@media (max-width: 600px) { button.uicopy { width: 34px; height: 34px; margin: -6px 0 -6px 2px; } button.uicopy::before { width: 17px; height: 17px; } }
@media print { button.uicopy { display: none !important; } }

/* ---------- L10.7 Notifications centre (/?p=inbox, notif.php): the count in the menu, the list (New / Seen), the admin card ---------- */
.snav a .ncount, .ntgl .ncount { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #b3261e; color: #fff; font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center; }
.ntgl .ncount { margin-left: 6px; display: inline-block; vertical-align: 2px; }
.smenu .ndot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #b3261e; box-shadow: 0 0 0 2px #fff; }
.ntpage .phead { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; } .ntpage .phead > div { flex: 1; min-width: 220px; }
.ntform { display: inline-block; margin: 0; } .ntas { margin-top: 6px; } .ntas select { max-width: 240px; }
.ntnote { padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; font-weight: 600; } .ntnote.ok { background: #e7f5ec; color: #1d5e33; } .ntnote.err { background: #fdecea; color: #8c1d18; }
.ntadmin { margin-bottom: 14px; } .ntadmin p { margin: 0 0 8px; }
.ntgl { font-size: 13px !important; text-transform: uppercase; letter-spacing: .06em !important; color: #5d6b7a; margin: 18px 0 6px; }
.ntlist { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid #E3E8EE; border-radius: 12px; overflow: hidden; }
.ntrow { display: flex; align-items: center; border-top: 1px solid #EEF1F5; } .ntrow:first-child { border-top: 0; }
.ntrow > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: #33414F; text-decoration: none; min-height: 48px; }
.ntrow > a:hover, .ntrow > a:focus-visible { background: #F3F5F8; }
.ntic { width: 20px; height: 20px; flex: none; fill: none; stroke: #5d6b7a; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ntw { flex: 1; min-width: 0; } .ntw b { display: block; font-weight: 600; overflow-wrap: anywhere; } .ntw small { display: block; color: #5d6b7a; font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.ntrow time { flex: none; color: #626F7B; font-size: 12px; white-space: nowrap; }
.ntnew > a { box-shadow: inset 3px 0 0 #b3261e; } .ntnew .ntic { stroke: #b3261e; }
.ntold .ntw b { font-weight: 400; color: #5d6b7a; }
.ntseen { margin-right: 10px; padding: 4px 10px; font-size: 12.5px; }
.ntempty { padding: 18px; background: #fff; border: 1px dashed #D5DCE3; border-radius: 12px; color: #5d6b7a; text-align: center; }
.ntfoot { margin-top: 14px; font-size: 12.5px; }
@media (max-width: 600px) { .ntrow > a { padding: 12px 10px; gap: 10px; } .ntrow time { display: none; } }

/* ---------- L10.14 tabs inside the app: the strip of open pages (ui.php ui_tabs, filled by ui.js) ---------- */
.apptabs { display: flex; align-items: flex-end; gap: 4px; padding: 6px 14px 0; background: #E9EEF3; border-bottom: 1px solid #D5DDE5; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.apptabs[hidden] { display: none; }
.atabw { display: flex; align-items: center; flex: 0 1 auto; min-width: 72px; max-width: 230px; background: #DCE3EA; border: 1px solid #CFD8E1; border-bottom: 0; border-radius: 8px 8px 0 0; }
.atabw:hover { background: #E6ECF1; }
.atabw.on { background: #fff; border-color: #D5DDE5; box-shadow: inset 0 3px 0 #0F8C82; position: relative; top: 1px; }
.atab { flex: 1; min-width: 0; padding: 8px 2px 8px 12px; font-size: 13px; line-height: 18px; color: #33414F; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atabw.on .atab { color: #0F2233; font-weight: 600; }
.atab:focus-visible, .atx:focus-visible { outline: 2px solid #0F8C82; outline-offset: -2px; }
button.atx { flex: none; width: 26px; height: 26px; min-height: 0; margin: 0 4px; padding: 0; border: 0; border-radius: 6px; background: none; color: #475569; font-size: 12px; line-height: 26px; cursor: pointer; }
button.atx:hover { background: #C9D3DD; color: #0F2233; }
@media (max-width: 1024px) {   /* phones: the strip sits beside Menu + Back and scrolls sideways */
  .apptabs { min-height: 58px; padding: 12px 8px 0 160px; }
  body.hasside:has(.apptabs:not([hidden])) main.home { padding-top: 10px; }
  .atabw { max-width: 170px; }
  .atab { padding: 11px 2px 11px 10px; }
  button.atx { width: 32px; height: 32px; }
}
body.qtvmode .apptabs { display: none; }
@media print { .apptabs { display: none !important; } }
/* Sign-in screen (08-Oct-2026): Settings shows a "Forgot password?" ask / a locked login under the name; the one-time fingerprint offer
   on a phone after a password sign-in (passkey.js data-mode="offer") */
.setask { display: block; margin-top: 3px; color: #92400E; font-weight: 600; }
.pkoffer { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: #0F2233; color: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 8px 30px #0f223340; }
.pkoffer p { flex: 1 1 100%; margin: 0; font-size: 15px; }
.pkoffer .pkofferyes { background: #0F8C82; color: #fff; text-decoration: none; font-weight: 600; padding: 10px 18px; border-radius: 9px; }
.pkoffer .pkofferno { background: transparent; border: 1px solid #5B6F7E; color: #DCE6EE; padding: 9px 16px; border-radius: 9px; min-height: 0; }

/* D3 menu cap (08-Oct-2026): the Search everything box at the top of the menu, and the tab strip of a page that shares a menu item */
.sfind { margin: 4px 0 8px; }
.side .snav .sfind input[type=search] { width: 100%; box-sizing: border-box; font-size: 16px !important; padding: 8px 10px; border: 1px solid #D5DDE5; border-radius: 8px; background: #fff; min-height: 40px; }
@media (min-width: 1025px) { .side.srail:not(:hover):not(:focus-within) .sfind { display: none; } }
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding: 0 0 2px; scrollbar-width: thin; }
.subtabs a { flex: none; padding: 9px 14px; min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; border-radius: 999px; background: #EEF2F5; color: #33414F; text-decoration: none; font-weight: 600; font-size: 14px; }
.subtabs a.on { background: var(--a-l, #E3F2F0); color: var(--a-d, #0B5F58); box-shadow: inset 0 0 0 1.5px var(--a, #0F8C82); }
@media print { .subtabs, .sfind { display: none !important; } }

/* ======================================================================================================================================
   PHONE LAYER (MOBILE_RCA_CAPA.md A1/A3, 08-Oct-2026: "the app breaks on a phone"). The ONE place for behaviour every screen shares on a phone.
   Three widths only: phone <= 600 px · tablet 601–1024 px · desktop >= 1025 px (test_layout_rules.js refuses any other width).
   test_phone_gate.js checks every page in real Chrome at 360 / 390 / 768 / 1366 px; deploy.sh refuses when it fails.
   ====================================================================================================================================== */
/* every table in its own sideways-scroll box (fields.js RxField.tableBox wraps them): a wide table scrolls, the page never widens */
.tbox { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
@media print { .tbox { overflow: visible; } }
/* nothing in a grid / flex column may force the page wider than the screen */
main, section, .card, .hcard, .bsec, .sec { min-width: 0; }
img, svg, video, canvas { max-width: 100%; }
/* Dr Shah's review screens (handouts, codes, medicines, tests, warnings, prompts, letters): the filter row wraps; a card column never forces width */
.hofilter { flex-wrap: wrap; row-gap: 8px; } .hofilter input[type=search] { max-width: 100%; }
.hocard > *, .hogrid > * { min-width: 0; } .hocolh { flex-wrap: wrap; gap: 6px; }
select { max-width: 100%; }
.promptreview .prow { grid-template-columns: minmax(0, 1fr); } .promptreview .prow > * { min-width: 0; }
.hoacts { flex-wrap: wrap; } .hoacts .rxtest { flex: 1 1 200px; min-width: 0; }
code, kbd, samp { overflow-wrap: anywhere; }
@media (max-width: 1024px) { .hogrid, .hocard { grid-template-columns: minmax(0, 1fr); } }
/* touch screens have no keyboard: no Ctrl / Alt key hints */
@media (pointer: coarse) { kbd, header.top .keys { display: none !important; } }
/* the side menu, when slid away, is out of reach — and out of the keyboard's Tab order */
@media (max-width: 1024px) {
  body:not(.sopen) .side { visibility: hidden; transition: transform .18s ease, visibility 0s linear .18s; }
  body.sopen .side { visibility: visible; transition: transform .18s ease; }
  .atabw { flex: none; }   /* open tabs keep their names ("Queue", not "Q…") — the strip scrolls sideways instead */
  /* the open-tabs strip sits on its own row UNDER Menu + Back, full width — the floating buttons never cover a tab, even scrolled */
  .apptabs { padding: 62px 8px 0; min-height: 0; }
  body.hasside:not(:has(.apptabs:not([hidden]))) main.home, body.hasside:not(:has(.apptabs:not([hidden]))) main.desk { padding-top: 64px; }
  body.hasrail header.top { padding-left: 10px; }
  body.hasrail:not(:has(.apptabs:not([hidden]))) header.top { margin-top: 62px; }
}
/* Report / Suggest never sits on the Rx save bar (bugbtn.js puts it bottom-right; html … out-ranks its own rule) */
html body:has(.savebar) #rxbugbtn { bottom: 76px; } html body:has(.envbar):has(.savebar) #rxbugbtn { bottom: 106px; }
/* the Rx screen's patient drawer, when slid away, likewise */
body.haspt:not(.drawer) aside.left, body:not(.checks) .rail { visibility: hidden; transition: transform .18s ease, visibility 0s linear .18s; }
@media (max-width: 600px) { .rail { width: min(340px, 92vw); } }
@media (max-width: 600px) {
  /* typing boxes: 16 px text, so the iPhone does not zoom in on a tap */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea, .rxf-in { font-size: 16px !important; }
  /* buttons at least 44 px tall: a finger, not a mouse pointer */
  button, .btn, input[type=submit], input[type=button], a[role=button] { min-height: 44px !important; }
  button.atx { width: 44px; height: 44px; }
  a.btn { display: inline-flex; align-items: center; }   /* an inline link styled as a button: min-height needs a box */
  .smenu, .smback { height: 44px; min-height: 44px; } .smenu { width: 44px; }
  /* TEST / LOCAL bar: one line on a phone; Report / Suggest stays above it */
  .envbar { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; font-size: 12px; }
  /* the save bar spans the whole width at the bottom of the screen; the form keeps room for it */
  .savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; border-radius: 0; border-width: 1px 0 0; height: auto !important;
    flex-wrap: wrap !important; padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)) !important; gap: 6px; }
  body:has(.envbar) .savebar { bottom: 28px; }
  .savebar .sbstat { flex: 1 0 100%; height: auto; min-height: 18px; }
  .savebar button, .savebar .langin select, .savebar .lhsel select { height: 44px !important; flex: 1 1 auto; }
  .savebar .langin, .savebar .lhsel { flex: 1 1 auto; } .savebar .langin select, .savebar .lhsel select { width: 100%; }
  body:has(.savebar:not([hidden])) main.app { padding-bottom: 170px; }
  html body:has(.savebar:not([hidden])) #rxbugbtn { bottom: 178px; } html body:has(.envbar):has(.savebar:not([hidden])) #rxbugbtn { bottom: 206px; }
  /* Rx form: the patient bar groups and the identity row wrap; the Contact & DOB toggle takes the full width */
  .tabs .orgbar { min-width: 0; flex-basis: 100%; }
  .pbg { flex-wrap: wrap; } .secpair { white-space: normal; flex-wrap: wrap; min-width: 0; }
  .demotgl { width: 100%; flex: 1 1 100%; height: auto; min-height: 44px; }
  body.haspt aside.left { width: min(330px, 88vw); }
}
/* L4.2b My desk → Automations: one line per scheduled task (desk.js paintAuto) */
.dkauto { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; margin: 0 0 6px; background: #fff; border: 1px solid #E3E8EE; border-radius: 10px; }
.dkauto.fail { border-left: 3px solid #E5484D; } .dkauto.needs-input { border-left: 3px solid var(--a, #0F8C82); }
.dkautot { font-weight: 600; overflow-wrap: anywhere; } .dkautom { color: #5d6b7a; font-size: 13px; }
/* Data freshness (20-Oct-2026): "Updated 20 Oct, 7:40 pm (3 h ago) · from Mac mini" at the top of a section (ui.js uiFreshHtml / ui.php ui_fresh). */
.uifresh { font-size: 12.5px; color: var(--muted, #5b6b78); margin: 2px 0 8px; line-height: 1.35; overflow-wrap: anywhere; }
.uifresh.stale { color: #9a4a00; font-weight: 600; }
.uifresh + .uifresh { margin-top: -6px; }

/* About this section (Dr Shah 20-Oct-2026): a closed panel at the top of every section (ui.php ui_about_html, placed by ui.js). The press target is
   44 px tall (UI_STANDARD U3.1); the open panel wraps inside the page (never wider than its box, U4.1). */
.uiabout { margin: 0 0 10px; max-width: 100%; min-width: 0; grid-column: 1 / -1; }
/* 31-Oct-2026 (Dr Shah: "only the 'i' button instead of the text About this — this will save space"): the pill is the round 'i' alone; 44 px on a phone. */
.uiabout > summary { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid #cbd5de; border-radius: 50%;
  background: #fff; color: #334155; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; user-select: none; }
.uiabout > summary::-webkit-details-marker { display: none; }
.uiabout > summary:hover, .uiabout[open] > summary { border-color: #0F8C82; color: #0B5F58; background: #E3F4F2; }
.uiabout > summary:focus-visible { outline: 2px solid #0F8C82; outline-offset: 2px; }
.uiab-i { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #0F8C82; color: #fff; font: italic 700 14px/1 Georgia, serif; }
.uiab-body { margin-top: 8px; padding: 14px 16px; background: #fff; border: 1px solid #e3e9ef; border-left: 4px solid #0F8C82; border-radius: 12px; max-width: 900px;
  font-size: 15px; line-height: 1.5; color: #1f2937; overflow-wrap: anywhere; }
.uiab-body h2 { margin: 0 0 6px; font-size: 18px; }
.uiab-body h3 { margin: 12px 0 4px; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: #0B5F58; }
.uiab-body ul, .uiab-body ol { margin: 0; padding-left: 22px; }
.uiab-body li { margin: 2px 0; }
.uiab-body p { margin: 4px 0; }
.uiab-bugs { color: #9a4a00; }
.uiab-foot { margin-top: 12px !important; font-size: 13px; color: var(--muted, #5b6b78); }
@media print { .uiabout { display: none !important; } }
/* "About this" on each part of the visit screen (OVERHAUL_2026-10-23 item 1; ui.js uiSecAbout). A small pill in the part's header line; its text
   floats over the form (position: fixed, placed by ui.js), so opening it never moves anything. On a phone the pill is 44 px and the text a
   sheet at the bottom of the screen. */
.secabout { display: inline-block; flex: 0 0 auto; font-size: 13px; font-weight: 600; line-height: 1.2; text-transform: none; letter-spacing: 0; }
.secabout > summary { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid #cbd5de; border-radius: 50%;
  background: #fff; color: #475569; cursor: pointer; list-style: none; user-select: none; white-space: nowrap; }
.secabout > summary::-webkit-details-marker { display: none; }
.secabout > summary:hover, .secabout[open] > summary { border-color: #0F8C82; color: #0B5F58; background: #E3F4F2; }
.secabout > summary:focus-visible { outline: 2px solid #0F8C82; outline-offset: 2px; }
.secabout .uiab-i { width: 20px; height: 20px; font-size: 13px; }
.secabout > .uiab-body { position: fixed; z-index: 60; margin: 0; max-height: min(70vh, 560px); overflow: auto; font-weight: 400; font-size: 14px;
  box-shadow: 0 10px 30px #0f2a3a33; overscroll-behavior: contain; }
.secabout > .uiab-body h2 { font-size: 16px; }
.banner > .secabout { float: right; margin: 0 0 4px 10px; }
.sugpanel > .secabout { margin: 0 0 6px; }
@media (max-width: 600px) {
  .secabout > summary, .uiabout > summary { width: 44px; height: 44px; }
  .secabout > .uiab-body { max-height: 70vh; }
}
@media print { .secabout { display: none !important; } }

/* ---------- home-screen apps (ui.php rx_solo_apps, 26-Oct-2026): To Do, Daily Quiz, Idea of the Day, Knowledge Base — one bar, no side menu ---------- */
body.solo.hasside { padding-left: 0 !important; }
body.solo.hasside main.home, body.solo.hasside main.desk, body.solo.hasside main { padding-top: 14px !important; }
.solobar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: #fff; border-bottom: 3px solid var(--solo, #0f6e8c); box-shadow: 0 2px 8px #0f22330f; }
.solobar .soloback { display: flex; align-items: center; gap: 4px; height: 44px; min-width: 44px; box-sizing: border-box; padding: 0 10px 0 6px; border-radius: 9px; border: 1px solid #E3E8EE;
  color: #0F2233; text-decoration: none; font-weight: 600; font-size: 14px; }
.solobar .soloname { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; color: #0F2233; text-decoration: none; font-weight: 700; font-size: 17px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.solobar .soloname img { flex: none; border-radius: 7px; }
.solobar .soloout { display: grid; place-items: center; width: 44px; height: 44px; box-sizing: border-box; border-radius: 9px; border: 1px solid #E3E8EE; color: #475569; }
.solobar .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.solo .subtabs, body.solo .dtabs { display: none; }
body.solo.solomods .subtabs { display: flex; }   /* 5 front doors (22-Nov-2026): in Harsh Professional / Personal a page with no tab bar keeps its own section row */
.solocrumb { margin: 6px 16px 0; }
/* 27-Oct-2026 (Dr Shah: "Proper separate UI on desktop app"): on a computer a home-screen app takes the wide window; its own tabs / rail sit inside it */
/* Per-app accent (22-Nov-2026, OVERHAUL_5_APPS P1 add-on). ONE variable, --app-accent, set on <body> by shell.php from the app's solo
   "color" (mod_l20_apps.json / mod_l20.json) — never in a page's CSS. The base (layout, fonts, backgrounds) is the same in all five apps;
   only these rules read it. The shell is light-only (UI_STANDARD U11.10), and every accent carries white text at >= 4.5:1 (test_app_accents.js). */
body.solo { --solo: var(--app-accent); --solo-d: var(--app-accent); --accent: var(--app-accent);
  --accent-d: color-mix(in srgb, var(--app-accent) 80%, #000); --accent-2: color-mix(in srgb, var(--app-accent) 10%, #fff); }
body.solo .solobar { background: color-mix(in srgb, var(--app-accent) 6%, #fff); border-bottom-color: var(--app-accent); }
body.solo #solonav a.on, body.solo #solonav a.on .ic { color: var(--app-accent); }
body.solo .subtabs a.on { background: var(--app-accent); color: #fff; box-shadow: none; }
@media (min-width: 1025px) { body.solo main.home { max-width: 1600px; padding-left: 32px; padding-right: 32px; } body.solo .solobar { padding-left: 24px; padding-right: 24px; } }
/* the Idea of the Day page (?p=idea, mydesk.php mydesk_idea_page) — a reading page: one column, large calm type */
.ideapage { max-width: 720px; margin: 0 auto; }
.idcard { background: #fff; border: 1px solid #E3E8EE; border-radius: 14px; padding: 22px 22px 18px; }
.idcard h1 { margin: 2px 0 6px; font-size: 24px; line-height: 1.25; color: #0F2233; }
.iddate { margin: 0; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: #8a5200; font-weight: 600; }
.idbody p { margin: 0 0 14px; font-size: 17px; line-height: 1.7; color: #1e293b; }
.idcard .mdact { margin: 6px 0 14px; font-size: 16px; }
.idmore { margin: 0 0 10px; border-top: 1px solid #eef2f6; padding-top: 10px; } .idmore summary { cursor: pointer; font-weight: 600; color: #0F2233; }
.idmore p { margin: 8px 0; font-size: 15.5px; line-height: 1.65; color: #334155; }
.idlist { margin-top: 18px; background: #fff; border: 1px solid #E3E8EE; border-radius: 14px; padding: 14px 18px; } .idlist h2 { margin: 0 0 6px; font-size: 16px; }
.idlist li a { display: flex; flex: 1; gap: 10px; align-items: baseline; justify-content: space-between; color: inherit; text-decoration: none; }
@media (max-width: 600px) { .idcard { padding: 16px 14px; border-radius: 12px; } .idcard h1 { font-size: 21px; } .idbody p { font-size: 16.5px; } }

/* ---------- 28-Oct-2026 nav redesign (Dr Shah 27-Oct-2026: best-in-market menus + search; phone and desktop laid out differently) ---------- */
/* wide screens: folding group headers, the lit item's own pages nested under it, a breadcrumb, Search everything opens the ⌘K palette */
.sgl { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 20px); min-height: 0; padding: 0; background: none; border: 0; box-shadow: none; cursor: pointer; text-align: left; font-family: inherit; }
.sgl::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: 0 4px 3px 0; transition: transform .12s ease; }
.sgl:hover { color: #33414F; background: none; } .sgl:focus-visible { outline: 2px solid #0F8C82; outline-offset: 2px; }
.sgrp.shut .sgl::after { transform: rotate(-45deg); margin-bottom: 0; }
.sgrp.shut .sgi { display: none; }
.snav .ssub { margin: 2px 0 6px 28px; padding-left: 8px; border-left: 1.5px solid #E3E8EE; }
.snav .ssub a { padding: 6px 10px; font-size: 13px; font-weight: 500; color: #5d6b7a; }
.snav .ssub a.on { color: var(--a-d, #0B6B63); font-weight: 700; background: none; box-shadow: inset 2px 0 0 var(--a, #0F8C82); border-radius: 0 8px 8px 0; }
.sfind { position: relative; } .sfind .skbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px/1 inherit; color: #626F7B; border: 1px solid #E3E8EE; border-radius: 5px; padding: 3px 5px; pointer-events: none; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 13px; color: #5D6B7A; } .crumb span { color: #A3AEB8; }
.crumb span[aria-current] { color: #0F2233; font-weight: 600; }   /* 03-Nov-2026: where he is now reads darkest, not the palest step */
.psrch, .btabs { display: none; }
@media (min-width: 1025px) {
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .ssub, .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .skbd { display: none; }
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .sgl::after { display: none; }
  .side.srail:is(:not(:hover):not(:focus-within), .snopeek) .sgrp.shut .sgi { display: block; }
  /* Dr Shah 03-Nov-2026 ("all laptops have so much space horizontally … the submenu & sub-submenu can lie there"): on a computer the lit
     item's pages are the tab row across the top of the page (#subtabs), the page's own views the row under it (.pgnav) — not a list in the menu */
  body.hasside .side .ssub { display: none; }
  .crumb { font-size: 14px; margin: 0 0 10px; } .crumb a { color: #3B4A57; text-decoration: none; } .crumb a:hover { text-decoration: underline; }
  .subtabs { margin-bottom: 10px; }
}
/* wide screens use the width: list and grid pages grow to 1600 px (reading text keeps its own measure, rl.css) */
@media (min-width: 1280px) {
  body #kb, body #rr, body #oa, body #staffwork, body #blocks, body #ekb, body #logbook, body #srtop, body #srpane { max-width: 1600px; }
}
/* tablets and wide screens: the page's own tabs are an underline row, not pills */
@media (min-width: 601px) {
  .subtabs { gap: 2px; border-bottom: 1px solid #E3E8EE; padding: 0; }
  .subtabs a { border-radius: 0; background: none; padding: 9px 12px; color: #5d6b7a; box-shadow: inset 0 -2px 0 transparent; }
  .subtabs a:hover { color: #0F2233; background: #F3F5F8; }
  .subtabs a.on { background: none; color: var(--a-d, #0B5F58); box-shadow: inset 0 -2.5px 0 var(--a, #0F8C82); }
  .subtabs .subsel { display: none; }
}
/* phones: a bottom tab bar, the menu as a full-screen sheet behind More, search where the Menu button was, no wrapping pills */
@media (max-width: 600px) {
  body:has(#btabs) { --btabs-h: calc(58px + env(safe-area-inset-bottom)); padding-bottom: var(--btabs-h); }
  .btabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; height: var(--btabs-h); padding: 4px 2px env(safe-area-inset-bottom);
    background: #ffffffF2; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid #E3E8EE; box-sizing: border-box;
    width: min(100vw, 100%); right: auto; }   /* UX-56: the screen's width, never the page's (a page wider than the phone pushed More off the right edge at 390) */
  .btabs a, .btabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; min-width: 0; padding: 2px; margin: 0; background: none; border: 0; box-shadow: none;
    color: #5D6B7A; text-decoration: none; font: 600 11px/1.1 inherit; border-radius: 10px; cursor: pointer; }
  .btabs span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btabs .ic { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .btabs a.on { color: #0B6B63; } .btabs a.on .ic { stroke-width: 2.3; }
  body.kbup .btabs, body.qtvmode .btabs, body.sopen .btabs { display: none; }
  body:has(#btabs) .smenu { display: none; }
  body:has(#btabs) .smback { left: 62px; height: 44px; }
  body:has(#btabs) .psrch { display: grid; place-items: center; position: fixed; top: 10px; left: 10px; z-index: 45; width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 10px;
    background: #fff; border: 1px solid #E3E8EE; color: #0F2233; box-shadow: 0 2px 8px #0f22331a; }
  .psrch .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  body.sopen .psrch { display: none; }
  body:has(#btabs) .side { width: 100%; border-right: 0; }
  body:has(#btabs) .savebar, body:has(#btabs) .tpeacts { bottom: var(--btabs-h); }
  body:has(#btabs) .htoast { bottom: calc(var(--btabs-h) + 14px); }
  body:has(#btabs) .hnav { display: none; }
  body:has(#btabs) .envbar { bottom: var(--btabs-h); }
  .crumb { display: none; }
  .subtabs.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; background: #EEF2F5; border-radius: 12px; overflow: visible; }
  .subtabs.seg a { justify-content: center; text-align: center; padding: 6px 6px; border-radius: 9px; background: none; font-size: 13px; line-height: 1.2; white-space: normal; box-shadow: none; }
  .subtabs.seg a.on { background: #fff; color: #0F2233; box-shadow: 0 1px 3px #0f223326; }
  .subtabs.many a { display: none; }
  body:has(#btabs) .subtabs.many { margin-top: 10px; }   /* Section ▾ sits 8+ px under the fixed Back / search / Report buttons (UX-M1, Eka @360) */
  .subtabs.many .subsel { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 0 14px; border-radius: 12px; background: #EEF2F5; border: 0; box-shadow: none; color: #33414F; font: 600 14px/1.2 inherit; justify-content: flex-start; }
  .subtabs.many .subsel span { margin-left: auto; }
}
/* Kaizen step 1 §4 ADD 3 (28-Oct-2026): a home-screen app's own sections (ui.php rx_solo_nav) — a bottom bar on phones and tablets, a left rail on a
   computer; never hidden on scroll, only while the keyboard is up. Not #btabs: the full app's shell rules (body:has(#btabs)) stay off. */
@media (max-width: 1024px) {
  body.solo:has(#solonav) { --sn-h: calc(58px + env(safe-area-inset-bottom)); padding-bottom: var(--sn-h); }
  .btabs.solonav { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; height: var(--sn-h); padding: 4px 2px env(safe-area-inset-bottom);
    background: #ffffffF2; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid #E3E8EE; box-sizing: border-box;
    width: min(100vw, 100%); right: auto; }   /* UX-56: the screen's width, never the page's (a page wider than the phone pushed More off the right edge at 390) */
  body.solo:has(#solonav) .savebar, body.solo:has(#solonav) .envbar { bottom: var(--sn-h); }
  body.solo:has(#solonav):has(.envbar) .savebar { bottom: calc(var(--sn-h) + 28px); }
  /* Report / Suggest rides above the tab bar (and the TEST / LOCAL bar, and a save bar) — phone gate solo-idea @360/390 */
  html body.solo:has(#solonav) #rxbugbtn { bottom: calc(var(--sn-h) + 14px); }
  html body.solo:has(#solonav):has(.envbar) #rxbugbtn { bottom: calc(var(--sn-h) + 40px); }
  html body.solo:has(#solonav):has(.savebar:not([hidden])) #rxbugbtn { bottom: calc(var(--sn-h) + 120px); }
  html body.solo:has(#solonav):has(.envbar):has(.savebar:not([hidden])) #rxbugbtn { bottom: calc(var(--sn-h) + 148px); }
}
@media (min-width: 1025px) {
  body.solo.hasside:has(#solonav) { padding-left: 88px !important; }
  .btabs.solonav { display: flex; flex-direction: column; gap: 6px; position: fixed; left: 0; top: 63px; bottom: 0; z-index: 39; width: 88px; padding: 12px 6px; box-sizing: border-box;
    background: #fff; border-right: 1px solid #E3E8EE; }
}
.solonav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; min-width: 0; padding: 4px 2px; margin: 0;
  color: #5D6B7A; text-decoration: none; font: 600 11.5px/1.15 inherit; border-radius: 10px; text-align: center; }
.solonav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.solonav .ic { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.solonav a.on { color: var(--solo-d, #0F2233); } .solonav a.on .ic { stroke-width: 2.3; color: var(--solo, #0f6e8c); }
@media (min-width: 1025px) { .solonav a { min-height: 64px; } .solonav a:hover { background: #F3F5F8; } .solonav a.on { background: #F3F5F8; } .solonav span { white-space: normal; } }
.solonav .snbadge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
  background: #c62828; color: #fff; font: 700 11px/18px inherit; text-align: center; }
.solonav a:focus-visible { outline: 2px solid var(--solo, #0f6e8c); outline-offset: -2px; }
body.kbup .btabs.solonav { display: none; }
/* the ⌘K palette and the bottom sheet (ui.js) */
dialog.cmdk { width: min(640px, calc(100% - 32px)); max-height: min(560px, 76vh); margin: 12vh auto auto; padding: 0; border: 1px solid #E3E8EE; border-radius: 14px; box-shadow: 0 24px 60px #0f223340; overflow: hidden; }
dialog.cmdk::backdrop, dialog.bsheet::backdrop { background: #0f223359; }
.cmdk form { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #EEF1F5; }
.cmdk input { flex: 1; border: 0; outline: 0; font-size: 17px; min-height: 44px; padding: 0; background: none; box-shadow: none; }
.cmdk .ckres { max-height: calc(min(560px, 76vh) - 70px); overflow-y: auto; padding: 6px; }
.cmdk h3 { margin: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #626F7B; }
.cmdk a { display: flex; align-items: baseline; gap: 10px; padding: 9px 10px; min-height: 44px; box-sizing: border-box; border-radius: 9px; color: #0F2233; text-decoration: none; }
.cmdk a small { margin-left: auto; color: #626F7B; font-size: 12px; white-space: nowrap; } .cmdk a em { color: #5D6B7A; font-style: normal; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk a.sel, .cmdk a:hover { background: #E3F4F2; }
.cmdk .ckfoot { padding: 8px 14px; border-top: 1px solid #EEF1F5; color: #626F7B; font-size: 12px; } .cmdk .ckempty { padding: 18px 12px; color: #5D6B7A; }
dialog.bsheet { width: 100%; max-width: 560px; margin: auto auto 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); border: 0; border-radius: 16px 16px 0 0; max-height: 80vh; overflow-y: auto; }
.bsheet h3 { margin: 8px 12px 6px; font-size: 15px; } .bsheet a, .bsheet .bsrow { display: flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 10px; color: #0F2233; text-decoration: none; font-weight: 600; }
.bsheet a.on { background: #E3F4F2; color: #0B6B63; } .bsheet a::after { content: '›'; margin-left: auto; color: #A3AEB8; font-size: 20px; }
@media (max-width: 600px) { dialog.cmdk { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border-radius: 0; border: 0; } .cmdk .ckres { max-height: calc(100vh - 110px); } .sfind .skbd { display: none; } }
/* 28-Oct-2026 UX-29 (a): a page's own tab row (role=tablist: medicines, investigations, links, appointments, waiting list …) is one sideways row on a phone,
   never a wall of pills; the segmented Knowledge base books, the Bundles kinds and the app's #subtabs have their own phone forms */
@media (max-width: 600px) {
  [role=tablist]:not(.kbtabs):not(.tpekinds):not(.subtabs) { display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; }
  [role=tablist]:not(.kbtabs):not(.tpekinds):not(.subtabs)::-webkit-scrollbar { display: none; }
  [role=tablist]:not(.kbtabs):not(.tpekinds):not(.subtabs) > * { flex: 0 0 auto; white-space: nowrap; }
}

/* ---------- R2 (Dr Shah 28-Oct-2026): the one patient header + Next step bar (ui.js uiPtHeadHtml; pthead.php) ----------
   Every width: the allergy line only (red when there are allergies). >= 1280 px: name · UHID · age/sex, active cancer + stage, follow-up, and
   the Next step bar. Phones and tablets otherwise look as before. */
.pthead[hidden] { display: none !important; }
.pthead { flex: 1 0 100%; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ptbar-links .pthead { margin-bottom: 2px; }
.ptbar-tabs .pthead { display: none; }   /* the Rx screen below 1280 px: as before — its own Allergy box (banner row 3) is on screen */
.phrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.phwho, .phca, .phfu, .phnext { display: none; }
.phal { display: inline-block; font-size: 13px; font-weight: 600; line-height: 1.35; padding: 3px 10px; border-radius: 8px; overflow-wrap: anywhere; max-width: 100%; }
.phal-yes { background: #fdecea; color: #b3261e; border: 1px solid #f3b8b2; }
.phal-yes::before { content: "⚠ "; }
.phal-none { background: #e8f5ec; color: #1d6b38; }
.phal-unknown { background: #fbefd9; color: #8a5200; }
@media (min-width: 1280px) {
  .pthead:not([hidden]) { background: #fff; border: 1px solid #E3E8EE; border-radius: 12px; padding: 8px 12px; }
  .ptbar-links .pthead:not([hidden]) { border: 0; padding: 0 0 8px; border-bottom: 1px solid #E3E8EE; border-radius: 0; }
  .phwho { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; color: #0F2233; min-width: 0; }
  .phwho a.phname, .ptbar .phwho a.phname, .ptbar .phwho a.phname:hover, .ptbar .phwho a.phname.on { color: inherit; background: none; border-color: transparent; padding: 0; min-height: 0; text-decoration: none; }   /* a plain link, not a bar button: .ptbar a / a.on would paint it teal (U15: dark text on teal) */
  .phwho a.phname:hover b { text-decoration: underline; }
  .phwho b { font-size: 15px; overflow-wrap: anywhere; } .phwho span { color: #5d6b7a; font-size: 13px; white-space: nowrap; }
  .ptbar-tabs .phwho { display: none; }   /* the Rx screen names the patient at the start of the bar already (#ptnavwho) */
  .ptbar-tabs .pthead:not([hidden]) { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 4px 10px; }   /* the Rx screen: one line, the sticky bar stays short */
  /* the Rx screen: the header's room is kept from the moment a patient is open, so its late arrival (or a new patient's) moves nothing below it
     (test_rx_still.js: nothing above the box he is typing in may move). Fixed height; long chips are cut with … (the whole text is the tooltip). */
  body.haspt .ptbar-tabs .pthead[hidden] { display: flex !important; visibility: hidden; }
  body.haspt .ptbar-tabs .pthead { height: 74px; box-sizing: border-box; overflow: hidden; align-content: flex-start; }
  .ptbar-tabs .phrow { flex-wrap: nowrap; min-width: 0; max-width: 100%; }
  .ptbar-tabs .phal, .ptbar-tabs .phca, .ptbar-tabs .phfu { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
  .ptbar-tabs .phal { max-width: 40%; } .ptbar-tabs .phca { max-width: 40%; }
  body.hasphead.haspt .encrail { top: 176px; max-height: calc(100vh - 220px); }   /* R1's rail sits under the taller sticky bar */
  .phca { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 8px; background: #f3e8fd; color: #5b2a86; overflow-wrap: anywhere; }
  .phfu { display: inline-block; font-size: 13px; color: #33414F; padding: 3px 0; }
  .phfu-overdue { color: #8a5200; font-weight: 600; }
  .phnext { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .phnl { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #626F7B; margin-right: 2px; }
  .phnext a { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 10px; border-radius: 8px; border: 1px solid #E3E8EE; background: #fff;
    color: #33414F; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
  .phnext a:hover { background: var(--a-l, #e6f4f2); color: var(--a-d, #0b6b63); }
  .phnext a.on { background: var(--a, #0F8C82); border-color: var(--a, #0F8C82); color: #fff; }
}
@media print { .pthead { display: none !important; } }
/* ---------- R3 (Dr Shah 28-Oct-2026 desktop review): lift the phone limits on a laptop / desktop. Phones and tablets (< 1280 px) are untouched:
   every rule here sits under (min-width: 1280px) or (min-width: 1600px). Reading / list pages take the shell width (main.home, 1320 px);
   a patient's reading page (.plpage) widens to 960 px so its lines stay readable; single forms (.setadd add-login, 720 px) stay narrow. ---------- */
@media (min-width: 1280px) {
  .ideapage { max-width: 1320px; }   /* Daily Learnings: was 720 px everywhere */
  main.plpage { max-width: 960px; }  /* Your prescriptions / Explanation (patient pages): was 720 px */
}
@media (min-width: 1600px) {
  /* Dashboard Today: three columns — Needs you · Today · Message a patient (below 1600: the two columns of app.css, phones one) */
  .dcols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
  .dcols > .dside { display: contents; }
}

/* ---------- l10 UX step 1 (29-Oct-2026, research/RESEARCH_l10_platform_ux.md §7 Step 1; UX_MISTAKES UX-L10-1/2) ----------
   1. Phone Dashboard, work first: Needs you + Today, then the counts, then Practice numbers (the tiles stay, below). Order only, same data.
   2. Phones and tablets: a solid bar behind the fixed Search / Menu / Back buttons, so cards scroll under the bar, never between the buttons.
   3. Report / Suggest on a phone is a row at the top of the More sheet (ui.php #sreport), not a floating pill over the content.
   4. Wider screens: the bottom-right pill keeps a strip of empty page under it, so the last card can scroll clear of it. */
.sreport { display: none; }
@media (max-width: 600px) {
  main.home:has(> .dcols) { display: flex; flex-direction: column; }
  main.home:has(> .dcols) > .dcols { order: 1; margin-bottom: 18px; }
  main.home:has(> .dcols) > .dnums { order: 2; }
  main.home:has(> .dcols) > .dkpis { order: 3; }
  main.home:has(> .dcols) > .dold { order: 4; }
  .snav .sreport { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; padding: 7px 10px; margin: 0 0 8px; border-radius: 8px; border: 1px solid #E3E8EE;
    background: #fff; color: #33414F; font: 600 13.5px/1.2 inherit; text-align: left; justify-content: flex-start; box-shadow: none; cursor: pointer; }
  .snav .sreport .ic { width: 18px; height: 18px; flex: none; fill: none; stroke: #7a2e12; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  html body:has(#sreport) #rxbugbtn { display: none !important; }
}
@media (max-width: 1024px) {
  body:has(#side):not(:has(header.top, .hometop))::before { content: ''; position: fixed; left: 0; right: 0; top: 0; z-index: 44; height: calc(56px + env(safe-area-inset-top, 0px));
    background: #ffffffF2; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid #E3E8EE; pointer-events: none; }
  body.sopen::before, body.qtvmode::before, body.bfull::before { display: none !important; }
}
@media (min-width: 601px) {
  body:has(#side):has(#rxbugbtn):not(:has(.savebar)) { padding-bottom: 52px; }
}
@media print { body::before { display: none !important; } }
/* Wave 1 (29-Oct-2026, l8): the clinic phone, one tap to call, on every patient screen; "answer again" after today's check-in */
.pltel { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 8px; background: #0b6e4f; color: #fff; font-weight: 600; text-decoration: none; }
.pltel:focus-visible { outline: 3px solid #b45309; outline-offset: 2px; }
.pcagain > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
/* U14 (03-Nov-2026): a page's own trail (.ptcrumb) is folded into the one breadcrumb (ui.js uiCrumbFold); only its action link (Edit details) stays */
.ptcrumb.ptfolded{font-size:0;margin:4px 0 8px}.ptcrumb.ptfolded>:not(.ptedit){display:none}.ptcrumb.ptfolded .ptedit{font-size:13px}

/* ===== Workspace (24-Nov-2026, Dr Shah, desktop only; ui.js uiWs*, workspace.php, research/RESEARCH_workspace_tabs_2026-11-24.md) ===== */
body.wsframe .side, body.wsframe .smenu, body.wsframe .smback, body.wsframe .sscrim, body.wsframe .psrch, body.wsframe #crumb, body.wsframe .apptabs, body.wsframe .btabs, body.wsframe .sback, body.wsframe .envbar { display: none !important; }
body.wsframe.hasside { padding-left: 0 !important; }
.wsctx { position: fixed; z-index: 99990; min-width: 168px; padding: 4px; background: #fff; border: 1px solid #D5DDE5; border-radius: 8px; box-shadow: 0 8px 28px #0f223333; font-size: 13px; }
.wsctx button { display: block; width: 100%; text-align: left; padding: 6px 10px; border: 0; background: none; border-radius: 5px; font: inherit; color: #0f2233; cursor: pointer; }
.wsctx button:hover:not(:disabled), .wsctx button:focus-visible { background: #EEF3F7; }
.wsctx button:disabled { color: #94A3B8; cursor: default; }
.wsctx hr { margin: 4px 0; border: 0; border-top: 1px solid #EEF1F5; }
.wsapp { display: block; padding: 24px 16px; }   /* narrow window: only the note (the wide layout below is min-width 1280) */
.wsbar, .wsframes { display: none; }
.wsnarrow { display: block; }
body.wshost .sback, body.wshost .smback, body.wshost #crumb, body.wshost .apptabs, body.wshost #subtabs, body.wshost .btabs { display: none !important; }
@media (min-width: 1280px) {
  body.wshost { height: 100vh; overflow: hidden; }
  .wsbar { display: flex; } .wsframes { display: block; }
  .wsapp { display: flex; flex-direction: column; height: 100vh; margin: 0; padding: 0; max-width: none; }
  body.wshost:has(.envbar) .wsapp { height: calc(100vh - 30px); }
  .wsbar { display: flex; align-items: stretch; height: 32px; flex: none; background: #E9EEF3; border-bottom: 1px solid #D5DDE5; }
  .wsbar[hidden], .wsframes[hidden] { display: none; }
  .wstabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .wst { position: relative; display: flex; align-items: center; gap: 6px; flex: 0 1 190px; min-width: 92px; max-width: 220px; height: 32px; padding: 0 4px 0 10px; box-sizing: border-box; font-size: 13px; color: #475569; border-right: 1px solid #D5DDE5; cursor: default; user-select: none; }
  .wst:hover { background: #F2F5F8; }
  .wst.on { background: #fff; color: #0f2233; font-weight: 600; box-shadow: inset 0 2px 0 var(--a, #0D7A71); }
  .wst.zz .wstl { opacity: .65; }
  .wst.pin { flex: 0 0 96px; min-width: 96px; border-left: 3px solid var(--a, #0D7A71); padding-right: 8px; }
  .wst.drag { opacity: .45; }
  .wstl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wsd { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #D97706; }
  .wsx { flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: #64748B; font-size: 16px; line-height: 20px; cursor: pointer; }
  .wsx:hover { background: #DDE4EB; color: #0f2233; }
  .wsnew, .wsleave { flex: none; border: 0; border-left: 1px solid #D5DDE5; background: none; color: #334155; cursor: pointer; font: inherit; font-size: 13px; padding: 0 12px; }
  .wsnew { font-size: 18px; width: 36px; padding: 0; } .wsnew:hover, .wsleave:hover { background: #DDE4EB; }
  .wsframes { position: relative; flex: 1; min-height: 0; background: #fff; }
  .wsf { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
  .wsf.off { visibility: hidden; pointer-events: none; }
  .wsnarrow { display: none; }
}
@media print { .wsbar, .wsctx { display: none !important; } }

/* L26 Workspace entry: a small button in the side menu header; wide screens only (phone / narrow windows never see it) */
.swsb { display: none; }
@media (min-width: 1280px) { .swsb { display: inline-block; margin: 0 8px 0 auto; padding: 4px 10px; border: 1px solid #0f6e8c; border-radius: 6px; color: #0f6e8c; font-size: 13px; font-weight: 600; text-decoration: none; } .swsb:hover { background: #e8f3f7; } .side.srail .swsb { display: none; } }
body.wsframe .swsb { display: none !important; }

.wscap { position: fixed; top: 44px; right: 16px; z-index: 99991; display: flex; gap: 8px; align-items: center; padding: 6px 10px; background: #fff; color: #1b2733; border: 1px solid #b45309; border-radius: 6px; box-shadow: 0 4px 14px #0003; font-size: 13px; }
.wscap button { min-height: 28px; padding: 0 10px; border-radius: 4px; border: 1px solid #0b5cad; background: #0b5cad; color: #fff; cursor: pointer; }
.wscap .wscapx { background: #fff; color: #0b5cad; }
@media (prefers-color-scheme: dark) { .wscap { background: #1b2733; color: #fff; } .wscap .wscapx { background: transparent; color: #8ec5ff; } }
/* PEEK (U19): the one shared tooltip card. Both colours named in every rule, light and dark. */
.uipeek { position: fixed; z-index: 10000; max-width: 280px; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.35;
  background: #1b2733; color: #fff; border: 1px solid #1b2733; box-shadow: 0 4px 14px #0003; display: flex; flex-direction: column; gap: 2px; max-height: 12em; overflow: hidden; }
.uipeek[hidden] { display: none; }
.uipeek .uipt { background: transparent; color: #fff; font-weight: 600; }
.uipeek .uips { background: transparent; color: #d3dce5; }
.uipeek .uipr { background: transparent; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uipeek .uipr i { background: transparent; color: #d3dce5; font-style: normal; }
.uipeek kbd { background: #fff; color: #1b2733; border-radius: 4px; padding: 0 5px; font-weight: 600; margin-left: 4px; }
.uipeek a.uipo { background: transparent; color: #bfe0ff; text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) { .uipeek { animation: uipeekin .12s ease-out; } }
@keyframes uipeekin { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-color-scheme: dark) {
  .uipeek { background: #f2f6fa; color: #1b2733; border-color: #d3dce5; }
  .uipeek .uipt, .uipeek .uipr { background: transparent; color: #1b2733; }
  .uipeek .uips, .uipeek .uipr i { background: transparent; color: #44515f; }
  .uipeek kbd { background: #1b2733; color: #fff; }
  .uipeek a.uipo { background: transparent; color: #0b5cad; }
}

/* Today + 5 modules (Dr Shah 26-Nov-2026, admin only): the More fold at the end of a module's tab strip, the app switcher and the gear in the side head */
.subtabs .submore { position: relative; flex: none; }
.subtabs .submore > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; box-sizing: border-box; padding: 9px 12px; font-weight: 600; font-size: 14px; color: #5d6b7a; background: transparent; }
.subtabs .submore > summary::-webkit-details-marker { display: none; }
.subtabs .submore > summary::after { content: "▾"; font-size: 13px; }
.subtabs .submore.on > summary { background: transparent; color: var(--a-d, #0B5F58); box-shadow: inset 0 -2.5px 0 var(--a, #0F8C82); }
.subtabs .submorelist { display: none; position: absolute; right: 0; top: 100%; z-index: 30; min-width: 200px; flex-direction: column; background: #fff; border: 1px solid #E3E8EE; border-radius: 10px; box-shadow: 0 8px 24px #0f223326; padding: 4px; color: #33414F; }
.subtabs .submore[open] > .submorelist { display: flex; }
.subtabs .submorelist a { border-radius: 8px; padding: 10px 12px; box-shadow: none; white-space: nowrap; }
@media (min-width: 1025px) { .subtabs:has(.submore) { overflow: visible; } }
@media (min-width: 601px) and (max-width: 1024px) { .subtabs .submore { display: flex; flex: none; } .subtabs .submore > summary { flex: none; } .subtabs .submore[open] > .submorelist { position: static; display: flex; flex-direction: row; min-width: 0; border: 0; box-shadow: none; padding: 0; color: #33414F; background: transparent; } }   /* tablets: the strip scrolls sideways, so the fold opens inline instead of a dropdown that the strip would clip or that would cover the page's buttons (phone gate @768) */
@media (max-width: 600px) { .subtabs.many .submore { display: none; } .subtabs.seg .submore { flex: 1; } .subtabs.seg .submorelist { right: 0; left: auto; } }
.shead .appsw, .shead .gearw { position: relative; flex: none; }
.shead .appsw > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 8px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #33414F; background: transparent; }
.shead .appsw > summary::-webkit-details-marker { display: none; }
.shead .appsw > summary:hover, .shead .gear:hover { background: #F3F5F8; color: #33414F; }
.shead .appsw .ic, .shead .gear .ic { width: 18px; height: 18px; }
.shead .appswl, .shead .gearl { display: none; position: absolute; top: 100%; left: 0; z-index: 40; min-width: 200px; flex-direction: column; background: #fff; border: 1px solid #E3E8EE; border-radius: 10px; box-shadow: 0 8px 24px #0f223326; padding: 4px; color: #33414F; }
.shead .appsw[open] > .appswl, .shead .gearw:hover > .gearl, .shead .gearw:focus-within > .gearl { display: flex; }
.shead .appswl a, .shead .gearl a { padding: 10px 12px; border-radius: 8px; color: #33414F; background: transparent; text-decoration: none; font-size: 14px; white-space: nowrap; }
.shead .appswl a:hover, .shead .gearl a:hover { background: #F3F5F8; color: #33414F; }
.shead .gear { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; color: #33414F; background: transparent; }

/* Today (26-Nov-2026): the module strip now sits above the home, so on a laptop the greeting band and the strip are compacted — the five cards still end inside 1366x768 (test_pro_home.js). Phones keep 44 px taps. */
@media (min-width: 1025px) {
  .hero.slim.dheroc { padding: 8px 18px !important; margin: 2px 0 4px; color: #fff; background: var(--a) !important; }
  .hero.slim.dheroc .hdate { display: none; margin: 0; color: #ffffffeb; background: transparent; }   /* the date is in the top bar's clock / the strip; the greeting stays */
  .hero.slim.dheroc h1 { font-size: 20px !important; color: #fff; background: transparent; }
  .subtabs:has(+ *) { margin-bottom: 4px; color: #33414F; background: transparent; }
  body.dframe #a5-pro > .crumb { min-height: 28px; }   /* laptop: the home's crumb row is slimmer so the first screen holds the five cards */
  body.dframe main.home.a5app#a5-pro { padding-top: 2px !important; }
  #a5-pro > .uiabout { margin: 0; }
  .subtabs a, .subtabs .submore > summary { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
}
@media (min-width: 1025px) {
  body.dframe #a5-pro > #subtabs { margin-bottom: 4px !important; color: #33414F; background: transparent; }
  body.dframe #a5-pro > .hero.slim.dheroc { margin: 2px 0 4px !important; color: #fff; background: var(--a) !important; }
}

/* B52 (27-Nov-2026): on a home-screen app's home (main.saapp = a flex column, float does nothing) the (i) sat on top of the crumb text, "Me(i)dical Officer".
   Put it at the right end of the crumb row instead; the row keeps its height. */
@media (min-width: 1025px) {
  body.dframe main.saapp > .uiabout:not([open]) { float: none; align-self: flex-end; margin: -36px 0 6px 0; position: relative; z-index: 2; }
}

/* ---------- B55 (Dr Shah 27-Nov-2026, "fix the wasted width at 1920"): inside the desktop frame the page uses the width it is given. Tables, card grids, boards and
   dashboards fill it; long prose keeps its ~80-character line (rl.css) but the reading pages use a second column instead of empty margins.
   Every rule is under body.dframe + min-width 1280 px: phones and tablets are untouched. ---------- */
@media (min-width: 1280px) {
  /* My desk: the lists and the open task take the whole width (was a 1400 px centred column) */
  body.dframe main.desk { max-width: none; margin: 0; }
  body.dframe .dkbody { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
  body.dframe.dkopen .dkbody { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) minmax(380px, 520px); }
  /* list and grid pages: the 1600 px cap of the laptop rule is lifted */
  body.dframe #kb, body.dframe #rr, body.dframe #oa, body.dframe #staffwork, body.dframe #blocks, body.dframe #ekb, body.dframe #logbook, body.dframe #srtop, body.dframe #srpane,
  body.dframe .ideapage, body.dframe .ideaapp, body.dframe .rl, body.dframe .rl[data-rl], body.dframe main.plpage, body.dframe .odmain { max-width: none; margin-left: 0; margin-right: 0; }
  /* MO Handbook: its own 860 px centred column (injected by mohb.js) becomes the full width; the home and the handbook list their cards in columns */
  body.dframe #mohb, body.dframe #mohb.mhwide { max-width: none; margin: 0; }
  body.dframe #mohb:has(.mhprog) { max-width: 1400px; }
  body.dframe #mohb #mhhome, body.dframe #mohb #mhres { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 0 14px; align-items: start; }
  body.dframe #mohb #mhhome > .mhtiles { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  body.dframe #mohb:has(> details.mhpart) { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 0 14px; align-items: start; }
  body.dframe #mohb:has(> details.mhpart) > :not(details.mhpart) { grid-column: 1 / -1; }
  body.dframe #mohb .mhsearch { max-width: 720px; }
  /* Boards: the 1320 px cap goes; My settings: its setting groups sit in columns instead of one 860 px strip */
  body.dframe #boards { max-width: none; }
  body.dframe .pf { max-width: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 0 16px; align-items: start; }
  body.dframe .pf > :not(.pfg) { grid-column: 1 / -1; }
}
@media (min-width: 1600px) {
  /* reading pages (Daily Learnings, reading notes, OT guide, chapters): rail + TWO text columns; headings and bars span both; each paragraph keeps its measure */
  body.dframe .rl[data-rl]:not(.rl-solo) > .rl-main:has(> .rl-sec ~ .rl-sec) { column-count: 2; column-gap: 56px; }
  body.dframe .rl[data-rl]:not(.rl-solo) > .rl-main:has(> .rl-sec ~ .rl-sec) > :not(.rl-sec) { column-span: all; }
  body.dframe .rl[data-rl]:not(.rl-solo) > .rl-main:has(> .rl-sec ~ .rl-sec) .rl-h { position: static; }
  body.dframe .rl[data-rl]:not(.rl-solo) > .rl-main:has(> .rl-sec ~ .rl-sec) .rl-sec > :is(ul, ol):not([class]) { column-count: 1; }
}
