#ailc-wrapper {
    position: fixed;
    bottom: 80px;
    right: 20px;
    left: auto;
    z-index: 999999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Single unified button container matching the reference design */
#ailc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #1e293b; /* Dark navy pill button theme */
    color: #fff;
    padding: 10px 18px 10px 12px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    gap: 10px;
    transition: transform 0.2s ease-in-out, background-color 0.2s;
    border: none;
}

#ailc-toggle:hover {
    transform: scale(1.05);
    background: #334155;
}

/* Icon inside the single button */
#ailc-toggle-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

/* Text name inside the single button */
#ailc-toggle-name {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* Fully responsive Chat Popup Box */
#ailc-box {
    width: 360px;
    max-width: calc(100vw - 30px);
    height: 380px;
    max-height: calc(100vh - 100px);
    position: absolute;
    bottom: 70px;
    right: 0;
    left: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    border: 1px solid #e6e6e6;
    display: flex;
    flex-direction: column;
}

#ailc-header {
    background: linear-gradient(90deg, #1e293b, #334155);
    color: #fff;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
}

#ailc-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

.ailc-msg {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 90%;
    line-height: 1.5;
    word-wrap: break-word;
}

.ailc-msg strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.85em;
    color: #555;
}

.ailc-msg.user {
    background: #eaf3ff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ailc-msg.user strong {
    color: #0052cc;
}

.ailc-msg.ai {
    background: #ffffff;
    border: 1px solid #eee;
    border-bottom-left-radius: 4px;
}

#ailc-footer {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
}

#ailc-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: none;
    outline: none;
}

#ailc-send {
    padding: 8px 15px;
    border: none;
    background: #1e293b;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#ailc-send:hover {
    background: #334155;
}

#ailc-send:disabled {
    background: #999;
    cursor: not-allowed;
}

.ailc-thinking {
    display: inline-block;
}

.ailc-thinking::after {
    content: '.';
    display: inline-block;
    animation: ailc-dots 1s steps(5, end) infinite;
}

@keyframes ailc-dots {
    0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    40% { color: #333; text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    60% { text-shadow: .25em 0 0 #333, .5em 0 0 rgba(0,0,0,0); }
    80%, 100% { text-shadow: .25em 0 0 #333, .5em 0 0 #333; }
}

@media screen and (max-width: 480px) {
    #ailc-box {
        width: calc(100vw - 20px);
        right: 0;
        bottom: 65px;
        height: 420px;
    }
}