/* =============================================================================
   desktop.css — Additive desktop layer for QMiniRoid v3
   Rules are scoped to min-width: 992px (Bootstrap lg) unless noted.
   NEVER overrides mobile base styles — additive only.
   ============================================================================= */

/* =============================================================================
   DESKTOP LAYOUT
   RTL note: CSS grid columns render right-to-left with dir="rtl":
     - Column 1 (240px nav) → appears on the RIGHT side of screen
     - Column 2 (1fr main)  → appears in the center/left
     - Column 3 (300px)     → appears on the LEFT side (only on pages with sidebar-right)
   ============================================================================= */

@media (min-width: 992px) {

    body.desktop-layout-body #page {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    /* Default: nav sidebar (right in RTL) + main content */
    .desktop-layout-wrap {
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 24px;
        max-width: 1200px;
        width: 100%;
        margin: 0 auto;
        padding: 24px 24px 40px;
        flex: 1;
        transition: grid-template-columns .22s ease;
    }

    /* Pages that also provide a right-sidebar (left side in RTL): add third column */
    .desktop-layout-wrap.has-sidebar-right {
        grid-template-columns: 240px 1fr 300px;
    }

    /* Collapsed nav rail (icon-only) */
    .desktop-layout-wrap.is-nav-collapsed {
        grid-template-columns: 72px 1fr;
    }

    .desktop-layout-wrap.is-nav-collapsed.has-sidebar-right {
        grid-template-columns: 72px 1fr 300px;
    }

    .desktop-main {
        min-width: 0;
    }

    /* Navigation sidebar (right side in RTL) */
    .desktop-sidebar-nav-wrap {
        position: sticky;
        top: 80px;
        height: fit-content;
        align-self: start;
    }

    /* Optional content sidebar (left side in RTL — download box, meta, etc.) */
    .desktop-sidebar-right {
        position: sticky;
        top: 80px;
        height: fit-content;
        align-self: start;
    }
}

@media (min-width: 1400px) {
    .desktop-layout-wrap {
        grid-template-columns: 240px 1fr;
        max-width: 1400px;
    }
    .desktop-layout-wrap.has-sidebar-right {
        grid-template-columns: 240px 1fr 320px;
    }
    .desktop-layout-wrap.is-nav-collapsed {
        grid-template-columns: 72px 1fr;
    }
    .desktop-layout-wrap.is-nav-collapsed.has-sidebar-right {
        grid-template-columns: 72px 1fr 320px;
    }
}

/* =============================================================================
   LEFT SIDEBAR NAV (navigation sidebar — right side in RTL)
   ============================================================================= */

@media (min-width: 992px) {

    .desktop-sidebar-nav {
        background: var(--bs-body-bg, #fff);
        border: 1px solid rgba(15, 23, 42, .06);
        border-radius: 18px;
        padding: 14px 10px;
        box-shadow: 0 6px 24px -12px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .04);
    }

    .theme-dark .desktop-sidebar-nav {
        background: #0f1117;
        border-color: rgba(255, 255, 255, .06);
        box-shadow: 0 6px 24px -12px rgba(0, 0, 0, .6);
    }

    .desktop-sidebar-nav__section + .desktop-sidebar-nav__section {
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid rgba(15, 23, 42, .06);
    }

    .theme-dark .desktop-sidebar-nav__section + .desktop-sidebar-nav__section {
        border-top-color: rgba(255, 255, 255, .06);
    }

    .desktop-sidebar-nav__heading {
        display: block;
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .04em;
        color: var(--mini-app-subtitle, #6b7280);
        opacity: .8;
        padding: 4px 12px 10px;
    }

    .desktop-sidebar-nav__list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .desktop-sidebar-nav__link {
        position: relative;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 9px 12px;
        border-radius: 13px;
        text-decoration: none;
        font-size: .82rem;
        font-weight: 600;
        color: var(--app-detail-h1, #111827);
        transition: background-color .16s ease, color .16s ease;
    }

    .theme-dark .desktop-sidebar-nav__link {
        color: #e4e6eb;
    }

    /* Icon tile (wrapper keeps duotone glyph layers intact) */
    .desktop-sidebar-nav__icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        flex-shrink: 0;
        line-height: 0;
        background: rgba(15, 23, 42, .05);
        color: var(--mini-app-subtitle, #6b7280);
        transition: background-color .16s ease, color .16s ease, transform .16s ease;
    }

    .desktop-sidebar-nav__icon i {
        font-size: 1.2rem;
        line-height: 1;
        color: inherit;
    }

    .theme-dark .desktop-sidebar-nav__icon {
        background: rgba(255, 255, 255, .06);
        color: #b0b3b8;
    }

    /* Hover */
    .desktop-sidebar-nav__link:hover {
        background: rgba(76, 201, 134, .08);
        color: #2f9e69;
        text-decoration: none;
    }

    .desktop-sidebar-nav__link:hover .desktop-sidebar-nav__icon {
        background: rgba(76, 201, 134, .16);
        color: #36a96d;
        transform: scale(1.05);
    }

    .theme-dark .desktop-sidebar-nav__link:hover {
        background: rgba(76, 201, 134, .12);
        color: #6ee7b0;
    }

    /* Active */
    .desktop-sidebar-nav__link.is-active {
        background: linear-gradient(90deg, rgba(76, 201, 134, .16), rgba(76, 201, 134, .05));
        color: #2f9e69;
    }

    .theme-dark .desktop-sidebar-nav__link.is-active {
        background: linear-gradient(90deg, rgba(76, 201, 134, .22), rgba(76, 201, 134, .06));
        color: #6ee7b0;
    }

    .desktop-sidebar-nav__link.is-active .desktop-sidebar-nav__icon {
        background: linear-gradient(135deg, #4cc986, #36a96d);
        color: #fff;
        box-shadow: 0 4px 10px rgba(76, 201, 134, .35);
    }

    /* Active accent bar on the inline-start edge (right in RTL) */
    .desktop-sidebar-nav__link.is-active::before {
        content: "";
        position: absolute;
        inset-inline-start: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 22px;
        border-radius: 0 3px 3px 0;
        background: linear-gradient(180deg, #4cc986, #36a96d);
    }

    .desktop-sidebar-nav__link:focus-visible {
        outline: 2px solid #4cc986;
        outline-offset: 2px;
    }

    /* ── Collapse control ──────────────────────────────────────────────── */
    .desktop-sidebar-nav__topbar {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 0 2px 2px;
        margin-bottom: 4px;
    }

    .desktop-sidebar-nav__collapse {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: rgba(15, 23, 42, .05);
        color: var(--mini-app-subtitle, #6b7280);
        cursor: pointer;
        transition: background-color .16s ease, color .16s ease, transform .16s ease;
    }

    .desktop-sidebar-nav__collapse i {
        font-size: 1rem;
        line-height: 1;
        transition: transform .22s ease;
    }

    .desktop-sidebar-nav__collapse:hover {
        background: rgba(76, 201, 134, .16);
        color: #36a96d;
    }

    .desktop-sidebar-nav__collapse:focus-visible {
        outline: 2px solid #4cc986;
        outline-offset: 2px;
    }

    .theme-dark .desktop-sidebar-nav__collapse {
        background: rgba(255, 255, 255, .06);
        color: #b0b3b8;
    }

    /* ── Collapsed (icon-only rail) state ──────────────────────────────── */
    .is-nav-collapsed .desktop-sidebar-nav {
        padding: 14px 8px;
    }

    .is-nav-collapsed .desktop-sidebar-nav__topbar {
        justify-content: center;
    }

    .is-nav-collapsed .desktop-sidebar-nav__collapse i {
        transform: rotate(180deg);
    }

    .is-nav-collapsed .desktop-sidebar-nav__heading {
        display: none;
    }

    .is-nav-collapsed .desktop-sidebar-nav__section + .desktop-sidebar-nav__section {
        margin-top: 10px;
        padding-top: 10px;
    }

    .is-nav-collapsed .desktop-sidebar-nav__link {
        justify-content: center;
        gap: 0;
        padding: 7px;
    }

    .is-nav-collapsed .desktop-sidebar-nav__label {
        display: none;
    }

    .is-nav-collapsed .desktop-sidebar-nav__link.is-active::before {
        display: none;
    }
}

/* =============================================================================
   DESKTOP STICKY HEADER
   ============================================================================= */

@media (min-width: 992px) {

    .desktop-header {
        height: 68px;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, .82);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
        border-bottom: 1px solid rgba(0, 0, 0, .06);
        padding: 0 24px;
        box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 6px 20px rgba(15, 23, 42, .05);
    }

    .theme-dark .desktop-header {
        background: rgba(15, 17, 23, .78);
        border-bottom-color: rgba(255, 255, 255, .06);
        box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 6px 20px rgba(0, 0, 0, .4);
    }

    .desktop-header__inner {
        display: flex;
        align-items: center;
        gap: 18px;
        max-width: 1400px;
        width: 100%;
        margin: 0 auto;
        height: 100%;
    }

    /* Logo */
    .desktop-header__logo {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        flex-shrink: 0;
        color: inherit;
    }

    .desktop-header__logo:hover { text-decoration: none; }

    .desktop-header__logo-img {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        object-fit: contain;
        transition: transform .2s ease, box-shadow .2s ease;
    }

    .desktop-header__logo:hover .desktop-header__logo-img {
        transform: translateY(-1px) scale(1.04);
        box-shadow: 0 6px 16px rgba(76, 201, 134, .28);
    }

    .desktop-header__logo-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
        line-height: 1.1;
        text-align: center;
    }

    .desktop-header__logo-name {
        font-weight: 800;
        font-size: 1.08rem;
        letter-spacing: .2px;
        white-space: nowrap;
        background: linear-gradient(135deg, #34d399 0%, #4cc986 45%, #2dd4bf 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: #36a96d; /* fallback for unsupported browsers */
    }

    .desktop-header__logo-name-fa {
        font-size: 12px;
        font-weight: 700;
        line-height: 1.25;
        color: #0f1117;
        white-space: nowrap;
    }

    .theme-dark .desktop-header__logo-name-fa {
        color: #f3f4f6;
    }

    /* Search bar */
    .desktop-header__search {
        flex: 1;
        min-width: 0;
    }

    .desktop-header__search-inner {
        position: relative;
        display: flex;
        align-items: center;
        max-width: 560px;
        margin: 0 auto;
    }

    .desktop-header__search-icon {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.15rem;
        pointer-events: none;
        opacity: .55;
        transition: opacity .2s ease, color .2s ease;
    }

    .desktop-header__search-input {
        width: 100%;
        height: 44px;
        padding: 0 44px 0 38px;
        border-radius: 999px;
        border: 1.5px solid transparent;
        background: rgba(15, 23, 42, .05);
        color: inherit;
        font-family: inherit;
        font-size: .9rem;
        transition: border-color .2s, box-shadow .2s, background-color .2s;
        text-align: right;
    }

    .desktop-header__search-input::placeholder {
        color: rgba(15, 23, 42, .45);
    }

    .theme-dark .desktop-header__search-input {
        background: rgba(255, 255, 255, .06);
        color: #edebeb;
    }

    .theme-dark .desktop-header__search-input::placeholder {
        color: rgba(255, 255, 255, .4);
    }

    .desktop-header__search-input:focus {
        outline: none;
        border-color: #4cc986;
        background: var(--bs-body-bg, #fff);
        box-shadow: 0 0 0 4px rgba(76, 201, 134, .15);
    }

    .theme-dark .desktop-header__search-input:focus {
        background: #1a1d23;
    }

    .desktop-header__search-inner:focus-within .desktop-header__search-icon {
        opacity: 1;
        color: #4cc986;
    }

    /* Keyboard shortcut hint ( "/" focuses the search ) */
    .desktop-header__search-kbd {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        padding: 0 7px;
        border-radius: 6px;
        font-family: inherit;
        font-size: .8rem;
        font-weight: 700;
        line-height: 1;
        color: rgba(15, 23, 42, .5);
        background: rgba(15, 23, 42, .06);
        border: 1px solid rgba(15, 23, 42, .08);
        pointer-events: none;
    }

    .theme-dark .desktop-header__search-kbd {
        color: rgba(255, 255, 255, .55);
        background: rgba(255, 255, 255, .08);
        border-color: rgba(255, 255, 255, .12);
    }

    /* Hide the hint while focused or when the field has text */
    .desktop-header__search-input:focus ~ .desktop-header__search-kbd,
    .desktop-header__search-input:not(:placeholder-shown) ~ .desktop-header__search-kbd {
        display: none;
    }

    /* Hairline brand accent along the bottom edge */
    .desktop-header::after {
        content: "";
        position: absolute;
        inset-inline: 0;
        bottom: 0;
        height: 2px;
        background: linear-gradient(90deg, rgba(76, 201, 134, 0) 0%, rgba(76, 201, 134, .55) 50%, rgba(76, 201, 134, 0) 100%);
        opacity: .7;
        pointer-events: none;
    }

    /* ── Live-search dropdown ──────────────────────────────────────────────── */
    .desktop-header__suggest {
        position: absolute;
        top: calc(100% + 10px);
        inset-inline: 0;
        z-index: 1100;
        background: var(--bs-body-bg, #fff);
        border: 1px solid rgba(15, 23, 42, .07);
        border-radius: 18px;
        box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .28), 0 8px 20px rgba(15, 23, 42, .08);
        overflow: hidden;
        padding: 8px;
        animation: desktopSuggestIn .18s cubic-bezier(.16, 1, .3, 1);
    }

    .theme-dark .desktop-header__suggest {
        background: #14161c;
        border-color: rgba(255, 255, 255, .08);
        box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
    }

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

    .desktop-header__suggest-list {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .desktop-header__suggest-item {
        position: relative;
        display: flex;
        align-items: center;
        gap: 13px;
        padding: 10px 12px;
        border-radius: 13px;
        text-decoration: none;
        color: inherit;
        cursor: pointer;
        transition: background-color .15s ease;
    }

    .desktop-header__suggest-item:hover,
    .desktop-header__suggest-item.is-active {
        background: linear-gradient(90deg, rgba(76, 201, 134, .14), rgba(76, 201, 134, .06));
        text-decoration: none;
    }

    .theme-dark .desktop-header__suggest-item:hover,
    .theme-dark .desktop-header__suggest-item.is-active {
        background: linear-gradient(90deg, rgba(76, 201, 134, .2), rgba(76, 201, 134, .07));
    }

    .desktop-header__suggest-item:hover .desktop-header__suggest-name,
    .desktop-header__suggest-item.is-active .desktop-header__suggest-name {
        color: #2f9e69;
    }

    .theme-dark .desktop-header__suggest-item:hover .desktop-header__suggest-name,
    .theme-dark .desktop-header__suggest-item.is-active .desktop-header__suggest-name {
        color: #6ee7b0;
    }

    .desktop-header__suggest-icon {
        width: 48px;
        height: 48px;
        border-radius: 13px;
        object-fit: cover;
        flex-shrink: 0;
        background: rgba(15, 23, 42, .05);
        border: 1px solid rgba(15, 23, 42, .06);
        box-shadow: 0 3px 8px rgba(15, 23, 42, .1);
        transition: transform .15s ease, box-shadow .15s ease;
    }

    .theme-dark .desktop-header__suggest-icon {
        background: rgba(255, 255, 255, .05);
        border-color: rgba(255, 255, 255, .08);
        box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
    }

    .desktop-header__suggest-item:hover .desktop-header__suggest-icon,
    .desktop-header__suggest-item.is-active .desktop-header__suggest-icon {
        transform: scale(1.05);
        box-shadow: 0 6px 14px rgba(76, 201, 134, .3);
    }

    .desktop-header__suggest-body {
        min-width: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .desktop-header__suggest-name {
        font-size: .92rem;
        font-weight: 600;
        line-height: 1.35;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: color .15s ease;
    }

    .desktop-header__suggest-meta {
        font-size: .77rem;
        color: var(--mini-app-subtitle, #6b7280);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .desktop-header__suggest-rating {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        font-size: .76rem;
        font-weight: 700;
        color: #d97706;
        background: rgba(245, 158, 11, .12);
        padding: 4px 9px;
        border-radius: 999px;
        white-space: nowrap;
    }

    .desktop-header__suggest-rating span { color: #f59e0b; }

    .theme-dark .desktop-header__suggest-rating {
        color: #fbbf24;
        background: rgba(245, 158, 11, .16);
    }

    .desktop-header__suggest-more {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 6px;
        padding: 12px;
        border-radius: 13px;
        font-size: .86rem;
        font-weight: 700;
        color: #36a96d;
        text-decoration: none;
        background: rgba(76, 201, 134, .09);
        border: 1px dashed rgba(76, 201, 134, .35);
        transition: background-color .15s ease, color .15s ease, border-color .15s ease;
    }

    .desktop-header__suggest-more:hover {
        background: linear-gradient(135deg, #4cc986, #36a96d);
        border-color: transparent;
        color: #fff;
        text-decoration: none;
        box-shadow: 0 6px 16px rgba(76, 201, 134, .3);
    }

    .desktop-header__suggest-more i {
        font-size: 1rem;
        transition: transform .15s ease;
    }

    .desktop-header__suggest-more:hover i { transform: translateX(-4px); }

    /* Status rows (loading / empty) */
    .desktop-header__suggest-status {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 20px 12px;
        font-size: .85rem;
        color: var(--mini-app-subtitle, #6b7280);
        text-align: center;
    }

    .desktop-header__suggest-spinner {
        width: 16px;
        height: 16px;
        border: 2px solid rgba(76, 201, 134, .25);
        border-top-color: #4cc986;
        border-radius: 50%;
        animation: desktopSuggestSpin .7s linear infinite;
    }

    @keyframes desktopSuggestSpin {
        to { transform: rotate(360deg); }
    }

    .desktop-header__suggest mark {
        background: transparent;
        color: #36a96d;
        font-weight: 700;
        padding: 0;
    }

    /* Type filter chips (segmented control with sliding indicator) */
    .desktop-header__suggest-chips {
        position: relative;
        display: inline-flex;
        gap: 2px;
        padding: 4px;
        margin: 0 4px 8px;
        background: rgba(15, 23, 42, .05);
        border-radius: 999px;
        width: fit-content;
    }

    .theme-dark .desktop-header__suggest-chips {
        background: rgba(255, 255, 255, .06);
    }

    /* Sliding active pill — positioned by JS over the active chip */
    .desktop-header__suggest-chip-indicator {
        position: absolute;
        top: 4px;
        left: 0;
        height: calc(100% - 8px);
        width: 0;
        border-radius: 999px;
        background: linear-gradient(135deg, #4cc986, #36a96d);
        box-shadow: 0 4px 12px rgba(76, 201, 134, .35);
        transform: translateX(0);
        transition: transform .28s cubic-bezier(.16, 1, .3, 1), width .28s cubic-bezier(.16, 1, .3, 1);
        pointer-events: none;
        z-index: 0;
        opacity: 0;
    }

    .desktop-header__suggest-chips.is-ready .desktop-header__suggest-chip-indicator {
        opacity: 1;
    }

    .desktop-header__suggest-chip {
        position: relative;
        z-index: 1;
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 14px;
        border-radius: 999px;
        border: none;
        background: transparent;
        color: var(--mini-app-subtitle, #6b7280);
        font-family: inherit;
        font-size: .8rem;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
        transition: color .18s ease;
    }

    .desktop-header__suggest-chip i {
        font-size: 1.05rem;
        line-height: 1;
        opacity: .85;
    }

    .desktop-header__suggest-chip:hover:not(.is-active) {
        color: #36a96d;
    }

    .desktop-header__suggest-chip.is-active {
        color: #fff;
    }

    .desktop-header__suggest-chip.is-active i { opacity: 1; }

    .desktop-header__suggest-chip:focus-visible {
        outline: 2px solid #4cc986;
        outline-offset: 2px;
    }

    /* Per-type count badge */
    .desktop-header__suggest-chip-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        font-size: .68rem;
        font-weight: 700;
        line-height: 1;
        background: rgba(15, 23, 42, .1);
        color: inherit;
    }

    .theme-dark .desktop-header__suggest-chip-count {
        background: rgba(255, 255, 255, .12);
    }

    .desktop-header__suggest-chip.is-active .desktop-header__suggest-chip-count {
        background: rgba(255, 255, 255, .25);
        color: #fff;
    }

    /* Disabled chip (no results for that type) */
    .desktop-header__suggest-chip.is-empty {
        opacity: .4;
        pointer-events: none;
    }

    /* Icon fallback (first letter) */
    .desktop-header__suggest-icon--fallback {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 1.1rem;
        color: #36a96d;
        background: rgba(76, 201, 134, .12);
        border-color: rgba(76, 201, 134, .2);
    }

    /* Skeleton loading rows */
    .desktop-header__suggest-skeleton {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 9px 10px;
    }

    .desktop-header__suggest-skel-icon {
        width: 44px;
        height: 44px;
        border-radius: 11px;
        flex-shrink: 0;
    }

    .desktop-header__suggest-skel-lines {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 7px;
    }

    .desktop-header__suggest-skel-line {
        height: 11px;
        border-radius: 6px;
        width: 70%;
    }

    .desktop-header__suggest-skel-line--sm { width: 40%; height: 9px; }

    .desktop-header__suggest-skel-icon,
    .desktop-header__suggest-skel-line {
        background: linear-gradient(90deg,
            rgba(15, 23, 42, .06) 25%,
            rgba(15, 23, 42, .12) 37%,
            rgba(15, 23, 42, .06) 63%);
        background-size: 400% 100%;
        animation: desktopSkeleton 1.3s ease infinite;
    }

    .theme-dark .desktop-header__suggest-skel-icon,
    .theme-dark .desktop-header__suggest-skel-line {
        background: linear-gradient(90deg,
            rgba(255, 255, 255, .05) 25%,
            rgba(255, 255, 255, .1) 37%,
            rgba(255, 255, 255, .05) 63%);
        background-size: 400% 100%;
    }

    @keyframes desktopSkeleton {
        0%   { background-position: 100% 0; }
        100% { background-position: 0 0; }
    }

    /* Recent searches */
    .desktop-header__suggest-recent-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 10px 8px;
        font-size: .76rem;
        font-weight: 700;
        color: var(--mini-app-subtitle, #6b7280);
    }

    .desktop-header__suggest-recent-clear {
        border: none;
        background: none;
        color: #36a96d;
        font-family: inherit;
        font-size: .76rem;
        font-weight: 700;
        cursor: pointer;
        padding: 2px 4px;
    }

    .desktop-header__suggest-recent-clear:hover { text-decoration: underline; }

    .desktop-header__suggest-recent {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 10px;
        border-radius: 10px;
        cursor: pointer;
        transition: background-color .14s ease;
    }

    .desktop-header__suggest-recent:hover,
    .desktop-header__suggest-recent.is-active {
        background: rgba(76, 201, 134, .1);
    }

    .theme-dark .desktop-header__suggest-recent:hover,
    .theme-dark .desktop-header__suggest-recent.is-active {
        background: rgba(76, 201, 134, .14);
    }

    .desktop-header__suggest-recent > i {
        font-size: 1.15rem;
        opacity: .6;
        flex-shrink: 0;
    }

    .desktop-header__suggest-recent-text {
        flex: 1;
        min-width: 0;
        font-size: .88rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .desktop-header__suggest-recent-remove {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        border-radius: 7px;
        border: none;
        background: transparent;
        color: var(--mini-app-subtitle, #6b7280);
        cursor: pointer;
        opacity: .6;
        transition: background-color .14s ease, opacity .14s ease;
    }

    .desktop-header__suggest-recent-remove:hover {
        opacity: 1;
        background: rgba(15, 23, 42, .07);
    }

    .theme-dark .desktop-header__suggest-recent-remove:hover {
        background: rgba(255, 255, 255, .08);
    }

    @media (prefers-reduced-motion: reduce) {
        .desktop-header__suggest,
        .desktop-header__suggest-skel-icon,
        .desktop-header__suggest-skel-line {
            animation: none;
        }
    }

    .desktop-header__search-clear {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
        opacity: .5;
        font-size: .9rem;
        line-height: 1;
        color: inherit;
    }

    .desktop-header__search-clear:hover { opacity: 1; }

    /* Right cluster (toggle + member area) */
    .desktop-header__actions {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }

    /* Icon-only buttons (dark/light toggle) */
    .desktop-header__icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 12px;
        border: 1px solid transparent;
        background: rgba(15, 23, 42, .05);
        cursor: pointer;
        font-size: 1.2rem;
        line-height: 1;
        color: inherit;
        transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
    }

    .desktop-header__icon-btn i {
        width: 1em;
        height: 1em;
        flex-shrink: 0;
    }

    .desktop-header__icon-btn:hover {
        background: rgba(76, 201, 134, .12);
        color: #4cc986;
        transform: translateY(-1px);
    }

    .theme-dark .desktop-header__icon-btn {
        background: rgba(255, 255, 255, .06);
    }

    .theme-dark .desktop-header__icon-btn:hover {
        background: rgba(76, 201, 134, .16);
    }

    /* Keep flex centering for the visible toggle (overrides .show-on-theme-* display:block) */
    .theme-light .desktop-header__icon-btn.show-on-theme-light,
    .theme-dark .desktop-header__icon-btn.show-on-theme-dark {
        display: inline-flex;
    }

    /* Login button (guest) */
    .desktop-header__login-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 9px 18px;
        border-radius: 999px;
        border: none;
        background: linear-gradient(135deg, #4cc986 0%, #36a96d 100%);
        color: #ffffff;
        font-family: inherit;
        font-size: .88rem;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 6px 16px rgba(76, 201, 134, .3);
        transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
        white-space: nowrap;
    }

    .desktop-header__login-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(76, 201, 134, .38);
        filter: brightness(1.03);
    }

    .desktop-header__login-btn:active {
        transform: translateY(0);
        box-shadow: 0 4px 10px rgba(76, 201, 134, .3);
    }

    .desktop-header__login-btn i {
        font-size: 1.15rem;
        width: 1em;
        height: 1em;
        flex-shrink: 0;
    }

    .desktop-header__login-btn span {
        display: inline-block;
        line-height: 1.2;
    }

    /* Keyboard focus ring for header controls */
    .desktop-header__icon-btn:focus-visible,
    .desktop-header__login-btn:focus-visible,
    .desktop-header__member-btn:focus-visible {
        outline: 2px solid #4cc986;
        outline-offset: 2px;
    }

    /* Member authenticated area */
    .desktop-header__member-wrap {
        position: relative;
    }

    .desktop-header__member-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 5px 12px 5px 8px;
        border-radius: 20px;
        border: 1.5px solid rgba(0, 0, 0, .1);
        background: transparent;
        color: inherit;
        font-family: inherit;
        font-size: .85rem;
        font-weight: 600;
        cursor: pointer;
        transition: border-color .15s, background .15s;
    }

    .desktop-header__member-btn:hover {
        border-color: #4cc986;
        background: rgba(76, 201, 134, .06);
    }

    .theme-dark .desktop-header__member-btn {
        border-color: rgba(255, 255, 255, .12);
    }

    .desktop-header__member-avatar {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #4cc986;
        color: #0b1b13;
        font-size: .78rem;
        font-weight: 700;
        flex-shrink: 0;
    }

    .desktop-header__member-name {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .desktop-header__member-caret {
        font-size: .8rem;
        opacity: .6;
        transition: transform .2s;
    }

    .desktop-header__member-wrap:hover .desktop-header__member-caret {
        transform: rotate(180deg);
    }

    /* Dropdown menu */
    .desktop-header__member-dropdown {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 0; /* RTL: opens to left edge */
        min-width: 180px;
        background: var(--bs-body-bg, #fff);
        border-radius: 12px;
        border: 1px solid rgba(0, 0, 0, .08);
        box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
        list-style: none;
        margin: 0;
        padding: 6px 0;
        z-index: 9999;
    }

    .theme-dark .desktop-header__member-dropdown {
        background: #1a1d23;
        border-color: rgba(255, 255, 255, .1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    }

    .desktop-header__member-wrap:hover .desktop-header__member-dropdown,
    .desktop-header__member-wrap:focus-within .desktop-header__member-dropdown {
        display: block;
    }

    .desktop-header__member-item {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 9px 16px;
        font-size: .85rem;
        font-weight: 500;
        font-family: inherit;
        color: inherit;
        text-decoration: none;
        background: none;
        border: none;
        cursor: pointer;
        text-align: right;
        white-space: nowrap;
        transition: background .15s;
    }

    .desktop-header__member-item:hover {
        background: rgba(0, 0, 0, .04);
        text-decoration: none;
        color: inherit;
    }

    .theme-dark .desktop-header__member-item:hover {
        background: rgba(255, 255, 255, .06);
    }

    .desktop-header__member-item--danger:hover {
        background: rgba(237, 85, 101, .08);
        color: #ed5565;
    }

    .desktop-header__member-item i { font-size: 1rem; opacity: .75; }

    .desktop-header__member-divider {
        height: 1px;
        background: rgba(0, 0, 0, .06);
        margin: 4px 0;
    }

    .theme-dark .desktop-header__member-divider {
        background: rgba(255, 255, 255, .07);
    }
}

/* =============================================================================
   DESKTOP FOOTER — dark brand design
   ============================================================================= */

.desktop-footer {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(120% 140% at 88% 0%, rgba(76, 201, 134, .12) 0%, rgba(76, 201, 134, 0) 42%),
        linear-gradient(180deg, #1c1d33 0%, #16172a 100%);
    color: #e2e8f0;
    padding: 56px 0 0;
    margin-top: auto;
    overflow: hidden;
}

/* Thin gradient accent line pinned to the top edge */
.desktop-footer__accent {
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    height: 3px;
    background: linear-gradient(90deg, #4cc986 0%, #38bdf8 50%, #4cc986 100%);
    opacity: .9;
    z-index: 1;
}

.desktop-footer__container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.desktop-footer__grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

@media (max-width: 1199px) {
    .desktop-footer__grid {
        grid-template-columns: 1.4fr 1fr 1fr;
        gap: 36px;
    }
    .desktop-footer__brand-col { grid-column: 1 / -1; }
}

.desktop-footer__brand-col {
    max-width: 340px;
}

.desktop-footer__brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    margin-bottom: 16px;
}

.desktop-footer__brand-link:hover { text-decoration: none; color: #4cc986; }

.desktop-footer__brand-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, .04);
    padding: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

.desktop-footer__brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: .2px;
}

.desktop-footer__brand-tagline {
    font-size: .85rem;
    color: #9aa6bd;
    line-height: 1.9;
    margin: 0 0 20px;
}

.desktop-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.desktop-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    line-height: 0;
    color: #cbd5e1;
    font-size: 1.15rem;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    text-decoration: none;
    transition: transform .2s ease, color .2s ease, background-color .2s ease, border-color .2s ease;
}

.desktop-footer__social-link:hover {
    color: #fff;
    background: #4cc986;
    border-color: #4cc986;
    transform: translateY(-3px);
    text-decoration: none;
}

.desktop-footer__heading {
    position: relative;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px;
    padding-inline-start: 14px;
}

.desktop-footer__heading::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(180deg, #4cc986, #36a96d);
}

.desktop-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.desktop-footer__links li { margin-bottom: 12px; }

.desktop-footer__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #9aa6bd;
    text-decoration: none;
    font-size: 13.5px;
    padding-inline-start: 0;
    transition: color .2s ease, padding-inline-start .2s ease;
}

.desktop-footer__link::before {
    content: "\203A"; /* RTL-friendly chevron */
    margin-inline-end: 0;
    max-width: 0;
    opacity: 0;
    color: #4cc986;
    overflow: hidden;
    transition: max-width .2s ease, opacity .2s ease, margin-inline-end .2s ease;
}

.desktop-footer__link:hover {
    color: #4cc986;
    text-decoration: none;
}

.desktop-footer__link:hover::before {
    max-width: 1em;
    opacity: 1;
    margin-inline-end: 6px;
}

.desktop-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px 0;
    font-size: 13px;
    color: #7c8aa3;
}

.desktop-footer__copy { line-height: 1.6; }

.desktop-footer__top-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    cursor: pointer;
    transition: transform .2s ease, color .2s ease, background-color .2s ease, border-color .2s ease;
}

.desktop-footer__top-btn i { font-size: 1rem; transition: transform .2s ease; }

.desktop-footer__top-btn:hover {
    color: #fff;
    background: #4cc986;
    border-color: #4cc986;
}

.desktop-footer__top-btn:hover i { transform: translateY(-2px); }

/* =============================================================================
   APP CARDS — desktop style
   ============================================================================= */

.desktop-app-card {
    display: flex;
    flex-direction: column;
    background: var(--bs-body-bg, #fff);
    border-radius: 16px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, .06);
}

.desktop-app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .10);
    text-decoration: none;
    color: inherit;
}

.theme-dark .desktop-app-card {
    background: #0f1117;
    border-color: rgba(255, 255, 255, .06);
}

.desktop-app-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.desktop-app-card__title {
    font-size: 13px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    line-height: 1.4;
}

.desktop-app-card__sub {
    font-size: 11px;
    color: #6b7280;
}

.theme-dark .desktop-app-card__sub { color: #9ca3af; }

/* App card grid */
@media (min-width: 992px) {

    .app-card-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

/* =============================================================================
   HOME PAGE — offer apps slider (shared .home-offers / .js-offer-slider)
   Card polish is scoped to .desktop-layout-body so CMS + interstitial
   consumers of the same component pick it up, while mobile stays on theme-core.
   ============================================================================= */

@media (min-width: 992px) {

    /*
     * Shared native-app interaction contract. Vertical page gestures remain
     * available while mouse, pen and horizontal touch drags control the row.
     */
    .desktop-layout-body :is(.offer-slider, .promo-apps-slider, .mini-apps-slider, .app-screens-slider, .app-media-slider) .splide__track {
        cursor: grab;
        touch-action: pan-y pinch-zoom;
        overscroll-behavior-inline: contain;
    }

    .desktop-layout-body :is(.offer-slider, .promo-apps-slider, .mini-apps-slider, .app-screens-slider, .app-media-slider).is-dragging .splide__track {
        cursor: grabbing;
    }

    .desktop-layout-body :is(.offer-slider, .promo-apps-slider, .mini-apps-slider, .app-screens-slider, .app-media-slider) :is(a, img) {
        -webkit-user-drag: none;
        user-select: none;
    }

    .desktop-layout-body :is(.offer-slider, .promo-apps-slider, .mini-apps-slider, .app-screens-slider).is-slider-fallback .splide__track {
        overflow-x: auto;
        scroll-behavior: smooth;
        scroll-snap-type: inline mandatory;
        scrollbar-width: none;
    }

    .desktop-layout-body :is(.offer-slider, .promo-apps-slider, .mini-apps-slider, .app-screens-slider).is-slider-fallback .splide__track::-webkit-scrollbar {
        display: none;
    }

    .desktop-layout-body :is(.offer-slider, .promo-apps-slider, .mini-apps-slider, .app-screens-slider).is-slider-fallback .splide__list {
        transform: none !important;
        width: max-content;
    }

    .desktop-layout-body :is(.offer-slider, .promo-apps-slider, .mini-apps-slider, .app-screens-slider).is-slider-fallback .splide__slide {
        scroll-snap-align: start;
    }

    .desktop-layout-body .home-offers {
        overflow: visible;
        padding: 16px 0;
        background: transparent;
    }

    .desktop-layout-body :is(.home-offers, .promo-apps-section, .app-spotlight, .featured-app-section, .mini-apps-section) .desktop-section-head {
        margin: 6px 2px 14px;
        padding: 0;
    }

    .desktop-layout-body :is(.home-offers, .promo-apps-section, .app-spotlight, .featured-app-section, .mini-apps-section) .desktop-section-head__title {
        font-size: 16px;
        font-weight: 700;
        color: var(--app-detail-h1, #111827);
    }

    .desktop-layout-body.theme-dark :is(.home-offers, .promo-apps-section, .app-spotlight, .featured-app-section, .mini-apps-section) .desktop-section-head__title {
        color: #e4e6eb;
    }

    .desktop-layout-body .offer-slider.splide {
        visibility: visible;
        padding-block: 0;
        background: transparent;
    }

    .desktop-layout-body .offer-slider .splide__list {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        width: auto;
        will-change: auto;
        background: transparent;
    }

    .desktop-layout-body .offer-slider .splide__track {
        overflow: hidden;
        background: transparent;
    }

    .desktop-layout-body .offer-slider .splide__slide {
        box-sizing: border-box;
        min-width: 0;
        flex: 0 0 auto;
        width: auto;
        max-width: none;
    }

    .desktop-layout-body .home-offers .offer-card-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: 100%;
    }

    .desktop-layout-body .home-offers .offer-card {
        border-radius: 20px;
        display: flex;
        flex-direction: column;
        height: 100%;
        box-shadow: none;
        background: #fff;
    }

    .desktop-layout-body .home-offers .offer-card__cover-wrap {
        width: 100%;
        height: auto;
        aspect-ratio: 2 / 1;
        max-height: 180px;
        overflow: hidden;
    }

    .desktop-layout-body .home-offers .offer-card__cover {
        position: absolute;
        inset: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 20px 20px 0 0;
    }

    .desktop-layout-body .home-offers .offer-card__body {
        padding: 10px 16px 12px;
        flex: 0 0 auto;
    }

    .desktop-layout-body .home-offers .offer-card__app {
        gap: 14px;
    }

    .desktop-layout-body .home-offers .offer-card__icon-wrap {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .desktop-layout-body .home-offers .offer-card__name {
        font-size: 13px;
        line-height: 1.9;
    }

    .desktop-layout-body .home-offers .offer-card__name-en {
        font-size: 13px;
    }

    .desktop-layout-body .home-offers .offer-card__button {
        min-width: 84px;
        height: 36px;
        font-size: 13px;
    }

    .desktop-layout-body .offer-slider::before,
    .desktop-layout-body .offer-slider::after {
        content: none;
    }

    .desktop-layout-body.theme-dark .home-offers .offer-card {
        background: #0f1117;
        border-color: rgba(255, 255, 255, .06);
        color: #f9fafb;
    }

    /* Section titles */
    .mini-apps-section__title {
        font-size: 16px !important;
        font-weight: 700 !important;
        margin-bottom: 0 !important;
    }

    .desktop-home-page .mini-apps-section { margin-top: 24px; }

    /* Main content padding */
    .desktop-main { padding: 0 4px; }
}

/* =============================================================================
   HOME PAGE — Promo interstitial grid (3-up on desktop)
   Deprecated: unused leftover. Home/hub promo rows use Splide (.js-promo-apps-slider).
   Do not wire new markup to .desktop-promo-grid.
   ============================================================================= */

@media (min-width: 992px) {

    .desktop-promo-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .desktop-promo-grid .promo-app-card { height: 100%; }

    .desktop-promo-grid .promo-app-card__link { border-radius: 18px; }

    /* Base cover is a fixed 180px height tuned for the full-width mobile slider.
       In a 3-up grid cell keep a 16:9 proportion so the card isn't overly wide
       and short. */
    .desktop-promo-grid .promo-app-card__cover {
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* =============================================================================
   HOME PAGE — Featured interstitial hero (معرفی بازی)
   Base card collapses to min-height:180px (all children are absolute), so on a
   full-width desktop row it becomes a ~5:1 stretched/cropped banner. Give it a
   balanced hero proportion + larger centered icon so it looks like a showcase.
   ============================================================================= */

@media (min-width: 992px) {

    .desktop-home-page .featured-app-card {
        padding: 0;
    }

    /* Full-width cinematic banner with a controlled, fixed height. object-fit:
       cover scales the cover to fill without any stretch/deform (it only crops
       the edges), so the wide banner stays sharp and undeformed. */
    .desktop-home-page .featured-app-card__link {
        min-height: 0;
        height: 280px;
        border-radius: 20px;
    }

    /* The source feature graphic is low-res for a banner this large. Use it as a
       soft, ambient backdrop (subtle blur + slight zoom to hide blurred edges)
       so the upscaling artefacts read as an intentional frosted hero rather than
       a low-quality stretch. The sharp centered icon + text become the focus. */
    .desktop-home-page .featured-app-card__cover {
        filter: blur(3px) saturate(1.12);
        transform: scale(1.1);
    }

    /* Stronger gradient for legibility of the overlaid icon/title/button. */
    .desktop-home-page .featured-app-card__media::after {
        background:
            linear-gradient(0deg, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, 0) 55%),
            linear-gradient(90deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .25) 100%);
    }

    .desktop-home-page .featured-app-card__icon-wrap {
        width: 96px;
        height: 96px;
        border-radius: 24px;
    }

    .desktop-home-page .featured-app-card__content {
        padding: 22px 26px;
    }

    .desktop-home-page .featured-app-card__title-fa {
        font-size: 16px;
        line-height: 1.5;
    }

    .desktop-home-page .featured-app-card__title-en {
        font-size: 14px;
    }

    .desktop-home-page .featured-app-card__button {
        min-width: 100px;
        height: 40px;
        font-size: 15px;
    }
}

/* =============================================================================
   CATEGORY APPS / SEARCH / DEVELOPER — app rows grid
   ============================================================================= */

@media (min-width: 992px) {

    .desktop-app-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .desktop-app-grid .developer-app-row { margin: 0; }
}

@media (min-width: 1200px) {
    .desktop-app-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================================================
   PLAY-STORE HUB PAGE
   ============================================================================= */

@media (min-width: 992px) {

    /* Deprecated: unused leftover. Hub promo uses shared Splide, not this grid. */
    .desktop-hub-promo-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .desktop-hub-promo-grid .promo-app-card { width: 100%; }
}

@media (min-width: 1200px) {
    .desktop-hub-promo-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Shared promo slider on desktop hub / home interstitial consumers */
@media (min-width: 992px) {

    .desktop-layout-body .promo-apps-section {
        background: transparent;
    }

    .desktop-layout-body .promo-apps-slider.splide {
        visibility: visible;
        background: transparent;
    }

    .desktop-layout-body .promo-apps-slider .splide__list {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        width: auto;
        will-change: auto;
        background: transparent;
    }

    .desktop-layout-body .promo-apps-slider .splide__track {
        overflow: hidden;
        background: transparent;
    }

    .desktop-layout-body .promo-apps-slider .splide__slide {
        box-sizing: border-box;
        min-width: 0;
        flex: 0 0 auto;
        width: auto;
        max-width: none;
    }

    .desktop-layout-body .promo-apps-slider .promo-app-card__link {
        box-shadow: none;
    }

    .desktop-layout-body .promo-apps-slider::before,
    .desktop-layout-body .promo-apps-slider::after {
        content: none;
    }

}

/* =============================================================================
   SINGLE / APP DETAIL PAGE
   ============================================================================= */

@media (min-width: 992px) {

    .app-body-desc__viewport--desktop-expanded {
        max-height: none !important;
    }

    .app-body-desc__viewport--desktop-expanded .app-body-desc__clip {
        max-height: none !important;
    }

    .desktop-similar-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 4px;
    }

    .desktop-similar-grid .mini-app-card { display: flex; }

    .desktop-similar-grid .mini-app-card__link {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 12px 8px;
        border-radius: 12px;
        width: 100%;
    }

    /*
     * Mini-app sliders (similar apps / others installed / hub child sliders).
     * Clip the track only — the section stays visible so arrows, edge fades,
     * and icon hover are not cut off. Keep a horizontal row before Splide mounts.
     */
    .desktop-layout-body .mini-apps-section {
        overflow: visible;
        min-width: 0;
        max-width: 100%;
    }

    /* Match home x-theme.section-header more link (green + caret). */
    .desktop-layout-body .mini-apps-section__more {
        width: auto;
        height: auto;
        border-radius: 0;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 4px;
        font-size: .82rem;
        font-weight: 700;
        color: #2f9e69;
        text-decoration: none;
        transition: gap .16s ease, color .16s ease;
    }

    .desktop-layout-body .mini-apps-section__more:hover,
    .desktop-layout-body .mini-apps-section__more:focus,
    .desktop-layout-body .mini-apps-section__more:active {
        gap: 8px;
        color: #36a96d;
        text-decoration: none;
    }

    .desktop-layout-body .mini-apps-section__more i {
        font-size: 1rem;
    }

    .desktop-layout-body .mini-apps-slider.splide {
        visibility: visible;
        padding-block: 2px;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .desktop-layout-body .mini-apps-slider .splide__list {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-start;
        width: auto;
        max-width: none;
    }

    .desktop-layout-body .app-screens-slider .splide__list {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        width: auto;
        max-width: none;
    }

    .desktop-layout-body .mini-apps-slider .splide__track {
        overflow: hidden;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .desktop-layout-body .mini-apps-slider .splide__slide {
        box-sizing: border-box;
        width: 108px;
        max-width: 108px;
        flex: 0 0 auto;
    }

    .desktop-layout-body .mini-apps-slider .mini-app-card__icon-wrap {
        width: 108px;
        height: 108px;
        aspect-ratio: 1 / 1;
        transition: transform .25s ease, box-shadow .25s ease;
    }

    .desktop-layout-body .mini-apps-slider .mini-app-card__link:hover .mini-app-card__icon-wrap,
    .desktop-layout-body .mini-apps-slider .mini-app-card__link:focus-visible .mini-app-card__icon-wrap {
        transform: translateY(-3px);
        box-shadow: 0 14px 26px -14px rgba(0, 0, 0, .5);
    }

    .desktop-layout-body .mini-apps-slider .splide__arrow {
        width: 40px;
        height: 40px;
        background: #fff;
        color: #111827;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
        opacity: 0;
        pointer-events: none;
        top: 56px;
        z-index: 3;
        transition: opacity .18s ease, background .18s ease, color .18s ease, transform .18s ease;
    }

    .desktop-layout-body .mini-apps-slider .splide__arrow svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
    }

    .desktop-layout-body .mini-apps-slider.is-overflowing .splide__arrow:not(:disabled),
    .desktop-layout-body .mini-apps-section:hover .mini-apps-slider.is-overflowing .splide__arrow:not(:disabled),
    .desktop-layout-body .mini-apps-section:focus-within .mini-apps-slider.is-overflowing .splide__arrow:not(:disabled),
    .desktop-layout-body .mini-apps-slider.is-overflowing:hover .splide__arrow:not(:disabled),
    .desktop-layout-body .mini-apps-slider.is-overflowing:focus-within .splide__arrow:not(:disabled) {
        opacity: .92;
        pointer-events: auto;
    }

    .desktop-layout-body .mini-apps-section:hover .mini-apps-slider.is-overflowing .splide__arrow:disabled,
    .desktop-layout-body .mini-apps-section:focus-within .mini-apps-slider.is-overflowing .splide__arrow:disabled,
    .desktop-layout-body .mini-apps-slider.is-overflowing:hover .splide__arrow:disabled,
    .desktop-layout-body .mini-apps-slider.is-overflowing:focus-within .splide__arrow:disabled {
        opacity: .38;
        pointer-events: none;
        visibility: visible;
    }

    .desktop-layout-body .mini-apps-slider .splide__arrow:disabled,
    .desktop-layout-body .mini-apps-slider.is-mini-slider-fit .splide__arrow {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }

    .desktop-layout-body .mini-apps-slider .splide__arrow:hover:not(:disabled) {
        background: #f8fafc;
        color: #0f172a;
        opacity: 1;
        transform: translateY(-50%) scale(1.04);
    }

    .desktop-layout-body .mini-apps-slider .splide__arrow:focus-visible:not(:disabled) {
        outline: 2px solid #4cc986;
        outline-offset: 2px;
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .desktop-layout-body .mini-apps-slider.splide--rtl .splide__arrow--prev {
        right: 0;
        left: auto;
    }

    .desktop-layout-body .mini-apps-slider.splide--rtl .splide__arrow--next {
        left: 0;
        right: auto;
    }

    .desktop-layout-body.theme-dark .mini-apps-slider .splide__arrow {
        background: #1f2430;
        color: #f9fafb;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
    }

    .desktop-layout-body.theme-dark .mini-apps-slider .splide__arrow:hover {
        background: #272d3b;
        color: #fff;
    }

    .desktop-sidebar-right .app-download-section {
        position: sticky;
        top: 80px;
    }

    .desktop-single-sidebar__mini-list {
        background: var(--bs-body-bg, #fff);
        border-radius: 14px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
        overflow: hidden;
    }

    .theme-dark .desktop-single-sidebar__mini-list { background: #0f1117; }
}

/* App detail tabs */
@media (min-width: 992px) {

    .desktop-content-tabs {
        display: flex;
        gap: 0;
        border-bottom: 2px solid rgba(0, 0, 0, .08);
        margin-bottom: 20px;
    }

    .theme-dark .desktop-content-tabs { border-bottom-color: rgba(255, 255, 255, .08); }

    .desktop-content-tab {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 20px;
        font-size: .9rem;
        font-weight: 600;
        cursor: pointer;
        border: none;
        background: none;
        color: inherit;
        opacity: .55;
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
        font-family: inherit;
        transition: opacity .2s, border-color .2s;
    }

    .desktop-content-tab:hover { opacity: .85; }

    .desktop-content-tab.is-active {
        opacity: 1;
        border-bottom-color: #4cc986;
        color: #4cc986;
    }

    .desktop-content-tab__badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: rgba(76, 201, 134, .15);
        color: #4cc986;
        font-size: .7rem;
        font-weight: 700;
    }

    /* Desktop: panels controlled by JS; only active is visible */
    .desktop-tab-panel { display: none; }
    .desktop-tab-panel.is-active { display: block; }
}

/* Mobile: all tab panels visible (linear flow — tabs nav is hidden anyway) */
@media (max-width: 991.98px) {
    .desktop-tab-panel { display: block !important; }
}

/* =============================================================================
   REVIEWS PAGE — sidebar rating badge
   ============================================================================= */

.desktop-reviews-sidebar-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, .06);
    margin-top: 4px;
}

.theme-dark .desktop-reviews-sidebar-rating { border-top-color: rgba(255, 255, 255, .06); }

.desktop-reviews-sidebar-rating__score { display: flex; align-items: center; gap: 5px; }
.desktop-reviews-sidebar-rating__star { color: #f5a623; font-size: 1.2rem; }
.desktop-reviews-sidebar-rating__num { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.desktop-reviews-sidebar-rating__count { font-size: .8rem; opacity: .6; }

/* =============================================================================
   DEVELOPER PAGE — sidebar
   ============================================================================= */

.desktop-dev-logo-wrap { display: flex; justify-content: center; padding: 16px 16px 8px; }

.desktop-dev-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: contain;
    border: 1px solid rgba(0, 0, 0, .08);
}

.theme-dark .desktop-dev-logo { border-color: rgba(255, 255, 255, .08); }

.desktop-dev-info-rows { padding: 0 8px 12px; }

.desktop-dev-description {
    font-size: .82rem;
    opacity: .7;
    line-height: 1.65;
    padding: 8px 8px 0;
    border-top: 1px solid rgba(0, 0, 0, .06);
    margin-top: 8px;
}

.theme-dark .desktop-dev-description { border-top-color: rgba(255, 255, 255, .06); }

/* =============================================================================
   ARCHIVE PAGE — sidebar
   ============================================================================= */

.desktop-archive-page .app-download-archive-empty {
    margin-inline: 0;
}

.desktop-archive-app-card { padding: 12px 16px 16px; }

.desktop-archive-app-card__link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 10px;
    border-radius: 12px;
    transition: background .15s;
}

.desktop-archive-app-card__link:hover { background: rgba(74, 137, 220, .06); text-decoration: none; }

.desktop-archive-app-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
}

.desktop-archive-app-card__meta { min-width: 0; }
.desktop-archive-app-card__name { font-size: .9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desktop-archive-app-card__name-en { font-size: .75rem; opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.desktop-archive-app-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: .75rem;
    color: #4a89dc;
    font-weight: 600;
}

/* =============================================================================
   ARCHIVE PAGE — desktop hero + pill breadcrumb
   Scoped to .desktop-archive-hero. Loaded only by the desktop layout.
   ============================================================================= */

.desktop-archive-hero {
    --archive-hero-green: #1d7044;
    --archive-hero-green-soft: #e7f4ec;
    --archive-hero-ink: #111827;
    --archive-hero-muted: #6b7280;
    --archive-hero-chip: #f3f4f6;
    --archive-hero-line: #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 24px;
    position: relative;
}

.desktop-archive-hero__crumbs {
    display: inline-flex;
    max-width: 100%;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
    padding: 6px 14px;
}

.desktop-archive-hero__crumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.desktop-archive-hero__crumb,
.desktop-archive-hero__sep {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: 22px;
}

.desktop-archive-hero__sep {
    color: #c4c9d1;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1;
    user-select: none;
    padding: 0 2px;
}

.desktop-archive-hero__crumb-link,
.desktop-archive-hero__crumb-text,
.desktop-archive-hero__crumb-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
}

.desktop-archive-hero__crumb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 6px;
    color: #9ca3af;
}

.desktop-archive-hero__crumb-icon i {
    display: block;
    width: 1em;
    height: 1em;
    font-size: 1rem;
    line-height: 1;
    color: inherit;
}

.desktop-archive-hero__crumb-label {
    display: inline-flex;
    align-items: center;
    height: 22px;
    line-height: 1;
}

.desktop-archive-hero__crumb-link:hover {
    color: var(--archive-hero-green);
    text-decoration: none;
}

.desktop-archive-hero__crumb-link:hover .desktop-archive-hero__crumb-icon {
    color: var(--archive-hero-green);
}

.desktop-archive-hero__crumb--current .desktop-archive-hero__crumb-icon {
    background: var(--archive-hero-green-soft);
    color: var(--archive-hero-green);
}

.desktop-archive-hero__crumb--current .desktop-archive-hero__crumb-icon i {
    font-size: .85rem;
}

.desktop-archive-hero__crumb--current .desktop-archive-hero__crumb-current {
    color: var(--archive-hero-green);
    font-weight: 700;
}

.desktop-archive-hero__clip {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.desktop-archive-hero__card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .95fr);
    align-items: stretch;
    min-height: 248px;
    width: 100%;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .07);
    overflow: hidden;
}

.desktop-archive-hero__card--plain {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
}

.desktop-archive-hero__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    min-height: 248px;
    padding: 22px 28px 22px 20px;
}

.desktop-archive-hero__card--plain .desktop-archive-hero__body {
    width: 100%;
    min-height: 0;
}

.desktop-archive-hero__body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(148, 163, 184, .22) 1px, transparent 1.4px);
    background-size: 14px 14px;
    -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, .28), transparent 72%);
    mask-image: linear-gradient(to left, rgba(0, 0, 0, .28), transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.desktop-archive-hero__badge,
.desktop-archive-hero__title,
.desktop-archive-hero__lead,
.desktop-archive-hero__chips,
.desktop-archive-hero__cta,
.desktop-archive-hero__cta-row {
    position: relative;
    z-index: 1;
}

.desktop-archive-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--archive-hero-green-soft);
    color: var(--archive-hero-green);
    font-size: .72rem;
    font-weight: 700;
}

.desktop-archive-hero__badge i {
    font-size: .9rem;
}

.desktop-archive-hero__title {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.45;
    color: var(--archive-hero-ink);
    letter-spacing: -.02em;
}

.desktop-archive-hero__lead {
    margin: 0;
    max-width: 36rem;
    font-size: .82rem;
    line-height: 1.75;
    color: var(--archive-hero-muted);
}

.desktop-archive-hero__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
}

.desktop-archive-hero__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    color: #374151;
    font-size: .78rem;
    font-weight: 600;
}

.desktop-archive-hero__chip:first-child {
    padding-inline-start: 0;
}

.desktop-archive-hero__chip + .desktop-archive-hero__chip {
    border-inline-start: 1px solid var(--archive-hero-line);
}

.desktop-archive-hero__chip i {
    font-size: .95rem;
    color: #6b7280;
}

.desktop-archive-hero__chip strong {
    font-weight: 800;
    color: var(--archive-hero-ink);
    font-variant-numeric: tabular-nums;
}

.desktop-archive-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    min-height: 52px;
    padding: 8px 16px 8px 14px;
    border: 1.5px solid var(--archive-hero-green);
    border-radius: 16px;
    color: var(--archive-hero-green);
    background: #fff;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.desktop-archive-hero__cta:hover {
    background: var(--archive-hero-green-soft);
    color: var(--archive-hero-green);
    text-decoration: none;
}

.desktop-archive-hero__cta > i {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
}

.desktop-archive-hero__cta-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    text-align: center;
}

.desktop-archive-hero__cta-label,
.desktop-archive-hero__cta-app {
    display: block;
    width: 100%;
    text-align: center;
}

.desktop-archive-hero__cta-label {
    font-size: .65rem;
    font-weight: 700;
    line-height: 1.55;
}

.desktop-archive-hero__cta-app {
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.25;
    color: #0b0c0c;
    letter-spacing: -.01em;
}

.desktop-archive-hero__cta:hover .desktop-archive-hero__cta-app {
    color: #0b0c0c;
}

.desktop-archive-hero__cta-chevron {
    font-size: 1.05rem;
    opacity: .9;
}

.desktop-archive-hero__visual {
    position: relative;
    z-index: 0;
    min-height: 248px;
    overflow: hidden;
    background: #123a24;
    -webkit-clip-path: url(#desktop-archive-hero-slope);
    clip-path: url(#desktop-archive-hero-slope);
}

.desktop-archive-hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.desktop-archive-hero__media .media-img__el,
.desktop-archive-hero__cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
}

.desktop-archive-hero__app-chip {
    position: absolute;
    z-index: 4;
    left: 40%;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: min(260px, calc(100% - 40px));
    padding-block: 6px;
    padding-inline: 6px 14px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .14);
    color: inherit;
    pointer-events: none;
}

.desktop-archive-hero__card--plain .desktop-archive-hero__app-chip {
    left: auto;
    right: 28px;
}

.desktop-archive-hero__app-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.desktop-archive-hero__app-icon {
    width: 44px;
    height: 44px;
    object-fit: cover;
}

.desktop-archive-hero__app-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.desktop-archive-hero__app-name {
    font-size: .8rem;
    font-weight: 800;
    color: var(--archive-hero-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desktop-archive-hero__app-name-en {
    font-size: .68rem;
    font-weight: 600;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-dark .desktop-archive-hero {
    --archive-hero-ink: #f3f4f6;
    --archive-hero-muted: rgba(243, 244, 246, .72);
    --archive-hero-chip: #1b1f2a;
    --archive-hero-green-soft: rgba(29, 112, 68, .22);
    --archive-hero-line: rgba(255, 255, 255, .08);
}

.theme-dark .desktop-archive-hero__crumbs,
.theme-dark .desktop-archive-hero__card,
.theme-dark .desktop-archive-hero__cta,
.theme-dark .desktop-archive-hero__app-chip {
    background: #0f1117;
}

.theme-dark .desktop-archive-hero__crumbs {
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
}

.theme-dark .desktop-archive-hero__card {
    box-shadow: 0 14px 40px rgba(0, 0, 0, .4);
}

.theme-dark .desktop-archive-hero__chip {
    color: #e5e7eb;
}

.theme-dark .desktop-archive-hero__cta-app,
.theme-dark .desktop-archive-hero__cta:hover .desktop-archive-hero__cta-app {
    color: #e8e9ea;
}

.theme-dark .desktop-archive-hero__body::before {
    background-image: radial-gradient(rgba(148, 163, 184, .14) 1px, transparent 1.4px);
}

@media (min-width: 1400px) {
    .desktop-archive-hero__card,
    .desktop-archive-hero__body,
    .desktop-archive-hero__visual {
        min-height: 268px;
    }

    .desktop-archive-hero__title {
        font-size: 1.38rem;
    }
}

@media (max-width: 1199.98px) {
    .desktop-archive-hero__card {
        grid-template-columns: minmax(0, 1.3fr) minmax(220px, .85fr);
        min-height: 232px;
    }

    .desktop-archive-hero__body,
    .desktop-archive-hero__visual {
        min-height: 232px;
    }

    .desktop-archive-hero__title {
        font-size: 1.12rem;
    }

    .desktop-archive-hero__body {
        padding: 18px 20px 18px 16px;
        gap: 8px;
    }

    .desktop-archive-hero__app-chip {
        left: 34%;
    }
}

.desktop-archive-hero--developer .desktop-archive-hero__chips--facts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 0;
    width: 100%;
}

.desktop-archive-hero--developer .desktop-archive-hero__chips--facts .desktop-archive-hero__chip {
    padding-inline: 14px;
}

.desktop-archive-hero--developer .desktop-archive-hero__chips--facts .desktop-archive-hero__chip:first-child {
    padding-inline-start: 0;
}

.desktop-archive-hero--developer .desktop-archive-hero__chips--facts .desktop-archive-hero__chip + .desktop-archive-hero__chip {
    border-inline-start: 1px solid var(--archive-hero-line);
}

.desktop-archive-hero--developer .desktop-archive-hero__chips--facts .desktop-archive-hero__chip--wide,
.desktop-archive-hero--developer .desktop-archive-hero__chips--facts .desktop-archive-hero__chip + .desktop-archive-hero__chip--wide {
    grid-column: 1 / -1;
    border-inline-start: 0;
    padding-inline: 0;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid var(--archive-hero-line);
}

.desktop-archive-hero--developer .desktop-archive-hero__chip-copy {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}

.desktop-archive-hero--developer .desktop-archive-hero__chip-label {
    font-size: .68rem;
    font-weight: 600;
    color: var(--archive-hero-muted);
    line-height: 1.2;
}

.desktop-archive-hero--developer .desktop-archive-hero__chip-value {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    color: var(--archive-hero-ink);
}

.desktop-archive-hero--developer .desktop-archive-hero__chip--wide .desktop-archive-hero__chip-copy,
.desktop-archive-hero--developer .desktop-archive-hero__chip--wide .desktop-archive-hero__chip-value {
    max-width: none;
    width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.45;
}

.desktop-archive-hero--developer .desktop-archive-hero__body {
    justify-content: flex-start;
    gap: 12px;
    padding: 20px 28px 20px 28px;
}

.desktop-archive-hero--developer .desktop-archive-hero__app-chip {
    left: 20px;
    max-width: min(240px, 42%);
}

.desktop-archive-hero--developer .desktop-archive-hero__cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    width: auto;
    max-width: 100%;
    margin-top: 4px;
}

.desktop-archive-hero--developer .desktop-archive-hero__cta-row--compact .desktop-archive-hero__cta {
    flex: 0 1 auto;
    width: max-content;
    max-width: 100%;
    min-height: 40px;
    margin-top: 0;
    padding: 6px 12px 6px 10px;
    gap: 8px;
    border-radius: 12px;
}

.desktop-archive-hero--developer .desktop-archive-hero__cta-row--compact .desktop-archive-hero__cta-copy {
    flex: 0 1 auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.desktop-archive-hero--developer .desktop-archive-hero__cta-row--compact .desktop-archive-hero__cta-label {
    font-size: .78rem;
    line-height: 1.2;
}

.desktop-archive-hero--developer .desktop-archive-hero__cta-row--compact .desktop-archive-hero__cta-app {
    display: none;
}

@media (max-width: 1199.98px) {
    .desktop-archive-hero--developer .desktop-archive-hero__app-chip {
        left: 16px;
    }
}

.desktop-archive-hero--developer .desktop-archive-hero__description {
    margin: 0;
    max-width: 36rem;
    font-size: .82rem;
    line-height: 1.7;
    color: var(--archive-hero-muted);
}

/* =============================================================================
   CATEGORIES INDEX PAGE
   ============================================================================= */

@media (min-width: 992px) {
    .desktop-categories-search-field { max-width: 480px; }
    .desktop-categories-section { margin-bottom: 8px; }
    .desktop-categories-tile-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

@media (min-width: 1200px) {
    .desktop-categories-tile-grid { grid-template-columns: repeat(5, 1fr) !important; }
}

/* =============================================================================
   SEARCH PAGE
   ============================================================================= */

@media (min-width: 992px) {

    .desktop-search-form .app-search-toolbar__input {
        font-size: 1rem;
        height: 48px;
    }

    .desktop-search-page .desktop-app-grid { grid-template-columns: repeat(2, 1fr); }

    .desktop-search-filters .desktop-sidebar-nav__section + .desktop-sidebar-nav__section {
        border-top: 1px solid rgba(0, 0, 0, .06);
        padding-top: 8px;
    }

    .theme-dark .desktop-search-filters .desktop-sidebar-nav__section + .desktop-sidebar-nav__section {
        border-top-color: rgba(255, 255, 255, .06);
    }
}

/* =============================================================================
   PAGE HEAD (breadcrumb + title + lead)
   ============================================================================= */

.desktop-page-head { padding: 16px 0 20px; }
.desktop-page-head__title { margin: 6px 0 0; font-size: 1.4rem; font-weight: 700; }
.desktop-page-head__lead { margin: 6px 0 0; font-size: .9rem; opacity: .65; line-height: 1.6; }

/* =============================================================================
   RIGHT SIDEBAR WIDGET
   ============================================================================= */

.desktop-widget {
    background: var(--bs-body-bg, #fff);
    border-radius: 14px;
    padding: 16px 0 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    margin-bottom: 20px;
}

.theme-dark .desktop-widget { background: #0f1117; box-shadow: 0 2px 12px rgba(0, 0, 0, .3); }

.desktop-widget__head {
    padding: 0 16px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    margin-bottom: 4px;
}

.theme-dark .desktop-widget__head { border-bottom-color: rgba(255, 255, 255, .06); }

.desktop-widget__title {
    margin: 0;
    font-size: .88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.desktop-widget__title i { font-size: 1.1rem; color: #e9573f; }

.desktop-widget__app-list { list-style: none; margin: 0; padding: 0; }

.desktop-widget__app-item + .desktop-widget__app-item { border-top: 1px solid rgba(0, 0, 0, .05); }
.theme-dark .desktop-widget__app-item + .desktop-widget__app-item { border-top-color: rgba(255, 255, 255, .05); }

.desktop-widget__app-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    text-decoration: none;
    transition: background .15s;
}

.desktop-widget__app-link:hover { background: rgba(74, 137, 220, .06); text-decoration: none; }

.desktop-widget__app-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.desktop-widget__app-meta { flex: 1; min-width: 0; }
.desktop-widget__app-name { font-size: .83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desktop-widget__app-name-en { font-size: .72rem; opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desktop-widget__app-dl { flex-shrink: 0; font-size: 1rem; opacity: .45; }

.desktop-widget__more {
    display: block;
    text-align: center;
    padding: 8px 16px;
    font-size: .8rem;
    opacity: .6;
    text-decoration: none;
    border-top: 1px solid rgba(0, 0, 0, .05);
    margin-top: 4px;
    transition: opacity .15s;
}

.desktop-widget__more:hover { opacity: 1; text-decoration: none; }

/* =============================================================================
   VISIBILITY HELPERS
   ============================================================================= */

@media (min-width: 992px) {
    .mobile-only { display: none !important; }
}

@media (max-width: 991.98px) {
    .desktop-only { display: none !important; }
    .desktop-layout-wrap,
    .desktop-layout-wrap.has-sidebar-right {
        grid-template-columns: 1fr;
        padding: 0;
    }
    .desktop-main { width: 100%; }
}

/* =============================================================================
   DARK THEME — misc overrides
   ============================================================================= */

.theme-dark .desktop-header__search-input::placeholder { color: rgba(255, 255, 255, .3); }

/* =============================================================================
   MEDIA IMAGE — Skeleton / Shimmer / fade-in (progressive enhancement)
   No-JS safe: <img> is visible by default. The skeleton only appears while the
   `.is-loading` class is present, which desktop.js adds to images that are not
   yet loaded and removes once they finish (or error). This keeps content in the
   HTML for SEO and avoids a blank UI if JavaScript is unavailable.
   ============================================================================= */

.media-img {
    position: relative;
    display: block;
    overflow: hidden;
}

.media-img__el {
    display: block;
}

/* Shimmer overlay shown only while the image is loading */
.media-img.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg,
        rgba(15, 23, 42, .06) 25%,
        rgba(15, 23, 42, .12) 37%,
        rgba(15, 23, 42, .06) 63%);
    background-size: 400% 100%;
    animation: desktopSkeleton 1.3s ease infinite;
}

.theme-dark .media-img.is-loading::after {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, .05) 25%,
        rgba(255, 255, 255, .10) 37%,
        rgba(255, 255, 255, .05) 63%);
    background-size: 400% 100%;
}

.media-img.is-loading .media-img__el {
    opacity: 0;
}

.media-img.is-loaded .media-img__el {
    opacity: 1;
    animation: mediaImgFade .35s ease both;
}

@keyframes mediaImgFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .media-img.is-loading::after { animation: none; }
    .media-img.is-loaded .media-img__el { animation: none; }
}

/* =============================================================================
   SECTION HEADER component (x-theme.section-header)
   ============================================================================= */

@media (min-width: 992px) {

    .desktop-section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 6px 2px 14px;
    }

    .desktop-section-head__title {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        color: var(--app-detail-h1, #111827);
    }

    .theme-dark .desktop-section-head__title {
        color: #e4e6eb;
    }

    .desktop-section-head__more {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: .82rem;
        font-weight: 700;
        color: #2f9e69;
        text-decoration: none;
        transition: gap .16s ease, color .16s ease;
    }

    .desktop-section-head__more:hover {
        gap: 8px;
        color: #36a96d;
    }

    .desktop-section-head__more i {
        font-size: 1rem;
    }
}

/* =============================================================================
   HOME PAGE — Enterprise visual polish (desktop only, ≥992px)
    All selectors are scoped to desktop-only containers (.desktop-home-page /
    .desktop-layout-body .home-offers / .desktop-promo-grid / .desktop-mini-grid) so the
   mobile sliders and mobile layout (style.css) are never affected.
   ============================================================================= */
@media (min-width: 992px) {

    /* ---- Section rhythm ---------------------------------------------------- */
    .desktop-home-page .app-home-cms-sections > section { margin-bottom: 36px; }
    .desktop-home-page > section { margin-top: 36px; }

    /* ---- Offer cards: hover micro-interactions ---------------------------- */
    .desktop-layout-body .home-offers .offer-card {
        transition: border-color .22s ease;
    }

    .desktop-layout-body .home-offers .offer-card-wrap:hover .offer-card,
    .desktop-layout-body .home-offers .offer-card:focus-visible {
        border-color: rgba(76, 201, 134, .45);
    }

    .desktop-layout-body .home-offers .offer-card__cover-wrap { position: relative; overflow: hidden; }
    .desktop-layout-body .home-offers .offer-card__cover { transition: transform .35s ease; }
    .desktop-layout-body .home-offers .offer-card-wrap:hover .offer-card__cover { transform: scale(1.04); }

    /* Cover gradient overlay for depth/legibility.
       Uses ::before so it never collides with the skeleton shimmer (::after). */
    .desktop-layout-body .home-offers .offer-card__cover-wrap::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        border-radius: inherit;
        background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, .26) 100%);
    }

    /* Stats: rating (1 decimal) + content-rating pill */
    .desktop-layout-body .home-offers .offer-card__stats { align-items: center; margin-top: 6px; }

    .desktop-layout-body .home-offers .offer-card__rating {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        font-weight: 700;
        color: var(--offer-card-text);
    }

    .desktop-layout-body .home-offers .offer-card__rating i { color: #f5a623; font-size: 14px; line-height: 1; }

    .desktop-layout-body .home-offers .offer-card__pegi {
        display: inline-flex;
        align-items: center;
        padding: 1px 8px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 600;
        background: rgba(115, 103, 240, .12);
        color: #7367f0;
    }

    /* Download button → brand green, fills on hover */
    .desktop-layout-body .home-offers .offer-card__button {
        background: rgba(76, 201, 134, .16);
        color: #2e9e63;
        transition: background .2s ease, color .2s ease;
    }

    .desktop-layout-body .home-offers .offer-card-wrap:hover .offer-card__button {
        background: var(--install-bg, #4cc986);
        color: #fff;
    }

    .desktop-layout-body.theme-dark .home-offers .offer-card {
        background: #0f1117;
        border-color: rgba(255, 255, 255, .06);
        color: #f9fafb;
    }

    .desktop-layout-body.theme-dark .home-offers .offer-card__name,
    .desktop-layout-body.theme-dark .home-offers .offer-card__rating {
        color: #f9fafb;
    }

    .desktop-layout-body.theme-dark .home-offers .offer-card__name-en {
        color: #9ca3af;
    }

    .desktop-layout-body.theme-dark .home-offers .offer-card__icon-wrap {
        background: #1f2430;
    }

    .desktop-layout-body.theme-dark .home-offers .offer-card__button {
        background: rgba(76, 201, 134, .22);
        color: #86efac;
    }

    .desktop-layout-body.theme-dark .home-offers .offer-card-wrap:hover .offer-card__button {
        background: var(--install-bg, #4cc986);
        color: #fff;
    }

    /* ---- Promo cards: hover ---------------------------------------------- */
    .desktop-promo-grid .promo-app-card__link {
        transition: transform .22s ease, box-shadow .22s ease;
    }

    .desktop-promo-grid .promo-app-card:hover .promo-app-card__link,
    .desktop-promo-grid .promo-app-card__link:focus-visible {
        transform: translateY(-4px);
        box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45);
    }

    .desktop-promo-grid .promo-app-card__media { overflow: hidden; }
    .desktop-promo-grid .promo-app-card__cover { transition: transform .35s ease; }
    .desktop-promo-grid .promo-app-card:hover .promo-app-card__cover { transform: scale(1.04); }

    /* Deprecated: unused leftover. Mini rows use Splide (.js-mini-apps-slider). */
    .desktop-mini-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
        gap: 18px 14px;
    }

    .desktop-mini-grid .mini-app-card__icon-wrap {
        transition: transform .25s ease, box-shadow .25s ease;
    }

    .desktop-mini-grid .mini-app-card__link:hover .mini-app-card__icon-wrap,
    .desktop-mini-grid .mini-app-card__link:focus-visible .mini-app-card__icon-wrap {
        transform: translateY(-3px);
        box-shadow: 0 14px 26px -14px rgba(0, 0, 0, .5);
    }

    /* ---- Empty state ----------------------------------------------------- */
    .desktop-home-empty {
        margin: 8px 2px;
        padding: 18px;
        text-align: center;
        border: 1px dashed var(--offer-card-border, #e5e7eb);
        border-radius: 14px;
        color: var(--mini-app-subtitle, #6b7280);
        font-size: 13px;
    }

    /* ---- CMS Hero (desktop showcase) ------------------------------------- */
    .desktop-home-page .app-home-cms-hero { padding: 0 2px; }
    .desktop-home-page .app-home-cms-hero__surface { min-height: 340px; border-radius: 22px; }
    .desktop-home-page .app-home-cms-hero__content { padding: 2rem 2.25rem; max-width: 680px; }

    .desktop-home-page .app-home-cms-hero__title {
        font-size: clamp(1.5rem, 2.4vw, 2.1rem);
        margin-bottom: .6rem;
    }

    .desktop-home-page .app-home-cms-hero__desc {
        font-size: .98rem;
        line-height: 1.75;
        margin-bottom: 1.1rem;
    }

    .desktop-home-page .app-home-cms-hero__btn {
        padding: .6rem 1.15rem;
        font-size: .85rem;
        transition: transform .2s ease, background .2s ease;
    }

    .desktop-home-page .app-home-cms-hero__btn:hover {
        transform: translateY(-2px);
        background: rgba(255, 255, 255, .28);
    }

    /* ---- CMS Promo / Rich / Features — desktop spacing + dark harmony ----- */
    .desktop-home-page .app-home-cms-promo,
    .desktop-home-page .app-home-cms-rich,
    .desktop-home-page .app-home-cms-features { padding: 0 2px; }

    .desktop-home-page .app-home-cms-features__grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 14px;
    }

    .desktop-home-page .app-home-cms-features__item {
        transition: transform .2s ease, box-shadow .2s ease;
    }

    .desktop-home-page .app-home-cms-features__item:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 28px -16px rgba(0, 0, 0, .35);
    }

    .theme-dark .desktop-home-page .app-home-cms-promo__inner {
        background: rgba(115, 103, 240, .12);
        border-color: rgba(115, 103, 240, .28);
    }

    .theme-dark .desktop-home-page .app-home-cms-promo__title,
    .theme-dark .desktop-home-page .app-home-cms-rich__title,
    .theme-dark .desktop-home-page .app-home-cms-features__title,
    .theme-dark .desktop-home-page .app-home-cms-features__item-title { color: #f9fafb; }

    .theme-dark .desktop-home-page .app-home-cms-promo__desc,
    .theme-dark .desktop-home-page .app-home-cms-rich__body,
    .theme-dark .desktop-home-page .app-home-cms-features__desc,
    .theme-dark .desktop-home-page .app-home-cms-features__item-desc { color: rgba(255, 255, 255, .72); }

    .theme-dark .desktop-home-page .app-home-cms-features__item {
        background: #0f1117;
        border-color: #1f2430;
    }

    /* ---- Featured: subtle desktop hover (spotlight left untouched) -------- */
    .desktop-home-page .featured-app-card__link {
        transition: transform .22s ease, box-shadow .22s ease;
    }

    .desktop-home-page .featured-app-card__link:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 44px -20px rgba(0, 0, 0, .5);
    }
}

/* =============================================================================
   BOTTOM SHEETS — constrain to a centered, bottom-anchored panel on desktop
   The base bottom-sheet spans full width (left/right:10px). On desktop (≥992px)
   we cap the width and center it horizontally, while keeping it stuck to the
   bottom of the viewport (PWA-like, no bottom gap). We only touch
   left/right/margin/width so the open/close translateY animation (transform)
   keeps working untouched. Applies to every detached bottom sheet.
   ============================================================================= */
@media (min-width: 992px) {
    .theme-bottom-sheet.offcanvas-detached.offcanvas-bottom {
        left: 0;
        right: 0;
        margin-inline: auto;
        max-width: 460px;
        width: calc(100% - 40px);
    }
}

/* Respect reduced-motion: disable hover transforms/zoom */
@media (prefers-reduced-motion: reduce) {
    .desktop-layout-body .home-offers .offer-card,
    .desktop-layout-body .home-offers .offer-card__cover,
    .desktop-promo-grid .promo-app-card__link,
    .desktop-promo-grid .promo-app-card__cover,
    .desktop-mini-grid .mini-app-card__icon-wrap,
    .desktop-home-page .app-home-cms-features__item,
    .desktop-home-page .app-home-cms-hero__btn,
    .desktop-home-page .featured-app-card__link,
    .desktop-layout-body .mini-apps-slider .mini-app-card__icon-wrap,
    .desktop-layout-body .mini-apps-slider .splide__arrow,
    .desktop-layout-body .mini-apps-slider::before,
    .desktop-layout-body .mini-apps-slider::after,
    .desktop-layout-body .offer-slider .splide__arrow,
    .desktop-layout-body .offer-slider::before,
    .desktop-layout-body .offer-slider::after,
    .desktop-layout-body .promo-apps-slider .splide__arrow,
    .desktop-layout-body .promo-apps-slider::before,
    .desktop-layout-body .promo-apps-slider::after {
        transition: none !important;
        transform: none !important;
    }

    .desktop-layout-body :is(.offer-slider, .promo-apps-slider, .mini-apps-slider, .app-screens-slider).is-slider-fallback .splide__track {
        scroll-behavior: auto;
    }

    .desktop-layout-body :is(.offer-slider, .promo-apps-slider, .mini-apps-slider) .splide__arrow {
        transform: translateY(-50%) !important;
    }
}

