

/* Layout spacing */
#ChatLauncher {
    gap: 12px;
    display: flex;
    align-items: end;
}

/* Assistant bubble — frosted, animated pastel, advanced typography */
#ChatLauncher .assistant-message {
    position: relative;
    display: inline-block;
    max-width: min(420px, 100vw - 96px);
    padding: 14px 18px;
    border-radius: 16px;

    /* Frosted glass background */
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 248, 252, 0.6) 40%,
        rgba(245, 249, 255, 0.6) 100%
    );
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(18px) saturate(1.05);
    -webkit-backdrop-filter: blur(18px) saturate(1.05);
    overflow: hidden;

    /* Typography: modern, clean, variable font settings */
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-optical-sizing: auto;
    font-variation-settings: "wght" 450, "opsz" 14;
    font-size: 15px;
    line-height: 1.5;
    color: #111;

    /* Hyphenation & wrapping */
    text-wrap: balance;
    overflow-wrap: anywhere;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    hyphenate-limit-zone: 8%;

    /* Font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "liga", "clig", "kern", "ss01", "cv02", "cv03";
    font-variant-numeric: tabular-nums slashed-zero;
    letter-spacing: 0.01em;

    user-select: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;

    -webkit-font-smoothing: antialiased;
}

#ChatLauncher .assistant-message:hover {
    transform: scale(1.02);
}

/* Animated pastel glow layer */
#ChatLauncher .assistant-message::before {
    content: "";
    position: absolute;
    inset: -30%;
    background: conic-gradient(
        from 0deg,
        #ffd9e6 0%,
        #ffe7d6 20%,
        #fff8cc 40%,
        #e8f9ff 60%,
        #e6e6ff 80%,
        #ffd9e6 100%
    );
    filter: blur(28px) saturate(1.05);
    opacity: 0.2;
    transform-origin: 50% 50%;
    animation: bubble-glow 24s linear infinite;
    pointer-events: none;
}

/* No tail */
#ChatLauncher .assistant-message::after {
    content: none;
}

/* Floating white icon button */
#ChatLauncher .radix-IconButton,
#ChatLauncher > button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 248, 252, 0.6) 40%,
        rgba(245, 249, 255, 0.6) 100%
    );
    backdrop-filter: blur(18px) saturate(1.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s ease, box-shadow .12s ease;
    cursor: pointer;
}

#ChatLauncher .radix-IconButton svg,
#ChatLauncher > button svg {
    color: #444;
}

#ChatLauncher .radix-IconButton:hover,
#ChatLauncher > button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

#ChatLauncher .radix-IconButton:active,
#ChatLauncher > button:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.10);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    #ChatLauncher .assistant-message {
        max-width: calc(100vw - 60px - 6px);
        padding: 12px 16px;
        border-radius: 14px;
    }

    #ChatLauncher .assistant-message {
        font-size: 12px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    #ChatLauncher .assistant-message::before {
        animation: none;
    }
}

/* Glow animation */
@keyframes bubble-glow {
    0%   { transform: rotate(0deg) scale(1.02); }
    50%  { transform: rotate(180deg) scale(1.03); }
    100% { transform: rotate(360deg) scale(1.02); }
}

/* Keep bubble clear of the home indicator when docked near bottom */
@supports (padding: max(0px)) {
  #ChatLauncher {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* Low-motion/low-power users: chill both animations */
@media (prefers-reduced-motion: reduce) {
  #ChatLauncher .assistant-message::before { animation: none; }
}

#ChatLauncherContainer {
    position: fixed;
    bottom: 6px;
    right: 6px;
    z-index: 1000;
}

@media (min-width: 800) {
    #ChatLaunchContainer {
        bottom: 12px;
        right: 12px;
    }
}

#ChatFrame {
    visibility: hidden;
    position: fixed;
    bottom: 60px;
    right: 12px;
    z-index: 1000;
    border: 0;
    outline: 0;
    height: 260px;
    max-width: min(420px, 100vw - 96px);
    border-radius: 24px;

    /* Frosted glass background */
    background: transparent;
    backdrop-filter: blur(18px) saturate(1.05);
    -webkit-backdrop-filter: blur(18px) saturate(1.05);
    overflow: hidden;

    transition: all 0.1s ease;
}

body.ChatOpened #ChatFrame {
    visibility: visible;
}

body.ChatOpened #ChatLauncherContainer .assistant-message {
    display: none;
}

#ChatLauncher .lucide-circle-x,
body.ChatOpened #ChatLauncher .lucide-message-circle { display: none; }

body.ChatOpened #ChatLauncher .lucide-circle-x { display: initial; }

#ChatLauncher .close-first-message {
    position: absolute;
    top: 12px;
    right: 12px;
}