/* ============================================================
   Elza A.I. — Chat público
   ============================================================ */
.chat-wrap{height:100dvh;display:flex;align-items:center;justify-content:center;padding:0;}

.chat-shell{
  width:100%;max-width:480px;height:100dvh;display:flex;flex-direction:column;
  background:var(--glass);
  backdrop-filter:blur(30px) saturate(1.5);
  -webkit-backdrop-filter:blur(30px) saturate(1.5);
  border:1px solid var(--stroke);overflow:hidden;position:relative;
}
@media (min-width:760px){
  .chat-shell{height:min(880px,94vh);border-radius:28px;box-shadow:var(--shadow)}
  .chat-wrap{padding:24px}
}

/* Header */
.chat-head{
  display:flex;align-items:center;gap:12px;padding:16px 18px;
  border-bottom:1px solid var(--stroke);
  background:linear-gradient(180deg,rgba(255,255,255,.04),transparent);
  z-index:3;
}
.chat-avatar{width:42px;height:42px;border-radius:var(--pill);object-fit:cover;
  border:1px solid var(--stroke-2);background:#10202f;flex:0 0 auto}
.chat-head .ttl{flex:1;min-width:0}
.chat-head .name{font-size:16px;font-weight:600;letter-spacing:-.02em;display:flex;align-items:center;gap:8px}
.chat-head .sub{font-size:12px;color:var(--text-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dot{width:8px;height:8px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 0 rgba(52,211,153,.5);animation:pulse 2.4s infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(52,211,153,.5)}70%{box-shadow:0 0 0 7px rgba(52,211,153,0)}100%{box-shadow:0 0 0 0 rgba(52,211,153,0)}}
.head-btn{width:38px;height:38px;border-radius:var(--pill);display:grid;place-items:center;
  border:1px solid var(--stroke);background:var(--glass);color:var(--text-dim);cursor:pointer;transition:.2s var(--ease)}
.head-btn:hover{color:var(--text);background:var(--glass-2)}

/* Body */
.chat-body{flex:1;overflow-y:auto;padding:20px 16px 8px;display:flex;flex-direction:column;gap:14px;scroll-behavior:smooth}
.chat-body::-webkit-scrollbar{width:7px}
.chat-body::-webkit-scrollbar-thumb{background:var(--stroke-2);border-radius:99px}

/* Mensagens */
.msg{display:flex;gap:9px;max-width:86%;animation:msgIn .42s var(--ease) both}
@keyframes msgIn{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
.msg .av{width:28px;height:28px;border-radius:50%;object-fit:cover;flex:0 0 auto;margin-top:2px;border:1px solid var(--stroke)}
.bubble{padding:11px 15px;border-radius:18px;font-size:15px;line-height:1.5;white-space:pre-wrap;word-wrap:break-word}
.msg.ai{align-self:flex-start}
.msg.ai .bubble{background:var(--glass-2);border:1px solid var(--stroke);border-bottom-left-radius:6px;backdrop-filter:blur(8px)}
.msg.me{align-self:flex-end;flex-direction:row-reverse}
.msg.me .bubble{background:linear-gradient(135deg,#0a84ff,#0a6fe0);color:#fff;border-bottom-right-radius:6px;box-shadow:0 6px 18px rgba(10,132,255,.35)}
.msg.system{align-self:center;max-width:92%}
.msg.system .bubble{background:rgba(255,255,255,.05);border:1px solid var(--stroke);color:var(--text-dim);
  font-size:12.5px;text-align:center;border-radius:var(--pill);padding:7px 14px}
.bubble .att{display:flex;align-items:center;gap:8px;margin-top:8px;padding:8px 10px;border-radius:12px;
  background:rgba(0,0,0,.18);border:1px solid var(--stroke);font-size:13px}
.bubble img.att-img{max-width:220px;border-radius:12px;margin-top:8px;display:block;border:1px solid var(--stroke)}
/* Nota de voz (player estilo WhatsApp) */
.vnote{display:flex;align-items:center;gap:10px;margin-top:6px;min-width:190px}
.vnote .vn-play{width:38px;height:38px;border-radius:50%;border:none;background:var(--accent);color:#fff;display:grid;place-items:center;cursor:pointer;flex:0 0 auto;transition:.15s}
.vnote .vn-play:active{transform:scale(.94)}
.vnote .vn-play svg{width:18px;height:18px;fill:currentColor;stroke:none}
.msg.me .vnote .vn-play{background:#fff;color:var(--accent)}
.vnote .vn-bar{flex:1;height:4px;border-radius:99px;background:rgba(255,255,255,.22);position:relative;cursor:pointer;min-width:90px}
.msg.ai .vnote .vn-bar{background:rgba(255,255,255,.18)}
.vnote .vn-fill{position:absolute;left:0;top:0;height:100%;border-radius:99px;background:currentColor;width:0}
.vnote .vn-time{font-size:11.5px;opacity:.85;min-width:32px;text-align:right;font-variant-numeric:tabular-nums}

/* Barra de gravação */
.rec-bar{flex:1;display:none;align-items:center;gap:9px;padding:0 6px;height:42px;color:var(--text);font-size:14px;font-variant-numeric:tabular-nums}
.rec-bar.on{display:flex}
.rec-bar .rec-dot{width:11px;height:11px;border-radius:50%;background:var(--danger);animation:recblink 1.1s infinite;flex:0 0 auto}
.rec-bar .rec-hint{color:var(--text-faint);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@keyframes recblink{50%{opacity:.25}}
.time{font-size:10.5px;color:var(--text-faint);margin-top:5px;padding:0 4px}
.msg.me .time{text-align:right}

/* Indicador de digitação */
.typing{display:flex;gap:9px;align-self:flex-start;align-items:center}
.typing .av{width:28px;height:28px;border-radius:50%;border:1px solid var(--stroke)}
.typing .dots{background:var(--glass-2);border:1px solid var(--stroke);border-radius:18px;border-bottom-left-radius:6px;
  padding:14px 16px;display:flex;gap:5px}
.typing .dots i{width:7px;height:7px;border-radius:50%;background:var(--text-dim);animation:blink 1.4s infinite both}
.typing .dots i:nth-child(2){animation-delay:.2s}.typing .dots i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

/* Painel de identificação */
.identify{margin:4px 16px 0;padding:16px;border-radius:var(--r-md);background:var(--glass-2);
  border:1px solid var(--stroke-2);animation:fadeUp .5s var(--ease) both}
.identify h3{font-size:15px;font-weight:600;display:flex;align-items:center;gap:8px;margin-bottom:4px}
.identify p{font-size:12.5px;color:var(--text-dim);margin-bottom:12px}
.identify .grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}
.identify .err{color:var(--danger);font-size:12.5px;margin-bottom:10px;display:none}
.identify .switch{font-size:12px;color:var(--accent);background:none;border:none;cursor:pointer;margin-top:10px;padding:4px}
.lock-note{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text-faint);margin-top:10px;justify-content:center}

/* Composer */
.chat-compose{padding:12px 14px;border-top:1px solid var(--stroke);
  background:linear-gradient(0deg,rgba(255,255,255,.04),transparent);z-index:3}
.attach-chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.chip{display:flex;align-items:center;gap:7px;background:var(--glass-2);border:1px solid var(--stroke);
  border-radius:var(--pill);padding:6px 10px 6px 8px;font-size:12.5px;animation:fadeUp .3s var(--ease) both}
.chip img{width:24px;height:24px;border-radius:6px;object-fit:cover}
.chip .x{cursor:pointer;color:var(--text-faint);font-size:15px;line-height:1}
.chip .x:hover{color:var(--danger)}
.compose-row{display:flex;align-items:flex-end;gap:8px}
.icon-btn{width:42px;height:42px;flex:0 0 auto;border-radius:var(--pill);display:grid;place-items:center;
  background:var(--glass);border:1px solid var(--stroke);color:var(--text-dim);cursor:pointer;transition:.2s var(--ease)}
.icon-btn:hover{color:var(--text);background:var(--glass-2)}
.icon-btn.rec{color:#fff;background:var(--danger);border-color:transparent;animation:recpulse 1.2s infinite}
@keyframes recpulse{50%{box-shadow:0 0 0 6px rgba(255,107,107,.25)}}
.compose-input{flex:1;background:rgba(255,255,255,.05);border:1px solid var(--stroke);border-radius:22px;
  display:flex;align-items:flex-end}
.compose-input textarea{flex:1;background:none;border:none;outline:none;color:var(--text);font-size:15px;
  font-family:inherit;resize:none;max-height:120px;padding:12px 4px 12px 16px;line-height:1.4}
.compose-input textarea::placeholder{color:var(--text-faint)}
.send-btn{width:42px;height:42px;border-radius:var(--pill);background:var(--accent);border:none;color:#fff;
  display:grid;place-items:center;cursor:pointer;transition:.2s var(--ease);flex:0 0 auto;box-shadow:0 6px 18px rgba(10,132,255,.4)}
.send-btn:hover{background:#2a96ff;transform:translateY(-1px)}
.send-btn:disabled{opacity:.4;cursor:not-allowed;box-shadow:none}
.powered{text-align:center;font-size:10.5px;color:var(--text-faint);margin-top:9px;letter-spacing:.02em}
svg.ic{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Header clicável (perfil) */
.chat-head .head-id{display:flex;align-items:center;gap:12px;flex:1;min-width:0;cursor:pointer;border-radius:12px;padding:5px;margin:-5px;transition:.18s var(--ease)}
.chat-head .head-id:hover{background:var(--glass)}

/* Modais (perfil + lightbox) */
.modal-overlay{position:fixed;inset:0;z-index:300;background:rgba(0,0,0,.72);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);display:none;align-items:center;justify-content:center;padding:20px;animation:ovIn .2s ease}
.modal-overlay.show{display:flex}
@keyframes ovIn{from{opacity:0}to{opacity:1}}
.modal-x{position:absolute;top:16px;right:18px;width:40px;height:40px;border-radius:50%;border:1px solid var(--stroke);background:rgba(255,255,255,.08);color:#fff;font-size:24px;line-height:38px;text-align:center;cursor:pointer;z-index:2}
.profile-card{width:100%;max-width:330px;border-radius:24px;padding:32px 26px;text-align:center;animation:fadeUp .3s var(--ease) both}
.profile-photo{width:144px;height:144px;border-radius:50%;object-fit:cover;border:2px solid var(--stroke-2);margin-bottom:16px;cursor:zoom-in;box-shadow:0 14px 44px rgba(0,0,0,.45)}
.profile-name{font-size:22px;font-weight:600;letter-spacing:-.02em}
.profile-status{display:flex;align-items:center;justify-content:center;gap:6px;color:var(--ok);font-size:13px;margin-top:6px}
.profile-office{margin-top:18px;padding-top:18px;border-top:1px solid var(--stroke)}
.po-name{font-size:15px;font-weight:500}
.po-line{font-size:13px;color:var(--text-dim);margin-top:6px}
.lightbox{cursor:zoom-out}
.lightbox img{max-width:94vw;max-height:90vh;border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.6)}
.bubble img.att-img{cursor:zoom-in}
