.college-ai-chat {
    position: fixed;
    right: 18px;
    bottom: 78px;
    width: 260px;
    height: 198px;
    z-index: 99999;
    font-family: Arial, sans-serif;
    pointer-events: none;
}

.college-ai-chat__launcher {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 260px;
    height: 198px;
    pointer-events: none;
    transform-origin: right bottom;
    animation: collegeAiMascotEnter 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.college-ai-chat__fox {
    position: absolute;
    right: 28px;
    bottom: 42px;
    z-index: 1;
    width: 176px;
    max-width: none;
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 14px 18px rgba(31, 47, 79, 0.2));
    transform-origin: 62% 100%;
    animation: collegeAiMascotFloat 4s ease-in-out 1.2s infinite;
}

.college-ai-chat__button {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 2;
    border: 0;
    background: linear-gradient(135deg, #2162bd 0%, #1e87a8 100%);
    color: #ffffff;
    min-width: 188px;
    min-height: 58px;
    padding: 9px 18px 9px 14px;
    border-radius: 12px 12px 12px 24px;
    box-shadow: 0 16px 34px rgba(22, 58, 112, 0.28);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-align: left;
    transform: rotate(-2deg);
    transform-origin: right center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    pointer-events: auto;
    overflow: hidden;
}

.college-ai-chat__button::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.28);
    pointer-events: none;
}

.college-ai-chat__button::after {
    content: "";
    position: absolute;
    left: -28px;
    top: 50%;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.16) 38%, rgba(255, 255, 255, 0) 70%);
    opacity: 0.62;
    transform: translateY(-50%) scale(0.88);
    animation: collegeAiButtonGlow 3.8s ease-in-out 1.1s infinite;
    pointer-events: none;
}

.college-ai-chat__button:hover {
    box-shadow: 0 18px 40px rgba(22, 58, 112, 0.35);
    filter: saturate(1.05);
    transform: rotate(-1deg) translateY(-2px);
}

.college-ai-chat__button:focus-visible {
    outline: 3px solid rgba(30, 135, 168, 0.26);
    outline-offset: 4px;
}

.college-ai-chat__button-icon {
    position: relative;
    z-index: 1;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: #2162bd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: inset 0 -2px 0 rgba(33, 98, 189, 0.12);
    animation: collegeAiIconPulse 3.8s ease-in-out 1.1s infinite;
}

.college-ai-chat__button-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 12px;
    line-height: 1.08;
    text-transform: uppercase;
}

.college-ai-chat__button-text strong {
    font-size: 15px;
    line-height: 1.05;
}

.college-ai-chat__window {
    position: absolute;
    right: 0;
    bottom: 190px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
    display: none;
    flex-direction: column;
    border: 1px solid rgba(47, 99, 199, 0.18);
    pointer-events: auto;
}

.college-ai-chat--open .college-ai-chat__window {
    display: flex;
}

.college-ai-chat__header {
    background: #2f63c7;
    color: #ffffff;
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.college-ai-chat__title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.college-ai-chat__subtitle {
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.35;
}

.college-ai-chat__close {
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    opacity: 0.85;
}

.college-ai-chat__close:hover {
    opacity: 1;
}

.college-ai-chat__messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: #f4f7fb;
}

.college-ai-chat__message {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.college-ai-chat__message--bot {
    background: #ffffff;
    color: #333333;
    border: 1px solid #e1e7f0;
    margin-right: auto;
}

.college-ai-chat__message--user {
    background: #2f63c7;
    color: #ffffff;
    margin-left: auto;
}

.college-ai-chat__message--error {
    background: #fff1f1;
    color: #a30000;
    border: 1px solid #ffd0d0;
}

.college-ai-chat__message--loading {
    color: #6b7280;
    font-style: italic;
}

.college-ai-chat__quick {
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid #e1e7f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.college-ai-chat__quick button {
    border: 1px solid #d6dfea;
    background: #ffffff;
    color: #2f63c7;
    border-radius: 4px;
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s ease;
}

.college-ai-chat__quick button:hover {
    background: #eef4ff;
    border-color: #2f63c7;
}

.college-ai-chat__form {
    padding: 14px;
    background: #ffffff;
    border-top: 1px solid #e1e7f0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.college-ai-chat__input {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 110px;
    border: 1px solid #d6dfea;
    border-radius: 4px;
    padding: 11px 12px;
    font-size: 14px;
    line-height: 1.35;
    outline: none;
}

.college-ai-chat__input:focus {
    border-color: #2f63c7;
    box-shadow: 0 0 0 2px rgba(47, 99, 199, 0.12);
}

.college-ai-chat__send {
    border: 0;
    background: #2f63c7;
    color: #ffffff;
    height: 42px;
    padding: 0 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s ease;
}

.college-ai-chat__send:hover {
    background: #244fa5;
}

.college-ai-chat__send:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .college-ai-chat {
        right: 8px;
        bottom: 70px;
        width: 226px;
        height: 174px;
    }

    .college-ai-chat__launcher {
        width: 226px;
        height: 174px;
    }

    .college-ai-chat__fox {
        right: 18px;
        bottom: 40px;
        width: 148px;
    }

    .college-ai-chat__window {
        right: -2px;
        bottom: 168px;
        width: calc(100vw - 24px);
        height: 68vh;
        max-height: 680px;
    }

    .college-ai-chat__button {
        min-width: 164px;
        min-height: 54px;
        padding: 8px 14px 8px 12px;
        gap: 9px;
    }

    .college-ai-chat__button-icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .college-ai-chat__button-text {
        font-size: 11px;
    }

    .college-ai-chat__button-text strong {
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .college-ai-chat {
        right: 4px;
        transform: scale(0.92);
        transform-origin: right bottom;
    }

    .college-ai-chat__window {
        right: 4px;
        width: calc(100vw - 16px);
    }
}

.college-ai-chat__quick button:disabled,
.college-ai-chat__send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.college-ai-chat__input:disabled {
    background: #f3f5f8;
    cursor: not-allowed;
}

.college-ai-chat--loading .college-ai-chat__quick button {
    pointer-events: none;
}

@keyframes collegeAiMascotEnter {
    0% {
        opacity: 0;
        transform: translate(96px, 76px) rotate(8deg) scale(0.78);
    }

    64% {
        opacity: 1;
        transform: translate(-6px, -6px) rotate(-2deg) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translate(0, 0) rotate(0) scale(1);
    }
}

@keyframes collegeAiMascotFloat {
    0%,
    100% {
        transform: translateY(0) rotate(-1deg);
    }

    50% {
        transform: translateY(-6px) rotate(1deg);
    }
}

@keyframes collegeAiButtonGlow {
    0%,
    100% {
        opacity: 0.42;
        transform: translateY(-50%) scale(0.86);
    }

    50% {
        opacity: 0.76;
        transform: translate(4px, -50%) scale(1.08);
    }
}

@keyframes collegeAiIconPulse {
    0%,
    100% {
        box-shadow: inset 0 -2px 0 rgba(33, 98, 189, 0.12), 0 0 0 0 rgba(255, 255, 255, 0);
    }

    50% {
        box-shadow: inset 0 -2px 0 rgba(33, 98, 189, 0.12), 0 0 0 7px rgba(255, 255, 255, 0.16);
    }
}

@media (prefers-reduced-motion: reduce) {
    .college-ai-chat__launcher,
    .college-ai-chat__fox,
    .college-ai-chat__button::after,
    .college-ai-chat__button-icon {
        animation: none;
    }

    .college-ai-chat__button,
    .college-ai-chat__button:hover {
        transition: none;
        transform: rotate(-2deg);
    }
}

/* Компактный HTML внутри ответа ИИ */
.college-ai-chat__message--bot {
    line-height: 1.22;
}

.college-ai-chat__message--bot p {
    margin: 0 0 5px;
    line-height: 1.22;
}

.college-ai-chat__message--bot p:last-child {
    margin-bottom: 0;
}

.college-ai-chat__message--bot ul,
.college-ai-chat__message--bot ol {
    margin: 5px 0 6px 16px;
    padding: 0;
}

.college-ai-chat__message--bot li {
    margin: 0 0 3px;
    line-height: 1.22;
}

.college-ai-chat__message--bot h1,
.college-ai-chat__message--bot h2,
.college-ai-chat__message--bot h3,
.college-ai-chat__message--bot h4,
.college-ai-chat__message--bot h5,
.college-ai-chat__message--bot h6 {
    margin: 0 0 6px;
    line-height: 1.22;
    font-size: 15px;
    font-weight: 700;
    color: #244fa5;
}

.college-ai-chat__message--bot br {
    line-height: 1.1;
}
.college-ai-chat__launcher {
    pointer-events: auto;
}

.college-ai-chat__fox {
    cursor: pointer;
    pointer-events: auto !important;
    z-index: 3;
}

.college-ai-chat__button {
    z-index: 4;
}

.college-ai-chat__fox:focus {

}
