.rector-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999999;
    background: rgba(0, 28, 70, 0.82);
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: rectorFadeIn .2s ease;
}

.rector-overlay[style*="display:none"],
.rector-overlay[style*="display: none"] {
    display: none !important;
}

@keyframes rectorFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ── Modal ── */
.rector-chat {
    width: 100%;
    max-width: 400px;
    background: #f0f2f7;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    animation: rectorSlide .25s ease;
}

@keyframes rectorSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.rector-chat__header {
    background: var(--azulFuerte);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rector-chat__avatar {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--azul), var(--azulFuerte));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    color: var(--blanco);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.rector-chat__status {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--primario);
    border: 2px solid var(--azulFuerte);
}

.rector-chat__info {
    flex: 1;
}

.rector-chat__name {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--blanco) !important;
    letter-spacing: -.01em !important;
}

.rector-chat__sub {
    margin: 2px 0 0 !important;
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

.rector-chat__close {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.5) !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    line-height: 1 !important;
    transition: background .15s !important;
}

.rector-chat__close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* ── Body ── */
.rector-chat__body {
    padding: 18px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Mensajes ── */
.rector-msg {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.rector-msg--left {
    justify-content: flex-start;
    max-width: 88%;
}

.rector-msg--indent {
    padding-left: 40px;
}

.rector-msg__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--azul), var(--azulFuerte));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--blanco);
    flex-shrink: 0;
}

.rector-msg__time {
    display: block;
    margin: 5px 0 0 4px;
    font-size: 10px;
    color: #aab;
}

.rector-bubble {
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.rector-bubble p {
    margin: 0 !important;
}

.rector-bubble--left {
    background: var(--blanco);
    border-radius: 16px 16px 16px 4px;
    padding: 11px 14px;
}

.rector-bubble--left p {
    font-size: 14px !important;
    color: #223 !important;
    line-height: 1.55 !important;
}

.rector-bubble--mid {
    border-radius: 16px !important;
}

.rector-bubble--step {
    width: 100%;
    box-sizing: border-box;
}

/* Pasos*/
.rector-step-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.rector-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--blanco);
    flex-shrink: 0;
}

.rector-step-num--verde {
    background: var(--primario);
}

.rector-step-num--azul {
    background: var(--azul);
}

.rector-step-title {
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--azulFuerte) !important;
}

.rector-step-desc {
    margin: 0 !important;
    font-size: 11.5px !important;
    color: #778 !important;
    padding-left: 30px;
}

.rector-step-desc strong {
    color: var(--azulFuerte) !important;
}

.rector-chat__footer {
    padding: 10px 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #e2e5ed;
}

.rector-input {
    flex: 1;
    background: var(--blanco);
    border: 1.5px solid #e2e5ed;
    border-radius: 24px;
    padding: 11px 18px;
    font-size: 14px;
    color: #334;
    display: flex;
    align-items: center;
    min-width: 0;
    cursor: default;
}

.rector-input__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rector-input__cursor {
    display: inline-block;
    width: 2px;
    height: 13px;
    background: #334;
    vertical-align: middle;
    margin-left: 1px;
    border-radius: 1px;
    animation: rectorCursor .9s ease infinite;
    flex-shrink: 0;
}

@keyframes rectorCursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.rector-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primario);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none !important;
    box-shadow: 0 2px 10px rgba(0, 167, 136, 0.4);
    transition: background .15s;
}

.rector-send:hover {
    background: #008a6f !important;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.m0 {
    animation: msgIn .35s ease .1s both;
}

.m1 {
    animation: msgIn .35s ease .5s both;
}

.m2 {
    animation: msgIn .35s ease .85s both;
}

.m3 {
    animation: msgIn .35s ease 1.2s both;
}

.m4 {
    animation: msgIn .35s ease 1.6s both;
}

@media (max-width: 480px) {
    .rector-chat {
        border-radius: 16px;
    }

    .rector-chat__body {
        padding: 14px 12px 10px;
    }

    .rector-chat__footer {
        padding: 8px 12px 14px;
    }
}