/* ==========================================================================
   AI Dental Receptionist — WhatsApp Web mockup (component only)
   PAGE uses the global Framworq design system (framworq.css): white, square,
   Geist, hairlines. Only the WhatsApp Web chat below opts back into rounded
   corners (via !important, to beat the global square reset).
   ========================================================================== */
:root{
  --wa-green:#008069; --wa-teal:#00A884; --wa-out:#D9FDD3; --wa-in:#FFFFFF;
  --wa-body:#EFEAE2; --wa-ink:#111B21; --wa-sub:#667781; --wa-tick:#53BDEB;
  --wa-panel:#F0F2F5; --wa-hair:#E9EDEF;
}

/* two-panel container */
.wachat{
  display:grid; grid-template-columns:minmax(300px,370px) 1fr;
  width:100%; max-width:1080px; margin:0 auto;
  height:min(660px, calc(100vh - 250px)); min-height:540px;
  background:#fff; border:1px solid var(--line); overflow:hidden;
  font-family:-apple-system,"Segoe UI",Helvetica,"Helvetica Neue",Roboto,Arial,sans-serif;
  color:var(--wa-ink); text-align:left;
  box-shadow:0 24px 60px rgba(11,20,26,.10), 0 4px 14px rgba(11,20,26,.06);
}

/* ---- Left: chat list ---------------------------------------------------- */
.wachat__side{ display:flex; flex-direction:column; min-width:0; border-right:1px solid var(--wa-hair); }
.wachat__side-head{ height:58px; flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; padding:0 16px; background:var(--wa-panel); }
.wachat__me{ width:38px; height:38px; border-radius:50% !important; background:#DFE5E7; color:#8696A0; display:flex; align-items:center; justify-content:center; }
.wachat__me svg{ width:22px; height:22px; }
.wachat__side-icons{ display:flex; gap:20px; color:#54656F; }
.wachat__side-icons svg{ width:21px; height:21px; }
.wachat__search{ padding:8px 12px; flex:0 0 auto; border-bottom:1px solid var(--wa-hair); }
.wachat__search-pill{ display:flex; align-items:center; gap:12px; background:var(--wa-panel); border-radius:8px !important; padding:8px 14px; color:#8696A0; font-size:13.5px; }
.wachat__search-pill svg{ width:16px; height:16px; flex:0 0 auto; }
.wachat__list{ overflow-y:auto; flex:1; min-height:0; }

.wachat__item{ display:flex; gap:13px; padding:11px 14px; cursor:pointer; border-bottom:1px solid var(--wa-hair); transition:background .14s; }
.wachat__item:hover{ background:#F5F6F6; }
.wachat__item.is-active{ background:var(--wa-panel); }
.wachat__item-av{ width:47px; height:47px; border-radius:50% !important; flex:0 0 auto; display:flex; align-items:center; justify-content:center; color:#fff; font-size:15px; font-weight:600; overflow:hidden; }
.wachat__item-av img{ width:30px; height:30px; }
.wachat__item-main{ flex:1; min-width:0; }
.wachat__item-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.wachat__item-name{ font-size:15.5px; font-weight:500; color:var(--wa-ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wachat__item-time{ font-size:12px; color:var(--wa-sub); flex:0 0 auto; }
.wachat__item.is-active .wachat__item-time.unread{ color:var(--wa-teal); font-weight:600; }
.wachat__item-bot{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:4px; }
.wachat__item-msg{ font-size:13.5px; color:var(--wa-sub); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wachat__badge{ flex:0 0 auto; background:#25D366; color:#fff; border-radius:50% !important; min-width:20px; height:20px; padding:0 6px; font-size:11.5px; font-weight:600; display:inline-flex; align-items:center; justify-content:center; }

/* ---- Right: conversation ------------------------------------------------ */
.wachat__main{ display:flex; flex-direction:column; min-width:0; overflow:hidden; }
.wachat__topbar{ height:58px; flex:0 0 auto; display:flex; align-items:center; gap:13px; padding:0 16px; background:var(--wa-panel); border-bottom:1px solid var(--wa-hair); }
.wachat__topbar-av{ width:40px; height:40px; border-radius:50% !important; background:var(--wa-green); display:flex; align-items:center; justify-content:center; flex:0 0 auto; overflow:hidden; }
.wachat__topbar-av img{ width:23px; height:23px; }
.wachat__peer{ line-height:1.25; min-width:0; }
.wachat__peer b{ font-size:15.5px; font-weight:600; color:var(--wa-ink); display:block; }
.wachat__peer span{ font-size:12.5px; color:var(--wa-sub); }
.wachat__topbar-icons{ margin-left:auto; display:flex; gap:24px; color:#54656F; }
.wachat__topbar-icons svg{ width:21px; height:21px; }

.wachat__body{
  flex:1; overflow-y:auto; min-height:0; padding:18px 6% 14px;
  display:flex; flex-direction:column; gap:7px; background-color:var(--wa-body);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='%23CFC6B8' fill-opacity='0.22'%3E%3Ccircle cx='7' cy='7' r='1.3'/%3E%3Ccircle cx='29' cy='20' r='1.3'/%3E%3Ccircle cx='16' cy='33' r='1.3'/%3E%3C/g%3E%3C/svg%3E");
}
.wa__daterow{ align-self:center; margin:4px 0; }
.wa__pill{ background:#fff; color:var(--wa-sub); font-size:12px; font-weight:500; padding:6px 12px; border-radius:8px !important; box-shadow:0 1px .5px rgba(0,0,0,.1); }
.wa__enc{ align-self:center; background:#FFF5C4; color:#54656F; font-size:11.5px; text-align:center; padding:6px 12px; border-radius:8px !important; max-width:75%; margin-bottom:4px; box-shadow:0 1px .5px rgba(0,0,0,.08); }

/* bubbles */
.bubble{ position:relative; max-width:66%; padding:6px 9px 8px; border-radius:8px !important; font-size:14.4px; line-height:1.4; box-shadow:0 1px .5px rgba(0,0,0,.13); word-wrap:break-word; }
.bubble--in{ align-self:flex-start; background:var(--wa-in); border-top-left-radius:0 !important; margin-left:9px; }
.bubble--out{ align-self:flex-end; background:var(--wa-out); border-top-right-radius:0 !important; margin-right:9px; }
.bubble--in::before{ content:""; position:absolute; top:0; left:-9px; width:0; height:0; border-style:solid; border-width:0 0 12px 10px; border-color:transparent transparent transparent var(--wa-in); }
.bubble--out::before{ content:""; position:absolute; top:0; right:-9px; width:0; height:0; border-style:solid; border-width:0 10px 12px 0; border-color:transparent var(--wa-out) transparent transparent; }
.bubble__t{ font-size:11px; color:var(--wa-sub); float:right; margin:8px 0 -3px 12px; display:inline-flex; align-items:center; gap:3px; white-space:nowrap; }
.bubble__t svg{ width:16px; height:16px; color:var(--wa-tick); }

/* typing */
.wa__typing{ align-self:flex-start; background:var(--wa-in); border-radius:8px !important; border-top-left-radius:0 !important; margin-left:9px; padding:12px 14px; box-shadow:0 1px .5px rgba(0,0,0,.13); display:inline-flex; gap:4px; }
.wa__typing i{ width:7px; height:7px; border-radius:50% !important; background:#9AA6AD; animation:wa-blink 1.2s infinite ease-in-out; }
.wa__typing i:nth-child(2){ animation-delay:.16s; } .wa__typing i:nth-child(3){ animation-delay:.32s; }
@keyframes wa-blink{ 0%,80%,100%{ opacity:.3; transform:translateY(0); } 40%{ opacity:1; transform:translateY(-3px); } }
.wa__err{ align-self:center; background:#FFE0DC; color:#B23A28; font-size:12px; padding:6px 12px; border-radius:8px !important; margin:4px 0; }

/* input bar */
.wachat__input{ display:flex; align-items:flex-end; gap:10px; padding:9px 16px; background:var(--wa-panel); flex:0 0 auto; }
.wachat__input-icons{ display:flex; gap:16px; color:#54656F; padding-bottom:10px; }
.wachat__input-icons svg{ width:23px; height:23px; }
.wachat__input-pill{ flex:1; min-width:0; display:flex; align-items:flex-end; background:#fff; border-radius:8px !important; padding:9px 14px; }
.wachat__input-pill textarea{ flex:1; width:100%; min-width:0; border:0; outline:none; resize:none; font:inherit; font-size:15px; line-height:1.4; max-height:90px; color:var(--wa-ink); background:none; }
.wachat__send{ width:42px; height:42px; flex:0 0 auto; border:0; cursor:pointer; background:var(--wa-teal); color:#fff; border-radius:50% !important; display:inline-flex; align-items:center; justify-content:center; }
.wachat__send svg{ width:22px; height:22px; }

@media (max-width:820px){
  .wachat{ grid-template-columns:1fr; height:min(600px, calc(100vh - 200px)); }
  .wachat__side{ display:none; }
}
