:root {
  --blue: #0084ff;
  --blue-deep: #006dd9;
  --purple: #a033ff;
  --pink: #ff6fa5;
  --grad: linear-gradient(135deg, #00c6ff 0%, #0084ff 55%, #a033ff 100%);
  --bg: #ffffff;
  --bg-alt: #f5f6f7;
  --text: #050505;
  --text-dim: #65676b;
  --border: #e9eaec;
  --online: #31a24c;
  --ai-badge: #6b4eff;
  --shadow-sm: 0 1px 3px rgba(15, 15, 20, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 15, 20, 0.08);
  --shadow-lift: 0 10px 28px rgba(80, 30, 150, 0.12);
  --bubble-them: #ffffff;
  --bubble-me-from: #12a1ff;
  --bubble-me-to: #7a4dff;
}

* { box-sizing: border-box; }

.icon {
  display: inline-block;
  vertical-align: -3px;
  flex-shrink: 0;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.phone {
  max-width: 420px;
  height: 100%;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* ---------- Top bar (list page) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
}

.topbar h1 {
  font-size: 27px;
  margin: 0;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.topbar .icons { display: flex; gap: 14px; font-size: 20px; }

.disclosure-banner {
  margin: 0 16px 12px;
  background: linear-gradient(135deg, #f3edff, #ede7ff);
  border: 1px solid #e1d3ff;
  color: #4b2fb3;
  font-size: 12.5px;
  padding: 10px 13px;
  border-radius: 14px;
  line-height: 1.45;
}

/* ---------- Stories / online row ---------- */
.stories {
  display: flex;
  gap: 10px;
  padding: 4px 16px 16px;
  overflow-x: auto;
}

.story {
  flex: 0 0 auto;
  width: 70px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.story:hover { transform: translateY(-2px); }

.story .avatar-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  padding: 2.5px;
  background: var(--grad);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.story img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #fff;
  display: block;
}

.story .dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: var(--online);
  border: 2.5px solid #fff;
  border-radius: 50%;
}

.story .ai-tag {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--ai-badge);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(107, 78, 255, 0.4);
}

.story span {
  display: block;
  font-size: 11.5px;
  margin-top: 6px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Native ad card in feed ---------- */
.ad-card {
  margin: 6px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-alt);
  box-shadow: var(--shadow-sm);
}

.ad-card .ad-banner {
  height: 90px;
  background: linear-gradient(135deg, #ffd76a, #ff9a6a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5b3a00;
  font-weight: 700;
  font-size: 14px;
}

.ad-card .ad-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 13px;
  font-size: 12px;
  color: var(--text-dim);
}

.ad-card .ad-meta .tag {
  background: #e4e6eb;
  border-radius: 6px;
  padding: 2px 7px;
  font-weight: 600;
}

/* ---------- Conversation list ---------- */
.convo-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.paywall-banner {
  margin: 14px 16px 22px;
  background: var(--grad);
  color: #fff;
  text-align: center;
  font-size: 13.5px;
  font-weight: 500;
  padding: 15px 16px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-lift);
  transition: transform 0.15s ease;
}

.paywall-banner:hover { transform: translateY(-1px); }

.convo {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}

.convo:last-child { border-bottom: none; }

.convo:hover { background: var(--bg-alt); }

.convo .avatar-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
}

.convo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.convo .dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: var(--online);
  border: 2.5px solid #fff;
  border-radius: 50%;
}

.convo .body { flex: 1; min-width: 0; }

.convo .name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 16px;
}

.ai-pill {
  background: var(--ai-badge);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

.convo .preview {
  color: var(--text-dim);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 6px;
}

.convo .time {
  font-size: 11px;
  color: var(--text-dim);
  align-self: flex-start;
  margin-top: 2px;
}

/* ---------- Chat page ---------- */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 5;
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}

.chat-header .back {
  color: var(--blue);
  text-decoration: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-alt);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-header .back:hover {
  background: #e8f0ff;
  box-shadow: 0 2px 8px rgba(0,132,255,0.18);
  transform: scale(1.08);
}

.chat-header .back:active {
  transform: scale(0.93);
  box-shadow: none;
}

.chat-header img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.chat-header .info { flex: 1; min-width: 0; }

.chat-header .name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.1px;
}

.chat-header .status {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 5px;  /* ← adiciona ou aumenta esse valor */
}

.chat-disclosure {
  margin: 12px 16px;
  background: linear-gradient(135deg, #f3edff, #ede7ff);
  border: 1px solid #e1d3ff;
  color: #4b2fb3;
  font-size: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  text-align: center;
  line-height: 1.45;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 78%;
  animation: rise 0.18s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-row.them { align-self: flex-start; }
.msg-row.me { align-self: flex-end; flex-direction: row-reverse; }

.msg-row img.mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.bubble {
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.msg-row.them .bubble {
  background: var(--bubble-them);
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.msg-row.me .bubble {
  background: linear-gradient(135deg, var(--bubble-me-from), var(--blue) 60%, var(--bubble-me-to));
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 132, 255, 0.28);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 11px 15px;
  background: var(--bubble-them);
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  width: fit-content;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

/* ── Anúncios reais (AdSense, MGID, etc.) ─────────────────────────── */

/* Reset: remove estilos decorativos do slot demo */
.ad-real {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  padding: 0 !important;
  position: relative;
}
.ad-real ins  { display: block !important; width: 100% !important; }
.ad-real iframe { display: block; width: 100%; }

/* Banner fixo (rodapé do chat) */
#fixedAd.ad-real {
  flex: 0 0 auto !important;
  width: 100% !important;
  min-height: 60px !important;
  background: #f0f0f0 !important;
  border-top: 1px solid var(--border) !important;
  border-bottom: none !important;
  border-left: none !important;
  border-right: none !important;
  display: block !important;
  overflow: hidden !important;
}
#fixedAd.ad-real ins  { min-height: 60px; width: 100%; }

/* Banner inline (entre mensagens) */
.ad-inline.ad-real {
  width: 100% !important;
  min-height: 100px !important;
  background: #f0f0f0 !important;
  border-top: 1px dashed var(--border) !important;
  border-bottom: 1px dashed var(--border) !important;
  border-left: none !important;
  border-right: none !important;
  border-radius: 0 !important;
  margin: 6px 0;
  overflow: hidden !important;
}
.ad-inline.ad-real ins { min-height: 100px; }

/* in-stream ad bubble */
.ad-inline {
  align-self: center;
  width: 100%;
  max-width: 100%;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.ad-inline .ad-banner {
  height: 74px;
  background: linear-gradient(135deg, #6ae3ff, #6a8fff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06305b;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  padding: 0 10px;
}

.ad-inline .ad-meta {
  display: flex;
  justify-content: space-between;
  padding: 7px 11px;
  font-size: 11px;
  color: var(--text-dim);
}

.quick-replies {
  display: none;
}

.inline-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px 31px;
  align-self: flex-start;
  animation: rise 0.18s ease;
}

.quick-reply-btn {
  background: #fff;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
  box-shadow: var(--shadow-sm);
}

.quick-reply-btn:hover {
  background: var(--blue);
  color: #fff;
  transform: translateY(-1px);
}

.quick-reply-btn:active { transform: translateY(0) scale(0.97); }

.composer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  flex: 0 0 auto;
  background: var(--bg);
  box-shadow: 0 -1px 0 var(--border);
}

/* botão lateral (+ ou lixeira) */
.composer-side {
  color: var(--text-dim);
  flex-shrink: 0;
}
.composer-side:hover { color: var(--blue); }

.rec-cancel { color: #e0245e !important; }

/* pílula central (estilo WA) */
.composer-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 0 6px 0 2px;
  min-height: 46px;
  transition: border-color 0.15s;
}

.composer-pill:focus-within {
  border-color: #c0c8d8;
}

.emoji-btn {
  color: var(--text-dim);
  flex-shrink: 0;
  width: 38px;
  height: 38px;
}
.emoji-btn:hover { color: var(--blue); background: transparent; }

.composer-pill input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 4px;
  font-size: 15px;
  outline: none;
  color: var(--text);
  min-width: 0;
}

.composer-pill input[type="text"]::placeholder {
  color: var(--text-dim);
}

/* Barra de gravação dentro da pílula */
[hidden] { display: none !important; }

.recording-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 4px;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e0245e;
  flex-shrink: 0;
  animation: rec-blink 1s infinite;
}

@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.rec-timer {
  font-size: 13px;
  font-weight: 600;
  color: #e0245e;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.rec-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  height: 24px;
}

.rec-waves span {
  display: inline-block;
  width: 3px;
  border-radius: 2px;
  background: #e0245e;
  animation: rec-wave 0.55s ease-in-out infinite alternate;
}

.rec-waves span:nth-child(1)  { height: 5px;  animation-delay: 0.00s; }
.rec-waves span:nth-child(2)  { height: 14px; animation-delay: 0.10s; }
.rec-waves span:nth-child(3)  { height: 20px; animation-delay: 0.20s; }
.rec-waves span:nth-child(4)  { height: 10px; animation-delay: 0.05s; }
.rec-waves span:nth-child(5)  { height: 18px; animation-delay: 0.15s; }
.rec-waves span:nth-child(6)  { height: 8px;  animation-delay: 0.25s; }
.rec-waves span:nth-child(7)  { height: 16px; animation-delay: 0.08s; }
.rec-waves span:nth-child(8)  { height: 12px; animation-delay: 0.18s; }
.rec-waves span:nth-child(9)  { height: 19px; animation-delay: 0.12s; }
.rec-waves span:nth-child(10) { height: 6px;  animation-delay: 0.22s; }

@keyframes rec-wave {
  from { transform: scaleY(0.35); opacity: 0.5; }
  to   { transform: scaleY(1);    opacity: 1; }
}

.rec-pause {
  color: #e0245e;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
}
.rec-pause:hover { background: #ffe0e8; }

.composer button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.composer button:disabled {
  color: var(--text-dim);
  cursor: default;
}

.icon-btn {
  font-size: 19px;
  flex: 0 0 auto;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, transform 0.12s ease;
}

.icon-btn:hover { background: var(--bg-alt); transform: scale(1.05); }

.icon-btn.recording {
  background: #ffe0e0;
  color: #e0245e;
  animation: pulse-rec 1s infinite;
}

@keyframes pulse-rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 36, 94, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(224, 36, 94, 0); }
}


.send-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad) !important;
  color: #fff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  box-shadow: 0 3px 10px rgba(160, 51, 255, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(160, 51, 255, 0.5); }
.send-btn:active { transform: scale(0.92); }

.send-btn--mic {
  background: var(--bg-alt) !important;
  color: var(--text-dim) !important;
  box-shadow: none !important;
}

.send-btn--mic:hover {
  background: #e8f0ff !important;
  color: var(--blue) !important;
  box-shadow: none !important;
}

.send-btn.recording {
  background: #ffe0e0 !important;
  color: #e0245e !important;
  animation: pulse-rec 1s infinite;
  box-shadow: none !important;
}

.bubble-media {
  padding: 4px !important;
  background: transparent !important;
  overflow: hidden;
  box-shadow: none !important;
}

.bubble-image {
  display: block;
  max-width: 220px;
  max-height: 260px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.audio-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  min-width: 200px;
  max-width: 260px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.audio-bubble-me {
  background: linear-gradient(135deg, #12a1ff, var(--blue) 60%, #7a4dff);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 6px;
}

.audio-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,132,255,0.3);
}

.audio-bubble-me .audio-play-btn {
  background: rgba(255,255,255,0.25);
  box-shadow: none;
}

.audio-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 28px;
}

.audio-bar {
  display: inline-block;
  width: 3px;
  border-radius: 2px;
  background: rgba(100,80,200,0.25);
}

.audio-bubble-me .audio-bar {
  background: rgba(255,255,255,0.45);
}

.audio-bubble.playing .audio-bar {
  animation: bar-pulse 0.7s ease-in-out infinite alternate;
}

@keyframes bar-pulse {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}

.audio-duration {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.audio-bubble-me .audio-duration {
  color: rgba(255,255,255,0.8);
}

.carousel-track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  max-width: 240px;
  border-radius: 16px;
}

.carousel-img {
  width: 200px;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.bubble-doc {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
}

.bubble-contact {
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---- Ad Gate (interstitial popup) ---- */
.ad-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  animation: ad-gate-in 0.18s ease;
}
.ad-gate-overlay[hidden] { display: none; }

@keyframes ad-gate-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ad-gate-box {
  background: #fff;
  border-radius: 18px;
  padding: 10px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ad-gate-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.ad-gate-content {
  min-height: 80px;
  width: 100%;
  overflow: hidden;
}

.ad-gate-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.ad-gate-wait-text {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.ad-gate-timer {
  font-size: 13px;
  color: var(--text-dim);
}

.ad-gate-btn {
  padding: 10px 22px;
  border-radius: 22px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(160,51,255,0.35);
  transition: transform 0.12s ease;
}
.ad-gate-btn:hover { transform: scale(1.03); }
.ad-gate-btn:active { transform: scale(0.97); }
.ad-gate-btn[hidden] { display: none; }

/* fixed bottom banner ad */
.fixed-ad {
  flex: 0 0 auto;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-dim);
}

.fixed-ad .label {
  font-weight: 700;
  background: #f0e2a3;
  border-radius: 5px;
  padding: 1px 5px;
  margin-right: 6px;
}


