.ai-advisor-launcher {
    position: fixed;
    right: 22px;
    bottom: 102px;
    z-index: 1085;
    border: 1px solid rgba(8, 16, 33, 0.28);
    border-radius: 999px;
    padding: 9px 14px;
    background: linear-gradient(135deg, #0e1f39, #1d3557);
    color: #f5f8ff;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 10px 24px rgba(8, 16, 33, 0.28);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.ai-advisor-launcher:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #10274b, #25436f);
    box-shadow: 0 14px 30px rgba(8, 16, 33, 0.35);
}

.ai-advisor-launcher i {
    margin-left: 7px;
}

.ai-advisor-modal {
    position: fixed;
    right: 22px;
    bottom: 160px;
    width: min(420px, calc(100vw - 24px));
    max-height: min(72vh, 700px);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d9e4f2);
    border-radius: 16px;
    box-shadow: 0 20px 44px rgba(8, 16, 33, 0.28);
    z-index: 1090;
    display: none;
    overflow: hidden;
}

.ai-advisor-modal.show {
    display: flex;
    flex-direction: column;
}

.ai-advisor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, #0f1f39, #1e3558);
    color: #f5f8ff;
}

.ai-advisor-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
}

.ai-advisor-subtitle {
    font-size: 12px;
    opacity: .9;
}

.ai-advisor-close {
    border: 0;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
}

.ai-advisor-messages {
    padding: 12px;
    overflow-y: auto;
    background: var(--surface-2, #f7fbff);
    flex: 1;
}

.ai-msg {
    max-width: 88%;
    margin-bottom: 9px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    text-align: right;
    word-break: break-word;
}

.ai-msg-bot {
    background: #eef4ff;
    color: #112036;
    border: 1px solid #d8e5ff;
    margin-right: auto;
}

.ai-msg-user {
    background: #0f2946;
    color: #ecf5ff;
    margin-left: auto;
}

.ai-quick-questions {
    padding: 10px 12px 0;
    background: var(--surface-2, #f7fbff);
    border-top: 1px solid rgba(8, 16, 33, 0.14);
}

.ai-chip {
    border: 1px solid #ccd9ec;
    border-radius: 999px;
    background: #fff;
    color: #1b3659;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    margin: 0 0 8px 8px;
    cursor: pointer;
}

.ai-chip-note {
    font-size: 10px;
    font-weight: 800;
    color: #1f4a6a;
    background: #e8f1ff;
    border: 1px solid #c9dcfb;
    border-radius: 999px;
    padding: 2px 6px;
    margin-right: 6px;
}

.ai-advisor-input-wrap {
    padding: 10px 12px;
    border-top: 1px solid rgba(8, 16, 33, 0.08);
    background: var(--surface, #fff);
}

.ai-advisor-form {
    display: flex;
    gap: 8px;
}

.ai-advisor-input {
    flex: 1;
    border: 1px solid #cbd7e7;
    border-radius: 11px;
    padding: 9px 10px;
    font-size: 13px;
}

.ai-advisor-send {
    border: 0;
    border-radius: 11px;
    background: #0f2946;
    color: #fff;
    padding: 0 14px;
    font-weight: 700;
}

.ai-advisor-note {
    font-size: 11px;
    color: #61748b;
    margin-top: 7px;
}

.ai-advisor-note a,
.ai-msg-bot a {
    color: #0a4da6;
    font-weight: 700;
    text-decoration: underline;
}

html[data-theme="dark"] .ai-advisor-note a,
html[data-theme="dark"] .ai-msg-bot a {
    color: #8ab8ff;
}

html[data-theme="dark"] .ai-advisor-modal {
    background: #111c33;
    border-color: #2f4261;
}

html[data-theme="dark"] .ai-advisor-messages,
html[data-theme="dark"] .ai-quick-questions {
    background: #0f182d;
}

html[data-theme="dark"] .ai-quick-questions {
    border-top-color: rgba(153, 175, 205, 0.28);
}

html[data-theme="dark"] .ai-msg-bot {
    background: #152542;
    border-color: #2f466c;
    color: #e4efff;
}

html[data-theme="dark"] .ai-chip {
    background: #121f37;
    border-color: #2f4466;
    color: #dde9fb;
}

html[data-theme="dark"] .ai-advisor-input {
    background: #0f1b32;
    color: #eaf1ff;
    border-color: #2d4162;
}

html[data-theme="dark"] .ai-advisor-note {
    color: #99afcd;
}

@media (max-width: 991.98px) {
    .ai-advisor-launcher {
        left: 10px !important;
        right: auto !important;
        bottom: 192px !important;
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        padding: 0;
        border-radius: 12px !important;
        font-size: 0;
        justify-content: center;
        position: fixed !important;
        z-index: 1120 !important;
    }

    .ai-advisor-launcher i {
        margin-left: 0;
        font-size: 15px;
    }

    .ai-advisor-modal {
        left: 10px !important;
        right: auto !important;
        bottom: 244px !important;
        width: calc(100vw - 20px);
        max-height: 62vh;
    }

    html.exam-mode .ai-advisor-launcher,
    body.exam-mode .ai-advisor-launcher {
        display: none !important;
    }

    html.exam-mode .ai-advisor-modal,
    body.exam-mode .ai-advisor-modal {
        left: 12px !important;
        right: auto !important;
        bottom: 246px !important;
    }
}
