/* ==========================================================================
   conversas.css — tela Conversas no layout A (mockup web/preview/conversas-layout-a-v1.html,
   aprovado pelo Rafael em 02/10). Carrega depois da fundação e de crm-clientes.css; tudo aqui
   fica sob #page-conversas, então vence as regras antigas (cv-/cp-/fq-) só nesta tela — o bloco
   de conversas da página CRM continua como estava.
   O que muda: faixa "Agora" de 48 px no lugar do título + 5 cartões; lista de 264 px; fio com
   rolagem própria pegando a altura que sobra; resposta fixa embaixo; painel da cliente em coluna
   de 300 px com abas (recolhível). A altura vem do CSS (a página não rola) — o JS de altura saiu.
   ========================================================================== */

/* ── casca: a tela ocupa a janela inteira ──────────────────────────────── */
.app-shell:has(#page-conversas.is-active) { padding: 0; max-width: none; }
.app-shell:has(#page-conversas.is-active) > .topbar { display: none; }
#page-conversas.is-active { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
#page-conversas :where(*) { box-sizing: border-box; }
#page-conversas > .cv-card { flex: 1; min-height: 0; margin: 0; display: flex; flex-direction: column; }
#page-conversas > .nx-card.cv-card { margin: 16px; flex: none; }
#page-conversas > .cv-card > .fq-aviso { flex: none; margin: 8px 12px; }
#page-conversas .cv-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#page-conversas button { font: inherit; }

/* ── 1. faixa "Agora" (48 px): título · situação · números numa linha ──── */
#page-conversas .fq-agora {
  flex: none; display: flex; align-items: center; gap: 18px; height: 48px; margin: 0; padding: 0 16px;
  border-bottom: 1px solid var(--separator-soft); border-radius: 0; background: none; box-shadow: none; overflow: visible;
  white-space: nowrap; min-width: 0;
}
#page-conversas .fq-titulo { flex: none; margin: 0; font-size: var(--fs-head); font-weight: var(--fw-semibold); letter-spacing: var(--ls-head); }
#page-conversas .fq-alerta {
  flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 10px;
  border-radius: var(--r-chip); background: rgba(255, 159, 10, .14); color: var(--text); font-size: var(--fs-foot); overflow: hidden;
}
#page-conversas .fq-alerta > i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
#page-conversas .fq-alerta.is-ok { background: rgba(48, 209, 88, .14); }
#page-conversas .fq-alerta.is-ok > i { background: var(--success); }
#page-conversas .fq-alerta.is-off > i { background: var(--dim); }
#page-conversas .fq-alerta.is-off { background: var(--fill-quiet); }
#page-conversas .fq-estado { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-foot); font-weight: var(--fw-semibold); line-height: 1; }
#page-conversas .fq-sub { flex: none; margin: 0; color: var(--muted); font-size: var(--fs-foot); }
#page-conversas .fq-alerta.is-off .fq-sub { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#page-conversas .fq-sub u { color: var(--warning); text-decoration: none; font-weight: var(--fw-semibold); }
/* número que não cabe desce pra 2ª linha e some inteiro (nunca corta no meio) */
#page-conversas .fq-kpis { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 20px 16px; height: 20px; overflow: hidden; }
#page-conversas .fq-kpis > div { flex: none; display: flex; align-items: baseline; gap: 6px; height: 20px; padding: 0; border: 0; color: var(--muted); font-size: var(--fs-foot); line-height: 20px; }
#page-conversas .fq-kpis b { color: var(--text); font-size: 15px; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
#page-conversas .fq-kpis .is-bad { color: var(--danger); }
#page-conversas .fq-kpis .fq-vazio-ainda { color: var(--dim); font-size: var(--fs-foot); font-weight: 400; }
#page-conversas .fq-agora-dir { flex: none; margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
#page-conversas .fq-agora-dir .cp-vivo { font-size: 12px; }
#page-conversas .fq-agora .fq-quem { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 2px 9px 2px 3px; border-radius: var(--r-chip); background: var(--fill-quiet); color: var(--muted); font-size: 12px; }
#page-conversas .fq-agora .fq-quem.is-sem { padding: 2px 10px; color: var(--warning); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
#page-conversas .fq-agora .fq-quem i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 700 10px/1 var(--font-ui); font-style: normal; }

/* botões da tela (mockup .btn / .ic-btn) */
#page-conversas .cvx-ic, #page-conversas .cvx-bt {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border: 0;
  border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-foot); font-weight: var(--fw-medium); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color var(--dur-fast) ease, transform var(--dur-press) var(--ease-out);
}
#page-conversas .cvx-ic { width: 32px; padding: 0; background: transparent; color: var(--muted); }
#page-conversas .cvx-bt { padding: 0 12px; background: var(--fill-quiet); }
#page-conversas .cvx-ic:hover { background: var(--fill-quiet); color: var(--text); }
#page-conversas .cvx-bt:hover { background: var(--fill-hover); }
#page-conversas .cvx-ic:active, #page-conversas .cvx-bt:active { transform: scale(.97); }
#page-conversas .cvx-ic[aria-expanded="true"] { background: var(--accent-tint); color: var(--accent-text); }
#page-conversas .cvx-ic svg { width: 18px; height: 18px; }
#page-conversas .cvx-bt svg { width: 16px; height: 16px; color: var(--muted); }
#page-conversas .cvx-bt em { font-style: normal; color: var(--dim); font-variant-numeric: tabular-nums; }
#page-conversas .cvx-bt.is-on { background: var(--accent-tint); color: var(--accent-text); }
#page-conversas .cvx-bt.is-on svg { color: var(--accent-text); }
#page-conversas .cvx-grupo { flex: none; display: inline-flex; border-radius: var(--r-sm); background: var(--fill-quiet); }
#page-conversas .cvx-grupo .cvx-bt { background: transparent; border-radius: 0; }
#page-conversas .cvx-grupo .cvx-bt:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
#page-conversas .cvx-grupo .cvx-bt:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
#page-conversas .cvx-grupo .cvx-bt + .cvx-bt { box-shadow: inset 1px 0 0 var(--separator-soft); }
#page-conversas .cvx-grupo .cvx-bt:hover { background: var(--fill-hover); }
#page-conversas .cvx-grupo .cvx-bt.is-on { background: var(--accent-tint); }

/* menus ▾ e ⋯ */
#page-conversas .cvx-mn { position: relative; flex: none; }
#page-conversas .cvx-mn-lista {
  position: absolute; right: 0; top: 38px; z-index: 20; width: 280px; margin: 0; padding: 6px; list-style: none;
  border-radius: var(--r-md); background: var(--surface-2); box-shadow: 0 12px 32px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--separator-soft);
}
#page-conversas .cvx-mn-lista[hidden] { display: none; }
#page-conversas .cvx-mn-lista.is-esq { width: 220px; top: 30px; }
#page-conversas .cvx-mn-lista button, #page-conversas .cvx-mn-lista a {
  width: 100%; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font-size: 13.5px; text-decoration: none; text-align: left; white-space: nowrap; cursor: pointer;
}
#page-conversas .cvx-mn-lista button:hover, #page-conversas .cvx-mn-lista a:hover { background: var(--accent); }
#page-conversas .cvx-mn-lista button[aria-pressed="true"] { font-weight: var(--fw-semibold); }
#page-conversas .cvx-mn-lista svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
#page-conversas .cvx-mn-lista small { margin-left: auto; color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }
#page-conversas .cvx-mn-lista small.is-alerta { color: var(--warning); }
#page-conversas .cvx-mn-lista .is-on { color: var(--accent-text); }
#page-conversas .cvx-so-movel { display: none; }

/* ── grade: lista 264 · fio · cliente 300 ──────────────────────────────── */
#page-conversas .cp-grid {
  flex: 1; min-height: 0; height: auto; margin: 0; border: 0; border-radius: 0; overflow: hidden;
  display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
}
@media (min-width: 1101px) {
  #page-conversas .cp-grid { grid-template-columns: 264px minmax(0, 1fr) 300px; }
  #page-conversas .cp-grid.is-sem-cli { grid-template-columns: 264px minmax(0, 1fr) 0; }
  #page-conversas .cp-grid .cp-ctx { position: static; width: auto; transform: none; visibility: visible; box-shadow: none; transition: none; }
  #page-conversas .cp-grid.is-sem-cli .cp-ctx { visibility: hidden; border: 0; }
}

/* ── 2. lista (264 px) ─────────────────────────────────────────────────── */
#page-conversas .cp-col-lista { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--separator-soft); background: var(--bg-soft); }
#page-conversas .cp-ferr { flex: none; width: auto; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px; padding: 10px 10px 8px; border-bottom: 1px solid var(--separator-soft); }
#page-conversas .cp-busca {
  width: 100%; height: 32px; min-height: 0; padding: 0 10px 0 30px; border: 0; border-radius: var(--r-sm); font-size: var(--fs-foot);
  background: var(--fill-quiet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2396969B' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 9px center / 14px;
}
#page-conversas .cv-numeros { display: flex; padding: 2px; border-radius: var(--r-sm); background: var(--fill-quiet); }
#page-conversas .cv-numeros button { flex: 1; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; cursor: pointer; }
#page-conversas .cv-numeros button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); font-weight: var(--fw-semibold); }
#page-conversas .cv-numeros button[aria-pressed="true"][data-conv-numero="atendimento"] { color: var(--success); }
#page-conversas .cv-filtros { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; padding: 0; border-radius: 0; background: none; overflow: visible; }
#page-conversas .cv-filtros > button, #page-conversas .cvx-mn-bt {
  flex: none; min-height: 0; height: 24px; padding: 0 6px; border: 0; border-radius: var(--r-chip); background: transparent; color: var(--muted);
  font-size: 11.5px; font-weight: var(--fw-regular); line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: pointer;
}
#page-conversas .cv-filtros > button:hover, #page-conversas .cvx-mn-bt:hover { background: var(--fill-quiet); color: var(--text); }
#page-conversas .cv-filtros > button[aria-pressed="true"], #page-conversas .cvx-mn-bt[aria-pressed="true"] { background: var(--accent-tint); color: var(--text); font-weight: var(--fw-semibold); }
#page-conversas .cv-filtros em { font-style: normal; color: var(--dim); }
#page-conversas .cv-filtros .is-alerta em { color: var(--warning); }
#page-conversas .cvx-mn-filtros { margin-left: auto; }
#page-conversas .cvx-pt { display: inline-block; width: 6px; height: 6px; margin-left: 2px; border-radius: 50%; background: var(--warning); vertical-align: 1px; }

#page-conversas .cv-lista { flex: 1; min-height: 0; max-height: none; margin: 0; padding: 4px 0; overflow-y: auto; overscroll-behavior: contain; border: 0; }
#page-conversas .cv-item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 9px; row-gap: 1px; align-items: center;
  width: 100%; padding: 7px 10px; border: 0; background: transparent; text-align: left;
}
#page-conversas .cv-lista li:first-child .cv-item { border-top: 0; }
#page-conversas .cv-item:hover { background: var(--fill-quiet); }
#page-conversas .cv-item[aria-current="true"] { background: var(--accent-tint); }
#page-conversas .cv-item .cv-av { grid-row: 1 / 3; width: 28px; height: 28px; font-size: 12px; background: var(--surface-2); color: var(--muted); }
#page-conversas .cv-item.is-espera .cv-av { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
#page-conversas .cv-item .cv-nome { min-width: 0; font-size: 13.5px; }
#page-conversas .cv-item.is-espera .cv-nome::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--warning); vertical-align: 1px; }
#page-conversas .cv-item .fq-hora-dono { gap: 6px; }
#page-conversas .cv-item .cv-hora { font-size: 11.5px; }
#page-conversas .cv-item .fq-dono { width: 16px; height: 16px; font-size: 9px; }
#page-conversas .cv-item .fq-dono.is-d { background: #8E8E93; }
#page-conversas .cv-item .fq-dono.is-ia { background: transparent; box-shadow: inset 0 0 0 1px var(--success); color: var(--success); }
#page-conversas .cv-item .cv-prev { grid-column: 2 / 4; gap: 6px; font-size: 12px; white-space: nowrap; overflow: hidden; }
#page-conversas .cv-item .fq-numero { font-size: 11px; font-variant-numeric: tabular-nums; }
/* estado na lista = bolinha + palavra curta (cor só onde é sinal: novo e vencido) */
#page-conversas .cv-item .cx-pill { flex: none; gap: 4px; padding: 0; background: none; color: var(--muted); font-size: 11px; font-weight: var(--fw-medium); }
#page-conversas .cv-item .cx-pill::before { width: 6px; height: 6px; background: var(--dim); }
#page-conversas .cv-item .cx-pill.is-novo { color: var(--warning); }
#page-conversas .cv-item .cx-pill.is-novo::before { background: var(--warning); }
#page-conversas .cv-item .cx-pill.is-venc { color: var(--danger); }
#page-conversas .cv-item .cx-pill.is-venc::before { background: var(--danger); }
#page-conversas .cv-item .cx-pill.is-atend::before { background: var(--accent-data); }
#page-conversas .cv-item .cx-pill.is-fup::before { background: var(--accent-text); }
#page-conversas .cv-item .cx-pill.is-ok::before { background: var(--success); }
#page-conversas .cv-lista > .cv-vazio { padding: 20px 12px; font-size: var(--fs-foot); }
#page-conversas .cp-resumo { flex: none; margin: 0; padding: 7px 12px; border-top: 1px solid var(--separator-soft); color: var(--dim); font-size: 11.5px; line-height: 1.4; }
#page-conversas .cp-resumo .cv-link { font-weight: var(--fw-regular); text-decoration: none; }

/* ── 3. conversa: topo · faixa do atendimento · FIO · resposta ─────────── */
#page-conversas .cv-conversa { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; }
#page-conversas .cv-conversa > .cv-vazio { margin: auto; }
#page-conversas .cv-topo {
  flex: none; display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 10px;
  height: 52px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--separator-soft);
}
#page-conversas .cv-voltar { display: none; }
#page-conversas .cv-topo .cv-av { flex: none; grid-row: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-text); font-size: 13px; font-weight: 700; }
#page-conversas .cv-quem { display: block; flex: 1; min-width: 0; }
#page-conversas .cv-quem b { display: block; font-size: 15px; font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#page-conversas .cv-quem small { display: block; margin: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
#page-conversas .cp-acoes-topo { flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; width: auto; }

/* faixa do atendimento: Estado · Dono · Motivo juntos, Prioridade e retorno ao lado */
#page-conversas .fq-barra {
  flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; height: 40px; min-width: 0; padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--separator-soft); background: var(--bg-soft); overflow: hidden;
}
#page-conversas .fq-campos { flex: none; display: inline-flex; min-width: 0; border-radius: var(--r-sm); background: var(--fill-quiet); }
#page-conversas .fq-campo { position: relative; display: inline-flex; align-items: center; gap: 5px; min-width: 0; height: 30px; padding: 0 24px 0 10px; color: var(--dim); font-size: 12px; white-space: nowrap; cursor: pointer; }
#page-conversas .fq-campo + .fq-campo { box-shadow: inset 1px 0 0 var(--separator-soft); }
#page-conversas .fq-campo b { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-size: 12.5px; font-weight: var(--fw-semibold); }
#page-conversas .fq-campo::after { content: ""; position: absolute; right: 9px; top: 11px; width: 6px; height: 6px; border-right: 1.5px solid var(--dim); border-bottom: 1.5px solid var(--dim); transform: rotate(45deg); }
#page-conversas .fq-campo .fq-sel { position: absolute; inset: 0; width: 100%; max-width: none; min-height: 0; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
#page-conversas .fq-campo:has(.fq-sel:focus-visible) { border-radius: var(--r-sm); box-shadow: var(--focus-ring); }
#page-conversas .fq-val-est { display: inline-flex; align-items: center; gap: 5px; }
#page-conversas .fq-val-est::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
#page-conversas .fq-val-est.is-novo::before { background: var(--warning); }
#page-conversas .fq-val-est.is-atend::before { background: var(--accent-data); }
#page-conversas .fq-val-est.is-fup::before { background: var(--accent-text); }
#page-conversas .fq-val-est.is-ok::before { background: var(--success); }
#page-conversas .fq-val-est.is-venc { color: var(--danger); }
#page-conversas .fq-val-est.is-venc::before { background: var(--danger); }
#page-conversas .fq-barra .fq-prio {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border-radius: var(--r-sm); color: var(--muted); font-size: 12.5px; white-space: nowrap; cursor: pointer;
}
#page-conversas .fq-barra .fq-prio:hover { background: var(--fill-quiet); color: var(--text); }
#page-conversas .fq-barra .fq-prio:has(input:checked) { color: var(--danger); background: rgba(255, 122, 112, .12); }
#page-conversas .fq-barra .fq-prio input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
#page-conversas .fq-barra .fq-prio:has(input:focus-visible) { box-shadow: var(--focus-ring); }
#page-conversas .fq-barra .fq-ret {
  flex: 0 1 auto; min-width: 0; margin: 0; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: 12.5px; white-space: nowrap; cursor: pointer;
}
#page-conversas .fq-barra .fq-ret:hover { background: var(--fill-quiet); }
#page-conversas .fq-barra .fq-ret svg { flex: none; width: 15px; height: 15px; }
#page-conversas .fq-barra .fq-ret b { flex: none; color: var(--text); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
#page-conversas .fq-barra .fq-ret.is-venc svg, #page-conversas .fq-barra .fq-ret.is-venc .fq-ret-q { color: var(--danger); }
#page-conversas .fq-barra .fq-ret-mot { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#page-conversas .fq-barra .fq-ret.is-novo { color: var(--accent-text); }
#page-conversas .fq-barra-nota { flex: none; margin: 0; padding: 6px 16px; border-bottom: 1px solid var(--separator-soft); color: var(--warning); font-size: 12px; }

/* O FIO: pega toda a altura que sobra e rola sozinho */
#page-conversas .cv-msgs { flex: 1 1 auto; min-height: 120px; max-height: none; display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 12px; overflow-y: auto; overscroll-behavior: contain; }
#page-conversas .cv-msg { max-width: min(68%, 560px); padding: 8px 12px 6px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; }
#page-conversas .cv-msg p { margin: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; font-size: 14.5px; }
#page-conversas .cv-msg small { margin-top: 3px; color: var(--dim); font-size: 11px; text-align: left; }
#page-conversas .cv-msg.is-dela { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 4px; }
#page-conversas .cv-msg.is-nossa { align-self: flex-end; background: var(--accent-tint); border-bottom-right-radius: 4px; }
#page-conversas .cv-msg.is-nossa.is-ia { background: var(--surface-2); }
#page-conversas .cv-msg.is-nossa.is-atend { background: color-mix(in srgb, var(--success) 20%, var(--surface-2)); }
#page-conversas .cv-msg.is-nossa.is-celular { background: var(--surface-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 35%, transparent); }
#page-conversas .cv-msg.is-falhou { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 55%, transparent); color: var(--muted); }
#page-conversas .cv-msg.is-dela.is-tipo p { color: var(--muted); font-style: italic; }
#page-conversas .cv-msg .cv-inter { padding: 0; background: none; }
#page-conversas .cv-msg .cv-cit { background: rgba(0, 0, 0, .18); }
#page-conversas .cv-msg.is-nossa .cp-midia { margin-left: 0; }
#page-conversas .cv-msgs > .cv-dia { margin: 8px 0 4px; }
#page-conversas .cv-msgs > .fq-mais { margin-bottom: 6px; font-weight: var(--fw-regular); text-decoration: none; }

/* RESPOSTA: fixa embaixo — rascunho da IA em 1 linha · campo · por onde sai */
#page-conversas .cv-resp { flex: none; max-height: 60%; overflow-y: auto; padding: 8px 12px 10px; border-top: 1px solid var(--separator-soft); background: var(--bg); }
#page-conversas .cv-resp > .fq-aviso { margin: 0 0 8px; padding: 6px 10px; }
#page-conversas .cp-rasc {
  display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0 0 8px; padding: 6px 6px 6px 12px;
  border-radius: var(--r-sm); background: var(--fill-quiet); box-shadow: inset 2px 0 0 var(--success); font-size: 13px;
}
#page-conversas .cp-rasc-rt { flex: none; color: var(--success); font-size: 12px; font-weight: var(--fw-semibold); }
#page-conversas .cp-rasc-alerta { flex: none; color: var(--warning); font-size: 12px; cursor: help; }
#page-conversas .cp-rasc .cp-rasc-texto { display: block; flex: 1; min-width: 0; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; -webkit-line-clamp: unset; line-clamp: none; }
#page-conversas .cp-rasc .cp-rasc-bts { flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; margin: 0; }
#page-conversas .cp-rasc .cp-rasc-bts .nx-btn { min-height: 28px; height: 28px; padding: 0 10px; font-size: 12.5px; }
#page-conversas .cp-rasc .cp-rasc-desc { background: none; color: var(--muted); }
#page-conversas .cp-rasc-info { display: none; }
#page-conversas .cp-rasc.is-aberto { flex-wrap: wrap; align-items: flex-start; }
#page-conversas .cp-rasc.is-aberto .cp-rasc-bts { margin-left: auto; }
#page-conversas .cp-rasc.is-aberto .cp-rasc-texto { order: 3; flex-basis: 100%; max-height: 12lh; overflow-y: auto; color: var(--text); white-space: pre-wrap; }
#page-conversas .cp-rasc.is-aberto .cp-rasc-info { order: 4; flex-basis: 100%; display: block; }
#page-conversas .cp-rasc-info small { display: block; margin-top: 4px; color: var(--warning); font-size: var(--fs-foot); }
#page-conversas .cp-rasc-info .cp-sombra { margin-top: 0; }
#page-conversas .cv-campo { display: flex; align-items: flex-end; gap: 8px; padding: 4px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--separator-soft); }
#page-conversas .cv-campo:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }
#page-conversas .cv-campo .cv-texto {
  flex: 1; width: auto; min-width: 0; min-height: 40px; max-height: 160px; padding: 9px 4px; border: 0; border-radius: 0;
  background: none; box-shadow: none; resize: none; outline: none; font-size: 14.5px; line-height: 1.4;
}
#page-conversas .cv-campo .cv-anexar { flex: none; width: 36px; height: 36px; min-height: 0; margin-bottom: 2px; padding: 0; justify-content: center; border-radius: var(--r-sm); background: transparent; color: var(--muted); }
#page-conversas .cv-campo .cv-anexar:hover { background: var(--fill-quiet); color: var(--text); }
#page-conversas .cv-campo .cv-anexar svg { width: 18px; height: 18px; }
#page-conversas .cv-anexar-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#page-conversas .cv-campo [data-conv-enviar] { flex: none; height: 36px; min-height: 0; margin-bottom: 2px; }
#page-conversas .cv-rotulo { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; margin: 6px 0 0; padding: 0 4px; white-space: nowrap; }
#page-conversas .cv-prazo { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--dim); font-size: 12px; }
#page-conversas .cv-resp .cv-status:not(:empty) { margin: 6px 4px 0; }
#page-conversas .cv-resp .cv-anexo { margin: 0 0 8px; }
#page-conversas .cv-fechada { margin: 0; }

/* ── 4. painel "Sobre a cliente": coluna de 300 px com abas ────────────── */
#page-conversas .cp-ctx { min-height: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--bg-soft); border-left: 1px solid var(--separator-soft); }
#page-conversas .cp-ctx-topo { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-start; gap: 8px; height: 52px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--separator-soft); background: var(--bg-soft); }
#page-conversas .cp-ctx-topo h2 { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#page-conversas .cp-ctx-fechar { display: grid; place-items: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; }
#page-conversas .cp-ctx-fechar:hover { background: var(--fill-quiet); color: var(--text); }
#page-conversas .cp-ctx-fechar svg { width: 18px; height: 18px; }
#page-conversas .cp-abas { position: sticky; top: 52px; z-index: 2; display: flex; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--separator-soft); background: var(--bg-soft); }
#page-conversas .cp-abas button { flex: 1; height: 30px; border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; }
#page-conversas .cp-abas button:hover { background: var(--fill-quiet); color: var(--text); }
#page-conversas .cp-abas button[aria-selected="true"] { background: var(--fill-quiet); color: var(--text); font-weight: var(--fw-semibold); }
#page-conversas .cp-abas em { font-style: normal; color: var(--dim); margin-left: 2px; font-variant-numeric: tabular-nums; }
#page-conversas .cp-ctx-corpo { padding: 12px 16px 24px; }
#page-conversas .cp-aba[hidden] { display: none; }
#page-conversas .cp-ctx dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
#page-conversas .cp-ctx dl > div { padding: 8px 10px; border-radius: var(--r-xs); background: var(--fill-quiet); min-width: 0; }
#page-conversas .cp-ctx dl > .cp-larga { grid-column: 1 / -1; }
#page-conversas .cp-ctx dt { color: var(--dim); font-size: 11.5px; }
#page-conversas .cp-ctx dd { margin: 2px 0 0; font-size: 15px; font-weight: var(--fw-semibold); line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#page-conversas .cp-ctx dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-weight: 400; }
#page-conversas .cp-ctx h4 { margin: 14px 0 6px; color: var(--dim); font-size: 11.5px; font-weight: var(--fw-semibold); letter-spacing: .04em; text-transform: uppercase; }
#page-conversas .cp-aba > h4:first-child { margin-top: 2px; }
#page-conversas .cp-ctx .fq-ped { margin: 0 0 6px; gap: 6px; }
#page-conversas .cp-ctx .fq-perfil { display: flex; gap: 0; margin: 0; padding: 2px; border-radius: var(--r-sm); background: var(--fill-quiet); }
#page-conversas .cp-ctx .fq-perfil button { flex: 1; min-height: 0; height: 28px; border-radius: 7px; background: none; color: var(--muted); font-size: 12.5px; font-weight: var(--fw-regular); white-space: nowrap; }
#page-conversas .cp-ctx .fq-perfil button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); font-weight: var(--fw-semibold); box-shadow: none; }
#page-conversas .cp-ctx .fq-obs { margin-top: 8px; }
#page-conversas .cp-ctx .fq-salvo { margin: 4px 0 0; }
#page-conversas .cp-vazio-aba { margin: 0 0 10px; color: var(--muted); font-size: var(--fs-foot); }
#page-conversas .fq-nota { margin: 0 0 6px; padding: 8px 10px; border-radius: var(--r-xs); background: var(--fill-quiet); box-shadow: none; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
#page-conversas .fq-nota small { display: block; margin-top: 3px; color: var(--dim); font-size: 11.5px; }
#page-conversas .fq-nota.is-cli { background: transparent; box-shadow: inset 0 0 0 1px var(--separator-soft); }
#page-conversas .fq-nota-campo { width: 100%; height: 36px; margin-top: 4px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: var(--fill-quiet); color: var(--text); font-size: 13px; }
#page-conversas .fq-nota-add { display: flex; gap: 6px; margin-top: 6px; }
#page-conversas .fq-nota-add .nx-btn { flex: 1 1 auto; min-width: 0; min-height: 32px; justify-content: center; padding: 0 8px; font-size: 12.5px; white-space: nowrap; }

/* ── 841–1100 px: o painel vira gaveta por cima da conversa (regras de crm-clientes) ── */
@media (max-width: 1100px) and (min-width: 841px) {
  #page-conversas .cp-grid .cp-ctx { width: min(320px, 100%); }
}

/* ── celular (≤ 840 px): lista OU conversa, como no app ─────────────────── */
@media (max-width: 840px) {
  #page-conversas .fq-agora { flex-wrap: wrap; height: auto; min-height: 52px; gap: 6px 10px; padding: 4px 12px 8px 12px; }
  #page-conversas .fq-agora .nav-movel-bt { margin-left: -8px; }
  #page-conversas .fq-kpis, #page-conversas .fq-agora-dir .cp-vivo, #page-conversas .fq-agora-dir .fq-quem:not(.is-sem) { display: none; }
  #page-conversas .fq-agora-dir .cvx-ic { width: 44px; height: 44px; }
  #page-conversas .fq-alerta { order: 5; flex: 1 1 100%; height: auto; min-height: 32px; padding: 6px 12px 6px 10px; border-radius: var(--r-md); white-space: normal; }
  #page-conversas .fq-alerta .fq-estado { line-height: 1.3; white-space: normal; }
  #page-conversas .fq-agora .fq-quem.is-sem { max-width: 150px; }
  #page-conversas .cp-grid { grid-template-columns: minmax(0, 1fr); }
  #page-conversas .cp-grid.is-aberta .cp-col-lista { display: none; }
  #page-conversas .cp-grid:not(.is-aberta) .cv-conversa, #page-conversas .cp-grid:not(.is-aberta) .cp-ctx { display: none; }
  #page-conversas .cp-col-lista { border-right: 0; }
  #page-conversas .cv-filtros > button, #page-conversas .cvx-mn-bt { height: 36px; padding: 0 10px; font-size: 12.5px; }
  #page-conversas .cv-numeros button { height: 32px; }
  #page-conversas .cp-busca { height: 40px; }
  #page-conversas .cv-item { padding: 10px 12px; }
  #page-conversas .cvx-mn-lista.is-esq { right: 0; }
  #page-conversas .cvx-mn-lista button, #page-conversas .cvx-mn-lista a { height: 44px; }

  #page-conversas .cv-topo { height: 56px; gap: 6px; padding: 0 6px 0 4px; }
  #page-conversas .cv-voltar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; min-height: 0; margin: 0; padding: 0; font-size: 18px; }
  #page-conversas .cv-topo .cv-av, #page-conversas .cv-quem small, #page-conversas .cvx-so-largo, #page-conversas .cvx-painel-bt { display: none; }
  #page-conversas .cvx-so-movel { display: list-item; list-style: none; }
  #page-conversas .cvx-ic { width: 44px; height: 44px; }
  #page-conversas .cvx-bt { height: 40px; padding: 0 10px; }

  #page-conversas .fq-barra { flex-wrap: wrap; height: auto; gap: 6px 8px; padding: 8px 12px; overflow: visible; }
  #page-conversas .fq-campos { flex: 1 1 100%; }
  #page-conversas .fq-campo { flex: 1 1 0; height: 36px; padding: 0 20px 0 8px; }
  #page-conversas .fq-campo .fq-rot { display: none; }
  #page-conversas .fq-campo::after { right: 7px; top: 14px; }
  #page-conversas .fq-barra .fq-prio { height: 36px; }
  #page-conversas .fq-barra .fq-ret { flex: 1 1 0; height: 36px; }

  #page-conversas .cv-msgs { padding: 12px; }
  #page-conversas .cv-msg { max-width: 85%; }
  #page-conversas .cv-resp { display: block; max-height: 60%; padding: 8px; }
  #page-conversas .cp-rasc { flex-wrap: wrap; }
  #page-conversas .cp-rasc .cp-rasc-texto { order: 3; flex-basis: 100%; }
  #page-conversas .cp-rasc .cp-rasc-bts { margin-left: auto; }
  #page-conversas .cv-campo .cv-anexar { width: 44px; height: 44px; margin: 0; }
  #page-conversas .cv-campo .cv-texto { min-height: 44px; }
  #page-conversas .cv-campo { gap: 4px; }
  #page-conversas .cv-campo [data-conv-enviar] { height: 44px; margin: 0; padding: 0 10px; font-size: 13px; }
  #page-conversas .cv-rotulo { padding: 0 2px; }
  #page-conversas .cp-ctx { border-left: 0; }
  #page-conversas .cp-ctx-fechar { width: 44px; height: 44px; }
  #page-conversas .cp-abas button { height: 40px; }
}
@media (prefers-reduced-motion: reduce) { #page-conversas .cvx-ic, #page-conversas .cvx-bt { transition: none; } }
