/* ── 100% saves (/saves) ───────────────────────────────────
   Loaded by Pages/Saves.cshtml (@section Head). Plain CSS on the games.css / fluid.css
   vocabulary (--ease-out, --press-scale, --dur-press). Motion: press and hover feedback,
   and the photo sheet opening (slow in, quick out). Opacity and transform only,
   reduced-motion aware. No inline styles: the CSP forbids them. */

.sv {
    --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);
    --field: #161b22;
    --brand: #D4774E;          /* text and icons: 5.5:1 on the card, 5.9:1 on the page */
    --brand-fill: #B85C30;     /* Buy: white on it 4.55:1 (on #D4774E it was 3.2:1) */
    --brand-ink: #fff;
    --focus: #D4774E;
    --seg: rgba(255, 255, 255, .06);
    --seg-on: #2b3343;
    --chip: rgba(13, 17, 23, .72);
}
html:not(.dark) .sv {
    --ink: #0f172a;
    --muted: #475569;
    --faint: #64748b;
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.14);
    --surface: #ffffff;
    --field: #ffffff;
    --brand: #A3502A;          /* 5.1:1 on the grey page, 5.6:1 on white (#B85C30 was 4.1:1 on the page) */
    --brand-fill: #A3502A;     /* white on it 5.6:1 */
    --focus: #1f2328;
    --seg: rgba(15, 23, 42, .07);
    --seg-on: #ffffff;
}

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

/* ── Header ─────────────────────────────────────────────── */
.sv-hero { margin: 8px 0 32px; max-width: 46rem; }
.sv-kicker {
    margin: 0;
    font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand);
}
.sv-title {
    margin: 10px 0 0;
    font-size: clamp(2rem, 4.6vw, 3.25rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--ink);
    text-wrap: balance;
}
.sv-lede { margin: 14px 0 0; max-width: 38rem; font-size: 1.0625rem; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.sv-promises { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 20px 0 0; padding: 0; list-style: none; }
.sv-promises li { display: inline-flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 600; color: var(--ink); }
.sv-promises svg { width: 20px; height: 20px; flex: none; color: var(--brand); }
[dir="rtl"] .sv-kicker, [dir="rtl"] .sv-kind { letter-spacing: 0; }
html[lang="ar"] .sv-title { line-height: 1.3; letter-spacing: 0; }

/* ── Shared bits ────────────────────────────────────────── */
.sv-kind {
    margin: 0;
    font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--brand);
}
.sv-platforms { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8125rem; }
.sv-checks { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.sv-checks li { display: flex; align-items: flex-start; gap: 9px; font-size: .9375rem; line-height: 1.35; color: var(--ink); min-width: 0; }
.sv-checks svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--brand); }

.sv-buy-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sv-price { margin: 0; font-size: 1.375rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sv-price.is-ask { font-size: .9375rem; font-weight: 600; color: var(--muted); }
/* A Patreon tier's price (the member's own, or Gold as a teaser): the tier named in its trophy
   colour (fluid.css .tier-*), the normal price crossed out with a line in that colour. */
.sv-price.is-member { display: flex; flex-direction: column; gap: 2px; }
.sv-price-tag { font-size: .75rem; font-weight: 700; color: var(--tier); }
.sv-price-line { display: inline-flex; align-items: baseline; gap: 10px; }
.sv-price-was {
    font-size: 1rem; font-weight: 600; color: var(--muted);
    text-decoration-line: line-through; text-decoration-color: var(--tier);
    text-decoration-thickness: 2px;
}
.sv-feature .sv-price-was { font-size: 1.125rem; }
/* Visitors and free members: the teaser's way in, on its own line under the price. */
.sv-join { flex-basis: 100%; margin: -4px 0 0; font-size: .875rem; }
.sv-join-link {
    display: inline-flex; align-items: center; gap: 4px; min-height: 36px;
    color: var(--tier); font-weight: 700; text-decoration: none; border-radius: 6px;
}
.sv-join-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sv-join-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sv-buy svg { width: 17px; height: 17px; flex: none; }
.sv-buy {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 44px; min-width: 96px; padding: 0 22px; border-radius: 999px;
    background: var(--brand-fill); color: var(--brand-ink);
    font-size: .9375rem; font-weight: 700; text-decoration: none;
    transition: transform var(--dur-press) var(--ease-out), background-color 150ms ease;
}
.sv-buy:hover { background: color-mix(in srgb, var(--brand-fill) 88%, #000); }
.sv-buy:active { transform: scale(var(--press-scale)); transition-duration: 100ms; }
.sv-buy:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sv-soon { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .875rem; font-weight: 600; }
.sv-soon svg { width: 16px; height: 16px; flex: none; }

/* A set's name links to its page (/saves/{slug}); so does its picture, hidden from screen readers. */
.sv-name-link { color: inherit; text-decoration: none; border-radius: 6px; }
.sv-name-link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--brand) 60%, transparent); }
.sv-name-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sv-details { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin-top: -4px; font-size: .9375rem; font-weight: 600; color: var(--brand); text-decoration: none; border-radius: 6px; }
.sv-details:hover { text-decoration: underline; text-underline-offset: 3px; }
.sv-details:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.sv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 18px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    color: var(--ink); font-size: .875rem; font-weight: 600; text-decoration: none;
    transition: border-color 150ms ease, background-color 150ms ease, transform var(--dur-press) var(--ease-out);
}
.sv-btn:hover { border-color: var(--brand); }
.sv-btn:active { transform: scale(var(--press-scale)); transition-duration: 100ms; }
.sv-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sv-btn.is-disabled { pointer-events: none; opacity: .3; }
.sv-btn-quiet { border-color: transparent; color: var(--brand); }

/* ── Featured save: picture and details side by side ───── */
.sv-feature {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--surface);
    scroll-margin-top: 96px;
}
.sv-feature-art {
    position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
    background: var(--surface); outline: none;
}
.sv-feature-art img, .sv-art img {
    display: block; width: 100%; height: 100%; object-fit: cover;
    transition: opacity 150ms var(--ease-out), scale 400ms var(--ease-out);
}
.sv-feature-body { display: flex; flex-direction: column; gap: 14px; padding: clamp(20px, 3.4vw, 40px); min-width: 0; }
.sv-feature-name {
    margin: 0;
    font-size: clamp(1.625rem, 3vw, 2.25rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
    color: var(--ink); overflow-wrap: anywhere; text-wrap: balance;
}
.sv-feature-summary { margin: 0; max-width: 34rem; font-size: 1rem; line-height: 1.55; color: var(--muted); }
.sv-feature .sv-buy-row { margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.sv-feature .sv-price { font-size: 1.75rem; }
.sv-feature .sv-price.is-ask { font-size: 1.0625rem; }
.sv-feature .sv-kind { font-size: .8125rem; }
.sv-feature .sv-buy { min-height: 48px; min-width: 120px; font-size: 1rem; }
@media (min-width: 768px) {
    .sv-feature { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    /* The text sets the card's height; the photo fills it rather than stretching it. */
    .sv-feature-art { aspect-ratio: auto; min-height: 360px; }
    .sv-feature-art img { position: absolute; inset: 0; }
    .sv-feature-body { justify-content: center; }
}

/* Store cover only (no photos yet): the square cover sharp in the middle, over a blurred copy
   of itself, like the game page's header. */
.sv-art.is-cover, .sv-feature-art.is-cover { isolation: isolate; }
.is-cover .sv-art-blur {
    position: absolute; inset: 0; z-index: -1;
    filter: blur(28px) saturate(150%); scale: 1.25; opacity: .7;
}
/* 78% of the frame's height (an absolute box resolves the percentage), square, centred. */
.is-cover .sv-art-cover {
    position: absolute; top: 11%; left: 50%; translate: -50% 0;
    width: auto; height: 78%; aspect-ratio: 1; object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 18px 40px -14px rgba(0, 0, 0, .7) !important;
}
html:not(.dark) .is-cover .sv-art-blur { opacity: .55; }
/* The featured set with wide background art: the art, sharp, behind the cover, fading into the card
   on the side the text is (the set page's header, in small). */
.has-scene .sv-art-scene { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 65% center; }

/* Its official cover, smaller, at the end of the name row. */
.sv-feature-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 20px; }
.sv-feature-head-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sv-feature-cover {
    flex: none; width: clamp(84px, 8vw, 112px); aspect-ratio: 1; overflow: hidden; border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 14px 32px -14px rgba(0, 0, 0, .7) !important;
    transition: transform var(--dur-press) var(--ease-out);
}
html:not(.dark) .sv-feature-cover { box-shadow: 0 0 0 1px rgba(15, 23, 42, .08), 0 14px 32px -16px rgba(15, 23, 42, .4) !important; }
.sv-feature-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sv-feature-cover:active { transform: scale(var(--press-scale)); transition-duration: 100ms; }
@media (prefers-reduced-motion: reduce) { .sv-feature-cover:active { transform: none; } }
@media (min-width: 768px) {
    .has-scene .sv-art-scene {
        -webkit-mask-image: linear-gradient(to left, transparent 0%, #000 30%);
        mask-image: linear-gradient(to left, transparent 0%, #000 30%);
    }
    [dir="rtl"] .has-scene .sv-art-scene {
        -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%);
        mask-image: linear-gradient(to right, transparent 0%, #000 30%);
    }
}
@media (max-width: 767px) {
    .has-scene .sv-art-scene {
        -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 30%);
        mask-image: linear-gradient(to top, transparent 0%, #000 30%);
    }
}

/* ── Section heads ──────────────────────────────────────── */
.sv-section { margin-top: clamp(40px, 6vw, 64px); scroll-margin-top: 96px; }
.sv-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.sv-h2 { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.sv-count { margin: 0; font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Toolbar: search + platform switch ─────────────────── */
.sv-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 22px; }
.sv-search { position: relative; flex: 1 1 18rem; min-width: 0; }
.sv-search-icon {
    position: absolute; inset-inline-start: 14px; top: 50%; translate: 0 -50%;
    width: 18px; height: 18px; color: var(--faint); pointer-events: none;
}
.sv-input {
    width: 100%; height: 44px; padding-inline: 42px 40px;
    border: 1px solid var(--line-strong); border-radius: 14px;
    background-color: var(--field); color: var(--ink);
    font: inherit; font-size: 1rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.sv-input::placeholder { color: var(--muted); }
.sv-input::-webkit-search-cancel-button { display: none; }
.sv-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent) !important; }
.sv-clear {
    position: absolute; inset-inline-end: 4px; top: 50%; translate: 0 -50%;
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; color: var(--faint);
}
.sv-clear:hover { color: var(--ink); background: var(--line); }
.sv-clear svg { width: 16px; height: 16px; }

.sv-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--seg); }
.sv-seg a {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 0 16px; border-radius: 999px;
    color: var(--muted); font-size: .875rem; font-weight: 600; text-decoration: none;
    transition: background-color 200ms ease, color 200ms ease, transform var(--dur-press) var(--ease-out);
}
.sv-seg a:hover { color: var(--ink); }
.sv-seg a:active { transform: scale(.96); transition-duration: 100ms; }
.sv-seg a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sv-seg a[aria-current="page"] { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.sv-seg .n { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 639px) {
    .sv-seg { display: flex; flex: 1 1 100%; }
    .sv-seg a { flex: 1; justify-content: center; }
}

/* ── Grid of saves ──────────────────────────────────────── */
.sv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(17.5rem, 100%), 1fr));
    gap: 20px;
    margin: 0; padding: 0; list-style: none;
}
.sv-grid > li { display: flex; min-width: 0; }
.sv-card {
    display: flex; flex-direction: column; flex: 1; min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    scroll-margin-top: 96px;
}
html:not(.dark) .sv-card, html:not(.dark) .sv-feature { box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -16px rgba(15, 23, 42, .18); }
.sv-art { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); outline: none; }
.sv-art.is-empty {
    display: grid; place-items: center;
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 62%),
        var(--surface);
    border-bottom: 1px solid var(--line);
}
.sv-art-initial { font-family: "Exo 2", sans-serif; font-size: 3.5rem; font-weight: 700; line-height: 1; color: color-mix(in srgb, var(--brand) 75%, transparent); }
.sv-art:focus-visible, .sv-feature-art:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
@media (hover: hover) and (pointer: fine) {
    .sv-art:hover :is(.sv-art-photo, .sv-art-cover), .sv-feature-art:hover :is(.sv-art-photo, .sv-art-cover) { scale: 1.03; }
}
.sv-art:active :is(.sv-art-photo, .sv-art-cover), .sv-feature-art:active :is(.sv-art-photo, .sv-art-cover) { opacity: .85; transition-duration: 100ms; }
.sv-photo-count {
    position: absolute; bottom: 10px; inset-inline-start: 10px;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px; border-radius: 999px;
    background: var(--chip); color: #fff;
    font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sv-photo-count svg { width: 14px; height: 14px; }

.sv-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 16px 18px 18px; min-width: 0; }
/* Names and summaries wrap in full: there is no detail page to read the rest on. */
.sv-name { margin: 0; font-size: 1.1875rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
.sv-summary { margin: 0; font-size: .875rem; line-height: 1.5; color: var(--muted); }
.sv-card .sv-checks { margin-top: 2px; }
.sv-more > summary {
    display: inline-flex; align-items: center; min-height: 44px; margin-block: -6px;
    list-style: none; cursor: pointer;
    font-size: .875rem; font-weight: 600; color: var(--brand);
    border-radius: 6px;
}
.sv-more > summary::-webkit-details-marker { display: none; }
.sv-more > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sv-more[open] > summary { display: none; }
.sv-more[open] > .sv-checks { animation: sv-fade 200ms var(--ease-out); }
/* Price and Buy line up along the bottom of every card in a row. */
.sv-card .sv-buy-row { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.sv-card .sv-body > :nth-last-child(2) { margin-bottom: 6px; }

/* ── Empty states ───────────────────────────────────────── */
.sv-empty {
    padding: 56px 20px; text-align: center;
    border: 1px dashed var(--line-strong); border-radius: 22px;
}
.sv-empty-icon { width: 40px; height: 40px; color: var(--faint); }
.sv-empty-title { margin: 12px 0 0; font-size: 1.125rem; font-weight: 700; color: var(--ink); }
.sv-empty-text { margin: 6px auto 20px; max-width: 26rem; font-size: .9375rem; line-height: 1.5; color: var(--muted); }
.sv-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.sv-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; }
.sv-pager-pos { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── How it works ───────────────────────────────────────── */
.sv-steps {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 12px;
    margin: 16px 0 0; padding: 0; list-style: none;
}
.sv-steps li { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.sv-step-n {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
    background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
    font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sv-step-title { margin: 14px 0 0; font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.sv-step-text { margin: 6px 0 0; font-size: .9375rem; line-height: 1.5; color: var(--muted); }
.sv-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; font-size: .875rem; line-height: 1.45; color: var(--muted); }
.sv-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--brand); }

/* ── Questions ──────────────────────────────────────────── */
.sv-faq { display: grid; gap: 10px; margin-top: 16px; max-width: 52rem; }
.sv-faq .fl-disclosure-title.sv-faq-q { font-size: 1rem; font-weight: 600; }
.sv-faq .fl-disclosure > summary { min-height: 56px; }
.sv-faq .fl-disclosure-body p { margin: 0; font-size: .9375rem; line-height: 1.55; color: var(--muted); max-width: 44rem; }

/* ── Ask for a save ─────────────────────────────────────── */
.sv-ask {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
    margin-top: clamp(40px, 6vw, 64px); padding: 22px 24px;
    border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent);
    border-radius: 22px;
    background: color-mix(in srgb, var(--brand) 7%, transparent);
}
.sv-ask-title { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--ink); }
.sv-ask-text { margin: 4px 0 0; font-size: .9375rem; color: var(--muted); }

/* ── Photo sheet (<dialog>, js/saves.js) ────────────────── */
.sv-viewer {
    --ink: #f1f5f9; --muted: #94a3b8; --line: rgba(255, 255, 255, .1); --focus: #D4774E;
    width: min(1080px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #0d1117;
    color: var(--ink);
    overflow: hidden;
    box-shadow: 0 40px 80px -24px rgba(0, 0, 0, .7);
}
html:not(.dark) .sv-viewer { --ink: #0f172a; --muted: #475569; --line: rgba(15, 23, 42, .1); --focus: #1f2328; background: #ffffff; box-shadow: 0 40px 80px -24px rgba(15, 23, 42, .45); }
html:has(.sv-viewer[open]) { overflow: hidden; }   /* the page stays put behind the sheet */
.sv-viewer::backdrop { background: rgba(5, 8, 12, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html:not(.dark) .sv-viewer::backdrop { background: rgba(15, 23, 42, .45); }
/* Arrive slow, leave quick. */
.sv-viewer[open] { animation: sv-in 280ms var(--ease-out); }
.sv-viewer[open]::backdrop { animation: sv-fade 280ms var(--ease-out); }
.sv-viewer.is-closing { animation: sv-out 150ms cubic-bezier(.4, 0, 1, 1) forwards; }
.sv-viewer.is-closing::backdrop { animation: sv-fade-out 150ms cubic-bezier(.4, 0, 1, 1) forwards; }
@keyframes sv-in { from { opacity: 0; scale: .96; } }
@keyframes sv-out { to { opacity: 0; scale: .98; } }
@keyframes sv-fade { from { opacity: 0; } }
@keyframes sv-fade-out { to { opacity: 0; } }

.sv-viewer-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
[dir="rtl"] .sv-viewer-head { padding: 8px 20px 8px 8px; }
.sv-viewer-title { flex: 1; min-width: 0; margin: 0; font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.sv-viewer-pos { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sv-viewer-close {
    display: grid; place-items: center; width: 44px; height: 44px; flex: none;
    border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease, transform var(--dur-press) var(--ease-out);
}
.sv-viewer-close:hover { background: var(--line); color: var(--ink); }
.sv-viewer-close:active { transform: scale(.94); transition-duration: 100ms; }
.sv-viewer-close:focus-visible, .sv-viewer-nav:focus-visible, .sv-viewer-track:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sv-viewer-close svg { width: 20px; height: 20px; }

.sv-viewer-stage { position: relative; background: #000; }
.sv-viewer-track {
    display: flex;
    aspect-ratio: 16 / 10;
    max-height: calc(100dvh - 32px - 62px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.sv-viewer-track::-webkit-scrollbar { display: none; }
.sv-viewer-track img {
    flex: 0 0 100%; width: 100%; height: 100%; min-width: 0;
    object-fit: contain; scroll-snap-align: center; scroll-snap-stop: always;
}
.sv-viewer-nav {
    position: absolute; top: 50%; translate: 0 -50%;
    display: grid; place-items: center; width: 44px; height: 44px;
    border: 0; border-radius: 999px; cursor: pointer;
    background: rgba(13, 17, 23, .62); color: #fff;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    transition: opacity 150ms ease, transform var(--dur-press) var(--ease-out);
}
.sv-viewer-nav:active { transform: scale(.94); transition-duration: 100ms; }
.sv-viewer-nav:disabled { opacity: 0; pointer-events: none; }
.sv-viewer-nav[hidden] { display: none; }
.sv-viewer-nav svg { width: 20px; height: 20px; }
.sv-viewer-nav.is-prev { inset-inline-start: 12px; }
.sv-viewer-nav.is-next { inset-inline-end: 12px; }
[dir="rtl"] .sv-viewer-nav svg { scale: -1 1; }
/* Phones: photos get the whole screen. Swipe or use the buttons. */
@media (max-width: 639px) {
    .sv-viewer {
        width: 100vw; height: 100dvh; max-height: none; margin: 0; inset: 0;
        border: 0; border-radius: 0; background: #000; color: #f1f5f9;
        --ink: #f1f5f9; --muted: #94a3b8; --line: rgba(255, 255, 255, .1); --focus: #D4774E;
    }
    html:not(.dark) .sv-viewer { background: #000; --ink: #f1f5f9; --muted: #94a3b8; --line: rgba(255, 255, 255, .1); --focus: #D4774E; }
    .sv-viewer[open] { display: flex; flex-direction: column; }
    .sv-viewer-head { padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 0; }
    .sv-viewer-stage { flex: 1; min-height: 0; display: flex; }
    .sv-viewer-track { flex: 1; aspect-ratio: auto; max-height: none; }
    .sv-viewer-nav { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); translate: none; }
}

/* ── Preferences ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .sv-art:hover :is(.sv-art-photo, .sv-art-cover), .sv-feature-art:hover :is(.sv-art-photo, .sv-art-cover) { scale: none; }
    .sv-viewer[open] { animation: sv-fade 200ms ease; }
    .sv-viewer.is-closing { animation: sv-fade-out 120ms ease forwards; }
    .sv-buy:active, .sv-btn:active, .sv-seg a:active, .sv-viewer-close:active, .sv-viewer-nav:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .sv-photo-count, .sv-viewer-nav { background: #0d1117; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .sv-viewer::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(5, 8, 12, .9); }
    .is-cover .sv-art-blur { display: none; }
}
@media (prefers-contrast: more) {
    .sv, html:not(.dark) .sv { --line: rgba(127, 127, 127, .5); --line-strong: rgba(127, 127, 127, .7); }
}
@media (forced-colors: active) {
    .sv-seg a[aria-current="page"] { outline: 2px solid CanvasText; }
    .sv-buy { border: 1px solid ButtonText; }
}
