:root {
  /* Temple Night: token names are historical (celadon = page ground, jade = action colour). */
  --celadon: #121512;
  --celadon-pale: #1a1e1b;
  --celadon-deep: #3a3f38;
  --porcelain: #eef2ec;
  --porcelain-2: #dfe4dc;
  --ink: #ece6d8;
  --ink-2: #bdb5a3;
  --jade: #c9a96a;
  --jade-hover: #d9bc82;
  --night: #1d1a13;
  --night-ink: #d9cfb9;
  --seal: #a8352a;
  --crackle: rgba(236, 230, 216, 0.16);
  --surface: #1a1e1b;
  --field: #222723;
  --placeholder: #8f8a7c;
  --on-action: #15130e;
  --shadow: rgba(0, 0, 0, 0.6);
  --cert-ink: #1d3530;
  --cert-ink-2: #34504a;
  --night-hi: #f3ead6;
  --night-mid: #b8ab90;
  --night-field: #2a261c;
  --night-line: #4d4533;
  --night-line-2: #3a3427;
  --night-btn: #c9a96a;
  --night-btn-ink: #15130e;
  --night-btn-hover: #d9bc82;
  --display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --brush: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', serif;
  --body: 'Hanken Grotesk', system-ui, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --zh: 'Noto Serif SC', 'Songti SC', serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  /* Sized from the window height so the niche and the details box under it fit on the first screen of a computer. */
  --hero-stage: clamp(200px, calc(80vh - 400px), 420px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scrollbar-color: var(--celadon-deep) var(--celadon-pale); }
body {
  margin: 0; background: var(--celadon); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body); -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--ink); color: var(--celadon-pale); }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 3px; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
[lang="zh"] { font-family: var(--zh); font-weight: 500; letter-spacing: 0.04em; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; letter-spacing: 0.01em; margin: 0; text-wrap: balance; }
p { margin: 0; max-width: 62ch; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* Header */
.site { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--celadon) 88%, transparent); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--crackle); }
.site .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.site nav { display: flex; gap: clamp(14px, 2.4vw, 32px); font-size: 0.95rem; }
.site nav a { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.site nav a:hover, .site nav a[aria-current] { border-color: var(--ink); }
.cart-link { white-space: nowrap; }
@media (max-width: 720px) {
  .site nav .nav-extra { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px; border: 1px solid var(--jade); border-radius: 2px; background: var(--jade); color: var(--on-action); font: 500 1rem/1 var(--body); letter-spacing: 0.02em; text-decoration: none; cursor: pointer; transition: background 0.3s var(--ease), transform 0.3s var(--ease); }
.btn:hover { background: var(--jade-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: transparent; color: var(--ink-2); border-color: var(--crackle); cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--celadon-pale); }
.link { font-weight: 500; }

/* Image slot */
.plate { position: relative; margin: 0; background: var(--porcelain); display: grid; place-items: center; overflow: hidden; }
.plate img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.plate-file { position: absolute; inset: auto 8px 8px; font: 500 0.6875rem/1.3 ui-monospace, 'Cascadia Mono', monospace; color: var(--ink-2); opacity: 0.75; text-align: center; word-break: break-all; }

/* Hero */
.hero { position: relative; padding: clamp(24px, 4vw, 56px) 0 clamp(56px, 8vw, 112px); }
.hero .wrap { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2vw, 32px); align-items: start; }
.hero h1 { grid-column: 1 / 9; grid-row: 1; font-size: clamp(2.3rem, 5.2vw, 4.5rem); position: relative; z-index: 2; }
.hero h1 > span { white-space: pre-line; }
.hero h1 > span + span { display: block; font-size: max(0.36em, 1rem); margin-top: 0.6em; letter-spacing: 0.3em; color: var(--ink-2); }
.hero-intro { grid-column: 1 / 6; grid-row: 2; margin-top: clamp(24px, 3vw, 40px); display: grid; gap: 28px; align-content: start; }
.hero-intro p { font-size: 1.1875rem; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.hero-object { grid-column: 8 / 13; grid-row: 1 / 4; position: relative; }
.hero-holds { grid-column: 1 / 7; grid-row: 3; align-self: start; margin-top: clamp(32px, 4vw, 56px); }
.hero-stage { position: relative; width: min(100%, var(--hero-stage)); margin-inline: auto; }
.niche { aspect-ratio: 4 / 5; border-radius: 999px 999px 0 0; background: radial-gradient(ellipse at 50% 38%, var(--porcelain) 0 50%, var(--porcelain-2)); box-shadow: inset 0 -40px 50px -40px var(--shadow); display: grid; }
.niche .plate { background: transparent; height: 100%; padding: 16% 18% 6%; }
.plinth { height: 16px; margin: 0 -6%; background: linear-gradient(var(--porcelain), var(--porcelain-2)); box-shadow: 0 18px 30px -12px var(--shadow); }
.museum-label { margin-top: 28px; display: grid; gap: 6px; padding-top: 18px; border-top: 1px solid var(--crackle); }
.museum-label .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.museum-label h2 { font-size: 1.625rem; }
.museum-label .meta { color: var(--ink-2); font-size: 0.95rem; }
.price { font: 400 1.5rem/1 var(--display); }
.museum-label { padding: 18px 18px 16px; border: 1px solid color-mix(in srgb, var(--jade) 45%, transparent); background: color-mix(in srgb, var(--celadon) 80%, transparent); gap: 14px; }
.label-facts { margin: 0; padding-top: 12px; border-top: 1px solid var(--crackle); display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 20px; font-size: 0.95rem; }
.label-facts dt { color: var(--ink-2); }
.label-facts dd { margin: 0; }
.label-facts .serial { color: var(--jade); font-size: 0.9rem; align-self: center; }
.label-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.label-acts .btn { flex: 1 1 150px; padding: 0 14px; white-space: nowrap; }
.label-acts .btn.ghost { border-color: var(--jade); color: var(--jade); }
.label-acts .btn.ghost:hover { background: var(--jade); color: var(--on-action); }
.museum-label h2 a { color: inherit; text-decoration: none; }
.museum-label h2 a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

@media (max-width: 900px) {
  .hero .wrap { display: flex; flex-direction: column; }
  .hero-object { margin-top: 40px; width: 100%; }
  .hero-stage { width: min(64%, 40vh); margin-inline: auto; }
  .hero-intro { order: 3; }
  .hero-holds { order: 4; margin-top: 44px; }
}

/* Certificate */
.cert { display: block; padding: 0; border: 0; background: none; text-align: left; color: var(--ink); font: inherit; cursor: pointer; perspective: 900px; aspect-ratio: 1.42; container-type: inline-size; }
.cert-face { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 2.6cqi; padding: 4.5cqi 5cqi; background: #f7f8f3; color: var(--cert-ink); border: 1px solid #c9d3c4; outline: 1px solid #c9d3c4; outline-offset: -5px; box-shadow: 0 14px 28px -14px var(--shadow); backface-visibility: hidden; transition: transform 0.7s var(--ease); font-size: 4.3cqi; line-height: 1.35; }
.cert { position: relative; --ink: var(--cert-ink); --ink-2: var(--cert-ink-2); }
.cert-back { transform: rotateY(180deg); }
.cert[aria-pressed="true"] .cert-front { transform: rotateY(-180deg); }
.cert[aria-pressed="true"] .cert-back { transform: rotateY(0); }
.cert-head { display: flex; justify-content: space-between; gap: 8px; font-size: 3.3cqi; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid #d5ddd0; padding-bottom: 6px; }
.cert-head [lang="zh"] { text-transform: none; letter-spacing: 0.2em; }
.cert-body { display: flex; gap: 10px; flex: 1; min-height: 0; }
.cert-photo { width: 34%; aspect-ratio: 3 / 4; background: var(--porcelain-2); }
.cert-photo .plate-file { display: none; }
.cert dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-content: start; }
.cert dt { color: var(--ink-2); }
.cert dd { margin: 0; font-weight: 500; }
.cert-foot { display: flex; justify-content: space-between; align-items: end; }
.serial { font: 500 0.8125rem/1 ui-monospace, 'Cascadia Mono', monospace; letter-spacing: 0.06em; }
.cert .serial { font-size: 4.6cqi; }
.seal { width: 13cqi; height: 13cqi; color: var(--seal); transform: rotate(-8deg); }
.cert-note { margin-top: auto; color: var(--ink-2); }

/* Journey rail */
.journey { position: relative; }
.rail { position: sticky; top: 68px; z-index: 10; background: var(--celadon-pale); border-block: 1px solid var(--crackle); }
.rail ol { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: clamp(16px, 3vw, 48px); overflow-x: auto; scrollbar-width: none; }
.rail a { display: block; padding: 14px 0; font-size: 0.9rem; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.rail a.is-active { color: var(--ink); border-color: var(--ink); }

.station { padding: clamp(56px, 7vw, 104px) 0; scroll-margin-top: 110px; }
.station-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 32px; row-gap: 20px; margin-bottom: clamp(40px, 5vw, 72px); }
.station-head h1, .station-head h2 { grid-column: 1 / 8; font-size: clamp(1.9rem, 3.8vw, 3.25rem); }
.station-head h2 > span + span { font-size: max(0.42em, 0.95rem); letter-spacing: 0.24em; color: var(--ink-2); margin-left: 0.6em; vertical-align: 0.4em; }
.station-head p { grid-column: 8 / 13; align-self: end; color: var(--ink-2); }
@media (max-width: 800px) { .station-head { display: block; } .station-head p { margin-top: 16px; } }

/* Cabinet shelves */
.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(32px, 4vw, 56px) clamp(16px, 2.4vw, 36px); }
@media (max-width: 1099px) { .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.piece a { display: grid; gap: 14px; text-decoration: none; }
.piece .plate { aspect-ratio: 3 / 4; box-shadow: 0 1px 0 var(--porcelain-2), 0 22px 30px -22px var(--shadow); transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.piece .plate img { object-fit: cover; }
.piece a:hover .plate { transform: translateY(-4px); box-shadow: 0 1px 0 var(--porcelain-2), 0 30px 36px -22px var(--shadow); }
.label { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--crackle); }
.label-name { font: 400 1.25rem/1.2 var(--display); }
.label-name > span { font-size: 0.75em; color: var(--ink-2); margin-left: 4px; }
.label-meta { font-size: 0.875rem; color: var(--ink-2); }
.label-price { font-weight: 500; margin-top: 4px; }
.is-rehomed .plate { background: transparent; box-shadow: inset 0 0 0 1px var(--crackle); }
.is-rehomed .plate img { opacity: 0.18; filter: grayscale(1); }
.is-rehomed .label { opacity: 0.6; }
.is-rehomed .label-price { font-style: italic; font-weight: 400; }
.shelf-foot { margin-top: clamp(40px, 5vw, 64px); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Provenance */
.provenance { background: var(--surface); }
.prov-grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.prov-grid .plate { aspect-ratio: 4 / 3; background: var(--porcelain-2); }
.temples { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--crackle); }
.temples li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--crackle); }
.temples span:first-child { font: 400 1.25rem/1.3 var(--display); }
.temples span:last-child { color: var(--ink-2); font-size: 0.9rem; text-align: right; }
@media (max-width: 800px) { .prov-grid { grid-template-columns: 1fr; } }

/* Verify */
.verify-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.verify-grid .cert { width: min(100%, 460px); transform: rotate(-2deg); }
.verify-form { display: grid; gap: 14px; margin-top: 32px; max-width: 460px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.875rem; font-weight: 500; }
.field input, .field select { min-height: 52px; padding: 0 16px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--field); color: var(--ink); font: inherit; width: 100%; }
.field input::placeholder { color: var(--placeholder); }
.field input[aria-invalid="true"] { border-color: var(--seal); }
.inline { display: flex; gap: 10px; }
.inline input { flex: 1; min-width: 0; }
.result { min-height: 1.6em; font-weight: 500; }
.result.bad { color: var(--seal); }
@media (max-width: 800px) { .verify-grid { grid-template-columns: 1fr; } }

/* Chart */
.chart { background: var(--night); color: var(--night-ink); }
.chart h2, .chart .label-name { color: var(--night-hi); }
.chart .station-head p, .chart .station-head h2 > span + span { color: var(--night-mid); }
.chart-grid { display: grid; grid-template-columns: 6fr 5fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.chart-form { display: grid; gap: 18px; }
.chart .field input, .chart .field select { background: var(--night-field); border-color: var(--night-line); color: var(--night-hi); color-scheme: dark; }
.chart .btn { background: var(--night-btn); color: var(--night-btn-ink); border-color: var(--night-btn); }
.chart .btn:hover { background: var(--night-btn-hover); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.two > * { min-width: 0; }
.chart-board { border: 1px solid var(--night-line); padding: clamp(20px, 3vw, 32px); display: grid; gap: 14px; }
.receive { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.receive li { padding-top: 10px; border-top: 1px solid var(--night-line-2); color: var(--night-hi); }
@media (max-width: 800px) { .chart-grid { grid-template-columns: 1fr; } }

/* Acquire */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.steps li { padding: 24px 24px 0 0; position: relative; }
.steps li::before { content: ''; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.steps h3 { font-size: 1.5rem; margin-bottom: 10px; }
.steps p { color: var(--ink-2); font-size: 0.975rem; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--ink); } .steps li { padding: 0 0 32px 28px; } .steps li::before { left: -5px; top: 8px; } }

/* Keeper */
.keeper { background: var(--surface); }
.keeper-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.keeper .plate { aspect-ratio: 4 / 5; background: var(--porcelain-2); }
.keeper h2 { font-size: clamp(1.9rem, 3.8vw, 3.25rem); margin-bottom: 24px; }
.keeper p + p { margin-top: 16px; }
.channels { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 32px; }
@media (max-width: 800px) { .keeper-grid { grid-template-columns: 1fr; } }

/* Footer */
.foot { background: var(--night); color: var(--night-ink); padding: 48px 0; font-size: 0.875rem; }
.foot .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* Inner pages */
.page-head { padding: clamp(40px, 6vw, 88px) 0 clamp(24px, 3vw, 40px); }
.page-head h1 { font-size: clamp(2.25rem, 4.6vw, 3.75rem); }
.page-head p { margin-top: 16px; color: var(--ink-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; align-items: center; }
.chip { white-space: nowrap; min-height: 40px; padding: 0 16px; border: 1px solid var(--ink-2); border-radius: 20px; background: transparent; color: var(--ink); font: 500 0.9rem/1 var(--body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--celadon-pale); border-color: var(--ink); }
.filters .spacer { flex: 1; }
.filters select { min-height: 40px; border: 1px solid var(--ink-2); border-radius: 20px; padding: 0 14px; background: transparent; font: inherit; font-size: 0.9rem; color: var(--ink); }
.empty { padding: 48px 0; color: var(--ink-2); }

.detail { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 96px); padding-bottom: clamp(72px, 10vw, 144px); align-items: start; }
.detail-object { position: sticky; top: 100px; }
.detail-object .stage { background: var(--porcelain); min-height: min(70vh, 640px); display: grid; place-items: center; padding: 32px; }
.detail-object .stage .plate { width: 70%; aspect-ratio: 3 / 4; background: transparent; transition: width 0.6s var(--ease); }
.detail-object.actual .stage .plate { aspect-ratio: auto; }
.size-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 0.875rem; color: var(--ink-2); }
.detail h1 { font-size: clamp(2.1rem, 3.8vw, 3.25rem); }
.detail h1 > span { display: block; font-size: 0.4em; color: var(--ink-2); margin-top: 0.5em; letter-spacing: 0.2em; }
.detail .price { display: block; font-size: 2rem; margin: 24px 0; }
.facts { margin: 32px 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--crackle); }
.facts dt, .facts dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--crackle); }
.facts dt { color: var(--ink-2); padding-right: 24px; }
.detail .cert { width: min(100%, 360px); margin-top: 40px; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } .detail-object { position: static; } }

.cart-grid { display: grid; grid-template-columns: 6fr 5fr; gap: clamp(32px, 6vw, 96px); padding-bottom: clamp(72px, 10vw, 144px); align-items: start; }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--crackle); }
.line { display: grid; grid-template-columns: 88px 1fr auto; gap: 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--crackle); }
.line .plate { aspect-ratio: 3 / 4; }
.line .plate-file { display: none; }
.line button { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 0.875rem; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.total { display: flex; justify-content: space-between; padding: 20px 0; font: 400 1.5rem/1 var(--display); }
.checkout { background: var(--surface); padding: clamp(24px, 3vw, 40px); display: grid; gap: 18px; }
.checkout h2 { font-size: 1.75rem; }
.checkout fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.checkout legend { font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; }
.pay { display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 0 16px; border: 1px solid var(--ink-2); border-radius: 2px; cursor: pointer; }
.pay:has(input:checked) { border-color: var(--jade); box-shadow: inset 0 0 0 1px var(--jade); }
.pay input { accent-color: var(--jade); }
.err { color: var(--seal); font-size: 0.875rem; min-height: 1.3em; }
.note { font-size: 0.8125rem; color: var(--ink-2); }
.done { padding: clamp(24px, 3vw, 40px); background: var(--surface); }
.done h2 { font-size: 2rem; margin-bottom: 12px; }
@media (max-width: 900px) { .cart-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Section headings outside .station-head */
.h2 { font-size: clamp(1.9rem, 3.8vw, 3.25rem); }
.sub { display: block; font-size: max(0.42em, 0.95rem); letter-spacing: 0.24em; color: var(--ink-2); margin-top: 0.6em; }
.lede { margin-top: 24px; color: var(--ink-2); }
.note.gap { margin-top: 32px; }
.keeper h2.h2 { margin-bottom: 24px; }
.page-body { padding-bottom: clamp(72px, 10vw, 144px); }
.page-head.back { padding-bottom: 24px; }
.buy { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.detail .cert + .note { margin-top: 12px; }
.lines .label-name { text-decoration: none; }
.gap-top { margin-top: 24px; }
body.night { background: var(--night); }
body.night .site { background: color-mix(in srgb, var(--night) 88%, transparent); border-color: var(--night-line-2); color: var(--night-hi); }
body.night .site nav a:hover, body.night .site nav a[aria-current] { border-color: var(--night-hi); }
.chart-board .btn { justify-self: start; }
.chart .sub, .chart h1 { color: var(--night-hi); }
.chart .sub { color: var(--night-mid); }

/* Language switch */
.lang-toggle { min-height: 36px; padding: 0 12px; border: 1px solid var(--ink-2); border-radius: 18px; background: transparent; color: inherit; font: 500 0.875rem/1 var(--body); cursor: pointer; white-space: nowrap; flex: none; }
.lang-toggle[lang="zh"] { font-family: var(--zh); }
.lang-toggle:hover { background: var(--ink); color: var(--celadon-pale); }
body.night .lang-toggle { border-color: var(--night-line); }
body.night .lang-toggle:hover { background: var(--night-hi); color: var(--night); }
.site nav { align-items: center; }
.site nav > * { white-space: nowrap; flex: none; }

/* Chinese mode: Chinese leads in the serif, English accents keep the display face */
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) .label-name { font-family: var(--brush); font-weight: 400; letter-spacing: 0.04em; }
:lang(zh) .hero h1 { font-size: clamp(2.75rem, 8vw, 7rem); line-height: 1.12; }
/* Chinese title: the English accent sits under it as three short lines. */
:lang(zh) .hero h1 > span + span { font-size: max(0.27em, 1rem); letter-spacing: 0.22em; line-height: 1.5; margin-top: 0.5em; }
:lang(zh) [lang="en"] { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; }
:lang(zh) body { line-height: 1.8; }

/* Scroll motion (only when JS adds .motion and the visitor allows motion) */
.motion [data-reveal] { transition: opacity 0.9s var(--ease), transform 1s var(--ease), filter 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.motion [data-reveal]:not(.in) { opacity: 0; transform: translateY(40px); filter: blur(6px); transition-delay: 0s; }
.motion [data-reveal].above:not(.in) { transform: translateY(-40px); }
.motion .shelf > li[data-reveal]:not(.in) { transform: translateY(56px) scale(0.96); }
.motion [data-reveal] .plate img { transition: transform 1.6s var(--ease); }
.motion [data-reveal]:not(.in) .plate img { transform: scale(1.08); }
.motion .steps li[data-reveal]::before { transition: transform 0.8s var(--ease) 0.3s; }
.motion .steps li[data-reveal]:not(.in)::before { transform: scale(0); }
.motion .hero h1 > span, .motion .hero-intro, .motion .museum-label { animation: rise 1.2s var(--ease) both; }
.motion .hero h1 > span + span { animation-delay: 0.15s; }
.motion .hero-intro { animation-delay: 0.3s; }
.motion .museum-label { animation-delay: 0.5s; }
.motion .niche { animation: niche-in 1.4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(32px); filter: blur(6px); } }
@keyframes niche-in { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
[data-parallax] { will-change: translate; }
.views { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-object .stage .plate.wide { width: 100%; aspect-ratio: 4 / 3; }
.detail-object .note { margin-top: 10px; }
.motion .hero-object.again .museum-label, .motion .hero-object.again .niche, .hero-object.again .cert { animation: none; }
/* Hide the filename label once a real image is in the slot (the img removes itself if missing). */
.plate:has(img) .plate-file { display: none; }
.cert-photo img, .line .plate img, .detail-object .stage .plate.wide img { object-fit: cover; }
/* Detail photo fills the stage; the actual-size view returns to a padded stage with the small object */
.detail-object .stage { padding: 0; min-height: 0; background: transparent; }
.detail-object .stage .plate { width: min(100%, 62vh); margin-inline: 0; box-shadow: 0 1px 0 var(--porcelain-2), 0 26px 36px -24px var(--shadow); }
.detail-object .stage .plate.wide { width: 100%; }
.detail-object .stage .plate img { object-fit: cover; }
.detail-object.actual .stage { min-height: min(70vh, 640px); padding: 32px; background: var(--porcelain); }
.detail-object.actual .stage .plate { box-shadow: none; }
.detail-object.actual .stage .plate img { object-fit: contain; }

/* Phones: the cabinet reads as a two-up shelf, controls stay on one line */
@media (max-width: 600px) {
  .shelf { grid-template-columns: 1fr 1fr; gap: 28px 14px; }
  .label-name { font-size: 1.0625rem; }
  .label-name > span { display: block; margin: 2px 0 0; }
  .label-meta { font-size: 0.8125rem; }
  .size-toggle { flex-wrap: wrap; }
  .views .chip, .size-toggle .chip { padding: 0 12px; min-height: 36px; font-size: 0.85rem; }
}


/* Moving background (built in assets/fx.js): temple in mist travelling with the scroll, gold dust in front */
:root { --fx-dust: #d9b874; }

.fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fx canvas { display: block; }



.fx-temple img { position: absolute; left: 0; top: 0; width: 100%; height: auto; min-height: 160vh; object-fit: cover; filter: saturate(0.85); opacity: 0.5; translate: 0 calc(var(--sy, 0) * var(--travel, 0px) * -1); }
.fx-temple::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--celadon) 55%, transparent) 0%, transparent 45%, transparent 70%, color-mix(in srgb, var(--celadon) 40%, transparent) 100%), radial-gradient(ellipse 100% 80% at 50% 45%, transparent 40%, var(--celadon) 100%); }

/* With an effect on, section grounds turn translucent so the background shows through */
.provenance, .keeper { background: color-mix(in srgb, var(--surface) 30%, transparent); }
.chart, .foot { background: color-mix(in srgb, var(--night) 70%, transparent); }
.rail { background: color-mix(in srgb, var(--celadon-pale) 75%, transparent); backdrop-filter: blur(10px); }
.checkout, .done { background: color-mix(in srgb, var(--surface) 80%, transparent); }
body.night { background: var(--night); }
@media (prefers-reduced-motion: reduce) { .fx * { animation: none !important; } }
.page-body { min-height: 70vh; }

/* Association check */
.assoc-box { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--crackle); display: grid; gap: 10px; justify-items: start; }
.result .assoc { margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; translate: -50% 20px; max-width: min(92vw, 520px); padding: 14px 20px; background: var(--ink); color: var(--celadon); border-radius: 4px; box-shadow: 0 16px 32px -12px var(--shadow); font-size: 0.95rem; opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease), translate 0.3s var(--ease); }
.toast.show { opacity: 1; translate: -50% 0; }

/* Account control in the header */
.account { position: relative; }
button.account { min-height: 36px; padding: 0 14px; border: 1px solid var(--jade); border-radius: 18px; background: var(--jade); color: var(--on-action); font: 500 0.875rem/1 var(--body); cursor: pointer; white-space: nowrap; }
button.account:hover { background: var(--jade-hover); }
details.account summary { list-style: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--jade); color: var(--on-action); font-weight: 600; cursor: pointer; }
details.account summary::-webkit-details-marker { display: none; }
.account-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 200px; display: grid; padding: 8px; background: var(--celadon-pale); border: 1px solid var(--crackle); border-radius: 6px; box-shadow: 0 18px 36px -16px var(--shadow); z-index: 30; }
.account-menu > * { padding: 10px 12px; border-radius: 4px; text-align: left; font: inherit; font-size: 0.95rem; color: var(--ink); background: none; border: 0; text-decoration: none; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--crackle); }
.account-name { font-size: 0.8125rem; color: var(--ink-2); cursor: default; border-bottom: 1px solid var(--crackle); border-radius: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-board.members { max-width: 520px; }
@media (max-width: 420px) { .site nav { gap: 10px; font-size: 0.9rem; } button.account, .lang-toggle { padding: 0 10px; } }

/* Admin dashboard */
body.admin { background: var(--celadon); }
.admin-main { padding: clamp(20px, 2.6vw, 36px) clamp(16px, 2.6vw, 40px) 96px; min-height: 80vh; max-width: 1500px; }
.admin-gate { max-width: 640px; display: grid; gap: 16px; justify-items: start; }
.admin-gate h1 { font-size: clamp(2rem, 4vw, 3rem); }
.admin-gate code, .admin-main code { font-size: 0.9em; padding: 1px 6px; border-radius: 3px; background: var(--celadon-pale); }
.admin-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.admin-tools input, .admin-tools select { min-height: 48px; padding: 0 14px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--field); color: var(--ink); font: inherit; }
.admin-tools input { flex: 1 1 260px; }
.admin-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--crackle); }
.admin-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 170px auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--crackle); }
.admin-row .thumb { width: 64px; aspect-ratio: 3 / 4; background: var(--porcelain); overflow: hidden; border-radius: 2px; }
.admin-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-row small { color: var(--ink-2); }
.admin-row [lang="zh"] { color: var(--ink-2); font-size: 0.9em; }
.admin-row select { min-height: 40px; padding: 0 10px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--field); color: var(--ink); font: inherit; font-size: 0.9rem; }
.admin-row .acts { display: flex; gap: 14px; }
.admin-row.is-rehomed .thumb, .admin-row.is-hidden .thumb { opacity: 0.45; }
.link { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 0.22em; cursor: pointer; }
.link.danger { color: #e08a7e; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--crackle); white-space: nowrap; }
.admin-table th { color: var(--ink-2); font-weight: 500; }
@media (max-width: 760px) {
  .admin-row { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "t w p" "t s a"; row-gap: 8px; }
  .admin-row .thumb { grid-area: t; width: 56px; } .admin-row .who { grid-area: w; } .admin-row .price { grid-area: p; }
  .admin-row select { grid-area: s; } .admin-row .acts { grid-area: a; }
}

.editor { width: min(960px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--crackle); border-radius: 8px; background: var(--celadon-pale); color: var(--ink); }
.editor::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }
.editor form { padding: clamp(18px, 3vw, 32px); display: grid; gap: 16px; }
.editor-head, .editor-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.editor-foot { justify-content: flex-end; }
.editor h2 { font-size: 1.75rem; }
.editor-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.photos { display: grid; gap: 14px; align-content: start; }
.photo { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 8px; font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--porcelain); border-radius: 2px; }
.photo img[hidden] { display: block; visibility: hidden; height: 0; }
.photo input { font-size: 0.8rem; color: var(--ink-2); }
.fields { display: grid; gap: 14px; }
.fields textarea { padding: 12px 16px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--field); color: var(--ink); font: inherit; width: 100%; resize: vertical; }
.intents { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.intents legend { font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; }
.intents label { display: flex; gap: 8px; align-items: center; }
.intents input { accent-color: var(--jade); }
@media (max-width: 760px) { .editor-grid { grid-template-columns: 1fr; } .photos { grid-template-columns: 1fr 1fr; } .photos .note { grid-column: 1 / -1; } }

/* Detail photo sits on the column's left edge, in line with the view buttons; actual size stays centred */
.detail-object .stage { place-items: start; }
.detail-object.actual .stage { place-items: center; }

/* Shared header and footer brand layout. */
.mark { display: inline-grid; justify-items: center; gap: 3px; text-decoration: none; margin-right: auto; line-height: 1; }
.mark-zh { font: 400 2.2rem/1 var(--brush); letter-spacing: 0.04em; background: linear-gradient(180deg, #fbe8ad 0%, #e2bd66 42%, #a9812f 72%, #edcd7c 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
.mark-en { font: 700 0.62rem/1 var(--display); letter-spacing: 0.26em; padding-left: 0.24em; color: #d9b45e; }
.foot-mark { margin-right: 0; }
.foot-mark .mark-zh { font-size: 2.2rem; }
.foot-mark .mark-en { font-size: 0.66rem; }
.mark { flex: none; white-space: nowrap; }
@media (max-width: 420px) {
  .mark-zh { font-size: 1.45rem; } .mark-en { font-size: 0.44rem; }
}
/* Phones up to the largest (about 440px wide): the header keeps cart, sign-in and language;
   the cabinet stays one tap away through the hero button and the journey rail */
@media (max-width: 560px) { .site nav a[href="cabinet.html"] { display: none; } }

/* Chinese display lines use the same brush as the logo; small Chinese labels keep the readable serif */
h1 [lang="zh"], h2 [lang="zh"], .sub[lang="zh"] { font-family: var(--brush); font-weight: 400; letter-spacing: 0.08em; }

/* Account menu: every row shares one inset and type size (header link rules otherwise strip the link's padding) */
.site nav .account-menu > * { display: block; width: 100%; padding: 10px 14px; border: 0; border-radius: 4px; font: 500 0.95rem/1.3 var(--body); color: var(--ink); text-align: left; white-space: nowrap; }
.site nav .account-menu .account-name { font-size: 0.8125rem; font-weight: 400; color: var(--ink-2); border-bottom: 1px solid var(--crackle); border-radius: 0; margin-bottom: 4px; padding-bottom: 12px; }
.site nav .account-menu a:hover, .site nav .account-menu button:hover { background: var(--crackle); border-color: transparent; }

/* Announcement bar (set in the dashboard) */
.announce { position: relative; z-index: 21; padding: 9px var(--gutter); background: var(--jade); color: var(--on-action); text-align: center; font-size: 0.9rem; font-weight: 500; }

/* Dashboard phase 1 */
body.admin.lang-th { font-family: 'Sarabun', var(--body); }
body.admin.lang-th .btn, body.admin.lang-th .chip, body.admin.lang-th input, body.admin.lang-th select, body.admin.lang-th textarea, body.admin.lang-th .link { font-family: 'Sarabun', var(--body); }
.admin-langs { display: flex; border: 1px solid var(--ink-2); border-radius: 18px; overflow: hidden; }
.admin-langs button { min-height: 34px; padding: 0 12px; border: 0; background: none; color: var(--ink); font: 500 0.85rem/1 var(--body); cursor: pointer; }
.admin-langs button[lang="th"] { font-family: 'Sarabun', var(--body); }
.admin-langs button[aria-pressed="true"] { background: var(--jade); color: var(--on-action); }
/* Phones: the logo already links to the shop, so drop the text link to keep the bar on one line. */
.admin-tools .note { margin-right: auto; align-self: center; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.875rem; }
.pill { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 500; background: var(--crackle); color: var(--ink-2); }
.pill-available { background: color-mix(in srgb, var(--jade) 25%, transparent); color: var(--ink); }
.admin-row { grid-template-columns: 22px 64px minmax(0, 1fr) auto auto; }
.admin-row .price { text-align: right; }
.admin-row .acts { flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; }
.drag { display: grid; place-items: center; height: 44px; cursor: grab; color: var(--ink-2); touch-action: none; }
.drag svg { width: 10px; height: 16px; fill: currentColor; }
.drag.off { cursor: default; }
.admin-list .sortable-ghost { opacity: 0.35; }
.admin-list .sortable-chosen { background: var(--celadon-pale); }
@media (max-width: 760px) {
  .admin-row { grid-template-columns: 22px 56px minmax(0, 1fr) auto; grid-template-areas: "d t w p" "d t a a"; }
  .admin-row .drag { grid-area: d; } .admin-row .acts { grid-area: a; justify-content: flex-start; }
}
.admin-form { display: grid; gap: 20px; max-width: 920px; }
.admin-group { border: 1px solid var(--crackle); border-radius: 6px; padding: 18px 20px 20px; margin: 0; display: grid; gap: 14px; background: color-mix(in srgb, var(--celadon-pale) 60%, transparent); }
.admin-group legend { padding: 0 8px; font: 500 1.05rem/1.2 var(--display); }
.admin-group textarea, .admin-group input:not([type=checkbox]):not([type=file]) { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--field); color: var(--ink); font: inherit; }
.admin-group textarea { resize: vertical; }
.admin-group ::placeholder { color: var(--placeholder); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.pair-label { grid-column: 1 / -1; font-size: 0.875rem; font-weight: 600; }
.pair label { display: grid; gap: 4px; font-size: 0.8rem; color: var(--ink-2); }
@media (max-width: 640px) { .pair { grid-template-columns: 1fr; } }
.photo-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; max-width: 468px; }
.switch { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--jade); }
.admin-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; }
.admin-save .btn { box-shadow: 0 10px 24px -10px var(--shadow); }
details.more { border-top: 1px solid var(--crackle); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 500; padding: 6px 0; }
details.more[open] summary { margin-bottom: 12px; }
@media (max-width: 760px) { .editor { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; } }

/* Dashboard live preview */
.admin-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.admin-split .admin-form { max-width: none; }
.preview { position: sticky; top: 88px; display: grid; gap: 10px; }
.preview-head { display: grid; gap: 2px; }
.preview-head b { font: 500 1rem/1.2 var(--display); }
.preview-frame { position: relative; overflow: hidden; border: 1px solid var(--crackle); border-radius: 8px; background: #000; box-shadow: 0 18px 40px -24px var(--shadow); }
.preview-frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
@media (max-width: 1360px) {
  .admin-split { grid-template-columns: 1fr; }
  .preview { order: -1; position: sticky; top: 76px; z-index: 5; background: var(--celadon); padding-bottom: 8px; }
  .preview-head .note { display: none; }
}
/* Phones: no sticky preview (it fights scrolling and the keyboard). It is hidden until opened with its button. */
.preview-toggle { display: none; }
@media (max-width: 760px) {
  .preview { position: static; background: none; padding: 0; }
  .preview-head { display: flex; justify-content: space-between; align-items: center; }
  .preview-toggle { display: inline; }
  .preview:not(.open) .preview-frame { display: none; }
}

/* Large desktops: everything is set in rem, so a larger root size scales type, spacing and controls together;
   the content column widens to match. Phones and tablets keep the 16px root. */
@media (min-width: 1200px) {
  html { font-size: clamp(16px, calc(9px + 0.55vw), 19px); }
  :root { --max: 1480px; }
  .label-facts { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
}
/* The headline and introduction sit together; the tall arch takes its extra height from the row below. */
.hero .wrap { grid-template-rows: auto auto 1fr; }

/* Member details */
.member-row { cursor: pointer; }
.member-row:hover td, .member-row:focus-visible td { background: var(--crackle); }
.member-name { display: inline-flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; background: var(--jade); color: var(--on-action); font-weight: 600; font-size: 0.9rem; }
.member-dialog { width: min(520px, calc(100vw - 24px)); height: fit-content; max-height: calc(100dvh - 24px); }
.member-wrap { padding: clamp(18px, 3vw, 28px); display: grid; gap: 16px; }
.member-top { display: flex; align-items: center; gap: 16px; }
.member-top .avatar { width: 64px; height: 64px; font-size: 1.5rem; }
.member-top h2 { font-size: 1.5rem; }
.member-top p { color: var(--ink-2); word-break: break-all; }
.member-acts { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
@media (max-width: 760px) { .member-dialog { height: fit-content; } }

/* Orders: customer "My orders" page, thank-you code, and status pills shared with the dashboard */
.order { padding: clamp(20px, 3vw, 32px); margin-bottom: 24px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.order-head div { display: grid; gap: 6px; }
.order-head .serial { font-size: 1rem; }
.order-code { font-size: 1.125rem; margin-bottom: 12px; }
.order-code .serial { font-size: 1.125rem; }
.pill.order-pending { background: color-mix(in srgb, var(--jade) 22%, transparent); color: var(--ink); }
.pill.order-paid { background: var(--jade); color: var(--on-action); }
.pill.order-shipped { background: color-mix(in srgb, #7fb7a4 30%, transparent); color: var(--ink); }
.pill.order-completed { background: var(--crackle); color: var(--ink); }
.pill.order-cancelled { background: color-mix(in srgb, var(--seal) 25%, transparent); color: var(--ink-2); text-decoration: line-through; }

/* Dashboard: overview figures, order details, purchase history */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 40px; }
.stat { display: grid; gap: 8px; align-content: start; padding: 18px; border: 1px solid var(--crackle); border-radius: 8px; background: color-mix(in srgb, var(--celadon-pale) 60%, transparent); color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.stat:hover { border-color: var(--jade); }
.stat b { font: 400 clamp(1.6rem, 2.4vw, 2.2rem)/1 var(--display); color: var(--jade); }
.stat span { font-size: 0.9rem; color: var(--ink-2); }
.admin-subhead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 8px; }
.admin-subhead h2 { font-size: 1.5rem; }
.admin-table td.empty { padding: 32px 0; white-space: normal; }
.order-top { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.order-top h2 { font-size: 1.4rem; }
.order-items { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--crackle); }
.order-items li { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--crackle); }
.order-items .thumb { width: 48px; aspect-ratio: 3 / 4; background: var(--porcelain); overflow: hidden; border-radius: 2px; }
.order-items .thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-items .order-total { font: 400 1.25rem/1 var(--display); border-bottom: 0; }
.order-form { display: grid; gap: 14px; padding: 0; }
.order-form select, .order-form input { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--field); color: var(--ink); font: inherit; }
.member-h { font-size: 1.1rem; margin-top: 8px; }
.member-orders { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--crackle); }
.member-orders li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--crackle); }
.member-orders .pill { margin-top: 0; }

/* Policy pages: one article per language, shown by the page language */
html[lang="zh-Hans"] [data-show="en"], html:not([lang="zh-Hans"]) [data-show="zh"] { display: none !important; }
.policy { max-width: 760px; padding-bottom: 48px; }
.policy h2 { font-size: 1.35rem; margin: 36px 0 12px; }
.policy p, .policy li { color: var(--ink-2); line-height: 1.75; }
.policy ul { padding-left: 1.2em; display: grid; gap: 8px; }
.policy b { color: var(--ink); font-weight: 500; }
.policy > .note { margin-top: 40px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; width: 100%; order: 3; }
.foot-links a { color: inherit; opacity: 0.8; }
.foot-links a:hover { opacity: 1; }
.agree { font-size: 0.8125rem; color: var(--ink-2); }
.steps-list { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; color: var(--ink-2); }
.steps-list .done-step { opacity: 0.55; }
.steps-list b { color: var(--ink); font-weight: 500; }

/* Fortune reading */
.guide { font: 400 clamp(1.8rem, 3vw, 2.4rem)/1.1 var(--display); color: var(--jade); }
.reading-wrap { padding: clamp(48px, 6vw, 88px) 0 clamp(56px, 7vw, 104px); }
.reading { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(28px, 4vw, 56px) clamp(32px, 5vw, 72px); }
.reading li { display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 1px solid var(--night-line, var(--crackle)); }
.reading-h { font-size: 1.35rem; }
.reading-lead { font-size: 1.125rem; color: var(--ink); }
.reading p { color: var(--ink-2); }
.reading b { color: var(--jade); font-weight: 500; margin-right: 6px; }
.reading-amulets { margin-top: clamp(48px, 6vw, 88px); display: grid; gap: 18px; }
.why { margin: 0; padding-left: 1.2em; color: var(--ink-2); display: grid; gap: 6px; }
.reading-note { margin-top: 40px; }

/* Dashboard: overdue orders, notes, reviews, waiting members, reports */
.stat-warn b { color: var(--seal); }
.pill-overdue { background: color-mix(in srgb, var(--seal) 30%, transparent); color: var(--ink); }
.overdue-box { display: grid; gap: 10px; padding: 12px 16px; border-left: 3px solid var(--seal); background: color-mix(in srgb, var(--seal) 8%, transparent); }
.note-box textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--field); color: var(--ink); font: inherit; resize: vertical; }
.note-box small { font-weight: 400; color: var(--ink-2); }
.review-row { padding-bottom: 16px; border-bottom: 1px solid var(--crackle); }
.review-row .link { justify-self: start; }
.waiting-list li { grid-template-columns: 1fr auto auto; }
.report th.bar-cell, .report td.bar-cell { width: 38%; }
.bar { display: block; height: 8px; width: var(--w); min-width: 3px; border-radius: 4px; background: var(--jade); }
.report-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 32px; margin-top: 48px; }
.admin-table td.wrap-cell { white-space: normal; min-width: 260px; }

/* Reviews, live schedule, About, FAQ, Guide, "tell me when a piece arrives" */
.review-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: clamp(28px, 4vw, 56px); }
.review-list li { display: grid; gap: 14px; align-content: start; padding-top: 18px; border-top: 1px solid var(--crackle); }
.review-list blockquote { margin: 0; font-size: 1.125rem; line-height: 1.7; }
.review-by { font-size: 0.875rem; color: var(--ink-2); letter-spacing: 0.04em; }
.live { margin-top: 16px; }
.live b { display: inline-block; margin-right: 10px; padding: 1px 10px; border-radius: 99px; background: var(--seal); color: #fff; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; vertical-align: 0.1em; }
.lede { font-size: 1.2rem; line-height: 1.7; color: var(--ink) !important; }
.about { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
.about-photo, .about-wide { margin: 0; overflow: hidden; border-radius: 0; background: none; }
.about-photo, .about-wide { -webkit-mask-image: linear-gradient(to bottom, #000 92%, transparent); mask-image: linear-gradient(to bottom, #000 92%, transparent); }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.about-wide { margin: 8px 0 64px; background: none; }
.about-wide img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; display: block; }
.about .channels { margin-top: 20px; }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; } .about-photo img { aspect-ratio: 4 / 3; } }
.page-faq details { border-bottom: 1px solid var(--crackle); }
.page-faq summary { cursor: pointer; padding: 16px 32px 16px 0; font-weight: 500; color: var(--ink); list-style: none; position: relative; }
.page-faq summary::-webkit-details-marker { display: none; }
.page-faq summary::after { content: '+'; position: absolute; right: 4px; top: 14px; font-size: 1.25rem; color: var(--ink-2); transition: transform 0.2s; }
.page-faq details[open] summary::after { transform: rotate(45deg); }
.page-faq details p { padding-bottom: 18px; }
.notify { margin: clamp(56px, 7vw, 96px) 0 clamp(32px, 4vw, 56px); padding: clamp(24px, 3vw, 40px); max-width: 720px; display: grid; gap: 14px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.notify h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.notify > p { color: var(--ink-2); }
.notify-form { display: grid; gap: 16px; }
.notify .btn.ghost { justify-self: start; }
.order-top h2 { white-space: nowrap; }
.order-top > div:last-child { display: grid; gap: 4px; justify-items: end; }
.order-top .pill { margin-top: 0; }
.intent-boxes { display: contents; }

/* AI-written reading */
.reading-wait { margin-bottom: 24px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .reading-wait { animation: none; } }
.reading-intro { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); font-size: 1.2rem; line-height: 1.7; }
.reading-closing { max-width: 760px; margin-top: clamp(28px, 4vw, 48px); font-size: 1.1rem; line-height: 1.7; color: var(--ink-2); }
.reading-why { max-width: 760px; color: var(--ink-2); line-height: 1.7; }

/* Homepage mix: live bar, choose by what it holds, and the buttons that stay at the bottom of the screen */
.live-bar { position: relative; z-index: 21; display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter); background: var(--seal); color: #fbf3e2; font-size: 0.875rem; font-weight: 500; }
.live-bar > span:nth-child(2) { flex: 1; }
.live-bar b { font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 6px; }
.live-bar a { color: inherit; white-space: nowrap; }
.live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #fbf3e2; }
.motion .live-dot { animation: breathe 1.6s ease-in-out infinite; }
.hero-holds h2 { font-size: clamp(1.35rem, 2vw, 1.75rem); margin-bottom: 18px; }
.hero-holds h2 .sub { display: inline; margin-left: 0.6em; }
.holds-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.holds-list a { display: flex; justify-content: center; align-items: baseline; gap: 10px; min-height: 52px; padding: 13px 10px; box-sizing: border-box; border: 1px solid var(--jade); color: var(--ink); text-decoration: none; transition: background 0.2s, color 0.2s; }
.holds-list a:hover { background: var(--jade); color: var(--on-action); }
.holds-list a:hover .holds-acc { color: inherit; }
.holds-acc { color: var(--jade); font-size: 0.85rem; }
.holds-acc[lang="zh"] { font: 400 1.15rem/1 var(--brush); letter-spacing: 0.04em; }
@media (max-width: 760px) { .holds-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dock { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 15; display: flex; justify-content: flex-end; gap: 10px; pointer-events: none; }
.dock a { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 99px; text-decoration: none; font-weight: 600; font-size: 0.95rem; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.8); }
.dock a[hidden] { display: none; }
.dock-cab { display: none !important; background: var(--ink); color: var(--celadon); }
.dock-wa { background: #25d366; color: #08270f; }
.home .foot { padding-bottom: 96px; }
.home .toast { bottom: 84px; }
@media (max-width: 760px) { .dock-cab { display: inline-flex !important; flex: 1; } }
@media (max-width: 760px) { .home .hero-actions .btn { display: none; } }

/* Homepage niche as a framed window for real photos (hand-held, any background) */
.niche.photo { position: relative; overflow: hidden; background: var(--porcelain); }
.niche.photo .plate { padding: 0; }
.niche.photo .plate img { object-fit: cover; }
.niche.photo::before { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--jade) 80%, transparent), inset 0 0 46px rgba(0, 0, 0, 0.28), inset 0 -70px 60px -46px rgba(0, 0, 0, 0.5); }
.niche.photo::after { content: ''; position: absolute; inset: 9px 9px 0; z-index: 1; border: 1px solid color-mix(in srgb, #fbe8ad 70%, transparent); border-bottom: 0; border-radius: 999px 999px 0 0; pointer-events: none; }
/* Dashboard: framing the main photo */
.crop-wrap { display: grid; gap: 8px; }
.cropper { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--porcelain); border-radius: 2px; cursor: grab; touch-action: none; user-select: none; }
.cropper:active { cursor: grabbing; }
.cropper:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
.cropper img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.cropper::after { content: ''; position: absolute; inset: 0; border: 1px dashed #fbe8ad; border-bottom: 0; border-radius: 999px 999px 0 0; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.38); pointer-events: none; }
.crop-zoom { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; font-size: 0.8rem; }
.crop-zoom input { accent-color: var(--jade); }
.cropper.is-cutout { background: radial-gradient(ellipse 80% 72% at 50% 52%, #3a3122 0%, #1d1b17 62%, #131412 100%); }
.cropper.is-cutout img { filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.7)); }
.bg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.bg-tools .note { margin: 0; font-size: 0.78rem; }

/* Dashboard shell: a menu drawer on the left, a bar with the section name, and the work area */
.drawer { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 248px; display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; box-sizing: border-box; overflow-y: auto; background: #0b0d0b; border-right: 1px solid var(--crackle); transition: translate 0.25s var(--ease), visibility 0.25s; }
.admin:not(.in) .drawer, .admin:not(.in) .drawer-toggle, .admin:not(.in) .bar-title { display: none; }
.drawer-top { display: flex; justify-content: center; padding: 8px 0 14px; border-bottom: 1px solid var(--crackle); }
.drawer-top .mark { margin: 0; }
.drawer-seal { display: none; }
.drawer-cap { margin: 12px 14px 4px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.admin-tabs { display: flex; flex-direction: column; gap: 2px; }
.drawer-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 46px; padding: 0 14px; box-sizing: border-box; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font: inherit; font-size: 0.98rem; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap; }
.drawer-item svg { flex: none; width: 21px; height: 21px; }
.drawer-item:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.drawer-item[aria-pressed="true"] { color: var(--jade); background: color-mix(in srgb, var(--jade) 13%, transparent); box-shadow: inset 3px 0 0 var(--jade); }
.drawer-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--crackle); }
.drawer-foot .admin-langs { justify-self: center; }
.admin-body { min-width: 0; }
.admin-bar .bar-in { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 clamp(12px, 2.6vw, 40px) 0 clamp(8px, 1.6vw, 24px); }
.admin-bar nav { margin-left: auto; }
.bar-title { font-size: clamp(1.25rem, 2vw, 1.6rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-toggle { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; }
.drawer-toggle:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.drawer-toggle svg { width: 24px; height: 24px; }
.scrim { position: fixed; inset: 0; z-index: 39; border: 0; padding: 0; background: rgba(0, 0, 0, 0.55); cursor: pointer; }
@media (min-width: 1000px) {
  .admin.in .admin-body { margin-left: 248px; }
  .admin.in.drawer-mini .admin-body { margin-left: 76px; }
  .drawer-mini .drawer { width: 76px; }
  .drawer-mini .drawer .mark, .drawer-mini .drawer-cap, .drawer-mini .drawer-foot .admin-langs { display: none; }
  .drawer-mini .drawer-seal { display: block; }
  .drawer-mini .drawer-item { justify-content: center; padding: 0; }
  .drawer-mini .drawer-item span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 999px) {
  .drawer { width: min(84vw, 300px); translate: -100% 0; visibility: hidden; box-shadow: 24px 0 48px -24px rgba(0, 0, 0, 0.8); }
  .drawer-open .drawer { translate: 0 0; visibility: visible; }
}
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }

/* Auctions: cards, and the bidding panel on a piece page (assets/auction.js) */
.piece.is-auction a { position: relative; }
.auc-tag { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 4px 10px; border-radius: 99px; background: var(--ink); color: var(--celadon); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.auc-tag.live { background: var(--seal); color: #fbf3e2; }
.chip-auction { border-color: var(--seal); }
.auc { position: relative; overflow: hidden; margin: 24px 0 32px; padding: 20px; display: grid; gap: 14px; border: 1px solid color-mix(in srgb, var(--jade) 55%, transparent); background: color-mix(in srgb, var(--celadon) 82%, transparent); }
.auc-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--ink-2); }
.auc-badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 99px; background: var(--seal); color: #fbf3e2; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; }
.auc-badge i { width: 7px; height: 7px; border-radius: 50%; background: #fbf3e2; }
.motion .auc[data-state="live"] .auc-badge i { animation: breathe 1.4s ease-in-out infinite; }
.auc:not([data-state="live"]) .auc-badge { background: var(--crackle); color: var(--ink); }
.auc-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; }
.auc-label { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }
.auc-amount { position: relative; display: inline-block; margin: 6px 0 4px; font: 400 clamp(2.4rem, 6vw, 3.4rem)/1 var(--display); color: var(--jade); font-variant-numeric: tabular-nums; }
.auc-amount.bump { animation: auc-bump 0.7s var(--ease); }
@keyframes auc-bump { 0% { transform: scale(1); } 30% { transform: scale(1.14); text-shadow: 0 0 28px color-mix(in srgb, var(--jade) 80%, transparent); } 100% { transform: scale(1); } }
.auc-by { font-size: 0.9rem; color: var(--ink-2); }
.auc-by.me, .auc-lead { color: var(--jade); font-weight: 600; }
.auc-clock { text-align: right; }
.auc-time { margin-top: 6px; font: 500 1.5rem/1 ui-monospace, 'Cascadia Mono', monospace; font-variant-numeric: tabular-nums; }
.auc.urgent .auc-time { color: #ff8a7a; animation: auc-pulse 1s ease-in-out infinite; }
@keyframes auc-pulse { 50% { transform: scale(1.08); } }
.auc-ext { margin-top: 6px; font-size: 0.8rem; font-weight: 600; color: var(--jade); }
.auc-ext.pop { animation: auc-pop 0.6s var(--ease); }
@keyframes auc-pop { from { transform: translateY(8px) scale(0.8); opacity: 0; } }
.auc-call { min-height: 1.2em; text-align: center; font: 500 1.35rem/1.2 var(--display); color: #ff8a7a; letter-spacing: 0.04em; }
.auc-call:empty { display: none; }
.auc-form { display: grid; gap: 10px; }
.auc-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.auc-row { display: flex; gap: 10px; align-items: stretch; }
.auc-cur { display: grid; place-items: center; padding: 0 2px 0 4px; color: var(--ink-2); }
.auc-row input { flex: 1; min-width: 0; min-height: 52px; padding: 0 14px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--field); color: var(--ink); font: 500 1.15rem/1 var(--body); font-variant-numeric: tabular-nums; }
.auc-row .btn { position: relative; white-space: nowrap; }
.auc-msg { min-height: 1.3em; font-size: 0.92rem; color: var(--jade); }
.auc-msg.bad { color: #ff8a7a; }
.auc-msg:empty { display: none; }
.auc-bids { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--crackle); }
.auc-bids:empty { display: none; }
.auc-bids li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--crackle); font-size: 0.92rem; color: var(--ink-2); }
.auc-bids li:first-child { color: var(--ink); }
.auc-bids li:first-child b { color: var(--jade); }
.auc-bids li.me span { color: var(--jade); font-weight: 600; }
.auc-bids b { font-weight: 600; font-variant-numeric: tabular-nums; }
.auc-bids time { font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.auc-bids li.new { animation: auc-row 0.7s var(--ease); }
@keyframes auc-row { from { transform: translateY(-14px); opacity: 0; background: color-mix(in srgb, var(--jade) 30%, transparent); } }
.auc.shake { animation: auc-shake 0.45s; }
@keyframes auc-shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.auc-claim { padding: 0; background: none; }
.auc-claim h2 { font-size: 1.5rem; color: var(--jade); }
.auc-claim label:has([type=radio]) { display: flex; gap: 8px; align-items: center; }
/* Gold sparks on a new bid, confetti for the winner, and the seal that stamps "sold". */
.spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #fbe8ad; box-shadow: 0 0 8px #e2bd66; pointer-events: none; animation: auc-spark 0.9s ease-out forwards; }
@keyframes auc-spark { to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }
.confetti { position: absolute; top: -12px; width: 8px; height: 14px; pointer-events: none; z-index: 3; animation: auc-fall 3.2s linear forwards; }
@keyframes auc-fall { to { transform: translateY(720px) rotate(var(--spin)); opacity: 0.2; } }
.auc-stamp { position: absolute; right: 14px; top: 54px; width: 108px; height: 108px; display: grid; place-content: center; justify-items: center; gap: 2px; border-radius: 50%; border: 3px solid var(--seal); outline: 1px solid var(--seal); outline-offset: -8px; color: var(--seal); background: color-mix(in srgb, var(--celadon) 70%, transparent); transform: rotate(-14deg); pointer-events: none; }
.auc-stamp span { font: 400 2rem/1 var(--brush); }
.auc-stamp b { font: 700 0.8rem/1 var(--display); letter-spacing: 0.3em; padding-left: 0.3em; }
.auc-stamp.go { animation: auc-stamp 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes auc-stamp { from { transform: rotate(8deg) scale(3); opacity: 0; } 70% { transform: rotate(-16deg) scale(0.92); opacity: 1; } }
@media (max-width: 520px) { .auc-main { grid-template-columns: 1fr; } .auc-clock { text-align: left; } .auc-stamp { width: 88px; height: 88px; top: 48px; } .auc-stamp span { font-size: 1.6rem; } }
@media (prefers-reduced-motion: reduce) { .auc *, .auc { animation: none !important; } }
.pill-auction { background: var(--seal); color: #fbf3e2; }
.auc-line { color: var(--jade); }
.bid-list li { grid-template-columns: minmax(0, 1fr) auto auto; }
#auction-dlg .err:empty { display: none; }

/* Auction as a game: ring timer, heat meter, big bid button, banners, countdown, ranked leaderboard */
.auc { border-radius: 14px; border-width: 2px; padding: 18px; background: radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--jade) 14%, transparent), transparent 60%), color-mix(in srgb, var(--celadon) 86%, transparent); }
.auc-top-r { display: inline-flex; align-items: center; gap: 10px; }
.auc-sound { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--crackle); border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.auc-sound[aria-pressed="true"] { color: var(--jade); border-color: var(--jade); }
.auc-sound svg { width: 20px; height: 20px; }
.auc-main { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.auc-ring { position: relative; width: 118px; height: 118px; flex: none; }
.auc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.auc-ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: var(--crackle); }
.ring-fg { stroke: var(--jade); stroke-linecap: round; transition: stroke-dashoffset 0.2s linear, stroke 0.3s; }
.auc.urgent .ring-fg { stroke: #ff8a7a; }
.ring-in { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; }
.ring-in .auc-label { font-size: 0.6rem; letter-spacing: 0.14em; }
.auc-ring .auc-time { margin: 0; font-size: 1.15rem; }
.auc-heat { display: flex; align-items: center; gap: 12px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--jade); }
.heat-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--crackle); overflow: hidden; }
.heat-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e2bd66, #ff8a7a); transition: width 0.5s var(--ease); }
.auc-heat.war { color: #ff8a7a; }
.motion .auc-heat.war > span:first-child { animation: auc-pulse 0.7s ease-in-out infinite; }
.auc-ext { justify-self: center; margin: 0; padding: 5px 16px; border-radius: 99px; background: var(--jade); color: var(--on-action); font-size: 0.85rem; font-weight: 700; }
.auc-go { position: relative; overflow: hidden; width: 100%; min-height: 62px; padding: 0 20px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #f6dc95, #d9b05a 55%, #c2933f); color: #2a1c05; font: 700 1.25rem/1 var(--display); letter-spacing: 0.06em; cursor: pointer; box-shadow: 0 6px 0 #7d5a1c, 0 16px 26px -10px rgba(0, 0, 0, 0.7); transition: transform 0.08s, box-shadow 0.08s, filter 0.2s; }
.auc-go:hover { filter: brightness(1.06); }
.auc-go:active { transform: translateY(4px); box-shadow: 0 2px 0 #7d5a1c, 0 8px 14px -8px rgba(0, 0, 0, 0.7); }
.auc-go:disabled { filter: saturate(0.4) brightness(0.8); cursor: progress; }
.auc-go::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%); transform: translateX(-120%); }
.motion .auc-go::after { animation: auc-shine 3.2s ease-in-out infinite; }
@keyframes auc-shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.auc-go.nudge { animation: auc-nudge 0.25s var(--ease); }
@keyframes auc-nudge { 50% { transform: scale(1.04); } }
.auc-row input { min-height: 56px; border-radius: 10px; font-size: 1.3rem; text-align: center; }
.auc-quick .chip { flex: 1; border-color: var(--jade); color: var(--jade); font-weight: 600; }
.auc-quick .chip:hover { background: color-mix(in srgb, var(--jade) 16%, transparent); }
.coin { position: absolute; left: 50%; top: 50%; z-index: 4; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6cf, #e2bd66 55%, #a9812f); box-shadow: 0 0 8px rgba(226, 189, 102, 0.8); pointer-events: none; animation: auc-coin 1s cubic-bezier(0.2, 0.7, 0.4, 1) forwards; }
@keyframes auc-coin { 60% { opacity: 1; } to { transform: translate(var(--dx), calc(var(--dy) + 70px)) rotate(540deg) scale(0.5); opacity: 0; } }
.auc-float { position: absolute; left: 100%; top: -4px; margin-left: 8px; white-space: nowrap; font: 700 1.3rem/1 var(--body); color: #fbe8ad; text-shadow: 0 0 12px rgba(226, 189, 102, 0.9); pointer-events: none; animation: auc-float 1.2s ease-out forwards; }
@keyframes auc-float { from { transform: translateY(14px) scale(0.6); opacity: 0; } 20% { transform: translateY(0) scale(1.15); opacity: 1; } to { transform: translateY(-46px) scale(1); opacity: 0; } }
.auc-banner { position: absolute; left: 50%; top: 58px; z-index: 5; padding: 9px 24px; border-radius: 99px; font: 700 1.3rem/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateX(-50%); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.8); }
.auc-banner.bad { background: var(--seal); color: #fff; }
.auc-banner.good, .auc-banner.win { background: linear-gradient(180deg, #f6dc95, #c99a43); color: #2a1c05; }
.auc-banner.info { background: var(--ink); color: var(--celadon); }
.auc-banner.go { animation: auc-banner 1.9s var(--ease) both; }
.auc-banner.win.go { animation-duration: 4.2s; font-size: 1.8rem; }
@keyframes auc-banner { 0% { opacity: 0; transform: translateX(-50%) scale(2.2); } 12% { opacity: 1; transform: translateX(-50%) scale(0.94); } 18%, 80% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(1); } }
.auc-big { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font: 700 clamp(7rem, 30vw, 11rem)/1 var(--display); color: rgba(255, 138, 122, 0.85); pointer-events: none; opacity: 0; }
.auc-big.go { animation: auc-big 0.95s ease-out both; }
@keyframes auc-big { from { opacity: 0.9; transform: scale(1.7); } to { opacity: 0; transform: scale(0.8); } }
.auc.flash-bad { animation: auc-shake 0.45s, auc-flash-bad 0.9s; }
.auc.flash-good { animation: auc-flash-good 0.9s; }
@keyframes auc-flash-bad { 20% { box-shadow: inset 0 0 0 3px var(--seal), 0 0 46px rgba(168, 53, 42, 0.8); } }
@keyframes auc-flash-good { 20% { box-shadow: inset 0 0 0 3px #f6dc95, 0 0 46px rgba(226, 189, 102, 0.7); } }
.auc-bids li { grid-template-columns: 28px 30px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.rk { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); border: 1px solid var(--crackle); }
.rk1 { border: 0; background: linear-gradient(180deg, #f6dc95, #c99a43); color: #2a1c05; }
.rk2 { border-color: #c9ced2; color: #dfe4e8; }
.rk3 { border-color: #b98a5e; color: #d9a777; }
.crown { width: 16px; height: 16px; }
.av { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: hsl(var(--hue) 42% 36%); color: #fff; font-size: 0.82rem; font-weight: 700; }
.auc-bids .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auc-lead { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--jade) 14%, transparent); border: 1px solid var(--jade); }
.auc-lead .crown { flex: none; width: 26px; height: 26px; }
.motion .auc-lead .crown { animation: auc-nudge 1.6s ease-in-out infinite; }
@media (max-width: 520px) {
  .auc-main { grid-template-columns: minmax(0, 1fr) auto; }
  .auc-ring { width: 96px; height: 96px; } .auc-ring .auc-time { font-size: 1rem; }
  .auc-amount { font-size: clamp(2rem, 10vw, 2.6rem); }
  .auc-bids time { display: none; } .auc-bids li { grid-template-columns: 28px 30px minmax(0, 1fr) auto; }
  .auc-float { left: auto; right: 0; top: -22px; margin: 0; }
}
.auc:not([data-state="live"]):not([data-state="loading"]) .auc-ring { visibility: hidden; }

/* Auction section: its own page and menu link */
.site nav .nav-auction { color: #ff9c8d; }
@media (max-width: 560px) { .site nav a[href="auctions.html"] { display: none; } }
.auc-card { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--crackle); }
.auc-card > span { display: grid; gap: 3px; }
.auc-card > span + span { text-align: right; }
.auc-card small { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.auc-card b { font: 500 1.3rem/1 var(--display); color: var(--jade); font-variant-numeric: tabular-nums; }
.auc-card .auc-left { font: 500 1.05rem/1.2 ui-monospace, 'Cascadia Mono', monospace; color: var(--ink); }
.auc-card .auc-left.urgent { color: #ff8a7a; }
.auc-card-foot { margin-top: 8px; font-size: 0.85rem; color: var(--ink-2); }
.auc-card-foot b { color: var(--jade); font-weight: 600; }
.auc-empty { padding: clamp(32px, 5vw, 64px) 0; color: var(--ink-2); font-size: 1.1rem; }
.auc-how { margin: clamp(56px, 7vw, 104px) 0 clamp(32px, 4vw, 56px); }
.auc-how h2 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); margin-bottom: clamp(24px, 3vw, 40px); }

/* Product and cart: readable buying information on the temple-night background. */
.shopping-page .shop-panel { background: #191c18; border: 1px solid var(--crackle); padding: clamp(20px, 2.4vw, 32px); border-radius: 8px; min-width: 0; }
.shopping-page .shop-panel > * + * { margin-top: 16px; }
.shopping-page .shop-panel h2 { font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.35; }
.shopping-page .shop-panel p { max-width: none; }
.shopping-page .btn { min-height: 48px; white-space: normal; text-align: center; }
.shopping-page .btn:disabled { opacity: .65; cursor: default; }
.shopping-page .shop-panel .note { color: var(--ink-2); font-size: .9rem; line-height: 1.6; }
.shopping-page .shop-back { padding-block: 24px; }
.shopping-page .shop-empty { margin-block: 32px 64px; max-width: 760px; }
.shopping-page .shop-empty .btn, .shopping-page .shop-empty .link { display: inline-flex; margin-right: 16px; }
.shopping-page .shop-empty p, .shopping-page .shop-empty h2 { margin-bottom: 18px; }
.shopping-page .shop-notice { border-left: 3px solid var(--jade); padding-left: 16px; }
.shopping-page .shop-warning { color: var(--jade); font-size: .9rem; }
.shopping-page .shop-inquiry { display: flex; width: 100%; }
.shopping-page .shop-divider { border-top: 1px solid var(--crackle); padding-top: 24px; }
.shopping-page .shop-divider > * + * { margin-top: 14px; }
.shopping-page .shop-divider .link { display: inline-block; }
.shopping-page .shop-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.shopping-page .shop-actions > * { flex: 1 1 160px; }
.shopping-page .shop-feedback:empty { display: none; }
.shopping-page .shop-feedback { color: var(--jade); }
.shopping-page .product-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: 'gallery heading' 'gallery purchase' 'details certificate'; gap: 24px 40px; margin-bottom: 64px; align-items: start; }
.shopping-page .product-heading { grid-area: heading; padding-block: 8px; }
.shopping-page .product-heading h1 { font-size: clamp(1.9rem, 3vw, 2.8rem); line-height: 1.2; margin-block: 12px; overflow-wrap: anywhere; }
.shopping-page .shop-eyebrow { color: var(--jade); font-size: .9rem; }
.shopping-page .product-accent { color: var(--ink-2); }
.shopping-page .product-price { font-size: 2rem; margin-top: 16px; }
.shopping-page .product-gallery { grid-area: gallery; text-align: center; }
.shopping-page .product-image { display: grid; place-items: center; height: clamp(260px, 48vw, 520px); overflow: hidden; background: #121512; border-radius: 4px; }
.shopping-page .product-image img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.shopping-page .product-no-photo { padding: 24px; }
.shopping-page .product-no-photo .note { margin-top: 12px; }
.shopping-page .product-views { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.shopping-page .product-views .chip { min-height: 44px; padding: 8px 16px; }
.shopping-page .product-purchase { grid-area: purchase; }
.shopping-page .product-details { grid-area: details; }
.shopping-page .product-certificate { grid-area: certificate; }
.shopping-page .product-certificate .serial { overflow-wrap: anywhere; color: var(--jade); }
.shopping-page .product-certificate .btn { width: 100%; }
.shopping-page .facts { margin-block: 20px 0; grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr); }
.shopping-page .facts dd { overflow-wrap: anywhere; }
.shopping-page .product-mobile-buy { display: none; }
.shopping-page .page-head { padding-block: 32px 24px; }
.shopping-page .page-head p { margin-top: 14px; }
.shopping-page .shop-cart-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: 'items summary' 'checkout summary'; gap: 24px 32px; align-items: start; margin-bottom: 64px; }
.shopping-page .shop-cart-items { grid-area: items; }
.shopping-page .shop-cart-summary { grid-area: summary; position: sticky; top: 96px; }
.shopping-page .shop-checkout { grid-area: checkout; }
.shopping-page .shop-lines { margin: 0; padding: 0; list-style: none; }
.shopping-page .shop-line { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 16px; padding-block: 20px; border-bottom: 1px solid var(--crackle); align-items: start; }
.shopping-page .shop-line:first-child { padding-top: 0; }
.shopping-page .shop-line:last-child { border-bottom: 0; }
.shopping-page .shop-thumb { width: 76px; min-height: 95px; background: #121512; font-size: .75rem; display: grid; place-items: center; text-align: center; overflow: hidden; border-radius: 4px; }
.shopping-page .shop-thumb img { width: 76px; height: 95px; object-fit: cover; }
.shopping-page .shop-line-copy { min-width: 0; overflow-wrap: anywhere; }
.shopping-page .shop-line-copy .label-name { font-size: 1.1rem; }
.shopping-page .shop-line-copy .note { margin-top: 8px; }
.shopping-page .shop-remove { background: transparent; border: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; padding: 8px 0; min-height: 44px; cursor: pointer; font: inherit; font-size: .9rem; }
.shopping-page .shop-remove:disabled { opacity: .5; cursor: wait; }
.shopping-page .shop-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0; }
.shopping-page .shop-totals dd { margin: 0; text-align: right; }
.shopping-page .shop-totals dt:first-child, .shopping-page .shop-totals dd:nth-child(2) { font-size: 1.18rem; color: var(--jade); }
.shopping-page .shop-totals dd:last-child { font-size: .9rem; }
.shopping-page .field { margin-block: 20px 0; }
.shopping-page .field input, .shopping-page .field select { width: 100%; min-height: 48px; font-size: 1rem; }
.shopping-page .field select { background: var(--field); color: var(--ink); border: 1px solid var(--crackle); border-radius: 3px; padding: 10px 12px; font-family: inherit; }
.shopping-page .shop-form-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.shopping-page .shop-form-fields > legend { font: 500 1.4rem/1.4 var(--display); }
.shopping-page .shop-form-fields > p, .shopping-page .shop-form-fields > .btn { margin-top: 18px; }
.shopping-page .shop-form-fields > .btn, .shopping-page #co-signin { width: 100%; }
.shopping-page .shop-payment { margin: 24px 0 0; padding: 14px; border: 1px solid var(--crackle); min-width: 0; }
.shopping-page .pay { min-height: 44px; display: flex; align-items: center; gap: 12px; }
.shopping-page .pay input { flex: 0 0 auto; }
.shopping-page .err:empty { display: none; }
@media (max-width: 760px) {
  .shopping-page .product-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'heading' 'gallery' 'purchase' 'details' 'certificate'; gap: 20px; }
  .shopping-page .product-heading { padding: 0; }
  .shopping-page .product-price { margin-top: 10px; }
  .shopping-page .product-image { height: 320px; }
  .shopping-page .product-gallery { padding: 16px; }
  .shopping-page .shop-back { padding-block: 20px 12px; }
  .shopping-page .product-mobile-buy { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; display: flex; align-items: center; gap: 16px; padding: 12px var(--gutter) max(12px, env(safe-area-inset-bottom)); background: #191c18; border-top: 1px solid var(--jade); }
  .shopping-page .product-mobile-buy > div { flex: 1 1 auto; }
  .shopping-page .product-mobile-buy small { display: block; font-size: .75rem; color: var(--ink-2); }
  .shopping-page .product-mobile-buy .btn { flex: 0 1 65%; font-size: .9rem; padding-inline: 16px; }
  .piece-shop { padding-bottom: 88px; }
  .shopping-page .shop-cart-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'items' 'summary' 'checkout'; gap: 20px; }
  .shopping-page .shop-cart-summary { position: static; }
  .shopping-page .shop-line { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 14px; }
  .shopping-page .shop-thumb { width: 64px; grid-row: span 2; min-height: 80px; }
  .shopping-page .shop-thumb img { width: 64px; height: 80px; }
  .shopping-page .shop-line-price { grid-column: 2; grid-row: 2; }
  .shopping-page .shop-line-copy .note { font-size: .8rem; }
  .shopping-page .shop-panel { padding: 20px; }
}
/* Compact checkout: one summary/form column and no pre-order contact step. */
.shopping-page .shop-cart-simple { grid-template-areas: 'items summary'; }
.shopping-page .shop-cart-simple .shop-cart-summary { position: static; }
.shopping-page .shop-cart-simple .shop-totals dd { font-size: 1.3rem; }
.shopping-page .shop-line-copy .shop-remove { display: block; }
.shopping-page .shop-optional { margin-top: 20px; }
.shopping-page .shop-optional summary { cursor: pointer; min-height: 44px; padding-block: 10px; }
.shopping-page .shop-quote-items { margin-bottom: 32px; }
@media (max-width: 760px) {
  .shopping-page .shop-cart-simple { grid-template-areas: 'items' 'summary'; }
}
