.topbar-menu-toggle,
.topbar-drawer-header,
.topbar-drawer-backdrop {
    display: none;
}

.topbar-header-actions {
    display: none;
}

@media (min-width: 1201px) {
    html body .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
    }

    html body .topbar > .brand {
        grid-column: 1;
        justify-self: start;
    }

    html body .topbar .topbar-drawer {
        display: contents;
    }

    html body .topbar .topbar-menu-toggle,
    html body .topbar .topbar-drawer-header,
    html body .topbar .topbar-drawer-backdrop {
        display: none;
    }
}

@media (min-width: 1201px) {
    html body .topbar .topbar-nav {
        grid-column: 2;
        justify-self: center;
        flex: 0 1 auto;
        justify-content: center;
        gap: 5px;
        min-width: 0;
    }

    html body .topbar .topbar-actions {
        grid-column: 3;
        justify-self: end;
        flex: 0 0 auto;
        justify-content: flex-end;
        min-width: 0;
        flex-wrap: wrap;
    }

    html body .topbar .topbar-nav a {
        padding-inline: 3px;
        font-size: .76rem;
    }
}

@media (max-width: 1200px) {
    html body .topbar {
        display: grid;
        grid-template-columns: 40px max-content minmax(0, 1fr);
        grid-template-rows: auto;
        align-items: center;
        column-gap: 8px;
        width: calc(100% - 24px);
        margin: 8px auto 0;
        padding: 6px 10px;
        border-radius: 20px;
        transform: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    html body .topbar:hover {
        transform: none;
    }

    html body .topbar > .brand {
        grid-column: 2;
        grid-row: 1;
        justify-self: start;
        max-width: 100%;
        min-width: 0;
        gap: 12px;
        justify-content: flex-start;
    }

    html body .topbar .topbar-menu-toggle {
        grid-column: 1;
        grid-row: 1;
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }

    html body .topbar .topbar-header-actions {
        grid-column: 3;
        grid-row: 1;
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 4px;
        min-width: 0;
        max-width: 100%;
        padding-top: 0;
        justify-self: end;
    }

    html body .topbar > .brand .brand-wordmark {
        width: 187px;
        max-width: min(187px, 43vw);
        flex: 0 1 187px;
    }

    html body .topbar > .brand .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    html body .topbar .topbar-header-actions > a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        box-sizing: border-box;
        padding: 6px 8px;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 9999px;
        color: #fff;
        background: rgba(255, 255, 255, .12);
        font-size: .72rem;
        font-weight: 800;
        text-decoration: none;
        white-space: nowrap;
    }

    html body .topbar .topbar-header-actions > a:focus-visible,
    html body .topbar .topbar-header-actions .lang-pill:focus-visible {
        outline: 3px solid #38bdf8;
        outline-offset: 3px;
    }

    html body .topbar .topbar-header-actions > a.topbar-header-download {
        width: 34px;
        flex: 0 0 34px;
        padding: 0;
    }

    html body .topbar .topbar-header-actions .language-switch {
        flex: 0 0 auto;
        align-items: center;
        gap: 4px;
        padding: 0;
        background: transparent;
    }

    html body .topbar .topbar-header-actions .language-switch .lang-pill {
        min-width: 0;
        min-height: 0;
        justify-content: center;
        padding: 0;
        border-radius: 0;
        color: rgba(255, 255, 255, .68);
        background: transparent;
        font-size: .64rem;
        font-weight: 700;
        line-height: 1;
    }

    html body .topbar .topbar-header-actions .language-switch .lang-pill.active {
        color: #fff;
        background: transparent;
        box-shadow: none;
        font-weight: 900;
    }

    html body .topbar .topbar-header-actions .topbar-header-admin-link {
        flex: 0 0 auto;
        padding-inline: 7px;
    }

    html body .topbar .topbar-drawer {
        display: flex;
        flex: 0 0 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    html body .topbar .topbar-menu-toggle {
        flex: 0 0 40px;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, .24);
        border-radius: 12px;
        color: #fff;
        background: rgba(255, 255, 255, .12);
        cursor: pointer;
    }

    html body .topbar .topbar-menu-toggle:focus-visible,
    html body .topbar .topbar-menu-close:focus-visible {
        outline: 3px solid #38bdf8;
        outline-offset: 3px;
    }

    body.nd-topbar-drawer-ready .topbar .topbar-menu-toggle {
        display: inline-flex;
    }

    html body .topbar.is-menu-open {
        z-index: 1003;
    }

    body.nd-topbar-drawer-ready .topbar .topbar-drawer {
        position: fixed;
        z-index: 1002;
        inset-block: 0;
        left: 0;
        right: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 20px;
        box-sizing: border-box;
        width: min(88vw, 360px);
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
        border: 0;
        border-radius: 0;
        color: #0f172a;
        background: linear-gradient(180deg, #eef8f6 0%, #f8fafc 52%, #f8fafc 100%);
        box-shadow: 0 0 36px rgba(2, 6, 23, .2);
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform .24s ease, visibility .24s ease;
    }

    html[dir="rtl"] body.nd-topbar-drawer-ready .topbar .topbar-drawer {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    html body .topbar.is-menu-open .topbar-drawer {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    html[dir="rtl"] body.nd-topbar-drawer-ready .topbar.is-menu-open .topbar-drawer {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    body.nd-topbar-drawer-ready .topbar .topbar-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        gap: 12px;
        padding: 10px 12px;
        border: 1px solid rgba(255, 255, 255, .16);
        border-radius: 16px;
        background: linear-gradient(135deg, #0b7a72, #0f766e 52%, #115e59);
        box-shadow: 0 10px 24px rgba(15, 118, 110, .18);
    }

    html body .topbar .topbar-drawer-brand {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        min-width: 0;
        gap: 8px;
        text-decoration: none;
    }

    html body .topbar .topbar-drawer-brand-icon {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        border-radius: 11px;
        object-fit: cover;
    }

    html body .topbar .topbar-drawer-brand-wordmark {
        display: block;
        flex: 0 1 148px;
        width: 148px;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

    html body .topbar .topbar-menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        flex: 0 0 40px;
        border: 1px solid rgba(255, 255, 255, .26);
        border-radius: 12px;
        color: #fff;
        background: rgba(255, 255, 255, .12);
        cursor: pointer;
    }

    html body .topbar .topbar-menu-close:hover {
        background: rgba(255, 255, 255, .2);
    }

    html body .topbar .topbar-nav {
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: none;
        min-width: 0;
        justify-content: flex-start;
        gap: 6px;
    }

    html body .topbar .topbar-nav a {
        display: flex;
        justify-content: flex-start;
        width: 100%;
        min-height: 44px;
        box-sizing: border-box;
        padding: 10px 12px;
        border: 1px solid rgba(15, 118, 110, .08);
        border-radius: 12px;
        color: #1e293b;
        background: rgba(255, 255, 255, .88);
        font-size: .92rem;
        white-space: normal;
        box-shadow: 0 2px 6px rgba(15, 23, 42, .03);
    }

    html body .topbar .topbar-nav a:hover,
    html body .topbar .topbar-nav a.is-active {
        color: #0f766e;
        border-color: rgba(15, 118, 110, .18);
        background: rgba(20, 125, 120, .1);
    }

    html body .topbar .topbar-nav a.topbar-school-link {
        color: #fff;
        border-color: transparent;
        background: linear-gradient(135deg, #0284c7, #0f766e);
        box-shadow: 0 8px 22px rgba(15, 118, 110, .18);
    }

    html body .topbar .topbar-nav a.topbar-school-link:hover,
    html body .topbar .topbar-nav a.topbar-school-link.is-active {
        color: #fff;
        border-color: transparent;
        background: linear-gradient(135deg, #0ea5e9, #14b8a6);
        box-shadow: 0 12px 28px rgba(15, 118, 110, .24);
    }

    html body .topbar .topbar-actions {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: none;
        gap: 10px;
    }

    html body .topbar .topbar-actions > a {
        justify-content: center;
        min-height: 44px;
        box-sizing: border-box;
    }

    html body .topbar .topbar-actions > a.topbar-app-link {
        width: 100%;
        height: 44px;
        flex-basis: 44px;
        padding: 0;
        color: #0f766e;
        background: #ecfdf5;
    }

    html body .topbar .language-switch {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-self: stretch;
        width: 100%;
        gap: 8px;
        padding: 0;
        background: transparent;
    }

    html body .topbar .language-switch .lang-pill {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        box-sizing: border-box;
        padding: 10px 12px;
        border: 1px solid rgba(15, 118, 110, .08);
        border-radius: 12px;
        color: #1e293b;
        background: rgba(255, 255, 255, .88);
        font-size: .92rem;
        box-shadow: 0 2px 6px rgba(15, 23, 42, .03);
    }

    html body .topbar .language-switch .lang-pill.active {
        color: #0f766e;
        border-color: rgba(15, 118, 110, .18);
        background: rgba(20, 125, 120, .1);
        box-shadow: none;
    }

    body.nd-topbar-drawer-ready .topbar .topbar-drawer-backdrop {
        position: fixed;
        z-index: 1001;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(2, 6, 23, .52);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .24s ease, visibility .24s ease;
    }

    html body .topbar.is-menu-open .topbar-drawer-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.nd-topbar-menu-open {
        overflow: hidden;
    }

}

@media (max-width: 480px) {
    html body .topbar {
        grid-template-columns: 34px max-content minmax(0, 1fr);
        column-gap: 6px;
        width: calc(100% - 16px);
        padding-inline: 8px;
    }

    html body .topbar .topbar-menu-toggle {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    html body .topbar > .brand {
        gap: 12px;
    }

    html body .topbar > .brand .brand-mark {
        display: block;
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    html body .topbar > .brand .brand-wordmark {
        width: 187px;
        max-width: min(187px, 43vw);
        flex-basis: 187px;
    }

    html body .topbar .topbar-header-actions {
        gap: 3px;
    }

    html body .topbar .topbar-header-actions > .topbar-header-download,
    html body .topbar .topbar-header-actions > .topbar-header-admin-link {
        display: none;
    }

    html body .topbar .topbar-header-actions > a {
        min-height: 32px;
        padding-inline: 5px;
        font-size: .66rem;
    }

    html body .topbar .topbar-header-actions > a.topbar-header-download {
        width: 32px;
        flex-basis: 32px;
    }

    html body .topbar .topbar-header-actions .language-switch .lang-pill {
        font-size: .62rem;
    }
}

@media (max-width: 1200px) and (prefers-reduced-motion: reduce) {
    body.nd-topbar-drawer-ready .topbar .topbar-drawer,
    body.nd-topbar-drawer-ready .topbar .topbar-drawer-backdrop {
        transition: none;
    }
}

