:root {
    --site-header-bottom: 125px;
}

.aqua-chatbot {
    --aqua-chat-blue: #0077b6;
    --aqua-chat-cyan: #00a6c8;
    --aqua-chat-dark: #075575;
    position: fixed !important;
    right: 22px !important;
    bottom: 22px !important;
    z-index: 85 !important;
    display: block !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0;
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
}

body:has(.floating-book) .aqua-chatbot,
body:has(.floating-stay) .aqua-chatbot {
    bottom: 86px !important;
}

.aqua-chatbot.is-open {
    bottom: 0 !important;
    right: 0 !important;
    pointer-events: none !important;
}

.aqua-chatbot.is-open > * {
    pointer-events: auto !important;
}

.aqua-chatbot *, .aqua-chatbot *::before, .aqua-chatbot *::after { box-sizing: border-box; }
.aqua-chatbot button { font-family: inherit; letter-spacing: 0; cursor: pointer; }

/* Peeking cute cat above the Aqua Bot badge */
.aqua-chatbot-cat {
    position: absolute;
    right: 10px;
    bottom: 54px;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    pointer-events: none;
    transform-origin: 70% 100%;
    animation: aquaMiniCatPeek 4.8s ease-in-out infinite;
    z-index: 2;
}

.aqua-chatbot-cat::after {
    position: absolute;
    right: -5px;
    bottom: 8px;
    width: 12px;
    height: 16px;
    border: 2px solid #075575;
    border-radius: 999px 999px 8px 8px;
    background:
        radial-gradient(circle at 35% 22%, #075575 0 1px, transparent 1.5px),
        radial-gradient(circle at 62% 22%, #075575 0 1px, transparent 1.5px),
        linear-gradient(180deg, #fff1c8, #ffd9ad);
    box-shadow: 0 6px 12px rgba(6, 63, 87, .12);
    content: "";
    transform-origin: 50% 100%;
    animation: aquaMiniCatPaw 1.2s ease-in-out infinite;
}

.aqua-chatbot.is-open .aqua-chatbot-cat {
    display: none !important;
}

.aqua-chatbot-cat span {
    position: relative;
    margin-bottom: 20px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #075575;
    background: linear-gradient(180deg, #ffffff, #effbff);
    box-shadow: 0 8px 16px rgba(6, 63, 87, .16);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.aqua-chatbot-cat span::after {
    position: absolute;
    right: 7px;
    bottom: -4px;
    width: 7px;
    height: 7px;
    background: #ffffff;
    transform: rotate(45deg);
    content: "";
}

.aqua-chatbot-cat-face {
    position: relative;
    width: 34px;
    height: 30px;
    border: 2px solid #075575;
    border-radius: 50% 50% 46% 46%;
    background:
        radial-gradient(circle at 28% 62%, rgba(255, 135, 145, .44) 0 3px, transparent 4px),
        radial-gradient(circle at 72% 62%, rgba(255, 135, 145, .44) 0 3px, transparent 4px),
        radial-gradient(circle at 50% 50%, #fff9e8 0 48%, transparent 49%),
        linear-gradient(145deg, #fff7df 0%, #ffe4ba 100%);
    box-shadow:
        inset 0 -3px 0 rgba(255, 188, 122, .2),
        0 10px 18px rgba(6, 63, 87, .16);
    animation: aquaMiniCatWave 1.45s ease-in-out infinite;
}

.aqua-chatbot-cat-face::before,
.aqua-chatbot-cat-face::after {
    position: absolute;
    top: -8px;
    width: 13px;
    height: 13px;
    border-top: 2px solid #075575;
    border-left: 2px solid #075575;
    background:
        radial-gradient(circle at 58% 58%, #ffc7b0 0 3px, transparent 4px),
        #fff0c9;
    content: "";
}

.aqua-chatbot-cat-face::before {
    left: 4px;
    border-radius: 5px 0 4px 0;
    transform: rotate(16deg) skew(-8deg);
}

.aqua-chatbot-cat-face::after {
    right: 4px;
    border-radius: 5px 0 4px 0;
    transform: rotate(74deg) skew(-8deg);
}

.aqua-chatbot-cat-face i,
.aqua-chatbot-cat-face i::before,
.aqua-chatbot-cat-face i::after {
    position: absolute;
    display: block;
    content: "";
}

.aqua-chatbot-cat-face i {
    left: 50%;
    top: 16px;
    width: 5px;
    height: 4px;
    border-radius: 50% 50% 55% 55%;
    background: #075575;
    box-shadow:
        -9px 3px 0 -2px rgba(7, 85, 117, .65),
        9px 3px 0 -2px rgba(7, 85, 117, .65);
    transform: translateX(-50%);
}

.aqua-chatbot-cat-face i::before,
.aqua-chatbot-cat-face i::after {
    top: -8px;
    width: 4px;
    height: 6px;
    border-radius: 999px;
    background: #075575;
    animation: aquaMiniCatBlink 4.8s ease-in-out infinite;
}

.aqua-chatbot-cat-face i::before {
    left: -10px;
}

.aqua-chatbot-cat-face i::after {
    right: -10px;
}

/* Floating capsule widget with Periodic Peek-Out Animation ("andar baar av jav kare") */
@keyframes aquaBotPeek {
    0%, 14% {
        max-width: 52px;
        padding: 0;
        gap: 0;
        box-shadow: 0 6px 18px rgba(7, 85, 117, 0.22);
    }
    22%, 60% {
        max-width: 205px;
        padding: 0 18px 0 8px;
        gap: 9px;
        box-shadow: 0 10px 28px rgba(7, 85, 117, 0.28);
    }
    68%, 100% {
        max-width: 52px;
        padding: 0;
        gap: 0;
        box-shadow: 0 6px 18px rgba(7, 85, 117, 0.22);
    }
}

@keyframes aquaBotTextPeek {
    0%, 14% {
        max-width: 0;
        opacity: 0;
        margin-left: 0;
        transform: translateX(10px);
    }
    22%, 60% {
        max-width: 140px;
        opacity: 1;
        margin-left: 0;
        transform: translateX(0);
    }
    68%, 100% {
        max-width: 0;
        opacity: 0;
        margin-left: 0;
        transform: translateX(10px);
    }
}

.aqua-chatbot-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    height: 52px;
    box-sizing: border-box;
    border: 1.5px solid #bce3f2;
    border-radius: 999px;
    color: #063f57;
    background: linear-gradient(135deg, #ffffff 0%, #edf8fc 100%);
    box-shadow: 0 8px 24px rgba(7, 85, 117, 0.22);
    cursor: pointer;
    font-weight: 800;
    outline: none;
    white-space: nowrap;
    overflow: visible;
    animation: aquaBotPeek 7.5s cubic-bezier(0.16, 1, 0.3, 1) infinite;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.aqua-chatbot-toggle:hover,
.aqua-chatbot-toggle:focus-visible,
.aqua-chatbot-toggle:active {
    animation-play-state: paused;
    max-width: 205px !important;
    padding: 0 18px 0 8px !important;
    gap: 9px !important;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(7, 85, 117, 0.32);
    border-color: #8ed2ec;
}

.aqua-chatbot-toggle:hover b,
.aqua-chatbot-toggle:focus-visible b,
.aqua-chatbot-toggle:active b {
    animation-play-state: paused;
    max-width: 140px !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* Single smooth transparent pulse wave behind Aqua Bot (No mirror sweep, no radar rings) */
.aqua-chatbot-toggle::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    border: 1.5px solid rgba(0, 119, 182, 0.35);
    background: rgba(0, 119, 182, 0.08);
    pointer-events: none;
    z-index: -1;
    animation: aquaBotSinglePulse 2.8s cubic-bezier(0.16, 0.8, 0.3, 1) infinite;
}

@keyframes aquaBotSinglePulse {
    0% {
        transform: scale(0.98);
        opacity: 0.8;
    }
    60% {
        transform: scale(1.12, 1.25);
        opacity: 0;
    }
    100% {
        transform: scale(1.15, 1.3);
        opacity: 0;
    }
}

/* Circular logo emblem inside the toggle */
.aqua-chatbot-toggle .aqua-chatbot-toggle-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(0, 119, 182, 0.25);
    box-shadow: 0 2px 8px rgba(7, 85, 117, 0.15);
    flex-shrink: 0;
    animation: aquaLogoFloat 2.8s ease-in-out infinite;
}

.aqua-chatbot-toggle .aqua-chatbot-toggle-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
    display: block;
}

.aqua-chatbot-toggle b {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    word-break: keep-all;
    font-size: 14.5px;
    font-weight: 800;
    color: #075575;
    letter-spacing: 0.2px;
    padding-right: 4px;
    animation: aquaBotTextPeek 7.5s cubic-bezier(0.16, 1, 0.3, 1) infinite;
    pointer-events: none;
}

/* Hide toggle and cat when the panel is open */
.aqua-chatbot.is-open .aqua-chatbot-toggle {
    display: none !important;
}

/* Hide floating booking and WhatsApp buttons cleanly when chat is open so no overlap occurs */
body.site-chat-open .floating-book,
body.site-chat-open .floating-whatsapp,
.aqua-chatbot.is-open ~ .floating-book,
.aqua-chatbot.is-open ~ .floating-whatsapp {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease;
}

/* Chat Panel Box: Positioned cleanly within viewport without any overflow/cutoff */
.aqua-chatbot-panel {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    width: min(380px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    height: min(520px, calc(100dvh - var(--site-header-bottom, 170px) - 24px)) !important;
    max-height: calc(100dvh - var(--site-header-bottom, 170px) - 24px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 1px solid rgba(0, 119, 182, 0.22);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 16px 48px rgba(6, 63, 87, 0.28);
    transform-origin: 90% 100%;
    animation: aquaChatOpen .22s cubic-bezier(0.16, 1, 0.3, 1);
    transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), height 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    z-index: 75;
}

/* Expanded Full Screen / Full Page State on Desktop: Header is NEVER covered */
.aqua-chatbot-panel.is-expanded {
    position: fixed !important;
    right: 20px !important;
    top: calc(var(--site-header-bottom, 170px) + 12px) !important;
    bottom: 20px !important;
    width: min(720px, calc(100vw - 40px)) !important;
    height: calc(100dvh - var(--site-header-bottom, 170px) - 32px) !important;
    max-height: calc(100dvh - var(--site-header-bottom, 170px) - 32px) !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 20px !important;
    box-shadow: 0 24px 60px rgba(6, 63, 87, 0.35) !important;
    z-index: 75 !important;
}

.aqua-chatbot-panel[hidden] { display: none !important; }

/* Panel Header */
.aqua-chatbot-head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #0077b6 0%, #075575 100%);
}

.aqua-chatbot-head-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aqua-chatbot-head-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    padding: 3px;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.aqua-chatbot-head-avatar .aqua-chatbot-avatar-img,
.aqua-chatbot-head-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.aqua-chatbot-head strong {
    display: block;
    font-size: 15.5px;
    line-height: 1.3;
    font-weight: 800;
}

.aqua-chatbot-head span {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    line-height: 1.3;
    color: #d6f0fb;
    opacity: 0.9;
}

.aqua-chatbot-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.aqua-chatbot-expand,
.aqua-chatbot-close {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    cursor: pointer;
    line-height: 1;
    transition: background .2s, border-color .2s, transform .15s;
}

.aqua-chatbot-expand:hover,
.aqua-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.aqua-chatbot-panel.is-expanded .aqua-chatbot-expand {
    background: rgba(255, 255, 255, 0.28);
    border-color: #ffffff;
}

.aqua-chatbot-expand svg,
.aqua-chatbot-close svg {
    display: block;
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.aqua-chatbot-panel .aqua-chatbot-expand .icon-compress,
.aqua-chatbot-panel .aqua-chatbot-expand svg.icon-compress {
    display: none !important;
}
.aqua-chatbot-panel .aqua-chatbot-expand .icon-expand,
.aqua-chatbot-panel .aqua-chatbot-expand svg.icon-expand {
    display: block !important;
}

.aqua-chatbot-panel.is-expanded .aqua-chatbot-expand .icon-compress,
.aqua-chatbot-panel.is-expanded .aqua-chatbot-expand svg.icon-compress {
    display: block !important;
}
.aqua-chatbot-panel.is-expanded .aqua-chatbot-expand .icon-expand,
.aqua-chatbot-panel.is-expanded .aqua-chatbot-expand svg.icon-expand {
    display: none !important;
}

/* Chat Messages */
.aqua-chatbot-messages {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column;
    gap: 12px;
    min-height: 0 !important;
    max-height: none !important;
    padding: 16px;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    background: #f4fbff;
}

.aqua-chatbot-message {
    flex: 0 0 auto;
    max-width: 86%;
    padding: 9px 13px;
    border-radius: 14px;
    overflow-wrap: anywhere;
    font-size: 13.5px;
    line-height: 1.5;
}

/* User question sent from RIGHT side */
.aqua-chatbot-message.user {
    align-self: flex-end;
    margin-left: auto;
    background: linear-gradient(135deg, #0077b6 0%, #075575 100%);
    color: #ffffff;
    border: none;
    border-radius: 14px 14px 4px 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 119, 182, 0.25);
    animation: aquaUserMsgIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Bot answer from LEFT side */
.aqua-chatbot-message.bot {
    align-self: flex-start;
    margin-right: auto;
    color: #17384a;
    background: #ffffff;
    border: 1px solid #d4ebf5;
    border-radius: 14px 14px 14px 4px;
    box-shadow: 0 2px 6px rgba(7, 85, 117, 0.05);
    animation: aquaBotMsgIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.aqua-chatbot-message.is-thinking {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #3b6075;
    background: #f0f9ff;
    border: 1px solid #d0ecf8;
    box-shadow: 0 2px 8px rgba(7, 85, 117, 0.08);
    font-size: 13.5px;
    font-weight: 500;
}

.aqua-chatbot-message.is-thinking i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0077b6;
    opacity: 0.35;
    display: inline-block;
    animation: aquaThinkingDot 1.15s infinite ease-in-out both;
}

.aqua-chatbot-message.is-thinking i:nth-child(2) { animation-delay: 0s; }
.aqua-chatbot-message.is-thinking i:nth-child(3) { animation-delay: 0.18s; }
.aqua-chatbot-message.is-thinking i:nth-child(4) { animation-delay: 0.36s; }

@keyframes aquaThinkingDot {
    0%, 80%, 100% {
        transform: translateY(0) scale(0.85);
        opacity: 0.35;
    }
    40% {
        transform: translateY(-5px) scale(1.15);
        opacity: 1;
        background: #075575;
    }
}

/* Action Links & Buttons inside Bot Replies */
.aqua-chatbot-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 4px;
}

.aqua-chatbot-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

/* Secondary Action Links (e.g. Tickets & Offers, Food Facilities, Rules) */
.aqua-chatbot-links a,
.aqua-chatbot-links a.aqua-chat-btn-secondary {
    color: #0757ad !important;
    background: #eaf5fc !important;
    border: 1.5px solid #0099db !important;
    box-shadow: 0 2px 6px rgba(0, 119, 182, 0.12) !important;
}

.aqua-chatbot-links a:visited,
.aqua-chatbot-links a.aqua-chat-btn-secondary:visited {
    color: #0757ad !important;
}

.aqua-chatbot-links a:hover,
.aqua-chatbot-links a:focus-visible,
.aqua-chatbot-links a.aqua-chat-btn-secondary:hover {
    color: #ffffff !important;
    background: #0077b6 !important;
    border-color: #0077b6 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.28) !important;
}

/* Primary Action Link (e.g. Book Now) */
.aqua-chatbot-links a.aqua-chat-btn-primary {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0757ad 0%, #0099db 100%) !important;
    border: 1.5px solid #064789 !important;
    box-shadow: 0 3px 10px rgba(7, 87, 173, 0.35) !important;
}

.aqua-chatbot-links a.aqua-chat-btn-primary:visited {
    color: #ffffff !important;
}

.aqua-chatbot-links a.aqua-chat-btn-primary:hover,
.aqua-chatbot-links a.aqua-chat-btn-primary:focus-visible {
    color: #ffffff !important;
    background: linear-gradient(135deg, #063c78 0%, #0077b6 100%) !important;
    border-color: #042e5c !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(7, 87, 173, 0.48) !important;
}

.aqua-chatbot-links a:active {
    transform: translateY(0) scale(0.98);
}

/* Quick Question Chips */
.aqua-chatbot-chips {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    border-top: 1px solid #e1f0f8;
    background: #ffffff;
}

.aqua-chatbot-chips button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid #b9e7f5;
    border-radius: 999px;
    color: #075575;
    background: #f7fdff;
    font-size: 12px;
    font-weight: 700;
    transition: background 0.2s, border-color 0.2s;
}

.aqua-chatbot-chips button:hover {
    background: #e8f5fb;
    border-color: #8ed2ec;
}

/* Input Form */
.aqua-chatbot-form {
    display: grid !important;
    flex: 0 0 auto !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e1f0f8;
    background: #ffffff;
}

.aqua-chatbot-form input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #cce5f2;
    border-radius: 8px;
    color: #17384a;
    background: #ffffff;
    font: 16px 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.aqua-chatbot-form input:focus {
    border-color: #0077b6;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.15);
}

.aqua-chatbot-form button {
    display: grid;
    place-items: center;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, #0077b6 0%, #075575 100%);
    box-shadow: 0 2px 6px rgba(0, 119, 182, 0.25);
    transition: transform 0.15s, opacity 0.2s;
}

.aqua-chatbot-form button:hover {
    transform: scale(1.04);
}

/* Footer "Powered by Aquaworld AI" Badge */
.aqua-chatbot-footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px 8px;
    background: #f8fafc;
    border-top: 1px solid #edf2f7;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.2px;
    user-select: none;
    flex-shrink: 0;
}

.aqua-chatbot-footer-brand strong {
    font-weight: 700;
    color: #0077b6;
    letter-spacing: 0.25px;
}

.aqua-chatbot-footer-brand .ai-sparkle-icon {
    width: 12px;
    height: 12px;
    color: #0096c7;
    flex-shrink: 0;
}

.aqua-chatbot button:disabled { cursor: wait; opacity: .6; }

@keyframes aquaChatOpen {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes aquaMiniCatPeek {
    0%, 58%, 100% {
        opacity: 0;
        transform: translateY(14px) scale(.86) rotate(-5deg);
    }
    10%, 46% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    24% {
        transform: translateY(-3px) scale(1) rotate(5deg);
    }
}

@keyframes aquaMiniCatPaw {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-18deg) translateY(-2px); }
}

@keyframes aquaMiniCatWave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-6deg); }
}

@keyframes aquaMiniCatBlink {
    0%, 94%, 98%, 100% { transform: scaleY(1); }
    96% { transform: scaleY(0.1); }
}

@keyframes aquaLogoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(4deg); }
}

/* Mobile & Tablet Ratio Styling (max-width: 768px) */
@media (max-width: 768px) {
    .aqua-chatbot {
        position: fixed !important;
        right: 14px !important;
        bottom: max(14px, env(safe-area-inset-bottom, 14px)) !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 85 !important;
    }

    body:has(.floating-book) .aqua-chatbot,
    body:has(.floating-stay) .aqua-chatbot {
        bottom: max(72px, calc(env(safe-area-inset-bottom, 0px) + 72px)) !important;
    }

    .aqua-chatbot.is-open {
        bottom: 0 !important;
        right: 0 !important;
    }

    @keyframes aquaBotPeekMobile {
        0%, 14% {
            max-width: 44px;
            padding: 0;
            gap: 0;
            box-shadow: 0 4px 14px rgba(7, 85, 117, 0.2);
        }
        22%, 60% {
            max-width: 180px;
            padding: 0 14px 0 6px;
            gap: 7px;
            box-shadow: 0 8px 22px rgba(7, 85, 117, 0.26);
        }
        68%, 100% {
            max-width: 44px;
            padding: 0;
            gap: 0;
            box-shadow: 0 4px 14px rgba(7, 85, 117, 0.2);
        }
    }

    @keyframes aquaBotTextPeekMobile {
        0%, 14% {
            max-width: 0;
            opacity: 0;
            margin-left: 0;
            transform: translateX(8px);
        }
        22%, 60% {
            max-width: 130px;
            opacity: 1;
            margin-left: 0;
            transform: translateX(0);
        }
        68%, 100% {
            max-width: 0;
            opacity: 0;
            margin-left: 0;
            transform: translateX(8px);
        }
    }

    .aqua-chatbot-cat {
        right: 6px;
        bottom: 46px;
        transform: scale(0.85);
    }

    .aqua-chatbot-toggle {
        min-height: 44px;
        height: 44px;
        border-radius: 999px;
        animation: aquaBotPeekMobile 7.5s cubic-bezier(0.16, 1, 0.3, 1) infinite !important;
    }

    .aqua-chatbot-toggle .aqua-chatbot-toggle-icon {
        width: 32px;
        height: 32px;
    }

    .aqua-chatbot-toggle b {
        font-size: 13px;
        padding-right: 4px;
        word-break: keep-all;
        animation: aquaBotTextPeekMobile 7.5s cubic-bezier(0.16, 1, 0.3, 1) infinite !important;
    }

    .aqua-chatbot-toggle:hover,
    .aqua-chatbot-toggle:focus-visible,
    .aqua-chatbot-toggle:active {
        animation-play-state: paused !important;
        max-width: 180px !important;
        padding: 0 14px 0 6px !important;
        gap: 7px !important;
    }

    .aqua-chatbot-toggle:hover b,
    .aqua-chatbot-toggle:focus-visible b,
    .aqua-chatbot-toggle:active b {
        animation-play-state: paused !important;
        max-width: 130px !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
    }

    /* Default Open Box on Mobile: Large enough so replies don't get cut off, safely under header */
    .aqua-chatbot-panel {
        right: 10px !important;
        left: auto !important;
        bottom: max(10px, env(safe-area-inset-bottom, 10px)) !important;
        width: min(340px, calc(100vw - 20px)) !important;
        height: min(440px, calc(100dvh - var(--site-header-bottom, 125px) - 16px)) !important;
        max-height: calc(100dvh - var(--site-header-bottom, 125px) - 16px) !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 16px !important;
        box-shadow: 0 16px 44px rgba(7, 85, 117, 0.35) !important;
    }

    /* FULL PAGE / FULL SCREEN Mode on Mobile: Header is NEVER covered and Chatbot Header is 100% visible */
    .aqua-chatbot-panel.is-expanded {
        top: calc(var(--site-header-bottom, 125px) + 6px) !important;
        left: 8px !important;
        right: 8px !important;
        bottom: max(8px, env(safe-area-inset-bottom, 8px)) !important;
        width: auto !important;
        height: calc(100dvh - var(--site-header-bottom, 125px) - max(8px, env(safe-area-inset-bottom, 8px)) - 6px) !important;
        max-height: calc(100dvh - var(--site-header-bottom, 125px) - max(8px, env(safe-area-inset-bottom, 8px)) - 6px) !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 18px !important;
        z-index: 75 !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important;
    }

    .aqua-chatbot-head {
        padding: 9px 12px !important;
        gap: 8px;
        flex: 0 0 auto !important;
    }

    .aqua-chatbot-head-avatar {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
    }

    .aqua-chatbot-head strong {
        font-size: 13.5px;
    }

    .aqua-chatbot-head span {
        font-size: 10px;
        margin-top: 1px;
    }

    .aqua-chatbot-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .aqua-chatbot-expand,
    .aqua-chatbot-close {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
        border-radius: 7px;
    }

    .aqua-chatbot-expand svg,
    .aqua-chatbot-close svg {
        width: 15px;
        height: 15px;
    }

    .aqua-chatbot-messages {
        padding: 10px;
        gap: 8px;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
    }

    .aqua-chatbot-message {
        font-size: 12px;
        padding: 7px 11px;
        line-height: 1.45;
    }

    .aqua-chatbot-links {
        gap: 6px;
        margin-top: 8px;
    }

    .aqua-chatbot-links a {
        min-height: 30px;
        padding: 5px 12px;
        font-size: 11.5px;
    }

    .aqua-chatbot-chips {
        padding: 5px 8px;
        gap: 5px;
        flex: 0 0 auto !important;
    }

    .aqua-chatbot-chips button {
        min-height: 26px;
        padding: 3px 10px;
        font-size: 10.5px;
    }

    .aqua-chatbot-form {
        padding: 6px 8px !important;
        gap: 6px;
        grid-template-columns: minmax(0, 1fr) 36px;
        margin-top: auto !important;
        margin-bottom: 0 !important;
        flex: 0 0 auto !important;
    }

    .aqua-chatbot-form input {
        height: 38px;
        font-size: 16px !important; /* Critical >= 16px completely eliminates iOS mobile auto-zoom */
        padding: 0 10px;
        border-radius: 8px;
    }

    .aqua-chatbot-form button {
        height: 36px;
        width: 36px;
        border-radius: 6px;
    }

    .aqua-chatbot-form button svg {
        width: 14px;
        height: 14px;
    }

    .aqua-chatbot-footer-brand {
        padding: 5px 8px 6px;
        font-size: 10px;
        gap: 4px;
    }

    .aqua-chatbot-footer-brand .ai-sparkle-icon {
        width: 10px;
        height: 10px;
    }
}

@keyframes aquaBotPeekMobileSmall {
    0%, 14% {
        max-width: 42px;
        padding: 0;
        gap: 0;
        box-shadow: 0 4px 12px rgba(7, 85, 117, 0.18);
    }
    22%, 60% {
        max-width: 170px;
        padding: 0 12px 0 5px;
        gap: 6px;
        box-shadow: 0 6px 18px rgba(7, 85, 117, 0.24);
    }
    68%, 100% {
        max-width: 42px;
        padding: 0;
        gap: 0;
        box-shadow: 0 4px 12px rgba(7, 85, 117, 0.18);
    }
}

@keyframes aquaBotTextPeekMobileSmall {
    0%, 14% {
        max-width: 0;
        opacity: 0;
        transform: translateX(6px);
    }
    22%, 60% {
        max-width: 120px;
        opacity: 1;
        transform: translateX(0);
    }
    68%, 100% {
        max-width: 0;
        opacity: 0;
        transform: translateX(6px);
    }
}

@media (max-width: 360px) {
    .aqua-chatbot-cat {
        right: 5px;
        bottom: 44px;
        transform: scale(0.8);
    }
    .aqua-chatbot-toggle {
        min-height: 42px;
        height: 42px;
        animation: aquaBotPeekMobileSmall 7.5s cubic-bezier(0.16, 1, 0.3, 1) infinite !important;
    }
    .aqua-chatbot-toggle .aqua-chatbot-toggle-icon {
        width: 30px;
        height: 30px;
    }
    .aqua-chatbot-toggle b {
        font-size: 12.5px;
        padding-right: 4px;
        word-break: keep-all;
        animation: aquaBotTextPeekMobileSmall 7.5s cubic-bezier(0.16, 1, 0.3, 1) infinite !important;
    }
    .aqua-chatbot-toggle:hover,
    .aqua-chatbot-toggle:focus-visible,
    .aqua-chatbot-toggle:active {
        animation-play-state: paused !important;
        max-width: 170px !important;
        padding: 0 12px 0 5px !important;
        gap: 6px !important;
    }
    .aqua-chatbot-toggle:hover b,
    .aqua-chatbot-toggle:focus-visible b,
    .aqua-chatbot-toggle:active b {
        animation-play-state: paused !important;
        max-width: 120px !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
    }
}


@media (prefers-reduced-motion: reduce) {
    .aqua-chatbot *, .aqua-chatbot *::before, .aqua-chatbot *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media print {
    .aqua-chatbot { display: none !important; }
}

/* Guarantee Aqua Bot is always visible and clickable above other widgets */
body:not(.site-nav-open) .aqua-chatbot {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 99999 !important;
}
