#chatbot-panel,
#chatbot-panel input,
#chatbot-panel button,
#chatbot-panel .bubble,
#chatbot-btn,
.chatbot-teaser {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- CHAT BUTTON ---------- */

#chatbot-btn {
    position: fixed;
    right: 18px;
    bottom: 88px;
    width: 80px;
    height: 80px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 9999;

    background: radial-gradient(circle at 30% 25%,
            #ECF6FA 0%,
            #97C6F0 38%,
            #4F81DC 72%,
            #2243B8 100%);

    box-shadow:
        0 12px 30px rgba(0, 0, 0, .18),
        inset 0 4px 10px rgba(255, 255, 255, .8),
        inset 0 -8px 18px rgba(0, 0, 0, .08);

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        filter .15s ease;
}

#chatbot-btn::before {
    content: "";
    position: absolute;
    top: 10%;
    left: 18%;
    width: 50%;
    height: 40%;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(255, 255, 255, .9) 0%,
            rgba(255, 255, 255, .35) 60%,
            transparent 70%);
    pointer-events: none;
    opacity: .6;
}

#chatbot-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 18px 38px rgba(0, 0, 0, .22),
        inset 0 4px 10px rgba(255, 255, 255, .9),
        inset 0 -10px 22px rgba(0, 0, 0, .1);
}

#chatbot-btn:active {
    transform: translateY(0);
}

#chatbot-btn:focus-visible {
    outline: 3px solid rgba(80, 80, 80, .35);
    outline-offset: 3px;
}

/* ---------- ROBOT ---------- */

.chatbot-robot3d {
    display: block;
    transform: translateY(1px);
    transition: transform .25s ease;
    animation: robot-float 2.9s ease-in-out infinite;
}

#chatbot-btn:not(.open) .chatbot-robot3d {
    animation:
        robot-float 2.9s ease-in-out infinite,
        robot-wiggle 12s ease-in-out infinite,
        robot-breathe 4.6s ease-in-out infinite;
}

#chatbot-btn.open .chatbot-robot3d {
    transform: rotate(-6deg) translateX(-2px);
    animation: robot-float 2.9s ease-in-out infinite;
}

#chatbot-btn.pop {
    animation: toy-pop .28s ease;
}

#chatbot-btn.hello {
    animation: robot-hello 1.2s ease-in-out 1;
}

#chatbot-btn.nod .chatbot-robot3d {
    animation: robot-nod .34s ease;
}

#chatbot-btn.error .chatbot-robot3d {
    animation: robot-tilt .35s ease 1;
}

.chatbot-robot3d svg {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .15));
}

.chatbot-robot3d path[stroke] {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- EYES / BROWS / MOUTH ---------- */

.eye-group {
    transition: transform .25s ease;
    transform-origin: center;
}

#chatbot-btn.open .eye-group {
    transform: translateX(-2px);
}

#chatbot-btn:not(.open) .eye-group {
    transform: translateX(0);
}

#chatbot-btn.thinking .eye-group {
    animation: robot-thinking-look 1s ease-in-out infinite;
}

.chatbot-robot3d .eye-group circle:first-child {
    transform-origin: center;
    animation: robot-blink 4.8s infinite;
}

.chatbot-robot3d .eyes {
    transform-origin: center;
    transition: transform .08s ease;
}

.chatbot-robot3d.blink .eyes {
    transform: scaleY(0.05);
}

.pupil {
    transition: transform .12s ease;
}

#chatbot-btn .brow,
#chatbot-btn .mouth {
    transition: transform .18s ease, opacity .18s ease, stroke .18s ease;
    transform-origin: center;
}

#chatbot-btn.open .mouth {
    transform: scaleX(1.06) translateY(-.2px);
}

#chatbot-btn.thinking .brow {
    transform: translateY(-1.2px);
}

#chatbot-btn.thinking .mouth {
    transform: scaleX(.9) translateY(.4px);
    opacity: .75;
}

#chatbot-btn.error .left-brow {
    transform: translateY(-2px) rotate(-6deg);
}

#chatbot-btn.error .right-brow {
    transform: translateY(1px) rotate(6deg);
}

#chatbot-btn.error .mouth {
    transform: rotate(-4deg) translateY(.6px);
    opacity: .75;
}

/* ---------- ANTENNA / THINKING ---------- */

.chatbot-robot3d .antenna-tip {
    fill: #cfd8dc;
    transition: fill .25s ease, filter .25s ease;
}

#chatbot-btn.thinking .antenna-tip {
    fill: #3b82f6;
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, .8));
    animation: antenna-pulse 1.2s infinite ease-in-out;
}

#chatbot-btn.answer .antenna-tip {
    fill: #22c55e;
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, .8));
}

#chatbot-btn.thinking .pupil {
    filter: drop-shadow(0 0 6px rgba(40, 209, 124, .35));
}

#chatbot-btn.thinking .chatbot-robot3d svg {
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18));
}

/* ---------- BADGE ---------- */

.chatbot-badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cfcfcf;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, .8),
        0 2px 6px rgba(0, 0, 0, .25);
    transition: background .25s ease, box-shadow .25s ease, transform .2s ease;
}

#chatbot-btn.open .chatbot-badge {
    background: #28d17c;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, .9),
        0 0 10px rgba(40, 209, 124, .6),
        0 2px 8px rgba(0, 0, 0, .25);
    transform: scale(1.1);
}

#chatbot-btn.thinking .chatbot-badge {
    background: #28d17c;
    animation: badge-pulse 1.6s ease-out infinite;
}

/* ---------- PANEL ---------- */

#chatbot-panel {
    position: fixed;
    right: 18px;
    bottom: 92px;
    width: 360px;
    max-width: calc(100vw - 36px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-size: 16px;
    line-height: 1.45;
}

#chatbot-panel.open {
    display: flex;
}

#chatbot-panel .bubble a {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-word;
}

#chatbot-panel .bubble a:hover {
    text-decoration: none;
}

#chatbot-panel .bubble strong {
    font-weight: 600;
}

#chatbot-panel .bubble .msg-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
}

.msg.bot .bubble .msg-title {
    color: #111827;
    border-bottom-color: #e5e7eb;
}

#chatbot-panel .bubble p {
    margin: 0;
}

#chatbot-panel .bubble .msg-gap {
    height: 8px;
}

/* custom bullets */
#chatbot-panel .bubble ul {
    margin: 6px 0 6px 0;
    padding: 0;
    list-style: none;
}

#chatbot-panel .bubble li {
    position: relative;
    margin: 6px 0;
    padding-left: 18px;
}

#chatbot-panel .bubble li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    transform: translateY(-50%);
}

/* normal inline links */
#chatbot-panel .bubble a.msg-link,
#chatbot-panel .bubble a.msg-email {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-word;
}

#chatbot-panel .bubble a.msg-link:hover,
#chatbot-panel .bubble a.msg-email:hover {
    text-decoration: none;
}

/* button-like standalone links */
#chatbot-panel .bubble .msg-link-row {
    margin: 4px 0;
}

#chatbot-panel .bubble .msg-link-button,
#chatbot-panel .bubble .msg-email-button {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s ease, transform .15s ease;
}

#chatbot-panel .bubble .msg-link-button {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

#chatbot-panel .bubble .msg-email-button {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #d1d5db;
}

#chatbot-panel .bubble .msg-link-button:hover,
#chatbot-panel .bubble .msg-email-button:hover {
    transform: translateY(-1px);
}

/* bold */
#chatbot-panel .bubble strong {
    font-weight: 600;
}

.chatbot-header {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fafafa;
}

.chatbot-header strong {
    font-size: 18px;
}

.chatbot-header .muted {
    font-size: 13px;
    color: #666;
}

.chatbot-close {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.chatbot-body {
    flex: 1;
    padding: 12px;
    overflow: auto;
    background: #fff;
}

.msg {
    margin: 8px 0;
    display: flex;
}

.msg .bubble {
    padding: 10px 11px;
    border-radius: 12px;
    max-width: 85%;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 15px;
    line-height: 1.5;
}

.msg.user {
    justify-content: flex-end;
}

.msg.user .bubble {
    background: #111;
    color: #fff;
    border-top-right-radius: 4px;
}

.msg.user .bubble .msg-title {
    color: #fff;
}

.msg.bot {
    justify-content: flex-start;
}

.msg.bot .bubble {
    background: #f3f3f3;
    color: #111;
    border-top-left-radius: 4px;
}

.msg.user .bubble .msg-title {
    color: #fff;
}

.chatbot-note {
    padding: 8px 12px;
    font-size: 12px;
    color: #666;
}

/* ---------- FOOTER ---------- */

.chatbot-footer {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    background: #fafafa;
}

.chatbot-footer input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
}

.chatbot-footer button {
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    background: #111;
    color: #fff;
    font-size: 16px;
}

.chatbot-footer button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ---------- TEASER ---------- */

.chatbot-teaser {
    position: fixed;
    right: 42px;
    bottom: 180px;
    max-width: 240px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 10px 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
    font-size: 14px;
    line-height: 1.35;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9998;
}

.chatbot-teaser.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chatbot-teaser::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: -8px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transform: rotate(45deg);
}

/* ---------- SUGGESTION CHIPS ---------- */

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px 12px;
}

.chat-suggestion {
    border: 1px solid #d0d7e2;
    background: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
}

.chat-suggestion:hover {
    background: #f5f7fb;
}

/* ---------- ACCESSIBILITY ---------- */

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- MOBILE ---------- */

@media (max-width: 640px) {
    .chatbot-teaser {
        right: 72px;
        bottom: 84px;
        max-width: 200px;
        font-size: 13px;
    }
}

/* ---------- KEYFRAMES ---------- */

@keyframes robot-float {

    0%,
    100% {
        transform: translateY(1px);
    }

    50% {
        transform: translateY(-2px);
    }
}

@keyframes robot-wiggle {

    0%,
    92%,
    100% {
        transform: translateY(1px) rotate(0deg);
    }

    94% {
        transform: translateY(-1px) rotate(-4deg);
    }

    96% {
        transform: translateY(-1px) rotate(4deg);
    }

    98% {
        transform: translateY(1px) rotate(0deg);
    }
}

@keyframes robot-breathe {

    0%,
    100% {
        filter: none;
        transform: translateY(1px) scale(1);
    }

    50% {
        filter: brightness(1.02);
        transform: translateY(0px) scale(1.015);
    }
}

@keyframes robot-blink {

    0%,
    92%,
    100% {
        transform: scaleY(1);
    }

    94%,
    96% {
        transform: scaleY(0.15);
    }
}

@keyframes toy-pop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.12);
    }

    70% {
        transform: scale(.96);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes robot-hello {
    0% {
        transform: translateY(0) scale(1);
    }

    15% {
        transform: translateY(-2px) scale(1.05);
    }

    35% {
        transform: translateY(0) scale(1);
    }

    55% {
        transform: translateY(-1px) scale(1.02);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes robot-thinking-look {
    0% {
        transform: translateX(-1px);
    }

    50% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(-1px);
    }
}

@keyframes robot-tilt {
    0% {
        transform: translateY(1px) rotate(0deg);
    }

    45% {
        transform: translateY(0px) rotate(-6deg);
    }

    100% {
        transform: translateY(1px) rotate(0deg);
    }
}

@keyframes robot-nod {
    0% {
        transform: translateY(1px) rotate(0deg);
    }

    35% {
        transform: translateY(2px) rotate(7deg);
    }

    70% {
        transform: translateY(0px) rotate(-3deg);
    }

    100% {
        transform: translateY(1px) rotate(0deg);
    }
}

@keyframes antenna-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes badge-pulse {
    0% {
        transform: scale(1);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, .9),
            0 0 0 0 rgba(40, 209, 124, .6),
            0 2px 8px rgba(0, 0, 0, .25);
    }

    70% {
        transform: scale(1.12);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, .9),
            0 0 0 10px rgba(40, 209, 124, 0),
            0 2px 8px rgba(0, 0, 0, .25);
    }

    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, .9),
            0 0 0 0 rgba(40, 209, 124, 0),
            0 2px 8px rgba(0, 0, 0, .25);
    }
}