body[data-screen="campaigns"] #campaigns-area { display: block; }
/* Cavazonne · campanhas em lotes (simulação). Usa as variáveis de styles.css, com cores de reserva. */
.cmp-root { display: grid; gap: 12px; max-width: 880px; color: var(--ink, #1d2433); font-family: var(--font, system-ui, sans-serif); }
.cmp-root h2 { font-size: 1.1rem; margin: 0; }
.cmp-root h4 { margin: 10px 0 6px; font-size: .9rem; color: var(--muted, #5b6475); }
.cmp-banner {
  margin: 0; padding: 10px 12px; border: 1px solid var(--warn-line, #e3b54a); border-radius: var(--radius-s, 6px);
  background: var(--warn-bg, #fff4d6); color: #4a3500; font-size: .9rem;
}
.cmp-status { margin: 0; font-weight: 600; }
.cmp-form { display: grid; gap: 12px; }
.cmp-form fieldset {
  min-width: 0; margin: 0; padding: 12px 14px; border: 1px solid var(--line, #d6d9d2);
  border-radius: var(--radius-m, 10px); background: var(--sheet, #fbfbf9);
}
.cmp-form legend { font-weight: 700; padding: 0 4px; }
.cmp-form .field { display: grid; gap: 4px; margin: 6px 0; }
.cmp-form textarea, .cmp-form input[type="number"], .cmp-form input[type="search"], .cmp-form select {
  width: 100%; max-width: 100%; padding: 6px 8px; border: 1px solid var(--line, #d6d9d2); border-radius: var(--radius-s, 6px); background: #fff;
}
.cmp-form input[aria-invalid="true"] { border-color: #b3261e; }
.cmp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.cmp-checks { display: grid; gap: 4px; }
.cmp-contacts { max-height: 240px; overflow-y: auto; padding-right: 4px; }
.cmp-check { display: flex; align-items: flex-start; gap: 6px; overflow-wrap: anywhere; }
.cmp-check input { margin-top: .25em; flex: none; }
.cmp-sim-consent { margin: 4px 0 10px; padding: 6px 8px; border: 1px dashed var(--warn-line, #e3b54a); border-radius: var(--radius-s, 6px); }
.cmp-muted { margin: 4px 0; color: var(--muted, #5b6475); font-size: .88rem; }
.cmp-preview { margin: 0; padding-left: 18px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.cmp-pace { margin: 6px 0 0; font-weight: 600; }
.cmp-review p, .cmp-review ul { margin: 4px 0; }
.cmp-run { padding: 12px 14px; border: 1px solid var(--indigo, #0e7c63); border-radius: var(--radius-m, 10px); background: var(--indigo-soft, #e3f3ed); }
.cmp-run h3 { margin: 0 0 8px; color: var(--ink, #1d2433); }
.cmp-run progress { width: 100%; height: 14px; }
.cmp-counters { margin: 8px 0 4px; }
.cmp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cmp-media-list { display: grid; gap: 10px; }
.cmp-media-item { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line, #d6d9d2); border-radius: 8px; overflow-wrap: anywhere; min-width: 0; }
.cmp-media-preview { max-width: 100%; width: 280px; max-height: 200px; object-fit: contain; }
.cmp-media-item button { justify-self: start; }

/* Prévia no formato de conversa do WhatsApp (pedido do Lucas, 11/11). */
.wa-who-row { display: flex; align-items: center; gap: .5rem; margin: .25rem 0 .5rem; font-size: .9rem; }
.wa-who { max-width: 16rem; }
.wa-phone { width: min(360px, 100%); border-radius: 26px; overflow: hidden; border: 8px solid #1f2c33; background: #efeae2;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); display: flex; flex-direction: column; list-style: none; padding: 0; margin: 0;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif; }
.wa-top { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; background: #0e7c63; color: #fff; }
.wa-back { font-size: 1.6rem; line-height: 1; }
.wa-avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: #dfe5e7; color: #54656f; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.wa-name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.wa-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .98rem; }
.wa-name small { opacity: .85; font-size: .75rem; }
.wa-body { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; padding: .7rem .6rem 1rem; min-height: 260px; max-height: 560px; overflow-y: auto;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; }
.wa-day { align-self: center; margin: 0 0 .4rem; padding: .2rem .6rem; border-radius: 8px; background: #fff; color: #54656f; font-size: .72rem; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.wa-bubble { position: relative; max-width: 82%; background: #e3f3ed; color: #111b21; border-radius: 8px; padding: .35rem .5rem .25rem;
  box-shadow: 0 1px .5px rgba(0,0,0,.13); font-size: .92rem; line-height: 1.35; word-wrap: break-word; }
.wa-bubble.has-tail { border-top-right-radius: 0; }
.wa-bubble.has-tail::after { content: ""; position: absolute; top: 0; right: -7px; border-width: 0 0 9px 8px; border-style: solid; border-color: transparent transparent transparent #e3f3ed; }
.wa-bubble.is-image, .wa-bubble.is-video { padding: 3px; }
.wa-photo { display: block; width: 100%; max-width: 250px; max-height: 330px; object-fit: cover; border-radius: 6px; }
.wa-bubble.is-image .wa-meta, .wa-bubble.is-video .wa-meta { position: absolute; right: .45rem; bottom: .3rem; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.6); }
.wa-bubble.is-image .wa-ticks, .wa-bubble.is-video .wa-ticks { color: #fff; }
.wa-audio { width: 230px; max-width: 100%; height: 36px; }
.wa-text { white-space: pre-wrap; padding-right: 3.6rem; }
.wa-text code { font-family: Consolas, monospace; font-size: .85rem; }
.wa-link { color: #027eb5; text-decoration: underline; word-break: break-all; }
.wa-meta { float: right; display: inline-flex; gap: .2rem; align-items: center; margin: .35rem 0 -.1rem .5rem; font-size: .68rem; color: #667781; }
.wa-bubble.is-text .wa-meta { position: absolute; right: .5rem; bottom: .25rem; float: none; margin: 0; }
.wa-ticks { color: #53bdeb; letter-spacing: -.2em; font-size: .8rem; }
.wa-empty { align-self: center; margin: 3rem 1rem; padding: .5rem .8rem; background: #fff; border-radius: 8px; color: #54656f; font-size: .85rem; text-align: center; }
.wa-bottom { display: flex; gap: .4rem; align-items: center; padding: .45rem .5rem; background: #f0f2f5; }
.wa-input { flex: 1; background: #fff; border-radius: 20px; padding: .45rem .8rem; color: #8696a0; font-size: .88rem; }
.wa-mic { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: #0e7c63; display: grid; place-items: center; font-size: .9rem; }

/* Revisão em cartões. */
.cmp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.cmp-card { border: 1px solid var(--line); border-radius: var(--radius-m, 10px); background: #fff; padding: .75rem .9rem; }
.cmp-card.is-wide { margin-bottom: .5rem; }
.cmp-card h5 { margin: 0 0 .5rem; font-size: .95rem; color: var(--indigo, #0e7c63); }
.cmp-card p { margin: .25rem 0; }
.cmp-big { font-size: 1.35rem; font-weight: 800; }
.cmp-kv { display: flex; justify-content: space-between; gap: .75rem; font-size: .9rem; }
.cmp-kv span { color: var(--muted); }
.cmp-kv strong { text-align: right; }
.cmp-reasons { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .85rem; }
.cmp-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.cmp-checklist li.is-ok span { color: #1f8a5b; font-weight: 800; }
.cmp-checklist li.is-bad span { color: #b3261e; font-weight: 800; }

/* Mensagem + prévia lado a lado; a prévia acompanha a rolagem. */
#campaigns-area > * { max-width: 1180px; }
.cmp-root { max-width: 1180px; }
.cmp-msg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.cmp-msg-right { position: sticky; top: .5rem; }
.cmp-msg-right h4 { margin-top: 0; }
.cmp-media-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.cmp-media-preview { width: 100%; max-height: 120px; object-fit: cover; border-radius: 6px; }
@media (max-width: 900px) { .cmp-msg-grid { grid-template-columns: minmax(0, 1fr); } .cmp-msg-right { position: static; } }
.cmp-root .message-box textarea { width: 100%; padding-right: 5.6rem; }
.cmp-rec-status:empty { display: none; }
/* Garantia quando campaigns.css é usado sem styles.css (testes isolados). */
.cmp-root .message-box { position: relative; min-width: 0; }
.cmp-root .message-tools { position: absolute; right: .4rem; bottom: .4rem; display: flex; gap: .3rem; align-items: center; }
.cmp-root .message-tools .audio-recorder { display: contents; }
.cmp-root .icon-tool { width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; }
.cmp-root .icon-tool svg { width: 1.15rem; height: 1.15rem; }
.cmp-root textarea { max-width: 100%; box-sizing: border-box; }
.wa-who-row > span { white-space: nowrap; }
.cmp-tpl { display: grid; gap: .6rem; margin-bottom: .9rem; padding: .75rem; border: 1px solid var(--line, #d6d9d2); border-radius: 8px; background: #fff; }
.cmp-mode { display: grid; gap: .35rem; }
.cmp-tpl .cmp-row { display: grid; grid-template-columns: 2fr 1fr; gap: .6rem; }
.cmp-tpl .cmp-row > :last-child { grid-column: 1 / -1; }
.cmp-tpl input:not([type=radio]):not([type=checkbox]), .cmp-tpl textarea, .cmp-tpl select { width: 100%; box-sizing: border-box; }
.cmp-mode input[type=radio] { width: auto; height: auto; flex: none; margin-top: .3em; }
.cmp-mode .cmp-check > span { flex: 1; min-width: 0; overflow-wrap: normal; }
.cmp-tpl-pick { display: flex; gap: .5rem; align-items: center; }
.cmp-tpl-pick select { flex: 1; min-width: 0; }
.cmp-tpl-pick button { flex: none; white-space: nowrap; }
.wa-header { font-weight: 700; margin-bottom: .2rem; }
.wa-footer { color: #667781; font-size: .78rem; margin-top: .35rem; padding-right: 3.6rem; white-space: pre-wrap; }
.cmp-sent-badge { display: inline-block; margin-left: .35rem; padding: 0 .5rem; border-radius: 999px; background: #fff4c2; color: #6b5300; font-size: .78rem; font-weight: 600; }
.cmp-sent-badge[hidden], .cmp-sent-badge:empty { display: none; }
.cmp-history { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line, #d6d9d2); border-radius: 10px; background: #fff; }
.cmp-history h3 { margin: 0 0 .25rem; }
.cmp-hist-wrap { overflow-x: auto; }
.cmp-hist { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cmp-hist th, .cmp-hist td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid var(--line, #d6d9d2); white-space: nowrap; }
.cmp-hist th { color: var(--muted, #5b6475); font-weight: 600; }

/* Caixa da mensagem com os anexos dentro, abaixo do texto. */
.cmp-root .cmp-compose { border: 1px solid var(--line, #d6d9d2); border-radius: 10px; background: #fff; padding-bottom: 2.9rem; }
.cmp-root .cmp-compose:focus-within { border-color: var(--indigo, #0e7c63); box-shadow: 0 0 0 2px rgba(47,63,143,.15); }
.cmp-root .cmp-compose textarea { border: 0 !important; box-shadow: none !important; outline: none; background: transparent; resize: vertical; }
.cmp-root .cmp-compose .cmp-media-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 .6rem; }
.cmp-root .cmp-compose .cmp-media-list:empty { display: none; }
.cmp-root .cmp-compose .cmp-media-item { position: relative; width: 96px; padding: 0; border: 1px solid var(--line, #d6d9d2); border-radius: 8px; overflow: hidden; background: #f4f5f7; }
.cmp-root .cmp-compose .cmp-media-item:has(audio) { width: 240px; padding: .4rem; }
.cmp-root .cmp-compose .cmp-media-preview { display: block; width: 100%; height: 96px; max-height: none; object-fit: cover; border-radius: 0; }
.cmp-root .cmp-compose audio.cmp-media-preview { height: 34px; }
.cmp-root .cmp-media-name { display: block; font-size: .72rem; color: var(--muted, #5b6475); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-root .cmp-media-x { position: absolute; top: 4px; right: 4px; width: 1.5rem; height: 1.5rem; padding: 0 !important; border-radius: 50% !important; border: 0 !important;
  background: rgba(15,23,42,.65) !important; color: #fff !important; font-size: 1rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.cmp-root .cmp-media-x:hover { background: #b3261e !important; }
.cmp-root .cmp-compose textarea.cmp-after { display: block; width: 100%; margin-top: .4rem; border-top: 1px dashed var(--line, #d6d9d2) !important; padding: .5rem .6rem; min-height: 2.6rem; }
.cmp-root .cmp-compose textarea.cmp-after[hidden] { display: none; }
.cmp-hist-detail > td { background: #f7f8fb; padding: .75rem !important; }
.cmp-detail-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.cmp-detail-filters { display: flex; gap: .35rem; flex-wrap: wrap; }
.cmp-detail-filters button[aria-pressed="true"] { background: var(--indigo, #0e7c63) !important; color: #fff !important; }
