/* MyTS Corp — chatbot flotante */
.myts-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9998;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, #0088dd, #00a8ff);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0, 168, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.myts-chat-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(30, 58, 138, 0.55);
}

.myts-chat-launcher svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (max-width: 1099px) {
  .myts-chat-launcher {
    bottom: calc(4.7rem + env(safe-area-inset-bottom, 0px));
  }

  .myts-chat-panel {
    bottom: calc(8.7rem + env(safe-area-inset-bottom, 0px));
  }
}

.myts-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;
  z-index: 9999;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.myts-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.myts-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(90deg, #0088dd, #00a8ff);
  color: #fff;
}

.myts-chat-header strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.myts-chat-header span {
  display: block;
  font-size: 0.72rem;
  opacity: 0.85;
  font-weight: 400;
}

.myts-chat-close {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.myts-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.myts-chat-bubble {
  max-width: 92%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.875rem;
  line-height: 1.45;
  word-break: break-word;
}

.myts-chat-bubble.bot {
  align-self: flex-start;
  background: rgba(51, 65, 85, 0.9);
  color: #e2e8f0;
  border-bottom-left-radius: 0.25rem;
}

.myts-chat-bubble.user {
  align-self: flex-end;
  background: #00a8ff;
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.myts-chat-bubble a {
  color: #7dd3fc;
}

.myts-chat-chips-wrap {
  padding: 0 1rem 0.65rem;
}

.myts-chat-chips-wrap.is-collapsed {
  padding-top: 0.35rem;
}

.myts-chat-chips-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.myts-chat-chips-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.myts-chat-chips-toggle:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(96, 165, 250, 0.6);
  color: #e2e8f0;
}

.myts-chat-chips-wrap.is-collapsed .myts-chat-chips-toggle {
  display: inline-flex;
}

.myts-chat-chips-wrap.is-collapsed .myts-chat-chips {
  display: none;
}

.myts-chat-chips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.myts-chat-chip {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.65rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.myts-chat-chip:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(96, 165, 250, 0.6);
}

.myts-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.myts-chat-input-row input {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.9);
  color: #f1f5f9;
  border-radius: 0.65rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
}

.myts-chat-input-row input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  border-color: transparent;
}

.myts-chat-input-row button {
  border: none;
  background: #00a8ff;
  color: #fff;
  border-radius: 0.65rem;
  padding: 0 0.9rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

.myts-chat-input-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .myts-chat-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 5rem;
  }
}
