/* Teleatendimento: janela de vídeo (paciente em tela cheia, profissional em janela flutuante) */
.tl{position:fixed;z-index:70;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;background:#0B1110;color:#E9F0EC;opacity:0;transform:translateY(16px) scale(.98);transition:opacity .25s var(--ease,ease),transform .25s var(--ease,ease)}
.tl.on{opacity:1;transform:none}
.tl-pac{inset:0}
html.tl-aberta,html.tl-aberta body{overflow:hidden}
.tl-prof{right:16px;bottom:16px;width:min(400px,calc(100vw - 32px));height:min(560px,calc(100vh - 32px));border-radius:16px;box-shadow:0 18px 50px rgb(0 0 0 / .35);overflow:hidden}
.tl-prof.mini{height:auto}
.tl-prof.mini .tl-palco,.tl-prof.mini .tl-chat,.tl-prof.mini .tl-ctrl{display:none}
.tl-top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));background:rgb(255 255 255 / .04)}
.tl-tit{display:flex;align-items:center;gap:10px;min-width:0} .tl-tit b{display:block;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tl-live{width:9px;height:9px;border-radius:50%;background:#E9B949;flex:none;box-shadow:0 0 0 0 rgb(233 185 73 / .6);animation:tlPulso 1.6s ease-out infinite}
.tl.ligada .tl-live{background:#4CC38A;box-shadow:0 0 0 0 rgb(76 195 138 / .6)}
.tl-estado{display:block;font-size:12px;color:#A9B8B1} .tl-estado.ok{color:#7FDCA9} .tl-estado.warn{color:#E9B949} .tl-estado.bad{color:#F2826F}
.tl-ic{border:0;background:rgb(255 255 255 / .08);color:inherit;width:34px;height:34px;border-radius:10px;display:grid;place-items:center;cursor:pointer}
.tl-ic svg,.tl-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tl-palco{position:relative;min-height:0;overflow:hidden;background:#050807}
.tl-remoto{width:100%;height:100%;object-fit:cover;display:block;background:#050807;opacity:0;transition:opacity .4s}
.tl.ligada .tl-remoto{opacity:1}
.tl-pac .tl-remoto{object-fit:contain}
.tl-local{position:absolute;right:12px;bottom:12px;width:28%;max-width:150px;aspect-ratio:3/4;object-fit:cover;border-radius:12px;border:2px solid rgb(255 255 255 / .25);background:#1A2320;transform:scaleX(-1);box-shadow:0 6px 18px rgb(0 0 0 / .4);transition:opacity .2s}
.tl.semcam .tl-local{opacity:.25}
.tl-espera{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:18px;padding:24px;text-align:center;color:#C9D6D0;font-size:15px}
.tl-espera p{max-width:320px}
.tl-pulso{width:74px;height:74px;border-radius:50%;background:radial-gradient(circle,#A79DFF 0 30%,transparent 31%);position:relative}
.tl-pulso::before,.tl-pulso::after{content:"";position:absolute;inset:0;border-radius:50%;border:2px solid #A79DFF;animation:tlOnda 2s ease-out infinite}
.tl-pulso::after{animation-delay:1s}
.tl-som{position:absolute;left:50%;top:16px;transform:translateX(-50%);border:0;border-radius:999px;padding:8px 14px;background:#fff;color:#111;font-weight:600;cursor:pointer}
.tl-aviso{position:absolute;left:12px;right:12px;top:12px;background:rgb(0 0 0 / .65);border-radius:10px;padding:9px 12px;font-size:13px}
.tl-chat{display:grid;grid-template-rows:minmax(0,1fr) auto;max-height:42vh;border-top:1px solid rgb(255 255 255 / .08);background:#111917}
.tl-prof .tl-chat{max-height:210px}
.tl-msgs{overflow:auto;padding:10px 12px;display:grid;gap:6px;align-content:start;min-height:70px}
.tl-m{max-width:85%;background:#1E2A26;border-radius:12px 12px 12px 4px;padding:6px 10px;font-size:14px;animation:tlEntra .25s ease both}
.tl-m.eu{justify-self:end;background:#5144E0;border-radius:12px 12px 4px 12px}
.tl-m time{display:block;font-size:10.5px;color:#9FB0A9;text-align:right}
.tl-form{display:flex;gap:8px;padding:8px 10px}
.tl-form input{background:#0B1110;border-color:#2B3632;color:#E9F0EC}
.tl-ctrl{display:flex;justify-content:center;gap:12px;padding:12px;padding-bottom:max(12px,env(safe-area-inset-bottom));background:rgb(255 255 255 / .03)}
.tl-btn{position:relative;width:52px;height:52px;border-radius:50%;border:0;background:rgb(255 255 255 / .12);color:#fff;display:grid;place-items:center;cursor:pointer;transition:background .15s,transform .12s}
.tl-btn:active{transform:scale(.92)} .tl-btn[aria-pressed="true"]{background:#fff;color:#111}
.tl-sair{background:#A8201A} .tl-sair.confirma{background:#fff;color:#A8201A;animation:tlPop .3s}
.tl-sair svg{transform:rotate(135deg)}
.tl-prof .tl-btn{width:44px;height:44px}
.tl-dot{position:absolute;top:6px;right:6px;width:10px;height:10px;border-radius:50%;background:#F2826F;border:2px solid #0B1110}
.tl-fim{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:16px;padding:24px;text-align:center}
.tl-ok{width:64px;height:64px;border-radius:50%;background:#4CC38A;color:#06120D;display:grid;place-items:center;font-size:30px;font-weight:700;animation:tlPop .4s}
@keyframes tlPulso{to{box-shadow:0 0 0 10px transparent}}
@keyframes tlOnda{from{transform:scale(.5);opacity:1}to{transform:scale(1.6);opacity:0}}
@keyframes tlEntra{from{opacity:0;transform:translateY(6px)}}
@keyframes tlPop{0%{transform:scale(.6)}70%{transform:scale(1.08)}100%{transform:none}}
@media (max-width:640px){.tl-prof{right:0;bottom:0;width:100vw;height:100dvh;border-radius:0}}
.tl-acoes{display:flex;gap:6px;flex:none}
.tl-ic[aria-pressed="true"]{background:#fff;color:#111}
/* Tela dividida: vídeo fixo à esquerda (em telas estreitas, em cima) e o prontuário utilizável ao lado */
.tl-prof.dividida{left:0;top:0;right:auto;bottom:0;width:42vw;height:100vh;height:100dvh;border-radius:0;box-shadow:6px 0 28px rgb(0 0 0 / .22)}
.tl-prof.dividida .tl-chat{max-height:32vh}
html.tl-split body{padding-left:42vw}
html.tl-split #overlay{left:42vw}
html.tl-split #toast{left:71vw}
html.tl-split .two,html.tl-split .two.rev{grid-template-columns:minmax(0,1fr)}
html.tl-split .two.rev:has(.ptitle) > aside{order:2}
html.tl-split .vitals{grid-template-columns:repeat(auto-fit,minmax(110px,1fr))}
@media (max-width:899px){
  .tl-prof.dividida{left:0;right:0;top:0;bottom:auto;width:100vw;height:40vh;height:40dvh;box-shadow:0 6px 24px rgb(0 0 0 / .25)}
  .tl-prof.dividida .tl-chat{max-height:16vh}
  .tl-prof.dividida .tl-btn{width:40px;height:40px}
  .tl-prof.dividida .tl-ctrl{padding:8px;gap:10px}
  html.tl-split body{padding-left:0;padding-top:40vh;padding-top:40dvh}
  html.tl-split .topbar{position:static}
  html.tl-split #overlay{left:0;top:40vh;top:40dvh}
  html.tl-split #toast{left:50%}
}
@media (prefers-reduced-motion:reduce){.tl,.tl *{animation:none!important;transition:none!important}}
/* Avisos de teleatendimento dentro das telas */
.tag.tele{color:var(--accent);border-color:var(--accent)}
.tele-card{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.tele-prep{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:13.5px}
.tele-prep li{padding-left:22px;position:relative} .tele-prep li::before{content:"✓";position:absolute;left:2px;color:var(--ok);font-weight:700}
.tele-ok{display:flex;gap:10px;align-items:flex-start;font-size:13.5px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px}
.tele-ok input{margin-top:3px}
