/* Srnec Chatbot - Intercom-style widget */

.srnec-chatbot {
    --srnec-font-heading: "GreedCondensed-TRIAL-Bold", "Arial Narrow", sans-serif;
    --srnec-font-body: "TT2020StyleE", "Georgia", "Times New Roman", serif;
    --srnec-chatbot-edge-gap: 20px;
    --srnec-chatbot-lift: 0px;
    --srnec-chatbot-blob-size: 100px;
    --srnec-chatbot-open-bar-height: 48px;
    --srnec-chatbot-stack-height: var(--srnec-chatbot-blob-size);
    --srnec-chatbot-bottom: calc(
        var(--srnec-chatbot-lift) + var(--srnec-chatbot-keyboard, 0px) + var(--srnec-chatbot-edge-gap) + env(safe-area-inset-bottom, 0px)
    );
    --srnec-chatbot-desktop-width: min(420px, 50vw);
    --srnec-chatbot-window-open-bottom: calc(
        var(--srnec-chatbot-bottom) + var(--srnec-chatbot-stack-height) + 0.75rem
    );
    --srnec-chatbot-inset-x: 16px;
    --srnec-chatbot-mobile-width: calc(100vw - (2 * var(--srnec-chatbot-inset-x)));
    --srnec-chatbot-uv-glow:
        0 0 8px rgba(0, 255, 85, 0.5),
        0 0 16px rgba(65, 0, 245, 0.42),
        0 0 28px rgba(223, 80, 208, 0.36),
        0 0 40px rgba(205, 245, 100, 0.28);
    --srnec-chatbot-uv-glow-strong:
        0 0 12px rgba(0, 255, 85, 0.72),
        0 0 24px rgba(65, 0, 245, 0.58),
        0 0 40px rgba(223, 80, 208, 0.48),
        0 0 56px rgba(191, 0, 255, 0.38);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    font-family: var(--srnec-font-body);
    font-weight: 400;
    font-style: normal;
    font-synthesis: none;
    font-variant-ligatures: contextual;
    font-feature-settings: "calt" on;
    letter-spacing: var(--srnec-meta-letter-spacing, 0);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.srnec-chatbot:has(.srnec-chatbot__window.is-open) {
    --srnec-chatbot-stack-height: var(--srnec-chatbot-open-bar-height);
}

.srnec-chatbot > * {
    pointer-events: auto;
}

.srnec-chatbot :where(em, i, cite, strong, b) {
    font-style: normal;
    font-weight: 400;
}

.srnec-chatbot.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.srnec-chatbot-scroll-lock {
    overflow: hidden;
    overscroll-behavior: none;
}

/* Homepage: compact blob stays hidden until JS adds .is-scrolled */
body.home .srnec-chatbot__bubble:not(.is-scrolled):not(.is-expanded) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    animation: none !important;
}

body.home .srnec-chatbot__bubble.is-scrolled:not(.is-expanded) {
    animation:
        slideUpFromBottom 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards,
        srnec-chatbot-uv-pulse 2.8s ease-in-out 0.8s infinite;
}

/* Chat bubble — default: 100px UV blob; expanded: full input bar */
.srnec-chatbot__bubble {
    position: fixed;
    bottom: var(--srnec-chatbot-bottom);
    left: auto;
    right: var(--srnec-chatbot-inset-x);
    transform: none;
    z-index: 10000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    box-sizing: border-box;
    opacity: 0;
    overflow: visible;
    will-change: width, height, transform, opacity, box-shadow;
    background-color: rgba(18, 18, 18, 0.82);
    color: #FFFFFF;
    --tw-backdrop-blur: blur(16px);
    backdrop-filter: var(--tw-backdrop-blur);
    -webkit-backdrop-filter: var(--tw-backdrop-blur);
    font-family: var(--srnec-font-body);
    text-align: left;
    border: 1px solid rgba(205, 245, 100, 0.35);
    transition:
        width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        border-radius 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.4s,
        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: slideUpFromBottom 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

/* Compact blob (all screens, chat closed) */
.srnec-chatbot__bubble:not(.is-expanded) {
    width: var(--srnec-chatbot-blob-size);
    min-width: var(--srnec-chatbot-blob-size);
    max-width: var(--srnec-chatbot-blob-size);
    height: var(--srnec-chatbot-blob-size);
    padding: 0;
    border-radius: 50%;
    font-family: var(--srnec-font-heading);
    box-shadow: var(--srnec-chatbot-uv-glow);
    animation:
        slideUpFromBottom 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards,
        srnec-chatbot-uv-pulse 2.8s ease-in-out 0.8s infinite;
}

.srnec-chatbot__bubble:not(.is-expanded)::after {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 40%, rgba(0, 255, 85, 0.55) 0%, transparent 55%),
        radial-gradient(circle at 70% 60%, rgba(223, 80, 208, 0.5) 0%, transparent 50%),
        radial-gradient(circle at 50% 90%, rgba(65, 0, 245, 0.45) 0%, transparent 48%);
    filter: blur(10px);
    opacity: 0.75;
    animation: srnec-chatbot-uv-halo 2.8s ease-in-out infinite;
}

.srnec-chatbot__bubble-compact {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: inherit;
    font-size: var(--srnec-fs-md, 16px);
    line-height: normal;
    font-weight: 700;
    font-style: normal;
    font-feature-settings: normal;
    font-variant-ligatures: normal;
    font-synthesis: none;
    color: #fff;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.65);
}

.srnec-chatbot__bubble-compact-line {
    display: block;
    font-family: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.srnec-chatbot__bubble:not(.is-expanded) .srnec-chatbot__bubble-compact {
    display: flex;
}

.srnec-chatbot__bubble:not(.is-expanded) .srnec-chatbot__bubble-badge,
.srnec-chatbot__bubble:not(.is-expanded) .srnec-chatbot__bubble-input,
.srnec-chatbot__bubble:not(.is-expanded) .srnec-chatbot__bubble-send {
    display: none !important;
}

@keyframes srnec-chatbot-uv-pulse {
    0%,
    100% {
        box-shadow: var(--srnec-chatbot-uv-glow);
    }

    50% {
        box-shadow: var(--srnec-chatbot-uv-glow-strong);
    }
}

@keyframes srnec-chatbot-uv-halo {
    0%,
    100% {
        opacity: 0.62;
        transform: scale(0.94);
    }

    50% {
        opacity: 0.92;
        transform: scale(1.08);
    }
}

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

.srnec-chatbot__bubble.is-expanded {
    left: var(--srnec-chatbot-inset-x);
    right: var(--srnec-chatbot-inset-x);
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 44px;
    padding: 5px 11px;
    border-radius: 999px;
    justify-content: flex-start;
    animation: none;
    box-shadow:
        0 0 8px rgba(255, 255, 255, 0.35),
        0 0 18px rgba(205, 245, 100, 0.25);
}

.srnec-chatbot__bubble.is-expanded::after {
    content: none;
}

.srnec-chatbot__bubble.is-expanded .srnec-chatbot__bubble-compact {
    display: none;
}

.srnec-chatbot__bubble.is-expanded .srnec-chatbot__bubble-input {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.srnec-chatbot__bubble.is-expanded .srnec-chatbot__bubble-send {
    display: flex;
}

.srnec-chatbot__bubble.is-thinking:not(.is-expanded) {
    animation: srnec-chatbot-uv-pulse 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.srnec-chatbot__bubble.is-thinking.is-expanded {
    animation: neonPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes neonPulse {
    0%, 100% {
        box-shadow: 
            0 0 8px rgba(255, 255, 255, 0.8),
            0 0 16px rgba(255, 255, 255, 0.6),
            0 0 24px rgba(255, 255, 255, 0.4),
            0 0 32px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 16px rgba(255, 255, 255, 0.95),
            0 0 32px rgba(255, 255, 255, 0.85),
            0 0 48px rgba(255, 255, 255, 0.7),
            0 0 64px rgba(255, 255, 255, 0.5);
    }
}

.srnec-chatbot__bubble.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.srnec-chatbot__bubble:not(.is-hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


.srnec-chatbot__bubble-send {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #FFFFFF;
    color: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.srnec-chatbot__bubble-send:hover:not(:disabled) {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.8);
}

.srnec-chatbot__bubble-send:active:not(:disabled) {
    transform: scale(0.95);
}

.srnec-chatbot__bubble-send:disabled {
    opacity: 0.45;
    cursor: default;
}

.srnec-chatbot__bubble:focus-visible,
.srnec-chatbot__bubble-send:focus-visible,
.srnec-chatbot__close:focus-visible {
    outline: 2px solid #CDF564;
    outline-offset: 3px;
}

.srnec-chatbot__bubble-send svg {
    width: 13px;
    height: 13px;
    stroke: #000;
    fill: none;
}

.srnec-chatbot__bubble-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 0 8px;
    font-size: var(--srnec-meta-fs);
    line-height: 1.4;
    color: #FFFFFF;
    cursor: pointer;
    font-family: "TT2020StyleE", "Georgia", "Times New Roman", serif;
    text-shadow: none;
    box-shadow: none;
    transition: margin-left 0.3s ease, padding-left 0.3s ease;
    margin-left: 0;
}

.srnec-chatbot__window.is-open ~ .srnec-chatbot__bubble .srnec-chatbot__bubble-input {
    margin-left: 0;
    padding-left: 0;
}

.srnec-chatbot__bubble-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

.srnec-chatbot__bubble-input:focus {
    cursor: text;
}

/* Chat window */
.srnec-chatbot__window {
    position: fixed;
    width: 300px;
    max-width: calc(100vw - 40px);
    height: 52px;
    max-height: calc(var(--srnec-chatbot-visible-height, 100vh) - var(--srnec-chatbot-window-open-bottom) - 24px);
    will-change: opacity, transform;
    display: none;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    opacity: 0;
    left: auto;
    right: var(--srnec-chatbot-inset-x);
    bottom: var(--srnec-chatbot-bottom);
    top: auto;
    transform: translateY(80px) scale(0.95);
    background-color: rgba(30, 30, 30, .65);
    color: #FFFFFF;
    --tw-backdrop-blur: blur(20px);
    backdrop-filter: var(--tw-backdrop-blur);
    -webkit-backdrop-filter: var(--tw-backdrop-blur);
    border-radius: 999px;
    border: 0.5px solid #808080;
    font-family: "TT2020StyleE", "Georgia", "Times New Roman", serif;
    /* Smooth single-property transitions */
    transition: 
        opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.srnec-chatbot__window.is-open {
    display: flex;
    opacity: 1;
    width: var(--srnec-chatbot-desktop-width);
    height: min(520px, 62vh);
    bottom: var(--srnec-chatbot-window-open-bottom);
    border-radius: 32px;
    transform: translateY(0) scale(1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}


/* Close button (in panel header when open) */
.srnec-chatbot__close {
    position: relative;
    flex-shrink: 0;
    background: #FFFFFF;
    border: none;
    color: #000000;
    font-size: var(--srnec-fs-xl);
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    opacity: 1;
    z-index: 1;
    font-family: "TT2020StyleE", "Georgia", "Times New Roman", serif;
    font-weight: 400;
}

.srnec-chatbot__close:hover {
    background: #000000;
    color: #FFFFFF;
    box-shadow: 0px 0px 20px 12px rgba(255, 255, 255, 0.4);
    border-radius: 999px;
}

.srnec-chatbot__close:active {
    transform: none;
}

.srnec-chatbot__window.is-open .srnec-chatbot__close {
    display: flex;
}

/* Messages area */
.srnec-chatbot__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: rgba(30, 30, 30, .65);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
    font-family: "TT2020StyleE", "Georgia", "Times New Roman", serif;
    border-radius: 20px;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
}

.srnec-chatbot__window.is-open .srnec-chatbot__messages {
    text-shadow: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.srnec-chatbot__message {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeInMessage 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.srnec-chatbot__message.is-restored {
    opacity: 1;
    transform: none;
    animation: none;
}

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

.srnec-chatbot__message--user {
    flex-direction: row-reverse;
}

.srnec-chatbot__message-content {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: var(--srnec-fs-sm);
    font-family: "TT2020StyleE", "Georgia", "Times New Roman", serif;
}

/* Bot messages - no background, white text */
.srnec-chatbot__message--bot .srnec-chatbot__message-content {
    background: transparent !important;
    color: #FFFFFF !important;
    border: none;
}

/* User messages - black bg with 0.5 opacity, white text */
.srnec-chatbot__message--user .srnec-chatbot__message-content {
    background: rgba(0, 0, 0, 0.5) !important;
    color: #ffffff !important;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 85%;
}

.srnec-chatbot__message--error .srnec-chatbot__message-content {
    color: rgba(255, 255, 255, 0.72) !important;
    border-left: 2px solid rgba(223, 80, 208, 0.7);
    border-radius: 0;
    padding: 4px 0 4px 12px;
    margin: 8px 16px;
}

.srnec-chatbot__message-content p {
    margin: 0 0 8px;
}

/* TT2020StyleE ships no bold and synthesis is off, so emphasis is carried by colour. */
.srnec-chatbot__message-content strong {
    font-weight: 400;
    color: #CDF564;
}

.srnec-chatbot__message-content p:last-child,
.srnec-chatbot__message-content ul:last-child,
.srnec-chatbot__message-content ol:last-child {
    margin-bottom: 0;
}

.srnec-chatbot__message-content ul,
.srnec-chatbot__message-content ol {
    margin: 0 0 8px;
    padding-left: 1.25em;
}

.srnec-chatbot__message-content li {
    margin: 0 0 4px;
}

.srnec-chatbot__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Links in messages */
.srnec-chatbot__message-content .srnec-chatbot__link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
}

.srnec-chatbot__message--bot .srnec-chatbot__message-content .srnec-chatbot__link {
    color: #FFFFFF;
    text-decoration-color: rgba(255, 255, 255, 0.6);
}

.srnec-chatbot__message--bot .srnec-chatbot__message-content .srnec-chatbot__link:hover {
    opacity: 0.7;
}

.srnec-chatbot__message--user .srnec-chatbot__message-content .srnec-chatbot__link {
    color: #ffffff;
    text-decoration-color: rgba(255, 255, 255, 0.6);
}

.srnec-chatbot__message--user .srnec-chatbot__message-content .srnec-chatbot__link:hover {
    opacity: 0.9;
}

/* Typing indicator */
.srnec-chatbot__typing {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: 75px;
}

.srnec-chatbot__typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FFFFFF;
    opacity: 0.9;
    animation: typing 1.4s infinite;
    box-shadow: 
        0 0 4px rgba(255, 255, 255, 0.8),
        0 0 8px rgba(255, 255, 255, 0.6),
        0 0 12px rgba(255, 255, 255, 0.4);
}

.srnec-chatbot__typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.srnec-chatbot__typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input area - removed, using bubble input only */

/* Chat header (open window) */
.srnec-chatbot__header {
    display: none;
    flex-shrink: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.srnec-chatbot__window.is-open .srnec-chatbot__header {
    display: flex;
}

.srnec-chatbot__clear {
    align-self: center;
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 8px 4px;
    color: rgba(255, 255, 255, 0.65);
    font-family: inherit;
    font-size: var(--srnec-meta-fs);
    text-transform: uppercase;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.srnec-chatbot__clear:hover {
    color: #FFFFFF;
    text-decoration-color: #CDF564;
}

.srnec-chatbot__clear:focus-visible {
    outline: 2px solid #CDF564;
    outline-offset: 2px;
}

.srnec-chatbot__clear[hidden] {
    display: none;
}

.srnec-chatbot__header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.srnec-chatbot__header-name {
    font-size: var(--srnec-fs-sm);
    font-weight: 400;
    color: #FFFFFF;
}

.srnec-chatbot__header-label {
    font-size: var(--srnec-meta-fs);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

/* Bubble identity badge */
.srnec-chatbot__bubble-badge {
    display: none;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
    padding-right: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    margin-right: 4px;
    max-width: 88px;
}

.srnec-chatbot__bubble-name {
    font-size: var(--srnec-meta-fs);
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.srnec-chatbot__bubble-label {
    font-size: var(--srnec-meta-fs);
    text-transform: uppercase;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Welcome message */
.srnec-chatbot__welcome {
    text-align: center;
    padding: 24px 16px;
    color: #FFFFFF;
    text-shadow: none;
}

.srnec-chatbot__welcome-label {
    margin: 0 0 8px;
    font-size: var(--srnec-meta-fs);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.srnec-chatbot__welcome h4 {
    margin: 0 0 8px;
    color: #FFFFFF;
    font-family: var(--srnec-font-heading);
    font-size: var(--srnec-fs-md, 1.125rem);
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-shadow: none;
}

.srnec-chatbot__welcome p {
    margin: 0;
    font-size: var(--srnec-fs-sm);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: none;
}

.srnec-chatbot__window.is-open .srnec-chatbot__messages {
    padding-top: 8px;
}

/* Responsive — compact bottom-right on mobile (thumb reach) */
@media (max-width: 768px) {
    .srnec-chatbot {
        --srnec-chatbot-inset-x: 18px;
    }

    .srnec-chatbot__bubble:not(.is-expanded)::after {
        inset: -10px;
    }

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

    .srnec-chatbot__window {
        left: var(--srnec-chatbot-inset-x);
        right: var(--srnec-chatbot-inset-x);
        width: var(--srnec-chatbot-mobile-width);
        height: 48px;
        bottom: var(--srnec-chatbot-bottom);
        transform: translateY(80px) scale(0.95);
    }

    .srnec-chatbot__window.is-open {
        left: var(--srnec-chatbot-inset-x) !important;
        right: auto !important;
        width: var(--srnec-chatbot-mobile-width) !important;
        max-width: var(--srnec-chatbot-mobile-width) !important;
        height: min(420px, 56vh);
        bottom: var(--srnec-chatbot-window-open-bottom);
        transform: translateY(0) scale(1);
        border-radius: 20px;
        box-sizing: border-box;
    }

    .srnec-chatbot__window.is-open ~ .srnec-chatbot__bubble.is-expanded {
        left: var(--srnec-chatbot-inset-x) !important;
        right: auto !important;
        width: var(--srnec-chatbot-mobile-width) !important;
        max-width: var(--srnec-chatbot-mobile-width) !important;
        box-sizing: border-box;
    }

    .srnec-chatbot__bubble {
        bottom: var(--srnec-chatbot-bottom);
        opacity: 0;
        transform: translateY(80px);
        animation: none;
    }

    body.home .srnec-chatbot__bubble.is-scrolled:not(.is-expanded),
    .srnec-chatbot__bubble.is-scrolled:not(.is-expanded) {
        animation:
            slideUpFromBottomMobile 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards,
            srnec-chatbot-uv-pulse 2.8s ease-in-out 0.8s infinite;
    }

    body.home .srnec-chatbot__bubble:not(.is-scrolled):not(.is-expanded) {
        transform: translateY(80px);
    }

    .srnec-chatbot__bubble.is-scrolled.is-expanded {
        animation: slideUpFromBottomMobile 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .srnec-chatbot__bubble.is-expanded {
        left: var(--srnec-chatbot-inset-x) !important;
        right: auto !important;
        width: var(--srnec-chatbot-mobile-width) !important;
        max-width: var(--srnec-chatbot-mobile-width) !important;
        min-height: 44px;
        padding: 4px 11px;
        box-sizing: border-box;
    }

    .srnec-chatbot__bubble-send {
        width: 32px;
        height: 32px;
    }

    .srnec-chatbot__bubble-send svg {
        width: 14px;
        height: 14px;
    }

    .srnec-chatbot__bubble-input {
        font-size: var(--srnec-meta-fs);
        padding: 0 6px;
    }

    .srnec-chatbot__welcome {
        padding: 16px 12px;
    }

    .srnec-chatbot__welcome h4 {
        font-size: var(--srnec-fs-md);
    }

    .srnec-chatbot__message-content {
        font-size: var(--srnec-fs-sm);
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .srnec-chatbot {
        --srnec-chatbot-inset-x: 12px;
    }

    .srnec-chatbot__window.is-open {
        height: min(380px, 52vh);
        bottom: var(--srnec-chatbot-window-open-bottom);
    }

    .srnec-chatbot__bubble {
        bottom: var(--srnec-chatbot-bottom);
    }

    .srnec-chatbot__bubble-label {
        display: none;
    }

    .srnec-chatbot__bubble-badge {
        max-width: none;
        border-right: none;
        padding-right: 0;
        margin-right: 2px;
    }
}

@media (min-width: 769px) {
    .srnec-chatbot__bubble:not(.is-expanded) {
        top: auto;
        left: auto;
        right: 5%;
        bottom: 5%;
    }

    .srnec-chatbot__bubble.is-expanded {
        top: auto;
        left: auto;
        right: var(--srnec-chatbot-inset-x);
        width: var(--srnec-chatbot-desktop-width);
        max-width: calc(100vw - 40px);
    }
}

/* iOS zooms the page when a focused input is under 16px. */
@media (pointer: coarse) {
    .srnec-chatbot__bubble-input {
        font-size: max(16px, var(--srnec-meta-fs));
    }
}

@media (prefers-reduced-motion: reduce) {
    .srnec-chatbot__bubble:not(.is-expanded),
    .srnec-chatbot__bubble:not(.is-expanded)::after {
        animation: none;
    }

    .srnec-chatbot__window,
    .srnec-chatbot__bubble {
        transition: none;
    }
    .srnec-chatbot__message {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .srnec-chatbot__typing-dot {
        animation-duration: 2.8s;
    }

    .srnec-chatbot__bubble:not(.is-expanded)::after {
        opacity: 0.72;
        transform: none;
    }
}

/* Scrollbar styling */
.srnec-chatbot__messages::-webkit-scrollbar {
    width: 6px;
}

.srnec-chatbot__messages::-webkit-scrollbar-track {
    background: transparent;
}

.srnec-chatbot__messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.srnec-chatbot__messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}
