/* Чат-виджет Люмы */
.lw-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  background: #2f5d50; color: #fdf9f0;
  display: grid; place-items: center;
  box-shadow: 0 12px 28px rgba(47, 93, 80, 0.4);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), background 200ms;
}
.lw-launcher:hover { transform: scale(1.07); background: #27473d; }
.lw-launcher:focus-visible { outline: 3px solid #e8a13c; outline-offset: 3px; }
.lw-launcher svg { width: 30px; height: 30px; }
.lw-launcher .lw-badge {
  position: absolute; top: -2px; right: -2px; width: 16px; height: 16px;
  border-radius: 50%; background: #e8a13c; border: 2px solid #fbf6ee;
  animation: lw-pulse 2.4s infinite;
}
@keyframes lw-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

.lw-panel {
  position: fixed; right: 22px; bottom: 96px; z-index: 200;
  width: min(392px, calc(100vw - 24px));
  height: min(600px, calc(100vh - 130px));
  display: flex; flex-direction: column;
  background: #fffdf8; border: 1px solid #eadfcd; border-radius: 20px;
  box-shadow: 0 24px 60px rgba(42, 33, 24, 0.25);
  overflow: hidden;
  opacity: 0; transform: translateY(14px) scale(0.98); pointer-events: none;
  transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1), transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.lw-panel.lw-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.lw-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, #2f5d50, #234639); color: #fdf9f0;
}
.lw-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: #e8a13c; display: grid; place-items: center;
}
.lw-avatar svg { width: 24px; height: 24px; }
.lw-header-info { display: grid; line-height: 1.25; }
.lw-header-info b { font-size: 0.98rem; }
.lw-status { font-size: 0.76rem; color: #bcd6cc; display: inline-flex; align-items: center; gap: 5px; }
.lw-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7ed9a7; }
.lw-close {
  margin-left: auto; background: none; border: none; color: #fdf9f0;
  font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 6px; border-radius: 8px;
}
.lw-close:hover { background: rgba(255, 255, 255, 0.14); }

.lw-messages {
  flex: 1; overflow-y: auto; padding: 1rem 1rem 0.5rem;
  display: flex; flex-direction: column; gap: 0.65rem;
  background:
    radial-gradient(500px 220px at 100% 0%, rgba(232, 161, 60, 0.07), transparent 70%),
    #fbf6ee;
}
.lw-msg {
  max-width: 84%; padding: 0.65rem 0.95rem; border-radius: 16px;
  font-size: 0.92rem; line-height: 1.5; white-space: pre-line;
  animation: lw-in 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.lw-msg-bot { align-self: flex-start; background: #fffdf8; border: 1px solid #eadfcd; border-bottom-left-radius: 6px; color: #2a2118; }
.lw-msg-user { align-self: flex-end; background: #2f5d50; color: #fdf9f0; border-bottom-right-radius: 6px; }
@keyframes lw-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.lw-typing { display: inline-flex; gap: 5px; padding: 0.85rem 1rem; }
.lw-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: #b9a888;
  animation: lw-dot 1.1s infinite;
}
.lw-typing i:nth-child(2) { animation-delay: 0.18s; }
.lw-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes lw-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }

.lw-quick { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 92%; }
.lw-chip {
  border: 1px solid #cfe0d8; background: #fffdf8; color: #2f5d50;
  border-radius: 999px; padding: 0.42rem 0.85rem; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: background 160ms, transform 160ms;
}
.lw-chip:hover { background: #e3ede8; transform: translateY(-1px); }

.lw-slots { display: grid; gap: 8px; align-self: stretch; max-width: 92%; }
.lw-slot-card {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  background: #fffdf8; border: 1px solid #eadfcd; border-radius: 14px;
  padding: 0.7rem 0.9rem; animation: lw-in 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.lw-slot-card .lw-slot-when { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; font-weight: 600; color: #2a2118; }
.lw-slot-card svg { width: 18px; height: 18px; flex: none; color: #d97b29; }
.lw-slot-pick {
  border: none; background: #e8a13c; color: #2a2118; font-weight: 700; font-size: 0.8rem;
  border-radius: 999px; padding: 0.45rem 0.95rem; cursor: pointer; transition: background 160ms;
}
.lw-slot-pick:hover { background: #f0b256; }

.lw-note {
  align-self: center; font-size: 0.74rem; color: #8d7c64; background: #f3ecdd;
  border-radius: 999px; padding: 0.25rem 0.8rem; margin: 0.2rem 0;
}

.lw-form { display: flex; gap: 8px; padding: 0.8rem; border-top: 1px solid #eadfcd; background: #fffdf8; }
.lw-input {
  flex: 1; border: 1px solid #eadfcd; border-radius: 999px;
  padding: 0.65rem 1rem; font: inherit; font-size: 0.92rem; background: #fbf6ee; color: #2a2118;
}
.lw-input:focus { outline: 2px solid #e8a13c; border-color: transparent; }
.lw-send {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: none; cursor: pointer;
  background: #2f5d50; color: #fdf9f0; display: grid; place-items: center;
  transition: background 160ms, transform 160ms;
}
.lw-send:hover { background: #27473d; transform: scale(1.05); }
.lw-send:disabled { opacity: 0.5; cursor: default; transform: none; }
.lw-send svg { width: 18px; height: 18px; }

@media (max-width: 480px) {
  .lw-panel { right: 12px; bottom: 88px; border-radius: 16px; }
  .lw-launcher { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .lw-panel, .lw-msg, .lw-slot-card, .lw-launcher, .lw-chip { transition: none; animation: none; }
  .lw-launcher .lw-badge, .lw-typing i { animation: none; }
}
