/* Rooster One floating chat widget. A cached file since 11.2.3 (brief 7.5: it
 * used to be 18 KB of inline CSS on every page). The per-site colours and
 * sizes stay inline as custom properties; the theme (rounded or square) is a
 * class on the widget wrapper. */
            /* Use button color for trigger, header, and send button */
            .aieo-floating-trigger {
                background: var(--aieo-chat-button-gradient) !important;
                box-shadow: 0 4px 20px var(--aieo-chat-button-shadow) !important;
            }

            .aieo-floating-trigger:hover {
                box-shadow: 0 6px 30px var(--aieo-chat-button-shadow) !important;
            }

            .aieo-chat-header,
            .aieo-floating-chat-window .aieo-chat-header {
                background: var(--aieo-chat-button-gradient) !important;
                box-shadow: 0 2px 10px var(--aieo-chat-button-shadow) !important;
            }

            .aieo-chat-send-btn,
            #aieo-floating-chat-send {
                background: var(--aieo-chat-button-gradient) !important;
                box-shadow: 0 2px 8px var(--aieo-chat-button-shadow) !important;
            }

            .aieo-chat-send-btn:hover:not(:disabled),
            #aieo-floating-chat-send:hover:not(:disabled) {
                box-shadow: 0 4px 12px var(--aieo-chat-button-shadow) !important;
            }

            /* Chat input area - prevent theme interference */
            .aieo-chat-input-area {
                line-height: 1.5 !important;
                padding: 20px !important;
            }

            /* Ensure floating wrapper inherits all chat-wrapper styles */
            .aieo-floating-wrapper {
                display: block;
                width: 100%;
                height: 100%;
            }

            /* Floating chat message styling */
            #aieo-floating-chat-messages .aieo-chat-message {
                display: flex;
                flex-direction: column;
                gap: 0;
                margin-bottom: 16px;
                animation: slideIn 0.3s ease-out;
            }

            #aieo-floating-chat-messages .aieo-message-content {
                background: white;
                padding: 12px 16px;
                border-radius: var(--aieo-shape-card, 12px);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
                flex: 1;
                line-height: 1.6;
                word-wrap: break-word;
                font-size: var(--aieo-chat-text-fs, 15px);
            }
            /* Operator text/button font-size — ID-scoped so it wins over the
               base chat-frontend.css class rules inside the floating widget. */
            #aieo-floating-chat-messages .aieo-message-content p {
                font-size: inherit;
            }
            #aieo-floating-chat-messages .aieo-chat-category-bubble {
                font-size: var(--aieo-chat-btn-fs, 13px);
            }

            #aieo-floating-chat-messages .aieo-message-content p {
                margin: 0 0 8px 0;
            }

            #aieo-floating-chat-messages .aieo-message-content p:last-child {
                margin-bottom: 0;
            }

            #aieo-floating-chat-messages .aieo-message-content strong {
                font-weight: 600;
                color: var(--aieo-chat-button-color, #03163C);
            }

            #aieo-floating-chat-messages .aieo-message-content em {
                font-style: italic;
            }

            #aieo-floating-chat-messages .aieo-message-content a {
                color: var(--aieo-chat-primary-color, #47ACFE);
                text-decoration: none;
                border-bottom: 1px solid var(--aieo-chat-primary-color, #47ACFE);
            }

            #aieo-floating-chat-messages .aieo-message-content a:hover {
                color: var(--aieo-chat-button-color, #03163C);
                border-bottom-color: var(--aieo-chat-button-color, #03163C);
            }

            #aieo-floating-chat-messages .aieo-chat-message-user .aieo-message-content {
                background: #F3F4F6;
            }

            /* Typing indicator */
            .aieo-chat-typing {
                display: flex;
                flex-direction: row;
                align-items: center;
                gap: 8px;
            }

            .aieo-chat-typing .aieo-chat-avatar-small {
                width: 36px;
                height: 36px;
                border-radius: 50%;
                background: #F3F4F6;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 20px;
                flex-shrink: 0;
            }

            .aieo-chat-typing .aieo-chat-message-content {
                background: white;
                padding: 12px 16px;
                border-radius: var(--aieo-shape-card, 12px);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            }

            .aieo-chat-typing-dots {
                display: flex;
                align-items: center;
                gap: 6px;
            }

            .aieo-chat-typing-dots span {
                width: 10px;
                height: 10px;
                border-radius: 50%;
                background: var(--aieo-chat-primary-color, #47ACFE);
                animation: typing-bounce 1.4s infinite ease-in-out;
            }

            .aieo-chat-typing-dots span:nth-child(1) {
                animation-delay: -0.32s;
            }

            .aieo-chat-typing-dots span:nth-child(2) {
                animation-delay: -0.16s;
            }

            @keyframes typing-bounce {
                0%, 80%, 100% {
                    transform: scale(0.8);
                    opacity: 0.5;
                }
                40% {
                    transform: scale(1.2);
                    opacity: 1;
                }
            }

            /* Product slider - appears below AI response */
            .aieo-chat-products {
                display: flex;
                gap: 8px;
                overflow-x: auto;
                overflow-y: hidden;
                scroll-snap-type: x mandatory;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: thin;
                scrollbar-color: var(--aieo-chat-primary-color, #47ACFE) #F3F4F6;
                padding: 8px 0;
                margin-top: 12px;
                width: 100%;
            }

            .aieo-chat-products::-webkit-scrollbar {
                height: 4px;
            }

            .aieo-chat-products::-webkit-scrollbar-track {
                background: #F3F4F6;
                border-radius: 2px;
            }

            .aieo-chat-products::-webkit-scrollbar-thumb {
                background: var(--aieo-chat-primary-color, #47ACFE);
                border-radius: 2px;
            }

            .aieo-chat-products::-webkit-scrollbar-thumb:hover {
                background: var(--aieo-chat-button-color, #03163C);
            }

            .aieo-chat-product {
                min-width: 160px;
                max-width: 160px;
                flex-shrink: 0;
                scroll-snap-align: start;
                background: white;
                border-radius: var(--aieo-shape-card, 8px);
                box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
                overflow: hidden;
                transition: transform 0.2s ease;
                display: flex;
                flex-direction: column;
            }

            .aieo-chat-product:hover {
                transform: scale(1.05);
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            }

            .aieo-chat-product-image {
                width: 100%;
                height: 100px;
                overflow: hidden;
                flex-shrink: 0;
            }

            .aieo-chat-product img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: block;
            }

            .aieo-chat-product-info {
                background: var(--aieo-chat-button-color);
                padding: 8px;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                gap: 4px;
                flex: 1;
                min-height: 60px;
            }

            .aieo-chat-product h4 {
                margin: 0;
                padding: 0;
                color: white;
                font-size: 11px;
                line-height: 1.3;
                text-align: center;
                font-weight: 600;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                max-height: 2.6em;
                width: 100%;
            }

            .aieo-chat-product h4 a {
                color: white;
                text-decoration: none;
            }

            .aieo-chat-product .price {
                margin: 0;
                padding: 0;
                font-size: 13px;
                font-weight: bold;
                color: white;
                text-align: center;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 6px;
                flex-wrap: wrap;
            }

            .aieo-chat-product .price * {
                margin: 0 !important;
                padding: 0 !important;
                line-height: 1.2 !important;
            }

            .aieo-chat-product .price br {
                display: none;
            }

            .aieo-chat-product .price .screen-reader-text,
            .aieo-chat-product .price .woocommerce-ultimate-pricing-tooltip {
                display: none !important;
            }

            .aieo-chat-product .price del {
                color: rgba(255, 255, 255, 0.85) !important;
                font-size: 11px;
                order: 1;
            }

            .aieo-chat-product .price ins {
                text-decoration: none;
                background: none;
                color: white;
                font-weight: bold;
                order: 2;
            }

            .aieo-chat-product .price .woocommerce-Price-amount {
                display: inline;
                color: white;
            }

            .aieo-chat-product .price del .woocommerce-Price-amount {
                color: inherit;
            }

            /* Chat terms - reset theme line-height */
            .aieo-chat-terms {
                line-height: 1.4 !important;
                margin-top: 0 !important;
                margin-bottom: 12px !important;
            }

            /* Chat input wrapper - proper spacing */
            .aieo-chat-input-wrapper {
                gap: 12px !important;
                padding: 0 5px !important;
            }

            /* Chat input - reset all theme styles */
            .aieo-chat-input,
            #aieo-floating-chat-input {
                box-sizing: border-box;
                flex: 1;
                font-family: inherit !important;
                width: 100% !important;
                display: block !important;
                margin: 0 !important;
            }
            /* Brief section 23: under the theme's design authority the input is
             * the theme's field; this is its look under ours. */
            html:not([data-rooster-design="theme"]) .aieo-chat-input,
            html:not([data-rooster-design="theme"]) #aieo-floating-chat-input {
                all: unset;
                box-sizing: border-box;
                flex: 1;
                padding: 12px 16px !important;
                border: 2px solid #E5E7EB !important;
                border-radius: var(--aieo-shape-control, 24px) !important;
                font-size: var(--aieo-chat-text-fs, 1em) !important;
                font-family: inherit !important;
                line-height: 1.5 !important;
                color: #1F2937 !important;
                background: white !important;
                width: 100% !important;
                display: block !important;
                margin: 0 !important;
                box-shadow: none !important;
                transition: all 0.3s ease !important;
            }

            html:not([data-rooster-design="theme"]) .aieo-chat-input:focus,
            html:not([data-rooster-design="theme"]) #aieo-floating-chat-input:focus {
                border-color: var(--aieo-chat-button-color) !important;
                box-shadow: 0 0 0 3px var(--aieo-chat-button-shadow) !important;
                outline: none !important;
            }

            /* Send button - ensure proper shape and positioning */
            .aieo-chat-send-btn,
            #aieo-floating-chat-send {
                width: 48px !important;
                height: 48px !important;
                min-width: 48px !important;
                min-height: 48px !important;
                border: none !important;
                border-radius: 50% !important;
                color: white !important;
                cursor: pointer !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                transition: all 0.3s ease !important;
                padding: 0 !important;
                flex-shrink: 0 !important;
            }

            /* Theme: Rounded (default - modern with shadows).
             *
             * `!important` was stripped from these rules so a host
             * plugin/theme can override the popup's chrome via plain
             * CSS cascade (later origin / higher specificity). The
             * defaults still apply on standalone installs because
             * nothing else competes. On Rooster X / AIEO Side Cart the
             * launcher publishes its own #aieo-floating-chat-window
             * rules and wins by ID-vs-class specificity. */
            /* Theme: rounded */
            .aieo-chat-theme-rounded .aieo-floating-chat-window {
                border-radius: var(--aieo-shape-panel, 16px);
                box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
            }

            .aieo-chat-theme-rounded .aieo-chat-container {
                border-radius: var(--aieo-shape-panel, 16px);
                box-shadow: 0 10px 40px var(--aieo-chat-button-shadow);
            }

            .aieo-chat-theme-rounded .aieo-chat-message-content {
                border-radius: var(--aieo-shape-card, 12px);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            }

            .aieo-chat-theme-rounded .aieo-chat-product {
                border-radius: var(--aieo-shape-card, 12px);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
            }
            /* Theme: square */
            /* Theme: Square (clean and minimal) — same `!important`
             * stripping rationale as the rounded theme above. */
            .aieo-chat-theme-square .aieo-floating-chat-window {
                border-radius: var(--aieo-shape-panel, 4px);
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            }

            .aieo-chat-theme-square .aieo-chat-container {
                border-radius: var(--aieo-shape-panel, 4px);
                box-shadow: none;
                border: 1px solid #E5E7EB;
            }

            .aieo-chat-theme-square .aieo-chat-message-content {
                border-radius: var(--aieo-shape-card, 4px);
                box-shadow: none;
                border: 1px solid #E5E7EB;
            }

            .aieo-chat-theme-square .aieo-chat-product {
                border-radius: var(--aieo-shape-card, 4px);
                box-shadow: none;
                border: 1px solid #E5E7EB;
            }

            .aieo-chat-theme-square .aieo-chat-input,
            .aieo-chat-theme-square #aieo-floating-chat-input {
                border-radius: var(--aieo-shape-control, 4px);
            }

            .aieo-chat-theme-square .aieo-chat-send-btn,
            .aieo-chat-theme-square #aieo-floating-chat-send {
                border-radius: var(--aieo-shape-button, 4px);
            }

            .aieo-chat-message.user {
                background: var(--aieo-chat-primary-color-light) !important;
                color: var(--aieo-chat-primary-color) !important;
            }

            .aieo-chat-container a {
                color: var(--aieo-chat-primary-color) !important;
            }

            /* Feedback Slider Styles for Floating Chat */
            #aieo-floating-chat-messages .aieo-chat-feedback {
                margin-top: 10px;
                padding: 8px 12px;
                background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
                border-radius: var(--aieo-shape-card, 8px);
                border: 1px solid rgba(3, 22, 60, 0.08);
                box-sizing: border-box;
                width: 100%;
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-label {
                font-size: 11px;
                color: #6B7280;
                margin-bottom: 6px;
                text-align: center;
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-slider-container {
                display: flex;
                align-items: center;
                gap: 8px;
                width: 100%;
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-emoji {
                font-size: 14px;
                line-height: 1;
                flex-shrink: 0;
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-slider {
                flex: 1;
                -webkit-appearance: none;
                appearance: none;
                height: 6px;
                border-radius: var(--aieo-shape-card, 3px);
                background: linear-gradient(to right, #EF4444 0%, #F59E0B 50%, #22C55E 100%);
                outline: none;
                cursor: pointer;
                width: 100%;
                min-width: 0;
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-slider::-webkit-slider-thumb {
                -webkit-appearance: none;
                appearance: none;
                width: 16px;
                height: 16px;
                border-radius: 50%;
                background: white;
                border: 2px solid var(--slider-color, #F59E0B);
                cursor: pointer;
                box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-slider::-moz-range-thumb {
                width: 16px;
                height: 16px;
                border-radius: 50%;
                background: white;
                border: 2px solid var(--slider-color, #F59E0B);
                cursor: pointer;
                box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-slider::-moz-range-track {
                height: 6px;
                border-radius: var(--aieo-shape-card, 3px);
                background: linear-gradient(to right, #EF4444 0%, #F59E0B 50%, #22C55E 100%);
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-status {
                font-size: 10px;
                text-align: center;
                margin-top: 4px;
                min-height: 14px;
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-saved {
                color: #22C55E;
                font-weight: 500;
            }

            #aieo-floating-chat-messages .aieo-chat-feedback-error {
                color: #EF4444;
                font-weight: 500;
            }

/* Brief section 19: the chat follows the visitor's scheme. Its surfaces were
 * fixed white; under the theme's design authority they take the presets. */
html[data-rooster-design="theme"] .aieo-floating-chat-window,
html[data-rooster-design="theme"] .aieo-chat-container,
html[data-rooster-design="theme"] #aieo-floating-chat-messages,
html[data-rooster-design="theme"] #aieo-floating-chat-messages .aieo-message-content,
html[data-rooster-design="theme"] .aieo-chat-typing .aieo-chat-message-content,
html[data-rooster-design="theme"] .aieo-chat-product {
    background: var(--wp--preset--color--bg, #fff);
    color: var(--wp--preset--color--fg, #1a1a1a);
}
/* Inside a message on those surfaces, bold text and links follow them too: their fixed navy (#03163C) read about
   1.1:1 on the dark scheme's background (29 Oct 2026, the dark-scheme sweep's mixed pairs). */
html[data-rooster-design="theme"] #aieo-floating-chat-messages .aieo-message-content strong {
    color: inherit;
}
html[data-rooster-design="theme"] #aieo-floating-chat-messages .aieo-message-content a {
    color: var(--wp--preset--color--accent-text, var(--wp--preset--color--accent, currentColor));
    border-bottom-color: currentColor;
}
html[data-rooster-design="theme"] #aieo-floating-chat-messages .aieo-message-content a:hover {
    color: var(--wp--preset--color--fg, currentColor);
    border-bottom-color: currentColor;
}
