.sg-chatbot {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1800;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #132033;
  pointer-events: none;
}

.sg-chatbot * {
  box-sizing: border-box;
}

.sg-chatbot:not(.is-ready) {
  display: none;
}

.sg-chatbot button,
.sg-chatbot a,
.sg-chatbot input {
  font: inherit;
}

.sg-chatbot-launcher,
.sg-chatbot-panel {
  pointer-events: auto;
}

.sg-chatbot-launcher {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  padding: 11px 14px;
  min-height: 48px;
  background: linear-gradient(135deg, rgba(16, 41, 82, .64), rgba(218, 164, 55, .6));
  color: #fff;
  box-shadow: 0 16px 36px rgba(11, 28, 56, .22);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.sg-chatbot-launcher:hover,
.sg-chatbot-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(11, 28, 56, .28);
}

.sg-chatbot-launcher-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #6ff0b7;
  box-shadow: 0 0 0 5px rgba(111, 240, 183, .15);
}

.sg-chatbot-panel {
  width: min(390px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 96px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 22px;
  background: rgba(255,255,255,.64);
  box-shadow: 0 24px 70px rgba(12, 27, 53, .28);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.sg-chatbot.is-open .sg-chatbot-panel {
  display: flex;
}

.sg-chatbot.is-open .sg-chatbot-launcher {
  display: none;
}

.sg-chatbot-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 16px 13px;
  background: linear-gradient(135deg, rgba(10, 31, 68, .72), rgba(16, 48, 92, .66));
  color: #fff;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.sg-chatbot-kicker {
  margin: 0 0 3px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.68);
}

.sg-chatbot-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
}

.sg-chatbot-subtitle {
  margin: 3px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  line-height: 1.4;
}

.sg-chatbot-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.sg-chatbot-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
  cursor: pointer;
}

.sg-chatbot-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
  min-height: 220px;
  overscroll-behavior: contain;
}

.sg-chatbot-msg {
  max-width: 88%;
  border-radius: 17px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sg-chatbot-msg.bot {
  align-self: flex-start;
  background: rgba(241,245,251,.86);
  border: 1px solid rgba(33, 71, 123, .1);
  color: #14243b;
}

.sg-chatbot-msg.user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, rgba(16, 42, 85, .9), rgba(30, 90, 141, .88));
}

.sg-chatbot-ctas,
.sg-chatbot-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sg-chatbot-ctas {
  align-self: flex-start;
  max-width: 100%;
}

.sg-chatbot-cta,
.sg-chatbot-quick button {
  border: 1px solid rgba(20, 49, 91, .15);
  border-radius: 12px;
  background: rgba(255,255,255,.88);
  color: #17315d;
  padding: 5px 7px;
  min-height: 28px;
  max-width: 100%;
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.sg-chatbot-cta:hover,
.sg-chatbot-quick button:hover,
.sg-chatbot-cta:focus-visible,
.sg-chatbot-quick button:focus-visible {
  background: #f7efd9;
  transform: translateY(-1px);
}

.sg-chatbot-quick {
  padding: 0 14px 10px;
}

.sg-chatbot-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(23, 49, 93, .1);
  background: rgba(255,255,255,.58);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.sg-chatbot-input {
  min-width: 0;
  flex: 1;
  border: 1px solid rgba(23, 49, 93, .18);
  border-radius: 999px;
  padding: 10px 12px;
  outline: none;
  color: #132033;
  background: rgba(255,255,255,.9);
}

.sg-chatbot-input:focus {
  border-color: rgba(218, 164, 55, .8);
  box-shadow: 0 0 0 3px rgba(218, 164, 55, .18);
}

.sg-chatbot-send {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: #102a55;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.sg-chatbot-launcher:focus-visible,
.sg-chatbot-icon-btn:focus-visible,
.sg-chatbot-send:focus-visible {
  outline: 3px solid rgba(218, 164, 55, .42);
  outline-offset: 3px;
}

.sg-chatbot-note {
  padding: 0 14px 12px;
  color: #637089;
  font-size: 11px;
  line-height: 1.4;
}

.sg-chatbot.is-loading .sg-chatbot-send,
.sg-chatbot.is-loading .sg-chatbot-quick button {
  opacity: .65;
  pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sg-chatbot-launcher {
    background: linear-gradient(135deg, rgba(16, 41, 82, .9), rgba(218, 164, 55, .86));
  }

  .sg-chatbot-panel {
    background: rgba(255,255,255,.94);
  }

  .sg-chatbot-header {
    background: linear-gradient(135deg, rgba(10, 31, 68, .94), rgba(16, 48, 92, .9));
  }
}

@media (max-width: 640px) {
  .sg-chatbot {
    right: 12px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .sg-chatbot-panel {
    width: calc(100vw - 24px);
    max-height: min(78vh, calc(100vh - 84px));
    border-radius: 20px;
  }

  .sg-chatbot-messages {
    min-height: 190px;
  }

  .sg-chatbot-msg {
    max-width: 92%;
  }

  .sg-chatbot[data-page="booking"].is-form-focused .sg-chatbot-panel {
    display: none;
  }

  .sg-chatbot[data-page="booking"].is-form-focused .sg-chatbot-launcher {
    display: inline-flex;
    transform: scale(.92);
    opacity: .88;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sg-chatbot-launcher,
  .sg-chatbot-cta,
  .sg-chatbot-quick button {
    transition: none;
  }

  .sg-chatbot-launcher:hover,
  .sg-chatbot-launcher:focus-visible,
  .sg-chatbot-cta:hover,
  .sg-chatbot-quick button:hover,
  .sg-chatbot-cta:focus-visible,
  .sg-chatbot-quick button:focus-visible {
    transform: none;
  }
}
