.sunpal-chat .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sunpal-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 980;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.sunpal-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink, #090b0d);
  color: #fff;
  box-shadow: 0 14px 40px rgba(9, 11, 13, .22);
  font: 700 13px/1 inherit;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.sunpal-chat-launcher:hover,
.sunpal-chat-launcher:focus-visible {
  transform: translateY(-2px);
  background: #168b3d;
  outline: none;
}

.sunpal-chat-launcher-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 5px;
  box-sizing: border-box;
}

.sunpal-chat-launcher-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: -5px;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  background: var(--ink, #090b0d);
}

.sunpal-chat-launcher:hover .sunpal-chat-launcher-icon::after,
.sunpal-chat-launcher:focus-visible .sunpal-chat-launcher-icon::after {
  background: #168b3d;
}

.sunpal-chat-launcher-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8fe0a8;
  box-shadow: 0 0 0 3px rgba(143, 224, 168, .28);
}

.sunpal-chat-launcher-label {
  white-space: nowrap;
}

.sunpal-chat-panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid rgba(9, 11, 13, .1);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(9, 11, 13, .22);
  transform-origin: bottom right;
}

.sunpal-chat-panel[hidden] { display: none !important; }

.sunpal-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  color: #fff;
  background:
    radial-gradient(420px 160px at 10% 0%, rgba(143, 224, 168, .28), transparent 60%),
    linear-gradient(145deg, #0b3d22 0%, #127a38 100%);
}

.sunpal-chat-header strong {
  display: block;
  font-size: 16px;
  letter-spacing: -.02em;
}

.sunpal-chat-header span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  line-height: 1.4;
}

.sunpal-chat-close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sunpal-chat-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line, #dedfdf);
  background: #f7faf8;
}

.sunpal-chat-modes button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #64696d);
  font: 700 11px/1 inherit;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
}

.sunpal-chat-modes button.is-active {
  border-color: rgba(22, 139, 61, .28);
  background: #fff;
  color: #0b3d22;
}

.sunpal-chat-log {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 8px;
  background: linear-gradient(180deg, #fbfcfb 0%, #fff 40%);
}

.sunpal-chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.sunpal-chat-bubble[data-role="assistant"] {
  align-self: flex-start;
  background: #eef6f0;
  color: var(--ink, #090b0d);
}

.sunpal-chat-bubble[data-role="user"] {
  align-self: flex-end;
  background: var(--ink, #090b0d);
  color: #fff;
}

.sunpal-chat-meta {
  margin: 0 14px 8px;
  color: var(--muted, #64696d);
  font-size: 11px;
  line-height: 1.4;
}

.sunpal-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
}

.sunpal-chat-suggestions button,
.sunpal-chat-suggestions a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line, #dedfdf);
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #090b0d);
  font: 650 11px/1 inherit;
  text-decoration: none;
  cursor: pointer;
}

.sunpal-chat-suggestions a[data-type="whatsapp"],
.sunpal-chat-suggestions button[data-type="whatsapp"] {
  border-color: rgba(22, 139, 61, .35);
  color: #0b3d22;
}

.sunpal-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line, #dedfdf);
  background: #fff;
}

.sunpal-chat-form textarea {
  width: 100%;
  min-height: 44px;
  max-height: 96px;
  resize: none;
  padding: 11px 12px;
  border: 1px solid var(--line, #dedfdf);
  border-radius: 12px;
  font: 500 13px/1.4 inherit;
}

.sunpal-chat-form button[type="submit"] {
  min-width: 72px;
  border: 0;
  border-radius: 12px;
  background: #168b3d;
  color: #fff;
  font: 750 12px/1 inherit;
  cursor: pointer;
}

.sunpal-chat-form button[type="submit"]:disabled {
  opacity: .55;
  cursor: wait;
}

.sunpal-chat-escape {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 0 12px 12px;
}

.sunpal-chat-escape a {
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line, #dedfdf);
  border-radius: 10px;
  color: var(--ink, #090b0d);
  font: 650 11px/1 inherit;
  text-decoration: none;
}

.sunpal-chat-escape a.is-whatsapp {
  border-color: rgba(22, 139, 61, .35);
  background: #f3faf5;
  color: #0b3d22;
}

body.sunpal-chat-open { overscroll-behavior: none; }

@media (max-width: 560px) {
  .sunpal-chat { right: 14px; bottom: 14px; }
  .sunpal-chat-launcher-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sunpal-chat-launcher {
    width: 54px;
    height: 54px;
    min-height: 54px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .sunpal-chat-launcher-icon {
    width: 20px;
    height: 18px;
  }
  .sunpal-chat-panel {
    position: fixed;
    right: 10px;
    bottom: 78px;
    width: calc(100vw - 20px);
    height: min(70vh, 620px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sunpal-chat-launcher { transition: none; }
}
