body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    min-width: 320px;
}

* {
    box-sizing: border-box;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
}

.logo,
.logo_dark {
    display: block;
}

html.dark .logo_dark {
    display: block;
}

html.dark .logo {
    display: none;
}

html:not(.dark) .logo {
    display: block;
}

html:not(.dark) .logo_dark {
    display: none;
}

#studentAvatarMenuButton {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.app-header-back-button {
    display: grid !important;
    place-items: center !important;
    line-height: 1;
    padding: 0;
    position: relative;
    flex: 0 0 auto;
}

.app-header-back-button i {
    align-items: center;
    display: flex;
    font-size: 1.5rem;
    height: 1em;
    justify-content: center;
    left: 50%;
    line-height: 1;
    margin: 0;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) translateX(1px);
    width: 1em;
}

.app-avatar-initials {
    align-items: center;
    background: #1394ff;
    color: #fff;
    display: flex;
    font-size: .92rem;
    font-weight: 800;
    height: 100%;
    justify-content: center;
    letter-spacing: 0;
    width: 100%;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .35);
    border-radius: 999px;
}

.app-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 3000;
    max-width: min(420px, calc(100vw - 44px));
    border-radius: 10px;
    padding: 14px 16px;
    color: #ffffff;
    font-weight: 900;
    line-height: 1.35;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.app-toast.is-success {
    background: #20a85f;
}

.app-toast.is-error {
    background: #e5484d;
}

.app-toast.is-warning {
    background: #c58b12;
}

.app-toast.is-info {
    background: #1394ff;
}

.app-confirm-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: 24px;
    pointer-events: none;
    position: fixed;
    transition: opacity .18s ease;
    z-index: 4200;
}

.app-confirm-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.app-confirm-backdrop {
    backdrop-filter: blur(6px);
    background: rgba(7, 12, 14, .72);
    inset: 0;
    position: absolute;
}

.app-confirm-dialog {
    background: #ffffff;
    border: 1px solid #dfe5e8;
    border-radius: 16px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
    color: #111516;
    display: grid;
    gap: 14px;
    max-width: min(440px, calc(100vw - 36px));
    padding: 28px;
    position: relative;
    transform: translateY(10px) scale(.98);
    transition: transform .18s ease;
    width: 100%;
}

.dark .app-confirm-dialog {
    background: #202526;
    border-color: #343b3d;
    color: #ffffff;
}

.app-confirm-modal.is-open .app-confirm-dialog {
    transform: translateY(0) scale(1);
}

.app-confirm-close {
    align-items: center;
    background: transparent;
    border: 1px solid #dfe5e8;
    border-radius: 999px;
    color: #7a858c;
    display: flex;
    height: 40px;
    justify-content: center;
    position: absolute;
    right: 18px;
    top: 18px;
    width: 40px;
}

.dark .app-confirm-close {
    border-color: #343b3d;
    color: #9aa5ad;
}

.app-confirm-icon {
    align-items: center;
    background: rgba(229, 72, 77, .12);
    border-radius: 14px;
    color: #e5484d;
    display: flex;
    font-size: 1.35rem;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.app-confirm-modal.is-warning .app-confirm-icon {
    background: rgba(197, 139, 18, .14);
    color: #c58b12;
}

.app-confirm-modal.is-info .app-confirm-icon {
    background: rgba(19, 148, 255, .14);
    color: #1394ff;
}

.app-confirm-modal.is-success .app-confirm-icon {
    background: rgba(32, 168, 95, .14);
    color: #20a85f;
}

.app-confirm-dialog h2 {
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.15;
    margin: 4px 46px 0 0;
}

.app-confirm-dialog p {
    color: #6f7a82;
    font-size: .96rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 0;
}

.dark .app-confirm-dialog p {
    color: #9aa5ad;
}

.app-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.app-confirm-button {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    font-size: .95rem;
    font-weight: 900;
    height: 44px;
    justify-content: center;
    min-width: 112px;
    padding: 0 18px;
}

.app-confirm-button.is-cancel {
    background: transparent;
    border: 1px solid #d3dbe0;
    color: #5f6b74;
}

.dark .app-confirm-button.is-cancel {
    border-color: #343b3d;
    color: #c6d0d7;
}

.app-confirm-button.is-confirm {
    background: #e5484d;
    border: 1px solid #e5484d;
    color: #ffffff;
}

.app-confirm-modal.is-warning .app-confirm-button.is-confirm {
    background: #c58b12;
    border-color: #c58b12;
}

.app-confirm-modal.is-info .app-confirm-button.is-confirm {
    background: #1394ff;
    border-color: #1394ff;
}

.app-confirm-modal.is-success .app-confirm-button.is-confirm {
    background: #20a85f;
    border-color: #20a85f;
}

.app-searchable-select {
    min-width: 0;
    position: relative;
    width: 100%;
}

.app-searchable-select-native {
    height: 1px !important;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 100%;
    width: 1px !important;
}

.app-searchable-select-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid #d7dfe4;
    border-radius: 8px;
    color: #182026;
    display: flex;
    font-size: .92rem;
    font-weight: 700;
    gap: 12px;
    height: 48px;
    justify-content: space-between;
    padding: 0 14px;
    text-align: left;
    width: 100%;
}

.app-searchable-select-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-searchable-select-trigger i {
    color: #71808a;
    flex: 0 0 auto;
    transition: transform .18s ease;
}

.app-searchable-select.is-placeholder .app-searchable-select-value {
    color: #7c8992;
}

.app-searchable-select.is-open .app-searchable-select-trigger,
.app-searchable-select-trigger:focus-visible {
    border-color: #1394ff;
    box-shadow: 0 0 0 3px rgba(19, 148, 255, .14);
    outline: none;
}

.app-searchable-select.is-open .app-searchable-select-trigger i {
    transform: rotate(180deg);
}

.app-searchable-select.is-invalid .app-searchable-select-trigger {
    border-color: #e5484d;
}

.app-searchable-select-panel {
    background: #fff;
    border: 1px solid #d7dfe4;
    border-radius: 8px;
    box-shadow: 0 14px 38px rgba(19, 31, 39, .18);
    left: 0;
    margin-top: 6px;
    overflow: hidden;
    padding: 8px;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1300;
}

.app-searchable-select-search {
    align-items: center;
    border: 1px solid #d7dfe4;
    border-radius: 7px;
    display: flex;
    gap: 8px;
    padding: 0 11px;
}

.app-searchable-select-search i {
    color: #74818a;
}

.app-searchable-select-search input {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #182026 !important;
    font-size: .9rem !important;
    height: 40px !important;
    min-width: 0;
    outline: none !important;
    padding: 0 !important;
    width: 100%;
}

.app-searchable-select-options {
    display: grid;
    gap: 3px;
    margin-top: 6px;
    max-height: 224px;
    overflow-y: auto;
}

.app-searchable-select-option {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #34414a;
    display: flex;
    font-size: .9rem;
    font-weight: 700;
    justify-content: space-between;
    min-height: 39px;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.app-searchable-select-option:hover,
.app-searchable-select-option.is-active {
    background: #edf6fc;
}

.app-searchable-select-option.is-selected {
    background: rgba(19, 148, 255, .12);
    color: #087ac8;
}

.app-searchable-select-empty {
    color: #7c8992;
    font-size: .86rem;
    font-weight: 700;
    margin: 12px 8px 6px;
    text-align: center;
}

.dark .app-searchable-select-trigger,
.dark .app-searchable-select-panel {
    background: #101516;
    border-color: #343c3f;
    color: #f3f6f7;
}

.dark .app-searchable-select-panel {
    box-shadow: 0 16px 42px rgba(0, 0, 0, .42);
}

.dark .app-searchable-select-search {
    border-color: #343c3f;
}

.dark .app-searchable-select-search input {
    color: #f3f6f7 !important;
}

.dark .app-searchable-select-option {
    color: #cbd4d9;
}

.dark .app-searchable-select-option:hover,
.dark .app-searchable-select-option.is-active {
    background: #20292c;
}

.dark .app-searchable-select-option.is-selected {
    background: rgba(19, 148, 255, .18);
    color: #58b7f8;
}

.app-copyright {
    align-items: center;
    border-top: 1px solid #dce3e7;
    color: #687780;
    display: flex;
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 500;
    justify-content: center;
    margin-top: 48px;
    min-height: 64px;
    padding: 16px 24px;
    text-align: center;
    width: 100%;
}

.app-copyright p {
    margin: 0;
}

.dark .app-copyright {
    border-top-color: #2c3335;
    color: #8f9ba1;
}

.auth-body .app-copyright {
    border-top: 0;
    bottom: 0;
    color: #8f9ba1;
    left: 0;
    margin: 0;
    min-height: 26px;
    padding: 4px 24px;
    pointer-events: none;
    position: fixed;
    z-index: 20;
}

.app-primary-nav {
    display: flex;
    gap: 1.75rem;
    overflow: visible;
}

.app-mobile-nav-toggle,
.app-mobile-nav-backdrop,
.app-mobile-nav-header,
.app-primary-nav-icon {
    display: none;
}

@media (max-width: 767px) {
    .app-page-header-inner {
        padding-top: 28px !important;
    }

    .app-mobile-nav-toggle {
        align-items: center;
        background: rgba(255, 255, 255, .12);
        border: 1px solid rgba(255, 255, 255, .35);
        border-radius: 8px;
        color: #fff;
        display: inline-flex;
        font-size: 14px;
        font-weight: 800;
        gap: 8px;
        margin-top: 24px;
        min-height: 46px;
        padding: 8px 16px;
    }

    .app-mobile-nav-toggle .bi {
        font-size: 22px;
    }

    .app-mobile-nav-backdrop {
        background: rgba(4, 8, 9, .68);
        border: 0;
        display: block;
        inset: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        transition: opacity .24s ease, visibility .24s ease;
        visibility: hidden;
        z-index: 60;
    }

    .app-mobile-nav-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    body.app-mobile-nav-open {
        overflow: hidden;
    }

    .app-primary-nav {
        background: #fff;
        bottom: 0;
        box-shadow: 18px 0 48px rgba(0, 0, 0, .28);
        color: #34414a !important;
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        left: 0;
        margin: 0 !important;
        max-width: 320px;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 18px 14px calc(24px + env(safe-area-inset-bottom));
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform .28s ease, visibility .28s ease;
        visibility: hidden;
        width: min(86vw, 320px);
        z-index: 70;
    }

    .app-primary-nav.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .app-mobile-nav-header {
        align-items: center;
        border-bottom: 1px solid #e0e6e9;
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
        min-height: 68px;
        padding: 2px 4px 14px 8px;
    }

    .app-mobile-nav-header div {
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }

    .app-mobile-nav-header span {
        color: #77858d;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .app-mobile-nav-header strong {
        color: #111516;
        font-size: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-mobile-nav-close {
        align-items: center;
        background: transparent;
        border: 1px solid #d8e0e4;
        border-radius: 50%;
        color: #45535b;
        display: inline-flex;
        flex: 0 0 40px;
        height: 40px;
        justify-content: center;
        width: 40px;
    }

    .app-primary-nav-link {
        align-items: center;
        border: 0 !important;
        border-radius: 6px;
        color: #53626b !important;
        display: flex;
        font-weight: 700;
        gap: 12px;
        min-height: 48px;
        overflow: hidden;
        padding: 11px 12px !important;
        width: 100%;
    }

    .app-primary-nav-link:hover {
        background: #edf6fc;
    }

    .app-primary-nav-link.is-active {
        background: rgba(19, 148, 255, .12);
        color: #087ac8 !important;
    }

    .app-primary-nav-icon {
        display: inline-flex;
        flex: 0 0 22px;
        font-size: 19px;
        justify-content: center;
    }

    .app-primary-nav-label {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dark .app-mobile-nav-toggle {
        background: #151a1b;
        border-color: #394245 !important;
    }

    .dark .app-primary-nav {
        background: #151a1b;
        color: #cbd4d9 !important;
    }

    .dark .app-mobile-nav-header {
        border-bottom-color: #30383b;
    }

    .dark .app-mobile-nav-header strong {
        color: #fff;
    }

    .dark .app-mobile-nav-close {
        border-color: #394245;
        color: #dbe2e5;
    }

    .dark .app-primary-nav-link {
        color: #aeb9bf !important;
    }

    .dark .app-primary-nav-link:hover {
        background: #20292c;
    }

    .dark .app-primary-nav-link.is-active {
        background: rgba(19, 148, 255, .16);
        color: #58b7f8 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-mobile-nav-backdrop,
    .app-primary-nav {
        transition: none;
    }
}

@media (max-width: 420px) {
    .app-topbar-inner {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .app-topbar-logo {
        height: auto !important;
        max-width: 145px;
        width: 40vw !important;
    }

    .app-topbar-actions {
        gap: 8px !important;
    }

    .app-topbar-button {
        height: 38px !important;
        min-height: 38px;
        min-width: 38px;
        width: 38px !important;
    }
}

/* Keep headings readable on phones regardless of the page-specific stylesheet. */
@media (max-width: 767px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    h1:not(.student-trail-reading-article *):not(.ql-editor *),
    h2:not(.text-4xl):not(.text-5xl):not(.student-trail-reading-article *):not(.ql-editor *),
    h3:not(.student-trail-reading-article *):not(.ql-editor *) {
        letter-spacing: 0 !important;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    h1:not(.student-trail-reading-article *):not(.ql-editor *) {
        font-size: 1.875rem !important;
        line-height: 1.18 !important;
    }

    h2:not(.text-4xl):not(.text-5xl):not(.student-trail-reading-article *):not(.ql-editor *) {
        font-size: 1.5rem !important;
        line-height: 1.22 !important;
    }

    h3:not(.student-trail-reading-article *):not(.ql-editor *) {
        font-size: 1.25rem !important;
        line-height: 1.28 !important;
    }
}

@media (max-width: 420px) {
    h1:not(.student-trail-reading-article *):not(.ql-editor *) {
        font-size: 1.625rem !important;
    }

    h2:not(.text-4xl):not(.text-5xl):not(.student-trail-reading-article *):not(.ql-editor *) {
        font-size: 1.375rem !important;
    }

    h3:not(.student-trail-reading-article *):not(.ql-editor *) {
        font-size: 1.125rem !important;
    }
}
