.molee-assistant {
  --molee-primary: #717653;
  --molee-secondary: #373d28;
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: inherit;
}

.molee-chat-launcher {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 13px 17px;
  background: var(--molee-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(26,31,17,.25);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.molee-chat-launcher:hover,
.molee-chat-launcher:focus-visible {
  background: var(--molee-secondary);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(26,31,17,.32);
}

.molee-launcher-icon { font-size: 21px; }

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

.molee-chat-panel {
  position: absolute;
  left: 0;
  bottom: 66px;
  width: min(405px, calc(100vw - 28px));
  height: min(640px, calc(100vh - 108px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(24,29,16,.28);
  border: 1px solid rgba(55,61,40,.14);
  opacity: 0;
  transform: translateY(14px) scale(.975);
  transform-origin: bottom left;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.molee-chat-panel.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.molee-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--molee-primary), var(--molee-secondary));
  color: #fff;
  padding: 16px 18px;
}

.molee-chat-header > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.molee-chat-title {
  font-size: 16px;
  letter-spacing: .1px;
}

.molee-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: .9;
}

.molee-chat-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d9f4bf;
  box-shadow: 0 0 0 3px rgba(217,244,191,.15);
}

.molee-chat-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 25px;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.molee-chat-close:hover {
  transform: rotate(5deg);
  background: rgba(255,255,255,.22);
}

.molee-chat-messages {
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top right, rgba(113,118,83,.08), transparent 38%),
    #f8f8f5;
  scrollbar-width: thin;
}

.molee-message {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.42;
  font-size: 14px;
  overflow-wrap: anywhere;
  animation: moleeBubbleIn .18s ease both;
}

.molee-message-bot {
  background: #fff;
  color: #25291f;
  border: 1px solid rgba(55,61,40,.09);
  border-bottom-left-radius: 5px;
  box-shadow: 0 3px 10px rgba(55,61,40,.05);
}

.molee-message-user {
  margin-left: auto;
  background: var(--molee-primary);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.molee-message-link {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(113,118,83,.11);
  font-weight: 700;
  color: var(--molee-secondary);
  text-decoration: none;
}

.molee-message-link:hover {
  background: rgba(113,118,83,.19);
}

.molee-chat-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 11px 12px;
  max-height: 142px;
  overflow-y: auto;
  background: #fff;
  border-top: 1px solid rgba(55,61,40,.08);
}

.molee-chat-quick-actions button {
  min-width: 0;
  border: 1px solid rgba(113,118,83,.62);
  border-radius: 12px;
  padding: 8px 9px;
  background: #fff;
  color: var(--molee-secondary);
  font-size: 12px;
  line-height: 1.25;
  cursor: pointer;
  text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.molee-chat-quick-actions button:hover {
  background: var(--molee-primary);
  color: #fff;
  transform: translateY(-1px);
}

.molee-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 6px;
  background: #fff;
}

.molee-chat-form input {
  min-width: 0;
  flex: 1;
  border: 1px solid #d6d7cf;
  border-radius: 999px;
  padding: 11px 14px;
  background: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.molee-chat-form input:focus {
  border-color: var(--molee-primary);
  box-shadow: 0 0 0 3px rgba(113,118,83,.13);
}

.molee-chat-form button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 50%;
  background: var(--molee-primary);
  color: #fff;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.molee-chat-form button:hover {
  background: var(--molee-secondary);
  transform: translateX(1px);
}

.molee-chat-disclaimer {
  margin: 0;
  padding: 0 12px 10px;
  background: #fff;
  color: #7c7e77;
  text-align: center;
  font-size: 10px;
}

.molee-product-results {
  margin-bottom: 10px;
  animation: moleeBubbleIn .18s ease both;
}

.molee-product-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  padding: 9px;
  margin-bottom: 8px;
  background: #fff;
  border-radius: 13px;
  border: 1px solid rgba(55,61,40,.08);
  box-shadow: 0 3px 10px rgba(55,61,40,.04);
}

.molee-product-card img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 10px;
  background: #f1f1ee;
}

.molee-product-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.molee-product-info strong { font-size: 13px; }
.molee-product-price { color: var(--molee-secondary); font-weight: 700; }
.molee-product-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }

.molee-product-buttons a,
.molee-product-buttons button {
  display: inline-block;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: var(--molee-primary);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.molee-product-buttons .molee-product-add {
  background: var(--molee-secondary);
}

.molee-product-buttons .molee-product-add:disabled {
  cursor: default;
  opacity: .82;
}

.molee-product-buttons .molee-product-add.is-added {
  background: var(--molee-primary);
}

@keyframes moleeBubbleIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .molee-chat-panel,
  .molee-chat-launcher,
  .molee-message,
  .molee-product-results {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 480px) {
  .molee-assistant {
    left: 12px;
    right: auto;
    bottom: 12px;
  }

  .molee-launcher-label {
    display: none;
  }

  .molee-chat-launcher {
    width: 50px;
    height: 50px;
    justify-content: center;
    padding: 0;
  }

  .molee-chat-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 74px;
    width: auto;
    height: min(78dvh, 590px);
    max-height: calc(100dvh - 100px);
    border-radius: 18px;
    transform-origin: bottom center;
  }

  .molee-chat-header {
    padding: 12px 14px;
  }

  .molee-chat-title {
    font-size: 15px;
  }

  .molee-chat-close {
    width: 34px;
    height: 34px;
  }

  .molee-chat-messages {
    padding: 12px;
  }

  .molee-message {
    max-width: 90%;
    padding: 9px 11px;
    margin-bottom: 8px;
    font-size: 13px;
  }

  .molee-chat-quick-actions {
    gap: 6px;
    padding: 8px 10px;
    max-height: 112px;
  }

  .molee-chat-quick-actions button {
    padding: 7px 8px;
    font-size: 11px;
  }

  .molee-chat-form {
    padding: 8px 10px 5px;
  }

  .molee-chat-form input {
    padding: 9px 12px;
    font-size: 13px;
  }

  .molee-chat-form button {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .molee-chat-disclaimer {
    padding: 0 10px 8px;
    font-size: 9px;
  }

  .molee-product-card {
    grid-template-columns: 64px 1fr;
    padding: 8px;
  }

  .molee-product-card img {
    width: 64px;
    height: 64px;
  }
}


@supports not (height: 1dvh) {
  @media (max-width: 480px) {
    .molee-chat-panel {
      height: min(78vh, 590px);
      max-height: calc(100vh - 100px);
    }
  }
}
