#aiss-chat-widget {
    font-family: Tahoma, "IRANSans", "Vazir", Arial, sans-serif;
    direction: rtl;
    box-sizing: border-box;
}
#aiss-chat-widget * {
    box-sizing: border-box;
}

.aiss-position-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
}
.aiss-position-bottom-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999999;
}

#aiss-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--aiss-color, #2563eb);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}
#aiss-toggle-btn:hover {
    transform: scale(1.06);
}

#aiss-chat-box {
    display: none;
    flex-direction: column;
    width: 340px;
    max-width: 90vw;
    height: 460px;
    max-height: 75vh;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    position: absolute;
    bottom: 72px;
    right: 0;
}
.aiss-position-bottom-left #aiss-chat-box {
    right: auto;
    left: 0;
}
#aiss-chat-box.aiss-open {
    display: flex;
}

.aiss-inline {
    position: relative;
    display: block;
}
.aiss-inline #aiss-chat-box {
    position: static;
    width: 100%;
    max-width: 100%;
    height: 500px;
    max-height: none;
    display: flex;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.aiss-header {
    background: var(--aiss-color, #2563eb);
    color: #fff;
    padding: 14px 16px;
    font-weight: bold;
    font-size: 15px;
}

.aiss-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f7f8fa;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aiss-msg {
    max-width: 80%;
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.aiss-msg-bot {
    background: #fff;
    border: 1px solid #e5e7eb;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.aiss-msg-user {
    background: var(--aiss-color, #2563eb);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.aiss-msg-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.aiss-typing {
    padding: 0 14px 6px;
    font-size: 12px;
    color: #888;
}

#aiss-form {
    display: flex;
    border-top: 1px solid #e5e7eb;
    padding: 8px;
    gap: 6px;
    background: #fff;
}
#aiss-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
#aiss-input:focus {
    border-color: var(--aiss-color, #2563eb);
}
#aiss-form button {
    background: var(--aiss-color, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}
#aiss-form button:hover {
    opacity: 0.92;
}

@media (max-width: 480px) {
    #aiss-chat-box {
        width: 92vw;
    }
}
