:root {
    --academy-assistant-accent: #ef4056;
    --academy-assistant-accent-dark: #c9203c;
    --academy-assistant-text: #171717;
    --academy-assistant-muted: #666b73;
    --academy-assistant-border: #ececef;
}

.robotAvatar {
    --robot-width: 103px;
    position: relative;
    width: var(--robot-width);
    aspect-ratio: 520 / 723;
    pointer-events: none;
    user-select: none;
}

.robotAvatar--small {
    --robot-width: 58px;
}

.robotAvatar--medium {
    --robot-width: 98px;
}

.robotAvatar__frame {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.academyChatbot {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1050;
    color: var(--academy-assistant-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.academyChatbot__closed {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.academyChatbot__greeting {
    margin-bottom: 28px;
    padding: 10px 14px;
    border: 1px solid rgba(239, 64, 86, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 38px rgba(15, 15, 20, 0.12);
    color: #262730;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
}

.academyChatbot__greeting span,
.academyChatbot__greeting strong {
    display: block;
}

.academyChatbot__greeting strong {
    color: var(--academy-assistant-accent);
}

.academyChatbot__chatButton {
    position: absolute;
    right: 0;
    bottom: -5px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--academy-assistant-accent), var(--academy-assistant-accent-dark));
    color: #fff;
    box-shadow: 0 12px 30px rgba(239, 64, 86, 0.32);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.academyChatbot__chatButton span {
    display: block;
    letter-spacing: 1px;
    transform: translateY(-1px);
}

.academyChatbot__panel {
    width: min(380px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid rgba(20, 20, 20, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 70px rgba(15, 15, 20, 0.18);
}

.academyChatbot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--academy-assistant-border);
}

.academyChatbot__titleBlock {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.academyChatbot__header h2 {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
}

.academyChatbot__header p {
    margin: 2px 0 0;
    color: var(--academy-assistant-muted);
    font-size: 12px;
}

.academyChatbot__header button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--academy-assistant-border);
    border-radius: 50%;
    background: white;
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.academyChatbot__messages {
    display: flex;
    min-height: 210px;
    max-height: min(48vh, 360px);
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 14px;
    background: #fbfbfc;
    scrollbar-width: thin;
    scrollbar-color: #b8b8b8 transparent;
}

/* Scoped to the chatbot messages list only — overrides the site-wide
   colorful scrollbar (styles.css) with a simple neutral one, without
   touching the global rule itself. */
.academyChatbot__messages::-webkit-scrollbar {
    width: 6px;
    background-color: transparent;
}

.academyChatbot__messages::-webkit-scrollbar-track {
    background-color: transparent;
}

.academyChatbot__messages::-webkit-scrollbar-track:hover {
    background-color: transparent;
}

.academyChatbot__messages::-webkit-scrollbar-thumb {
    background-color: #b8b8b8;
    border: none;
    border-radius: 10px;
}

.academyChatbot__messages::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.academyChatbot__message {
    max-width: 86%;
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-line;
}

.academyChatbot__message--bot {
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    background: white;
    box-shadow: 0 4px 16px rgba(20, 20, 20, 0.06);
}

.academyChatbot__message--user {
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    background: #ffe8ec;
    color: #681526;
}

.academyChatbot__cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: flex-start;
    width: 92%;
}

.academyChatbot__card {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--academy-assistant-border);
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 16px rgba(20, 20, 20, 0.05);
    text-decoration: none;
    color: inherit;
}

.academyChatbot__card:hover {
    border-color: rgba(239, 64, 86, 0.35);
}

.academyChatbot__cardTitle {
    margin: 0 0 4px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--academy-assistant-text);
}

.academyChatbot__cardMeta {
    margin: 0;
    font-size: 12px;
    color: var(--academy-assistant-muted);
    line-height: 1.4;
}

.academyChatbot__typing {
    align-self: flex-start;
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border-bottom-left-radius: 5px;
    background: white;
    box-shadow: 0 4px 16px rgba(20, 20, 20, 0.06);
}

.academyChatbot__typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--academy-assistant-muted);
    opacity: 0.5;
    animation: academyChatbotTyping 1s infinite ease-in-out;
}

.academyChatbot__typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.academyChatbot__typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes academyChatbotTyping {

    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.academyChatbot__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
    background: #fbfbfc;
}

.academyChatbot__suggestions:empty {
    display: none;
}

.academyChatbot__suggestion {
    border: 1px solid rgba(239, 64, 86, 0.28);
    border-radius: 999px;
    background: white;
    color: var(--academy-assistant-accent-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
}

.academyChatbot__suggestion:hover {
    background: rgba(239, 64, 86, 0.08);
}

.academyChatbot__form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--academy-assistant-border);
    background: white;
}

.academyChatbot__form input {
    min-width: 0;
    height: 42px;
    border: 1px solid #dedee2;
    border-radius: 999px;
    padding: 0 14px;
    outline: none;
    font: inherit;
}

.academyChatbot__form input:focus {
    border-color: var(--academy-assistant-accent);
    box-shadow: 0 0 0 3px rgba(239, 64, 86, 0.12);
}

.academyChatbot__form button {
    min-width: 74px;
    height: 42px;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(135deg, var(--academy-assistant-accent), var(--academy-assistant-accent-dark));
    color: #fff;
    font-weight: 800;
    font: inherit;
    box-shadow: 0 12px 30px rgba(239, 64, 86, 0.28);
    cursor: pointer;
}

@media (max-width: 640px) {
    .robotAvatar--medium {
        --robot-width: 86px;
    }

    .academyChatbot {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }

    .academyChatbot__closed {
        justify-content: flex-end;
    }

    .academyChatbot__greeting {
        display: none;
    }

    .academyChatbot__panel {
        width: 100%;
        border-radius: 16px;
    }

    .academyChatbot__messages {
        max-height: 48vh;
    }
}
