/* Floating chatbot widget — turismo portal */

.tourism-chatbot {
  --chatbot-accent: var(--color-accent-1, #3464ab);
  --chatbot-accent-dark: var(--color-accent-1-dark, #305b9d);
  --chatbot-bg: #ffffff;
  --chatbot-surface: #f4f6f9;
  --chatbot-border: #e5e9ef;
  --chatbot-text: #051036;
  --chatbot-text-muted: #697488;
  --chatbot-user-bubble: var(--chatbot-accent);
  --chatbot-bot-bubble: #eef2f7;
  --chatbot-shadow: 0 12px 48px rgba(5, 16, 54, 0.18);
  --chatbot-radius: 16px;
  --chatbot-z: 1100;

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--chatbot-z);
  font-family: "DM Sans", sans-serif;
}

@media (max-width: 767px) {
  .tourism-chatbot {
    right: 16px;
    bottom: 16px;
  }

  .tourism-chatbot.is-open {
    inset: 0;
    right: 0;
    bottom: 0;
  }
}

/* Toggle FAB */
.tourism-chatbot__toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chatbot-accent) 0%, var(--chatbot-accent-dark) 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(52, 100, 171, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tourism-chatbot__toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(52, 100, 171, 0.5);
}

.tourism-chatbot__toggle:focus-visible {
  outline: 2px solid var(--chatbot-accent);
  outline-offset: 3px;
}

.tourism-chatbot__toggle svg {
  width: 26px;
  height: 26px;
}

.tourism-chatbot.is-open .tourism-chatbot__toggle {
  display: none;
}

/* Panel */
.tourism-chatbot__panel {
  display: flex;
  flex-direction: column;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 100px);
  background: var(--chatbot-bg);
  border-radius: var(--chatbot-radius);
  box-shadow: var(--chatbot-shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
  position: relative;
}

.tourism-chatbot__body {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.tourism-chatbot.is-open .tourism-chatbot__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.tourism-chatbot.is-open .tourism-chatbot__panel[hidden] {
  display: flex !important;
}

@media (max-width: 767px) {
  .tourism-chatbot.is-open .tourism-chatbot__panel {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    transform: translateY(100%);
  }

  .tourism-chatbot.is-open.is-panel-visible .tourism-chatbot__panel {
    transform: translateY(0);
  }
}

/* Header */
.tourism-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--chatbot-accent) 0%, var(--chatbot-accent-dark) 100%);
  color: #fff;
  flex-shrink: 0;
}

.tourism-chatbot__header-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tourism-chatbot__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.tourism-chatbot__avatar svg {
  width: 22px;
  height: 22px;
}

.tourism-chatbot__header-info {
  min-width: 0;
}

.tourism-chatbot__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tourism-chatbot__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.9;
}

.tourism-chatbot__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35);
}

.tourism-chatbot__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tourism-chatbot__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.tourism-chatbot__icon-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.tourism-chatbot__icon-btn svg {
  width: 18px;
  height: 18px;
}

.tourism-chatbot__close--back {
  width: auto;
  min-width: 36px;
  padding: 0 12px 0 10px;
  border-radius: 18px;
  gap: 4px;
}

.tourism-chatbot__close-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tourism-chatbot__close-mode[hidden] {
  display: none !important;
}

.tourism-chatbot__back-label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

/* Confirm dialog (visitante) — overlay dentro do painel */
.tourism-chatbot__confirm {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tourism-chatbot__confirm[hidden] {
  display: none !important;
}

.tourism-chatbot__confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
}

.tourism-chatbot__confirm-dialog {
  position: relative;
  width: 100%;
  max-width: 300px;
  padding: 20px;
  border-radius: 14px;
  background: var(--chatbot-bg);
  box-shadow: 0 8px 32px rgba(5, 16, 54, 0.15);
  border: 1px solid var(--chatbot-border);
}

.tourism-chatbot__confirm-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--chatbot-text);
}

.tourism-chatbot__confirm-message {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--chatbot-text-muted);
}

.tourism-chatbot__confirm-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.tourism-chatbot__confirm-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
  text-align: center;
}

.tourism-chatbot__confirm-btn--cancel {
  background: var(--chatbot-surface);
  color: var(--chatbot-text);
  border-color: var(--chatbot-border);
}

.tourism-chatbot__confirm-btn--cancel:hover {
  background: var(--chatbot-border);
}

.tourism-chatbot__confirm-btn--accept {
  background: #dc2626;
  color: #fff;
}

.tourism-chatbot__confirm-btn--accept:hover {
  background: #b91c1c;
}

/* Views */
.tourism-chatbot__view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tourism-chatbot__view[hidden] {
  display: none !important;
}

/* Conversations list */
.tourism-chatbot__conversations {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.tourism-chatbot__conversations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
  flex-shrink: 0;
}

.tourism-chatbot__conversations-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--chatbot-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tourism-chatbot__new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--chatbot-border);
  border-radius: 20px;
  background: var(--chatbot-bg);
  color: var(--chatbot-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.tourism-chatbot__new-btn:hover {
  background: var(--chatbot-surface);
  border-color: var(--chatbot-accent);
}

.tourism-chatbot__new-btn svg {
  width: 14px;
  height: 14px;
}

.tourism-chatbot__conversations-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 10px;
  flex-shrink: 0;
  min-width: 0;
}

.tourism-chatbot__conversations-toolbar[hidden] {
  display: none !important;
}

.tourism-chatbot__select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.tourism-chatbot__select-all-input,
.tourism-chatbot__conversation-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--chatbot-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.tourism-chatbot__select-all-label {
  font-size: 13px;
  color: var(--chatbot-text-muted);
}

.tourism-chatbot__delete-selected-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 20px;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  flex-shrink: 0;
  max-width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tourism-chatbot__delete-selected-btn:hover:not(:disabled) {
  background: #b91c1c;
}

.tourism-chatbot__delete-selected-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tourism-chatbot__delete-selected-btn svg {
  width: 14px;
  height: 14px;
}

.tourism-chatbot__conversations-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 24px;
  text-align: center;
}

.tourism-chatbot__conversations-loading[hidden] {
  display: none !important;
}

.tourism-chatbot__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--chatbot-border);
  border-top-color: var(--chatbot-accent);
  border-radius: 50%;
  animation: chatbot-spin 0.75s linear infinite;
}

@keyframes chatbot-spin {
  to {
    transform: rotate(360deg);
  }
}

.tourism-chatbot__loading-text {
  margin: 0;
  font-size: 14px;
  color: var(--chatbot-text-muted);
}

.tourism-chatbot__messages-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(2px);
}

.tourism-chatbot__messages-loading[hidden] {
  display: none !important;
}

.tourism-chatbot.is-loading-messages .tourism-chatbot__messages,
.tourism-chatbot.is-loading-messages .tourism-chatbot__typing {
  visibility: hidden;
}

.tourism-chatbot.is-loading-conversations .tourism-chatbot__new-btn {
  opacity: 0.55;
  pointer-events: none;
}

.tourism-chatbot__conversation-list {
  list-style: none;
  margin: 0;
  padding: 4px 8px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  min-width: 0;
}

.tourism-chatbot__conversation-list[hidden] {
  display: none !important;
}

.tourism-chatbot__conversation-item {
  margin: 0;
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.tourism-chatbot__conversation-check {
  display: flex;
  align-items: center;
  padding: 0 4px 0 8px;
  flex-shrink: 0;
  cursor: pointer;
}

.tourism-chatbot__conversation-body {
  position: relative;
  flex: 1;
  min-width: 0;
}

.tourism-chatbot__conversation-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 12px 12px 12px 4px;
  border: none;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.tourism-chatbot__conversation-delete {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #dc2626;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  line-height: 0;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, background 0.2s;
}

.tourism-chatbot__conversation-item:hover .tourism-chatbot__conversation-delete,
.tourism-chatbot__conversation-item:focus-within .tourism-chatbot__conversation-delete {
  opacity: 1;
  pointer-events: auto;
}

.tourism-chatbot__conversation-delete:hover,
.tourism-chatbot__conversation-delete:focus-visible {
  background: #fef2f2;
  outline: none;
}

.tourism-chatbot__conversation-delete svg {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.tourism-chatbot__conversation-item:hover .tourism-chatbot__conversation-btn,
.tourism-chatbot__conversation-item:focus-within .tourism-chatbot__conversation-btn {
  background: var(--chatbot-surface);
}

.tourism-chatbot__conversation-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.tourism-chatbot__conversation-item:hover .tourism-chatbot__conversation-top,
.tourism-chatbot__conversation-item:focus-within .tourism-chatbot__conversation-top {
  padding-right: 28px;
}

.tourism-chatbot__conversation-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--chatbot-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tourism-chatbot__conversation-date {
  font-size: 11px;
  color: var(--chatbot-text-muted);
  flex-shrink: 0;
}

.tourism-chatbot__conversation-preview {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 13px;
  color: var(--chatbot-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tourism-chatbot__empty {
  padding: 32px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--chatbot-text-muted);
}

.tourism-chatbot__empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 24px;
  text-align: center;
}

.tourism-chatbot__empty-state[hidden] {
  display: none !important;
}

.tourism-chatbot__empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--chatbot-surface);
  color: var(--chatbot-accent);
}

.tourism-chatbot__empty-icon svg {
  width: 32px;
  height: 32px;
}

.tourism-chatbot__empty-text {
  margin: 0;
  max-width: 260px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--chatbot-text-muted);
}

.tourism-chatbot__empty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 24px;
  background: var(--chatbot-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.tourism-chatbot__empty-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.tourism-chatbot__empty-btn svg {
  width: 16px;
  height: 16px;
}

.tourism-chatbot__empty-state--error .tourism-chatbot__empty-icon {
  color: #b91c1c;
  background: #fef2f2;
}

.tourism-chatbot__empty-state--error .tourism-chatbot__empty-text {
  color: #b91c1c;
}

.tourism-chatbot__empty-state--error .tourism-chatbot__empty-btn {
  display: none;
}

.tourism-chatbot__conversations-header[hidden] {
  display: none !important;
}

/* Messages */
.tourism-chatbot__chat {
  position: relative;
}

.tourism-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.tourism-chatbot__message {
  display: flex;
  max-width: 85%;
  animation: chatbot-message-in 0.25s ease;
}

@keyframes chatbot-message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tourism-chatbot__message--bot {
  align-self: flex-start;
}

.tourism-chatbot__message--user {
  align-self: flex-end;
}

.tourism-chatbot__bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.tourism-chatbot__message--bot .tourism-chatbot__bubble {
  background: var(--chatbot-bot-bubble);
  color: var(--chatbot-text);
  border-bottom-left-radius: 4px;
}

.tourism-chatbot__message--user .tourism-chatbot__bubble {
  background: var(--chatbot-user-bubble);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.tourism-chatbot__message-time {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.65;
}

/* Markdown nas respostas do agente */
.tourism-chatbot__bubble--markdown {
  padding-top: 8px;
  padding-bottom: 8px;
}

.tourism-chatbot__markdown {
  font-size: 14px;
  line-height: 1.5;
}

.tourism-chatbot__markdown > :first-child {
  margin-top: 0;
}

.tourism-chatbot__markdown > :last-child {
  margin-bottom: 0;
}

.tourism-chatbot__markdown p,
.tourism-chatbot__markdown ul,
.tourism-chatbot__markdown ol,
.tourism-chatbot__markdown pre,
.tourism-chatbot__markdown blockquote {
  margin: 0 0 0.65em;
}

.tourism-chatbot__markdown ul,
.tourism-chatbot__markdown ol {
  padding-left: 1.25em;
}

.tourism-chatbot__markdown li + li {
  margin-top: 0.25em;
}

.tourism-chatbot__markdown a {
  color: var(--chatbot-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tourism-chatbot__markdown a:hover {
  color: var(--chatbot-accent-dark);
}

.tourism-chatbot__markdown strong {
  font-weight: 600;
}

.tourism-chatbot__markdown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(5, 16, 54, 0.08);
}

.tourism-chatbot__markdown pre {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(5, 16, 54, 0.06);
  overflow-x: auto;
}

.tourism-chatbot__markdown pre code {
  padding: 0;
  background: transparent;
  font-size: 0.88em;
}

.tourism-chatbot__markdown blockquote {
  padding-left: 10px;
  border-left: 3px solid var(--chatbot-border);
  color: var(--chatbot-text-muted);
}

.tourism-chatbot__message--user .tourism-chatbot__markdown a {
  color: #fff;
}

/* Typing indicator */
.tourism-chatbot__typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 8px;
  flex-shrink: 0;
}

.tourism-chatbot__typing-dots {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--chatbot-bot-bubble);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.tourism-chatbot__typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chatbot-text-muted);
  animation: chatbot-typing 1.2s infinite ease-in-out;
}

.tourism-chatbot__typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.tourism-chatbot__typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatbot-typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.tourism-chatbot__typing-text {
  font-size: 12px;
  color: var(--chatbot-text-muted);
}

/* Doing / status bubble (agent processing) */
.tourism-chatbot__message--doing {
  max-width: 92%;
}

.tourism-chatbot__bubble--status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--chatbot-bot-bubble);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.tourism-chatbot__status-spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid var(--chatbot-border);
  border-top-color: var(--chatbot-accent);
  border-radius: 50%;
  animation: chatbot-spin 0.75s linear infinite;
}

.tourism-chatbot__status-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--chatbot-text-muted);
}

/* Footer / input */
.tourism-chatbot__footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--chatbot-border);
  background: var(--chatbot-bg);
  flex-shrink: 0;
}

.tourism-chatbot__footer[hidden] {
  display: none !important;
}

.tourism-chatbot__form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tourism-chatbot__input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--chatbot-border);
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  color: var(--chatbot-text);
  background: var(--chatbot-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tourism-chatbot__input:focus {
  outline: none;
  border-color: var(--chatbot-accent);
  box-shadow: 0 0 0 3px rgba(52, 100, 171, 0.12);
  background: var(--chatbot-bg);
}

.tourism-chatbot__input::placeholder {
  color: var(--chatbot-text-muted);
}

.tourism-chatbot__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--chatbot-accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.tourism-chatbot__send:hover {
  background: var(--chatbot-accent-dark);
}

.tourism-chatbot__send:active {
  transform: scale(0.95);
}

.tourism-chatbot__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tourism-chatbot__send svg {
  width: 18px;
  height: 18px;
}

.tourism-chatbot.is-agent-loading .tourism-chatbot__toggle {
  opacity: 0.85;
}

.tourism-chatbot.is-agent-loading .tourism-chatbot__toggle::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: chatbot-spin 0.75s linear infinite;
}

/* Template visual blocks (structure JSON) */
.tourism-chatbot__message--template {
  align-self: flex-start;
  max-width: 100%;
  width: 100%;
}

.tourism-chatbot__bubble--template {
  padding: 0;
  overflow: hidden;
  background: transparent;
  max-width: 100%;
  width: 100%;
}

.tourism-chatbot__template-root,
.tourism-chatbot__template-view {
  max-width: 100%;
}

.tourism-chatbot__template-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tourism-chatbot__template-carousel {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  max-width: 100%;
}

.tourism-chatbot__template-carousel > .tourism-chatbot__template-view {
  flex: 0 0 auto;
  flex-shrink: 0;
}

.tourism-chatbot__template-image {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.tourism-chatbot__template-button,
.tourism-chatbot__template-button--link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  line-height: 1.2;
}

.tourism-chatbot__template-button--link:hover {
  text-decoration: underline;
}

.tourism-chatbot__template-fallback {
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--chatbot-text);
}

.tourism-chatbot__message--template .tourism-chatbot__message-time {
  padding: 0 14px 8px;
}

/* Ajuste com botão "voltar ao topo" */
@media (min-width: 768px) {
  body:has(.toTopButton:not(.is-hidden)) .tourism-chatbot:not(.is-open) {
    bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tourism-chatbot__panel,
  .tourism-chatbot__toggle,
  .tourism-chatbot__spinner {
    animation: none;
  }
}
