/* Compact Meta window banner: one line with status, countdown and help, giving the conversation more room. */
.meta-chat-availability.nca-compact{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;padding:6px 14px;min-height:0}
.meta-chat-availability.nca-compact .nca-availability-row{flex:1 1 auto;min-width:0;gap:10px;margin:0}
.meta-chat-availability.nca-compact .nca-availability-title{font-size:13px;line-height:1.4;margin:0}
.meta-chat-availability.nca-compact .nca-availability-hint{flex-basis:100%;margin:0;font-size:12.5px}
.meta-chat-availability.nca-compact .nca-window-help{margin:0;font-size:12.5px}
.meta-chat-availability.nca-compact .nca-window-help>summary{cursor:pointer;color:#047857;text-decoration:underline;text-underline-offset:3px;list-style:none}
.meta-chat-availability.nca-compact .nca-window-help>summary::-webkit-details-marker{display:none}
.meta-chat-availability.nca-compact .nca-window-help[open]{flex-basis:100%}
.meta-chat-availability.nca-compact .nca-window-help[open]>p{margin:4px 0 2px;line-height:1.5;color:#334155}
.meta-chat-availability.nca-compact[data-refreshing=true]{transition:none}
/* ---- CHAT_UX_R2_20261106: WhatsApp-like Meta chat (scoped to the Meta drawer) ---- */
.meta-chat-shell{--meta-chat-paper:#efeae2;--wa-out:#d9fdd3;--wa-in:#fff;--wa-ink:#111b21;--wa-muted:#667781;--wa-green:#008069;--wa-teal:#00a884}
.meta-chat-shell .meta-chat-history{background-color:var(--meta-chat-paper);padding:14px 7%}
.meta-chat-shell [data-chat-bubble]{border:0;border-radius:8px;padding:7px 10px 6px;box-shadow:0 1px .5px rgba(11,20,26,.13);color:var(--wa-ink);position:relative}
.meta-chat-shell [data-chat-bubble=outbound]{background:var(--wa-out)}
.meta-chat-shell [data-chat-bubble=inbound]{background:var(--wa-in)}
.meta-chat-shell [data-chat-bubble] :is(p,.whitespace-pre-wrap){font-size:14.2px;line-height:1.45}
.meta-chat-shell [data-chat-bubble] [class*=text-white]{color:var(--wa-muted)}
.meta-chat-shell [data-chat-bubble=outbound][class*=rounded-tr-none]{border-top-right-radius:0}
.meta-chat-shell [data-chat-bubble=inbound][class*=rounded-tl-none]{border-top-left-radius:0}
.meta-chat-shell [data-chat-bubble=outbound][class*=rounded-tr-none]::after{content:"";position:absolute;top:0;right:-8px;border-style:solid;border-width:0 0 10px 8px;border-color:transparent transparent transparent var(--wa-out)}
.meta-chat-shell [data-chat-bubble=inbound][class*=rounded-tl-none]::after{content:"";position:absolute;top:0;left:-8px;border-style:solid;border-width:0 8px 10px 0;border-color:transparent var(--wa-in) transparent transparent}
.meta-chat-shell .meta-chat-message-meta{color:var(--wa-muted);font-size:11px}
.meta-chat-shell .meta-chat-history>div.justify-center>span[class*=rounded-full]{background:#fff;color:#54656f;box-shadow:0 1px .5px rgba(11,20,26,.13);font-size:12px;font-weight:500;text-transform:uppercase;letter-spacing:.02em;border-radius:7px}
/* Internal note: clearly team-only */
.meta-chat-shell [data-chat-bubble=internal]{background:#fff3c4;border:1px dashed #d9a400;box-shadow:none}
.meta-chat-shell .meta-chat-compose-dock[data-internal=true]{background:#fff8dc;border-color:#e0b000;box-shadow:0 0 0 2px #f3d36a55}
.meta-chat-shell .meta-chat-compose-dock{position:relative}
.meta-chat-shell .meta-chat-compose-dock[data-internal=true]::before{content:"🔒 Nota interna — o contato não recebe";position:absolute;top:-26px;left:8px;z-index:2;font-size:11.5px;font-weight:600;color:#8a5a00;background:#fff3c4;border:1px solid #ecd27a;border-radius:999px;padding:2px 10px;pointer-events:none}
.meta-chat-shell .meta-chat-compose{position:relative;background:#f0f2f5;border-top:0}
.meta-chat-shell .meta-chat-compose-dock{border-radius:10px;border-color:transparent;box-shadow:0 1px 1px rgba(11,20,26,.06)}
.meta-chat-shell .meta-chat-compose-dock button[type=submit]:not(:disabled){background:var(--wa-teal);border-radius:999px}
/* Reply arrow only on hover (desktop), always available by keyboard */
@media (hover:hover){.meta-chat-shell .meta-chat-reply{opacity:0}.meta-chat-shell .group\/msg:hover .meta-chat-reply,.meta-chat-shell .meta-chat-reply:focus-visible{opacity:1}}
/* Header: lighter, more room for the conversation */
.meta-chat-shell .meta-chat-contact-header{background:#f0f2f5;border-bottom:1px solid #e1e4e7}

/* Conversation bar (one line) */
.meta-chat-shell .nchat-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;padding:6px 14px;background:#fff;border-bottom:1px solid #e9edef;font-size:13px;color:#3b4a54;flex-shrink:0}
.nchat-bar-kind,.nchat-bar-owner{display:flex;align-items:center;gap:6px;min-width:0}
.nchat-bar-kind{padding:3px 10px;border-radius:999px;background:#e7f6f1;color:#05614b}
.nchat-bar-kind[data-kind=contact]{background:#eef1f4;color:#46525c}
.nchat-bar-kind b{font-weight:600}
.nchat-bar-job{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px;display:inline-block;vertical-align:bottom}
.nchat-link{background:none;border:0;padding:0 0 0 4px;color:#027eb5;font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:2px;font-size:12.5px}
.nchat-bar-owner{flex:1 1 auto}
.nchat-bar-who{font-weight:600;color:#111b21}
.nchat-bar[data-owner=mine] .nchat-bar-who{color:#05614b}
.nchat-bar[data-owner=other] .nchat-bar-who{color:#8a5a00}
.nchat-bar-hint{color:#667781;font-size:12.5px}
.nchat-bar-actions{position:relative;display:flex;gap:6px;margin-left:auto}
.nchat-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:999px;border:1px solid #d1d7db;background:#fff;color:#3b4a54;font-size:13px;font-weight:600;cursor:pointer}
.nchat-btn:hover{background:#f5f6f6}
.nchat-btn--primary{background:var(--wa-green,#008069);border-color:transparent;color:#fff}
.nchat-btn--primary:hover{background:#006e5a}
.nchat-btn:disabled{opacity:.55;cursor:not-allowed}
.nchat-menu{position:absolute;right:0;top:40px;z-index:40;width:260px;max-height:320px;overflow:auto;background:#fff;border-radius:10px;box-shadow:0 8px 28px rgba(11,20,26,.18);padding:6px}
.nchat-menu-title{font-size:12px;font-weight:600;color:#667781;padding:6px 10px 4px;margin:0}
.nchat-menu-empty{font-size:13px;color:#667781;padding:8px 10px;margin:0}
.nchat-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:none;border-radius:8px;font-size:13.5px;color:#111b21;cursor:pointer;text-align:left}
.nchat-menu-item:hover{background:#f0f2f5}
.nchat-avatar{width:28px;height:28px;border-radius:50%;background:#dfe5e7;color:#54656f;display:inline-flex;align-items:center;justify-content:center;font-weight:600;font-size:12px;flex-shrink:0}
.nchat-menu-wait{margin-left:auto;font-size:12px;color:#667781}
.nchat-bar-notice{flex-basis:100%;margin:0;font-size:12.5px;color:#05614b}
@media (max-width:640px){.meta-chat-shell .nchat-bar-hint{display:none}.meta-chat-shell .meta-chat-history{padding:12px 10px}}

/* CHAT_UX_R3: one-line contact header (desktop) + nicer initials when there is no photo. */
@media (min-width:768px){
.meta-chat-shell .meta-chat-contact-header{flex-direction:row!important;align-items:center;flex-wrap:nowrap;gap:8px;padding:8px 14px}
.meta-chat-shell .meta-chat-contact-header>div:first-child,.meta-chat-shell .meta-chat-contact-header .meta-chat-context{display:contents!important}
.meta-chat-shell .meta-chat-contact-header>div:first-child>div:first-child{order:1;flex:1 1 auto;min-width:0}
.meta-chat-shell .meta-chat-contact-header h4{font-size:15px;line-height:1.25}
.meta-chat-shell .meta-chat-contact-phone{display:block!important;font-size:12px;line-height:1.3;color:#667781;font-weight:500}
.meta-chat-shell .meta-chat-context>div:first-child{display:none!important}
.meta-chat-shell .meta-chat-context-controls{order:2;width:auto!important;flex-wrap:nowrap!important}
.meta-chat-shell .meta-chat-context select{min-height:34px!important;height:34px;border-radius:999px;padding:0 10px;max-width:170px}
.meta-chat-shell .meta-chat-contact-actions{order:3;width:auto!important;margin-left:0!important;flex-wrap:nowrap!important;gap:2px!important}
.meta-chat-shell .meta-chat-contact-actions>button{min-width:36px!important;min-height:36px!important;height:36px;padding:0 9px;border-radius:999px!important;border:0!important;background:transparent!important;box-shadow:none!important;color:#54656f!important;font-size:13px!important}
.meta-chat-shell .meta-chat-contact-actions>button:hover{background:#e3e6e9!important}
.meta-chat-shell .meta-chat-contact-actions>button[title^="Abrir perfil"]{display:none!important}
.meta-chat-shell .meta-chat-contact-actions>button:not([title^="Abrir Roteiro"]) span{display:none!important}
.meta-chat-shell .meta-chat-contact-actions>button[title^="Abrir Roteiro"]{color:#008069!important;font-weight:600}
.meta-chat-shell .meta-chat-contact-actions>button.bg-amber-500{background:#fef3c7!important;color:#92400e!important}
.meta-chat-shell .meta-chat-contact-actions>button.bg-indigo-600{background:#d9fdd3!important;color:#005c4b!important}
.meta-chat-shell .meta-chat-more{display:none!important}
}
.meta-chat-shell .meta-chat-contact-header .w-8.h-8:not(:has(img)),.meta-chat-shell .meta-chat-session .w-10.h-10:not(:has(img)){background:linear-gradient(135deg,#25d366,#128c7e)!important;color:#fff!important;border-color:transparent!important;border-radius:999px!important;font-weight:700}
.meta-chat-shell .meta-chat-contact-header .w-8.h-8:has(img),.meta-chat-shell .meta-chat-session .w-10.h-10:has(img){border-radius:999px!important}

/* CHAT_UX_R6: invite / message dialog while sending (both footer buttons disabled = sending). */
@keyframes nxa-spin{to{transform:rotate(360deg)}}
@keyframes nxa-bar{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
.nxa-dialog:has(.nxa-footer .nxa-secondary:disabled){position:relative;overflow:hidden}
.nxa-dialog:has(.nxa-footer .nxa-secondary:disabled)::before{content:"";position:absolute;top:0;left:0;width:40%;height:3px;border-radius:3px;background:linear-gradient(90deg,transparent,#25d366,#128c7e,transparent);animation:nxa-bar 1.2s ease-in-out infinite;z-index:2}
.nxa-dialog:has(.nxa-footer .nxa-secondary:disabled) .nxa-field textarea{opacity:.6;transition:opacity .2s}
.nxa-footer:has(.nxa-secondary:disabled){align-items:center}
.nxa-footer:has(.nxa-secondary:disabled)::before{content:"Enviando pelo WhatsApp Oficial… leva alguns segundos.";margin-right:auto;font-size:13px;color:#667781}
.nxa-footer:has(.nxa-secondary:disabled) .nxa-button:not(.nxa-secondary):disabled{display:inline-flex;align-items:center;gap:8px;background:#4f46e5;border-color:#4f46e5;color:#fff;opacity:.92;cursor:progress}
.nxa-footer:has(.nxa-secondary:disabled) .nxa-button:not(.nxa-secondary):disabled::before{content:"";width:15px;height:15px;border:2px solid rgb(255 255 255/.45);border-top-color:#fff;border-radius:50%;animation:nxa-spin .7s linear infinite}
.nxa-footer:has(.nxa-secondary:disabled) .nxa-secondary:disabled{opacity:.55}
@media (max-width:520px){.nxa-footer:has(.nxa-secondary:disabled)::before{display:none}}
@media (prefers-reduced-motion:reduce){.nxa-dialog:has(.nxa-footer .nxa-secondary:disabled)::before,.nxa-footer:has(.nxa-secondary:disabled) .nxa-button:not(.nxa-secondary):disabled::before{animation:none}}

/* CHAT_UX_R8: template wizard — sticky step actions, unchanged-text hint, open personalization. */
.ntm-body>.overflow-hidden{overflow:clip}
.ntm-body .ntp-review-actions{padding-top:8px}
.ntm-body .ntp-editor-actions,.ntm-body .ntp-review-confirmation{position:sticky;bottom:0;z-index:5;background:rgb(255 255 255/.97);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);padding:12px 0!important;margin-top:16px;border-top:1px solid #e2e8f0;box-shadow:0 -10px 18px -12px rgb(15 23 42/.25)}
.ntp-unchanged-hint{margin:12px 0 0;padding:10px 12px;border-radius:10px;background:#fffbeb;border:1px solid #fcd34d;color:#78350f;font-size:13px;line-height:1.5}
.ntp-optional-fields[open]>summary{font-weight:600;color:#0f172a}
.ntp-optional-fields>div{display:grid;gap:14px}
/* R9: footer flush with the modal edge (wrapper p-5 sm:p-7), preview stays in view while editing. */
.ntm-body .ntp-editor-actions,.ntm-body .ntp-review-confirmation{margin-bottom:-20px;padding-bottom:16px!important}
@media (min-width:640px){.ntm-body .ntp-editor-actions,.ntm-body .ntp-review-confirmation{margin-bottom:-28px;padding-bottom:20px!important}}
@media (min-width:900px){.ntm-body .ntp-editor-preview{position:sticky;top:12px;align-self:start}}
.ntp-details[open]>summary{font-weight:600;color:#0f172a}
.ntp-details[open]>div{margin-top:8px;padding:10px 12px;border-radius:10px;background:#f8fafc;border:1px solid #e2e8f0;line-height:1.55}

/* R11: Revisar / Resultado in two columns (actions left, phone right), no duplicate heading inside the modal. */
.ntm-body section.overflow-hidden>.p-5>.flex.flex-wrap.items-start:first-child{display:none}
@media (min-width:900px){
.ntm-body .ntp-review,.ntm-body .ntp-status{display:grid;grid-template-columns:minmax(0,1fr) 360px;column-gap:40px;align-items:start;max-width:none!important;width:100%;margin:0!important}
.ntm-body .ntp-review>*,.ntm-body .ntp-status>*{grid-column:1}
.ntm-body .ntp-review>.ntp-review-preview,.ntm-body .ntp-status>.ntp-status-preview{grid-column:2;grid-row:1 / span 8;position:sticky;top:0;border:0!important;padding:0!important;margin:0!important}
.ntm-body .ntp-review>.ntp-review-preview>div,.ntm-body .ntp-status>.ntp-status-preview>div{margin-top:0!important}
.ntm-body .ntp-status>.ntp-status-preview>h4{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.ntm-body .ntp-review>h3{margin-top:0}
.ntm-body .ntp-review .ntp-footnote{text-align:left!important;margin-left:0!important}
.ntm-body .ntp-review .ntp-review-confirmation{position:static!important;box-shadow:none!important;border:1px solid #e2e8f0!important;border-radius:14px;padding:16px!important;margin:16px 0 0!important;background:#f8fafc!important;-webkit-backdrop-filter:none;backdrop-filter:none!important}
.ntm-body .ntp-review .ntp-review-actions{display:flex;flex-wrap:nowrap;justify-content:space-between;gap:12px}
.ntm-body .ntp-review .ntp-review-actions>button{white-space:nowrap}
.ntm-body .ntp-unchanged-hint,.ntm-body .ntp-status .ntp-details>div{max-width:none}
}
