.aquaphor-chat {
  /* Colors strictly from aquaphor.ru brand palette (blue shades only):
     #164CB5 primary blue, #2960CC light blue, #2B1B35 text,
     #F1F6FF / #F0F5F9 tints, #E4E7EB borders. */
  --aq-primary: #164CB5;
  --aq-primary-hover: #1248B2;
  --aq-primary-light: #F1F6FF;
  --aq-primary-dark: #073FAB;
  --aq-bg: #F0F5F9;
  --aq-surface: #ffffff;
  --aq-text: #2B1B35;
  --aq-text-secondary: rgba(43, 27, 53, 0.5);
  --aq-border: #E4E7EB;
  --aq-border-light: #E4E7EB;
  --aq-error-bg: #fff3f3;
  --aq-error-text: #c62828;
  --aq-error-border: #ffcdd2;
  --aq-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --aq-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --aq-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.08);
  --aq-radius: 14px;
  --aq-radius-sm: 10px;
  --aq-radius-xs: 8px;
  --aq-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --aq-font-size: 15px;
  --aq-line-height: 1.55;
  --aq-transition: 0.3s ease;

  font-family: var(--aq-font);
  font-size: var(--aq-font-size);
  line-height: var(--aq-line-height);
  color: var(--aq-text);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
}

.aquaphor-chat *,
.aquaphor-chat *::before,
.aquaphor-chat *::after {
  box-sizing: inherit;
}

.aquaphor-chat__form {
  position: relative;
  background: var(--aq-surface);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: clip;
  border: 1px solid var(--aq-border);
  border-radius: 16px;
}

.aquaphor-chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #0049D9;
  color: #fff;
  flex-shrink: 0;
}

.aquaphor-chat__header-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aquaphor-chat__header-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  color: #fff;
}

.aquaphor-chat__header-content {
  flex: 1;
  min-width: 0;
}

.aquaphor-chat__header-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.aquaphor-chat__header-subtitle {
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.3;
  margin-top: 1px;
}

.aquaphor-chat__reset {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--aq-transition), opacity var(--aq-transition);
  opacity: 0.7;
}

/* .aquaphor-chat__history-btn { */
/*   display: flex; */
/*   align-items: center; */
/*   justify-content: center; */
/*   width: 30px; */
/*   height: 30px; */
/*   padding: 0; */
/*   border: none; */
/*   border-radius: 50%; */
/*   background: rgba(255, 255, 255, 0.15); */
/*   color: #fff; */
/*   cursor: pointer; */
/*   flex-shrink: 0; */
/*   transition: background var(--aq-transition), opacity var(--aq-transition); */
/*   opacity: 0.7; */
/* } */

.aquaphor-chat__reset:hover {
  background: rgba(255, 255, 255, 0.28);
  opacity: 1;
}

.aquaphor-chat__reset:active {
  background: rgba(255, 255, 255, 0.35);
}

.aquaphor-chat__reset svg {
  width: 16px;
  height: 16px;
  display: block;
}

.aquaphor-chat__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--aq-transition), opacity var(--aq-transition);
  opacity: 0.7;
}

.aquaphor-chat__close:hover {
  background: rgba(255, 255, 255, 0.28);
  opacity: 1;
}

.aquaphor-chat__close:active {
  background: rgba(255, 255, 255, 0.35);
}

.aquaphor-chat__close svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* .aquaphor-chat__history-btn svg { */
/*   width: 16px; */
/*   height: 16px; */
/*   display: block; */
/* } */

/* .aquaphor-chat__history-btn:hover { */
/*   background: rgba(255, 255, 255, 0.28); */
/*   opacity: 1; */
/* } */

/* .aquaphor-chat__history-panel { */
/*   position: absolute; */
/*   top: 0; */
/*   left: 0; */
/*   right: 0; */
/*   bottom: 0; */
/*   background: var(--aq-bg); */
/*   z-index: 10; */
/*   flex-direction: column; */
/*   display: none; */
/*   overflow: hidden; */
/* } */

/* .aquaphor-chat__history-title { */
/*   padding: 16px 20px; */
/*   font-size: 15px; */
/*   font-weight: 600; */
/*   color: var(--aq-text); */
/*   border-bottom: 1px solid var(--aq-border); */
/*   flex-shrink: 0; */
/* } */

/* .aquaphor-chat__history-list { */
/*   flex: 1; */
/*   overflow-y: auto; */
/*   padding: 8px 0; */
/*   scrollbar-width: none; */
/* } */

/* .aquaphor-chat__history-list::-webkit-scrollbar { */
/*   display: none; */
/* } */

/* .aquaphor-chat__history-item { */
/*   padding: 12px 20px; */
/*   cursor: pointer; */
/*   transition: background var(--aq-transition); */
/*   border-bottom: 1px solid var(--aq-border); */
/* } */

/* .aquaphor-chat__history-item:hover { */
/*   background: color-mix(in srgb, var(--aq-text) 6%, transparent); */
/* } */

/* .aquaphor-chat__history-item--active { */
/*   background: color-mix(in srgb, var(--aq-primary) 10%, transparent); */
/*   border-left: 3px solid var(--aq-primary); */
/* } */

/* .aquaphor-chat__history-item-task { */
/*   font-size: 14px; */
/*   color: var(--aq-text); */
/*   margin-bottom: 2px; */
/*   white-space: nowrap; */
/*   overflow: hidden; */
/*   text-overflow: ellipsis; */
/* } */

/* .aquaphor-chat__history-item-date { */
/*   font-size: 12px; */
/*   color: #999; */
/* } */

/* .aquaphor-chat__history-loading, */
/* .aquaphor-chat__history-empty, */
/* .aquaphor-chat__history-error { */
/*   padding: 40px 20px; */
/*   text-align: center; */
/*   color: #999; */
/*   font-size: 14px; */
/* } */

.aquaphor-chat__disclaimer {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--aq-text-secondary);
  background: color-mix(in srgb, var(--aq-primary) 8%, transparent);
  border: 1px solid var(--aq-border-light);
  border-radius: 12px;
  margin-bottom: 8px;
}

.aquaphor-chat__history {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--aq-bg);
  min-height: 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.aquaphor-chat__history::-webkit-scrollbar {
  display: none;
}

.aquaphor-chat__skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  animation: aq-skeleton-pulse 1.5s ease-in-out infinite;
}

.aquaphor-chat__skeleton-line {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: aq-skeleton-shimmer 1.5s ease-in-out infinite;
}

.aquaphor-chat__skeleton-line:nth-child(1) {
  width: 70%;
}

.aquaphor-chat__skeleton-line:nth-child(2) {
  width: 85%;
}

.aquaphor-chat__skeleton-line:nth-child(3) {
  width: 40%;
}

@keyframes aq-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes aq-skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.aquaphor-chat__message {
  display: flex;
  max-width: 88%;
  animation: aq-msg-in 0.3s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.04s);
  contain: content;
}

.aquaphor-chat__message--user {
  align-self: flex-end;
}

.aquaphor-chat__message--model {
  align-self: flex-start;
}

/* У welcome нет собственного аватара, но текст сохраняет ту же линию,
   что и обычное сообщение ассистента: место капельки остаётся пустым. */
.aquaphor-chat__message--without-avatar {
  margin-left: 40px;
  max-width: calc(88% - 40px);
}

.aquaphor-chat__message--error {
  align-self: center;
  max-width: 90%;
}

.aquaphor-chat__message--error .aquaphor-chat__row,
.aquaphor-chat__message--error .aquaphor-chat__content {
  width: 100%;
}

.aquaphor-chat__message--error .aquaphor-chat__msg-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--aq-error-bg);
  border: 1px solid var(--aq-error-border);
  color: var(--aq-error-text);
  border-radius: var(--aq-radius);
  text-align: left;
  flex-wrap: wrap;
}

.aquaphor-chat__error-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.aquaphor-chat__error-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  color: var(--aq-error-text);
}

.aquaphor-chat__error-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
}

.aquaphor-chat__error-timer {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
  padding-top: 4px;
  border-top: 1px solid var(--aq-error-border);
  margin-top: 4px;
  text-align: center;
}

@keyframes aq-msg-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.aquaphor-chat__row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  width: 100%;
}

.aquaphor-chat__message--user .aquaphor-chat__row {
  flex-direction: row-reverse;
}

.aquaphor-chat__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex: none;
}

.aquaphor-chat__avatar svg {
  width: 16px;
  height: 16px;
  display: block;
}

.aquaphor-chat__avatar--bot {
  background: #0049D9;
  box-shadow: 0 2px 6px rgba(0, 73, 217, 0.25);
}

.aquaphor-chat__avatar--bot svg {
  color: #fff;
}

.aquaphor-chat__avatar--user {
  background: var(--aq-border);
}

.aquaphor-chat__avatar--user svg {
  color: var(--aq-text-secondary);
}

.aquaphor-chat__message--error .aquaphor-chat__avatar {
  display: none;
}

.aquaphor-chat__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.aquaphor-chat__msg-body {
  padding: 10px 14px;
  border-radius: var(--aq-radius);
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.aquaphor-chat__message--user .aquaphor-chat__msg-body {
  background: var(--aq-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}

.aquaphor-chat__message--user .aquaphor-chat__msg-body a {
  color: #b3d4ff;
}

.aquaphor-chat__message--model .aquaphor-chat__msg-body {
  background: var(--aq-surface);
  background-color: var(--aq-surface);
  color: var(--aq-text);
  border: 1px solid var(--aq-border-light);
  border-bottom-left-radius: 4px;
  box-shadow: var(--aq-shadow-sm);
}

.aquaphor-chat__message--error .aquaphor-chat__msg-body {
  background: var(--aq-error-bg);
  border: 1px solid var(--aq-error-border);
  color: var(--aq-error-text);
  border-radius: var(--aq-radius);
  text-align: center;
}

.aquaphor-chat__msg-body a {
  color: var(--aq-primary);
  text-decoration: none;
  font-weight: 500;
}

.aquaphor-chat__msg-body a:hover {
  text-decoration: underline;
}

.aquaphor-chat__msg-body .aquaphor-chat__cart-link {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 18px;
  background: var(--aq-primary);
  color: #ffffff;
  border-radius: var(--aq-radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--aq-transition);
}

.aquaphor-chat__msg-body .aquaphor-chat__cart-link:hover {
  background: var(--aq-primary-hover);
  text-decoration: none;
}

.aquaphor-chat__msg-body p,
.aquaphor-chat__msg-body li,
.aquaphor-chat__msg-body div,
.aquaphor-chat__msg-body span,
.aquaphor-chat__msg-body strong,
.aquaphor-chat__msg-body b {
  color: inherit;
}

.aquaphor-chat__msg-body blockquote {
  margin: 12px 0;
  padding: 0;
  border: none;
}

.aquaphor-chat__msg-body blockquote a {
  display: inline-block;
  padding: 10px 20px;
  background: var(--aq-primary);
  color: #fff;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: background var(--aq-transition);
}

.aquaphor-chat__msg-body blockquote a:hover {
  background: var(--aq-primary-hover);
  text-decoration: none;
}

.aquaphor-chat__msg-body p {
  margin: 6px 0;
}

.aquaphor-chat__msg-body p:first-child {
  margin-top: 0;
}

.aquaphor-chat__msg-body p:last-child {
  margin-bottom: 0;
}

.aquaphor-chat__msg-body ul,
.aquaphor-chat__msg-body ol {
  margin: 6px 0;
  padding-left: 22px;
}

.aquaphor-chat__msg-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--aq-radius-xs);
}

.aquaphor-chat__msg-body hr {
  border: none;
  border-top: 1px solid var(--aq-border-light);
  margin: 10px 0;
}

.aquaphor-chat__msg-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 13px;
}

.aquaphor-chat__msg-body th,
.aquaphor-chat__msg-body td {
  border: 1px solid var(--aq-border);
  padding: 7px 11px;
  text-align: left;
  /* Длинные слова/значения не должны раздвигать таблицу шире пузыря */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.aquaphor-chat__msg-body th {
  background: var(--aq-primary-light);
  font-weight: 600;
}

.aquaphor-chat__msg-body code {
  background: #f0f0f0;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.9em;
}

.aquaphor-chat__msg-body pre code {
  display: block;
  background: #f5f5f5;
  padding: 10px 14px;
  border-radius: 6px;
  overflow-x: auto;
}

.aquaphor-chat__message--user .aquaphor-chat__msg-body code {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.aquaphor-chat__message--user .aquaphor-chat__msg-body pre code {
  background: rgba(255, 255, 255, 0.1);
}

.aquaphor-chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aquaphor-chat__suggestion-btn--sm {
  padding: 5px 12px !important;
  font-size: 12px !important;
  border-radius: 16px !important;
}

.aquaphor-chat__qr-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 8px;
}

.aquaphor-chat__qr-group--answered .aquaphor-chat__suggestion-btn--sm:not(.aquaphor-chat__suggestion--chosen) {
  background: #f0f0f0;
  border-color: #d0d0d0;
  color: #b0b0b0;
}

/* Multi-select: don't grey out unselected buttons */
.aquaphor-chat__qr-group.aq-multi.aquaphor-chat__qr-group--answered .aquaphor-chat__suggestion-btn--sm:not(.aquaphor-chat__suggestion--chosen) {
  background: var(--aq-surface);
  border-color: var(--aq-primary);
  color: var(--aq-primary);
}

/* Multi-select: subtle tint for selected buttons */
.aquaphor-chat__qr-group.aq-multi .aquaphor-chat__suggestion-btn--sm.aquaphor-chat__suggestion--chosen {
  background: #E8F0FE;
  border-color: var(--aq-primary);
  color: var(--aq-primary);
}

/* Inline options row */
.aquaphor-chat__qr-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Custom answer input */
.aquaphor-chat__qr-custom {
  width: 100%;
  margin-top: 6px;
}

.aquaphor-chat__qr-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--aq-border);
  border-radius: 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--aq-surface);
  color: var(--aq-text);
  outline: none;
  box-sizing: border-box;
}

.aquaphor-chat__qr-input:focus {
  border-color: var(--aq-primary);
}

.aquaphor-chat__qr-input:disabled {
  background: #f5f5f5;
  color: #b0b0b0;
}

/* Submit button row (multi only) */
.aquaphor-chat__qr-submit-row {
  width: 100%;
  margin-top: 8px;
}

.aquaphor-chat__qr-submit-btn {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: var(--aq-primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--aq-transition);
  font-family: inherit;
}

.aquaphor-chat__qr-submit-btn:hover {
  background: var(--aq-primary-hover);
}

.aquaphor-chat__qr-submit-btn:disabled {
  background: var(--aq-border);
  color: var(--aq-text-secondary);
  cursor: not-allowed;
}

.aquaphor-chat__suggestion-btn {
  background: var(--aq-surface);
  border: 1.5px solid var(--aq-primary);
  color: var(--aq-primary);
  display: inline-block;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 24px;
  transition: all var(--aq-transition);
  font-weight: 500;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
}

.aquaphor-chat__suggestion-btn:hover {
  background: var(--aq-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 73, 217, 0.2);
}

.aquaphor-chat__suggestion-btn:active {
  transform: translateY(0);
}

.aquaphor-chat__suggestion-btn:disabled {
  background: #f0f0f0;
  border-color: #d0d0d0;
  color: #b0b0b0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.aquaphor-chat__suggestion--chosen.aquaphor-chat__suggestion-btn {
  background: var(--aq-primary-light);
  border-color: var(--aq-primary);
  color: var(--aq-primary);
}

.aquaphor-chat__suggestion--chosen.aquaphor-chat__suggestion-btn:hover {
  background: var(--aq-primary-light);
  border-color: var(--aq-primary);
  color: var(--aq-primary);
  filter: brightness(0.95);
}

.aquaphor-chat__suggestion--chosen:disabled {
  background: var(--aq-primary-light);
  border-color: var(--aq-primary);
  color: var(--aq-primary);
}

.aquaphor-chat__message--has-cards {
  max-width: 100%;
}

/* Карточки + сообщение без аватара: под аватар всё равно резервируется
   margin-left, поэтому 100% ширины переполняет историю на его величину и
   весь чат приходится скроллить по горизонтали. Вычитаем этот отступ. */
.aquaphor-chat__message--without-avatar.aquaphor-chat__message--has-cards {
  max-width: calc(100% - 40px);
}

.aquaphor-chat__cards-wrapper {
  position: relative;
  width: 100%;
  overflow: visible;
}

.aquaphor-chat__cards-nav {
  display: none;
}

.aquaphor-chat__cards {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  touch-action: pan-x pinch-zoom;
  scroll-snap-type: x mandatory;
  /* overflow-x:auto заставляет браузер считать overflow-y тоже как auto, и
     контейнер обрезает появление карточки (translateY(6px)) и её тень.
     Даём вертикальный «воздух» и компенсируем его отрицательными полями,
     чтобы не раздувать отступ сообщения. */
  padding: 8px 0;
  margin: -8px 0;
}

.aquaphor-chat__cards::-webkit-scrollbar {
  display: none;
}

.aquaphor-chat__card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 280px;
  min-width: 0;
  padding: 12px;
  text-decoration: none;
  color: var(--aq-text);
  border: 1px solid var(--aq-border-light);
  border-radius: 12px;
  background: var(--aq-surface);
  transition: box-shadow var(--aq-transition), transform var(--aq-transition);
  animation: aq-card-in 0.3s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.06s);
  box-sizing: border-box;
}

@keyframes aq-card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.aquaphor-chat__card:hover {
  box-shadow: var(--aq-shadow-hover);
  transform: translateY(-2px);
}

.aquaphor-chat__card:active {
  transform: translateY(0);
}

.aquaphor-chat__card-cover {
  position: relative;
  width: 100%;
  height: 120px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--aq-radius-xs);
  background: var(--aq-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.aquaphor-chat__card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.aquaphor-chat__card-discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 9px;
  border-radius: var(--aq-radius-xs);
  background: #164CB5;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.aquaphor-chat__card-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1;
  min-width: 0;
  gap: 4px;
}

.aquaphor-chat__card-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.aquaphor-chat__card-description {
  font-size: 12px;
  color: var(--aq-text-secondary);
  line-height: 1.4;
}

.aquaphor-chat__card-price {
  font-weight: 700;
  color: var(--aq-primary);
  font-size: 16px;
}

.aquaphor-chat__card-price--old {
  font-size: 12px;
  font-weight: 600;
  color: var(--aq-text-secondary);
  text-decoration: line-through;
}

.aquaphor-chat__card-price--gift {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #164CB5;
  white-space: nowrap;
}

.aquaphor-chat__card-price-icon {
  display: inline-flex;
  color: #2960CC;
}

.aquaphor-chat__card-gift-note {
  margin-top: 2px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--aq-radius-xs);
  background: #ffffff;
  border: 1px solid #164CB5;
  color: #2B1B35;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.aquaphor-chat__card-gift-note-icon {
  display: inline-flex;
  flex-shrink: 0;
  margin-top: 1px;
  color: #2960CC;
}

.aquaphor-chat__card-gift-of {
  font-size: 11px;
  color: rgba(43, 27, 53, 0.5);
  line-height: 1.35;
  word-break: break-word;
}

.aquaphor-chat__card-gift-of strong {
  color: #2B1B35;
  font-weight: 700;
}

.aquaphor-chat__card--gift {
  border-color: #164CB5;
  background: #ffffff;
}

.aquaphor-chat__card-action {
  text-align: center;
  width: 100%;
  background: var(--aq-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--aq-radius-xs);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--aq-transition), border-color var(--aq-transition);
  flex-shrink: 0;
  box-sizing: border-box;
}

.aquaphor-chat__card:hover .aquaphor-chat__card-action {
  background: var(--aq-primary-hover);
}

.aquaphor-chat__card--unavailable {
  opacity: 0.82;
}

.aquaphor-chat__card--unavailable .aquaphor-chat__card-action {
  background: var(--aq-bg);
  border-color: var(--aq-border-light);
  color: var(--aq-text-secondary);
}

.aquaphor-chat__card--unavailable:hover .aquaphor-chat__card-action {
  background: var(--aq-bg);
  color: var(--aq-text-secondary);
}

.aquaphor-chat__attach {
  display: none !important;
  position: relative;
}

.aquaphor-chat__attach:hover {
  background: var(--aq-primary-light);
  border-color: var(--aq-primary);
}

.aquaphor-chat__attach svg {
  display: block;
  width: 20px;
  height: 20px;
  color: var(--aq-text-secondary);
  transition: color var(--aq-transition);
}

.aquaphor-chat__attach:hover svg {
  color: var(--aq-primary);
}

.aquaphor-chat__attach--drag {
  background: var(--aq-primary-light);
  border-color: var(--aq-primary);
  transform: scale(1.05);
}

.aquaphor-chat__attach--drag svg {
  color: var(--aq-primary);
}

.aquaphor-chat__attach--has {
  border-style: solid;
  border-color: #28a745;
  background: #f0faf0;
}

.aquaphor-chat__attach--has svg {
  color: #28a745;
}

.aquaphor-chat__file-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  top: 0;
  left: 0;
}

.aquaphor-chat__file-name {
  position: absolute;
  bottom: -16px;
  font-size: 9px;
  text-align: center;
  white-space: nowrap;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--aq-text-secondary);
  display: none;
  line-height: 1.2;
}

.aquaphor-chat__file-name--has {
  display: block;
}

.aquaphor-chat__input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--aq-border-light);
  background: var(--aq-surface);
  flex-shrink: 0;
}

.aquaphor-chat__input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--aq-border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.3;
  resize: none;
  overflow: hidden;
  height: 44px;
  min-height: 44px;
  max-height: 140px;
  outline: none;
  transition: border-color var(--aq-transition), box-shadow var(--aq-transition);
  background: var(--aq-bg);
  color: var(--aq-text);
}

.aquaphor-chat__input:focus {
  border-color: var(--aq-primary);
  box-shadow: 0 0 0 3px rgba(0, 73, 217, 0.1);
}

.aquaphor-chat__input::placeholder {
  color: #bbb;
}

.aquaphor-chat__send {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 22px;
  background: var(--aq-primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--aq-transition), transform 0.1s ease;
  font-weight: 600;
  height: 44px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.aquaphor-chat__send::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0%;
  transition: none;
  pointer-events: none;
}

.aquaphor-chat__send:active::after {
  background-size: 1000%;
  transition: background-size 0.4s ease;
}

.aquaphor-chat__send:hover {
  background: var(--aq-primary-hover);
}

.aquaphor-chat__send:active {
  transform: scale(0.97);
}

.aquaphor-chat__send:disabled {
  background: #d0d0d0;
  cursor: not-allowed;
  transform: none;
}

.aquaphor-chat__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 10;
  animation: aq-overlay-in 0.15s ease;
}

@keyframes aq-overlay-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.aquaphor-chat--loading .aquaphor-chat__overlay {
  display: flex;
}

.aquaphor-chat--loading .aquaphor-chat__input,
.aquaphor-chat--loading .aquaphor-chat__send {
  pointer-events: none;
  opacity: 0.5;
}

.aquaphor-chat__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e8ecf5;
  border-top: 3px solid var(--aq-primary);
  border-radius: 50%;
  animation: aq-spin 0.7s linear infinite;
  margin-bottom: 12px;
}

@keyframes aq-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.aquaphor-chat__loading-text {
  color: var(--aq-primary);
  font-size: 13px;
  font-weight: 500;
}

.aquaphor-chat__consent-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: aq-overlay-in 0.15s ease;
}

.aquaphor-chat__consent-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: 100%;
  background: #ffffff;
  background: var(--aq-surface);
  border: 1px solid var(--aq-border-light);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
  padding: 24px 20px 20px;
  overflow: hidden;
  animation: aq-consent-card-in 0.2s ease;
}

@keyframes aq-consent-card-in {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.aquaphor-chat__consent-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 18px;
}

.aquaphor-chat__consent-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 73, 217, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--aq-primary);
  animation: aq-consent-pop 0.35s ease;
}

.aquaphor-chat__consent-icon svg {
  display: block;
}

@keyframes aq-consent-pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.aquaphor-chat__consent-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: var(--aq-text);
}

.aquaphor-chat__consent-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.aquaphor-chat__consent-item {
  margin-bottom: 12px;
}

.aquaphor-chat__consent-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--aq-text-secondary);
  padding: 4px 2px;
}

.aquaphor-chat__consent-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  background: var(--aq-surface);
  border: 1px solid var(--aq-border-light);
  border-radius: var(--aq-radius);
  box-shadow: var(--aq-shadow-sm);
  cursor: pointer;
  transition: border-color var(--aq-transition), box-shadow var(--aq-transition), transform var(--aq-transition);
}

.aquaphor-chat__consent-check:hover {
  border-color: rgba(0, 73, 217, 0.4);
  box-shadow: var(--aq-shadow);
}

.aquaphor-chat__consent-check:has(.aquaphor-chat__consent-checkbox:checked) {
  border-color: rgba(0, 73, 217, 0.35);
  background: var(--aq-primary-light);
}

.aquaphor-chat__consent-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.aquaphor-chat__consent-checkbox-ui {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid #cfd6e4;
  border-radius: 7px;
  background: #fff;
  position: relative;
  transition: border-color var(--aq-transition), background var(--aq-transition), box-shadow var(--aq-transition);
}

.aquaphor-chat__consent-check:hover .aquaphor-chat__consent-checkbox-ui {
  border-color: var(--aq-primary);
}

.aquaphor-chat__consent-checkbox:checked + .aquaphor-chat__consent-checkbox-ui {
  background: var(--aq-primary);
  border-color: var(--aq-primary);
  box-shadow: 0 2px 8px rgba(0, 73, 217, 0.35);
}

.aquaphor-chat__consent-checkbox:checked + .aquaphor-chat__consent-checkbox-ui::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  animation: aq-check-pop 0.2s ease;
}

@keyframes aq-check-pop {
  from {
    transform: rotate(45deg) scale(0.4);
    opacity: 0;
  }

  to {
    transform: rotate(45deg) scale(1);
    opacity: 1;
  }
}

.aquaphor-chat__consent-checkbox:focus-visible + .aquaphor-chat__consent-checkbox-ui {
  outline: 2px solid var(--aq-primary);
  outline-offset: 2px;
}

.aquaphor-chat__consent-check-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--aq-text);
}

.aquaphor-chat__consent-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.aquaphor-chat__consent-link {
  font-size: 12.5px;
  text-align: center;
  color: var(--aq-primary);
  text-decoration: none;
}

.aquaphor-chat__consent-link:hover {
  text-decoration: underline;
}

.aquaphor-chat__consent-button {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--aq-primary) 0%, var(--aq-primary-dark) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 73, 217, 0.3);
  transition: background var(--aq-transition), box-shadow var(--aq-transition), opacity var(--aq-transition), transform 0.1s ease;
}

.aquaphor-chat__consent-button:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(0, 73, 217, 0.4);
  transform: translateY(-1px);
}

.aquaphor-chat__consent-button:active:not(:disabled) {
  transform: scale(0.98);
}

.aquaphor-chat__consent-button:disabled {
  background: linear-gradient(135deg, #cfd6e4 0%, #b9c1d4 100%);
  box-shadow: none;
  cursor: not-allowed;
}

.aquaphor-chat__photo-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 26px 18px;
  border: 2px dashed #b9c8ee;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--aq-primary-light) 100%);
  box-shadow: var(--aq-shadow-sm);
  cursor: pointer;
  text-align: center;
  position: relative;
  transition: border-color var(--aq-transition), border-style var(--aq-transition),
    background var(--aq-transition), box-shadow var(--aq-transition);
}

.aquaphor-chat__photo-zone:hover,
.aquaphor-chat__photo-zone--drag {
  border-color: var(--aq-primary);
  background: linear-gradient(180deg, #ffffff 0%, #e9f1ff 100%);
  box-shadow: var(--aq-shadow);
}

.aquaphor-chat__photo-zone--drag {
  border-style: solid;
}

.aquaphor-chat__photo-zone-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--aq-primary-light);
  box-shadow: var(--aq-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--aq-primary);
  margin-bottom: 6px;
}

.aquaphor-chat__photo-zone-icon svg {
  display: block;
}

.aquaphor-chat__photo-zone-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--aq-text);
}

.aquaphor-chat__photo-zone-hint {
  font-size: 12.5px;
  color: var(--aq-text-secondary);
}

.aquaphor-chat__photo-zone-btn {
  margin-top: 10px;
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  background: var(--aq-primary);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--aq-shadow-sm);
  transition: background var(--aq-transition), box-shadow var(--aq-transition);
}

.aquaphor-chat__photo-zone-btn:hover {
  background: var(--aq-primary-hover);
  box-shadow: var(--aq-shadow);
}

/* Photo picked: preview with upload status instead of the drop zone */
.aquaphor-chat__photo-zone--has {
  border-style: solid;
  border-color: #28a745;
  cursor: default;
  pointer-events: auto;
}

.aquaphor-chat__photo-zone--retry {
  border-color: var(--aq-border);
}

.aquaphor-chat__photo-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.aquaphor-chat__photo-preview-img {
  max-width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--aq-shadow-sm);
  border: 1px solid var(--aq-border-light);
}

.aquaphor-chat__photo-preview-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--aq-text);
}

.aquaphor-chat__photo-zone--done .aquaphor-chat__photo-preview-status {
  color: #28a745;
}

.aquaphor-chat__photo-preview-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--aq-primary-light);
  border-top-color: var(--aq-primary);
  border-radius: 50%;
  animation: aq-photo-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes aq-photo-spin {
  to {
    transform: rotate(360deg);
  }
}

.aquaphor-chat__photo-preview-check {
  display: inline-flex;
  color: #28a745;
  flex-shrink: 0;
}

.aquaphor-chat__photo-preview-check svg {
  display: block;
}

.aquaphor-chat__typing {
  align-self: flex-start;
}

.aquaphor-chat__typing .aquaphor-chat__content {
  flex-direction: row;
  align-items: center;
}

.aquaphor-chat__typing .aquaphor-chat__msg-body {
  background: var(--aq-surface);
  border: 1px solid var(--aq-border-light);
  border-bottom-left-radius: 4px;
  padding: 14px 18px;
  display: flex;
  gap: 5px;
  align-items: center;
  box-shadow: var(--aq-shadow-sm);
}

.aquaphor-chat__typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbb;
  animation: aq-typing-bounce 1.4s ease-in-out infinite;
}

.aquaphor-chat__typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.aquaphor-chat__typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.aquaphor-chat__typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes aq-typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    background: #ccc;
  }

  30% {
    transform: translateY(-8px);
    background: var(--aq-primary);
  }
}

.aquaphor-chat__questionnaire {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0;
}

.aquaphor-chat__questionnaire-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aquaphor-chat__questionnaire-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--aq-text);
  line-height: 1.4;
}

.aquaphor-chat__questionnaire-required {
  color: var(--aq-error-text);
}

.aquaphor-chat__questionnaire-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--aq-border);
  border-radius: var(--aq-radius-xs);
  font-size: 14px;
  font-family: inherit;
  background: var(--aq-surface);
  color: var(--aq-text);
  box-sizing: border-box;
  transition: border-color var(--aq-transition), box-shadow var(--aq-transition);
}

.aquaphor-chat__questionnaire-input::placeholder {
  color: var(--aq-text-secondary);
}

.aquaphor-chat__questionnaire-input:focus {
  border-color: var(--aq-primary);
  box-shadow: 0 0 0 3px var(--aq-primary-light);
  outline: none;
  background: var(--aq-surface);
}

.aquaphor-chat__questionnaire-number-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aquaphor-chat__questionnaire-number-wrap .aquaphor-chat__questionnaire-input {
  flex: 1;
}

.aquaphor-chat__questionnaire-unit {
  font-size: 13px;
  color: var(--aq-text-secondary);
  white-space: nowrap;
}

.aquaphor-chat__questionnaire-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aquaphor-chat__questionnaire-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--aq-radius-xs);
  transition: background var(--aq-transition);
}

.aquaphor-chat__questionnaire-option:hover {
  background: var(--aq-primary-light);
}

.aquaphor-chat__questionnaire-option input[type="radio"],
.aquaphor-chat__questionnaire-option input[type="checkbox"] {
  accent-color: var(--aq-primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.aquaphor-chat__questionnaire-submit {
  align-self: flex-start;
  padding: 10px 24px;
  background: var(--aq-primary);
  color: #fff;
  border: none;
  border-radius: var(--aq-radius-xs);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--aq-transition), transform 0.1s ease;
}

.aquaphor-chat__questionnaire-submit:hover {
  background: var(--aq-primary-hover);
}

.aquaphor-chat__questionnaire-submit:active {
  transform: scale(0.97);
}

.aquaphor-chat__questionnaire-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.aquaphor-chat__questionnaire-error .aquaphor-chat__questionnaire-input {
  border-color: var(--aq-error-text);
  box-shadow: 0 0 0 3px var(--aq-error-bg);
}

.aquaphor-chat__questionnaire-error .aquaphor-chat__questionnaire-options {
  border-left: 3px solid var(--aq-error-text);
  padding-left: 10px;
}

.aquaphor-chat__questionnaire-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.aquaphor-chat__questionnaire-field-head .aquaphor-chat__questionnaire-label {
  flex-shrink: 0;
}

.aquaphor-chat__questionnaire-field-error {
  font-size: 12px;
  line-height: 1.3;
  color: var(--aq-error-text);
  text-align: right;
}

.aquaphor-chat__questionnaire-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.aquaphor-chat__questionnaire-actions-error {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--aq-error-text);
}

.aquaphor-chat__questionnaire-success {
  font-size: 14px;
  line-height: 1.5;
  color: var(--aq-text);
  background: var(--aq-surface);
  border: 1.5px solid var(--aq-border);
  border-radius: var(--aq-radius-xs);
  padding: 12px 14px;
}

@media (prefers-reduced-motion: reduce) {

  .aquaphor-chat__message,
  .aquaphor-chat__card {
    animation: none;
  }

  .aquaphor-chat__typing-dot {
    animation: none;
  }

  .aquaphor-chat__send::after {
    display: none;
  }

  .aquaphor-chat__spinner {
    animation: none;
  }

  .aquaphor-chat-overlay,
  .aquaphor-chat-box,
  .aquaphor-chat-overlay--open .aquaphor-chat-box {
    transition: none;
    transform: none;
    opacity: 1;
  }

  .aquaphor-chat-overlay--open {
    opacity: 1;
  }

  .aquaphor-chat__skeleton,
  .aquaphor-chat__skeleton-line {
    animation: none;
  }

  .aquaphor-chat__skeleton-line {
    background: #e0e0e0;
  }

}



@keyframes aq-blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 479px) {
  .aquaphor-chat__form {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .aquaphor-chat__header {
    padding: 12px 14px;
    gap: 10px;
  }

  .aquaphor-chat__header-icon {
    width: 28px;
    height: 28px;
  }

  .aquaphor-chat__header-icon svg {
    width: 16px;
    height: 16px;
  }

  .aquaphor-chat__header-title {
    font-size: 15px;
  }

  .aquaphor-chat__header-subtitle {
    font-size: 11px;
  }

  .aquaphor-chat__disclaimer {
    padding: 6px 14px;
    font-size: 10px;
  }

  .aquaphor-chat__history {
    padding: 12px 10px;
    gap: 6px;
  }

  .aquaphor-chat__message {
    max-width: 92%;
  }

  .aquaphor-chat__message--without-avatar {
    margin-left: 36px;
    max-width: calc(92% - 36px);
  }

  .aquaphor-chat__message--without-avatar.aquaphor-chat__message--has-cards {
    max-width: calc(100% - 36px);
  }

  .aquaphor-chat__avatar {
    width: 28px;
    height: 28px;
  }

  .aquaphor-chat__avatar svg {
    width: 14px;
    height: 14px;
  }

  .aquaphor-chat__msg-body {
    padding: 9px 12px;
    font-size: 14px;
  }

  .aquaphor-chat__input-row {
    padding: 10px 10px;
    gap: 8px;
  }

  .aquaphor-chat__input {
    padding: 9px 12px;
    font-size: 16px;
  }

  .aquaphor-chat__send {
    padding: 0 16px;
    font-size: 14px;
  }

  .aquaphor-chat__card {
    padding: 10px;
  }

  .aquaphor-chat__card-cover {
    width: 100%;
    height: 100px;
  }

  .aquaphor-chat__cards {
    gap: 10px;
  }

  .aquaphor-chat__suggestion-btn {
    padding: 10px 16px;
    font-size: 13px;
    width: 100%;
    text-align: center;
  }

  .aquaphor-chat__suggestions {
    flex-direction: column;
  }
}

@media (min-width: 480px) and (max-width: 768px) {
  .aquaphor-chat__history {
    padding: 14px 14px;
  }

  .aquaphor-chat__header {
    padding: 14px 16px;
  }

  .aquaphor-chat__input-row {
    padding: 10px 14px;
  }

  .aquaphor-chat__card-cover {
    height: 100px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .aquaphor-chat__suggestion-btn:hover {
    background: var(--aq-surface);
    color: var(--aq-primary);
    transform: none;
    box-shadow: none;
  }

  .aquaphor-chat__card:hover {
    box-shadow: none;
    transform: none;
  }

  .aquaphor-chat__card:hover .aquaphor-chat__card-action {
    background: var(--aq-primary);
  }

  .aquaphor-chat__send:hover {
    background: var(--aq-primary);
  }

  .aquaphor-chat__attach:hover {
    background: var(--aq-bg);
    border-color: var(--aq-border);
  }

  .aquaphor-chat__attach:hover svg {
    color: var(--aq-text-secondary);
  }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .aquaphor-chat__input-row {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

.aquaphor-chat-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.aquaphor-chat-overlay--open {
  opacity: 1;
  visibility: visible;
  z-index: 2147483647;
}

/* Плавающая кнопка запуска чата на странице-владельце (embed) */
.chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #0049D9;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 73, 217, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 2147483647;
}
.chat-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(0, 73, 217, 0.5);
}
.chat-launcher svg {
  width: 26px;
  height: 26px;
  display: block;
}
.chat-launcher[hidden] {
  display: none;
}

body:has(.aquaphor-chat-overlay--open) jdiv#jcont,
body:has(.aquaphor-chat-overlay--open) jdiv[id^="jivo"] {
  visibility: hidden !important;
}

/* On mobile the live-chat (Jivo) launcher overlaps the AI-chat launcher in the
   bottom-right corner. Hide Jivo's mobile button while the AI chat is present.
   Jivo root has no id (jdiv.jv-mobile / globalClass__*), so target the mobile
   button wrapper directly. */
@media (max-width: 768px) {
  jdiv.__jivoMobileButton,
  jdiv.jv-mobile [class*="button"],
  jdiv#jcont [class*="button"],
  jdiv[id^="jivo"] [class*="button"] {
    display: none !important;
  }
}

.aquaphor-chat-box {
  position: relative;
  width: 90vw;
  max-width: 720px;
  height: 80vh;
  max-height: 800px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  background: #ffffff;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.aquaphor-chat-overlay--open .aquaphor-chat-box {
  transform: scale(1);
  opacity: 1;
}

.aquaphor-chat-box .aquaphor-chat {
  height: 100%;
  background: #ffffff;
}

.aquaphor-chat-box .aquaphor-chat__form {
  border: none;
  border-radius: 0;
}

@media (max-width: 768px) {
  .aquaphor-chat-box {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .aquaphor-chat__header {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .aquaphor-chat__cards {
    gap: 10px;
    padding: 8px 0;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .aquaphor-chat__card {
    /* Ряд начинается с левого края (как на ПК); карточка занимает ~72%
       ширины экрана — остаётся читаемой, а следующая выглядывает сбоку,
       подсказывая, что ряд можно листать. */
    flex: 0 0 72%;
  }

  .aquaphor-chat-overlay {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .aquaphor-chat__input-row {
    position: sticky;
    bottom: 0;
    z-index: 5;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  }

}



/* ── Файл анализа воды в пузыре пользователя ─────────────────────────── */
.aquaphor-chat__msg-attach {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin-bottom: 2px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
}

.aquaphor-chat__msg-attach-icon {
  display: inline-flex;
  flex-shrink: 0;
}

.aquaphor-chat__msg-attach-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.aquaphor-chat__msg-attach-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

