.site-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family: Inter, system-ui, sans-serif;
}

.site-chat__toggle {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 26px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
  background: linear-gradient(135deg, #111827, #2563eb);
  color: #fff;
}

.site-chat__panel {
  position: absolute;
  right: 0;
  bottom: 80px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 620px;
  max-height: min(75vh, 620px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.site-chat__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
}

.site-chat__sub {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.9;
}

.site-chat__actions {
  display: flex;
  gap: 8px;
}

.site-chat__actions button {
  border: 0;
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.site-chat__messages {
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
  padding: 16px;
}

.site-chat__msg {
  max-width: 85%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.site-chat__msg--assistant {
  background: #fff;
  color: #111827;
  border-top-left-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.site-chat__msg--user {
  margin-left: auto;
  background: #1d4ed8;
  color: #fff;
  border-top-right-radius: 6px;
}

.site-chat__msg--meta {
  font-size: 12px;
  color: #64748b;
  background: transparent;
  padding: 4px 0 0;
}

.site-chat__form {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.site-chat__form textarea {
  flex: 1;
  resize: none;
  min-height: 46px;
  max-height: 120px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  padding: 12px 14px;
  outline: none;
  font: inherit;
}

.site-chat__form textarea:focus {
  border-color: #2563eb;
}

.site-chat__form button {
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  cursor: pointer;
  color: white;
  background: #111827;
  font-weight: 600;
}

@media (max-width: 640px) {
  .site-chat {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .site-chat__toggle {
    margin-left: auto;
    display: block;
  }

  .site-chat__panel {
    left: 0;
    right: 0;
    width: auto;
    height: 70vh;
    bottom: 76px;
  }
}

.site-chat__panel[hidden] {
  display: none !important;
}

.site-chat__toggle[aria-expanded="true"] {
  transform: scale(0.98);
}

.site-chat__toggle:focus-visible,
.site-chat__actions button:focus-visible,
.site-chat__form button:focus-visible,
.site-chat__form textarea:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
