body {
  padding-bottom: 96px;
}

.saaniya-chat {
  --saaniya-ink: #1c1917;
  --saaniya-cream: #fffaf3;
  --saaniya-rust: #c0562a;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

.saaniya-chat-button {
  width: 68px;
  height: 68px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #f3e6d4;
  box-shadow: 0 10px 28px rgba(28, 25, 23, 0.22);
  cursor: pointer;
  overflow: hidden;
}

.saaniya-chat-button img,
.saaniya-chat-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.saaniya-chat-panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: 80px;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px));
  background: var(--saaniya-cream);
  color: var(--saaniya-ink);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(28, 25, 23, 0.22);
  overflow: hidden;
  flex-direction: column;
}

.saaniya-chat.is-open .saaniya-chat-panel {
  display: flex;
}

.saaniya-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #3f2a22;
  color: #fffaf3;
}

.saaniya-chat-head img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  background: #f3e6d4;
}

.saaniya-chat-head strong {
  display: block;
  font-size: 1rem;
}

.saaniya-chat-head span {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
}

.saaniya-chat-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.saaniya-chat-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: #4a3329;
  color: #fffaf3;
}

.saaniya-chat-lang,
.saaniya-chat-tool,
.saaniya-chat-mic {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.14);
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  padding: 4px 10px;
  cursor: pointer;
}

.saaniya-chat-mic {
  background: #f3e6d4;
  color: #3f2a22;
  flex: 0 0 auto;
}

.saaniya-chat-mic.is-listening {
  background: #9f2d2d;
  color: #fff;
}

.saaniya-chat-mic:disabled {
  opacity: 0.45;
  cursor: default;
}

.saaniya-chat-log {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saaniya-chat-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.saaniya-chat-msg.user {
  align-self: flex-end;
  background: #3f2a22;
  color: #fffaf3;
}

.saaniya-chat-msg.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #eadfce;
}

.saaniya-chat-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.saaniya-chat-sources a {
  color: var(--saaniya-rust);
  font-size: 0.8rem;
}

.saaniya-chat-feedback {
  margin-top: 8px;
}

.saaniya-chat-feedback button {
  border: 1px solid #eadfce;
  background: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.saaniya-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eadfce;
  background: #fff;
}

.saaniya-chat-form input {
  flex: 1;
  border: 1px solid #e4d5c3;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
}

.saaniya-chat-form .saaniya-chat-send {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--saaniya-rust);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.saaniya-chat-form button:disabled {
  opacity: 0.6;
  cursor: default;
}

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

  .saaniya-chat-panel {
    width: calc(100vw - 24px);
    height: min(70vh, 520px);
  }
}
