/* WhatsApp: mesmos tokens e cabecalho da interface Aplicativos/Galeria. */
.chat-layout{
  display:grid;
  grid-template-columns:minmax(260px,340px) minmax(0,1fr);
  width:100%;
  height:clamp(440px,65dvh,700px);
  min-height:0;
  overflow:hidden;
}
.chat-list{
  min-width:0;min-height:0;height:100%;
  overflow-x:hidden;overflow-y:auto;
  background:rgba(7,18,31,.33);
  border-right:1px solid var(--line);
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#36556f transparent;
  touch-action:pan-y;
}
.chat-person{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  width:100%;min-width:0;align-items:center;
  gap:12px;padding:14px 14px;
  border:0;border-bottom:1px solid var(--line2);
  background:transparent;color:var(--text);
  text-align:left;cursor:pointer;
  transition:background .15s ease;
}
.chat-person:hover{background:rgba(47,91,126,.26)}
.chat-person.active{background:#183553;box-shadow:inset 3px 0 0 #70b5f4}
.chat-person:focus-visible{outline:2px solid #93caff;outline-offset:-2px}
.chat-person .chat-info{
  display:block;min-width:0;max-width:100%;
  overflow:hidden;
}
.chat-person .label{
  display:block;
  min-width:0;
  max-width:100%;
  margin:0;
  font-size:13px;
  line-height:1.5;
  font-weight:650;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.chat-person .snippet{
  display:block;
  min-width:0;max-width:100%;
  margin-top:4px;
  font-size:12px;
  line-height:1.5;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.chat-person small{
  display:block;
  min-width:0;max-width:100%;
  margin-top:5px;
  font-size:10px;
  line-height:1.45;
  font-weight:400;
  color:#809cb5;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.avatar{
  display:grid;place-items:center;
  width:42px;height:42px;
  border-radius:50%;
  background:#234969;
  color:#d7edff;
  font-size:16px;font-weight:650;
  flex:0 0 42px;
}
.chat-thread{
  display:flex;flex-direction:column;
  width:100%;height:100%;
  min-width:0;min-height:0;
  overflow:hidden;
  background:rgba(11,24,39,.72);
}
.thread-head{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;flex:0 0 auto;
  min-height:56px;padding:13px 17px;
  border-bottom:1px solid var(--line);
  background:#0e2033;
}
.thread-head strong{
  min-width:0;flex:1;
  font-size:14px;font-weight:650;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.thread-head span{
  flex:0 0 auto;
  max-width:45%;
  color:var(--muted);font-size:11px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.thread-messages{
  display:flex;flex-direction:column;align-items:stretch;
  flex:1 1 0;
  min-height:0;
  width:100%;
  overflow-x:hidden;overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#36556f transparent;
  touch-action:pan-y;
  gap:9px;
  padding:18px 19px;
}
.chat-list::-webkit-scrollbar,.thread-messages::-webkit-scrollbar{width:8px}
.chat-list::-webkit-scrollbar-thumb,.thread-messages::-webkit-scrollbar-thumb{
  background:#31506b;border-radius:10px;border:2px solid #0c2033;
}
.bubble{
  flex:0 0 auto;
  align-self:flex-start;
  width:fit-content;
  max-width:min(83%,560px);
  padding:10px 13px;
  overflow-wrap:anywhere;
  border:1px solid rgba(152,184,215,.13);
  border-radius:12px 12px 12px 4px;
  background:#18334f;
  color:var(--text);
}
.bubble.outgoing{
  align-self:flex-end;
  border-radius:12px 12px 4px 12px;
  background:#123d35;
  border-color:rgba(85,183,155,.20);
}
.bubble.unknown{background:#283146}
.bubble .sender{
  font-size:11px;color:#add6f6;
  font-weight:650;
  margin-bottom:4px;
}
.bubble .body{
  display:block;
  white-space:pre-wrap;
  font-size:13px;
  line-height:1.5;
}
.bubble .foot{
  display:flex;justify-content:flex-end;gap:6px;
  margin-top:6px;
  font-size:10px;color:#adc0d2;
}
.thread-footer{
  display:flex;align-items:center;justify-content:center;
  gap:10px;flex-wrap:wrap;
  min-height:40px;padding:9px 13px;
  flex:0 0 auto;
  border-top:1px solid var(--line);
  background:#0e2033;
  color:var(--muted);
  font-size:11px;
}
.thread-footer .load-more{min-height:32px}
.thread-messages .empty,.chat-list .empty{
  padding:28px 16px;line-height:1.6;
}
.time-stat{font-size:16px!important;margin-top:9px!important}
@media(max-width:780px){
  .chat-layout{
    display:flex;flex-direction:column;
    height:auto;min-height:0;overflow:visible;
  }
  .chat-list{
    height:clamp(165px,31dvh,285px);
    max-height:none;
    min-height:0;
    flex:0 0 auto;
    overflow-y:auto;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .chat-thread{
    height:clamp(370px,60dvh,620px);
    flex:0 0 auto;
    max-height:none;
    min-height:0;
    overflow:hidden;
  }
  .thread-messages{min-height:0;flex:1 1 0;padding:12px;gap:8px}
  .thread-head{min-height:48px;padding:12px}
  .bubble{max-width:92%}
  .chat-person{padding:11px 13px}
  .thread-footer{font-size:10px}
}

.wa-sync-warning{
 display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 13px;
 margin:0 0 13px;padding:12px 16px;
 background:#101e2e;border:1px solid var(--line);
 border-radius:12px;color:#bdcddd;font-size:12px;
}
.wa-sync-warning strong{font-size:12px;color:#f0f5fb}
.wa-sync-warning span{line-height:1.5;min-width:0;flex:1 1 470px}
