.m360-chatbot {
  --m360-gold: #dd9933;
  --m360-ink: #212930;
  --m360-ink-soft: #2a343c;
  --m360-surface: #ffffff;
  --m360-text: #1f252b;
  --m360-muted: #5a6672;
  --m360-shadow: 0 18px 40px rgba(13, 17, 21, 0.24);
  --m360-ring: 0 0 0 3px rgba(221, 153, 51, 0.35);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: "Open Sans", sans-serif;
}

.m360-chatbot__launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(221, 153, 51, 0.5);
  background: linear-gradient(130deg, var(--m360-ink) 0%, var(--m360-ink-soft) 100%);
  color: #fff;
  border-radius: 999px;
  box-shadow: var(--m360-shadow);
  padding: 10px 14px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.m360-chatbot__launcher:hover {
  transform: translateY(-2px);
  background: var(--m360-gold);
  border-color: var(--m360-gold);
  color: #ffffff;
  box-shadow: 0 22px 44px rgba(13, 17, 21, 0.29);
}

.m360-chatbot__launcher:focus-visible {
  transform: translateY(-2px);
}

.m360-chatbot__launcher:focus-visible,
.m360-chatbot__close:focus-visible,
.m360-chatbot__starter:focus-visible,
.m360-chatbot__send:focus-visible,
.m360-chatbot__input:focus-visible {
  outline: none;
  box-shadow: var(--m360-ring);
}

.m360-chatbot__launcher-icon {
  position: relative;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0;
  line-height: 0;
  padding: 0;
}

.m360-chatbot__launcher-icon::before {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-0.5px);
}

.m360-chatbot__launcher-label {
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
}

.m360-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: min(500px, calc(100vw - 24px));
  max-height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(33, 41, 48, 0.12);
  border-radius: 18px;
  background: var(--m360-surface);
  box-shadow: var(--m360-shadow);
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  display: flex;
  flex-direction: column;
}

.m360-chatbot.is-open .m360-chatbot__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.m360-chatbot__header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(120deg, #f9f7f4 0%, #ffffff 100%);
  border-bottom: 1px solid rgba(33, 41, 48, 0.08);
  padding: 14px 16px;
}

.m360-chatbot__title {
  margin: 0;
  font-family: "Josefin Sans", sans-serif;
  font-size: 20px;
  color: var(--m360-ink);
}

.m360-chatbot__subtitle {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--m360-muted);
}

.m360-chatbot__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: none;
  background: transparent;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  line-height: 1;
  font-size: 26px;
  color: #495560;
  cursor: pointer;
}

.m360-chatbot__close:hover {
  background: rgba(33, 41, 48, 0.08);
}

.m360-chatbot__messages {
  padding: 14px 16px;
  overflow-y: auto;
  min-height: 320px;
  max-height: 560px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfa 100%);
}

.m360-chatbot__bubble {
  display: inline-block;
  max-width: 92%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  font-size: 13px;
}

.m360-chatbot__bubble p,
.m360-chatbot__bubble h1,
.m360-chatbot__bubble h2,
.m360-chatbot__bubble h3 {
  margin: 0 0 8px;
}

.m360-chatbot__bubble p:last-child,
.m360-chatbot__bubble h1:last-child,
.m360-chatbot__bubble h2:last-child,
.m360-chatbot__bubble h3:last-child {
  margin-bottom: 0;
}

.m360-chatbot__bubble h1,
.m360-chatbot__bubble h2,
.m360-chatbot__bubble h3 {
  font-family: "Josefin Sans", sans-serif;
  color: #1b252c;
  line-height: 1.25;
}

.m360-chatbot__bubble h1 {
  font-size: 18px;
}

.m360-chatbot__bubble h2 {
  font-size: 16px;
}

.m360-chatbot__bubble h3 {
  font-size: 14px;
}

.m360-chatbot__bubble a {
  color: #0b5c9e;
  text-decoration: underline;
}

.m360-chatbot__bubble--assistant {
  background: #f2f5f7;
  border: 1px solid rgba(33, 41, 48, 0.09);
  color: var(--m360-text);
  border-top-left-radius: 5px;
}

.m360-chatbot__bubble--user {
  background: var(--m360-ink);
  color: #fff;
  margin-left: auto;
  display: block;
  border-top-right-radius: 5px;
}

.m360-chatbot__cta-wrap {
  margin: 2px 0 12px;
}

.m360-chatbot__cta {
  display: inline-block;
  border: 1px solid var(--m360-gold);
  background: var(--m360-gold);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  font-weight: 700;
  text-decoration: none;
}

.m360-chatbot__cta:hover {
  color: #fff;
  text-decoration: none;
  filter: brightness(0.94);
}

.m360-chatbot__starters {
  border-top: 1px solid rgba(33, 41, 48, 0.08);
  border-bottom: 1px solid rgba(33, 41, 48, 0.08);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  background: #fcfcfb;
}

.m360-chatbot__starter {
  text-align: left;
  border: 1px solid rgba(33, 41, 48, 0.18);
  background: #ffffff;
  border-radius: 10px;
  color: #273038;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.m360-chatbot__starter:hover {
  border-color: rgba(221, 153, 51, 0.6);
}

.m360-chatbot__form {
  padding: 12px 12px 10px;
  background: #fff;
}

.m360-chatbot__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--m360-muted);
}

.m360-chatbot__input {
  width: 100%;
  resize: none;
  border: 1px solid rgba(33, 41, 48, 0.26);
  border-radius: 10px;
  padding: 10px;
  line-height: 1.4;
  color: var(--m360-text);
  min-height: 70px;
}

.m360-chatbot__actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.m360-chatbot__status {
  color: var(--m360-muted);
  font-size: 12px;
  min-height: 1em;
}

.m360-chatbot__thinking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.m360-chatbot__spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(33, 41, 48, 0.25);
  border-top-color: var(--m360-ink);
  border-radius: 50%;
  animation: m360-chatbot-spin 0.7s linear infinite;
}

@keyframes m360-chatbot-spin {
  to {
    transform: rotate(360deg);
  }
}

.m360-chatbot__send {
  border: 1px solid var(--m360-gold);
  background: var(--m360-gold);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  font-weight: 700;
}

.m360-chatbot__send[disabled],
.m360-chatbot__input[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .m360-chatbot {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .m360-chatbot__launcher {
    margin-left: auto;
  }

  .m360-chatbot__launcher-label {
    font-size: 12px;
  }

  .m360-chatbot__panel {
    width: 100%;
    right: 0;
    bottom: 56px;
    max-height: calc(100vh - 36px);
  }
}
