/* ── Members area: account, profile, sync guide, admin ─────
   Loaded by Account, Profile, SyncGuide and Admin/Members (@section Head).
   Same vocabulary as games.css (tokens, 44px fields, pill buttons, kicker + title) so the
   site reads as one product. Plain CSS on fluid.css's motion tokens: Tailwind output is
   prebuilt. Motion: press, the tab indicator and the sync panel; all interruptible CSS
   transitions on transform/opacity, each with a reduced-motion version at the end. */

.mx {
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --faint: #64748b;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --raised: #232a35;
    --field: #161b22;
    --brand: #D4774E;
    --brand-ink: #fff;
    --focus: #D4774E;
    --track: rgba(212, 119, 78, 0.18);
    --good: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;
    max-width: 64rem;
    margin-inline: auto;
    color: var(--ink);
}
html:not(.dark) .mx {
    --ink: #0f172a;
    --muted: #475569;
    --faint: #64748b;
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.14);
    --surface: #ffffff;
    --surface-2: rgba(15, 23, 42, 0.05);
    --raised: #ffffff;
    --field: #ffffff;
    --brand: #B85C30;
    --focus: #1f2328;
    --track: rgba(184, 92, 48, 0.14);
    --good: #15803d;
    --warn: #b45309;
    --bad: #b91c1c;
}
.mx-narrow { max-width: 44rem; }
/* Icons (Helpers/Icons.cs) default to the text size; components below set their own. */
:where(.mx) .ti { width: 1em; height: 1em; flex: none; }

.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;
}

/* ── Type: kicker → title → sub, as on the games pages ─── */
.mx-kicker {
    margin: 0;
    font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand);
}
[dir="rtl"] .mx-kicker { letter-spacing: 0; }
.mx-title {
    margin: 8px 0 0;
    font-size: clamp(1.75rem, 3.6vw, 2.5rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--ink);
    overflow-wrap: anywhere;
    text-wrap: balance;
}
/* Names and game titles carry dir="auto" (Latin in Arabic and back): keep them on the page's side. */
.mx [dir="auto"] { text-align: -webkit-match-parent; text-align: match-parent; }
html[lang="ar"] .mx-title { line-height: 1.3; letter-spacing: 0; }
.mx-sub { margin: 8px 0 0; font-size: .9375rem; line-height: 1.55; color: var(--muted); }
.mx-h2 { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.mx-h3 { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.3; color: var(--ink); }
.mx-note { margin: 0; font-size: .8125rem; line-height: 1.5; color: var(--muted); }
.mx-faint { color: var(--faint); }
.mx-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125em; overflow-wrap: anywhere; }
.mx-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.mx-link:hover { text-decoration: underline; }
.mx-num { font-variant-numeric: tabular-nums; }

/* ── Surfaces ──────────────────────────────────────────── */
.mx-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
}
html:not(.dark) .mx-card { box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important; }
.mx-section { margin-top: 40px; }
.mx-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }

/* ── Buttons: pills, 44px tall (touch), press handled by fluid.css ── */
.mx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    background: transparent; color: var(--ink);
    font: inherit; font-size: .875rem; font-weight: 600; line-height: 1.2; text-decoration: none;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, opacity 150ms ease;
}
.mx-btn:hover { border-color: var(--brand); }
.mx-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.mx-btn svg { width: 18px; height: 18px; flex: none; }
.mx-btn.is-primary { border-color: transparent; background: var(--brand); color: var(--brand-ink); }
.mx-btn.is-primary:hover { opacity: .92; }
.mx-btn.is-patreon { border-color: transparent; background: #FF424D; color: #fff; }
.mx-btn.is-patreon:hover { background: #e63946; }
.mx-btn.is-danger { border-color: transparent; background: #dc2626; color: #fff; }
.mx-btn.is-danger:hover { background: #ef4444; }
.mx-btn.is-quiet { border-color: transparent; color: var(--muted); padding-inline: 12px; }
.mx-btn.is-quiet:hover { color: var(--ink); background: var(--surface-2); }
.mx-btn.is-small { min-height: 36px; padding: 0 14px; font-size: .8125rem; }
.mx-btn[disabled], .mx-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.mx-btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* Link buttons and tiles press like buttons do (fluid.css covers <button>). */
a.mx-btn, .mx-av { transition: border-color 150ms ease, background-color 150ms ease, scale var(--dur-press) var(--ease-out); }
a.mx-btn:active, .mx-av:active { scale: var(--press-scale); transition-duration: 150ms, 150ms, 100ms; }

/* Small labels: tier, PS Plus, status. Text + colour, never colour alone. */
.mx-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    background: var(--surface-2);
    font-size: .75rem; font-weight: 600; line-height: 1.4; color: var(--ink);
    white-space: nowrap;
}
.mx-chip svg { width: 14px; height: 14px; flex: none; }
.mx-chip.is-brand { border-color: transparent; background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand); }
.mx-chip.is-plus { border-color: transparent; background: rgba(251, 191, 36, .16); color: #f59e0b; }
html:not(.dark) .mx-chip.is-plus { background: rgba(245, 158, 11, .14); color: #92400e; }
.mx-chip.is-warn { border-color: transparent; background: rgba(251, 191, 36, .16); color: var(--warn); }
.mx-chip.is-bad { border-color: transparent; background: rgba(248, 113, 113, .14); color: var(--bad); }
.mx-chip.is-good { border-color: transparent; background: rgba(74, 222, 128, .12); color: var(--good); }

/* ── Trophy icons (sprite in _TrophySprite.cshtml) ─────── */
.tr { display: inline-block; flex: none; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.tr-plat   { fill: url(#tr-g-plat); filter: drop-shadow(0 0 5px rgba(147, 197, 253, .45)); }
.tr-gold   { fill: url(#tr-g-gold); }
.tr-silver { fill: url(#tr-g-silver); }
.tr-bronze { fill: url(#tr-g-bronze); }
html:not(.dark) .tr-plat { fill: url(#tr-g-plat-l); filter: drop-shadow(0 1px 2px rgba(30, 64, 175, .25)); }
/* A platinum the game has but the player hasn't earned yet: an outline, quiet. */
.tr-off { fill: var(--line-strong); filter: none; --tr-shine: transparent; }
.tr-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Hero: who this is, when it was synced, what to do next ── */
.mx-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px 20px;
    align-items: center;
    margin: 8px 0 28px;
}
.mx-hero-pic {
    width: 88px; height: 88px;
    border-radius: 24px;
    object-fit: cover;
    background: var(--surface-2);
    box-shadow: 0 0 0 1px var(--line-strong), 0 12px 32px -12px rgba(0, 0, 0, .6) !important;
}
.mx-hero-pic.is-initial {
    display: grid; place-items: center;
    font-size: 2rem; font-weight: 700; color: var(--ink);
}
.mx-hero-text { min-width: 0; }
.mx-hero-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.mx-hero-meta { margin: 10px 0 0; font-size: .8125rem; color: var(--muted); }
.mx-hero-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mx-hero-actions .mx-spacer { flex: 1; }
@media (min-width: 768px) {
    .mx-hero { grid-template-columns: auto 1fr auto; }
    .mx-hero-pic { width: 112px; height: 112px; border-radius: 28px; }
    .mx-hero-actions { grid-column: auto; justify-content: flex-end; max-width: 22rem; }
    .mx-hero-actions .mx-spacer { display: none; }
}

/* Account switcher: a plain select, styled like the toolbar's. */
.mx-switch { position: relative; }
.mx-switch .mx-select { height: 44px; min-width: 11rem; }

/* ── Stat tiles: label (sentence case) over value ───────── */
.mx-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 10px;
    margin: 0 0 32px;
    padding: 0;
}
.mx-stat {
    margin: 0;
    padding: 14px 16px 15px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    min-width: 0;
}
html:not(.dark) .mx-stat { box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important; }
.mx-stat dt { display: flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 500; color: var(--muted); }
.mx-stat dd { margin: 4px 0 0; font-size: 1.75rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); overflow-wrap: anywhere; }
/* Money: a smaller size, and it only wraps between the amount and the code ("70.55 / CHF"), never inside a number. */
.mx-stat dd.is-money { font-size: clamp(1.125rem, .9rem + 1vw, 1.5rem); overflow-wrap: normal; word-break: keep-all; }
.mx-acct-stats { margin: 16px 0 4px; }
.mx-acct-advanced { margin-top: 12px; }
.mx-row-action { flex: none; }
.mx-row:has(> .mx-row-action) { grid-template-columns: 52px minmax(0, 1fr) auto auto; }
.mx-stat dd small { font-size: .8125rem; font-weight: 500; letter-spacing: 0; color: var(--faint); }
.mx-stat .mx-stat-note { margin-top: 6px; font-size: .75rem; font-weight: 400; line-height: 1.4; letter-spacing: 0; color: var(--faint); }
.mx-stat-note .mx-meter { display: block; margin: 10px 0 7px; }
/* A tile that opens a section: the label is the link, stretched over the whole tile. */
.mx-stat.is-link { position: relative; transition: border-color 150ms ease, scale var(--dur-press) var(--ease-out); }
.mx-stat.is-link:hover { border-color: var(--brand); }
.mx-stat.is-link:active { scale: var(--press-scale); transition-duration: 150ms, 100ms; }
.mx-stat-link { color: inherit; text-decoration: none; }
.mx-stat-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.mx-stat-link:focus-visible { outline: none; }
.mx-stat.is-link:has(.mx-stat-link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.mx-stat.is-locked dd:not(.mx-stat-note) { font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }

/* Meter / progress track: brand fill on a lighter step of the same hue. */
.mx-meter {
    position: relative;
    height: 4px;
    border-radius: 2px;
    background: var(--track);
    overflow: hidden;
}
.mx-meter > span {
    position: absolute; inset-block: 0; inset-inline-start: 0;
    width: var(--v, 0%);
    border-radius: 2px;
    background: var(--brand);
}
.mx-meter.is-done > span { background: linear-gradient(90deg, #93c5fd, #e0f2fe); }
html:not(.dark) .mx-meter.is-done > span { background: linear-gradient(90deg, #3b82f6, #7dd3fc); }

/* ── Tabs: a segmented control; the selected pill slides between items ── */
.mx-tabs-wrap { position: sticky; top: 88px; z-index: 5; margin: 0 -4px 20px; padding: 4px; }
.mx-seg {
    position: relative;
    display: flex;
    gap: 2px;
    width: max-content;
    max-width: 100%;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--field) 82%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    overflow-x: auto;
    scrollbar-width: none;
}
.mx-seg::-webkit-scrollbar { display: none; }
html:not(.dark) .mx-seg { background: rgba(241, 245, 249, .85); }
.mx-seg-btn {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 38px; padding: 0 16px;
    border: 0; border-radius: 999px;
    background: transparent; color: var(--muted);
    font: inherit; font-size: .875rem; font-weight: 600; white-space: nowrap;
    cursor: pointer;
    transition: color 200ms ease;
}
.mx-seg-btn:hover { color: var(--ink); }
.mx-seg-btn[aria-selected="true"] { color: var(--ink); }
.mx-seg-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.mx-seg-btn svg { width: 14px; height: 14px; }
.mx-seg-ind {
    position: absolute; z-index: 0;
    top: 4px; bottom: 4px; left: 0;
    width: var(--w, 0);
    translate: var(--x, 0) 0;
    border-radius: 999px;
    background: var(--raised);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
    transition: translate 260ms var(--ease-out), width 260ms var(--ease-out);
}
html:not(.dark) .mx-seg-ind { box-shadow: 0 1px 3px rgba(15, 23, 42, .14), 0 0 0 1px rgba(15, 23, 42, .04) !important; }
.mx-seg.is-instant .mx-seg-ind { transition: none; }
/* Without JS the selected tab paints its own pill. */
html:not(.js) .mx-seg-btn[aria-selected="true"] { background: var(--raised); }

.mx-panel[hidden] { display: none; }
.mx-panel.is-entering { animation: mx-fade 160ms var(--ease-out); }
@keyframes mx-fade { from { opacity: 0; } }

/* ── List toolbar: search + order, then filter chips (as on /games) ── */
.mx-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.mx-search { position: relative; flex: 1 1 16rem; min-width: 0; }
.mx-search-icon {
    position: absolute; inset-inline-start: 14px; top: 50%; translate: 0 -50%;
    width: 18px; height: 18px; color: var(--faint); pointer-events: none;
}
.mx-input, .mx-select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background-color: var(--field);
    color: var(--ink);
    font: inherit;
    font-size: .9375rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.mx-input { padding-inline: 14px; }
.mx-search .mx-input { padding-inline: 42px 40px; }
.mx-input::placeholder { color: var(--faint); }
.mx-input::-webkit-search-cancel-button { display: none; }
.mx-input:focus, .mx-select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent) !important; }
.mx-clear {
    position: absolute; inset-inline-end: 6px; top: 50%; translate: 0 -50%;
    display: grid; place-items: center; width: 32px; height: 32px;
    border: 0; border-radius: 999px; background: transparent;
    color: var(--faint); cursor: pointer;
}
.mx-clear:hover { color: var(--ink); background: var(--line); }
.mx-clear svg { width: 16px; height: 16px; }
.mx-clear[hidden] { display: none; }
.mx-field { flex: 0 1 13rem; min-width: 9rem; }
.mx-select {
    appearance: none;
    -webkit-appearance: none;
    padding-inline: 14px 38px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}
[dir="rtl"] .mx-select { background-position: left 12px center; }
@media (max-width: 639px) {
    .mx-toolbar .mx-field { flex: 1 1 100%; }
}

.mx-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.mx-filter {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    background: transparent; color: var(--muted);
    font: inherit; font-size: .8125rem; font-weight: 600;
    cursor: pointer;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
.mx-filter:hover { color: var(--ink); border-color: var(--brand); }
.mx-filter:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mx-filter[aria-pressed="true"] { border-color: transparent; background: var(--ink); color: #0d1117; }
html:not(.dark) .mx-filter[aria-pressed="true"] { color: #fff; }
.mx-filter .mx-filter-n { font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }

.mx-count { margin: 0 0 10px; font-size: .8125rem; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ── Lists: one row per game ───────────────────────────── */
.mx-list { margin: 0; padding: 0; list-style: none; }
.mx-list.mx-card > li + li { border-top: 1px solid var(--line); }
.mx-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
}
.mx-row[hidden] { display: none; }
.mx-row-art {
    width: 52px; height: 52px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--surface-2);
}
.mx-row-art.is-blank { display: grid; place-items: center; color: var(--faint); }
.mx-row-art.is-blank svg { width: 22px; height: 22px; }
.mx-row-main { min-width: 0; }
.mx-row-title {
    display: flex; align-items: center; gap: 6px;
    margin: 0;
    font-size: .9375rem; font-weight: 600; line-height: 1.3; color: var(--ink);
}
.mx-row-title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-row-title .tr { width: 18px; height: 18px; }
.mx-row .mx-meter { margin-top: 8px; max-width: 26rem; }
.mx-row-sub {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
    margin: 7px 0 0;
    font-size: .8125rem; line-height: 1.3; color: var(--muted);
}
.mx-row-sub .pf-tag { font-size: .8125rem; }
/* Platforms without a wordmark (PC): same size as a .pf-tag, outlined. */
.mx-pf {
    display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
    border: 1px solid var(--line-strong); border-radius: 4px;
    font-size: .6875rem; font-weight: 700; letter-spacing: .04em; color: var(--ink);
}
.mx-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: end; }
.mx-row-big { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx-row-small { margin: 0; font-size: .75rem; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx-row-end .tr { width: 26px; height: 26px; }
a.mx-row { color: inherit; text-decoration: none; transition: background-color 150ms ease; }
a.mx-row:hover { background: var(--surface-2); }
a.mx-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 12px; }
@media (max-width: 479px) {
    .mx-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 12px; }
    .mx-row-art { width: 44px; height: 44px; border-radius: 10px; }
}

.mx-empty { padding: 48px 16px; text-align: center; }
.mx-empty[hidden] { display: none; }
.mx-empty-title { margin: 0; font-size: 1rem; font-weight: 600; color: var(--ink); }
.mx-empty-text { margin: 6px 0 16px; font-size: .875rem; color: var(--muted); }

/* ── Avatar tiles ──────────────────────────────────────── */
.mx-avatars:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr));
    gap: 18px 12px;
    margin: 0; padding: 0; list-style: none;
}
.mx-av { display: block; min-width: 0; color: inherit; text-decoration: none; }
.mx-av[hidden] { display: none; }
.mx-av img {
    display: block; width: 100%; aspect-ratio: 1;
    border-radius: 16px; object-fit: cover;
    background: var(--surface-2);
    box-shadow: 0 0 0 1px var(--line) !important;
    transition: box-shadow 150ms ease;
}
.mx-av:hover img { box-shadow: 0 0 0 2px var(--brand) !important; }
.mx-av:focus-visible { outline: none; }
.mx-av:focus-visible img { box-shadow: 0 0 0 2px var(--focus) !important; }
.mx-av-name {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin: 8px 0 0; font-size: .8125rem; font-weight: 600; line-height: 1.3; color: var(--ink);
}
.mx-av-meta { margin: 2px 0 0; font-size: .75rem; line-height: 1.35; color: var(--faint); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Consoles ──────────────────────────────────────────── */
.mx-devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.mx-device { display: flex; align-items: center; gap: 14px; padding: 16px; }
.mx-device .pf-tag { font-size: 1.125rem; }
.mx-device-text { min-width: 0; }

/* ── Money: totals, then a bar per year (one hue, value at the tip) ── */
.mx-years { margin: 0; padding: 6px 16px; list-style: none; }
.mx-year {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    font-size: .875rem;
}
.mx-year + .mx-year { border-top: 1px solid var(--line); }
.mx-year-label { color: var(--muted); font-variant-numeric: tabular-nums; }
.mx-year-bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--brand); width: var(--v, 0%); min-width: 2px; }
[dir="rtl"] .mx-year-bar { border-radius: 4px 0 0 4px; }
.mx-year-value { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx-subs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

/* ── Sync panel: three numbered steps, help inline, honest progress ── */
.mx-sync { padding: 22px; }
@media (min-width: 768px) { .mx-sync { padding: 28px; } }
.mx-sync-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .mx-sync-grid { grid-template-columns: minmax(0, 1fr) 17rem; gap: 36px; } }
.mx-steps { display: grid; gap: 18px; margin: 20px 0 0; padding: 0; list-style: none; }
.mx-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; }
.mx-step-num {
    display: grid; place-items: center;
    width: 28px; height: 28px; margin-top: 1px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: .8125rem; font-weight: 700; color: var(--ink);
    transition: background-color 200ms ease, color 200ms ease;
}
.mx-step.is-ok .mx-step-num { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.mx-step-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-height: 30px; }
.mx-step-head label { font-size: .9375rem; font-weight: 600; color: var(--ink); }
.mx-step-head .mx-faint { font-size: .8125rem; }
.mx-step-body { grid-column: 2; display: grid; gap: 8px; }
.mx-input.is-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875rem; letter-spacing: .02em; }
/* Codes read left to right in either language; the hint keeps the page's font so Arabic letters stay joined. */
.mx-input.is-code::placeholder { font-family: var(--font-ui); letter-spacing: 0; }
html[lang="ar"] .mx-input.is-code::placeholder { font-family: 'Cairo', var(--font-ui); }
[dir="rtl"] .mx-input.is-code { text-align: right; }
.mx-input[aria-invalid="true"] { border-color: var(--bad); }
.mx-check { display: flex; align-items: center; gap: 6px; min-height: 18px; margin: 0; font-size: .8125rem; color: var(--muted); }
.mx-check[data-state="ok"] { color: var(--good); }
.mx-check[data-state="bad"] { color: var(--bad); }
.mx-check svg { width: 15px; height: 15px; flex: none; }

/* "How do I get this?": the steps open right under the field, no new tab. */
.mx-help > summary {
    display: inline-flex; align-items: center; gap: 4px;
    width: fit-content;
    font-size: .8125rem; font-weight: 600; color: var(--brand);
    list-style: none; cursor: pointer;
}
.mx-help > summary::-webkit-details-marker { display: none; }
.mx-help > summary svg { width: 14px; height: 14px; transition: rotate 200ms var(--ease-in-out); }
.mx-help[open] > summary svg { rotate: 180deg; }
.mx-help ol {
    list-style: decimal;
    margin: 8px 0 2px; padding: 12px 14px 12px 32px;
    border-radius: 14px; background: var(--surface-2);
    font-size: .8125rem; line-height: 1.55; color: var(--muted);
}
[dir="rtl"] .mx-help ol { padding: 12px 32px 12px 14px; }
.mx-help li + li { margin-top: 4px; }
.mx-help b, .mx-help code { color: var(--ink); }
.mx-code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125em; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
@supports (interpolate-size: allow-keywords) {
    .mx-help { interpolate-size: allow-keywords; }
    .mx-help::details-content { height: 0; overflow: clip; transition: height 200ms var(--ease-out), content-visibility 200ms allow-discrete; }
    .mx-help[open]::details-content { height: auto; }
}

.mx-submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 24px; }
.mx-busy { display: none; align-items: center; gap: 10px; font-size: .8125rem; color: var(--muted); }
.mx-sync-form[aria-busy="true"] .mx-busy { display: flex; }
.mx-sync-form[aria-busy="true"] .mx-step-body { opacity: .6; pointer-events: none; }
.mx-spinner {
    width: 16px; height: 16px; flex: none;
    border: 2px solid var(--track); border-top-color: var(--brand);
    border-radius: 999px;
    animation: mx-spin 800ms linear infinite;
}
@keyframes mx-spin { to { rotate: 1turn; } }
.mx-progress { position: relative; height: 3px; margin-top: 18px; border-radius: 2px; background: var(--track); overflow: hidden; display: none; }
.mx-sync-form[aria-busy="true"] .mx-progress { display: block; }
.mx-progress::after {
    content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 35%;
    border-radius: 2px; background: var(--brand);
    animation: mx-indeterminate 1.4s var(--ease-in-out) infinite;
}
@keyframes mx-indeterminate { from { translate: -100% 0; } to { translate: 290% 0; } }
[dir="rtl"] .mx-progress::after { animation-name: mx-indeterminate-rtl; }
@keyframes mx-indeterminate-rtl { from { translate: 100% 0; } to { translate: -290% 0; } }

.mx-alert { display: flex; gap: 10px; margin: 18px 0 0; padding: 12px 14px; border-radius: 14px; font-size: .875rem; line-height: 1.5; }
.mx-alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.mx-alert.is-bad { background: rgba(248, 113, 113, .1); color: var(--bad); }
.mx-alert.is-warn { background: rgba(251, 191, 36, .1); color: var(--warn); }

/* Side column: what you get, and what happens to the codes. */
.mx-aside { display: grid; gap: 22px; align-content: start; }
.mx-points { display: grid; gap: 12px; margin: 10px 0 0; padding: 0; list-style: none; }
.mx-point { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; font-size: .8125rem; line-height: 1.45; color: var(--muted); }
.mx-point svg { width: 18px; height: 18px; margin-top: 1px; color: var(--faint); }
.mx-point b { color: var(--ink); font-weight: 600; }
.mx-point.is-locked { opacity: .65; }

/* Sync again: the panel opens under the hero (Fluid.disclosure: .fl-collapse). */
.mx-sync-wrap { margin-bottom: 28px; scroll-margin-top: 96px; }
/* Without JS: the form stays open and every section shows, one after another. */
html:not(.js) .mx-sync-wrap.fl-collapse { grid-template-rows: 1fr; opacity: 1; visibility: visible; }
html:not(.js) #sync-toggle,
html:not(.js) .mx-tabs-wrap,
html:not(.js) .mx-toolbar,
html:not(.js) .mx-filters { display: none; }
html:not(.js) .mx-panel[hidden] { display: block; margin-top: 32px; }

/* ── Locked feature (free members) ─────────────────────── */
.mx-lock { padding: 36px 24px; text-align: center; }
.mx-lock-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.mx-lock-icon svg { width: 22px; height: 22px; }

/* ── Account page: intro, sign-in, who's signed in ─────── */
.mx-intro { margin: 8px 0 24px; }
.mx-signin { display: grid; gap: 12px; justify-items: start; padding: 24px; }
@media (min-width: 640px) { .mx-signin { padding: 28px; } }
.mx-btn.is-large { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.mx-who { display: flex; align-items: center; gap: 14px; }
.mx-signin > form > .mx-btn.is-quiet { margin-inline-start: -12px; }
.mx-who-pic { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; flex: none; }
.mx-who-text { min-width: 0; display: grid; gap: 4px; }
.mx-warn-text { color: var(--warn); }
.mx-intro + .mx-alert { margin: 0 0 16px; }

/* ── Plans (account page) ──────────────────────────────── */
.mx-plans { display: grid; gap: 12px; margin-top: 28px; }
@media (min-width: 640px) { .mx-plans { grid-template-columns: 1fr 1fr; } }
.mx-plan { display: flex; flex-direction: column; padding: 22px; }
.mx-plan.is-featured { border-color: color-mix(in srgb, var(--brand) 55%, transparent); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.mx-plan-price { margin: 6px 0 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.mx-plan-price small { font-size: .875rem; font-weight: 500; letter-spacing: 0; color: var(--faint); }
.mx-plan ul { display: grid; gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; font-size: .875rem; color: var(--muted); }
.mx-plan li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; line-height: 1.45; }
.mx-plan li svg { width: 16px; height: 16px; margin-top: 2px; color: var(--good); }
.mx-plan li b { color: var(--ink); font-weight: 600; }
.mx-plan-cta { margin-top: auto; padding-top: 20px; }

/* ── Guide: back link, step jump bar, one card per code ── */
.mx-back {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; margin: 0 0 8px; padding: 0 12px 0 8px;
    border-radius: 999px; color: var(--muted);
    font-size: .875rem; font-weight: 600; text-decoration: none;
    transition: color 150ms ease, background-color 150ms ease, scale var(--dur-press) var(--ease-out);
}
.mx-back:hover { color: var(--ink); background: var(--surface-2); }
.mx-back:active { scale: var(--press-scale); }
.mx-back svg { width: 18px; height: 18px; }
[dir="rtl"] .mx-flip { scale: -1 1; }
.mx-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.mx-toc a {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 0 14px 0 6px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    color: var(--ink); font-size: .8125rem; font-weight: 600; text-decoration: none;
    transition: border-color 150ms ease, scale var(--dur-press) var(--ease-out);
}
.mx-toc a:hover { border-color: var(--brand); }
.mx-toc a:active { scale: var(--press-scale); }
.mx-toc .mx-step-num { margin: 0; }
.mx-toc .mx-step-num svg, .mx-guide-head .mx-step-num svg { width: 14px; height: 14px; }
.mx-guide { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.mx-guide-step { padding: 22px; scroll-margin-top: 96px; }
@media (min-width: 640px) { .mx-guide-step { padding: 26px 28px; } }
.mx-guide-step:target { border-color: color-mix(in srgb, var(--brand) 60%, transparent); }
.mx-guide-step.is-warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 5%, var(--surface)); }
.mx-guide-head { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.mx-guide-head .mx-note { margin-top: 4px; }
.mx-guide-tag { margin: 2px 0 4px; font-size: .75rem; font-weight: 700; color: var(--brand); }
.mx-guide-tag.is-optional { color: var(--faint); }
.mx-guide-tag.is-warn { color: var(--warn); }
.mx-guide-list { display: grid; gap: 8px; margin: 16px 0 0; padding-inline-start: 60px; list-style: decimal; font-size: .9375rem; line-height: 1.55; color: var(--muted); }
.mx-guide-list li { padding-inline-start: 4px; }
.mx-guide-list li::marker, .mx-help li::marker { color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.mx-guide-list b { color: var(--ink); }
.mx-guide-step > .mx-sub { margin-top: 12px; padding-inline-start: 40px; }
@media (max-width: 479px) { .mx-guide-list { padding-inline-start: 20px; } .mx-guide-step > .mx-sub { padding-inline-start: 0; } }
.mx-break { overflow-wrap: anywhere; }

/* ── Guide: DevTools sketch, so the cookie row is easy to spot ── */
.mx-devtools {
    margin: 14px 0 0;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    overflow: hidden;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .75rem;
    color: var(--muted);
    background: var(--field);
}
.mx-devtools-bar { display: flex; gap: 14px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mx-devtools-bar .is-on { color: var(--ink); font-weight: 700; }
.mx-devtools table { width: 100%; border-collapse: collapse; }
.mx-devtools th, .mx-devtools td { padding: 6px 12px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mx-devtools th { font-weight: 600; color: var(--faint); }
.mx-devtools tr.is-hl td { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--ink); }
.mx-devtools td:nth-child(2) { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; }
.mx-devtools figcaption { padding: 9px 12px; border-top: 1px solid var(--line); font-family: var(--font-ui); font-size: .8125rem; line-height: 1.45; color: var(--muted); }
.mx-guide-step .mx-devtools { margin: 18px 0 0; margin-inline-start: 40px; }
@media (max-width: 479px) { .mx-guide-step .mx-devtools { margin-inline-start: 0; } }
.mx-devtools-page { margin: 0; padding: 14px 12px; font: inherit; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.mx-devtools mark { padding: 1px 3px; border-radius: 4px; background: color-mix(in srgb, var(--brand) 26%, transparent); color: var(--ink); }
.mx-devtools-body { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); }
.mx-devtools-side { display: grid; align-content: start; gap: 6px; padding: 8px 12px; border-inline-end: 1px solid var(--line); }
.mx-devtools-side .is-on { color: var(--ink); font-weight: 700; }
.mx-devtools-side .is-sub { padding-inline-start: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-devtools tr.is-soft td { opacity: .7; }
@media (max-width: 479px) { .mx-devtools-body { grid-template-columns: minmax(0, 1fr); } .mx-devtools-side { display: none; } .mx-devtools td:nth-child(3), .mx-devtools th:nth-child(3) { display: none; } }

/* ── Admin ─────────────────────────────────────────────── */
.mx-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.mx-table th { padding: 10px 14px; text-align: start; font-size: .75rem; font-weight: 600; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; }
.mx-table td { padding: 10px 14px; color: var(--muted); border-bottom: 1px solid var(--line); vertical-align: top; }
.mx-table tr:last-child td { border-bottom: 0; }
.mx-table td.is-strong { color: var(--ink); font-weight: 600; }
.mx-scroll { overflow-x: auto; }
.mx-initial {
    display: grid; place-items: center; flex: none;
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--surface-2); color: var(--ink);
    font-weight: 700;
}
.mx-ids { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mx-ids .mx-chip { font-weight: 500; }
.mx-acct { padding: 18px; }
.mx-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 12px 16px; margin: 16px 0 0; }
.mx-facts dt { font-size: .75rem; color: var(--faint); }
.mx-facts dd { margin: 2px 0 0; font-size: .9375rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.mx-table th.is-num, .mx-table td.is-num { text-align: end; font-variant-numeric: tabular-nums; }
.mx-table .is-nowrap { white-space: nowrap; }
.mx-ink { color: var(--ink); font-weight: 600; }
.mx-initial.is-large { width: 64px; height: 64px; border-radius: 20px; font-size: 1.5rem; }
.mx-row > .mx-initial { width: 44px; height: 44px; }
.mx-row-big.is-warn { color: var(--warn); }
.mx-row-title .mx-chip { padding: 1px 8px; font-size: .6875rem; }

/* Member header: who, chips, then ban / unban on the end side. */
.mx-member { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 18px; align-items: start; padding: 22px; margin-top: 4px; }
.mx-member .mx-title { font-size: clamp(1.5rem, 3vw, 2rem); }
.mx-member-text { min-width: 0; }
.mx-member-actions { grid-column: 1 / -1; display: grid; gap: 10px; justify-items: start; }
@media (min-width: 900px) {
    .mx-member { grid-template-columns: auto minmax(0, 1fr) minmax(16rem, 22rem); }
    .mx-member-actions { grid-column: auto; justify-items: end; }
}
.mx-ban { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.mx-ban .mx-input { flex: 1 1 12rem; }
@media (min-width: 900px) { .mx-ban { justify-content: flex-end; } }
.mx-notice { align-items: center; margin: 0 0 14px; }
.mx-notice form { margin-inline-start: auto; }
.mx-notice .mx-btn { color: inherit; border-color: currentColor; }
.mx-alert.is-good { background: rgba(74, 222, 128, .1); color: var(--good); }

/* PSN account cards: facts, raw JSON, owned avatars behind a disclosure. */
.mx-accts { display: grid; gap: 12px; }
.mx-acct-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.mx-acct-head .mx-note { margin-top: 2px; }
.mx-acct-avatars { margin-top: 16px; }
.mx-grid-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr)); gap: 14px 12px; margin: 0; padding: 0; list-style: none; }
.mx-grid-avatars .mx-av img { border-radius: 12px; }
.mx-grid-avatars .mx-av-meta { margin-top: 6px; }
.mx-row.is-plain > .mx-new { width: 52px; }
/* Where a tile's picture comes from: our gallery, or fetched from PlayStation Store. */
.mx-av-tagged { position: relative; }
.mx-tag {
    position: absolute; inset-inline-start: 6px; inset-block-end: 6px;
    padding: 2px 6px; border-radius: 999px;
    font-size: .625rem; font-weight: 700; line-height: 1.3; letter-spacing: .02em;
    color: #fff; background: rgb(0 0 0 / .62);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    pointer-events: none;
}
.mx-tag.is-gallery  { background: color-mix(in srgb, #16a34a 85%, transparent); }
.mx-tag.is-buyable  { background: color-mix(in srgb, #0070d1 88%, transparent); }
.mx-tag.is-plus     { background: color-mix(in srgb, #b8860b 90%, transparent); }
.mx-tag.is-bundle   { background: color-mix(in srgb, #7c3aed 88%, transparent); }
.mx-tag.is-voucher  { background: color-mix(in srgb, #db2777 88%, transparent); }
.mx-tag.is-included { background: color-mix(in srgb, #475569 90%, transparent); }
.mx-tag.is-delisted { background: color-mix(in srgb, #b91c1c 88%, transparent); }
.mx-tag.is-checking { background: rgb(0 0 0 / .55); }
.mx-av-tagged > .mx-new { width: 100%; }
.mx-grid-avatars .mx-tag { inset-inline-start: 4px; inset-block-end: 4px; padding: 1px 5px; font-size: .5625rem; }
.mx-row-thumb { width: 52px; flex: none; }
.mx-row-thumb img { border-radius: 12px; }
.mx-row-thumb .mx-tag { inset-inline-start: 3px; inset-block-end: 3px; padding: 0 4px; font-size: .5rem; }
@media (prefers-reduced-transparency: reduce) { .mx-tag { -webkit-backdrop-filter: none; backdrop-filter: none; } }
.mx-new {
    display: grid; place-items: center; aspect-ratio: 1;
    border: 1px dashed color-mix(in srgb, var(--warn) 60%, transparent); border-radius: 14px;
    font-size: .6875rem; font-weight: 700; color: var(--warn);
}

/* ── Accessibility preferences ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .mx-seg-ind { transition: none; }
    .mx-panel.is-entering { animation: none; }
    .mx-progress::after { animation: none; width: 100%; opacity: .5; translate: none; }
    .mx-spinner { animation-duration: 2.4s; }
    .mx-help > summary svg { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .mx-seg { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--field); }
    html:not(.dark) .mx-seg { background: #f1f5f9; }
}
@media (prefers-contrast: more) {
    .mx { --line: rgba(255, 255, 255, .3); --line-strong: rgba(255, 255, 255, .5); --muted: #cbd5e1; }
    html:not(.dark) .mx { --line: rgba(15, 23, 42, .35); --line-strong: rgba(15, 23, 42, .55); --muted: #334155; }
}
@media (forced-colors: active) {
    .mx-seg-ind { background: Highlight; }
    .mx-seg-btn[aria-selected="true"] { color: HighlightText; }
    .mx-meter > span, .mx-year-bar { background: CanvasText; }
}

/* Guides index */
.mx-guides { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mx-guide { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; text-decoration: none; color: var(--ink); transition: background-color .15s, scale .15s; }
.mx-guide strong { font-weight: 600; }
.mx-guide span { color: var(--ink-2, var(--muted)); font-size: .9rem; line-height: 1.45; }
.mx-guide:hover { background: var(--surface-2); }
.mx-guide:active { scale: var(--press-scale); }
