/* ===================================================
   NexBot — WhatsApp Section Styles
   =================================================== */

/* ── Header ── */
.nexbot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.nexbot-header-left { display: flex; flex-direction: column; }
.nexbot-title-row   { display: flex; align-items: center; gap: .65rem; }

.nexbot-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--warning-bg-strong), var(--warning-border));
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: var(--font-size-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Layout grid ── */
.wa-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

/* ── Benefits panel ── */
.wa-benefits-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Hero Banner ── */
.wa-hero-banner {
  background: linear-gradient(135deg, #071a0f 0%, #0a3d26 60%, #0d4f32 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.8rem;
  position: relative;
  overflow: hidden;
  color: white;
}
.wa-hero-banner::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(37,211,102,.15) 0%, transparent 65%);
  pointer-events: none;
}
.wa-hero-banner::after {
  content: '';
  position: absolute;
  bottom: -50px; left: -30px;
  width: 220px; height: 160px;
  background: radial-gradient(ellipse, rgba(18,140,126,.1) 0%, transparent 70%);
  pointer-events: none;
}
.wa-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37,211,102,.13);
  border: 1px solid rgba(37,211,102,.3);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: var(--font-size-2xs);
  font-weight: 600;
  color: var(--success-color);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
}
.wa-hero-tag-dot {
  width: 6px; height: 6px;
  background: var(--success-color);
  border-radius: 50%;
  animation: wa-pulse 1.5s ease infinite;
}
.wa-hero-banner h3 {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: .65rem;
  position: relative;
  z-index: 1;
}
.wa-hero-banner h3 span { color: var(--success-color); }
.wa-hero-banner > p {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,.6);
  line-height: 1.7;
  max-width: 500px;
  position: relative;
  z-index: 1;
}
.wa-hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  position: relative;
  z-index: 1;
}
.wa-hero-stat { display: flex; flex-direction: column; }
.wa-hero-stat-num   { font-size: var(--font-size-2xl); font-weight: 800; color: var(--white); line-height: 1; }
.wa-hero-stat-label { font-size: var(--font-size-2xs); color: rgba(255,255,255,.45); margin-top: 3px; }

/* ── Capabilities ── */
.wa-capabilities {
  background: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
}
.wa-section-label {
  font-size: var(--font-size-2xs);
  font-weight: 700;
  color: var(--muted-text-color);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.1rem;
}
.wa-cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
.wa-cap-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.wa-cap-icon {
  width: 36px;
  height: 36px;
  background: var(--ci-bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-md);
  flex-shrink: 0;
  transition: transform .2s;
}
.wa-cap-item:hover .wa-cap-icon { transform: scale(1.1) rotate(-4deg); }
.wa-cap-item > div > strong {
  display: block;
  font-size: var(--font-size-compact);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 2px;
}
.wa-cap-item > div > span {
  font-size: var(--font-size-xs);
  color: var(--subtitle-color);
  line-height: 1.5;
}

/* ── How it works ── */
.wa-how {
  background: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
}
.wa-steps {
  display: flex;
  position: relative;
  gap: 0;
}
.wa-steps::before {
  content: '';
  position: absolute;
  top: 17px; left: 18px; right: 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--whatsapp-color), var(--whatsapp-dark));
  opacity: .2;
}
.wa-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .4rem;
  padding: 0 .35rem;
}
.wa-step-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--whatsapp-dark), var(--whatsapp-color));
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37,211,102,.3);
}
.wa-step span {
  font-size: var(--font-size-2xs);
  color: var(--subtitle-color);
  line-height: 1.45;
}

/* ── Plan notice ── */
.wa-plan-notice {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  background: linear-gradient(135deg, var(--warning-bg), var(--warning-bg));
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
}
.wa-plan-notice-icon {
  font-size: var(--font-size-xl);
  flex-shrink: 0;
  margin-top: 1px;
}
.wa-plan-notice strong {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--warning-text);
  margin-bottom: .3rem;
}
.wa-plan-notice p {
  font-size: var(--font-size-xs);
  color: var(--warning-text);
  line-height: 1.6;
  margin: 0;
}

/* ── Connection widget ── */
.wa-card {
  background: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 60px;
}

.wa-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: .85rem;
}
.wa-brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--whatsapp-dark), var(--whatsapp-color));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-brand-name {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  line-height: 1.2;
}
.wa-brand-sub {
  font-size: var(--font-size-2xs);
  color: var(--subtitle-color);
}
.wa-divider {
  height: 1px;
  background: var(--border-color);
  margin-bottom: 1rem;
}

/* Status pill */
.wa-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-2xs);
  font-weight: 600;
  margin-bottom: .85rem;
  transition: all .3s;
}
.wa-pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.wa-pill.idle       { background: var(--surface-hover); color: var(--slate-500); }
.wa-pill.idle       .wa-pill-dot { background: var(--muted-text-color); }
.wa-pill.checking   { background: var(--info-bg); color: var(--info-color); }
.wa-pill.checking   .wa-pill-dot { background: var(--blue-500); animation: wa-pulse 1s infinite; }
.wa-pill.connecting { background: var(--info-bg); color: var(--info-color); }
.wa-pill.connecting .wa-pill-dot { background: var(--blue-500); animation: wa-pulse 1s infinite; }
.wa-pill.qr         { background: var(--info-bg); color: var(--info-color); }
.wa-pill.qr         .wa-pill-dot { background: var(--info-color); animation: wa-pulse 1.2s infinite; }
.wa-pill.ready      { background: var(--success-bg); color: var(--success-strong); }
.wa-pill.ready      .wa-pill-dot { background: var(--success-color); }
.wa-pill.error      { background: var(--danger-bg-subtle); color: var(--danger-strong); }
.wa-pill.error      .wa-pill-dot { background: var(--danger-strong); }

@keyframes wa-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.65); }
}

/* Area */
.wa-area {
  background: var(--bg-color, var(--surface-muted));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.6rem 1.1rem;
  margin-bottom: .85rem;
  text-align: center;
}
.wa-area h4 { font-size: var(--font-size-sm); font-weight: 700; margin-bottom: .35rem; color: var(--text-color); }
.wa-area p  { font-size: var(--font-size-xs); color: var(--subtitle-color); line-height: 1.6; max-width: 210px; }

.wa-idle-icon {
  width: 52px; height: 52px;
  background: var(--success-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--whatsapp-color);
  margin-bottom: .85rem;
  opacity: .8;
}

.wa-spinner {
  width: 34px; height: 34px;
  border: 2.5px solid var(--border-color);
  border-top-color: var(--whatsapp-color);
  border-radius: 50%;
  animation: wa-spin .7s linear infinite;
  margin-bottom: .85rem;
}
@keyframes wa-spin { to { transform: rotate(360deg); } }

.wa-qr-frame {
  padding: 7px;
  background: var(--white);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: var(--shadow-hover);
}
.wa-qr-frame img { width: 145px; height: 145px; display: block; border-radius: 3px; }
.wa-qr-hint { font-size: var(--font-size-2xs) !important; color: var(--subtitle-color) !important; }

.wa-check {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--whatsapp-dark), var(--whatsapp-color));
  display: flex; align-items: center; justify-content: center;
  animation: wa-pop .4s cubic-bezier(.175,.885,.32,1.275) both;
  margin-bottom: .65rem;
}
@keyframes wa-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.wa-ready-title { color: var(--success-strong) !important; }

.wa-stats-live {
  margin-top: .5rem;
  display: flex;
  justify-content: center;
}
.wa-stat-live {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: var(--font-size-2xs);
  font-weight: 600;
  color: var(--success-strong);
}
.wa-live-dot {
  width: 6px; height: 6px;
  background: var(--success-color);
  border-radius: 50%;
  animation: wa-pulse 1.5s ease infinite;
}

.wa-error-icon { font-size: 2rem; margin-bottom: .5rem; }

/* Buttons */
.wa-btn {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.wa-btn-primary {
  background: linear-gradient(135deg, var(--whatsapp-dark), var(--whatsapp-color));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(37,211,102,.22);
}
.wa-btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(37,211,102,.35); }
.wa-btn-danger  { background: var(--danger-bg-subtle); color: var(--danger-strong); border: 1px solid var(--danger-border); }
.wa-btn-danger:hover:not(:disabled)  { background: var(--danger-bg); }
.wa-btn-ghost   { background: var(--bg-color); color: var(--subtitle-color); border: 1px solid var(--border-color); }
.wa-btn-secondary {
  background: var(--bg-color, var(--surface-muted));
  color: var(--subtitle-color, var(--slate-500));
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
}
.wa-btn-secondary:hover:not(:disabled) { background: var(--border-color); }
.wa-btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* Token warning */
.wa-token-warn {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: var(--font-size-2xs);
  color: var(--warning-text);
  margin-bottom: .85rem;
  display: none;
}
.wa-token-warn.show { display: block; }

/* Security tag */
.wa-security {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: .75rem;
  font-size: var(--font-size-2xs);
  color: var(--muted-text-color);
  justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
  .wa-grid { grid-template-columns: 1fr; }
  .wa-card { position: static; }
  /* Uma coluna: o status do bot ("está funcionando?") vem antes dos ajustes */
  #wa-connect-widget, #wa-connect-upsell { order: -1; }
}
@media (max-width: 680px) {
  .wa-cap-grid { grid-template-columns: 1fr; }
  .wa-hero-stats { gap: 1.4rem; }
  .wa-steps { flex-direction: column; gap: .7rem; }
  .wa-steps::before { display: none; }
  .nexbot-title-row { flex-wrap: wrap; }
}

.wa-help-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: .75rem;
  font-size: var(--font-size-xs);
  color: #6b8a72;
  text-decoration: none;
  transition: color .2s;
}
.wa-help-link:hover { color: var(--whatsapp-color); }

/* ── Config panel (estado conectado) ──────────────────────── */
/* Config carregando: controles travados e em esqueleto (kit: styles.css) */
#wa-config.is-loading-config { pointer-events: none; }
#wa-config.is-loading-config .wac-switch { position: relative; }
#wa-config.is-loading-config .wac-switch > * { visibility: hidden; }
#wa-config.is-loading-config .wac-switch::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--border-color);
  animation: nf-skeleton-pulse 1.2s ease-in-out infinite;
}
#wa-config.is-loading-config :is(input:not([type="checkbox"]), textarea, select) {
  color: transparent !important;
  background: var(--border-color) !important;
  animation: nf-skeleton-pulse 1.2s ease-in-out infinite;
}
/* Falha ao carregar: mantém bloqueado (evita salvar padrões sobre a config real) */
#wa-config.is-config-bloqueada > :not(#wac-config-erro) { opacity: .45; pointer-events: none; }

#wa-config {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wac-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .25rem;
}
.wac-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0 0 .25rem;
}
.wac-header p {
  font-size: var(--font-size-sm);
  color: var(--muted-text-color, var(--slate-500));
  margin: 0;
}

.wac-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--card-bg, var(--white));
  transition: border-color .2s, box-shadow .2s;
}
.wac-toggle-card:has(input:checked) {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(var(--success-rgb), .08);
}

.wac-toggle-info {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  flex: 1;
}
.wac-toggle-icon {
  font-size: var(--font-size-2xl);
  line-height: 1;
  margin-top: 2px;
}
.wac-toggle-info strong {
  display: block;
  font-size: var(--font-size-sm);
  margin-bottom: .2rem;
}
.wac-toggle-info span {
  font-size: var(--font-size-xs);
  color: var(--muted-text-color, var(--slate-500));
  line-height: 1.4;
}

/* Switch grande */
.wac-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.wac-switch input { opacity: 0; width: 0; height: 0; }
.wac-switch-slider {
  position: absolute;
  inset: 0;
  background: var(--slate-300);
  border-radius: 28px;
  transition: background .2s;
}
.wac-switch-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 4px;
  top: 4px;
  background: var(--white);
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: var(--shadow-sm);
}
.wac-switch input:checked + .wac-switch-slider { background: var(--success-color); }
.wac-switch input:checked + .wac-switch-slider::before { transform: translateX(20px); }

.wac-save-hint {
  font-size: var(--font-size-xs);
  color: var(--success-color);
  font-weight: 600;
  min-height: 1rem;
  margin: 0;
  transition: opacity .3s;
}

.wac-tip {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .75rem 1rem;
  background: var(--hover-bg, var(--surface-muted));
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  color: var(--muted-text-color, var(--slate-500));
  line-height: 1.4;
  margin-top: auto;
}

/* ── Controle granular de respostas ──────────────────────── */
.wac-respostas-wrap {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem 1.1rem;
  background: var(--card-bg, var(--white));
  transition: opacity .2s;
}
.wac-respostas-wrap.disabled {
  opacity: .4;
  pointer-events: none;
}
.wac-respostas-label-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: .85rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border-color);
}
.wac-respostas-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-color);
}
.wac-respostas-sub {
  font-size: var(--font-size-xs);
  color: var(--muted-text-color, var(--slate-500));
}
.wac-respostas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem .5rem;
}
.wac-resp-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  padding: .45rem .6rem;
  border-radius: var(--radius-sm);
  transition: background .15s;
  user-select: none;
}
.wac-resp-item:hover { background: var(--hover-bg, var(--surface-muted)); }
.wac-resp-emo  { font-size: var(--font-size-sm); flex-shrink: 0; }
.wac-resp-label {
  font-size: var(--font-size-xs);
  flex: 1;
  color: var(--text-color);
  line-height: 1.2;
}

/* Switch compacto */
.wac-switch-sm {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.wac-switch-sm input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.wac-sm-slider {
  position: absolute;
  inset: 0;
  background: var(--slate-300);
  border-radius: var(--radius-xl);
  transition: background .2s;
  cursor: pointer;
}
.wac-sm-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: var(--shadow-sm);
}
.wac-switch-sm input:checked + .wac-sm-slider { background: var(--success-color); }
.wac-switch-sm input:checked + .wac-sm-slider::before { transform: translateX(16px); }

/* ─────────────────────────────────────────────────────────────────────────────
   NEXBOT HELP — Sistema de ajuda contextual
   Usa exclusivamente variáveis do design system do painel
───────────────────────────────────────────────────────────────────────────── */

/* ── Botão "?" ─────────────────────────────────────────────────────────────── */

.nxh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  background: transparent;
  color: var(--muted-text-color);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  padding: 0;
  flex-shrink: 0;
  vertical-align: middle;
}

.nxh-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--highlight-bg-color);
  transform: scale(1.1);
}

.nxh-btn-sm {
  width: 16px;
  height: 16px;
  border-width: 1px;
  margin-right: 2px;
}

/* ── Overlay ───────────────────────────────────────────────────────────────── */

#nxh-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#nxh-overlay.show { display: flex; }
#nxh-overlay.visible .nxh-modal { transform: translateY(0); opacity: 1; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */

.nxh-modal {
  position: relative;
  background: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(12px);
  opacity: 0;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
  font-family: var(--font-family);
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.nxh-modal::-webkit-scrollbar       { width: 4px; }
.nxh-modal::-webkit-scrollbar-track { background: transparent; }
.nxh-modal::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: var(--radius-xs); }

/* ── Fechar ────────────────────────────────────────────────────────────────── */

.nxh-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--muted-text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  padding: 0;
}

.nxh-close:hover {
  background: var(--bg-color);
  color: var(--text-color);
  border-color: var(--muted-text-color);
}

/* ── Header ────────────────────────────────────────────────────────────────── */

.nxh-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-right: 28px;
}

.nxh-emoji {
  font-size: var(--font-size-2xl);
  line-height: 1;
  flex-shrink: 0;
}

.nxh-titulo {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  line-height: 1.3;
}

/* ── Descrição ─────────────────────────────────────────────────────────────── */

.nxh-desc {
  font-size: var(--font-size-compact);
  color: var(--subtitle-color);
  line-height: 1.6;
  margin: 0 0 16px;
}

/* ── Exemplo WhatsApp ──────────────────────────────────────────────────────── */

.nxh-exemplo-wrap { margin-bottom: 14px; }

.nxh-exemplo-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-2xs);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted-text-color);
  margin-bottom: 8px;
}

/* Cores internas do bubble são fixas — identidade visual do WhatsApp */
.nxh-bubble-wrap {
  background: #0b1014;
  border-radius: calc(var(--radius) * 0.75);
  padding: 12px 12px 10px;
  position: relative;
  overflow: hidden;
}

.nxh-bubble-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.015) 1px, transparent 1px),
    radial-gradient(circle at 80% 60%, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.nxh-bubble {
  position: relative;
  background: #005c4b;
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 2px;
  padding: 8px 12px 6px;
  font-size: var(--font-size-compact);
  line-height: 1.5;
  color: #e9edef;
  display: inline-block;
  max-width: 92%;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}

.nxh-bubble strong { color: var(--white); font-weight: 600; }
.nxh-bubble em     { font-style: italic; opacity: .85; }

.nxh-bubble-time {
  display: block;
  text-align: right;
  font-size: var(--font-size-2xs);
  color: rgba(233, 237, 239, .6);
  margin-top: 5px;
  padding-right: 2px;
}

/* ── Detalhe (ℹ️) ──────────────────────────────────────────────────────────── */

.nxh-detalhe {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: var(--font-size-xs);
  color: var(--subtitle-color);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--radius) * 0.67);
  padding: 9px 11px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.nxh-detalhe svg { color: var(--primary-color); margin-top: 1px; flex-shrink: 0; }

/* ── Se desativado ─────────────────────────────────────────────────────────── */

.nxh-off {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: var(--font-size-xs);
  color: var(--subtitle-color);
  background: var(--highlight-bg-color);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--radius) * 0.67);
  padding: 9px 11px;
  line-height: 1.5;
}

.nxh-off svg    { color: var(--danger-color); flex-shrink: 0; }
.nxh-off strong { color: var(--danger-color); }

/* ── Responsivo mobile — bottom sheet ─────────────────────────────────────── */

@media (max-width: 480px) {
  #nxh-overlay { align-items: flex-end; padding: 0; }

  .nxh-modal {
    border-radius: var(--radius) var(--radius) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    max-height: 85vh;
    border-bottom: none;
    transform: translateY(100%);
  }

  #nxh-overlay.visible .nxh-modal { transform: translateY(0); }
}

/* ── Ajuste layout respostas granulares ────────────────────────────────────── */

.wac-resp-item                  { display: flex; align-items: center; gap: 6px; }
.wac-resp-item .wac-resp-label  { flex: 1; min-width: 0; }
.wac-resp-item .nxh-btn-sm      { margin-left: auto; margin-right: 4px; }
.wac-resp-item .wac-switch-sm   { margin-left: 0; flex-shrink: 0; }

/* ── Automações do gestor ────────────────────────────────────────────────── */

.wac-automation-card {
  margin-top: 1.5rem;
  padding: 1.4rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--card-bg-color, var(--white));
  box-shadow: var(--shadow-sm);
}

.wac-automation-header,
.wac-automation-feature-main,
.wac-automation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wac-automation-header {
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-color);
}

.wac-automation-kicker {
  display: block;
  color: #0d9488;
  font-size: var(--font-size-2xs);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .2rem;
}

.wac-automation-header h3 {
  margin: 0;
  color: var(--text-color);
  font-size: var(--font-size-lg);
  font-weight: 800;
}

.wac-automation-header p,
.wac-automation-feature span,
.wac-automation-destination span {
  margin: .2rem 0 0;
  color: var(--muted-text-color);
  font-size: var(--font-size-compact);
}

#wac-automacoes-body {
  transition: opacity .2s ease;
}

.wac-automation-destination {
  display: grid;
  grid-template-columns: minmax(210px, .75fr) minmax(230px, 1fr);
  align-items: center;
  gap: .45rem 1rem;
  padding: 1rem 0;
}

.wac-automation-destination label {
  color: var(--text-color);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.wac-automation-destination input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: .68rem .75rem;
  color: var(--text-color);
  background: var(--input-bg-color, var(--card-bg-color, var(--white)));
  outline: none;
}

.wac-automation-destination input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .12);
}

.wac-automation-destination input.is-invalid {
  border-color: var(--danger-strong);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
}

.wac-automation-destination span.is-error {
  color: var(--danger-strong);
  font-weight: 600;
}

.wac-automation-destination span {
  grid-column: 2;
}

.wac-automation-feature {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.wac-automation-feature.is-highlight {
  background: linear-gradient(135deg, rgba(13, 148, 136, .08), rgba(37, 211, 102, .04));
  border-color: rgba(13, 148, 136, .24);
}

.wac-automation-feature-main > div:nth-child(2) {
  flex: 1;
}

.wac-automation-feature-main strong,
.wac-automation-option strong {
  display: block;
  color: var(--text-color);
  font-size: var(--font-size-sm);
}

.wac-summary-recommendation {
  margin: .7rem 0 0 3rem;
  color: var(--muted-text-color);
  font-size: var(--font-size-2xs);
}

.wac-automation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: .85rem;
}

.wac-automation-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .7rem;
  padding: .9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg-color, var(--white));
  cursor: pointer;
}

.wac-automation-option:hover {
  border-color: rgba(13, 148, 136, .35);
}

.wac-automation-option-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--highlight-bg-color);
}

.wac-automation-option small {
  display: block;
  margin-top: .2rem;
  color: var(--muted-text-color);
  font-size: var(--font-size-2xs);
  line-height: 1.35;
}

.wac-automation-footer {
  margin-top: 1rem;
  color: var(--muted-text-color);
  font-size: var(--font-size-2xs);
}

@media (max-width: 680px) {
  .wac-automation-card { padding: 1rem; }
  .wac-automation-destination,
  .wac-automation-grid {
    grid-template-columns: 1fr;
  }
  .wac-automation-destination span { grid-column: 1; }
  .wac-summary-recommendation { margin-left: 0; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   CONFIGURAÇÕES EM GRUPOS (Atendimento · Avisos ao cliente · Marketing)
───────────────────────────────────────────────────────────────────────────── */
#wa-config { gap: 1.75rem; }

/* Status do salvamento no topo (substitui um aviso por interruptor) */
.wac-save-status {
  flex-shrink: 0;
  min-height: 1.5rem;
  padding: .2rem .65rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--success-strong);
  background: var(--success-bg);
  white-space: nowrap;
}
.wac-save-status:empty { visibility: hidden; }
.wac-save-status.is-salvando { color: var(--muted-text-color); background: var(--surface-muted); }
.wac-save-status.is-erro { color: var(--danger-strong); background: var(--danger-bg-subtle); }
.wac-automation-footer .wac-save-hint.is-erro { color: var(--danger-strong); }
.wac-automation-footer .wac-save-hint.is-salvando { color: var(--muted-text-color); }

.wac-group { display: flex; flex-direction: column; gap: .75rem; }
.wac-group-head h4 {
  margin: 0;
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-700);
}
.wac-group-head p {
  margin: .15rem 0 0;
  font-size: var(--font-size-xs);
  color: var(--muted-text-color);
}

/* Cartão com campos (resgate, aniversário): linha do interruptor + campos abaixo */
.wac-toggle-card.has-config { flex-direction: column; align-items: stretch; gap: 0; }
.wac-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wac-config-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 0 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}
.wac-config-row[hidden] { display: none; }
.wac-field { display: flex; flex-direction: column; gap: 4px; }
.wac-field > span { font-size: var(--font-size-compact); font-weight: 600; color: var(--text-color); }
.wac-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background: var(--card-bg-color);
  font: inherit;
}
.wac-field input:focus { outline: none; border-color: var(--success-color); box-shadow: var(--focus-ring, 0 0 0 3px rgba(var(--success-rgb), .15)); }
.wac-field small { font-size: var(--font-size-2xs); color: var(--muted-text-color); }

/* Respostas: nome + descrição curta do que cada uma cobre */
.wac-respostas-wrap { display: flex; flex-direction: column; gap: 0; }
.wac-resp-label small {
  display: block;
  margin-top: 2px;
  font-size: var(--font-size-2xs);
  color: var(--muted-text-color);
  line-height: 1.35;
}
.wac-resp-item { align-items: flex-start; padding: .6rem; }
.wac-resp-item .wac-resp-emo, .wac-resp-item .nxh-btn-sm, .wac-resp-item .wac-switch-sm { margin-top: 2px; }

/* Mensagem de boas-vindas + prévia */
.wac-boasvindas {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-color);
}
.wac-boasvindas-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wac-textarea {
  width: 100%;
  min-height: 116px;
  padding: 10px 12px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background: var(--card-bg-color);
  font: inherit;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  resize: vertical;
}
.wac-textarea:focus { outline: none; border-color: var(--success-color); box-shadow: var(--focus-ring, 0 0 0 3px rgba(var(--success-rgb), .15)); }
.wac-boasvindas-acoes { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.wac-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--card-bg-color);
  color: var(--slate-700);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
}
.wac-chip:hover { border-color: var(--success-color); color: var(--success-strong); }
.wac-contador { font-size: var(--font-size-2xs); color: var(--muted-text-color); font-variant-numeric: tabular-nums; }
.wac-aviso-boasvindas {
  display: none;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: var(--font-size-2xs);
  line-height: 1.45;
}
.wac-boasvindas.is-personalizada .wac-aviso-boasvindas { display: block; }

.wac-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #efeae2; /* fundo da conversa do WhatsApp */
}
.wac-preview-label {
  font-size: var(--font-size-2xs);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #667781;
}
.wac-preview-bubble {
  align-self: flex-start;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 0 8px 8px 8px;
  background: #ffffff;
  color: #111b21;
  font-size: var(--font-size-xs);
  line-height: 1.45;
  overflow-wrap: anywhere;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
}
.wac-boasvindas:not(.is-personalizada) .wac-preview-bubble { opacity: .8; }

@media (max-width: 1024px) {
  .wac-boasvindas { grid-template-columns: 1fr; }
}

/* A descrição vai para a linha de baixo do título (o "?" da ajuda deixava os dois na mesma linha) */
.wac-toggle-info > div > span:last-child { display: block; }

/* Boas-vindas: salva só pelo botão (não grava sozinha enquanto digita) */
.wac-boasvindas-salvar { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.wac-nao-salva { display: none; flex-basis: 100%; font-size: var(--font-size-2xs); font-weight: 600; color: var(--warning-text); }
.wac-nao-salva i { font-size: 6px; vertical-align: middle; margin-right: 4px; }
.wac-boasvindas.is-alterada .wac-nao-salva { display: inline-flex; align-items: center; }
.wac-boasvindas.is-alterada .wac-textarea { border-color: var(--warning-color); }
