/* TTM Assistant 0.2.0
   Privacy-first rule-based assistant. No external fonts or assets. */

.ttm-assistant {
  --ttm-blue: #193342;
  --ttm-dark: #0d202a;
  --ttm-orange: #f28c28;
  --ttm-white: #ffffff;
  --ttm-soft: #f5f7f7;
  --ttm-line: #dce3e5;
  --ttm-text: #26373f;
  --ttm-muted: #6a787f;
  --ttm-shadow: 0 18px 55px rgba(13, 32, 42, .18);

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  font-family: "Open Sans", Arial, sans-serif;
  color: var(--ttm-text);
}

.ttm-assistant *,
.ttm-assistant *::before,
.ttm-assistant *::after {
  box-sizing: border-box;
}

.ttm-assistant button,
.ttm-assistant input {
  font: inherit;
}

.ttm-assistant__launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ttm-blue);
  color: var(--ttm-white);
  box-shadow: 0 10px 28px rgba(13, 32, 42, .24);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
}


.ttm-assistant__launcher:disabled {
  opacity: .72;
  cursor: wait;
}

.ttm-assistant__launcher:hover,
.ttm-assistant__launcher:focus-visible {
  background: var(--ttm-dark);
}

.ttm-assistant__launcher-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ttm-orange);
  box-shadow: 0 0 0 4px rgba(242, 140, 40, .16);
}

.ttm-assistant__panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: min(390px, calc(100vw - 32px));
  max-height: min(650px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ttm-line);
  border-radius: 14px;
  background: var(--ttm-white);
  box-shadow: var(--ttm-shadow);
}

.ttm-assistant__panel[hidden] {
  display: none !important;
}

.ttm-assistant__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 18px 16px;
  background: var(--ttm-blue);
  color: var(--ttm-white);
}

.ttm-assistant__header > div {
  min-width: 0;
}

.ttm-assistant__title,
.ttm-assistant__subtitle {
  display: block;
}

.ttm-assistant__title {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
}

.ttm-assistant__subtitle {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, .74);
}

.ttm-assistant__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .09);
  color: var(--ttm-white);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.ttm-assistant__close:hover,
.ttm-assistant__close:focus-visible {
  background: rgba(255, 255, 255, .17);
}

.ttm-assistant__language {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--ttm-line);
  background: #fbfcfc;
}

.ttm-assistant__language button {
  padding: 5px 9px;
  border: 1px solid var(--ttm-line);
  border-radius: 999px;
  background: var(--ttm-white);
  color: var(--ttm-muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.ttm-assistant__language button[aria-pressed="true"] {
  border-color: var(--ttm-blue);
  background: var(--ttm-blue);
  color: var(--ttm-white);
}

.ttm-assistant__messages {
  min-height: 170px;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
  background: var(--ttm-white);
}

.ttm-assistant__message {
  max-width: 88%;
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ttm-assistant__message--assistant {
  margin-right: auto;
  border: 1px solid var(--ttm-line);
  border-top-left-radius: 3px;
  background: var(--ttm-soft);
  color: var(--ttm-text);
}

.ttm-assistant__message--user {
  margin-left: auto;
  border-top-right-radius: 3px;
  background: var(--ttm-blue);
  color: var(--ttm-white);
}

.ttm-assistant__links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 94%;
  margin: -5px 0 14px;
}

.ttm-assistant__link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--ttm-line);
  border-radius: 7px;
  background: var(--ttm-white);
  color: var(--ttm-blue) !important;
  text-decoration: none !important;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
}

.ttm-assistant__link:hover,
.ttm-assistant__link:focus-visible {
  border-color: var(--ttm-orange);
  color: var(--ttm-dark) !important;
}

.ttm-assistant__quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--ttm-line);
  background: #fbfcfc;
}

.ttm-assistant__quick-action {
  padding: 7px 10px;
  border: 1px solid var(--ttm-line);
  border-radius: 999px;
  background: var(--ttm-white);
  color: var(--ttm-blue);
  cursor: pointer;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
}

.ttm-assistant__quick-action:hover,
.ttm-assistant__quick-action:focus-visible {
  border-color: var(--ttm-orange);
}

.ttm-assistant__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--ttm-line);
  background: var(--ttm-white);
}

.ttm-assistant__input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cfd8db;
  border-radius: 7px;
  outline: 0;
  background: var(--ttm-white);
  color: var(--ttm-text);
  font-size: 13px;
}

.ttm-assistant__input:focus {
  border-color: var(--ttm-blue);
  box-shadow: 0 0 0 3px rgba(25, 51, 66, .08);
}

.ttm-assistant__send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--ttm-orange);
  color: var(--ttm-dark);
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
}

.ttm-assistant__send:hover,
.ttm-assistant__send:focus-visible {
  filter: brightness(.96);
}

.ttm-assistant__privacy {
  padding: 0 16px 12px;
  background: var(--ttm-white);
  color: var(--ttm-muted);
  font-size: 9px;
  line-height: 1.45;
}

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

@media (max-width: 600px) {
  .ttm-assistant {
    right: 12px;
    bottom: 12px;
  }

  .ttm-assistant__launcher {
    min-height: 46px;
    padding: 0 15px;
  }

  .ttm-assistant__panel {
    position: fixed;
    right: 10px;
    bottom: 68px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 86px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ttm-assistant__messages {
    scroll-behavior: auto;
  }
}
