.olipsy-chatbot-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  font-family: inherit;
}

.olipsy-chatbot-toggle {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(90deg,#7b3db8 0,#9a63c7 45%,#b7be6a 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  cursor: pointer;
}

.olipsy-chatbot-panel {
  width: min(390px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 42px));
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(0,0,0,.22);
  border: 1px solid rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.olipsy-chatbot-header {
  padding: 18px;
  background: linear-gradient(90deg,#7b3db8 0,#9a63c7 45%,#b7be6a 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}


.olipsy-chatbot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.olipsy-chatbot-favicon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  padding: 6px;
  box-sizing: border-box;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.olipsy-chatbot-header strong {
  display: block;
  font-size: 17px;
}

.olipsy-chatbot-header small {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
  opacity: .92;
}

.olipsy-chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.olipsy-chatbot-minimize,
.olipsy-chatbot-close {
  background: rgba(255,255,255,.16);
  border: 0;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.olipsy-chatbot-minimize {
  font-size: 26px;
  line-height: .8;
}

.olipsy-chatbot-minimize:hover,
.olipsy-chatbot-close:hover {
  background: rgba(255,255,255,.26);
}


.olipsy-chatbot-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: #f8faf8;
}

.olipsy-chatbot-message {
  max-width: 88%;
  padding: 11px 13px;
  margin-bottom: 10px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.olipsy-chatbot-message.bot {
  background: #fff;
  color: #283433;
  border: 1px solid rgba(0,0,0,.06);
  border-top-left-radius: 6px;
}

.olipsy-chatbot-message.user {
  background: linear-gradient(90deg,#7b3db8 0,#9a63c7 45%,#b7be6a 100%);
  color: #fff;
  margin-left: auto;
  border-top-right-radius: 6px;
}

.olipsy-chatbot-message.is-loading {
  opacity: .75;
}

.olipsy-chatbot-result {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 13px;
  margin: 10px 0;
}

.olipsy-chatbot-result a {
  color: #7b3db8;
  font-weight: 700;
  text-decoration: none;
}

.olipsy-chatbot-result a:hover {
  text-decoration: underline;
}

.olipsy-chatbot-result-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #5e6b69;
}

.olipsy-chatbot-result p {
  margin: 8px 0 0;
  font-size: 13px;
  color: #4a5654;
  line-height: 1.4;
}

.olipsy-chatbot-quick-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 12px;
  border-top: 1px solid rgba(0,0,0,.06);
  background: #fff;
}

.olipsy-chatbot-quick-actions button {
  border: 1px solid rgba(123,61,184,.25);
  color: #7b3db8;
  background: #f5fbf9;
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
}

.olipsy-chatbot-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
}

.olipsy-chatbot-form input {
  flex: 1;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 11px 13px;
  font: inherit;
  min-width: 0;
}

.olipsy-chatbot-form button {
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: linear-gradient(90deg,#7b3db8 0,#9a63c7 45%,#b7be6a 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .olipsy-chatbot-root {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
  }

  .olipsy-chatbot-toggle {
    width: auto;
    max-width: calc(100vw - 24px);
    pointer-events: auto;
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .olipsy-chatbot-panel {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    pointer-events: auto;
  }

  .olipsy-chatbot-header {
    flex: 0 0 auto;
    padding: 13px 14px;
    align-items: center;
    position: relative;
    z-index: 2;
  }

  .olipsy-chatbot-favicon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    padding: 5px;
  }

  .olipsy-chatbot-header strong {
    font-size: 15px;
  }

  .olipsy-chatbot-header small {
    font-size: 11px;
    line-height: 1.25;
  }

  .olipsy-chatbot-header-actions {
    gap: 7px;
  }

  .olipsy-chatbot-minimize,
  .olipsy-chatbot-close {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 24px;
  }

  .olipsy-chatbot-minimize {
    font-size: 28px;
  }

  .olipsy-chatbot-messages {
    flex: 1 1 auto;
    min-height: 110px;
    padding: 12px;
  }

  .olipsy-chatbot-quick-actions {
    flex: 0 0 auto;
    max-height: 148px;
    overflow-y: auto;
    padding: 10px 10px 12px;
    box-sizing: border-box;
  }

  .olipsy-chatbot-form {
    flex: 0 0 auto;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    z-index: 3;
  }
}

@media (max-width: 380px), (max-height: 700px) {
  .olipsy-chatbot-panel {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
  }

  .olipsy-chatbot-messages {
    min-height: 0;
  }

  .olipsy-chatbot-quick-actions {
    max-height: 116px;
  }
}

.olipsy-chatbot-support-box {
  background: #fff;
  border: 1px solid rgba(123,61,184,.18);
  border-radius: 16px;
  padding: 13px;
  margin: 10px 0;
  box-shadow: 0 8px 22px rgba(0,0,0,.05);
}

.olipsy-chatbot-support-box strong {
  display: block;
  color: #7b3db8;
  font-size: 14px;
  margin-bottom: 9px;
}

.olipsy-chatbot-support-form {
  display: grid;
  gap: 8px;
}

.olipsy-chatbot-support-form input,
.olipsy-chatbot-support-form textarea {
  width: 100%;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 10px 11px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}

.olipsy-chatbot-support-form textarea {
  resize: vertical;
  min-height: 92px;
}

.olipsy-chatbot-support-form button {
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  background: linear-gradient(90deg,#7b3db8 0,#9a63c7 45%,#b7be6a 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.olipsy-chatbot-support-form button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.olipsy-chatbot-support-form.is-sent {
  opacity: .65;
  pointer-events: none;
}

.olipsy-chatbot-message.error {
  border-color: rgba(160,40,40,.18);
}

.olipsy-chatbot-transcript-box {
  background: #fff;
  border: 1px solid rgba(123,61,184,.18);
  border-radius: 16px;
  padding: 13px;
  margin: 10px 0;
  box-shadow: 0 8px 22px rgba(0,0,0,.05);
}

.olipsy-chatbot-transcript-box strong {
  display: block;
  color: #7b3db8;
  font-size: 14px;
  margin-bottom: 7px;
}

.olipsy-chatbot-transcript-box p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #4a5654;
  line-height: 1.4;
}

.olipsy-chatbot-transcript-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.olipsy-chatbot-transcript-actions button,
.olipsy-chatbot-transcript-form button {
  border: 0;
  border-radius: 999px;
  padding: 9px 11px;
  background: linear-gradient(90deg,#7b3db8 0,#9a63c7 45%,#b7be6a 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
}

.olipsy-chatbot-transcript-actions button.secondary {
  background: #f5fbf9;
  color: #7b3db8;
  border: 1px solid rgba(123,61,184,.25);
}

.olipsy-chatbot-transcript-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.olipsy-chatbot-transcript-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 10px 11px;
  font: inherit;
  font-size: 13px;
}

.olipsy-chatbot-transcript-form button:disabled {
  opacity: .65;
  cursor: not-allowed;
}
