/* Laplace demo widget — «Онлайн-консультант». Namespaced under .lpw-.
   Font inherited from the site body. Animations use only transform/opacity
   (GPU-composited) to stay smooth. */

.lpw-root, .lpw-root * { box-sizing: border-box; }

.lpw-root {
  --lpw-olive: #818D69;
  --lpw-olive-d: #6d7857;
  --lpw-terra: #C49267;
  --lpw-ink: #2f3330;
  --lpw-muted: #7a7f78;
  --lpw-line: #e7e7e1;
  --lpw-bg: #ffffff;
  --lpw-chat-bg: #f5f6f1;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483646; /* above the site's third-party corner widgets */
  font-family: inherit;
  line-height: 1.45;
  color: var(--lpw-ink);
}

/* ---- FAB ---- */
.lpw-fab {
  position: relative;
  width: 60px; height: 60px;
  border: none; border-radius: 50%;
  background: linear-gradient(145deg, var(--lpw-olive), var(--lpw-olive-d));
  color: #fff; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(129,141,105,.45), 0 2px 6px rgba(0,0,0,.15);
  transition: transform .2s cubic-bezier(.22,.61,.36,1), box-shadow .2s ease;
  animation: lpw-fab-in .35s cubic-bezier(.22,.61,.36,1) both;
}
.lpw-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 28px rgba(129,141,105,.55), 0 3px 8px rgba(0,0,0,.18); }
.lpw-fab:active { transform: scale(.95); }
.lpw-fab svg { width: 28px; height: 28px; display: block; }
.lpw-fab::after { /* soft pulse ring */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--lpw-olive);
  animation: lpw-pulse 2.6s ease-out infinite;
  pointer-events: none;
}
.lpw-fab-dot {
  position: absolute; top: 3px; right: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #46c07a; border: 2px solid #fff;
}
.lpw-root.lpw-open .lpw-fab { display: none; }

/* ---- Panel ---- */
.lpw-panel {
  display: none;
  flex-direction: column;
  width: 372px; max-width: 372px;
  max-height: min(80vh, 640px);
  background: var(--lpw-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(45,45,45,.28), 0 4px 14px rgba(45,45,45,.12);
  transform-origin: bottom right;
  will-change: opacity, transform;
}
.lpw-root.lpw-open .lpw-panel { display: flex; animation: lpw-panel-in .24s cubic-bezier(.22,.61,.36,1) both; }
.lpw-root.lpw-closing .lpw-panel { display: flex; animation: lpw-panel-out .18s ease-in both; }

/* ---- Header ---- */
.lpw-head {
  background: linear-gradient(135deg, var(--lpw-olive), var(--lpw-olive-d));
  color: #fff;
  padding: 15px 15px 16px;
  display: flex; align-items: center; gap: 11px;
}
.lpw-head-av {
  position: relative; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
}
.lpw-head-av svg { width: 22px; height: 22px; }
.lpw-head-status {
  position: absolute; right: -1px; bottom: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #46c07a; border: 2px solid #74805d;
}
.lpw-head-titles { flex: 1; min-width: 0; }
.lpw-title { font-size: 16px; font-weight: 700; }
.lpw-subtitle { font-size: 12px; opacity: .92; margin-top: 1px; }
.lpw-head-back, .lpw-head-close {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.lpw-head-back:hover, .lpw-head-close:hover { background: rgba(255,255,255,.28); }
.lpw-head-back svg, .lpw-head-close svg { width: 18px; height: 18px; display: block; }
.lpw-head-back { display: none; }
.lpw-root.lpw-chat .lpw-head-back { display: flex; }

/* ---- Menu ---- */
.lpw-menu { padding: 18px 16px 8px; overflow-y: auto; }
.lpw-root.lpw-chat .lpw-menu { display: none; }
.lpw-menu-hint { font-size: 13px; color: var(--lpw-muted); margin: 0 2px 12px; font-weight: 500; }

.lpw-card {
  display: flex; align-items: center; gap: 13px;
  width: 100%; text-align: left;
  border: 1px solid var(--lpw-line);
  background: #fff; color: var(--lpw-ink);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  cursor: pointer; text-decoration: none; font: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.lpw-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(45,45,45,.1); border-color: #d7d7cf; }
.lpw-card:active { transform: translateY(0); }
.lpw-card-ico {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(129,141,105,.12); color: var(--lpw-olive);
}
.lpw-card-ico svg { width: 21px; height: 21px; display: block; }
.lpw-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lpw-card-t { font-size: 14.5px; font-weight: 600; }
.lpw-card-s { font-size: 12.5px; color: var(--lpw-muted); margin-top: 2px; }
.lpw-card-arrow { flex: none; color: #c4c4bb; display: flex; transition: transform .16s ease, color .16s ease; }
.lpw-card-arrow svg { width: 18px; height: 18px; display: block; }
.lpw-card:hover .lpw-card-arrow { transform: translateX(3px); color: var(--lpw-terra); }

.lpw-card.lpw-primary {
  background: linear-gradient(135deg, var(--lpw-olive), var(--lpw-olive-d));
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px rgba(129,141,105,.32);
}
.lpw-card.lpw-primary:hover { box-shadow: 0 12px 26px rgba(129,141,105,.42); }
.lpw-card.lpw-primary .lpw-card-ico { background: rgba(255,255,255,.2); color: #fff; }
.lpw-card.lpw-primary .lpw-card-s { color: rgba(255,255,255,.88); }
.lpw-card.lpw-primary .lpw-card-arrow { color: rgba(255,255,255,.85); }

.lpw-foot { padding: 6px 18px 14px; font-size: 11px; color: var(--lpw-muted); text-align: center; }
.lpw-root.lpw-chat .lpw-foot { display: none; }

/* ---- Chat ---- */
.lpw-chat-wrap { display: none; flex-direction: column; flex: 1; min-height: 0; }
.lpw-root.lpw-chat .lpw-chat-wrap { display: flex; }
/* Fixed height in chat mode so the log flexes and the input stays pinned and
   visible even on short screens (flex:1 needs a bounded container). */
.lpw-root.lpw-chat .lpw-panel { height: min(82vh, 560px); }

.lpw-log {
  flex: 1; overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--lpw-chat-bg);
  min-height: 0;
}
.lpw-log::-webkit-scrollbar { width: 6px; }
.lpw-log::-webkit-scrollbar-thumb { background: rgba(0,0,0,.14); border-radius: 3px; }

.lpw-row { display: flex; align-items: flex-end; gap: 8px; animation: lpw-msg-in .2s ease both; }
.lpw-row-me { flex-direction: row-reverse; }
.lpw-av {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lpw-olive), var(--lpw-olive-d));
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.lpw-av svg { width: 15px; height: 15px; display: block; }

.lpw-msg {
  max-width: 78%; padding: 10px 13px; border-radius: 16px;
  font-size: 14px; white-space: pre-wrap; word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.lpw-msg.lpw-bot { background: #fff; color: var(--lpw-ink); border-bottom-left-radius: 5px; }
.lpw-msg.lpw-me { background: linear-gradient(135deg, var(--lpw-olive), var(--lpw-olive-d)); color: #fff; border-bottom-right-radius: 5px; }
.lpw-msg a { color: inherit; text-decoration: underline; }

.lpw-msg.lpw-typing { display: flex; gap: 4px; align-items: center; padding: 13px 14px; }
.lpw-msg.lpw-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--lpw-muted); animation: lpw-blink 1.2s infinite; }
.lpw-msg.lpw-typing span:nth-child(2) { animation-delay: .2s; }
.lpw-msg.lpw-typing span:nth-child(3) { animation-delay: .4s; }

.lpw-compose {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 12px 12px; border-top: 1px solid var(--lpw-line); background: #fff;
}
.lpw-input {
  flex: 1; resize: none; border: 1px solid var(--lpw-line);
  border-radius: 22px; padding: 10px 14px; font: inherit; font-size: 14px;
  max-height: 100px; outline: none; background: #f7f7f3;
  transition: border-color .15s ease, background .15s ease;
}
.lpw-input:focus { border-color: var(--lpw-olive); background: #fff; }
.lpw-send {
  flex: none; width: 44px; height: 44px; border: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--lpw-olive), var(--lpw-olive-d)); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(129,141,105,.4);
  transition: transform .15s ease, opacity .15s ease;
}
.lpw-send:hover { transform: scale(1.06); }
.lpw-send:active { transform: scale(.93); }
.lpw-send:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.lpw-send svg { width: 19px; height: 19px; display: block; }

/* ---- Form success / error ---- */
.lpw-form-done { padding: 24px 18px; text-align: center; font-size: 15px; color: var(--lpw-olive); font-weight: 600; }
.lpw-form-error { margin-top: 10px; color: #c0392b; font-size: 13.5px; }

/* ---- Keyframes ---- */
@keyframes lpw-panel-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lpw-panel-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes lpw-fab-in { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
@keyframes lpw-msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lpw-blink { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes lpw-pulse { 0% { transform: scale(1); opacity: .4; } 70% { transform: scale(1.55); opacity: 0; } 100% { opacity: 0; } }

/* The site ships third-party bottom-right promo/callback widgets ("tl-widget",
   a gift launcher that also expands to a big box) with near-max z-index. They
   collide with our FAB/panel, so we hide them on the demo — our consultant
   replaces their function. The booking "УЗНАТЬ ЦЕНЫ" widget is left intact. */
.tl-widgets-container,
[class*="tl-widget"],
[id^="tlFrame"] { display: none !important; }

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .lpw-root { right: 16px; bottom: 16px; left: 16px; }
  .lpw-panel { width: auto; max-width: none; max-height: 82vh; }
  .lpw-fab { margin-left: auto; }
  .lpw-root:not(.lpw-open) { left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .lpw-root.lpw-open .lpw-panel,
  .lpw-root.lpw-closing .lpw-panel,
  .lpw-fab, .lpw-fab::after, .lpw-row,
  .lpw-msg.lpw-typing span { animation: none !important; }
}
