/* ============ SCREENS & LAYOUTS ============ */
/* ============================================================================
   ============ DESKTOP DASHBOARD LAYER (>=1024px) ======
   ============================================================================ */

        /* ---- Persistent left icon rail (hidden unless desktop + logged-in screen) ---- */
        .desktop-sidebar {
            display: none;
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            width: 92px;
            background: var(--surface);
            border-right: 1px solid var(--border);
            z-index: 150;
            flex-direction: column;
            align-items: center;
            padding: 24px 0 18px;
        }

        .desktop-sidebar .ds-logo {
            width: 42px;
            height: 42px;
            margin-bottom: 8px;
            flex-shrink: 0;
        }

        .desktop-sidebar .ds-brand {
            font-family: var(--font-display);
            font-size: 10.5px;
            font-weight: 700;
            color: var(--primary-dark);
            letter-spacing: .02em;
            margin-bottom: 26px;
        }

        .desktop-sidebar .ds-nav {
            display: flex;
            flex-direction: column;
            gap: 8px;
            flex: 1;
            width: 100%;
            align-items: center;
            overflow-y: auto;
        }

        .desktop-sidebar .ds-item {
            width: 66px;
            min-height: 58px;
            border-radius: 16px;
            border: none;
            background: none;
            color: var(--text-faint);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            cursor: pointer;
            font-size: 10px;
            font-weight: 700;
            font-family: var(--font-body);
            transition: all .15s ease;
            padding: 8px 4px;
        }

        .desktop-sidebar .ds-item i {
            font-size: 17px;
        }

        .desktop-sidebar .ds-item:hover {
            background: var(--primary-light);
            color: var(--primary-dark);
        }

        .desktop-sidebar .ds-item.active {
            background: var(--grad-primary);
            color: #fff;
            box-shadow: 0 10px 18px -8px rgba(123, 44, 191, 0.55);
        }

        .desktop-sidebar .ds-bottom {
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: center;
            width: 100%;
            padding-top: 14px;
            border-top: 1px solid var(--border);
            margin-top: 10px;
        }

        .desktop-sidebar .ds-item.danger:hover {
            background: var(--error-bg);
            color: var(--error);
        }

        /* ============ MEMBERSHIP PAGE - LEFT ALIGNED WITH MAX-WIDTH ============ */
        .membership-wrap {
            max-width: 500px;
            margin-left: 0;
            width: 100%;
        }

        .membership-wrap .card {
            width: 100%;
        }

        /* ============ NOTIFICATIONS - FULL WIDTH ============ */
        .notif-full {
            width: 100%;
        }

        .notif-full .notif-item {
            padding: 16px 0;
        }

        /* ============ EDIT PROFILE - 2 COLUMN LAYOUT ============ */
        .edit-profile-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }

        .edit-profile-grid .field {
            margin-bottom: 0;
        }

        .edit-profile-grid .field.full-width {
            grid-column: 1 / -1;
        }

        @media (max-width: 600px) {
            .edit-profile-grid {
                grid-template-columns: 1fr;
            }

            .edit-profile-grid .field.full-width {
                grid-column: 1;
            }
        }

        @media (min-width:1024px) {
            body.sidebar-active .desktop-sidebar {
                display: flex;
            }

            body.sidebar-active .app-container {
                margin-left: 92px;
                width: calc(100% - 92px);
            }

            .tabbar {
                display: none;
            }

            /* generic dashboard content width for logged-in screens */
            .screen-pad {
                max-width: 1360px;
                width: 100%;
                padding: 36px 44px 60px;
            }

            .screen-pad.no-tab {
                padding: 36px 44px 60px;
            }

            .topbar {
                max-width: 1360px;
                width: 100%;
                padding: 26px 44px 10px;
            }

            /* auth / onboarding screens become a centered dashboard-style card */
            .screen.auth-screen .screen-pad {
                max-width: 480px;
                margin: 48px auto;
                background: var(--surface);
                border-radius: 28px;
                box-shadow: var(--shadow-pop);
                padding: 44px 42px 42px;
            }

            .screen.auth-screen .topbar {
                max-width: 480px;
                margin: 0 auto;
                padding: 26px 0 0;
            }

            /* narrower content panels (settings-style screens) */
            .screen.panel-screen .screen-pad {
                max-width: 760px;
                margin: 0 auto;
                padding: 36px 0 60px;
            }

            .screen.panel-screen .topbar {
                margin: auto;
                max-width: 760px;
                padding: 26px 0px 10px;
            }

            /* home / browse / favorites become responsive card grids like a dashboard */
            #homeGirlsList,
            #browseList,
            #favContent {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
                gap: 20px;
                align-items: start;
            }

            #homeGirlsList .empty-state,
            #browseList .empty-state,
            #favContent .empty-state {
                grid-column: 1/-1;
            }

            .profile-card {
                margin-bottom: 0;
            }

            .hero-grid {
                max-width: 720px;
            }

            .stat-strip {
                max-width: 720px;
            }

            .search-bar {
                max-width: 720px;
            }

            .seg-toggle {
                max-width: 340px;
            }

            /* full profile becomes a two-column dashboard detail panel */
            #profileContent {
                display: flex;
                align-items: flex-start;
                gap: 0;
                max-width: 1360px;
                margin: 0 auto;
                width: 100%;
            }

            #profileContent .full-hero {
                width: 50%;
                flex-shrink: 0;
                height: calc(100vh - 48px);
                position: sticky;
                top: 24px;
                border-radius: 26px;
                margin: 24px 0 24px 44px;
                box-shadow: var(--shadow-pop);
            }

            #profileContent .screen-pad {
                flex: 1;
                max-width: none;
                margin: 0;
                padding: 28px 44px 60px 40px;
            }

            /* modal sheets read as centered dashboard dialogs, not mobile bottom sheets */
            .modal-backdrop {
                align-items: center;
            }

            .modal-sheet {
                border-radius: 28px;
                max-width: 520px;
                margin: 0 auto;
                max-height: 80vh;
            }
        }

        /* ============ STRICT RESPONSIVE NAVIGATION GUARD ============ */
        /* Desktop (>=1024px) */
        @media (min-width: 1024px) {
            body.sidebar-active .desktop-sidebar {
                display: flex !important;
            }

            body.sidebar-active .app-container {
                margin-left: 92px !important;
                width: calc(100% - 92px) !important;
            }

            .tabbar {
                display: none !important;
            }
        }

        /* Mobile (<1024px) ALWAYS hides desktop sidebar and uses full width + bottom tabbar */
        @media (max-width: 1023px) {

            .desktop-sidebar,
            body.sidebar-active .desktop-sidebar {
                display: none !important;
            }

            .app-container,
            body.sidebar-active .app-container {
                margin-left: 0 !important;
                width: 100% !important;
                max-width: 100% !important;
            }

            .tabbar,
            body.sidebar-active .tabbar {
                display: flex !important;
            }
        }

        /* ============ 3-SLOT PHOTO UPLOADER (STEP 2) ============ */
        .photo-upload-grid-3 {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin: 10px 0 16px;
        }

        .photo-slot-card {
            aspect-ratio: 3/4;
            border: 2px dashed var(--secondary);
            border-radius: var(--radius-sm);
            background: var(--surface);
            position: relative;
            overflow: hidden;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 8px;
            transition: all .2s ease;
        }

        .photo-slot-card:hover {
            background: var(--primary-light);
        }

        .photo-slot-card img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: 1;
        }

        .photo-slot-card .slot-tag {
            position: absolute;
            top: 6px;
            left: 6px;
            background: rgba(20, 10, 32, 0.75);
            color: #fff;
            font-size: 9.5px;
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 4px;
            z-index: 2;
        }

        .photo-slot-card .cam-btn {
            position: absolute;
            bottom: 6px;
            right: 6px;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: var(--grad-primary);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            z-index: 2;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
        }

        /* ============ CASTE SEARCH & TAG CHIP ============ */
        .caste-chip-box {
            display: none;
            align-items: center;
            justify-content: space-between;
            background: rgba(123, 44, 191, 0.08);
            border: 1.5px solid var(--primary);
            border-radius: 14px;
            padding: 12px 16px;
            color: var(--primary);
            font-weight: 700;
            margin-bottom: 12px;
            box-shadow: 0 2px 8px rgba(123, 44, 191, 0.08);
        }

        .caste-chip-box.active {
            display: flex;
        }

        .caste-chip-box .caste-remove-btn {
            cursor: pointer;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: rgba(123, 44, 191, 0.15);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 12px;
            transition: background 0.15s ease, transform 0.15s ease;
        }

        .caste-chip-box .caste-remove-btn:hover {
            background: rgba(123, 44, 191, 0.28);
            transform: scale(1.08);
        }

        .caste-dropdown-menu {
            background: var(--surface);
            border: 1.5px solid rgba(123, 44, 191, 0.2);
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(45, 10, 80, 0.12);
            max-height: 280px;
            overflow-y: auto;
            margin-top: 6px;
            display: none;
            z-index: 50;
            position: relative;
        }

        .caste-dropdown-menu.open {
            display: block;
        }

        .caste-dropdown-header {
            padding: 8px 14px;
            background: #F8F5FB;
            border-bottom: 1px solid rgba(123, 44, 191, 0.08);
            font-size: 10.5px;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .caste-dropdown-menu .caste-option {
            padding: 11px 14px;
            cursor: pointer;
            border-bottom: 1px solid rgba(0, 0, 0, 0.04);
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: background 0.15s ease;
        }

        .caste-dropdown-menu .caste-option:hover {
            background: rgba(123, 44, 191, 0.07);
        }

        .caste-dropdown-menu .caste-option:last-child {
            border-bottom: none;
        }

        .caste-opt-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 10.5px;
            font-weight: 700;
            color: var(--primary);
            background: rgba(123, 44, 191, 0.09);
            padding: 2px 7px;
            border-radius: 6px;
            margin-bottom: 3px;
        }

        .caste-empty-helpline {
            padding: 20px 16px;
            text-align: center;
            background: #FAFAFC;
            border-radius: 14px;
        }

        .caste-helpline-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 9px 16px;
            border-radius: 20px;
            background: var(--grad-primary);
            color: #ffffff !important;
            font-size: 12px;
            font-weight: 700;
            text-decoration: none;
            box-shadow: 0 4px 12px rgba(123, 44, 191, 0.25);
            transition: transform 0.15s ease;
        }

        .caste-helpline-link:hover {
            transform: scale(1.03);
        }

        /* ============ FILTER CASTE & CITY SEARCHABLE DROPDOWNS ============ */
        .filter-caste-dd-menu,
        .filter-city-dd-menu {
            max-height: 380px !important;
            padding: 10px !important;
            overflow: hidden;
            display: none;
            flex-direction: column;
            background: var(--surface);
            border: 1.5px solid var(--border);
            border-radius: 16px;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
            z-index: 100;
        }

        .dd.open .filter-caste-dd-menu,
        .dd.open .filter-city-dd-menu {
            display: flex !important;
            animation: ddPop .18s ease;
        }

        .flt-caste-top-options {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 8px;
        }

        .flt-caste-item,
        .flt-city-item {
            padding: 9px 12px;
            border-radius: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: background 0.15s ease, border-color 0.15s ease;
            border: 1.5px solid transparent;
            background: #FAFAFC;
        }

        .flt-caste-item:hover,
        .flt-city-item:hover {
            background: rgba(123, 44, 191, 0.08);
        }

        .flt-caste-item.active,
        .flt-city-item.active {
            background: rgba(123, 44, 191, 0.1);
            border-color: var(--primary);
        }

        .flt-caste-item.active .flt-check-icon,
        .flt-city-item.active .flt-city-check-icon {
            display: block !important;
        }

        .flt-caste-scroll-list,
        .flt-city-scroll-list {
            flex: 1;
            overflow-y: auto;
            max-height: 180px;
            padding-right: 4px;
            margin-top: 4px;
        }

        .flt-caste-scroll-list::-webkit-scrollbar,
        .flt-city-scroll-list::-webkit-scrollbar {
            width: 4px;
        }

        .flt-caste-scroll-list::-webkit-scrollbar-thumb,
        .flt-city-scroll-list::-webkit-scrollbar-thumb {
            background: rgba(123, 44, 191, 0.25);
            border-radius: 4px;
        }

        .flt-caste-sub-item,
        .flt-city-sub-item {
            padding: 8px 10px;
            border-radius: 9px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid rgba(0, 0, 0, 0.04);
            transition: background 0.12s ease;
        }

        .flt-caste-sub-item:hover,
        .flt-city-sub-item:hover {
            background: rgba(123, 44, 191, 0.06);
        }

        .flt-caste-sub-item.active,
        .flt-city-sub-item.active {
            background: rgba(123, 44, 191, 0.12);
            font-weight: 700;
        }

        /* ============ AGE RANGE DUAL SLIDER STYLING ============ */
        .flt-age-slider-wrap {
            position: relative;
            height: 32px;
            display: flex;
            align-items: center;
            margin: 8px 0;
        }

        .flt-age-track-bg {
            position: absolute;
            width: 100%;
            height: 6px;
            border-radius: 4px;
            background: #E8E0F2;
        }

        .flt-age-track-active {
            position: absolute;
            height: 6px;
            border-radius: 4px;
            background: var(--grad-primary);
            left: 0%;
            right: 0%;
        }

        .flt-age-slider-wrap input[type="range"] {
            position: absolute;
            width: 100%;
            height: 6px;
            margin: 0;
            background: transparent;
            pointer-events: none;
            -webkit-appearance: none;
            appearance: none;
            outline: none;
        }

        .flt-age-slider-wrap input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: #ffffff;
            border: 3.5px solid var(--primary);
            box-shadow: 0 2px 8px rgba(123, 44, 191, 0.35);
            cursor: pointer;
            pointer-events: auto;
            transition: transform 0.12s ease;
        }

        .flt-age-slider-wrap input[type="range"]::-webkit-slider-thumb:active {
            transform: scale(1.15);
        }

        .flt-age-slider-wrap input[type="range"]::-moz-range-thumb {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #ffffff;
            border: 3.5px solid var(--primary);
            box-shadow: 0 2px 8px rgba(123, 44, 191, 0.35);
            cursor: pointer;
            pointer-events: auto;
        }

        .flt-age-val-box {
            background: #F7F5FA;
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 6px 14px;
            text-align: center;
            min-width: 90px;
        }

        .flt-age-presets {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        /* ============ PHOTO CAROUSEL MODAL ============ */
        .carousel-overlay {
            position: fixed;
            inset: 0;
            background: rgba(10, 5, 20, 0.94);
            z-index: 500;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .carousel-overlay.open {
            display: flex;
        }

        .carousel-wrap {
            max-width: 440px;
            width: 100%;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .carousel-view {
            width: 100%;
            height: 480px;
            border-radius: 20px;
            overflow: hidden;
            position: relative;
            background: #000;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
        }

        .carousel-view img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .carousel-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 42px;
            height: 42px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.9);
            color: var(--primary-dark);
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 16px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
            z-index: 5;
        }

        .carousel-btn.prev {
            left: 12px;
        }

        .carousel-btn.next {
            right: 12px;
        }

        .carousel-pill {
            position: absolute;
            bottom: 16px;
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
            padding: 5px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 700;
        }

        .carousel-close {
            position: absolute;
            top: -46px;
            right: 0;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.25);
            color: #fff;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 18px;
        }

        .pcount-chip {
            position: absolute;
            bottom: 10px;
            left: 10px;
            background: rgba(20, 10, 32, 0.8);
            color: #fff;
            font-size: 10.5px;
            font-weight: 800;
            padding: 4px 9px;
            border-radius: 14px;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            z-index: 2;
        }

        /* ============ PAGE ROUTE LOADER ============ */
        .page-route-loader {
            position: fixed;
            inset: 0;
            background: rgba(250, 248, 252, 0.78);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 999;
            display: none;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 12px;
        }

        .page-route-loader.open {
            display: flex;
        }

        /* ============ CUSTOM DOB MODAL ============ */
        .dob-modal-card {
            background: var(--surface);
            border-radius: 24px;
            padding: 24px 20px;
            width: 100%;
            max-width: 380px;
            box-shadow: var(--shadow-pop);
            border: 1px solid var(--border);
        }

        .dob-age-badge {
            background: var(--primary-light);
            color: var(--primary-dark);
            padding: 6px 14px;
            border-radius: 20px;
            font-weight: 800;
            font-size: 12.5px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin: 10px 0 16px;
        }

        .dob-picker-container {
            display: grid;
            grid-template-columns: 1fr 1.3fr 1fr;
            gap: 8px;
            margin: 16px 0 20px;
        }

        .dob-col {
            background: var(--bg);
            border: 1.5px solid var(--border);
            border-radius: 16px;
            padding: 6px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .dob-col-header {
            font-size: 11px;
            font-weight: 800;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: .04em;
            padding: 4px 0 6px;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .dob-scroll-list {
            height: 180px;
            overflow-y: auto;
            width: 100%;
            scrollbar-width: thin;
            scrollbar-color: var(--secondary) transparent;
            padding: 4px 2px;
        }

        .dob-scroll-list::-webkit-scrollbar {
            width: 4px;
        }

        .dob-scroll-list::-webkit-scrollbar-thumb {
            background: var(--secondary);
            border-radius: 4px;
        }

        .dob-item {
            padding: 8px 6px;
            font-size: 13.5px;
            font-weight: 700;
            text-align: center;
            border-radius: 10px;
            cursor: pointer;
            color: var(--text);
            transition: all 0.15s ease;
            user-select: none;
        }

        .dob-item:hover {
            background: var(--primary-light);
            color: var(--primary-dark);
        }

        .dob-item.active {
            background: var(--grad-primary);
            color: #fff;
            box-shadow: 0 4px 10px rgba(123, 44, 191, 0.25);
        }

        /* ============ PROFILE CARD ACTION BUTTONS ============ */
        .card-action-bar {
            display: grid;
            grid-template-columns: 1.3fr 1fr 1fr auto;
            gap: 6px;
            margin-top: 12px;
            align-items: center;
        }

        .c-act-btn {
            border: none;
            border-radius: 11px;
            padding: 8px 8px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            transition: all 0.15s ease;
        }

        .c-act-btn.interest {
            background: var(--grad-gold);
            color: var(--primary-dark);
            box-shadow: 0 2px 8px rgba(244, 180, 0, 0.25);
        }

        .c-act-btn.wa {
            background: #25D366;
            color: #fff;
            text-decoration: none;
        }

        .c-act-btn.call {
            background: var(--primary-light);
            color: var(--primary-dark);
            text-decoration: none;
        }

        .c-act-btn.report {
            background: transparent;
            color: var(--text-faint);
            padding: 8px 10px;
        }

        .c-act-btn.report:hover {
            color: var(--error);
            background: rgba(214, 69, 69, 0.1);
        }

        .carousel-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.4);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .carousel-dot.active {
            background: #fff;
            width: 22px;
            border-radius: 10px;
        }

        /* ============================================================ GLOBAL PAGE LOADER ============================================================ */
        .global-page-loader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: radial-gradient(circle at center, #2C164D 0%, #150826 100%);
            z-index: 99999;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
        }

        .global-page-loader.active {
            opacity: 1;
            visibility: visible;
            pointer-events: all;
        }

        .gloader-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: 32px;
            max-width: 320px;
            animation: gloaderCardPulse 2s ease-in-out infinite alternate;
        }

        @keyframes gloaderCardPulse {
            0% {
                transform: scale(0.97);
            }

            100% {
                transform: scale(1.02);
            }
        }

        .gloader-logo-ring {
            position: relative;
            width: 92px;
            height: 92px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 22px;
        }

        .gloader-spin-arc {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 3px solid rgba(212, 160, 23, 0.16);
            border-top-color: #D4A017;
            border-right-color: #702B90;
            animation: gloaderSpin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
        }

        @keyframes gloaderSpin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        .gloader-icon {
            width: 62px;
            height: 62px;
            border-radius: 18px;
            background: linear-gradient(135deg, #702B90 0%, #D4A017 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
            font-size: 26px;
            box-shadow: 0 10px 25px rgba(112, 43, 144, 0.45);
        }

        .gloader-title {
            font-family: 'Playfair Display', Georgia, serif;
            font-size: 24px;
            font-weight: 700;
            color: #ffffff;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
        }

        .gloader-subtitle {
            font-size: 11px;
            letter-spacing: 2.5px;
            text-transform: uppercase;
            color: #D4A017;
            font-weight: 600;
            margin-bottom: 20px;
        }

        .gloader-status-wrap {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 8px 18px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 999px;
            backdrop-filter: blur(8px);
        }

        .gloader-dots {
            display: flex;
            gap: 4px;
        }

        .gloader-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background-color: #D4A017;
            animation: gloaderDotBounce 1.2s infinite ease-in-out both;
        }

        .gloader-dot:nth-child(1) {
            animation-delay: -0.32s;
        }

        .gloader-dot:nth-child(2) {
            animation-delay: -0.16s;
        }

        .gloader-dot:nth-child(3) {
            animation-delay: 0s;
        }

        @keyframes gloaderDotBounce {

            0%,
            80%,
            100% {
                transform: scale(0);
                opacity: 0.3;
            }

            40% {
                transform: scale(1);
                opacity: 1;
            }
        }

        .gloader-status {
            font-size: 13.5px;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.92);
        }

        /* ======================== WHATSAPP-STYLE CHAT ARCHITECTURE ======================== */
        body.in-chat-screen,
        html:has(#scr-chat.active),
        html:has(#scr-chat.active) body {
            overflow: hidden !important;
            height: 100vh !important;
            height: 100dvh !important;
            max-height: 100dvh !important;
        }

        body.in-chat-screen .app-container,
        html:has(#scr-chat.active) .app-container {
            overflow: hidden !important;
            height: 100vh !important;
            height: 100dvh !important;
            max-height: 100dvh !important;
            min-height: 0 !important;
            display: flex;
            flex-direction: column;
        }

        #scr-chat {
            display: none;
            flex-direction: column;
            width: 100%;
            height: 100vh;
            height: 100dvh;
            max-height: 100dvh;
            min-height: 0 !important;
            overflow: hidden !important;
            position: relative;
            box-sizing: border-box;
            background: #FAF7FD;
            animation: none !important;
        }

        #scr-chat.active {
            display: flex !important;
            height: 100vh !important;
            height: 100dvh !important;
            max-height: 100dvh !important;
            overflow: hidden !important;
        }

        /* Fixed Top Header (WhatsApp Header) */
        #scr-chat .chat-header {
            flex-shrink: 0;
            position: sticky;
            top: 0;
            left: 0;
            right: 0;
            z-index: 60;
            width: 100%;
            background: rgba(255, 255, 255, 0.96);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border-bottom: 1px solid rgba(123, 44, 191, 0.12);
            box-shadow: 0 2px 10px rgba(45, 10, 80, 0.04);
            padding-top: max(12px, env(safe-area-inset-top));
            padding-bottom: 10px;
            padding-left: 14px;
            padding-right: 14px;
            box-sizing: border-box;
        }

        .chat-header-inner {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            max-width: 900px;
            margin: 0 auto;
        }

        .chat-user-profile-btn {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
            min-width: 0;
            cursor: pointer;
            padding: 4px 6px;
            border-radius: 12px;
            transition: background 0.15s ease;
        }

        .chat-user-profile-btn:hover {
            background: rgba(123, 44, 191, 0.05);
        }

        .chat-avatar-wrap {
            position: relative;
            flex-shrink: 0;
            width: 44px;
            height: 44px;
        }

        .chat-avatar-wrap img {
            width: 44px;
            height: 44px;
            border-radius: 14px;
            object-fit: cover;
            border: 2px solid #fff;
            box-shadow: 0 2px 8px rgba(45, 10, 80, 0.12);
            display: block;
        }

        .chat-online-dot {
            position: absolute;
            bottom: -1px;
            right: -1px;
            width: 11px;
            height: 11px;
            background: #10B981;
            border: 2px solid #fff;
            border-radius: 50%;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
        }

        .chat-online-dot.offline {
            background: #94A3B8;
        }

        .chat-header-info {
            flex: 1;
            min-width: 0;
        }

        .chat-header-title {
            display: flex;
            align-items: center;
            gap: 7px;
            line-height: 1.25;
        }

        .chat-header-name {
            font-size: 15.5px;
            font-weight: 700;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 220px;
        }

        .chat-header-verified {
            color: #10B981;
            font-size: 13.5px;
            flex-shrink: 0;
        }

        .chat-header-subtitle {
            font-size: 11.5px;
            color: var(--muted);
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 2px;
            line-height: 1.2;
        }

        .chat-active-indicator {
            color: #10B981;
            font-weight: 600;
            font-size: 11.5px;
        }

        .chat-active-indicator.offline {
            color: var(--muted);
            font-weight: 500;
        }

        /* Scrollable Message Container (Flex 1) */
        #scr-chat .chat-messages-container {
            width: 100%;
            flex: 1 1 0%;
            min-height: 0 !important;
            height: 100%;
            overflow-y: auto !important;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            box-sizing: border-box;
            position: relative;
            background:
                radial-gradient(circle at 12% 16%, rgba(123, 44, 191, 0.035), transparent 45%),
                radial-gradient(circle at 88% 84%, rgba(244, 180, 0, 0.03), transparent 45%),
                #F8F5FB;
        }

        .chat-messages-inner {
            width: 100%;
            max-width: 900px;
            margin: 0 auto;
            padding: 16px 16px 24px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-height: 100%;
            box-sizing: border-box;
            justify-content: flex-start;
        }

        .chat-security-badge {
            align-self: center;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 6px 14px;
            background: rgba(123, 44, 191, 0.08);
            border: 1px solid rgba(123, 44, 191, 0.15);
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
            color: var(--primary);
            text-align: center;
            margin: 4px auto 8px;
            box-shadow: 0 1px 4px rgba(45, 10, 80, 0.03);
        }

        .chat-security-badge i {
            font-size: 12px;
            color: var(--primary);
        }

        /* Message Rows and Bubbles */
        .chat-messages-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            width: 100%;
        }

        .chat-msg-row {
            display: flex;
            align-items: center;
            width: 100%;
            gap: 8px;
            position: relative;
            animation: chatFadeUp 0.18s ease-out;
        }

        .chat-msg-row.msg-me {
            justify-content: flex-end;
        }

        .chat-msg-row.msg-them {
            justify-content: flex-start;
        }

        @keyframes chatFadeUp {
            from {
                opacity: 0;
                transform: translateY(6px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Floating action buttons popup beside the bubble */
        .chat-msg-actions-popup {
            display: none;
            align-items: center;
            gap: 6px;
            background: #ffffff;
            padding: 4px 8px;
            border-radius: 24px;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
            border: 1px solid rgba(123, 44, 191, 0.16);
            animation: chatActionPop 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            z-index: 10;
            flex-shrink: 0;
            user-select: none;
        }

        .chat-msg-row.show-actions .chat-msg-actions-popup {
            display: inline-flex;
        }

        @media (hover: hover) and (pointer: fine) {
            .chat-msg-row:hover .chat-msg-actions-popup {
                display: inline-flex;
            }
        }

        @keyframes chatActionPop {
            0% {
                opacity: 0;
                transform: scale(0.7);
            }
            100% {
                opacity: 1;
                transform: scale(1);
            }
        }

        .chat-bubble-action-btn {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: none;
            background: #F3F4F6;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            color: #4B5563;
            transition: all 0.16s ease;
        }

        .chat-bubble-action-btn.btn-edit:hover,
        .chat-bubble-action-btn.btn-edit:active {
            background: #F3E8FF;
            color: var(--primary);
            transform: scale(1.12);
        }

        .chat-bubble-action-btn.btn-delete:hover,
        .chat-bubble-action-btn.btn-delete:active {
            background: #FEE2E2;
            color: #DC2626;
            transform: scale(1.12);
        }

        .chat-bubble {
            max-width: 82%;
            padding: 10px 14px 8px 14px;
            box-sizing: border-box;
            position: relative;
            word-wrap: break-word;
            word-break: break-word;
            cursor: pointer;
            transition: box-shadow 0.2s ease, transform 0.2s ease;
        }

        @media (min-width: 768px) {
            .chat-bubble {
                max-width: 70%;
            }
        }

        .chat-bubble.bubble-me {
            background: var(--grad-primary);
            color: #ffffff;
            border-radius: 18px 18px 4px 18px;
            box-shadow: 0 3px 10px rgba(123, 44, 191, 0.22);
        }

        .chat-msg-row.show-actions .chat-bubble.bubble-me {
            box-shadow: 0 0 0 2.5px #ffffff, 0 4px 18px rgba(123, 44, 191, 0.45);
            transform: scale(1.01);
        }

        .chat-bubble.bubble-me.is-editing {
            box-shadow: 0 0 0 2.5px #F4B400, 0 4px 18px rgba(244, 180, 0, 0.45);
            animation: pulseEditBubble 2s infinite ease-in-out;
        }

        @keyframes pulseEditBubble {
            0%, 100% { box-shadow: 0 0 0 2.5px #F4B400, 0 4px 16px rgba(244, 180, 0, 0.35); }
            50% { box-shadow: 0 0 0 3.5px #F4B400, 0 6px 22px rgba(244, 180, 0, 0.6); }
        }

        .chat-bubble.bubble-them {
            background: #ffffff;
            color: var(--text);
            border: 1px solid rgba(123, 44, 191, 0.12);
            border-radius: 18px 18px 18px 4px;
            box-shadow: 0 2px 8px rgba(45, 10, 80, 0.04);
        }

        .chat-msg-row.show-actions .chat-bubble.bubble-them {
            box-shadow: 0 0 0 2.5px var(--primary), 0 4px 14px rgba(123, 44, 191, 0.2);
        }

        .chat-bubble-text {
            font-size: 14px;
            line-height: 1.48;
            font-weight: 450;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .chat-bubble-meta {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 4px;
            margin-top: 4px;
            font-size: 10px;
        }

        .chat-bubble-edited {
            display: inline-flex;
            align-items: center;
            font-size: 10px;
            opacity: 0.88;
            font-weight: 500;
            margin-right: 4px;
            font-style: italic;
        }

        .bubble-me .chat-bubble-meta {
            color: rgba(255, 255, 255, 0.85);
        }

        .bubble-me .chat-bubble-edited {
            color: rgba(255, 255, 255, 0.92);
        }

        .bubble-them .chat-bubble-meta {
            color: var(--muted);
        }

        .bubble-them .chat-bubble-edited {
            color: var(--muted);
        }

        .chat-bubble-check {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.65);
            transition: color 0.25s ease, transform 0.2s ease;
            vertical-align: middle;
        }

        .chat-bubble-check.is-read {
            color: #38bdf8 !important;
            filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.45));
        }

        /* WhatsApp-Style Deleted Messages */
        .chat-deleted-text {
            font-style: italic;
            color: #6b7280;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 13.5px;
            font-weight: 500;
        }

        .chat-bubble.is-deleted {
            background: #f3f4f6 !important;
            color: #4b5563 !important;
            border: 1px dashed rgba(107, 114, 128, 0.35) !important;
            box-shadow: none !important;
        }

        .chat-bubble.bubble-me.is-deleted .chat-deleted-text,
        .chat-bubble.bubble-them.is-deleted .chat-deleted-text {
            color: #6b7280;
        }

        .chat-bubble.is-deleted .chat-bubble-meta {
            color: #9ca3af !important;
        }

        /* Empty State */
        .chat-empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 48px 20px;
            text-align: center;
            margin: auto;
            max-width: 360px;
        }

        .chat-empty-icon {
            width: 68px;
            height: 68px;
            border-radius: 24px;
            background: linear-gradient(135deg, rgba(123, 44, 191, 0.12) 0%, rgba(244, 180, 0, 0.12) 100%);
            border: 1px solid rgba(123, 44, 191, 0.18);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            color: var(--primary);
            margin-bottom: 16px;
        }

        .chat-empty-state h3 {
            font-size: 17px;
            font-weight: 700;
            color: var(--text);
            margin: 0 0 6px 0;
        }

        .chat-empty-state p {
            font-size: 13px;
            color: var(--muted);
            line-height: 1.5;
            margin: 0;
        }

        /* Fixed Bottom Bar (WhatsApp Input Bar) */
        #scr-chat .chat-bottom-bar {
            flex-shrink: 0;
            position: sticky;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 60;
            width: 100%;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border-top: 1px solid rgba(123, 44, 191, 0.12);
            box-shadow: 0 -4px 16px rgba(45, 10, 80, 0.04);
            padding-top: 10px;
            padding-bottom: max(12px, env(safe-area-inset-bottom));
            padding-left: 14px;
            padding-right: 14px;
            box-sizing: border-box;
        }

        .chat-bottom-inner {
            display: flex;
            align-items: flex-end;
            gap: 10px;
            width: 100%;
            max-width: 900px;
            margin: 0 auto;
        }

        .chat-input-wrapper {
            flex: 1;
            position: relative;
            min-width: 0;
        }

        .chat-input-pill {
            width: 100%;
            min-height: 46px;
            max-height: 125px;
            border-radius: 23px !important;
            padding: 12px 18px !important;
            font-size: 14.5px !important;
            line-height: 1.42 !important;
            font-family: inherit !important;
            background: #F6F2FA !important;
            border: 1.5px solid rgba(123, 44, 191, 0.16) !important;
            color: var(--text) !important;
            box-sizing: border-box;
            outline: none !important;
            resize: none !important;
            overflow-y: hidden;
            display: block;
            word-wrap: break-word;
            word-break: break-word;
            white-space: pre-wrap;
            transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
        }

        .chat-input-pill:focus {
            background: #ffffff !important;
            border-color: var(--primary) !important;
            box-shadow: 0 0 0 3.5px rgba(123, 44, 191, 0.14) !important;
        }

        .chat-input-pill::-webkit-scrollbar {
            width: 4px;
        }

        .chat-input-pill::-webkit-scrollbar-thumb {
            background: rgba(123, 44, 191, 0.25);
            border-radius: 4px;
        }

        .chat-send-btn {
            width: 46px;
            height: 46px;
            border-radius: 50% !important;
            background: var(--grad-primary) !important;
            color: #ffffff !important;
            border: none !important;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            box-shadow: 0 4px 14px rgba(123, 44, 191, 0.35) !important;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        .chat-send-btn:hover {
            transform: scale(1.06);
            box-shadow: 0 6px 18px rgba(123, 44, 191, 0.45) !important;
        }

        .chat-send-btn.editing-active {
            background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
            box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
        }

        .chat-send-btn.editing-active i {
            margin-left: 0;
            font-size: 16px;
        }

        /* Edit Message Banner Above Input Bar */
        .chat-edit-bar {
            display: none;
            align-items: center;
            justify-content: space-between;
            background: #F4E8FC;
            border-left: 4px solid var(--primary);
            border-radius: 12px;
            padding: 8px 14px;
            margin: 0 auto 8px auto;
            max-width: 900px;
            gap: 12px;
            box-shadow: 0 2px 8px rgba(123, 44, 191, 0.08);
            animation: chatEditSlideDown 0.2s ease-out;
        }

        @keyframes chatEditSlideDown {
            from {
                opacity: 0;
                transform: translateY(8px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .chat-edit-content {
            display: flex;
            align-items: center;
            gap: 10px;
            overflow: hidden;
            flex: 1;
        }

        .chat-edit-icon {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            background: rgba(123, 44, 191, 0.15);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            flex-shrink: 0;
        }

        .chat-edit-texts {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .chat-edit-title {
            font-size: 11px;
            font-weight: 700;
            color: var(--primary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 2px;
        }

        .chat-edit-snippet {
            font-size: 13px;
            color: #374151;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-weight: 500;
        }

        .chat-edit-close-btn {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: none;
            background: rgba(0, 0, 0, 0.05);
            color: #4B5563;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.15s ease;
            flex-shrink: 0;
        }

        .chat-edit-close-btn:hover {
            background: rgba(0, 0, 0, 0.12);
            color: #111827;
        }

        /* Desktop Container Aesthetics (WhatsApp Web Look) */
        @media (min-width: 1024px) {
            #scr-chat {
                align-items: center;
                background: #F1ECF7;
            }

            #scr-chat .chat-header {
                background: rgba(255, 255, 255, 0.98);
                border-left: 1px solid rgba(123, 44, 191, 0.1);
                border-right: 1px solid rgba(123, 44, 191, 0.1);
                max-width: 900px;
                border-top-left-radius: 16px;
                border-top-right-radius: 16px;
                margin-top: 12px;
            }

            #scr-chat .chat-messages-container {
                max-width: 900px;
                border-left: 1px solid rgba(123, 44, 191, 0.1);
                border-right: 1px solid rgba(123, 44, 191, 0.1);
            }

            #scr-chat .chat-bottom-bar {
                background: rgba(255, 255, 255, 0.98);
                border-left: 1px solid rgba(123, 44, 191, 0.1);
                border-right: 1px solid rgba(123, 44, 191, 0.1);
                max-width: 900px;
                border-bottom-left-radius: 16px;
                border-bottom-right-radius: 16px;
                margin-bottom: 12px;
            }
        }
