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

.swe-widget {
  --swe-primary: #25d366;
  --swe-header: #075e54;
  --swe-shadow: 0 16px 48px rgba(16, 24, 40, 0.2);
  position: fixed;
  z-index: 999999;
  bottom: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #172b2d;
  line-height: 1.45;
}

.swe-widget[hidden],
.swe-widget [hidden] {
  display: none !important;
}

.swe-position-right { right: 24px; }
.swe-position-left { left: 24px; }

.swe-fab {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--swe-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.swe-position-left .swe-fab { margin-left: 0; margin-right: auto; }
.swe-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26); }
.swe-fab:focus-visible,
.swe-panel button:focus-visible,
.swe-panel input:focus-visible,
.swe-panel textarea:focus-visible,
.swe-panel select:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.3);
  outline-offset: 2px;
}

.swe-fab-icon { width: 32px; height: 32px; display: grid; place-items: center; }
.swe-fab-icon svg { width: 100%; height: 100%; }
.swe-icon-close { display: none; font-size: 36px; font-weight: 300; line-height: 1; }
.swe-is-open .swe-icon-open { display: none; }
.swe-is-open .swe-icon-close { display: grid; }

.swe-teaser {
  position: absolute;
  bottom: 76px;
  width: max-content;
  max-width: min(300px, calc(100vw - 48px));
  padding: 14px 42px 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.16);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  animation: swe-pop 0.25s ease-out;
}

.swe-position-right .swe-teaser { right: 0; }
.swe-position-left .swe-teaser { left: 0; }

.swe-teaser::after {
  content: "";
  position: absolute;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  transform: rotate(45deg);
}

.swe-position-right .swe-teaser::after { right: 24px; }
.swe-position-left .swe-teaser::after { left: 24px; }

.swe-teaser-close {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #667085;
  font-size: 20px;
  cursor: pointer;
}

.swe-panel {
  position: absolute;
  bottom: 76px;
  width: 370px;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 20px;
  background: #f6f8f7;
  box-shadow: var(--swe-shadow);
  animation: swe-pop 0.22s ease-out;
}

.swe-position-right .swe-panel { right: 0; }
.swe-position-left .swe-panel { left: 0; }

.swe-panel-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 52px 16px 18px;
  color: #fff;
  background: var(--swe-header);
}

.swe-avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.swe-avatar svg { width: 27px; height: 27px; }
.swe-header-copy { display: grid; gap: 2px; min-width: 0; }
.swe-header-copy strong { overflow: hidden; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.swe-header-copy span { color: rgba(255, 255, 255, 0.78); font-size: 12px; }

.swe-panel-close {
  position: absolute;
  top: 17px;
  right: 14px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.swe-panel-body {
  max-height: min(510px, calc(100vh - 210px));
  overflow-y: auto;
  padding: 16px;
  overscroll-behavior: contain;
}

.swe-welcome-card {
  position: relative;
  margin-bottom: 16px;
  padding: 15px 16px;
  border-radius: 0 14px 14px 14px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(16, 24, 40, 0.08);
}

.swe-welcome-card strong { display: block; margin-bottom: 5px; font-size: 15px; }
.swe-welcome-card p { margin: 0; color: #526065; font-size: 13px; }
.swe-step-title { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.swe-reasons { display: grid; gap: 8px; }

.swe-reason-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #e2e8e5;
  border-radius: 11px;
  color: #17333a;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.swe-reason-button:hover { border-color: var(--swe-primary); transform: translateX(2px); }
.swe-reason-button span:last-child { color: var(--swe-primary); font-size: 24px; font-weight: 400; line-height: 1; }

.swe-back-button {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: #526065;
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.swe-selected-reason {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-left: 3px solid var(--swe-primary);
  border-radius: 7px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.swe-enquiry-form,
.swe-dynamic-fields { display: grid; gap: 12px; }
.swe-form-field { display: grid; gap: 6px; }
.swe-form-field label { color: #263a40; font-size: 12px; font-weight: 650; }

.swe-form-field input,
.swe-form-field textarea,
.swe-form-field select {
  width: 100%;
  min-height: 43px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #d6dedb;
  border-radius: 9px;
  color: #172b2d;
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
}

.swe-form-field textarea { min-height: 82px; resize: vertical; }
.swe-form-field input:focus,
.swe-form-field textarea:focus,
.swe-form-field select:focus { border-color: var(--swe-primary); }

.swe-form-error {
  padding: 9px 10px;
  border-radius: 7px;
  color: #b42318;
  background: #fef3f2;
  font-size: 12px;
}

.swe-submit-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 2px;
  padding: 12px 16px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--swe-primary);
  box-shadow: 0 7px 20px rgba(37, 211, 102, 0.22);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.swe-submit-button:hover { filter: brightness(0.95); }
.swe-submit-button svg { width: 21px; height: 21px; }

.swe-panel-note {
  display: grid;
  gap: 3px;
  padding: 10px 16px 13px;
  border-top: 1px solid #e6ebe9;
  color: #7b878a;
  background: #fff;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.swe-panel-credit {
  color: #909a9c;
  font-size: 9px;
}

@keyframes swe-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 767px) {
  .swe-widget { bottom: 16px; }
  .swe-position-right { right: 16px; }
  .swe-position-left { left: 16px; }
  .swe-fab { width: 58px; height: 58px; }
  .swe-panel { bottom: 70px; width: calc(100vw - 32px); max-width: 390px; }
  .swe-panel-body { max-height: min(500px, calc(100vh - 190px)); }
  .swe-teaser { bottom: 70px; max-width: calc(100vw - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  .swe-panel,
  .swe-teaser,
  .swe-fab,
  .swe-reason-button { animation: none; transition: none; }
}
