.aic-wrap {
    border: 1px solid #e2e8f0;
    overflow: hidden;
    height: 100%;
}

.aic-head {
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between
}

.aic-messages {
    max-height: 520px;
    overflow: auto;
    padding: 14px;
    background: #fff
}

.aic-row {
    display: flex;
    gap: 8px;
    margin: 12px 0
}

.aic-user {
    margin-left: auto;
    max-width: 85%;
    background: #e6f0ff;
    border: 1px solid #cfe0ff;
    border-radius: 10px 10px 0 10px;
    padding: 10px;
}

.aic-bot {
    margin-right: auto;
    max-width: 85%;
    background: #f5f7fa;
    border: 1px solid #e6ecf3;
    border-radius: 10px 10px 10px 0;
    padding: 10px;
}

.aic-bot.aic-streaming {
    white-space: pre-wrap;
}

.aic-bot p {
    margin: 0;
}

.aic-foot {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0
}

.aic-foot input {
    flex: 1;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 10px
}

.aic-foot input::placeholder {
    opacity: 0.5;
}

.aic-foot button {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer
}

.aic-foot button.primary {
    background: #4E0364;
    color: #fff;
    border-color: #4E0364
}

.chat-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chat-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.2s infinite;
}

.chat-dots span:nth-child(2) {
    animation-delay: .2s;
}

.chat-dots span:nth-child(3) {
    animation-delay: .4s;
}

.ai-product-preview {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid #d6dbe2;
    border-radius: 6px;
    background-color: #fff;
}

.ai-product-link img {
    max-width: 120px;
    height: auto;
    width: 100px;
    border-radius: 5px;
}

.ai-product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.ai-product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ai-product-info br {
    display: none;
}

.ai-product-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
    margin: 0;
}

.ai-product-title a {
    color: inherit;
    text-decoration: none;
}

.ai-product-price {
    color: #444;
    font-size: 14px;
    margin-bottom: 6px;
}

.ai-product-price del .amount {
    color: #444;
}

.ai-product-price ins .amount {
    font-size: 16px;
}

.ai-product-desc {
    font-size: 13px;
    color: #555;
}

.ai-cta-button {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 14px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    transition: background .2s ease;
    width: fit-content;
}

.ai-cta-button:hover {
    background: #111;
    color: #fff;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(.6);
    }

    40% {
        transform: scale(1);
    }
}

/* tighten paragraphs inside chat bubbles */
.aic-bot p,
.aic-user p {
    margin: 0 0 8px;
}

.aic-bot p:last-child,
.aic-user p:last-child {
    margin-bottom: 0;
}

.ai-chat-btn {
    position: fixed;
    bottom: 85px;
    right: 5px;
    background: #59106f;
    color: #fff;
    padding: 12px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    transition: background 0.2s ease;
    z-index: 9999;
}
.ai-chat-btn:hover { background:#59106f;color: #fff; }
.ai-chat-modal {
    display:none;
    position:fixed;
    bottom:80px;
    right:20px;
    width:380px;
    max-width:90%;
    height:500px;
    background:#fff;
    border-radius:10px;
    box-shadow:0 4px 12px rgba(0,0,0,0.3);
    z-index:10000;
    overflow:hidden;
}
.ai-chat-modal-header {
    background:#333;
    color:#fff;
    padding:8px 12px;
    font-weight:600;
    display:flex;
    justify-content:space-between;
    align-items:center;
}
.ai-chat-modal-close {
    cursor:pointer;
    font-size:18px;
}
.ai-chat-modal-body {
    height:calc(100% - 40px);
    overflow:auto;
}
.ai-chat-modal-body .aic-messages {
    max-height: 328px;
}

.aic-product-skeleton{
  display:inline-flex; gap:10px; align-items:center;
  padding:8px 10px; border:1px solid #eee; border-radius:10px;
  background:#fafafa; vertical-align:middle;
  margin-top: 8px;
  margin-left: -2px;
}
.aic-skel-thumb{
  width:44px; height:44px; border-radius:8px; background:#e9e9e9;
  display:inline-block;
}
.aic-skel-lines{ display:flex; flex-direction:column; gap:6px; }
.aic-skel-line{
  display:block; width:160px; height:10px; background:#e9e9e9; border-radius:6px;
}
.aic-skel-line.short{ width:90px; }

.aic-suggestions{ padding:12px 16px 6px; display:flex; flex-wrap:wrap; gap:10px 12px; }

.aic-suggestions .aic-chip{
  appearance:none; -webkit-appearance:none;
  margin:0;
  background:#dde5ed;
  color:#2D3440;
  padding:8px 8px 8px 25px;
  border-radius:15px;
  display:inline-flex; align-items:center;
  line-height:1.2;
  font-size:14px;
  font-weight:500;
  font-family:inherit;
  text-transform:none !important;
  letter-spacing:0 !important;
  white-space:nowrap;
  cursor:pointer; user-select:none;
  transition:background .15s, border-color .15s;
  text-wrap-mode: wrap;
  text-align: left;
}

.aic-suggestions .aic-chip::before{
  content:'';
  position:absolute;
  left:8px; top:50%; transform:translateY(-50%);
  width:13px; height:13px;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 0C12 0 11.5 6.5 9 9C6.5 11.5 0 12 0 12C0 12 6.5 12.5 9 15C11.5 17.5 12 24 12 24C12 24 12.5 17.5 15 15C17.5 12.5 24 12 24 12C24 12 17.5 11.5 15 9C12.5 6.5 12 0 12 0Z' fill='%23445060'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.aic-wrap { 
    border-radius: 10px; 
    border: 3px solid #e2e8f0; 
}

.aic-wrap .aic-head { 
    background: #e2e8f0; 
}

.aic-wrap .aic-head #aic-new { 
    background-color: #fff;
    border-radius: 100px; 
}

.aic-wrap .aic-messages { 
    height: 400px; 
}

.aic-wrap .aic-foot { 
    border: 3px solid transparent; 
    background: linear-gradient(white, white) padding-box, linear-gradient(to right, #b6c6db, #8f2bdb) border-box; 
    border-radius: 10px; 
    margin: 20px;
    margin-bottom: 20px!important; 
    padding: 8px; 
}

.aic-wrap .aic-foot #aic-input { 
    border: none; 
    height: 45px; 
}

.aic-wrap .aic-foot #aic-send { 
    height: 45px; 
    border-radius: 100px; 
}

@media only screen and (max-width: 480px) {

    .ai-product-link {
        flex-direction: column;
    }

}

