/* ============================================================================
   chat-list.css — Conversas: lista, filtros, painel do contato, reunião e
   "Nova conversa" (zona A de app/views/client/chats/index.php; serve o dono e
   o atendente). Carrega DEPOIS do chats.css (que vira só o legado da conversa).

   Regras: só tokens do ui-kit (docs/DESIGN-SYSTEM.md) e as regras de conteúdo
   do docs/UX-CALMA.md (linha 68px, avatar 40, até 1 selo extra, etiquetas como
   bolinhas, 4 filtros em pílula + "Filtros", painel 340px com seções
   recolhíveis). Sem sombra, sem faixa de accent, sem !important, sem cor solta
   (a exceção são as cores de MARCA dos canais, iguais às do selo de canal do
   ui-kit). O style.css (compartilhado com o admin) não é tocado: aqui se
   sobrescreve por escopo (.chl-side, .chl-panel, .chl-main).

   Desempenho: cada linha da lista é `content-visibility: auto` (o navegador
   não diagrama nem pinta o que está fora da tela), os ícones repetidos por
   linha são máscara CSS (um SVG por tipo, em cache) e as transições só mexem
   em opacity/transform.
   ============================================================================ */

/* ── Escala local (deriva dos tokens do ui-kit) ─────────────────────────── */
.wa-layout.chl-layout {
    --chl-side-w: 360px;
    --chl-panel-w: 320px;
    --chl-row-h: 68px;
    --chl-row-hover: var(--ui-fill-1);
    --chl-row-sel: rgba(var(--ui-accent-rgb), .09);
    /* Aro do selo do canal: a cor OPACA do fundo da linha em cada estado. */
    --chl-ring: var(--ui-bg-card);
    --chl-ring-hover: color-mix(in srgb, rgb(var(--ui-neutral-rgb)) 4.5%, var(--ui-bg-card));
    --chl-ring-sel: color-mix(in srgb, rgb(var(--ui-accent-rgb)) 9%, var(--ui-bg-card));
    background: var(--ui-bg-card);
    color: var(--ui-ink);
    font-family: var(--ui-font);
}
@media (min-width: 1600px) {
    .wa-layout.chl-layout { --chl-side-w: 380px; --chl-panel-w: 360px; }
}

/* ── Ícone por máscara (repetido por linha): <span class="chl-ic chl-ic-NOME"> */
.chl-ic { display: inline-block; flex: 0 0 auto; width: 1em; height: 1em; background-color: currentColor; -webkit-mask: var(--chl-ic) center / contain no-repeat; mask: var(--chl-ic) center / contain no-repeat; }

/* Esconder visualmente (leitor de tela continua lendo) */
.chl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ════════════════════════════════════════════════════════════════════════
   BARRA LATERAL (lista)
   ════════════════════════════════════════════════════════════════════════ */
.wa-sidebar.chl-side { width: var(--chl-side-w); min-width: var(--chl-side-w); background: var(--ui-bg-card); border-right: 1px solid var(--ui-line); }

/* Topo: canal (à esquerda, como a "conta" das referências) + ações */
.chl-top { display: flex; align-items: center; gap: var(--ui-space-2); flex-shrink: 0; padding: var(--ui-space-3) var(--ui-space-3) var(--ui-space-2) var(--ui-space-2); }
.chl-top-actions { display: flex; align-items: center; gap: var(--ui-space-1); flex-shrink: 0; }

.chl-scope { position: relative; flex: 1 1 auto; min-width: 0; }
.chl-scope-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin: 0; padding: 6px 8px; border: 0; border-radius: var(--ui-r-lg); background: transparent; color: var(--ui-ink); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--ui-dur-1) var(--ui-ease); }
.chl-scope-btn:hover, .chl-scope-btn[aria-expanded="true"] { background: var(--ui-fill-1); }
.chl-scope-btn:active { background: var(--ui-fill-2); }
.chl-scope-btn:focus:not(:focus-visible) { outline: none; }
.chl-scope-btn:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 1px; }
.chl-scope-tile { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: var(--ui-r-md); background: var(--ui-fill-2); color: var(--ui-ink-2); }
.chl-scope-tile svg { width: var(--ui-ic-md); height: var(--ui-ic-md); grid-area: 1 / 1; }
.chl-scope-tile .wa-dd-cur-ico { grid-area: 1 / 1; display: grid; place-items: center; margin: 0; font-size: var(--ui-ic-md); }
.chl-scope-tile .wa-dd-cur-ico[hidden], .chl-scope-def { display: none; }
.chl-scope-tile[data-scope="wa"] .chl-scope-def--wa, .chl-scope-tile[data-scope="multi"] .chl-scope-def--multi, .chl-scope-tile[data-scope="none"] .chl-scope-def--multi { display: grid; place-items: center; grid-area: 1 / 1; }
.chl-scope-tile[data-scope="wa"] { background: rgba(var(--ui-ok-rgb), .13); color: var(--ui-ok-ink); }
.chl-scope-tile[data-scope="ig"] { background: rgba(193, 53, 132, .12); color: #B0306F; }
.chl-scope-tile[data-scope="tg"] { background: rgba(var(--ui-tg-rgb), .13); color: var(--ui-tg-ink); }
:root[data-theme="dark"] .chl-scope-tile[data-scope="ig"] { background: rgba(228, 112, 159, .16); color: #E4709F; }
.chl-scope-tile .wa-dd-ico-ig, .chl-scope-tile .wa-dd-ico-tg { color: inherit; font-size: inherit; }
.chl-scope-txt { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; gap: 1px; }
.chl-scope-btn .wa-dd-label { display: block; margin: 0; font-size: var(--ui-fs-body-lg); font-weight: var(--ui-fw-semibold); line-height: 20px; letter-spacing: -.01em; color: var(--ui-ink); }
.chl-scope-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--ui-fs-help); line-height: 16px; color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chl-scope-meta.is-warn { color: var(--ui-warn-ink); }
.chl-scope-chev { flex: 0 0 auto; width: var(--ui-ic-sm); height: var(--ui-ic-sm); color: var(--ui-muted); transition: transform var(--ui-dur-2) var(--ui-ease-out); }
.chl-scope-btn[aria-expanded="true"] .chl-scope-chev { transform: rotate(180deg); }

/* Popover dos canais (ui-popover + uiPanel) */
.chl-scope-pop { width: min(320px, calc(100vw - 24px)); }
.chl-scope-pop > .ui-mbody { padding: 4px 8px 10px; }
.chl-scope-pop .wa-dd-sep { height: 1px; margin: 6px 8px; background: var(--ui-line-2); }
.chl-scope-pop .wa-dd-group { padding: 8px 8px 4px; font-size: var(--ui-fs-caption); font-weight: var(--ui-fw-semibold); letter-spacing: .05em; text-transform: uppercase; color: var(--ui-muted); }
.chl-scope-pop .wa-dd-opt { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0; padding: 6px 8px; border-radius: var(--ui-r-sm); font-size: var(--ui-fs-body); font-weight: var(--ui-fw-medium); color: var(--ui-ink); cursor: pointer; transition: background-color var(--ui-dur-1) var(--ui-ease); }
.chl-scope-pop .wa-dd-opt:hover { background: var(--ui-fill-2); }
.chl-scope-pop .wa-dd-opt .wa-ico { flex: 0 0 auto; font-size: var(--ui-ic-sm); }
.chl-scope-pop .wa-dd-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chl-scope-pop .wa-dd-all { font-weight: var(--ui-fw-semibold); }
.chl-dd-ico-wa { color: var(--ui-ok-ink); }
.chl-scope-pop .wa-dd-ico-ig { color: #B0306F; }
:root[data-theme="dark"] .chl-scope-pop .wa-dd-ico-ig { color: #E4709F; }
.chl-scope-pop .wa-dd-ico-tg { color: var(--ui-tg-ink); }
/* Estado do dispositivo: ponto + palavra na dica (o nome já diz qual é) */
.chl-dd-st { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; font-size: var(--ui-fs-help); font-weight: var(--ui-fw-regular); color: var(--ui-muted); }
.chl-dd-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ui-muted-2); }
.chl-dd-st.is-on::before { background: var(--ui-ok); }
.chl-dd-st.is-off { color: var(--ui-warn-ink); }
.chl-dd-st.is-off::before { background: var(--ui-warn); }
.chl-dd-empty { padding: 4px 8px 8px; }
/* A caixinha do seletor (input.device-chk) ganha .ui-checkbox pelo JS. */

/* Busca + Filtros */
.chl-search-row { display: flex; align-items: center; gap: var(--ui-space-2); flex-shrink: 0; padding: 0 var(--ui-space-3) var(--ui-space-2); }
.chl-search { flex: 1 1 auto; }
.chl-search .ui-input { background-color: var(--ui-fill-1); border-color: transparent; }
.chl-search .ui-input:hover { border-color: var(--ui-line-strong); }
.chl-search .ui-input:focus { background-color: var(--ui-field-bg); border-color: var(--ui-accent); }
.chl-filters-btn { flex: 0 0 auto; gap: 6px; padding-left: var(--ui-space-3); padding-right: var(--ui-space-3); }
.chl-filters-btn[aria-expanded="true"] { background-color: var(--ui-fill-2); border-color: var(--ui-ctl-line); }
.chl-filters-btn .ui-count { min-width: 18px; height: 18px; padding: 0 5px; }
.chl-filters-btn .ui-count[hidden] { display: none; }
.chl-filters-btn.has-active { border-color: rgba(var(--ui-accent-rgb), .45); color: var(--ui-accent-ink); }

/* Pílulas de filtro (até 4 visíveis; rola de lado com esmaecimento) */
.chl-pills { flex-wrap: nowrap; flex-shrink: 0; gap: 6px; padding: 2px var(--ui-space-3) var(--ui-space-3); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-padding-inline: var(--ui-space-3); }
.chl-pills::-webkit-scrollbar { display: none; }
.chl-pills.has-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.chl-pills .ui-pill { flex: 0 0 auto; }

/* Popover "Filtros" */
.chl-filters-pop { width: min(340px, calc(100vw - 24px)); }
.chl-filters-pop > .ui-mbody { display: flex; flex-direction: column; gap: var(--ui-space-5); padding-top: 14px; padding-bottom: 8px; }
.chl-fsec[hidden] { display: none; }
.chl-fsec-t { margin: 0 0 var(--ui-space-2); font-size: var(--ui-fs-label); font-weight: var(--ui-fw-semibold); color: var(--ui-ink); }
.chl-fsec-sub { margin: 10px 0 6px; font-size: var(--ui-fs-help); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chl-fsec-sub:first-of-type { margin-top: 0; }
.chl-fsec .ui-pills { gap: 6px; }
.chl-fsec .ui-switch { margin-top: var(--ui-space-3); }
.chl-fsec-note { margin: 6px 0 0; font-size: var(--ui-fs-help); line-height: var(--ui-lh-body); color: var(--ui-muted); }
.chl-pill-mark { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--chl-mark, var(--ui-muted-2)); }
.ui-pill[aria-pressed="true"] .chl-pill-mark { box-sizing: content-box; border: 1.5px solid var(--ui-card-bg); margin: -1.5px; }
.chl-filters-pop > .ui-mfoot { padding-top: 8px; }

/* ── Lista ─────────────────────────────────────────────────────────────── */
.chl-side .wa-chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--ui-space-2) var(--ui-space-3); scrollbar-width: thin; scrollbar-color: var(--ui-line-strong) transparent; }
.chl-side .wa-chat-list::-webkit-scrollbar { width: 6px; }
.chl-side .wa-chat-list::-webkit-scrollbar-thumb { background: var(--ui-line-strong); border-radius: 3px; }

.wa-chat-wrap { position: relative; }
.wa-chat-wrap[hidden] { display: none; }
/* Linha fora da tela: sem diagramar nem pintar (milhares de conversas). */
.chl-side .wa-chat-wrap { content-visibility: auto; contain-intrinsic-size: auto var(--chl-row-h); }
.chl-side .wa-chat-wrap + .wa-chat-wrap { margin-top: 2px; }

.chl-side .wa-chat-item { display: flex; align-items: center; gap: var(--ui-space-3); min-height: var(--chl-row-h); margin: 0; padding: 12px; border: 0; border-radius: var(--ui-r-lg); background: transparent; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; transition: background-color var(--ui-dur-1) var(--ui-ease); }
.chl-side .wa-chat-item:hover { background: var(--chl-row-hover); color: inherit; }
.chl-side .wa-chat-item.active, .chl-side .wa-chat-item.active:hover { background: var(--chl-row-sel); border-left: 0; padding-left: 12px; }
.chl-side .wa-chat-item:focus:not(:focus-visible) { outline: none; }
.chl-side .wa-chat-item:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: -2px; }
.chl-side .wa-chat-item:active { background: var(--ui-fill-2); }

/* Avatar 40 (ui-avatar) com a cor do contato em TOM SUAVE (.chl-av) */
.wa-av-wrap { position: relative; display: flex; flex-shrink: 0; }
.chl-av { --chl-hue: var(--wa-av-bg, var(--ui-muted)); --ui-av-bg: color-mix(in srgb, var(--chl-hue) 16%, var(--ui-bg-card)); --ui-av-fg: color-mix(in srgb, var(--chl-hue) 72%, var(--ui-ink)); }
:root[data-theme="dark"] .chl-av { --ui-av-bg: color-mix(in srgb, var(--chl-hue) 24%, var(--ui-bg-card)); --ui-av-fg: color-mix(in srgb, var(--chl-hue) 55%, var(--ui-ink)); }
.chl-av.is-group { --chl-hue: var(--ui-muted); }
.wa-chat-avatar.chl-av { width: 40px; height: 40px; max-width: 40px; max-height: 40px; flex: 0 0 auto; overflow: hidden; background: var(--ui-av-bg); color: var(--ui-av-fg); font-size: 15px; font-weight: var(--ui-fw-semibold); }
.chl-av > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.chl-av > img[hidden] { display: none; }
.chl-av .wa-av-init { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: transparent; color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: .01em; }
.chl-av .wa-av-init[hidden] { display: none; }
.chl-av .wa-av-init--icon { font-size: 18px; }
.chl-av .wa-av-init--icon .chl-ic, .chl-av .wa-av-init--icon svg { width: 18px; height: 18px; }
/* Selo do canal no canto da foto (ui-chan-dot), um pouco menor que o padrão */
.chl-side .wa-av-wrap > .ui-chan-dot { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; --ui-chan-dot-ring: var(--chl-ring); }
.chl-side .wa-av-wrap > .ui-chan-dot svg, .chl-side .wa-av-wrap > .ui-chan-dot:empty::before { width: 10px; height: 10px; }
.chl-side .wa-chat-item:hover .ui-chan-dot { --ui-chan-dot-ring: var(--chl-ring-hover); }
.chl-side .wa-chat-item.active .ui-chan-dot { --ui-chan-dot-ring: var(--chl-ring-sel); }

/* Texto: nome (600 só se não lida), prévia de 1 linha, hora à direita */
.chl-side .wa-chat-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chl-side .wa-chat-row1, .chl-side .wa-chat-row2 { display: flex; align-items: center; justify-content: flex-start; gap: 6px; min-width: 0; }
.chl-side .wa-chat-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-body); font-weight: var(--ui-fw-medium); line-height: 20px; color: var(--ui-ink); }
.chl-side .wa-chat-item.has-unread .wa-chat-name { font-weight: var(--ui-fw-semibold); }
.chl-side .wa-chat-time { flex: 0 0 auto; margin-left: auto; font-size: var(--ui-fs-help); line-height: 20px; color: var(--ui-muted); font-variant-numeric: tabular-nums; white-space: nowrap; transition: opacity var(--ui-dur-1) var(--ui-ease); }
.chl-side .wa-chat-item.has-unread .wa-chat-time { color: var(--ui-accent-ink); font-weight: var(--ui-fw-semibold); }
.chl-side .wa-chat-preview { display: block; flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-label); line-height: 18px; color: var(--ui-muted); }
.chl-side .wa-chat-item.has-unread .wa-chat-preview { color: var(--ui-ink-2); }
.chl-pv-ic { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; opacity: .85; }

/* Etiquetas: como no WhatsApp, numa linha própria ABAIXO da prévia, com o
   nome (ui-tag compacta, cor só na bolinha; até 2 + "+N", numa linha só,
   nome longo com reticências). Antes eram bolinhas sem nome ao lado do nome. */
.chl-side .wa-chat-labels { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; min-width: 0; margin-top: 3px; overflow: hidden; }
.chl-side .wa-chat-labels[hidden] { display: none; }
.chl-side .wa-label-dot { flex: 0 1 auto; min-width: 0; height: 18px; max-width: 132px; margin: 0; padding: 0 7px; gap: 4px; font-size: var(--ui-fs-caption); color: var(--ui-ink-2); }
.chl-side .chl-lbl-more { flex: 0 0 auto; }
.chl-side .wa-label-dot .ui-tag-mark { width: 6px; height: 6px; }
.chl-side .wa-label-dot[hidden], .chl-side .wa-label-dot.is-over { display: none; }
.chl-lbl-more { font-size: var(--ui-fs-caption); font-weight: var(--ui-fw-semibold); line-height: 1; color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.chl-lbl-more[hidden] { display: none; }

/* Chip de anúncio (só o ícone, compacto) */
.chl-side .wa-chat-ad { flex: 0 0 auto; margin: 0; padding: 1px 4px; border-radius: 6px; }
.chl-side .wa-chat-ad svg { width: 12px; height: 12px; }

/* Origem (só com 2+ canais): texto discreto na cor do canal, não um selo */
.chl-side .wa-chat-device { max-width: 96px; margin: 0; padding: 0; background: transparent; border-radius: 0; font-size: var(--ui-fs-caption); font-weight: var(--ui-fw-medium); line-height: 20px; }
/* O chats.css pinta o fundo do selo no escuro com :root[data-theme="dark"] .wa-chat-device--* (mais especifico):
   aqui a origem continua so texto na cor do canal, igual ao claro. */
:root[data-theme="dark"] .chl-side .wa-chat-device { background: transparent; }
#chatList[data-multi-channel="1"] .wa-chat-device { display: inline-block; margin-left: auto; }
#chatList[data-multi-channel="1"] .wa-chat-device + .wa-chat-time { margin-left: 0; }
#chatList[data-multi-channel="1"] .wa-chat-device + .wa-chat-time::before { content: "·"; margin-right: 6px; color: var(--ui-muted-2); }

/* Segunda linha: selo de atendimento, sino, não lidas */
.chl-side .wa-chat-row2 .wa-attend { flex: 0 0 auto; margin: 0; }
/* Nome de quem atende dentro do selo: corta com reticências, nunca quebra a linha. */
.wa-attend-txt { display: inline-block; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
@media (max-width: 420px) { .wa-attend-txt { max-width: 72px; } }
.chl-side .wa-muted-icon { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; color: var(--ui-muted-2); font-size: 14px; }
/* Fixada no topo (migration 340): alfinete 14 px no mesmo tom do sino, máscara CSS como os outros selos da linha. */
.chl-side .wa-pinned-icon { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; color: var(--ui-muted-2); font-size: 14px; }
.chl-side .wa-chat-item .wa-unread-badge { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 20px; height: 20px; margin: 0; padding: 0 6px; border-radius: var(--ui-r-pill); background: var(--ui-accent); color: var(--ui-on-primary, #fff); font-size: var(--ui-fs-caption); font-weight: var(--ui-fw-semibold); line-height: 1; font-variant-numeric: tabular-nums; }
.chl-side .wa-chat-item.is-muted .wa-unread-badge { background: var(--ui-fill-3); color: var(--ui-ink-2); }

/* Menu "..." da linha: aparece no hover/foco no lugar da hora (desktop);
   fixo à direita no toque. Ícone por máscara (nenhum SVG por linha). */
.chl-side .wa-chevron-btn { position: absolute; top: 8px; right: 8px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; margin: 0; padding: 0; border: 0; border-radius: var(--ui-r-sm); background: var(--chl-row-hover); color: var(--ui-muted); font-size: 18px; transform: none; opacity: 0; cursor: pointer; transition: opacity var(--ui-dur-1) var(--ui-ease), background-color var(--ui-dur-1) var(--ui-ease), color var(--ui-dur-1) var(--ui-ease); }
.chl-side .wa-chevron-btn::before { content: ""; width: 18px; height: 18px; background-color: currentColor; -webkit-mask: var(--chl-ic) center / contain no-repeat; mask: var(--chl-ic) center / contain no-repeat; }
.chl-side .wa-chevron-btn:hover { background: var(--ui-fill-3); color: var(--ui-ink); }
.chl-side .wa-chevron-btn:focus:not(:focus-visible) { outline: none; }
.chl-side .wa-chevron-btn:focus-visible { opacity: 1; outline: 2px solid var(--ui-focus); outline-offset: 0; }
.chl-side .wa-chat-wrap:hover .wa-chevron-btn, .chl-side .wa-chat-wrap.is-menu-open .wa-chevron-btn, .chl-side .wa-chat-wrap:focus-within .wa-chevron-btn { opacity: 1; }
.chl-side .wa-chat-wrap:hover .wa-chat-time, .chl-side .wa-chat-wrap.is-menu-open .wa-chat-time, .chl-side .wa-chat-wrap:focus-within .wa-chat-time { opacity: 0; }
.chl-side .wa-chat-wrap.is-menu-open .wa-chat-item { background: var(--chl-row-hover); }
.chl-side .wa-chat-wrap:has(.wa-chat-item.active) .wa-chevron-btn { background: var(--chl-row-sel); }
.chl-side .wa-chat-wrap:has(.wa-chat-item.active) .wa-chevron-btn:hover { background: var(--ui-fill-3); }
@media (hover: none) {
    /* O style.css fixa o padding da linha no celular (!important): o espaço do
       botão sai da margem do texto, não do padding. */
    .chl-side .wa-chat-wrap .wa-chat-info { margin-right: 32px; }
    .chl-side .wa-chevron-btn { top: 50%; right: 2px; width: 40px; height: 44px; margin-top: -22px; opacity: 1; background: transparent; color: var(--ui-muted-2); }
    .chl-side .wa-chat-wrap:hover .wa-chat-time, .chl-side .wa-chat-wrap:focus-within .wa-chat-time { opacity: 1; }
}

/* Menu da linha: um só, levado para o <body> na hora de abrir (ui-menu) */
.chl-row-menu { position: fixed; z-index: var(--ui-z-popover); display: block; top: 0; left: 0; right: auto; width: 248px; max-height: min(460px, calc(100vh - 24px)); overflow-y: auto; overscroll-behavior: contain; animation: uiMenuIn var(--ui-dur-2) var(--ui-ease-out); }
.chl-row-menu[hidden] { display: none; }
/* O style.css (legado) estica todo <span> do item (flex: 1): aqui cada peça
   volta ao tamanho certo (rótulo cresce, marca e seta não). */
.chl-row-menu .wa-drop-item > span { flex: 0 0 auto; }
.chl-row-menu .wa-drop-item > span:not(.chl-pill-mark):not(.wa-drop-chevron) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chl-row-menu .wa-drop-chevron { display: inline-flex; margin-left: auto; transition: transform var(--ui-dur-2) var(--ui-ease-out); }
.chl-row-menu [aria-expanded="true"] .wa-drop-chevron { transform: rotate(90deg); }
.chl-row-menu .wa-drop-chevron svg { width: 14px; height: 14px; }
.chl-row-menu .chl-row-sub { margin: 2px 0 4px; padding: 0 0 0 18px; background: transparent; border-top: 0; }
.chl-row-sub[hidden] { display: none; }
.chl-row-menu .chl-row-sub .ui-menu-item { min-height: 34px; padding: 6px 10px; font-size: var(--ui-fs-label); }
.chl-row-sub .chl-pill-mark { width: 10px; height: 10px; }
.chl-row-menu .chl-menu-note { padding: 6px 10px 8px; font-size: var(--ui-fs-help); color: var(--ui-muted); }

/* Carregar mais (rolagem infinita + botão de reserva) */
#loadMoreWrap { padding: 4px 0 8px; }
.chl-more-btn { width: 100%; color: var(--ui-muted); }
#loadMoreWrap .ui-skel-group { padding: 2px 0; }

/* Busca/filtro demorando (>300 ms): o esqueleto ocupa o lugar das linhas */
.chl-side .wa-chat-list.is-loading > .wa-chat-wrap,
.chl-side .wa-chat-list.is-loading > #waEmptyList,
.chl-side .wa-chat-list.is-loading > #loadMoreWrap { display: none; }

/* Esqueleto da lista no formato da linha */
.chl-skel-list .ui-skel-row { min-height: var(--chl-row-h); padding: 12px; }
.chl-skel-list .ui-skel-line { height: 11px; }

/* Estados vazios dentro da lista */
.chl-side .wa-chat-list > .ui-empty { padding: 40px 16px 32px; }
.chl-side .wa-chat-list > .ui-empty p { max-width: 260px; }

/* Modo privacidade: nomes, fotos e prévias borradas até passar o mouse */
body.wa-privacy-on #chatList .wa-chat-avatar,
body.wa-privacy-on #chatList .wa-chat-name,
body.wa-privacy-on #chatList .wa-chat-preview { filter: blur(5px); transition: filter var(--ui-dur-1) var(--ui-ease); }
body.wa-privacy-on #chatList .wa-chat-item:hover .wa-chat-avatar,
body.wa-privacy-on #chatList .wa-chat-item:hover .wa-chat-name,
body.wa-privacy-on #chatList .wa-chat-item:hover .wa-chat-preview { filter: none; }
#privacyToggleBtn .pi-eyeoff, #privacyToggleBtn[aria-pressed="true"] .pi-eye { display: none; }
#privacyToggleBtn[aria-pressed="true"] .pi-eyeoff { display: inline; }

/* Conversa de grupo escondida pela preferência "Esconder grupos". Fica fora
   de "Grupos" (lá os grupos são o assunto). Seletor de atributo do <body>:
   a linha nova do tempo real já nasce escondida, sem tocar no DOM. */
body[data-hide-groups="1"]:not([data-filter="groups"]) .wa-chat-wrap[data-is-group="1"] { display: none; }
/* Conversa do painel antigo do Instagram não passa pelo atendimento. */
body[data-filter="attending"] .wa-chat-wrap[data-ig-account-id],
body[data-filter="waiting"] .wa-chat-wrap[data-ig-account-id] { display: none; }

/* ════════════════════════════════════════════════════════════════════════
   ÁREA PRINCIPAL (sem conversa aberta / abrindo)
   ════════════════════════════════════════════════════════════════════════ */
.chl-main { position: relative; }
.chl-main .wa-empty { gap: 0; padding: var(--ui-space-8); background: var(--wa-app-bg, var(--ui-bg-page)); }
.chl-main .wa-empty[hidden] { display: none; }
.chl-main-empty .ui-empty-ico { width: 56px; height: 56px; border-radius: var(--ui-r-xl); background: var(--ui-bg-card); border: 1px solid var(--ui-line); color: var(--ui-accent-ink); }
.chl-main-empty .ui-empty-ico svg { width: 24px; height: 24px; }
.chl-main-empty p { margin-bottom: 0; }
#chatFrame { display: block; width: 100%; height: 100%; border: 0; background: var(--wa-app-bg, var(--ui-bg-page)); opacity: 1; transition: opacity var(--ui-dur-2) var(--ui-ease-out); }
#chatFrame[hidden] { display: none; }
#chatFrame.is-loading { opacity: 0; transition-duration: calc(var(--ui-dur-1) * .75); transition-timing-function: var(--ui-ease-in); }

/* Abrindo a conversa: cabeçalho com o nome NA HORA (da linha clicada) e as
   bolhas em esqueleto só depois de 300 ms (ui-skel-group). */
.chl-frame-skel { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; background: var(--wa-app-bg, var(--ui-bg-page)); pointer-events: none; }
.chl-frame-skel[hidden] { display: none; }
.chl-fs-head { display: flex; align-items: center; gap: var(--ui-space-3); flex: 0 0 auto; height: 60px; padding: 0 var(--ui-space-4); background: var(--ui-bg-card); border-bottom: 1px solid var(--ui-line-2); }
.chl-fs-head .ui-avatar { --ui-av-size: 40px; overflow: hidden; }
.chl-fs-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-body-lg); font-weight: var(--ui-fw-semibold); color: var(--ui-ink); }
.chl-fs-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: var(--ui-space-6); }
.chl-fs-body .ui-skel-bubble { background: var(--ui-bg-card); }
.chl-fs-body .ui-skel-bubble.is-out { align-self: flex-end; width: 42%; }
.chl-fs-body .ui-skel-bubble.is-short { width: 30%; }
.chl-fs-foot { flex: 0 0 auto; height: 64px; margin: 0 var(--ui-space-4) var(--ui-space-3); border-radius: var(--ui-r-pill); background: var(--ui-bg-card); border: 1px solid var(--ui-line-2); }

/* ════════════════════════════════════════════════════════════════════════
   PAINEL DO CONTATO E DO GRUPO (gaveta à direita, 340px)
   ════════════════════════════════════════════════════════════════════════ */
.wa-contact-panel.chl-panel { width: var(--chl-panel-w); min-width: var(--chl-panel-w); display: flex; flex-direction: column; background: var(--ui-bg-card); border-left: 1px solid var(--ui-line); color: var(--ui-ink); }
.wa-contact-panel.chl-panel[hidden] { display: none; }
.chl-panel.is-entering { animation: clPanelIn var(--ui-dur-3) var(--ui-ease-out); }
@keyframes clPanelIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.chl-panel .wa-cp-header.chl-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ui-space-2); flex-shrink: 0; height: 60px; padding: 0 var(--ui-space-3) 0 var(--ui-space-5); background: var(--ui-bg-card); border-bottom: 1px solid var(--ui-line-2); color: var(--ui-ink); }
.chl-panel-title { font-size: var(--ui-fs-title); font-weight: var(--ui-fw-semibold); letter-spacing: var(--ui-ls-title); color: var(--ui-ink); }
.chl-panel-head-actions { display: flex; align-items: center; gap: var(--ui-space-1); }
.chl-panel-head .ui-mclose { margin: 0; }
.chl-panel .wa-cp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ui-line-strong) transparent; }

/* Herói: foto 64, nome, linha de meta */
.chl-panel .wa-cp-avatar-section { display: flex; flex-direction: column; align-items: center; gap: 0; padding: var(--ui-space-6) var(--ui-space-5) var(--ui-space-5); background: transparent; text-align: center; }
.chl-panel .chl-hero-av { --ui-av-size: 72px; overflow: hidden; margin-bottom: var(--ui-space-3); font-size: 26px; }
.chl-panel .chl-hero-av > img.wa-cp-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.chl-panel .wa-cp-name { margin: 0; max-width: 100%; overflow-wrap: anywhere; font-size: var(--ui-fs-modal); font-weight: var(--ui-fw-semibold); line-height: var(--ui-lh-tight); letter-spacing: var(--ui-ls-title); color: var(--ui-ink); }
.chl-panel .wa-cp-phone { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: var(--ui-fs-body); color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.chl-panel .wa-cp-phone:empty { display: none; }
.chl-hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: var(--ui-space-3); }

/* Seção recolhível: título 14 neutro (nada de laranja em caixa alta) */
.chl-sec { border-top: 1px solid var(--ui-line-2); }
.chl-sec-head { display: flex; align-items: center; gap: var(--ui-space-1); min-height: 52px; padding: 6px var(--ui-space-3) 6px var(--ui-space-2); }
.chl-sec-toggle { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: 40px; margin: 0; padding: 0 var(--ui-space-3) 0 var(--ui-space-2); border: 0; border-radius: var(--ui-r-md); background: transparent; color: var(--ui-ink); font: inherit; font-size: var(--ui-fs-body); font-weight: var(--ui-fw-semibold); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--ui-dur-1) var(--ui-ease); }
.chl-sec-toggle:hover { background: var(--ui-fill-1); }
.chl-sec-toggle:focus:not(:focus-visible) { outline: none; }
.chl-sec-toggle:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: -2px; }
.chl-sec-chev { flex: 0 0 auto; width: var(--ui-ic-sm); height: var(--ui-ic-sm); color: var(--ui-muted); transition: transform var(--ui-dur-2) var(--ui-ease-out); }
.chl-sec-toggle[aria-expanded="false"] .chl-sec-chev { transform: rotate(-90deg); }
.chl-sec-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chl-sec-n { flex: 0 0 auto; }
.chl-sec-n[hidden] { display: none; }
.chl-sec-add { flex: 0 0 auto; }
.chl-sec-body { padding: 0 var(--ui-space-5) var(--ui-space-5); }
.chl-sec-body[hidden] { display: none; }
.chl-sec-body.is-entering { animation: clFadeDown var(--ui-dur-2) var(--ui-ease-out); }
@keyframes clFadeDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.chl-sec-empty { margin: 0; padding: 2px 0 4px; font-size: var(--ui-fs-label); line-height: var(--ui-lh-body); color: var(--ui-muted); }
.chl-sec-empty a { color: var(--ui-accent-ink); font-weight: var(--ui-fw-medium); text-decoration: none; }
.chl-sec-empty a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* "Sobre": pares rótulo/valor. .wa-cp-section-label é o RÓTULO do campo
   ("Telefone", "Telegram"), não mais o título laranja da seção. */
.chl-about { display: flex; flex-direction: column; gap: var(--ui-space-4); }
.chl-panel .wa-cp-section-label { display: block; margin: 0 0 4px; padding: 0; font-size: var(--ui-fs-help); font-weight: var(--ui-fw-medium); line-height: 16px; letter-spacing: 0; text-transform: none; color: var(--ui-muted); }
.chl-panel .wa-cp-section-item { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 0; padding: 0; border: 0; font-size: var(--ui-fs-body); line-height: 20px; color: var(--ui-ink); }
.chl-panel .wa-cp-section-item > .wa-cp-ident-ico { display: inline-flex; flex: 0 0 auto; color: var(--ui-muted); font-size: 16px; }
.chl-panel .wa-cp-section-item > .chl-val { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.chl-copy { flex: 0 0 auto; }
.chl-copy.is-done { color: var(--ui-ok-ink); }
.chl-win-help { margin: 6px 0 0; font-size: var(--ui-fs-help); line-height: var(--ui-lh-body); color: var(--ui-muted); }

/* Reuniões: linha com tile do tipo, título, quando, ação "..." */
.chl-mtgs { display: flex; flex-direction: column; gap: 2px; margin: 0 calc(var(--ui-space-2) * -1); }
.chl-mtg { position: relative; display: flex; align-items: flex-start; gap: var(--ui-space-3); padding: 10px var(--ui-space-2); border-radius: var(--ui-r-lg); transition: background-color var(--ui-dur-1) var(--ui-ease); }
.chl-mtg:hover { background: var(--ui-fill-1); }
.chl-mtg .ui-tile { margin-top: 1px; }
.chl-mtg-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chl-mtg-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-body); font-weight: var(--ui-fw-medium); line-height: 20px; color: var(--ui-ink); }
.chl-mtg-when { font-size: var(--ui-fs-help); line-height: 16px; color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.chl-mtg-link { align-self: flex-start; margin-top: 4px; }
.chl-mtg.is-cancelled .chl-mtg-title { color: var(--ui-muted); text-decoration: line-through; text-decoration-color: var(--ui-muted-2); }
.chl-mtg.is-past { opacity: .72; }
.chl-mtg .ui-dropdown { flex: 0 0 auto; margin: -2px -4px 0 0; }
.chl-mtg-more { margin-top: var(--ui-space-2); }
.chl-mtg-past[hidden] { display: none; }
.chl-mtg-past { margin-top: var(--ui-space-1); }

/* Campos personalizados */
.chl-cfs { display: flex; flex-direction: column; gap: 2px; margin: 0 calc(var(--ui-space-2) * -1); }
.chl-cf { display: flex; align-items: flex-start; gap: var(--ui-space-2); padding: 8px var(--ui-space-2); border-radius: var(--ui-r-lg); transition: background-color var(--ui-dur-1) var(--ui-ease); }
.chl-cf:hover { background: var(--ui-fill-1); }
.chl-cf-body { flex: 1 1 auto; min-width: 0; }
.chl-cf-key { font-size: var(--ui-fs-help); font-weight: var(--ui-fw-medium); line-height: 16px; color: var(--ui-muted); overflow-wrap: anywhere; }
.chl-cf-val { font-size: var(--ui-fs-body); line-height: 20px; color: var(--ui-ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.chl-cf .ui-dropdown { flex: 0 0 auto; }
/* Editor em linha (campo e nota): cartão com borda, sem sombra */
.chl-editor { display: flex; flex-direction: column; gap: var(--ui-space-3); margin: 0 0 var(--ui-space-3); padding: var(--ui-space-4); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); background: var(--ui-bg-card); animation: clFadeDown var(--ui-dur-2) var(--ui-ease-out); }
.chl-editor .ui-field { margin: 0; }
.chl-editor .ui-textarea { min-height: 72px; }
.chl-editor-actions { display: flex; justify-content: flex-end; gap: var(--ui-space-2); }
.chl-editor-key { display: inline-flex; align-self: flex-start; }

/* Follow-up da conversa (acima de Notas; docs/ux/FOLLOW-UPS.md): 1 cartão no
   tom das notas com selo de estado + quando, mensagem pronta (até 3 linhas),
   nota e as ações rápidas. Sem follow-up: frase + botão de marcar. */
.chl-fu { position: relative; padding: 10px 12px; border-radius: var(--ui-r-lg); background: var(--ui-fill-1); }
.chl-fu-head { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.chl-fu-head .ui-badge { flex: 0 0 auto; }
.chl-fu-when { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-label); font-weight: var(--ui-fw-medium); line-height: 20px; color: var(--ui-ink); font-variant-numeric: tabular-nums; }
.chl-fu-head .ui-dropdown { flex: 0 0 auto; margin-left: auto; }
.chl-fu-msg { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0 0; font-size: var(--ui-fs-body); line-height: var(--ui-lh-body); color: var(--ui-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.chl-fu-note { margin: 4px 0 0; font-size: var(--ui-fs-help); line-height: var(--ui-lh-body); color: var(--ui-muted); overflow-wrap: anywhere; }
/* API Oficial: linha do modelo que sai fora das 24 h; aviso "Precisa de modelo" com o botão. */
.chl-fu-tpl { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: var(--ui-fs-help); line-height: var(--ui-lh-body); color: var(--ui-muted); }
.chl-fu-tpl svg { flex: 0 0 auto; width: 14px; height: 14px; color: var(--ui-ok-ink); }
.chl-fu-warn { display: flex; flex-direction: column; align-items: flex-start; gap: var(--ui-space-2); margin-top: var(--ui-space-2); padding: 10px 12px; border-radius: var(--ui-r-md); background: rgba(var(--ui-danger-rgb), .07); }
.chl-fu-warn-txt { margin: 6px 0 0; font-size: var(--ui-fs-help); line-height: var(--ui-lh-body); color: var(--ui-ink-2); }
.chl-fu-warn .chl-fu-warn-txt { margin: 0; }
.chl-fu-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); margin-top: var(--ui-space-3); }
.chl-fu-acts .ui-menu { min-width: 260px; }
.chl-fu-acts .ui-menu-item .ui-menu-hint { white-space: nowrap; }
.chl-fu-acts .ui-dropdown .ui-menu { min-width: 190px; }
.chl-fu .ui-menu { min-width: 190px; }
.chl-fu-new { margin-top: var(--ui-space-2); }
.chl-fu-block { margin: 0; }

/* Notas */
.chl-notes { display: flex; flex-direction: column; gap: var(--ui-space-2); }
.chl-note { position: relative; padding: 10px 12px; border-radius: var(--ui-r-lg); background: var(--ui-fill-1); }
.chl-note-meta { display: flex; align-items: center; gap: 6px; min-height: 24px; margin-bottom: 2px; font-size: var(--ui-fs-help); color: var(--ui-muted); }
.chl-note-meta .chl-note-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--ui-fw-medium); color: var(--ui-ink-2); }
.chl-note-meta .ui-dropdown { margin-left: auto; }
.chl-note-text { font-size: var(--ui-fs-body); line-height: var(--ui-lh-body); color: var(--ui-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.chl-note-edit[hidden], .chl-note-text[hidden] { display: none; }
.chl-note-edit { display: flex; flex-direction: column; gap: var(--ui-space-2); margin-top: 4px; }
.chl-note-edit .ui-textarea { min-height: 64px; }

/* Botão "..." pequeno das linhas do painel */
.chl-dots { color: var(--ui-muted); }
.chl-mtg .ui-menu, .chl-cf .ui-menu, .chl-note .ui-menu { min-width: 190px; }

/* Grupo: participantes */
.chl-gp-search { margin-bottom: var(--ui-space-3); }
.chl-gp-list { display: flex; flex-direction: column; margin: 0 calc(var(--ui-space-2) * -1); }
.chl-panel .wa-gp-member { display: flex; align-items: center; gap: var(--ui-space-3); padding: 8px var(--ui-space-2); border: 0; border-radius: var(--ui-r-lg); background: transparent; transition: background-color var(--ui-dur-1) var(--ui-ease); }
.chl-panel .wa-gp-member:hover { background: var(--ui-fill-1); }
.chl-panel .wa-gp-avatar { --ui-av-size: 36px; width: 36px; height: 36px; font-size: 13px; background: var(--ui-av-bg); color: var(--ui-av-fg); }
.chl-panel .wa-gp-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chl-panel .wa-gp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-body); font-weight: var(--ui-fw-medium); color: var(--ui-ink); }
.chl-panel .wa-gp-phone { font-size: var(--ui-fs-help); color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.chl-panel .wa-gp-badge { flex: 0 0 auto; }
.chl-panel .wa-gp-member.is-busy, .chl-gp-req.is-busy { opacity: .55; pointer-events: none; }
.chl-panel .wa-gp-member .chl-gp-mmenu { flex: 0 0 auto; margin-right: -4px; }
.chl-panel .wa-gp-member .ui-menu { min-width: 220px; }

/* Grupo: herói editável (foto com menu, nome com lápis, meta) */
.chl-gp-hero.is-busy .chl-gp-av { opacity: .55; pointer-events: none; }
.chl-gp-av { position: relative; display: inline-flex; margin-bottom: var(--ui-space-3); }
.chl-gp-av .chl-hero-av { margin-bottom: 0; }
.chl-gp-cam-dd { position: absolute; right: -6px; bottom: -4px; }
.chl-gp-cam.ui-btn { border-color: var(--ui-bg-card); background: var(--ui-bg-card); color: var(--ui-ink-2); }
.chl-gp-cam.ui-btn:hover { background: var(--ui-fill-2); color: var(--ui-ink); }
.chl-gp-cam-dd .ui-menu { min-width: 180px; }
.chl-gp-title { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; min-width: 0; }
.chl-gp-title .wa-cp-name { min-width: 0; }
.chl-gp-pencil { color: var(--ui-muted); }
.chl-gp-edit { display: flex; flex-direction: column; gap: var(--ui-space-2); width: 100%; text-align: left; }
.chl-gp-edit-actions { display: flex; justify-content: flex-end; gap: var(--ui-space-2); }
.chl-gp-edit-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--ui-space-3); }
.chl-gp-edit-meta .chl-gp-count { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Grupo: descrição (quebras preservadas, link no tom da marca) */
.chl-gp-desc { margin: 0; padding: 2px 0 0; font-size: var(--ui-fs-body); line-height: var(--ui-lh-body); color: var(--ui-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.chl-gp-desc a { color: var(--ui-accent-ink); text-decoration: none; }
.chl-gp-desc a:hover { text-decoration: underline; text-underline-offset: 3px; }
.chl-sec-empty .ui-btn-link.ui-btn-sm { height: auto; padding: 0; vertical-align: baseline; font-size: inherit; }

/* Grupo: ajustes (uma linha por decisão: ícone, título, apoio, controle) */
.chl-gp-rows { display: flex; flex-direction: column; }
.chl-gp-row { display: flex; flex-direction: column; gap: var(--ui-space-2); padding: var(--ui-space-3) 0; border-top: 1px solid var(--ui-line-2); }
.chl-gp-row:first-child { padding-top: 2px; border-top: 0; }
.chl-gp-row:last-child { padding-bottom: 0; }
.chl-gp-row.is-busy .ui-seg, .chl-gp-row.is-busy .ui-toggle, .chl-gp-invite.is-busy { opacity: .55; pointer-events: none; }
.chl-gp-row-head { display: flex; align-items: center; gap: var(--ui-space-3); min-height: 28px; margin: 0; }
label.chl-gp-row-head { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chl-gp-row-ic { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 18px; color: var(--ui-muted); }
.chl-gp-row-ic svg { width: 18px; height: 18px; }
.chl-gp-row-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chl-gp-row-t { font-size: var(--ui-fs-label); font-weight: var(--ui-fw-semibold); line-height: var(--ui-lh-snug); color: var(--ui-ink); }
.chl-gp-row-d { font-size: var(--ui-fs-help); line-height: var(--ui-lh-body); color: var(--ui-muted); }
.chl-gp-row .ui-seg, .chl-gp-invite { margin-left: calc(18px + var(--ui-space-3)); }
.chl-gp-row .ui-seg.ui-seg-block { width: auto; max-width: calc(100% - 18px - var(--ui-space-3)); }
.chl-gp-row .ui-toggle { flex: 0 0 auto; margin: 0; }
.chl-gp-invite { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.chl-gp-invite .ui-linkfield { width: 100%; min-width: 0; }
.chl-gp-invite .ui-linkfield-url { flex: 1 1 auto; min-width: 0; }
.chl-gp-invite-reset { margin-left: -2px; }

/* Grupo: pedidos de entrada */
.chl-gp-req-all { display: flex; justify-content: flex-end; margin: -6px 0 2px; }
.chl-gp-req { display: flex; align-items: center; gap: var(--ui-space-3); padding: 6px 0; }
.chl-gp-req + .chl-gp-req { border-top: 1px solid var(--ui-line-2); }
.chl-gp-req-acts { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }

/* Grupo: rodapé "Sair do grupo" */
.chl-gp-foot { padding: var(--ui-space-4) var(--ui-space-5) var(--ui-space-6); border-top: 1px solid var(--ui-line-2); }

/* Modal "Adicionar participantes": resultado por pessoa */
.chl-gp-results { display: flex; flex-direction: column; margin-top: var(--ui-space-4); border-top: 1px solid var(--ui-line-2); }
.chl-gp-results[hidden] { display: none; }
.chl-gp-result { display: flex; align-items: center; justify-content: space-between; gap: var(--ui-space-3); min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--ui-line-2); }
.chl-gp-result-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chl-gp-result-ph { font-size: var(--ui-fs-body); font-weight: var(--ui-fw-medium); color: var(--ui-ink); font-variant-numeric: tabular-nums; }
.chl-gp-result-why { font-size: var(--ui-fs-help); line-height: var(--ui-lh-body); color: var(--ui-muted); }
.chl-gp-result .ui-badge { flex: 0 0 auto; }

/* Carregando o painel: esqueleto no formato do herói + seções */
.chl-panel-skel { padding: var(--ui-space-6) var(--ui-space-5); }
.chl-panel-skel .ui-skel-circle { width: 72px; height: 72px; margin: 0 auto var(--ui-space-4); }
.chl-panel-skel .ui-skel-title { margin: 0 auto 10px; }
.chl-panel-skel .ui-skel-line.is-short { margin: 0 auto 28px; width: 40%; }
.chl-panel-skel .ui-skel-block { height: 44px; margin-bottom: 10px; }
.chl-panel-err { padding: var(--ui-space-8) var(--ui-space-5); }

/* ════════════════════════════════════════════════════════════════════════
   MODAL "Reunião" (ui-modal md + folha de baixo no celular)
   ════════════════════════════════════════════════════════════════════════ */
.chl-mtg-modal .ui-mbody { padding-top: var(--ui-space-5); }
.chl-mtg-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ui-space-2); }
.chl-mtg-types .ui-choice { align-items: center; gap: 10px; padding: 12px; }
.chl-mtg-types .ui-choice > .ui-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.chl-mtg-types .ui-choice { position: relative; }
.chl-mtg-types .ui-choice .ui-tile { transition: background-color var(--ui-dur-1) var(--ui-ease), color var(--ui-dur-1) var(--ui-ease); }
.chl-mtg-types .ui-choice:has(input:checked) .ui-tile { background: rgba(var(--ui-accent-rgb), .14); color: var(--ui-accent-ink); }
.chl-mtg-types .ui-choice-title { font-size: var(--ui-fs-label); }
.chl-mtg-types .ui-choice-desc { font-size: var(--ui-fs-caption); }
@media (max-width: 560px) {
    .chl-mtg-types { grid-template-columns: minmax(0, 1fr); }
}
.chl-dur { gap: 6px; }
.chl-dur .ui-pill { min-width: 64px; justify-content: center; }
.chl-mtg-modal .ui-field-row { align-items: start; }
/* "Repetir" sozinho (sem "Até") ocupa a linha toda. */
.chl-mtg-modal .ui-field-row:has(> .ui-field[hidden]) > .ui-field:not([hidden]) { grid-column: 1 / -1; }


/* "Mais opções" recolhido (descrição, repetição, lembrete, mensagens) */
.chl-adv { margin-top: var(--ui-space-1); border-top: 1px solid var(--ui-line-2); }
.chl-adv > summary { display: flex; align-items: center; gap: var(--ui-space-2); min-height: 52px; padding: 8px 0; list-style: none; cursor: pointer; color: var(--ui-ink); font-size: var(--ui-fs-body); font-weight: var(--ui-fw-semibold); -webkit-tap-highlight-color: transparent; }
.chl-adv > summary::-webkit-details-marker { display: none; }
.chl-adv > summary:focus:not(:focus-visible) { outline: none; }
.chl-adv > summary:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; border-radius: var(--ui-r-sm); }
.chl-adv-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-help); font-weight: var(--ui-fw-regular); color: var(--ui-muted); }
.chl-adv-chev { flex: 0 0 auto; margin-left: auto; width: var(--ui-ic-sm); height: var(--ui-ic-sm); color: var(--ui-muted); transition: transform var(--ui-dur-2) var(--ui-ease-out); }
.chl-adv[open] > summary .chl-adv-chev { transform: rotate(180deg); }
.chl-adv-body { padding: var(--ui-space-2) 0 var(--ui-space-1); }
.chl-adv[open] .chl-adv-body { animation: clFadeDown var(--ui-dur-2) var(--ui-ease-out); }
/* Variáveis da mensagem como fichas clicáveis */
.chl-vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--ui-space-2); }
.chl-vars-lbl { font-size: var(--ui-fs-help); color: var(--ui-muted); margin-right: 2px; }
.chl-var { height: 26px; padding: 0 10px; font-size: var(--ui-fs-help); }

/* ════════════════════════════════════════════════════════════════════════
   MODAL "Nova conversa"
   ════════════════════════════════════════════════════════════════════════ */
.chl-nc .ui-mbox { max-height: min(720px, calc(100vh - 3.5rem)); max-height: min(720px, calc(100dvh - 3.5rem)); }
.chl-nc .ui-mbody { display: flex; flex-direction: column; min-height: 0; padding-bottom: 0; }
.chl-nc-tools { display: flex; flex-direction: column; gap: var(--ui-space-3); flex-shrink: 0; }
.chl-nc-tools .ui-field { margin: 0; }
.chl-nc-device[hidden] { display: none; }
.wa-nc-tgnote { margin: 0 0 var(--ui-space-3); }
.wa-nc-tgnote a { color: var(--ui-accent-ink); font-weight: var(--ui-fw-semibold); text-decoration: none; }
.wa-nc-tgnote a:hover { text-decoration: underline; text-underline-offset: 3px; }
.chl-nc-manual { margin: var(--ui-space-3) calc(var(--ui-space-2) * -1) 0; flex-shrink: 0; }
.chl-nc-manual-btn { display: flex; align-items: center; gap: var(--ui-space-3); width: 100%; min-height: 56px; padding: 8px var(--ui-space-2); border: 0; border-radius: var(--ui-r-lg); background: transparent; color: var(--ui-ink); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--ui-dur-1) var(--ui-ease); }
.chl-nc-manual-btn:hover { background: var(--ui-fill-1); }
.chl-nc-manual-btn:focus:not(:focus-visible) { outline: none; }
.chl-nc-manual-btn:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: -2px; }
.chl-nc-manual-txt { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.chl-nc-manual-t { font-size: var(--ui-fs-body); font-weight: var(--ui-fw-semibold); line-height: 20px; }
.chl-nc-manual-s { font-size: var(--ui-fs-help); line-height: 16px; color: var(--ui-muted); }
.chl-nc-manual-btn .chl-nc-chev { flex: 0 0 auto; width: var(--ui-ic-sm); height: var(--ui-ic-sm); color: var(--ui-muted); transition: transform var(--ui-dur-2) var(--ui-ease-out); }
.chl-nc-manual-btn[aria-expanded="true"] .chl-nc-chev { transform: rotate(180deg); }
.chl-nc-manual-box { display: flex; flex-direction: column; gap: var(--ui-space-2); padding: 4px var(--ui-space-2) var(--ui-space-3); }
.chl-nc-manual-box[hidden] { display: none; }
.chl-nc-manual-row { display: flex; gap: var(--ui-space-2); }
.chl-nc-manual-row .iti { flex: 1 1 auto; min-width: 0; display: block; }
.chl-nc-manual-row > .ui-input { flex: 1 1 auto; min-width: 0; }
.chl-nc-manual-row .ui-btn { flex: 0 0 auto; }
.chl-nc-manual-box .iti__tel-input { width: 100%; }
.chl-nc-manual-box .ui-error { margin-top: 0; }
.wa-nc-list { flex: 1 1 auto; min-height: 160px; overflow-y: auto; overscroll-behavior: contain; margin: var(--ui-space-2) calc(var(--ui-space-6) * -1) 0; padding: 0 var(--ui-space-4) var(--ui-space-4); border-top: 1px solid var(--ui-line-2); }
.wa-nc-group { position: sticky; top: 0; z-index: 1; padding: 12px 8px 4px; background: var(--ui-bg-raised); font-size: var(--ui-fs-caption); font-weight: var(--ui-fw-semibold); letter-spacing: .05em; text-transform: uppercase; color: var(--ui-muted); }
.wa-nc-item { display: flex; align-items: center; gap: var(--ui-space-3); width: 100%; min-height: 56px; margin: 0; padding: 8px; border: 0; border-radius: var(--ui-r-lg); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 56px; transition: background-color var(--ui-dur-1) var(--ui-ease); }
.wa-nc-item:hover { background: var(--ui-fill-1); }
.wa-nc-item:focus:not(:focus-visible) { outline: none; }
.wa-nc-item:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: -2px; }
.wa-nc-item[aria-busy="true"] { opacity: .6; pointer-events: none; }
.wa-nc-item-avatar.chl-av { --ui-av-size: 40px; overflow: hidden; font-size: 15px; }
.wa-nc-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wa-nc-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-body); font-weight: var(--ui-fw-medium); line-height: 20px; color: var(--ui-ink); }
.wa-nc-item-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-help); line-height: 16px; color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.wa-nc-list > .ui-empty { padding: 32px 16px; }

/* ════════════════════════════════════════════════════════════════════════
   PAINEL ANTIGO DO INSTAGRAM (contas que ainda não foram unificadas)
   ════════════════════════════════════════════════════════════════════════ */
.chl-ig { flex: 1 1 auto; display: flex; flex-direction: column; height: 100%; min-width: 0; overflow: hidden; background: var(--wa-app-bg, var(--ui-bg-page)); }
.chl-ig-head { display: flex; align-items: center; gap: var(--ui-space-3); flex-shrink: 0; height: 60px; padding: 0 var(--ui-space-4); background: var(--ui-bg-card); border-bottom: 1px solid var(--ui-line-2); }
.chl-ig-head .ui-avatar { overflow: hidden; }
.chl-ig-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.chl-ig-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-body-lg); font-weight: var(--ui-fw-semibold); color: var(--ui-ink); }
.chl-ig-sub { display: flex; align-items: center; gap: 6px; font-size: var(--ui-fs-help); color: var(--ui-muted); }
.chl-ig-sub a { color: inherit; text-decoration: none; }
.chl-ig-sub a:hover { color: var(--ui-ink); text-decoration: underline; text-underline-offset: 3px; }
.chl-ig-note { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 8px var(--ui-space-4); background: rgba(var(--ui-warn-rgb), .08); border-bottom: 1px solid rgba(var(--ui-warn-rgb), .2); font-size: var(--ui-fs-label); color: var(--ui-warn-ink); }
.chl-ig-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.chl-ig-msgs { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: var(--ui-space-4) var(--ui-space-5); }
.chl-ig-older { display: flex; justify-content: center; padding: 6px 0 12px; }
.ig-msg-wrap { display: flex; justify-content: flex-start; margin-bottom: 6px; }
.ig-msg-wrap.is-me { justify-content: flex-end; }
.chl-ig-bubble { max-width: 65%; padding: 8px 12px 6px; border-radius: 16px; background: var(--ui-bg-card); border: 1px solid var(--ui-line-2); color: var(--ui-ink); font-size: var(--ui-fs-body-lg); line-height: 1.45; overflow-wrap: anywhere; }
.ig-msg-wrap.is-me .chl-ig-bubble { background: rgba(var(--ui-accent-rgb), .12); border-color: transparent; }
.chl-ig-bubble img, .chl-ig-bubble video { display: block; max-width: 100%; margin-bottom: 4px; border-radius: var(--ui-r-lg); }
.chl-ig-react { font-size: 1.5rem; line-height: 1.2; }
.chl-ig-story { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: var(--ui-fs-help); color: var(--ui-muted); }
.chl-ig-time { margin-top: 2px; text-align: right; font-size: var(--ui-fs-caption); color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.chl-ig-fab { position: absolute; right: 16px; bottom: 16px; z-index: 5; }
.chl-ig-fab[hidden] { display: none; }
.chl-ig-fab .ui-count { position: absolute; top: -6px; right: -6px; }
.chl-ig-fab .ui-count[hidden] { display: none; }
.chl-ig-composer { display: flex; align-items: center; gap: var(--ui-space-2); flex-shrink: 0; padding: 10px var(--ui-space-4); background: var(--ui-bg-card); border-top: 1px solid var(--ui-line-2); }
.chl-ig-composer .ui-input { flex: 1 1 auto; border-radius: var(--ui-r-pill); }

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVO
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) and (min-width: 768px) {
    .wa-layout.chl-layout { --chl-side-w: 300px; }
}
@media (max-width: 767px) {
    .chl-side .wa-chat-list { padding-left: var(--ui-space-1); padding-right: var(--ui-space-1); }
    .chl-top { padding: var(--ui-space-2) var(--ui-space-2) var(--ui-space-1); }
    .chl-search-row { padding-left: var(--ui-space-3); padding-right: var(--ui-space-3); }
    .chl-panel .wa-cp-header.chl-panel-head { height: 56px; }
}
@media (max-width: 380px) {
    .chl-filters-btn .chl-filters-lbl { display: none; }
    .chl-filters-btn { padding-left: 0; padding-right: 0; width: var(--ui-btn-h); }
}

@media (prefers-reduced-motion: reduce) {
    .chl-panel.is-entering, .chl-sec-body.is-entering, .chl-editor, .chl-adv[open] .chl-adv-body, .chl-row-menu { animation: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   ÍCONES POR MÁSCARA (Lucide, contorno). Gerados de app/helpers/Lucide.php.
   ════════════════════════════════════════════════════════════════════════ */
.chl-ic-ellipsis { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%271%27 /%3E%3Ccircle cx=%2719%27 cy=%2712%27 r=%271%27 /%3E%3Ccircle cx=%275%27 cy=%2712%27 r=%271%27 /%3E%3C/svg%3E"); }
.chl-ic-pin { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M12 17v5%27 /%3E%3Cpath d=%27M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z%27 /%3E%3C/svg%3E"); }
.chl-ic-bell-off { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M10.268 21a2 2 0 0 0 3.464 0%27 /%3E%3Cpath d=%27M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742%27 /%3E%3Cpath d=%27m2 2 20 20%27 /%3E%3Cpath d=%27M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05%27 /%3E%3C/svg%3E"); }
.chl-ic-image { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Crect x=%273%27 y=%273%27 rx=%272%27 ry=%272%27 /%3E%3Ccircle cx=%279%27 cy=%279%27 r=%272%27 /%3E%3Cpath d=%27m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21%27 /%3E%3C/svg%3E"); }
.chl-ic-mic { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z%27 /%3E%3Cpath d=%27M19 10v2a7 7 0 0 1-14 0v-2%27 /%3E%3Cline x1=%2712%27 x2=%2712%27 y1=%2719%27 y2=%2722%27 /%3E%3C/svg%3E"); }
.chl-ic-video { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5%27 /%3E%3Crect x=%272%27 y=%276%27 rx=%272%27 /%3E%3C/svg%3E"); }
.chl-ic-file-text { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z%27 /%3E%3Cpath d=%27M14 2v5a1 1 0 0 0 1 1h5%27 /%3E%3Cpath d=%27M10 9H8%27 /%3E%3Cpath d=%27M16 13H8%27 /%3E%3Cpath d=%27M16 17H8%27 /%3E%3C/svg%3E"); }
.chl-ic-smile { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2710%27 /%3E%3Cpath d=%27M8 14s1.5 2 4 2 4-2 4-2%27 /%3E%3Cline x1=%279%27 x2=%279.01%27 y1=%279%27 y2=%279%27 /%3E%3Cline x1=%2715%27 x2=%2715.01%27 y1=%279%27 y2=%279%27 /%3E%3C/svg%3E"); }
.chl-ic-map-pin { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0%27 /%3E%3Ccircle cx=%2712%27 cy=%2710%27 r=%273%27 /%3E%3C/svg%3E"); }
.chl-ic-contact-round { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M16 2v2%27 /%3E%3Cpath d=%27M17.915 21a6 6 0 10-12 0%27 /%3E%3Cpath d=%27M8 2v2%27 /%3E%3Ccircle cx=%2712%27 cy=%2711%27 r=%274%27 /%3E%3Crect x=%273%27 y=%273%27 rx=%272%27 /%3E%3C/svg%3E"); }
.chl-ic-list { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M3 12h.01%27 /%3E%3Cpath d=%27M3 18h.01%27 /%3E%3Cpath d=%27M3 6h.01%27 /%3E%3Cpath d=%27M8 12h13%27 /%3E%3Cpath d=%27M8 18h13%27 /%3E%3Cpath d=%27M8 6h13%27 /%3E%3C/svg%3E"); }
.chl-ic-ban { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2710%27 /%3E%3Cpath d=%27m4.9 4.9 14.2 14.2%27 /%3E%3C/svg%3E"); }
.chl-ic-info { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2710%27 /%3E%3Cpath d=%27M12 16v-4%27 /%3E%3Cpath d=%27M12 8h.01%27 /%3E%3C/svg%3E"); }
.chl-ic-reply { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpolyline points=%279 17 4 12 9 7%27 /%3E%3Cpath d=%27M20 18v-2a4 4 0 0 0-4-4H4%27 /%3E%3C/svg%3E"); }
.chl-ic-at-sign { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%274%27 /%3E%3Cpath d=%27M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8%27 /%3E%3C/svg%3E"); }
.chl-ic-eye { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0%27 /%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%273%27 /%3E%3C/svg%3E"); }
.chl-ic-link { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71%27 /%3E%3Cpath d=%27M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71%27 /%3E%3C/svg%3E"); }
.chl-ic-circle-alert { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2710%27 /%3E%3Cline x1=%2712%27 x2=%2712%27 y1=%278%27 y2=%2712%27 /%3E%3Cline x1=%2712%27 x2=%2712.01%27 y1=%2716%27 y2=%2716%27 /%3E%3C/svg%3E"); }
.chl-ic-users { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2%27 /%3E%3Cpath d=%27M16 3.128a4 4 0 0 1 0 7.744%27 /%3E%3Cpath d=%27M22 21v-2a4 4 0 0 0-3-3.87%27 /%3E%3Ccircle cx=%279%27 cy=%277%27 r=%274%27 /%3E%3C/svg%3E"); }
.chl-ic-user { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2%27 /%3E%3Ccircle cx=%2712%27 cy=%277%27 r=%274%27 /%3E%3C/svg%3E"); }
.chl-ic-chevron-down { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27 /%3E%3C/svg%3E"); }
.chl-ic-check { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M20 6 9 17l-5-5%27 /%3E%3C/svg%3E"); }
.chl-ic-copy { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Crect x=%278%27 y=%278%27 rx=%272%27 ry=%272%27 /%3E%3Cpath d=%27M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2%27 /%3E%3C/svg%3E"); }
.chl-ic-layers { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z%27 /%3E%3Cpath d=%27M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12%27 /%3E%3Cpath d=%27M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17%27 /%3E%3C/svg%3E"); }
.chl-ic-megaphone { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z%27 /%3E%3Cpath d=%27M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14%27 /%3E%3Cpath d=%27M8 6v8%27 /%3E%3C/svg%3E"); }
.chl-ic-list-ordered { --chl-ic: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M11 5h10%27 /%3E%3Cpath d=%27M11 12h10%27 /%3E%3Cpath d=%27M11 19h10%27 /%3E%3Cpath d=%27M4 4h1v5%27 /%3E%3Cpath d=%27M4 9h2%27 /%3E%3Cpath d=%27M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02%27 /%3E%3C/svg%3E"); }

/* ════════════════════════════════════════════════════════════════════════
   CRIT-1 (01/10/2026) · acabamento
   ════════════════════════════════════════════════════════════════════════ */

/* Fundo único: modal da conversa (iframe) escurece a página inteira, com o
   mesmo tom do fundo de lá, deixando o "buraco" do iframe (que tem o próprio
   fundo): uma tela, um escurecido só. */
/* A casca não tem fundo nem recebe ponteiro: só as 4 faixas em volta do
   iframe (--chl-l/t/r/b, pelo JS) escurecem e bloqueiam. Um fundo inteiro
   com buraco por clip-path engolia a roda do mouse dentro do iframe. */
.chl-frame-scrim {
    position: fixed; inset: 0; z-index: calc(var(--ui-z-modal) - 1);
    --chl-scrim-bg: var(--ui-scrim);
    opacity: 0; pointer-events: none;
    transition: opacity calc(var(--ui-dur-3) * .75) var(--ui-ease-in);
}
.chl-frame-scrim-band { position: absolute; background: var(--chl-scrim-bg); pointer-events: none; }
.chl-frame-scrim-band:nth-child(1) { left: 0; top: 0; bottom: 0; width: var(--chl-l, 0px); }
.chl-frame-scrim-band:nth-child(2) { left: var(--chl-r, 0px); right: 0; top: 0; bottom: 0; }
.chl-frame-scrim-band:nth-child(3) { left: var(--chl-l, 0px); top: 0; width: calc(var(--chl-r, 0px) - var(--chl-l, 0px)); height: var(--chl-t, 0px); }
.chl-frame-scrim-band:nth-child(4) { left: var(--chl-l, 0px); top: var(--chl-b, 0px); bottom: 0; width: calc(var(--chl-r, 0px) - var(--chl-l, 0px)); }
.chl-frame-scrim.is-on { opacity: 1; transition-duration: var(--ui-dur-3); transition-timing-function: var(--ui-ease-out); }
.chl-frame-scrim.is-on > .chl-frame-scrim-band { pointer-events: auto; }
.chl-frame-scrim.is-photo { --chl-scrim-bg: rgba(10, 11, 14, .88); }
/* modal do Bootstrap dentro da conversa: o fundo dele é o do style.css (#2A2D34 a 45%) */
.chl-frame-scrim.is-bs { --chl-scrim-bg: rgba(42, 45, 52, .45); }

/* Pílulas de filtro: quando não cabem, a borda que rola esmaece dos dois
   lados e uma seta discreta (só com mouse) leva às de fora; nada parece
   cortado. A roda do mouse rola de lado (chat-list.js). */
.chl-pills-wrap { position: relative; flex-shrink: 0; }
.chl-pills.has-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent calc(100% - 12px)); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent calc(100% - 12px)); }
.chl-pills.has-less { -webkit-mask-image: linear-gradient(to right, transparent 12px, #000 56px); mask-image: linear-gradient(to right, transparent 12px, #000 56px); }
.chl-pills.has-more.has-less { -webkit-mask-image: linear-gradient(to right, transparent 12px, #000 56px, #000 calc(100% - 56px), transparent calc(100% - 12px)); mask-image: linear-gradient(to right, transparent 12px, #000 56px, #000 calc(100% - 56px), transparent calc(100% - 12px)); }
.chl-pills-nav {
    position: absolute; top: 2px; z-index: 1; display: none; place-items: center;
    width: 32px; height: 32px; padding: 0; border: 1px solid var(--ui-line); border-radius: 50%;
    background: var(--ui-bg-card); color: var(--ui-ink-2); cursor: pointer;
    transition: background-color var(--ui-dur-1) var(--ui-ease), color var(--ui-dur-1) var(--ui-ease);
}
.chl-pills-nav svg { width: var(--ui-ic-sm); height: var(--ui-ic-sm); }
.chl-pills-nav:hover { background: var(--ui-fill-2); color: var(--ui-ink); }
.chl-pills-nav:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 1px; }
.chl-pills-nav.is-next { right: 8px; }
.chl-pills-nav.is-prev { left: 8px; }
@media (hover: hover) and (pointer: fine) {
    .chl-pills-wrap.has-more .chl-pills-nav.is-next,
    .chl-pills-wrap.has-less .chl-pills-nav.is-prev { display: grid; }
    /* com a seta na tela, a pílula some antes dela (nada fica por baixo) */
    .chl-pills.has-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 96px), transparent calc(100% - 44px)); mask-image: linear-gradient(to right, #000 calc(100% - 96px), transparent calc(100% - 44px)); }
    .chl-pills.has-less { -webkit-mask-image: linear-gradient(to right, transparent 44px, #000 96px); mask-image: linear-gradient(to right, transparent 44px, #000 96px); }
    .chl-pills.has-more.has-less { -webkit-mask-image: linear-gradient(to right, transparent 44px, #000 96px, #000 calc(100% - 96px), transparent calc(100% - 44px)); mask-image: linear-gradient(to right, transparent 44px, #000 96px, #000 calc(100% - 96px), transparent calc(100% - 44px)); }
}

/* Convite da comunidade (casca do portal): na tela de conversas ele espera a
   próxima página (não some: só não aparece aqui). Antes ele ocupava o pé do menu
   lateral, no lugar do cartão de plano; a casca nova (docs/ux/CASCA.md, 02/10)
   não tem mais pé, e cobrir itens do menu ou a conversa não vale. SH, 02/10. */
body:has(.chl-layout) .ui-community-pop { display: none; }
@media (prefers-reduced-motion: reduce) { .chl-frame-scrim { transition: none; } }
