/**
 * Phase 14 — Retention strip + library nudge (scoped; no design-system refactor).
 */

.bbai-bottom-banner,
.bbai-retention-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 16px;
    align-items: center;
    max-width: 900px;
    margin: 16px auto 16px;
    padding: 24px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(248, 250, 252, 1) 100%
    );
    box-shadow: none;
}

.bbai-bottom-banner__inner {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
}

.bbai-bottom-banner__content,
.bbai-retention-strip__main {
    grid-column: 1;
    text-align: left;
}

.bbai-retention-strip__headline {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 650;
    color: #0f172a;
    line-height: 1.35;
}

.bbai-retention-strip__supporting,
.bbai-retention-strip__delta {
    margin: 0;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.45;
}

.bbai-retention-strip__delta {
    color: #047857;
    font-weight: 600;
}

.bbai-bottom-banner__progress,
.bbai-retention-strip__progress {
    grid-column: 1;
    min-width: 0;
    max-width: 420px;
    margin-top: 6px;
}

.bbai-retention-strip__bar {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.bbai-retention-strip__bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #20b26c, #22b573);
    transition: width 0.35s ease;
}

.bbai-retention-strip[data-progress-tone='danger'] .bbai-retention-strip__bar-fill {
    background: linear-gradient(90deg, #c97a00, #d48806);
}

.bbai-retention-strip[data-progress-tone='warning'] .bbai-retention-strip__bar-fill {
    background: linear-gradient(90deg, #d9a441, #e0b35a);
}

.bbai-retention-strip[data-progress-tone='complete'] .bbai-retention-strip__bar-fill {
    background: linear-gradient(90deg, #20b26c, #22b573);
}

.bbai-retention-strip__processed {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.bbai-bottom-banner__actions,
.bbai-retention-strip__actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
}

.bbai-bottom-banner__actions .bbai-btn,
.bbai-retention-strip__actions .bbai-btn {
    height: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.bbai-retention-strip__upgrade-hint {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    padding-top: 0;
    border-top: none;
    font-size: 0.8125rem;
    color: #64748b;
}

@media (max-width: 960px) {
    .bbai-bottom-banner,
    .bbai-retention-strip {
        grid-template-columns: 1fr;
    }

    .bbai-bottom-banner__actions,
    .bbai-retention-strip__actions {
        grid-column: 1;
        grid-row: auto;
        justify-content: flex-start;
    }
}

/* Library nudge */
.bbai-retention-library-nudge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--bbai-space-2) var(--bbai-space-4);
    margin: 0 0 var(--bbai-space-4);
    padding: var(--bbai-space-2) var(--bbai-space-4);
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: #fffbeb;
}

.bbai-retention-library-nudge__line {
    margin: 0;
    flex: 1 1 220px;
    font-size: 0.875rem;
    color: #78350f;
    line-height: 1.4;
}

.bbai-retention-library-nudge__meta {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 0.8125rem;
}

.bbai-retention-library-nudge__cta {
    flex: 0 0 auto;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    background: #10b981;
    color: #fff;
    border: 1px solid #059669;
}

.bbai-retention-library-nudge__cta:hover,
.bbai-retention-library-nudge__cta:focus-visible {
    background: #059669;
    color: #fff;
}
