/* ============================================================
   SupportWidget — premium dark theme
   Fixes: header subtitle wrap, avatar dot positioning, FAB sizing,
          message row alignment, scroll layout, mobile ergonomics.
   ============================================================ */

.tbb-sw {
  --sw-bg: #0a1929;
  --sw-bg-elev: #0d2238;
  --sw-bg-bubble-bot: #1a2942;
  --sw-bg-bubble-user: #0f766e;
  --sw-bg-input: #0f1c33;
  --sw-border: rgba(56, 189, 248, 0.12);
  --sw-border-strong: rgba(56, 189, 248, 0.22);
  --sw-text: #e2e8f0;
  --sw-text-mute: #94a3b8;
  --sw-text-faint: #64748b;
  --sw-online: #22c55e;
  --sw-accent: #14b8a6;
  --sw-accent-strong: #0f766e;
  --sw-danger: #ef4444;
  --sw-warn: #fbbf24;
  --sw-link: #38bdf8;
  --sw-focus: #14b8a6;
  --sw-shadow-fab: 0 6px 20px rgba(15, 118, 110, 0.45);
  --sw-shadow-panel: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 0 0.5px rgba(56, 189, 248, 0.15);
  /* Panel width cap + horizontal inset (wider inset reduces 100vw scrollbar overflow) */
  --sw-panel-max-w: 380px;
  --sw-panel-inset-x: 32px;

  font-family: var(--sans, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
  font-size: 14px;
  line-height: 1.45;
  color: var(--sw-text);
  z-index: 10050;
}

.tbb-sw *,
.tbb-sw *::before,
.tbb-sw *::after {
  box-sizing: border-box;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes tbb-sw-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes tbb-sw-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tbb-sw-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tbb-sw-fab-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes tbb-sw-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

@keyframes tbb-sw-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes tbb-sw-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   FAB (floating action button)
   ============================================================ */
.tbb-sw-fab {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  right: max(24px, env(safe-area-inset-right, 0px));
  z-index: 10052;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px 0 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--sw-shadow-fab);
  transition: transform 0.18s cubic-bezier(0.32, 0.72, 0, 1),
              box-shadow 0.18s ease;
}

.tbb-sw-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.55);
}

.tbb-sw-fab:active {
  transform: translateY(0) scale(0.97);
}

.tbb-sw-fab:focus-visible {
  outline: 2px solid var(--sw-focus);
  outline-offset: 3px;
}

.tbb-sw-fab__icon-open,
.tbb-sw-fab__icon-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.tbb-sw-fab__icon-open svg,
.tbb-sw-fab__icon-close svg {
  width: 22px;
  height: 22px;
}

.tbb-sw-fab__icon-close {
  display: none;
}

.tbb-sw-fab__label {
  font-weight: 500;
  white-space: nowrap;
}

.tbb-sw-fab__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--sw-online);
  opacity: 0;
  pointer-events: none;
}

.tbb-sw-fab__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sw-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  border: 2px solid var(--sw-bg);
}

/* When open: collapse FAB to a circular X-only button */
.tbb-sw.is-open .tbb-sw-fab {
  width: 52px;
  padding: 0;
  gap: 0;
  background: var(--sw-bg-elev);
  border: 1px solid var(--sw-border-strong);
}

.tbb-sw.is-open .tbb-sw-fab__icon-open,
.tbb-sw.is-open .tbb-sw-fab__label,
.tbb-sw.is-open .tbb-sw-fab__pulse {
  display: none;
}

.tbb-sw.is-open .tbb-sw-fab__icon-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.tbb-sw.is-open .tbb-sw-fab__icon-close svg {
  width: 22px;
  height: 22px;
}

/* ============================================================
   BACKDROP (mobile only — prevents body scroll/tap-through)
   ============================================================ */
.tbb-sw-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10049;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  animation: tbb-sw-fade 0.2s ease-out both;
}

.tbb-sw-backdrop[hidden] {
  display: none !important;
}

/* ============================================================
   PANEL (chat container)
   ============================================================ */
.tbb-sw-panel {
  position: fixed;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  right: max(24px, env(safe-area-inset-right, 0px));
  left: auto;
  z-index: 10051;
  box-sizing: border-box;
  width: min(
    var(--sw-panel-max-w),
    calc(100vw - var(--sw-panel-inset-x) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))
  );
  height: 560px;
  min-height: 420px;
  max-height: 88vh;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--sw-bg);
  border: 1px solid var(--sw-border-strong);
  box-shadow: var(--sw-shadow-panel);
  resize: none;
  transform-origin: bottom right;
}

.tbb-sw-panel[hidden] {
  display: none !important;
}

.tbb-sw-panel:not([hidden]) {
  display: flex;
  animation: tbb-sw-panel-in 0.22s cubic-bezier(0.32, 0.72, 0, 1) both;
}

/* Resize grip — visible affordance at top edge */
.tbb-sw-grip {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 6px;
  margin-top: 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0);
  cursor: ns-resize;
  z-index: 3;
  transition: background 0.15s ease;
}

.tbb-sw-panel:hover .tbb-sw-grip {
  background: rgba(148, 163, 184, 0.22);
}

.tbb-sw-grip:hover,
.tbb-sw-grip:active {
  background: rgba(148, 163, 184, 0.4);
}

/* ============================================================
   HEADER
   ============================================================ */
.tbb-sw-header {
  flex-shrink: 0;
  height: 64px;
  padding: 10px 12px 10px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--sw-bg-elev);
  border-bottom: 1px solid var(--sw-border);
  position: relative;
  z-index: 1;
  cursor: ns-resize;
  user-select: none;
  touch-action: none;
}

.tbb-sw-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  /* overflow visível: a bolinha online + pulse (box-shadow) não podem ser cortados */
  overflow: visible;
}

.tbb-sw-avatar__photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.tbb-sw-avatar__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tbb-sw-avatar__dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sw-online);
  border: 2px solid var(--sw-bg-elev);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: tbb-sw-online-pulse 2.4s ease-in-out infinite;
}

.tbb-sw-header__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.tbb-sw-header__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--sw-text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tbb-sw-header__subtitle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--sw-text-mute);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
}

.tbb-sw-header__statusdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sw-online);
  flex-shrink: 0;
}

.tbb-sw-header__statustxt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tbb-sw-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  cursor: default;
  touch-action: auto;
}

.tbb-sw-icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--sw-text-mute);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.tbb-sw-icon-btn svg {
  width: 18px;
  height: 18px;
}

.tbb-sw-icon-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--sw-text);
}

.tbb-sw-icon-btn:focus-visible {
  outline: 2px solid var(--sw-focus);
  outline-offset: -2px;
}

/* ============================================================
   MESSAGES (scroll root) — the critical flex-fix is here
   ============================================================ */
.tbb-sw-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--sw-bg);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.tbb-sw-messages:focus {
  outline: none;
}

.tbb-sw-messages::-webkit-scrollbar {
  width: 6px;
}

.tbb-sw-messages::-webkit-scrollbar-track {
  background: transparent;
}

.tbb-sw-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.tbb-sw-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

/* Day separator — centered chip */
.tbb-sw-day-sep {
  align-self: center;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-text-faint);
  padding: 4px 10px;
  background: rgba(148, 163, 184, 0.06);
  border-radius: 999px;
  margin: 4px 0;
}

/* ============================================================
   MESSAGE ROWS — avatar pinned to the bubble (not the stack)
   ============================================================ */
.tbb-sw-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 92%;
  animation: tbb-sw-msg-in 0.22s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.tbb-sw-msg-row--bot {
  align-self: flex-start;
}

.tbb-sw-msg-row--user {
  align-self: flex-end;
}

.tbb-sw-msg-av {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

/* Continuation rows (same speaker, no avatar) keep alignment */
.tbb-sw-msg-row--bot.is-continuation {
  padding-left: 36px;
}

.tbb-sw-msg-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.tbb-sw-msg-row--user .tbb-sw-msg-stack {
  align-items: flex-end;
}

.tbb-sw-msg-row--bot .tbb-sw-msg-stack {
  align-items: flex-start;
}

/* ============================================================
   BUBBLES
   ============================================================ */
.tbb-sw-bubble {
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  padding: 10px 13px;
  max-width: 100%;
}

.tbb-sw-bubble p {
  margin: 0;
}

.tbb-sw-bubble p + p {
  margin-top: 6px;
}

.tbb-sw-bubble--bot {
  background: var(--sw-bg-bubble-bot);
  color: var(--sw-text);
  border-radius: 14px 14px 14px 4px;
  border: 1px solid rgba(56, 189, 248, 0.06);
}

.tbb-sw-bubble--bot a {
  color: var(--sw-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tbb-sw-bubble strong {
  font-weight: 500;
  color: #fff;
}

.tbb-sw-bubble code {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  background: rgba(15, 23, 42, 0.7);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--sw-border);
}

.tbb-sw-bubble ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.tbb-sw-bubble ul li {
  margin: 2px 0;
}

.tbb-sw-bubble--user {
  background: linear-gradient(135deg, #0f766e 0%, #0d6259 100%);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}

.tbb-sw-bubble--user a {
  color: #ccfbf1;
  text-decoration: underline;
}

/* Meta line below bubble */
.tbb-sw-msg-meta {
  font-size: 10.5px;
  color: var(--sw-text-faint);
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.tbb-sw-read {
  color: var(--sw-text-mute);
  letter-spacing: -2px;
  font-size: 11px;
}

.tbb-sw-read.is-read {
  color: var(--sw-link);
}

/* Quick-reply chips */
.tbb-sw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tbb-sw-chip {
  appearance: none;
  border: 1px solid var(--sw-border-strong);
  background: rgba(15, 118, 110, 0.08);
  color: #5eead4;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}

.tbb-sw-chip:hover {
  background: rgba(15, 118, 110, 0.18);
  border-color: var(--sw-accent);
}

.tbb-sw-chip:active {
  transform: scale(0.97);
}

.tbb-sw-chip:focus-visible {
  outline: 2px solid var(--sw-focus);
  outline-offset: 2px;
}

/* Typing indicator */
.tbb-sw-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  background: var(--sw-bg-bubble-bot);
  border: 1px solid rgba(56, 189, 248, 0.06);
  border-radius: 14px 14px 14px 4px;
  width: fit-content;
}

.tbb-sw-typing span {
  width: 6px;
  height: 6px;
  background: var(--sw-text-mute);
  border-radius: 50%;
  animation: tbb-sw-typing 1.4s ease-in-out infinite;
}

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

/* New-messages pill */
.tbb-sw-new-pill[hidden] {
  display: none !important;
}

.tbb-sw-new-pill {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--sw-border-strong);
  border-radius: 999px;
  background: var(--sw-bg-elev);
  color: var(--sw-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transition: background 0.12s ease, transform 0.12s ease;
}

.tbb-sw-new-pill svg {
  width: 14px;
  height: 14px;
  color: var(--sw-accent);
}

.tbb-sw-new-pill:hover {
  background: #1a2942;
  transform: translateX(-50%) translateY(-1px);
}

.tbb-sw-new-pill:focus-visible {
  outline: 2px solid var(--sw-focus);
  outline-offset: 2px;
}

/* ============================================================
   FOOTER (input area)
   ============================================================ */
.tbb-sw-footer {
  flex-shrink: 0;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--sw-bg);
  border-top: 1px solid var(--sw-border);
}

.tbb-sw-input-pill {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 4px 4px 4px 6px;
  border: 1px solid var(--sw-border-strong);
  border-radius: 22px;
  background: var(--sw-bg-input);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tbb-sw-input-pill:focus-within {
  border-color: var(--sw-accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.tbb-sw-attach {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--sw-text-faint);
  cursor: not-allowed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}

.tbb-sw-attach svg {
  width: 18px;
  height: 18px;
}

.tbb-sw-textarea {
  flex: 1;
  min-width: 0;
  min-height: 24px;
  max-height: 96px;
  resize: none;
  overflow-y: auto;
  overflow-x: hidden;
  border: none;
  background: transparent;
  color: var(--sw-text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 7px 6px;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.tbb-sw-textarea::-webkit-scrollbar {
  width: 6px;
}

.tbb-sw-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.tbb-sw-textarea::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 3px;
}

.tbb-sw-textarea::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.tbb-sw-textarea::placeholder {
  color: var(--sw-text-faint);
}

.tbb-sw-send {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.12s ease, transform 0.1s ease;
}

.tbb-sw-send svg {
  width: 16px;
  height: 16px;
  transform: translateX(-1px);
}

.tbb-sw-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: var(--sw-bg-bubble-bot);
}

.tbb-sw-send:not(:disabled):hover {
  filter: brightness(1.1);
}

.tbb-sw-send:not(:disabled):active {
  transform: scale(0.94);
}

.tbb-sw-send:focus-visible {
  outline: 2px solid var(--sw-focus);
  outline-offset: 2px;
}

.tbb-sw-counter {
  font-size: 11px;
  color: var(--sw-text-faint);
  text-align: right;
  margin-top: 6px;
  padding-right: 6px;
}

.tbb-sw-counter--warn {
  color: var(--sw-warn);
}

/* ============================================================
   TABLET (≤899px) — narrower panel, FAB stays compact
   ============================================================ */
@media (max-width: 899px) {
  .tbb-sw-fab {
    height: 52px;
    padding: 0;
    width: 52px;
    gap: 0;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }

  .tbb-sw-fab__label {
    display: none;
  }

  body:has(.imn-root) .tbb-sw-fab {
    bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px));
  }

  .tbb-sw-panel {
    --sw-panel-inset-x: 20px;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    max-height: min(88vh, 720px);
  }

  body:has(.imn-root) .tbb-sw-panel {
    bottom: calc(6.75rem + 4.25rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   MOBILE (≤599px) — bottom sheet, no FAB-collide
   ============================================================ */
@media (max-width: 599px) {
  .tbb-sw-panel {
    --sw-panel-inset-x: 16px;
    inset: auto;
    left: auto;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(128px + env(safe-area-inset-bottom, 0px));
    width: min(
      var(--sw-panel-max-w),
      calc(100vw - var(--sw-panel-inset-x) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))
    );
    height: min(580px, 92vh);
    max-height: min(94vh, 760px);
    min-height: 430px;
    border-radius: 18px;
    border-bottom: 1px solid var(--sw-border-strong);
    resize: none;
    transform-origin: bottom right;
  }

  .tbb-sw-panel:not([hidden]) {
    animation: tbb-sw-panel-in 0.22s cubic-bezier(0.32, 0.72, 0, 1) both;
  }

  .tbb-sw.is-open .tbb-sw-panel:not([hidden]) {
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }

  .tbb-sw-grip {
    width: 44px;
    height: 5px;
    cursor: ns-resize;
    touch-action: none;
  }

  .tbb-sw-panel:hover .tbb-sw-grip {
    background: rgba(148, 163, 184, 0.35);
  }

  /* Landing / páginas sem bottom nav: FAB mais alto para não cobrir o footer */
  .tbb-sw-fab {
    bottom: max(60px, env(safe-area-inset-bottom, 0px));
  }

  body:has(.imn-root) .tbb-sw-fab {
    bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px));
  }

  /* When open on mobile, hide FAB so it doesn't overlap the sheet */
  .tbb-sw.is-open .tbb-sw-fab {
    display: none;
  }

  .tbb-sw-header {
    height: 60px;
    padding: 8px 8px 8px 14px;
  }

  .tbb-sw-bubble {
    font-size: 14px;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .tbb-sw-panel,
  .tbb-sw-msg-row,
  .tbb-sw-fab,
  .tbb-sw-avatar__dot,
  .tbb-sw-typing span {
    animation: none !important;
    transition: none !important;
  }
}
