:root {
  --green-dark: #075e54;
  --green: #128c7e;
  --green-light: #25d366;
  --teal-panel: #008069;
  --chat-bg: #e5ddd5;
  --out-bubble: #dcf8c6;
  --in-bubble: #ffffff;
  --panel: #f0f2f5;
  --border: #e9edef;
  --text: #111b21;
  --muted: #667781;
  --tick-lida: #53bdeb; /* azul do WhatsApp; os temas não mudam */
  --danger: #ea4335;
  --shadow: 0 1px 3px rgba(11,20,26,.08);
  --radius: 8px;
  /* 56 + 7 cima + 7 baixo: cabeçalho um pouco mais alto que a linha da lista. */
  --header-h: 70px;
  --header-pad-y: 7px;
  --composer-h: 62px;
  /* constant() = iOS antigo; env() = atual. No desktop ambos resolvem 0. */
  --safe-top-raw: constant(safe-area-inset-top, 0px);
  --safe-top-raw: env(safe-area-inset-top, 0px);
  --safe-top: var(--safe-top-raw);
  --safe-bottom-raw: constant(safe-area-inset-bottom, 0px);
  --safe-bottom-raw: env(safe-area-inset-bottom, 0px);
  --safe-bottom: var(--safe-bottom-raw);
  --safe-left: constant(safe-area-inset-left, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: constant(safe-area-inset-right, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--panel);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ========== LOGIN ========== */
#screen-login {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  background: linear-gradient(160deg, #0b141a 0%, #075e54 60%, #128c7e 100%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--green-dark);
  display: grid; place-items: center;
  color: #fff; font-size: 28px; font-weight: 700;
}
.login-card h1 {
  margin: 0 0 4px; text-align: center; font-size: 1.35rem;
}
.login-card .sub {
  text-align: center; color: var(--muted); font-size: .9rem; margin: 0 0 20px;
}
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px;
}
.field input {
  width: 100%; padding: 14px 14px; border: 1px solid #d1d7db;
  border-radius: 10px; outline: none; font-size: 1rem;
}
.field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,140,126,.15); }
.btn-primary {
  width: 100%; padding: 14px; border-radius: 10px;
  background: var(--green-dark); color: #fff; font-weight: 600; font-size: 1rem;
  min-height: 48px;
}
.btn-primary:active { opacity: .9; }
.login-hint {
  margin-top: 14px; font-size: .78rem; color: var(--muted); text-align: center;
}
.banner-fake {
  margin-top: 16px; padding: 10px 12px; border-radius: 8px;
  background: #fff8e1; color: #7a5c00; font-size: .78rem; line-height: 1.35;
}

/* ========== APP SHELL ========== */
#screen-app { display: none; height: 100dvh; }
#screen-app.active { display: flex; }

.app {
  display: flex;
  width: 100%;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  overflow: hidden;
}

/* Sidebar / list */
.sidebar {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
  border-right: 1px solid var(--border);
  position: relative;
}
/* Chip do master: segunda linha do header (precisa de flex-wrap no .side-header). */
.conta-chip-slot {
  flex: 1 1 100%; order: 3; padding: 0 0 2px; min-width: 0;
  box-sizing: border-box;
}
.conta-chip {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; max-width: 100%; box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--t-header-fg, #fff) 28%, transparent);
  background: color-mix(in srgb, var(--t-header-fg, #fff) 12%, transparent);
  color: var(--t-header-fg, #fff); border-radius: 999px; padding: 5px 12px;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.conta-chip-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.conta-chip-chev { opacity: .7; font-size: 10px; flex: 0 0 auto; }
.conta-sheet {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.35);
  display: grid; align-items: end; justify-items: stretch;
}
.conta-sheet-card {
  background: var(--bg, #fff); color: var(--fg, #1a1a1a); border-radius: 16px 16px 0 0;
  max-height: min(70vh, 520px); display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.conta-sheet-card header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border, #e5e5e5);
}
.conta-sheet-x { border: 0; background: transparent; font-size: 22px; cursor: pointer; line-height: 1; }
.conta-sheet-lista { overflow: auto; padding: 8px; }
.conta-sheet-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 12px; border-radius: 10px; cursor: pointer; font: inherit;
}
.conta-sheet-item:hover { background: var(--hover, #f3f3f3); }
.conta-sheet-item.on { background: color-mix(in srgb, var(--accent, #128c7e) 14%, transparent); }
.conta-sheet-item b { font-size: 15px; }
.conta-sheet-item small { color: var(--muted, #667); font-size: 12px; }
@media (min-width: 768px) {
  .conta-sheet { align-items: center; justify-items: center; }
  .conta-sheet-card { border-radius: 16px; width: min(420px, 92vw); max-height: 70vh; }
}

.side-header {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start;
  gap: 6px 12px;
  position: relative;
  min-height: calc(var(--header-h) + var(--safe-top));
  height: auto;
  padding: calc(var(--safe-top) + var(--header-pad-y)) 12px var(--header-pad-y) calc(12px + var(--safe-left));
  background: var(--panel);
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
  flex: 0 0 auto; overflow: hidden;
}
.avatar.sm { width: 48px; height: 48px; font-size: 1.05rem; }
.avatar.xs { width: 36px; height: 36px; font-size: .85rem; }
.side-title { flex: 1; font-weight: 600; font-size: 1.1rem; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted);
}
.icon-btn:active { background: rgba(0,0,0,.06); }
.search-wrap {
  flex: 0 0 auto;
  padding: 8px 12px;
  background: #fff;
}
/* Lista de conversas: esconde/mostra a busca ao rolar (altura + transform). */
.sidebar > .search-wrap {
  overflow: hidden;
  max-height: 108px;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height .22s ease,
    padding .22s ease,
    opacity .18s ease,
    transform .22s ease;
}
/* menu de filtros abre para baixo: não cortar pelo overflow do collapse da busca */
.sidebar > .search-wrap:has(#menu-lista-filtro:not([hidden])) {
  overflow: visible;
  z-index: 25;
}
.search-row {
  display: flex; align-items: center; gap: 6px;
  position: relative;
}
.search-row .search-box { flex: 1 1 auto; min-width: 0; }
.lista-filtro-btn {
  position: relative; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--muted); background: var(--panel);
  border: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lista-filtro-btn:hover, .lista-filtro-btn[aria-expanded="true"] { color: var(--text); }
.lista-filtro-btn.ativo { color: var(--t-primary, var(--green-dark)); }
.lista-filtro-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--t-primary, var(--green-dark));
  box-shadow: 0 0 0 2px var(--t-list-bg, #fff);
}
/* (posição do menu: ver .menu-pop.lista-filtro-menu mais abaixo, depois de .menu-pop) */
.sidebar > .search-wrap.escondida {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border-radius: 8px; padding: 6px 12px;
}
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  /* 16px: no iPhone, input < 16px provoca zoom ao focar */
  font-size: 1rem; line-height: 1.25; min-height: 28px;
  /* X nativo do type=search some; usamos .search-clear */
  -webkit-appearance: none; appearance: none;
}
.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-decoration {
  -webkit-appearance: none; appearance: none;
}
.search-clear {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 28px; height: 28px; margin: -2px -4px -2px 0;
  border: 0; border-radius: 50%; padding: 0;
  background: transparent; color: var(--muted);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.search-clear[hidden] { display: none !important; }
.search-clear:active { background: rgba(0,0,0,.08); color: var(--text); }
.chat-list {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.chat-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; min-height: 72px;
  border-bottom: 1px solid var(--border);
  width: 100%; text-align: left;
}
.chat-item:active, .chat-item.active { background: #f5f6f6; }
.chat-meta { flex: 1; min-width: 0; }
.chat-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.chat-name {
  font-weight: 600; font-size: 1.02rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-time { font-size: .75rem; color: var(--muted); flex: 0 0 auto; }
.chat-time.unread { color: var(--green-light); font-weight: 600; }
.chat-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px;
}
.chat-preview {
  font-size: .88rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--green-light); color: #fff;
  font-size: .72rem; font-weight: 700;
  display: grid; place-items: center; flex: 0 0 auto;
}
.side-footer {
  flex: 0 0 auto;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  font-size: .72rem; color: var(--muted); text-align: center;
  border-top: 1px solid var(--border); background: #fff;
}

/* Chat pane */
.chat-pane {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--chat-bg);
  position: absolute; inset: 0; z-index: 5;
}
.chat-pane.open { display: flex; }
.chat-header {
  flex: 0 0 auto;
  display: flex; align-items: stretch;
  height: calc(var(--header-h) + var(--safe-top));
  padding: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.chat-header-normal,
.chat-busca {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-top) + var(--header-pad-y)) 8px var(--header-pad-y) calc(4px + var(--safe-left));
}
.chat-busca { gap: 4px; }
.chat-busca-box {
  flex: 1 1 auto; min-width: 0;
  height: 36px; padding: 0 10px; gap: 6px;
}
.chat-busca-box input { font-size: 16px; }
.chat-busca-contador {
  flex: 0 0 auto;
  font-size: .78rem; font-weight: 600;
  color: var(--t-header-sub, var(--muted));
  white-space: nowrap; min-width: 3.6rem; text-align: center;
  font-variant-numeric: tabular-nums;
}
.chat-busca .icon-btn:disabled { opacity: .35; }
.back-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); flex: 0 0 auto;
}
.back-btn:active { background: rgba(0,0,0,.06); }
.chat-cabeca {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  text-align: left; border-radius: 10px; padding: 2px 6px 2px 2px; margin-right: 4px;
  color: inherit; background: transparent;
}
.chat-cabeca:active { background: rgba(0,0,0,.05); }
.chat-header .info { flex: 1; min-width: 0; overflow: hidden; }
.chat-header .info .name {
  font-weight: 600; font-size: 1.02rem;
  min-width: 0; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-header .info .status {
  font-size: .75rem; color: var(--muted);
  min-width: 0; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.messages {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: none;
  padding: 12px 12px 8px;
  background-image:
    linear-gradient(rgba(229,221,213,.92), rgba(229,221,213,.92)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='%23d4ccc4'/%3E%3Cpath d='M30 8l2 6h6l-5 4 2 6-5-4-5 4 2-6-5-4h6z' fill='%23cbbfb4' opacity='.35'/%3E%3C/svg%3E");
}
.day-sep {
  display: flex; justify-content: center; margin: 10px 0;
}
.day-sep span {
  background: #e1f2fb; color: #54656f;
  font-size: .75rem; padding: 6px 12px; border-radius: 8px;
  box-shadow: var(--shadow);
}
.row {
  display: flex; margin-bottom: 4px;
}
.row.out { justify-content: flex-end; }
.row.in { justify-content: flex-start; }
.bubble {
  max-width: min(78%, 420px);
  padding: 6px 8px 4px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: relative;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.row.in .bubble { background: var(--in-bubble); border-top-left-radius: 0; }
.row.out .bubble { background: var(--out-bubble); border-top-right-radius: 0; }
.bubble .text { font-size: .95rem; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.bubble .text strong { font-weight: 700; }
.bubble .text em { font-style: italic; }
.bubble .text s { text-decoration: line-through; }
.bubble .text .wa-code,
.bubble .text .wa-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: .9em;
  background: var(--t-mono-bg, rgba(0, 0, 0, .06));
  border-radius: 4px;
  padding: .1em .35em;
}
.bubble .text .wa-mono { display: inline-block; white-space: pre-wrap; max-width: 100%; margin: .15em 0; }
.bubble .text .wa-quote {
  border-left: 3px solid var(--t-fmt-quote-bar, var(--t-quote-bar, #1F5DA2));
  padding: .1em 0 .1em .55em;
  margin: .2em 0;
}
.row.out .bubble .text .wa-quote {
  border-left-color: var(--t-quote-out-bar, var(--t-fmt-quote-bar, #1F5DA2));
}
.bubble .text .wa-ul,
.bubble .text .wa-ol {
  margin: .15em 0;
  padding-left: 1.25em;
}
.bubble .text .wa-ul { list-style: disc; }
.bubble .text .wa-ol { list-style: decimal; }
.bubble .text .wa-ul li,
.bubble .text .wa-ol li { margin: .05em 0; }
.bubble .meta {
  display: flex; justify-content: flex-end; align-items: center; gap: 4px;
  margin-top: 2px; font-size: .68rem; color: var(--muted);
}
.envio-barra {
  flex: 1 1 72px; height: 4px; border-radius: 2px; overflow: hidden;
  background: var(--border);
}
.envio-barra > span { display: block; height: 100%; background: var(--green); }
.envio-pct { font-variant-numeric: tabular-nums; }
.envio-link { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.ticks { letter-spacing: -1px; }
.ticks.pending { color: var(--muted); }
.ticks.sent { color: var(--muted); }
.ticks.read { color: var(--tick-lida); }
.media-img {
  width: 100%; max-width: 260px; border-radius: 6px; margin-bottom: 4px;
  background: #ccc; aspect-ratio: 4/3; object-fit: cover;
}
.doc-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.04); border-radius: 6px; padding: 10px;
  min-width: 200px; margin-bottom: 4px;
}
.doc-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: #e53935; color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .7rem;
  flex: 0 0 auto;
}
.doc-name { font-size: .9rem; font-weight: 600; }
.doc-size { font-size: .75rem; color: var(--muted); }
.audio-card {
  display: flex; align-items: center; gap: 10px;
  min-width: 220px; padding: 4px 2px 2px;
}
.audio-play {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center; flex: 0 0 auto;
}
.audio-wave {
  flex: 1; height: 28px;
  background: repeating-linear-gradient(
    90deg,
    #aebac1 0 2px,
    transparent 2px 5px
  );
  border-radius: 4px; opacity: .7;
}
.audio-dur { font-size: .75rem; color: var(--muted); }

.composer {
  flex: 0 0 auto;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 8px 8px calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left));
  background: var(--panel);
  border-top: 1px solid var(--border);
}
.composer .attach, .composer .send {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 auto;
  color: var(--muted);
}
.composer .send {
  background: var(--green-dark); color: #fff;
}
.composer .send:disabled { opacity: .45; }
.composer .input-wrap {
  flex: 1; background: #fff; border-radius: 24px;
  padding: 10px 14px; min-height: 44px;
  display: flex; align-items: center;
  border: 1px solid transparent;
}
.composer textarea {
  width: 100%; border: none; outline: none; resize: none;
  max-height: 120px; line-height: 1.35; font-size: 1rem;
  background: transparent;
}
.attach-menu {
  position: absolute; bottom: calc(70px + var(--safe-bottom)); left: 12px;
  background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 8px; display: none; z-index: 10; min-width: 180px;
}
.attach-menu.show { display: block; }
.attach-menu button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px; border-radius: 8px;
  font-size: .95rem; text-align: left; min-height: 48px;
}
.attach-menu button:active { background: var(--panel); }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff3cd; color: #7a5c00;
  font-size: .7rem; padding: 2px 8px; border-radius: 999px;
  margin-left: 6px;
}

/* Empty state on desktop when no chat selected */
.empty-pane {
  display: none;
  flex: 1;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  background: #f8f9fa; color: var(--muted);
  border-bottom: 6px solid var(--green-light);
}
.empty-pane .big { font-size: 1.25rem; color: var(--text); font-weight: 500; }
.empty-pane .hint { font-size: .9rem; max-width: 360px; text-align: center; }

/* Desktop two-pane */
@media (min-width: 768px) {
  .app { height: 100%; }
  .sidebar {
    width: 38%; max-width: 420px; min-width: 320px;
    flex: 0 0 auto;
  }
  .chat-pane {
    position: relative; inset: auto;
    display: none; flex: 1;
  }
  .chat-pane.open { display: flex; }
  .empty-pane { display: flex; }
  .empty-pane.hidden { display: none; }
  .back-btn { display: none; }
  .chat-header-normal,
  .chat-busca { padding-left: 16px; }
  .chat-item.active { background: #f0f2f5; }
  #screen-app.active {
    padding: 0;
    background: #0b141a;
  }
  .app {
    height: min(100dvh, 920px);
    margin-top: max(0px, calc((100dvh - 920px) / 2));
    border-radius: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,.04);
  }
}
@media (min-width: 1024px) {
  .sidebar { width: 34%; }
}

/* Offline banner demo */
.offline-bar {
  display: none;
  background: #182229; color: #fff;
  font-size: .8rem; text-align: center;
  padding: 6px 8px;
}
.offline-bar.show { display: block; }

/* ===================== WeAds Whats v1: complementos do protótipo ===================== */
[hidden] { display: none !important; }
.login-error { color: var(--danger); font-size: .85rem; min-height: 1.2em; margin: -4px 0 10px; }
.btn-primary:disabled { opacity: .6; }
.avatar { position: relative; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.side-actions { display: flex; align-items: center; margin-left: auto; flex: 0 0 auto; }
.icon-btn.on { color: var(--green); }
.notice {
  display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 10px 14px; font-size: .82rem; line-height: 1.35;
  background: #fff8e1; color: #6b5200; border-bottom: 1px solid #f3e3a8;
}
.notice.info { background: #e7f6f3; color: #075e54; border-color: #cbe9e2; }
.notice.danger { background: #fdecea; color: #8a1c12; border-color: #f6c9c3; }
.notice button { margin-left: auto; font-weight: 600; color: inherit; text-decoration: underline; padding: 6px 4px; flex: 0 0 auto; }
.chat-empty { padding: 32px 24px; color: var(--muted); text-align: center; font-size: .9rem; }
.chat-item .chat-pin {
  flex: 0 0 auto; margin-left: 4px; color: var(--muted); opacity: .85;
  display: inline-flex; align-items: center;
}
.chat-item.fixada .chat-name { max-width: calc(100% - 18px); }
.chat-top { display: flex; align-items: baseline; gap: 6px; }
.chat-top .chat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ops-card .msg-acoes button { min-height: 48px; }
.escopo-acoes { flex-direction: column; }
.escopo-acoes button.sec { background: transparent; color: var(--muted); font-weight: 500; }
.chat-mais {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; color: var(--muted); font-size: .85rem;
}
.chat-mais-btn {
  width: 100%; border: none; background: transparent; cursor: pointer;
  color: var(--green); font-weight: 600;
}
.chat-mais-btn:active { background: #f5f6f6; }
.chat-fim {
  padding: 14px 16px 20px; text-align: center;
  color: var(--muted); font-size: .78rem;
}
.chat-sentinela { height: 1px; width: 100%; pointer-events: none; }
.lista-secao {
  padding: 10px 14px 6px; font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  background: var(--panel);
}
.chat-mais-spin {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); border-top-color: var(--green);
  animation: girar-qr .8s linear infinite;
}
.chat-preview .tick-inline { display: inline-flex; vertical-align: -2px; margin-right: 2px; }
.loading-more { text-align: center; color: var(--muted); font-size: .75rem; padding: 6px; }
.sender { font-size: .78rem; font-weight: 600; color: var(--green); margin-bottom: 2px; }
.text a { color: #027eb5; }
.ticks { display: inline-flex; align-items: center; }
.ticks svg { display: block; }
/* Traço mais grosso: o azul claro some no balão claro com o traço fino. */
.ticks.read svg path { stroke-width: 2.1; }
.ticks.fail { color: var(--danger); }
.ticks.warn { color: #c98a00; }
.msg-erro { font-size: .72rem; color: var(--danger); margin-top: 2px; text-align: right; }
.msg-erro.warn { color: #8a6200; }
.msg-erro button { color: inherit; text-decoration: underline; font-size: inherit; padding: 2px 0; }
.bubble.pending { opacity: .85; }
.media-img { aspect-ratio: auto; max-height: 340px; object-fit: cover; cursor: zoom-in; min-height: 80px; }
.media-sticker { width: 140px; height: 140px; object-fit: contain; background: transparent; }
.media-video { width: 100%; max-width: 300px; border-radius: 6px; margin-bottom: 4px; background: #000; display: block; }
.video-card {
  position: relative; width: min(300px, 100%); margin-bottom: 4px;
  border-radius: 6px; overflow: hidden; background: #000;
}
.video-card .media-video {
  width: 100%; max-width: none; max-height: 340px; min-height: 120px; margin: 0; border-radius: 0;
  object-fit: contain; pointer-events: none; background: #000;
}
.video-card.aberto .media-video { pointer-events: auto; min-height: 0; }
.video-hit { position: absolute; inset: 0; z-index: 1; }
.video-play {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(11, 20, 26, .45); border: 0;
  box-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.video-play svg { margin-left: 3px; }
.video-card.aberto .video-hit,
.video-card.aberto .video-play { display: none; }
.media-audio { width: 260px; max-width: 100%; height: 40px; display: block; margin: 2px 0 4px; }
.media-wait {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 240px; max-width: 100%; height: 120px; border-radius: 6px; margin-bottom: 4px;
  background: rgba(0,0,0,.06); color: var(--muted); font-size: .8rem; text-align: center; padding: 8px;
}
.media-wait.small { height: 48px; }
a.doc-card { color: inherit; text-decoration: none; }
.doc-icon.pdf { background: #e53935; } .doc-icon.doc { background: #1e88e5; } .doc-icon.xls { background: #2e7d32; }
.doc-icon.gen { background: #607d8b; }
.doc-name { word-break: break-all; }
.composer { position: relative; }
.preview-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 12;
  background: var(--panel); border-top: 1px solid var(--border);
  padding: 12px 12px calc(12px + var(--safe-bottom)); box-shadow: 0 -8px 24px rgba(0,0,0,.12);
}
.preview-sheet .pv-lista { max-height: min(40vh, 320px); overflow-y: auto; overscroll-behavior: contain; margin-bottom: 10px; }
.preview-sheet .pv-top { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.preview-sheet .pv-top + .pv-top { margin-top: 8px; }
.preview-sheet .pv-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #ddd; flex: 0 0 auto; }
.preview-sheet .pv-info { flex: 1; min-width: 0; font-size: .85rem; }
.preview-sheet .pv-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-sheet .pv-doc-toggle {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-size: .92rem; color: var(--text); user-select: none; min-height: 36px;
}
.preview-sheet .pv-doc-toggle input { width: 18px; height: 18px; accent-color: var(--green-dark); }
.preview-sheet .pv-row { display: flex; gap: 8px; align-items: center; }
.preview-sheet input[type=text] { flex: 1; min-height: 44px; border-radius: 22px; border: 1px solid #d1d7db; padding: 0 14px; font-size: 1rem; outline: none; }
.preview-sheet .send { width: 44px; height: 44px; border-radius: 50%; background: var(--green-dark); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.viewer {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.94);
  display: flex; flex-direction: column; color: #fff;
}
.viewer[hidden] { display: none !important; }
.viewer-top {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(6px + var(--safe-top)) 10px 8px; background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
  position: relative; z-index: 2;
}
.viewer-acoes { display: flex; gap: 6px; }
.viewer-btn {
  min-height: 40px; padding: 0 12px; border-radius: 10px; color: #fff; font-weight: 600; font-size: .92rem;
  background: rgba(255,255,255,.12);
}
.viewer-btn:active { background: rgba(255,255,255,.22); }
.viewer-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.viewer-stage img, .viewer-stage video {
  max-width: 100%; max-height: 100%; object-fit: contain; background: #000;
}
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 64px; color: #fff; font-size: 2rem; background: rgba(0,0,0,.25);
  display: none; place-items: center;
}
.viewer-nav.prev { left: 4px; border-radius: 0 8px 8px 0; }
.viewer-nav.next { right: 4px; border-radius: 8px 0 0 8px; }
.viewer-contador {
  position: absolute; left: 0; right: 0; bottom: calc(12px + var(--safe-bottom));
  text-align: center; font-size: .85rem; color: rgba(255,255,255,.8); pointer-events: none; z-index: 2;
}
@media (pointer: fine) {
  .viewer-nav { display: grid; }
}
.galeria-fundo { position: fixed; inset: 0; z-index: 47; background: var(--panel); display: flex; justify-content: center; }
.galeria-fundo[hidden] { display: none !important; }
.galeria-card { width: 100%; max-width: 560px; height: 100%; display: flex; flex-direction: column; background: #fff; }
.galeria-header { gap: 8px; }
.galeria-header .adm-title { flex: 1; min-width: 0; }
.galeria-sel-btn {
  flex: 0 0 auto; min-height: 36px; padding: 0 10px; border-radius: 8px;
  font-size: .9rem; font-weight: 600; color: var(--green-dark, #0b6b5b);
}
.galeria-sel-btn:disabled { opacity: .4; }
.galeria-sel-acoes { display: flex; gap: 4px; flex: 0 0 auto; }
.galeria-tabs {
  display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border); overflow-x: auto;
}
.galeria-tabs button {
  flex: 0 0 auto; min-height: 36px; padding: 0 12px; border-radius: 18px;
  font-size: .88rem; font-weight: 600; color: var(--muted); background: transparent;
}
.galeria-tabs button.on { background: #e7f8f2; color: var(--green-dark, #0b6b5b); }
.galeria-corpo { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.galeria-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; }
.galeria-tile {
  position: relative; aspect-ratio: 1; background: #e9edef; overflow: hidden; border: 0; padding: 0; color: inherit;
}
.galeria-tile img, .galeria-tile video {
  width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none;
}
.galeria-tile .galeria-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.22); color: #fff; font-size: 1.4rem; pointer-events: none;
}
.galeria-tile .galeria-check {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.25); display: none;
}
.galeria-card.modo-sel .galeria-tile .galeria-check { display: block; }
.galeria-tile.marcada .galeria-check { background: var(--green); border-color: var(--green); }
.galeria-tile.marcada .galeria-check::after {
  content: ""; position: absolute; left: 5px; top: 4px; width: 10px; height: 6px;
  border: solid #fff; border-width: 0 0 2.4px 2.4px; transform: rotate(-45deg);
}
.galeria-tile.marcada { outline: 2px solid var(--green); outline-offset: -2px; }
.galeria-lista { display: flex; flex-direction: column; }
.galeria-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: #fff; color: inherit;
}
.galeria-item .galeria-check {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c4c9cc; display: none; position: relative;
}
.galeria-card.modo-sel .galeria-item .galeria-check { display: block; }
.galeria-item.marcada .galeria-check { background: var(--green); border-color: var(--green); }
.galeria-item.marcada .galeria-check::after {
  content: ""; position: absolute; left: 5px; top: 5px; width: 10px; height: 6px;
  border: solid #fff; border-width: 0 0 2.4px 2.4px; transform: rotate(-45deg);
}
.galeria-item-icone {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; background: #e9edef;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #54656f;
}
.galeria-item-meta { flex: 1; min-width: 0; }
.galeria-item-nome { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.galeria-item-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.galeria-vazio, .galeria-mais { padding: 28px 16px; text-align: center; color: var(--muted); font-size: .95rem; }
.galeria-mais { padding: 16px; }
@media (min-width: 768px) {
  .galeria-fundo { padding: 24px; background: rgba(11,20,26,.85); }
  .galeria-card { height: min(100%, 760px); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
}
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%);
  background: #111b21; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .85rem;
  /* Acima do painel de tarefas / sheets (z-index 80). */
  z-index: 90;
  max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 12px;
}
.toast[hidden] { display: none !important; }
.toast-msg { flex: 1; min-width: 0; }
.toast-acao {
  flex: 0 0 auto; border: 0; background: transparent;
  color: #6ee7b7; font: inherit; font-weight: 700; cursor: pointer; padding: 0;
}
.toast-acao:hover { text-decoration: underline; }
html[data-tema="escuro"] .toast-acao { color: #86efac; }
.tf-detalhe-concluir.on {
  color: var(--green, #25d366);
}
.tf-detalhe-concluir .tf-check-marcado { display: none !important; }
.tf-detalhe-concluir.on .tf-check-marcado { display: block !important; }
.tf-detalhe-concluir.on .tf-check-vazio { display: none !important; }
.menu-pop {
  /* Embaixo do header inteiro (avatar + chip de conta), ancorado à direita. */
  position: absolute; top: calc(100% - 6px); right: 8px; z-index: 20;
  background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; min-width: 220px;
}
.menu-pop.menu-aparencia {
  top: calc(100% + 140px);
  min-width: 180px;
}
.menu-pop.lista-filtro-menu {
  top: calc(100% + 6px); right: 0; left: auto; z-index: 40;
  min-width: 220px;
}
.menu-pop.lista-filtro-menu button[aria-checked="true"] {
  background: var(--t-item-active, var(--panel));
  color: var(--t-primary2, var(--green-dark));
  font-weight: 700;
}
.menu-pop.lista-filtro-menu .lf-sec {
  padding: 8px 14px 4px; font-size: .72rem; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.menu-pop.lista-filtro-menu #lista-filtro-limpar { color: var(--danger); border-top: 1px solid var(--border); margin-top: 4px; }
.menu-pop button { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: 8px; font-size: .95rem; min-height: 44px; }
.menu-pop button:active { background: var(--panel); }
.menu-pop button[aria-checked="true"]::after {
  content: "✓"; float: right; color: var(--t-primary, var(--green-dark)); font-weight: 700;
}
.menu-pop .who { padding: 8px 14px 10px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.jump-bottom {
  position: absolute; right: 14px; bottom: calc(var(--composer-h) + 14px + var(--safe-bottom)); z-index: 6;
  width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--muted); box-shadow: var(--shadow), 0 2px 8px rgba(0,0,0,.12);
  display: grid; place-items: center;
}
.jump-bottom .jump-count {
  position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--t-primary, #25d366); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.jump-bottom.com-novas { color: var(--t-primary, #075e54); }

/* Pull-to-refresh (lista de conversas / CRM) */
.pull-refresh {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--pull, 0px); max-height: 72px; overflow: hidden;
  color: var(--muted); font-size: .82rem; font-weight: 500;
  transition: none; pointer-events: none; flex-shrink: 0;
}
.pull-refresh.pronto { color: var(--t-primary, #075e54); }
.pull-refresh-ico {
  width: 18px; height: 18px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; opacity: .55;
  transform: rotate(calc(var(--pull, 0px) * 4deg));
}
.pull-refresh.busy .pull-refresh-ico {
  opacity: 1; animation: pull-spin .7s linear infinite;
  transform: none;
}
@keyframes pull-spin { to { transform: rotate(360deg); } }
.app { position: relative; }

/* ===================== v2: Google, aprovação e administração ===================== */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 10px;
  background: #fff; color: #1f1f1f; border: 1px solid #d1d7db; font-weight: 600; font-size: 1rem;
  text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.btn-google:active { background: #f5f6f6; }
.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-size: .78rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-switch { margin: 16px 0 0; text-align: center; font-size: .88rem; color: var(--muted); }
.login-switch button { color: var(--green-dark); font-weight: 600; padding: 6px 2px; text-decoration: underline; }
.btn-secondary {
  width: 100%; min-height: 48px; margin-top: 10px; padding: 12px; border-radius: 10px;
  background: var(--panel); color: var(--text); font-weight: 600; font-size: .95rem;
}
.btn-secondary:active { background: #e4e7ea; }

#screen-pendente,
#screen-proprio {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  background: linear-gradient(160deg, #0b141a 0%, #075e54 60%, #128c7e 100%);
  overflow: auto;
}
.btn-perigo {
  width: 100%; min-height: 44px; margin-top: 4px; padding: 10px; border-radius: 10px;
  background: transparent; color: #c0392b; font-weight: 600;
}
.cv-proprio { margin: 0 16px 12px; border: 1px solid var(--border); border-radius: 10px; }
.pend-card { text-align: center; }
.pend-card h1 { font-size: 1.2rem; line-height: 1.3; margin-bottom: 8px; }
.pend-card .sub { line-height: 1.45; }
.pend-icon {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  background: #fff4d6; color: #b07800; display: grid; place-items: center;
}
.pend-conta {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--panel); border-radius: 12px; padding: 12px; margin: 0 0 18px;
}
.pend-info { min-width: 0; flex: 1; }
.pend-nome { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pend-email { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.notice.warn { background: #fff8e1; color: #6b5200; border-color: #f3e3a8; }
.menu-pop #mi-admin { display: flex; align-items: center; gap: 8px; }
.menu-pop #mi-admin[hidden] { display: none !important; }
.menu-pop .badge { margin-left: auto; }

/* Tela de administração: ocupa a tela no celular; painel central no computador */
#screen-admin { position: fixed; inset: 0; z-index: 40; background: var(--panel); display: flex; justify-content: center; }
.adm { width: 100%; max-width: 760px; height: 100%; display: flex; flex-direction: column; background: #fff; }
.adm-header {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  height: calc(var(--header-h) + var(--safe-top));
  padding: calc(var(--safe-top) + var(--header-pad-y)) 12px var(--header-pad-y) calc(4px + var(--safe-left));
  background: var(--teal-panel); color: #fff;
}
.adm-header .adm-back { display: grid !important; color: #fff; width: 44px; height: 44px; place-items: center; border-radius: 50%; }
.adm-title { font-weight: 600; font-size: 1.08rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.adm-view[hidden] { display: none !important; }
.adm-tabs { flex: 0 0 auto; display: flex; background: var(--teal-panel); }
.adm-tabs button {
  flex: 1; min-height: 46px; color: rgba(255,255,255,.75); font-weight: 600; font-size: .9rem;
  text-transform: uppercase; letter-spacing: .02em; border-bottom: 3px solid transparent;
}
.adm-tabs button.on { color: #fff; border-bottom-color: #fff; }
.adm-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(16px + var(--safe-bottom)); }
.adm-grupo { padding: 14px 16px 6px; font-size: .78rem; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: .03em; }
.adm-grupo.pend { color: #b07800; }
.u-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 16px; min-height: 68px; border-bottom: 1px solid var(--border); background: #fff;
}
.u-item:active { background: #f5f6f6; }
.u-meta { flex: 1; min-width: 0; }
.u-nome { font-weight: 600; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-email { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: .7rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--panel); color: var(--muted); }
.tag.admin { background: #e7f6f3; color: var(--green-dark); }
.tag.pendente { background: #fff4d6; color: #8a5f00; }
.tag.desativado { background: #fdecea; color: #8a1c12; }
.tag.google { background: #e8f0fe; color: #1a57c9; }
.u-acao {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px; border-radius: 18px; line-height: 1;
  background: var(--green-dark); color: #fff; font-weight: 600; font-size: .85rem;
}
.u-item.off .u-nome, .u-item.off .avatar { opacity: .55; }
.adm-vazio { padding: 28px 24px; color: var(--muted); text-align: center; font-size: .9rem; }
.i-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.i-dot { width: 10px; height: 10px; border-radius: 50%; background: #c4c9cc; flex: 0 0 auto; }
.i-dot.ok { background: var(--green-light); }
.i-dot.ruim { background: var(--danger); }
.i-status { font-size: .8rem; color: var(--muted); }

.i-item { align-items: flex-start; }
.i-item .u-meta { flex: 1; min-width: 0; }
.i-btn {
  flex: 0 0 auto; align-self: center; margin-left: 8px;
  min-height: 36px; padding: 0 12px; border-radius: 18px;
  background: var(--green-dark); color: #fff; font-weight: 600; font-size: .78rem;
  white-space: nowrap;
}
.i-btn:disabled { opacity: .55; }
.i-btn:active:not(:disabled) { opacity: .85; }
.i-import { margin-top: 4px; font-size: .75rem; line-height: 1.3; }
.i-import.rodando { color: var(--green); }
.i-import.ok { color: var(--muted); }
.i-import.erro { color: var(--danger); }
.adm-nota { margin: 12px 16px; font-size: .78rem; color: var(--muted); line-height: 1.4; }

.adm-perfil { display: flex; align-items: center; gap: 14px; padding: 18px 16px; border-bottom: 1px solid var(--border); }
.ed-meta { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.adm-sec { margin: 0; padding: 18px 16px 8px; font-size: .8rem; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: .03em; }
.adm-hint { margin: 0 16px 8px; font-size: .82rem; color: var(--muted); }
.seg { display: flex; margin: 0 16px; border: 1px solid #d1d7db; border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; min-height: 44px; font-size: .88rem; font-weight: 600; color: var(--muted); border-right: 1px solid #d1d7db; }
.seg button:last-child { border-right: none; }
.seg button.on[data-v=aprovado] { background: var(--green-dark); color: #fff; }
.seg button.on[data-v=pendente] { background: #f2b600; color: #3d2c00; }
.seg button.on[data-v=desativado] { background: var(--danger); color: #fff; }
.opt-list { margin: 0 16px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; min-height: 52px; border-bottom: 1px solid var(--border); cursor: pointer; }
.opt:last-child { border-bottom: none; }
.opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green-dark); flex: 0 0 auto; }
.opt span { display: flex; flex-direction: column; gap: 2px; font-size: .95rem; min-width: 0; }
.opt small { color: var(--muted); font-size: .78rem; }
.opt.disabled { opacity: .55; cursor: default; }
#adm-editar .login-error { margin: 12px 16px 0; }
.adm-footer { flex: 0 0 auto; padding: 10px 16px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--border); background: #fff; }
@media (min-width: 768px) {
  #screen-admin { padding: 24px; background: rgba(11,20,26,.85); }
  .adm { height: min(100%, 860px); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
  .adm-header { border-radius: 0; }
}

/* ===================== v5: reações, responder (arrastar) e encaminhar ===================== */
/* mensagem citada (dentro da bolha e acima do campo de texto) */
.quote {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: rgba(0,0,0,.05); border-left: 4px solid #06cf9c; border-radius: 6px;
  padding: 5px 8px 6px; margin: 0 0 4px; min-width: 160px; overflow: hidden;
}
.row.out .bubble .quote { background: rgba(0,0,0,.06); }
.quote.eu { border-left-color: #53bdeb; }
.quote-autor { font-size: .78rem; font-weight: 600; color: var(--green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote.eu .quote-autor { color: #1f8fc4; }
.quote-texto {
  font-size: .82rem; color: #54656f; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap;
}
.fwd-label { display: flex; align-items: center; gap: 4px; font-size: .74rem; font-style: italic; color: var(--muted); margin-bottom: 2px; }

.reply-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 8px 6px 0 calc(10px + var(--safe-left)); background: var(--panel);
  border-top: 1px solid var(--border);
}
.reply-bar .quote { flex: 1; min-width: 0; margin: 0; background: #fff; cursor: default; }
.reply-bar.eu .quote { border-left-color: #53bdeb; }
.reply-bar.eu .quote-autor { color: #1f8fc4; }
.reply-bar .icon-btn { width: 40px; height: 40px; font-size: 18px; }
.reply-bar:not([hidden]) + .composer { border-top: none; }

/* reações (pílula sob a bolha, como no WhatsApp) */
.row.com-reacoes { margin-bottom: 20px; }
.reacts {
  position: absolute; bottom: -17px; display: inline-flex; align-items: center; gap: 1px;
  background: #fff; border-radius: 12px; padding: 1px 6px; min-height: 24px;
  box-shadow: 0 1px 2px rgba(11,20,26,.18); font-size: .9rem; line-height: 1; z-index: 1;
  border: 1px solid #f0f2f5;
}
.row.in .reacts { left: 8px; }
.row.out .reacts { right: 8px; }
.reacts.minha { background: #e7f6f3; }
.reacts .n { font-size: .72rem; color: var(--muted); margin-left: 3px; font-weight: 600; }

/* menu da mensagem — nunca selecionável (iOS não “prende” o 👍 como texto) */
.msg-menu-fundo,
.msg-menu,
.react-bar,
.msg-acoes,
.react-bar button,
.msg-acoes button {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.msg-menu-fundo { position: fixed; inset: 0; z-index: 45; background: rgba(11,20,26,.35); }
.msg-menu {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2);
  padding: 10px 8px calc(8px + var(--safe-bottom));
  animation: subir .16s ease-out;
}
@keyframes subir { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.react-bar {
  display: flex; justify-content: space-around; gap: 2px;
  margin: 0 4px 6px; padding: 6px; background: var(--panel); border-radius: 999px;
}
.react-bar button {
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.6rem; line-height: 1;
  display: grid; place-items: center; transition: transform .1s;
}
.react-bar button:active { transform: scale(1.25); }
.react-bar button.on { background: #cfe9e3; }
.msg-acoes button {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 50px; padding: 0 14px; border-radius: 10px; font-size: 1rem; color: var(--text);
}
.msg-acoes button svg { color: var(--muted); flex: 0 0 auto; }
.msg-acoes button:active { background: var(--panel); }
.row.selecionada .bubble { box-shadow: 0 0 0 2px rgba(18,140,126,.55), var(--shadow); }

/* arrastar para responder */
.row { position: relative; touch-action: pan-y; }
.row .bubble { transform: translateX(var(--swipe, 0px)); transition: transform .2s ease; }
.row.arrastando .bubble { transition: none; }
.swipe-icon {
  position: absolute; left: 4px; top: 50%; margin-top: -16px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.85); color: var(--muted);
  opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; pointer-events: none;
}
.row.arrastando .swipe-icon { opacity: .6; transform: scale(.85); }
.row.pronto .swipe-icon { opacity: 1; transform: scale(1); color: var(--green); }
.row.piscar .bubble { animation: piscar 1.2s ease; }
@keyframes piscar { 0%, 60% { box-shadow: 0 0 0 3px rgba(37,211,102,.55), var(--shadow); } 100% { box-shadow: var(--shadow); } }
/* Toque (iPhone/PWA): toque longo abre o nosso menu — sem seleção/callout do iOS.
   Desktop com mouse (hover fino) continua podendo selecionar texto no balão. */
@media (hover: none), (pointer: coarse) {
  .row,
  .row .bubble,
  .row .bubble .text,
  .row .bubble .meta,
  .row .reacts,
  .row .quote,
  .chat-item,
  .chat-item .chat-name,
  .chat-item .chat-preview {
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  }
  .row .bubble img,
  .row .bubble video { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}
/* composer / inputs / busca: sempre selecionáveis (não herdam o none acima) */
.composer textarea,
.composer input,
.search-box input,
.field input,
.preview-sheet input[type="text"],
#msg-input, #fwd-busca, #search, #pv-caption,
textarea, input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]) {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}

/* seta de opções na bolha (computador) */
.bubble-mais {
  position: absolute; top: 2px; right: 2px; z-index: 3; width: 26px; height: 22px; border-radius: 0 6px 0 10px;
  display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity .12s;
  background: radial-gradient(circle at 70% 30%, var(--in-bubble) 55%, transparent 75%);
}
.row.out .bubble-mais { background: radial-gradient(circle at 70% 30%, var(--out-bubble) 55%, transparent 75%); }
.bubble:hover .bubble-mais, .bubble-mais:focus-visible { opacity: 1; }
@media (hover: none), (pointer: coarse) { .bubble-mais { display: none; } }

/* encaminhar */
.fwd-fundo { position: fixed; inset: 0; z-index: 46; background: var(--panel); display: flex; justify-content: center; }
.fwd-card { width: 100%; max-width: 560px; height: 100%; display: flex; flex-direction: column; background: #fff; }
.fwd-msg { display: flex; gap: 8px; align-items: baseline; padding: 10px 16px; background: #f7f8fa; border-bottom: 1px solid var(--border); font-size: .85rem; color: #54656f; }
.fwd-msg #fwd-resumo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fwd-msg-rot { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--green); flex: 0 0 auto; }
.fwd-lista { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.fwd-item .fwd-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c4c9cc; flex: 0 0 auto; display: grid; place-items: center;
}
.fwd-item.sel { background: #f0faf7; }
.fwd-item.sel .fwd-check { background: var(--green); border-color: var(--green); }
.fwd-item.sel .fwd-check::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.4px 2.4px; transform: translateY(-1px) rotate(-45deg); }
.fwd-footer {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px calc(10px + var(--safe-bottom)) 16px; background: var(--panel); border-top: 1px solid var(--border);
}
.fwd-nomes { flex: 1; min-width: 0; font-size: .9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fwd-footer .send { width: 48px; height: 48px; border-radius: 50%; background: var(--green-dark); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.fwd-footer .send:disabled { opacity: .5; }

@media (min-width: 768px) {
  .msg-menu-fundo { background: transparent; }
  .msg-menu {
    left: auto; right: auto; bottom: auto; width: 300px; border-radius: 12px;
    padding: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.22); animation: none;
  }
  .react-bar button { width: 40px; height: 40px; font-size: 1.35rem; }
  .msg-acoes button { min-height: 42px; font-size: .92rem; }
  .fwd-fundo { padding: 24px; background: rgba(11,20,26,.85); }
  .fwd-card { height: min(100%, 760px); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
}

/* ===================== v6: voz, WhatsApp no topo, topo do iPhone ===================== */

/* Topo: --safe-top = --safe-top-raw (sem +14). Com status-bar default a barra
   é opaca (env top = 0); a folga extra era só para o blur do translucent. */

/* Conversa no PWA iOS: home indicator ~34px deixa o composer alto demais
   (faixa vazia sob o campo). Reduz ~20px → ~14px, como o WhatsApp.
   Só com #chat-pane aberto — lista / side-footer mantêm o inset cheio.
   teclado-aberto zera --safe-bottom depois (regra mais abaixo). */
html.pwa-movel:has(#chat-pane.open) {
  --safe-bottom: max(6px, calc(var(--safe-bottom-raw) - 20px));
}
@media (display-mode: standalone) and (hover: none) and (pointer: coarse) {
  html:has(#chat-pane.open) {
    --safe-bottom: max(6px, calc(var(--safe-bottom-raw) - 20px));
  }
}
/* Composer: a folga já está no --safe-bottom reduzido; não somar +8 de novo. */
html.pwa-movel:has(#chat-pane.open) .composer,
html.pwa-movel:has(#chat-pane.open) .preview-sheet {
  padding-bottom: max(8px, var(--safe-bottom));
}
@media (display-mode: standalone) and (hover: none) and (pointer: coarse) {
  html:has(#chat-pane.open) .composer,
  html:has(#chat-pane.open) .preview-sheet {
    padding-bottom: max(8px, var(--safe-bottom));
  }
}

/* Cabeçalhos/topos fixos: padding-top da área segura (fundo continua full-bleed).
   side/chat/adm já trazem isso no shorthand; reforço aqui cobre fwd/galeria. */
.fwd-header,
.galeria-header {
  padding-top: var(--safe-top);
}

/* WhatsApp conectado no topo da lista (1ª linha; chip de conta vai na 2ª) */
.inst-btn {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 4px 0; border-radius: 10px; text-align: left; position: relative;
  cursor: default;
}
.inst-btn.varias { cursor: pointer; }
.inst-btn.varias:active { background: rgba(0,0,0,.05); }
.inst-foto { position: relative; flex: 0 0 auto; display: block; }
.inst-foto .avatar { position: relative; }
.inst-dot {
  position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--panel); background: #aebac1;
}
.inst-dot.ok { background: var(--green-light); }
.inst-dot.ruim { background: var(--danger); }
.inst-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inst-nome { font-weight: 600; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inst-sub { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inst-sub.ruim { color: var(--danger); }
.inst-chev { color: var(--muted); flex: 0 0 auto; }
.inst-chev[hidden] { display: none; }
.inst-outras {
  position: absolute; left: 30px; top: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--green-light); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--panel);
}
.inst-outras[hidden] { display: none; }
.inst-sheet { position: absolute; inset: 0; z-index: 30; }
.inst-sheet[hidden] { display: none; }
.inst-fundo { position: absolute; inset: 0; background: rgba(11,20,26,.35); }
.inst-painel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--t-card-bg, var(--t-panel, #fff)); color: var(--t-text, var(--text));
  border-radius: 16px 16px 0 0; padding: 8px 8px calc(12px + var(--safe-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,.18); max-height: 70%; overflow-y: auto;
  animation: subir .18s ease-out;
}
.inst-painel::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--t-border, #d1d7db); margin: 2px auto 8px; }
.inst-painel-tit { font-size: .8rem; color: var(--t-muted, var(--muted)); padding: 2px 12px 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.inst-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; text-align: left; min-height: 64px; color: var(--t-text, var(--text)); }
.inst-item:active, .inst-item:hover { background: var(--t-item-active, var(--panel)); }
.inst-item.atual { background: var(--t-primary, var(--green-dark)); color: #fff; }
.inst-item .inst-dot { border-color: var(--t-card-bg, #fff); }
.inst-item.atual .inst-dot { border-color: var(--t-primary, var(--green-dark)); }
.inst-item-nome { font-weight: 600; font-size: .98rem; color: var(--t-text, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inst-item-sub { font-size: .78rem; color: var(--t-muted, var(--muted)); }
.inst-item-sub.ruim { color: var(--danger); }
.inst-item.atual .inst-item-nome { color: #fff; }
.inst-item.atual .inst-item-sub { color: rgba(255,255,255,.78); }
.inst-item.atual .inst-item-sub.ruim { color: #ffc9c2; }
.inst-check { color: var(--t-primary, var(--green)); flex: 0 0 auto; }
.inst-item.atual .inst-check { color: #fff; }
@keyframes subir { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 768px) {
  /* no computador: lista suspensa logo abaixo do topo */
  .inst-fundo { background: transparent; }
  .inst-painel {
    top: calc(var(--header-h) + var(--safe-top) - 4px); bottom: auto; left: 8px; right: auto; width: 340px;
    border-radius: 12px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: none;
  }
  .inst-painel::before { display: none; }
}
/* quem está usando: agora dentro do menu ⋮ */
.menu-pop .who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.menu-pop .who .avatar { width: 36px; height: 36px; font-size: .8rem; }
.who-txt { min-width: 0; }
.who-nome { font-size: .92rem; font-weight: 600; color: var(--text); }
.who-email { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* Gravar mensagem de voz — layout WhatsApp (painel substitui o composer).
   L1: tempo + forma de onda ao vivo; L2: lixeira · pausar/retomar · enviar.
   Toque no mic começa; enviar manda direto (sem etapa de revisão). */
.composer .send[hidden] { display: none; }
.composer .mic {
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.composer.gravando,
.composer.pausado,
.composer.rascunho {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 10px 14px calc(10px + var(--safe-bottom)) calc(14px + var(--safe-left));
  background: #F0F2F5;
  border-top: 1px solid var(--border);
}
html[data-tema="escuro"] .composer.gravando,
html[data-tema="escuro"] .composer.pausado,
html[data-tema="escuro"] .composer.rascunho {
  background: #1C1C1E;
  border-top-color: rgba(255,255,255,.06);
}
.composer.gravando > .attach,
.composer.gravando > .input-wrap,
.composer.gravando > .send,
.composer.gravando > .mic,
.composer.pausado > .attach,
.composer.pausado > .input-wrap,
.composer.pausado > .send,
.composer.pausado > .mic,
.composer.rascunho > .attach,
.composer.rascunho > .input-wrap,
.composer.rascunho > .send,
.composer.rascunho > .mic { display: none !important; }

.rec-bar {
  display: flex; flex-direction: column; gap: 14px;
  width: 100%; background: transparent; position: relative; z-index: 2;
}
.rec-bar[hidden] { display: none; }
.rec-topo {
  display: flex; align-items: center; gap: 10px; min-height: 28px;
}
.rec-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  flex: 0 0 auto; animation: piscar-rec 1.1s ease-in-out infinite; opacity: .85;
}
.rec-dot[hidden] { display: none; }
@keyframes piscar-rec { 50% { opacity: .15; } }
.rec-tempo {
  font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 500;
  color: var(--text); min-width: 2.6em; flex: 0 0 auto; letter-spacing: .02em;
}
.rec-onda {
  flex: 1 1 auto; min-width: 0; height: 28px; width: 100%;
  display: block;
}
.rec-acoes {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; padding: 0 4px;
}
.rec-lixo {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text); flex: 0 0 auto; opacity: .9;
}
.rec-lixo:active, .rec-lixo:hover { color: var(--danger); background: rgba(234,67,53,.12); }
.rec-acoes-centro {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex: 1 1 auto;
}
.rec-pausar {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 auto;
  color: #E53935; background: transparent;
  border: 2.5px solid #E53935;
}
.rec-pausar:active { background: rgba(229,57,53,.1); }
.rec-pausar .rec-ico-pausar[hidden],
.rec-pausar .rec-ico-retomar[hidden] { display: none; }
.rec-ouvir {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text); flex: 0 0 auto; border: 1.5px solid rgba(127,127,127,.35);
}
.rec-ouvir[hidden] { display: none; }
.rec-ouvir:active { background: rgba(0,0,0,.06); }
.rec-ouvir .rec-pause-ico[hidden],
.rec-ouvir .rec-play-ico[hidden] { display: none; }
.rec-enviar {
  width: 48px !important; height: 48px !important; margin: 0 !important;
  background: #fff !important; color: #111 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
html[data-tema="escuro"] .rec-enviar {
  background: #fff !important; color: #111 !important;
}
html[data-tema="claro"] .rec-enviar,
:root:not([data-tema="escuro"]) .rec-enviar {
  background: #fff !important; color: #111 !important;
}
.composer.gravando .rec-enviar,
.composer.pausado .rec-enviar,
.composer.rascunho .rec-enviar {
  /* no tema claro o círculo branco some no fundo claro → usa primary */
  background: var(--t-mic-bg, var(--green-dark, #1F5DA2)) !important;
  color: var(--t-mic-fg, #fff) !important;
  box-shadow: var(--t-mic-shadow, 0 1px 3px rgba(0,0,0,.18));
}
html[data-tema="escuro"] .composer.gravando .rec-enviar,
html[data-tema="escuro"] .composer.pausado .rec-enviar,
html[data-tema="escuro"] .composer.rascunho .rec-enviar {
  background: #fff !important; color: #111 !important; box-shadow: none;
}
.rec-enviar[hidden] { display: none; }
html[data-tema="escuro"] .rec-lixo:active,
html[data-tema="escuro"] .rec-lixo:hover { background: rgba(234,67,53,.15); }
html[data-tema="escuro"] .rec-ouvir { border-color: rgba(255,255,255,.28); color: #fff; }
html[data-tema="escuro"] .rec-tempo { color: #fff; }
html[data-tema="escuro"] .rec-lixo { color: #fff; }

/* Tocar áudio (balão) */
.audio-card { display: flex; align-items: center; gap: 8px; min-width: 240px; max-width: 300px; padding: 4px 2px 0; }
.audio-play { width: 40px; height: 40px; border-radius: 50%; background: transparent; color: #54656f; display: grid; place-items: center; flex: 0 0 auto; }
.audio-play:active { background: rgba(0,0,0,.06); }
.audio-card.voz .audio-play { color: #54656f; }
.audio-main { flex: 1; min-width: 0; position: relative; padding-top: 4px; }
.audio-wave {
  height: 28px; cursor: pointer; touch-action: manipulation;
  background: linear-gradient(90deg, #34b7f1 var(--p), #aebac1 var(--p));
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.row.out .audio-wave { background: linear-gradient(90deg, #1fa855 var(--p), #9fbf9a var(--p)); }
.audio-knob {
  position: absolute; top: 13px; left: calc(var(--p) - 6px); width: 12px; height: 12px; border-radius: 50%;
  background: #34b7f1; pointer-events: none;
}
.row.out .audio-knob { background: #1fa855; }
.audio-info { display: flex; justify-content: space-between; margin-top: 2px; }
.audio-dur { font-size: .72rem; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.audio-card.voz .audio-dur svg { color: #34b7f1; }
.row.out .audio-card.voz .audio-dur svg { color: #1fa855; }
.audio-vel {
  flex: 0 0 auto; min-width: 40px; height: 26px; padding: 0 8px; border-radius: 13px;
  background: rgba(0,0,0,.08); color: #3b4a54; font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.audio-vel:active { background: rgba(0,0,0,.14); }

/* Mini player persistente (topo; overlay — sem empurrar layout ao mostrar/esconder).
   Só aparece fora da conversa de origem (regra WhatsApp). Não cobre composer nem aba do CRM. */
html { --audio-mini-h: calc(48px + var(--safe-top, 0px)); }
.audio-mini {
  position: fixed; top: 0; left: var(--crm-rail-w, 0px); right: 0; z-index: 55;
  display: flex; align-items: center; gap: 8px;
  height: var(--audio-mini-h); min-height: 48px; box-sizing: border-box;
  padding: calc(6px + var(--safe-top, 0px)) 10px 6px 8px;
  background: var(--t-card-bg, #fff); color: var(--t-text, #111b21);
  border-bottom: 1px solid var(--t-border, var(--border));
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  /* Overlay: o header fica por baixo; mostrar/esconder não mexe padding das telas. */
  pointer-events: auto;
}
.audio-mini[hidden] { display: none !important; }
html.vv .audio-mini { top: var(--vv-top, 0px); }
.audio-mini-play {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--t-primary2, var(--green-dark, #075e54));
  background: transparent;
}
.audio-mini-play:active { background: rgba(0,0,0,.06); }
.audio-mini-nome {
  flex: 0 1 28%; min-width: 72px; max-width: 160px;
  border: 0; background: transparent; padding: 0; text-align: left;
  font: inherit; font-weight: 700; font-size: .9rem; color: inherit;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.audio-mini-nome:active { opacity: .75; }
.audio-mini-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.audio-mini-seek {
  position: relative; flex: 1 1 auto; height: 28px; cursor: pointer; touch-action: none;
  display: flex; align-items: center;
}
.audio-mini-seek::before {
  content: ''; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px;
  background: var(--t-wave-off, #aebac1);
}
.audio-mini-fill {
  position: absolute; left: 0; height: 4px; border-radius: 2px; width: 0%;
  background: var(--t-wave-on, #34b7f1); pointer-events: none;
}
.audio-mini-knob {
  position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--t-wave-on, #34b7f1); pointer-events: none;
}
.audio-mini-tempo {
  flex: 0 0 auto; font-size: .72rem; font-variant-numeric: tabular-nums;
  color: var(--t-muted, var(--muted)); min-width: 2.4em; text-align: right;
}
.audio-mini-vel {
  flex: 0 0 auto; min-width: 40px; height: 26px; padding: 0 8px; border-radius: 13px;
  background: var(--t-vel-bg, rgba(0,0,0,.08)); color: var(--t-vel-fg, #3b4a54);
  font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.audio-mini-fechar {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--t-muted, var(--muted));
}
.audio-mini-fechar:active { background: rgba(0,0,0,.06); }
html[data-tema="escuro"] .audio-mini {
  background: var(--t-card-bg, #1a2332); box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
html[data-tema="escuro"] .audio-mini-play:active,
html[data-tema="escuro"] .audio-mini-fechar:active { background: rgba(255,255,255,.08); }

/* ===================== v6.1: teclado do iPhone ===================== */
/* No iOS o teclado não encolhe a página (100dvh continua a tela inteira) e
   ficava por cima do campo de escrever. No celular, o JS (teclado.js) põe a
   classe "vv" e mede a área visível: o app fica fixo nela, então cabeçalho,
   lista e campo (com a barra de resposta) cabem acima do teclado. */
html.vv #screen-app { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100dvh); }
/* Overlays/modais/sheets: mesmos limites do visualViewport — teclado não cobre ações.
   Longhands (top/right/bottom/left) sobrescrevem o inset:0 dos fundos; não usar
   `inset: unset` depois, senão zera o top. */
html.vv :is(
  .fwd-fundo, .galeria-fundo, .msg-menu-fundo, #screen-admin, .viewer,
  .sheet-fundo, .crm-dialogo-fundo, .crm-gaveta-fundo, .crm-funil-sheet
) {
  top: var(--vv-top, 0px) !important;
  right: 0 !important;
  bottom: auto !important;
  left: 0 !important;
  width: 100% !important;
  height: var(--vv-h, 100dvh) !important;
  max-height: var(--vv-h, 100dvh) !important;
  overscroll-behavior: contain;
}
html.vv .sheet-card { max-height: min(92vh, calc(var(--vv-h, 100dvh) - 8px)); }
html.vv .tf-card-painel { max-height: min(88dvh, calc(var(--vv-h, 100dvh) - 8px), 720px); }
html.vv .toast { bottom: calc(var(--vv-fundo, 0px) + 90px + var(--safe-bottom)); }
/* Com teclado: ancora o modal no topo da área visível (não centra “dentro” do teclado) */
html.teclado-aberto .crm-dialogo-fundo,
html.teclado-aberto .sheet-fundo {
  align-items: flex-start;
  padding-top: 12px;
}
/* com o teclado aberto a barrinha de baixo do iPhone fica escondida: sem folga */
html.teclado-aberto { --safe-bottom: 0px; }
@media (min-width: 768px) {
  html.vv .app {
    height: min(var(--vv-h, 100dvh), 920px);
    margin-top: max(0px, calc((var(--vv-h, 100dvh) - 920px) / 2));
  }
}

/* ===================== v7: instâncias, QR, convites ===================== */
.banner-convite {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--green-light) 18%, #fff); color: var(--green-dark); font-size: 14px; line-height: 1.35;
  display: flex; flex-direction: column; gap: 4px;
}
.banner-convite[hidden] { display: none !important; }
.adm-acoes-topo { display: flex; gap: 8px; padding: 10px 16px 0; flex-wrap: wrap; }
.adm-acoes-topo .btn-mini {
  border: 0; background: var(--teal-panel); color: #fff; border-radius: 20px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.adm-acoes-topo .btn-mini.sec { background: var(--border); color: var(--text); }
.i-item .i-btns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.i-opcao { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; min-height: 44px; font-size: .85rem; cursor: pointer; }
.i-opcao input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--green-dark); flex: 0 0 auto; }
.i-opcao span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.i-opcao small { color: var(--muted); font-size: .75rem; }
.i-monitor { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.i-monitor-aviso { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.i-monitor-cli { align-items: center; min-height: 36px; }
.i-monitor-cli select {
  flex: 1 1 auto; min-width: 0; max-width: 100%;
  padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card, #fff); color: inherit; font: inherit; font-size: .82rem;
}
.i-btn.sec { background: var(--border); color: var(--text); }
.i-servidor { opacity: .95; border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 8px; }
.tag.warn { background: color-mix(in srgb, #f7c948 35%, #fff); color: #6b5a00; }
.sheet-fundo {
  position: fixed;
  top: var(--vv-top, 0px); right: 0; bottom: auto; left: 0;
  width: 100%; height: var(--vv-h, 100dvh); max-height: var(--vv-h, 100dvh);
  z-index: 50; background: rgba(11, 20, 26, .55);
  display: flex; justify-content: center; align-items: flex-end;
  overflow: hidden; overscroll-behavior: contain; box-sizing: border-box;
}
.sheet-fundo[hidden] { display: none !important; }
.sheet-card {
  background: var(--panel); width: 100%; max-width: 480px;
  max-height: min(92vh, calc(var(--vv-h, 100dvh) - 8px));
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column; overflow: hidden;
}
.sheet-body { padding: 12px 16px 24px; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.par-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.par-tabs button {
  flex: 1; border: 0; background: var(--border); color: var(--text); border-radius: 20px;
  padding: 8px; font-weight: 600; cursor: pointer;
}
.par-tabs button.on { background: var(--teal-panel); color: #fff; }
.par-status { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.par-qr-wrap {
  position: relative; width: min(260px, 70vw); aspect-ratio: 1; margin: 0 auto 12px;
  background: #fff; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.par-qr-wrap img { width: 100%; height: 100%; object-fit: contain; }
.par-qr-wrap.expirado img { filter: grayscale(1) opacity(.35); }
.par-qr-loading {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid #e6e8ea; border-top-color: var(--t-primary, var(--green-dark, #075e54));
  animation: girar-qr .8s linear infinite;
}
.par-qr-wrap:not(.carregando) .par-qr-loading { display: none; }
@keyframes girar-qr { to { transform: rotate(360deg); } }
.par-qr-fade {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(255,255,255,.55); text-align: center; padding: 12px;
}
.par-qr-fade[hidden] { display: none !important; }
.par-codigo {
  font-size: 28px; font-weight: 700; letter-spacing: .12em; text-align: center;
  padding: 16px; background: var(--panel); border-radius: 12px; margin: 12px 0;
}
.par-codigo[hidden] { display: none !important; }
#cv-url {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 1rem; line-height: 1.35; resize: none; margin-bottom: 10px;
}

/* iPhone/iPad (WebKit): garante ≥16px em campos editáveis — evita zoom ao focar.
   Não usa maximum-scale / user-scalable=no no viewport. */
@supports (-webkit-touch-callout: none) {
  .search-box input,
  .field input,
  .composer textarea,
  .preview-sheet input[type="text"],
  #search, #fwd-busca, #msg-input, #pv-caption,
  #par-nome, #par-fone, #proprio-fone, #cv-dias, #cv-url,
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  textarea,
  select {
    font-size: 16px;
  }
}
.cv-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 16px; min-height: 68px;
  border-bottom: 1px solid var(--border); background: #fff;
}
.cv-corpo { flex: 1; min-width: 0; }
.cv-item .u-nome,
.cv-item .u-email { white-space: normal; overflow: visible; text-overflow: unset; overflow-wrap: anywhere; }
.cv-item .cv-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--muted); font-size: .78rem; line-height: 1.35; margin-top: 2px; }
.cv-item .cv-meta span { white-space: nowrap; }
.cv-item .cv-marca { background: #fff4d6; color: #8a5f00; }
.cv-item .i-btn { align-self: center; }
@media (min-width: 900px) {
  .sheet-fundo { align-items: center; }
  .sheet-card { border-radius: 16px; max-height: 85vh; }
}

/* ---- Tarefas ---- */
.chat-tarefas-btn { position: relative; flex: 0 0 auto; }
.chat-tarefas-btn .badge {
  position: absolute; top: 2px; right: 0;
  min-width: 16px; height: 16px; padding: 0 4px;
  font-size: .65rem; line-height: 16px;
}
.chat-item .tf-badge {
  position: relative;
  display: inline-flex; align-items: center; gap: 3px;
  flex: 0 0 auto;
  min-height: 28px; min-width: 36px; padding: 4px 8px 4px 7px;
  border-radius: 12px;
  background: var(--t-warn-bg, #FEF3C7); color: var(--t-warn-fg, #92400E);
  font-size: .7rem; font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
/* Área de toque confortável no iPhone (~44px) sem inflar o layout da linha. */
.chat-item .tf-badge::before {
  content: '';
  position: absolute;
  inset: -10px -12px;
}
.chat-item .tf-badge.vencida {
  background: color-mix(in srgb, var(--danger, #ea4335) 16%, var(--t-card-bg, #fff));
  color: var(--danger, #ea4335);
}
.chat-item .tf-badge:active { filter: brightness(0.96); }
.chat-item .tf-badge svg { flex: 0 0 auto; pointer-events: none; }
.chat-item .tf-badge .tf-badge-n { pointer-events: none; }
#notice-tarefas-vencidas { padding: 0; }
#notice-tarefas-vencidas .notice-tf-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px; border: 0; background: transparent;
  color: inherit; font: inherit; font-weight: 700; cursor: pointer; text-align: left;
}
#notice-tarefas-vencidas .notice-tf-btn:hover { filter: brightness(0.97); }
.tf-corpo-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.tf-link {
  background: transparent; border: 0; padding: 0;
  color: #075e54; font-size: .78rem; font-weight: 600;
  cursor: pointer; text-align: left;
}
.tf-ver-msg-wrap { margin: 0; }
.tf-detalhe-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.tf-detalhe-titulo {
  margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--text);
  line-height: 1.3; word-break: break-word;
}
.tf-detalhe-status {
  display: inline-flex; align-self: flex-start;
  padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700;
  background: var(--t-warn-bg, #FEF3C7); color: var(--t-warn-fg, #92400E);
}
.tf-detalhe-status.feita {
  background: color-mix(in srgb, var(--green, #25d366) 18%, #fff);
  color: var(--green-dark, #075e54);
}
.tf-detalhe-status.vencida {
  background: color-mix(in srgb, var(--danger, #ea4335) 14%, #fff);
  color: var(--danger, #c0392b);
}
.tf-detalhe-desc {
  font-size: .95rem; line-height: 1.45; color: var(--text);
  word-break: break-word;
}
.tf-detalhe-desc:empty::before {
  content: 'Sem descrição'; color: var(--muted); font-style: italic;
}
.tf-detalhe-desc a { color: #075e54; font-weight: 600; text-decoration: underline; }
html[data-tema="escuro"] .tf-detalhe-desc a { color: #6ee7b7; }
.tf-detalhe-dl {
  margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px;
  font-size: .85rem;
}
.tf-detalhe-dl dt { color: var(--muted); font-weight: 600; }
.tf-detalhe-dl dd { margin: 0; color: var(--text); word-break: break-word; }
.tf-detalhe-subs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tf-detalhe-subs li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .9rem; color: var(--text);
}
.tf-detalhe-subs li.feita { color: var(--muted); text-decoration: line-through; }
.tf-detalhe-subs .tf-sub-mark { flex: 0 0 auto; margin-top: 2px; color: var(--muted); }
.tf-detalhe-ops {
  position: absolute; top: 52px; right: 12px; z-index: 5;
  min-width: 160px;
}
.tf-detalhe-ops .tf-ops-danger { color: var(--danger, #c0392b); }
html[data-tema="escuro"] .tf-card-painel,
html[data-tema="escuro"] .tf-global,
html[data-tema="escuro"] #screen-tarefas { background: var(--t-panel, #0B1230); }
html[data-tema="escuro"] .tf-detalhe-status.feita {
  background: color-mix(in srgb, var(--green, #25d366) 22%, var(--t-panel, #0B1230));
  color: #6ee7b7;
}
html[data-tema="escuro"] .tf-link { color: #6ee7b7; }
.tf-conc-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px; margin-top: 4px;
  border: 0; border-top: 1px solid var(--border);
  background: transparent; color: var(--muted);
  font-size: .82rem; font-weight: 600; cursor: pointer;
}
.tf-conc-chev { margin-left: 8px; }
.tf-conc-lista { border-top: 1px solid var(--border); }
#tf-painel {
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 80;
}
#tf-painel[hidden] { display: none !important; }
.tf-fundo {
  position: absolute; inset: 0; background: rgba(0,0,0,.35);
}
.tf-card-painel {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  max-height: min(88dvh, 720px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px 16px 0 0;
  padding-bottom: var(--safe-bottom);
}
#tf-painel-lista-wrap,
#tf-detalhe,
#tf-form {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
}
#tf-painel-lista-wrap[hidden],
#tf-detalhe[hidden],
#tf-form[hidden] { display: none !important; }
@media (min-width: 900px) {
  #tf-painel { align-items: center; }
  .tf-card-painel { border-radius: 16px; max-height: 85vh; }
}
.tf-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 8px; flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
}
.tf-header h2 { flex: 1; margin: 0; font-size: 1.05rem; }
.tf-lista {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}
.tf-footer {
  flex: 0 0 auto; padding: 10px 14px;
  border-top: 1px solid var(--border);
}
/* No formulário: rodapé rola com o conteúdo (último item), não fica fixo acima do teclado. */
.tf-footer-form {
  display: flex; gap: 8px;
  margin: 4px -14px 0; padding: 12px 14px 4px;
  border-top: 1px solid var(--border);
  background: transparent;
}
.tf-btn-pri, .tf-btn-danger {
  flex: 1; padding: 12px; border-radius: 10px; font-weight: 600;
  border: 0;
}
.tf-btn-pri { background: var(--green, #25d366); color: #fff; }
.tf-btn-danger { background: #fdecea; color: #8a1c12; }
.tf-empty, .tf-hint { margin: 24px 16px; color: var(--muted); text-align: center; font-size: .9rem; }
.tf-card {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.tf-card.feita .tf-titulo { text-decoration: line-through; color: var(--muted); }
.tf-check { flex: 0 0 auto; padding-top: 2px; }
.tf-corpo {
  flex: 1; min-width: 0; text-align: left;
  background: transparent; border: 0; color: inherit; padding: 0;
}
.tf-titulo { font-weight: 600; font-size: .95rem; }
.tf-meta {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  margin-top: 4px; font-size: .75rem; color: var(--muted);
}
.tf-lem.vencido { color: #c0392b; font-weight: 600; }
.tf-more { flex: 0 0 auto; }
.tf-form-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 12px 14px calc(16px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
html.teclado-aberto .tf-form-body { padding-bottom: 24px; }
.tf-field {
  display: flex; flex-direction: column; gap: 4px;
  font-size: .8rem; color: var(--muted); font-weight: 600;
}
.tf-field input, .tf-field textarea, .tf-field select {
  font-weight: 400; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 1rem; background: #fff;
}
.tf-hint-inline { font-weight: 400; opacity: .8; }
/* Só visual quando vazio: o datetime-local nativo continua clicável por cima. */
.tf-lembrete-wrap { position: relative; display: block; }
.tf-lembrete-wrap input[type="datetime-local"] { position: relative; z-index: 2; width: 100%; box-sizing: border-box; }
.tf-lembrete-wrap[data-vazio] input[type="datetime-local"] {
  color: transparent; caret-color: transparent;
  background: transparent; border-color: transparent;
}
.tf-lembrete-wrap[data-vazio] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.tf-lembrete-fake {
  position: absolute; inset: 0; z-index: 1;
  display: none; align-items: center; gap: 8px; pointer-events: none;
  padding: 0 12px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); font: inherit; font-size: 1rem; font-weight: 400;
}
.tf-lembrete-wrap[data-vazio] .tf-lembrete-fake { display: flex; }
.tf-lembrete-fake svg { flex: 0 0 auto; color: var(--t-primary, var(--green-dark, #075e54)); }
html[data-tema="escuro"] .tf-lembrete-fake {
  background: var(--t-input-bg, var(--t-panel, #0B1230));
  border-color: var(--t-border, #2a3555);
  color: var(--t-muted, #9aa6bd);
}
.tf-subs-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; font-weight: 600; color: var(--muted);
}
.tf-subs-head button {
  background: transparent; border: 0; color: var(--green, #075e54);
  font-weight: 600; font-size: .85rem;
}
.tf-sub-row {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.tf-sub-row input[type="text"] {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 1rem;
}
.tf-global {
  display: flex; flex-direction: column;
  height: 100%; max-width: 720px; margin: 0 auto; background: #fff;
}
.tf-filtros {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px;
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
  -webkit-overflow-scrolling: touch;
}
.tf-filtro {
  flex: 0 0 auto; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-size: .82rem; font-weight: 600; color: var(--muted);
}
.tf-filtro.on {
  background: #e7f6f3; color: #075e54; border-color: #cbe9e2;
}
.tf-global-lista { flex: 1; overflow-y: auto; }
#screen-tarefas {
  position: fixed; inset: 0; z-index: 40;
  background: #fff; padding-top: var(--safe-top);
}

/* Busca no conteúdo das mensagens */
.busca-trecho mark,
.bubble .text mark.busca-hit {
  background: #f6e05e;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
html[data-tema="escuro"] .busca-trecho mark,
html[data-tema="escuro"] .bubble .text mark.busca-hit {
  background: #c9a227;
  color: #0B1230;
}
.row.msg-destaque > .bubble {
  /* border (não outline): outline some em alguns Chromium headless / com transform. */
  border: 2px solid #f6e05e !important;
  box-shadow: 0 0 0 4px rgba(246, 224, 94, .45) !important;
  transition: border-color .3s ease, box-shadow .3s ease;
}
html[data-tema="escuro"] .row.msg-destaque > .bubble {
  border-color: #c9a227 !important;
  box-shadow: 0 0 0 4px rgba(201, 162, 39, .45) !important;
}

/* Peças que só existem no app WeAds CRM (a mesma página com a casca do CRM). */
html:not(.app-crm) .so-crm { display: none !important; }
