/* ---------- Sold usernames — phone layout (components/sold/sold-m.php, below 1024px) ----------
 * Hero with the record card (counters run in sold-mobile.js), platform tabs with a sliding underline (.sdm-tabs__ind,
 * placed by the script), the ticket grid or the compact list, and "Show more". The desktop v5 layout (#mk5) keeps
 * #soldPage; phones hide it. White mode: sold-mobile-light.css
 */
.sdm { display: none; }

@media (max-width: 1023px) {
    #mk5 #soldPage { display: none; }
    .sdm {
        --sdm-ease: cubic-bezier(0.22, 1, 0.36, 1);
        --sdm-display: Sora, 'Noto Sans Arabic', system-ui, sans-serif;
        --sdm-mono: 'JetBrains Mono', ui-monospace, monospace;
        --sdm-bg: #000;
        /* z-index: above the page's fixed .global-vignette (z 1), which would darken the edges of the design */
        position: relative; z-index: 2; display: block; overflow: hidden; max-width: 560px; margin: 0 auto;
        padding: calc(var(--snav-space, 0px) + 20px + env(safe-area-inset-top, 0px)) 20px 48px; color: #fff;
    }
    .sdm__glow { position: absolute; left: 50%; top: 150px; width: 560px; height: 560px; transform: translateX(-50%); pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 65%); }

    /* Hero */
    .sdm__crumbs { position: relative; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; }
    .sdm__crumbs a { display: flex; align-items: center; min-height: 32px; color: rgba(255, 255, 255, 0.45); text-decoration: none; }
    .sdm__crumbs i { font-size: 8px; color: rgba(255, 255, 255, 0.22); }
    .sdm__crumbs span { color: rgba(255, 255, 255, 0.75); }
    .sdm__meta { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 22px; font-size: 12.5px; font-weight: 500; color: rgba(255, 255, 255, 0.6); }
    .sdm__stack { display: flex; flex-shrink: 0; }
    .sdm__stack > span {
        width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
        background: radial-gradient(circle at 35% 30%, #2a2a2f 0%, #0b0b0d 100%); box-shadow: 0 0 0 2px var(--sdm-bg), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    }
    .sdm__stack > span + span { margin-inline-start: -10px; }
    .sdm__stack img { width: 24px; height: 24px; object-fit: contain; pointer-events: none; }
    .sdm__title { position: relative; margin: 12px 0 0; font-family: var(--sdm-display); font-size: 34px; line-height: 1.06; letter-spacing: -0.05em; font-weight: 600; color: #fff; }
    .sdm__title span { color: rgba(255, 255, 255, 0.42); }
    .sdm__lead { position: relative; margin: 12px 0 0; max-width: 34ch; font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, 0.5); text-wrap: pretty; }

    /* Record card */
    .sdm-rec { position: relative; margin-top: 22px; border-radius: 26px; padding: 1px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 55%, rgba(255, 255, 255, 0.1) 100%); }
    .sdm-rec__in { position: relative; display: flex; flex-direction: column; border-radius: 25px; padding: 20px; background: linear-gradient(180deg, #141416 0%, #0b0b0d 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
    .sdm-rec__art { position: absolute; inset-inline-end: 16px; top: 14px; width: 84px; height: 84px; pointer-events: none; }
    .sdm-rec__art img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.75)); animation: sdmFloat 6s ease-in-out infinite; }
    .sdm-rec__art::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 76px; height: 10px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 70%); }
    .sdm-rec__label { padding-inline-end: 96px; font-family: var(--sdm-mono); font-size: 10px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); }
    .sdm-rec__vol {
        align-self: flex-start; margin-top: 10px; font-family: var(--sdm-display); font-size: 50px; font-weight: 300; line-height: 1; letter-spacing: -0.06em; font-variant-numeric: tabular-nums;
        background: linear-gradient(180deg, #fff 0%, #d9d9de 45%, #7a7a82 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
    }
    .sdm-rec__split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
    .sdm-rec__cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
    .sdm-rec__cell:first-child { padding-inline-end: 14px; border-inline-end: 1px solid rgba(255, 255, 255, 0.07); }
    .sdm-rec__cell + .sdm-rec__cell { padding-inline-start: 16px; }
    .sdm-rec__row { display: flex; align-items: center; gap: 10px; }
    .sdm-rec__val { align-self: flex-start; font-family: var(--sdm-display); font-size: 26px; font-weight: 300; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; color: #fff; }
    .sdm-rec__row .sdm-rec__val { align-self: auto; }
    .sdm-rec__icons { display: flex; }
    .sdm-rec__icons > span {
        width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
        background: linear-gradient(180deg, #26262a 0%, #121214 100%); box-shadow: 0 0 0 2px #0f0f11; color: rgba(255, 255, 255, 0.85); font-size: 11px;
    }
    .sdm-rec__icons > span + span { margin-inline-start: -6px; }
    .sdm-rec__cap { font-size: 12.5px; font-weight: 500; color: rgba(255, 255, 255, 0.45); }

    /* Platform tabs */
    .sdm-tabs { position: relative; margin: 22px -20px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
    .sdm-tabs__rail { position: relative; display: flex; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
    .sdm-tabs__rail::-webkit-scrollbar { display: none; }
    .sdm-tabs__rail--many {
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 36px), transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 36px), transparent 100%);
    }
    .sdm-tabs__ind {
        position: absolute; bottom: 0; left: 0; width: 0; height: 2px; border-radius: 999px; background: #fff; box-shadow: 0 0 14px rgba(255, 255, 255, 0.55);
        transition: left .45s var(--sdm-ease), width .45s var(--sdm-ease);
    }
    /* few tabs share the row by content width (a long name like "Instagram" keeps its room); many tabs scroll */
    .sdm-tab {
        flex: 1 1 auto; min-width: 0; height: 50px; padding: 0 4px; display: flex; align-items: center; justify-content: center; gap: 7px;
        border: 0; background: none; color: rgba(255, 255, 255, 0.45); cursor: pointer; transition: color .3s; -webkit-tap-highlight-color: transparent;
    }
    .sdm-tabs__rail--many .sdm-tab { flex: 0 0 auto; padding: 0 14px; }
    .sdm-tab i { font-size: 14px; }
    .sdm-tab__label { overflow: hidden; text-overflow: ellipsis; font-family: var(--sdm-display); font-size: 14px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
    .sdm-tab__n {
        display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.55);
        font-family: var(--sdm-mono); font-size: 10px; font-weight: 600; transition: background .3s, color .3s;
    }
    .sdm-tab[aria-pressed="true"] { color: #fff; }
    .sdm-tab[aria-pressed="true"] .sdm-tab__n { background: #fff; color: #0a0a0a; }
    .sdm-tab:focus-visible { outline: 2px solid #fff; outline-offset: -6px; border-radius: 12px; }

    /* Count + view toggle */
    .sdm-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
    .sdm-bar__count { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, 0.5); }
    .sdm-bar__count b { font-weight: 700; color: #fff; }
    .sdm-views { display: flex; gap: 2px; padding: 3px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.03); }
    .sdm-view {
        width: 40px; height: 32px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: transparent;
        color: rgba(255, 255, 255, 0.45); font-size: 12px; cursor: pointer; transition: background .2s, color .2s; -webkit-tap-highlight-color: transparent;
    }
    .sdm-view[aria-pressed="true"] { background: rgba(255, 255, 255, 0.12); color: #fff; }
    .sdm-view:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

    /* Ticket grid */
    .sdm-list { margin-top: 12px; }
    .sdm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
    .sdm-card {
        position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.1);
        background: linear-gradient(180deg, #161618 0%, #0c0c0e 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }
    .sdm-card__top { padding: 14px 14px 0; }
    .sdm-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .sdm-card__pl { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, 0.55); }
    .sdm-card__pl i { font-size: 12px; color: rgba(255, 255, 255, 0.8); }
    .sdm-card__no { flex-shrink: 0; font-family: var(--sdm-mono); font-size: 10.5px; font-weight: 600; color: rgba(255, 255, 255, 0.3); }
    .sdm-card__user { display: block; margin-top: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--sdm-display); font-size: 21px; font-weight: 600; letter-spacing: -0.04em; color: #fff; }
    /* perforation: a dashed line with a notch bitten out of each side */
    .sdm-card__perf { position: relative; height: 0; margin: 16px 12px 0; border-top: 1px dashed rgba(255, 255, 255, 0.13); }
    .sdm-card__perf::before, .sdm-card__perf::after {
        content: ''; position: absolute; top: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--sdm-bg); border: 1px solid rgba(255, 255, 255, 0.1);
    }
    .sdm-card__perf::before { left: -20px; clip-path: inset(0 0 0 50%); }
    .sdm-card__perf::after { right: -20px; clip-path: inset(0 50% 0 0); }
    .sdm-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 14px; }
    .sdm-card__tag {
        display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.18);
        font-family: var(--sdm-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; color: rgba(255, 255, 255, 0.75);
    }
    .sdm-card__price { font-family: var(--sdm-display); font-size: 17px; font-weight: 600; letter-spacing: -0.03em; color: #fff; }

    /* Compact list */
    .sdm-rows { border-radius: 22px; padding: 1px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 55%, rgba(255, 255, 255, 0.08) 100%); }
    .sdm-rows__in { border-radius: 21px; overflow: hidden; background: linear-gradient(180deg, #111113 0%, #0b0b0d 100%); }
    .sdm-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding-block: 10px; padding-inline: 14px 16px; }
    .sdm-row + .sdm-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
    .sdm-row__ico {
        flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
        background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.85); font-size: 14px;
    }
    .sdm-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
    .sdm-row__user { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--sdm-display); font-size: 16px; font-weight: 600; letter-spacing: -0.03em; color: #fff; }
    .sdm-row__meta { font-size: 12px; color: rgba(255, 255, 255, 0.42); }
    .sdm-row__end { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
    .sdm-row__price { font-family: var(--sdm-display); font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
    .sdm-row__sold { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.5); }
    .sdm-row__sold i { font-size: 9px; color: #fff; }

    /* Empty filter / no sales */
    .sdm-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 22px; padding: 36px 20px; border-radius: 22px; border: 1px dashed rgba(255, 255, 255, 0.12); text-align: center; }
    .sdm-empty__ico { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.7); }
    .sdm-empty h2, .sdm-empty h3 { margin: 6px 0 0; font-family: var(--sdm-display); font-size: 17px; font-weight: 600; color: #fff; }
    .sdm-empty p { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, 0.5); }
    .sdm-list .sdm-empty { margin-top: 0; }

    /* Show more */
    .sdm-more {
        width: 100%; height: 50px; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.03); color: #fff; cursor: pointer;
        font-family: var(--sdm-display); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; transition: background .2s, border-color .2s; -webkit-tap-highlight-color: transparent;
    }
    .sdm-more[hidden] { display: none; }
    .sdm-more:active { background: rgba(255, 255, 255, 0.08); }
    .sdm-more:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    .sdm-more__n { font-family: var(--sdm-mono); font-size: 11px; font-weight: 600; letter-spacing: 0; color: rgba(255, 255, 255, 0.4); }

    /* RTL: the crumb chevron points the reading way, the tab fade sits on the left; Arabic script keeps its natural spacing */
    html[dir="rtl"] .sdm__crumbs i { transform: scaleX(-1); }
    html[dir="rtl"] .sdm-tabs__rail--many {
        -webkit-mask-image: linear-gradient(270deg, transparent 0, #000 20px, #000 calc(100% - 36px), transparent 100%);
        mask-image: linear-gradient(270deg, transparent 0, #000 20px, #000 calc(100% - 36px), transparent 100%);
    }
    html[dir="rtl"] :is(.sdm__title, .sdm-rec__label, .sdm-rec__cap, .sdm-tab__label, .sdm-card__tag, .sdm-more) { letter-spacing: 0; }
    /* the mono face has no Arabic glyphs, and its fallback spaces the words far apart */
    html[dir="rtl"] :is(.sdm-rec__label, .sdm-card__tag) { font-family: var(--sdm-display); font-size: 11px; }

    @keyframes sdmFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
}

@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
    .sdm-rec__art img { animation: none; }
    .sdm-tabs__ind { transition: none; }
}
