/* SOAI Ambient Contextual Bubbles — styles.
   Translucent whisper bubble anchored above the launcher. Fade in/out is driven
   by inline transitions from bubbles.js (so it animates regardless of the OS
   reduce-motion setting; a shorter fallback is applied below for that pref). */

.soai-bubble {
    --soai-b-glass: rgba(255, 255, 255, 0.42);
    --soai-b-txt: #26302a;
    --soai-b-action: #3c6a4b;
    --soai-b-dot: var(--soai-color, #4A7C59);
    position: absolute;
    right: 24px;
    bottom: 74px;            /* tucked just above the launcher (tail connects into it) */
    width: 260px;
    max-width: calc(100vw - 48px);
    z-index: 99998;
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 11px 13px;
    border-radius: 15px;
    background: var(--soai-b-glass);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px -12px rgba(31, 58, 40, 0.4);
    color: var(--soai-b-txt);
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    pointer-events: none;
    will-change: opacity, transform;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.soai-bubble.soai-bubble-in { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.soai-bubble.soai-bubble-out { opacity: 0; transform: translateY(-8px) scale(0.98); }

/* Comic speech-bubble tail pointing down into the launcher circle */
.soai-bubble::after {
    content: "";
    position: absolute;
    bottom: -8px;
    right: 0px;                     /* centered over the launcher circle below */
    width: 18px;
    height: 18px;
    background: var(--soai-b-glass);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    backdrop-filter: blur(20px) saturate(1.5);
    border-right: 1px solid rgba(255, 255, 255, 0.42);
    border-bottom: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 0 0 6px 0;
    transform: rotate(45deg);
    box-shadow: 4px 4px 10px -6px rgba(31, 58, 40, 0.35);
}
.soai-bubble.soai-bubble-dark::after { border-color: rgba(255, 255, 255, 0.14); }

/* Dark glass variant (admin toggle) */
.soai-bubble.soai-bubble-dark {
    --soai-b-glass: rgba(18, 28, 23, 0.5);
    --soai-b-txt: #eef4ee;
    --soai-b-action: #9fe0b6;
    --soai-b-dot: #8fe0ad;
    border-color: rgba(255, 255, 255, 0.14);
}

.soai-bubble-dot {
    flex: 0 0 auto;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    background: var(--soai-b-dot);
    position: relative;
}
.soai-bubble-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--soai-b-dot);
    opacity: 0;
    animation: soai-launcher-pulse 3.6s ease-out infinite;
}

.soai-bubble-body { min-width: 0; }
.soai-bubble-msg {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.42;
    color: var(--soai-b-txt);
    font-weight: 450;
}
.soai-bubble-msg b { font-weight: 600; }

.soai-bubble-action {
    margin-top: 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font: 600 12.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--soai-b-action);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.92;
}
.soai-bubble-action:hover { opacity: 1; }
.soai-bubble-arw { transition: transform 0.15s; }
.soai-bubble-action:hover .soai-bubble-arw { transform: translateX(3px); }

/* Mobile: sit a bit lower/narrower, still above the launcher */
@media (max-width: 600px) {
    .soai-bubble { right: 16px; bottom: 66px; width: 240px; }
    .soai-bubble::after { right: 4px; }
}

/* Reduce-motion: keep a short fade rather than a hard pop */
@media (prefers-reduced-motion: reduce) {
    .soai-bubble { transition-duration: 200ms !important; transform: none; }
    .soai-bubble.soai-bubble-out { transform: none; }
    .soai-bubble-dot::after { animation: none; }
}

/* Quick-answer row (ad visitor firmness bubble) */
.soai-bubble-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.soai-bubble-choice {
    background: transparent;
    border: 1px solid var(--soai-b-action);
    border-radius: 999px;
    color: var(--soai-b-action);
    cursor: pointer;
    font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 32px;
    padding: 0 13px;
}
.soai-bubble-choice:hover { background: var(--soai-b-action); color: #fff; }
/* The one-tap question is not tucked away while it sits over the builder column (so-site-palette.css).
   Other bubbles on the mattress page show again since 2026-11-24 (owner) but are still tucked. */
.soai-bubble.soai-bubble-ask.so-nudge-tucked { visibility: visible !important; pointer-events: auto; }
