.assistant-widget-panel {
  position: fixed;
  z-index: 70;
  inset: 0 auto auto 0;
  display: grid;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--white);
  font-family: "DM Sans", sans-serif;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
}

.assistant-widget-panel[hidden] {
  display: none !important;
}

.chatbot-toolbar-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.assistant-widget-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #FAF9F5;
}

.assistant-widget-homebar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 7px 24px;
  border-bottom: 1px solid rgba(29, 31, 26, 0.08);
  background: #FFFFFF;
}

.assistant-widget-back {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(29, 31, 26, 0.14);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.assistant-widget-back:hover {
  border-color: rgba(238, 104, 74, 0.6);
  background: #FFF8F5;
}

.assistant-widget-back svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.assistant-widget-homebar > span {
  color: #77776E;
  font-size: 9px;
}

.assistant-widget-logo {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border: 1px solid rgba(29, 31, 26, 0.1);
  border-radius: 50%;
  object-fit: cover;
  animation: assistant-logo-flip 3s linear infinite;
}

.assistant-widget-title {
  min-width: 0;
  flex: 1;
}

.assistant-widget-title h2 {
  overflow: hidden;
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-widget-title p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  color: #77776E;
  font-size: 9px;
}

.assistant-widget-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6D8C59;
}

.assistant-widget-action {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #62635B;
  cursor: pointer;
}

.assistant-widget-action:hover {
  background: rgba(29, 31, 26, 0.07);
  color: var(--ink);
}

.assistant-widget-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.assistant-widget-conversation {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 22px max(16px, calc((100% - 900px) / 2));
  scroll-behavior: smooth;
}

.assistant-widget-panel .message {
  display: flex;
  max-width: 96%;
  align-items: flex-start;
  gap: 7px;
  animation: assistant-message-in 200ms ease-out both;
}

.assistant-widget-panel .message-assistant {
  align-self: flex-start;
}

.assistant-widget-panel .message-user {
  align-self: flex-end;
}

.assistant-widget-panel .message-avatar {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(29, 31, 26, 0.1);
  background: #F8E2D9;
  color: #A8432E;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 800;
  object-fit: cover;
}

.assistant-widget-panel .message-content {
  min-width: 0;
}

.assistant-widget-panel .message-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 1px 0 5px 2px;
  color: #74756D;
  font-size: 8px;
}

.assistant-widget-panel .message-heading strong {
  color: var(--ink);
  font-size: 9px;
}

.assistant-widget-panel .message-bubble {
  padding: 9px 11px;
  border: 1px solid rgba(29, 31, 26, 0.08);
  border-radius: 3px 12px 12px 12px;
  background: #FBFAF7;
  color: #393A34;
  font-size: 10px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.assistant-widget-panel .message-user .message-content {
  display: flex;
  justify-content: flex-end;
}

.assistant-widget-panel .message-user .message-bubble {
  border-color: var(--ink);
  border-radius: 12px 3px 12px 12px;
  background: var(--ink);
  color: var(--white);
}

.assistant-widget-panel .suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.assistant-widget-panel .suggestion-chip {
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid rgba(29, 31, 26, 0.14);
  border-radius: 999px;
  background: var(--white);
  color: #505149;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-size: 8px;
  text-align: left;
}

.assistant-widget-panel .suggestion-chip:hover {
  border-color: rgba(238, 104, 74, 0.6);
  background: #FFF8F5;
}

.assistant-widget-panel .message-products {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.assistant-widget-panel .product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(29, 31, 26, 0.1);
  border-radius: 8px;
  background: var(--white);
  animation: none;
}

.assistant-widget-panel .product-card:hover {
  transform: none;
}

.assistant-widget-panel .product-image {
  display: block;
  width: 100%;
  aspect-ratio: 1.7;
  object-fit: cover;
  transform: none;
}

.assistant-widget-panel .product-card:hover .product-image {
  transform: none;
}

.assistant-widget-panel .product-copy {
  padding: 8px 9px 9px;
}

.assistant-widget-panel .product-demo-tag {
  display: inline-block;
  margin-bottom: 4px;
  color: #77776E;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-widget-panel .product-copy h3 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.4;
}

.assistant-widget-panel .product-price {
  margin: 5px 0 1px;
  font-size: 9px;
  font-weight: 700;
}

.assistant-widget-panel .product-seller {
  margin: 0;
  color: #77776E;
  font-size: 8px;
}

.assistant-widget-panel .product-link {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  margin-top: 7px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 8px;
  font-weight: 700;
}

.assistant-widget-panel .product-link:hover {
  background: #45473F;
}

.assistant-widget-typing {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 max(18px, calc((100% - 900px) / 2)) 11px;
  color: #77776E;
  font-size: 8px;
}

.assistant-widget-typing[hidden] {
  display: none;
}

.assistant-widget-dots {
  display: inline-flex;
  gap: 3px;
}

.assistant-widget-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  animation: assistant-typing 900ms ease-in-out infinite;
}

.assistant-widget-dots i:nth-child(2) {
  animation-delay: 120ms;
}

.assistant-widget-dots i:nth-child(3) {
  animation-delay: 240ms;
}

.assistant-widget-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 6px 7px 6px 11px;
  border: 1px solid rgba(29, 31, 26, 0.16);
  border-radius: 9px;
  background: var(--white);
}

.assistant-widget-composer:focus-within {
  border-color: rgba(238, 104, 74, 0.75);
  box-shadow: 0 0 0 3px rgba(238, 104, 74, 0.1);
}

.assistant-widget-composer textarea {
  width: 100%;
  max-height: 100px;
  min-height: 36px;
  resize: none;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  line-height: 1.5;
}

.assistant-widget-composer textarea::placeholder {
  color: #92928A;
}

.assistant-widget-send {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  margin-bottom: 1px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
}

.assistant-widget-send:disabled {
  background: #B5B5AC;
  cursor: not-allowed;
}

.assistant-widget-send svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.assistant-widget-note {
  margin: 8px 12px 13px;
  color: #85857B;
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

@keyframes assistant-message-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes assistant-logo-flip {
  to {
    transform: perspective(500px) rotateY(360deg);
  }
}

@keyframes assistant-typing {
  0%, 60%, 100% {
    opacity: 0.45;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 560px) {
  .assistant-widget-header {
    min-height: 65px;
    gap: 7px;
    padding: 8px 11px;
  }

  .assistant-widget-homebar {
    min-height: 43px;
    padding: 5px 11px;
  }

  .assistant-widget-back {
    min-height: 31px;
    gap: 5px;
    padding-inline: 8px;
    font-size: 9px;
  }

  .assistant-widget-homebar > span {
    font-size: 8px;
  }

  .assistant-widget-conversation {
    padding: 15px 11px;
  }

  .assistant-widget-composer {
    width: calc(100% - 20px);
  }

  .assistant-widget-panel .message-products {
    grid-template-columns: 1fr;
  }

  .assistant-widget-panel .message-products .product-card {
    display: grid;
    align-items: center;
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .assistant-widget-panel .message-products .product-image {
    height: 100%;
    min-height: 94px;
    aspect-ratio: auto;
  }

  .assistant-widget-panel .message-products .product-copy {
    padding: 7px 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-widget-panel *,
  .assistant-widget-panel *::before,
  .assistant-widget-panel *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .assistant-widget-logo {
    animation: none;
  }
}
