/**
 * Mobile header + sidebar navigation polish (public site + dashboard)
 */

.eman-mobile-drawer__search,
.eman-dash-sidebar__search {
    display: none;
}

/* Lock page scroll while mobile drawer is open — do not use touch-action:none
   on html/body; WebKit can keep swallowing taps after the next navigation. */
html.eman-mobile-nav-open,
body.eman-mobile-nav-open {
    overflow: hidden !important;
}

/* ══════════════════════════════════════════════════════
   Public site header (-type-4)
   ══════════════════════════════════════════════════════ */
@media (max-width: 1199px) {
    .header.-type-4 {
        z-index: 150;
        padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
    }

    .header.-type-4 .header__container {
        padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
        padding-bottom: 8px !important;
    }

    .header.-type-4 .header-right__icons > div {
        display: block !important;
    }

    .header.-type-4 .header-right__icons button[data-el-toggle=".js-mobile-menu-toggle"] {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        border-radius: 12px;
        background: rgba(106, 27, 154, 0.08);
        transition: background 0.2s ease;
    }

    .header.-type-4 .header-right__icons button[data-el-toggle=".js-mobile-menu-toggle"]:hover {
        background: rgba(106, 27, 154, 0.14);
    }

    .header.-type-4 .header-right__icons .icon-mobile-menu {
        font-size: 20px;
        color: var(--eman-purple);
    }

    .header.-type-4 .eman-header-actions {
        gap: 6px;
    }

    .header.-type-4 .eman-header-actions .eman-lesson-search-wrap {
        display: none;
    }

    .eman-mobile-drawer__search {
        display: block;
        padding: 10px 14px 8px;
        flex-shrink: 0;
        border-bottom: 1px solid rgba(106, 27, 154, 0.08);
    }

    .eman-mobile-drawer__search .eman-lesson-search-wrap,
    .eman-mobile-drawer__search .eman-lesson-search {
        display: block;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .eman-mobile-drawer__search .eman-lesson-search__input {
        min-height: 44px;
        font-size: 16px;
    }

    .eman-mobile-drawer__search .eman-lesson-search__panel {
        position: relative;
        top: 8px;
        max-height: 240px;
        z-index: 5;
    }

    /* Drawer: full-screen shell so overlay never sits on top of the panel */
    .header.-type-4 .header-menu {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 200 !important;
        height: 100dvh !important;
        height: 100vh !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    html[dir="rtl"] .header.-type-4 .header-menu,
    html[dir="ltr"] .header.-type-4 .header-menu {
        left: 0 !important;
        right: 0 !important;
    }

    .header.-type-4 .header-menu .header-menu__content {
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 2;
        width: min(300px, 86vw);
        max-width: calc(100vw - 56px);
        background: #fff;
        padding-top: max(6px, env(safe-area-inset-top, 0px));
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
        height: 100%;
        max-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-shadow: 10px 0 36px rgba(15, 23, 42, 0.18);
        pointer-events: auto !important;
    }

    /* Closed drawer stays in the DOM at 100vw×100vh. Children with
       pointer-events:auto still receive taps (opacity:0 is not enough). */
    .header.-type-4 .header-menu:not(.-is-el-visible) {
        pointer-events: none !important;
        visibility: hidden;
    }

    .header.-type-4 .header-menu:not(.-is-el-visible) .header-menu__content,
    .header.-type-4 .header-menu:not(.-is-el-visible) .header-menu-bg,
    .header.-type-4 .header-menu:not(.-is-el-visible) * {
        pointer-events: none !important;
    }

    .header.-type-4 .header-menu.-is-el-visible {
        pointer-events: auto !important;
        visibility: visible;
    }

    html[dir="ltr"] .header.-type-4 .header-menu .header-menu__content {
        left: 0;
        right: auto;
        border-radius: 0 20px 20px 0;
    }

    html[dir="rtl"] .header.-type-4 .header-menu .header-menu__content {
        right: 0;
        left: auto;
        border-radius: 20px 0 0 20px;
        box-shadow: -10px 0 36px rgba(15, 23, 42, 0.18);
    }

    .header.-type-4 .header-menu .header-menu-bg {
        position: absolute !important;
        inset: 0 !important;
        z-index: 1 !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: rgba(17, 12, 28, 0.42) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }

    .header.-type-4 .header-menu.-is-el-visible .header-menu-bg {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .header.-type-4 .header-menu:not(.-is-el-visible) .header-menu-bg {
        opacity: 0 !important;
        pointer-events: none !important;
        visibility: hidden !important;
    }

    /* Hide legacy floating close */
    .header.-type-4 .header-menu-close,
    .header.-type-4 .header-menu.-is-el-visible .header-menu-close {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Drawer top bar */
    .eman-mobile-drawer__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 14px;
        border-bottom: 1px solid rgba(106, 27, 154, 0.08);
        flex-shrink: 0;
    }

    .eman-mobile-drawer__brand {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        text-decoration: none !important;
        color: #2e1065 !important;
        font-weight: 750;
        font-size: 0.92rem;
        letter-spacing: -0.01em;
    }

    .eman-mobile-drawer__brand img {
        width: 30px;
        height: 30px;
        flex-shrink: 0;
        display: block;
    }

    .eman-mobile-drawer__brand span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .eman-mobile-drawer__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
        border: 1px solid rgba(106, 27, 154, 0.14);
        border-radius: 11px;
        background: rgba(106, 27, 154, 0.05);
        color: var(--eman-purple, #6a1b9a);
        cursor: pointer;
        transition: background 0.15s ease, border-color 0.15s ease;
    }

    .eman-mobile-drawer__close:hover,
    .eman-mobile-drawer__close:focus-visible {
        background: rgba(106, 27, 154, 0.12);
        border-color: rgba(106, 27, 154, 0.3);
        outline: none;
    }

    .eman-mobile-drawer__close svg,
    .eman-mobile-drawer__close i {
        width: 18px;
        height: 18px;
        stroke-width: 2.4;
    }

    /* Auth / account block */
    .header.-type-4 .mobile-user-links {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px 14px !important;
        border-bottom: 1px solid rgba(106, 27, 154, 0.08);
        background: #fff;
    }

    .eman-mobile-drawer__lang {
        margin-bottom: 0;
        width: 100%;
    }

    .header.-type-4 .mobile-user-links a.eman-lang-btn,
    .header.-type-4 .mobile-user-links .eman-lang-switcher a {
        display: inline-flex !important;
        width: auto;
        flex: 1 1 0;
        min-height: 44px !important;
        padding: 6px 14px !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 999px !important;
        justify-content: center !important;
        font-size: 14px !important;
        font-weight: 750 !important;
        color: #5c4b6e !important;
        box-shadow: none !important;
    }

    .header.-type-4 .mobile-user-links a.eman-lang-btn.is-active,
    .header.-type-4 .mobile-user-links a.eman-lang-btn[aria-current="true"] {
        background: var(--eman-purple, #6a1b9a) !important;
        color: #fff !important;
        box-shadow: 0 4px 12px rgba(106, 27, 154, 0.28) !important;
    }

    .header.-type-4 .mobile-user-links a:not(.eman-lang-btn) {
        display: flex !important;
        align-items: center;
        gap: 10px;
        min-height: 44px !important;
        padding: 8px 10px !important;
        margin: 0 !important;
        border-radius: 12px !important;
        border: 0 !important;
        border-bottom: none !important;
        font-size: 0.9rem !important;
        font-weight: 650 !important;
        color: #3b0764 !important;
        text-decoration: none !important;
        transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    }

    .header.-type-4 .mobile-user-links a:not(.eman-lang-btn):hover {
        background: rgba(106, 27, 154, 0.07);
        color: var(--eman-purple) !important;
    }

    .eman-mobile-drawer__auth-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px;
        width: 100%;
    }

    .eman-mobile-drawer__auth-row.is-single {
        grid-template-columns: 1fr !important;
    }

    .header.-type-4 .mobile-user-links a.eman-mobile-drawer__auth {
        justify-content: center !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 44px !important;
        padding: 8px 6px !important;
        border-radius: 14px !important;
        font-size: 0.8rem !important;
        font-weight: 800 !important;
        letter-spacing: -0.01em;
        gap: 6px !important;
        white-space: nowrap;
    }

    .eman-mobile-drawer__auth-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        height: auto;
        background: none !important;
        border: 0 !important;
        border-radius: 0;
        padding: 0;
        flex-shrink: 0;
    }

    .eman-mobile-drawer__auth-icon .lucide-icon,
    .eman-mobile-drawer__auth-icon svg,
    .header.-type-4 .mobile-user-links a.eman-mobile-drawer__auth .lucide-icon {
        width: 17px !important;
        height: 17px !important;
        stroke-width: 2.25;
        background: none !important;
        color: inherit !important;
    }

    .header.-type-4 .mobile-user-links a.eman-mobile-drawer__auth--login {
        border: 1px solid rgba(106, 27, 154, 0.2) !important;
        background: #f6f0fa !important;
        color: var(--eman-purple, #6a1b9a) !important;
        box-shadow: none !important;
    }

    .eman-mobile-drawer__auth--login .eman-mobile-drawer__auth-icon {
        background: none;
        color: inherit;
    }

    .header.-type-4 .mobile-user-links a.eman-mobile-drawer__auth--login:hover {
        background: #efe6f6 !important;
        border-color: rgba(106, 27, 154, 0.32) !important;
    }

    .header.-type-4 .mobile-user-links a.eman-mobile-drawer__auth--signup {
        background: var(--eman-purple, #6a1b9a) !important;
        border: 1px solid var(--eman-purple, #6a1b9a) !important;
        color: #fff !important;
        box-shadow: 0 8px 18px rgba(106, 27, 154, 0.24) !important;
    }

    .eman-mobile-drawer__auth--signup .eman-mobile-drawer__auth-icon {
        background: none;
        color: inherit;
    }

    .header.-type-4 .mobile-user-links a.eman-mobile-drawer__auth--signup:hover {
        background: #5b1786 !important;
        border-color: #5b1786 !important;
        color: #fff !important;
    }

    .header.-type-4 .mobile-user-links a.eman-mobile-drawer__quick {
        justify-content: flex-start !important;
    }

    .header.-type-4 .mobile-user-links a.eman-mobile-drawer__quick--logout {
        color: #b42318 !important;
    }

    .header.-type-4 .mobile-user-links a.eman-mobile-drawer__quick--logout .eman-mobile-drawer__nav-icon {
        background: rgba(180, 35, 24, 0.1);
        color: #b42318;
    }

    /* Nav links — compact, consistent icon chips */
    .header.-type-4 .header-menu .menu {
        height: auto !important;
        flex: 0 0 auto;
        min-height: 0;
        padding: 10px 12px 6px !important;
        overflow: visible;
    }

    .header.-type-4 .header-menu .menu__nav {
        gap: 2px;
        width: 100%;
    }

    .header.-type-4 .header-menu .menu__nav li > a {
        border-radius: 12px !important;
        min-height: 46px;
        padding: 9px 10px !important;
        gap: 12px;
        font-size: 0.94rem;
        font-weight: 650;
        color: #3b0764 !important;
        justify-content: flex-start !important;
        border-bottom: none !important;
    }

    .eman-mobile-drawer__nav-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        border-radius: 10px;
        background: rgba(106, 27, 154, 0.09);
        color: var(--eman-purple, #6a1b9a);
        overflow: visible;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .header.-type-4 .header-menu .menu__nav li {
        overflow: visible !important;
    }

    .header.-type-4 .header-menu a .eman-mobile-drawer__nav-icon .lucide-icon,
    .header.-type-4 .header-menu a .eman-mobile-drawer__nav-icon svg,
    .header.-type-4 .header-menu a .eman-mobile-drawer__nav-icon i,
    .header.-type-4 .mobile-user-links a .eman-mobile-drawer__nav-icon .lucide-icon,
    .header.-type-4 .mobile-user-links a .eman-mobile-drawer__nav-icon svg,
    .header.-type-4 .header-menu .menu__nav li > a .lucide-icon,
    .header.-type-4 .header-menu .menu__nav li > a .eman-mobile-drawer__nav-icon .lucide-icon,
    .header.-type-4 .header-menu .menu__nav li > a .eman-mobile-drawer__nav-icon svg {
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
        flex-shrink: 0;
        stroke-width: 2.25;
        color: inherit !important;
        stroke: currentColor !important;
        fill: none !important;
    }

    .header.-type-4 .header-menu .menu__nav li.is-active > a {
        color: var(--eman-purple) !important;
        background-color: rgba(106, 27, 154, 0.1) !important;
    }

    .header.-type-4 .header-menu .menu__nav li.is-active > a .eman-mobile-drawer__nav-icon,
    .header.-type-4 .header-menu .menu__nav li > a:hover .eman-mobile-drawer__nav-icon {
        background: var(--eman-purple, #6a1b9a);
        color: #fff;
    }

    .header.-type-4 .header-menu .menu__nav li > a:hover {
        background-color: rgba(106, 27, 154, 0.06);
    }

    /* Social footer — sits under nav, no huge empty gap */
    .header.-type-4 .header-menu .mobile-footer,
    .header.-type-4 .header-menu .eman-mobile-drawer__footer {
        display: block !important;
        margin-top: 8px;
        padding: 14px 16px 12px !important;
        border-top: 1px solid rgba(106, 27, 154, 0.08);
        background: #faf8fc;
        flex-shrink: 0;
    }

    .eman-mobile-drawer__footer-label {
        margin: 0 0 10px;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: #64748b;
    }

    .eman-mobile-drawer__social {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .eman-mobile-drawer__social a {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 11px;
        border: 1px solid rgba(106, 27, 154, 0.12) !important;
        background: #fff !important;
        text-decoration: none !important;
        transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }

    .eman-mobile-drawer__social a.is-facebook { color: #1877f2 !important; }
    .eman-mobile-drawer__social a.is-instagram { color: #e4405f !important; }
    .eman-mobile-drawer__social a.is-youtube { color: #ff0000 !important; }
    .eman-mobile-drawer__social a.is-telegram { color: #26a5e4 !important; }
    .eman-mobile-drawer__social a.is-whatsapp { color: #25d366 !important; }

    .eman-mobile-drawer__social a:hover,
    .eman-mobile-drawer__social a:focus-visible {
        color: #fff !important;
        background: var(--eman-purple, #6a1b9a) !important;
        border-color: var(--eman-purple, #6a1b9a) !important;
        transform: translateY(-1px);
        outline: none;
    }

    .eman-mobile-drawer__social a svg {
        display: block;
        width: 15px;
        height: 15px;
        fill: currentColor;
    }
}

@media (max-width: 767px) {
    .header.-type-4 .header__container .row {
        gap: 8px;
    }

    .header.-type-4 .eman-header__logo img {
        height: 34px;
    }

    .header.-type-4 .profile-pill {
        margin-inline-start: 4px;
    }

    .header.-type-4 .header-right__buttons .eman-lang-switcher-wrap {
        display: none;
    }

    .header.-type-4 .header-menu {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .header.-type-4 .header-menu .header-menu__content {
        width: min(300px, 90vw);
        max-width: calc(100vw - 40px);
    }
}

/* Public header — dark mode drawer */
@media (max-width: 1199px) {
    html.-dark-mode .header.-type-4 .header-menu .header-menu__content {
        background: var(--eman-bg, #181f2c);
    }

    html.-dark-mode .eman-mobile-drawer__top {
        border-bottom-color: var(--eman-border-light, #2d3748);
    }

    html.-dark-mode .eman-mobile-drawer__brand {
        color: var(--eman-text-dark, #eef1f6) !important;
    }

    html.-dark-mode .eman-mobile-drawer__close {
        background: var(--eman-bg-subtle, #222a38);
        border-color: var(--eman-border-light, #2d3748);
        color: var(--eman-purple-light, #d4a5e0);
    }

    html.-dark-mode .eman-mobile-drawer__search {
        border-bottom-color: var(--eman-border-light, #2d3748);
    }

    html.-dark-mode .eman-mobile-drawer__search .eman-lesson-search__input {
        background: var(--eman-bg-subtle, #222a38);
        border-color: var(--eman-border-light, #2d3748);
        color: var(--eman-text-dark, #eef1f6);
    }

    html.-dark-mode .header.-type-4 .mobile-user-links {
        background: linear-gradient(180deg, #1c2432 0%, #181f2c 100%);
        border-bottom-color: var(--eman-border-light, #2d3748);
    }

    html.-dark-mode .header.-type-4 .mobile-user-links a:not(.eman-lang-btn):not(.eman-mobile-drawer__auth--signup) {
        color: var(--eman-text-dark, #eef1f6) !important;
    }

    html.-dark-mode .header.-type-4 .mobile-user-links a:not(.eman-lang-btn):hover {
        background: rgba(106, 27, 154, 0.18);
        color: var(--eman-purple-light, #d4a5e0) !important;
    }

    html.-dark-mode .header.-type-4 .mobile-user-links a.eman-mobile-drawer__auth--login {
        background: rgba(212, 165, 224, 0.1) !important;
        border-color: rgba(212, 165, 224, 0.28) !important;
        color: var(--eman-purple-light, #d4a5e0) !important;
    }

    html.-dark-mode .eman-mobile-drawer__auth--login .eman-mobile-drawer__auth-icon {
        background: none;
        color: inherit;
    }

    html.-dark-mode .header.-type-4 .mobile-user-links a.eman-mobile-drawer__auth--signup:hover {
        color: #fff !important;
    }

    html.-dark-mode .header.-type-4 .header-menu .menu__nav li > a {
        color: var(--eman-text-light, #c5cdd9) !important;
    }

    html.-dark-mode .eman-mobile-drawer__nav-icon {
        background: rgba(212, 165, 224, 0.12);
        color: var(--eman-purple-light, #d4a5e0);
    }

    html.-dark-mode .header.-type-4 .header-menu .menu__nav li.is-active > a,
    html.-dark-mode .header.-type-4 .header-menu .menu__nav li > a:hover {
        background: rgba(106, 27, 154, 0.18);
        color: var(--eman-purple-light, #d4a5e0) !important;
    }

    html.-dark-mode .header.-type-4 .header-menu .eman-mobile-drawer__footer {
        border-top-color: var(--eman-border-light, #2d3748);
    }

    html.-dark-mode .eman-mobile-drawer__social a {
        background: #0f172a !important;
        border-color: #334155 !important;
    }
}

/* ══════════════════════════════════════════════════════
   Dashboard header + sidebar
   ══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    .header.-dashboard {
        z-index: 130;
        overflow: visible;
        padding-inline: max(10px, env(safe-area-inset-left, 0px)) max(10px, env(safe-area-inset-right, 0px));
        padding-top: env(safe-area-inset-top, 0px);
    }

    .header.-dashboard .header__container {
        gap: 8px;
        overflow: visible;
    }

    .header.-dashboard .header__container > .d-flex:first-child {
        min-width: 0;
        flex: 1 1 auto;
        gap: 8px;
        overflow: visible;
    }

    .header.-dashboard .mobile-menu-trigger {
        flex-shrink: 0;
        border-radius: 12px;
        background: rgba(106, 27, 154, 0.08);
        color: var(--eman-purple);
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }

    .header.-dashboard .mobile-menu-trigger:hover {
        background: rgba(106, 27, 154, 0.14);
    }

    .header.-dashboard .header-actions {
        flex-shrink: 0;
        gap: 4px;
        overflow: visible !important;
    }

    .header.-dashboard .header-actions .eman-lesson-search-wrap {
        display: none;
    }

    .eman-dash-sidebar__search {
        display: block;
        padding: 0 2px 12px;
    }

    .eman-dash-sidebar__search .eman-lesson-search-wrap,
    .eman-dash-sidebar__search .eman-lesson-search {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .eman-dash-sidebar__search .eman-lesson-search__input {
        min-height: 44px;
        font-size: 16px;
        background: var(--color-bg-main, #fff);
        border-color: var(--color-border-primary, #e5e7eb);
        color: var(--color-text-primary, #111827);
    }

    .eman-dash-sidebar__search .eman-lesson-search__icon {
        color: var(--eman-purple, #6a1b9a);
    }

    .eman-dash-sidebar__search .eman-lesson-search__panel {
        position: relative;
        top: 8px;
        max-height: 220px;
    }

    .header.-dashboard .header-actions .js-darkmode-toggle {
        display: flex;
    }

    .header.-dashboard .eman-dash-alerts-wrap {
        display: flex;
        position: relative;
        z-index: 5;
        overflow: visible;
    }

    /* Sidebar drawer — full-height sheet from inline-start */
    .eman-dashboard .dashboard__sidebar.eman-dash-sidebar {
        top: var(--eman-dash-header-h, 64px) !important;
        bottom: 0 !important;
        height: auto !important;
        max-height: none !important;
        width: min(320px, 86vw) !important;
        padding: 0 !important;
        border-inline-end: 1px solid var(--color-border-primary) !important;
        border-start-end-radius: 16px;
        border-end-end-radius: 16px;
        border-start-start-radius: 0;
        border-end-start-radius: 0;
        box-shadow: 8px 0 40px rgba(15, 23, 42, 0.2);
        z-index: 140 !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }

    html[dir="rtl"] .eman-dashboard .dashboard__sidebar.eman-dash-sidebar {
        box-shadow: -8px 0 40px rgba(15, 23, 42, 0.2);
    }

    .eman-dash-sidebar__inner {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 12px 12px calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .eman-dash-sidebar__label {
        display: none;
    }

    .eman-dash-sidebar__close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-inline-start: auto;
        margin-bottom: 8px;
        border: 0;
        border-radius: 12px;
        background: var(--color-bg-main);
        color: var(--color-text-secondary);
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .eman-dash-sidebar__close:hover {
        background: rgba(106, 27, 154, 0.1);
        color: var(--eman-purple);
    }

    .eman-dash-sidebar__close .lucide-icon,
    .eman-dash-sidebar__close svg {
        width: 22px;
        height: 22px;
    }

    .eman-dash-sidebar__topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 4px;
        padding: 4px 2px 0;
    }

    .eman-dash-sidebar__topbar-label {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--color-text-secondary);
    }

    .eman-dash-sidebar__link {
        min-height: 48px;
        padding: 12px 14px !important;
        border-radius: 12px !important;
        font-size: 0.95rem;
    }

    .eman-dash-sidebar__icon {
        width: 36px !important;
        height: 36px !important;
    }

    .eman-dash-sidebar__nav {
        flex: 1 1 auto;
        gap: 6px;
    }

    .eman-dash-sidebar__footer {
        margin-top: auto;
        flex-shrink: 0;
        padding-top: 12px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .eman-dash-sidebar__profile {
        flex-shrink: 0;
    }

    .eman-dashboard .js-dashboard-home-9.-is-sidebar-hidden .dashboard__main::after,
    .eman-dashboard .dashboard.-home-9.-is-sidebar-hidden .dashboard__main::after,
    body.eman-dash-sidebar-open .eman-dashboard .dashboard.-home-9.-is-sidebar-hidden .dashboard__main::after {
        pointer-events: none !important;
        opacity: 0 !important;
        display: none !important;
    }

    .eman-dashboard .js-dashboard-home-9:not(.-is-sidebar-hidden) .dashboard__main::after {
        display: block !important;
        pointer-events: auto !important;
        opacity: 1 !important;
        z-index: 125 !important;
        background-color: rgba(15, 19, 25, 0.5) !important;
        backdrop-filter: blur(2px);
    }
}

@media (min-width: 992px) {
    .eman-dash-sidebar__close,
    .eman-dash-sidebar__topbar {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .header.-dashboard {
        height: auto;
        min-height: 56px;
    }

    .header.-dashboard .header-actions .action-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        padding: 8px;
    }

    .header.-dashboard .header-actions .eman-lang-switcher-wrap,
    .header.-dashboard .eman-dash-header-lang,
    .header.-dashboard .eman-lang-switcher {
        display: none !important;
    }

    .header.-dashboard .profile-pill img {
        width: 36px;
        height: 36px;
    }
}

/* Dashboard dark mode — mobile drawer */
@media (max-width: 991px) {
    html.-dark-mode .header.-dashboard .mobile-menu-trigger {
        background: rgba(106, 27, 154, 0.2);
        color: var(--eman-purple-light, #d4a5e0);
    }

    html.-dark-mode .eman-dashboard .dashboard__sidebar.eman-dash-sidebar {
        background: var(--eman-bg, #181f2c) !important;
        border-color: var(--eman-border-light, #2d3748) !important;
    }

    html.-dark-mode .eman-dash-sidebar__close {
        background: var(--eman-bg-subtle, #222a38);
        color: var(--eman-text-light, #c5cdd9);
    }
}

/* Desktop: hide mobile-only drawer chrome */
@media (min-width: 1200px) {
    .eman-mobile-drawer__top,
    .eman-mobile-drawer__footer {
        display: none !important;
    }
}
