/* emr.css — lane 1 (mod_l1_problems.json "css": linked on every page after app.css; every rule is scoped to its own classes).
   F2 Problem list (problems.js): the Rx box under the diagnosis, the profile fold, the left rail line, the chip in the shared patient header.
   Phones and tablets: the boxes stack (each part full width); the header chip shows from 1280 px, like the rest of the header. */

/* ---------- F2 problem list ---------- */
.dxbox > .plsec { margin: 10px 0 0; padding-top: 6px; border-top: 1px solid var(--line2, #e3e9ef); }   /* >= 1280 px: inside section 7 (problems.js plPlace) */
.plsec .plh { margin: 0 0 2px; font-size: 14px; }
.plsec .plh small { font-weight: 400; font-size: 12px; }
/* section 7 folded to its carried-forward line (rxvisit.js cfFold 'dx'; app.css hides the rest): the problem list stays in view */
#work .sec.cfsec > section.plsec#plsec { display: block !important; }
.plbox .pllist { list-style: none; margin: 4px 0 8px; padding: 0; }
.plbox .plrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0; border-bottom: 1px solid var(--line2, #eef2f5); }
.plbox .plt { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.plbox .plt small { display: block; color: var(--muted, #5d6b7a); font-size: 12px; }
.plbox .placts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.plbox .placts button { min-height: 32px; padding: 2px 10px; font-size: 12.5px; }
.plbox .plerr { color: #8a5200; }
.plbox .pl-resolved .plt b { color: #5d6b7a; font-weight: 600; }
.plbox .plst.res { display: inline-block; padding: 0 6px; border-radius: 8px; background: #eef2f7; color: #334155; font-size: 11.5px; font-weight: 600; }
.plbox .pladd { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.plbox .pladd input { min-width: 0; }
.plbox .pladd .plp { flex: 3 1 220px; } .plbox .pladd .plicd { flex: 0 1 96px; }
.plbox .pladd .plon { flex: 1 0 10em; }   /* never narrower than its placeholder "Since (yyyy-mm)" (phone gate UX-21, 29-Oct-2026) */
.plbox .plsug { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.plbox .plsug > small { flex: 1 0 100%; }
.plbox .plchip small { color: var(--muted, #5d6b7a); }
.plbox .plmsg { margin: 2px 0 0; font-size: 12.5px; color: var(--muted, #5d6b7a); min-height: 1em; }
.plbox .plmsg.err { color: var(--err, #b3261e); font-weight: 600; }
.plbox .plhist { margin-top: 8px; font-size: 12.5px; }
.plbox .plhist ul { margin: 4px 0 0; padding-left: 18px; }
.encrail .erp { color: #0b3d4f; }
@media (max-width: 600px) {
  .plbox .pladd input, .plbox .pladd button { flex: 1 1 100%; font-size: 16px; }
  .plbox .placts button { min-height: 44px; min-width: 44px; }
}

/* the shared patient header (ui.js uiPtHeadHtml): the active problems, from 1280 px like the rest of the header */
.phpl { display: none; }
@media (min-width: 1280px) {
  .phpl { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 8px; background: #eef4f8; color: #0b3d4f; overflow-wrap: anywhere; }
  .phpl b { font-weight: 700; margin-right: 4px; }
  .ptbar-tabs .phpl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; max-width: 30%; }
}

/* ---------- F3 medicine review (medrec.js): top of section 11 on the Rx, the profile fold ---------- */
.mrrev { margin: 4px 0 8px; border: 1px solid var(--line2, #e3e9ef); border-radius: 8px; padding: 4px 10px; background: #fbfdfe; }
.mrrev > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.mrrev > summary small { font-weight: 400; }
.mrbox .mrlist { list-style: none; margin: 4px 0 6px; padding: 0; }
.mrbox .mrrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 5px 0; border-bottom: 1px solid var(--line2, #eef2f5); }
.mrbox .mrt { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.mrbox .mrt small { display: block; color: var(--muted, #5d6b7a); font-size: 12px; }
.mrbox .mracts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mrbox .mracts button { min-height: 32px; padding: 2px 10px; font-size: 12.5px; }
.mrbox .mrstop { color: #8a5200; }
.mrbox .mrst { display: inline-block; padding: 0 6px; border-radius: 8px; font-size: 11.5px; font-weight: 600; background: #eef2f7; color: #334155; }
.mrbox .mrst.changed { background: #fff4e0; color: #7a4a00; } .mrbox .mrst.stopped { background: #f1f1f1; color: #5d6b7a; } .mrbox .mrst.seed { background: #eef4f8; color: #0b3d4f; }
.mrbox .mron { font-size: 11.5px; color: #0b6b3a; font-weight: 600; }
.mrbox .mr-stopped .mrt b { color: #5d6b7a; text-decoration: line-through; }
.mrbox .mradd { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.mrbox .mradd input, .mrbox .mradd select { min-width: 0; }
.mrbox .mradd .mrd { flex: 3 1 200px; } .mrbox .mradd .mrdose, .mrbox .mradd .mrfq { flex: 1 1 90px; } .mrbox .mradd .mrby { flex: 1 1 130px; }
.mrbox .mrmsg { margin: 2px 0 0; font-size: 12.5px; color: var(--muted, #5d6b7a); min-height: 1em; }
.mrbox .mrmsg.err { color: var(--err, #b3261e); font-weight: 600; }
.mrbox .mrh { margin: 8px 0 2px; font-size: 13px; }
.mrbox .mrhist { margin-top: 8px; font-size: 12.5px; }
.mrbox .mrhist ul { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 600px) {
  .mrbox .mradd input, .mrbox .mradd select, .mrbox .mradd button { flex: 1 1 100%; font-size: 16px; }
  .mrbox .mracts button { min-height: 44px; min-width: 44px; }
}
/* the medicines carried forward fold to one line (rxvisit.js cfFold; app.css hides the rest of the section) — the review stays in view:
   that is when it is needed. Its clicks open the fold before they change the prescription's rows (medrec.js openMeds). */
#work .sec.cfsec > details.mrrev#mrrev { display: block !important; }

/* F4 (29-Oct-2026): investigation order -> result loop (ixloop.js) — the left rail's "Awaiting results" and the Calls tab "Tests awaited" */
.ixl .ixi { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.ixl .ixb { display: inline-flex; gap: 4px; margin-left: auto; }
.ixl .ixb button { min-height: 26px; padding: 1px 8px; font-size: 12px; }
.ixover { color: #b42318; font-weight: 600; font-size: 12px; }
.ixn { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #fde7e4; color: #b42318; font-size: 11px; text-align: center; letter-spacing: 0; }
.ixdone small { color: #475569; }
#ixdue .ixsub { max-width: 70ch; }
#ixdue .ixall { display: inline-flex; gap: 6px; align-items: center; margin: 6px 0 10px; }
#ixdue .ixlist { list-style: none; margin: 0; padding: 0; }
#ixdue .ixrow { border: 1px solid var(--line2, #e3e9ef); border-radius: 8px; padding: 8px 12px; margin: 0 0 8px; background: #fff; }
#ixdue .ixpt { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
#ixdue .ixl { list-style: none; margin: 4px 0 0; padding: 0; }
#ixdue .ixl li { padding: 4px 0; border-top: 1px solid var(--line2, #eef2f6); }
@media (min-width: 1280px) { #ixdue .ixlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; } }

/* ---------- Get new reports reads Slack live (31-Oct-2026, rxinf.js pendingHtml / nearHtml) and the profile card (ptreports.js) ---------- */
/* a post of the last 24 h that matched nobody: one tap = "this patient" — the same phone-sized row as app.css .invposs button.invpadd */
.invposs button.invnear { display: flex; width: 100%; text-align: left; gap: 8px; align-items: flex-start; min-height: 44px; margin: 4px 0; padding: 6px 8px; background: #fff; border: 1px solid var(--line); border-radius: 4px; color: inherit; font-weight: 400; white-space: normal; }
.invposs button.invnear b { white-space: nowrap; }
.invposs ul.invpend { list-style: none; margin: 0 0 6px; padding: 0; }
.invposs ul.invpend li { padding: 6px 0; border-bottom: 1px solid var(--line2, #e6ecf1); overflow-wrap: anywhere; }
.invposs ul.invpend li:last-child { border-bottom: 0; }
.invposs ul.invpend a { display: inline-flex; align-items: center; min-height: 44px; }
.rpab { color: var(--err, #b3261e); font-weight: 600; }

/* 29-Nov-2026 patient comorbidity list (app.js cpl*): amber "details missing" (UI_STANDARD U15/U24: --warn tint with its ink), the lab date box,
   "Reviewed today" beside the source label. 44 px taps at <= 1024 px; long labels wrap, never cut at 360 px. */
#comodet .comosum .comomiss { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px; background: var(--warn, #fff4dc); color: #8a5a00; font-size: 12px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
#comodet .comosum { white-space: normal; overflow-wrap: anywhere; }
.comoitem input.comodate { width: auto; min-width: 0; max-width: 150px; margin-left: 4px; }
button.comorev { margin-left: 6px; padding: 2px 10px; min-height: 28px; font-size: 12px; background: #fff; color: var(--accent, #0f6e8c); border: 1px solid var(--line, #d7dee6); border-radius: 999px; white-space: normal; }
button.comorev[hidden] { display: none; }
@media (max-width: 1024px) {
  .comoitem input.comodate, button.comorev { min-height: 44px; }
  #comodet .comosum { min-height: 44px; box-sizing: border-box; }
}
