/* A conversa segue a composição WhatsApp pedida; a moldura pertence ao admin. */
.whatsapp-view #environment-badge, .whatsapp-view #global-error, .whatsapp-view #page-purpose { display: none; }
.wa-session { margin-top:18px; padding:16px 20px; border:1px solid var(--line,#d8e1dd); border-radius:var(--radius,12px); background:var(--surface,#fff); color:var(--ink,#15362f); }
.wa-session [hidden] { display:none !important; }
.wa-session-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.wa-session-head h2 { margin:0 0 6px; font-size:1.06rem; }
.wa-session-head p { margin:0; }
.wa-session-reason { margin:12px 0 5px; max-width:75ch; font-size:.9rem; line-height:1.5; }
.wa-session-meta { margin:5px 0 0; font-size:.8rem; line-height:1.5; color:var(--muted,#566b65); }
.wa-session-recovery { border-top:1px solid var(--line,#d8e1dd); margin-top:14px; padding-top:14px; }
.wa-session-recovery>p { margin:0 0 12px; max-width:75ch; font-size:.9rem; line-height:1.5; }
.wa-session-actions { display:flex; flex-wrap:wrap; gap:10px; }
.wa-session-challenge { border-top:1px solid var(--line,#d8e1dd); margin-top:16px; padding-top:16px; }
.wa-session-challenge-content { display:flex; align-items:center; justify-content:space-between; gap:24px; }
.wa-session-challenge-content>div { min-width:0; max-width:65ch; }
.wa-session-challenge h3 { font-size:1rem; margin:0 0 10px; }
.wa-session-challenge ol { margin:0; padding-left:22px; font-size:.9rem; line-height:1.6; }
.wa-session-paircode { font-size:clamp(1.6rem,3vw,2.2rem); font-weight:700; letter-spacing:.03em; font-variant-numeric:tabular-nums; white-space:nowrap; color:var(--accent-strong,#0b513d); background:var(--accent-soft,#d8eee5); border-radius:var(--radius-small,8px); padding:18px 22px; }
.wa-session-qrcode { display:block; width:190px; height:190px; max-width:100%; object-fit:contain; background:#fff; }
.wa-session-expiry { margin:12px 0 0; font-size:.85rem; line-height:1.5; font-variant-numeric:tabular-nums; color:var(--warning,#8f5a00); }
.wa-session-feedback { margin:14px 0 0; font-size:.9rem; line-height:1.5; }
.wa-session-feedback.is-error { color:var(--danger,#a93434); }
.wa-session button:focus-visible, .wa-session h3:focus-visible { outline:3px solid var(--accent,#146b52); outline-offset:3px; }
@media (max-width:680px) {
  .wa-session { padding:16px; }
  .wa-session-head { align-items:flex-start; flex-wrap:wrap; }
  .wa-session-head .button { width:100%; }
  .wa-session-actions { flex-direction:column; }
  .wa-session-actions .button { width:100%; }
  .wa-session-challenge-content { align-items:flex-start; flex-direction:column; gap:16px; }
}
.wa-window { --wa-ink:#111b21; --wa-muted:#54656f; --wa-green:#007f61; display:grid; grid-template-columns:minmax(270px,32%) minmax(0,1fr); height:calc(100dvh - 140px); min-height:530px; max-height:1100px; margin-top:18px; border:1px solid #d8dfe2; border-radius:10px; overflow:hidden; color:var(--wa-ink); background:#fff; }
.wa-window [hidden] { display:none !important; }
.wa-window button, .wa-window input, .wa-window textarea { font:inherit; }
.wa-window button { cursor:pointer; }
.wa-window button:disabled { cursor:default; opacity:.5; }
.wa-window button:focus-visible, .wa-window a:focus-visible, .wa-window input:focus-visible, .wa-window textarea:focus-visible, .wa-history:focus-visible { outline:3px solid #007f61; outline-offset:2px; }
.wa-window svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.wa-directory { display:flex; flex-direction:column; min-height:0; min-width:0; background:#fff; border-right:1px solid #d8dfe2; }
.wa-directory-head { display:flex; align-items:center; justify-content:space-between; padding:18px 18px 12px; gap:6px; }
.wa-directory-head h2 { font-size:1.4rem; color:var(--wa-ink); margin:0 0 4px; letter-spacing:-.025em; }
.wa-directory-head p { font-size:.73rem; margin:0; color:var(--wa-muted); }
.wa-directory-head p.is-connected::before { content:''; display:inline-block; width:7px; height:7px; margin-right:6px; background:var(--wa-green); border-radius:50%; }
.wa-icon { display:grid; place-items:center; padding:8px; min-width:40px; height:40px; border:0; border-radius:50%; color:var(--wa-muted); background:transparent; }
.wa-icon:hover { background:#e7ebed; }
.wa-list-tools { padding:0 12px 10px; }
.wa-search { display:flex; align-items:center; gap:13px; background:#f0f2f5; padding:0 13px; border-radius:8px; }
.wa-search svg { width:19px; height:19px; }
.wa-search input { width:100%; min-width:0; padding:10px 0; background:transparent; border:0; font-size:.84rem; color:var(--wa-ink); min-height:40px; }
.wa-search input::placeholder { color:var(--wa-muted); opacity:1; }
.wa-filters { display:flex; gap:6px; flex-wrap:wrap; padding-top:11px; }
.wa-filters button { border:0; border-radius:20px; background:#f0f2f5; color:#4c5b63; padding:7px 11px; font-size:.77rem; min-height:34px; }
.wa-filters button[aria-pressed="true"] { color:#006b50; background:#d9fdd3; }
.wa-list-scroll { flex:1; overflow:auto; overscroll-behavior:contain; min-height:0; }
.wa-list { list-style:none; margin:0; padding:0; }
.wa-list li { margin:0; padding:0; }
.wa-chat { display:flex; gap:12px; padding:0 14px; min-height:80px; align-items:center; width:100%; text-align:left; border:0; color:var(--wa-ink); background:#fff; }
.wa-chat:hover { background:#f5f6f6; }
.wa-chat[aria-current="true"] { background:#f0f2f5; }
.wa-avatar { position:relative; width:46px; height:46px; display:grid; place-items:center; flex-shrink:0; border-radius:50%; background:#e6eeeb; color:#667d73; font-size:1rem; font-weight:600; overflow:hidden; }
.wa-avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.wa-avatar svg { width:26px; height:26px; }
.wa-chat-content { min-width:0; flex:1; border-bottom:1px solid #f0f2f5; padding:15px 0; }
.wa-chat-line { display:flex; align-items:center; justify-content:space-between; gap:7px; }
.wa-chat-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.94rem; font-weight:500; }
.wa-chat time { white-space:nowrap; color:var(--wa-muted); font-size:.68rem; font-variant-numeric:tabular-nums; }
.wa-chat-preview { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.8rem; color:var(--wa-muted); margin-top:4px; }
.wa-unread { display:grid; place-items:center; flex-shrink:0; min-width:20px; height:20px; border-radius:20px; color:#fff; background:#008b65; font-size:.67rem; padding:0 5px; margin-top:4px; }
.wa-chat.has-unread .wa-chat-name { font-weight:650; }
.wa-chat.has-unread time { color:var(--wa-green); }
.wa-list-feedback { padding:22px 17px; margin:0; color:var(--wa-muted); font-size:.86rem; }
.wa-list-foot { border-top:1px solid #e9edef; margin:0; padding:12px; font-size:.69rem; text-align:center; color:var(--wa-muted); }
.wa-thread { position:relative; min-width:0; min-height:0; background:#efeae2; }
.wa-welcome { height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:35px; text-align:center; background:#f0f2f5; border-bottom:5px solid #25b985; }
.wa-welcome>svg { width:110px; height:110px; color:#89a99b; stroke-width:2; margin-bottom:26px; }
.wa-welcome h2 { font-size:1.7rem; font-weight:400; margin:0 0 12px; color:#41525d; }
.wa-welcome p { color:var(--wa-muted); margin:0 0 8px; }
.wa-welcome .wa-welcome-detail { margin:0; font-size:.85rem; line-height:1.7; }
.wa-welcome-note { color:var(--wa-muted); font-size:.72rem; margin-top:55px; }
.wa-active { display:flex; height:100%; flex-direction:column; min-height:0; }
.wa-thread-head { display:flex; align-items:center; gap:12px; min-height:72px; padding:10px 19px; background:#f0f2f5; border-bottom:1px solid #dfe3e5; }
.wa-thread-head .wa-avatar { width:42px; height:42px; }
.wa-chat-heading { min-width:0; flex:1; }
.wa-chat-heading h3 { font-size:.95rem; font-weight:600; color:var(--wa-ink); margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wa-chat-heading p { margin:2px 0 0; font-size:.74rem; color:var(--wa-muted); }
.wa-back { display:none; }
.wa-find { padding:8px 14px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:#fff; font-size:.75rem; }
.wa-find input { width:180px; flex:1; min-width:100px; min-height:36px; border:1px solid #d8dfe2; padding:6px 9px; border-radius:6px; }
.wa-find span { min-width:60px; color:var(--wa-muted); }
.wa-history { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:12px clamp(14px,3vw,48px) 20px; scrollbar-width:thin; }
.wa-history-start { text-align:center; }
.wa-history-start p { display:inline-block; max-width:440px; margin:0 auto 20px; padding:7px 12px; color:#586257; background:#f7f4ed; border-radius:7px; font-size:.71rem; line-height:1.5; }
.wa-older { display:block; margin:0 auto 14px; border:1px solid #dfe5df; background:#fff; border-radius:18px; padding:7px 16px; min-height:36px; color:var(--wa-green); font-size:.76rem; }
.wa-messages { display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.wa-day { align-self:center; margin:13px 0 10px; padding:5px 12px; background:#fff; border-radius:7px; color:#54656f; font-size:.7rem; text-align:center; }
.wa-message { position:relative; max-width:min(88%,550px); min-width:95px; border-radius:0 8px 8px; padding:7px 10px 5px; background:#fff; color:var(--wa-ink); overflow-wrap:anywhere; box-shadow:0 1px 1px #0b141a15; scroll-margin:20px; }
.wa-message.is-mine { align-self:flex-end; border-radius:8px 0 8px 8px; background:#d9fdd3; }
.wa-message.is-match { outline:2px solid #9b7100; }
.wa-message-author { font-size:.77rem; font-weight:650; color:#8a4c20; margin:0 26px 3px 0; }
.wa-author-0 { color:#007f61; }
.wa-author-1 { color:#386aa1; }
.wa-author-2 { color:#8a4c20; }
.wa-author-3 { color:#884b93; }
.wa-author-4 { color:#9e3a51; }
.wa-author-5 { color:#526d25; }
.wa-author-6 { color:#366f76; }
.wa-author-7 { color:#6654a0; }
.wa-forwarded { margin:0 0 4px; color:var(--wa-muted); font-size:.72rem; font-style:italic; }
.wa-message-text { white-space:pre-wrap; line-height:1.5; font-size:.875rem; margin:0 8px 0 0; }
.wa-message-text a { color:#00769c; text-decoration:underline; }
.wa-message-meta { display:flex; justify-content:flex-end; align-items:center; gap:4px; color:#55645b; font-size:.62rem; margin-top:3px; }
.wa-message-meta svg { width:17px; height:15px; stroke-width:1.5; }
.wa-message-meta .is-read { color:#007fa5; }
.wa-reply-action { position:absolute; right:2px; top:2px; width:30px; min-width:30px; height:28px; padding:5px; border-radius:6px; opacity:0; background:inherit; color:#607268; }
.wa-reply-action svg { width:19px; height:19px; }
.wa-message:hover .wa-reply-action, .wa-message:focus-within .wa-reply-action { opacity:1; }
.wa-quote { background:#00000006; border-left:4px solid #06a581; border-radius:4px; padding:6px 9px; margin:0 16px 5px 0; }
.wa-quote strong { font-size:.75rem; color:#007b60; }
.wa-quote p { margin:2px 0 0; font-size:.77rem; white-space:pre-wrap; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; color:#53616a; }
.wa-media { margin:3px 0 5px; }
.wa-media img { display:block; max-width:100%; max-height:360px; border-radius:5px; object-fit:contain; }
.wa-media video { display:block; width:100%; max-height:320px; border-radius:5px; background:#192825; }
.wa-media audio { display:block; width:300px; max-width:100%; height:42px; }
.wa-media-link { display:inline-flex; align-items:center; gap:8px; font-size:.78rem; color:#006f54; text-decoration:underline; padding:5px 0; }
.wa-media-error { color:#8b4534; font-size:.74rem; margin:5px 0; }
.wa-new-messages { position:absolute; right:25px; bottom:132px; background:white; color:var(--wa-green); border:1px solid #c5d3cb; border-radius:22px; font-size:.76rem; padding:8px 15px; box-shadow:0 2px 8px #17251a15; }
.wa-compose { margin:0; padding:11px 14px 7px; background:#f0f2f5; flex-shrink:0; }
.wa-compose-row { display:flex; align-items:flex-end; gap:10px; }
.wa-compose textarea { resize:vertical; width:100%; min-width:0; min-height:45px; max-height:140px; border:1px solid #fff; border-radius:9px; color:#111b21; background:#fff; padding:12px 14px; font-size:.88rem; line-height:1.4; }
.wa-compose textarea::placeholder { color:#596a72; }
.wa-send { width:44px; min-width:44px; height:44px; display:grid; place-items:center; border:0; border-radius:50%; color:white; background:#007f61; }
.wa-send:hover { background:#006f54; }
.wa-send svg { width:23px; height:23px; }
.wa-compose-help { margin:5px 54px 0 2px; color:#596970; font-size:.66rem; line-height:1.5; }
.wa-reply { display:flex; align-items:center; gap:12px; padding:8px 10px; border-left:4px solid #06a581; background:#e7eceb; border-radius:5px; margin:0 54px 10px 0; }
.wa-reply>div { flex:1; min-width:0; }
.wa-reply strong { font-size:.8rem; color:#007b60; }
.wa-reply p { margin:3px 0 0; font-size:.78rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#53616a; }
.wa-feedback { margin:0; padding:9px 16px; background:#f5f7ed; border-top:1px solid #dce2cd; color:#3c5b3d; font-size:.77rem; }
.wa-feedback.is-error { background:#fff2e5; color:#854926; border-color:#ebd1b8; }
.wa-receipts { flex-shrink:0; max-height:170px; overflow:auto; }
.wa-receipt { display:flex; gap:12px; align-items:center; padding:10px 15px; background:#fff1d7; font-size:.78rem; color:#704f13; border-top:1px solid #e2cea5; }
.wa-receipt>div { flex:1; min-width:0; }
.wa-receipt p { margin:3px 0 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wa-text-button { border:0; background:none; color:#007258; font-size:.75rem; text-decoration:underline; padding:7px; min-height:34px; }
@media (max-width:1180px) and (min-width:901px) { .wa-window { grid-template-columns:280px minmax(0,1fr); } .wa-filters { gap:4px; } .wa-filters button { padding:6px 9px; } }
@media (max-width:900px) { .wa-window { height:calc(100dvh - 245px); min-height:520px; grid-template-columns:280px minmax(0,1fr); } }
@media (max-width:680px) {
  .wa-window { display:block; height:calc(100dvh - 290px); min-height:500px; border-radius:8px; }
  .wa-directory { height:100%; border:0; }
  .wa-thread { display:none; height:100%; }
  .wa-window.has-chat .wa-directory { display:none; }
  .wa-window.has-chat .wa-thread { display:block; }
  .wa-back { display:grid; min-width:32px; width:32px; padding:5px; }
  .wa-thread-head { gap:8px; padding:10px 8px; min-height:68px; }
  .wa-thread-head .wa-avatar { width:35px; height:35px; }
  .wa-chat-heading h3 { font-size:.87rem; }
  .wa-chat-heading p { font-size:.66rem; }
  .wa-history { padding:10px 12px 16px; }
  .wa-message { max-width:92%; }
  .wa-compose { padding:10px 10px 7px; }
  .wa-compose textarea { font-size:16px; padding:10px; }
  .wa-message-text { font-size:.85rem; }
  .wa-reply-action { opacity:1; }
  .wa-message-text { margin-right:19px; }
}
@media (hover:none) { .wa-reply-action { opacity:1; } }
