.loan-ai-assistant {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    font-family: Georgia, 'Times New Roman', serif;
}

.loan-ai-launcher {
    border: none;
    background: var(--primary, #153f3f);
    color: #fff;
    padding: 14px 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 14px 34px rgba(21, 63, 63, 0.28);
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.loan-ai-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(21, 63, 63, 0.34);
}

.loan-ai-launcher-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent, #d8a23a);
    color: #153f3f;
    font-weight: 900;
}

.loan-ai-panel {
    display: none;
    width: min(380px, calc(100vw - 32px));
    max-height: min(650px, calc(100vh - 44px));
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.loan-ai-panel.open {
    display: flex;
    flex-direction: column;
}

.loan-ai-header {
    background: var(--primary, #153f3f);
    color: #fff;
    padding: 18px 18px 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.loan-ai-eyebrow {
    display: inline-block;
    font-size: 12px;
    color: #f5d891;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.loan-ai-header h3 {
    margin: 0;
    font-size: 21px;
    line-height: 1.2;
}

.loan-ai-close {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.28);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.loan-ai-messages {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    background: #f7faf9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.loan-ai-message {
    max-width: 88%;
    padding: 12px 13px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
}

.loan-ai-message.bot {
    align-self: flex-start;
    background: #fff;
    color: #1f2937;
    border: 1px solid #e6ece9;
    border-bottom-left-radius: 5px;
}

.loan-ai-message.user {
    align-self: flex-end;
    background: var(--primary, #153f3f);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.loan-ai-quick-actions {
    padding: 12px 14px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-top: 1px solid var(--border, #e2e8f0);
    background: #fff;
}

.loan-ai-quick-actions button {
    flex: 0 0 auto;
    border: 1px solid #d8e1dd;
    background: #f7faf9;
    color: var(--primary, #153f3f);
    padding: 8px 11px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.loan-ai-quick-actions button:hover {
    border-color: var(--accent, #d8a23a);
    background: #fff9ea;
}

.loan-ai-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border, #e2e8f0);
    background: #fff;
}

.loan-ai-input-row input {
    flex: 1;
    border: 1px solid #d8e1dd;
    border-radius: 999px;
    padding: 11px 13px;
    font-family: inherit;
    outline: none;
}

.loan-ai-input-row input:focus {
    border-color: var(--primary, #153f3f);
    box-shadow: 0 0 0 3px rgba(21,63,63,0.09);
}

.loan-ai-input-row button {
    border: none;
    background: var(--accent, #d8a23a);
    color: #153f3f;
    font-weight: 700;
    padding: 0 15px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
}

.loan-ai-footer-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--border, #e2e8f0);
}

.loan-ai-footer-cta a {
    text-align: center;
    padding: 12px;
    font-weight: 700;
    color: var(--primary, #153f3f);
    background: #fff;
}

.loan-ai-footer-cta a + a {
    border-left: 1px solid var(--border, #e2e8f0);
}

.loan-ai-footer-cta a:hover {
    background: #f7faf9;
}

.loan-ai-suggestion-links {
    display: grid;
    gap: 7px;
    margin-top: 8px;
}

.loan-ai-suggestion-links a {
    display: block;
    color: var(--primary, #153f3f);
    background: #f7faf9;
    border: 1px solid #e6ece9;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 700;
}

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

    .loan-ai-launcher-text {
        display: none;
    }

    .loan-ai-launcher {
        padding: 12px;
    }

    .loan-ai-launcher-icon {
        width: 34px;
        height: 34px;
    }

    .loan-ai-panel {
        width: calc(100vw - 28px);
        max-height: calc(100vh - 28px);
    }
}
