/**
 * AI eShop Chat - Frontend Styles
 * Oxford Metadata Blue Theme 💙
 *
 * @package AI_eShop_Chat
 */

/* Chat Wrapper */
.aieo-chat-wrapper {
    /* Inherit the host theme's font so the chat matches the storefront
       typography (was a hard-coded system-font stack). */
    font-family: inherit;
    max-width: 95vw;
    margin: 0 auto;
}

/* Chat Container */
.aieo-chat-container {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(3, 22, 60, 0.15);
    overflow: hidden;
    border: 1px solid rgba(3, 22, 60, 0.1);
}

/* Header */
.aieo-chat-header {
    background: var(--aieo-chat-button-color, #03163C);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(3, 22, 60, 0.3);
}

.aieo-chat-avatar {
    font-size: 2.5em;
    line-height: 1;
}

.aieo-chat-title {
    flex: 1;
    font-size:14px;
}

.aieo-chat-title strong {
    display: block;
    font-size: 1.3em;
    margin-bottom: 3px;
}

.aieo-chat-status {
    font-size: 0.85em;
    opacity: 0.9;
}

/* Messages Area */
.aieo-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F9FAFB;
    min-height: 0; /* Important: allows flex to shrink below content size */
}

/* Individual Message */
.aieo-chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aieo-chat-message-user {
    flex-direction: row-reverse;
}

.aieo-chat-avatar-small {
    width: 36px;
    height: 36px;
    background: var(--aieo-chat-button-color, #03163C);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    flex-shrink: 0;
}

.aieo-chat-message-user .aieo-chat-avatar-small {
    background: var(--aieo-chat-primary-color, #47ACFE);
}

.aieo-chat-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    line-height: 1.5;
    font-size: var(--aieo-chat-text-fs, 15px);
}

.aieo-chat-message-user .aieo-chat-message-content {
    background: var(--aieo-chat-primary-color, #47ACFE);
    color: white;
}

/* Typing Indicator */
.aieo-chat-typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.aieo-chat-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--aieo-chat-button-color, #03163C);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    30% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Products Display */
.aieo-chat-products {
    margin: 20px 0;
    display: grid;
    gap: 15px;
}

.aieo-chat-product {
    background: white;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(3, 22, 60, 0.1);
    transition: all 0.3s ease;
}

.aieo-chat-product:hover {
    box-shadow: 0 4px 20px rgba(3, 22, 60, 0.2);
    transform: translateY(-2px);
}

.aieo-chat-product-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #F3F4F6;
}

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

.aieo-chat-product-details {
    flex: 1;
}

.aieo-chat-product-details h4 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.aieo-chat-product-details h4 a {
    color: #1F2937;
    text-decoration: none;
    transition: color 0.2s;
}

.aieo-chat-product-details h4 a:hover {
    color: var(--aieo-chat-primary-color, #47ACFE);
}

.aieo-chat-product-price {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--aieo-chat-button-color, #03163C);
    margin-bottom: 8px;
}

.aieo-chat-product-details p {
    color: #6B7280;
    font-size: 0.9em;
    margin: 8px 0;
}

.aieo-chat-product-rating {
    font-size: 0.9em;
    color: #6B7280;
    margin: 8px 0;
}

.aieo-chat-product-stock {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    margin: 8px 0;
}

.aieo-out-of-stock {
    background: #FEE2E2;
    color: #DC2626;
}

.aieo-on-sale {
    background: #DCFCE7;
    color: #16A34A;
    margin-bottom: 12px;
}

.aieo-chat-product-btn {
    display: inline-block;
    background: var(--aieo-chat-button-color, #03163C);
    color: white !important;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(3, 22, 60, 0.3);
}

.aieo-chat-product-btn:hover {
    background: var(--aieo-chat-primary-color, #47ACFE);
    box-shadow: 0 4px 12px rgba(3, 22, 60, 0.5);
    transform: translateY(-1px);
}

/* Input Area */
.aieo-chat-input-area {
    background: white;
    padding: 20px 20px 20px 20px;
    border-top: 1px solid #E5E7EB;
    flex-shrink: 0; /* Important: prevents input area from being hidden */
}

.aieo-chat-terms {
    font-size: 0.75em;
    line-height: 1.4;
    color: #9CA3AF;
    text-align: center;
    margin-bottom: 12px;
    margin-top: 0;
    padding: 0 10px;
}

.aieo-chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 5px;
}

.aieo-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 24px;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
}

.aieo-chat-input:focus {
    border-color: var(--aieo-chat-primary-color, #47ACFE);
    box-shadow: 0 0 0 3px rgba(71, 172, 254, 0.1);
}

.aieo-chat-send-btn {
    width: 48px;
    height: 48px;
    background: var(--aieo-chat-button-color, #03163C);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(3, 22, 60, 0.3);
}

.aieo-chat-send-btn:hover:not(:disabled) {
    background: var(--aieo-chat-primary-color, #47ACFE);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(3, 22, 60, 0.5);
}

.aieo-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.aieo-chat-loading {
    text-align: center;
    padding: 40px;
    color: #6B7280;
    font-size: 1.1em;
}

/* Error State */
.aieo-chat-error {
    background: #FEE2E2;
    color: #DC2626;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .aieo-chat-container {
        border-radius: 0;
        height: 100vh !important;
    }

    .aieo-chat-message-content {
        max-width: 85%;
    }

    .aieo-chat-product {
        flex-direction: column;
    }

    .aieo-chat-product-image {
        width: 100%;
        height: 200px;
    }
}

/* Scrollbar Styling */
.aieo-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.aieo-chat-messages::-webkit-scrollbar-track {
    background: #F3F4F6;
}

.aieo-chat-messages::-webkit-scrollbar-thumb {
    background: var(--aieo-chat-button-color, #03163C);
    border-radius: 4px;
}

.aieo-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--aieo-chat-primary-color, #47ACFE);
}

/* ========================================
   FLOATING CHAT WIDGET STYLES
   ======================================== */

/* Floating Trigger Button */
.aieo-floating-trigger {
    position: fixed;
    width: 60px;
    height: 60px;
    background: var(--aieo-chat-button-color, #03163C);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(3, 22, 60, 0.4);
    transition: all 0.3s ease;
    z-index: 999998;
}

.aieo-floating-trigger.bottom-right {
    bottom: 20px;
    right: 20px;
}

.aieo-floating-trigger.bottom-left {
    bottom: 20px;
    left: 20px;
}

.aieo-floating-trigger.bottom-centre {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.aieo-floating-trigger.bottom-centre:hover {
    transform: translateX(-50%) scale(1.1);
}

.aieo-floating-trigger.top-right {
    top: 100px;
    right: 20px;
}

.aieo-floating-trigger.top-left {
    top: 100px;
    left: 20px;
}

.aieo-floating-trigger:hover {
    background: var(--aieo-chat-primary-color, #47ACFE);
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(3, 22, 60, 0.6);
}

.aieo-floating-trigger svg {
    width: 28px;
    height: 28px;
}

/* Welcome Bubble */
.aieo-floating-welcome-bubble {
    position: fixed;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 250px;
    z-index: 999997;
    animation: aieo-bubble-appear 0.3s ease-out;
    cursor: pointer;
}

.aieo-floating-welcome-bubble.hidden {
    display: none;
}

/* Desktop positions for welcome bubble */
.aieo-floating-welcome-bubble.bottom-right {
    bottom: 90px;
    right: 20px;
}

.aieo-floating-welcome-bubble.bottom-left {
    bottom: 90px;
    left: 20px;
}

.aieo-floating-welcome-bubble.bottom-centre {
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
}

.aieo-floating-welcome-bubble-content {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.aieo-floating-welcome-bubble-arrow {
    position: absolute;
    bottom: -8px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

/* Position arrow for bottom-left */
.aieo-floating-welcome-bubble.bottom-left .aieo-floating-welcome-bubble-arrow {
    right: auto;
    left: 25px;
}

/* Position arrow for bottom-centre */
.aieo-floating-welcome-bubble.bottom-centre .aieo-floating-welcome-bubble-arrow {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

/* Mobile-specific positions */
@media (max-width: 768px) {
    .aieo-floating-welcome-bubble.mobile-bottom-right {
        bottom: 90px;
        right: 20px;
        left: auto;
        transform: none;
    }

    .aieo-floating-welcome-bubble.mobile-bottom-left {
        bottom: 90px;
        left: 20px;
        right: auto;
        transform: none;
    }

    .aieo-floating-welcome-bubble.mobile-bottom-centre {
        bottom: 90px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    /* Mobile arrow positioning */
    .aieo-floating-welcome-bubble.mobile-bottom-right .aieo-floating-welcome-bubble-arrow {
        right: 25px;
        left: auto;
        transform: none;
    }

    .aieo-floating-welcome-bubble.mobile-bottom-left .aieo-floating-welcome-bubble-arrow {
        left: 25px;
        right: auto;
        transform: none;
    }

    .aieo-floating-welcome-bubble.mobile-bottom-centre .aieo-floating-welcome-bubble-arrow {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

@keyframes aieo-bubble-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Chat Window */
.aieo-floating-chat-window {
    position: fixed;
    /* Desktop default — fills 90% of the viewport height so the agent
       has room to show several products + their images stacked, and a
       comfortable width for two cards side-by-side. The mobile @media
       block below collapses this back to the saved popup_width/height
       for phones/tablets ≤768px. Resize is handled by the custom JS
       resizer in ai-eshop-chat-addon.php (8 handles — 4 edges + 4
       corners) so the user can grab any side, not just the bottom-
       right corner that CSS `resize: both` would offer. */
    width: 520px;
    max-width: calc(100vw - 40px) !important;
    height: 90vh;
    max-height: calc(100vh - 80px) !important;
    min-width: 360px;
    min-height: 480px;
    overflow: hidden;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
}

.aieo-floating-chat-window.bottom-right {
    bottom: 40px;
    right: 20px;
}

.aieo-floating-chat-window.bottom-left {
    bottom: 40px;
    left: 20px;
}

.aieo-floating-chat-window.bottom-centre {
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.aieo-floating-chat-window.top-right {
    top: 80px;
    right: 20px;
}

.aieo-floating-chat-window.top-left {
    top: 80px;
    left: 20px;
}

.aieo-floating-chat-window .aieo-chat-header {
    background: var(--aieo-chat-button-color, #03163C);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(3, 22, 60, 0.3);
    flex-shrink: 0; /* Important: keeps header always visible */
}

.aieo-floating-chat-window .aieo-chat-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.aieo-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px !important;
    height: 32px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.aieo-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.aieo-floating-chat-window .aieo-chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important: allows flex to shrink */
    margin: 0; /* Remove auto margin that centers content */
    max-width: none; /* Remove max-width constraint */
    width: 100%; /* Fill the floating window width */
}

.aieo-floating-chat-window .aieo-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important: allows flex to shrink */
}

.aieo-floating-chat-window .aieo-chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Important: allows flex to shrink below content size */
}

.aieo-floating-chat-window .aieo-chat-input-area {
    flex-shrink: 0; /* Important: prevents input area from being hidden */
}

/* Mobile Responsive Floating Widget */
@media (max-width: 768px) {
    .aieo-floating-trigger {
        width: 56px;
        height: 56px;
    }

    .aieo-floating-trigger svg {
        width: 24px;
        height: 24px;
    }

    /* Mobile positioning for trigger button - overrides desktop position */
    .aieo-floating-trigger.mobile-bottom-right {
        bottom: 10px !important;
        right: 15px !important;
        left: auto !important;
        transform: none !important;
    }

    .aieo-floating-trigger.mobile-bottom-left {
        bottom: 10px !important;
        left: 15px !important;
        right: auto !important;
        transform: none !important;
    }

    .aieo-floating-trigger.mobile-bottom-centre {
        bottom: 10px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    /* Mobile positioning for chat window - overrides desktop position.
     *
     * NOTE: `!important` was stripped from these rules so a host plugin
     * or theme can override the popup's mobile layout via plain CSS
     * cascade (later origin / higher specificity). The default values
     * here still take effect on standalone installs because nothing
     * else competes; on Rooster X / AIEO Side Cart the launcher in the
     * bottom bar publishes its own #aieo-floating-chat-window rules
     * (full viewport above the 58px bar) and wins via `<link>`-after-
     * `<style>` cascade order, no `!important` needed. */
    .aieo-floating-chat-window {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        /* Sit ABOVE the mobile bottom bar: --aieo-mbar-height is published on
           :root by the side-cart (0 in bubble mode, unset → 0 when no bar). */
        height: calc(100vh - var(--aieo-mbar-height, 0px) - 30px);
        max-height: calc(100vh - var(--aieo-mbar-height, 0px) - 30px);
        min-width: 0;
        min-height: 0;
        resize: none; /* Phones / tablets: don't expose the resize handle */
        top: auto;
        border-radius: 12px;
    }
    .aieo-resize-handle { display: none !important; } /* No resize on mobile. */

    .aieo-floating-chat-window.mobile-bottom-right {
        bottom: calc(var(--aieo-mbar-height, 0px) + 10px);
        right: 10px;
        left: auto;
        transform: none;
    }

    .aieo-floating-chat-window.mobile-bottom-left {
        bottom: calc(var(--aieo-mbar-height, 0px) + 10px);
        left: 10px;
        right: auto;
        transform: none;
    }

    .aieo-floating-chat-window.mobile-bottom-centre {
        bottom: calc(var(--aieo-mbar-height, 0px) + 10px);
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

/* Persistent Category Menu */
.aieo-chat-category-menu {
    background: #f9f9f9;
    border-bottom: 2px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Category Selection Bubbles */
.aieo-chat-category-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.aieo-chat-category-bubble {
    background: var(--aieo-chat-button-color, #03163C);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: inherit;       /* <button> doesn't inherit the theme font by default */
    font-size: var(--aieo-chat-btn-fs, 13px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(3, 22, 60, 0.2);
    white-space: nowrap;
}

.aieo-chat-category-bubble:hover {
    background: var(--aieo-chat-primary-color, #45B1E8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(69, 177, 232, 0.3);
}

.aieo-chat-category-bubble:active {
    transform: translateY(0);
}

/* Highlighted category bubble (current page category) */
.aieo-chat-category-bubble-highlight {
    background: var(--aieo-chat-primary-color, #45B1E8) !important;
    box-shadow: 0 4px 12px rgba(69, 177, 232, 0.4) !important;
    transform: scale(1.05);
}

.aieo-chat-category-selection .aieo-chat-message-content p {
    margin-bottom: 10px;
}

/* Category link styling */
.aieo-chat-message-content a {
    color: var(--aieo-chat-primary-color, #45B1E8);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.aieo-chat-message-content a:hover {
    color: var(--aieo-chat-button-color, #03163C);
    text-decoration: underline;
}

/* ========================================
   FEEDBACK SLIDER STYLES
   ======================================== */

/* Message content wrapper for feedback integration */
.aieo-chat-message-content-wrapper {
    max-width: 70%;
}

.aieo-chat-message-user .aieo-chat-message-content-wrapper {
    max-width: 70%;
}

/* Feedback container */
.aieo-chat-feedback {
    margin-top: 8px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid rgba(3, 22, 60, 0.08);
    box-sizing: border-box;
    min-width: 250px;
    width: 100%;
}

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

.aieo-chat-feedback-slider-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.aieo-chat-feedback-emoji {
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
}

/* Slider styling */
.aieo-chat-feedback-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right,
        #EF4444 0%,
        #F59E0B 50%,
        #22C55E 100%
    );
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Slider thumb - Webkit (Chrome, Safari, Edge) */
.aieo-chat-feedback-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    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);
    transition: all 0.2s ease;
}

.aieo-chat-feedback-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Slider thumb - Firefox */
.aieo-chat-feedback-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    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);
    transition: all 0.2s ease;
}

.aieo-chat-feedback-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Firefox track styling */
.aieo-chat-feedback-slider::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right,
        #EF4444 0%,
        #F59E0B 50%,
        #22C55E 100%
    );
}

/* Status message */
.aieo-chat-feedback-status {
    font-size: 10px;
    text-align: center;
    margin-top: 3px;
    min-height: 12px;
    transition: all 0.3s ease;
}

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

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

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .aieo-chat-message-content-wrapper {
        max-width: 85%;
    }

    .aieo-chat-feedback {
        padding: 5px 8px;
    }

    .aieo-chat-feedback-slider::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }

    .aieo-chat-feedback-slider::-moz-range-thumb {
        width: 16px;
        height: 16px;
    }
}

/* ------------------------------------------------------------
   Custom resize handles for the floating chat (desktop only).
   8 handles — 4 edges (n/s/e/w) + 4 corners (nw/ne/sw/se).
   The se corner uses the existing CSS resize widget visually.
   Hidden on mobile via the @media block above.
   ------------------------------------------------------------ */
.aieo-resize-handle {
    position: absolute;
    z-index: 100;
    background: transparent; /* invisible — they're grab targets only */
}
.aieo-resize-n  { top: -4px;    left: 8px;    right: 8px;    height: 8px;  cursor: ns-resize; }
.aieo-resize-s  { bottom: -4px; left: 8px;    right: 8px;    height: 8px;  cursor: ns-resize; }
.aieo-resize-w  { left: -4px;   top: 8px;     bottom: 8px;   width: 8px;   cursor: ew-resize; }
.aieo-resize-e  { right: -4px;  top: 8px;     bottom: 8px;   width: 8px;   cursor: ew-resize; }
.aieo-resize-nw { top: -4px;    left: -4px;   width: 14px;   height: 14px; cursor: nwse-resize; z-index: 101; }
.aieo-resize-ne { top: -4px;    right: -4px;  width: 14px;   height: 14px; cursor: nesw-resize; z-index: 101; }
.aieo-resize-sw { bottom: -4px; left: -4px;   width: 14px;   height: 14px; cursor: nesw-resize; z-index: 101; }
.aieo-resize-se { bottom: -4px; right: -4px;  width: 14px;   height: 14px; cursor: nwse-resize; z-index: 101; }
