/* CharMasks Counting Room page. Builds on CharMasks tokens.css + base.css (copied verbatim). */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .bar { display: flex; align-items: center; gap: 20px; padding-block: 18px; }
.mark { font: 500 21px/1 var(--display); letter-spacing: .06em; margin-right: auto; }
.lang-btn { font: 400 13px/1 var(--display); letter-spacing: .1em; color: var(--muted); padding: 6px 2px; }
.lang-btn:hover { color: var(--fg); }

.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(48px, 8vw, 104px) 0; }
.hero h1 { font: 400 clamp(34px, 5.4vw, 58px)/1.12 var(--display); letter-spacing: .02em; }
.hero h1 .zh { font-family: var(--serif); letter-spacing: .08em; }
.hero .lede { margin-top: 22px; font: 300 17px/1.8 var(--sans); color: var(--fg); max-width: 34em; }
.hero figure { margin: 0; }
.hero figure img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.hero figcaption { margin-top: 10px; }
.status { display: inline-flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gilt); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 26px; border: 1px solid var(--gilt); color: var(--fg); font: 400 14px/1 var(--sans); letter-spacing: .12em; transition: background .15s; }
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--gilt) 14%, transparent); }
.btn.solid { background: var(--gilt); color: var(--bg); }
.btn:disabled { border-color: var(--line); color: var(--faint); background: none; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.step { background: var(--bg); padding: 28px 24px 30px; }
.step .lotno { display: block; margin-bottom: 14px; }
.step h3 { font: 400 19px/1.3 var(--serif); letter-spacing: .06em; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 14px; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.fact { padding: 22px 18px 22px 0; border-bottom: 1px solid var(--line); }
.fact .v { display: block; margin-top: 8px; font: 400 24px/1.1 var(--display); letter-spacing: .02em; }
.ph { color: var(--faint); border-bottom: 1px dashed var(--faint); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.split h2 { font: 400 26px/1.25 var(--serif); letter-spacing: .06em; margin-bottom: 16px; }
.split p + p { margin-top: 12px; }
.register { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--line); }
.register li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.register b { font: 400 18px/1 var(--display); color: var(--gilt); font-weight: 400; }

.ai-box { border: 1px solid var(--line); background: var(--plinth); padding: 24px; }
.ai-box pre { margin: 16px 0 0; white-space: pre-wrap; font: 400 13px/1.7 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); max-height: 220px; overflow: auto; }

.rules { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 44px 1fr; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.rules li::before { content: counter(r, upper-roman); font: 400 14px/1.7 var(--display); color: var(--faint); letter-spacing: .1em; }
.rules strong { color: var(--fg); font-weight: 400; }
.conditions-details summary { cursor: pointer; min-height: 46px; padding-block: 12px; color: var(--gilt); }
.addr { font: 400 12.5px/1.6 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }

.site-foot { margin-top: var(--section); padding-block: 40px 56px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.site-foot a { border-bottom: 1px solid var(--line); }

/* Controls share the catalogue's rules and gilt accents. */
.skip { position: absolute; left: 20px; top: -100px; z-index: 20; background: var(--bg); padding: 12px; }
.skip:focus { top: 0; }
.hero > *, .split > *, .fact, .step { min-width: 0; }
.hero h1 { overflow-wrap: anywhere; }
.patron { border-top: 1px solid var(--gilt); margin-top: var(--section); padding-top: 36px; }
.patron .cap { margin-bottom: 16px; color: var(--gilt); }
.small { font-size: 13px; margin-top: 12px; }
.wallet-line, .entry-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.wallet-line { margin-bottom: 16px; }
.entry-form { margin-top: 28px; }
.entry-form p { flex-basis: 100%; margin-top: 0; }
input { background: var(--plinth); border: 1px solid var(--line); border-radius: 0; min-height: 46px; padding: 8px 12px; max-width: 100%; min-width: 0; }
input[type="number"] { width: 90px; }
input[type="text"] { width: 260px; }
.btn { line-height: 1.4; padding-block: 10px; text-align: center; max-width: 100%; }
.fact .v { overflow-wrap: anywhere; line-height: 1.3; }
.collection { margin-top: 42px; }
.collection h3 { margin-bottom: 16px; }
.collection .v { font-size: 21px; }
.notice { margin-top: 24px; border-left: 2px solid var(--gilt); padding-left: 16px; overflow-wrap: anywhere; }
.notice:has(p:empty):not(:has(a:not([hidden]))) { display: none; }
.notice .btn { margin-top: 12px; }
.preview-meter { margin-top: 24px; max-width: 640px; }
progress { display: block; width: 100%; height: 7px; margin-block: 12px; accent-color: var(--gilt); background: var(--line); border: 0; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--gilt); }
.ai-box pre { overflow-wrap: anywhere; }
.addresses { margin: 0; }
.addresses > div { padding: 18px 0; border-top: 1px solid var(--line); }
.addresses dd { margin: 8px 0 0; }
.addresses a[href], #ref-link, #tx-link { border-bottom: 1px solid var(--line); }
#ref-link { display: inline-block; margin-top: 12px; }
.danger { color: var(--danger); }
@media (max-width: 480px) {
  .hero figure { max-width: 100%; }
  .actions { gap: 10px; }
  .btn { padding-inline: 16px; }
  .entry-form label { flex-basis: 100%; }
  .register li { align-items: start; }
  .register b { line-height: 1.4; white-space: nowrap; }
  .fact { padding-right: 12px; }
  .ai-box { padding: 18px; }
}

/* language toggle: zh is default; en hidden unless html[lang=en] */
[data-l="en"] { display: none; }
html[lang="en"] [data-l="en"] { display: revert; }
html[lang="en"] [data-l="zh"] { display: none; }

@media (max-width: 820px) {
  .cap { font-size: 12px; line-height: 1.5; letter-spacing: .12em; }
  .rules li { grid-template-columns: 30px 1fr; }
  .hero, .split { grid-template-columns: 1fr; }
  .hero figure { order: -1; max-width: 420px; }
  .steps { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
}
