/* ==========================================================================
   RareFinds theme — BASE + COMPONENTS + PAGE LAYOUTS
   Only uses tokens from tokens.css (+ direction overrides). No hard-coded
   colours below except the prototype demo bar.
   ========================================================================== */

/* ---------- 1. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: var(--fs-m); line-height: var(--body-leading);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 0;
  display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(button, [role="button"]) { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
::selection { background: color-mix(in oklab, var(--brand) 30%, transparent); }

:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  background: var(--color-text); color: var(--color-bg); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-s); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 820px; }
.stack > * + * { margin-top: var(--space-4); }
.muted { color: var(--color-muted); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---------- 2. Type ---------- */
.display, h1, .h1, .section__title, .hero__title {
  font-family: var(--font-display); font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking); line-height: var(--display-leading);
  text-transform: var(--display-case); text-wrap: balance;
}
h1, .h1 { font-size: var(--fs-3xl); }
h2, .h2 { font-size: var(--fs-2xl); font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.1; text-transform: var(--display-case); text-wrap: balance; }
h3, .h3 { font-size: var(--fs-l); font-weight: 600; line-height: 1.3; }
.lead { font-size: var(--fs-l); color: var(--color-muted); max-width: 60ch; text-wrap: pretty; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-xs); font-weight: var(--label-weight); letter-spacing: var(--label-tracking);
  text-transform: var(--label-case); color: var(--color-muted);
}
.prose { max-width: 68ch; }
.prose p, .prose ul, .prose ol { margin-block: 0 var(--space-4); }
.prose h2 { margin-block: var(--space-7) var(--space-4); font-size: var(--fs-xl); }
.prose h3 { margin-block: var(--space-5) var(--space-2); }
.prose li + li { margin-top: var(--space-2); }
.prose a { color: var(--brand-ink); }

/* ---------- 3. Buttons & controls ---------- */
.btn, .buy-btn {
  --_bg: var(--color-surface); --_fg: var(--color-text); --_bd: var(--color-border);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 var(--space-5);
  background: var(--_bg); color: var(--_fg); border: var(--border-w) solid var(--_bd);
  border-radius: var(--radius-btn); font-weight: 600; font-size: var(--fs-s); line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:hover { border-color: var(--color-text); }
.btn:active, .buy-btn:active { transform: translateY(1px); }
.btn--primary { --_bg: var(--brand); --_fg: var(--on-brand); --_bd: var(--brand); }
.btn--primary:hover { --_bg: color-mix(in oklab, var(--brand) 86%, var(--color-text)); border-color: var(--_bg); }
.btn--ghost { --_bg: transparent; --_bd: transparent; }
.btn--ghost:hover { --_bg: var(--color-surface-2); border-color: transparent; }
.btn--l { min-height: 52px; font-size: var(--fs-m); padding-inline: var(--space-6); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: var(--tap); }
.btn svg, .buy-btn svg, .icon-btn svg { width: 20px; height: 20px; flex: none; }

/* LOCKED component: markup + behaviour come from the RareFinds plugin;
   the theme may only style it through tokens. */
.buy-btn { --_bg: var(--brand); --_fg: var(--on-brand); --_bd: var(--brand); min-height: 52px; font-size: var(--fs-m); padding-inline: var(--space-6); }
.buy-btn:hover { --_bg: color-mix(in oklab, var(--brand) 86%, var(--color-text)); border-color: var(--_bg); }
.buy-btn--now { --_bg: var(--color-text); --_fg: var(--color-bg); --_bd: var(--color-text); }
.buy-btn--now:hover { --_bg: color-mix(in oklab, var(--color-text) 85%, var(--color-bg)); border-color: var(--_bg); }
.buy-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap); border-radius: var(--radius-btn);
  background: transparent; border: 0; color: var(--color-text);
}
.icon-btn:hover { background: var(--color-surface-2); }
.icon-btn .count {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--brand); color: var(--on-brand);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

.field { display: grid; gap: var(--space-2); }
.field > span, .label { font-size: var(--fs-s); font-weight: 600; }
.input, .select {
  width: 100%; min-height: var(--tap); padding: 0 var(--space-3);
  background: var(--color-surface); color: var(--color-text);
  border: var(--border-w) solid var(--color-border); border-radius: var(--radius-s);
}
.input::placeholder { color: var(--color-muted); }
.input:hover, .select:hover { border-color: color-mix(in oklab, var(--color-text) 40%, var(--color-border)); }
.select { appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 20px; height: 20px; margin: 0; flex: none; }

.check {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap);
  font-size: var(--fs-s); cursor: pointer; border-radius: var(--radius-s);
}
.check .n { margin-left: auto; color: var(--color-muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.check:has(input:disabled) { color: var(--color-muted); cursor: default; }

.switch { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--tap); cursor: pointer; font-size: var(--fs-s); font-weight: 500; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--color-surface-2); border: 1px solid var(--color-border); position: relative; transition: background var(--dur-2) var(--ease); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--color-surface); box-shadow: var(--shadow-1); transition: transform var(--dur-2) var(--ease); }
.switch input:checked { background: var(--brand); border-color: var(--brand); }
.switch input:checked::after { transform: translateX(16px); background: var(--on-brand); }

.stepper { display: inline-flex; align-items: center; border: var(--border-w) solid var(--color-border); border-radius: var(--radius-btn); background: var(--color-surface); }
.stepper button { width: var(--tap); height: var(--tap); border: 0; background: transparent; font-size: 20px; line-height: 1; border-radius: var(--radius-btn); }
.stepper button:disabled { color: var(--color-muted); opacity: .5; cursor: default; }
.stepper output { min-width: 2.5ch; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 4. Small atoms: badge, chip, stock, price ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border-radius: var(--radius-pill); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .04em; line-height: 1.4;
  background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-1); white-space: nowrap;
}
.badge--grade { background: var(--color-text); color: var(--color-bg); box-shadow: none; }
.badge--new { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.badge--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .badge--live::before { animation: none; } }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; min-height: 22px;
  border: 1px solid var(--color-border); border-radius: var(--radius-s);
  font-size: var(--fs-xs); font-weight: 600; color: var(--color-muted); white-space: nowrap;
}
.chip--strong { color: var(--color-text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.stock { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.stock--in { color: var(--color-stock); }
.stock--in::before, .stock--low::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.stock--low { color: var(--color-notice); }
.stock--sold { color: var(--color-sold); background: var(--color-sold-bg); padding: 2px 8px; border-radius: var(--radius-pill); }

.price { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.price--sold { color: var(--color-muted); font-weight: 500; }
.price--xl { font-size: var(--fs-2xl); line-height: 1; letter-spacing: -0.01em; }

/* ---------- 5. Prototype demo bar (not part of the theme) ---------- */
.demo-bar {
  position: relative; z-index: 50; background: #0e0f12; color: #e9eaee; font: 500 12px/1.3 system-ui, -apple-system, sans-serif;
  border-bottom: 1px solid #23252b;
}
.demo-bar__in { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px var(--gutter); max-width: none; flex-wrap: wrap; }
.demo-bar b { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9aa0ab; font-size: 11px; }
.demo-bar a { color: #fff; }
.demo-bar label { display: inline-flex; align-items: center; gap: 6px; color: #9aa0ab; }
.demo-bar select { background: #1b1d23; color: #fff; border: 1px solid #33363e; border-radius: 6px; min-height: 32px; padding: 0 8px; font-size: 12px; }
.demo-bar .demo-bar__home { margin-left: auto; text-decoration: none; font-weight: 600; padding: 6px 10px; border-radius: 6px; background: #1b1d23; }
[data-demo="off"] .demo-bar { display: none; }
@media (max-width: 640px) {
  .demo-bar__in { gap: 6px; }
  .demo-bar b, .demo-bar .demo-bar__lbl { display: none; }
  .demo-bar select { max-width: 112px; }
}

/* ---------- 6. Logo (owner's logo or generated placeholder) ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-text); min-height: var(--tap); }
.logo__mark {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  background: var(--brand); color: var(--on-brand); font: 700 14px/1 var(--font-body); letter-spacing: .02em;
}
.logo__mark[data-mark="circle"] { border-radius: 50%; }
.logo__mark[data-mark="square"] { border-radius: 10px; }
.logo__mark[data-mark="diamond"] { width: 30px; height: 30px; transform: rotate(45deg); border-radius: 6px; margin-inline: 3px; }
.logo__mark[data-mark="diamond"] > span { transform: rotate(-45deg); }
.logo__word { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.3rem; letter-spacing: var(--display-tracking); text-transform: var(--display-case); line-height: 1; white-space: nowrap; }
[data-direction="arena"] .logo__word { font-size: 1.55rem; }
.logo__img { max-height: 40px; width: auto; max-width: 180px; object-fit: contain; }

/* ---------- 7. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: color-mix(in oklab, var(--color-bg) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: var(--border-w) solid var(--color-border);
}
.site-header__bar { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; }
.site-header__menu { margin-left: -10px; }
.site-header__actions { display: flex; align-items: center; gap: 2px; margin-left: auto; margin-right: -10px; }
.site-search { position: relative; flex: 1; max-width: 560px; margin-inline: auto; display: none; }
.site-search input { padding-left: 42px; border-radius: var(--radius-btn); background: var(--color-surface); }
.site-search svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.site-nav { display: none; }
.site-nav ul { display: flex; gap: var(--space-5); align-items: center; }
.site-nav a { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; font-size: var(--fs-s); font-weight: 500; color: var(--color-muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--color-text); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.site-header__live { margin-left: auto; font-size: var(--fs-xs); color: var(--color-muted); display: inline-flex; gap: var(--space-2); align-items: center; }
.site-header__live a { color: var(--color-text); font-weight: 600; }
.site-header__row2 { display: none; }
@media (min-width: 960px) {
  .site-header__menu, .js-search-open { display: none !important; }
  .site-search { display: block; }
  .site-header__row2 { display: flex; align-items: center; min-height: 48px; border-top: var(--border-w) solid var(--color-border); }
  .site-nav { display: block; }
}
@media (max-width: 959px) {
  .logo__word { font-size: 1.15rem; }
  [data-direction="arena"] .logo__word { font-size: 1.35rem; }
  .site-header__bar { min-height: 56px; }
}
@media (max-width: 380px) { .logo__mark { width: 32px; height: 32px; } }

/* ---------- 8. Sheets / drawers (native <dialog>) ---------- */
.sheet {
  margin: 0; padding: 0; border: 0; max-width: none; max-height: none;
  background: var(--color-bg); color: var(--color-text);
}
.sheet:not([open]) { display: none !important; }
.sheet::backdrop { background: var(--color-overlay); }
.sheet--left, .sheet--right { position: fixed; inset: 0 auto 0 0; width: min(88vw, 380px); height: 100%; height: 100dvh; display: flex; flex-direction: column; }
.sheet--right { inset: 0 0 0 auto; }
.sheet--top { position: fixed; inset: 0 0 auto 0; width: 100%; }
.sheet[open] { animation: sheet-in var(--dur-2) var(--ease); }
.sheet--left[open] { animation-name: sheet-left; }
.sheet--right[open] { animation-name: sheet-right; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes sheet-left { from { transform: translateX(-24px); opacity: 0; } }
@keyframes sheet-right { from { transform: translateX(24px); opacity: 0; } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5); min-height: 60px; border-bottom: 1px solid var(--color-border); }
.sheet__head h2 { font-size: var(--fs-l); font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-weight: 700; }
.sheet__body { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-5); overscroll-behavior: contain; }
.sheet__foot { padding: var(--space-3) var(--space-5) calc(var(--space-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--color-border); display: flex; gap: var(--space-3); }
.menu-list { display: grid; }
.menu-list a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; text-decoration: none; font-size: var(--fs-l); font-weight: 600; border-bottom: 1px solid var(--color-border); }
.menu-list a span { font-size: var(--fs-s); font-weight: 500; color: var(--color-muted); }
.search-sheet { padding: var(--space-3) var(--gutter) var(--space-5); }
.search-sheet form { display: flex; gap: var(--space-2); align-items: center; }
.search-sheet .input { min-height: 52px; font-size: var(--fs-m); }
.search-sheet__hints { margin-top: var(--space-4); }
.search-sheet__hints .chips a { min-height: 36px; padding: 0 12px; text-decoration: none; color: var(--color-text); }

/* ---------- 9. Breadcrumbs ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 0; list-style: none; padding: 0; margin: 0; font-size: var(--fs-xs); color: var(--color-muted); }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "/"; margin-inline: 8px; opacity: .6; }
.crumbs a { text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.crumbs a:hover { color: var(--color-text); text-decoration: underline; }
.crumbs [aria-current] { color: var(--color-text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

/* ---------- 10. Product card ---------- */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-3); list-style: none; padding: 0; margin: 0; }
@media (min-width: 600px) { .pgrid { grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), 1fr)); gap: var(--space-6) var(--space-4); } }
.pgrid--wide { }
@media (min-width: 1200px) { .pgrid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .pgrid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.pcard {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--card-bg); border: var(--border-w) solid var(--card-border); border-radius: var(--card-radius);
  padding: var(--card-pad); box-shadow: var(--card-shadow);
  transition: box-shadow var(--dur-2) var(--ease);
}
.pcard__media {
  position: relative; display: grid; place-items: center; aspect-ratio: var(--media-ratio);
  padding: var(--media-pad); background: var(--media-bg); border-radius: var(--media-radius); overflow: hidden;
}
.pcard__media img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .18)); transition: transform var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease); }
.pcard[data-kind="graded"] .pcard__media { padding-block: calc(var(--media-pad) * .6); }
.pcard[data-kind="sealed"] .pcard__media { padding: calc(var(--media-pad) * .7); }
.pcard__badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0; z-index: 1; }
.pcard__body { display: flex; flex-direction: column; gap: 4px; padding: var(--space-3) 2px 0; flex: 1; }
.pcard__title { font-size: var(--fs-s); font-weight: 600; line-height: 1.3; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pcard__link { text-decoration: none; color: inherit; }
.pcard__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--card-radius); }
.pcard__link:focus-visible { outline: none; }
.pcard__link:focus-visible::after { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.pcard__meta { font-size: var(--fs-xs); color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard__foot { display: flex; align-items: center; gap: var(--space-2); margin-top: auto; padding-top: 6px; min-height: var(--tap); }
.pcard__foot .price { font-size: var(--fs-m); }
.pcard__foot .stock { margin-right: auto; }
.pcard__add {
  position: relative; z-index: 2; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: -4px -6px -4px 0;
  border-radius: var(--radius-btn); border: var(--border-w) solid var(--color-border); background: var(--color-surface); color: var(--color-text);
}
.pcard__add:hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.pcard__add[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.pcard__add svg { width: 18px; height: 18px; }
.pcard__price-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.pcard[data-state="sold"] .pcard__media img { opacity: .5; filter: saturate(.35); }
.pcard[data-state="sold"] .pcard__title { color: var(--color-muted); }
@media all {
  .pcard__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "price add" "stock add"; gap: 2px var(--space-2); align-items: center; }
  .pcard__foot .price { grid-area: price; }
  .pcard__foot .stock { grid-area: stock; justify-self: start; }
  .pcard__add { grid-area: add; margin: 0 -2px 0 0; }
}

/* ---------- 11. Sections ---------- */
.section { padding-block: var(--section-gap); }
.section + .section { padding-top: 0; }
.section--tinted + .section, .section + .section--tinted { padding-top: var(--section-gap); }
.section--tinted { background: var(--color-surface-2); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.section__head .eyebrow { margin-bottom: var(--space-2); }
.section__title { font-size: var(--fs-2xl); }
.section__more { font-size: var(--fs-s); font-weight: 600; color: var(--brand-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); }
.section__more:hover { text-decoration: underline; }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 44%); gap: var(--space-3);
  overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) var(--space-3);
  scrollbar-width: thin; list-style: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 600px) { .rail { grid-auto-columns: minmax(180px, 30%); } }
@media (min-width: 1100px) { .rail { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; gap: var(--space-6) var(--space-4); } }

/* ---------- 12. Hero ---------- */
.hero { overflow: hidden; }
.hero__inner { display: grid; gap: var(--space-6); padding-block: var(--space-7) var(--space-7); align-items: center; }
.hero__copy { display: grid; gap: var(--space-4); justify-items: start; }
.hero__title { font-size: var(--fs-4xl); max-width: 14ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.hero__facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-3); padding: 0; list-style: none; font-size: var(--fs-s); color: var(--color-muted); }
.hero__facts li { display: inline-flex; gap: 8px; align-items: center; }
.hero__facts svg { width: 16px; height: 16px; color: var(--brand-ink); }
.fan { position: relative; aspect-ratio: 5 / 4; width: 100%; max-width: 560px; justify-self: center; }
.fan__card { position: absolute; top: 50%; left: 50%; width: 42%; transform-origin: 50% 100%; text-decoration: none; }
.fan__card img { width: 100%; height: auto; border-radius: 4.5%/3.2%; box-shadow: var(--shadow-art); }
.fan__card:nth-child(1) { transform: translate(-112%, -46%) rotate(-12deg); }
.fan__card:nth-child(2) { transform: translate(-50%, -54%); z-index: 2; }
.fan__card:nth-child(3) { transform: translate(12%, -46%) rotate(12deg); }
.fan__caption { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: var(--fs-xs); color: var(--color-muted); }
@media (min-width: 960px) {
  .hero__inner { grid-template-columns: 1.05fr .95fr; gap: var(--space-8); padding-block: var(--space-8); }
}
@media (max-width: 599px) {
  .hero__inner { padding-block: var(--space-6) var(--space-6); gap: var(--space-5); }
  .fan { max-width: 360px; }
}
/* direction variations on the same markup */
[data-direction="galleri"] .fan { aspect-ratio: 4 / 4.4; background: var(--color-mat); max-width: 520px; }
[data-direction="galleri"] .fan__card:nth-child(1), [data-direction="galleri"] .fan__card:nth-child(3) { display: none; }
[data-direction="galleri"] .fan__card:nth-child(2) { width: 50%; transform: translate(-50%, -56%); }
[data-direction="galleri"] .fan__card img { border-radius: 4.5%/3.2%; }
[data-direction="galleri"] .fan__caption { bottom: 18px; font-family: var(--font-display); font-style: italic; font-size: var(--fs-s); color: var(--color-text); }
[data-direction="parm"] .hero { padding-top: var(--space-4); }
[data-direction="parm"] .hero__inner { padding: var(--space-6) var(--space-5); margin-inline: var(--gutter); max-width: calc(var(--container) - var(--gutter) * 2); width: auto; }
@media (min-width: 1400px) { [data-direction="parm"] .hero__inner { margin-inline: auto; } }
@media (min-width: 960px) { [data-direction="parm"] .hero__inner { padding: var(--space-8) var(--space-8); } }
[data-direction="parm"] .fan__card:nth-child(1) { transform: translate(-108%, -50%) rotate(-6deg); }
[data-direction="parm"] .fan__card:nth-child(3) { transform: translate(8%, -50%) rotate(6deg); }

/* ---------- 13. Category tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); list-style: none; padding: 0; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); } }
.tile { position: relative; display: grid; align-content: space-between; gap: var(--space-4); min-height: 168px; padding: var(--space-4);
  background: var(--color-surface); border: var(--border-w) solid var(--color-border); border-radius: var(--radius-l); text-decoration: none; overflow: hidden; }
.tile:hover { border-color: var(--brand-line); }
.tile__label { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--fs-xl); line-height: 1.05; text-transform: var(--display-case); letter-spacing: var(--display-tracking); position: relative; z-index: 1; max-width: 9ch; }
.tile__count { font-size: var(--fs-xs); color: var(--color-muted); position: relative; z-index: 1; }
.tile__art { position: absolute; right: -6%; bottom: -14%; width: 46%; transform: rotate(10deg); }
.tile__art img { width: 100%; border-radius: 4%; box-shadow: var(--shadow-art); }
@media (min-width: 900px) { .tile { min-height: 220px; padding: var(--space-5); } }

/* ---------- 14. Stream / about blocks ---------- */
.feature { display: grid; gap: var(--space-6); align-items: center; padding: var(--space-6); border-radius: var(--radius-l); background: var(--color-surface); border: var(--border-w) solid var(--color-border); }
@media (min-width: 900px) { .feature { grid-template-columns: 1.2fr 1fr; padding: var(--space-8); } }
.feature--brand { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.feature--brand .eyebrow, .feature--brand .muted, .feature--brand .lead { color: inherit; opacity: .86; }
.feature--brand .btn { --_bg: var(--on-brand); --_fg: var(--brand); --_bd: var(--on-brand); }
.feature--brand .btn--ghost { --_bg: transparent; --_fg: var(--on-brand); --_bd: color-mix(in oklab, var(--on-brand) 45%, transparent); }
.feature--brand .btn--ghost:hover { --_bg: color-mix(in oklab, var(--on-brand) 12%, transparent); border-color: var(--on-brand); }
.schedule { display: grid; gap: 0; list-style: none; padding: 0; border-top: 1px solid color-mix(in oklab, currentColor 22%, transparent); }
.schedule li { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid color-mix(in oklab, currentColor 22%, transparent); font-size: var(--fs-s); }
.schedule b { font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); list-style: none; padding: 0; }
.facts b { display: block; font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--fs-2xl); line-height: 1; text-transform: var(--display-case); letter-spacing: var(--display-tracking); margin-bottom: 6px; }
.facts span { font-size: var(--fs-s); color: var(--color-muted); }

/* ---------- 15. Footer ---------- */
.site-footer { margin-top: var(--section-gap); border-top: var(--border-w) solid var(--color-border); background: var(--color-surface); font-size: var(--fs-s); }
.site-footer__grid { display: grid; gap: var(--space-6); padding-block: var(--space-7); }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h2 { font-family: var(--font-body); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--color-muted); font-weight: 600; margin-bottom: var(--space-3); }
.site-footer ul { list-style: none; padding: 0; display: grid; }
.site-footer li a { display: inline-flex; min-height: 36px; align-items: center; text-decoration: none; }
.site-footer li a:hover { text-decoration: underline; }
.site-footer address { font-style: normal; color: var(--color-muted); margin-top: var(--space-3); line-height: 1.6; }
.site-footer__bottom { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); justify-content: space-between; align-items: center; padding-block: var(--space-4) var(--space-6); border-top: var(--border-w) solid var(--color-border); color: var(--color-muted); font-size: var(--fs-xs); }
.paylist { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.paylist li { padding: 3px 9px; border: 1px solid var(--color-border); border-radius: var(--radius-s); font-weight: 600; color: var(--color-text); font-size: var(--fs-xs); }
.site-footer__note { font-size: var(--fs-xs); }

/* ---------- 16. Toast ---------- */
.toast-region { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
body.has-buybar .toast-region { bottom: calc(96px + env(safe-area-inset-bottom)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--space-3); padding: 10px 10px 10px 16px; background: var(--color-text); color: var(--color-bg); border-radius: var(--radius-m); box-shadow: var(--shadow-2); font-size: var(--fs-s); font-weight: 500; animation: toast-in var(--dur-2) var(--ease); }
.toast a { margin-left: auto; color: inherit; font-weight: 700; white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: var(--radius-s); background: color-mix(in oklab, var(--color-bg) 16%, transparent); text-decoration: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 17. Catalog (category / search) ---------- */
.page-head { padding-block: var(--space-5) var(--space-5); display: grid; gap: var(--space-3); }
.page-head h1 { font-size: var(--fs-3xl); }
.catalog { display: grid; gap: var(--space-6); padding-bottom: var(--space-7); }
@media (min-width: 1024px) { .catalog { grid-template-columns: 264px minmax(0, 1fr); gap: var(--space-7); align-items: start; } }
.catalog__aside { display: none; }
@media (min-width: 1024px) {
  .catalog__aside { display: block; position: sticky; top: 132px; max-height: calc(100vh - 148px); overflow-y: auto; padding-right: var(--space-3); scrollbar-width: thin; }
  .js-filter-open { display: none !important; }
}
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.toolbar__count { font-size: var(--fs-s); color: var(--color-muted); margin-right: auto; }
.toolbar__count b { color: var(--color-text); }
.toolbar .select { width: auto; min-width: 180px; }
.toolbar__row { display: flex; gap: var(--space-2); width: 100%; }
@media (max-width: 1023px) { .toolbar__row .select { flex: 1; min-width: 0; } .toolbar__row .btn { flex: 1; } }
@media (min-width: 1024px) { .toolbar__row { width: auto; } }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-5); }
.active-filters:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px 0 12px; border-radius: var(--radius-pill); background: var(--color-surface-2); border: 1px solid var(--color-border); font-size: var(--fs-xs); font-weight: 600; }
.fchip svg { width: 14px; height: 14px; }
.fchip--clear { background: transparent; border-color: transparent; text-decoration: underline; padding-inline: 8px; color: var(--color-muted); }
.typetabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.typetabs::-webkit-scrollbar { display: none; }
.typetabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); text-decoration: none; font-size: var(--fs-s); font-weight: 600; white-space: nowrap; background: var(--color-surface); }
.typetabs a[aria-current="true"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.typetabs a span { font-weight: 500; opacity: .7; font-size: var(--fs-xs); }
@media (min-width: 1024px) { .typetabs { margin-inline: 0; padding-inline: 0; } }

.filters { display: grid; gap: 0; }
.fgroup { border-bottom: 1px solid var(--color-border); }
.fgroup summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; cursor: pointer; list-style: none; font-weight: 600; font-size: var(--fs-s); }
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform var(--dur-2) var(--ease); margin-right: 4px; }
.fgroup[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.fgroup summary .sel { margin-left: auto; margin-right: 12px; font-size: var(--fs-xs); color: var(--brand-ink); font-weight: 600; }
.fgroup__body { padding-bottom: var(--space-4); }
.fgroup__list { display: grid; list-style: none; padding: 0; }
.fgroup__list--scroll { max-height: 264px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.fgroup__sub { font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--color-muted); padding: var(--space-3) 0 2px; }
.fgroup__find { margin-bottom: var(--space-2); }
.fgroup__find .input { min-height: 40px; font-size: var(--fs-s); }
.price-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-2); align-items: center; }
.price-range .input { text-align: right; }
.price-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-3); }
.price-presets button { min-height: 36px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-surface); font-size: var(--fs-xs); font-weight: 600; }
.price-presets button[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.filters__sold { padding-block: var(--space-3); border-bottom: 1px solid var(--color-border); }
.filters__sold p { font-size: var(--fs-xs); color: var(--color-muted); margin-top: 2px; }
.more-row { display: grid; justify-items: center; gap: var(--space-3); margin-top: var(--space-7); }
.more-row progress { width: 200px; height: 4px; appearance: none; border: 0; border-radius: 4px; background: var(--color-surface-2); overflow: hidden; }
.more-row progress::-webkit-progress-bar { background: var(--color-surface-2); }
.more-row progress::-webkit-progress-value { background: var(--color-text); }
.more-row progress::-moz-progress-bar { background: var(--color-text); }
.more-row p { font-size: var(--fs-xs); color: var(--color-muted); }
.empty { display: grid; justify-items: center; gap: var(--space-3); text-align: center; padding: var(--space-8) var(--space-4); border: 1px dashed var(--color-border); border-radius: var(--radius-l); }
.empty h2 { font-size: var(--fs-xl); }
.empty p { color: var(--color-muted); max-width: 44ch; }

/* ---------- 18. Product page ---------- */
.rf-product { display: grid; gap: var(--space-6); padding-block: var(--space-4) var(--space-7); }
@media (min-width: 960px) { .rf-product { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: var(--space-8); align-items: start; } }
.gallery { display: grid; gap: var(--space-3); }
@media (min-width: 960px) { .gallery { position: sticky; top: 132px; } }
.gallery__stage { position: relative; aspect-ratio: 1 / 1; background: var(--media-bg); border-radius: var(--media-radius); perspective: 1800px; overflow: hidden; }
@media (max-width: 599px) { .gallery__stage { aspect-ratio: 1 / 1; margin-inline: calc(var(--gutter) * -1); border-radius: 0; } [data-direction="arena"] .gallery__stage, [data-direction="parm"] .gallery__stage { margin-inline: 0; border-radius: var(--media-radius); } }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform var(--dur-3) var(--ease-flip); }
.flip[data-face="back"] { transform: rotateY(180deg); }
.flip__face { position: absolute; inset: 0; display: grid; place-items: center; padding: 9% 14%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip__face img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 24px rgb(0 0 0 / .22)); }
.flip__face--back { transform: rotateY(180deg); }
.rf-product[data-kind="graded"] .flip__face { padding: 5% 18%; }
.rf-product[data-kind="sealed"] .flip__face { padding: 8%; }
@media (prefers-reduced-motion: reduce) {
  .flip, .flip[data-face="back"] { transform: none; }
  .flip__face--back { transform: none; opacity: 0; visibility: hidden; }
  .flip[data-face="back"] .flip__face--back { opacity: 1; visibility: visible; }
  .flip[data-face="back"] .flip__face--front { opacity: 0; visibility: hidden; }
}
.gallery__zoom { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--color-surface); box-shadow: var(--shadow-1); }
.gallery__sold { position: absolute; left: 12px; top: 12px; z-index: 2; }
.gallery__bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.thumbs { display: flex; gap: var(--space-2); list-style: none; padding: 0; }
.thumbs button { display: grid; gap: 4px; justify-items: center; padding: 6px; width: 76px; border-radius: var(--radius-s); border: 2px solid transparent; background: var(--media-bg); font-size: var(--fs-2xs); font-weight: 600; color: var(--color-muted); }
.thumbs button[aria-pressed="true"] { border-color: var(--color-text); color: var(--color-text); }
.thumbs img { height: 54px; width: 100%; object-fit: contain; }
.gallery__flip { margin-left: auto; }
.gallery__note { font-size: var(--fs-xs); color: var(--color-muted); display: flex; gap: 8px; align-items: center; }
.gallery__note svg { width: 16px; height: 16px; flex: none; }

.pinfo { display: grid; gap: var(--space-5); align-content: start; }
.pinfo__head { display: grid; gap: var(--space-3); }
.pinfo h1 { font-size: var(--fs-2xl); line-height: 1.12; overflow-wrap: anywhere; }
[data-direction="arena"] .pinfo h1 { font-size: var(--fs-3xl); line-height: .98; }
.pinfo__sub { font-size: var(--fs-s); color: var(--color-muted); }
.pinfo__price { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.buybox { display: grid; gap: var(--space-3); }
.buybox__row { display: grid; grid-template-columns: 1fr; gap: var(--space-2); }
@media (min-width: 600px) { .buybox__row { grid-template-columns: 1fr 1fr; } }
.buybox__qty { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-s); }
.buybox__unique { font-size: var(--fs-xs); color: var(--color-muted); display: flex; gap: 8px; align-items: center; }
.buybox__unique svg { width: 16px; height: 16px; flex: none; color: var(--brand-ink); }
.soldbox { display: grid; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius-m); background: var(--color-surface-2); }
.soldbox h2 { font-size: var(--fs-l); font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-weight: 700; }
.soldbox p { font-size: var(--fs-s); color: var(--color-muted); }
.soldbox .btns { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ship { display: grid; gap: 0; border: var(--border-w) solid var(--color-border); border-radius: var(--radius-m); list-style: none; padding: 0; background: var(--color-surface); }
.ship li { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); font-size: var(--fs-s); align-items: flex-start; }
.ship li + li { border-top: var(--border-w) solid var(--color-border); }
.ship svg { width: 20px; height: 20px; flex: none; color: var(--brand-ink); margin-top: 1px; }
.ship b { font-weight: 600; }
.ship span { color: var(--color-muted); }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 0 var(--space-5); font-size: var(--fs-s); }
.specs dt, .specs dd { padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.specs dt { color: var(--color-muted); }
.specs dd { font-weight: 500; overflow-wrap: anywhere; }
.specs dd a { color: var(--brand-ink); }
.disclosure { border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.disclosure summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 600; font-size: var(--fs-s); list-style: none; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: "+"; font-size: 20px; font-weight: 400; }
.disclosure[open] summary::after { content: "–"; }
.disclosure__body { padding-bottom: var(--space-4); font-size: var(--fs-s); }
.cond-list { display: grid; gap: var(--space-3); list-style: none; padding: 0; }
.cond-list li { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-3); align-items: start; }
.cond-list li[aria-current="true"] .chip { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.cond-list p { color: var(--color-muted); }
.cond-list b { color: var(--color-text); }

.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-buybar);
  display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--color-bg) 96%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: var(--border-w) solid var(--color-border); box-shadow: 0 -8px 24px rgb(0 0 0 / .08);
  transform: translateY(110%); transition: transform var(--dur-2) var(--ease); }
.buybar.is-visible { transform: none; }
.buybar__info { min-width: 0; flex: 1; display: grid; }
.buybar__title { font-size: var(--fs-xs); color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar .price { font-size: var(--fs-l); }
.buybar .buy-btn { min-height: 48px; padding-inline: var(--space-5); }
@media (min-width: 960px) { .buybar { display: none; } }

.zoom { width: 100vw; height: 100vh; height: 100dvh; background: var(--color-bg); display: grid; grid-template-rows: auto 1fr; }
.zoom__img { display: grid; place-items: center; padding: var(--space-4); overflow: auto; }
.zoom__img img { width: 100%; height: calc(100dvh - 120px); object-fit: contain; }

/* ---------- 19. Cart, checkout, thanks ---------- */
.cart-layout { display: grid; gap: var(--space-6); padding-bottom: var(--space-7); }
@media (min-width: 960px) { .cart-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-8); align-items: start; } }
.lines { list-style: none; padding: 0; border-top: 1px solid var(--color-border); }
.line { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--color-border); align-items: start; }
.line__img { aspect-ratio: 4 / 5; background: var(--media-bg); border-radius: var(--radius-s); display: grid; place-items: center; padding: 8px; }
.line__img img { width: 100%; height: 100%; object-fit: contain; }
.line__title { font-weight: 600; font-size: var(--fs-s); line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.line__title:hover { text-decoration: underline; }
.line__meta { font-size: var(--fs-xs); color: var(--color-muted); margin-top: 2px; }
.line__actions { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); flex-wrap: wrap; }
.line__remove { background: none; border: 0; padding: 0 4px; min-height: var(--tap); font-size: var(--fs-xs); color: var(--color-muted); text-decoration: underline; }
.line__price { text-align: right; }
.summary { display: grid; gap: var(--space-4); padding: var(--space-5); border-radius: var(--radius-l); background: var(--color-surface); border: var(--border-w) solid var(--color-border); }
@media (min-width: 960px) { .summary { position: sticky; top: 132px; } }
.summary h2 { font-size: var(--fs-l); font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-weight: 700; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) 0; font-size: var(--fs-s); }
.summary dt { padding-right: var(--space-4); }
.summary dd { text-align: right; font-variant-numeric: tabular-nums; }
.summary .total { font-weight: 700; font-size: var(--fs-l); padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
.summary__note { font-size: var(--fs-xs); color: var(--color-muted); display: flex; gap: 8px; }
.summary__note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.notice { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-m); background: var(--color-surface-2); font-size: var(--fs-s); }
.notice svg { width: 20px; height: 20px; flex: none; color: var(--brand-ink); margin-top: 1px; }

.checkout-header { border-bottom: var(--border-w) solid var(--color-border); background: var(--color-bg); }
.checkout-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 64px; }
.checkout-header__secure { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--color-muted); }
.checkout-header__secure svg { width: 16px; height: 16px; }
.checkout { display: grid; gap: var(--space-5); padding-block: var(--space-5) var(--space-8); }
@media (min-width: 960px) { .checkout { grid-template-columns: minmax(0, 1fr) 400px; gap: var(--space-8); align-items: start; padding-top: var(--space-7); } .checkout .summary { order: 2; } }
.mini-summary { border: var(--border-w) solid var(--color-border); border-radius: var(--radius-m); background: var(--color-surface); }
.mini-summary summary { display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 0 var(--space-4); cursor: pointer; font-weight: 600; font-size: var(--fs-s); list-style: none; }
.mini-summary summary::-webkit-details-marker { display: none; }
.mini-summary__body { padding: 0 var(--space-4) var(--space-4); }
@media (min-width: 960px) { .mini-summary { display: none; } }
@media (max-width: 959px) { .checkout .summary { display: none; } }
.mini-lines { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
.mini-lines li { display: grid; grid-template-columns: 48px 1fr auto; gap: var(--space-3); align-items: center; font-size: var(--fs-xs); }
.mini-lines .line__img { padding: 4px; }
.mini-lines b { font-weight: 600; font-size: var(--fs-xs); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kustom { position: relative; border: 2px dashed var(--color-border); border-radius: var(--radius-l); padding: var(--space-5); display: grid; gap: var(--space-4); background: var(--color-surface); }
.kustom__tag { position: absolute; top: -12px; left: var(--space-4); background: var(--color-bg); padding: 0 8px; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--color-muted); }
.kustom__intro { font-size: var(--fs-s); color: var(--color-muted); }
.kustom__step { display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-m); background: var(--color-surface-2); }
.kustom__step h3 { font-size: var(--fs-s); display: flex; align-items: center; gap: var(--space-2); }
.kustom__step h3 span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--color-text); color: var(--color-bg); font-size: 11px; }
.ghost-field { height: 44px; border-radius: var(--radius-s); background: var(--color-surface); border: 1px solid var(--color-border); display: flex; align-items: center; padding: 0 12px; color: var(--color-muted); font-size: var(--fs-s); }
.ghost-row { display: grid; gap: var(--space-2); }
@media (min-width: 600px) { .ghost-row--2 { grid-template-columns: 1fr 1fr; } }
.ghost-opt { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: 0 12px; border-radius: var(--radius-s); background: var(--color-surface); border: 1px solid var(--color-border); font-size: var(--fs-s); }
.ghost-opt i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--color-muted); flex: none; }
.ghost-opt[data-on] i { border: 6px solid var(--color-text); }
.ghost-opt span { margin-left: auto; color: var(--color-muted); font-variant-numeric: tabular-nums; }

.thanks { display: grid; gap: var(--space-6); padding-block: var(--space-7) var(--space-8); max-width: 760px; }
.thanks__check { width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; }
.thanks__check svg { width: 28px; height: 28px; }
.timeline { list-style: none; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3); padding-bottom: var(--space-5); position: relative; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--color-border); }
.timeline li:last-child::before { display: none; }
.timeline i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--color-border); background: var(--color-bg); display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; }
.timeline li[data-done] i { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.timeline b { display: block; font-size: var(--fs-s); }
.timeline span { font-size: var(--fs-s); color: var(--color-muted); }

/* ---------- 20. Info pages ---------- */
.info { display: grid; gap: var(--space-6); padding-bottom: var(--space-7); }
@media (min-width: 960px) { .info { grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-8); align-items: start; } }
.subnav ul { display: flex; gap: 6px; list-style: none; padding: 0; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); text-decoration: none; font-size: var(--fs-s); font-weight: 600; white-space: nowrap; }
.subnav a[aria-current="true"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
@media (min-width: 960px) {
  .subnav { position: sticky; top: 132px; }
  .subnav ul { flex-direction: column; margin: 0; padding: 0; gap: 2px; }
  .subnav a { border: 0; border-radius: var(--radius-s); padding: 0 12px; min-height: 44px; }
  .subnav a[aria-current="true"] { background: var(--color-surface-2); color: var(--color-text); }
}
.info section { scroll-margin-top: 140px; }
.info section + section { margin-top: var(--space-8); padding-top: var(--space-7); border-top: 1px solid var(--color-border); }
.info h2 { font-size: var(--fs-2xl); margin-bottom: var(--space-5); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); margin-block: var(--space-3) var(--space-5); }
.table th, .table td { text-align: left; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.table th { font-size: var(--fs-xs); color: var(--color-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.table td:last-child, .table th:last-child { text-align: right; padding-right: 0; white-space: nowrap; }
.contact-grid { display: grid; gap: var(--space-4); }
@media (min-width: 700px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-card { padding: var(--space-5); border-radius: var(--radius-m); border: var(--border-w) solid var(--color-border); background: var(--color-surface); font-size: var(--fs-s); display: grid; gap: 6px; align-content: start; }
.contact-card h3 { font-size: var(--fs-s); color: var(--color-muted); font-weight: 600; }
.contact-card a { color: var(--brand-ink); font-weight: 600; }
.form-grid { display: grid; gap: var(--space-4); margin-top: var(--space-5); }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }
textarea.input { min-height: 132px; padding-block: 10px; resize: vertical; }
.tf { transition: background var(--dur-2), outline-color var(--dur-2); border-radius: 3px; }
[data-show-fields] .tf { background: color-mix(in oklab, #f5c518 30%, transparent); outline: 1px dashed #b88900; outline-offset: 1px; }
.legal-note { font-size: var(--fs-xs); color: var(--color-muted); padding: var(--space-3) var(--space-4); border-left: 3px solid var(--color-border); margin-bottom: var(--space-5); }

/* ---------- 21. Demo hub + design-system sheet ---------- */
.hub-hero { padding-block: var(--space-8) var(--space-6); display: grid; gap: var(--space-4); }
.hub-hero h1 { font-size: var(--fs-4xl); max-width: 16ch; }
.cards-3 { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pagelist { display: grid; gap: var(--space-3); list-style: none; padding: 0; }
@media (min-width: 700px) { .pagelist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pagelist { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pagelink { display: grid; gap: 6px; padding: var(--space-5); border-radius: var(--radius-m); border: var(--border-w) solid var(--color-border); background: var(--color-surface); text-decoration: none; height: 100%; }
.pagelink:hover { border-color: var(--color-text); }
.pagelink b { font-size: var(--fs-l); }
.pagelink span { font-size: var(--fs-s); color: var(--color-muted); }
.pagelink em { font-style: normal; font-size: var(--fs-xs); color: var(--brand-ink); font-weight: 600; margin-top: auto; padding-top: var(--space-2); }
.dircard { display: grid; gap: var(--space-4); padding: var(--space-5); border-radius: var(--radius-m); border: 2px solid var(--color-border); background: var(--color-surface); }
.dircard[aria-current="true"] { border-color: var(--color-text); }
.dircard__sample { height: 120px; border-radius: 8px; display: grid; align-content: end; padding: 14px; overflow: hidden; }
.dircard__sample b { font-size: 34px; line-height: .95; }
.dircard__sample small { font-size: 12px; opacity: .8; }
.dircard p { font-size: var(--fs-s); color: var(--color-muted); }
.dircard .btns { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: auto; }
.studio { display: grid; gap: var(--space-6); }
@media (min-width: 1000px) { .studio { grid-template-columns: 360px minmax(0, 1fr); align-items: start; } }
.studio__panel { display: grid; gap: var(--space-5); padding: var(--space-5); border-radius: var(--radius-l); border: var(--border-w) solid var(--color-border); background: var(--color-surface); }
.presets { display: grid; gap: var(--space-2); list-style: none; padding: 0; }
.presets button { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 52px; padding: 6px 12px; text-align: left; border-radius: var(--radius-s); border: 1px solid var(--color-border); background: var(--color-bg); }
.presets button[aria-pressed="true"] { border-color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-text); }
.presets i { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.presets small { display: block; color: var(--color-muted); font-size: var(--fs-xs); }
.color-row { display: flex; gap: var(--space-3); align-items: center; }
.color-row input[type="color"] { width: 52px; height: 44px; border: 1px solid var(--color-border); border-radius: var(--radius-s); padding: 2px; background: var(--color-surface); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--color-bg); box-shadow: 0 0 0 1px var(--color-border); }
.contrast-out { font-size: var(--fs-xs); color: var(--color-muted); display: grid; gap: 4px; }
.contrast-out b { color: var(--color-text); }
.preview-frame { border-radius: var(--radius-l); border: var(--border-w) solid var(--color-border); overflow: hidden; background: var(--color-bg); }
.preview-frame .pgrid { padding: var(--space-5); }
.ds-grid { display: grid; gap: var(--space-5); }
@media (min-width: 900px) { .ds-grid--2 { grid-template-columns: 1fr 1fr; } .ds-grid--3 { grid-template-columns: repeat(3, 1fr); } .ds-grid--4 { grid-template-columns: repeat(4, 1fr); } }
.ds-block { padding: var(--space-5); border-radius: var(--radius-m); border: var(--border-w) solid var(--color-border); background: var(--color-surface); display: grid; gap: var(--space-4); align-content: start; }
.ds-block > h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--color-muted); }
.ds-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.swatch { display: grid; gap: 6px; font-size: var(--fs-xs); }
.swatch i { display: block; height: 56px; border-radius: var(--radius-s); border: 1px solid var(--color-border); }
.swatch code { font-size: 11px; color: var(--color-muted); }
.typescale { display: grid; gap: var(--space-3); }
.typescale div { display: grid; grid-template-columns: 90px 1fr; gap: var(--space-4); align-items: baseline; border-bottom: 1px solid var(--color-border); padding-bottom: var(--space-3); overflow: hidden; }
.typescale code { font-size: var(--fs-xs); color: var(--color-muted); }
.typescale span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }

/* ---------- 22. Fixes / refinements ---------- */
.site-footer .paylist { display: flex; }
.hero__title em { padding-right: .06em; }
@media (min-width: 1100px) { .rail > li:nth-child(n+7) { display: none; } }
.info > *, .catalog > *, .rf-product > *, .cart-layout > *, .checkout > *, .studio > * { min-width: 0; }
.pagelink em a { color: var(--brand-ink); min-height: 32px; display: inline-flex; align-items: center; }
.flip__face, .pcard__media, .line__img { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.flip__face img, .pcard__media img { min-height: 0; }
body.has-buybar .site-footer { padding-bottom: 80px; }
.pcard[data-kind="graded"] .pcard__badges { top: auto; bottom: 8px; }
