.systour-assistant {
  position: fixed;
  inset: auto 24px calc(92px + env(safe-area-inset-bottom, 0px)) auto;
  z-index: 1040;
  font-family: Inter, sans-serif;
}

.systour-assistant__fab {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1b84ff;
  color: #fff;
  box-shadow: 0 18px 36px rgba(27, 132, 255, .32);
}

.systour-assistant__fab:hover,
.systour-assistant__fab:focus {
  background: #056ee9;
  color: #fff;
}

.systour-assistant__panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, calc(100vw - 24px));
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  background: var(--bs-body-bg, #fff);
  border-left: 1px solid var(--bs-border-color, #e4e6ef);
  box-shadow: -24px 0 48px rgba(15, 23, 42, .16);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform .2s ease;
}

.systour-assistant.is-open .systour-assistant__panel {
  transform: translateX(0);
}

.systour-assistant.is-open .systour-assistant__fab {
  display: none;
}

.systour-assistant__header {
  min-height: 76px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bs-border-color, #e4e6ef);
  gap: 16px;
}

.systour-assistant__mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--bs-primary-light, #eef6ff);
  color: var(--bs-primary, #1b84ff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.systour-assistant__suggestions {
  padding: 14px 18px 8px;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  overflow-x: auto;
  position: relative;
  z-index: 1;
  background: var(--bs-body-bg, #fff);
  border-bottom: 1px solid var(--bs-border-color, #e4e6ef);
  scrollbar-width: thin;
}

.systour-assistant__suggestions button {
  flex: 0 0 auto;
  border: 1px solid var(--bs-border-color, #e4e6ef);
  border-radius: 8px;
  background: var(--bs-gray-100, #f9f9f9);
  color: var(--bs-gray-700, #4b5675);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  white-space: nowrap;
}

.systour-assistant__suggestions button[hidden] {
  display: none;
}

.systour-assistant__suggestions button:hover,
.systour-assistant__suggestions button:focus {
  border-color: var(--bs-primary, #1b84ff);
  color: var(--bs-primary, #1b84ff);
}

.systour-assistant__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.systour-assistant__empty {
  border: 1px dashed var(--bs-border-color, #e4e6ef);
  border-radius: 8px;
  padding: 18px;
  background: var(--bs-gray-100, #f9f9f9);
}

.systour-assistant__message {
  display: flex;
  margin-bottom: 14px;
}

.systour-assistant__message--user {
  justify-content: flex-end;
}

.systour-assistant__bubble {
  max-width: 88%;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.systour-assistant__message--user .systour-assistant__bubble {
  background: var(--bs-primary, #1b84ff);
  color: #fff;
}

.systour-assistant__message--assistant .systour-assistant__bubble {
  background: var(--bs-gray-100, #f9f9f9);
  color: var(--bs-gray-800, #252f4a);
  border: 1px solid var(--bs-border-color, #e4e6ef);
}

.systour-assistant__meta {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.systour-assistant__meta a,
.systour-assistant__source {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #e4e6ef);
  color: var(--bs-gray-700, #4b5675);
  padding: 6px 8px;
  font-size: 12px;
  text-decoration: none;
}

.systour-assistant__composer {
  padding: 14px;
  border-top: 1px solid var(--bs-border-color, #e4e6ef);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: end;
  background: var(--bs-body-bg, #fff);
}

.systour-assistant__composer textarea {
  resize: none;
  max-height: 120px;
}

.systour-assistant.is-loading .systour-assistant__composer textarea,
.systour-assistant.is-loading .systour-assistant__composer button {
  pointer-events: none;
  opacity: .7;
}

@media (max-width: 575.98px) {
  .systour-assistant {
    inset: auto 16px calc(84px + env(safe-area-inset-bottom, 0px)) auto;
  }

  .systour-assistant__panel {
    width: 100vw;
    height: calc(100dvh - env(safe-area-inset-bottom, 0px));
  }

  .systour-assistant__header {
    min-height: 68px;
    padding: 14px;
  }

  .systour-assistant__suggestions,
  .systour-assistant__messages {
    padding-left: 14px;
    padding-right: 14px;
  }
}
