#bobbys-chat-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999; /* lower than .side-panel */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#bobbys-launcher-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

#bobbys-launcher {
    width: 52px;
    height: 52px;
    background: #132440;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s ease;
}

#bobbys-launcher:hover {
    transform: scale(1.05);
}

.bobbys-online-dot {
    width: 11px;
    height: 11px;
    background: #4ade80;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
    border: 2px solid #132440;
}

.bobbys-teaser {
    background: #fff;
    border: 0.5px solid #e8e0d6;
    border-radius: 12px;
    border-bottom-right-radius: 3px;
    padding: 9px 12px;
    font-size: 13px;
    color: #000;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    cursor: pointer;
}

.bobbys-teaser.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#bobbys-teaser-close {
    width: 16px;
    height: 16px;
    min-width: 16px;
    background: #f0ebe4;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 10px;
    color: #686868;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

@keyframes bobby-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.13); }
    60%  { transform: scale(0.96); }
    80%  { transform: scale(1.07); }
    100% { transform: scale(1); }
}

.bobbys-pulse {
    animation: bobby-pulse 1.8s ease-in-out;
}

#bobbys-widget {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 320px;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    border: 0.5px solid #e8e0d6;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.97);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

#bobbys-widget.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.bobbys-header {
    background: #132440;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bobbys-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bobbys-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #decfbf;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: #132440;
    flex-shrink: 0;
}

.bobbys-name {
    font-size: 14px;
    color: #f9f5f2;
    font-family: Georgia, serif;
}

.bobbys-status {
    font-size: 11px;
    color: rgba(249,245,242,0.55);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.bobbys-status-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    flex-shrink: 0;
}

#bobbys-close {
    color: rgba(249,245,242,0.4);
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

#bobbys-messages {
    padding: 12px;
    background: #faf8f6;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

#bobbys-messages::-webkit-scrollbar {
    display: none;
}

.bobbys-msg-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.bobbys-msg-row.user {
    justify-content: flex-end;
}

.bobbys-msg-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #decfbf;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    color: #132440;
    flex-shrink: 0;
}

.bobbys-bubble {
    max-width: 230px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
}

.bobbys-bubble.bot {
    background: #fff;
    border: 0.5px solid #e8e0d6;
    color: #000;
    border-bottom-left-radius: 3px;
}

.bobbys-bubble.user {
    background: #132440;
    color: #f9f5f2;
    border-bottom-right-radius: 3px;
}

.bobbys-bubble a {
    color: #132440;
    text-decoration: underline;
}

.bobbys-product-card {
    margin-left: 32px;
    background: #fff;
    border: 0.5px solid #e8e0d6;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    min-height: 110px;
    align-items: stretch;
}

.bobbys-product-img {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    object-fit: cover;
    display: block !important;
    background: #f0ebe4;
    flex-shrink: 0;
    min-height: 110px;
}

.bobbys-product-body {
    padding: 8px 10px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bobbys-product-stars {
    font-size: 11px;
    color: #132440;
    margin-bottom: 3px;
}

.bobbys-product-name {
    font-size: 12px;
    font-weight: 500;
    color: #000;
    font-family: Georgia, serif;
    margin-bottom: 6px;
    line-height: 1.3;
}

.bobbys-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.bobbys-product-price {
    font-size: 13px;
    font-weight: 500;
    color: #000;
}

.bobbys-product-btn {
    font-size: 10px;
    background: #132440;
    color: #f9f5f2;
    padding: 4px 9px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.bobbys-bundle-card {
    margin-left: 32px;
    background: #132440;
    border-radius: 8px;
    padding: 10px 12px;
}

.bobbys-bundle-eyebrow {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #decfbf;
    margin-bottom: 4px;
}

.bobbys-bundle-name {
    font-size: 13px;
    color: #f9f5f2;
    font-family: Georgia, serif;
    margin-bottom: 3px;
}

.bobbys-bundle-desc {
    font-size: 11px;
    color: rgba(249,245,242,0.6);
    line-height: 1.4;
    margin-bottom: 8px;
}

.bobbys-bundle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bobbys-bundle-price {
    font-size: 13px;
    color: #decfbf;
    font-weight: 500;
}

.bobbys-bundle-btn {
    font-size: 10px;
    background: #decfbf;
    color: #132440;
    padding: 4px 9px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
}

.bobbys-steer {
    margin-left: 32px;
    background: #f0ebe4;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 12px;
    color: #686868;
    font-style: italic;
    line-height: 1.5;
}

.bobbys-input-wrap {
    padding: 10px 12px;
    background: #fff;
    border-top: 0.5px solid #e8e0d6;
}

.bobbys-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#bobbys-input {
    flex: 1;
    height: 36px;
    border: 0.5px solid #e8e0d6;
    border-radius: 18px;
    padding: 0 14px;
    font-size: 13px;
    background: #faf8f6;
    color: #000;
    outline: none;
    font-family: inherit;
}

#bobbys-input::placeholder {
    color: #c8bfb5;
}

#bobbys-send {
    width: 32px;
    height: 32px;
    background: #132440;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bobbys-notice {
    font-size: 10px;
    color: #c8bfb5;
    text-align: center;
    margin-top: 6px;
}

.bobbys-typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
}

.bobbys-typing-bubble span {
    width: 6px;
    height: 6px;
    background: #c8bfb5;
    border-radius: 50%;
    display: inline-block;
    animation: bobby-typing 1.2s infinite ease-in-out;
}

.bobbys-typing-bubble span:nth-child(2) {
    animation-delay: 0.2s;
}

.bobbys-typing-bubble span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bobby-typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
    40%            { transform: scale(1.1); opacity: 1; }
}

@media (max-width: 768px) {
    #bobbys-chat-wrap {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
    }

    #bobbys-launcher-wrap {
        position: fixed;
        bottom: 16px;
        right: 16px;
        width: auto;
    }

    /* FIX 1 + 4: 60% height, fixed position, no resize on keyboard open */
    #bobbys-widget {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60vh;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        opacity: 1;
        /* Prevent layout shift when soft keyboard opens */
        will-change: transform;
    }

    #bobbys-widget.open {
        transform: translateY(0);
        opacity: 1;
    }

    #bobbys-messages {
        flex: 1;
        max-height: none;
        overflow-y: auto;
    }

    /* Keep input row always visible above keyboard */
    .bobbys-input-wrap {
        flex-shrink: 0;
        position: relative;
    }
}

#bobbys-send {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    background: #132440 !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 !important;
}

#bobbys-launcher {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    background: #132440 !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 !important;
}

#bobbys-input {
    flex: 1;
    height: 36px !important;
    border: 0.5px solid #e8e0d6 !important;
    border-radius: 18px !important;
    padding: 0 14px !important;
    /* FIX: 16px prevents iOS Safari auto-zoom on focus */
    font-size: 16px !important;
    transform-origin: left center;
    background: #faf8f6 !important;
    color: #000;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none !important;
    appearance: none !important;
}