:root {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --ink: #111b21;
  --muted: #54656f;
  --line: #dfe4e7;
  --brand: #0a8f5b;
  --brand-ink: #ffffff;
  --brand-soft: #dcf8e8;
  --accent: #25d366;
  --accent-ink: #073b2a;
  --in: #ffffff;
  --out: #d9fdd3;
  --warn: #b25e00;
  --bad: #c62828;
  --good: #0a8f5b;
  --radius: 16px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b141a; --panel: #111b21; --ink: #e9edef; --muted: #8696a0; --line: #26343d;
    --brand: #25d366; --brand-ink: #062a1c; --brand-soft: #123a2a; --in: #202c33; --out: #005c4b;
    --warn: #f0a24a; --bad: #ff8a80; --good: #25d366;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b141a; --panel: #111b21; --ink: #e9edef; --muted: #8696a0; --line: #26343d;
    --brand: #25d366; --brand-ink: #062a1c; --brand-soft: #123a2a; --in: #202c33; --out: #005c4b;
    --warn: #f0a24a; --bad: #ff8a80; --good: #25d366;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--bad); min-height: 1.2em; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 12px 0 6px; }
a { color: var(--brand); }

.brand { font-weight: 800; font-size: 20px; letter-spacing: -.2px; color: var(--ink, inherit); display: flex; align-items: center; gap: 9px; }
.brand b { font-weight: 800; }
.brand span { color: var(--brand); }
.brand img { width: 32px; height: 32px; flex-shrink: 0; }
.brand.big { font-size: 32px; }
.brand.big img { width: 48px; height: 48px; }

.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: wait; }

input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
textarea { min-height: 120px; resize: vertical; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.row > .btn, .row > .shrink { flex: 0 0 auto; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi .v { font-size: 28px; font-weight: 700; }
.kpi .l { color: var(--muted); font-size: 13px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; }
.login-card .btn { width: 100%; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.side nav { display: grid; gap: 2px; }
.side nav a { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); display: flex; justify-content: space-between; }
.side nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side nav a .lock { font-size: 11px; color: var(--muted); }
.side-foot { margin-top: auto; display: grid; gap: 6px; }
.tenant-box { font-size: 13px; }
.main { padding: 24px; max-width: 1200px; width: 100%; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--brand-soft); color: var(--brand); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.pill.neutral { background: var(--line); color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }

.convs { display: grid; grid-template-columns: 300px 1fr 320px; gap: 16px; height: calc(100vh - 110px); }
.conv-list { overflow: auto; padding: 0; }
.conv-item { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.conv-item:hover, .conv-item.active { background: var(--brand-soft); }
.conv-item .n { font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.chat-send { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; }
.bubble { max-width: 75%; padding: 8px 10px; border-radius: 10px; background: var(--in); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.bubble.out { align-self: flex-end; background: var(--out); }
.bubble .meta { font-size: 11px; color: var(--muted); margin-top: 3px; text-align: right; }
.bubble img { max-width: 100%; border-radius: 6px; display: block; }
.analysis { overflow: auto; }
.analysis ul { padding-left: 18px; margin: 4px 0; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 80px; }
.bars div { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; }
.qr { max-width: 280px; background: #fff; padding: 10px; border-radius: 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 10; max-width: calc(100% - 32px); }
.locked { text-align: center; padding: 40px 16px; }
code, pre { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
pre { background: var(--bg); padding: 12px; border-radius: 8px; overflow: auto; }

@media (max-width: 1000px) {
  .convs { grid-template-columns: 1fr; height: auto; }
  .conv-list { max-height: 300px; }
  .chat { height: 70vh; }
}
.menu-toggle { display: none; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { position: relative; height: auto; }
  .side nav { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 16px; }
  /* celular: o menu fica fechado atrás do botão, para a página (e o primeiro acesso) aparecer logo de cara */
  .menu-toggle { display: inline-flex; position: absolute; top: 16px; right: 16px; }
  .side:not(.open) nav, .side:not(.open) .side-foot { display: none; }
}

/* ===== Conversas no estilo de app de mensagens (visual familiar, arte própria) ===== */
.main.main-wide { max-width: none; padding: 0; }
.main-wide > .card { margin: 12px; }
.wa {
  --wa-bg: #0c1317; --wa-panel: #111b21; --wa-panel-2: #202c33; --wa-hover: #2a3942; --wa-line: #222d34;
  --wa-ink: #e9edef; --wa-sub: #8696a0; --wa-in: #202c33; --wa-out: #005c4b; --wa-accent: #00a884; --wa-read: #53bdeb;
  display: grid; grid-template-columns: minmax(300px, 30%) 1fr; height: 100vh; background: var(--wa-bg); color: var(--wa-ink);
  font-size: 14.5px; position: relative; overflow: hidden;
}
:root[data-theme="light"] .wa {
  --wa-bg: #efeae2; --wa-panel: #ffffff; --wa-panel-2: #f0f2f5; --wa-hover: #f5f6f6; --wa-line: #e9edef;
  --wa-ink: #111b21; --wa-sub: #667781; --wa-in: #ffffff; --wa-out: #d9fdd3; --wa-accent: #00a884; --wa-read: #53bdeb;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .wa { --wa-bg: #efeae2; --wa-panel: #ffffff; --wa-panel-2: #f0f2f5; --wa-hover: #f5f6f6; --wa-line: #e9edef;
        --wa-ink: #111b21; --wa-sub: #667781; --wa-in: #ffffff; --wa-out: #d9fdd3; --wa-accent: #00a884; --wa-read: #53bdeb; }
}
.wa.ai-open { grid-template-columns: minmax(300px, 28%) 1fr 340px; }
.wa-side { background: var(--wa-panel); border-right: 1px solid var(--wa-line); display: flex; flex-direction: column; min-height: 0; }
.wa-side-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 8px; }
.wa-side-head strong { font-size: 20px; }
.wa-sub { color: var(--wa-sub); font-size: 12.5px; }
.wa-side-head .wa-sub { flex: 1; }
.wa-iconbtn { background: none; border: 0; color: var(--wa-sub); cursor: pointer; padding: 6px; border-radius: 50%; display: inline-grid; place-items: center; text-decoration: none; font-size: 18px; }
.wa-iconbtn:hover { background: var(--wa-hover); color: var(--wa-ink); }
.wa-searchbox { margin: 4px 12px 8px; background: var(--wa-panel-2); border-radius: 10px; display: flex; align-items: center; gap: 10px; padding: 0 12px; color: var(--wa-sub); }
.wa-searchbox input, .wa-msgsearch input { background: transparent; border: 0; color: var(--wa-ink); padding: 9px 0; outline: none; }
.wa-chips, .wa-period { display: flex; gap: 6px; padding: 0 12px 8px; flex-wrap: wrap; align-items: center; }
.wa-chip { background: var(--wa-panel-2); color: var(--wa-sub); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13.5px; }
.wa-chip.small { padding: 3px 10px; font-size: 12px; }
.wa-chip.on { background: color-mix(in srgb, var(--wa-accent) 25%, transparent); color: var(--wa-accent); font-weight: 600; }
.wa-period input[type=date] { width: auto; background: var(--wa-panel-2); border: 0; color: var(--wa-sub); font-size: 12px; padding: 3px 6px; color-scheme: dark light; }
.wa-list { flex: 1; overflow-y: auto; border-top: 1px solid var(--wa-line); }
.wa-item { display: flex; gap: 12px; padding: 0 0 0 14px; cursor: pointer; align-items: center; }
.wa-item:hover { background: var(--wa-hover); }
.wa-item.active { background: var(--wa-panel-2); }
.wa-item-main { flex: 1; min-width: 0; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--wa-line); }
.wa-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wa-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-time { font-size: 12px; color: var(--wa-sub); flex: 0 0 auto; }
.wa-time.unread { color: var(--wa-accent); }
.wa-preview { color: var(--wa-sub); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 3px; }
.wa-badge { background: var(--wa-accent); color: #111b21; font-weight: 700; font-size: 11.5px; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.wa-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.wa-dot.bad { background: #f15c6d; }
.wa-avatar { border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; flex: 0 0 auto; font-size: 15px; }
.wa-empty { color: var(--wa-sub); padding: 20px; text-align: center; }
.wa-msgsearch { border-top: 1px solid var(--wa-line); padding: 4px 14px; }
.wa-note { color: var(--wa-sub); font-size: 12px; padding: 0 14px 8px; margin: 0; }

.wa-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0;
  /* fundo com padrão discreto próprio */
  background-color: var(--wa-bg);
  background-image: radial-gradient(color-mix(in srgb, var(--wa-sub) 12%, transparent) 1px, transparent 1.4px), radial-gradient(color-mix(in srgb, var(--wa-sub) 7%, transparent) 1px, transparent 1.4px);
  background-size: 22px 22px, 22px 22px; background-position: 0 0, 11px 11px; }
.wa-chat-head { background: var(--wa-panel-2); display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 60px; }
.wa-chat-title { flex: 1; min-width: 0; }
.wa-chat-title strong { font-size: 16px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-back { display: none; }
.wa-pillbtn { border: 1px solid var(--wa-line); background: transparent; color: var(--wa-ink); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.wa-pillbtn.ok { color: var(--wa-accent); border-color: transparent; cursor: default; }
.wa-body { flex: 1; overflow-y: auto; padding: 16px 7% 8px; display: flex; flex-direction: column; gap: 2px; }
.wa-day { text-align: center; margin: 10px 0 6px; }
.wa-day span { background: var(--wa-panel-2); color: var(--wa-sub); font-size: 12.5px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.wa-msg { display: flex; margin: 1px 0; }
.wa-msg.out { justify-content: flex-end; }
.wa-bubble { position: relative; max-width: min(65%, 560px); padding: 6px 8px 8px 9px; border-radius: 8px; background: var(--wa-in); box-shadow: 0 1px .5px rgba(11,20,26,.13); white-space: pre-wrap; word-wrap: break-word; line-height: 1.35; }
.wa-msg.out .wa-bubble { background: var(--wa-out); }
.wa-msg.in + .wa-msg.out, .wa-msg.out + .wa-msg.in { margin-top: 8px; }
.wa-msg.in:not(.wa-msg.in + .wa-msg.in) .wa-bubble { border-top-left-radius: 0; }
.wa-msg.out:not(.wa-msg.out + .wa-msg.out) .wa-bubble { border-top-right-radius: 0; }
.wa-msg.in:not(.wa-msg.in + .wa-msg.in) .wa-bubble::before { content: ""; position: absolute; top: 0; left: -8px; border: 8px solid transparent; border-top-color: var(--wa-in); border-right-color: var(--wa-in); border-width: 0 8px 10px 0; }
.wa-msg.out:not(.wa-msg.out + .wa-msg.out) .wa-bubble::before { content: ""; position: absolute; top: 0; right: -8px; border-style: solid; border-color: var(--wa-out) transparent transparent var(--wa-out); border-width: 0 0 10px 8px; border-top-color: transparent; }
.wa-msg.out:not(.wa-msg.out + .wa-msg.out) .wa-bubble::before { border-width: 10px 8px 0 0; border-color: var(--wa-out) transparent transparent transparent; }
.wa-msg.in:not(.wa-msg.in + .wa-msg.in) .wa-bubble::before { border-width: 10px 0 0 8px; border-color: var(--wa-in) transparent transparent transparent; }
.wa-meta { float: right; margin: 6px -2px -4px 10px; font-size: 11px; color: var(--wa-sub); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.wa-msg.out .wa-meta { color: color-mix(in srgb, var(--wa-ink) 60%, transparent); }
.wa-tick { display: inline-flex; color: var(--wa-sub); }
.wa-tick.read { color: var(--wa-read); }
.wa-by { background: color-mix(in srgb, var(--wa-accent) 30%, transparent); color: var(--wa-ink); border-radius: 4px; padding: 0 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .3px; }
.wa-from { color: var(--wa-accent); font-size: 12.5px; font-weight: 600; }
.wa-bubble img { max-width: 330px; width: 100%; border-radius: 6px; display: block; }
.wa-bubble img.wa-sticker { max-width: 150px; }
.wa-bubble audio { width: 260px; max-width: 100%; display: block; }
.wa-bubble video { max-width: 330px; width: 100%; border-radius: 6px; }
.wa-caption { margin-top: 4px; }
.wa-doc { color: var(--wa-ink); text-decoration: none; display: block; background: color-mix(in srgb, var(--wa-bg) 40%, transparent); padding: 10px; border-radius: 6px; }
.wa-muted { color: var(--wa-sub); font-style: italic; }
.wa-compose { background: var(--wa-panel-2); display: flex; align-items: center; gap: 8px; padding: 8px 16px; min-height: 62px; }
.wa-compose input { background: var(--wa-panel); border: 0; border-radius: 10px; color: var(--wa-ink); padding: 11px 14px; font-size: 15px; outline: none; }
.wa-compose.readonly { color: var(--wa-sub); font-size: 13px; justify-content: center; text-align: center; }
.wa-send { background: none; border: 0; color: var(--wa-sub); cursor: pointer; padding: 6px; }
.wa-send:not(:disabled):hover { color: var(--wa-accent); }
.wa-placeholder { margin: auto; text-align: center; color: var(--wa-sub); max-width: 420px; padding: 20px; }
.wa-placeholder h2 { color: var(--wa-ink); font-weight: 300; font-size: 28px; margin: 12px 0 8px; }
.wa-ph-icon { width: 80px; height: 80px; margin: 0 auto; border-radius: 50%; background: var(--wa-panel-2); color: var(--wa-accent); display: grid; place-items: center; }
.wa-ph-icon svg { width: 40px; height: 40px; }

.wa-ai { display: none; background: var(--wa-panel); border-left: 1px solid var(--wa-line); overflow-y: auto; padding: 0 16px 16px; color: var(--wa-ink); }
.wa.ai-open .wa-ai { display: block; }
.wa-ai-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--wa-panel); padding: 14px 0 6px; }
.wa-ai-head h2 { margin: 0; }
.wa-ai .muted { color: var(--wa-sub); }
.wa-ai .bubble.out { background: var(--wa-out); color: var(--wa-ink); border-color: transparent; }

@media (max-width: 900px) {
  .wa, .wa.ai-open { grid-template-columns: 1fr; height: calc(100vh - 0px); }
  .wa .wa-chat { display: none; }
  .wa.has-chat .wa-side { display: none; }
  .wa.has-chat .wa-chat { display: flex; }
  .wa-back { display: inline-grid; }
  .wa.ai-open .wa-ai { position: absolute; inset: 0; z-index: 5; }
  .wa-body { padding: 12px 10px; }
  .wa-bubble { max-width: 85%; }
}
@media (max-width: 760px) { .wa, .wa.ai-open { height: 85vh; } }

.theme-switch { display: flex; gap: 4px; }
.theme-switch button { flex: 1; font-size: 12px; padding: 4px 6px; }
.theme-switch button.on { border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* vendedores */
.table-wrap { overflow-x: auto; }
table.sellers td, table.sellers th { white-space: nowrap; }
table.sellers td.bad-cell { color: var(--bad); font-weight: 600; }
.seller-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.seller-dot.on { background: var(--good); }
.wa-seller { background: var(--wa-panel-2); color: var(--wa-accent); border-radius: 6px; padding: 0 6px; font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.wa-att { border-radius: 6px; padding: 0 6px; font-size: 11.5px; font-weight: 600; flex-shrink: 0; white-space: nowrap; background: var(--wa-panel-2); color: var(--wa-sub); }
.wa-att.aguardando { background: color-mix(in srgb, #e5484d 18%, transparent); color: #e5484d; animation: waAttPulse 2s ease-in-out infinite; }
.wa-att.humano { color: #3e9bff; }
.wa-att.ia { color: var(--wa-accent); }
.wa-chat-head .wa-att { align-self: center; padding: 3px 8px; }
@keyframes waAttPulse { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .wa-att.aguardando { animation: none; } }
.wa-sellerbar { padding: 0 12px 8px; }
.wa-sellerbar select { width: 100%; background: var(--wa-panel-2); color: var(--wa-ink); border: 0; border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.num-card .qr { max-width: 240px; }
.wa-assign { width: auto; max-width: 180px; background: var(--wa-panel-2); color: var(--wa-ink); border: 0; border-radius: 16px; padding: 5px 10px; font-size: 13px; }
#addUser input, #addUser select { flex: 1 1 160px; width: auto; }

/* funil de vendas */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kb-col { flex: 0 0 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; max-height: 75vh; }
.kb-col header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px 12px 0 0; }
.kb-col header strong { flex: 1; }
.kb-col.over { outline: 2px dashed var(--brand); }
.kb-list { overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; }
.kb-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: grab; display: flex; flex-direction: column; gap: 3px; }
.kb-card.dragging { opacity: .5; }
.kb-add { border-style: dashed; align-items: center; justify-content: center; min-height: 80px; background: transparent; }
.late-txt { color: var(--bad); font-weight: 600; }
.funnel-bars { display: flex; flex-direction: column; gap: 6px; }
.fb-row { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 10px; }
.fb-bar { background: var(--line); border-radius: 6px; height: 12px; overflow: hidden; }
.fb-bar i { display: block; height: 100%; border-radius: 6px; }
.fb-n { text-align: right; }
.crm-box { border-bottom: 1px solid var(--wa-line, var(--line)); padding-bottom: 12px; margin-bottom: 12px; }
.crm-box label { font-size: 13px; }
.crm-sub { margin-top: 10px; font-size: 13px; }
.crm-form { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.crm-form input { flex: 1 1 140px; width: auto; }
.crm-item { display: flex; justify-content: space-between; gap: 6px; align-items: center; padding: 4px 0; }
.crm-item.late span { color: var(--bad); font-weight: 600; }
.crm-note { background: color-mix(in srgb, #f5a623 14%, transparent); border-radius: 8px; padding: 6px 8px; margin-top: 6px; font-size: 13px; }
.stage-pill { white-space: nowrap; }
.ai-title { margin-top: 4px; }
.wa-sellerbar { display: flex; gap: 6px; }
.wa-chat-title .wa-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat-head > .wa-pillbtn, .wa-chat-head > .wa-assign, .wa-actions > * { flex-shrink: 0; }
.main.main-funil { max-width: none; }
.main { min-width: 0; }
.main.main-funil { overflow-x: hidden; }
.wa.ai-open .stage-pill { display: none; }

/* primeiro acesso guiado */
.wiz { max-width: 640px; margin: 0 auto; }
.wiz-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.wiz-dots { display: flex; gap: 6px; }
.wiz-dots span { width: 26px; height: 6px; border-radius: 3px; background: var(--line); }
.wiz-dots span.on { background: var(--brand); }
.wiz-card { padding: 22px; }
.wiz-card h1 { margin-top: 0; font-size: 1.5rem; }
.wiz-card textarea { min-height: 0; }
.btn.big { padding: 12px 18px; font-size: 1rem; }
.wiz-choices { display: grid; gap: 10px; }
.wiz-list { padding-left: 18px; line-height: 1.9; }
.wiz-chat { display: flex; flex-direction: column; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 120px; max-height: 320px; overflow: auto; }
.wiz-loader { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 12px 0; }
.wiz-loader span { display: block; height: 100%; width: 35%; background: var(--brand); border-radius: 3px; animation: wizload 1.4s ease-in-out infinite; }
@keyframes wizload { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

/* ---------- linguagem simples: semáforo, números grandes, cartões com um botão ---------- */
.card.easy { padding: 18px; }
.hero { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--tone) 12%, transparent); border: 2px solid var(--tone); --tone: var(--good); }
.hero.warn { --tone: var(--warn); } .hero.bad { --tone: var(--bad); }
.hero-score { flex: 0 0 auto; width: 78px; height: 78px; border-radius: 50%; background: var(--tone); color: #fff; display: grid; place-items: center; font-size: 34px; line-height: 1; text-align: center; }
.hero-score b { font-size: 30px; letter-spacing: -1px; } .hero-score small { font-size: 13px; opacity: .85; display: block; margin-top: -2px; }
.hero-score:has(b) { display: flex; flex-direction: column; justify-content: center; }
.hero-word { font-size: 15px; font-weight: 700; color: var(--tone); text-transform: uppercase; letter-spacing: .3px; }
.hero-line { font-size: 21px; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 4px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; background: var(--panel); }
.tile-ico { font-size: 20px; }
.tile b { font-size: 30px; line-height: 1.1; }
.tile span:not(.tile-ico) { color: var(--muted); font-size: 14px; }
.tile.bad b { color: var(--bad); } .tile.good b { color: var(--good); }
.tile small.up { color: var(--good); font-weight: 600; } .tile small.down { color: var(--bad); font-weight: 600; }
h2.sec { font-size: 19px; margin: 20px 0 8px; }
.pcard { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--panel); }
.pcard-main { flex: 1; min-width: 0; }
.pcard-name { font-size: 17px; font-weight: 700; }
.pcard-num { font-weight: 400; color: var(--muted); font-size: 14px; white-space: nowrap; }
.pcard-what { font-size: 15px; margin-top: 2px; }
.pcard .money { color: var(--good); font-size: 18px; }
.btn.big-btn { flex: 0 0 auto; padding: 11px 18px; font-size: 15px; border-radius: 10px; text-decoration: none; display: inline-block; text-align: center; font-weight: 600; }
.allgood { font-size: 18px; font-weight: 600; color: var(--good); margin: 16px 0 4px; }
.easy-list { margin: 0; padding-left: 0; list-style: none; }
.easy-list li { font-size: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
details.more { margin-top: 14px; }
details.more > summary { cursor: pointer; color: var(--brand); font-weight: 600; padding: 6px 0; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--good); flex: 0 0 auto; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.day-row > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.day-row > summary::-webkit-details-marker { display: none; }
.day-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.lastday { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--brand-soft); color: var(--ink); text-decoration: none; }
.lastday > span:nth-child(2) { flex: 1; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.scard { border: 2px solid var(--tone); border-radius: 12px; padding: 12px; --tone: var(--good); display: flex; flex-direction: column; gap: 10px; }
.scard.warn { --tone: var(--warn); } .scard.bad { --tone: var(--bad); }
.scard-top { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.scard-say { margin-left: auto; color: var(--tone); font-weight: 700; font-size: 14px; }
.scard-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.scard-nums b { display: block; font-size: 20px; white-space: nowrap; } .scard-nums span { color: var(--muted); font-size: 12px; }
@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 12px; gap: 12px; } .hero-score { width: 62px; height: 62px; font-size: 28px; } .hero-score b { font-size: 26px; }
  .hero-line { font-size: 18px; }
  .pcard { flex-wrap: wrap; } .pcard .big-btn { width: 100%; }
}

/* ---------- painel de demonstração (/demo) ---------- */
.demo-bar { position: relative; z-index: 50; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: linear-gradient(90deg, #075e54, #128c7e); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.demo-tag { font-weight: 800; font-size: 12px; letter-spacing: .08em; background: rgba(255,255,255,.18); padding: 3px 8px; border-radius: 999px; }
.demo-txt { flex: 1 1 260px; font-size: 14px; }
.demo-bar .demo-cta { background: #25d366; color: #073b2f; border-color: #25d366; font-weight: 700; white-space: nowrap; text-decoration: none; }
.demo-bar .demo-as { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.5); white-space: nowrap; }
.demo-bar.pulse { animation: demoPulse .9s ease 2; }
@keyframes demoPulse { 50% { box-shadow: 0 0 0 6px rgba(37,211,102,.55); } }
@media (max-width: 640px) { .demo-bar { padding: 8px 12px; gap: 8px; } .demo-txt { display: none; } .demo-bar .demo-cta { flex: 1; text-align: center; padding: 8px 10px; font-size: 14px; } }


/* ---------- visual igual à demonstração do site (2026-11-16) ---------- */
h1, h2, .brand, .hero-word, .kpi6 b, .donut b, .bignote b { font-family: var(--display); letter-spacing: -.01em; }
h1 { font-size: 26px; }
.btn { border-radius: 999px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(.96); border-color: var(--accent); }
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: 0 1px 2px rgba(17,27,33,.04); }
input, select, textarea { border-radius: 10px; }
.side nav a { border-radius: 10px; padding: 9px 12px; color: var(--muted); }
.side nav a:hover { background: var(--bg); color: var(--ink); }
.side nav a.active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); font-weight: 600; }
.tenant-box .pill:first-child { }

/* linha de números com comparação */
.kpi6 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.kpi6 > div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.kpi6 b { font-size: 30px; font-weight: 800; line-height: 1.05; }
.kpi6 span { color: var(--muted); font-size: 14px; }
.kpi6 small { font-size: 12px; color: var(--muted); }
.kpi6 small .up { color: var(--good); font-weight: 700; }
.kpi6 small .down { color: var(--bad); font-weight: 700; }
.kpi6 > div.bad b { color: var(--bad); }
.duo { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.duo .card { margin-bottom: 0; }
@media (max-width: 900px) { .duo { grid-template-columns: 1fr; } }
.hbars { display: flex; align-items: flex-end; gap: 4px; height: 160px; margin-top: 8px; }
.hbars i { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 3px; display: block; }
.hbars i.dim { background: color-mix(in srgb, var(--accent) 45%, var(--panel)); }
.hbars.click i { cursor: pointer; }
.hbars i.sel { background: var(--brand); outline: 2px solid var(--brand); }
.haxis { display: flex; justify-content: space-between; font: 500 12px ui-monospace, "JetBrains Mono", monospace; color: var(--muted); margin-top: 6px; }
.donut { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; margin: 6px auto 12px; }
.donut > div { width: 92px; height: 92px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; text-align: center; }
.donut b { font-size: 24px; display: block; }
.donut span { font-size: 12px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.kv b { font-weight: 700; }
.alert-card { border-left: 4px solid var(--bad); }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.alert-row:first-of-type { border-top: 0; }
.alert-row > span:first-child { flex: 1; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.tag.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.tag.ok { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--good); }
.ai-sum { background: #fff4d6; border: 1px solid #f2c94c; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; color: #2b2410; }
.ai-sum h2 { font-size: 16px; margin: 0 0 8px; }
.ai-sum p { margin: 0; line-height: 1.6; font-size: 16px; }
:root[data-theme="dark"] .ai-sum { background: #2a2410; border-color: #6b5612; color: #f3e6bf; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ai-sum { background: #2a2410; border-color: #6b5612; color: #f3e6bf; } }
.meter { display: grid; grid-template-columns: 120px 1fr 52px; align-items: center; gap: 10px; margin: 9px 0; font-size: 14px; }
.meter i { height: 9px; border-radius: 99px; background: var(--line); display: block; overflow: hidden; }
.meter i u { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter i u.warn { background: #f0a020; }
.meter b { text-align: right; }
.perf td.bad-cell, .perf td.bad-cell b { color: var(--warn); font-weight: 700; }
.perf .gat { display: grid; grid-template-columns: 1fr 40px; align-items: center; gap: 8px; }

/* feedback da IA ao lado da conversa (como no site) */
.fb-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.fb-alert { background: color-mix(in srgb, var(--bad) 9%, var(--wa-panel, #fff)); border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; margin: 10px 0; }
.fb-alert b { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.chip.miss { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 6%, transparent); }
.chip.hit { color: var(--good); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sug-old { background: var(--wa-panel-2, #f0f2f5); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.sug-old s { opacity: .75; }
.sug-new { background: var(--wa-out, #d9fdd3); border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 14px; line-height: 1.5; }
.sug-lbl { font: 600 11px ui-monospace, "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase; opacity: .7; display: block; margin-bottom: 3px; }
.sug-why { font-size: 13px; margin: 4px 0; opacity: .85; }
.bignote { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.bignote b { font-size: 30px; font-weight: 800; }
.bignote i { flex: 1; height: 8px; border-radius: 99px; background: var(--wa-line, var(--line)); overflow: hidden; display: block; }
.bignote i u { display: block; height: 100%; background: var(--accent); }
.wa-ai .ai-title { margin-top: 4px; }
.wa-ai h3 { font-size: 14px; margin: 14px 0 4px; }
.wa-ai details.more { margin-top: 12px; }
.ia-switch { display: flex; align-items: center; gap: 12px; }
.ia-switch h2 { margin: 0; }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.daytable td { vertical-align: top; }

/* reação no balão (como no WhatsApp) */
.wa-msg.has-react { margin-bottom: 14px; }
.wa-bubble { position: relative; }
.wa-react { position: absolute; bottom: -14px; right: 8px; background: var(--wa-panel, var(--panel)); border: 1px solid var(--line); border-radius: 999px; padding: 0 5px; font-size: 13px; line-height: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.wa-msg.in .wa-react { right: auto; left: 8px; }

/* cabeçalho da conversa: no celular o nome e o número aparecem inteiros; os botões vão para o "⋯" */
.wa-chat-head { position: relative; }
.wa-actions { display: flex; align-items: center; gap: 8px; }
.wa-more { display: none; }
@media (max-width: 760px) {
  .wa-more { display: inline-flex; }
  .wa-actions { display: none; position: absolute; top: 100%; right: 8px; z-index: 30; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px; background: var(--wa-panel-2); border: 1px solid var(--wa-line); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
  .wa-actions.open { display: flex; }
  .wa-chat-title strong, .wa-chat-title .wa-sub { white-space: normal; overflow: visible; }
}

/* Feedback do gestor: veredito em uma linha, o que foi bem, para a próxima */
.fb-verdict { border-radius: 12px; padding: 10px 12px; margin: 6px 0 10px; font-size: 14px; line-height: 1.45; border: 1px solid transparent; }
.fb-verdict b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb-verdict span { display: block; }
.fb-verdict b span { display: inline; }
.fb-verdict .fb-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; color: #fff; }
.fb-verdict .fb-kind { font-weight: 500; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--wa-panel-2, #f0f2f5); color: var(--muted, #667781); }
.fb-verdict.ok { background: color-mix(in srgb, var(--good) 9%, transparent); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.fb-verdict.ok .fb-ic { background: var(--good); }
.fb-verdict.warn { background: color-mix(in srgb, var(--warn) 9%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.fb-verdict.warn .fb-ic { background: var(--warn); }
.fb-verdict.bad { background: color-mix(in srgb, var(--bad) 9%, transparent); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.fb-verdict.bad .fb-ic { background: var(--bad); }
.fb-verdict.none { background: var(--wa-panel-2, #f0f2f5); }
.fb-verdict.none .fb-ic { background: var(--muted, #8696a0); }
.fb-list { margin: 4px 0 10px; padding-left: 0; list-style: none; }
.fb-list li { position: relative; padding-left: 20px; margin: 4px 0; line-height: 1.45; font-size: 14px; }
.fb-list.good li::before { content: "✓"; position: absolute; left: 2px; color: var(--good); font-weight: 700; }
.fb-list.tip li::before { content: "→"; position: absolute; left: 2px; color: var(--warn); font-weight: 700; }
.fb-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 4px; }
.fb-rel .chip { cursor: pointer; background: transparent; color: inherit; border-color: var(--border, #d1d7db); }
.fb-rel .chip.on { background: var(--accent, #0a8f5b); border-color: var(--accent, #0a8f5b); color: #fff; }
table.sellers td.good-cell, .perf td.good-cell { color: var(--good); font-weight: 600; }
.tag.rel { background: var(--wa-panel-2, #f0f2f5); color: var(--muted, #667781); }

/* conversa que não é cliente (equipe, fornecedor, vaga, pessoal): etiqueta própria, diferente do nome do vendedor */
.wa-rel { border: 1px dashed var(--muted, #8696a0); color: var(--muted, #667781); background: transparent; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 500; flex-shrink: 0; }
.wa-item.not-client .wa-name { color: var(--muted, #667781); font-weight: 500; }
/* quem cuida da conversa, logo abaixo do nome */
.wa-att-line { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 1px 0; }
.wa-att-line .wa-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* telas médias com o Feedback aberto: os botões da conversa também vão para o "⋯" */
@media (min-width: 761px) and (max-width: 1440px) {
  .wa.ai-open .wa-more { display: inline-flex; }
  .wa.ai-open .wa-actions { display: none; position: absolute; top: 100%; right: 8px; z-index: 30; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px; background: var(--wa-panel-2); border: 1px solid var(--wa-line); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
  .wa.ai-open .wa-actions.open { display: flex; }
}
/* ---------- chat igual ao WhatsApp Web ---------- */
.wa-chat { position: relative; }
.wa-chat.dropping::after { content: "Solte para anexar"; position: absolute; inset: 60px 0 0; display: grid; place-items: center; background: color-mix(in srgb, var(--wa-bg) 80%, transparent); border: 3px dashed var(--wa-accent); color: var(--wa-ink); font-size: 18px; z-index: 30; pointer-events: none; }
.wa-bubble b { font-weight: 700; }
.wa-bubble code { font-family: ui-monospace, monospace; font-size: 13px; }
.wa-bubble a { color: var(--wa-read); }
.wa-bubble.bare { background: transparent !important; box-shadow: none; padding: 0; }
.wa-bubble.bare::before { display: none; }
.wa-media { display: block; position: relative; border: 0; padding: 0; margin: 0 0 2px; background: none; cursor: zoom-in; border-radius: 6px; overflow: hidden; max-width: 330px; width: 100%; }
.wa-media img, .wa-media video { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: 6px; background: color-mix(in srgb, var(--wa-bg) 50%, transparent); min-height: 60px; }
.wa-media.sticker { max-width: 150px; cursor: pointer; }
.wa-media.sticker img { object-fit: contain; background: none; min-height: 0; }
.wa-media.video { cursor: pointer; }
.wa-playbig { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.wa-audio { display: flex; align-items: center; gap: 8px; min-width: 240px; max-width: 320px; padding: 4px 2px 10px; }
.wa-audio audio { display: none; }
.wa-aplay { background: none; border: 0; color: var(--wa-sub); cursor: pointer; padding: 0; width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; }
.wa-audio.playing .wa-aplay { color: var(--wa-accent); }
.wa-atrack { flex: 1; position: relative; min-width: 0; }
.wa-arange { width: 100%; accent-color: var(--wa-accent); margin: 0; cursor: pointer; }
.wa-atime { position: absolute; left: 0; top: 18px; font-size: 11px; color: var(--wa-sub); }
.wa-aspeed { background: color-mix(in srgb, var(--wa-sub) 25%, transparent); border: 0; color: var(--wa-ink); border-radius: 12px; font-size: 12px; font-weight: 600; padding: 3px 7px; cursor: pointer; flex-shrink: 0; }
.wa-transc { color: var(--wa-sub); font-size: 12.5px; }
.wa-doc { display: flex; align-items: center; gap: 4px; background: color-mix(in srgb, var(--wa-bg) 40%, transparent); padding: 8px; border-radius: 6px; min-width: 240px; max-width: 330px; }
.wa-docopen { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--wa-ink) !important; text-decoration: none; }
.wa-docicon { flex-shrink: 0; min-width: 38px; height: 44px; padding: 0 4px; border-radius: 4px; background: #e2574c; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.wa-docname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.wa-docdl { color: var(--wa-sub) !important; padding: 6px; border-radius: 50%; display: grid; place-items: center; }
.wa-docdl:hover { background: color-mix(in srgb, var(--wa-sub) 20%, transparent); }
.wa-quote { display: block; background: color-mix(in srgb, var(--wa-bg) 45%, transparent); border-left: 4px solid #06cf9c; border-radius: 6px; padding: 5px 8px; margin: 0 0 4px; font-size: 13px; cursor: pointer; overflow: hidden; white-space: normal; }
.wa-quote.me { border-left-color: #53bdeb; }
.wa-quote strong { display: block; color: #06cf9c; font-size: 12.5px; }
.wa-quote.me strong { color: #53bdeb; }
.wa-quote span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--wa-sub); }
.wa-mact { position: absolute; top: 2px; right: 2px; z-index: 2; background: var(--wa-in); color: var(--wa-sub); border: 0; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; box-shadow: 0 0 6px 4px var(--wa-in); }
.wa-msg.out .wa-mact { background: var(--wa-out); box-shadow: 0 0 6px 4px var(--wa-out); }
.wa-bubble:hover .wa-mact { opacity: 1; }
@media (hover: none) { .wa-mact { opacity: .55; } }
.wa-msg.flash .wa-bubble { animation: waFlash 1.6s; }
@keyframes waFlash { 0%, 60% { filter: brightness(1.35); } 100% { filter: none; } }
.wa-pending { opacity: .75; }
/* caixa de mensagem */
.wa-composer { position: relative; background: var(--wa-panel-2); }
.wa-composer .wa-compose { align-items: flex-end; }
.wa-composer .wa-compose.hidden, .wa-recbar.hidden, .wa-replybar.hidden, .wa-attachbar.hidden, .wa-emoji.hidden { display: none; }
.wa-compose textarea { flex: 1; resize: none; background: var(--wa-panel); border: 0; border-radius: 10px; color: var(--wa-ink); padding: 10px 14px; font: inherit; font-size: 15px; line-height: 1.35; outline: none; max-height: 140px; min-height: 42px; }
.wa-compose .wa-iconbtn, .wa-compose .wa-send { color: var(--wa-sub); align-self: flex-end; margin-bottom: 4px; }
.wa-compose .wa-send[hidden] { display: none; }
.wa-replybar { display: flex; align-items: center; gap: 8px; padding: 8px 16px 0; }
.wa-replybar .wa-quote { flex: 1; margin: 0; cursor: default; }
.wa-attachbar { display: flex; gap: 8px; padding: 8px 16px 0; overflow-x: auto; }
.wa-att { position: relative; display: flex; align-items: center; gap: 8px; background: var(--wa-panel); border-radius: 8px; padding: 6px 30px 6px 6px; max-width: 240px; flex-shrink: 0; }
.wa-att img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.wa-attname { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-att button { position: absolute; top: 4px; right: 4px; background: none; border: 0; color: var(--wa-sub); cursor: pointer; padding: 0; }
.wa-att button svg { width: 18px; height: 18px; }
.wa-emoji { position: absolute; bottom: 100%; left: 8px; z-index: 20; width: min(360px, calc(100vw - 32px)); max-height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; background: var(--wa-panel); border: 1px solid var(--wa-line); border-radius: 10px; padding: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.wa-emoji button { background: none; border: 0; font-size: 24px; line-height: 36px; border-radius: 6px; cursor: pointer; }
.wa-emoji button:hover { background: var(--wa-hover); }
.wa-recbar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 62px; justify-content: flex-end; }
.wa-recbar .wa-iconbtn { color: var(--wa-sub); }
.wa-recdot { width: 10px; height: 10px; border-radius: 50%; background: #f15c6d; animation: waBlink 1s infinite; }
@keyframes waBlink { 50% { opacity: .2; } }
#recTime { font-variant-numeric: tabular-nums; min-width: 40px; }
.wa-recwave { flex: 0 1 220px; height: 4px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--wa-sub) 0 3px, transparent 3px 6px); opacity: .6; }
.wa-sendround { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--wa-accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
/* visualizador de fotos e vídeos */
.wa-viewer { position: fixed; inset: 0; z-index: 1000; background: rgba(11, 20, 26, .96); display: grid; grid-template-columns: 64px 1fr 64px; grid-template-rows: 56px 1fr; color: #e9edef; }
.wa-viewer header { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 20px; }
.wa-vinfo { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-vbtn { background: none; border: 0; color: #e9edef !important; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.wa-vbtn:hover, .wa-vnav:hover { background: rgba(255,255,255,.1); }
.wa-vstage { display: grid; place-items: center; overflow: hidden; padding: 0 0 24px; min-width: 0; min-height: 0; }
.wa-vstage img, .wa-vstage video { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; cursor: zoom-in; transition: transform .15s; user-select: none; }
.wa-vstage img.zoomed { cursor: zoom-out; }
.wa-vnav { align-self: center; justify-self: center; background: none; border: 0; color: #e9edef; font-size: 40px; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; line-height: 1; }
@media (max-width: 760px) { .wa-viewer { grid-template-columns: 36px 1fr 36px; } .wa-vnav { font-size: 30px; width: 34px; } }
/* nova conversa */
.wa-newchat { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 16px; }
.wa-newcard { background: var(--wa-panel); color: var(--wa-ink); border-radius: 12px; width: min(400px, 100%); padding: 16px 18px 18px; display: grid; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.wa-newcard header { display: flex; align-items: center; justify-content: space-between; font-size: 17px; }
.wa-newcard label { display: grid; gap: 6px; font-size: 13px; color: var(--wa-sub); }
.wa-newcard input, .wa-newcard textarea { background: var(--wa-panel-2); border: 1px solid var(--wa-line); border-radius: 8px; color: var(--wa-ink); padding: 10px 12px; font: inherit; font-size: 15px; outline: none; resize: vertical; }
.wa-newcard input:focus, .wa-newcard textarea:focus { border-color: var(--wa-accent); }
.wa-newcard .small { margin: 0; font-size: 12px; }
.wa-start .wa-avatar { color: #fff; display: grid; place-items: center; }
/* só mídia, sem legenda: hora por cima/ao lado, como no WhatsApp */
.wa-bubble.mo { padding: 3px 3px 3px 3px; }
.wa-bubble.mo .wa-meta { position: absolute; right: 8px; bottom: 6px; float: none; margin: 0; }
.wa-bubble.mo-image .wa-meta, .wa-bubble.mo-video .wa-meta, .wa-bubble.mo-sticker .wa-meta { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.wa-bubble.mo-image .wa-media, .wa-bubble.mo-video .wa-media { margin: 0; }
.wa-bubble.mo-audio { padding: 6px 8px 4px 6px; }
.wa-bubble.mo-document { padding: 4px 4px 20px; }
.wa-bubble.mo-document .wa-meta { bottom: 3px; }
.wa-audio { padding: 2px 0 14px; }
.wa-atrack { display: grid; }
.wa-atime { position: static; margin-top: 2px; height: 0; overflow: visible; }
.wa-arange { height: 18px; }
/* botão responder ao lado do balão (não cobre o conteúdo) */
.wa-mact { top: 50%; transform: translateY(-50%); right: -36px; box-shadow: 0 1px 3px rgba(0,0,0,.25) !important; background: var(--wa-panel) !important; }
.wa-msg.out .wa-mact { right: auto; left: -36px; }
.wa-msg:hover .wa-mact { opacity: 1; }
