/* consultation.css — the dedicated clinical-queue consultation surface (#cst).
   Visually a sibling of the V37 wizard (same background, glass cards and step rail) so the two
   screens read as one product, but a completely separate stylesheet: nothing here can leak into
   an ordinary New Patient Session, which is exactly what went wrong when the queue banner was
   injected into the shared wizard DOM. */

#cst{
  position:fixed; inset:0; z-index:110; display:none; flex-direction:column;
  background:#bde7ef url('../images/new-patient-bg.png') center center / cover no-repeat;
  font-family:'Inter',system-ui,sans-serif; color:#0f3a52; overflow:hidden;
}
#consultation-view.active #cst{display:flex;}
#cst::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:0;
  background:
    radial-gradient(1100px 460px at 50% -6%,rgba(255,255,255,.45) 0%,transparent 62%),
    linear-gradient(180deg,rgba(190,235,245,.30) 0%,rgba(150,215,235,.14) 34%,rgba(120,195,220,.10) 70%,rgba(120,195,220,.18) 100%);}
#cst > *{position:relative;z-index:2;}

/* ---- header + step rail ---- */
.cst-top{display:flex;align-items:center;gap:14px;padding:14px 26px;background:rgba(255,255,255,.72);
  border-bottom:1px solid rgba(120,170,200,.3);backdrop-filter:blur(14px);}
.cst-brand{display:flex;align-items:center;gap:16px;}
.cst-brand img{height:44px;width:auto;object-fit:contain;display:block;}
.cst-brand .tag{font-size:14px;letter-spacing:.2em;color:#5b6b86;font-weight:400;text-transform:uppercase;}
.cst-steps{display:flex;align-items:center;gap:6px;flex:1;justify-content:center;}
.cst-step{display:flex;align-items:center;gap:9px;opacity:.5;transition:.25s;}
.cst-step.active,.cst-step.done{opacity:1;}
.cst-dot{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:13px;
  background:rgba(255,255,255,.8);color:#3a7e9a;border:1px solid rgba(120,170,200,.4);flex-shrink:0;}
.cst-step.active .cst-dot{background:linear-gradient(135deg,#3b82f6,#38bdf8);color:#fff;border-color:transparent;
  box-shadow:0 4px 16px rgba(56,189,248,.5);}
.cst-step.done .cst-dot{background:linear-gradient(135deg,#0ea5a4,#10b981);color:#fff;border-color:transparent;}
.cst-step .lbl{font-size:12.5px;font-weight:600;color:#0f5170;white-space:nowrap;}
.cst-line{width:26px;height:2px;background:rgba(80,140,170,.35);}
.cst-topacts{display:flex;gap:8px;}

/* ---- pinned patient strip (visible on EVERY step) ---- */
.cst-patient{padding:14px 26px 0;max-width:1180px;margin:0 auto;width:100%;}
.cst-pt{display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  background:rgba(255,255,255,.82);border:1px solid rgba(120,170,200,.38);border-radius:16px;
  padding:13px 18px;backdrop-filter:blur(12px) saturate(1.2);box-shadow:0 8px 26px rgba(9,37,70,.08);}
.cst-av{flex:none;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(135deg,#e8f0ff,#dbeafe);color:#1b55e2;font-weight:800;font-size:15px;
  font-family:'Outfit',system-ui,sans-serif;}
.cst-who{min-width:0;flex:1;}
.cst-name{font-family:'Outfit',system-ui,sans-serif;font-size:17px;font-weight:800;color:#062a5e;line-height:1.2;
  display:flex;align-items:center;gap:8px;}
.cst-tag{font-size:9px;font-weight:800;letter-spacing:.05em;padding:2px 7px;border-radius:6px;}
.cst-tag.new{color:#1b55e2;background:#dbeafe;border:1px solid #bfdbfe;}
.cst-meta{font-size:12.5px;color:#5b7395;margin-top:3px;}
.cst-vitals{display:flex;flex-wrap:wrap;gap:7px;}
.cst-chip{font-size:12px;background:#eef3fb;color:#1e40af;padding:5px 11px;border-radius:99px;font-weight:600;}
.cst-chip b{font-weight:800;margin-right:5px;}
.cst-novitals{font-size:12.5px;color:#8ba0bd;font-style:italic;}
.cst-pill{font-size:11.5px;font-weight:700;color:#0a7048;background:#e7f7ef;border:1px solid #bbe7d1;
  padding:5px 11px;border-radius:99px;white-space:nowrap;}
.cst-pt-load .cst-av,.cst-sk{background:#e6edf7;border-radius:7px;}
.cst-sk-a{height:15px;width:180px;margin-bottom:7px;}
.cst-sk-b{height:11px;width:260px;}

.cst-alert{max-width:1180px;margin:9px auto 0;font-size:12.8px;line-height:1.5;border-radius:12px;padding:9px 14px;
  display:flex;gap:8px;align-items:flex-start;}
.cst-alert b{font-weight:800;margin-right:2px;}
.cst-alert i{margin-top:2px;flex:none;}
.cst-alert.allergy{color:#a1201f;background:#fdecec;border:1px solid #f6cfcf;}
.cst-alert.cc{color:#0f3a52;background:rgba(255,255,255,.8);border:1px solid rgba(120,170,200,.36);}
.cst-alert.returned{color:#92400e;background:#fef6e7;border:1px solid #fadfae;}

/* ---- body + steps ---- */
.cst-body{flex:1;overflow-y:auto;padding:16px 26px 24px;}
.cst-screen{display:none;max-width:1180px;margin:0 auto;}
.cst-screen.on{display:block;}
.cst-hi{font-family:'Outfit',system-ui,sans-serif;font-size:24px;font-weight:800;color:#062a5e;letter-spacing:-.02em;}
.cst-sub{font-size:13.5px;color:#5b7395;margin-top:4px;}
.cst-emr-grid{display:grid;grid-template-columns:1fr;gap:14px;margin-top:16px;}
.cst-emr-grid .cst-card{min-height:154px;margin-bottom:0;}
.cst-emr-copy{font-size:12.5px;line-height:1.55;color:#496987;margin:8px 0 12px;}
.cst-emr-loading{display:flex;align-items:center;gap:9px;padding:15px 17px;margin-top:16px;border:1px dashed #8dc9dc;border-radius:12px;background:rgba(255,255,255,.58);color:#3f6f88;font-size:13px;}
.cst-emr-loading i{animation:cst-spin .8s linear infinite;}
@keyframes cst-spin{to{transform:rotate(360deg)}}
.cst-2col{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px;align-items:start;}
@media (max-width:900px){.cst-2col{grid-template-columns:1fr;}}
.cst-card{background:rgba(255,255,255,.82);border:1px solid rgba(120,170,200,.38);border-radius:16px;
  padding:18px;backdrop-filter:blur(12px) saturate(1.2);margin-bottom:16px;}
.cst-h3{display:flex;align-items:center;gap:9px;font-family:'Outfit',system-ui,sans-serif;font-size:15px;
  font-weight:800;color:#062a5e;margin-bottom:12px;}
.cst-hi .cst-count{font-size:12px;font-weight:800;color:#1b55e2;background:#dbeafe;border-radius:99px;
  padding:2px 10px;vertical-align:middle;margin-left:6px;font-family:'Outfit',system-ui,sans-serif;}
.cst-h3 .cst-count{font-size:11px;font-weight:800;color:#1b55e2;background:#dbeafe;border-radius:99px;
  padding:1px 8px;min-width:20px;text-align:center;}
.cst-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;}
.cst-f label{display:block;font-size:11.5px;font-weight:700;color:#5b7395;margin-bottom:5px;
  letter-spacing:.02em;text-transform:uppercase;}
.cst-f input,.cst-f select{width:100%;padding:10px 12px;border-radius:10px;border:1px solid rgba(120,170,200,.5);
  background:rgba(255,255,255,.9);font-size:13.5px;color:#0f3a52;font-family:inherit;}
.cst-f input:focus,.cst-f select:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.15);}
.cst-f input[readonly]{background:rgba(240,245,251,.9);color:#5b7395;}
.cst-empty{font-size:13px;color:#8ba0bd;font-style:italic;padding:10px 0;}

/* vitals read-out (recorded by the Nurse Technician, not editable here) */
.cst-vrow{display:flex;justify-content:space-between;align-items:center;padding:9px 0;
  border-bottom:1px dashed rgba(120,170,200,.3);font-size:13.2px;}
.cst-vrow:last-of-type{border-bottom:none;}
.cst-vrow span{color:#5b7395;}
.cst-vrow b{color:#062a5e;font-weight:700;}
.cst-vnote{font-size:12px;color:#8ba0bd;margin-top:10px;font-style:italic;}

/* documents */
.cst-doc{display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid rgba(120,170,200,.36);
  border-radius:12px;margin-bottom:8px;background:rgba(255,255,255,.75);}
.cst-doc > i{font-size:19px;color:#1b55e2;flex:none;}
.cst-docmeta{flex:1;min-width:0;font-family:'Outfit',system-ui,sans-serif;}
.cst-docmeta b{display:block;font-size:13.5px;color:#062a5e;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.cst-docmeta span{font-size:11.5px;color:#5b7395;display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
/* "is this file actually going to the model?" — the answer has to be visible before Start AI Analysis */
.cst-docstate{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;font-weight:700;
  padding:2px 7px;border-radius:999px;background:rgba(120,170,200,.18);color:#5b7395;}
.cst-docstate.ok{background:rgba(10,112,72,.12);color:#0a7048;}
.cst-docstate.err{background:rgba(185,28,28,.12);color:#b91c1c;}
.cst-note{font-size:11.8px;color:#5b7395;display:flex;align-items:center;gap:6px;margin-top:6px;}
.cst-filesrc{font-style:normal;font-size:10px;font-weight:700;color:#1b55e2;
  background:rgba(27,85,226,.1);border-radius:999px;padding:1px 6px;}

/* recorder + uploads */
.cst-rec{text-align:center;}
.cst-mic{width:150px;height:150px;margin:6px auto 14px;border-radius:50%;cursor:pointer;position:relative;
  display:grid;place-items:center;color:#1b55e2;font-size:44px;}
.cst-rec b{display:block;font-family:'Outfit',system-ui,sans-serif;font-size:16px;color:#062a5e;}
.cst-rec p{font-size:12.8px;color:#5b7395;margin:4px 0 12px;}
.cst-rec.live b{color:#b91c1c;}
.cst-upload{border:2px dashed rgba(120,170,200,.55);border-radius:14px;padding:22px;text-align:center;
  cursor:pointer;background:rgba(255,255,255,.5);transition:.15s;}
.cst-upload:hover{background:rgba(255,255,255,.78);border-color:#3b82f6;}
.cst-upload b{display:block;font-family:'Outfit',system-ui,sans-serif;font-size:15px;color:#062a5e;}
.cst-upload p{font-size:12.3px;color:#5b7395;margin-top:4px;}
.cst-upicons{display:flex;justify-content:center;gap:14px;font-size:22px;margin-bottom:8px;}
.cst-files{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;}
.cst-file{display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;
  background:rgba(255,255,255,.8);border:1px solid rgba(120,170,200,.35);font-size:12px;color:#0a3d5c;}
.cst-emrstate{font-size:12.5px;color:#5b7395;margin-top:12px;display:flex;align-items:center;gap:7px;}
.cst-emrstate.ok{color:#0a7048;}

/* AI output */
.cst-handoff{display:none;font-size:13px;line-height:1.55;color:#1e40af;background:#eef3fb;
  border:1px solid #c7d7f5;border-radius:12px;padding:11px 15px;margin-bottom:16px;}
.cst-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(212px,1fr));gap:13px;}
.cst-tile{display:flex;flex-direction:column;align-items:flex-start;gap:7px;text-align:left;cursor:pointer;
  background:rgba(255,255,255,.86);border:1px solid rgba(120,170,200,.38);border-radius:15px;padding:16px;
  position:relative;font-family:'Outfit',system-ui,sans-serif;transition:transform .12s,box-shadow .12s;}
.cst-tile:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(9,37,70,.14);}
.cst-tile .ic{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;color:#fff;font-size:19px;}
.cst-tile b{font-size:14px;color:#062a5e;}
.cst-tile .cst-tile-detail{display:flex;align-items:center;gap:4px;font-size:10.5px;color:#1b55e2;font-weight:800;}
.cst-tile.pending{opacity:.72;}
.cst-rdy{position:absolute;top:14px;right:14px;font-size:10px;font-weight:800;letter-spacing:.04em;
  text-transform:uppercase;color:#0a7048;background:#e7f7ef;border-radius:6px;padding:2px 7px;}
.cst-tile.pending .cst-rdy{color:#5b7395;background:#eef2f7;}
.cst-sync{font-size:12.5px;margin-top:16px;display:flex;align-items:center;gap:7px;color:#5b7395;}
.cst-sync.saved{color:#0a7048;}
.cst-sync.error{color:#b91c1c;}
.cst-sync.saving i{animation:cstspin 1s linear infinite;}
@keyframes cstspin{to{transform:rotate(360deg)}}

/* ---- footer ---- */
.cst-foot{display:flex;align-items:center;gap:12px;padding:13px 26px;background:rgba(255,255,255,.72);
  border-top:1px solid rgba(120,170,200,.3);backdrop-filter:blur(14px);}
.cst-foot .sp{flex:1;}
.cst-stepnum{font-size:12px;color:#5b7395;}

/* ---- buttons ---- */
.cst-btn{display:inline-flex;align-items:center;gap:7px;border-radius:11px;padding:10px 18px;cursor:pointer;
  font-family:'Outfit',system-ui,sans-serif;font-size:13.5px;font-weight:700;border:1px solid transparent;
  background:linear-gradient(135deg,#1b55e2,#3b82f6);color:#fff;box-shadow:0 6px 18px rgba(27,85,226,.28);}
.cst-btn:hover{filter:brightness(1.05);}
.cst-btn.ghost{background:rgba(255,255,255,.72);color:#0f5170;border-color:rgba(120,170,200,.45);box-shadow:none;}
.cst-btn.sm{padding:7px 12px;font-size:12.5px;}

/* ---- document viewer ---- */
.cst-modal{position:fixed;inset:0;z-index:220;display:none;align-items:center;justify-content:center;
  background:rgba(6,25,48,.55);backdrop-filter:blur(3px);padding:24px;}
.cst-modal.open{display:flex;}
.cst-modal-in{background:#fff;border-radius:18px;width:min(980px,100%);max-height:88vh;display:flex;
  flex-direction:column;overflow:hidden;box-shadow:0 30px 80px rgba(6,25,48,.4);}
.cst-modal-hd{display:flex;align-items:center;gap:12px;padding:15px 20px;border-bottom:1px solid #e2e8f0;}
.cst-modal-hd h3{flex:1;margin:0;font-family:'Outfit',system-ui,sans-serif;font-size:16px;color:#062a5e;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.cst-modal-bd{flex:1;overflow:auto;padding:16px;background:#f6f8fb;}
.cst-modal-bd img{max-width:100%;display:block;margin:0 auto;border-radius:10px;}
.cst-modal-bd iframe{width:100%;height:70vh;border:none;border-radius:10px;background:#fff;}
.cst-modal-bd pre{white-space:pre-wrap;word-break:break-word;font-size:13px;color:#0f3a52;margin:0;}

/* Vitals History, beside this visit's reading. The pinned patient strip is on screen for EVERY
   step, so the button there is what makes the trend reachable from Step 3's AI output. */
.cst-vitals .vh-btn-inline{margin-left:6px;flex:0 0 auto;}
.cst-vhrow{display:flex;justify-content:flex-start;margin-top:12px;}
