:root {
  --slc-navy: #153a42;
  --slc-navy-deep: #0f2d33;
  --slc-cream: #f5efcf;
  --slc-cream-soft: #fbf8e9;
  --slc-ink: #16343a;
  --slc-muted: #6b7777;
  --slc-line: rgba(21, 58, 66, 0.14);
  --slc-white: #ffffff;
  --slc-shadow: 0 24px 70px rgba(8, 29, 33, .22);
}

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

.slc-root {
  position: fixed;
  z-index: 999999;
  right: 24px;
  bottom: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--slc-ink);
}

.slc-launcher {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  padding: 0;
  border: 3px solid rgba(255,255,255,.96);
  background: var(--slc-cream);
  box-shadow: 0 12px 34px rgba(12, 46, 53, .28);
  cursor: pointer;
  overflow: visible;
  position: relative;
  display: grid;
  place-items: center;
  transition: transform .18s ease, box-shadow .18s ease;
}

.slc-launcher:hover { transform: translateY(-2px); box-shadow: 0 15px 38px rgba(12, 46, 53, .34); }
.slc-launcher img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.slc-launcher-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #2ca86d;
  border: 2px solid #fff;
}

.slc-panel {
  position: absolute;
  right: 0;
  bottom: 82px;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 120px));
  background: var(--slc-white);
  border: 1px solid var(--slc-line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--slc-shadow);
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  animation: slc-pop .16s ease-out;
}

@keyframes slc-pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.slc-header {
  background: var(--slc-navy);
  color: #fff;
  padding: 16px 16px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.slc-header-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.slc-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.86); background: var(--slc-cream); flex: 0 0 auto; }
.slc-title { font-weight: 750; font-size: 16px; letter-spacing: -.01em; line-height: 1.2; }
.slc-subtitle { font-size: 11.5px; opacity: .8; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.slc-close { border: 0; background: transparent; color: #fff; font-size: 28px; line-height: 1; width: 34px; height: 34px; cursor: pointer; border-radius: 50%; }
.slc-close:hover { background: rgba(255,255,255,.1); }

.slc-legal-note {
  padding: 9px 14px;
  font-size: 10.5px;
  line-height: 1.35;
  background: var(--slc-cream-soft);
  border-bottom: 1px solid var(--slc-line);
  color: #556667;
}

.slc-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 8px;
  background: linear-gradient(#fff, #fff 78%, #fcfbf5);
  scroll-behavior: smooth;
}
.slc-msg { display: flex; margin: 0 0 10px; }
.slc-msg-user { justify-content: flex-end; }
.slc-bubble {
  max-width: 84%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}
.slc-msg-bot .slc-bubble { background: #f3f5f3; color: #21383b; border-bottom-left-radius: 5px; }
.slc-msg-user .slc-bubble { background: var(--slc-navy); color: #fff; border-bottom-right-radius: 5px; }
.slc-typing .slc-bubble { color: #7a8585; font-style: italic; }

.slc-quick {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 12px 10px;
  scrollbar-width: none;
  background: #fff;
}
.slc-quick::-webkit-scrollbar { display: none; }
.slc-quick button {
  flex: 0 0 auto;
  border: 1px solid rgba(21,58,66,.18);
  color: var(--slc-navy);
  background: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11.5px;
  cursor: pointer;
}
.slc-quick button:hover { background: var(--slc-cream-soft); }

.slc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 10px;
  background: #fff;
}
.slc-consult, .slc-call {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.slc-consult { border: 0; background: var(--slc-cream); color: var(--slc-navy-deep); }
.slc-call { border: 1px solid var(--slc-line); background: #fff; color: var(--slc-navy); }

.slc-lead {
  position: absolute;
  inset: 76px 12px 62px;
  z-index: 5;
  background: #fff;
  border: 1px solid var(--slc-line);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(11,43,49,.2);
  padding: 16px;
  overflow-y: auto;
}
.slc-lead-title { font-size: 17px; font-weight: 800; color: var(--slc-navy); margin-bottom: 5px; }
.slc-lead-note { font-size: 10.5px; line-height: 1.4; color: var(--slc-muted); margin-bottom: 12px; }
.slc-lead input, .slc-lead select, .slc-lead textarea {
  width: 100%;
  border: 1px solid rgba(21,58,66,.16);
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  font-size: 13px;
  color: var(--slc-ink);
  background: #fff;
  margin-bottom: 9px;
  outline: none;
}
.slc-lead input:focus, .slc-lead select:focus, .slc-lead textarea:focus { border-color: rgba(21,58,66,.5); box-shadow: 0 0 0 3px rgba(21,58,66,.07); }
.slc-lead-buttons { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.slc-primary, .slc-secondary { border-radius: 10px; min-height: 40px; font-weight: 750; cursor: pointer; }
.slc-primary { border: 0; background: var(--slc-navy); color: #fff; }
.slc-secondary { border: 1px solid var(--slc-line); background: #fff; color: var(--slc-navy); }
.slc-lead-status { min-height: 18px; font-size: 11px; line-height: 1.35; margin-top: 8px; color: var(--slc-muted); }

.slc-inputbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 8px;
  border-top: 1px solid var(--slc-line);
  background: #fff;
}
.slc-inputbar textarea {
  flex: 1 1 auto;
  resize: none;
  max-height: 96px;
  min-height: 42px;
  border: 1px solid rgba(21,58,66,.16);
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.35;
  outline: none;
  color: var(--slc-ink);
}
.slc-inputbar textarea:focus { border-color: rgba(21,58,66,.5); box-shadow: 0 0 0 3px rgba(21,58,66,.06); }
.slc-inputbar button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  background: var(--slc-navy);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.slc-inputbar button:disabled { opacity: .5; cursor: default; }
.slc-powered { text-align: center; color: #8a9493; font-size: 9.5px; padding: 0 10px 8px; background: #fff; }

@media (max-width: 520px) {
  .slc-root { right: 14px; bottom: 14px; }
  .slc-launcher { width: 62px; height: 62px; }
  .slc-panel {
    position: fixed;
    right: 10px;
    left: 10px;
    bottom: 86px;
    width: auto;
    height: min(680px, calc(100dvh - 106px));
    border-radius: 20px;
  }
  .slc-subtitle { max-width: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  .slc-panel { animation: none; }
  .slc-launcher { transition: none; }
  .slc-messages { scroll-behavior: auto; }
}
