        :root{
            --primary: #0B1F3A;
            --header-bg: var(--primary);
            --primary-2: #123B68;
            --primary-gradient: linear-gradient(135deg, #071A2F, #0B1F3A, #123B68);
            --surface-dark: #050505;
            --surface-dark-2: #0B0B0B;
            --primary-green: var(--primary);
            --primary-green-dark: var(--primary-2);
            --fresh-green: #2563EB;
            --page-gray: #FFFFFF;
            --soft-orange: #8AA4C8;
            --line: #D6DEE8;
            --line-strong: #CBD5E1;
            --muted: #64748B;
            --light-beige: #0B0B0B;
            --card: #FFFFFF;
            --shadow-soft: 0 14px 34px rgba(7, 26, 47, 0.10);
            --shadow-strong: 0 24px 70px rgba(7, 26, 47, 0.24);
        }

        *{
            box-sizing: border-box;
        }

        html{
            direction: rtl;
            background: var(--header-bg);
            -webkit-text-size-adjust: 100%;
        }

        body{
            margin: 0;
            background: #FFFFFF !important;
            color: var(--text-dark);
            font-family: "IBM Plex Sans Arabic", "Tajawal", "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
            font-weight: 600;
            letter-spacing: 0;
            overflow-x: hidden;
        }

        body.no-scroll{
            overflow-x: hidden;
        }

        body .messages:not(.messages-page){
            position: fixed !important;
            top: 12px;
            right: 50%;
            transform: translateX(50%);
            z-index: 3000;
            width: min(92vw, 520px);
            margin: 0 !important;
            display: grid;
            gap: 8px;
            pointer-events: none;
            animation: siteMessageIn .22s ease both;
        }

        body .messages:not(.messages-page).is-hiding{
            opacity: 0;
            transform: translateX(50%) translateY(-10px);
            transition: opacity .25s ease, transform .25s ease;
        }

        body .messages:not(.messages-page) .message{
            padding: 12px 14px;
            border: 1px solid #D6E4F2;
            border-radius: 14px;
            background: #F8FBFF;
            color: #123B68;
            box-shadow: 0 14px 34px rgba(7, 26, 47, 0.14);
            font-size: 14px;
            font-weight: 900;
            line-height: 1.7;
        }

        body .messages:not(.messages-page) .message.success{
            background: #EEF8F2;
            color: #166534;
            border-color: #CDEBD8;
        }

        body .messages:not(.messages-page) .message.error{
            background: #FFF5F5;
            color: #B42318;
            border-color: #F5CACA;
        }

        body .messages:not(.messages-page) .message.warning{
            background: #FFF9EB;
            color: #8A5A12;
            border-color: #F2D99D;
        }

        .user-identity-avatar{
            width: 92px;
            height: 92px;
            aspect-ratio: 1 / 1;
            border-radius: 50%;
            display: grid;
            place-items: center;
            overflow: hidden;
            background: linear-gradient(145deg, #DCE7F1, #FFFFFF);
            color: #123B68;
            font-size: 34px;
            font-weight: 900;
            line-height: 1;
            text-decoration: none;
            padding: 0;
        }

        .user-identity-avatar img{
            width: 100%;
            height: 100%;
            aspect-ratio: 1 / 1;
            object-fit: cover;
            border-radius: 50%;
            display: block;
        }

        .user-identity-avatar--compact{
            width: 54px;
            height: 54px;
            font-size: 20px;
        }

        .user-identity-name{
            max-width: min(100%, 30ch);
            min-width: 0;
            display: block;
            margin-inline: auto;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            text-align: center;
        }

        .user-identity-bio{
            max-width: 560px;
            margin-inline: auto;
            text-align: center;
            overflow: hidden;
            overflow-wrap: anywhere;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        @keyframes siteMessageIn{
            from{
                opacity: 0;
                transform: translateX(50%) translateY(-10px);
            }
            to{
                opacity: 1;
                transform: translateX(50%) translateY(0);
            }
        }

        .avatar-lightbox{
            position: fixed;
            inset: 0;
            z-index: 3600;
            display: none;
            place-items: center;
            padding: 18px;
            background: rgba(15, 24, 18, 0.82);
            touch-action: none;
        }

        .avatar-lightbox.is-open{
            display: grid;
        }

        .avatar-lightbox__stage{
            position: relative;
            width: min(94vw, 760px);
            height: min(82vh, 760px);
            display: grid;
            place-items: center;
            overflow: hidden;
        }

        .avatar-lightbox__image{
            max-width: 100%;
            max-height: 100%;
            border-radius: 18px;
            object-fit: contain;
            box-shadow: 0 24px 70px rgba(0,0,0,0.34);
            cursor: grab;
            touch-action: none;
            user-select: none;
            will-change: transform;
        }

        .avatar-lightbox__image:active{
            cursor: grabbing;
        }

        .avatar-lightbox__close{
            position: absolute;
            top: max(14px, env(safe-area-inset-top));
            left: 14px;
            z-index: 2;
            width: 42px;
            height: 42px;
            border: 1px solid rgba(255,255,255,0.28);
            border-radius: 50%;
            display: grid;
            place-items: center;
            background: rgba(255,255,255,0.94);
            color: #0B1F3A;
            font-size: 22px;
            font-weight: 900;
            cursor: pointer;
            box-shadow: 0 12px 28px rgba(0,0,0,0.18);
        }

        .home-main,
        .categories-page,
        .messages-page,
        .chat-page,
        .dashboard-shell,
        .main{
            background: #FFFFFF !important;
            background-image: none !important;
        }

        a,
        button,
        input,
        textarea,
        select{
            font-family: inherit;
        }

        input,
        textarea,
        select,
        button{
            font-size: 16px;
        }

        a{
            color: inherit;
        }

        /* هيدر رئيسي بسيط يبرز شعار حراج طبرجل */
        .market-header{
            position: sticky;
            top: 0;
            z-index: 1000;
            background: var(--header-bg);
            box-shadow: 0 10px 28px rgba(15, 75, 47, 0.18);
        }

        .market-header--home{
            background: var(--header-bg);
            border-bottom: 1px solid rgba(7,26,47,0.22);
            box-shadow: 0 10px 24px rgba(7,26,47,0.18);
        }

        .market-header__inner{
            width: min(1180px, 100%);
            margin: 0 auto;
            min-height: 104px;
            padding: 12px 16px;
            display: grid;
            grid-template-columns: 52px minmax(0, 1fr) 52px;
            grid-template-areas: "menu brand notify";
            align-items: center;
            gap: 10px;
            direction: ltr;
        }

        .market-header--home .market-header__inner{
            min-height: 72px;
            padding: 4px 12px;
            grid-template-areas: "spacer brand menu";
        }

        .market-header--home .market-header__inner::before{
            content: "";
            grid-area: spacer;
            justify-self: start;
            width: 42px;
            height: 42px;
        }

        .market-brand{
            grid-area: brand;
            justify-self: center;
            min-width: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            position: relative;
            color: #0B1F3A;
            text-decoration: none;
            font-weight: 900;
            line-height: 1;
            padding: 2px 12px 10px;
            direction: rtl;
        }

        .market-brand__mark{
            display: none;
        }

        .market-brand__logo{
            display: block;
            width: min(46vw, 210px);
            max-width: 100%;
            height: auto;
            max-height: 88px;
            object-fit: contain;
        }

        .market-brand__text{
            display: grid;
            gap: 1px;
            text-align: center;
            white-space: nowrap;
            letter-spacing: 0;
        }

        .market-brand__line{
            display: block;
            font-weight: 900;
            line-height: 0.9;
            color: #0B1F3A;
            text-shadow: 0 2px 0 rgba(255,255,255,0.95), 0 6px 15px rgba(7,26,47,0.20);
        }

        .market-brand__line--top{
            font-size: clamp(31px, 5.2vw, 58px);
        }

        .market-brand__line--bottom{
            font-size: clamp(37px, 6.4vw, 70px);
        }

        .market-brand::after{
            content: "";
            position: absolute;
            right: 50%;
            bottom: 2px;
            width: min(76vw, 320px);
            height: 10px;
            border-radius: 999px;
            background: linear-gradient(90deg, rgba(184,137,74,0), #C99B33 22%, #8AA4C8 78%, rgba(184,137,74,0));
            transform: translateX(50%) rotate(-5deg);
            box-shadow: 0 2px 5px rgba(184,137,74,0.24);
            pointer-events: none;
            display: none;
        }

        .market-brand__sr{
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0,0,0,0);
            white-space: nowrap;
            border: 0;
        }

        .market-header--home .market-brand{
            width: 64px;
            height: 64px;
            padding: 7px;
            border-radius: 50%;
            background: #FFFFFF;
            overflow: hidden;
            box-shadow: 0 10px 22px rgba(7,26,47,0.16);
        }

        .market-header--home .market-brand__logo{
            width: 100%;
            height: 100%;
            max-height: none;
            object-fit: contain;
        }

        .market-header--home .market-brand__line{
            color: var(--primary-green);
            text-shadow: 0 2px 0 rgba(255,253,248,0.98), 0 8px 18px rgba(18,59,104,0.16);
        }

        .market-header--home .market-brand__line--top{
            font-size: clamp(34px, 6vw, 62px);
        }

        .market-header--home .market-brand__line--bottom{
            font-size: clamp(40px, 7vw, 76px);
        }

        .market-header--home .market-brand::after{
            width: min(74vw, 340px);
            height: 9px;
            background: linear-gradient(90deg, rgba(147,197,253,0), #CBD5E1 18%, #CDB48D 82%, rgba(147,197,253,0));
            box-shadow: 0 2px 5px rgba(147,197,253,0.32);
        }

        .market-header--home .account-trigger{
            display: none;
        }

        .account-trigger{
            grid-area: notify;
            justify-self: end;
            width: 42px;
            height: 42px;
            border: 0;
            border-radius: 16px;
            display: inline-grid;
            place-items: center;
            background: rgba(255,255,255,0.92);
            color: #0B1F3A;
            cursor: pointer;
            text-decoration: none;
            box-shadow: 0 10px 22px rgba(7,26,47,0.18), inset 0 0 0 1px rgba(147,197,253,0.58);
            transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
        }

        .account-trigger:hover{
            background: #fff;
            transform: translateY(-1px);
            box-shadow: 0 14px 28px rgba(7,26,47,0.22), inset 0 0 0 1px rgba(184,137,74,0.38);
        }

        .account-trigger__icon{
            position: relative;
            width: 19px;
            height: 21px;
            display: block;
            line-height: 1;
        }

        .account-trigger__icon::before{
            content: "";
            position: absolute;
            right: 2px;
            top: 2px;
            width: 15px;
            height: 15px;
            border: 2px solid currentColor;
            border-bottom: 0;
            border-radius: 11px 11px 4px 4px;
        }

        .account-trigger__icon::after{
            content: "";
            position: absolute;
            right: 7px;
            bottom: 0;
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: currentColor;
            box-shadow: 0 -3px 0 5px rgba(7,26,47,0.10);
        }

        .desktop-linkbar{
            display: none;
            background: #FFFFFF;
            border-top: 1px solid rgba(229,216,195,0.62);
            border-bottom: 1px solid #D6DEE8;
        }

        .desktop-linkbar__inner{
            width: min(1180px, 100%);
            margin: 0 auto;
            padding: 9px 22px;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .desktop-linkbar__link{
            min-height: 38px;
            padding: 0 12px;
            border: 1px solid #D6DEE8;
            border-radius: 14px;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            background: #FFFFFF;
            color: var(--text-dark);
            text-decoration: none;
            font-size: 13px;
            font-weight: 900;
            line-height: 1.4;
            white-space: nowrap;
            transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
        }

        .desktop-linkbar__link:hover{
            transform: translateY(-1px);
            border-color: rgba(18,59,104,0.30);
            background: #0B0B0B;
            color: var(--primary-green);
        }

        .desktop-linkbar__icon{
            color: var(--primary-green);
            font-size: 14px;
            line-height: 1;
        }

        .mobile-menu-trigger{
            grid-area: menu;
            justify-self: start;
            display: grid;
            width: 42px;
            height: 42px;
            border: 0;
            border-radius: 16px;
            place-items: center;
            background: rgba(255,255,255,0.92);
            color: #0B1F3A;
            cursor: pointer;
            font-size: 22px;
            font-weight: 900;
            line-height: 1;
            box-shadow: 0 10px 22px rgba(7,26,47,0.18), inset 0 0 0 1px rgba(147,197,253,0.58);
            transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
        }

        .mobile-menu-trigger:hover{
            background: #fff;
            transform: translateY(-1px);
            box-shadow: 0 14px 28px rgba(7,26,47,0.22), inset 0 0 0 1px rgba(184,137,74,0.38);
        }

        .market-header--home .mobile-menu-trigger{
            justify-self: end;
        }

        .mobile-menu-backdrop{
            position: fixed;
            inset: 0;
            z-index: 1240;
            display: none;
            background: rgba(7,26,47,0.52);
            backdrop-filter: blur(3px);
        }

        .mobile-menu-backdrop.is-open{
            display: block;
        }

        .mobile-side-menu{
            position: fixed;
            top: 0;
            right: 0;
            z-index: 1350;
            width: min(88vw, 390px);
            height: 100dvh;
            max-width: 100%;
            background: #FFFFFF;
            transform: translateX(104%);
            transition: transform 0.30s cubic-bezier(.2,.8,.2,1);
            box-shadow: -22px 0 70px rgba(7,26,47,0.26);
            display: none;
            flex-direction: column;
            overflow: hidden;
        }

        .mobile-side-menu.is-open{
            transform: translateX(0);
        }

        .mobile-side-menu__head{
            padding: 18px 18px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            background: var(--primary-gradient);
            color: #fff;
        }

        .mobile-side-menu__title{
            margin: 0;
            font-size: 22px;
            font-weight: 900;
            line-height: 1.35;
        }

        .mobile-side-menu__subtitle{
            margin: 4px 0 0;
            color: rgba(255,255,255,0.78);
            font-size: 12.5px;
            line-height: 1.7;
        }

        .mobile-side-menu__close{
            width: 42px;
            height: 42px;
            border: 1px solid rgba(255,255,255,0.24);
            border-radius: 14px;
            display: grid;
            place-items: center;
            background: rgba(255,255,255,0.14);
            color: #fff;
            cursor: pointer;
            font-size: 26px;
            line-height: 1;
        }

        .mobile-side-menu__nav{
            flex: 1;
            overflow-y: auto;
            padding: 8px 0 calc(18px + env(safe-area-inset-bottom));
            background: #FFFFFF;
            overflow-x: hidden;
        }

        .mobile-menu-group{
            padding: 8px 0;
            border-top: 8px solid #050505;
        }

        .mobile-menu-group:first-child{
            border-top: 0;
        }

        .mobile-menu-item{
            width: 100%;
            min-height: 60px;
            border: 0;
            background: transparent;
            color: inherit;
            text-decoration: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 18px;
            text-align: right;
            transition: background 0.2s ease, color 0.2s ease;
        }

        .mobile-menu-item + .mobile-menu-item{
            border-top: 1px solid #0B0B0B;
        }

        .mobile-menu-item:hover,
        .mobile-menu-item:focus-visible{
            background: #050505;
            outline: 0;
        }

        .mobile-menu-item__icon{
            flex: 0 0 auto;
            width: 40px;
            height: 40px;
            border-radius: 13px;
            display: grid;
            place-items: center;
            background: #EDF4FF;
            color: var(--primary-green);
            font-size: 18px;
            font-weight: 900;
            line-height: 1;
        }

        .mobile-menu-item--accent .mobile-menu-item__icon{
            background: #0B0B0B;
            color: var(--soft-orange);
        }

        .mobile-menu-item--danger .mobile-menu-item__icon{
            background: #FDECEC;
            color: #B42318;
        }

        .mobile-menu-item__text{
            flex: 1;
            min-width: 0;
            color: var(--text-dark);
            font-size: 15px;
            font-weight: 900;
            line-height: 1.45;
        }

        .mobile-menu-item__hint{
            display: block;
            margin-top: 2px;
            color: var(--muted);
            font-size: 11.5px;
            font-weight: 800;
            line-height: 1.5;
        }

        .mobile-menu-item__arrow{
            color: #64748B;
            font-size: 22px;
            line-height: 1;
        }

        .mobile-menu-switch{
            flex: 0 0 auto;
            position: relative;
            width: 48px;
            height: 28px;
            border-radius: 999px;
            background: #CBD5E1;
            box-shadow: inset 0 0 0 1px rgba(7,26,47,0.08);
        }

        .mobile-menu-switch::before{
            content: "";
            position: absolute;
            top: 3px;
            right: 3px;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 3px 10px rgba(7,26,47,0.18);
            transition: transform 0.22s ease;
        }

        .mobile-menu-item.is-active .mobile-menu-switch{
            background: var(--primary-green);
        }

        .mobile-menu-item.is-active .mobile-menu-switch::before{
            transform: translateX(-20px);
        }

        body.dark-mode{
            --page-gray: #18211A;
            --card: #202B22;
            --text-dark: #F5F0E7;
            --muted: #C6BCA7;
            --line: rgba(147,197,253,0.26);
            background: #18211A;
            color: #F5F0E7;
        }

        body.dark-mode .market-header{
            background: var(--header-bg);
            box-shadow: 0 12px 30px rgba(0,0,0,0.28);
        }

        body.dark-mode .side-drawer,
        body.dark-mode .mobile-side-menu,
        body.dark-mode .mobile-side-menu__nav,
        body.dark-mode .login-modal{
            background: #202B22;
            color: #F5F0E7;
        }

        body.dark-mode .drawer-item,
        body.dark-mode .mobile-menu-item{
            background: transparent;
        }

        body.dark-mode .mobile-menu-group{
            border-top-color: rgba(147,197,253,0.12);
        }

        body.dark-mode .drawer-item:hover,
        body.dark-mode .mobile-menu-item:hover,
        body.dark-mode .mobile-menu-item:focus-visible{
            background: rgba(232,243,232,0.08);
        }

        body.dark-mode .drawer-item__title,
        body.dark-mode .mobile-menu-item__text,
        body.dark-mode .drawer-profile__title,
        body.dark-mode .theme-toggle__text,
        body.dark-mode .login-modal__title{
            color: #F5F0E7;
        }

        body.dark-mode .drawer-item__desc,
        body.dark-mode .drawer-profile__text,
        body.dark-mode .mobile-menu-item__hint,
        body.dark-mode .login-modal__lead{
            color: #C6BCA7;
        }

        .drawer-backdrop,
        .login-backdrop{
            position: fixed;
            inset: 0;
            z-index: 1200;
            display: none;
            background: rgba(7,26,47,0.50);
            backdrop-filter: blur(3px);
        }

        .drawer-backdrop.is-open,
        .login-backdrop.is-open{
            display: block;
        }

        /* قائمة الحساب الجانبية */
        .side-drawer{
            position: fixed;
            top: 0;
            right: 0;
            z-index: 1300;
            width: min(88vw, 430px);
            height: 100dvh;
            max-width: 100%;
            background: #FFFFFF;
            transform: translateX(104%);
            transition: transform 0.30s cubic-bezier(.2,.8,.2,1);
            box-shadow: -22px 0 70px rgba(7,26,47,0.26);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .side-drawer.is-open{
            transform: translateX(0);
        }

        .side-drawer__top{
            padding: 18px 18px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            background: linear-gradient(180deg, #0B0B0B 0%, #fff 100%);
            border-bottom: 1px solid var(--line);
        }

        .drawer-profile{
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .drawer-profile__avatar{
            flex: 0 0 auto;
            width: 52px;
            height: 52px;
            border-radius: 18px;
            display: grid;
            place-items: center;
            background: var(--primary-green);
            color: #fff;
            font-size: 22px;
            font-weight: 900;
            box-shadow: 0 12px 26px rgba(18,59,104,0.24);
        }

        .drawer-profile__title{
            margin: 0 0 4px;
            color: var(--text-dark);
            font-size: 18px;
            font-weight: 900;
            line-height: 1.35;
        }

        .drawer-profile__text{
            margin: 0;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.7;
        }

        .drawer-close,
        .modal-close{
            flex: 0 0 auto;
            width: 42px;
            height: 42px;
            border: 0;
            border-radius: 14px;
            background: #0B0B0B;
            color: var(--text-dark);
            cursor: pointer;
            font-size: 24px;
            line-height: 1;
            transition: background 0.22s ease, transform 0.22s ease;
        }

        .drawer-close:hover,
        .modal-close:hover{
            background: #CBD5E1;
            transform: rotate(4deg);
        }

        .drawer-menu{
            flex: 1;
            overflow-y: auto;
            padding: 10px 0;
            scrollbar-width: thin;
            scrollbar-color: #CBD5E1 transparent;
        }

        .drawer-group{
            padding: 8px 0;
            border-bottom: 8px solid #050505;
        }

        .drawer-group:last-child{
            border-bottom: 0;
        }

        .drawer-item{
            width: 100%;
            min-height: 68px;
            border: 0;
            background: #FFFFFF;
            color: inherit;
            text-decoration: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px 18px;
            text-align: right;
            transition: background 0.22s ease;
        }

        .drawer-item + .drawer-item{
            border-top: 1px solid #0B0B0B;
        }

        .drawer-item:hover{
            background: #050505;
        }

        .drawer-item__icon{
            flex: 0 0 auto;
            width: 44px;
            height: 44px;
            border-radius: 15px;
            display: grid;
            place-items: center;
            background: #EDF4FF;
            color: var(--primary-green);
            font-size: 22px;
            line-height: 1;
        }

        .drawer-item--accent .drawer-item__icon{
            background: #0B0B0B;
            color: var(--soft-orange);
        }

        .drawer-item--green .drawer-item__icon{
            background: #EDF4FF;
            color: var(--fresh-green);
        }

        .drawer-item--danger .drawer-item__icon{
            background: #FDECEC;
            color: #B42318;
        }

        .drawer-item__content{
            min-width: 0;
            flex: 1;
        }

        .drawer-item__title{
            display: block;
            color: var(--text-dark);
            font-size: 16px;
            font-weight: 900;
            line-height: 1.45;
        }

        .drawer-item__desc{
            display: block;
            margin-top: 3px;
            color: #64748B;
            font-size: 12.5px;
            line-height: 1.55;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .drawer-item__arrow{
            flex: 0 0 auto;
            color: #64748B;
            font-size: 26px;
            line-height: 1;
        }

        .theme-toggle{
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
            border-top: 1px solid var(--line);
            background: #FFFFFF;
        }

        .theme-toggle__text{
            display: flex;
            align-items: center;
            gap: 11px;
            color: var(--text-dark);
            font-size: 16px;
            font-weight: 900;
        }

        .theme-toggle__icon{
            width: 38px;
            height: 38px;
            border-radius: 14px;
            display: grid;
            place-items: center;
            background: #EDF4FF;
            color: var(--primary-green);
            font-size: 20px;
        }

        .switch{
            position: relative;
            width: 52px;
            height: 30px;
        }

        .switch input{
            opacity: 0;
            width: 0;
            height: 0;
        }

        .switch span{
            position: absolute;
            inset: 0;
            border-radius: 999px;
            background: #CBD5E1;
            cursor: pointer;
            transition: background 0.22s ease;
        }

        .switch span::before{
            content: "";
            position: absolute;
            width: 24px;
            height: 24px;
            top: 3px;
            right: 3px;
            border-radius: 50%;
            background: #FFFFFF;
            transition: transform 0.22s ease;
            box-shadow: 0 3px 10px rgba(7,26,47,0.22);
        }

        .switch input:checked + span{
            background: var(--text-dark);
        }

        .switch input:checked + span::before{
            transform: translateX(-22px);
        }

        /* نافذة الدخول تتحول إلى ورقة سفلية على الجوال */
        .login-modal{
            position: fixed;
            right: 50%;
            bottom: 0;
            z-index: 1400;
            width: min(100%, 480px);
            max-height: calc(100dvh - 24px);
            overflow-y: auto;
            background: #FFFFFF;
            border-radius: 28px 28px 0 0;
            padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
            box-shadow: 0 -24px 70px rgba(7,26,47,0.28);
            transform: translate(50%, 110%);
            opacity: 0;
            pointer-events: none;
            transition: transform 0.28s cubic-bezier(.2,.8,.2,1), opacity 0.22s ease;
        }

        .login-modal.is-open{
            transform: translate(50%, 0);
            opacity: 1;
            pointer-events: auto;
        }

        .login-modal__handle{
            width: 48px;
            height: 5px;
            margin: 0 auto 16px;
            border-radius: 999px;
            background: #CBD5E1;
        }

        .login-modal__head{
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }

        .login-modal__title{
            margin: 0;
            color: var(--text-dark);
            font-size: 22px;
            font-weight: 900;
            line-height: 1.45;
        }

        .login-modal__lead{
            margin: 0 0 18px;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.9;
        }

        .login-field{
            display: block;
            margin-bottom: 16px;
        }

        .login-field span{
            display: block;
            margin-bottom: 9px;
            color: var(--text-dark);
            font-size: 14px;
            font-weight: 900;
        }

        .login-field input{
            width: 100%;
            height: 56px;
            border: 1px solid var(--line-strong);
            border-radius: 18px;
            padding: 0 16px;
            outline: 0;
            color: var(--text-dark);
            background: #FFFFFF;
            font-size: 16px;
            font-weight: 800;
            transition: border 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
        }

        .login-field input:focus{
            border-color: var(--primary-green);
            background: #FFFFFF;
            box-shadow: 0 0 0 4px rgba(18,59,104,0.13);
        }

        .login-next{
            width: 100%;
            height: 56px;
            border: 0;
            border-radius: 18px;
            background: var(--primary-green);
            color: #fff;
            font-size: 16px;
            font-weight: 900;
            cursor: pointer;
            box-shadow: 0 14px 26px rgba(18,59,104,0.24);
            transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
        }

        .login-next:hover{
            background: var(--primary-green-dark);
            transform: translateY(-1px);
            box-shadow: 0 18px 32px rgba(18,59,104,0.28);
        }

        @media (min-width: 769px){
            .market-header__inner{
                min-height: 118px;
                padding: 14px 24px;
                grid-template-columns: 56px minmax(0, 1fr) 56px;
                gap: 14px;
            }

            .market-brand{
                padding-bottom: 13px;
            }

            .login-modal{
                top: 50%;
                right: auto;
                bottom: auto;
                left: 50%;
                width: min(calc(100vw - 40px), 460px);
                border-radius: 30px;
                padding: 26px;
                box-shadow: var(--shadow-strong);
                transform: translate(-50%, -44%) scale(0.96);
            }

            .login-modal.is-open{
                transform: translate(-50%, -50%) scale(1);
            }

            .login-modal__handle{
                display: none;
            }

            .desktop-linkbar{
                display: none;
            }

            .mobile-side-menu{
                display: flex;
            }

            .market-header--home .market-header__inner{
                min-height: 76px;
                padding-top: 4px;
                padding-bottom: 4px;
            }

            .market-header--home .mobile-menu-trigger{
                width: 42px;
                height: 42px;
            }

            .market-header--home .market-brand{
                width: 68px;
                height: 68px;
                padding: 8px;
            }

            .market-header--home .market-brand__logo{
                width: 100%;
                height: 100%;
                max-height: none;
            }

        }

        @media (max-width: 768px){
            .market-header__inner{
                min-height: 98px;
                padding: 10px 12px;
                gap: 8px;
                grid-template-columns: 48px minmax(0, 1fr) 48px;
                grid-template-areas: "menu brand notify";
            }

            .market-brand{
                grid-area: brand;
                justify-self: center;
            }

            .account-trigger{
                grid-area: notify;
                display: grid;
                width: 40px;
                height: 40px;
            }

            .mobile-menu-trigger{
                grid-area: menu;
                display: grid;
                width: 40px;
                height: 40px;
                border-radius: 15px;
                font-size: 20px;
            }

            .mobile-side-menu{
                display: flex;
            }

            .side-drawer,
            .drawer-backdrop{
                display: none !important;
            }

            .desktop-linkbar{
                display: none;
            }

            .market-header--home .market-header__inner{
                min-height: 72px;
                grid-template-columns: 48px minmax(0, 1fr) 48px;
                grid-template-areas: "spacer brand menu";
            }

        }

        @media (max-width: 520px){
            .market-header__inner{
                min-height: 92px;
                gap: 8px;
            }

            .market-brand{
                padding: 0 8px 10px;
            }

            .market-header--home .market-brand{
                width: 62px;
                height: 62px;
                padding: 7px;
                border-radius: 50%;
            }

            .market-brand__logo{
                width: min(52vw, 190px);
                max-height: 82px;
            }

            .market-header--home .market-brand__logo{
                width: 100%;
                height: 100%;
                max-height: none;
            }

            .market-brand__text{
                gap: 1px;
            }

            .side-drawer{
                width: min(90vw, 410px);
            }

        }

        @media (max-width: 360px){
            .market-header__inner{
                min-height: 86px;
                padding-right: 9px;
                padding-left: 9px;
                grid-template-columns: 42px minmax(0, 1fr) 42px;
            }

            .market-brand{
                padding-right: 4px;
                padding-left: 4px;
            }

            .market-brand__logo{
                width: min(50vw, 172px);
                max-height: 76px;
            }

            .market-header--home .market-brand__logo{
                width: 100%;
                height: 100%;
                max-height: none;
            }

            .account-trigger,
            .mobile-menu-trigger{
                width: 38px;
                height: 38px;
                border-radius: 13px;
            }

            .market-header--home .market-header__inner{
                min-height: 66px;
            }

            .market-header--home .market-brand{
                width: 58px;
                height: 58px;
                padding: 7px;
            }

        }

        .market-header--reference .market-header__inner{
            min-height: 62px;
            padding-top: 3px;
            padding-bottom: 3px;
        }

        .market-header--reference .market-brand{
            width: 56px;
            height: 56px;
            padding: 6px;
        }

        .market-header--reference .market-header__inner::before,
        .market-header--reference .mobile-menu-trigger{
            width: 38px;
            height: 38px;
        }

        @media (min-width: 760px){
            .market-header--reference .market-header__inner{
                min-height: 66px;
            }

            .market-header--reference .market-brand{
                width: 60px;
                height: 60px;
                padding: 7px;
            }
        }

        @media (max-width: 430px){
            .market-header--reference .market-header__inner{
                min-height: 62px;
                grid-template-columns: 42px minmax(0, 1fr) 42px;
            }

            .market-header--reference .market-brand{
                width: 54px;
                height: 54px;
                padding: 6px;
            }
        }

        @media (max-width: 360px){
            .market-header--reference .market-header__inner{
                min-height: 58px;
            }

            .market-header--reference .market-brand{
                width: 50px;
                height: 50px;
                padding: 6px;
            }
        }

        .market-header,
        .market-header--home{
            background: var(--header-bg);
            border-bottom-color: rgba(255,255,255,0.12);
            box-shadow: 0 10px 28px rgba(7,26,47,0.24);
        }

        .market-header--home .market-brand{
            box-shadow: 0 10px 22px rgba(7,26,47,0.24);
        }

        .mobile-menu-trigger,
        .account-trigger,
        .avatar-lightbox__close{
            color: var(--primary);
            box-shadow: 0 10px 22px rgba(7,26,47,0.18), inset 0 0 0 1px rgba(147,197,253,0.42);
        }

        .desktop-linkbar{
            background: var(--surface-dark);
            border-top-color: #1F2937;
            border-bottom-color: #1F2937;
        }

        .desktop-linkbar__link{
            background: var(--surface-dark-2);
            border-color: #1F2937;
            color: #E5E7EB;
        }

        .desktop-linkbar__link:hover{
            background: rgba(18,59,104,0.82);
            border-color: rgba(147,197,253,0.24);
            color: #FFFFFF;
        }

        .desktop-linkbar__icon,
        .mobile-menu-item__icon{
            background: #EDF4FF;
            color: var(--primary-2);
        }

        .mobile-side-menu,
        .mobile-side-menu__nav{
            background: #FFFFFF;
        }

        .mobile-side-menu__head{
            background: var(--primary-gradient);
        }

        .mobile-menu-group,
        .drawer-item + .drawer-item,
        .mobile-menu-item + .mobile-menu-item{
            border-color: #E2E8F0;
        }

        .mobile-menu-item:hover,
        .mobile-menu-item:focus-visible,
        .drawer-item:hover{
            background: #EDF4FF;
        }

        .mobile-menu-item__text,
        .drawer-item__title{
            color: #172033;
        }

        .mobile-menu-item__hint,
        .mobile-menu-item__arrow,
        .drawer-item__desc,
        .drawer-item__arrow{
            color: #64748B;
        }

        .drawer-item__icon,
        .drawer-item--green .drawer-item__icon,
        .theme-toggle__icon{
            background: #EDF4FF;
            color: var(--primary-2);
        }

/* Desktop-only primary navigation (mobile keeps its bottom bar unchanged) */
.tbrgl-desktop-nav { display: none; }
@media (min-width: 769px) {
    .tbrgl-desktop-nav {
        display: flex; align-items: center; justify-content: center;
        gap: 10px; flex-wrap: wrap;
        background: #0B1F3A; padding: 12px 24px;
        border-top: 1px solid rgba(255, 255, 255, .08);
    }
    .tbrgl-desktop-nav a {
        display: inline-flex; align-items: center; gap: 8px;
        color: #E5E7EB; text-decoration: none;
        font-weight: 700; font-size: 1rem; line-height: 1; white-space: nowrap;
        padding: 10px 18px; border-radius: 12px;
        transition: background .15s ease, color .15s ease;
    }
    .tbrgl-desktop-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
    .tbrgl-desktop-nav a.is-active { background: rgba(255, 255, 255, .16); color: #fff; }
    .tbrgl-desktop-nav a.is-add { background: #C9A227; color: #0B1F3A; }
    .tbrgl-desktop-nav a.is-add:hover { background: #d8b02f; color: #0B1F3A; }
    .tbrgl-desktop-nav a.is-admin { background: #1E7D46; color: #fff; }
    .tbrgl-desktop-nav a.is-admin:hover { background: #229152; color: #fff; }
    .tbrgl-desktop-nav .tbrgl-desktop-nav__icon { font-size: 1.05rem; line-height: 1; }
}
