.ai-assistant-root {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 8500;
    font-family: Inter, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.ai-assistant-button {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    color: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.32);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.ai-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 120px));
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.ai-assistant-root.open .ai-assistant-panel {
    display: flex;
}

.ai-assistant-header {
    padding: 14px 16px;
    background: #0f172a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ai-assistant-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    font-weight: 700;
}

.ai-assistant-title small {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 500;
}

.ai-assistant-close {
    border: 0;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 18px;
}

.ai-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-assistant-message {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.ai-assistant-message.assistant {
    align-self: flex-start;
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.ai-assistant-message.user {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
}

.ai-assistant-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.ai-assistant-suggestion {
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    border-radius: 999px;
    color: #334155;
    cursor: pointer;
    font-size: 12px;
    padding: 7px 10px;
}

.ai-assistant-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
}

.ai-assistant-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    outline: none;
}

.ai-assistant-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ai-assistant-send {
    border: 0;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    min-width: 44px;
}

.ai-assistant-send:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

html.theme-dark .ai-assistant-panel {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.22);
}

html.theme-dark .ai-assistant-messages {
    background: #0b1120;
}

html.theme-dark .ai-assistant-message.assistant,
html.theme-dark .ai-assistant-form,
html.theme-dark .ai-assistant-suggestions {
    background: #111827;
    color: #e5e7eb;
    border-color: #263244;
}

html.theme-dark .ai-assistant-input,
html.theme-dark .ai-assistant-suggestion {
    background: #0f172a;
    border-color: #334155;
    color: #e5e7eb;
}

@media (max-width: 640px) {
    .ai-assistant-root {
        right: 16px;
        bottom: 16px;
    }

    .ai-assistant-panel {
        height: min(520px, calc(100vh - 96px));
    }
}
