/* Wholeboxbuy / 成盒買 — polished TCG price board (original) */
/* Dark (default) — near-black + electric lime */
:root,
[data-theme="dark"] {
  --bg: #0a0c10;
  --bg-elev: #12161f;
  --bg-card: #141922;
  --border: #2a3142;
  --border-soft: #1e2430;
  --text: #f2f4f8;
  --muted: #a8b0c0;
  --faint: #6e778a;
  --accent: #c8f542;
  --accent-2: #9dff6b;
  --accent-dim: rgba(200, 245, 66, 0.12);
  --accent-glow: rgba(200, 245, 66, 0.22);
  --accent-border: rgba(200, 245, 66, 0.35);
  --accent-border-strong: rgba(200, 245, 66, 0.4);
  --warn: #ffc857;
  --warn-border: rgba(255, 200, 87, 0.38);
  --warn-wash: rgba(255, 200, 87, 0.1);
  --warn-row: rgba(255, 200, 87, 0.06);
  --warn-row-hover: rgba(255, 200, 87, 0.1);
  --danger: #ff6b7a;
  --link: #6ec8ff;
  --link-border: rgba(110, 200, 255, 0.3);
  --link-wash: rgba(110, 200, 255, 0.08);
  --link-wash-hover: rgba(110, 200, 255, 0.16);
  --pos: #3dd68c;
  --pos-ink: #0a2e1e;
  --pos-glow: rgba(61, 214, 140, 0.25);
  --neg: #ff6b7a;
  --neg-ink: #3d0c12;
  --neg-glow: rgba(255, 107, 122, 0.22);
  --jp: #6ec8ff;
  --jp-border: rgba(110, 200, 255, 0.4);
  --jp-wash: rgba(110, 200, 255, 0.1);
  --tc: #ffb86b;
  --tc-border: rgba(255, 184, 107, 0.4);
  --tc-wash: rgba(255, 184, 107, 0.1);
  --header-bg: rgba(10, 12, 16, 0.82);
  --th-bg: #1a2030;
  --nav-hover-bg: rgba(255, 255, 255, 0.04);
  --chip-hover-border: #3d465c;
  --row-hover: rgba(200, 245, 66, 0.035);
  --pill-bg: rgba(18, 22, 31, 0.85);
  --spread-zero-bg: rgba(255, 255, 255, 0.06);
  --brand-ink: #0a0c10;
  --brand-ring: rgba(200, 245, 66, 0.35);
  --hero-lime: rgba(200, 245, 66, 0.16);
  --hero-cyan: rgba(110, 200, 255, 0.1);
  --hero-mint: rgba(157, 255, 107, 0.06);
  --hero-fade: rgba(20, 25, 34, 0.35);
  --grid-line: rgba(255, 255, 255, 0.035);
  --callout-grad: linear-gradient(135deg, rgba(255, 200, 87, 0.1), rgba(20, 25, 34, 0.95) 55%);
  --footer-fade: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.25));
  --radius: 14px;
  --radius-sm: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", "Hiragino Sans GB", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --max: 1120px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.28);
  --color-scheme: dark;
}

/* Light — paper / dark ink, vivid lime accent (original, RareRip-adjacent) */
[data-theme="light"] {
  --bg: #f4f1ea;
  --bg-elev: #fffcf7;
  --bg-card: #ffffff;
  --border: #d9d2c4;
  --border-soft: #ebe5d9;
  --text: #1a1d24;
  --muted: #5a6373;
  --faint: #8a9184;
  --accent: #6f9f00;
  --accent-2: #86c41a;
  --accent-dim: rgba(111, 159, 0, 0.12);
  --accent-glow: rgba(111, 159, 0, 0.18);
  --accent-border: rgba(111, 159, 0, 0.4);
  --accent-border-strong: rgba(111, 159, 0, 0.5);
  --warn: #c47a00;
  --warn-border: rgba(196, 122, 0, 0.35);
  --warn-wash: rgba(255, 200, 87, 0.18);
  --warn-row: rgba(255, 200, 87, 0.12);
  --warn-row-hover: rgba(255, 200, 87, 0.2);
  --danger: #d63d52;
  --link: #0a7ec4;
  --link-border: rgba(10, 126, 196, 0.28);
  --link-wash: rgba(10, 126, 196, 0.08);
  --link-wash-hover: rgba(10, 126, 196, 0.14);
  --pos: #1faa66;
  --pos-ink: #06351f;
  --pos-glow: rgba(31, 170, 102, 0.2);
  --neg: #d63d52;
  --neg-ink: #3d0c12;
  --neg-glow: rgba(214, 61, 82, 0.18);
  --jp: #0a7ec4;
  --jp-border: rgba(10, 126, 196, 0.35);
  --jp-wash: rgba(10, 126, 196, 0.1);
  --tc: #c46a12;
  --tc-border: rgba(196, 106, 18, 0.35);
  --tc-wash: rgba(196, 106, 18, 0.1);
  --header-bg: rgba(244, 241, 234, 0.88);
  --th-bg: #efe9de;
  --nav-hover-bg: rgba(26, 29, 36, 0.05);
  --chip-hover-border: #b8b09e;
  --row-hover: rgba(111, 159, 0, 0.06);
  --pill-bg: rgba(255, 252, 247, 0.9);
  --spread-zero-bg: rgba(26, 29, 36, 0.05);
  --brand-ink: #1a1d24;
  --brand-ring: rgba(111, 159, 0, 0.4);
  --hero-lime: rgba(111, 159, 0, 0.14);
  --hero-cyan: rgba(10, 126, 196, 0.08);
  --hero-mint: rgba(134, 196, 26, 0.08);
  --hero-fade: rgba(255, 255, 255, 0.55);
  --grid-line: rgba(26, 29, 36, 0.045);
  --callout-grad: linear-gradient(135deg, rgba(255, 200, 87, 0.22), rgba(255, 252, 247, 0.95) 55%);
  --footer-fade: linear-gradient(180deg, transparent, rgba(26, 29, 36, 0.04));
  --shadow: 0 12px 36px rgba(40, 32, 18, 0.1);
  --shadow-sm: 0 4px 14px rgba(40, 32, 18, 0.07);
  --color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: var(--color-scheme);
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  min-height: 3.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
}
.brand-logo-wrap {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.5rem; /* ~40px */
  height: 2.5rem;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0c10; /* dark chip so white WBB stays readable on light theme */
  box-shadow:
    0 0 0 1px var(--brand-ring),
    0 4px 14px var(--accent-glow);
}
.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.15;
}
.brand-mark {
  font-weight: 750;
  letter-spacing: -0.03em;
  font-size: 1rem;
}
.brand-zh {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}
.brand-tagline {
  display: block;
  color: var(--faint);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  margin-top: 0.08rem;
  white-space: nowrap;
}
.nav {
  display: flex;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.nav a {
  color: var(--muted);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover {
  color: var(--text);
  background: var(--nav-hover-bg);
  text-decoration: none;
}
.nav a[aria-current="page"] {
  color: var(--bg);
  background: var(--accent);
  font-weight: 650;
}
.nav a[aria-current="page"]:hover {
  color: var(--bg);
  background: var(--accent-2);
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--chip-hover-border);
  background: var(--bg-card);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle-icon {
  font-size: 0.95rem;
  line-height: 1;
}
.theme-toggle-label {
  letter-spacing: 0.02em;
}

/* Hero */
.hero {
  position: relative;
  padding: 1.1rem 0 1rem;
  isolation: isolate;
}
/* Legacy mesh kept for non-banner heroes; disabled when banner present */
.hero:not(.hero-with-banner)::before {
  content: "";
  position: absolute;
  inset: -1rem -2rem auto;
  height: min(28rem, 70vw);
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 18% 30%, var(--hero-lime), transparent 70%),
    radial-gradient(ellipse 40% 35% at 88% 10%, var(--hero-cyan), transparent 65%),
    radial-gradient(ellipse 50% 40% at 60% 80%, var(--hero-mint), transparent 70%),
    linear-gradient(180deg, var(--hero-fade), transparent);
  mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
}
.hero:not(.hero-with-banner)::after {
  content: "";
  position: absolute;
  inset: 0 -1rem auto;
  height: 16rem;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 40% 20%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 40% 20%, #000 20%, transparent 75%);
}
.hero-media {
  margin: 0 0 0.85rem;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow:
    0 0 0 1px rgba(200, 245, 66, 0.05),
    0 8px 24px rgba(0, 0, 0, 0.2);
  max-width: 52rem;
}
.hero-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.4 / 1;
  object-fit: contain; /* full wordmark + tagline visible — no awkward crop */
  object-position: left center;
  max-height: 9.5rem; /* ~8–10rem desktop; obvious, not huge */
}
.hero-copy .tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  max-width: 40rem;
  line-height: 1.5;
}
.hero .tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  max-width: 36rem;
  line-height: 1.5;
}
.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;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.15rem;
}
.hero-copy:has(.tagline) .meta-row {
  margin-top: 1.35rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  backdrop-filter: blur(8px);
}
.pill strong {
  color: var(--text);
  font-weight: 650;
}
.pill.accent {
  color: var(--accent);
  border-color: var(--accent-border-strong);
  background: var(--accent-dim);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Sources strip */
.sources-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0.15rem 0 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.78rem;
  color: var(--faint);
}
.sources-strip .label {
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sources-strip a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.sources-strip a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-border-strong);
  text-decoration: none;
}
.sources-strip .sep {
  color: var(--border);
  user-select: none;
}

/* Callout */
.callout {
  margin: 1.5rem 0 0;
  padding: 1.15rem 1.25rem 1.15rem 1.35rem;
  border-radius: var(--radius);
  background:
    var(--callout-grad),
    var(--bg-card);
  border: 1px solid var(--warn-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.callout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--warn), #ff8f3c);
}
.callout h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--warn);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  letter-spacing: -0.02em;
}
.callout p {
  margin: 0.3rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.callout .watch {
  color: var(--text);
  font-weight: 650;
}

/* Toolbar */
.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0 0.95rem;
}
.board-toolbar h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  font-weight: 750;
}
.board-toolbar h2 .en {
  color: var(--faint);
  font-weight: 550;
  font-size: 0.85em;
  margin-left: 0.35rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 550;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.chip:hover {
  color: var(--text);
  border-color: var(--chip-hover-border);
}
.chip[aria-pressed="true"] {
  color: var(--bg);
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 18px var(--accent-glow);
}

/* Table desktop */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

table.board {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 980px;
}
.board th,
.board td {
  padding: 0.85rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.board th {
  position: sticky;
  top: 0;
  background: var(--th-bg);
  color: var(--faint);
  font-weight: 650;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  user-select: none;
  border-bottom: 1px solid var(--border);
}
.board th.sortable {
  cursor: pointer;
}
.board th.sortable:hover {
  color: var(--text);
}
.board th .arrow {
  opacity: 0.4;
  font-size: 0.65rem;
  margin-left: 0.2rem;
}
.board th[aria-sort="ascending"] .arrow,
.board th[aria-sort="descending"] .arrow {
  opacity: 1;
  color: var(--accent);
}
.board tbody tr {
  transition: background 0.12s;
}
.board tbody tr:hover {
  background: var(--row-hover);
}
.board tbody tr:last-child td {
  border-bottom: none;
}
.board tbody tr.hero-row {
  background: var(--warn-row);
}
.board tbody tr.hero-row:hover {
  background: var(--warn-row-hover);
}
.board tbody tr.is-hidden {
  display: none;
}
.board td.num,
.board th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 550;
  letter-spacing: -0.01em;
}
.board td.num.hk-ask {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.set-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  min-width: 12.5rem;
}
.set-thumb {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
  background: var(--bg-elev);
  box-shadow: 0 0 0 1px var(--border-soft);
}
.set-thumb-lg {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--warn-border), 0 6px 18px rgba(0, 0, 0, 0.25);
}
.set-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.set-code {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 0.95rem;
}
.set-name {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
}
.set-name-alt {
  color: var(--faint);
  font-size: 0.7rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}

/* Hero M6a callout chip */
.callout-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.45rem;
}
.callout-head h2 {
  margin: 0;
}
/* Set thumbs: keep gradient chips readable in light theme */
[data-theme="light"] .set-thumb {
  box-shadow: 0 0 0 1px rgba(20, 24, 32, 0.12), 0 1px 2px rgba(20, 24, 32, 0.06);
}


.lang-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.lang-badge.jp {
  color: var(--jp);
  border-color: var(--jp-border);
  background: var(--jp-wash);
}
.lang-badge.tc {
  color: var(--tc);
  border-color: var(--tc-border);
  background: var(--tc-wash);
}

.stock {
  font-size: 0.8rem;
  font-weight: 550;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stock.in_stock {
  color: var(--pos);
}
.stock.sold_out {
  color: var(--danger);
}
.stock.listed,
.stock.unknown,
.stock.none {
  color: var(--faint);
}

/* Spread badges: green + / red − */
.spread-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  min-width: 4.5rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.15;
  white-space: nowrap;
}
.spread-badge .spread-abs {
  font-size: 0.86rem;
}
.spread-badge .spread-pct {
  font-size: 0.68rem;
  font-weight: 650;
  opacity: 0.92;
}
.spread.pos .spread-badge {
  color: var(--pos-ink);
  background: var(--pos);
  box-shadow: 0 0 12px var(--pos-glow);
}
.spread.neg .spread-badge {
  color: var(--neg-ink);
  background: var(--neg);
  box-shadow: 0 0 12px var(--neg-glow);
}
.spread.zero .spread-badge {
  color: var(--muted);
  background: var(--spread-zero-bg);
  border: 1px solid var(--border);
  box-shadow: none;
}
.spread.pos {
  color: var(--pos);
}
.spread.neg {
  color: var(--neg);
}
.spread.zero {
  color: var(--muted);
}

.shop {
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src a {
  font-size: 0.78rem;
  font-weight: 550;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--link-border);
  background: var(--link-wash);
  text-decoration: none;
}
.src a:hover {
  background: var(--link-wash-hover);
  text-decoration: none;
}
.empty {
  color: var(--faint);
}

.footnote {
  margin: 1.15rem 0 2.75rem;
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.6;
}
.footnote strong {
  color: var(--muted);
  font-weight: 650;
}
.footnote code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-elev);
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
  color: var(--text);
}

/* About */
.prose {
  padding: 2.25rem 0 3rem;
  max-width: 42rem;
}
.prose h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.03em;
  font-weight: 800;
}
.prose h2 {
  margin: 2rem 0 0.55rem;
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: -0.02em;
  font-weight: 700;
}
.prose p,
.prose li {
  color: var(--muted);
}
.prose strong {
  color: var(--text);
  font-weight: 650;
}
.prose ul {
  padding-left: 1.2rem;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-elev);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
  color: var(--text);
}
.prose .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
}
.prose .back-link:hover {
  background: var(--accent-glow);
  text-decoration: none;
}

.fx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.85rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.fx-table th,
.fx-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}
.fx-table tr:last-child td {
  border-bottom: none;
}
.fx-table th {
  background: var(--bg-elev);
  color: var(--faint);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 650;
}
.fx-table td {
  background: var(--bg-card);
  font-variant-numeric: tabular-nums;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 1.35rem 0 2.25rem;
  color: var(--faint);
  font-size: 0.8rem;
  background: var(--footer-fade);
}
.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}

/* Mobile: SKU rows as cards */
@media (max-width: 760px) {
  .wrap {
    width: min(100% - 1.25rem, var(--max));
  }
  .hero {
    padding-top: 1.15rem;
  }
  .hero-media {
    border-radius: 0.85rem;
    margin-bottom: 1rem;
  }
  .hero-media {
    max-width: none;
  }
  .hero-media img {
    max-height: min(7rem, 34vw);
    aspect-ratio: 2.4 / 1;
    object-fit: contain;
    object-position: left center;
  }
  .brand-logo-wrap {
    width: 2.25rem;
    height: 2.25rem;
  }
  .brand-mark {
    font-size: 0.92rem;
  }
  .nav a {
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
  }
  .theme-toggle {
    min-width: 2.15rem;
    min-height: 2.15rem;
    padding: 0.3rem 0.5rem;
  }
  .theme-toggle-label {
    display: none;
  }
  .board-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-wrap {
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  table.board {
    min-width: 0;
    display: block;
  }
  .board thead {
    display: none;
  }
  .board tbody {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }
  .board tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "set set"
      "hk hk"
      "shop stock"
      "jp jpref"
      "spread spread"
      "src src";
    gap: 0.55rem 0.6rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
  }
  .board tbody tr.hero-row {
    border-color: var(--warn-border);
  }
  .board tbody tr.is-hidden {
    display: none;
  }
  .board tbody tr:hover {
    background: var(--bg-card);
  }
  .board td {
    padding: 0;
    border: none;
    display: block;
    max-width: none;
  }
  .board td.num {
    text-align: left;
  }

  .board td:nth-child(1) {
    grid-area: set;
    padding-right: 3.25rem;
  }
  .board td:nth-child(2) {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: auto;
  }
  .board td:nth-child(3) {
    grid-area: hk;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em;
  }
  .board td:nth-child(3)::before {
    content: "HK ask · HKD";
    display: block;
    font-size: 0.65rem;
    font-weight: 650;
    font-family: var(--font);
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
  }
  .board td:nth-child(4) {
    grid-area: shop;
    padding: 0.45rem 0.6rem;
    background: var(--bg-elev);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
    font-size: 0.82rem;
  }
  .board td:nth-child(4)::before {
    content: "Shop";
    display: block;
    font-size: 0.62rem;
    font-weight: 650;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
  }
  .board td:nth-child(5) {
    grid-area: stock;
    padding: 0.45rem 0.6rem;
    background: var(--bg-elev);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    text-align: right;
  }
  .board td:nth-child(5)::before {
    content: "Stock";
    display: block;
    font-size: 0.62rem;
    font-weight: 650;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
  }
  .board td:nth-child(6) {
    grid-area: jp;
    padding: 0.5rem 0.65rem;
    background: var(--bg-elev);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
  }
  .board td:nth-child(6)::before {
    content: "JP MSRP · HKD";
    display: block;
    font-size: 0.62rem;
    font-weight: 650;
    font-family: var(--font);
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
  }
  .board td:nth-child(7) {
    grid-area: jpref;
    padding: 0.5rem 0.65rem;
    background: var(--bg-elev);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
  }
  .board td:nth-child(7)::before {
    content: "JP 市價 · HKD";
    display: block;
    font-size: 0.62rem;
    font-weight: 650;
    font-family: var(--font);
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
  }
  .board td:nth-child(8) {
    grid-area: spread;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  .board td:nth-child(9) {
    grid-area: src;
    padding-top: 0.15rem;
  }
  .spread-badge {
    min-width: 5.25rem;
    font-size: 0.9rem;
    padding: 0.4rem 0.7rem;
  }
  .set-code {
    font-size: 1.05rem;
  }
}

@media (max-width: 420px) {
  .brand-tagline {
    white-space: normal;
    max-width: 11rem;
  }
}

/* —— Ad slot placeholder (no third-party scripts) —— */
.ad-slot {
  margin: 0.85rem 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.ad-slot-lite {
  margin: 0.75rem 0 0.5rem;
  max-width: 42rem;
}
.ad-slot-label {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.ad-slot-box {
  width: 100%;
  max-width: 728px;
  height: 72px;
  max-height: 72px;
  margin: 0 auto;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm, 8px);
  background: transparent;
  box-sizing: border-box;
}
@media (max-width: 760px) {
  .ad-slot-box {
    height: 56px;
    max-height: 56px;
  }
}

/* Multi-shop board bits */
.shop-name {
  color: var(--muted);
}
a.shop-link {
  color: var(--muted);
  text-decoration: none;
}
a.shop-link:hover {
  color: var(--text);
  text-decoration: underline;
}
.shop-more {
  display: inline-block;
  margin-left: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--faint);
  vertical-align: middle;
  text-decoration: none;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elev);
}
.shop-more:hover {
  color: var(--text);
  border-color: var(--border);
}
.hk-ask {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Shops page */
.shops-hero {
  padding: 1.5rem 0 0.75rem;
}
.shops-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  letter-spacing: -0.03em;
  font-weight: 800;
}
.shops-hero h1 .en {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--muted);
  margin-left: 0.35rem;
}
.shops-hero .lede {
  margin: 0 0 0.5rem;
  color: var(--muted);
  max-width: 40rem;
  line-height: 1.55;
  font-size: 0.95rem;
}
.shops-hero .meta-inline {
  margin: 0;
  color: var(--faint);
  font-size: 0.82rem;
}

.shop-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.55rem;
  margin: 0.85rem 0 1.5rem;
}
.shop-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.shop-card:hover,
.shop-card.is-active {
  border-color: var(--accent, #c8f542);
  background: var(--bg-elev);
}
.shop-card-name {
  font-weight: 700;
  font-size: 0.9rem;
}
.shop-card-count {
  font-size: 0.72rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.shop-sections {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-bottom: 1.5rem;
}
.shop-block {
  scroll-margin-top: 4.5rem;
}
.shop-block.is-focus {
  outline: 1px solid var(--warn-border, rgba(255, 200, 87, 0.45));
  outline-offset: 6px;
  border-radius: var(--radius);
}
.shop-block-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}
.shop-block-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.shop-table-wrap {
  margin: 0;
}
.shop-board {
  min-width: 0;
}
.set-name-inline {
  color: var(--muted);
  font-size: 0.82rem;
  margin-left: 0.25rem;
}

@media (max-width: 720px) {
  .shop-board thead {
    display: none;
  }
  .shop-board tbody {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }
  .shop-board tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.6rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
  }
  .shop-board td {
    border: none;
    padding: 0;
  }
  .shop-board td:nth-child(1) {
    grid-column: 1 / -1;
  }
  .shop-board td.num.hk-ask {
    font-size: 1.25rem;
    font-weight: 800;
  }
}
