.o24chat {
    --o24-main: #0A1A3E;
    --o24-main-soft: #1E3A6E;
    --o24-accent: #EC9013;
    --o24-accent-dark: #D27E0A;
    --o24-text: #0A1A3E;
    --o24-muted: #5B7280;
    --o24-line: #D7E3EA;
    --o24-bg: #F1F5FA;
    --o24-launcher-right: 24px;
    --o24-launcher-bottom: 112px;
    --o24-launcher-size: 72px;
    font-family: "Be Vietnam Pro", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--o24-text);
}

.o24chat *,
.o24chat *::before,
.o24chat *::after {
    box-sizing: border-box;
}

.o24chat [hidden] {
    display: none !important;
}

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

.o24chatLauncher {
    position: fixed;
    right: var(--o24-launcher-right);
    bottom: var(--o24-launcher-bottom);
    z-index: 95;
    width: var(--o24-launcher-size);
    height: var(--o24-launcher-size);
    padding: 0;
    border: 3px solid var(--o24-accent);
    border-radius: 50%;
    background: var(--o24-main);
    overflow: visible;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(10, 26, 62, 0.3);
    transition: transform .2s ease;
}

.o24chatLauncher img {
    border-radius: 50%;
}

.o24chatLauncher::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    animation: o24chatRing 2.4s ease-out infinite;
    pointer-events: none;
}

.o24chatLauncher::after {
    content: "";
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 14px;
    height: 14px;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    background: #22C55E;
}

.o24chatLauncher:hover {
    transform: scale(1.06);
}

.o24chat.is-open .o24chatLauncher::before {
    animation: none;
}

@keyframes o24chatRing {
    0% { box-shadow: 0 0 0 0 rgba(236, 144, 19, 0.5); }
    100% { box-shadow: 0 0 0 16px rgba(236, 144, 19, 0); }
}

.o24chatTeaser {
    position: fixed;
    right: calc(var(--o24-launcher-right) + var(--o24-launcher-size) + 14px);
    bottom: calc(var(--o24-launcher-bottom) + var(--o24-launcher-size) / 2);
    z-index: 95;
    display: flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    max-width: calc(100vw - var(--o24-launcher-right) - var(--o24-launcher-size) - 30px);
    padding: 12px 20px;
    white-space: nowrap;
    border: 1px solid var(--o24-line);
    border-radius: 26px;
    background: #FFFFFF;
    box-shadow: 0 8px 26px rgba(10, 26, 62, 0.16);
    transform: translateY(50%);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .8s ease, visibility 0s linear .8s;
    animation: o24chatBob 2.6s ease-in-out infinite;
}

.o24chatTeaser.is-show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .8s ease, visibility 0s;
}

.o24chatTeaser::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -6px;
    width: 12px;
    height: 12px;
    border-top: 1px solid var(--o24-line);
    border-right: 1px solid var(--o24-line);
    background: #FFFFFF;
    transform: translateY(-50%) rotate(45deg);
}

.o24chatTeaser:hover {
    animation-play-state: paused;
}

.o24chatTeaser p {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
}

@keyframes o24chatBob {
    0%, 100% { transform: translateY(50%); }
    50% { transform: translateY(calc(50% - 7px)); }
}

.o24chatPanel {
    position: fixed;
    right: var(--o24-launcher-right);
    bottom: calc(var(--o24-launcher-bottom) + var(--o24-launcher-size) + 14px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: 400px;
    height: min(560px, calc(100vh - var(--o24-launcher-bottom) - var(--o24-launcher-size) - 40px));
    border-radius: 22px;
    background: #FFFFFF;
    box-shadow: 0 16px 44px rgba(20, 40, 70, 0.22);
    overflow: hidden;
    transform-origin: bottom right;
    animation: o24chatIn .25s ease;
}

@keyframes o24chatIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to { opacity: 1; transform: none; }
}

.o24chatHead {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 14px 16px 20px;
    border-bottom: 3px solid var(--o24-accent);
    background: var(--o24-main);
    color: #FFFFFF;
}

.o24chatTitle {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.o24chatClose {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #FFFFFF;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.o24chatClose:hover {
    background: rgba(255, 255, 255, .15);
    opacity: 1;
}

.o24chatBody {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 16px;
    background: var(--o24-bg);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.o24chatRow {
    display: flex;
    gap: 10px;
}

.o24chatRow--user {
    flex-direction: row-reverse;
}

.o24chatRow--user .o24chatStack {
    align-items: flex-end;
}

.o24chatAvatar.o24chatAvatar--user {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-color: #FFFFFF;
    background: var(--o24-main);
    color: #FFFFFF;
}

.o24chatAvatar--user svg {
    width: 36px;
    height: 36px;
    margin-bottom: -5px;
}

.o24chatAvatar {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 2px solid var(--o24-accent);
    border-radius: 50%;
    background: var(--o24-main);
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(10, 26, 62, 0.15);
}

.o24chatStack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    max-width: calc(100% - 54px);
}

.o24chatSender {
    margin: 2px 0 -2px;
    color: #4A5563;
    font-size: 14px;
    font-weight: 600;
}

.o24chatBubble {
    max-width: 100%;
    padding: 10px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.o24chatRow--bot .o24chatBubble {
    border: 1px solid var(--o24-line);
    border-top-left-radius: 6px;
    background: #FFFFFF;
    color: var(--o24-text);
    box-shadow: 0 2px 6px rgba(10, 26, 62, 0.05);
}

.o24chatRow--bot .o24chatBubble a {
    color: #176C86;
}

.o24chatRow--user .o24chatBubble {
    max-width: 100%;
    border-top-right-radius: 6px;
    background: var(--o24-accent);
    color: var(--o24-main);
}

.o24chatBubble p,
.o24chatBubble ul,
.o24chatBubble ol {
    margin: 0 0 6px;
}

.o24chatBubble > :last-child {
    margin-bottom: 0;
}

.o24chatBubble ul,
.o24chatBubble ol {
    padding-left: 18px;
}

.o24chatBubble ul {
    list-style: disc;
}

.o24chatBubble ol {
    list-style: decimal;
}

.o24chatBubble a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.o24chatRow--bot .o24chatBubble strong {
    color: #A45E00;
}

.o24chatRow--bot .o24chatBubble.is-error {
    background: #FFFFFF;
    border: 1px solid #F3C9C9;
    color: var(--o24-text);
}

.o24chatRow--bot .o24chatBubble.is-error strong {
    color: inherit;
}

.o24chatDots {
    display: inline-flex;
    gap: 4px;
    padding: 5px 0;
}

.o24chatDots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--o24-muted);
    animation: o24chatDot 1.2s infinite ease-in-out;
}

.o24chatDots i:nth-child(2) { animation-delay: .15s; }
.o24chatDots i:nth-child(3) { animation-delay: .3s; }

@keyframes o24chatDot {
    0%, 80%, 100% { opacity: .35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.o24chatForm {
    padding: 12px 14px 14px;
    background: #FFFFFF;
}

.o24chatField {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 6px 6px 6px 18px;
    border: 1px solid var(--o24-line);
    border-radius: 28px;
    background: #F5F6F7;
}

.o24chatField:focus-within {
    border-color: var(--o24-accent);
    background: #FFFFFF;
}

.o24chatInput {
    flex: 1;
    min-height: 40px;
    max-height: 110px;
    padding: 9px 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 15px;
    color: inherit;
    resize: none;
    outline: none;
}

.o24chatInput::placeholder {
    color: #8A939E;
}

.o24chatSend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--o24-accent);
    color: var(--o24-main);
    cursor: pointer;
}

.o24chatSend:hover {
    background: var(--o24-accent-dark);
}

.o24chatSend:disabled {
    opacity: .5;
    cursor: default;
}

@media (max-width: 768px) {
    .o24chat {
        --o24-launcher-right: 16px;
        --o24-launcher-bottom: 88px;
        --o24-launcher-size: 60px;
    }

    .o24chatTeaser {
        white-space: normal;
    }

    .o24chatTeaser p {
        font-size: 14px;
    }

    .o24chatPanel {
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        border-radius: 0;
    }

    .o24chatInput {
        font-size: 16px;
    }

    .o24chat.is-open .o24chatLauncher,
    .o24chat.is-open .o24chatTeaser {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .o24chatPanel,
    .o24chatTeaser,
    .o24chatLauncher::before,
    .o24chatDots i {
        animation: none;
    }
}
