/* School identity. Scoped attributes keep company/group names unchanged. */
:root body img[data-school-logo="mqr"] {
    content: url("logo-mqr-oscuro.png"); filter: none; object-fit: contain;
}
:root[data-admin-theme="light"] body img[data-school-logo="mqr"],
:root[data-student-theme="light"] body img[data-school-logo="mqr"] {
    content: url("logo-mqr-claro.png"); filter: none;
}
:root body img[data-school-logo="mambo"] {
    content: url("logo-mambo-claro.png"); filter: brightness(1.85) saturate(.65); object-fit: contain;
}
:root[data-admin-theme="light"] body img[data-school-logo="mambo"],
:root[data-student-theme="light"] body img[data-school-logo="mambo"] {
    content: url("logo-mambo-claro.png"); filter: none;
}
:root body .login-logo[data-school-logo] { width: 100px; height: 100px; max-height: 100px; }
:root body .sidebar-logo[data-school-logo] { width: 62px; height: 62px; max-height: 62px; }
:root body :is(.sidebar-mqr,.mqr-logo)[data-school-logo="mambo"] {
    width: 90px; height: 40px; max-height: 40px;
}
:root body .student-brand { gap: 10px; }
:root body .student-brand .school-header-logo {
    display: block; width: 38px; height: 38px; max-height: 38px;
    flex: 0 0 38px; object-position: center; order: -1;
}
.qr-config-controls { display: grid; gap: 8px; margin-bottom: 14px; }
.qr-config-controls[hidden] { display: none; }
.qr-config-controls small { line-height: 1.5; }
.qr-config-controls select { max-width: 100%; }
#sessionQrLink { overflow-wrap: anywhere; }
.profile-avatar[role="button"] { cursor: pointer; position: relative; overflow: hidden; }
.profile-avatar[role="button"]:focus-visible { outline: 2px solid var(--gold, #e7be56); outline-offset: 3px; }
.student-avatar-photo { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; border-radius: inherit; }
.student-avatar-photo[hidden],.photo-preview[hidden],#profileInitials[hidden] { display: none; }
.student-photo-dialog { width: min(360px, calc(100vw - 32px)); box-sizing: border-box; }
.student-photo-dialog h2 { margin: 0; font-size: 20px; }
.student-photo-dialog input { max-width: 100%; }
.photo-preview { display: block; width: 128px; height: 128px; border-radius: 50%; margin: 16px auto; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Override the old position-based logo rules in dark mode too. */
:root[data-admin-theme="dark"] body img[data-school-logo="mambo"],
:root[data-student-theme="dark"] body img[data-school-logo="mambo"] {
    content: url("logo-mambo-claro.png"); filter: brightness(1.85) saturate(.65);
}
:root[data-admin-theme="dark"] body img[data-school-logo="mqr"],
:root[data-student-theme="dark"] body img[data-school-logo="mqr"] {
    content: url("logo-mqr-oscuro.png"); filter: none;
}
/* Student access: one heading and centered school identity. */
:root body.is-login-view .student-brand { position: relative; justify-content: center; padding: 28px 20px 12px; min-height: 0; border-bottom: 0; }
:root body.is-login-view .student-brand > span { display: none; }
:root body.is-login-view .student-brand .school-header-logo { width: 100px; height: 100px; max-height: 100px; flex: 0 0 100px; margin: 10px 0 0; }
:root body.is-login-view .student-theme-toggle { position: absolute; top: 12px; right: 14px; width: auto; font-size: 9px; padding: 4px; }
:root body.is-login-view #loginView { padding-top: 8px; }
:root body.is-login-view #loginView h1 { font-size: 18px; line-height: 1.35; text-align: center; margin: 0 0 12px; letter-spacing: 1px; }
:root body.is-login-view #loginView > .muted { text-align: center; }
:root body .student-photo-dialog { width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 18px; overflow-y: auto; font-size: 13px; }
:root body .student-photo-dialog .class-topline h2 { font-size: 20px; }
:root body .student-photo-dialog p { line-height: 1.45; margin: 10px 0; }
.photo-file-label { display: grid; gap: 6px; font-size: 12px; }
:root body .student-photo-dialog input[type=file] { padding: 8px; width: 100%; box-sizing: border-box; font-size: 12px; }
.photo-editor { display: grid; justify-items: center; gap: 8px; margin-top: 12px; }
.photo-editor[hidden] { display: none; }
.photo-editor canvas { width: min(200px, 60vw); height: auto; aspect-ratio: 1; border-radius: 50%; display: block; border: 2px solid var(--gold,#e6c365); box-sizing: content-box; cursor: grab; touch-action: none; background: #fff; }
.photo-editor canvas:active { cursor: grabbing; }
.photo-editor canvas:focus-visible { outline: 2px solid var(--gold,#e6c365); outline-offset: 3px; }
.photo-zoom { width: 100%; display: flex; align-items: center; gap: 12px; }
:root body .photo-zoom input { width: 100%; height: 28px; padding: 0; accent-color: #c9a74f; }
:root body .student-photo-dialog button { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.photo-actions { justify-content: center; }
@media (max-height: 650px) { .photo-editor canvas { width: 144px; } }
:root body .student-install-button { display: block; margin: 10px auto 0; border: 0; background: transparent; color: var(--gold,#d4b461); cursor: pointer; font: inherit; font-size: 11px; padding: 6px 10px; letter-spacing: .3px; }
:root body .student-install-button[hidden] { display: none; }
:root body .app-install-dialog { width: min(380px,calc(100vw - 24px)); box-sizing: border-box; padding: 20px; }
:root body .app-install-dialog h2 { font-size: 18px; }
:root body .app-install-dialog p { font-size: 14px; line-height: 1.5; }
@media (display-mode: standalone) { .student-shell { padding-bottom: env(safe-area-inset-bottom); } }
@media (max-width: 820px) {
    :root body .mobile-admin-mark { display: none; }
    :root body #adminHeaderEyebrow { display: none; }
}
.student-session-restore { padding: 28px 20px; text-align: center; }
.student-session-restore[hidden],.student-session-restore button[hidden] { display: none; }
