/* ============================================================================
   jp-brief-ops.css — v1.7.48 "The workbench earns its keep"
   ----------------------------------------------------------------------------
   Enhancement layer for JetPatient_AI_Brief.html: framed workbench shell,
   ops bar with custom SVG icons, generation-theater console, SOAP card,
   branded modals/toast, CTA band, ?embed=1 chrome-stripping, print CSS.
   ============================================================================ */

/* ── Workbench shell: kill the dead gap, frame the instrument ───────────── */
#app {
  flex-direction: column; height: auto; min-height: 0;
  max-width: 1340px; margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 40px) 64px;
  box-sizing: border-box;
}
#jpb-shellbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px; border-radius: 18px 18px 0 0;
  background: linear-gradient(135deg, #04102A 0%, #0A2D6E 100%);
  border: 1px solid rgba(10, 45, 110, .35); border-bottom: none;
}
.jpb-sh-l { display: flex; align-items: center; gap: 11px; min-width: 0; }
.jpb-sh-mark {
  width: 28px; height: 28px; 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, .4);
}
.jpb-sh-mark .jpb-ic { width: 14px; height: 14px; }
.jpb-sh-title { color: #fff; font-weight: 800; font-size: 14.5px; letter-spacing: -.01em; white-space: nowrap; }
.jpb-sh-title em { font-style: normal; font-weight: 700; font-size: 11px; color: rgba(127, 231, 226, .85);
  margin-left: 8px; letter-spacing: .05em; text-transform: uppercase; }
.jpb-sh-r { display: flex; align-items: center; gap: 10px; }
.jpb-sh-chip { font-size: 9.5px; font-weight: 800; letter-spacing: .1em; color: rgba(255, 255, 255, .65);
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.jpb-sh-live { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800;
  color: #7FE7E2; letter-spacing: .04em; white-space: nowrap; }
.jpb-sh-live i { width: 7px; height: 7px; border-radius: 50%; background: #00C9C0;
  box-shadow: 0 0 0 0 rgba(0, 201, 192, .5); animation: jpbPulse 2s infinite; }
@keyframes jpbPulse { 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); } }

#jpb-main { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow: hidden; }
#jpb-main #briefPanel { flex: 1; }
#mainArea {
  height: clamp(620px, 76vh, 840px); flex: none;
  background: #FDFEFF;
  border: 1px solid #D7DEEA; border-top: none;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 24px 64px rgba(10, 45, 110, .12), 0 4px 14px rgba(10, 45, 110, .06);
}

/* ── icon sizing ────────────────────────────────────────────────────────── */
.jpb-ic { width: 15px; height: 15px; flex: 0 0 auto; display: inline-block; vertical-align: -2px; }
.jpb-chip .jpb-ic { width: 12px; height: 12px; }

/* ── Operations bar ─────────────────────────────────────────────────────── */
.jpb-ops { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; padding: 12px 22px;
  border-bottom: 1px solid rgba(13, 30, 66, .08);
  background: rgba(244, 247, 252, .9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 8; }
.jpb-trust { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jpb-chip { display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em;
  padding: 4.5px 10px; border-radius: 999px;
  background: rgba(0, 201, 192, .10); border: 1px solid rgba(0, 201, 192, .35);
  color: #00766F; }
.jpb-chip.src { background: rgba(13, 30, 66, .06); border-color: rgba(13, 30, 66, .14);
  color: #44546F; }
.jpb-chip.src em { font-style: normal; }
.jpb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jpb-langs { display: inline-flex; border: 1px solid #D2DBEA; background: #fff;
  border-radius: 11px; overflow: hidden; box-shadow: 0 1px 2px rgba(10, 45, 110, .06); }
.jpb-lang { min-width: 42px; min-height: 36px; border: none; cursor: pointer;
  background: transparent; color: #44546F; font-weight: 800; font-size: 12px;
  font-family: inherit; transition: all .15s ease; }
.jpb-lang:hover { color: #0A2D6E; background: #F2F6FC; }
.jpb-lang.active { background: linear-gradient(180deg, #11398A, #0A2D6E); color: #fff; }

/* ── Buttons, polished ──────────────────────────────────────────────────── */
.jpb-btn { display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 0 15px; border-radius: 11px; cursor: pointer;
  border: 1px solid #D2DBEA;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F8FD 100%);
  color: #0A2D6E; font-weight: 800; font-size: 12.5px; font-family: inherit;
  letter-spacing: .01em;
  box-shadow: 0 1px 2px rgba(10, 45, 110, .07), inset 0 1px 0 #fff;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, color .14s ease, filter .14s ease; }
.jpb-btn:hover { border-color: rgba(0, 201, 192, .65); color: #00766F;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(10, 45, 110, .12), inset 0 1px 0 #fff; }
.jpb-btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(10, 45, 110, .08); }
.jpb-btn:focus-visible, .jpb-lang:focus-visible { outline: 2px solid #00C9C0; outline-offset: 2px; }
.jpb-btn.primary { background: linear-gradient(135deg, #00C9C0 0%, #00A89F 100%);
  border: 1px solid rgba(0, 130, 122, .5); color: #04102A;
  box-shadow: 0 5px 16px rgba(0, 201, 192, .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
.jpb-btn.primary:hover { filter: brightness(1.06); color: #04102A; transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 201, 192, .45), inset 0 1px 0 rgba(255, 255, 255, .35); }
.jpb-btn.accent { border-color: rgba(10, 45, 110, .3);
  background: linear-gradient(180deg, #F3F7FF 0%, #E8F0FC 100%); }
.jpb-btn.sent { background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .45);
  color: #0B7A55; pointer-events: none; box-shadow: none; transform: none; }
.jpb-btn[disabled] { opacity: .5; pointer-events: none; box-shadow: none; }

/* ── Generation-theater console (the labor illusion) ────────────────────── */
.jpb-console { max-width: 560px; margin: 7vh auto 0; padding: 22px 24px 24px;
  background: #fff; border: 1px solid #DCE4F0; border-radius: 18px;
  box-shadow: 0 18px 48px rgba(10, 45, 110, .12); }
.jpb-modal.console { padding: 0; background: transparent; border: none; box-shadow: none; max-width: 580px; }
.jpb-modal.console .jpb-console { margin: 0; }
.jpb-cons-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px;
  color: #0A2D6E; font-size: 14.5px; }
.jpb-cons-head .jpb-ic { color: #00A89F; width: 17px; height: 17px; animation: jpbSpark 1.6s ease-in-out infinite; }
@keyframes jpbSpark { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18) rotate(8deg); opacity: .75; } }
.jpb-cons-head b { font-weight: 800; }
.jpb-cons-head .who { color: #5A6B88; font-weight: 600; font-size: 13px; }
.jpb-cons-steps { display: flex; flex-direction: column; gap: 4px; }
.jpb-cons-row { display: flex; align-items: center; gap: 11px; padding: 8px 10px;
  border-radius: 10px; opacity: .38; transition: opacity .25s ease, background .25s ease; }
.jpb-cons-row.active { opacity: 1; background: rgba(0, 201, 192, .07); }
.jpb-cons-row.done { opacity: .85; }
.jpb-cons-row .ic { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; position: relative; }
.jpb-cons-row .ic .jpb-ic { display: none; color: #00A89F; width: 14px; height: 14px; }
.jpb-cons-row.done .ic .jpb-ic { display: block; animation: jpbPop .3s ease; }
@keyframes jpbPop { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.jpb-spin { width: 14px; height: 14px; border-radius: 50%; display: none;
  border: 2px solid rgba(0, 201, 192, .25); border-top-color: #00A89F;
  animation: jpbRot .7s linear infinite; }
.jpb-cons-row.active .jpb-spin { display: block; }
.jpb-cons-row.done .jpb-spin { display: none; }
@keyframes jpbRot { to { transform: rotate(360deg); } }
.jpb-cons-row .tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.jpb-cons-row .tx b { color: #15294B; font-size: 13px; font-weight: 800; }
.jpb-cons-row .tx small { color: #5A6B8C; font-size: 11.5px; font-weight: 600; }
.jpb-cons-row .tm { color: #9AA8C0; font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.jpb-cons-bar { height: 4px; border-radius: 999px; background: rgba(13, 30, 66, .08);
  margin: 16px 0 14px; overflow: hidden; }
.jpb-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); }
.jpb-skel { display: flex; flex-direction: column; gap: 7px; }
.jpb-skel i { display: block; height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(13, 30, 66, .06) 25%, rgba(13, 30, 66, .12) 50%, rgba(13, 30, 66, .06) 75%);
  background-size: 240% 100%; animation: jpbShimmer 1.3s linear infinite; }
.jpb-skel i:nth-child(2) { width: 84%; }
.jpb-skel i:nth-child(3) { width: 62%; }
@keyframes jpbShimmer { from { background-position: 200% 0; } to { background-position: -40% 0; } }

/* ── SOAP card ──────────────────────────────────────────────────────────── */
.jpb-soap-card { margin-top: 16px; }
.jpb-soap-top { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 6px; }
.jpb-soap-top .brief-section-label { margin: 0; }
.jpb-soap-badge { display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 4px 10px;
  border-radius: 999px; color: #8A6D1A;
  background: rgba(255, 193, 7, .12); border: 1px solid rgba(255, 193, 7, .4); }
.jpb-soap-badge .jpb-ic { width: 11px; height: 11px; }
.jpb-soap-sec { display: flex; gap: 13px; padding: 13px 2px;
  border-bottom: 1px dashed rgba(13, 30, 66, .12); }
.jpb-soap-sec:last-of-type { border-bottom: none; }
.jpb-soap-sec .l { width: 28px; height: 28px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 900; font-size: 13px;
  background: linear-gradient(135deg, #0A2D6E, #11398A); color: #7FE7E2; }
.jpb-soap-sec > div { min-width: 0; flex: 1; }
.jpb-soap-sec b { display: block; font-size: 12px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 4px; }
.jpb-soap-sec p { margin: 0; font-size: 13.5px; line-height: 1.6; }
.jpb-soap-sec ul { margin: 0; padding-left: 17px; font-size: 13.5px; line-height: 1.65; }
.jpb-soap-sec li.warn { color: #B96A00; }
.jpb-soap-foot { margin-top: 12px; font-size: 11px; font-weight: 700; color: #5A6B8C; }

/* ── Provenance tags on highlight rows ──────────────────────────────────── */
.jpb-prov { display: inline-block; margin-left: 8px; padding: 1.5px 7px;
  border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: .05em;
  background: rgba(13, 30, 66, .05); border: 1px solid rgba(13, 30, 66, .12);
  color: #5A6B88; vertical-align: middle; white-space: nowrap; }

/* ── Language note ──────────────────────────────────────────────────────── */
.jpb-langnote { margin: 0 0 14px; padding: 9px 14px; border-radius: 10px;
  font-size: 12px; font-weight: 600; color: #00766F;
  background: rgba(0, 201, 192, .08); border: 1px solid rgba(0, 201, 192, .3); }

/* ── Modals + toast (self-contained, branded) ───────────────────────────── */
.jpb-scrim { position: fixed; inset: 0; z-index: 10001; background: rgba(2, 8, 24, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.jpb-scrim[hidden] { display: none; }
.jpb-modal { width: 100%; max-width: 400px; border-radius: 18px; overflow: hidden;
  background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.jpb-modal .hd { background: linear-gradient(135deg, #04102A, #0A2D6E);
  padding: 16px 20px; display: flex; align-items: center; gap: 10px; }
.jpb-modal .hd .mk { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  background: rgba(255, 255, 255, .1); display: grid; place-items: center;
  color: #00C9C0; border: 1px solid rgba(0, 201, 192, .45); }
.jpb-modal .hd .mk .jpb-ic { width: 13px; height: 13px; }
.jpb-modal .hd b { color: #fff; font-size: 15px; }
.jpb-modal .bd { padding: 18px 20px; color: #33415C; font-size: 13.5px; line-height: 1.55; }
.jpb-modal .ft { display: flex; gap: 10px; padding: 0 20px 18px; }
.jpb-modal .ft button { flex: 1; min-height: 46px; border-radius: 12px; border: none;
  cursor: pointer; font-weight: 800; font-size: 14px; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease; }
.jpb-modal .ft button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.jpb-modal .ft .go { background: linear-gradient(135deg, #00C9C0, #00A89F); color: #04102A;
  box-shadow: 0 6px 18px rgba(0, 201, 192, .35); }
.jpb-modal .ft .no { background: #fff; border: 1.5px solid #D7DEEA; color: #0A2D6E; }
.jpb-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, .35);
  border: 1px solid rgba(0, 201, 192, .4);
  display: inline-flex; align-items: center; gap: 8px; }
.jpb-toast .jpb-ic { color: #00C9C0; }

/* ── Closing CTA band (AI Passport convention) ──────────────────────────── */
.jpb-cta-band { text-align: center; padding: 56px 24px 64px;
  background: linear-gradient(180deg, #F4F7FC 0%, #E8F0FA 100%); }
.jpb-cta-band h2 { font-size: 28px; letter-spacing: -.02em; color: #0A2D6E; margin: 0 0 10px; }
.jpb-cta-band p { max-width: 560px; margin: 0 auto 22px; color: #44546F;
  font-size: 14.5px; line-height: 1.6; }
.jpb-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.jpb-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; }
.jpb-cta:hover { transform: translateY(-1px); }
.jpb-cta.primary { background: linear-gradient(135deg, #00C9C0, #00A89F); color: #04102A;
  box-shadow: 0 8px 24px rgba(0, 201, 192, .35); }
.jpb-cta.ghost { border: 1.5px solid rgba(13, 30, 66, .2); color: #0A2D6E; }

/* ── ?embed=1 — Clinic Portal embed strips marketing chrome ─────────────── */
body.jp-embed #nav, body.jp-embed #page-hero, body.jp-embed .jp-footer,
body.jp-embed .jpb-cta-band, body.jp-embed #jp-mob-cta { display: none !important; }
body.jp-embed { padding-top: 0 !important; background: #F4F7FC; }
body.jp-embed #app { padding: 12px; max-width: none; height: 100vh; }
body.jp-embed #mainArea { height: auto; flex: 1; min-height: 0; }
body.jp-embed .jpb-ops { top: 0; }

/* ── Print: the brief itself is the page ────────────────────────────────── */
@media print {
  #nav, #page-hero, .jp-footer, .jpb-cta-band, .jpb-ops, #jpb-shellbar,
  #patientQueue, [class*="queue"], .hiw-fab, #jp-mob-cta { display: none !important; }
  #app { padding: 0 !important; max-width: none !important; }
  #mainArea { height: auto !important; border: none !important; box-shadow: none !important; }
  #briefPanel { padding: 0 !important; overflow: visible !important; }
  body { background: #fff !important; }
}

@media (max-width: 768px) {
  #app { padding: 18px 10px 40px; }
  #jpb-shellbar { padding: 11px 14px; border-radius: 14px 14px 0 0; }
  .jpb-sh-chip { display: none; }
  #mainArea { height: auto; min-height: 70vh; border-radius: 0 0 14px 14px; }
  .jpb-ops { padding: 10px 14px; }
  .jpb-trust .jpb-chip:not(.lock):not(.src) { display: none; }
  .jpb-console { margin-top: 3vh; }
}
