/* ═══════════════════════════════════════════════════════════════
   Apply-Moment Intercept — Slide-up panel styles
   Prefix: ai- (apply-intercept)
   ═══════════════════════════════════════════════════════════════ */

/* ── Panel container ── */
.ai-panel {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 380px;
    max-height: 90vh;
    background: #FFFFFF;
    border-radius: 16px 16px 12px 12px;
    box-shadow: 0 8px 40px rgba(44, 24, 16, 0.15), 0 2px 8px rgba(44, 24, 16, 0.08);
    z-index: 10000;
    overflow: hidden;
    transform: translateY(calc(100% + 32px));
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.3s ease;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #2C1810;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.ai-panel.ai-visible {
    transform: translateY(0);
    opacity: 1;
}

.ai-panel.ai-dismissing {
    transform: translateY(calc(100% + 32px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.55, 0, 1, 0.45),
                opacity 0.25s ease;
}

/* ── Drag handle (decorative) ── */
.ai-handle {
    width: 36px;
    height: 3px;
    background: rgba(139, 69, 19, 0.15);
    border-radius: 3px;
    margin: 10px auto 0;
}

/* ── Close button ── */
.ai-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #8B7355;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.ai-close:hover {
    background: rgba(139, 69, 19, 0.08);
    color: #2C1810;
}

.ai-close svg {
    width: 16px;
    height: 16px;
}

/* ── Inner content ── */
.ai-body {
    padding: 14px 20px 18px;
}

/* ── Heading ── */
.ai-heading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #2C1810;
    margin-bottom: 12px;
    line-height: 1.35;
    padding-right: 24px;
}

.ai-heading strong {
    font-weight: 700;
}

/* ── Stat row ── */
.ai-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.ai-stat {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #FAF7F2;
    border: 1px solid rgba(139, 69, 19, 0.08);
    border-radius: 8px;
}

.ai-stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-stat-icon.ai-docs {
    background: rgba(45, 106, 79, 0.1);
    color: #2D6A4F;
}

.ai-stat-icon.ai-time {
    background: rgba(139, 69, 19, 0.08);
    color: #8B4513;
}

.ai-stat-icon svg {
    width: 14px;
    height: 14px;
}

.ai-stat-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #2C1810;
    line-height: 1.2;
}

.ai-stat-label {
    font-size: 0.7rem;
    color: #8B7355;
    line-height: 1.2;
}

/* ── Copy text ── */
.ai-copy {
    font-size: 0.82rem;
    color: #5C4033;
    line-height: 1.55;
    margin-bottom: 12px;
}

.ai-copy strong {
    font-weight: 600;
    color: #2C1810;
}

/* ── Rejection teaser (blurred) ── */
.ai-teaser {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(184, 134, 11, 0.06);
    border: 1px solid rgba(184, 134, 11, 0.12);
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.78rem;
}

.ai-teaser-label {
    font-weight: 600;
    color: #8B4513;
    white-space: nowrap;
    flex-shrink: 0;
}

.ai-teaser-blur {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
    color: #5C4033;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── CTA button ── */
.ai-cta {
    display: block;
    width: 100%;
    padding: 11px 16px;
    background: #8B4513;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    margin-bottom: 8px;
}

.ai-cta:hover {
    background: #A0522D;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.25);
}

.ai-cta:visited {
    color: #FFFFFF;
}

.ai-cta:active {
    transform: translateY(0);
}

/* ── Dismiss link ── */
.ai-dismiss {
    display: block;
    width: 100%;
    padding: 4px;
    background: none;
    border: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    color: #8B7355;
    cursor: pointer;
    text-align: center;
    transition: color 0.15s;
}

.ai-dismiss:hover {
    color: #2C1810;
}

/* ── Trust line ── */
.ai-trust {
    text-align: center;
    font-size: 0.68rem;
    color: #8B7355;
    margin-top: 6px;
    letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Mobile bottom sheet
   ═══════════════════════════════════════════ */
@media (max-width: 640px) {
    .ai-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .ai-panel.ai-visible {
        transform: translateY(0);
    }

    .ai-panel.ai-dismissing {
        transform: translateY(100%);
    }

    .ai-body {
        padding: 12px 16px 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
}
