/* لینکدونی — RTL dark UI (design tokens) */
:root {
    --bg-deep: #0a0d12;
    --bg-elevated: #10151c;
    --bg-card: #141b24;
    --bg-card-hover: #1b2430;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(0, 198, 255, 0.28);
    --text: #eef2f7;
    --text-soft: #c5ced9;
    --muted: #8f9eae;
    --accent: #2ecfff;
    --accent-dim: rgba(46, 207, 255, 0.14);
    --accent-2: #4f8cff;
    --success: #5ee9a0;
    --radius: 14px;
    --radius-sm: 11px;
    --radius-xs: 8px;
    --font: "Vazirmatn", "Tahoma", sans-serif;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --focus-ring: 0 0 0 3px rgba(46, 207, 255, 0.28);
    --font-size-body: 1rem;
    /* ارتفاع نوار دستهٔ چسبان؛ با JS برای چسب جستجو زیر نوار به‌روز می‌شود */
    --sticky-nav-h: 0px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: var(--font-size-body);
    background: var(--bg-deep);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(46, 207, 255, 0.22);
    color: var(--text);
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 72%);
}

.glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 420px;
    height: 420px;
    background: var(--accent);
    top: -120px;
    left: -80px;
}

.glow-2 {
    width: 360px;
    height: 360px;
    background: #6366f1;
    bottom: 10%;
    right: -100px;
    opacity: 0.22;
}

.wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;
    margin-inline: auto;
    padding-inline: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    box-sizing: border-box;
}

@media (min-width: 721px) {
    .wrap {
        max-width: 1120px;
        padding-inline: max(24px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    }
}

.site-header,
.apps-header {
    position: relative;
    overflow: hidden;
    padding: 1.35rem 0 1.1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(10, 13, 18, 0.97) 0%, rgba(10, 13, 18, 0.82) 100%);
    backdrop-filter: blur(16px) saturate(1.1);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.site-header__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 7.5rem;
    pointer-events: none;
    z-index: 0;
}

.site-header .wrap,
.apps-header .wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-text h1 {
    margin: 0;
    font-size: clamp(1.28rem, 3.6vw, 1.72rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.25;
    background: linear-gradient(135deg, #ffffff 0%, #b8e8ff 55%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    margin: 0.28rem 0 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.header-download-btn {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #071018;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: var(--shadow-sm), 0 0 24px rgba(46, 207, 255, 0.18);
    transition:
        transform 0.18s var(--ease-out),
        box-shadow 0.18s var(--ease-out),
        filter 0.18s var(--ease-out);
}

.header-download-btn:hover,
.header-download-btn:focus-visible {
    filter: brightness(1.06);
    box-shadow: var(--shadow-sm), 0 4px 28px rgba(46, 207, 255, 0.32);
    outline: none;
}

.header-download-btn:focus-visible {
    box-shadow: var(--shadow-sm), var(--focus-ring), 0 4px 28px rgba(46, 207, 255, 0.25);
}

.header-download-btn:active {
    transform: scale(0.97);
}

.header-download-btn__ic {
    flex-shrink: 0;
}

.header-download-btn__label {
    display: inline;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.theme-toggle {
    flex-shrink: 0;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.15s var(--ease-out),
        border-color 0.15s var(--ease-out),
        transform 0.12s ease;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.theme-toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.theme-toggle:active {
    transform: scale(0.96);
}

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

.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    font-family: var(--font);
}

.skip-link:focus {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    inset-inline-start: max(12px, env(safe-area-inset-left, 0px));
    z-index: 10001;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0.65rem 1.1rem;
    clip: auto;
    overflow: visible;
    white-space: nowrap;
    background: var(--bg-card-hover);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-hover);
    box-shadow: var(--shadow-lg), var(--focus-ring);
}

.main {
    padding: 1.75rem 0 4.25rem;
}

/* بلوک نرخ ارز بالای جستجو */
.home-prices {
    position: relative;
    overflow: hidden;
    padding: 0.85rem 1rem 0.9rem;
    margin-bottom: 1rem;
}

.home-prices__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 8rem;
    pointer-events: none;
    z-index: 0;
}

.home-prices__head {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.65rem;
}

.home-prices__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: -0.02em;
}

.home-prices__title-ic {
    font-size: 1rem;
}

.home-prices__age {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
}

.home-prices__spotlight {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 0.5rem;
}

.home-spot-card {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.55rem 0.65rem;
    background: rgba(32, 40, 52, 0.4);
    backdrop-filter: blur(14px) saturate(1.12);
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
    min-height: 4.65rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition:
        border-color 0.18s var(--ease-out),
        box-shadow 0.18s var(--ease-out),
        transform 0.18s var(--ease-out),
        background 0.18s var(--ease-out);
}

.home-spot-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.home-spot-card--fx {
    background: linear-gradient(
        160deg,
        rgba(14, 165, 233, 0.28),
        rgba(20, 26, 34, 0.35)
    );
}

.home-spot-card--bullion {
    background: linear-gradient(160deg, rgba(212, 168, 75, 0.22), rgba(24, 20, 14, 0.4));
    border-color: rgba(212, 168, 75, 0.28);
}

.home-spot-card__top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.home-spot-card__ic {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-spot-card__emoji {
    font-size: 1.15rem;
    line-height: 1;
}

.home-spot-card__svg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-spot-card__svg svg {
    width: 22px;
    height: 22px;
    display: block;
}

.home-spot-card__lbl {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--muted);
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

.home-spot-card__val {
    font-size: 0.82rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    unicode-bidi: isolate;
    text-align: right;
    color: var(--text);
    line-height: 1.3;
    word-break: break-word;
}

.home-spot-card__unit {
    font-size: 0.72em;
    font-weight: 700;
    color: var(--muted);
}

a.home-spot-card--cta {
    text-decoration: none;
    color: var(--text);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    text-align: start;
    background: linear-gradient(165deg, rgba(46, 207, 255, 0.2), rgba(99, 102, 241, 0.12));
    border: 1px dashed rgba(46, 207, 255, 0.42);
    padding-inline: 0.75rem 0.65rem;
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

a.home-spot-card--cta:hover,
a.home-spot-card--cta:focus-visible {
    background: linear-gradient(165deg, rgba(46, 207, 255, 0.28), rgba(99, 102, 241, 0.18));
    border-color: rgba(46, 207, 255, 0.55);
    outline: none;
    box-shadow: var(--focus-ring);
}

.home-spot-card__cta-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

.home-spot-card__cta-chevron {
    flex-shrink: 0;
    color: var(--accent);
    opacity: 0.9;
    transform: scaleX(-1);
}

.back-to-top {
    position: fixed;
    z-index: 99;
    left: 0;
    right: 0;
    bottom: max(16px, env(safe-area-inset-bottom, 0));
    margin-inline: auto;
    width: max-content;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 198, 255, 0.35);
    background: rgba(20, 26, 34, 0.92);
    color: var(--accent);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transition: transform 0.12s, border-color 0.15s, background 0.15s;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    border-color: rgba(46, 207, 255, 0.5);
    background: rgba(26, 34, 45, 0.95);
    outline: none;
}

.back-to-top:focus-visible {
    box-shadow: var(--shadow), var(--focus-ring);
}

.back-to-top:active {
    transform: scale(0.97);
}

@media (max-width: 720px) {
    .site-header .wrap,
    .apps-header .wrap {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.45rem;
    }

    .site-header .brand,
    .apps-header .brand {
        flex-direction: row;
        align-items: center;
        flex: 1;
        min-width: 0;
        gap: 0.35rem;
    }

    .site-header .brand-text,
    .apps-header .brand-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.12rem;
        min-width: 0;
    }

    .site-header .tagline,
    .apps-header .tagline {
        display: block;
        margin: 0;
        max-width: 100%;
        font-size: 0.7rem;
        line-height: 1.35;
        white-space: normal;
    }

    .site-header .brand-text h1,
    .apps-header .brand-text h1 {
        font-size: clamp(1.05rem, 4.5vw, 1.45rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .header-actions {
        flex-wrap: nowrap;
        flex-shrink: 0;
        gap: 0.35rem;
    }

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

    .header-download-btn {
        box-sizing: border-box;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 0;
        border-radius: 10px;
        gap: 0;
    }

    .header-download-btn__ic {
        width: 18px;
        height: 18px;
    }
}

.card-glass {
    background: linear-gradient(165deg, rgba(22, 28, 38, 0.78) 0%, rgba(16, 21, 28, 0.84) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm), var(--shadow);
    backdrop-filter: blur(20px) saturate(1.15);
}

/* نرخ روز — شیشه مات */
.home-prices.card-glass {
    background: rgba(20, 26, 34, 0.48);
    backdrop-filter: blur(26px) saturate(1.22);
    -webkit-backdrop-filter: blur(26px) saturate(1.22);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 12px 44px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.search-section {
    position: sticky;
    top: var(--sticky-nav-h);
    z-index: 54;
    padding: 0.85rem 1rem 0.95rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.search-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 50%, #a78bfa 100%);
    opacity: 0.92;
}

.category-nav {
    position: sticky;
    top: 0;
    z-index: 55;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.55rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(12, 16, 22, 0.94) 0%, rgba(10, 14, 20, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm), 0 12px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px) saturate(1.1);
}

.category-nav__track {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-nav__track::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.category-nav__chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-soft);
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--border);
    white-space: nowrap;
    transition:
        background 0.18s var(--ease-out),
        border-color 0.18s var(--ease-out),
        color 0.18s var(--ease-out),
        transform 0.12s var(--ease-out);
}

.category-nav__chip:hover,
.category-nav__chip:focus-visible {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text);
    outline: none;
}

.category-nav__chip:focus-visible {
    box-shadow: var(--focus-ring);
}

.category-nav__chip:active {
    transform: scale(0.98);
}

.category-nav__chip--active {
    background: var(--accent-dim);
    border-color: rgba(46, 207, 255, 0.45);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(46, 207, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.category-nav__chip--active:hover,
.category-nav__chip--active:focus-visible {
    background: rgba(46, 207, 255, 0.2);
    border-color: rgba(46, 207, 255, 0.55);
}

.category-nav__emoji {
    font-size: 1rem;
    line-height: 1;
}

.category-nav__label {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    min-width: 200px;
    min-height: 2.65rem;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(5, 8, 12, 0.55);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9375rem;
    outline: none;
    transition:
        border-color 0.2s var(--ease-out),
        box-shadow 0.2s var(--ease-out),
        background 0.2s var(--ease-out);
}

.search-input::placeholder {
    color: var(--muted);
    opacity: 0.82;
}

.search-input:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.search-input:focus {
    border-color: rgba(46, 207, 255, 0.55);
    background: rgba(5, 8, 12, 0.7);
    box-shadow: var(--focus-ring);
}

.search-hint {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.search-hint.loading {
    color: var(--accent);
    font-weight: 700;
}

.search-results {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.search-results.hidden {
    display: none;
}

.search-results-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-results-hd strong {
    font-size: 1rem;
}

.search-results-hd span {
    font-size: 0.85rem;
    color: var(--muted);
}

.search-result-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0.15rem 0.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: min(60vh, 440px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 207, 255, 0.3) transparent;
}

.search-result-list a {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1.05rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition:
        background 0.18s var(--ease-out),
        border-color 0.18s var(--ease-out),
        transform 0.12s var(--ease-out);
}

.search-result-list a:hover,
.search-result-list a:focus-visible {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    outline: none;
}

.search-result-list a:focus-visible {
    box-shadow: var(--focus-ring);
}

.search-result-list a:active {
    transform: scale(0.995);
}

.sr-emoji {
    font-size: 1.25rem;
    line-height: 1;
}

.sr-meta {
    flex: 1;
    min-width: 0;
}

.sr-title {
    display: block;
    font-weight: 700;
    word-break: break-word;
}

.sr-note {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.2rem;
    white-space: pre-line;
    word-break: break-word;
}

.sr-url {
    display: block;
    font-size: 0.8rem;
    color: var(--success);
    word-break: break-all;
    margin-top: 0.15rem;
}

.sr-cat {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.category-block {
    margin-bottom: 2.75rem;
    scroll-margin-top: 5.25rem;
}

.category-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding-bottom: 0.85rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cat-emoji {
    font-size: 1.75rem;
    line-height: 1;
}

.category-head h2 {
    margin: 0;
    flex: 1;
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    min-width: 140px;
}

.cat-count {
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(46, 207, 255, 0.22);
}

.link-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1rem;
}

.link-card {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1.05rem 1.1rem 1.05rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(28, 36, 48, 0.52);
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    text-decoration: none;
    min-height: 4.65rem;
    position: relative;
    overflow: hidden;
    transition:
        background 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out),
        box-shadow 0.2s var(--ease-out),
        transform 0.18s var(--ease-out);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.link-card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: opacity 0.2s var(--ease-out);
}

.link-card:hover .link-card-title,
.link-card:focus-visible .link-card-title {
    color: var(--text);
}

.link-card:hover,
.link-card:focus-visible {
    background: rgba(36, 46, 60, 0.62);
    border-color: var(--border-hover);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    outline: none;
}

.link-card:hover::before,
.link-card:focus-visible::before {
    opacity: 1;
}

.link-card:focus-visible {
    box-shadow: var(--shadow), var(--focus-ring);
}

.link-card:active {
    transform: translateY(1px) scale(0.995);
}

.link-card-icon {
    flex-shrink: 0;
    color: var(--accent);
    margin-top: 0.1rem;
}

.link-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.link-card-title {
    font-weight: 700;
    font-size: 0.9375rem;
    line-height: 1.45;
    letter-spacing: -0.015em;
    color: var(--text-soft);
    word-break: break-word;
}

.link-card-note {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-line;
}

.link-card-host {
    font-size: 0.78rem;
    color: var(--muted);
    unicode-bidi: plaintext;
    direction: ltr;
    text-align: right;
}

.link-card-go {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 1.1rem;
    margin-inline-start: auto;
    padding-top: 0.15rem;
}

.empty-search {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
}

.site-footer {
    margin-top: auto;
    padding: 2.5rem 0 3rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 1.25rem;
    flex-wrap: wrap;
    text-align: center;
}

.footer-visits {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--muted);
    line-height: 1.4;
}

.footer-visits__label {
    margin-inline-end: 0.35rem;
}

.footer-visits__num {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.iran-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.iran-link:hover,
.iran-link:focus-visible {
    background: rgba(35, 159, 64, 0.12);
    border-color: rgba(35, 159, 64, 0.4);
    outline: none;
}

.iran-link:focus-visible {
    box-shadow: var(--focus-ring);
}

.iran-flag {
    display: block;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    vertical-align: middle;
}

@media (max-width: 520px) {
    .link-grid {
        grid-template-columns: 1fr;
    }
}

/* —— صفحه دانلود برنامه (apps.php) */
body.page-apps {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.apps-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    transition:
        opacity 0.15s,
        background 0.15s,
        border-color 0.15s;
}

.apps-back__ic {
    font-size: 1.05rem;
    line-height: 1;
}

.apps-back:focus-visible {
    border-radius: var(--radius-xs);
    box-shadow: var(--focus-ring);
}

.apps-back--bottom {
    margin: 2rem auto 2.5rem;
    padding: 0.5rem 0;
}

.apps-back--bottom:hover,
.apps-back--bottom:focus-visible {
    opacity: 0.88;
    outline: none;
}

.apps-main {
    flex: 1;
    padding: 1.75rem 0 2rem;
}

.apps-section {
    margin-bottom: 2.5rem;
}

.apps-section__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.15rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}

.apps-section__emoji {
    font-size: 1.35rem;
    line-height: 1;
}

.apps-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1rem;
}

.apps-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.15rem 1.2rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(165deg, rgba(24, 32, 42, 0.95) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm), var(--shadow);
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.apps-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm), 0 12px 40px rgba(0, 0, 0, 0.35);
}

.apps-card--missing {
    opacity: 0.72;
    border-style: dashed;
}

.apps-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.apps-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-soft);
}

.apps-card__size {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    unicode-bidi: plaintext;
}

.apps-card__desc {
    margin: 0 0 0.65rem;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.55;
    flex: 1;
}

.apps-card__file {
    margin: 0 0 0.85rem;
    font-size: 0.72rem;
    color: var(--success);
    word-break: break-all;
    opacity: 0.9;
}

.apps-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem 1rem;
    margin-top: auto;
}

.apps-card__actions--android {
    justify-content: space-between;
}

.apps-card__actions .apps-card__btn {
    margin-top: 0;
}

.apps-card__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem;
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.apps-card__qr-img {
    display: block;
    width: 108px;
    height: 108px;
    border-radius: 6px;
    background: #fff;
}

.apps-card__qr-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    max-width: 7.5rem;
    line-height: 1.35;
}

.apps-card__btn {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.48rem 1.15rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.02em;
    color: #071018;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: var(--shadow-sm), 0 0 20px rgba(46, 207, 255, 0.15);
    transition:
        transform 0.18s var(--ease-out),
        box-shadow 0.18s var(--ease-out),
        filter 0.18s var(--ease-out);
}

.apps-card__btn:hover,
.apps-card__btn:focus-visible {
    filter: brightness(1.05);
    box-shadow: var(--shadow-sm), 0 8px 28px rgba(46, 207, 255, 0.28);
    outline: none;
}

.apps-card__btn:focus-visible {
    box-shadow: var(--shadow-sm), var(--focus-ring), 0 8px 28px rgba(46, 207, 255, 0.22);
}

.apps-card__btn:active {
    transform: scale(0.98);
}

.apps-card__btn--disabled {
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    border-color: var(--border);
    box-shadow: none;
}

.apps-footer {
    margin-top: auto;
}

/* تم روشن — خاکستری–آبی مات (نه سفیدِ تند) */
body.light-mode {
    --bg-deep: #d4dae6;
    --bg-elevated: #dfe4ee;
    --bg-card: #e4e9f2;
    --bg-card-hover: #d6dde8;
    --border: rgba(15, 23, 42, 0.13);
    --border-hover: rgba(3, 105, 161, 0.38);
    --text: #0f172a;
    --text-soft: #3d4d63;
    --muted: #5a6a7e;
    --accent: #0369a1;
    --accent-dim: rgba(3, 105, 161, 0.14);
    --accent-2: #1d4ed8;
    --success: #047857;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.07);
    --shadow: 0 4px 22px rgba(15, 23, 42, 0.09);
    --shadow-lg: 0 16px 44px rgba(15, 23, 42, 0.12);
    --focus-ring: 0 0 0 3px rgba(3, 105, 161, 0.24);
}

body.light-mode ::selection {
    background: rgba(3, 105, 161, 0.18);
    color: var(--text);
}

body.light-mode .bg-grid {
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.065) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.065) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 25%, transparent 75%);
}

body.light-mode .glow-1,
body.light-mode .glow-2 {
    opacity: 0.12;
}

body.light-mode .site-header,
body.light-mode .apps-header {
    background: linear-gradient(180deg, #e4e9f2 0%, #d7dde8 100%);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.09);
}

body.light-mode .site-header__svg {
    opacity: 0.95;
}

body:not(.light-mode) .site-header__svg {
    opacity: 0.5;
    mix-blend-mode: screen;
}

body.light-mode .home-prices__svg {
    opacity: 1;
}

body:not(.light-mode) .home-prices__svg {
    opacity: 0.35;
    mix-blend-mode: overlay;
}

/* عنوان برند: مشکی مات هماهنگ با تم روشن */
body.light-mode .brand-text h1 {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: #0a0a0a;
}

/* دکمهٔ CTA هدر: کنتراست و ظاهر تمیز روی پس‌زمینهٔ روشن */
body.light-mode .header-download-btn {
    color: #f8fafc;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(15, 23, 42, 0.22);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 6px 18px rgba(15, 23, 42, 0.12);
}

body.light-mode .header-download-btn:hover,
body.light-mode .header-download-btn:focus-visible {
    filter: brightness(1.07);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.08),
        0 8px 22px rgba(15, 23, 42, 0.16);
    outline: none;
}

body.light-mode .header-download-btn:focus-visible {
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.08),
        0 8px 22px rgba(15, 23, 42, 0.14),
        var(--focus-ring);
}

body.light-mode .card-glass {
    background: linear-gradient(165deg, rgba(222, 228, 238, 0.92) 0%, rgba(210, 218, 230, 0.94) 100%);
}

body.light-mode .home-prices.card-glass {
    background: rgba(210, 218, 232, 0.58);
    border: 1px solid rgba(15, 23, 42, 0.11);
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(24px) saturate(1.15);
    -webkit-backdrop-filter: blur(24px) saturate(1.15);
}

body.light-mode .theme-toggle {
    background: rgba(218, 225, 236, 0.88);
    border: 1px solid rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(12px) saturate(1.05);
    -webkit-backdrop-filter: blur(12px) saturate(1.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.light-mode .theme-toggle:hover {
    background: rgba(226, 232, 242, 0.95);
    border-color: rgba(3, 105, 161, 0.32);
}

body.light-mode .category-nav {
    background: linear-gradient(180deg, #e2e8f3 0%, #d5dde8 100%);
    box-shadow: var(--shadow-sm), 0 8px 26px rgba(15, 23, 42, 0.08);
}

body.light-mode .category-nav__chip {
    background: rgba(15, 23, 42, 0.08);
}

body.light-mode .category-nav__chip--active {
    border-color: rgba(3, 105, 161, 0.38);
    box-shadow:
        0 0 0 1px rgba(3, 105, 161, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light-mode .category-nav__chip--active:hover,
body.light-mode .category-nav__chip--active:focus-visible {
    background: rgba(2, 132, 199, 0.18);
    border-color: rgba(2, 132, 199, 0.52);
}

body.light-mode .search-input {
    background: rgba(224, 230, 240, 0.92);
}

body.light-mode .search-input:hover {
    border-color: rgba(15, 23, 42, 0.18);
}

body.light-mode .search-input:focus {
    background: #e8edf5;
    border-color: rgba(3, 105, 161, 0.5);
}

body.light-mode .search-result-list {
    scrollbar-color: rgba(2, 132, 199, 0.35) transparent;
}

body.light-mode .search-result-list a {
    background: rgba(15, 23, 42, 0.07);
}

body.light-mode .home-spot-card {
    background: rgba(214, 222, 234, 0.68);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.light-mode .home-spot-card--fx {
    background: linear-gradient(
        160deg,
        rgba(14, 165, 233, 0.22),
        rgba(208, 218, 232, 0.62)
    );
    border-color: rgba(14, 165, 233, 0.26);
}

body.light-mode .home-spot-card--bullion {
    background: linear-gradient(160deg, rgba(212, 168, 75, 0.22), rgba(218, 214, 230, 0.58));
    border-color: rgba(160, 120, 50, 0.32);
}

body.light-mode a.home-spot-card--cta {
    background: linear-gradient(165deg, rgba(2, 132, 199, 0.22), rgba(37, 99, 235, 0.12));
    border-color: rgba(2, 132, 199, 0.38);
}

body.light-mode a.home-spot-card--cta:hover,
body.light-mode a.home-spot-card--cta:focus-visible {
    background: linear-gradient(165deg, rgba(2, 132, 199, 0.3), rgba(37, 99, 235, 0.18));
    border-color: rgba(2, 132, 199, 0.52);
}

body.light-mode .back-to-top {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(222, 228, 238, 0.94);
    color: var(--accent);
    box-shadow: var(--shadow-sm), 0 8px 24px rgba(15, 23, 42, 0.11);
}

body.light-mode .back-to-top:hover,
body.light-mode .back-to-top:focus-visible {
    background: #e6ebf4;
    border-color: rgba(3, 105, 161, 0.45);
    color: #075985;
}

body.light-mode .category-head {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .cat-count {
    border-color: rgba(2, 132, 199, 0.28);
}

body.light-mode .link-card {
    background: rgba(212, 220, 234, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow:
        0 6px 26px rgba(15, 23, 42, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

body.light-mode .link-card:hover {
    background: rgba(222, 228, 240, 0.82);
    border-color: var(--border-hover);
    box-shadow:
        0 10px 34px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body.light-mode .link-card:focus-visible {
    background: rgba(222, 228, 240, 0.82);
    border-color: var(--border-hover);
    box-shadow:
        0 10px 34px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        var(--focus-ring);
}

body.light-mode .site-footer {
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.07) 0%, transparent 100%);
}

body.light-mode .iran-link {
    background: rgba(15, 23, 42, 0.07);
}

body.light-mode .apps-card__qr {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
}

body.light-mode .apps-card {
    background: linear-gradient(165deg, rgba(218, 225, 236, 0.95) 0%, var(--bg-card) 100%);
}

body.light-mode .apps-card:hover {
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: var(--shadow-sm), 0 12px 32px rgba(15, 23, 42, 0.08);
}

body.light-mode .apps-card__btn--disabled {
    background: rgba(15, 23, 42, 0.06);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
