:root {
  --tria-chatbot-safe-bottom: 24px;
}

.tria-chatbot-launcher {
  position: fixed;
  right: 26px;
  bottom: var(--tria-chatbot-safe-bottom);
  z-index: 10001;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 20px;
  border: 1px solid rgba(121, 218, 255, 0.42);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(43, 192, 245, 0.98), rgba(30, 127, 224, 0.98));
  color: #04121f;
  box-shadow:
    0 16px 38px rgba(1, 8, 30, 0.42),
    0 0 28px rgba(43, 192, 245, 0.2);
  font: 700 0.95rem/1 "Space Grotesk", "Inter", sans-serif;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    bottom 0.25s ease;
}

.tria-chatbot-launcher:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 44px rgba(1, 8, 30, 0.48),
    0 0 34px rgba(43, 192, 245, 0.3);
}

.tria-chatbot-launcher:focus-visible,
.tria-chatbot-icon-button:focus-visible,
.tria-chatbot-send:focus-visible,
.tria-chatbot-action:focus-visible,
.tria-chatbot-rating:focus-visible,
.tria-chatbot-new-conversation:focus-visible,
.tria-chatbot-form-submit:focus-visible,
.tria-chatbot-input:focus-visible,
.tria-chatbot-field input:focus-visible {
  outline: 3px solid rgba(120, 220, 255, 0.82);
  outline-offset: 3px;
}

.tria-chatbot-launcher[hidden] {
  display: none;
}

.tria-chatbot-launcher-icon {
  width: 25px;
  height: 25px;
  flex: none;
}

.tria-chatbot-panel {
  position: fixed;
  right: 26px;
  bottom: var(--tria-chatbot-safe-bottom);
  z-index: 10002;
  display: flex;
  flex-direction: column;
  width: min(410px, calc(100vw - 36px));
  height: min(620px, calc(100dvh - var(--tria-chatbot-safe-bottom) - 92px));
  max-width: calc(100vw - 36px);
  max-height: calc(100dvh - var(--tria-chatbot-safe-bottom) - 92px);
  min-height: min(420px, calc(100dvh - var(--tria-chatbot-safe-bottom) - 92px));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(150, 197, 255, 0.25);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% -8%, rgba(43, 192, 245, 0.13), transparent 34%),
    linear-gradient(155deg, #10213c, #071326 72%);
  color: #eaf1f8;
  box-shadow:
    0 28px 70px rgba(0, 3, 22, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: "Inter", system-ui, sans-serif;
  transform-origin: bottom right;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    bottom 0.25s ease;
}

.tria-chatbot-panel[hidden] {
  display: none;
}

.tria-chatbot-panel.tria-chatbot-entering {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.tria-chatbot-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #102746;
}

.tria-chatbot-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(43, 192, 245, 0.35);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(43, 192, 245, 0.18), rgba(124, 92, 255, 0.16));
  color: #6dd8ff;
}

.tria-chatbot-brand-mark svg {
  width: 23px;
  height: 23px;
}

.tria-chatbot-heading {
  min-width: 0;
  flex: 1;
}

.tria-chatbot-title {
  margin: 0;
  color: #ffffff;
  font: 700 1rem/1.25 "Space Grotesk", "Inter", sans-serif;
}

.tria-chatbot-subtitle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 3px 0 0;
  color: #aeb9d6;
  font-size: 0.78rem;
  line-height: 1.3;
}

.tria-chatbot-status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.tria-chatbot-panel[data-connection-state="connecting"] .tria-chatbot-status-dot {
  background: #2bc0f5;
  box-shadow: 0 0 10px rgba(43, 192, 245, 0.72);
}

.tria-chatbot-panel[data-connection-state="connected"] .tria-chatbot-status-dot {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.72);
}

.tria-chatbot-panel[data-connection-state="error"] .tria-chatbot-status-dot {
  background: #ff7557;
  box-shadow: 0 0 10px rgba(255, 117, 87, 0.58);
}

.tria-chatbot-icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: #dce9f6;
  cursor: pointer;
}

.tria-chatbot-icon-button:hover {
  border-color: rgba(43, 192, 245, 0.4);
  color: #6dd8ff;
}

.tria-chatbot-messages {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 15px 14px;
  background: #09182e;
  scrollbar-color: rgba(69, 182, 232, 0.45) transparent;
  scrollbar-width: thin;
}

.tria-chatbot-message {
  display: flex;
  margin: 0 0 13px;
}

.tria-chatbot-message-user {
  justify-content: flex-end;
}

.tria-chatbot-bubble {
  max-width: 84%;
  padding: 11px 13px;
  border-radius: 15px 15px 15px 5px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.075);
  color: #eaf1f8;
  font-size: 0.91rem;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tria-chatbot-message-user .tria-chatbot-bubble {
  border-color: rgba(43, 192, 245, 0.2);
  border-radius: 15px 15px 5px 15px;
  background: linear-gradient(135deg, rgba(43, 192, 245, 0.94), rgba(30, 127, 224, 0.94));
  color: #04121f;
  font-weight: 600;
}

.tria-chatbot-message-system .tria-chatbot-bubble {
  max-width: 100%;
  border-color: rgba(245, 166, 35, 0.24);
  background: rgba(245, 166, 35, 0.08);
  color: #f7d999;
  font-size: 0.83rem;
}

.tria-chatbot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -3px 0 15px;
}

.tria-chatbot-action,
.tria-chatbot-new-conversation,
.tria-chatbot-form-submit {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(43, 192, 245, 0.32);
  border-radius: 10px;
  background: rgba(43, 192, 245, 0.09);
  color: #8be1ff;
  font: 700 0.79rem/1.2 "Space Grotesk", "Inter", sans-serif;
  cursor: pointer;
}

.tria-chatbot-action:hover,
.tria-chatbot-new-conversation:hover,
.tria-chatbot-form-submit:hover {
  border-color: rgba(43, 192, 245, 0.62);
  background: rgba(43, 192, 245, 0.16);
}

.tria-chatbot-action:disabled,
.tria-chatbot-new-conversation:disabled,
.tria-chatbot-form-submit:disabled,
.tria-chatbot-rating:disabled {
  cursor: wait;
  opacity: 0.55;
}

.tria-chatbot-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 58px;
}

.tria-chatbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #76d9fd;
  animation: tria-chatbot-pulse 1.1s infinite ease-in-out;
}

.tria-chatbot-typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.tria-chatbot-typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes tria-chatbot-pulse {
  0%,
  70%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.tria-chatbot-composer {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 9px;
  width: 100%;
  margin: 0;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #061326;
}

.tria-chatbot-composer[hidden] {
  display: none;
}

.tria-chatbot-input {
  width: 100%;
  min-height: 43px;
  max-height: 110px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.045);
  color: #f4f8fc;
  font: 400 0.9rem/1.45 "Inter", sans-serif;
}

.tria-chatbot-input::placeholder {
  color: #8493b3;
}

.tria-chatbot-input:focus {
  border-color: rgba(43, 192, 245, 0.55);
  box-shadow: 0 0 0 3px rgba(43, 192, 245, 0.09);
}

.tria-chatbot-input:disabled {
  opacity: 0.62;
}

.tria-chatbot-send {
  display: grid;
  width: 43px;
  height: 43px;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 12px;
  border: 1px solid rgba(118, 217, 253, 0.38);
  background: linear-gradient(135deg, #238fdc, #1768c1);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(17, 91, 179, 0.28);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

.tria-chatbot-send:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #32b7ed, #1d7bda);
  box-shadow: 0 10px 22px rgba(26, 126, 211, 0.38);
}

.tria-chatbot-send:disabled {
  cursor: not-allowed;
  border-color: rgba(159, 178, 207, 0.14);
  background: #203149;
  color: #71829c;
  box-shadow: none;
  opacity: 0.72;
}

.tria-chatbot-send svg {
  width: 21px;
  height: 21px;
}

.tria-chatbot-state {
  display: grid;
  min-height: 100%;
  padding: 20px 18px;
  place-items: center;
  text-align: center;
}

.tria-chatbot-state-inner {
  width: 100%;
  max-width: 300px;
}

.tria-chatbot-state-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 15px;
  place-items: center;
  border: 1px solid rgba(43, 192, 245, 0.25);
  border-radius: 17px;
  background: rgba(43, 192, 245, 0.08);
  color: #69d8ff;
}

.tria-chatbot-state h3,
.tria-chatbot-card h3 {
  margin: 0 0 8px;
  color: #f4f8fc;
  font: 700 1rem/1.3 "Space Grotesk", "Inter", sans-serif;
}

.tria-chatbot-state p,
.tria-chatbot-card p {
  margin: 0 0 15px;
  color: #aeb9d6;
  font-size: 0.84rem;
  line-height: 1.5;
}

.tria-chatbot-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 14px;
  border: 3px solid rgba(43, 192, 245, 0.18);
  border-top-color: #2bc0f5;
  border-radius: 50%;
  animation: tria-chatbot-spin 0.8s linear infinite;
}

.tria-chatbot-state .tria-chatbot-new-conversation {
  width: auto;
  min-width: 158px;
  min-height: 42px;
  padding: 11px 18px;
  border-color: rgba(117, 220, 255, 0.55);
  background: linear-gradient(135deg, #2bc0f5, #1e7fe0);
  color: #04121f;
  box-shadow: 0 9px 24px rgba(30, 127, 224, 0.25);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

.tria-chatbot-state .tria-chatbot-new-conversation:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(139, 229, 255, 0.8);
  background: linear-gradient(135deg, #55cff8, #268de7);
  box-shadow: 0 12px 28px rgba(30, 127, 224, 0.34);
}

.tria-chatbot-state .tria-chatbot-new-conversation:disabled {
  cursor: wait;
  opacity: 0.68;
}

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

.tria-chatbot-card {
  margin: 4px 0 16px;
  padding: 15px;
  border: 1px solid rgba(150, 197, 255, 0.17);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.04);
}

.tria-chatbot-field {
  display: block;
  margin: 0 0 11px;
  text-align: left;
}

.tria-chatbot-field span {
  display: block;
  margin: 0 0 5px;
  color: #c8d7e8;
  font-size: 0.76rem;
  font-weight: 600;
}

.tria-chatbot-field input {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  outline: none;
  background: rgba(3, 10, 27, 0.52);
  color: #f4f8fc;
  font: 400 0.88rem "Inter", sans-serif;
}

.tria-chatbot-field input:focus {
  border-color: rgba(43, 192, 245, 0.58);
}

.tria-chatbot-field-error {
  min-height: 17px;
  margin: -5px 0 8px;
  color: #ffaaaa;
  font-size: 0.73rem;
}

.tria-chatbot-form-submit,
.tria-chatbot-new-conversation {
  width: 100%;
}

.tria-chatbot-ratings {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 14px 0 15px;
}

.tria-chatbot-rating {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(245, 166, 35, 0.3);
  border-radius: 11px;
  background: rgba(245, 166, 35, 0.08);
  color: #ffd36d;
  font: 700 0.9rem "Space Grotesk", sans-serif;
  cursor: pointer;
}

.tria-chatbot-rating:hover {
  border-color: rgba(245, 166, 35, 0.7);
  background: rgba(245, 166, 35, 0.16);
  transform: translateY(-1px);
}

.tria-chatbot-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body:not(.tria-chatbot-open) .wa-float {
  bottom: calc(var(--tria-chatbot-safe-bottom) + 74px);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    bottom 0.25s ease;
}

body.tria-chatbot-open .wa-float {
  pointer-events: none;
  opacity: 0;
  transform: scale(0.88);
}

@media (max-width: 560px) {
  :root {
    --tria-chatbot-safe-bottom: 18px;
  }

  .tria-chatbot-launcher {
    right: 18px;
    width: 56px;
    min-height: 56px;
    padding: 0;
  }

  .tria-chatbot-launcher-text {
    display: none;
  }

  .tria-chatbot-panel {
    right: 12px;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    height: min(620px, calc(100dvh - var(--tria-chatbot-safe-bottom) - 18px));
    max-height: calc(100dvh - var(--tria-chatbot-safe-bottom) - 18px);
    min-height: min(420px, calc(100dvh - var(--tria-chatbot-safe-bottom) - 18px));
    border-radius: 19px;
  }

  .tria-chatbot-send {
    width: 46px;
    height: 46px;
  }

  body:not(.tria-chatbot-open) .wa-float {
    bottom: calc(var(--tria-chatbot-safe-bottom) + 68px);
  }
}

@media (max-height: 560px) {
  .tria-chatbot-panel {
    height: calc(100dvh - var(--tria-chatbot-safe-bottom) - 12px);
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tria-chatbot-launcher,
  .tria-chatbot-panel,
  .tria-chatbot-action,
  .tria-chatbot-rating,
  body .wa-float {
    scroll-behavior: auto;
    transition: none !important;
  }

  .tria-chatbot-typing span,
  .tria-chatbot-spinner {
    animation: none;
  }
}
