/* OS24 "AI-консультант" — Warm Scandinavian palette
   cream #faf6f0 · oak #b8895a · terracotta #c8654b · ink #3a3129 */

.os24adv {
  --adv-cream: #faf6f0;
  --adv-oak: #b8895a;
  --adv-terra: #c8654b;
  --adv-ink: #3a3129;
  --adv-line: #e7ddd0;
  --adv-shadow: 0 12px 40px rgba(58, 49, 41, .22);
  font-family: inherit;
}

/* floating launcher bubble */
.os24adv-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--adv-terra);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--adv-shadow);
  transition: transform .15s ease, background .15s ease;
}
.os24adv-bubble:hover { transform: translateY(-2px); background: #b6573f; }
.os24adv-bubble .os24adv-spark { font-size: 17px; line-height: 1; }
.os24adv-bubble.is-hidden { display: none; }

/* panel */
.os24adv-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  width: 370px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100vh - 40px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--adv-cream);
  border: 1px solid var(--adv-line);
  border-radius: 18px;
  box-shadow: var(--adv-shadow);
}
.os24adv-panel.is-open { display: flex; }

.os24adv-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--adv-ink);
  color: var(--adv-cream);
}
.os24adv-head strong { font-size: 15px; font-weight: 600; }
.os24adv-head .os24adv-spark { color: var(--adv-oak); }
.os24adv-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--adv-cream);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
}
.os24adv-close:hover { opacity: 1; }

/* message list */
.os24adv-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.os24adv-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.os24adv-msg.user { align-self: flex-end; background: var(--adv-oak); color: #fff; border-bottom-right-radius: 4px; }
.os24adv-msg.bot { align-self: flex-start; background: #fff; color: var(--adv-ink); border: 1px solid var(--adv-line); border-bottom-left-radius: 4px; }

/* product cards inside the chat */
.os24adv-cards { align-self: stretch; display: flex; flex-direction: column; gap: 8px; }
.os24adv-card {
  display: flex;
  gap: 10px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--adv-line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--adv-ink);
  transition: border-color .15s ease, transform .15s ease;
}
.os24adv-card:hover { border-color: var(--adv-oak); transform: translateY(-1px); }
.os24adv-card img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; flex: none; background: var(--adv-cream); }
.os24adv-card-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.os24adv-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os24adv-card-price { font-size: 13px; }
.os24adv-card-price .old { color: #9a8f82; text-decoration: line-through; margin-right: 6px; font-size: 12px; }
.os24adv-card-price .now { color: var(--adv-terra); font-weight: 700; }
.os24adv-card-cta { margin-top: 4px; font-size: 12px; color: var(--adv-oak); font-weight: 600; }

/* typing indicator */
.os24adv-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--adv-line); border-radius: 14px; }
.os24adv-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--adv-oak); opacity: .5; animation: os24adv-blink 1.2s infinite; }
.os24adv-typing span:nth-child(2) { animation-delay: .2s; }
.os24adv-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes os24adv-blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* input row */
.os24adv-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--adv-line);
  background: var(--adv-cream);
}
.os24adv-input textarea {
  flex: 1;
  resize: none;
  height: 42px;
  max-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--adv-line);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--adv-ink);
  background: #fff;
  outline: none;
}
.os24adv-input textarea:focus { border-color: var(--adv-oak); }
.os24adv-send {
  flex: none;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: var(--adv-terra);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  transition: background .15s ease;
}
.os24adv-send:hover { background: #b6573f; }
.os24adv-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 420px) {
  .os24adv-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 24px); }
  .os24adv-bubble { right: 12px; bottom: 12px; }
}
