.whai-root {
  --whai-primary: #F6C515;
  --whai-dark: #171717;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #202020;
}

.whai-root *, .whai-root *::before, .whai-root *::after { box-sizing: border-box; }

.whai-launcher {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--whai-primary);
  color: var(--whai-dark);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.whai-launcher:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 38px rgba(0,0,0,.3); }
.whai-launcher svg { width: 29px; height: 29px; fill: currentColor; }
.whai-launcher.is-open { transform: scale(.92); }

.whai-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(380px, calc(100vw - 28px));
  height: min(610px, calc(100vh - 110px));
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transition: opacity .18s ease, transform .18s ease;
}
.whai-panel.is-visible { opacity: 1; transform: translateY(0) scale(1); }

.whai-header {
  min-height: 72px;
  padding: 13px 14px;
  background: var(--whai-dark);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 11px;
}
.whai-brand-mark {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--whai-primary);
  color: var(--whai-dark);
  font-weight: 900;
  font-size: 23px;
}
.whai-heading { min-width: 0; flex: 1; }
.whai-heading strong { display: block; font-size: 15px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whai-heading span { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: #d7d7d7; }
.whai-heading i { width: 7px; height: 7px; border-radius: 50%; background: #48d277; display: inline-block; }
#whai-close { border: 0; background: transparent; color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 27px; line-height: 1; cursor: pointer; }
#whai-close:hover { background: rgba(255,255,255,.1); }

.whai-messages {
  height: calc(100% - 200px);
  min-height: 250px;
  padding: 17px 14px 12px;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff 0%, #fbfbfb 100%);
  scroll-behavior: smooth;
}
.whai-message-row { display: flex; margin: 0 0 12px; }
.whai-message-row.is-user { justify-content: flex-end; }
.whai-message {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  background: #f0f0f0;
  color: #202020;
  font-size: 13.5px;
  line-height: 1.52;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.is-user .whai-message { background: var(--whai-primary); color: #171717; border-radius: 14px 14px 4px 14px; }
.whai-message a { color: #0645ad; text-decoration: underline; }
.whai-message.is-typing { display: flex; gap: 5px; align-items: center; min-width: 52px; }
.whai-message.is-typing span { width: 7px; height: 7px; border-radius: 50%; background: #777; animation: whai-bounce 1s infinite ease-in-out; }
.whai-message.is-typing span:nth-child(2) { animation-delay: .15s; }
.whai-message.is-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes whai-bounce { 0%, 60%, 100% { transform: translateY(0); opacity:.55; } 30% { transform: translateY(-5px); opacity:1; } }

.whai-suggestions {
  display: flex;
  gap: 7px;
  padding: 0 12px 10px;
  overflow-x: auto;
  background: #fbfbfb;
  scrollbar-width: none;
}
.whai-suggestions::-webkit-scrollbar { display: none; }
.whai-suggestions button {
  flex: 0 0 auto;
  border: 1px solid #dedede;
  background: #fff;
  color: #333;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11.5px;
  cursor: pointer;
}
.whai-suggestions button:hover { border-color: var(--whai-primary); background: #fffbee; }

.whai-form {
  min-height: 64px;
  padding: 10px 10px 8px 13px;
  border-top: 1px solid #ececec;
  background: #fff;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.whai-form textarea {
  flex: 1;
  min-height: 42px;
  max-height: 110px;
  resize: none;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  padding: 10px 11px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
}
.whai-form textarea:focus { border-color: var(--whai-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--whai-primary) 20%, transparent); }
.whai-form button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--whai-primary);
  color: var(--whai-dark);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.whai-form button:disabled { opacity:.55; cursor:not-allowed; }
.whai-form button svg { width: 20px; height: 20px; fill: currentColor; }
.whai-powered { height: 29px; padding: 4px 10px 8px; text-align: center; font-size: 10px; color: #777; background:#fff; }

@media (max-width: 600px) {
  .whai-root { right: 14px; bottom: 14px; }
  .whai-launcher { width: 56px; height: 56px; }
  .whai-panel {
    position: fixed;
    inset: auto 8px 78px 8px;
    width: auto;
    height: min(650px, calc(100vh - 92px));
    border-radius: 16px;
  }
}

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