#chatbot-toggle {
    position: fixed;
    right: 28px;
    bottom: 24px;
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 10px 16px 10px 11px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 18px;
    background: linear-gradient(145deg, #202b3d, #111827);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32), 0 3px 10px rgba(0, 0, 0, 0.2);
    color: #f8fafc;
    font: inherit;
    cursor: pointer;
    text-align: left;
    opacity: 0;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#chatbot-toggle:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 193, 7, 0.45);
    background: linear-gradient(145deg, #26354b, #151e2d);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38), 0 0 0 4px rgba(255, 193, 7, 0.08);
}

.chatbot-toggle-icon {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 1px solid rgba(255, 193, 7, 0.25);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 193, 7, 0.2), rgba(255, 193, 7, 0.08));
    color: #ffd35a;
    font-size: 19px;
    transition: transform 180ms ease, background 180ms ease;
}

#chatbot-toggle:hover .chatbot-toggle-icon {
    transform: scale(1.05);
    background: linear-gradient(145deg, rgba(255, 193, 7, 0.28), rgba(255, 193, 7, 0.12));
}

.chatbot-toggle-indicator {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 11px;
    height: 11px;
    border: 2px solid #182131;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
    animation: chatbot-status-pulse 2.4s ease-out infinite;
}

.chatbot-toggle-copy {
    display: grid;
    gap: 3px;
}

.chatbot-toggle-title {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.chatbot-toggle-subtitle {
    color: #aab4c3;
    font-size: 11px;
    line-height: 1.2;
}

.chatbot-toggle-arrow {
    margin-left: 5px;
    color: #ffc107;
    font-size: 12px;
    transition: transform 180ms ease;
}

#chatbot-toggle:hover .chatbot-toggle-arrow {
    transform: translate(2px, -2px);
}

#chatbot-toggle:focus-visible,
#chatbot-window button:focus-visible,
#chatbot-window a:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

#chatbot-window {
    position: fixed;
    right: 28px;
    bottom: 88px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    width: min(390px, calc(100vw - 32px));
    max-height: min(660px, calc(100dvh - 112px));
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 22px;
    background: #101827;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    color: #e5e7eb;
    font-family: inherit;
}

#chatbot-window[hidden],
#chatbot-topics[hidden],
#chatbot-questions[hidden] {
    display: none;
}

.chatbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(120deg, #172338, #111827);
}

.chatbot-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 193, 7, 0.14);
    color: #ffc107;
    font-size: 18px;
}

.chatbot-heading {
    min-width: 0;
    flex: 1;
}

.chatbot-heading h2 {
    margin: 0 0 4px;
    color: #f9fafb;
    font-size: 16px;
    font-weight: 700;
}

.chatbot-heading p {
    margin: 0;
    color: #9ca3af;
    font-size: 12px;
}

.chatbot-status {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: #34d399;
}

.chatbot-close,
.chatbot-back {
    border: 0;
    background: transparent;
    color: #aab4c3;
    cursor: pointer;
}

.chatbot-close {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    font-size: 16px;
}

.chatbot-close:hover,
.chatbot-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.chatbot-body {
    min-height: 0;
    padding: 18px;
    overflow-y: auto;
    scrollbar-color: #42506a transparent;
    scrollbar-width: thin;
}

.chatbot-intro {
    margin: 0 0 16px;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.55;
}

.chatbot-question-choices {
    display: grid;
    gap: 9px;
}

.chatbot-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chatbot-topic,
.chatbot-choice {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.72);
    color: #e5e7eb;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.chatbot-topic:hover,
.chatbot-choice:hover,
.chatbot-choice[aria-pressed="true"] {
    transform: translateY(-1px);
    border-color: rgba(255, 193, 7, 0.65);
    background: rgba(255, 193, 7, 0.09);
}

.chatbot-topic > i:first-child {
    width: 18px;
    color: #ffc107;
    text-align: center;
}

.chatbot-topic {
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
}

.chatbot-topic-arrow {
    display: none;
}

.chatbot-back {
    margin: -5px 0 13px;
    padding: 7px 9px;
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
}

.chatbot-back i {
    margin-right: 5px;
}

.chatbot-question-panel h3 {
    margin: 0 0 12px;
    color: #f9fafb;
    font-size: 16px;
    font-weight: 700;
}

.chatbot-choice {
    justify-content: space-between;
}

.chatbot-choice::after {
    color: #ffc107;
    content: "\f054";
    font-family: "Font Awesome 5 Free";
    font-size: 10px;
    font-weight: 900;
}

.chatbot-answer:not(:empty) {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.chatbot-selected-question {
    justify-self: end;
    max-width: 88%;
    margin: 0;
    padding: 9px 13px;
    border-radius: 14px 14px 3px 14px;
    background: #ffc107;
    color: #172033;
    font-size: 12px;
    font-weight: 700;
}

.chatbot-response {
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 3px 14px 14px 14px;
    background: #1b2637;
}

.chatbot-response-text {
    margin: 0;
    color: #d7deea;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-line;
}

.chatbot-response-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.chatbot-response-links a {
    padding: 6px 9px;
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 999px;
    color: #ffd34e;
    font-size: 11px;
    text-decoration: none;
}

.chatbot-response-links a:hover {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
    color: #ffe28a;
}

.chatbot-footer {
    padding: 11px 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    color: #8793a6;
    font-size: 11px;
    text-align: center;
}

.chatbot-footer i {
    margin-right: 4px;
    color: #ffc107;
}

@media (max-width: 520px) {
    #chatbot-toggle {
        right: 16px;
        bottom: 16px;
        min-height: 60px;
        padding: 8px 13px 8px 9px;
        border-radius: 16px;
    }

    .chatbot-toggle-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    #chatbot-window {
        right: 16px;
        bottom: 76px;
        width: calc(100vw - 32px);
        max-height: calc(100dvh - 96px);
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chatbot-topic,
    .chatbot-choice {
        transition: none;
        animation: none;
    }

    .chatbot-toggle-indicator {
        animation: none;
    }
}

@keyframes chatbot-status-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45);
    }
    70%, 100% {
        box-shadow: 0 0 0 6px rgba(52, 211, 153, 0);
    }
}
