.spkg-chat {
  --chat-edge: clamp(12px, 2vw, 26px);
  --chat-bottom: max(var(--chat-edge), env(safe-area-inset-bottom));
  --chat-right: max(var(--chat-edge), env(safe-area-inset-right));
}
.chat-launch {
  position: fixed;
  z-index: 6;
  right: var(--chat-right);
  bottom: var(--chat-bottom);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 17px;
  border: 1px solid #e397b2;
  border-radius: 24px;
  background: #951245;
  color: #fff;
  box-shadow: 0 3px 13px #40132b35;
}
.chat-launch:hover, .chat-form button:hover { background: #761037; }
.chat-icon {
  position: relative;
  border: 1.5px solid currentColor;
  border-radius: 7px 7px 7px 1px;
  width: 22px;
  line-height: 14px;
  text-align: center;
  font: bold 14px/14px Arial, sans-serif;
}
.spkg-chat dialog {
  position: fixed;
  inset: auto var(--chat-right) calc(var(--chat-bottom) + var(--chat-keyboard, 0px)) auto;
  width: min(390px, calc(100vw - 2 * var(--chat-edge)));
  height: min(535px, calc(100dvh - 2 * var(--chat-edge) - var(--chat-keyboard, 0px)));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cfacba;
  border-radius: 19px;
  background: #fffafc;
  color: #361a29;
  box-shadow: 0 15px 52px #36152845;
  font: inherit;
}
.spkg-chat dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
.spkg-chat dialog::backdrop { background: #2f152323; }
html:has(#ask-spkg[open]) { overflow: hidden; }
body:has(.chat-launch:not([hidden])) .foot { padding-bottom: max(76px, calc(64px + env(safe-area-inset-bottom))); }
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 16px 13px 20px;
  background: #521531; color: white;
}
.chat-head h2 { color: white; font-size: 21px; line-height: 1.2; }
.chat-head p { margin: 2px 0 0; color: #f4d0df; font-size: 13px; }
.chat-close {
  flex: none; width: 44px; height: 44px;
  border: 1px solid #935c73; border-radius: 50%; background: transparent;
  color: white; font: 25px/1 Arial,sans-serif;
}
.chat-head button:focus-visible { outline-color: #ffd2e2; }
.chat-history {
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto; overscroll-behavior: contain; padding: 15px;
  overflow-wrap: anywhere; font-size: 15px; line-height: 1.5;
}
.chat-message {
  align-self: start; flex: none; max-width: 100%; padding: 10px 13px;
  border: 1px solid #ebdce2; border-radius: 3px 14px 14px;
  background: white;
}
.chat-message.user { align-self: end; border: 0; border-radius: 14px 3px 14px 14px; background: #fae0eb; }
.chat-message a { color: #951245; text-decoration: underline; text-underline-offset: 3px; }
.chat-links, .chat-choices { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 7px; }
.chat-links a { display: inline-flex; align-items: center; min-height: 36px; }
.chat-choices { flex-direction: column; align-items: stretch; }
.chat-choices button, .chat-prompts button {
  min-height: 36px; padding: 6px 10px; border: 1px solid #ddb6c7;
  border-radius: 9px; background: #fff; color: #8d1542; font-size: 14px;
}
.chat-choices button { text-align: start; }
.chat-choices button:hover, .chat-prompts button:hover { background: #fbeaf0; }
.chat-item { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 9px; }
.chat-item img { width: 58px; height: 69px; object-fit: contain; }
.chat-item small { display: block; color: #695360; }
.chat-price { margin-top: 7px; font-weight: 600; color: #84103b; }
.chat-facts { margin-top: 5px; font-size: 14px; }
.chat-prompts {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 7px 12px; border-top: 1px solid #eadde3; background: white;
}
.chat-prompts button { padding-inline: 8px; font-size: 13px; }
.chat-form { display: flex; gap: 6px; padding: 0 12px 12px; background: white; }
.chat-form input {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 11px;
  border: 1px solid #b891a2; border-radius: 9px; background: white; color: #361a29; font-size: 16px;
}
.chat-form button {
  min-width: 48px; min-height: 44px; border: 0; background: #951245; color: white; border-radius: 9px;
}
@media (max-height: 470px) {
  .chat-head { padding-block: 5px; }
  .chat-prompts { padding-block: 3px; }
  .chat-history { padding-block: 8px; }
}
.spkg-chat dialog.chat-compact[open] { grid-template-rows: auto minmax(0, 1fr) auto; }
.chat-compact .chat-head { padding: 2px 12px; }
.chat-compact .chat-head h2 { font-size: 16px; }
.chat-compact .chat-head p, .chat-compact .chat-prompts { display: none; }
.chat-compact .chat-close { width: 36px; height: 36px; }
.chat-compact .chat-history { padding-block: 2px; }
.chat-compact .chat-form { padding-block: 2px; }
