.sn-ai-widget,
.sn-ai-widget * {
  box-sizing: border-box;
}

.sn-ai-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9998;
  height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(31,42,36,.18);
  background: #1f2a24;
  color: #fff;
  font: 800 14px/1 Montserrat, Arial, sans-serif;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(15,23,42,.18);
  border-radius: 0;
}

.sn-ai-panel {
  position: fixed;
  right: 18px;
  bottom: 76px;
  z-index: 9999;
  width: min(420px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 104px));
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 22px 60px rgba(15,23,42,.20);
  border-radius: 0;
  overflow: hidden;
}

.sn-ai-panel.is-open {
  display: flex;
}

.sn-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #1f2a24;
  color: #fff;
}

.sn-ai-title {
  font: 900 15px/1.2 Montserrat, Arial, sans-serif;
}

.sn-ai-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sn-ai-messages {
  padding: 14px;
  overflow: auto;
  min-height: 180px;
  max-height: 420px;
  display: grid;
  gap: 10px;
  background: #f6f7f9;
}

.sn-ai-msg {
  padding: 11px 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1f2937;
  font: 14px/1.45 Arial, sans-serif;
  white-space: pre-wrap;
}

.sn-ai-msg.user {
  background: #1f2a24;
  border-color: #1f2a24;
  color: #fff;
  margin-left: 36px;
}

.sn-ai-msg.assistant {
  margin-right: 28px;
}

.sn-ai-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.sn-ai-input {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid #d1d5db;
  padding: 10px;
  color: #111827;
  font: 14px/1.45 Arial, sans-serif;
  outline: none;
  border-radius: 0;
}

.sn-ai-input:focus {
  border-color: #1f2a24;
  box-shadow: 0 0 0 3px rgba(31,42,36,.08);
}

.sn-ai-submit {
  height: 42px;
  border: 1px solid #1f2a24;
  background: #1f2a24;
  color: #fff;
  font: 900 13px/1 Montserrat, Arial, sans-serif;
  cursor: pointer;
  border-radius: 0;
}

.sn-ai-submit:disabled {
  opacity: .55;
  cursor: wait;
}

.sn-ai-note {
  color: #6b7280;
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .sn-ai-button {
    right: 12px;
    bottom: 12px;
  }

  .sn-ai-panel {
    right: 10px;
    left: 10px;
    bottom: 68px;
    width: auto;
    max-height: calc(100vh - 88px);
  }

  .sn-ai-messages {
    max-height: 48vh;
  }
}
