/* Understudia shell in the SummitEHR / DataQ Health frame (75 px blue rail, 64 px white top bar), plus simulator parts.
   Tokens come from summit.css. Status is always a symbol or dot plus text. */

.synthetic-banner { height: 26px; line-height: 26px; padding: 0 12px; background: #fff6e5; border-bottom: 1px solid #e8c98f; color: #6b4e00; font-size: 12px; text-align: center; }
.frame { display: flex; min-height: calc(100vh - 26px); }
.rail { position: sticky; top: 0; align-self: flex-start; height: calc(100vh - 26px); width: 75px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--rail); z-index: 30; }
.rail .logo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 64px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.18); }
.rail .logo svg { width: 38px; height: 38px; }
.uwm { display: flex; flex-direction: column; line-height: 1; }
.uwm .w { font-size: 22px; font-weight: 600; letter-spacing: -.3px; color: var(--ink); }
.uwm .w span { color: var(--primary); }
.uwm small { color: var(--muted); font-size: 11px; margin-top: 3px; letter-spacing: .02em; }
.rail .logo .spec { color: #fff; font-size: 10.5px; font-weight: 600; }
.rail ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rail a.ri { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 64px; color: #fff; font-size: 10px; text-decoration: none; }
.rail a.ri:hover { background: rgba(255,255,255,.1); }
.rail a.ri.on { background: var(--rail-active); }
.rail a.ri.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #fff; border-radius: 0 2px 2px 0; }
.rail a.ri.disabled { opacity: .35; pointer-events: none; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; height: 64px; padding: 0 18px 0 12px; background: #fff; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 20px; color: var(--ink); letter-spacing: -.01em; text-decoration: none !important; }
.wordmark b { color: var(--rail); }
.prod { margin-left: 6px; padding: 2px 8px; border-radius: 4px; background: var(--rail); color: #fff; font-size: 12px; font-weight: 600; vertical-align: 3px; }
.topbar .sp { flex: 1; }
.practice { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 4px; white-space: nowrap; }
.practice .loc { color: var(--primary); }
.pname { font-size: 14.5px; }
.ploc { color: var(--link); font-weight: 500; font-size: 13px; line-height: 1.2; }
.usermenu { position: relative; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border: 0; background: none; cursor: pointer; border-radius: 4px; text-align: left; }
.me:hover { background: #f0f3f7; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #6e747c; color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.who { display: flex; flex-direction: column; line-height: 1.25; }
.who .nm { font-weight: 600; color: #5a6472; font-size: 13.5px; }
.who .rl { color: var(--muted); font-size: 12px; }
.pop { position: absolute; right: 0; top: 52px; min-width: 260px; padding: 6px 0; background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: 0 8px 24px rgba(16,38,74,.14); z-index: 40; }
.pop .grp { padding: 6px 14px 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.pop button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 14px; border: 0; background: none; text-align: left; cursor: pointer; }
.pop button:hover { background: #eef4fd; }
.pop button[aria-checked='true'] { color: var(--link); font-weight: 500; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
main { flex: 1; min-width: 0; }
svg.ic { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* summary tiles (dashboard top row) */
.tile { display: flex; align-items: center; gap: 12px; min-height: 84px; box-sizing: border-box; padding: 10px 16px 10px 18px; border: 1px solid rgba(0,0,0,.04); border-radius: 4px; box-shadow: var(--shadow); }
.tile .ticon { width: 38px; height: 38px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.tile .big { display: flex; flex-direction: column; min-width: 80px; line-height: 1.15; }
.tile .n { font-size: 19px; }
.tile .l { font-size: 12.5px; }
.tile .rows2 { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.tile .r { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgba(0,0,0,.07); font-size: 12px; }
.tile .r:last-child { border-bottom: 0; }
.tile .c { white-space: nowrap; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.tile.green { background: var(--tile-green); } .tile.green .ticon, .tile.green .c { background: var(--tile-green-ink); }
.tile.blue { background: var(--tile-blue); } .tile.blue .ticon, .tile.blue .c { background: var(--tile-blue-ink); }
.tile.purple { background: var(--tile-purple); } .tile.purple .ticon, .tile.purple .c { background: var(--tile-purple-ink); }
.tile.orange { background: var(--tile-orange); } .tile.orange .ticon, .tile.orange .c { background: var(--tile-orange-ink); }

/* case library */
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--gap); }
.case-card .card-body { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.case-card .stem { color: var(--muted); font-size: var(--fs-sm); }
.case-card ul { margin: 0; padding-left: 18px; font-size: var(--fs-sm); }
.case-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.case-card .foot .sp { flex: 1; }

/* dialogs */
.backdrop { position: fixed; inset: 0; background: rgba(20,30,45,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.dialog { background: #fff; border-radius: 6px; box-shadow: 0 12px 40px rgba(16,38,74,.25); width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; }
.dialog.wide { width: min(900px, 100%); }
.dialog .card-head { border-radius: 6px 6px 0 0; }
.dialog .dbody { padding: 10px 16px; overflow: auto; }
.dialog .dfoot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--line); background: #fafbfc; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; margin-bottom: 6px; }
.choice:has(input:checked) { border-color: var(--primary); background: #f3f8ff; }
.choice .sub { color: var(--muted); font-size: var(--fs-sm); }
.dialog.alarm .card-head { background: linear-gradient(180deg, #fde3e3 0, #fff 100%); }

/* simulator */
.runbar { display: flex; align-items: center; gap: 14px; padding: 8px 14px; margin-bottom: var(--gap); }
.runbar h1 { margin: 0; font-size: 16px; font-weight: 500; }
.runbar .meta { color: var(--muted); font-size: var(--fs-sm); }
.clock { font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.clock.low { color: var(--stop); }
.timebar { width: 160px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.timebar > span { display: block; height: 100%; background: var(--primary); }
.timebar.low > span { background: var(--stop); }
.sim-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(340px, 1.25fr) minmax(320px, 1.1fr); gap: var(--gap); align-items: start; }
@media (max-width: 1250px) { .sim-grid { grid-template-columns: 1fr 1fr; } }
.monitor { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px 0; }
.vt { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; background: #fbfcfe; }
.vt .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.vt .v { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vt .tr { font-size: 12px; color: var(--muted); margin-left: 4px; }
.vt.bad { border-color: var(--stop); background: var(--stop-bg); }
.vt.bad .v { color: var(--stop); }
.vt.bad .k::after { content: ' ▲ alarm'; color: var(--stop); font-weight: 600; }
.mentation { padding: 4px 0 2px; font-size: var(--fs-sm); }
.feed { max-height: 330px; overflow-y: auto; scrollbar-width: thin; }
.feed .row { font-size: var(--fs-sm); }
.feed .ts { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 44px; }
.feed .row.alarm { background: var(--stop-bg); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.feed .row.result .grow b { color: var(--link); font-weight: 600; }
.feed .row.new { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: #fff3c4; } to { background: transparent; } }
.ohead { position: sticky; top: 0; z-index: 1; background: #fff; padding: 8px 0 3px; font-weight: 600; font-size: 12.5px; color: var(--ink); border-bottom: 1px solid var(--line-strong); }
.osub { padding: 7px 0 2px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.orders { max-height: calc(100vh - 260px); min-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.orders .row { align-items: center; }
.orders .row .lbl { flex: 1; }
.orders .row .m { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.orders .row.done .lbl { color: var(--muted); }
.ddx-row { display: grid; grid-template-columns: 22px 1fr auto auto auto; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.ddx-row .rk { font-weight: 600; color: var(--muted); }
.ddx-row select { height: 26px; font-size: 12px; padding: 0 4px; }
.ddx-row .cm { font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ddx-row .tiny { display: inline-flex; gap: 2px; }
.ddx-row .tiny button { border: 1px solid var(--line-strong); background: #fff; border-radius: 3px; width: 22px; height: 22px; cursor: pointer; padding: 0; color: var(--muted); }
.ddx-add { display: flex; gap: 6px; margin: 6px 0; }
.ddx-add input { flex: 1; }
.unmatched { color: var(--warn); font-size: 11px; }
.coach { border-left: 3px solid var(--primary); background: #f3f8ff; padding: 8px 12px; border-radius: 0 4px 4px 0; margin-bottom: 6px; font-size: var(--fs-sm); }

/* debrief */
.score-big { font-size: 34px; font-weight: 500; }
.bd-table td.num, .bd-table th.num { text-align: right; }
.flag { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--muted); border-radius: 0 4px 4px 0; background: #f6f8fb; }
.flag.stop { border-color: var(--stop); background: var(--stop-bg); }
.flag.warn { border-color: var(--warn); background: var(--warn-bg); }
.flag.ok { border-color: var(--ok); background: var(--ok-bg); }
.flag.info { border-color: var(--primary); background: #f3f8ff; }
.flag b { display: block; }
.refs a { margin-right: 8px; font-size: 12px; white-space: nowrap; text-decoration: underline; text-decoration-color: rgba(15,98,214,.4); }
.tl { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.tl .row .ts { min-width: 50px; color: var(--muted); }
.ddx-snaps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--gap); }
.ddx-snaps ol { margin: 4px 0; padding-left: 20px; }
.ddx-snaps li { padding: 2px 0; }
.ddx-snaps .reason { font-size: var(--fs-sm); color: var(--muted); font-style: italic; margin-top: 6px; }

/* pathway map */
.pmap-wrap { position: relative; overflow-x: auto; padding-bottom: 6px; }
.pmap { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 34px; padding: 4px 2px; }
.pmap svg.links { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.pcol h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.bcard { position: relative; border: 1px solid var(--line); border-left: 5px solid var(--bc); border-radius: 4px; padding: 6px 8px; margin-bottom: 8px; background: #fff; cursor: pointer; font-size: 12.5px; }
.bcard:hover { box-shadow: var(--shadow); }
.bcard.you { outline: 2px solid var(--primary); outline-offset: 1px; }
.bcard.sel { background: #f3f8ff; }
.bcard .bl { font-weight: 500; }
.bcard .bm { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; gap: 6px; }
.bcard .share { height: 4px; background: var(--line); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.bcard .share > span { display: block; height: 100%; background: #6e747c; }
.tag-you { position: absolute; top: -9px; right: 6px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink); margin: 4px 0 8px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.bdetail { margin-top: 8px; }

/* charts */
.viz { width: 100%; max-width: 860px; height: auto; display: block; font-family: inherit; }
.viz .grid { stroke: #e9edf2; stroke-width: 1; }
.viz .tick { fill: var(--muted); font-size: 11px; }
.viz .tick.strong { fill: var(--ink); }
.viz .lab { fill: var(--ink); font-size: 12px; }
.viz .deadline { stroke: var(--ink); stroke-dasharray: 4 3; stroke-width: 1; }
.viz .dot { stroke: #fff; stroke-width: 1.5; }
.viz .you { stroke: #fff; stroke-width: 2; }
.viz .you-lab { font-size: 11px; font-weight: 700; fill: var(--ink); }
.viz .line { fill: none; stroke: #2a78d6; stroke-width: 2; }
.viz .marker { fill: #fff; stroke: #2a78d6; stroke-width: 2; }
.viz .marker.bad { stroke: #d03b3b; }
.viz .xhair { stroke: var(--muted); stroke-width: 1; }
.viz-tip { position: fixed; display: none; z-index: 200; pointer-events: none; background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 6px 18px rgba(16,38,74,.16); border-radius: 4px; padding: 6px 9px; font-size: 12px; max-width: 280px; }
.stack-bar { display: flex; gap: 2px; height: 26px; border-radius: 4px; overflow: hidden; }
.stack-bar .seg { position: relative; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11.5px; font-weight: 600; min-width: 3px; }
.stack-bar .seg span { text-shadow: 0 0 2px rgba(0,0,0,.35); }
.stack-bar .seg.you { box-shadow: inset 0 0 0 2px #1f2733; }
.dec-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hbars .hb-row { display: grid; grid-template-columns: 220px 1fr 64px; gap: 8px; align-items: center; padding: 3px 0; font-size: 12.5px; }
.hb-track { height: 12px; background: #f1f3f6; border-radius: 0 4px 4px 0; }
.hb-bar { display: block; height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; }
.hb-bar.mark { background: #0ca30c; }
.hb-val { text-align: right; font-variant-numeric: tabular-nums; }
.role-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-bottom: 4px; }
.role-key .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.kpi-note { font-size: 12px; color: var(--muted); }

/* debrief readability: larger type, a scorecard with a plain-language verdict, takeaways first */
.debrief { font-size: 14px; line-height: 1.55; }
.debrief .card-head h2, .debrief .card-head h3 { font-size: 15px; }
.debrief h3.sec { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.debrief h3.sec:first-child { margin-top: 2px; }
.debrief .ctabs button { font-size: 14px; }
.debrief table td, .debrief table th { font-size: 13.5px; }
.scorecard { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; padding: 16px 18px; margin-bottom: var(--gap); }
.sc-main { display: flex; gap: 18px; align-items: center; flex: 1 1 520px; min-width: 0; }
.sc-score { font-size: 44px; font-weight: 600; line-height: 1; min-width: 108px; text-align: center; padding: 12px 6px; border-radius: 8px; }
.sc-score small { font-size: 15px; font-weight: 500; color: var(--muted); }
.sc-score.ok { background: var(--ok-bg); color: var(--ok); }
.sc-score.warn { background: var(--warn-bg); color: var(--warn); }
.sc-score.stop { background: var(--stop-bg); color: var(--stop); }
.sc-verdict p { margin: 6px 0 4px; font-size: 15px; }
.sc-verdict .muted { font-size: 12.5px; }
.sc-stats { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; flex: 1 1 520px; }
@media (max-width: 900px) { .sc-stats { grid-template-columns: repeat(2, 1fr); } }
.sc-stat { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fbfcfe; }
.sc-stat .n { font-size: 24px; font-weight: 600; line-height: 1.1; }
.sc-stat .n.ok { color: var(--ok); }
.sc-stat .n.warn { color: var(--warn); }
.sc-stat .n.stop { color: var(--stop); }
.sc-stat .l { font-weight: 500; margin-top: 2px; }
.sc-stat .s { color: var(--muted); font-size: 12.5px; }
.takeaways { margin-bottom: var(--gap); }
.tk ul, .tk ol { margin: 6px 0 4px; padding-left: 20px; }
.tk li { margin: 6px 0; }
.tk.good .card-head { background: linear-gradient(180deg, #e3f5ea 0, #f4fbf6 60%, #fff 100%); }
.tk.fix .card-head { background: linear-gradient(180deg, #fff0d9 0, #fff8ec 60%, #fff 100%); }
.tk .refs a { font-size: 12px; }
.sbar { margin: 0 0 12px; }
.sbar-top { display: flex; justify-content: space-between; gap: 8px; }
.sbar-track { height: 10px; background: #eef1f5; border-radius: 0 5px 5px 0; margin-top: 4px; }
.sbar-track span { display: block; height: 100%; background: var(--primary); border-radius: 0 5px 5px 0; }
.sbar-note { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.sbar.total { border-top: 1px solid var(--line-strong); padding-top: 8px; font-size: 15px; }
.stop-ink { color: var(--stop); }
.crit-list { display: flex; flex-direction: column; }
.crit { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.crit .pill { min-width: 86px; justify-content: center; margin-top: 2px; }
.crit .cl { font-weight: 500; }
.crit .cs { color: var(--muted); font-size: 13px; }
.case-card .foot { flex-wrap: wrap; }

/* evidence map */
.evchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.evchip { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 11px; border: 1px solid var(--line-strong); background: #fff; font-size: 11.5px; color: var(--ink); text-decoration: none !important; white-space: nowrap; }
.evchip b { color: var(--link); font-weight: 600; }
.evchip i { font-style: normal; font-weight: 700; }
.evchip.ok { border-color: #b9dfc6; background: var(--ok-bg); } .evchip.ok i { color: var(--ok); }
.evchip.info { border-color: #c6d9f5; background: #f3f8ff; } .evchip.info i { color: var(--primary); }
.evchip.warn { border-color: #f0cf96; background: var(--warn-bg); } .evchip.warn i, .evchip.warn b { color: var(--warn); }
.evchip.stop { border-color: #f1b9b9; background: var(--stop-bg); } .evchip.stop b { color: var(--stop); }
.gpipe { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 10px 0; }
@media (max-width: 1100px) { .gpipe { grid-template-columns: repeat(2, 1fr); } }
.gpipe li { border: 1px solid var(--line); border-top: 4px solid var(--line-strong); border-radius: 4px; padding: 8px 10px; background: #fbfcfe; display: flex; flex-direction: column; }
.gpipe li.done { border-top-color: var(--ok); }
.gpipe .gn { font-size: 22px; font-weight: 600; }
.gpipe .gd { color: var(--muted); font-size: 12px; }
table.trace td { vertical-align: top; padding-top: 9px; padding-bottom: 9px; }
table.trace tr.gap td { background: #fffaf2; }
table.trace .cl { font-weight: 500; margin-top: 4px; }
.trec { margin-bottom: 8px; } .trec:last-child { margin-bottom: 0; }
.trec .grade { font-weight: 600; font-size: 12.5px; margin: 0 4px; }
.gcard { margin-top: var(--gap); }
tr.focus td { background: #fff7d6; }
.recfocus { border: 2px solid var(--primary); }
ol.steps li { margin: 6px 0; }

/* plain-language drill-down */
.lay { margin-bottom: 12px; border-left: 4px solid var(--tile-green-ink); }
.lay .card-head { background: linear-gradient(180deg, #e3f5ea 0, #f4fbf6 60%, #fff 100%); }
.lay-sum { font-size: 15.5px; margin: 6px 0 10px; }
.lay details { border-top: 1px solid var(--line); padding: 6px 0; }
.lay summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--ink); padding: 2px 0; }
.lay summary::marker { color: var(--primary); }
.lay details p, .lay details li { font-size: 14.5px; line-height: 1.6; }
.lay-dec { margin: 8px 0; } .lay-dec p { margin: 2px 0; }
.lay-terms dt { font-weight: 600; }
abbr.gl { text-decoration: underline dotted var(--primary); text-underline-offset: 3px; cursor: help; }
abbr.gl:focus-visible { outline: 2px solid var(--primary); }
.layline { background: #f2faf5; border-left: 3px solid var(--tile-green-ink); padding: 6px 10px; margin-bottom: 8px; border-radius: 0 4px 4px 0; }

/* library: compact stats strip and a single filter bar */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 4px; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.04); }
.kpi .ticon { width: 36px; height: 36px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.kpi .kn { font-size: 20px; line-height: 1.1; }
.kpi .kl { font-weight: 500; }
.kpi .ks { color: var(--muted); font-size: 12px; }
.kpi.blue { background: var(--tile-blue); } .kpi.blue .ticon { background: var(--tile-blue-ink); }
.kpi.green { background: var(--tile-green); } .kpi.green .ticon { background: var(--tile-green-ink); }
.kpi.purple { background: var(--tile-purple); } .kpi.purple .ticon { background: var(--tile-purple-ink); }
.kpi.orange { background: var(--tile-orange); } .kpi.orange .ticon { background: var(--tile-orange-ink); }
.libbar { margin-bottom: 8px; }
.libbar .card-body { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; padding: 10px 14px; }
.libbar #libq { width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; border-right: 1px solid var(--line-strong); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--primary); color: #fff; }
.seg button.on .count { background: rgba(255,255,255,.25); color: #fff; }
.catchips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.cchip { border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 3px 10px; cursor: pointer; font-size: 12.5px; }
.cchip span { color: var(--muted); margin-left: 3px; }
.cchip.on { background: var(--chip-bg); border-color: var(--primary); color: var(--chip-ink); font-weight: 600; }
/* plain-language explanation hidden until clicked */
.lay-wrap { margin-bottom: 12px; }
.lay-wrap > summary { list-style: none; display: inline-flex; margin-bottom: 8px; }
.lay-wrap > summary::-webkit-details-marker { display: none; }
.lay-wrap > summary::before { content: '💬'; margin-right: 4px; }
.lay-wrap[open] > summary { background: var(--chip-bg); }
details.layline > summary { cursor: pointer; color: var(--link); font-weight: 500; }

/* glossary underlines only while the plain-language explanation is open */
#key:not(.glossed) abbr.gl, #dtab:not(.glossed) abbr.gl { text-decoration: none; cursor: inherit; pointer-events: none; }

.gpipe { grid-template-columns: repeat(8, minmax(0, 1fr)); }
@media (max-width: 1100px) { .gpipe { grid-template-columns: repeat(2, 1fr); } }

/* encounter stages and workflow phases */
.runbar { flex-wrap: wrap; }
.stagebar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 0 14px 8px; margin-top: -4px; }
.stages, .phases { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12.5px; }
.stg, .ph { padding: 2px 9px; border-radius: 11px; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.stg.done { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.ph.done { background: var(--ok-bg); color: var(--ok); }
.ph.on { background: var(--primary); color: #fff; font-weight: 600; }
.stagebar .arr { color: var(--line-strong); }
#libtrack { height: 32px; }
.libbar .card-body { grid-template-columns: auto auto 1fr; }

/* knowledge assessment */
.qnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 var(--gap); }
.qnav button { width: 30px; height: 28px; border: 1px solid var(--line-strong); background: #fff; border-radius: 4px; cursor: pointer; font-size: 12px; }
.qnav button.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; font-weight: 700; }
.qnav button.done { background: var(--chip-bg); }
.qnav button.ok { background: var(--ok-bg); color: var(--ok); }
.qnav button.bad { background: var(--stop-bg); color: var(--stop); }
.qnav button.flag { border-color: var(--warn); border-width: 2px; }
.qcard .card-body { padding: 16px 20px; font-size: 15px; line-height: 1.6; }
.qstem { margin: 0 0 8px; }
.qlead { margin: 0 0 10px; }
.qopts { display: flex; flex-direction: column; gap: 6px; }
.qopts.need { outline: 2px solid var(--warn); outline-offset: 4px; border-radius: 4px; }
.qopt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.qopt:hover { background: #f7f9fc; }
.qopt input { margin-top: 5px; }
.qopt .qk { font-weight: 700; min-width: 16px; }
.qopt.chosen { border-color: var(--primary); background: #f3f8ff; }
.qopt.right { border-color: var(--ok); background: var(--ok-bg); }
.qopt.wrong { border-color: var(--stop); background: var(--stop-bg); }
.qwhy { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.qconf { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 12px; font-size: 13.5px; }
details.qrev { border-bottom: 1px solid var(--line); padding: 8px 0; }
details.qrev > summary { cursor: pointer; }
.qrev-opts { list-style: none; padding: 0; margin: 6px 0; }
.qrev-opts li { padding: 4px 8px; border-radius: 4px; margin-bottom: 2px; }
.qrev-opts li.right { background: var(--ok-bg); }
.qrev-opts li.wrong { background: var(--stop-bg); }

/* case screen: sticky patient banner + two-column work area */
.runpage { padding-top: 6px; }
.ptbanner { position: sticky; top: 64px; z-index: 15; padding: 8px 12px 6px; margin-bottom: var(--gap); box-shadow: 0 2px 8px rgba(16,38,74,.12); }
.pt-row1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pt-id h1 { margin: 0; font-size: 16px; font-weight: 600; }
.pt-id .meta { color: var(--muted); font-size: 12px; }
.pt-row1 .sp { flex: 1; }
.pt-row1 .clock { font-size: 22px; min-width: 76px; }
.pill.loc { background: var(--stop-bg); color: var(--stop); font-weight: 600; }
.pt-row2 { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; }
.vstrip { display: flex; flex-wrap: wrap; gap: 6px; }
.vstrip .vt { min-width: 92px; padding: 4px 10px; }
.vstrip .vt .v { font-size: 20px; }
.vstrip .vt.bad .k::after { content: none; }
.vstrip .vt.bad { animation: alarmpulse 1.6s ease-in-out infinite; }
@keyframes alarmpulse { 50% { box-shadow: 0 0 0 3px rgba(198,42,42,.18); } }
.pt-side { font-size: 12.5px; line-height: 1.4; max-width: 300px; }
.pt-row3 { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin-top: 6px; }
.pendstrip { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; margin-left: auto; }
.pchip { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.pt-row4 { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.pt-row4 .xlabel { font-weight: 600; font-size: 12.5px; margin-right: 4px; }
.btn.xfer { border-color: var(--stop); color: var(--stop); }
.btn.xfer:hover { background: var(--stop-bg); }
.xhint { font-size: 12px; margin-left: 6px; }
.run-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 1050px) { .run-grid { grid-template-columns: 1fr; } .ptbanner { position: static; } }
.runpage .orders { max-height: calc(100vh - 380px); min-height: 360px; }
.runpage .feed { max-height: 300px; }
.osearch input { width: 100%; height: 36px; font-size: 14px; }
.osets { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 8px 0 2px; font-size: 12.5px; }
.otag { font-size: 11px; color: var(--muted); background: #eef1f5; border-radius: 8px; padding: 0 6px; margin-left: 4px; }
.codes { margin-left: 6px; }
.code { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-right: 3px; vertical-align: 1px; }
.kbd { font-family: ui-monospace, Consolas, monospace; font-size: 11px; border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 5px; }
.dialog.palette { width: min(720px, 100%); padding: 10px; align-self: flex-start; margin-top: 10vh; }
.palette input { width: 100%; height: 40px; font-size: 15px; }
.pal-row { cursor: pointer; padding: 7px 8px; border-radius: 4px; }
.pal-row.on { background: #eaf2fe; }
.pal-help { font-size: 12px; margin-top: 6px; }

/* answer drop-downs */
details.qanswer { margin-top: 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fbfcfe; }
details.qanswer > summary { cursor: pointer; padding: 8px 12px; font-weight: 600; color: var(--link); }
details.qanswer[open] > summary { border-bottom: 1px solid var(--line); }
details.qanswer .qans-body { padding: 10px 12px; font-size: 14px; line-height: 1.55; }
.qans-key { padding: 6px 10px; background: var(--ok-bg); border-radius: 4px; margin-bottom: 6px; }
.qans-warn { margin: 8px 12px 0; font-size: 12.5px; }
.qbank-item { margin-bottom: var(--gap); }
.qbank-item .card-body { font-size: 14.5px; line-height: 1.55; }
.qbank-opts { margin: 0 0 4px; padding-left: 22px; }
.qbank-opts li { margin: 3px 0; }
.qb-filters { grid-template-columns: repeat(3, auto) 1fr auto !important; }

/* best-practice journey (timeline) */
.journey { margin: 0 0 18px; padding: 14px 16px 6px; background: #f3f6fa; border: 1px solid var(--line); border-radius: 8px; }
.jr-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.jr-head h3 { margin: 0; font-size: 16px; }
.jr-line { list-style: none; margin: 0; padding: 0; position: relative; }
.jr-line::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #c9d4e3; border-radius: 2px; }
.jr-mark { position: relative; text-align: center; margin: 14px 0 10px; }
.jr-mark span { position: relative; display: inline-block; padding: 4px 14px; background: var(--primary); color: #fff; border-radius: 14px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.jr-mark.end span { background: var(--ok); }
.jr-post { position: relative; width: 50%; padding: 0 30px 14px; box-sizing: border-box; }
.jr-post.l { margin-right: 50%; }
.jr-post.r { margin-left: 50%; }
.jr-dot { position: absolute; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 3px solid #c9d4e3; display: flex; align-items: center; justify-content: center; color: var(--primary); z-index: 1; box-sizing: border-box; }
.jr-post.l .jr-dot { right: -15px; }
.jr-post.r .jr-dot { left: -15px; }
.jr-dot.ok { color: var(--ok); border-color: #9fd0b1; }
.jr-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 2px rgba(16, 32, 64, .08); padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.jr-card::after { content: ''; position: absolute; top: 22px; width: 12px; height: 12px; background: #fff; border: 1px solid var(--line); transform: rotate(45deg); }
.jr-post.l .jr-card::after { right: -7px; border-left: 0; border-bottom: 0; }
.jr-post.r .jr-card::after { left: -7px; border-right: 0; border-top: 0; }
.jr-card header { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.jr-av { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #e6eef8; color: var(--primary); display: flex; align-items: center; justify-content: center; }
.jr-av.ok { background: var(--ok-bg); color: var(--ok); }
.jr-card p { margin: 0 0 6px; }
.jr-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; }
.jr-tag { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef2f7; border: 1px solid #dbe3ee; }
.jr-tag.dispo { background: #fff4e0; border-color: #f0d49b; }
.jr-crit { margin-top: 6px; padding: 6px 8px; background: #fff9e8; border-left: 3px solid #e0a800; border-radius: 4px; font-size: 13px; }
.jr-card footer { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12.5px; }
.jr-outcome { border-color: #9fd0b1; }
@media (max-width: 900px) {
  .jr-line::before { left: 15px; }
  .jr-post, .jr-post.l, .jr-post.r { width: auto; margin: 0; padding: 0 0 12px 44px; }
  .jr-post.l .jr-dot, .jr-post.r .jr-dot { left: 0; right: auto; }
  .jr-post.l .jr-card::after, .jr-post.r .jr-card::after { left: -7px; right: auto; border: 1px solid var(--line); border-right: 0; border-top: 0; }
  .jr-mark { text-align: left; }
}

.journey:not(.lay-on) .jr-lay { display: none; }
.jr-lay { margin: 2px 0 8px; padding: 7px 10px; background: var(--ok-bg); border-left: 3px solid var(--ok); border-radius: 4px; font-size: 13.5px; line-height: 1.5; }
.jr-lay b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ok); margin-bottom: 2px; }
