.front-assistant {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1080;
    font-family: inherit;
}

.front-assistant-toggle {
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #0d6efd;
    box-shadow: 0 10px 28px rgba(13, 110, 253, 0.3);
}

.front-assistant-toggle i {
    font-size: 24px;
}

.front-assistant-panel {
    width: min(390px, calc(100vw - 28px));
    height: min(560px, calc(100vh - 92px));
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.front-assistant.open .front-assistant-panel {
    display: flex;
}

.front-assistant.open .front-assistant-toggle {
    display: none;
}

.front-assistant-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #e9ecef;
}

.front-assistant-title {
    font-weight: 600;
    color: #212529;
}

.front-assistant-subtitle {
    margin-top: 2px;
    color: #6c757d;
    font-size: 12px;
}

.front-assistant-close {
    min-width: 44px;
    height: 30px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #6c757d;
    font-size: 12px;
}

.front-assistant-close:hover {
    background: #f1f3f5;
    color: #212529;
}

.front-assistant-body {
    flex: 1;
    overflow: auto;
    padding: 12px;
    background: #f8f9fa;
}

.assistant-message {
    max-width: 92%;
    padding: 9px 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    background: #fff;
    color: #212529;
    border: 1px solid #e9ecef;
}

.assistant-message.user {
    margin-left: auto;
    color: #fff;
    background: #0d6efd;
    border-color: #0d6efd;
}

.assistant-intro {
    max-width: 100%;
}

.assistant-question-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.assistant-question-chip {
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid #cfe2ff;
    border-radius: 999px;
    background: #f8fbff;
    color: #0d6efd;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
}

.assistant-question-chip:hover {
    background: #e7f1ff;
    border-color: #9ec5fe;
}

.assistant-results {
    max-width: 100%;
}

.assistant-result-label {
    margin: 4px 0 7px;
    color: #495057;
    font-size: 12px;
    font-weight: 600;
}

.assistant-result-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.assistant-result {
    display: block;
    padding: 9px;
    color: #212529;
    text-decoration: none;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.assistant-result:hover {
    border-color: #86b7fe;
    color: #0d6efd;
}

.assistant-result-title {
    font-weight: 600;
    margin-bottom: 3px;
}

.assistant-result-meta,
.assistant-result-snippet {
    color: #6c757d;
    font-size: 12px;
}

.assistant-image-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.assistant-image-result {
    display: block;
    overflow: hidden;
    color: #212529;
    text-decoration: none;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.assistant-image-result img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #f1f3f5;
}

.assistant-image-result span {
    display: block;
    padding: 6px;
    font-size: 12px;
    color: #6c757d;
}

.front-assistant-input {
    padding: 10px;
    border-top: 1px solid #e9ecef;
    background: #fff;
}

.front-assistant-textarea {
    width: 100%;
    min-height: 68px;
    max-height: 130px;
    resize: vertical;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    outline: none;
}

.front-assistant-textarea:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.14);
}

.front-assistant-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.front-assistant-actions button {
    border-radius: 6px;
}

.assistant-ocr-note {
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
}

@media (max-width: 576px) {
    .front-assistant {
        right: 14px;
        bottom: 14px;
    }

    .front-assistant-panel {
        width: calc(100vw - 28px);
        height: min(560px, calc(100vh - 70px));
    }
}
