.search-box.ai-thinking {
    border-color: rgba(13, 110, 253, .6);
    box-shadow:
        0 0 0 2px rgba(13, 110, 253, .15),
        0 0 18px rgba(13, 110, 253, .18);
    animation: aiShimmer 1.6s ease-in-out infinite;
}

.search-btn.ai-mode {
    width: 72px;
}

.search-btn.ai-thinking {
    animation: aiPulseBtn 1.6s ease-in-out infinite;
}


/* AI query plan */
.ai-query-plan {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    color: #5b6b82;
    gap: 0.5rem;
}

/* Pulsing (thinking) */
.ai-query-plan.is-thinking::before {
    content: "";
    width: 1.1rem;
    height: 1.1rem;
    background: radial-gradient(circle at 30% 30%, #818cf8, #6366f1);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
    animation: ai-pulse 1.8s ease-in-out infinite;
}

/* Static (done) */
.ai-query-plan.is-done::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    background: rgba(99, 102, 241, 0.6);
    border-radius: 50%;
    box-shadow: none;
    animation: none;
}

.ai-summary-card {
    background: rgba(13, 110, 253, 0.06);
    /* Bootstrap primary tint */
    border-left: 4px solid rgba(13, 110, 253, 0.55);
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .08) !important;
}

.ai-summary-badge {
    background: rgba(13, 110, 253, 0.12);
    color: rgba(13, 110, 253, 1);
    border: 1px solid rgba(13, 110, 253, 0.25);
    font-weight: 600;
    letter-spacing: .02em;
}

/* AI Summary slide-up hide (on new search) */
#aiSummaryWrap {
    transition:
        transform 180ms ease,
        opacity 180ms ease,
        max-height 180ms ease,
        margin 180ms ease;
    transform: translateY(0);
    opacity: 1;
    max-height: 800px; /* enough for typical summaries */
}

#aiSummaryWrap.is-hiding {
    transform: translateY(-8px);
    opacity: 0;
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    #aiSummaryWrap {
        transition: none;
    }
}

.ai-key-callout {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .45rem .6rem;
    margin-bottom: .4rem;

    background: rgba(13, 110, 253, 0.06);
    border: 1px solid rgba(13, 110, 253, 0.18);
    border-radius: .5rem;
}

.ai-key-pill {
    background: rgba(13, 110, 253, .15);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, .35);
    font-weight: 700;
}

.ai-key-text strong {
    font-weight: 700;
}

.ai-summary-body ul {
    margin: 0;
    padding-left: 1.1rem;
}

.ai-summary-body li {
    margin: 0.3rem 0;
    line-height: 1.35;
}

.ai-summary-footnote {
    color: rgba(0, 0, 0, .55);
}


@keyframes aiPulseBtn {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(99, 102, 241, .3);
    }

    50% {
        box-shadow: 0 0 18px rgba(99, 102, 241, .65);
    }
}

@keyframes aiShimmer {
    0% {
        box-shadow:
            0 0 0 2px rgba(13, 110, 253, .12),
            0 0 12px rgba(13, 110, 253, .12);
    }

    50% {
        box-shadow:
            0 0 0 2px rgba(13, 110, 253, .22),
            0 0 22px rgba(13, 110, 253, .22);
    }

    100% {
        box-shadow:
            0 0 0 2px rgba(13, 110, 253, .12),
            0 0 12px rgba(13, 110, 253, .12);
    }
}

@keyframes ai-pulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}


@media (prefers-reduced-motion: reduce) {
    .search-box.ai-thinking {
        animation: none;
    }
}