.zetso-chatbot {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 2147483000;
  font-family: Inter, system-ui, sans-serif;
}

.zetso-chatbot--left {
  right: auto;
  left: max(1rem, env(safe-area-inset-left, 0px));
}

.zetso-chatbot--left .zetso-chatbot__teaser,
.zetso-chatbot--left .zetso-chatbot__panel {
  right: auto;
  left: 0;
}

.zetso-chatbot__teaser {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.85rem 2.1rem 0.85rem 0.95rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  animation: zetsoChatTeaserIn 0.35s ease;
}

.zetso-chatbot__teaser[hidden] {
  display: none !important;
}

@keyframes zetsoChatTeaserIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.zetso-chatbot__teaser-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #0f172a;
  font-weight: 600;
}

.zetso-chatbot__teaser-close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.zetso-chatbot__launcher {
  width: 3.65rem;
  height: 3.65rem;
  border: 0;
  border-radius: 9999px;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
}

.zetso-chatbot__launcher:hover {
  transform: scale(1.04);
}

.zetso-chatbot__launcher-emoji {
  font-size: 1.55rem;
  line-height: 1;
}

.zetso-chatbot__launcher-dot {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 9999px;
  background: #22c55e;
  border: 2px solid #fff;
}

.zetso-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(22rem, calc(100vw - 2rem));
  height: min(28rem, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  animation: zetsoChatPanelIn 0.28s ease;
}

.zetso-chatbot__panel[hidden] {
  display: none !important;
}

@keyframes zetsoChatPanelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.zetso-chatbot__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border-bottom: 1px solid #e2e8f0;
}

.zetso-chatbot__head-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.zetso-chatbot__head-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid #dbeafe;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}

.zetso-chatbot__head-meta strong {
  display: block;
  font-size: 0.92rem;
  color: #0f172a;
}

.zetso-chatbot__head-status {
  display: block;
  font-size: 0.74rem;
  color: #16a34a;
  font-weight: 600;
}

.zetso-chatbot__head-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 9999px;
  background: #fff;
  color: #64748b;
  font-size: 1.2rem;
  cursor: pointer;
}

.zetso-chatbot__messages {
  flex: 1;
  overflow: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #f8fafc;
}

.zetso-chatbot__msg {
  max-width: 88%;
  padding: 0.62rem 0.78rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.zetso-chatbot__msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.zetso-chatbot__msg--user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
}

.zetso-chatbot__msg-link {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.zetso-chatbot__options {
  padding: 0.75rem 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.zetso-chatbot__option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.62rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #c7d2fe;
  background: #fff;
  color: #1e293b;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.zetso-chatbot__option:hover {
  background: #eef2ff;
  border-color: #818cf8;
}

.zetso-chatbot__option-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #6366f1;
  flex-shrink: 0;
}

.zetso-chatbot.is-open .zetso-chatbot__teaser {
  display: none;
}

.zetso-chatbot__gate {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.95rem 1rem;
  background: #fff;
}

.zetso-chatbot__gate-intro {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #334155;
  font-weight: 600;
}

.zetso-chatbot.is-gate .zetso-chatbot__messages,
.zetso-chatbot.is-gate .zetso-chatbot__options,
.zetso-chatbot.is-gate .zetso-chatbot__footer {
  display: none !important;
}

.zetso-chatbot__gate[hidden] {
  display: none !important;
}

.zetso-chatbot__footer {
  display: flex;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.zetso-chatbot__footer-btn {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.zetso-chatbot__footer-btn:hover {
  background: #f1f5f9;
}

.zetso-chatbot__contact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.zetso-chatbot__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 0.15rem;
}

.zetso-chatbot__input,
.zetso-chatbot__select,
.zetso-chatbot__textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  padding: 0.48rem 0.6rem;
  font-size: 0.84rem;
  color: #0f172a;
  background: #fff;
}

.zetso-chatbot__phone-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 42%) 1fr;
  gap: 0.4rem;
}

.zetso-chatbot__textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.zetso-chatbot__contact-error {
  margin: 0;
  font-size: 0.78rem;
  color: #b91c1c;
}

.zetso-chatbot__submit {
  margin-top: 0.25rem;
  padding: 0.58rem 0.75rem;
  border: none;
  border-radius: 9999px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.zetso-chatbot__submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 480px) {
  .zetso-chatbot__panel {
    width: calc(100vw - 1.25rem);
    height: min(70vh, 28rem);
  }
}
