.wkai-chat {
  --wkai-bg: #fffdf9;
  --wkai-text: #2f2b27;
  --wkai-muted: #746d65;
  --wkai-line: #e5ddd3;
  --wkai-dark: #2f2b27;
  --wkai-panel: #faf6ef;
  --wkai-warm: #efe4d7;
  --wkai-soft: #f7efe5;
  --wkai-shadow: 0 18px 55px rgba(47, 43, 39, 0.20);
  font-family: inherit;
  color: var(--wkai-text);
}

.wkai-chat,
.wkai-chat * {
  box-sizing: border-box;
}

.wkai-chat:not(.wkai-chat--inline) {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
}

.wkai-chat__button {
  border: 0;
  border-radius: 999px;
  padding: 12px 17px;
  background: var(--wkai-dark);
  color: #ffffff;
  cursor: pointer;
  box-shadow: var(--wkai-shadow);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.wkai-chat__panel[hidden],
.wkai-chat__button[hidden],
.wkai-chat__handover[hidden] {
  display: none !important;
}

.wkai-chat__button-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  background: var(--wkai-soft);
}

.wkai-chat__panel {
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 42px);
  background: var(--wkai-bg);
  border: 1px solid var(--wkai-line);
  border-radius: 18px;
  box-shadow: var(--wkai-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wkai-chat--inline .wkai-chat__button {
  display: none;
}

.wkai-chat--inline .wkai-chat__panel {
  position: static;
  width: 100%;
  max-width: 760px;
  height: 660px;
  box-shadow: none;
}

.wkai-chat__header {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, #2f2b27 0%, #4a4037 100%);
  color: #ffffff;
  padding: 16px 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.wkai-chat__header strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.wkai-chat__header span {
  display: block;
  opacity: 0.86;
  font-size: 12px;
  letter-spacing: 0.03em;
  margin-top: 3px;
}

.wkai-chat__close {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

.wkai-chat__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scroll-behavior: smooth;
  padding: 16px;
  scroll-padding-top: 16px;
  background: var(--wkai-panel);
}

.wkai-chat__message {
  max-width: 88%;
  margin: 0 0 11px;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.wkai-chat__message a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wkai-chat__message--assistant {
  background: #ffffff;
  border: 1px solid var(--wkai-line);
  border-bottom-left-radius: 6px;
  margin-right: auto;
}

.wkai-chat__message--user {
  background: var(--wkai-dark);
  color: #ffffff;
  border-bottom-right-radius: 6px;
  margin-left: auto;
}

.wkai-chat__message--thinking {
  color: var(--wkai-muted);
  font-style: italic;
}


.wkai-chat__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -3px 0 13px;
  max-width: 92%;
}

.wkai-chat__choices button {
  border: 1px solid var(--wkai-line);
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  color: var(--wkai-text);
  box-shadow: 0 3px 12px rgba(47, 43, 39, 0.04);
}

.wkai-chat__choices button:hover,
.wkai-chat__choices button:focus {
  background: var(--wkai-warm);
}

.wkai-chat__choices button:disabled {
  opacity: 0.55;
  cursor: default;
}

.wkai-chat__cards {
  display: grid;
  gap: 10px;
  margin: 5px 0 12px;
}

.wkai-chat__cards-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--wkai-muted);
  letter-spacing: 0.02em;
  margin: 0 0 -1px 2px;
}

.wkai-chat__card {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--wkai-line);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(47, 43, 39, 0.06);
}

.wkai-chat__card--no-image {
  grid-template-columns: 1fr;
}

.wkai-chat__card-image {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 11px;
  overflow: hidden;
  background: var(--wkai-warm);
}

.wkai-chat__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wkai-chat__card-content {
  min-width: 0;
}

.wkai-chat__card-content strong,
.wkai-chat__card-title {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 2px;
  font-weight: 700;
  color: var(--wkai-text);
  text-decoration: none;
}

.wkai-chat__card-meta {
  display: block;
  color: var(--wkai-muted);
  font-size: 12px;
  line-height: 1.3;
  margin-bottom: 4px;
}

.wkai-chat__card-title:hover,
.wkai-chat__card-title:focus {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wkai-chat__card-content p {
  margin: 0 0 7px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--wkai-text);
}

.wkai-chat__card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wkai-chat__card-actions a,
.wkai-chat__card-actions button {
  border: 1px solid var(--wkai-line);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  color: var(--wkai-text);
  background: #ffffff;
  cursor: pointer;
  font-family: inherit;
}

.wkai-chat__card-actions button:disabled {
  opacity: 0.68;
  cursor: default;
}

.wkai-chat__card-note {
  margin: 0 0 6px;
  color: var(--wkai-muted);
  font-size: 12px;
  line-height: 1.35;
}

.wkai-chat__card-note strong {
  display: inline;
  font-size: inherit;
  margin: 0;
}


.wkai-chat__product-reveal {
  max-width: 94%;
  margin: 0 0 13px;
}

.wkai-chat__product-reveal-panel {
  background: #ffffff;
  border: 1px solid var(--wkai-line);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(47, 43, 39, 0.05);
}

.wkai-chat__product-reveal-note {
  margin: 0 0 8px;
  color: var(--wkai-muted);
  font-size: 12px;
  line-height: 1.35;
}

.wkai-chat__product-reveal-button {
  border: 1px solid var(--wkai-line);
  border-radius: 999px;
  background: var(--wkai-dark);
  color: #ffffff;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.wkai-chat__product-reveal-button:disabled {
  opacity: 0.65;
  cursor: default;
}

.wkai-chat__product-reveal .wkai-chat__cards {
  margin: 8px 0 0;
}

.wkai-chat__suggestions {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--wkai-line);
  background: #ffffff;
}

.wkai-chat__suggestions button {
  flex: 0 0 auto;
  border: 1px solid var(--wkai-line);
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  cursor: pointer;
  color: var(--wkai-text);
  white-space: nowrap;
}

.wkai-chat__suggestions button:hover,
.wkai-chat__card-actions a:hover,
.wkai-chat__card-actions button:hover,
.wkai-chat__shortlist-actions button:hover,
.wkai-chat__no-match-actions button:hover {
  background: var(--wkai-warm);
}


.wkai-chat__shortlist,
.wkai-chat__no-match,
.wkai-chat__profile {
  max-width: 94%;
  margin: 0 0 13px;
  padding: 11px;
  background: #ffffff;
  border: 1px solid var(--wkai-line);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(47, 43, 39, 0.05);
}

.wkai-chat__shortlist strong,
.wkai-chat__no-match strong,
.wkai-chat__profile strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}


.wkai-chat__profile dl {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.wkai-chat__profile dt {
  font-weight: 600;
  color: var(--wkai-muted);
}

.wkai-chat__profile dd {
  margin: 0;
  color: var(--wkai-text);
}

.wkai-chat__shortlist p,
.wkai-chat__no-match p {
  margin: 0 0 9px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--wkai-muted);
}

.wkai-chat__shortlist-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--wkai-line);
  font-size: 12px;
  line-height: 1.35;
}

.wkai-chat__shortlist-row:first-of-type {
  border-top: 0;
}

.wkai-chat__shortlist-row span:first-child {
  font-weight: 600;
}

.wkai-chat__shortlist-actions,
.wkai-chat__no-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.wkai-chat__shortlist-actions button,
.wkai-chat__no-match-actions button {
  border: 1px solid var(--wkai-line);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  color: var(--wkai-text);
  background: #ffffff;
  font-family: inherit;
}

.wkai-chat__no-match-actions button:first-child,
.wkai-chat__shortlist-actions button:first-child {
  background: var(--wkai-dark);
  color: #ffffff;
  border-color: var(--wkai-dark);
}

.wkai-chat__handover {
  border-top: 1px solid var(--wkai-line);
  padding: 12px;
  background: var(--wkai-warm);
}

.wkai-chat__handover strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}

.wkai-chat__handover p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--wkai-muted);
}




.wkai-chat__handover-type {
  display: block;
  margin: 0 0 7px;
  color: var(--wkai-text);
  font-size: 12px;
  line-height: 1.35;
}

.wkai-chat__handover-type span {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.wkai-chat__file-label {
  display: block;
  margin: 0 0 7px;
  color: var(--wkai-text);
  font-size: 12px;
  line-height: 1.35;
}

.wkai-chat__file-label span {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.wkai-chat__file-label input {
  margin-bottom: 0;
}

.wkai-chat__small-note {
  margin-top: -3px !important;
  font-size: 11px !important;
}

.wkai-chat__handover input,
.wkai-chat__handover select,
.wkai-chat__handover textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 7px;
  border: 1px solid var(--wkai-line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  background: #ffffff;
  color: var(--wkai-text);
}

.wkai-chat__handover textarea {
  resize: vertical;
  min-height: 74px;
}

.wkai-chat__handover-actions {
  display: flex;
  gap: 8px;
}

.wkai-chat__handover-actions button {
  border: 0;
  border-radius: 10px;
  padding: 9px 11px;
  font-weight: 600;
  cursor: pointer;
}

.wkai-chat__handover-actions button[type="submit"] {
  background: var(--wkai-dark);
  color: #ffffff;
}

.wkai-chat__handover-actions button[type="button"] {
  background: #ffffff;
  color: var(--wkai-text);
  border: 1px solid var(--wkai-line);
}

.wkai-chat__form {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--wkai-line);
  background: #ffffff;
}

.wkai-chat__form textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  border: 1px solid var(--wkai-line);
  border-radius: 12px;
  padding: 10px 11px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.35;
  color: var(--wkai-text);
  background: #ffffff;
}

.wkai-chat__form button {
  border: 0;
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--wkai-dark);
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

.wkai-chat__form button:disabled,
.wkai-chat__form textarea:disabled,
.wkai-chat__handover button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 820px) {
  .wkai-chat__suggestions,
  .wkai-chat--keyboard .wkai-chat__suggestions {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .wkai-chat:not(.wkai-chat--inline) {
    left: 0;
    right: 0;
    bottom: var(--wkai-mobile-bottom, 0px);
    width: auto;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    transition: bottom 160ms ease;
  }

  .wkai-chat__button,
  .wkai-chat__panel {
    pointer-events: auto;
  }

  .wkai-chat__button {
    margin: 0 10px 10px 0;
  }

  .wkai-chat__panel {
    width: 100%;
    max-width: none;
    height: var(--wkai-vvh, 100vh);
    max-height: var(--wkai-vvh, 100vh);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  @supports (height: 100dvh) {
    .wkai-chat__panel {
      height: var(--wkai-vvh, 100dvh);
      max-height: var(--wkai-vvh, 100dvh);
    }
  }

  .wkai-chat__button {
    padding: 12px 15px;
  }

  .wkai-chat__header {
    padding: 12px 14px;
  }

  .wkai-chat__header strong {
    font-size: 15px;
  }

  .wkai-chat__header span {
    font-size: 11px;
  }

  .wkai-chat__close {
    min-width: 36px;
    min-height: 36px;
  }

  .wkai-chat__messages {
    padding: 13px;
    scroll-padding-top: 13px;
  }

  .wkai-chat__message {
    max-width: 94%;
    font-size: 14px;
    padding: 10px 12px;
  }

  .wkai-chat__choices {
    max-width: 100%;
    gap: 8px;
    margin: 0 0 13px;
  }

  .wkai-chat__choices button {
    padding: 9px 11px;
    font-size: 12px;
  }

  
  .wkai-chat__suggestions {
    display: none;
  }

  .wkai-chat__form {
    gap: 8px;
    padding: 10px;
  }

  .wkai-chat__form textarea {
    min-height: 40px;
    max-height: 88px;
    font-size: 16px;
    line-height: 1.25;
    padding: 9px 10px;
  }

  .wkai-chat__form button {
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .wkai-chat--keyboard .wkai-chat__panel {
    height: var(--wkai-vvh, 100vh);
    max-height: var(--wkai-vvh, 100vh);
  }

  .wkai-chat--keyboard .wkai-chat__messages {
    padding-bottom: 8px;
  }

  .wkai-chat__card {
    grid-template-columns: 66px 1fr;
  }

  .wkai-chat__card--no-image {
    grid-template-columns: 1fr;
  }

  .wkai-chat__card-image {
    width: 66px;
    height: 66px;
  }

  .wkai-chat__card-content p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-width: 360px) {
  .wkai-chat__button {
    margin-right: 8px;
    margin-bottom: 8px;
  }

  .wkai-chat__form {
    gap: 6px;
  }

  .wkai-chat__form button {
    padding-left: 10px;
    padding-right: 10px;
  }
}

.wkai-chat__feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: -2px 0 12px 12px;
  font-size: 12px;
  color: #6f6559;
}

.wkai-chat__feedback span {
  margin-right: 2px;
}

.wkai-chat__feedback button {
  border: 1px solid rgba(75, 66, 55, 0.2);
  background: #fff;
  color: #4f463d;
  border-radius: 999px;
  padding: 6px 10px;
  min-height: 30px;
  cursor: pointer;
  font: inherit;
}

.wkai-chat__feedback button:hover,
.wkai-chat__feedback button:focus {
  border-color: rgba(75, 66, 55, 0.4);
}

.wkai-chat__feedback button:disabled {
  opacity: 0.55;
  cursor: default;
}

.wkai-chat__feedback em {
  display: block;
  flex-basis: 100%;
  font-style: normal;
  color: #6f6559;
}

.wkai-chat__privacy {
  margin: 0;
  padding: 8px 14px 0;
  font-size: 11px;
  line-height: 1.35;
  color: #7a7168;
  background: #fff;
}

@media (max-width: 520px) {
  .wkai-chat__feedback {
    margin-left: 10px;
    padding-right: 8px;
  }

  .wkai-chat__feedback button {
    min-height: 34px;
    padding: 7px 11px;
  }

  .wkai-chat__privacy {
    padding: 7px 12px 0;
    font-size: 10.5px;
  }
}
