/* ==========================================================================
   MINDBOOK EDUCATION — PERFIL DE ESTUDIANTE UNIFICADO APP-FIRST ("Campus Pocket")
   Aplica EXCLUSIVAMENTE a la primera vista (`#view-library`):
   - Estudiante (`userRole === 'employee'`): vertical (celulares y tablets en
     vertical) Y horizontal (tablets horizontales, laptops y escritorio).
   - Acudiente (`userRole === 'guardian'`): vista vertical (celulares/tablets).
   - Los celulares permanecen bloqueados en vertical por `pwa.js`.
   - Cero impacto en Admin, subvistas ni modales internos.
   - Respeta personalización de colegio (`--brand-color-1/2`, `data-mb-surface`,
     `data-mb-radius`, `data-mb-density`, `.mb-cust-hidden-el`).
   - Preserva el 100% de botones, badges y funcionalidad existente.
   ========================================================================== */

/* Ocultos por defecto en desktop, horizontal y otros roles */
.stu-portrait-only,
#stu-mobile-drawer {
    display: none !important;
}

/* ==========================================================================
   ESTILOS BASE DEL MENÚ HAMBURGUESA DEL ESTUDIANTE (`#stu-mobile-drawer`)
   ========================================================================== */
#stu-mobile-drawer.stu-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    justify-content: flex-end;
    align-items: stretch;
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif);
}

#stu-mobile-drawer .stu-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 19, 42, 0.54);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    touch-action: none;
}

#stu-mobile-drawer .stu-drawer-panel {
    position: relative;
    z-index: 2;
    width: min(84vw, 360px);
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    min-height: 0;
    background: #FCFBF7;
    border-left: 1px solid rgba(18, 19, 42, 0.08);
    box-shadow: -20px 0 56px rgba(18, 19, 42, 0.24);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: stuDrawerIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stuDrawerIn {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: translateX(0); }
}

.stu-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(15px + env(safe-area-inset-top, 0px)) 16px 13px;
    border-bottom: 1px solid rgba(18, 19, 42, 0.07);
    background: #F5F1E5;
    flex-shrink: 0;
}

.stu-drawer-user {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex: 1;
    background: transparent;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.stu-drawer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(var(--brand-color-1, 79, 70, 229), 0.35);
    background: #ffffff;
    flex-shrink: 0;
}

.stu-drawer-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stu-drawer-user-name {
    font-size: 0.96rem;
    font-weight: 800;
    color: #12132A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.stu-drawer-user-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: #5C607B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.stu-drawer-close {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(18, 19, 42, 0.14);
    background: #ffffff;
    color: #12132A;
    font-size: 0.98rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s ease, transform 0.18s ease;
}

.stu-drawer-close:hover {
    background: #F4F1EA;
    transform: scale(1.04);
}

/* Contenedor con scroll vertical real y estable (min-height: 0 + flex-shrink: 0 en hijos) */
.stu-drawer-body {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 14px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Grupos desplegables (acordeón limpio que nunca se aplasta al hacer scroll) */
.stu-menu-group {
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid rgba(18, 19, 42, 0.08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(18, 19, 42, 0.03);
}

.stu-menu-group.hidden {
    display: none !important;
}

.stu-menu-group-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4A4D68;
    text-align: left;
}

.stu-menu-group-chevron {
    width: 16px;
    height: 16px;
    color: #5C607B;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.stu-menu-group.is-collapsed .stu-menu-group-chevron {
    transform: rotate(-90deg);
}

.stu-menu-group.is-collapsed .stu-menu-group-list {
    display: none;
}

.stu-menu-group-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 8px 10px;
}

.stu-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    min-height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: #12132A;
    transition: background 0.16s ease, transform 0.16s ease;
}

.stu-menu-item:hover,
.stu-menu-item:active {
    background: #F6F4EE;
}

.stu-menu-item.hidden {
    display: none !important;
}

.stu-menu-item.is-urgent-alert {
    background: #FEF2F2;
    border-color: rgba(220, 38, 38, 0.28);
}

.stu-menu-item.is-urgent-alert .stu-menu-item-title {
    color: #991B1B;
}

.stu-menu-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #EEF2FF;
    color: #4338CA;
}

.stu-menu-item-icon--dark { background: #141436; color: #FFFFFF; }
.stu-menu-item-icon--sky { background: #E0F2FE; color: #0369A1; }
.stu-menu-item-icon--lav { background: #EDE9FE; color: #6D28D9; }
.stu-menu-item-icon--mint { background: #ECFDF5; color: #047857; }
.stu-menu-item-icon--gold { background: #FEF3C7; color: #92400E; }
.stu-menu-item-icon--rose { background: #FCE7F3; color: #BE185D; }
.stu-menu-item-icon--slate { background: #F1F5F9; color: #334155; }

.stu-menu-item-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.stu-menu-item-title {
    font-size: 0.87rem;
    font-weight: 700;
    color: #12132A;
    line-height: 1.25;
}

.stu-menu-item-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: #5C607B;
    line-height: 1.25;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stu-menu-pill-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #DC2626;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stu-menu-pill-badge.hidden {
    display: none !important;
}

.stu-drawer-foot {
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(18, 19, 42, 0.08);
    background: #FCFBF7;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.stu-drawer-install-btn {
    width: 100%;
    min-height: 44px;
    padding: 9px 14px;
    border-radius: 14px;
    border: 1.5px solid rgba(79, 70, 229, 0.28);
    background: #EEF2FF;
    color: #3730A3;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.stu-drawer-install-btn.hidden {
    display: none !important;
}

.stu-drawer-logout-btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1.5px solid rgba(220, 38, 38, 0.22);
    background: #FEF2F2;
    color: #B91C1C;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.stu-drawer-logout-btn:hover {
    background: #FEE2E2;
}

/* Anillos de foco accesibles en todos los controles interactivos del estudiante */
#stu-menu-btn:focus-visible,
#stu-mobile-drawer button:focus-visible,
.stu-week-strip:focus-visible,
.stu-section-more:focus-visible,
#stu-dock-home:focus-visible,
#stu-dock-child-switch:focus-visible,
#stu-dock-menu:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #btn-library:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #btn-logout:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #nav-avatar:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #profile-img:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active .edit-badge:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #btn-company-drawer:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #btn-student-ranking:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #btn-guardian-switcher:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #btn-codigo-dorado:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active .confidencialidad-badge:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active .bday-hero-card:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active .action-card-premium:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #floating-future-btn:focus-visible,
body.mb-student-portrait-home.mb-student-ui-active #floating-inbox-btn:focus-visible {
    outline: 2.5px solid #4F46E5;
    outline-offset: 2px;
}

/* Botón hamburguesa superior */
.stu-top-menu-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(18, 19, 42, 0.12);
    background: #FFFFFF;
    color: #12132A;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(18, 19, 42, 0.06);
    transition: transform 0.18s ease, background 0.18s ease;
}

.stu-top-menu-btn:active {
    transform: scale(0.95);
}

.stu-notif-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #DC2626;
    border: 2px solid #FFFFFF;
    pointer-events: none;
}

.stu-notif-dot.hidden {
    display: none !important;
}

/* Tira semanal interactiva compacta (inspiración Referencias #1 y #2) */
.stu-week-strip {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid rgba(18, 19, 42, 0.07);
    border-radius: 20px;
    padding: 10px 12px 11px;
    margin-bottom: 11px;
    box-shadow: 0 8px 22px rgba(18, 19, 42, 0.045);
    cursor: pointer;
    text-align: left;
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stu-week-strip:active {
    transform: scale(0.99);
}

.stu-week-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.stu-week-month {
    font-size: 0.76rem;
    font-weight: 800;
    color: #12132A;
    text-transform: capitalize;
}

.stu-week-cta {
    font-size: 0.73rem;
    font-weight: 700;
    color: rgb(var(--brand-1-ink, 79, 70, 229));
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.stu-week-days {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.stu-day-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 13px;
    background: #F8F6F0;
    color: #4A4D68;
    border: 1px solid transparent;
}

.stu-day-name {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.88;
}

.stu-day-num {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.1;
    color: #12132A;
}

.stu-day-pill.is-today {
    background: linear-gradient(155deg, #141436 0%, #262968 100%);
    color: #FFFFFF;
    box-shadow: 0 8px 18px rgba(20, 20, 54, 0.26);
    transform: translateY(-1px);
}

.stu-day-pill.is-today .stu-day-name {
    color: #C7D2FE;
    opacity: 1;
}

.stu-day-pill.is-today .stu-day-num {
    color: #FFFFFF;
}

.stu-day-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #FF6B4A;
    margin-top: 1px;
}

/* Cabecera de sección "Tus Espacios / Ver todo ›" */
.stu-section-head {
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 2px 0 8px;
    padding: 0 2px;
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif);
}

.stu-section-title {
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #12132A;
    margin: 0;
}

.stu-section-more {
    background: transparent;
    border: none;
    min-height: 36px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgb(var(--brand-1-ink, 79, 70, 229));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ==========================================================================
   BLOQUE ACTIVO UNIFICADO — ESTUDIANTE (VERTICAL + HORIZONTAL) Y ACUDIENTE
   (VERTICAL), controlado por `body.mb-student-portrait-home.mb-student-ui-active`
   sincronizado por student-mobile.js. Cero impacto en Admin y subvistas.
   ========================================================================== */
body.mb-student-portrait-home.mb-student-ui-active {
    color: #12132A;
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif);
}

html:not([data-mb-surface]) body.mb-student-portrait-home.mb-student-ui-active {
    background-color: #F8F4E8 !important;
}

/* Ocultar capa legacy .edu-background (z-index:-1 con blobs blur) que tapaba el canvas y consumía GPU móvil */
body.mb-student-portrait-home.mb-student-ui-active .edu-background {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #stu-mobile-drawer.is-open {
    display: flex !important;
}

body.mb-student-portrait-home.mb-student-ui-active .stu-portrait-only {
    display: flex !important;
}

body.mb-student-portrait-home.mb-student-ui-active .stu-portrait-only.hidden {
    display: none !important;
}

/* Protección estricta de controles solo-estudiante en modo Acudiente (Modo Lectura) */
body.mb-guardian-portrait-mode #view-library .confidencialidad-badge,
body.mb-guardian-portrait-mode #view-library .edit-badge,
body.mb-guardian-portrait-mode #floating-future-btn,
body.mb-guardian-portrait-mode #floating-anon-inbox-btn {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #stu-week-strip.stu-portrait-only {
    display: block !important;
}

/* Ocultar el FAB flotante morado de PWA para que nunca tape las tarjetas (vive en el menú hamburguesa) */
body.mb-student-portrait-home.mb-student-ui-active #pwa-install-btn {
    display: none !important;
}

/* 2) Top App Bar compacta y limpia */
body.mb-student-portrait-home.mb-student-ui-active header#main-site-header {
    height: calc(58px + env(safe-area-inset-top, 0px)) !important;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(248, 244, 232, 0.90) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(18, 19, 42, 0.07) !important;
    box-shadow: 0 4px 18px rgba(18, 19, 42, 0.04);
}

body.mb-student-portrait-home.mb-student-ui-active header#main-site-header nav {
    padding: 0 12px !important;
    gap: 8px;
}

/* Neutralizar la regla legacy "MindBk" en <= 380px */
body.mb-student-portrait-home.mb-student-ui-active header#main-site-header .logo {
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif);
    font-size: 1.12rem !important;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #12132A;
    flex-shrink: 0;
    white-space: nowrap;
}

body.mb-student-portrait-home.mb-student-ui-active header#main-site-header .logo > span:first-of-type {
    display: inline !important;
    color: #4F46E5;
    font-weight: 800;
}

body.mb-student-portrait-home.mb-student-ui-active header#main-site-header .logo .edu-tag {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active header#main-site-header .logo::after {
    content: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #nav-user .user-info-nav {
    gap: 6px !important;
    align-items: center;
}

body.mb-student-portrait-home.mb-student-ui-active #nav-avatar.avatar-sm {
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
    border: 2px solid rgba(var(--brand-color-1, 79, 70, 229), 0.3) !important;
}

body.mb-student-portrait-home.mb-student-ui-active #btn-library.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px !important;
    font-size: 0.72rem !important;
    font-weight: 700;
    border-radius: 999px;
    background: #FFFFFF;
    color: #12132A;
    border: 1px solid rgba(18, 19, 42, 0.1);
    min-height: 36px;
    white-space: nowrap;
    flex-shrink: 0;
}

body.mb-student-portrait-home.mb-student-ui-active #btn-logout.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px !important;
    font-size: 0.72rem !important;
    font-weight: 700;
    border-radius: 999px;
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid rgba(220, 38, 38, 0.18);
    min-height: 36px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 3) Contenedor Principal `#view-library` (sin doble relleno inferior antes del footer) */
body.mb-student-portrait-home.mb-student-ui-active main#app-root {
    padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    padding-left: max(14px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(14px, env(safe-area-inset-right, 0px)) !important;
    padding-bottom: 24px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library.container {
    width: 100% !important;
    max-width: 560px !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

/* 4) Banner IA Diario (`#daily-insight-card`) estilo pastel Ref #2 (selectores reales + AA) */
body.mb-student-portrait-home.mb-student-ui-active #view-library #daily-insight-anchor #daily-insight-card.premium-insight-card {
    background: linear-gradient(135deg, #E6F4FE 0%, #EFF6FF 55%, #EDE9FE 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.92) !important;
    border-radius: 20px !important;
    padding: 11px 46px 11px 13px !important;
    margin-bottom: 10px !important;
    gap: 11px !important;
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.08) !important;
    color: #12132A !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #daily-insight-anchor .insight-icon-box {
    width: 34px !important;
    height: 34px !important;
    border-radius: 11px !important;
    font-size: 1.05rem !important;
    flex-shrink: 0 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #daily-insight-anchor .insight-content-box {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #daily-insight-anchor .insight-content-box h4 {
    color: #3730A3 !important;
    font-weight: 800 !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.06em !important;
    margin: 0 0 2px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #daily-insight-anchor .insight-text-full,
body.mb-student-portrait-home.mb-student-ui-active #view-library #daily-insight-anchor p {
    color: #1E293B !important;
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif) !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    line-height: 1.42 !important;
    margin: 0 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #daily-insight-anchor .insight-close-btn {
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(79, 70, 229, 0.10) !important;
    color: #3730A3 !important;
    border-color: rgba(79, 70, 229, 0.2) !important;
    font-weight: 800 !important;
}

/* 5) Cabecera de Bienvenida del Estudiante (`.profile-header`) compacta */
body.mb-student-portrait-home.mb-student-ui-active #view-library > .profile-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 9px !important;
    background: #FFFFFF !important;
    border: 1px solid rgba(18, 19, 42, 0.07) !important;
    border-radius: 24px !important;
    padding: 13px 13px !important;
    margin-bottom: 10px !important;
    box-shadow: 0 12px 30px rgba(18, 19, 42, 0.055) !important;
    text-align: left !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-info-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 0 !important;
    width: 100%;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .user-main-data-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 11px !important;
    width: 100%;
    min-width: 0;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .avatar-upload {
    width: 54px !important;
    height: 54px !important;
    border-radius: 18px !important;
    flex-shrink: 0 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .avatar-loader-overlay {
    border-radius: 18px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #profile-img {
    width: 54px !important;
    height: 54px !important;
    border-radius: 18px !important;
    border: 2px solid rgba(var(--brand-color-1, 79, 70, 229), 0.26) !important;
    box-shadow: 0 6px 14px rgba(18, 19, 42, 0.1);
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .edit-badge {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.72rem !important;
    right: -4px !important;
    bottom: -4px !important;
    background: #141436 !important;
    color: #FFFFFF !important;
    border: 2px solid #FFFFFF !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .user-meta {
    min-width: 0;
    flex: 1;
    text-align: left !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .user-meta h5 {
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif);
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #5C607B !important;
    margin: 0 !important;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .user-meta h2#display-name {
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif);
    font-size: 1.18rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    color: #12132A !important;
    line-height: 1.15 !important;
    margin: 1px 0 1px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .user-meta span#display-email {
    display: block;
    font-size: 0.72rem !important;
    color: #5C607B !important;
    margin-top: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #display-badges-container {
    margin-top: 5px !important;
    gap: 5px !important;
    flex-wrap: wrap !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #display-badges-container > span {
    margin: 0 !important;
    font-size: 0.67rem !important;
    padding: 3px 9px !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    color: #334155 !important;
}

/* Chip de curso oscurecido a #0369A1 para garantizar AA >= 5.38:1 sobre #e0f2fe */
body.mb-student-portrait-home.mb-student-ui-active #view-library #display-badges-container > span:nth-child(2) {
    color: #0369A1 !important;
}

/* Tarjeta Cumpleaños / Oráculo Social integrada como píldora compacta horizontal */
body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status:not(.mb-cust-hidden-el):not(:empty) {
    width: 100%;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-hero-card,
body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-hero-card:hover {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 9px !important;
    padding: 7px 12px !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    text-align: left !important;
    animation: none !important;
    transform: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-hero-card:not(.is-birthday-today) {
    background: linear-gradient(135deg, #FFF7ED 0%, #FDF2F8 100%) !important;
    border: 1px solid rgba(236, 72, 153, 0.16) !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-hero-card.is-birthday-today {
    background: linear-gradient(135deg, #4338CA 0%, #6D28D9 100%) !important;
    border: none !important;
    color: #FFFFFF !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-hero-card > * {
    margin: 0 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-number-giant,
body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-oracle-icon,
body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-emoji-celebration {
    font-size: 1.25rem !important;
    line-height: 1 !important;
    letter-spacing: -0.02em !important;
    padding-right: 0 !important;
    flex-shrink: 0;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-label-premium {
    flex: 1;
    min-width: 0;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: #1E293B !important;
    text-align: left !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-hero-card.is-birthday-today .bday-label-premium {
    color: #FFFFFF !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-label-premium br {
    display: none;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-hero-card > div {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library #user-birthday-status .bday-hero-card.is-birthday-today > div {
    color: rgba(255, 255, 255, 0.94) !important;
}

/* 6) Acciones de Cabecera: Mi Colegio (arriba) + Código Dorado & Buzón Anónimo (2 píldoras compactas) */
body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
    padding-top: 8px;
    border-top: 1px solid rgba(18, 19, 42, 0.06);
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill:not(.hidden) {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 44px !important;
    padding: 5px 10px 5px 7px !important;
    border-radius: 15px !important;
    background: rgba(var(--brand-color-1, 79, 70, 229), 0.07) !important;
    border: 1px solid rgba(var(--brand-color-1, 79, 70, 229), 0.16) !important;
    box-shadow: none !important;
    justify-content: flex-start !important;
}

/* Cuando el botón de Ranking está activo, comparte la fila superior junto a Identidad Institucional (con :where para que media queries de apilamiento siempre ganen) */
body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container:where(:has(#btn-student-ranking:not(.hidden))) #btn-company-drawer.school-brand-pill:not(.hidden) {
    grid-column: span 1 !important;
    gap: 7px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container:where(:has(#btn-student-ranking:not(.hidden))) #btn-company-drawer .school-pill-crest {
    width: 30px !important;
    height: 30px !important;
    border-radius: 9px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container:where(:has(#btn-student-ranking:not(.hidden))) #btn-company-drawer .school-pill-title {
    font-size: 0.78rem !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container:where(:has(#btn-student-ranking:not(.hidden))) #btn-company-drawer .school-pill-sub {
    font-size: 0.63rem !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill:not(.hidden) {
    grid-column: span 1 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 44px !important;
    padding: 5px 10px 5px 7px !important;
    border-radius: 15px !important;
    background: linear-gradient(135deg, #EEF2FF 0%, #FFFBEB 100%) !important;
    border: 1px solid rgba(49, 46, 129, 0.22) !important;
    box-shadow: 0 4px 12px rgba(49, 46, 129, 0.08) !important;
    justify-content: flex-start !important;
    gap: 7px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill:disabled {
    opacity: 0.72 !important;
    background: linear-gradient(135deg, #EEF2FF 0%, #F8FAFC 100%) !important;
    color: #12132A !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container:where(:not(:has(#btn-company-drawer:not(.hidden)))) #btn-student-ranking.ranking-header-pill:not(.hidden) {
    grid-column: 1 / -1 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking .ranking-pill-crest {
    width: 30px !important;
    height: 30px !important;
    border-radius: 9px !important;
    background: linear-gradient(145deg, #1E1B4B 0%, #312E81 100%) !important;
    color: #FBBF24 !important;
    box-shadow: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking .ranking-pill-crest svg {
    width: 16px !important;
    height: 16px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking .ranking-pill-title {
    font-size: 0.78rem !important;
    color: #12132A !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking .ranking-pill-sub {
    font-size: 0.63rem !important;
    color: #4338CA !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill::after {
    content: "›";
    margin-left: auto;
    font-size: 1.15rem;
    font-weight: 800;
    color: #4338CA;
    padding-left: 4px;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill::after {
    content: "›";
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 800;
    color: rgb(var(--brand-1-ink, 79, 70, 229));
    padding-left: 6px;
}

/* Código Dorado — píldora legible con selectores reales de cd_alerta.js (.cd-badge-icon-box / .cd-badge-text-box) */
body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-codigo-dorado.cd-panic-badge {
    margin: 0 !important;
    padding: 7px 9px !important;
    min-height: 44px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%) !important;
    border: 1px solid rgba(217, 119, 6, 0.28) !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-codigo-dorado .cd-badge-icon-box {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
    animation: none !important;
    box-shadow: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-codigo-dorado .cd-badge-icon-box img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-codigo-dorado .cd-badge-text-box {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-align: left !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-codigo-dorado .cd-badge-top {
    display: block !important;
    font-size: 0.61rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    color: #92400E !important;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-codigo-dorado .cd-badge-bottom {
    display: block !important;
    font-size: 0.73rem !important;
    font-weight: 800 !important;
    color: #78350F !important;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buzón Anónimo — píldora legible (respeta .mb-cust-hidden-el y nunca se muestra a acudientes) */
body.mb-student-portrait-home.mb-student-ui-active:not(.mb-guardian-portrait-mode) #view-library .header-actions-container .confidencialidad-badge:not(.mb-cust-hidden-el) {
    margin: 0 !important;
    padding: 7px 9px !important;
    min-height: 44px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #ECFDF5 0%, #E0F2FE 100%) !important;
    border: 1px solid rgba(4, 120, 87, 0.22) !important;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container .confidencialidad-badge .badge-icon-box {
    width: 28px !important;
    height: 28px !important;
    border-radius: 9px !important;
    background: #FFFFFF !important;
    color: #065F46 !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container .confidencialidad-badge .badge-icon-box svg {
    width: 16px !important;
    height: 16px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container .confidencialidad-badge .badge-text-box {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-align: left !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container .confidencialidad-badge .badge-top {
    display: block !important;
    font-size: 0.61rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    color: #065F46 !important;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container .confidencialidad-badge .badge-bottom {
    display: block !important;
    font-size: 0.73rem !important;
    font-weight: 800 !important;
    color: #12132A !important;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Equilibrio 100% ancho si solo está presente una de las dos píldoras */
body.mb-student-portrait-home.mb-student-ui-active:not(.mb-guardian-portrait-mode) #view-library .header-actions-container:has(.confidencialidad-badge.mb-cust-hidden-el) #btn-codigo-dorado.cd-panic-badge {
    grid-column: 1 / -1 !important;
}

body.mb-student-portrait-home.mb-student-ui-active:not(.mb-guardian-portrait-mode) #view-library .header-actions-container:not(:has(#btn-codigo-dorado)) .confidencialidad-badge:not(.mb-cust-hidden-el) {
    grid-column: 1 / -1 !important;
}

/* ==========================================================================
   6b) ADAPTACIÓN DEDICADA DEL PERFIL DE ACUDIENTE / PADRE DE FAMILIA (SOLO LECTURA)
   ========================================================================== */
body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .user-meta h5 {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .user-meta h2#display-name {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #5C607B !important;
    letter-spacing: 0.01em !important;
    white-space: normal !important;
    overflow: visible !important;
    line-height: 1.15 !important;
    margin: 0 0 3px !important;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .user-meta h2#display-name > br {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .user-meta h2#display-name > span {
    display: block !important;
    font-size: 1.24rem !important;
    font-weight: 800 !important;
    color: #12132A !important;
    line-height: 1.16 !important;
    letter-spacing: -0.03em !important;
    margin-top: 1px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .user-meta span#display-email {
    display: inline-flex !important;
    align-items: center;
    background: #EEF2FF;
    color: #3730A3 !important;
    font-size: 0.67rem !important;
    font-weight: 700 !important;
    padding: 2px 8px;
    border-radius: 999px;
    margin-top: 2px !important;
    max-width: 100%;
}

/* Selector "Cambiar Estudiante" (vence .switcher-text-box { display:none } legacy <=768px de aprobPadres.js) */
body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .header-actions-container #btn-guardian-switcher.switcher-btn-premium {
    margin: 0 !important;
    padding: 7px 10px !important;
    min-height: 44px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #EFF6FF 0%, #E0E7FF 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.28) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    transform: none !important;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .header-actions-container #btn-guardian-switcher .switcher-icon-box {
    width: 28px !important;
    height: 28px !important;
    border-radius: 9px !important;
    background: #FFFFFF !important;
    color: #1D4ED8 !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .header-actions-container #btn-guardian-switcher .switcher-icon-box svg {
    width: 15px !important;
    height: 15px !important;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .header-actions-container #btn-guardian-switcher .switcher-text-box {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-align: left !important;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .header-actions-container #btn-guardian-switcher .switcher-top {
    display: block !important;
    font-size: 0.61rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    color: #1E40AF !important;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .header-actions-container #btn-guardian-switcher .switcher-bottom {
    display: block !important;
    font-size: 0.74rem !important;
    font-weight: 800 !important;
    color: #12132A !important;
    line-height: 1.15;
    max-width: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .header-actions-container #btn-guardian-switcher::after {
    content: "›";
    margin-left: auto;
    font-size: 1.1rem;
    font-weight: 800;
    color: #1D4ED8;
    flex-shrink: 0;
}

/* Si el acudiente tiene 1 solo hijo (sin switcher), Código Dorado ocupa todo el ancho limpiamente */
body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .header-actions-container:not(:has(#btn-guardian-switcher)) #btn-codigo-dorado.cd-panic-badge {
    grid-column: 1 / -1 !important;
}

body.mb-student-portrait-home.mb-student-portrait-active.mb-guardian-portrait-mode #view-library .header-actions-container:not(:has(#btn-codigo-dorado)) #btn-guardian-switcher.switcher-btn-premium {
    grid-column: 1 / -1 !important;
}

/* Banner de bienvenida de Mindbook Studio */
body.mb-student-portrait-home.mb-student-ui-active #view-library .mb-school-welcome-banner {
    border-radius: 18px !important;
    margin-bottom: 10px !important;
    padding: 10px 13px !important;
    font-size: 0.8rem !important;
}

/* 7) Grilla Bento 2x2 Tactile ("Tus Espacios" — Inspiración directa Referencia #2!) */
body.mb-student-portrait-home.mb-student-ui-active #view-library .employee-profile-layout {
    display: block !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-sidebar {
    position: static !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 0 !important;
    margin-bottom: 14px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .action-card-premium {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    padding: 14px 13px 13px !important;
    min-height: 126px !important;
    border-radius: 22px !important;
    background: #FFFFFF !important;
    border: 1px solid rgba(18, 19, 42, 0.07) !important;
    box-shadow: 0 10px 26px rgba(18, 19, 42, 0.05) !important;
    text-align: left !important;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease !important;
}

/* Eliminar barra lateral neón legacy de main.css en todas las tarjetas Bento */
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .action-card-premium::after {
    content: none !important;
    display: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .action-card-premium:active {
    transform: scale(0.975) !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .action-card-premium.hidden {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-main-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-icon-circle {
    width: 40px !important;
    height: 40px !important;
    border-radius: 13px !important;
    position: relative !important;
    overflow: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

/* Anular stroke: var(--glow-color) y drop-shadow de main.css para contraste exacto y visibilidad de extensiones */
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-icon-circle svg {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    filter: none !important;
    opacity: 1 !important;
}

/* Posicionamiento absoluto real + contraste AA del contador de Academia */
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-academy #emp-courses-badge {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    margin: 0 !important;
    min-width: 20px !important;
    height: 20px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: #DC2626 !important;
    color: #FFFFFF !important;
    border: 2px solid #FFFFFF !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.66rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.3) !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-academy #emp-courses-badge.hidden {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-text-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    width: 100%;
    min-width: 0;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-title {
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif);
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    color: #12132A !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-subtitle {
    display: -webkit-box !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #5C607B !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    word-break: break-word;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-arrow {
    display: none !important;
}

/* Tile 1: Reportes Académicos — Tarjeta Protagonista Midnight Indigo (aplica tanto a Estudiante como a Acudiente) */
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-repo-estudiantil.action-card-premium,
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-official.action-card-premium {
    background: linear-gradient(150deg, #141436 0%, #1F2255 100%) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 14px 30px rgba(20, 20, 54, 0.22) !important;
    order: 1;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-repo-estudiantil .card-icon-circle,
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-official .card-icon-circle {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #93C5FD !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-repo-estudiantil .card-title,
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-official .card-title {
    color: #FFFFFF !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-repo-estudiantil .card-subtitle,
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-official .card-subtitle {
    color: #CBD5E1 !important;
}

/* Tile 2: Mi Jornada — Porcelana Limpia */
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-schedule {
    background: #FFFFFF !important;
    order: 2;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-schedule .card-icon-circle {
    background: #E0F2FE !important;
    color: #0369A1 !important;
}

/* Tile 3: Academia — Lavanda Pastel (Ref #2!) */
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-academy {
    background: linear-gradient(155deg, #EEF0FF 0%, #E5E7FD 100%) !important;
    border-color: rgba(79, 70, 229, 0.14) !important;
    order: 3;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-academy .card-icon-circle {
    background: #FFFFFF !important;
    color: #4F46E5 !important;
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.14);
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-academy .card-subtitle {
    color: #4338CA !important;
}

/* Tile 4: Wiki & Enlaces (inyectado por profileLinks.js) — Menta Suave */
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-profile-wiki {
    background: linear-gradient(155deg, #ECFDF5 0%, #E6F7F1 100%) !important;
    border-color: rgba(4, 120, 87, 0.14) !important;
    order: 4;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-profile-wiki .card-icon-circle {
    background: #FFFFFF !important;
    color: #047857 !important;
    box-shadow: 0 6px 14px rgba(4, 120, 87, 0.12);
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-profile-wiki .card-subtitle {
    color: #065F46 !important;
}

/* Fila inferior limpia: Centro de Seguridad + Extensiones escolares (estilo Activity row de Ref #2!) */
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-security,
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .mb-ext-profile-card {
    grid-column: 1 / -1 !important;
    flex-direction: row !important;
    align-items: center !important;
    min-height: 64px !important;
    padding: 12px 14px !important;
    border-radius: 18px !important;
    background: #FFFFFF !important;
    order: 5;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .mb-ext-profile-card {
    order: 6;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-security .card-main-info,
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .mb-ext-profile-card .card-main-info {
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-security .card-icon-circle {
    width: 38px !important;
    height: 38px !important;
    border-radius: 12px !important;
    background: #F1F5F9 !important;
    color: #334155 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .mb-ext-profile-card .card-icon-circle {
    width: 38px !important;
    height: 38px !important;
    border-radius: 12px !important;
    background: #EEF2FF !important;
    color: rgb(var(--brand-1-ink, 79, 70, 229));
}

body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-security .card-arrow,
body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .mb-ext-profile-card .card-arrow {
    display: inline-flex !important;
    color: #5C607B !important;
    font-size: 1.25rem !important;
    font-weight: 800;
    margin-left: 8px;
}

/* 8) Bottom Navigation Pill Dock Flotante (`#mobile-action-bar`, Ref #1 & #2!) */
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar.active {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
    transform: translateX(-50%) !important;
    width: min(calc(100% - 24px), 440px) !important;
    min-height: 62px !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(22px) !important;
    -webkit-backdrop-filter: blur(22px) !important;
    border: 1px solid rgba(18, 19, 42, 0.09) !important;
    box-shadow: 0 18px 42px rgba(18, 19, 42, 0.16) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
    gap: 4px !important;
    transition: opacity 0.2s ease !important;
    z-index: 1040 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar .nav-item {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: auto !important;
    min-width: 64px !important;
    height: 48px !important;
    padding: 4px 10px !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 1.5px solid transparent !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    color: #4A4D68 !important;
    cursor: pointer;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar .nav-item:hover {
    transform: none !important;
    background: rgba(18, 19, 42, 0.04) !important;
    box-shadow: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar .hidden {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #stu-dock-home,
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #stu-dock-home:hover {
    background: #141436 !important;
    color: #FFFFFF !important;
    padding: 4px 15px !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #stu-dock-home .nav-label,
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #stu-dock-home svg {
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

/* Alerta roja visible cuando existen compromisos urgentes (`urgentCommitmentsCount > 0`) */
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn.is-urgent-alert,
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn[style*="ef4444"],
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn[style*="239, 68, 68"] {
    border: 2px solid #DC2626 !important;
    background: #FEF2F2 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn.is-urgent-alert svg,
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn[style*="ef4444"] svg,
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn[style*="239, 68, 68"] svg {
    stroke: #B91C1C !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn.is-urgent-alert .nav-label,
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn[style*="ef4444"] .nav-label,
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn[style*="239, 68, 68"] .nav-label {
    color: #B91C1C !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar .nav-item .icon-wrapper {
    width: 22px !important;
    height: 22px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar .nav-item svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2.1 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-future-btn svg {
    stroke: #7C3AED !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #stu-dock-child-switch svg {
    stroke: #2563EB !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #floating-inbox-btn svg {
    stroke: #4F46E5 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #stu-dock-menu svg {
    stroke: #334155 !important;
}

/* Color explícito WCAG AA (8.23:1) anulando var(--text-light) de main.css */
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar .nav-label {
    display: block !important;
    font-family: var(--lp-font, 'Plus Jakarta Sans', 'Outfit', sans-serif);
    font-size: 0.63rem !important;
    font-weight: 800 !important;
    color: #4A4D68 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    line-height: 1 !important;
}

/* Badges del dock: resetear left:-5px y width:18px de main.css + AA #DC2626 */
body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar .badge-count {
    left: auto !important;
    right: 6px !important;
    top: 2px !important;
    width: auto !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 5px !important;
    margin: 0 !important;
    background: #DC2626 !important;
    color: #FFFFFF !important;
    border: 2px solid #FFFFFF !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.64rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar .badge-count.hidden {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar #stu-dock-menu .stu-notif-dot {
    top: 4px;
    right: calc(50% - 14px);
}

/* Elevar toasts de extensiones sobre el dock incluso en tablets verticales (769px–1180px) */
body.mb-student-portrait-home.mb-student-ui-active .mb-ext-toast {
    bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Footer con despeje limpio sobre el dock flotante */
body.mb-student-portrait-home.mb-student-ui-active footer.footer {
    padding-bottom: calc(102px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ==========================================================================
   8b) VISTA HORIZONTAL — TABLET LANDSCAPE, LAPTOP Y DESKTOP (Solo Estudiante)
   Activada exclusivamente por `body.mb-student-portrait-home.mb-student-landscape-active`
   (nunca en celulares — bloqueados en vertical — ni en Admin ni en Acudiente).
   Mantiene el 100% del lenguaje visual del perfil vertical (Porcelana #F8F4E8,
   Midnight Indigo #141436, Bento pastel, tira semanal y pill dock centrado).
   ========================================================================== */

/* Top App Bar de escritorio y tablet horizontal */
body.mb-student-portrait-home.mb-student-landscape-active header#main-site-header {
    height: calc(64px + env(safe-area-inset-top, 0px)) !important;
    padding-top: env(safe-area-inset-top, 0px);
}

body.mb-student-portrait-home.mb-student-landscape-active header#main-site-header nav {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px !important;
    gap: 14px;
}

body.mb-student-portrait-home.mb-student-landscape-active header#main-site-header .logo {
    font-size: 1.26rem !important;
}

@media (min-width: 600px) {
    body.mb-student-portrait-home.mb-student-landscape-active header#main-site-header .logo .edu-tag {
        display: inline-block !important;
    }
}

body.mb-student-portrait-home.mb-student-landscape-active #nav-user .user-info-nav {
    gap: 10px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #nav-avatar.avatar-sm {
    width: 36px !important;
    height: 36px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #btn-library.nav-btn,
body.mb-student-portrait-home.mb-student-landscape-active #btn-logout.nav-btn {
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
    min-height: 38px;
}

body.mb-student-portrait-home.mb-student-landscape-active .stu-top-menu-btn {
    width: 40px;
    height: 40px;
}

/* Cajón deslizable ligeramente más amplio en escritorio */
body.mb-student-portrait-home.mb-student-landscape-active #stu-mobile-drawer .stu-drawer-panel {
    width: min(88vw, 390px);
}

/* Lienzo principal centrado y sin huecos fantasma */
body.mb-student-portrait-home.mb-student-landscape-active main#app-root {
    padding-top: calc(84px + env(safe-area-inset-top, 0px)) !important;
    padding-left: calc(24px + env(safe-area-inset-left, 0px)) !important;
    padding-right: calc(24px + env(safe-area-inset-right, 0px)) !important;
    padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px)) !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library > #daily-insight-anchor:empty {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-content-area:not(:has(> :not(.hidden))) {
    display: none !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-content-area {
    margin-top: 18px;
}

/* Banner IA Diario — más aireado y legible en pantalla ancha */
body.mb-student-portrait-home.mb-student-landscape-active #view-library #daily-insight-anchor #daily-insight-card.premium-insight-card {
    border-radius: 20px !important;
    padding: 13px 52px 13px 18px !important;
    margin-bottom: 0 !important;
    gap: 14px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library #daily-insight-anchor .insight-icon-box {
    width: 38px !important;
    height: 38px !important;
    border-radius: 12px !important;
    font-size: 1.15rem !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library #daily-insight-anchor .insight-content-box h4 {
    font-size: 0.72rem !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library #daily-insight-anchor .insight-text-full,
body.mb-student-portrait-home.mb-student-landscape-active #view-library #daily-insight-anchor p {
    font-size: 0.88rem !important;
    line-height: 1.48 !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library #daily-insight-anchor .insight-close-btn {
    top: 10px !important;
    right: 12px !important;
    width: 34px !important;
    height: 34px !important;
}

/* Tarjeta de identidad del estudiante (Columna izquierda en >= 768px) */
body.mb-student-portrait-home.mb-student-landscape-active #view-library > .profile-header {
    border-radius: 26px !important;
    padding: 20px !important;
    gap: 13px !important;
    box-shadow: 0 14px 34px rgba(18, 19, 42, 0.055) !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-info-row {
    gap: 12px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .user-main-data-group {
    gap: 14px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .avatar-upload,
body.mb-student-portrait-home.mb-student-landscape-active #view-library #profile-img {
    width: 62px !important;
    height: 62px !important;
    border-radius: 20px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .avatar-loader-overlay {
    border-radius: 20px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .edit-badge {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.76rem !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .user-meta h5 {
    font-size: 0.76rem !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .user-meta h2#display-name {
    font-size: 1.3rem !important;
    line-height: 1.18 !important;
    white-space: normal !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .user-meta span#display-email {
    font-size: 0.77rem !important;
    margin-top: 2px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library #display-badges-container {
    margin-top: 7px !important;
    gap: 6px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library #display-badges-container > span {
    font-size: 0.71rem !important;
    padding: 4px 10px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library #user-birthday-status .bday-hero-card {
    padding: 10px 13px !important;
    border-radius: 16px !important;
    gap: 10px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library #user-birthday-status .bday-label-premium {
    font-size: 0.8rem !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container {
    gap: 9px !important;
    padding-top: 12px;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill:not(.hidden),
body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill:not(.hidden) {
    grid-column: 1 / -1 !important;
    min-height: 48px !important;
    padding: 7px 13px 7px 9px !important;
    border-radius: 16px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-company-drawer .school-pill-crest,
body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-student-ranking .ranking-pill-crest {
    width: 34px !important;
    height: 34px !important;
    border-radius: 11px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-student-ranking .ranking-pill-title {
    font-size: 0.84rem !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-student-ranking .ranking-pill-sub {
    font-size: 0.68rem !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-codigo-dorado.cd-panic-badge,
body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container .confidencialidad-badge:not(.mb-cust-hidden-el) {
    min-height: 48px !important;
    padding: 8px 10px !important;
    border-radius: 15px !important;
    gap: 8px !important;
}

/* Tira semanal en vista horizontal */
body.mb-student-portrait-home.mb-student-landscape-active #stu-week-strip.stu-week-strip {
    border-radius: 24px;
    padding: 15px 16px 16px;
    box-shadow: 0 12px 28px rgba(18, 19, 42, 0.05);
}

body.mb-student-portrait-home.mb-student-landscape-active .stu-week-head {
    margin-bottom: 10px;
}

body.mb-student-portrait-home.mb-student-landscape-active .stu-week-month {
    font-size: 0.84rem;
}

body.mb-student-portrait-home.mb-student-landscape-active .stu-week-cta {
    font-size: 0.78rem;
}

body.mb-student-portrait-home.mb-student-landscape-active .stu-week-days {
    gap: 7px;
}

body.mb-student-portrait-home.mb-student-landscape-active .stu-day-pill {
    padding: 9px 4px;
    border-radius: 15px;
    gap: 3px;
}

body.mb-student-portrait-home.mb-student-landscape-active .stu-day-num {
    font-size: 1rem;
}

/* Cabecera "Tus Espacios / Ver todo ›" en escritorio */
body.mb-student-portrait-home.mb-student-landscape-active .stu-section-head {
    margin: 0 0 12px;
    padding: 0 2px;
}

body.mb-student-portrait-home.mb-student-landscape-active .stu-section-title {
    font-size: 1.12rem;
    letter-spacing: -0.025em;
}

body.mb-student-portrait-home.mb-student-landscape-active .stu-section-more {
    font-size: 0.83rem;
    padding: 6px 12px;
    border-radius: 999px;
    transition: background 0.18s ease;
}

/* Bento Workspace Horizontal: Hero full-width (Reportes Académicos) + 2x2 simétrico */
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 0 !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .action-card-premium {
    min-height: 152px !important;
    padding: 20px !important;
    border-radius: 24px !important;
    box-shadow: 0 12px 30px rgba(18, 19, 42, 0.05) !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-main-info {
    gap: 15px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-icon-circle {
    width: 46px !important;
    height: 46px !important;
    border-radius: 15px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-icon-circle svg {
    width: 22px !important;
    height: 22px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-title {
    font-size: 1.02rem !important;
    line-height: 1.22 !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-subtitle {
    font-size: 0.8rem !important;
    line-height: 1.38 !important;
}

/* Flecha sutil superior derecha en los 4 bloques Bento 2x2 */
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-arrow {
    display: inline-flex !important;
    position: absolute !important;
    top: 18px;
    right: 18px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(18, 19, 42, 0.05);
    color: #4A4D68 !important;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem !important;
    font-weight: 800;
    margin-left: 0;
    transition: transform 0.2s ease, background 0.2s ease;
}

/* Tile 1: Reportes Académicos — Tarjeta Hero Horizontal Protagonista (Ancho completo de la grilla) */
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil.action-card-premium,
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official.action-card-premium {
    grid-column: 1 / -1 !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 112px !important;
    padding: 20px 24px !important;
    border-radius: 26px !important;
    background: linear-gradient(135deg, #141436 0%, #1F2255 60%, #2B2F73 100%) !important;
    box-shadow: 0 18px 38px rgba(20, 20, 54, 0.22) !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil .card-main-info,
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official .card-main-info {
    flex-direction: row !important;
    align-items: center !important;
    gap: 18px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil .card-icon-circle,
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official .card-icon-circle {
    width: 52px !important;
    height: 52px !important;
    border-radius: 16px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil .card-icon-circle svg,
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official .card-icon-circle svg {
    width: 24px !important;
    height: 24px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil .card-title,
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official .card-title {
    font-size: 1.18rem !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil .card-subtitle,
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official .card-subtitle {
    font-size: 0.86rem !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil .card-arrow,
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official .card-arrow {
    position: static !important;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF !important;
    font-size: 1.3rem !important;
    flex-shrink: 0;
}

/* Tile 5: Centro de Seguridad — Empareja simétricamente junto a Wiki & Enlaces (2x2 perfecto) */
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-security {
    grid-column: auto !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    min-height: 152px !important;
    padding: 20px !important;
    border-radius: 24px !important;
    background: linear-gradient(155deg, #FFFFFF 0%, #F8FAFC 100%) !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-security .card-main-info {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-security .card-icon-circle {
    width: 46px !important;
    height: 46px !important;
    border-radius: 15px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-security .card-arrow {
    position: absolute !important;
    top: 18px;
    right: 18px;
    margin-left: 0;
}

/* Extensiones institucionales en escritorio — Fila horizontal limpia de ancho completo */
body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .mb-ext-profile-card {
    grid-column: 1 / -1 !important;
    min-height: 76px !important;
    padding: 16px 20px !important;
    border-radius: 20px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .mb-ext-profile-card .card-arrow {
    position: static !important;
    margin-left: 12px;
}

/* Dock flotante inferior horizontal estilo macOS / iPadOS */
body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar.active {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    min-width: min(400px, calc(100vw - 32px));
    max-width: calc(100vw - 32px) !important;
    min-height: 58px !important;
    padding: 6px 10px !important;
    gap: 6px !important;
    box-shadow: 0 18px 46px rgba(18, 19, 42, 0.14) !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar .nav-item,
body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar #floating-future-btn,
body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar #floating-inbox-btn {
    flex-direction: row !important;
    width: auto !important;
    min-width: auto !important;
    height: 44px !important;
    padding: 0 16px !important;
    gap: 8px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar #stu-dock-home,
body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar #stu-dock-home:hover {
    padding: 0 18px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar .nav-label {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar .badge-count {
    top: -4px !important;
    right: -4px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar #stu-dock-menu .stu-notif-dot {
    top: 6px;
    right: 8px;
}

body.mb-student-portrait-home.mb-student-landscape-active .mb-ext-toast {
    bottom: 92px !important;
}

body.mb-student-portrait-home.mb-student-landscape-active footer.footer {
    padding-bottom: 108px !important;
}

/* Breakpoint 1: Tablets horizontales y escritorio estándar (>= 768px) — Maquetación de 2 columnas */
@media (min-width: 768px) {
    body.mb-student-portrait-home.mb-student-landscape-active #view-library.container {
        max-width: 960px !important;
        display: grid !important;
        grid-template-columns: minmax(276px, 316px) minmax(0, 1fr) !important;
        gap: 14px 18px !important;
        align-items: start !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library > #daily-insight-anchor {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library > .mb-school-welcome-banner {
        grid-column: 1 / -1;
        grid-row: 1;
        margin-bottom: 0 !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> #daily-insight-anchor:not(:empty)) > .mb-school-welcome-banner {
        grid-row: 2;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library > .profile-header {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 0 !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library > #stu-week-strip {
        grid-column: 1;
        grid-row: 2;
        margin-bottom: 0 !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library > .employee-profile-layout {
        grid-column: 2;
        grid-row: 1 / span 3;
        min-width: 0;
        width: 100%;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> #daily-insight-anchor:not(:empty)) > .profile-header,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> .mb-school-welcome-banner) > .profile-header {
        grid-row: 2;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> #daily-insight-anchor:not(:empty)) > #stu-week-strip,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> .mb-school-welcome-banner) > #stu-week-strip {
        grid-row: 3;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> #daily-insight-anchor:not(:empty)) > .employee-profile-layout,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> .mb-school-welcome-banner) > .employee-profile-layout {
        grid-row: 2 / span 3;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> #daily-insight-anchor:not(:empty)):has(> .mb-school-welcome-banner) > .profile-header {
        grid-row: 3;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> #daily-insight-anchor:not(:empty)):has(> .mb-school-welcome-banner) > #stu-week-strip {
        grid-row: 4;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library:has(> #daily-insight-anchor:not(:empty)):has(> .mb-school-welcome-banner) > .employee-profile-layout {
        grid-row: 3 / span 3;
    }
}

/* En tablets horizontales compactas (768px - 920px), apilar botones del header para cero truncamiento */
@media (min-width: 768px) and (max-width: 920px) {
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill:not(.hidden),
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill:not(.hidden),
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-codigo-dorado.cd-panic-badge,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container .confidencialidad-badge:not(.mb-cust-hidden-el) {
        grid-column: 1 / -1 !important;
    }
}

/* Breakpoint 2: Tablets grandes horizontales y Laptops (1024px - 1439px) */
@media (min-width: 1024px) {
    body.mb-student-portrait-home.mb-student-landscape-active #view-library.container {
        max-width: 1180px !important;
        grid-template-columns: minmax(328px, 370px) minmax(0, 1fr) !important;
        gap: 16px 24px !important;
    }
}

/* Breakpoint 3: Monitores amplios / Ultrawide (>= 1440px) */
@media (min-width: 1440px) {
    body.mb-student-portrait-home.mb-student-landscape-active #view-library.container {
        max-width: 1240px !important;
        grid-template-columns: 384px minmax(0, 1fr) !important;
        gap: 18px 28px !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid {
        gap: 18px !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .action-card-premium {
        min-height: 162px !important;
        padding: 22px !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil.action-card-premium,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official.action-card-premium {
        min-height: 118px !important;
        padding: 22px 26px !important;
    }
}

/* Breakpoint 4: Ventana angosta de escritorio con mouse (< 768px) — Columna centrada limpia */
@media (max-width: 767px) {
    body.mb-student-portrait-home.mb-student-landscape-active main#app-root {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library.container {
        display: block !important;
        max-width: 580px !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library > #daily-insight-anchor #daily-insight-card.premium-insight-card {
        margin-bottom: 12px !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library > .profile-header,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library > #stu-week-strip {
        margin-bottom: 12px !important;
    }
}

@media (max-width: 540px) {
    body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar.active {
        min-width: 0;
        width: min(calc(100% - 24px), 440px) !important;
        gap: 4px !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar .nav-item,
    body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar #floating-future-btn,
    body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar #floating-inbox-btn {
        flex-direction: column !important;
        min-width: 64px !important;
        height: 48px !important;
        padding: 4px 10px !important;
        gap: 2px !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar .nav-label {
        font-size: 0.64rem !important;
    }
}

/* Micro-interacciones táctiles de puntero/mouse en horizontal y escritorio */
@media (hover: hover) {
    body.mb-student-portrait-home.mb-student-landscape-active #btn-library.nav-btn:hover {
        background: #F4F1EA;
        border-color: rgba(18, 19, 42, 0.18);
    }

    body.mb-student-portrait-home.mb-student-landscape-active #btn-logout.nav-btn:hover {
        background: #FEE2E2;
    }

    body.mb-student-portrait-home.mb-student-landscape-active .stu-top-menu-btn:hover {
        background: #F4F1EA;
        transform: translateY(-1px);
    }

    body.mb-student-portrait-home.mb-student-landscape-active .stu-section-more:hover {
        background: rgba(var(--brand-color-1, 79, 70, 229), 0.08);
    }

    body.mb-student-portrait-home.mb-student-landscape-active #stu-week-strip.stu-week-strip:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 34px rgba(18, 19, 42, 0.08);
        border-color: rgba(var(--brand-color-1, 79, 70, 229), 0.24);
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library #user-birthday-status .bday-hero-card:hover {
        transform: translateY(-1px) !important;
        box-shadow: 0 8px 20px rgba(18, 19, 42, 0.08) !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill:hover {
        background: rgba(var(--brand-color-1, 79, 70, 229), 0.12) !important;
        transform: translateY(-1px);
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill:hover:not(:disabled) {
        background: linear-gradient(135deg, #E0E7FF 0%, #FEF3C7 100%) !important;
        border-color: #4338CA !important;
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(49, 46, 129, 0.14) !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-codigo-dorado.cd-panic-badge:hover,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container .confidencialidad-badge:not(.mb-cust-hidden-el):hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(18, 19, 42, 0.09) !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .action-card-premium:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 18px 38px rgba(18, 19, 42, 0.09) !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .action-card-premium:hover .card-icon-circle {
        transform: scale(1.05) !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .action-card-premium:hover .card-arrow {
        transform: translateX(3px);
        background: rgba(18, 19, 42, 0.09);
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil.action-card-premium:hover,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official.action-card-premium:hover {
        box-shadow: 0 22px 44px rgba(20, 20, 54, 0.28) !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil:hover .card-icon-circle,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official:hover .card-icon-circle {
        background: rgba(255, 255, 255, 0.24) !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil:hover .card-arrow,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official:hover .card-arrow {
        background: rgba(255, 255, 255, 0.24);
        transform: translateX(4px);
    }

    body.mb-student-portrait-home.mb-student-landscape-active #mobile-action-bar .nav-item:not(#stu-dock-home):hover {
        background: rgba(18, 19, 42, 0.06) !important;
    }
}

/* ==========================================================================
   9) INTEGRACIÓN COMPLETA CON MINDBOOK STUDIO (`data-mb-surface`, `radius`, `density`)
   ========================================================================== */
html[data-mb-surface="modern_soft"] body.mb-student-portrait-home.mb-student-ui-active header#main-site-header {
    background: rgba(241, 245, 249, 0.92) !important;
}

html[data-mb-surface="editorial"] body.mb-student-portrait-home.mb-student-ui-active header#main-site-header {
    background: rgba(250, 248, 244, 0.92) !important;
}

html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active header#main-site-header {
    background: #FFFFFF !important;
    border-bottom: 2px solid #0F172A !important;
}

html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #view-library > .profile-header,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #stu-week-strip.stu-week-strip,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #view-library #daily-insight-anchor #daily-insight-card.premium-insight-card,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .action-card-premium:not(.card-official),
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-profile-wiki,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-guardian-switcher.switcher-btn-premium,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill:not(.hidden),
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill:not(.hidden),
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-codigo-dorado.cd-panic-badge,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container .confidencialidad-badge:not(.mb-cust-hidden-el),
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active .bday-hero-card,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active .stu-day-pill,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #mobile-action-bar.active,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active .stu-menu-group,
html[data-mb-surface="high_contrast"] body.mb-student-portrait-home.mb-student-ui-active #stu-mobile-drawer .stu-drawer-panel {
    border: 2px solid #0F172A !important;
    color: #020617 !important;
}

html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #view-library > .profile-header,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #view-library #daily-insight-anchor #daily-insight-card.premium-insight-card,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #stu-week-strip.stu-week-strip,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #view-library .mb-school-welcome-banner,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-guardian-switcher.switcher-btn-premium,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .action-card-premium,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-repo-estudiantil.action-card-premium,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-profile-wiki,
html[data-mb-radius="sharp"] body.mb-student-portrait-home.mb-student-ui-active .stu-menu-group {
    border-radius: 10px !important;
}

html[data-mb-radius="pill"] body.mb-student-portrait-home.mb-student-ui-active #view-library > .profile-header,
html[data-mb-radius="pill"] body.mb-student-portrait-home.mb-student-ui-active #stu-week-strip.stu-week-strip,
html[data-mb-radius="pill"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill,
html[data-mb-radius="pill"] body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill,
html[data-mb-radius="pill"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .action-card-premium,
html[data-mb-radius="pill"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-repo-estudiantil.action-card-premium,
html[data-mb-radius="pill"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid #btn-profile-wiki {
    border-radius: 28px !important;
}

html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-ui-active #view-library > .profile-header {
    padding: 10px 11px !important;
    gap: 7px !important;
}

html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-ui-active .stu-week-strip {
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
}

html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid {
    gap: 8px !important;
}

html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .action-card-premium {
    min-height: 110px !important;
    padding: 11px !important;
}

html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-landscape-active #view-library > .profile-header {
    padding: 15px !important;
    gap: 10px !important;
}

html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid {
    gap: 12px !important;
}

html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .action-card-premium {
    min-height: 126px !important;
    padding: 15px !important;
}

html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-landscape-active #view-library > #stu-week-strip.stu-week-strip {
    padding: 11px 13px !important;
    margin-bottom: 0 !important;
}

html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid #btn-repo-estudiantil.action-card-premium,
html[data-mb-density="compact"] body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .card-official.action-card-premium {
    min-height: 92px !important;
    padding: 15px 20px !important;
}

/* Teléfonos hasta 430px (iPhone 14/15/16, Pixel): apilar Identidad y Ranking a ancho completo para cero truncamiento */
@media (max-width: 430px) {
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill:not(.hidden),
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill:not(.hidden) {
        grid-column: 1 / -1 !important;
    }
}

/* Celulares estrechos y ventanas angostas (<= 390px): ocultar botón redundante Mi Perfil y compactar header */
@media (max-width: 390px) {
    body.mb-student-portrait-home.mb-student-ui-active #btn-library.nav-btn {
        display: none !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active header#main-site-header nav {
        padding: 0 12px !important;
        gap: 8px;
    }

    body.mb-student-portrait-home.mb-student-landscape-active header#main-site-header .logo {
        font-size: 1.06rem !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #btn-logout.nav-btn {
        padding: 6px 10px !important;
        font-size: 0.74rem !important;
    }
}

/* Celulares muy estrechos (320px - 360px) */
@media (max-width: 360px) {
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill:not(.hidden),
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill:not(.hidden),
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-guardian-switcher.switcher-btn-premium,
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-codigo-dorado.cd-panic-badge,
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container .confidencialidad-badge:not(.mb-cust-hidden-el) {
        grid-column: 1 / -1 !important;
    }

    body.mb-student-portrait-home.mb-student-portrait-active #view-library .profile-actions-grid {
        gap: 9px !important;
    }

    body.mb-student-portrait-home.mb-student-portrait-active #view-library .profile-actions-grid .action-card-premium {
        padding: 12px 11px !important;
        min-height: 116px !important;
    }

    body.mb-student-portrait-home.mb-student-portrait-active #view-library .profile-actions-grid .card-title {
        font-size: 0.84rem !important;
    }

    body.mb-student-portrait-home.mb-student-portrait-active #view-library .profile-actions-grid .card-subtitle {
        font-size: 0.68rem !important;
    }

    body.mb-student-portrait-home.mb-student-portrait-active #mobile-action-bar .nav-item {
        min-width: 56px !important;
        padding: 4px 7px !important;
    }
}

/* Tablets verticales (600px - 1180px): aire extra y escala iPadOS limpia */
@media (min-width: 600px) and (max-width: 1180px) {
    body.mb-student-portrait-home.mb-student-portrait-active #view-library.container {
        max-width: 620px !important;
    }

    body.mb-student-portrait-home.mb-student-portrait-active #view-library .profile-actions-grid {
        gap: 14px !important;
    }

    body.mb-student-portrait-home.mb-student-portrait-active #view-library .profile-actions-grid .action-card-premium {
        min-height: 142px !important;
        padding: 17px 17px 15px !important;
    }
}

/* Preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    #stu-mobile-drawer .stu-drawer-panel,
    body.mb-student-portrait-home.mb-student-ui-active .stu-week-strip,
    body.mb-student-portrait-home.mb-student-ui-active .stu-top-menu-btn,
    body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .action-card-premium,
    body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-icon-circle,
    body.mb-student-portrait-home.mb-student-ui-active #view-library .profile-actions-grid .card-arrow,
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-company-drawer,
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-student-ranking,
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container #btn-codigo-dorado,
    body.mb-student-portrait-home.mb-student-ui-active #view-library .header-actions-container .confidencialidad-badge {
        animation: none !important;
        transition: none !important;
    }

    body.mb-student-portrait-home.mb-student-landscape-active #stu-week-strip.stu-week-strip:hover,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-company-drawer.school-brand-pill:hover,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .header-actions-container #btn-student-ranking.ranking-header-pill:hover,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .action-card-premium:hover,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .action-card-premium:hover .card-icon-circle,
    body.mb-student-portrait-home.mb-student-landscape-active #view-library .profile-actions-grid .action-card-premium:hover .card-arrow {
        transform: none !important;
    }
}

/* Impresión: ocultar controles exclusivos del shell móvil */
@media print {
    #stu-mobile-drawer,
    #stu-menu-btn,
    #stu-week-strip,
    .stu-section-head,
    #stu-dock-home,
    #stu-dock-child-switch,
    #stu-dock-menu,
    #btn-student-ranking,
    #modal-student-ranking {
        display: none !important;
    }
}
