#ttaw-widget-root,
#ttaw-widget-root * {
  box-sizing: border-box;
}

#ttaw-widget-root {
  --ttaw-brand: #006AA6;
  --ttaw-brand-hover: #4A90E2;
  --ttaw-accent-green: #8FD125;
  --ttaw-bot-bubble: #f0f2f4;
  --ttaw-text-primary: #1b2733;
  --ttaw-text-muted: #6b7a86;
  --ttaw-border: #e8eaed;
  --ttaw-shadow-widget: 0 8px 32px rgba(0, 0, 0, .18);
  --ttaw-shadow-fab: 0 4px 16px rgba(0, 0, 0, .22);
  --ttaw-suggestion-font-size: 14px;
  --ttaw-input-font-size: 14px;
  --ttaw-menu-font-size: 13.5px;
  color: var(--ttaw-text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#ttaw-widget-root button,
#ttaw-widget-root textarea {
  font: inherit;
}

#ttaw-launcher {
  align-items: center;
  background: var(--ttaw-brand);
  border: 0;
  border-radius: 50%;
  bottom: 24px;
  box-shadow: var(--ttaw-shadow-fab);
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 56px;
  justify-content: center;
  padding: 0;
  position: fixed;
  right: 24px;
  transition: background 150ms, transform 120ms;
  width: 56px;
  z-index: 2147483001;
}

#ttaw-launcher:hover {
  background: var(--ttaw-brand-hover);
  transform: scale(1.06);
}

#ttaw-launcher:active {
  transform: scale(.96);
}

.ttaw-launcher-ring {
  animation: ttaw-pulse-ring 2.6s ease-out .6s 1 forwards;
  border: 3px solid var(--ttaw-accent-green);
  border-radius: 50%;
  inset: -4px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

@keyframes ttaw-pulse-ring {
  0% { opacity: .65; transform: scale(1); }
  14% { opacity: 0; transform: scale(1.45); }
  14.1% { opacity: .50; transform: scale(1); }
  28% { opacity: 0; transform: scale(1.45); }
  28.1% { opacity: .35; transform: scale(1); }
  42%, 100% { opacity: 0; transform: scale(1.45); }
}

.ttaw-icon-chat {
  display: block;
}

.ttaw-icon-close {
  display: none;
}

#ttaw-launcher.ttaw-open .ttaw-icon-chat {
  display: none;
}

#ttaw-launcher.ttaw-open .ttaw-icon-close {
  display: block;
}

#ttaw-unread-dot {
  background: #e53e3e;
  border: 2px solid #fff;
  border-radius: 50%;
  display: none;
  height: 12px;
  position: absolute;
  right: 3px;
  top: 3px;
  width: 12px;
}

#ttaw-unread-dot.ttaw-visible {
  display: block;
}

#ttaw-widget {
  background: #fff;
  border-radius: 16px;
  bottom: 92px;
  box-shadow: var(--ttaw-shadow-widget);
  display: flex;
  flex-direction: column;
  height: 560px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  right: 24px;
  transform: translateY(20px) scale(.97);
  transition: opacity 220ms ease-out, transform 220ms ease-out, visibility 0s 220ms,
    width 220ms ease-out, height 220ms ease-out;
  visibility: hidden;
  width: 380px;
  z-index: 2147483000;
}

#ttaw-widget.ttaw-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 220ms ease-out, transform 220ms ease-out, visibility 0s 0ms,
    width 220ms ease-out, height 220ms ease-out;
  visibility: visible;
}

#ttaw-widget.ttaw-expanded {
  height: 700px;
  width: 540px;
}

#ttaw-header {
  align-items: center;
  background: var(--ttaw-brand);
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  height: 64px;
  padding: 0 12px 0 16px;
}

.ttaw-hdr-avatar {
  align-items: center;
  background: #fff;
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  letter-spacing: .02em;
  width: 36px;
}

.ttaw-hdr-avatar img {
  display: block;
  max-height: 30px;
  max-width: 30px;
  object-fit: contain;
  width: auto;
}

.ttaw-hdr-name-wrap {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.ttaw-hdr-name {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
.ttaw-hdr-badge {
  background: var(--ttaw-accent-green);
  border-radius: 4px;
  color: #12320a;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  padding: 2px 5px;
}
*/

#ttaw-close,
#ttaw-menu-btn {
  align-items: center;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: 32px;
  justify-content: center;
  padding: 0;
  transition: background 150ms;
  width: 32px;
}

#ttaw-close:hover,
#ttaw-menu-btn:hover {
  background: rgba(255, 255, 255, .24);
}

#ttaw-menu-dropdown {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
  overflow: hidden;
  padding: 4px 0;
  position: absolute;
  right: 12px;
  top: 64px;
  width: 188px;
  z-index: 20;
}

#ttaw-menu-dropdown[hidden] {
  display: none;
}

#ttaw-widget-root .ttaw-menu-item {
  align-items: center;
  background: none;
  border: 0;
  color: var(--ttaw-text-primary);
  cursor: pointer;
  display: flex;
  font-size: var(--ttaw-menu-font-size) !important;
  gap: 10px;
  padding: 10px 14px;
  text-align: left;
  transition: background 120ms;
  width: 100%;
}

.ttaw-menu-item:hover {
  background: #f5f7f8;
}

.ttaw-menu-item svg {
  color: var(--ttaw-text-muted);
  flex-shrink: 0;
}

#ttaw-home-screen {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  padding: 28px 20px 16px;
}

#ttaw-home-screen.ttaw-hidden {
  display: none;
}

.ttaw-home-greeting {
  color: var(--ttaw-text-primary);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.ttaw-home-sub {
  color: var(--ttaw-text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 24px;
  text-align: center;
}

#ttaw-chips {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
}

#ttaw-widget-root .ttaw-chip {
  background: #fff;
  border: 1.5px solid var(--ttaw-border);
  border-radius: 24px;
  color: var(--ttaw-text-primary);
  cursor: pointer;
  font-size: var(--ttaw-suggestion-font-size) !important;
  line-height: 1.35;
  padding: 10px 15px;
  text-align: left;
  transition: border-color 140ms, background 140ms, color 140ms;
  width: 100%;
}

.ttaw-chip:hover {
  background: #eef6fd;
  border-color: var(--ttaw-brand-hover);
  color: var(--ttaw-brand);
}

.ttaw-chips-hint {
  color: var(--ttaw-text-muted);
  font-size: 12px;
  margin-top: 16px;
  text-align: center;
}

#ttaw-conv-view {
  display: none;
  flex: 1;
  overflow: hidden;
}

#ttaw-conv-view.ttaw-visible {
  display: flex;
  flex-direction: column;
}

#ttaw-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  scroll-behavior: smooth;
}

.ttaw-msg {
  align-items: flex-end;
  display: flex;
  gap: 7px;
  margin-top: 4px;
}

.ttaw-msg.ttaw-turn-start {
  margin-top: 14px;
}

.ttaw-msg.ttaw-user {
  flex-direction: row-reverse;
}

.ttaw-msg-avatar {
  align-items: center;
  align-self: flex-end;
  background: #fff;
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.ttaw-msg-avatar img {
  display: block;
  height: 18px;
  max-width: 20px;
  object-fit: contain;
  width: auto;
}

.ttaw-msg.ttaw-user .ttaw-msg-avatar {
  display: none;
}

.ttaw-msg.ttaw-no-avatar .ttaw-msg-avatar {
  visibility: hidden;
}

.ttaw-bubble {
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  font-size: 14px;
  line-height: 1.5;
  max-width: 73%;
  padding: 10px 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.ttaw-msg.ttaw-bot .ttaw-bubble {
  background: var(--ttaw-bot-bubble);
  color: var(--ttaw-text-primary);
}

.ttaw-msg.ttaw-user .ttaw-bubble {
  background: var(--ttaw-brand);
  color: #fff;
}

.ttaw-bubble a {
  text-decoration: underline;
}

.ttaw-msg.ttaw-bot .ttaw-bubble a {
  color: var(--ttaw-brand);
}

.ttaw-msg.ttaw-user .ttaw-bubble a {
  color: rgba(255, 255, 255, .92);
}

.ttaw-msg.ttaw-bot.ttaw-last-in-seq .ttaw-bubble {
  border-bottom-left-radius: 4px;
}

.ttaw-msg.ttaw-user.ttaw-last-in-seq .ttaw-bubble {
  border-bottom-right-radius: 4px;
}

.ttaw-typing-dots {
  align-items: center;
  display: flex;
  gap: 5px;
  padding: 12px 14px;
}

.ttaw-typing-dots span {
  animation: ttaw-dot-bounce 1.6s infinite ease-in-out;
  background: var(--ttaw-brand);
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

.ttaw-typing-dots span:nth-child(2) {
  animation-delay: .27s;
}

.ttaw-typing-dots span:nth-child(3) {
  animation-delay: .54s;
}

@keyframes ttaw-dot-bounce {
  0%, 80%, 100% { opacity: .35; transform: scale(.55); }
  40% { opacity: 1; transform: scale(1); }
}

.ttaw-sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

#ttaw-composer {
  background: #fff;
  border-top: 1px solid var(--ttaw-border);
  flex-shrink: 0;
  padding: 10px 12px;
}

.ttaw-input-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

#ttaw-widget-root #ttaw-q {
  background: #fff;
  border: 1.5px solid var(--ttaw-border);
  border-radius: 16px;
  color: var(--ttaw-text-primary);
  display: block;
  flex: 1;
  font-size: var(--ttaw-input-font-size) !important;
  line-height: 1.45;
  max-height: 120px;
  min-height: 40px;
  outline: none;
  overflow-y: hidden;
  padding: 9px 14px;
  resize: none;
  transition: border-color 150ms;
}

#ttaw-q:focus {
  border-color: var(--ttaw-brand);
}

#ttaw-q::placeholder {
  color: var(--ttaw-text-muted);
}

#ttaw-send {
  align-items: center;
  background: var(--ttaw-brand);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: 38px;
  justify-content: center;
  padding: 0;
  transition: background 150ms, transform 120ms;
  width: 38px;
}

#ttaw-send:hover:not(:disabled) {
  background: var(--ttaw-brand-hover);
}

#ttaw-send:active:not(:disabled) {
  transform: scale(.92);
}

#ttaw-send:disabled {
  background: #b8c4cc;
  cursor: default;
}

@media (max-width: 600px) {
  #ttaw-widget {
    border-radius: 0;
    bottom: auto;
    height: 100%;
    inset: 0;
    right: auto;
    width: 100%;
  }

  #ttaw-widget.ttaw-expanded {
    height: 100%;
    width: 100%;
  }

  #ttaw-launcher {
    bottom: 16px;
    right: 16px;
  }
}
