/* ==========================================================================
   CodeStrike - site stylesheet
   One file for every public page. The admin panel has its own (acp/assets).

   Layers, lowest priority first, so a page rule never needs !important to
   beat a component and a utility always wins.
   ========================================================================== */
@layer reset, tokens, base, layout, components, pages, utilities;

/* ---------------------------------------------------------------- tokens */
@layer tokens {
    :root {
        color-scheme: dark;

        /* Surfaces - a blue-black ramp, so cards read as lifted, not grey */
        --bg: #06080d;
        --bg-2: #0a0e16;
        --surface: #0e131d;
        --surface-2: #131a27;
        --surface-3: #1a2333;
        --surface-hover: #1c2638;
        --overlay: rgb(3 5 9 / .72);

        --border: rgb(148 163 184 / .1);
        --border-2: rgb(148 163 184 / .17);
        --border-3: rgb(148 163 184 / .28);

        --text: #e9eef7;
        --text-2: #a9b3c5;
        --text-3: #6f7a8f;

        /* Brand - the two halves of the logo */
        --blue: #2b8cff;
        --blue-2: #5ba6ff;
        --blue-3: #9cc8ff;
        --blue-soft: rgb(43 140 255 / .12);
        --blue-ring: rgb(43 140 255 / .45);
        --orange: #ff7a1a;
        --orange-2: #ff9440;
        --orange-soft: rgb(255 122 26 / .12);
        --brand-gradient: linear-gradient(100deg, var(--blue) 0%, #6a7dff 45%, var(--orange) 100%);

        --green: #22c55e;
        --green-2: #4ade80;
        --green-soft: rgb(34 197 94 / .12);
        --red: #ef4444;
        --red-2: #f87171;
        --red-soft: rgb(239 68 68 / .12);
        --yellow: #f5b83d;
        --yellow-soft: rgb(245 184 61 / .12);
        --pink: #f43f5e;
        --discord: #5865f2;

        --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
        --font-display: 'Exo 2', 'Inter', ui-sans-serif, system-ui, sans-serif;
        --font-mono: ui-monospace, 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

        --fs-xs: .75rem;
        --fs-sm: .875rem;
        --fs-base: 1rem;
        --fs-lg: 1.125rem;
        --fs-xl: 1.25rem;
        --fs-2xl: clamp(1.375rem, 1.2rem + .8vw, 1.625rem);
        --fs-3xl: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem);
        --fs-4xl: clamp(2rem, 1.5rem + 2.2vw, 2.875rem);
        --fs-5xl: clamp(2.375rem, 1.6rem + 3.4vw, 3.875rem);

        --radius-xs: 6px;
        --radius-sm: 8px;
        --radius: 12px;
        --radius-lg: 16px;
        --radius-xl: 22px;
        --radius-full: 999px;

        --shadow-sm: 0 1px 2px rgb(0 0 0 / .35);
        --shadow: 0 8px 24px -8px rgb(0 0 0 / .55), 0 2px 6px rgb(0 0 0 / .3);
        --shadow-lg: 0 24px 60px -16px rgb(0 0 0 / .7), 0 4px 14px rgb(0 0 0 / .35);
        --glow-blue: 0 0 0 1px rgb(43 140 255 / .35), 0 10px 40px -10px rgb(43 140 255 / .55);
        --glow-orange: 0 10px 34px -10px rgb(255 122 26 / .7);

        --container: 1240px;
        --gutter: clamp(1rem, .6rem + 1.6vw, 2rem);
        --header-h: 68px;
        --ease: cubic-bezier(.2, .7, .2, 1);
        --dur: .18s;
    }
}

/* ----------------------------------------------------------------- reset */
@layer reset {
    *, *::before, *::after { box-sizing: border-box; }
    * { margin: 0; padding: 0; }
    html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    img, picture, video, canvas, svg { display: block; max-width: 100%; }
    img { height: auto; }
    input, button, textarea, select { font: inherit; color: inherit; }
    button { background: none; border: 0; cursor: pointer; }
    a { color: inherit; text-decoration: none; }
    ul, ol { list-style: none; }
    table { border-collapse: collapse; }
    p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
    [hidden] { display: none !important; }
}

/* ------------------------------------------------------------------ base */
@layer base {
    @view-transition { navigation: auto; }

    html {
        scroll-behavior: smooth;
        scroll-padding-top: calc(var(--header-h) + 1rem);
        background: var(--bg);
    }

    body {
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        font-family: var(--font-body);
        font-size: var(--fs-base);
        line-height: 1.6;
        color: var(--text);
        background:
            radial-gradient(1100px 520px at 12% -8%, rgb(43 140 255 / .13), transparent 60%),
            radial-gradient(900px 480px at 92% -4%, rgb(255 122 26 / .08), transparent 60%),
            var(--bg);
        background-repeat: no-repeat;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
        overflow-x: clip;
    }

    body > main, .site-main { flex: 1 0 auto; }

    h1, h2, h3, h4 {
        font-family: var(--font-display);
        font-weight: 700;
        line-height: 1.15;
        letter-spacing: -.01em;
        color: var(--text);
        text-wrap: balance;
    }

    p { text-wrap: pretty; }

    ::selection { background: rgb(43 140 255 / .35); color: #fff; }

    :focus-visible {
        outline: 2px solid var(--blue-2);
        outline-offset: 2px;
        border-radius: 4px;
    }

    code, kbd, pre { font-family: var(--font-mono); font-size: .9em; }

    kbd {
        display: inline-flex;
        align-items: center;
        min-width: 1.5em;
        padding: .05em .4em;
        font-size: .72rem;
        color: var(--text-2);
        background: var(--surface-3);
        border: 1px solid var(--border-2);
        border-bottom-width: 2px;
        border-radius: 5px;
    }

    hr { border: 0; border-top: 1px solid var(--border); }

    /* Scrollbars - thin and dark, so a scrolled panel does not get a white rail */
    * { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
    ::-webkit-scrollbar-thumb:hover { background: #26324a; }

    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: .01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: .01ms !important;
            scroll-behavior: auto !important;
        }
    }
}

/* ---------------------------------------------------------------- layout */
@layer layout {
    .container {
        width: 100%;
        max-width: calc(var(--container) + var(--gutter) * 2);
        margin-inline: auto;
        padding-inline: var(--gutter);
    }
    .container-narrow { max-width: calc(860px + var(--gutter) * 2); }
    .container-tight { max-width: calc(560px + var(--gutter) * 2); }

    .section { padding-block: clamp(3.5rem, 2.5rem + 4vw, 6.5rem); position: relative; }
    .section-sm { padding-block: clamp(2.25rem, 1.8rem + 2vw, 3.5rem); }
    .section-alt { background: linear-gradient(180deg, transparent, rgb(14 19 29 / .65) 12%, rgb(14 19 29 / .65) 88%, transparent); }

    .section-head {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 1rem 2rem;
        flex-wrap: wrap;
        margin-bottom: clamp(1.75rem, 1.4rem + 1.4vw, 2.75rem);
    }
    .section-head.is-center { flex-direction: column; align-items: center; text-align: center; }
    .section-head.is-center .section-sub { margin-inline: auto; }
    .section-title { font-size: var(--fs-4xl); }
    .section-sub { color: var(--text-2); font-size: var(--fs-lg); max-width: 62ch; margin-top: .6rem; }

    .eyebrow {
        display: inline-flex;
        align-items: center;
        gap: .5rem;
        margin-bottom: .85rem;
        font-size: var(--fs-xs);
        font-weight: 700;
        letter-spacing: .14em;
        text-transform: uppercase;
        color: var(--blue-2);
    }
    .eyebrow::before {
        content: '';
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: var(--brand-gradient);
    }

    .page-head { padding-block: clamp(2rem, 1.5rem + 2.4vw, 3.5rem) clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); }
    .page-title { font-size: var(--fs-4xl); }
    .page-sub { color: var(--text-2); margin-top: .5rem; max-width: 65ch; }

    .grid-cards {
        display: grid;
        gap: clamp(1rem, .8rem + .8vw, 1.5rem);
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    }
    .grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
    .grid-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

    .stack > * + * { margin-top: var(--stack, 1rem); }
    .cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, .75rem); }
    .split { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

    /* Two columns: content + sticky sidebar. Collapses under 960px. */
    .with-aside {
        display: grid;
        gap: clamp(1.25rem, 1rem + 1.4vw, 2.25rem);
        grid-template-columns: minmax(0, 1fr) 360px;
        align-items: start;
    }
    .with-aside.is-left { grid-template-columns: 260px minmax(0, 1fr); }
    .sticky-aside { position: sticky; top: calc(var(--header-h) + 1.25rem); }
    @media (max-width: 960px) {
        .with-aside, .with-aside.is-left { grid-template-columns: minmax(0, 1fr); }
        .sticky-aside { position: static; }
    }
}

/* ------------------------------------------------------------ components */
@layer components {

    /* Gradient text, for the one highlighted word in a heading */
    .text-gradient {
        background: var(--brand-gradient);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
    .text-blue { color: var(--blue-2); }
    .text-orange { color: var(--orange-2); }

    /* ---------- Buttons ---------- */
    .btn {
        --btn-bg: var(--surface-3);
        --btn-fg: var(--text);
        --btn-border: var(--border-2);
        --btn-hover: var(--surface-hover);
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .55rem;
        min-height: 44px;
        padding: .6rem 1.15rem;
        font-size: var(--fs-sm);
        font-weight: 650;
        line-height: 1.2;
        white-space: nowrap;
        color: var(--btn-fg);
        background: var(--btn-bg);
        border: 1px solid var(--btn-border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        user-select: none;
        transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
                    color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
    }
    .btn:hover { background: var(--btn-hover); }
    .btn:active { transform: translateY(1px); }
    .btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
    .btn i { font-size: 1.05em; line-height: 1; }

    .btn-primary {
        --btn-bg: linear-gradient(180deg, var(--orange-2), var(--orange));
        --btn-fg: #fff;
        --btn-border: transparent;
        --btn-hover: linear-gradient(180deg, #ffa257, #ff8530);
        box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 6px 20px -8px rgb(255 122 26 / .75);
        text-shadow: 0 1px 1px rgb(0 0 0 / .18);
    }
    .btn-primary:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), var(--glow-orange); }

    .btn-blue {
        --btn-bg: linear-gradient(180deg, #3d97ff, var(--blue));
        --btn-fg: #fff;
        --btn-border: transparent;
        --btn-hover: linear-gradient(180deg, #57a6ff, #3593ff);
        box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 6px 20px -8px rgb(43 140 255 / .8);
    }

    .btn-outline { --btn-bg: transparent; --btn-border: var(--border-3); --btn-hover: rgb(148 163 184 / .08); }
    .btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-hover: rgb(148 163 184 / .08); --btn-fg: var(--text-2); }
    .btn-ghost:hover { color: var(--text); }
    .btn-success { --btn-bg: var(--green-soft); --btn-fg: var(--green-2); --btn-border: rgb(34 197 94 / .3); --btn-hover: rgb(34 197 94 / .2); }
    .btn-danger { --btn-bg: var(--red-soft); --btn-fg: var(--red-2); --btn-border: rgb(239 68 68 / .3); --btn-hover: rgb(239 68 68 / .2); }
    .btn-discord { --btn-bg: var(--discord); --btn-fg: #fff; --btn-border: transparent; --btn-hover: #4752c4; }
    .btn-white { --btn-bg: #fff; --btn-fg: #111827; --btn-border: transparent; --btn-hover: #e5e7eb; }

    .btn-sm { min-height: 36px; padding: .4rem .8rem; font-size: var(--fs-xs); border-radius: var(--radius-xs); }
    .btn-lg { min-height: 52px; padding: .8rem 1.6rem; font-size: var(--fs-base); border-radius: var(--radius); }
    .btn-xl { min-height: 58px; padding: .9rem 2rem; font-size: var(--fs-lg); border-radius: var(--radius); }
    .btn-block { width: 100%; }
    .btn-icon { padding: 0; width: 44px; min-width: 44px; }
    .btn-icon.btn-sm { width: 36px; min-width: 36px; }

    .btn.is-loading { color: transparent !important; pointer-events: none; }
    .btn.is-loading::after {
        content: '';
        position: absolute;
        width: 18px;
        height: 18px;
        border: 2px solid rgb(255 255 255 / .35);
        border-top-color: #fff;
        border-radius: 50%;
        animation: spin .7s linear infinite;
    }

    .link { color: var(--blue-2); font-weight: 550; text-underline-offset: 3px; }
    .link:hover { text-decoration: underline; }

    /* ---------- Badges & chips ---------- */
    .badge {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        padding: .22rem .6rem;
        font-size: .6875rem;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        line-height: 1.3;
        color: var(--text-2);
        background: var(--surface-3);
        border: 1px solid var(--border-2);
        border-radius: var(--radius-full);
        white-space: nowrap;
    }
    .badge-blue { color: var(--blue-3); background: var(--blue-soft); border-color: rgb(43 140 255 / .3); }
    .badge-orange { color: var(--orange-2); background: var(--orange-soft); border-color: rgb(255 122 26 / .3); }
    .badge-green { color: var(--green-2); background: var(--green-soft); border-color: rgb(34 197 94 / .3); }
    .badge-red { color: var(--red-2); background: var(--red-soft); border-color: rgb(239 68 68 / .3); }
    .badge-yellow { color: var(--yellow); background: var(--yellow-soft); border-color: rgb(245 184 61 / .3); }
    .badge-new { color: #fff; background: linear-gradient(135deg, var(--orange), #ef4444); border-color: transparent; font-size: .5625rem; padding: .15rem .45rem; }

    .chip {
        display: inline-flex;
        align-items: center;
        gap: .45rem;
        min-height: 36px;
        padding: .35rem .85rem;
        font-size: var(--fs-sm);
        font-weight: 550;
        color: var(--text-2);
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: var(--radius-full);
        transition: all var(--dur) var(--ease);
        white-space: nowrap;
    }
    .chip:hover { color: var(--text); border-color: var(--border-3); background: var(--surface-3); }
    .chip.is-active { color: #fff; background: var(--blue-soft); border-color: var(--blue-ring); }
    .chip .chip-count { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }

    /* ---------- Cards ---------- */
    .card {
        position: relative;
        background: linear-gradient(180deg, var(--surface-2), var(--surface));
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
    }
    .card-pad { padding: clamp(1.15rem, 1rem + .8vw, 1.75rem); }
    .card-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1.1rem clamp(1.15rem, 1rem + .8vw, 1.75rem);
        border-bottom: 1px solid var(--border);
    }
    .card-title { font-size: var(--fs-lg); display: flex; align-items: center; gap: .6rem; }
    .card-title i { color: var(--blue-2); }
    .card-body { padding: clamp(1.15rem, 1rem + .8vw, 1.75rem); }
    .card-foot { padding: 1rem clamp(1.15rem, 1rem + .8vw, 1.75rem); border-top: 1px solid var(--border); }
    .card-hover { transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
    .card-hover:hover { border-color: var(--border-3); transform: translateY(-2px); box-shadow: var(--shadow); }

    .icon-tile {
        display: inline-grid;
        place-items: center;
        flex: none;
        width: 46px;
        height: 46px;
        font-size: 1.25rem;
        color: var(--blue-2);
        background: var(--blue-soft);
        border: 1px solid rgb(43 140 255 / .22);
        border-radius: var(--radius);
    }
    .icon-tile.is-orange { color: var(--orange-2); background: var(--orange-soft); border-color: rgb(255 122 26 / .22); }
    .icon-tile.is-green { color: var(--green-2); background: var(--green-soft); border-color: rgb(34 197 94 / .22); }
    .icon-tile.is-yellow { color: var(--yellow); background: var(--yellow-soft); border-color: rgb(245 184 61 / .22); }
    .icon-tile.is-red { color: var(--red-2); background: var(--red-soft); border-color: rgb(239 68 68 / .22); }
    .icon-tile.is-discord { color: #fff; background: var(--discord); border-color: transparent; }
    .icon-tile.is-lg { width: 56px; height: 56px; font-size: 1.5rem; border-radius: var(--radius-lg); }
    .icon-tile.is-sm { width: 36px; height: 36px; font-size: 1rem; border-radius: var(--radius-sm); }

    /* ---------- Product card ---------- */
    .pcard {
        position: relative;
        display: flex;
        flex-direction: column;
        min-width: 0;
        background: linear-gradient(180deg, var(--surface-2), var(--surface));
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        overflow: hidden;
        transition: border-color var(--dur) var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
        isolation: isolate;
    }
    .pcard:hover { border-color: rgb(43 140 255 / .4); transform: translateY(-3px); box-shadow: var(--shadow-lg), 0 0 0 1px rgb(43 140 255 / .12); }
    .pcard:focus-within { border-color: rgb(43 140 255 / .5); }

    .pcard-media {
        position: relative;
        aspect-ratio: 16 / 9;
        background: var(--surface-3);
        overflow: hidden;
    }
    .pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
    .pcard:hover .pcard-media img { transform: scale(1.04); }
    .pcard-media::after {
        content: '';
        position: absolute;
        inset: auto 0 0;
        height: 45%;
        background: linear-gradient(180deg, transparent, rgb(6 8 13 / .55));
        pointer-events: none;
    }

    .pcard-tags { position: absolute; top: .7rem; left: .7rem; z-index: 2; display: flex; gap: .4rem; flex-wrap: wrap; }
    .pcard-tag {
        display: inline-flex;
        align-items: center;
        gap: .3rem;
        padding: .25rem .55rem;
        font-size: .6875rem;
        font-weight: 750;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: #fff;
        background: rgb(6 8 13 / .72);
        border: 1px solid rgb(255 255 255 / .12);
        border-radius: var(--radius-xs);
        backdrop-filter: blur(8px);
    }
    .pcard-tag.is-free { background: rgb(22 163 74 / .9); border-color: transparent; }
    .pcard-tag.is-owned { background: rgb(43 140 255 / .9); border-color: transparent; }
    .pcard-tag.is-sale { background: rgb(239 68 68 / .92); border-color: transparent; }
    .pcard-tag.is-featured { background: linear-gradient(135deg, var(--orange), #f43f5e); border-color: transparent; }

    .pcard-fav {
        position: absolute;
        top: .6rem;
        right: .6rem;
        z-index: 3;
        display: grid;
        place-items: center;
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
        color: #fff;
        background: rgb(6 8 13 / .6);
        border: 1px solid rgb(255 255 255 / .12);
        border-radius: 50%;
        backdrop-filter: blur(8px);
        transition: all var(--dur) var(--ease);
    }
    .pcard-fav:hover { color: var(--pink); background: rgb(6 8 13 / .85); transform: scale(1.08); }
    .pcard-fav.saved { color: var(--pink); }
    .pcard-fav.saved i { animation: pop .3s var(--ease); }

    .pcard-body { display: flex; flex-direction: column; flex: 1; gap: .55rem; padding: 1.05rem 1.1rem 1.1rem; }
    .pcard-cat {
        font-size: var(--fs-xs);
        font-weight: 650;
        color: var(--blue-2);
        letter-spacing: .02em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pcard-title {
        font-family: var(--font-body);
        font-size: 1.02rem;
        font-weight: 700;
        line-height: 1.35;
        letter-spacing: -.005em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    /* The title link covers the whole card, so anywhere is clickable while the
       buttons above it (z-index 3) keep working. */
    .pcard-title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
    .pcard-title a:hover { color: var(--blue-3); }
    .pcard-desc {
        font-size: var(--fs-sm);
        color: var(--text-2);
        line-height: 1.55;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .pcard-meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: var(--fs-xs); color: var(--text-3); margin-top: auto; padding-top: .25rem; }
    .pcard-meta span { display: inline-flex; align-items: center; gap: .3rem; }
    .pcard-meta .is-rating { color: var(--yellow); }

    .pcard-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        padding-top: .85rem;
        margin-top: .3rem;
        border-top: 1px solid var(--border);
    }
    .pcard-price { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
    .pcard-price.is-free { color: var(--green-2); }
    .pcard-price-old { font-size: var(--fs-sm); color: var(--text-3); text-decoration: line-through; margin-left: .35rem; font-weight: 500; font-family: var(--font-body); }
    .pcard-actions { position: relative; z-index: 3; display: flex; gap: .4rem; }
    .pcard-btn {
        display: inline-flex;
        align-items: center;
        gap: .4rem;
        min-height: 38px;
        padding: .45rem .85rem;
        font-size: var(--fs-xs);
        font-weight: 700;
        color: #fff;
        background: linear-gradient(180deg, var(--orange-2), var(--orange));
        border-radius: var(--radius-sm);
        box-shadow: inset 0 1px 0 rgb(255 255 255 / .2);
        transition: filter var(--dur), transform var(--dur);
        white-space: nowrap;
    }
    .pcard-btn:hover { filter: brightness(1.1); }
    .pcard-btn:active { transform: translateY(1px); }
    .pcard-btn.is-free { background: linear-gradient(180deg, #2fd16b, #16a34a); }
    .pcard-btn.is-owned { background: var(--blue-soft); color: var(--blue-3); box-shadow: inset 0 0 0 1px rgb(43 140 255 / .35); }
    .pcard-btn.is-incart { background: var(--surface-3); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-2); }
    @container (max-width: 250px) { .pcard-btn span { display: none; } }

    /* Horizontal variant, for lists (wishlist, related, search) */
    .pcard.is-row { flex-direction: row; }
    .pcard.is-row .pcard-media { flex: 0 0 38%; aspect-ratio: auto; min-height: 140px; }

    /* ---------- Forms ---------- */
    .field { display: flex; flex-direction: column; gap: .45rem; }
    .field + .field { margin-top: 1.1rem; }
    .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
    .label .req { color: var(--orange-2); margin-left: .15rem; }
    .help { font-size: var(--fs-xs); color: var(--text-3); }
    .error-text { font-size: var(--fs-xs); color: var(--red-2); }

    .input, .select, .textarea {
        width: 100%;
        min-height: 46px;
        padding: .65rem .9rem;
        font-size: var(--fs-sm);
        color: var(--text);
        background: var(--bg-2);
        border: 1px solid var(--border-2);
        border-radius: var(--radius-sm);
        transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
        appearance: none;
    }
    .input::placeholder, .textarea::placeholder { color: var(--text-3); }
    .input:hover, .select:hover, .textarea:hover { border-color: var(--border-3); }
    .input:focus, .select:focus, .textarea:focus {
        outline: none;
        border-color: var(--blue);
        background: #0b1220;
        box-shadow: 0 0 0 3px rgb(43 140 255 / .2);
    }
    .input:disabled, .input[readonly] { opacity: .65; cursor: not-allowed; }
    .input.is-invalid { border-color: var(--red); }
    .textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
    .select {
        padding-right: 2.4rem;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a9b3c5' viewBox='0 0 16 16'%3E%3Cpath d='M1.6 5.1a.6.6 0 0 1 .8 0L8 10.7l5.6-5.6a.6.6 0 1 1 .8.8l-6 6a.6.6 0 0 1-.8 0l-6-6a.6.6 0 0 1 0-.8z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right .85rem center;
        background-size: 14px;
        cursor: pointer;
    }
    .select option { background: var(--surface-2); color: var(--text); }

    .input-group { position: relative; display: flex; align-items: center; }
    .input-group > i:first-child {
        position: absolute;
        left: .9rem;
        color: var(--text-3);
        pointer-events: none;
        font-size: 1rem;
    }
    .input-group > i:first-child + .input { padding-left: 2.6rem; }
    .input-group .input-action {
        position: absolute;
        right: .35rem;
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        color: var(--text-3);
        border-radius: var(--radius-xs);
    }
    .input-group .input-action:hover { color: var(--text); background: var(--surface-3); }
    .input-group:has(.input-action) .input { padding-right: 2.9rem; }

    .check {
        display: inline-flex;
        align-items: flex-start;
        gap: .6rem;
        font-size: var(--fs-sm);
        color: var(--text-2);
        cursor: pointer;
        line-height: 1.45;
    }
    .check input {
        appearance: none;
        flex: none;
        width: 18px;
        height: 18px;
        margin-top: 1px;
        background: var(--bg-2);
        border: 1px solid var(--border-3);
        border-radius: 5px;
        display: grid;
        place-items: center;
        cursor: pointer;
        transition: all var(--dur);
    }
    .check input[type="radio"] { border-radius: 50%; }
    .check input:checked { background: var(--blue); border-color: var(--blue); }
    .check input:checked::after {
        content: '';
        width: 10px;
        height: 10px;
        background: #fff;
        clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    }
    .check input[type="radio"]:checked::after { clip-path: circle(35%); }

    /* Toggle switch */
    .switch { position: relative; display: inline-flex; flex: none; width: 42px; height: 24px; }
    .switch input { opacity: 0; width: 0; height: 0; position: absolute; }
    .switch span {
        position: absolute;
        inset: 0;
        background: var(--surface-3);
        border: 1px solid var(--border-2);
        border-radius: 999px;
        transition: background var(--dur);
        cursor: pointer;
    }
    .switch span::before {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 18px;
        height: 18px;
        background: #fff;
        border-radius: 50%;
        transition: transform var(--dur) var(--ease);
    }
    .switch input:checked + span { background: var(--blue); border-color: var(--blue); }
    .switch input:checked + span::before { transform: translateX(18px); }
    .switch input:focus-visible + span { outline: 2px solid var(--blue-2); outline-offset: 2px; }

    /* ---------- Alerts ---------- */
    .alert {
        display: flex;
        align-items: flex-start;
        gap: .75rem;
        padding: .9rem 1rem;
        font-size: var(--fs-sm);
        line-height: 1.5;
        color: var(--text);
        background: var(--surface-2);
        border: 1px solid var(--border-2);
        border-left-width: 3px;
        border-radius: var(--radius-sm);
    }
    .alert > i { font-size: 1.1rem; line-height: 1.3; flex: none; }
    .alert-info { border-color: rgb(43 140 255 / .35); border-left-color: var(--blue); background: rgb(43 140 255 / .07); }
    .alert-info > i { color: var(--blue-2); }
    .alert-success { border-color: rgb(34 197 94 / .35); border-left-color: var(--green); background: rgb(34 197 94 / .07); }
    .alert-success > i { color: var(--green-2); }
    .alert-warning { border-color: rgb(245 184 61 / .35); border-left-color: var(--yellow); background: rgb(245 184 61 / .07); }
    .alert-warning > i { color: var(--yellow); }
    .alert-error { border-color: rgb(239 68 68 / .35); border-left-color: var(--red); background: rgb(239 68 68 / .07); }
    .alert-error > i { color: var(--red-2); }

    /* ---------- Toast (window.showNotification) ---------- */
    .toast-stack {
        position: fixed;
        z-index: 1000;
        right: 1rem;
        bottom: 1rem;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: .6rem;
        width: min(400px, calc(100vw - 2rem));
        pointer-events: none;
    }
    .toast {
        display: flex;
        align-items: flex-start;
        gap: .7rem;
        width: 100%;
        padding: .85rem .9rem .85rem 1rem;
        font-size: var(--fs-sm);
        line-height: 1.45;
        color: var(--text);
        background: rgb(19 26 39 / .96);
        border: 1px solid var(--border-2);
        border-radius: var(--radius);
        box-shadow: var(--shadow-lg);
        backdrop-filter: blur(12px);
        pointer-events: auto;
        animation: toast-in .28s var(--ease);
    }
    .toast > i:first-child { font-size: 1.15rem; line-height: 1.25; flex: none; color: var(--blue-2); }
    .toast.success > i:first-child { color: var(--green-2); }
    .toast.warning > i:first-child { color: var(--yellow); }
    .toast.error > i:first-child { color: var(--red-2); }
    .toast.success { border-color: rgb(34 197 94 / .35); }
    .toast.warning { border-color: rgb(245 184 61 / .35); }
    .toast.error { border-color: rgb(239 68 68 / .35); }
    .toast span { flex: 1; min-width: 0; }
    .toast button { flex: none; display: grid; place-items: center; width: 24px; height: 24px; color: var(--text-3); border-radius: 6px; }
    .toast button:hover { color: var(--text); background: var(--surface-3); }
    .toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
    @media (max-width: 640px) {
        .toast-stack { left: 1rem; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); width: auto; align-items: stretch; }
    }

    /* ---------- Modal ---------- */
    .modal {
        position: fixed;
        inset: 0;
        z-index: 900;
        display: grid;
        place-items: center;
        padding: 1rem;
        background: var(--overlay);
        backdrop-filter: blur(6px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s var(--ease), visibility .2s;
    }
    .modal.active, .modal.is-open { opacity: 1; visibility: visible; }
    .modal-box {
        position: relative;
        width: min(520px, 100%);
        max-height: calc(100dvh - 2rem);
        overflow: auto;
        background: linear-gradient(180deg, var(--surface-2), var(--surface));
        border: 1px solid var(--border-2);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg);
        transform: translateY(10px) scale(.98);
        transition: transform .25s var(--ease);
    }
    .modal.active .modal-box, .modal.is-open .modal-box { transform: none; }
    .modal-box.is-lg { width: min(760px, 100%); }
    .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.35rem; border-bottom: 1px solid var(--border); }
    .modal-title { font-size: var(--fs-lg); display: flex; align-items: center; gap: .6rem; }
    .modal-body { padding: 1.35rem; }
    .modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.35rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
    .modal-close { display: grid; place-items: center; width: 34px; height: 34px; color: var(--text-3); border-radius: var(--radius-sm); font-size: 1.1rem; }
    .modal-close:hover { color: var(--text); background: var(--surface-3); }

    /* ---------- Tabs ---------- */
    .tabs {
        display: flex;
        gap: .25rem;
        padding: .3rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        overflow-x: auto;
        scrollbar-width: none;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab {
        display: inline-flex;
        align-items: center;
        gap: .5rem;
        min-height: 40px;
        padding: .5rem 1rem;
        font-size: var(--fs-sm);
        font-weight: 600;
        color: var(--text-2);
        border-radius: var(--radius-sm);
        white-space: nowrap;
        transition: all var(--dur) var(--ease);
    }
    .tab:hover { color: var(--text); background: var(--surface-2); }
    .tab.active, .tab.is-active, .tab[aria-selected="true"] { color: #fff; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-2); }
    .tab .count { font-size: var(--fs-xs); padding: .05rem .45rem; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
    .tab.active .count, .tab.is-active .count { background: var(--blue); color: #fff; }

    /* ---------- Empty state ---------- */
    .empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: .75rem;
        padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) 1.5rem;
        background: var(--surface);
        border: 1px dashed var(--border-2);
        border-radius: var(--radius-lg);
    }
    .empty > i, .empty-icon {
        display: grid;
        place-items: center;
        width: 72px;
        height: 72px;
        margin-bottom: .35rem;
        font-size: 2rem;
        color: var(--blue-2);
        background: var(--blue-soft);
        border-radius: 50%;
    }
    .empty h2, .empty h3 { font-size: var(--fs-xl); }
    .empty p { color: var(--text-2); max-width: 46ch; }
    .empty .cluster { justify-content: center; margin-top: .75rem; }

    /* ---------- Table ---------- */
    .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
    .table { width: 100%; font-size: var(--fs-sm); }
    .table th { text-align: left; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: .8rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap; }
    .table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
    .table tr:last-child td { border-bottom: 0; }
    .table tbody tr:hover td { background: rgb(148 163 184 / .03); }

    /* ---------- Stats ---------- */
    .stat { display: flex; flex-direction: column; gap: .2rem; }
    .stat-value { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
    .stat-label { font-size: var(--fs-sm); color: var(--text-2); }

    /* ---------- Skeleton ---------- */
    .skeleton {
        background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
        background-size: 200% 100%;
        animation: shimmer 1.4s infinite linear;
        border-radius: var(--radius-sm);
    }

    .spinner { display: block; flex: none; width: 22px; height: 22px; border: 2px solid var(--border-3); border-top-color: var(--blue-2); border-radius: 50%; animation: spin .7s linear infinite; }

    /* ---------- Breadcrumbs ---------- */
    .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: var(--fs-sm); color: var(--text-3); }
    .crumbs a { color: var(--text-2); }
    .crumbs a:hover { color: var(--text); }
    .crumbs i { font-size: .65rem; opacity: .6; }
    .crumbs [aria-current] { color: var(--text); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* ---------- Pagination ---------- */
    .pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; margin-top: 2.5rem; }
    .pagination a, .pagination span {
        display: inline-grid;
        place-items: center;
        min-width: 42px;
        height: 42px;
        padding: 0 .75rem;
        font-size: var(--fs-sm);
        font-weight: 600;
        color: var(--text-2);
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        font-variant-numeric: tabular-nums;
    }
    .pagination a:hover { color: var(--text); border-color: var(--border-3); }
    .pagination .is-active, .pagination .active { color: #fff; background: var(--blue); border-color: var(--blue); }
    .pagination .is-disabled { opacity: .4; pointer-events: none; }

    /* ---------- Prose (descriptions, legal pages) ---------- */
    .prose { color: var(--text-2); line-height: 1.75; font-size: .98rem; }
    .prose > * + * { margin-top: 1em; }
    .prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); margin-top: 1.8em; margin-bottom: .2em; }
    .prose h1 { font-size: var(--fs-3xl); }
    .prose h2 { font-size: var(--fs-2xl); }
    .prose h3 { font-size: var(--fs-xl); }
    .prose h4 { font-size: var(--fs-lg); }
    .prose > :first-child { margin-top: 0; }
    .prose a { color: var(--blue-2); text-decoration: underline; text-underline-offset: 3px; }
    .prose strong, .prose b { color: var(--text); font-weight: 650; }
    .prose ul, .prose ol { padding-left: 1.4em; }
    .prose ul { list-style: disc; }
    .prose ol { list-style: decimal; }
    .prose li + li { margin-top: .35em; }
    .prose li::marker { color: var(--blue-2); }
    .prose code { padding: .12em .4em; background: var(--surface-3); border-radius: 5px; color: var(--blue-3); }
    .prose pre { padding: 1rem 1.1rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-x: auto; }
    .prose pre code { padding: 0; background: none; color: var(--text); }
    .prose blockquote { padding: .6rem 1rem; border-left: 3px solid var(--blue); background: var(--blue-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
    .prose img { border-radius: var(--radius); border: 1px solid var(--border); }
    .prose table { width: 100%; font-size: var(--fs-sm); display: block; overflow-x: auto; }
    .prose th, .prose td { padding: .55rem .75rem; border: 1px solid var(--border); text-align: left; }
    .prose th { background: var(--surface-2); color: var(--text); }
    .prose hr { margin-block: 2em; }

    /* ---------- Avatar ---------- */
    .avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-3); border: 1px solid var(--border-2); }
    .avatar.is-lg { width: 88px; height: 88px; border-width: 2px; }

    /* ---------- Rating stars ---------- */
    .stars { display: inline-flex; gap: .1rem; color: var(--yellow); font-size: .9rem; }
    .stars .is-off { color: var(--surface-3); }

    /* ---------- Flags (inline SVG from flag_svg()) ---------- */
    .language-flag { width: 20px; height: 14px; border-radius: 3px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgb(255 255 255 / .08); overflow: hidden; }
}

/* ============================================================ SITE CHROME */
@layer components {

    /* ---------- Announcement bar (promo code / test mode) ---------- */
    .announce {
        position: relative;
        z-index: 51;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .5rem 1rem;
        flex-wrap: wrap;
        min-height: 42px;
        padding: .45rem 3rem;
        font-size: var(--fs-sm);
        color: #fff;
        text-align: center;
        background:
            linear-gradient(90deg, rgb(43 140 255 / .9), rgb(106 125 255 / .9) 50%, rgb(255 122 26 / .9)),
            var(--blue);
    }
    .announce strong { font-weight: 800; }
    .announce-code {
        display: inline-flex;
        align-items: center;
        gap: .4rem;
        padding: .2rem .65rem;
        font-family: var(--font-mono);
        font-size: .8rem;
        font-weight: 700;
        letter-spacing: .06em;
        color: #fff;
        background: rgb(0 0 0 / .25);
        border: 1px dashed rgb(255 255 255 / .55);
        border-radius: 6px;
        cursor: pointer;
        transition: background var(--dur);
    }
    .announce-code:hover { background: rgb(0 0 0 / .4); }
    .announce-meta { display: inline-flex; align-items: center; gap: .3rem; opacity: .85; font-size: var(--fs-xs); }
    .announce-more { padding: .1rem .5rem; font-size: var(--fs-xs); font-weight: 700; background: rgb(255 255 255 / .2); border-radius: 99px; }
    .announce-more:hover { background: rgb(255 255 255 / .32); }
    .announce-close { position: absolute; right: .5rem; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; font-size: 1.1rem; }
    .announce-close:hover { background: rgb(0 0 0 / .2); }
    .announce.is-test { background: #b45309; }

    /* ---------- Header ---------- */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 50;
        background: rgb(6 8 13 / .78);
        border-bottom: 1px solid var(--border);
        backdrop-filter: saturate(160%) blur(16px);
        -webkit-backdrop-filter: saturate(160%) blur(16px);
        transition: background var(--dur), box-shadow var(--dur);
    }
    .site-header.scrolled { background: rgb(6 8 13 / .92); box-shadow: 0 10px 30px -18px rgb(0 0 0 / .9); }

    .nav-bar {
        display: flex;
        align-items: center;
        gap: clamp(.75rem, .4rem + 1vw, 1.75rem);
        height: var(--header-h);
    }
    .nav-logo { display: flex; align-items: center; flex: none; }
    .nav-logo img { height: 40px; width: auto; transition: filter var(--dur); }
    .nav-logo:hover img { filter: drop-shadow(0 0 14px rgb(43 140 255 / .45)); }

    .nav-primary { display: flex; align-items: center; gap: .15rem; }
    .nav-item {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: .45rem;
        height: 40px;
        padding: 0 .85rem;
        font-size: var(--fs-sm);
        font-weight: 600;
        color: var(--text-2);
        border-radius: var(--radius-sm);
        transition: color var(--dur), background var(--dur);
        white-space: nowrap;
    }
    .nav-item i { font-size: 1rem; opacity: .85; }
    .nav-item:hover { color: var(--text); background: rgb(148 163 184 / .07); }
    .nav-item.is-active { color: #fff; }
    .nav-item.is-active::after {
        content: '';
        position: absolute;
        left: .85rem;
        right: .85rem;
        bottom: -14px;
        height: 2px;
        border-radius: 2px;
        background: var(--brand-gradient);
    }

    .nav-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }

    .nav-search-trigger {
        display: flex;
        align-items: center;
        gap: .6rem;
        width: clamp(180px, 16vw, 260px);
        height: 40px;
        padding: 0 .5rem 0 .85rem;
        font-size: var(--fs-sm);
        color: var(--text-3);
        background: var(--surface);
        border: 1px solid var(--border-2);
        border-radius: var(--radius-sm);
        transition: border-color var(--dur), color var(--dur);
    }
    .nav-search-trigger:hover { border-color: var(--border-3); color: var(--text-2); }
    .nav-search-trigger span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nav-search-trigger kbd { font-size: .65rem; }

    .nav-icon-btn {
        position: relative;
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
        color: var(--text-2);
        border-radius: var(--radius-sm);
        transition: color var(--dur), background var(--dur);
    }
    .nav-icon-btn:hover, .nav-icon-btn.is-open { color: var(--text); background: rgb(148 163 184 / .08); }
    .nav-icon-btn.is-current { color: #fff; background: rgb(148 163 184 / .1); }
    .nav-count {
        position: absolute;
        top: 3px;
        right: 2px;
        display: grid;
        place-items: center;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: .625rem;
        font-weight: 800;
        color: #fff;
        background: var(--orange);
        border: 2px solid var(--bg);
        border-radius: 99px;
        font-variant-numeric: tabular-nums;
    }
    .nav-count.is-pink { background: var(--pink); }

    .nav-lang-btn { display: inline-flex; align-items: center; gap: .4rem; height: 40px; padding: 0 .6rem; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); border-radius: var(--radius-sm); }
    .nav-lang-btn:hover, .nav-lang-btn.is-open { color: var(--text); background: rgb(148 163 184 / .08); }
    .nav-lang-btn .bi-chevron-down { font-size: .65rem; transition: transform var(--dur); }
    .nav-lang-btn.is-open .bi-chevron-down { transform: rotate(180deg); }

    .nav-user-btn { display: inline-flex; align-items: center; gap: .55rem; height: 42px; padding: 0 .6rem 0 .3rem; border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface); transition: border-color var(--dur); }
    .nav-user-btn:hover, .nav-user-btn.is-open { border-color: var(--border-3); }
    .nav-user-btn .avatar { width: 32px; height: 32px; }
    .nav-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: 600; }
    .nav-user-btn .bi-chevron-down { font-size: .65rem; color: var(--text-3); }

    .nav-burger { display: none; }

    /* Popovers hanging off the header buttons */
    .nav-pop-wrap { position: relative; }
    .nav-pop {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        z-index: 60;
        width: 340px;
        max-width: calc(100vw - 1.5rem);
        background: rgb(16 22 33 / .98);
        border: 1px solid var(--border-2);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        backdrop-filter: blur(16px);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
        overflow: hidden;
    }
    .nav-pop.active { opacity: 1; visibility: visible; transform: none; }
    .nav-pop.is-sm { width: 220px; }
    .nav-pop-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
    .nav-pop-head h4 { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 700; }
    .nav-pop-head span { font-size: var(--fs-xs); color: var(--text-3); }
    .nav-pop-items { max-height: 320px; overflow-y: auto; padding: .4rem; }
    .nav-pop-item { display: flex; align-items: center; gap: .75rem; padding: .55rem; border-radius: var(--radius-sm); }
    .nav-pop-item:hover { background: var(--surface-2); }
    .nav-pop-item img { width: 56px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-3); }
    .nav-pop-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .nav-pop-item-title { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nav-pop-item-title:hover { color: var(--blue-3); }
    .nav-pop-item-price { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
    .nav-pop-remove { display: grid; place-items: center; width: 28px; height: 28px; flex: none; color: var(--text-3); border-radius: 6px; }
    .nav-pop-remove:hover { color: var(--red-2); background: var(--red-soft); }
    .nav-pop-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem 1rem; color: var(--text-3); font-size: var(--fs-sm); text-align: center; }
    .nav-pop-empty i { font-size: 1.8rem; opacity: .6; }
    .nav-pop-foot { padding: .9rem 1rem 1rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .6rem; }
    .nav-pop-row { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--text-2); }
    .nav-pop-row strong { color: var(--text); font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
    .nav-pop-row.is-promo { color: var(--green-2); font-size: var(--fs-xs); }
    .nav-pop-row.is-sub { font-size: var(--fs-xs); color: var(--text-3); }

    .nav-menu { padding: .4rem; }
    .nav-menu-head { padding: .75rem .75rem .65rem; margin-bottom: .3rem; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
    .nav-menu-head strong { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nav-menu-head span { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nav-menu-item {
        display: flex;
        align-items: center;
        gap: .7rem;
        width: 100%;
        padding: .6rem .75rem;
        font-size: var(--fs-sm);
        font-weight: 550;
        color: var(--text-2);
        border-radius: var(--radius-sm);
        text-align: left;
    }
    .nav-menu-item i { font-size: 1rem; width: 18px; text-align: center; }
    .nav-menu-item:hover, .nav-menu-item.is-active { color: var(--text); background: var(--surface-2); }
    .nav-menu-item .count { margin-left: auto; font-size: var(--fs-xs); color: var(--text-3); background: var(--surface-3); padding: 0 .45rem; border-radius: 99px; font-variant-numeric: tabular-nums; }
    .nav-menu-item.is-danger:hover { color: var(--red-2); background: var(--red-soft); }
    .nav-menu-sep { height: 1px; margin: .35rem .25rem; background: var(--border); }
    .nav-menu-item .language-flag { width: 20px; }
    .nav-menu-item.is-active::after { content: '\F26E'; font-family: bootstrap-icons; margin-left: auto; color: var(--blue-2); }

    /* ---------- Mobile drawer ---------- */
    .drawer {
        position: fixed;
        inset: 0;
        z-index: 200;
        visibility: hidden;
        transition: visibility .3s;
    }
    .drawer.active { visibility: visible; }
    .drawer-backdrop { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity .3s var(--ease); }
    .drawer.active .drawer-backdrop { opacity: 1; }
    .drawer-panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        width: min(380px, 88vw);
        background: var(--bg-2);
        border-left: 1px solid var(--border-2);
        box-shadow: var(--shadow-lg);
        transform: translateX(100%);
        transition: transform .3s var(--ease);
    }
    .drawer.active .drawer-panel { transform: none; }
    .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 1rem 0 1.25rem; height: var(--header-h); border-bottom: 1px solid var(--border); flex: none; }
    .drawer-head img { height: 34px; width: auto; }
    .drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1rem 1rem 2rem; }
    .drawer-label { display: block; margin: 1.25rem .5rem .5rem; font-size: .6875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
    .drawer-link {
        display: flex;
        align-items: center;
        gap: .85rem;
        width: 100%;
        min-height: 48px;
        padding: .6rem .75rem;
        font-size: var(--fs-base);
        font-weight: 600;
        color: var(--text-2);
        border-radius: var(--radius-sm);
        text-align: left;
    }
    .drawer-link i { font-size: 1.15rem; width: 22px; text-align: center; }
    .drawer-link:hover, .drawer-link.is-active { color: var(--text); background: var(--surface-2); }
    .drawer-link.is-active i { color: var(--blue-2); }
    .drawer-link .count { margin-left: auto; font-size: var(--fs-xs); color: var(--text-2); background: var(--surface-3); padding: .05rem .55rem; border-radius: 99px; }
    .drawer-link .badge-new { margin-left: auto; }
    .drawer-user { display: flex; align-items: center; gap: .85rem; padding: .85rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
    .drawer-user .avatar { width: 44px; height: 44px; }
    .drawer-user div { min-width: 0; }
    .drawer-user strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .drawer-user span { display: block; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .drawer-langs { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
    .drawer-lang { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .6rem .2rem; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
    .drawer-lang:hover { border-color: var(--border-3); color: var(--text); }
    .drawer-lang.is-active { border-color: var(--blue-ring); background: var(--blue-soft); color: #fff; }

    /* ---------- Search palette (Ctrl+K) ---------- */
    .palette {
        position: fixed;
        inset: 0;
        z-index: 300;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: min(12vh, 110px) 1rem 1rem;
        background: var(--overlay);
        backdrop-filter: blur(6px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .18s var(--ease), visibility .18s;
    }
    .palette.active { opacity: 1; visibility: visible; }
    .palette-box {
        width: min(640px, 100%);
        max-height: min(70vh, 620px);
        display: flex;
        flex-direction: column;
        background: rgb(16 22 33 / .98);
        border: 1px solid var(--border-2);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg), 0 0 0 1px rgb(43 140 255 / .08);
        overflow: hidden;
        transform: translateY(-8px) scale(.98);
        transition: transform .2s var(--ease);
    }
    .palette.active .palette-box { transform: none; }
    .palette-input { display: flex; align-items: center; gap: .75rem; padding: 0 1rem 0 1.15rem; border-bottom: 1px solid var(--border); }
    .palette-input i { color: var(--text-3); font-size: 1.1rem; }
    .palette-input input { flex: 1; height: 60px; font-size: var(--fs-lg); background: none; border: 0; outline: none; color: var(--text); min-width: 0; }
    .palette-input input::placeholder { color: var(--text-3); }
    .palette-input input::-webkit-search-cancel-button { display: none; }
    .palette-body { overflow-y: auto; padding: .5rem; }
    .palette-section { padding: .6rem .7rem .35rem; font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
    .palette-item { display: flex; align-items: center; gap: .85rem; padding: .6rem .7rem; border-radius: var(--radius); scroll-margin: .5rem; }
    .palette-item:hover, .palette-item.is-selected { background: var(--surface-2); }
    .palette-item.is-selected { box-shadow: inset 0 0 0 1px rgb(43 140 255 / .35); }
    .palette-item img { width: 64px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-3); }
    .palette-item .icon-tile { width: 40px; height: 40px; font-size: 1rem; }
    .palette-item-info { flex: 1; min-width: 0; }
    .palette-item-title { display: block; font-size: var(--fs-sm); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .palette-item-desc { display: block; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .palette-item-price { font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
    .palette-item-price.free { color: var(--green-2); }
    .palette-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2.5rem 1rem; color: var(--text-3); text-align: center; }
    .palette-empty i { font-size: 1.8rem; }
    .palette-foot { display: flex; gap: 1rem; padding: .65rem 1rem; font-size: var(--fs-xs); color: var(--text-3); border-top: 1px solid var(--border); background: var(--surface); }
    .palette-foot span { display: inline-flex; align-items: center; gap: .35rem; }
    .palette-all { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: .35rem; padding: .7rem; font-size: var(--fs-sm); font-weight: 650; color: var(--blue-2); border-radius: var(--radius); }
    .palette-all:hover, .palette-all.is-selected { background: var(--blue-soft); }

    /* ---------- Footer ---------- */
    .site-footer {
        position: relative;
        margin-top: clamp(3rem, 2rem + 4vw, 6rem);
        padding-top: clamp(3rem, 2.4rem + 2.6vw, 4.5rem);
        background: linear-gradient(180deg, var(--bg-2), #05070b);
        border-top: 1px solid var(--border);
    }
    .site-footer::before {
        content: '';
        position: absolute;
        top: -1px;
        left: 10%;
        right: 10%;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--blue), var(--orange), transparent);
        opacity: .6;
    }
    .footer-grid {
        display: grid;
        gap: 2.5rem 2rem;
        grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    }
    .footer-brand img { height: 46px; width: auto; margin-bottom: 1rem; }
    .footer-brand p { font-size: var(--fs-sm); color: var(--text-2); max-width: 38ch; }
    .footer-social { display: flex; gap: .5rem; margin-top: 1.25rem; }
    .footer-social a { display: grid; place-items: center; width: 40px; height: 40px; font-size: 1.1rem; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all var(--dur); }
    .footer-social a:hover { color: #fff; border-color: var(--border-3); background: var(--surface-3); transform: translateY(-2px); }
    .footer-col h4 { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1rem; }
    .footer-col ul { display: flex; flex-direction: column; gap: .55rem; }
    .footer-col a { font-size: var(--fs-sm); color: var(--text-2); transition: color var(--dur); }
    .footer-col a:hover { color: var(--text); }
    .footer-pay { display: flex; flex-wrap: wrap; gap: .45rem; }
    .footer-pay span { display: grid; place-items: center; width: 52px; height: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
    .footer-pay img { width: 26px; height: 18px; object-fit: contain; opacity: .85; }
    .footer-secure { display: inline-flex; align-items: center; gap: .45rem; margin-top: .9rem; font-size: var(--fs-xs); color: var(--green-2); }
    .footer-bottom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 1rem;
        margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
        padding-block: 1.4rem calc(1.4rem + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        font-size: var(--fs-xs);
        color: var(--text-3);
    }
    .footer-lang { display: flex; gap: .3rem; flex-wrap: wrap; }
    .footer-lang a { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .55rem; border-radius: 6px; color: var(--text-3); font-weight: 600; }
    .footer-lang a:hover { color: var(--text); background: var(--surface); }
    .footer-lang a.is-active { color: var(--text); background: var(--surface-2); }
    .footer-lang .language-flag { width: 18px; height: 12px; }
    @media (max-width: 960px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
    @media (max-width: 480px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

    .to-top {
        position: fixed;
        right: 1rem;
        bottom: 1rem;
        z-index: 40;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        color: var(--text);
        background: rgb(26 35 51 / .9);
        border: 1px solid var(--border-2);
        border-radius: 50%;
        box-shadow: var(--shadow);
        backdrop-filter: blur(10px);
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: all .25s var(--ease);
    }
    .to-top.visible { opacity: 1; visibility: visible; transform: none; }
    .to-top:hover { border-color: var(--blue-ring); color: var(--blue-3); }

    /* ---------- Header responsive ---------- */
    @media (max-width: 1180px) {
        .nav-item span:not(.badge-new) { display: none; }
        .nav-item { padding: 0 .7rem; }
        .nav-item.is-active::after { left: .5rem; right: .5rem; }
        .nav-item .badge-new { position: absolute; top: 2px; right: -4px; }
    }
    @media (max-width: 1024px) {
        .nav-primary, .nav-search-trigger span, .nav-search-trigger kbd, .nav-user-name, .nav-lang-btn, .nav-hide-md { display: none; }
        .nav-search-trigger { width: 40px; padding: 0; justify-content: center; border-color: transparent; background: none; font-size: 1.1rem; color: var(--text-2); }
        .nav-burger { display: grid; }
        .nav-user-btn { padding: 0 .3rem; border: 0; background: none; }
        .nav-user-btn .bi-chevron-down { display: none; }
    }
    @media (max-width: 640px) {
        :root { --header-h: 60px; }
        .nav-logo img { height: 32px; }
        .nav-actions { gap: .1rem; }
        .nav-hide-sm { display: none; }
    }
}

/* ============================================================== UTILITIES */
@layer utilities {
    .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; }
    .hidden { display: none !important; }
    .muted { color: var(--text-2); }
    .faint { color: var(--text-3); }
    .small { font-size: var(--fs-sm); }
    .tiny { font-size: var(--fs-xs); }
    .strong { font-weight: 700; color: var(--text); }
    .center { text-align: center; }
    .nowrap { white-space: nowrap; }
    .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tabular { font-variant-numeric: tabular-nums; }
    .normal-case { text-transform: none !important; letter-spacing: 0 !important; }
    .w-full { width: 100%; }
    .mt-0 { margin-top: 0 !important; }
    .mt-1 { margin-top: .5rem; }
    .mt-2 { margin-top: 1rem; }
    .mt-3 { margin-top: 1.5rem; }
    .mt-4 { margin-top: 2rem; }
    .mt-6 { margin-top: 3rem; }
    .mb-1 { margin-bottom: .5rem; }
    .mb-2 { margin-bottom: 1rem; }
    .mb-3 { margin-bottom: 1.5rem; }
    .mb-4 { margin-bottom: 2rem; }
    .ml-auto { margin-left: auto; }
    .mx-auto { margin-inline: auto; }
    .gap-sm { --gap: .5rem; }
    .gap-lg { --gap: 1.25rem; }
    .flex { display: flex; }
    .flex-col { display: flex; flex-direction: column; }
    .items-center { align-items: center; }
    .justify-between { justify-content: space-between; }
    .justify-center { justify-content: center; }
    .grow { flex: 1; min-width: 0; }
    .gap-1 { gap: .5rem; }
    .gap-2 { gap: 1rem; }
    .text-green { color: var(--green-2); }
    .text-red { color: var(--red-2); }
    .text-yellow { color: var(--yellow); }
    @media (max-width: 640px) { .hide-sm { display: none !important; } }
    @media (min-width: 641px) { .show-sm { display: none !important; } }
}

/* ------------------------------------------------------------ keyframes */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes float-y { 50% { transform: translateY(-8px); } }

.reveal { animation: fade-up .6s var(--ease) both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
@supports not (animation-timeline: view()) { .reveal { animation: none; } }

/* ================================================================= PAGES */
@layer pages {

    .pcard { container-type: inline-size; }

    /* ---------------------------------------------------------- Home: hero */
    .hero { position: relative; padding-top: clamp(2.5rem, 1.5rem + 4vw, 5rem); overflow: hidden; }
    .hero-grid-bg {
        position: absolute;
        inset: 0 0 auto;
        height: 720px;
        background-image:
            linear-gradient(rgb(148 163 184 / .06) 1px, transparent 1px),
            linear-gradient(90deg, rgb(148 163 184 / .06) 1px, transparent 1px);
        background-size: 56px 56px;
        mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
        pointer-events: none;
    }
    .hero-inner {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        align-items: center;
        gap: clamp(2rem, 1rem + 4vw, 4.5rem);
    }
    .hero-pill {
        display: inline-flex;
        align-items: center;
        gap: .5rem;
        padding: .4rem .9rem .4rem .7rem;
        font-size: var(--fs-xs);
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--orange-2);
        background: var(--orange-soft);
        border: 1px solid rgb(255 122 26 / .28);
        border-radius: 99px;
    }
    .hero-title {
        margin-top: 1.25rem;
        font-size: var(--fs-5xl);
        font-weight: 800;
        line-height: 1.06;
        letter-spacing: -.02em;
    }
    .hero-title > span { display: block; }
    .hero-word {
        min-height: 1.1em;
        background: var(--brand-gradient);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        padding-bottom: .05em;
    }
    .hero-caret {
        display: inline-block;
        width: 3px;
        height: .9em;
        margin-left: 4px;
        vertical-align: -.08em;
        background: var(--orange);
        border-radius: 2px;
        animation: blink 1s steps(1) infinite;
    }
    .hero-sub { margin-top: 1.25rem; font-size: var(--fs-lg); color: var(--text-2); max-width: 54ch; }
    .hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
    .hero-trust { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1.75rem; font-size: var(--fs-sm); color: var(--text-2); }
    .hero-trust li { display: inline-flex; align-items: center; gap: .45rem; }
    .hero-trust i { color: var(--green-2); }

    .hero-visual { position: relative; }
    .hero-frame {
        position: relative;
        padding: 6px;
        border-radius: var(--radius-xl);
        background: linear-gradient(140deg, rgb(43 140 255 / .7), rgb(106 125 255 / .25) 40%, rgb(255 122 26 / .7));
        box-shadow: 0 40px 100px -30px rgb(43 140 255 / .45), 0 30px 80px -40px rgb(255 122 26 / .4);
        transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
        transition: transform .6s var(--ease);
    }
    .hero-visual:hover .hero-frame { transform: perspective(1400px) rotateY(-2deg) rotateX(0); }
    .hero-frame img { width: 100%; aspect-ratio: 1.12 / 1; object-fit: cover; object-position: 96% 50%; border-radius: calc(var(--radius-xl) - 5px); background: var(--surface); }
    .hero-float {
        position: absolute;
        display: flex;
        align-items: center;
        gap: .7rem;
        padding: .65rem .9rem .65rem .65rem;
        background: rgb(14 19 29 / .9);
        border: 1px solid var(--border-2);
        border-radius: var(--radius);
        box-shadow: var(--shadow-lg);
        backdrop-filter: blur(12px);
        animation: float-y 6s ease-in-out infinite;
    }
    .hero-float strong { display: block; font-family: var(--font-display); font-size: 1.1rem; line-height: 1.1; }
    .hero-float span:not(.icon-tile) { display: block; font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; }
    .hero-float.is-a { left: -1.5rem; bottom: 12%; }
    .hero-float.is-b { right: -1rem; top: -1.25rem; animation-delay: -2s; }
    .hero-float.is-c { right: 8%; bottom: -1.5rem; animation-delay: -4s; }

    .hero-stats {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        margin-top: clamp(3rem, 2rem + 4vw, 5rem);
        background: linear-gradient(180deg, var(--surface-2), var(--surface));
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
    }
    .hero-stats > div { display: flex; flex-direction: column; padding: 1.4rem 1.5rem; }
    .hero-stats > div + div { border-left: 1px solid var(--border); }
    .hero-stats dt { order: 2; font-size: var(--fs-sm); font-weight: 650; color: var(--text); }
    .hero-stats dd { order: 1; font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
    .hero-stats span { order: 3; font-size: var(--fs-xs); color: var(--text-3); margin-top: .15rem; }

    @media (max-width: 960px) {
        .hero-inner { grid-template-columns: minmax(0, 1fr); }
        .hero-copy { text-align: center; }
        .hero-sub { margin-inline: auto; }
        .hero-actions, .hero-trust { justify-content: center; }
        .hero-visual { max-width: 620px; margin-inline: auto; width: 100%; }
        .hero-frame { transform: none; }
        .hero-float.is-a { left: -.5rem; }
        .hero-float.is-b { right: -.5rem; }
        .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .hero-stats > div:nth-child(3) { border-left: 0; }
        .hero-stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
    }
    @media (max-width: 560px) {
        .hero-actions .btn { width: 100%; }
        .hero-float { display: none; }
        .hero-stats > div { padding: 1.1rem 1rem; }
    }

    /* ------------------------------------------------------ Home: categories */
    .cat-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
    .cat-tile {
        position: relative;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: .9rem;
        align-items: center;
        padding: 1rem 2.6rem 1rem 1rem;
        background: linear-gradient(180deg, var(--surface-2), var(--surface));
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        transition: border-color var(--dur), transform var(--dur) var(--ease), background var(--dur);
    }
    .cat-tile:hover { border-color: rgb(43 140 255 / .45); transform: translateY(-2px); }
    .cat-icon {
        grid-row: span 2;
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        color: var(--blue-2);
        background: var(--blue-soft);
        border-radius: var(--radius);
        transition: all var(--dur);
    }
    .cat-tile:nth-child(3n+2) .cat-icon { color: var(--orange-2); background: var(--orange-soft); }
    .cat-tile:nth-child(3n+3) .cat-icon { color: var(--green-2); background: var(--green-soft); }
    .cat-name { font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; }
    .cat-count { font-size: var(--fs-xs); color: var(--text-3); }
    .cat-arrow { position: absolute; top: 1rem; right: 1rem; color: var(--text-3); transition: all var(--dur); }
    .cat-tile:hover .cat-arrow { color: var(--blue-2); transform: translate(2px, -2px); }

    /* ---------------------------------------------------- Home: custom orders */
    .custom-wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: start; }
    .custom-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 1.75rem; }
    .custom-stats > div { padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
    .custom-stats strong { display: block; font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
    .custom-stats span { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.35; display: block; }
    .custom-steps-title { font-size: var(--fs-2xl); margin-bottom: 1.25rem; }

    .steps { display: flex; flex-direction: column; counter-reset: step; }
    .step { position: relative; display: flex; gap: 1.1rem; padding-bottom: 1.6rem; }
    .step:last-child { padding-bottom: 0; }
    .step:not(:last-child)::before {
        content: '';
        position: absolute;
        left: 21px;
        top: 46px;
        bottom: 4px;
        width: 2px;
        background: linear-gradient(var(--border-3), transparent);
    }
    .step-num {
        flex: none;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        font-family: var(--font-display);
        font-size: 1.1rem;
        font-weight: 800;
        color: #fff;
        background: linear-gradient(135deg, var(--blue), #6a7dff);
        border-radius: 50%;
        box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px rgb(43 140 255 / .35);
    }
    .step:last-child .step-num { background: linear-gradient(135deg, var(--orange-2), var(--orange)); box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px rgb(255 122 26 / .35); }
    .step h4 { font-family: var(--font-body); font-size: var(--fs-base); font-weight: 700; margin-top: .55rem; }
    .step p { font-size: var(--fs-sm); color: var(--text-2); margin-top: .3rem; }

    .know-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem); background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
    .know-item { display: flex; gap: .9rem; padding: 1.25rem; background: var(--surface); }
    .know-item h4 { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 700; }
    .know-item p { font-size: var(--fs-xs); color: var(--text-2); margin-top: .2rem; line-height: 1.5; }

    @media (max-width: 960px) {
        .custom-wrap { grid-template-columns: minmax(0, 1fr); }
        .know-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 560px) {
        .know-grid { grid-template-columns: minmax(0, 1fr); }
        .custom-stats strong { font-size: var(--fs-xl); }
    }

    /* ------------------------------------------------------- Home: features */
    .feature-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
    .feature { padding: 1.5rem; }
    .feature h3 { font-family: var(--font-body); font-size: var(--fs-lg); font-weight: 700; margin-top: 1.1rem; }
    .feature p { font-size: var(--fs-sm); color: var(--text-2); margin-top: .4rem; }

    /* -------------------------------------------------------- Home: Discord */
    .discord-band {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        gap: 2rem;
        align-items: center;
        padding: clamp(1.75rem, 1.2rem + 2.5vw, 3rem);
        color: #fff;
        background:
            radial-gradient(600px 300px at 100% 0%, rgb(255 255 255 / .14), transparent 60%),
            linear-gradient(135deg, #5865f2, #3b47c9 60%, #2b3399);
        border-radius: var(--radius-xl);
        overflow: hidden;
        box-shadow: 0 30px 80px -30px rgb(88 101 242 / .6);
    }
    .discord-band::after {
        content: '\F300';
        font-family: bootstrap-icons;
        position: absolute;
        right: -2rem;
        bottom: -4rem;
        font-size: 16rem;
        line-height: 1;
        color: rgb(255 255 255 / .06);
        pointer-events: none;
    }
    .discord-copy { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.1rem; align-items: center; }
    .discord-logo { display: grid; place-items: center; width: 60px; height: 60px; font-size: 1.9rem; background: rgb(255 255 255 / .15); border-radius: var(--radius-lg); }
    .discord-copy h2 { color: #fff; font-size: var(--fs-3xl); }
    .discord-copy p { color: rgb(255 255 255 / .75); }
    .discord-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.25rem; font-size: var(--fs-sm); color: rgb(255 255 255 / .9); }
    .discord-list li { display: flex; gap: .5rem; }
    .discord-list i { color: #a5f3c4; }
    .discord-copy .btn { grid-column: 1 / -1; justify-self: start; }
    .discord-stats { position: relative; z-index: 1; display: grid; gap: .75rem; }
    .discord-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: rgb(0 0 0 / .18); border: 1px solid rgb(255 255 255 / .12); border-radius: var(--radius); }
    .discord-stats strong { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; }
    .discord-stats span { font-size: var(--fs-sm); color: rgb(255 255 255 / .75); }
    .discord-dot { width: 10px; height: 10px; border-radius: 50%; background: #3ba55d; box-shadow: 0 0 0 4px rgb(59 165 93 / .25); }
    @media (max-width: 860px) {
        .discord-band { grid-template-columns: minmax(0, 1fr); }
        .discord-list { grid-template-columns: minmax(0, 1fr); }
    }

    /* Snow, when $enableSnowEffect is on */
    .snowfall { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
    .snowfall i {
        position: absolute;
        top: -10px;
        left: calc(var(--i) * 2.5%);
        width: 6px;
        height: 6px;
        background: #fff;
        border-radius: 50%;
        opacity: .7;
        animation: snow calc(8s + var(--i) * .17s) linear infinite;
        animation-delay: calc(var(--i) * -.6s);
    }
}

@keyframes snow { to { transform: translate(30px, 105vh); } }
@keyframes gallery-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@layer pages {
    /* A missing screenshot shows the card background, not the browser's alt text */
    .pcard-media img { color: transparent; font-size: 0; }
    .pcard-media::before {
        content: '\F42A';
        font-family: bootstrap-icons;
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        font-size: 2.2rem;
        color: var(--surface-hover);
    }
    .pcard-media img { position: relative; }

    /* Six featured cards read better as two rows of three */
    @media (min-width: 1100px) { .grid-cards.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

    @media (max-width: 560px) {
        .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
        .cat-tile { grid-template-columns: 1fr; grid-template-rows: auto; row-gap: .15rem; padding: .9rem; }
        .cat-icon { grid-row: auto; width: 40px; height: 40px; font-size: 1.1rem; margin-bottom: .5rem; }
        .cat-name { font-size: .8125rem; }
        .cat-arrow { display: none; }
    }
}

@layer components {
    /* Segmented control - a row of mutually exclusive links */
    .segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .25rem; padding: .25rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
    .segmented a, .segmented button {
        display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
        min-height: 36px; padding: .35rem .5rem; font-size: var(--fs-xs); font-weight: 650;
        color: var(--text-2); border-radius: 6px; white-space: nowrap; transition: all var(--dur);
    }
    .segmented a:hover, .segmented button:hover { color: var(--text); background: var(--surface-2); }
    .segmented .is-active { color: #fff; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-2); }
}

@layer pages {
    /* ------------------------------------------------------------ Resources */
    .res-head { position: relative; }
    .res-filters {
        position: sticky;
        top: calc(var(--header-h) + 1.25rem);
        display: flex;
        flex-direction: column;
        gap: 1.4rem;
        padding: 1.15rem;
        background: linear-gradient(180deg, var(--surface-2), var(--surface));
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        max-height: calc(100vh - var(--header-h) - 2.5rem);
        overflow-y: auto;
    }
    .res-filter-title { font-family: var(--font-body); font-size: .6875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: .6rem; }
    .res-cats { position: relative; display: flex; flex-direction: column; gap: .15rem; }
    .res-cats a {
        display: flex; align-items: center; justify-content: space-between; gap: .75rem;
        padding: .5rem .65rem; font-size: var(--fs-sm); color: var(--text-2);
        border-radius: var(--radius-sm); line-height: 1.35; transition: all var(--dur);
    }
    .res-cats a:hover { color: var(--text); background: var(--surface-3); }
    .res-cats a.is-active { color: #fff; background: var(--blue-soft); box-shadow: inset 2px 0 0 var(--blue); }
    .res-cats .chip-count { flex: none; font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
    .res-cats a.is-active .chip-count { color: var(--blue-3); }

    .res-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
    .res-count { font-family: var(--font-body); font-size: var(--fs-lg); font-weight: 700; }
    .res-sort { width: auto; min-height: 40px; padding-block: .45rem; }
    .res-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

    @media (max-width: 960px) {
        .res-filters { position: static; max-height: none; overflow: visible; padding: 0; background: none; border: 0; gap: .9rem; }
        .res-filter-title { display: none; }
        .res-cats { flex-direction: row; overflow-x: auto; gap: .4rem; scrollbar-width: none; scroll-snap-type: x proximity; padding-bottom: 2px; }
        .res-cats::-webkit-scrollbar { display: none; }
        .res-cats li { flex: none; scroll-snap-align: start; }
        .res-cats a { padding: .45rem .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; white-space: nowrap; }
        .res-cats a.is-active { box-shadow: none; border-color: var(--blue-ring); }
    }
    @media (max-width: 560px) {
        .res-toolbar .cluster { width: 100%; }
        .res-sort { flex: 1; }
    }
}

@layer pages {
    /* --------------------------------------------------------------- Product */
    .product-crumbs { padding-block: 1.5rem 1.25rem; }
    .product-top {
        display: grid;
        grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
        grid-template-areas: "gallery panel" "main panel";
        gap: clamp(1.5rem, 1rem + 1.6vw, 2.5rem) clamp(1.25rem, 1rem + 1.6vw, 2.5rem);
        align-items: start;
    }
    .gallery { grid-area: gallery; }
    .buy-panel { grid-area: panel; }
    .product-main { grid-area: main; min-width: 0; }
    .product-main .support-card { margin-top: 1.5rem; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .product-main .support-card > div { flex: 1; min-width: 220px; }
    .product-main .support-card .btn { width: auto; }

    .gallery { min-width: 0; }
    .gallery-stage { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
    .gallery-main { display: block; width: 100%; cursor: zoom-in; }
    .gallery-main img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #05070b; transition: opacity .2s var(--ease); }
    .gallery-main img.is-swapping { opacity: .35; }
    .gallery-arrow {
        position: absolute; top: 50%; translate: 0 -50%;
        display: grid; place-items: center; width: 44px; height: 44px;
        font-size: 1.1rem; color: #fff; background: rgb(6 8 13 / .65);
        border: 1px solid rgb(255 255 255 / .14); border-radius: 50%;
        backdrop-filter: blur(8px); opacity: 0; transition: opacity var(--dur), background var(--dur);
    }
    .gallery-arrow.is-prev { left: .75rem; }
    .gallery-arrow.is-next { right: .75rem; }
    .gallery-stage:hover .gallery-arrow, .gallery-arrow:focus-visible { opacity: 1; }
    .gallery-arrow:hover { background: rgb(43 140 255 / .85); }
    .gallery-count, .gallery-zoom {
        position: absolute; bottom: .75rem; padding: .25rem .6rem; font-size: var(--fs-xs); font-weight: 600;
        color: #fff; background: rgb(6 8 13 / .7); border-radius: 99px; pointer-events: none; backdrop-filter: blur(8px);
    }
    .gallery-count { left: .75rem; font-variant-numeric: tabular-nums; }
    .gallery-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgb(255 255 255 / .08); pointer-events: none; }
    .gallery-progress i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--blue), var(--orange)); }
    .gallery-zoom { right: .75rem; opacity: 0; transition: opacity var(--dur); }
    .gallery-stage:hover .gallery-zoom { opacity: 1; }
    .gallery-thumbs { display: flex; gap: .5rem; margin-top: .75rem; overflow-x: auto; scrollbar-width: none; padding: 2px; }
    .gallery-thumbs::-webkit-scrollbar { display: none; }
    .gallery-thumb { flex: 0 0 104px; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; opacity: .55; transition: all var(--dur); }
    .gallery-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
    .gallery-thumb:hover { opacity: .85; }
    .gallery-thumb.is-active { opacity: 1; border-color: var(--blue); }
    @media (hover: none) { .gallery-arrow { opacity: 1; width: 38px; height: 38px; } }

    .buy-panel {
        position: sticky;
        top: calc(var(--header-h) + 1.25rem);
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: clamp(1.15rem, 1rem + .8vw, 1.6rem);
        background: linear-gradient(180deg, var(--surface-2), var(--surface));
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow);
    }
    .buy-panel > .badge { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .buy-title { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); line-height: 1.2; margin-top: -.25rem; }
    .buy-desc { color: var(--text-2); font-size: var(--fs-sm); }
    .buy-rating { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--fs-sm); color: var(--text-2); width: fit-content; }
    .buy-rating strong { color: var(--text); }
    .buy-rating:hover span:last-child { text-decoration: underline; }
    .buy-price { display: flex; align-items: baseline; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--border); }
    .buy-price strong { font-family: var(--font-display); font-size: 2.25rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
    .buy-price strong.is-free { color: var(--green-2); }
    .buy-price span { font-size: var(--fs-xs); color: var(--text-3); }
    .buy-actions { display: flex; flex-direction: column; gap: .6rem; }
    .buy-secondary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; }
    .wl-btn.saved { color: var(--pink); border-color: rgb(244 63 94 / .4); background: rgb(244 63 94 / .08); }
    .wl-btn.saved i { animation: pop .3s var(--ease); }
    .buy-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .1rem 1rem; padding: .9rem 0; border-block: 1px solid var(--border); }
    .buy-facts > div { display: flex; flex-direction: column; padding: .35rem 0; }
    .buy-facts dt { display: flex; align-items: center; gap: .4rem; font-size: var(--fs-xs); color: var(--text-3); }
    .buy-facts dd { font-size: var(--fs-sm); font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
    .buy-trust { display: flex; flex-direction: column; gap: .4rem; font-size: var(--fs-xs); color: var(--text-2); }
    .buy-trust span { display: flex; align-items: center; gap: .5rem; }
    .buy-trust i { color: var(--green-2); }
    .buy-share { display: flex; align-items: center; gap: .35rem; font-size: var(--fs-xs); color: var(--text-3); }
    .buy-share span { margin-right: auto; font-weight: 600; }
    .buy-share a, .buy-share button { display: grid; place-items: center; width: 34px; height: 34px; color: var(--text-2); background: var(--surface-3); border-radius: var(--radius-sm); transition: all var(--dur); }
    .buy-share a:hover, .buy-share button:hover { color: #fff; background: var(--blue); }

    .product-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(1.25rem, 1rem + 1.6vw, 2.5rem); margin-top: clamp(2rem, 1.5rem + 2vw, 3rem); align-items: start; }
    .product-side { position: sticky; top: calc(var(--header-h) + 1.25rem); }
    .desc-wrap { position: relative; }
    .desc-wrap.is-collapsed { max-height: 520px; overflow: hidden; }
    .desc-wrap.is-collapsed::after { content: ''; position: absolute; inset: auto 0 0; height: 120px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
    .desc-toggle { margin: .75rem auto 0; display: flex; }
    .video-wrap { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
    .video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
    .product-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--text-3); }
    .product-tags .chip { min-height: 30px; padding: .2rem .7rem; font-size: var(--fs-xs); }

    .support-card { display: flex; flex-direction: column; gap: .75rem; padding: 1.4rem; background: linear-gradient(160deg, rgb(88 101 242 / .16), var(--surface) 60%); border: 1px solid rgb(88 101 242 / .3); border-radius: var(--radius-lg); }
    .support-card h3 { font-family: var(--font-body); font-size: var(--fs-lg); }
    .support-card p { font-size: var(--fs-sm); color: var(--text-2); }

    .reviews { margin-top: 2.5rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
    .reviews-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
    .reviews-head h2 { font-size: var(--fs-2xl); }
    .reviews-score { display: flex; align-items: center; gap: .85rem; padding: .6rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
    .reviews-score > strong { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--yellow); line-height: 1; }
    .reviews-score > div { display: flex; flex-direction: column; }
    .reviews-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
    .review { display: flex; gap: .9rem; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
    .review .avatar { width: 40px; height: 40px; }
    .review-head { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; }
    .review-head strong { font-size: var(--fs-sm); }
    .review-head .stars { font-size: .75rem; }
    .review p { margin-top: .4rem; font-size: var(--fs-sm); color: var(--text-2); white-space: pre-line; }
    .review-form .card-title { margin-bottom: .75rem; }
    .star-picker { display: flex; align-items: center; gap: .15rem; margin-bottom: .85rem; }
    .star-picker button { font-size: 1.6rem; line-height: 1; padding: .15rem; color: var(--surface-hover); transition: transform .12s, color .12s; }
    .star-picker button.is-on { color: var(--yellow); }
    .star-picker button:hover { transform: scale(1.15); }
    .star-picker span { margin-left: .5rem; }

    .rv-track { display: flex; gap: .85rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: .25rem; }
    .rv-track::-webkit-scrollbar { display: none; }
    .rv-card { flex: 0 0 220px; scroll-snap-align: start; display: flex; flex-direction: column; gap: .35rem; padding-bottom: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color var(--dur), transform var(--dur); }
    .rv-card:hover { border-color: rgb(43 140 255 / .4); transform: translateY(-2px); }
    .rv-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-3); margin-bottom: .3rem; }
    .rv-title { padding-inline: .8rem; font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .rv-price { padding-inline: .8rem; font-size: var(--fs-sm); font-weight: 750; }
    .rv-price.is-free { color: var(--green-2); }

    .buybar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        display: none; align-items: center; gap: .75rem;
        padding: .65rem var(--gutter) calc(.65rem + env(safe-area-inset-bottom));
        background: rgb(10 14 22 / .96); border-top: 1px solid var(--border-2);
        backdrop-filter: blur(14px); box-shadow: 0 -10px 30px -10px rgb(0 0 0 / .7);
        transform: translateY(105%); transition: transform .25s var(--ease);
    }
    .buybar img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }
    .buybar-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
    .buybar-info span { font-size: var(--fs-xs); color: var(--text-2); }
    .buybar-info strong { font-family: var(--font-display); font-size: 1.15rem; }
    .buybar.is-visible { transform: none; }
    body.has-buybar .to-top { bottom: calc(5rem + env(safe-area-inset-bottom)); }

    .lightbox { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgb(3 5 9 / .94); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
    .lightbox.active { opacity: 1; visibility: visible; }
    .lightbox-stage { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; padding: 4rem 1rem; }
    .lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); transition: transform .15s ease-out; user-select: none; }
    .lightbox-close, .lightbox-nav { position: absolute; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; font-size: 1.25rem; color: #fff; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .12); border-radius: 50%; transition: background var(--dur); }
    .lightbox-close:hover, .lightbox-nav:hover { background: rgb(255 255 255 / .18); }
    .lightbox-close { top: 1rem; right: 1rem; }
    .lightbox-nav { top: 50%; translate: 0 -50%; }
    .lightbox-nav.is-prev { left: 1rem; }
    .lightbox-nav.is-next { right: 1rem; }
    .lightbox-bar { position: absolute; bottom: 1rem; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; font-size: var(--fs-sm); background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .12); border-radius: 99px; font-variant-numeric: tabular-nums; }
    .lightbox-bar button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; }
    .lightbox-bar button:hover { background: rgb(255 255 255 / .12); }

    @media (max-width: 1024px) {
        .product-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "panel" "main"; }
        .buy-panel { position: static; }
        .buybar { display: flex; }
        .product-body { grid-template-columns: minmax(0, 1fr); }
        .product-side { position: static; }
    }
    @media (max-width: 420px) {
        .hide-xs { display: none; }
        .buy-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
        .review { flex-direction: column; }
    }
}

@layer pages {
    /* ------------------------------------------------------------------ Cart */
    .cart-list { display: flex; flex-direction: column; gap: .75rem; }
    .cart-row {
        display: grid;
        grid-template-columns: 132px minmax(0, 1fr) auto 96px 40px;
        align-items: center;
        gap: 1.1rem;
        padding: .85rem;
        background: linear-gradient(180deg, var(--surface-2), var(--surface));
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
    }
    .cart-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-3); }
    .cart-info { min-width: 0; }
    .cart-name { font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .cart-name:hover { color: var(--blue-3); }
    .cart-desc { font-size: var(--fs-xs); color: var(--text-3); margin-top: .2rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
    .cart-unit { font-size: var(--fs-xs); color: var(--text-2); }
    .cart-line { font-family: var(--font-display); font-size: var(--fs-lg); text-align: right; font-variant-numeric: tabular-nums; }

    .qty { display: inline-flex; align-items: center; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); }
    .qty button { display: grid; place-items: center; width: 34px; height: 36px; color: var(--text-2); }
    .qty button:hover:not(:disabled) { color: var(--text); background: var(--surface-3); }
    .qty button:disabled { opacity: .35; cursor: not-allowed; }
    .qty input { width: 38px; height: 36px; text-align: center; background: none; border: 0; font-weight: 650; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
    .qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .qty input:focus { outline: none; }

    .summary .card-body { display: flex; flex-direction: column; gap: 1.25rem; }
    .summary-promo { display: flex; flex-direction: column; gap: .55rem; }
    .promo-form { display: flex; gap: .5rem; }
    .promo-form .input { text-transform: uppercase; }
    .promo-form .input::placeholder { text-transform: none; }
    .promo-applied { display: flex; align-items: center; justify-content: space-between; padding: .6rem .8rem; font-family: var(--font-mono); font-weight: 700; color: var(--green-2); background: var(--green-soft); border: 1px dashed rgb(34 197 94 / .45); border-radius: var(--radius-sm); }
    .promo-applied span { display: inline-flex; align-items: center; gap: .5rem; }
    .promo-applied a { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--text-2); }
    .promo-applied a:hover { color: var(--red-2); background: var(--red-soft); }
    .promo-suggest { display: flex; flex-direction: column; gap: .35rem; }
    .promo-chip { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; padding: .45rem .7rem; font-size: var(--fs-xs); color: var(--blue-3); background: var(--blue-soft); border: 1px solid rgb(43 140 255 / .25); border-radius: var(--radius-sm); transition: border-color var(--dur); }
    .promo-chip strong { font-family: var(--font-mono); letter-spacing: .04em; }
    .promo-chip.is-wheel { color: var(--yellow); background: var(--yellow-soft); border-color: rgb(245 184 61 / .25); }
    .promo-chip:hover { border-color: currentColor; }

    .summary-rows { display: flex; flex-direction: column; gap: .55rem; padding-block: 1rem; border-block: 1px solid var(--border); }
    .summary-rows > div { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--fs-sm); color: var(--text-2); }
    .summary-rows dd { font-variant-numeric: tabular-nums; color: var(--text); }
    .summary-rows .is-discount, .summary-rows .is-discount dd { color: var(--green-2); }
    .summary-rows .is-total { margin-top: .35rem; padding-top: .7rem; border-top: 1px dashed var(--border-2); font-size: var(--fs-base); color: var(--text); font-weight: 700; }
    .summary-rows .is-total dd { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; }

    .pay-methods { border: 0; display: flex; flex-direction: column; gap: .5rem; }
    .pay-methods legend { margin-bottom: .5rem; }
    .pay-option { position: relative; cursor: pointer; }
    .pay-option input { position: absolute; opacity: 0; }
    .pay-card { display: flex; align-items: center; gap: .85rem; padding: .8rem .9rem; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius); transition: all var(--dur); }
    .pay-card > i { font-size: 1.35rem; color: var(--text-2); }
    .pay-card > span:not(.pay-logos) { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
    .pay-card strong { font-size: var(--fs-sm); }
    .pay-card small { font-size: var(--fs-xs); color: var(--text-3); }
    .pay-logos { display: flex; gap: .3rem; opacity: .75; }
    .pay-logos img { width: 22px; height: 14px; object-fit: contain; }
    .pay-option:hover .pay-card { border-color: var(--border-3); }
    .pay-option input:checked + .pay-card { border-color: var(--blue); background: rgb(43 140 255 / .08); box-shadow: 0 0 0 3px rgb(43 140 255 / .15); }
    .pay-option input:checked + .pay-card > i { color: var(--blue-2); }
    .pay-option input:focus-visible + .pay-card { outline: 2px solid var(--blue-2); outline-offset: 2px; }
    .summary-secure { display: flex; align-items: center; justify-content: center; gap: .45rem; font-size: var(--fs-xs); color: var(--text-3); }
    .summary-secure i { color: var(--green-2); }

    @media (max-width: 720px) {
        .cart-row { grid-template-columns: 96px minmax(0, 1fr) 36px; grid-template-areas: "thumb info remove" "qty qty line"; row-gap: .8rem; }
        .cart-thumb { grid-area: thumb; }
        .cart-info { grid-area: info; }
        .cart-remove { grid-area: remove; align-self: start; }
        .qty { grid-area: qty; justify-self: start; }
        .cart-line { grid-area: line; }
    }
}

@layer pages {
    /* ----------------------------------------------------- Account / auth */
    .auth-shell {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100dvh - var(--header-h));
        padding: clamp(2rem, 1rem + 4vw, 4.5rem) var(--gutter);
    }
    .auth-shell::before {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        background:
            radial-gradient(600px 360px at 18% 20%, rgb(43 140 255 / .12), transparent 65%),
            radial-gradient(540px 340px at 85% 85%, rgb(255 122 26 / .08), transparent 65%);
    }
    .auth-card {
        position: relative;
        width: 100%;
        max-width: 440px;
        background: linear-gradient(180deg, var(--surface-2), var(--surface));
        border: 1px solid var(--border-2);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
    }
    .auth-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--brand-gradient); }
    .auth-card-inner { padding: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem); }
    .auth-head { text-align: center; margin-bottom: 1.6rem; }
    .auth-badge { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 1rem; font-size: 1.55rem; border-radius: 18px; }
    .auth-badge--brand { color: var(--blue-2); background: var(--blue-soft); border: 1px solid rgb(43 140 255 / .3); }
    .auth-badge--ok { color: var(--green-2); background: var(--green-soft); border: 1px solid rgb(34 197 94 / .3); }
    .auth-badge--error { color: var(--red-2); background: var(--red-soft); border: 1px solid rgb(239 68 68 / .3); }
    .auth-title { font-size: var(--fs-2xl); margin-bottom: .45rem; }
    .auth-sub { color: var(--text-2); font-size: var(--fs-sm); }
    .auth-sub strong { color: var(--text); }
    .auth-sub--small { font-size: var(--fs-xs); color: var(--text-3); margin-top: .6rem; }
    .auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
    .auth-label { display: flex; align-items: center; gap: .45rem; margin-bottom: .45rem; font-size: var(--fs-sm); font-weight: 600; }
    .auth-label i { color: var(--text-3); }
    .auth-input {
        width: 100%; min-height: 48px; padding: .7rem .9rem; font-size: var(--fs-sm); color: var(--text);
        background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
        transition: border-color var(--dur), box-shadow var(--dur);
    }
    .auth-input::placeholder { color: var(--text-3); }
    .auth-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(43 140 255 / .2); }
    .auth-input:user-invalid { border-color: rgb(239 68 68 / .55); }
    .auth-input::-ms-reveal, .auth-input::-ms-clear { display: none; }
    .auth-input-wrap { position: relative; }
    .auth-input-wrap .auth-input { padding-right: 3rem; }
    .auth-toggle { position: absolute; top: 0; right: 0; height: 100%; width: 3rem; display: grid; place-items: center; color: var(--text-3); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
    .auth-toggle:hover, .auth-toggle[aria-pressed="true"] { color: var(--blue-2); }
    .auth-hint { margin-top: .45rem; font-size: var(--fs-xs); color: var(--text-3); }
    .auth-hint--ok { color: var(--green-2); }
    .auth-hint--bad { color: var(--red-2); }
    .auth-btn {
        display: inline-flex; align-items: center; justify-content: center; gap: .55rem; width: 100%; min-height: 50px;
        padding: .8rem 1.2rem; font-size: var(--fs-base); font-weight: 700; color: #fff;
        background: linear-gradient(180deg, #3d97ff, var(--blue)); border-radius: var(--radius);
        box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 8px 24px -10px rgb(43 140 255 / .8);
        transition: filter var(--dur), transform var(--dur);
    }
    .auth-btn:hover { filter: brightness(1.08); }
    .auth-btn:active { transform: translateY(1px); }
    .auth-btn--ghost { color: var(--text); background: var(--surface-3); border: 1px solid var(--border-2); box-shadow: none; }
    .auth-btn.is-loading { color: transparent; pointer-events: none; position: relative; }
    .auth-btn.is-loading::after { content: ''; position: absolute; width: 20px; height: 20px; border: 2px solid rgb(255 255 255 / .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
    .auth-alert { display: flex; gap: .6rem; margin-bottom: 1.2rem; padding: .85rem 1rem; font-size: var(--fs-sm); line-height: 1.5; border-radius: var(--radius-sm); border: 1px solid; }
    .auth-alert i { flex: none; margin-top: .1rem; }
    .auth-alert--error { color: var(--red-2); background: var(--red-soft); border-color: rgb(239 68 68 / .35); }
    .auth-alert--warn { color: var(--yellow); background: var(--yellow-soft); border-color: rgb(245 184 61 / .35); }
    .auth-alert--info { color: var(--blue-3); background: var(--blue-soft); border-color: rgb(43 140 255 / .3); }
    .auth-foot { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
    .auth-foot-note { display: flex; gap: .5rem; font-size: var(--fs-xs); color: var(--text-3); line-height: 1.6; }
    .auth-foot-note i { color: var(--blue-2); flex: none; margin-top: .15rem; }
    .auth-back { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.25rem; font-size: var(--fs-sm); color: var(--blue-2); font-weight: 600; }
    .auth-back:hover { color: var(--blue-3); }
    .auth-center { text-align: center; }
    .auth-actions { display: flex; flex-direction: column; gap: .7rem; margin-top: 1.5rem; }

    /* Login page: brand panel + form */
    .login-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; width: 100%; max-width: 1100px; }
    .login-brand h1 { font-size: var(--fs-4xl); }
    .login-brand > p { color: var(--text-2); margin-top: .8rem; max-width: 46ch; }
    .login-perks { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
    .login-perks li { display: flex; gap: .9rem; align-items: center; }
    .login-perks strong { display: block; font-size: var(--fs-sm); }
    .login-perks span:not(.icon-tile) { font-size: var(--fs-xs); color: var(--text-3); }
    .login-wrap .auth-card { max-width: none; }
    .auth-tabs { margin-bottom: 1.5rem; }
    .auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
    .auth-social .btn { min-height: 48px; }
    .auth-divider { display: flex; align-items: center; gap: .9rem; margin: 1.35rem 0; font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
    .auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-2); }
    .auth-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
    .auth-switch { text-align: center; font-size: var(--fs-sm); color: var(--text-2); margin-top: 1.25rem; }
    .auth-switch button { color: var(--blue-2); font-weight: 650; }
    .auth-switch button:hover { text-decoration: underline; }
    @media (max-width: 900px) {
        .login-wrap { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
        .login-brand { display: none; }
    }
    @media (max-width: 380px) { .auth-social { grid-template-columns: 1fr; } }
}

@layer pages {
    /* --------------------------------------------------------------- Account */
    .acc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(1.25rem, 1rem + 1.6vw, 2.5rem); padding-top: clamp(1.5rem, 1rem + 2vw, 2.75rem); align-items: start; }
    .acc-nav { position: sticky; top: calc(var(--header-h) + 1.25rem); display: flex; flex-direction: column; gap: .75rem; }
    .acc-user { display: flex; align-items: center; gap: .8rem; padding: .9rem; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-lg); }
    .acc-user .avatar { width: 48px; height: 48px; }
    .acc-user div { min-width: 0; display: flex; flex-direction: column; }
    .acc-user strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .acc-user span { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .acc-nav nav { display: flex; flex-direction: column; gap: .15rem; padding: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
    .acc-nav nav a, .acc-nav nav button { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .65rem .8rem; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); border-radius: var(--radius-sm); text-align: left; transition: all var(--dur); }
    .acc-nav nav a:hover, .acc-nav nav button:hover { color: var(--text); background: var(--surface-2); }
    .acc-nav nav a.is-active { color: #fff; background: var(--blue-soft); box-shadow: inset 2px 0 0 var(--blue); }
    .acc-nav nav a.is-active i { color: var(--blue-2); }
    .acc-nav nav .is-danger:hover { color: var(--red-2); background: var(--red-soft); }
    .acc-main { min-width: 0; }
    .acc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
    .acc-head .page-title { font-size: var(--fs-3xl); }
    .acc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .85rem; margin-bottom: 1.5rem; }
    .stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; }
    .stat-card .stat-value { font-size: var(--fs-2xl); }
    @media (max-width: 960px) {
        .acc-layout { grid-template-columns: minmax(0, 1fr); }
        .acc-nav { position: static; }
        .acc-user { display: none; }
        .acc-nav nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: .3rem; }
        .acc-nav nav::-webkit-scrollbar { display: none; }
        .acc-nav nav a, .acc-nav nav button { width: auto; flex: none; white-space: nowrap; padding: .5rem .8rem; }
        .acc-nav nav a.is-active { box-shadow: none; }
    }

    .purchase-list { display: flex; flex-direction: column; gap: .75rem; }
    .purchase { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 1.1rem; align-items: center; padding: .9rem; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-lg); }
    .purchase-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-3); }
    .purchase-name { font-weight: 700; line-height: 1.35; }
    .purchase-name:hover { color: var(--blue-3); }
    .purchase-desc { font-size: var(--fs-xs); color: var(--text-3); margin-top: .25rem; }
    .purchase-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; margin-top: .6rem; font-size: var(--fs-xs); color: var(--text-2); }
    .purchase-meta span { display: inline-flex; align-items: center; gap: .35rem; }
    .purchase-side { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
    .purchase-price { font-family: var(--font-display); font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
    .purchase-actions { display: flex; gap: .4rem; }
    @media (max-width: 720px) {
        .purchase { grid-template-columns: 110px minmax(0, 1fr); }
        .purchase-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; padding-top: .75rem; border-top: 1px solid var(--border); }
    }

    /* Invoice (HTML from api/invoice.php) */
    .invoice-document { font-size: var(--fs-sm); }
    .invoice-header { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1.25rem; border-bottom: 2px solid var(--blue); }
    .invoice-logo h2 { font-size: var(--fs-xl); background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
    .invoice-info { text-align: right; }
    .invoice-title { font-size: var(--fs-lg); }
    .invoice-number, .invoice-date { color: var(--text-3); font-size: var(--fs-xs); }
    .invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
    .invoice-parties h4 { font-family: var(--font-body); font-size: .6875rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: .3rem; }
    .invoice-parties p { color: var(--text-2); overflow-wrap: anywhere; }
    .invoice-items { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
    .invoice-items-header, .invoice-item { display: grid; grid-template-columns: minmax(0, 1fr) 50px 80px 80px; gap: .5rem; padding: .65rem .85rem; }
    .invoice-items-header { font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); background: var(--surface); }
    .invoice-item { border-top: 1px solid var(--border); }
    .invoice-items-header span:not(:first-child), .invoice-item span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
    .invoice-summary { margin: 1rem 0 0 auto; max-width: 300px; }
    .invoice-row { display: flex; justify-content: space-between; padding: .3rem 0; color: var(--text-2); }
    .invoice-discount { color: var(--green-2); }
    .invoice-total { margin-top: .4rem; padding-top: .6rem; border-top: 1px solid var(--border-2); font-weight: 800; color: var(--text); font-size: var(--fs-base); }
    .invoice-footer { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--border-2); color: var(--text-2); font-size: var(--fs-xs); display: flex; flex-direction: column; gap: .3rem; }
    .invoice-status-paid { color: var(--green-2); font-weight: 700; }
    .invoice-thank-you { margin-top: .5rem; color: var(--blue-3); }
}

@layer pages {
    /* ------------------------------------------------------- My orders chat */
    .chat-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 1rem; height: min(72vh, 720px); min-height: 480px; }
    .chat-list, .chat-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
    .chat-orders { flex: 1; overflow-y: auto; padding: .4rem; }
    .chat-order { display: flex; flex-direction: column; gap: .35rem; width: 100%; padding: .8rem .85rem; text-align: left; border-radius: var(--radius); border: 1px solid transparent; transition: all var(--dur); }
    .chat-order + .chat-order { margin-top: .25rem; }
    .chat-order:hover { background: var(--surface-2); }
    .chat-order.is-active { background: var(--blue-soft); border-color: rgb(43 140 255 / .35); }
    .chat-order-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
    .chat-order-top strong { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .chat-order-meta { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-xs); color: var(--text-3); }
    .chat-order-desc { font-size: var(--fs-xs); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .chat-order-date { font-size: .6875rem; color: var(--text-3); }
    .chat-empty { margin: auto; text-align: center; padding: 2rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
    .chat-empty h3 { font-size: var(--fs-lg); }
    .chat-active { display: flex; flex-direction: column; min-height: 0; flex: 1; }
    .chat-active[hidden] { display: none; }
    .chat-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); }
    .chat-head h3 { font-family: var(--font-body); font-size: var(--fs-base); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .chat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; margin-top: .25rem; font-size: var(--fs-xs); color: var(--text-3); }
    .chat-back { display: none; }
    .chat-messages { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; background: radial-gradient(500px 300px at 100% 0%, rgb(43 140 255 / .05), transparent 70%); }
    .msg { display: flex; gap: .65rem; max-width: 80%; }
    .msg .avatar { width: 34px; height: 34px; }
    .msg.is-own { align-self: flex-end; flex-direction: row-reverse; }
    .msg-body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
    .msg.is-own .msg-body { align-items: flex-end; }
    .msg-author { display: flex; align-items: center; gap: .4rem; font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); }
    .msg-author .badge { font-size: .5625rem; padding: .1rem .4rem; }
    .msg-bubble { padding: .65rem .9rem; font-size: var(--fs-sm); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-3); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; }
    .msg.is-own .msg-bubble { color: #fff; background: linear-gradient(180deg, #3d97ff, var(--blue)); border-color: transparent; border-radius: 14px 4px 14px 14px; }
    .msg.is-staff .msg-bubble { border-color: rgb(255 122 26 / .35); background: rgb(255 122 26 / .08); }
    .msg-time { font-size: .6875rem; color: var(--text-3); }
    .chat-input { padding: .8rem; border-top: 1px solid var(--border); }
    .chat-form { display: flex; align-items: flex-end; gap: .5rem; }
    .chat-form .textarea { min-height: 46px; max-height: 160px; resize: none; }
    .chat-closed { text-align: center; font-size: var(--fs-sm); color: var(--text-3); padding: .5rem; }
    @media (max-width: 960px) {
        .chat-layout { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
        .chat-layout .chat-panel { display: none; height: 75vh; }
        .chat-layout.is-chatting .chat-list { display: none; }
        .chat-layout.is-chatting .chat-panel { display: flex; }
        .chat-back { display: grid; }
        .msg { max-width: 92%; }
    }
}

@layer pages {
    /* --------------------------------------------------------------- Profile */
    .profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.25rem; padding: 1.4rem; margin-bottom: 1rem; background: radial-gradient(500px 200px at 0% 0%, rgb(43 140 255 / .14), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--surface)); }
    .profile-avatar { position: relative; width: 96px; height: 96px; border-radius: 50%; padding: 3px; background: var(--brand-gradient); cursor: pointer; }
    .profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface-3); border: 3px solid var(--surface); }
    .profile-avatar-edit { position: absolute; right: 0; bottom: 0; display: grid; place-items: center; width: 30px; height: 30px; font-size: .8rem; color: #fff; background: var(--blue); border: 3px solid var(--surface); border-radius: 50%; }
    .profile-avatar:hover img { filter: brightness(.8); }
    .profile-avatar.is-busy img { opacity: .4; }
    .profile-id h1 { font-size: var(--fs-2xl); overflow-wrap: anywhere; }
    .profile-avatar-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; max-width: 220px; text-align: right; }
    .profile-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
    .profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
    .kv { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
    .kv dt { font-size: var(--fs-xs); color: var(--text-3); }
    .kv dd { font-size: var(--fs-sm); font-weight: 650; }
    .setting-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--border); }
    .setting-row strong { font-size: var(--fs-sm); }
    .notif-list { display: flex; flex-direction: column; }
    .notif-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; cursor: pointer; }
    .notif-row + .notif-row { border-top: 1px solid var(--border); }
    .notif-row:has(input:checked) .icon-tile { color: var(--blue-2); }
    .notif-row:not(:has(input:checked)) .icon-tile { color: var(--text-3); background: var(--surface-3); border-color: var(--border); }
    .notif-foot { padding-top: .75rem; border-top: 1px solid var(--border); }
    .bars { display: flex; align-items: flex-end; gap: .4rem; height: 130px; padding-bottom: 1.4rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
    .bar { position: relative; flex: 1; max-width: 56px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
    .bar span { position: relative; display: block; height: var(--h); min-height: 4px; background: linear-gradient(180deg, var(--blue-2), rgb(43 140 255 / .35)); border-radius: 6px 6px 2px 2px; }
    .bar em { position: absolute; top: -1.2rem; left: 0; right: 0; text-align: center; font-style: normal; font-size: .6875rem; color: var(--text-2); }
    .bar small { position: absolute; bottom: -1.3rem; left: 0; right: 0; text-align: center; font-size: .625rem; color: var(--text-3); }
    .mini-list { display: flex; flex-direction: column; gap: .2rem; }
    .mini-list a { display: flex; align-items: center; gap: .7rem; padding: .45rem; font-size: var(--fs-sm); border-radius: var(--radius-sm); }
    .mini-list a:hover { background: var(--surface-2); }
    .mini-list img { width: 56px; height: 32px; object-fit: cover; border-radius: 5px; flex: none; background: var(--surface-3); }
    @media (max-width: 1100px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
    @media (max-width: 640px) {
        .profile-hero { grid-template-columns: auto minmax(0, 1fr); }
        .profile-avatar { width: 76px; height: 76px; }
        .profile-avatar-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; max-width: none; text-align: left; }
        .setting-row { flex-direction: column; align-items: flex-start; }
    }
}

@layer pages {
    .wl-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .85rem 1rem; margin-bottom: 1rem; }
    .wl-total { display: flex; flex-direction: column; line-height: 1.2; }
    .wl-total strong { font-family: var(--font-display); font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
    .purchase-list > .skeleton { list-style: none; }
}

@layer pages {
    /* --------------------------------------------------------- Custom orders */
    .custom-hero { position: relative; text-align: center; padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) clamp(2rem, 1.5rem + 2vw, 3rem); }
    .custom-hero .page-title { font-size: var(--fs-5xl); max-width: 20ch; margin-inline: auto; }
    .custom-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.75rem; }
    .custom-badges span { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; font-size: var(--fs-sm); color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 99px; }
    .custom-badges i { color: var(--green-2); }
    .custom-layout { grid-template-columns: minmax(0, 1fr) 420px; }
    .custom-h2 { font-size: var(--fs-3xl); margin-bottom: .4rem; }
    .service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
    .service { display: flex; gap: 1rem; padding: 1.1rem; }
    .service h3 { font-family: var(--font-body); font-size: var(--fs-base); font-weight: 700; }
    .service p { font-size: var(--fs-sm); color: var(--text-2); margin-top: .25rem; }
    .order-card .card-body { display: flex; flex-direction: column; }
    .game-pick label { position: relative; cursor: pointer; display: flex; }
    .game-pick input { position: absolute; opacity: 0; }
    .game-pick span { flex: 1; display: grid; place-items: center; min-height: 38px; padding: .35rem .5rem; font-size: var(--fs-sm); font-weight: 650; color: var(--text-2); border-radius: 6px; transition: all var(--dur); }
    .game-pick label:hover span { color: var(--text); background: var(--surface-2); }
    .game-pick input:checked + span { color: #fff; background: var(--blue); }
    .game-pick input:focus-visible + span { outline: 2px solid var(--blue-2); outline-offset: 2px; }
    .order-pay { display: flex; flex-direction: column; gap: .5rem; align-items: center; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
    @media (max-width: 1100px) { .custom-layout { grid-template-columns: minmax(0, 1fr); } }
    @media (max-width: 640px) { .service-grid { grid-template-columns: minmax(0, 1fr); } }
}

@layer pages {
    /* ----------------------------------------------------------------- Legal */
    .legal-head { text-align: center; }
    .legal-head .page-sub { margin-inline: auto; display: inline-flex; align-items: center; gap: .4rem; font-size: var(--fs-sm); }
    .legal-tabs { display: inline-grid; margin-bottom: 1.75rem; max-width: 100%; overflow-x: auto; }
    .legal-card { padding: clamp(1.25rem, 1rem + 2vw, 2.5rem); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-lg); }
    .legal-section + .legal-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
    .legal-heading { font-size: var(--fs-xl); margin-bottom: .75rem; }
    .legal-text { color: var(--text-2); line-height: 1.75; }
    .legal-text + .legal-text { margin-top: .75rem; }
    .legal-list { margin-top: .75rem; display: flex; flex-direction: column; gap: .45rem; }
    .legal-list li { position: relative; padding-left: 1.5rem; color: var(--text-2); line-height: 1.65; }
    .legal-list li::before { content: '\F26E'; font-family: bootstrap-icons; position: absolute; left: 0; top: .05em; color: var(--blue-2); }
    .legal-highlight { margin-top: 1rem; padding: 1rem 1.15rem; background: var(--blue-soft); border: 1px solid rgb(43 140 255 / .25); border-left: 3px solid var(--blue); border-radius: var(--radius-sm); color: var(--text-2); }
    .legal-highlight h3 { font-family: var(--font-body); font-size: var(--fs-base); font-weight: 700; color: var(--text); margin-bottom: .4rem; }
    .legal-highlight-green { background: var(--green-soft); border-color: rgb(34 197 94 / .25); border-left-color: var(--green); }
    .legal-highlight-red { background: var(--red-soft); border-color: rgb(239 68 68 / .25); border-left-color: var(--red); }
    .legal-highlight-red p:first-child { color: var(--red-2); font-weight: 600; }
    .legal-warning { display: flex; gap: 1rem; padding: 1.1rem 1.2rem; background: var(--yellow-soft); border: 1px solid rgb(245 184 61 / .3); border-radius: var(--radius); }
    .legal-warning > i { font-size: 1.5rem; color: var(--yellow); flex: none; }
    .legal-warning h3 { font-family: var(--font-body); font-size: var(--fs-base); font-weight: 700; color: var(--yellow); margin-bottom: .25rem; }
    .legal-warning p { color: var(--text-2); }
    .legal-steps { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
    .legal-step { display: flex; gap: .9rem; align-items: flex-start; color: var(--text-2); }
    .legal-step-number { flex: none; display: grid; place-items: center; width: 30px; height: 30px; font-weight: 800; font-size: var(--fs-sm); color: #fff; background: var(--blue); border-radius: 50%; }
    .legal-contact { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
    .legal-contact-link { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1rem; font-size: var(--fs-sm); font-weight: 600; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: var(--radius-sm); transition: all var(--dur); }
    .legal-contact-link:hover { border-color: var(--blue-ring); color: var(--blue-3); }
    .legal-card .mt-4 { margin-top: 1rem; }
    .legal-card .mt-2 { margin-top: .5rem; }
}

@layer pages {
    /* --------------------------------------------------------- Payment result */
    .payment-result-section { display: flex; justify-content: center; padding: clamp(2rem, 1rem + 4vw, 4.5rem) var(--gutter); }
    .payment-result-container { width: 100%; max-width: 620px; }
    .payment-result-card { position: relative; text-align: center; padding: clamp(1.5rem, 1rem + 2.5vw, 2.75rem); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border-2); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
    .payment-result-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--green); }
    .payment-result-card.payment-error::before { background: var(--red); }
    .payment-result-card.payment-cancelled::before { background: var(--yellow); }
    .payment-result-icon { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 1.25rem; font-size: 2.6rem; color: var(--green-2); background: var(--green-soft); border-radius: 50%; box-shadow: 0 0 0 10px rgb(34 197 94 / .06); animation: pop .5s var(--ease); }
    .payment-result-icon.error { color: var(--red-2); background: var(--red-soft); box-shadow: 0 0 0 10px rgb(239 68 68 / .06); }
    .payment-result-icon.cancelled { color: var(--yellow); background: var(--yellow-soft); box-shadow: 0 0 0 10px rgb(245 184 61 / .06); }
    .payment-result-card h1 { font-size: var(--fs-3xl); }
    .payment-result-desc { color: var(--text-2); margin-top: .5rem; }
    .payment-order-details { margin-top: 1.75rem; text-align: left; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
    .payment-order-header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .85rem 1.1rem; font-size: var(--fs-sm); border-bottom: 1px solid var(--border); }
    .payment-order-number { font-family: var(--font-mono); font-weight: 700; }
    .payment-order-date { color: var(--text-3); }
    .payment-order-items { padding: .5rem; }
    .payment-order-item { display: flex; align-items: center; gap: .85rem; padding: .55rem; }
    .payment-order-item img { width: 72px; height: 41px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-3); }
    .payment-order-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .payment-order-item-title { font-size: var(--fs-sm); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .payment-order-item-qty { font-size: var(--fs-xs); color: var(--text-3); }
    .payment-order-item-price { font-weight: 700; font-variant-numeric: tabular-nums; }
    .payment-order-summary { padding: .9rem 1.1rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .45rem; }
    .payment-summary-row { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--fs-sm); color: var(--text-2); }
    .payment-summary-row span:last-child { color: var(--text); text-align: right; display: inline-flex; align-items: center; gap: .35rem; }
    .payment-discount, .payment-discount span:last-child { color: var(--green-2) !important; }
    .payment-total { padding-top: .6rem; margin-top: .2rem; border-top: 1px dashed var(--border-2); font-weight: 700; color: var(--text); font-size: var(--fs-base); }
    .payment-total span:last-child { font-family: var(--font-display); font-size: var(--fs-xl); }
    .payment-txn-id { font-family: var(--font-mono); font-size: var(--fs-xs); overflow-wrap: anywhere; }
    .payment-cancelled-info { display: flex; gap: .7rem; margin-top: 1.5rem; padding: .9rem 1rem; text-align: left; font-size: var(--fs-sm); color: var(--text-2); background: var(--blue-soft); border: 1px solid rgb(43 140 255 / .25); border-radius: var(--radius-sm); }
    .payment-cancelled-info i { color: var(--blue-2); }
    .payment-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.75rem; }
    .payment-btn-primary, .payment-btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.3rem; font-size: var(--fs-sm); font-weight: 700; border-radius: var(--radius); transition: all var(--dur); }
    .payment-btn-primary { color: #fff; background: linear-gradient(180deg, #3d97ff, var(--blue)); box-shadow: 0 8px 24px -10px rgb(43 140 255 / .8); }
    .payment-btn-primary:hover { filter: brightness(1.08); }
    .payment-btn-secondary { color: var(--text); background: var(--surface-3); border: 1px solid var(--border-2); }
    .payment-btn-secondary:hover { border-color: var(--border-3); }
    @media (max-width: 480px) { .payment-result-actions > * { width: 100%; } }
}

@layer pages {
    /* ------------------------------------------------------------------- 404 */
    .nf { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 620px; margin-inline: auto; padding: clamp(3rem, 2rem + 4vw, 6rem) var(--gutter); }
    .nf-code { font-family: var(--font-display); font-size: clamp(6rem, 4rem + 10vw, 11rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 20px 60px rgb(43 140 255 / .25)); }
    .nf-code span { display: inline-block; animation: float-y 4s ease-in-out infinite; }
    .nf h1 { font-size: var(--fs-3xl); margin-top: .5rem; }
    .nf > p { color: var(--text-2); margin-top: .6rem; }
    .nf-search { display: flex; gap: .5rem; width: 100%; margin-top: 2rem; }
    .nf-search .input-group { flex: 1; }
    .nf-actions { justify-content: center; margin-top: 1rem; }
    .nf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.5rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
    .nf-links a { display: inline-flex; align-items: center; gap: .4rem; color: var(--blue-2); font-weight: 600; }
    .nf-links a:hover { color: var(--blue-3); }
    .auth-sub strong { color: var(--text); }
}

@layer pages {
    /* The search button in the drawer stays a full field at every width */
    .drawer .nav-search-trigger { width: 100%; height: 46px; padding: 0 .85rem; justify-content: flex-start; font-size: var(--fs-sm); color: var(--text-3); background: var(--surface); border-color: var(--border-2); }
    .drawer .nav-search-trigger span { display: block; }
}
