/* ============================================================================
   jp-scribe-ops.css — v1.7.50 "Scribe earns the Passport standard"
   ----------------------------------------------------------------------------
   Non-destructive enhancement layer for JetPatient_AI_Scribe.html, mirroring
   the AI Passport conventions already shipped on the Brief:
     · framed workbench shell bar + sticky ops bar with trust chips
     · branded inline-SVG icons (zero emoji)
     · generation THEATER (staged console) on SOAP generation
   Dark-themed to match the Scribe workbench. The authored cases, transcript,
   live endpoint, traceability and code chips are untouched.
   ============================================================================ */

/* ── Keep the SOAP action buttons pinned to the bottom of the right panel,
      so Edit / Review & Sign / Save stay visible no matter the note length ──── */
#soapWrap #actionBtns {
  position: sticky; bottom: -16px; z-index: 3;
  margin: 8px -18px -16px; padding: 12px 18px 16px;
  background: linear-gradient(180deg, rgba(8,24,40,0), #0a1c30 34%);
  border-top: 1px solid rgba(0,201,192,.14);
}
html[data-theme="light"] #soapWrap #actionBtns {
  background: linear-gradient(180deg, rgba(246,248,252,0), #F6F8FC 34%);
  border-top-color: rgba(13,30,66,.08);
}

/* ── E1 · Live consultation — pre-gen actions, waveform, streaming, build ───── */
.gen-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#jpsLiveBtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 12px; cursor: pointer;
  border: none; font-family: inherit; font-size: 14px; font-weight: 800; letter-spacing: .01em;
  background: linear-gradient(135deg, #00C9C0, #00A89F); color: #04102A;
  box-shadow: 0 8px 22px rgba(0,201,192,.32); transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
#jpsLiveBtn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 11px 28px rgba(0,201,192,.4); }
#jpsLiveBtn:active { transform: translateY(0); }
/* the instant path becomes the secondary action */
#generateWrap #generateBtn { background: rgba(255,255,255,.06) !important; border: 1px solid rgba(255,255,255,.18) !important; color: rgba(255,255,255,.82) !important; box-shadow: none !important; min-height: 44px; }
#generateWrap #generateBtn:hover { border-color: rgba(0,201,192,.5) !important; color: #7FE7E2 !important; }
html[data-theme="light"] #generateWrap #generateBtn { background: #fff !important; border-color: #D2DBEA !important; color: #0A2D6E !important; }

/* live audio waveform */
.jps-wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; margin-right: 6px; }
.jps-wave.sm { height: 13px; margin: 0 2px; }
.jps-wave i { width: 2.5px; border-radius: 2px; background: #00C9C0; animation: jpsWave 1s ease-in-out infinite; }
.jps-wave i:nth-child(1){animation-delay:0s} .jps-wave i:nth-child(2){animation-delay:.12s}
.jps-wave i:nth-child(3){animation-delay:.24s} .jps-wave i:nth-child(4){animation-delay:.36s}
.jps-wave i:nth-child(5){animation-delay:.48s} .jps-wave i:nth-child(6){animation-delay:.6s}
@keyframes jpsWave { 0%,100% { height: 4px; opacity:.55; } 50% { height: 16px; opacity:1; } }
.jps-wave.sm i { animation-name: jpsWaveSm; }
@keyframes jpsWaveSm { 0%,100% { height: 3px; opacity:.55; } 50% { height: 13px; opacity:1; } }

/* listening banner in the right (note) panel */
.jps-live-banner { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 11px; flex-shrink: 0;
  background: rgba(0,201,192,.08); border: 1px solid rgba(0,201,192,.26); }
.jps-live-banner .jps-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #F43F5E; flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(244,63,94,.5); animation: jpsRec 1.4s infinite; }
@keyframes jpsRec { 0% { box-shadow: 0 0 0 0 rgba(244,63,94,.5); } 70% { box-shadow: 0 0 0 7px rgba(244,63,94,0); } 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); } }
.jps-live-banner .jps-live-txt { font-size: 12px; font-weight: 700; color: #7FE7E2; flex: 1; min-width: 0; }
.jps-skip { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); color: rgba(255,255,255,.7);
  font-family: inherit; font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 8px; cursor: pointer; flex: 0 0 auto; }
.jps-skip:hover { border-color: rgba(0,201,192,.5); color: #7FE7E2; }
html[data-theme="light"] .jps-live-banner .jps-live-txt { color: #00766F; }
html[data-theme="light"] .jps-skip { border-color: #D2DBEA; background: #fff; color: #44546F; }

/* transcript line streams in */
.t-line.jps-streamin { opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
.t-line.jps-streamin.shown { opacity: 1; transform: none; }
/* the transcript line a section just cited briefly glows */
.t-line.jps-cite .t-bubble { box-shadow: 0 0 0 2px rgba(0,201,192,.55); transition: box-shadow .3s ease; }
/* a section being written gets a brief teal edge */
.soap-section.jps-writing { box-shadow: -2px 0 0 0 rgba(0,201,192,.6) inset; }

/* ── E2 · Trust layer — sourced + confidence-graded note ───────────────────── */
.jps-trustbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 11px; flex-shrink: 0; margin-bottom: 2px;
  background: rgba(0,201,192,.07); border: 1px solid rgba(0,201,192,.24); }
.jps-trustbar.has-flags { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.3); }
.jps-tb-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.jps-tb-l .sic { color: #00C9C0; width: 15px; height: 15px; flex: 0 0 auto; }
.jps-trustbar.has-flags .jps-tb-l .sic { color: #FBBF24; }
.jps-tb-l b { font-size: 12px; font-weight: 800; color: #fff; }
.jps-tb-sub { font-size: 10.5px; color: rgba(255,255,255,.5); font-weight: 600; }
.jps-tb-btn { display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-size: 11px; font-weight: 800;
  color: #4a3a10; background: linear-gradient(180deg,#FCD34D,#FBBF24); border: none; border-radius: 8px; padding: 6px 11px; cursor: pointer; }
.jps-tb-btn:hover { filter: brightness(1.05); }
.jps-tb-btn .sic { width: 12px; height: 12px; }
.jps-tb-clear { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: #00C9C0; }
.jps-tb-clear .sic { width: 13px; height: 13px; }

/* per-line confidence mark + hover tip (high sits quiet, low is flagged) */
.soap-item { position: relative; }
.soap-item .jps-conf { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px;
  vertical-align: -2px; margin-left: 6px; flex: 0 0 auto; cursor: default; }
.soap-item .jps-conf .sic { width: 12px; height: 12px; }
.soap-item .jps-conf.high { color: rgba(0,201,192,.55); opacity: 0; transition: opacity .15s ease; }
.soap-item:hover .jps-conf.high { opacity: 1; }
.soap-item .jps-conf.low { color: #FBBF24; }
.jps-tip { position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 20; width: max-content; max-width: 240px;
  background: #0a2036; color: #fff; border: 1px solid rgba(0,201,192,.3); border-radius: 8px; padding: 6px 9px;
  font-size: 10.5px; font-weight: 600; line-height: 1.35; text-align: left; box-shadow: 0 10px 28px rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .14s ease, transform .14s ease; }
.soap-item .jps-conf:hover .jps-tip { opacity: 1; transform: none; }
.soap-item.jps-verify { background: rgba(251,191,36,.06); border-radius: 8px; padding: 2px 8px; margin-left: -8px; }
.soap-item.jps-verify > span:first-child { color: #FBBF24 !important; }
.soap-item.jps-verify-active { box-shadow: 0 0 0 2px rgba(251,191,36,.6); }
.soap-item.jps-sourced { cursor: pointer; }
.soap-item.jps-sourced:hover { background: rgba(0,201,192,.05); border-radius: 8px; }
/* the transcript line a SOAP item is spotlighting */
.t-line.jps-spot .t-bubble { box-shadow: 0 0 0 2px rgba(0,201,192,.7); background: rgba(0,201,192,.08) !important; }

html[data-theme="light"] .jps-tb-l b { color: #0A2D6E; }
html[data-theme="light"] .jps-tb-sub { color: #5A6B8C; }
html[data-theme="light"] .jps-tip { background: #fff; color: #1A2B42; box-shadow: 0 10px 28px rgba(10,45,110,.18); }

/* ── E3 · Time-back & coding value strip ───────────────────────────────────── */
.jps-value { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.jps-val-cell { display: flex; align-items: center; gap: 9px; flex: 1 1 200px; min-width: 0;
  padding: 9px 12px; border-radius: 11px; background: rgba(0,201,192,.07); border: 1px solid rgba(0,201,192,.24); }
.jps-val-cell.code { background: rgba(99,102,241,.08); border-color: rgba(99,102,241,.3); }
.jps-val-cell .sic { width: 17px; height: 17px; color: #00C9C0; flex: 0 0 auto; }
.jps-val-lvl { font-size: 13px; font-weight: 900; letter-spacing: .01em; color: #A5B4FC; flex: 0 0 auto;
  background: rgba(99,102,241,.16); border: 1px solid rgba(99,102,241,.4); border-radius: 8px; padding: 4px 8px; }
.jps-val-cell .tx { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.jps-val-cell .tx b { font-size: 13px; font-weight: 800; color: #fff; }
.jps-val-cell.time .tx b { color: #7FE7E2; }
.jps-val-cell .tx small { font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,.55); }
.jps-val-cell .tx small .upl { color: #34D399; font-weight: 800; }
.jps-val-cell .tx small.nudge { color: rgba(165,180,252,.85); font-weight: 700; }
html[data-theme="light"] .jps-val-cell .tx b { color: #0A2D6E; }
html[data-theme="light"] .jps-val-cell.time .tx b { color: #00766F; }
html[data-theme="light"] .jps-val-cell .tx small { color: #5A6B8C; }
html[data-theme="light"] .jps-val-lvl { color: #4F46E5; }
html[data-theme="light"] .jps-val-cell .tx small.nudge { color: #6366F1; }

/* ── E4 · Clinical co-pilot card ───────────────────────────────────────────── */
.jps-copilot { margin-top: 10px; padding: 12px 14px; border-radius: 13px;
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(0,201,192,.06)); border: 1px solid rgba(99,102,241,.3); }
.jps-cop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.jps-cop-head .sic { color: #A5B4FC; width: 16px; height: 16px; }
.jps-cop-head b { font-size: 13px; font-weight: 800; color: #fff; }
.jps-cop-head span { font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,.45); }
.jps-cop-list { display: flex; flex-direction: column; gap: 6px; }
.jps-cop-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); transition: opacity .2s ease; }
.jps-cop-row.done { opacity: .6; }
.jps-cop-tag { font-size: 8.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px;
  border-radius: 6px; flex: 0 0 auto; }
.jps-cop-tag.safety { color: #FCA5A5; background: rgba(244,63,94,.14); border: 1px solid rgba(244,63,94,.32); }
.jps-cop-tag.gap { color: #FBBF24; background: rgba(251,191,36,.14); border: 1px solid rgba(251,191,36,.32); }
.jps-cop-tag.order { color: #7FE7E2; background: rgba(0,201,192,.14); border: 1px solid rgba(0,201,192,.32); }
.jps-cop-tag.guide { color: #A5B4FC; background: rgba(99,102,241,.16); border: 1px solid rgba(99,102,241,.34); }
.jps-cop-txt { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.82); line-height: 1.4; }
.jps-cop-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; font-family: inherit; font-size: 11px; font-weight: 800;
  color: #04102A; background: linear-gradient(180deg,#7FE7E2,#00C9C0); border: none; border-radius: 8px; padding: 5px 11px; cursor: pointer; white-space: nowrap; transition: filter .14s ease; }
.jps-cop-btn:hover { filter: brightness(1.06); }
.jps-cop-btn .sic { width: 12px; height: 12px; }
.jps-cop-row.done .jps-cop-btn { background: rgba(0,201,192,.16); color: #00C9C0; cursor: default; }
.jps-cop-added .jps-cop-by { font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #A5B4FC;
  background: rgba(99,102,241,.14); border: 1px solid rgba(99,102,241,.3); border-radius: 5px; padding: 1px 6px; margin-left: 5px; }
html[data-theme="light"] .jps-cop-head b { color: #0A2D6E; }
html[data-theme="light"] .jps-cop-head span { color: #5A6B8C; }
html[data-theme="light"] .jps-cop-row { background: rgba(255,255,255,.7); border-color: rgba(13,30,66,.08); }
html[data-theme="light"] .jps-cop-txt { color: #33415C; }

/* ── E5 · Push-to-EHR modal ────────────────────────────────────────────────── */
.jps-modal.jps-ehr { max-width: 560px; }
.jps-ehr-bd { padding: 16px 18px 18px; }
.jps-ehr-intro { font-size: 12px; color: rgba(255,255,255,.6); margin-bottom: 12px; }
.jps-ehr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; transition: opacity .3s ease; }
.jps-ehr-col { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 11px; padding: 10px 11px; }
.jps-ehr-col.prob { border-color: rgba(244,63,94,.28); } .jps-ehr-col.ord { border-color: rgba(0,201,192,.28); }
.jps-ehr-col.bill { border-color: rgba(99,102,241,.32); } .jps-ehr-col.lab { border-color: rgba(251,191,36,.3); }
.jps-ehr-h { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 7px; }
.jps-ehr-h .sic { width: 13px; height: 13px; color: #00C9C0; }
.jps-ehr-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.jps-ehr-col li { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,.82); line-height: 1.35; }
.jps-ehr-col li.empty { color: rgba(255,255,255,.3); }
.jps-ehr-x { flex: 0 0 auto; opacity: 0; transition: opacity .3s ease; }
.jps-ehr-x .sic { width: 12px; height: 12px; color: #00C9C0; vertical-align: -1px; }
.jps-ehr-grid.filed .jps-ehr-x { opacity: 1; }
.jps-ehr-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 13px; padding: 10px 12px; border-radius: 10px;
  background: rgba(0,201,192,.06); border: 1px solid rgba(0,201,192,.22); font-size: 12px; font-weight: 700; color: #7FE7E2; }
.jps-ehr-status.done { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.34); color: #34D399; }
.jps-ehr-status .sic { width: 14px; height: 14px; }
.jps-ehr-status b { color: #fff; font-weight: 800; }
.jps-ehr-close { margin-left: auto; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff;
  font-family: inherit; font-size: 11px; font-weight: 800; padding: 5px 13px; border-radius: 8px; cursor: pointer; }
.jps-ehr-close:hover { border-color: rgba(0,201,192,.5); }
@media (max-width: 560px) { .jps-ehr-grid { grid-template-columns: 1fr; } }
html[data-theme="light"] .jps-ehr-intro { color: #5A6B8C; }
html[data-theme="light"] .jps-ehr-col { background: #F6F8FC; border-color: rgba(13,30,66,.1); }
html[data-theme="light"] .jps-ehr-col li { color: #33415C; }
html[data-theme="light"] .jps-ehr-h { color: #5A6B8C; }
html[data-theme="light"] .jps-ehr-status b { color: #0A2D6E; }
html[data-theme="light"] .jps-ehr-close { color: #0A2D6E; border-color: #D2DBEA; background: #fff; }

/* ── E6 · Bilingual patient handoff (phone mockup) ─────────────────────────── */
.jps-handoff-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-family: inherit; font-size: 11.5px; font-weight: 800;
  color: #04102A; background: linear-gradient(180deg,#7FE7E2,#00C9C0); border: none; border-radius: 9px; padding: 7px 13px; cursor: pointer; transition: filter .14s ease; }
.jps-handoff-btn:hover { filter: brightness(1.05); }
.jps-handoff-btn .sic { width: 13px; height: 13px; }
.jps-modal.jps-handoff { max-width: 540px; }
.jps-handoff .hd { position: relative; }
.jps-ho-langs { margin-left: auto; display: inline-flex; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; overflow: hidden; }
.jps-ho-langs button { min-width: 34px; min-height: 26px; border: none; background: transparent; color: rgba(255,255,255,.6); font-family: inherit; font-weight: 800; font-size: 11px; cursor: pointer; }
.jps-ho-langs button.on { background: linear-gradient(180deg,#00C9C0,#00A89F); color: #04102A; }
.jps-ho-bd { display: flex; gap: 16px; padding: 18px 20px 20px; align-items: flex-start; flex-wrap: wrap; }
.jps-phone { width: 240px; flex: 0 0 auto; margin: 0 auto; background: #060f1e; border: 8px solid #1a2740; border-radius: 30px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5); overflow: hidden; position: relative; }
.jps-phone-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 90px; height: 18px; background: #1a2740; border-radius: 0 0 12px 12px; z-index: 2; }
.jps-phone-top { display: flex; align-items: center; gap: 9px; padding: 22px 14px 11px; background: linear-gradient(135deg,#04102A,#0A2D6E); border-bottom: 1px solid rgba(0,201,192,.2); }
.jps-ho-av { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 11px; font-weight: 900; flex: 0 0 auto;
  background: rgba(0,201,192,.16); border: 1px solid rgba(0,201,192,.4); color: #00C9C0; }
.jps-ho-who { min-width: 0; }
.jps-ho-who b { display: block; font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jps-ho-who small { display: flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 700; color: #7FE7E2; }
.jps-ho-who small .sic { width: 9px; height: 9px; }
.jps-phone-thread { padding: 14px 12px 18px; min-height: 180px; background: radial-gradient(circle at 30% 0,rgba(0,201,192,.05),transparent 60%); }
.jps-ho-bubble { position: relative; background: #11398A; color: #eef4ff; font-size: 12px; line-height: 1.5; font-weight: 500;
  padding: 11px 13px 18px; border-radius: 4px 14px 14px 14px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.jps-ho-time { position: absolute; right: 9px; bottom: 5px; font-size: 8.5px; color: rgba(255,255,255,.45); font-weight: 600; }
.jps-ho-deliv { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 6px; font-size: 9px; font-weight: 700; color: #34D399; }
.jps-ho-deliv .sic { width: 10px; height: 10px; }
.jps-ho-side { flex: 1; min-width: 160px; }
.jps-ho-sub { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6); line-height: 1.5; }
html[data-theme="light"] .jps-ho-sub { color: #5A6B8C; }
html[data-theme="light"] .jps-ho-langs { border-color: rgba(255,255,255,.3); }

/* ── icon sizing (stroke = currentColor) ───────────────────────────────────── */
.sic { width: 14px; height: 14px; flex: 0 0 auto; display: inline-block; vertical-align: -.15em; }

/* ── Branded workbench card — one centered, contained frame ─────────────────── */
#jps-frame {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  width: 85%; max-width: 1200px; margin: 0 auto;        /* ~15% narrower, centered, responsive */
  background: rgba(7,18,34,.55);
  border: 1px solid rgba(0,201,192,.22); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(0,201,192,.06), 0 0 70px rgba(0,201,192,.06);
  position: relative; z-index: 1;
}

/* ── Workbench shell bar (caps the card — the frame provides the border/radius) ── */
#jps-shellbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0; padding: 12px 18px; flex-shrink: 0; position: relative; z-index: 2;
  background: linear-gradient(135deg, rgba(4,16,42,.96) 0%, rgba(10,45,110,.62) 100%);
  border: none; border-bottom: 1px solid rgba(0,201,192,.16);
}
.jps-sh-l { display: flex; align-items: center; gap: 11px; min-width: 0; }
.jps-sh-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center;
  color: #00C9C0; background: rgba(0,201,192,.12); border: 1px solid rgba(0,201,192,.38);
}
.jps-sh-mark .sic { width: 14px; height: 14px; }
.jps-sh-title { color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.jps-sh-title em { font-style: normal; font-weight: 700; font-size: 10.5px; color: rgba(127,231,226,.85);
  margin-left: 8px; letter-spacing: .06em; text-transform: uppercase; }
.jps-sh-r { display: flex; align-items: center; gap: 10px; }
.jps-sh-chip { font-size: 9px; font-weight: 800; letter-spacing: .1em; color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.jps-sh-live { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800;
  color: #7FE7E2; letter-spacing: .04em; white-space: nowrap; }
.jps-sh-live i { width: 7px; height: 7px; border-radius: 50%; background: #00C9C0;
  box-shadow: 0 0 0 0 rgba(0,201,192,.5); animation: jpsPulse 2s infinite; }
@keyframes jpsPulse { 0% { box-shadow: 0 0 0 0 rgba(0,201,192,.45); } 70% { box-shadow: 0 0 0 7px rgba(0,201,192,0); } 100% { box-shadow: 0 0 0 0 rgba(0,201,192,0); } }

/* ── Operations bar (trust chips · actions) ────────────────────────────────── */
#jps-ops {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin: 0; padding: 9px 18px; flex-shrink: 0; position: relative; z-index: 2;
  background: rgba(6,16,32,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: none; border-bottom: 1px solid rgba(0,201,192,.14);
}

/* ── #mainArea fills the card below the bars (frame provides border/radius) ──── */
#mainArea { margin: 0 !important; flex: 1 1 auto; min-height: 0; overflow: hidden; }

@media (max-width: 768px) {
  #jps-frame { width: 94%; max-width: none; border-radius: 14px; }
}
html[data-theme="light"] #jps-frame {
  background: rgba(255,255,255,.62); border-color: rgba(0,201,192,.3);
  box-shadow: 0 24px 64px rgba(10,45,110,.16), 0 0 0 1px rgba(0,201,192,.08);
}
.jps-trust { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.jps-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800;
  letter-spacing: .04em; padding: 4px 9px; border-radius: 999px;
  background: rgba(0,201,192,.09); border: 1px solid rgba(0,201,192,.26); color: #7FE7E2; }
.jps-chip.src { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); color: rgba(255,255,255,.6); }
.jps-chip .sic { width: 11px; height: 11px; }
.jps-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── language toggle (T4 wires behavior; styled here) ──────────────────────── */
.jps-langs { display: inline-flex; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04);
  border-radius: 10px; overflow: hidden; }
.jps-lang { min-width: 40px; min-height: 32px; border: none; cursor: pointer; background: transparent;
  color: rgba(255,255,255,.5); font-weight: 800; font-size: 11.5px; font-family: inherit; transition: all .15s ease; }
.jps-lang:hover { color: #fff; background: rgba(255,255,255,.06); }
.jps-lang.active { background: linear-gradient(180deg,#00C9C0,#00A89F); color: #04102A; }

/* ── ops-bar buttons (polished) ────────────────────────────────────────────── */
.jps-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 13px;
  border-radius: 10px; cursor: pointer; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05); color: rgba(255,255,255,.82); font-weight: 800; font-size: 11.5px;
  font-family: inherit; transition: transform .14s ease, background .14s ease, border-color .14s ease, color .14s ease; }
.jps-btn:hover { border-color: rgba(0,201,192,.55); color: #7FE7E2; background: rgba(0,201,192,.08); transform: translateY(-1px); }
.jps-btn:active { transform: translateY(0); }
.jps-btn:focus-visible, .jps-lang:focus-visible { outline: 2px solid #00C9C0; outline-offset: 2px; }

/* ── Generation theater console (the labor illusion) ───────────────────────── */
.jps-console { max-width: 440px; margin: 6% auto 0; padding: 20px 22px 22px; width: 100%;
  background: rgba(8,20,40,.78); border: 1px solid rgba(0,201,192,.2); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.jps-cons-head { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; color: #fff; font-size: 14px; }
.jps-cons-head .sic { color: #00C9C0; width: 16px; height: 16px; animation: jpsSpark 1.6s ease-in-out infinite; }
@keyframes jpsSpark { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18) rotate(8deg); opacity: .72; } }
.jps-cons-head b { font-weight: 800; }
.jps-cons-head .who { color: rgba(255,255,255,.5); font-weight: 600; font-size: 12.5px; }
.jps-cons-steps { display: flex; flex-direction: column; gap: 3px; }
.jps-cons-row { display: flex; align-items: center; gap: 11px; padding: 7px 9px; border-radius: 9px;
  opacity: .34; transition: opacity .25s ease, background .25s ease; }
.jps-cons-row.active { opacity: 1; background: rgba(0,201,192,.08); }
.jps-cons-row.done { opacity: .82; }
.jps-cons-row .ic { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; position: relative; }
.jps-cons-row .ic .sic { display: none; color: #00C9C0; width: 13px; height: 13px; }
.jps-cons-row.done .ic .sic { display: block; animation: jpsPop .3s ease; }
@keyframes jpsPop { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.jps-spin { width: 13px; height: 13px; border-radius: 50%; display: none;
  border: 2px solid rgba(0,201,192,.25); border-top-color: #00C9C0; animation: jpsRot .7s linear infinite; }
.jps-cons-row.active .jps-spin { display: block; }
.jps-cons-row.done .jps-spin { display: none; }
@keyframes jpsRot { to { transform: rotate(360deg); } }
.jps-cons-row .tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.jps-cons-row .tx b { color: #fff; font-size: 12.5px; font-weight: 800; }
.jps-cons-row .tx small { color: rgba(255,255,255,.45); font-size: 11px; font-weight: 600; }
.jps-cons-row .tm { color: rgba(127,231,226,.6); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.jps-cons-bar { height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); margin: 15px 0 13px; overflow: hidden; }
.jps-cons-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#00C9C0,#4D7CFE);
  border-radius: 999px; transition: width .55s cubic-bezier(.3,.7,.3,1); }
.jps-skel { display: flex; flex-direction: column; gap: 7px; }
.jps-skel i { display: block; height: 10px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.05) 75%);
  background-size: 240% 100%; animation: jpsShimmer 1.3s linear infinite; }
.jps-skel i:nth-child(2) { width: 84%; }
.jps-skel i:nth-child(3) { width: 62%; }
@keyframes jpsShimmer { from { background-position: 200% 0; } to { background-position: -40% 0; } }

/* ── F3 · searchable patient combobox (replaces the horizontal tabs) ───────── */
#jps-psel-wrap { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; background: rgba(0,0,0,.22); border-bottom: 1px solid rgba(255,255,255,.06); }
.jps-psel-cap { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.4); flex: 0 0 auto; }
#jps-psel { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; min-height: 50px; padding: 8px 9px 8px 14px;
  border-radius: 13px; cursor: pointer; font-family: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05)); border: 1.5px solid rgba(255,255,255,.2);
  box-shadow: 0 3px 12px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.06);
  color: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
#jps-psel:hover { border-color: rgba(0,201,192,.55); background: rgba(0,201,192,.07); }
#jps-psel[aria-expanded="true"] { border-color: rgba(0,201,192,.7); background: rgba(0,201,192,.08); }
#jps-psel:focus-visible { outline: 2px solid #00C9C0; outline-offset: 2px; }
.jps-psel-lead { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; color: rgba(255,255,255,.5); }
.jps-psel-lead .sic { width: 14px; height: 14px; }
.jps-psel-av { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 900; background: linear-gradient(135deg, rgba(0,201,192,.22), rgba(10,45,110,.28)); border: 1px solid rgba(0,201,192,.4); color: #5EEAE2; }
.jps-psel-name { font-weight: 800; font-size: 14px; white-space: nowrap; }
.jps-psel-sub { font-size: 11.5px; color: rgba(255,255,255,.5); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.jps-psel-chevbox { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; margin-left: auto;
  background: rgba(0,201,192,.13); border: 1px solid rgba(0,201,192,.3); color: #00C9C0; transition: background .15s; }
.jps-psel-chevbox .sic { width: 14px; height: 14px; transition: transform .15s; }
#jps-psel[aria-expanded="true"] .jps-psel-chevbox { background: rgba(0,201,192,.24); }
#jps-psel[aria-expanded="true"] .jps-psel-chevbox .sic { transform: rotate(180deg); }

.jps-psel-panel { position: fixed; z-index: 9000; width: 440px; max-width: 92vw; max-height: 62vh; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(155deg,#0a2036,#08182b); border: 1px solid rgba(0,201,192,.25); border-radius: 13px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.jps-psel-panel[hidden] { display: none; }
.jps-psel-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.jps-psel-search .sic { width: 14px; height: 14px; color: rgba(255,255,255,.4); }
#jps-psel-input { flex: 1; background: transparent; border: none; outline: none; color: #fff; font-family: inherit; font-size: 13px; font-weight: 600; }
#jps-psel-input::placeholder { color: rgba(255,255,255,.35); }
.jps-psel-list { overflow-y: auto; padding: 6px; }
.jps-psel-group { font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.35); padding: 8px 8px 4px; }
.jps-psel-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 9px; border-radius: 9px; cursor: pointer;
  border: none; background: transparent; font-family: inherit; text-align: left; color: #fff; transition: background .12s; }
.jps-psel-item:hover, .jps-psel-item.kbd { background: rgba(0,201,192,.1); }
.jps-psel-item.active { background: rgba(0,201,192,.14); }
.jps-psel-item .jps-psel-av { width: 28px; height: 28px; }
.jps-psel-item .it-tx { min-width: 0; flex: 1; }
.jps-psel-item .it-tx b { display: block; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jps-psel-item .it-tx small { display: block; font-size: 10.5px; color: rgba(255,255,255,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jps-psel-item .it-chk { margin-left: auto; color: #00C9C0; display: none; flex: 0 0 auto; }
.jps-psel-item.active .it-chk { display: block; }
.jps-psel-empty { padding: 18px; text-align: center; color: rgba(255,255,255,.4); font-size: 12px; }
html[data-theme="light"] #jps-psel-wrap { background: rgba(10,45,110,.04); border-bottom-color: rgba(228,233,242,.7); }
html[data-theme="light"] .jps-psel-cap { color: #8595AD; }
html[data-theme="light"] #jps-psel { background: linear-gradient(180deg,#fff,#f4f7fc); border-color: #BFccE0;
  box-shadow: 0 1px 3px rgba(10,45,110,.1), inset 0 1px 0 #fff; color: #0A2D6E; }
html[data-theme="light"] #jps-psel:hover { border-color: #00A89F; }
html[data-theme="light"] #jps-psel[aria-expanded="true"] { border-color: #00A89F; background: #fff; }
html[data-theme="light"] .jps-psel-lead { color: #7C8AA5; }
html[data-theme="light"] .jps-psel-sub { color: #5A6B8C; }
html[data-theme="light"] .jps-psel-chevbox { background: rgba(0,201,192,.12); border-color: rgba(0,168,159,.4); color: #08857B; }
html[data-theme="light"] #jps-psel[aria-expanded="true"] .jps-psel-chevbox { background: rgba(0,201,192,.2); }
html[data-theme="light"] .jps-psel-panel { background: #fff; border-color: #D7DEEA; box-shadow: 0 24px 60px rgba(10,45,110,.16); }
html[data-theme="light"] #jps-psel-input { color: #0A2D6E; }
html[data-theme="light"] .jps-psel-item { color: #0A2D6E; }
html[data-theme="light"] .jps-psel-item .it-tx small { color: #5A6B8C; }
html[data-theme="light"] .jps-psel-group { color: #94A3B8; }

/* ── T5 · branded export modal + toast ─────────────────────────────────────── */
.jps-scrim { position: fixed; inset: 0; z-index: 10001; background: rgba(2,8,24,.62);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.jps-scrim[hidden] { display: none; }
.jps-modal { width: 100%; max-width: 410px; border-radius: 18px; overflow: hidden; transform: translateZ(0);
  background: linear-gradient(155deg,#0a2036,#08182b); border: 1px solid rgba(0,201,192,.25); box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.jps-modal .hd { background: linear-gradient(135deg,#04102A,#0A2D6E); padding: 16px 20px; display: flex; align-items: center; gap: 10px; }
.jps-modal .hd .mk { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto; background: rgba(0,201,192,.12);
  display: grid; place-items: center; color: #00C9C0; border: 1px solid rgba(0,201,192,.4); }
.jps-modal .hd .mk .sic { width: 13px; height: 13px; }
.jps-modal .hd b { color: #fff; font-size: 15px; }
.jps-modal .bd { padding: 18px 20px; color: rgba(255,255,255,.72); font-size: 13.5px; line-height: 1.55; }
.jps-modal .ft { display: flex; gap: 10px; padding: 0 20px 18px; }
.jps-modal .ft button { flex: 1; min-height: 46px; border-radius: 12px; border: none; cursor: pointer; font-weight: 800;
  font-size: 13.5px; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transform: translateZ(0); transition: transform .14s ease, filter .14s ease; }
.jps-modal .ft button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.jps-modal .ft .go { background: linear-gradient(135deg,#00C9C0,#00A89F); color: #04102A; }
.jps-modal .ft .no { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: #fff; }
.jps-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10002; background: #0A2D6E;
  color: #fff; font-size: 13px; font-weight: 700; padding: 11px 18px; border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.4);
  border: 1px solid rgba(0,201,192,.4); display: inline-flex; align-items: center; gap: 8px; }
.jps-toast .sic { color: #00C9C0; }

/* ── T5 · Print: the SOAP note is the page ─────────────────────────────────── */
@media print {
  #nav, #page-hero, .jp-hero, .jp-footer, .jps-cta-band, #jps-shellbar, #jps-ops, #jps-psel-wrap, #ptTabs,
  #leftPanel, #wzFab, #jpScribeSeg, #wzOverlay, #wzCard, #wzHL, #actionBtns, .avs-tabs { display: none !important; }
  #app { padding: 0 !important; min-height: 0 !important; height: auto !important; background: #fff !important; }
  #mainArea { display: block !important; height: auto !important; overflow: visible !important; }
  #rightPanel { width: 100% !important; height: auto !important; overflow: visible !important; padding: 0 !important; }
  body { background: #fff !important; }
  .soap-section, .soap-text, .soap-item, .soap-item strong, .confidence-badge, .avs-block, .avs-body, .avs-h { color: #111 !important; }
  .soap-item span { color: #00766F !important; }
  .soap-label { color: #00766F !important; border-bottom-color: rgba(0,118,111,.25) !important; }
  .soap-section { opacity: 1 !important; transform: none !important; }
}

/* ── T7 · closing CTA band ─────────────────────────────────────────────────── */
.jps-cta-band { text-align: center; padding: 56px 24px 64px; background: linear-gradient(180deg,#071525,#0a1d35); border-top: 1px solid rgba(0,201,192,.12); position: relative; z-index: 1; }
.jps-cta-band h2 { font-size: 27px; letter-spacing: -.02em; color: #fff; margin: 0 0 10px; }
.jps-cta-band p { max-width: 580px; margin: 0 auto 22px; color: rgba(255,255,255,.62); font-size: 14.5px; line-height: 1.6; }
.jps-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.jps-cta { display: inline-block; min-height: 48px; line-height: 48px; padding: 0 26px; border-radius: 13px; font-weight: 800; font-size: 14.5px; text-decoration: none; transition: transform .14s ease, box-shadow .14s ease; }
.jps-cta:hover { transform: translateY(-1px); }
.jps-cta.primary { background: linear-gradient(135deg,#00C9C0,#00A89F); color: #04102A; box-shadow: 0 8px 24px rgba(0,201,192,.3); }
.jps-cta.ghost { border: 1.5px solid rgba(255,255,255,.25); color: #fff; }
html[data-theme="light"] .jps-cta-band { background: linear-gradient(180deg,#F4F7FC,#E8F0FA); border-top-color: rgba(0,201,192,.2); }
html[data-theme="light"] .jps-cta-band h2 { color: #0A2D6E; }
html[data-theme="light"] .jps-cta-band p { color: #44546F; }
html[data-theme="light"] .jps-cta.ghost { border-color: rgba(13,30,66,.2); color: #0A2D6E; }

/* ── T8 · ?embed=1 — Clinic Portal Copilot iframe strips marketing chrome ───── */
body.jp-embed #nav, body.jp-embed #page-hero, body.jp-embed .jp-hero,
body.jp-embed .jp-footer, body.jp-embed .jps-cta-band, body.jp-embed #wzFab { display: none !important; }
body.jp-embed #app { padding-top: 12px !important; padding-bottom: 12px !important; height: 100vh; }
body.jp-embed #jps-frame { width: 100%; max-width: none; border-radius: 12px; box-shadow: none; }

/* ── light theme parity ────────────────────────────────────────────────────── */
html[data-theme="light"] #jps-ops { background: rgba(244,247,252,.92); border-color: rgba(13,30,66,.08); border-bottom-color: rgba(0,201,192,.25); }
/* F1 — legible trust chips on the light workbench (darker text, clearer fill/border) */
html[data-theme="light"] .jps-chip { color: #066B63; background: rgba(0,201,192,.13); border-color: rgba(0,150,141,.5); }
html[data-theme="light"] .jps-chip .sic { color: #08857B; }
html[data-theme="light"] .jps-chip.src { color: #2C3A55; background: rgba(13,30,66,.06); border-color: rgba(13,30,66,.18); }
html[data-theme="light"] .jps-chip.src .sic { color: #51618A; }
html[data-theme="light"] .jps-btn { color: #0A2D6E; border-color: #D2DBEA; background: linear-gradient(180deg,#fff,#f5f8fd); }
html[data-theme="light"] .jps-lang { color: #44546F; }
html[data-theme="light"] .jps-console { background: #fff; border-color: #DCE4F0; box-shadow: 0 18px 48px rgba(10,45,110,.12); }
html[data-theme="light"] .jps-cons-head { color: #0A2D6E; }
html[data-theme="light"] .jps-cons-head .who { color: #5A6B88; }
html[data-theme="light"] .jps-cons-row .tx b { color: #15294B; }
html[data-theme="light"] .jps-cons-row .tx small { color: #5A6B8C; }
