@font-face { font-family: "STIX Two Text"; src: url(/fonts/stix-normal-400.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "STIX Two Text"; src: url(/fonts/stix-italic-400.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #ebe5e3;
  --surface: #e1dad7;
  --paper: #f5f1ef;
  --ink: #2b2622;
  --muted: #645b57;
  --accent: #1d5e40;
  --accent-ink: #ffffff;
  --f-blush: #e3cfc8;
  --f-stone: #dad3ca;
  --f-sage: #cfd4c8;
  --serif: "STIX Two Text", "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1.02rem + 0.2vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --step-head: clamp(2rem, 1.2rem + 3.4vw, 4.25rem);
  --m: clamp(16px, 2.4vw, 32px);
  --gap: 8px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, figure, ol { margin: 0; }
h2 { font: 600 var(--step-head)/1.08 var(--serif); letter-spacing: -0.02em; }
.lead { font-size: var(--step-lead); line-height: 1.5; max-width: 30em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.f-blush { background: var(--f-blush); } .f-stone { background: var(--f-stone); } .f-sage { background: var(--f-sage); } .f-paper { background: var(--paper); }

.wordmark, .ft-wm { text-decoration: none; display: inline-flex; align-items: baseline; gap: .35em; }
.wm-zh { font-family: var(--serif); font-weight: 600; }
.wm-en { font-family: "STIX Two Text", serif; font-style: italic; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 0;
  font: 600 1.0625rem/1 var(--sans); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: #fff; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--accent); color: var(--accent-ink); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: .9375rem; }
.btn[disabled] { background: var(--surface); color: var(--muted); cursor: not-allowed; transform: none; }

/* ---------- hero: the sample wall ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: var(--bg); }
.wall { position: absolute; inset: -40px 0 0; display: flex; flex-direction: column; gap: var(--gap); --t: clamp(104px, 8.6vw, 148px); }
.row { display: flex; gap: var(--gap); width: max-content; will-change: transform; }
.row:nth-child(even) { margin-left: calc(var(--t) / -2); }
.tile {
  flex: 0 0 var(--t); height: calc(var(--t) * 4 / 3); border: 0; padding: 0; cursor: pointer;
  display: block; background: var(--f-blush); overflow: hidden;
  transition: background-color .3s var(--ease);
}
.tile:nth-child(3n+1) { background: var(--f-stone); }
.tile:nth-child(3n+2) { background: var(--f-sage); }
.row:nth-child(3n+1) .tile:nth-child(3n) { background: var(--f-sage); }
.row:nth-child(3n+1) .tile:nth-child(3n+2) { background: var(--f-blush); }
.tile img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(1.1) contrast(.94); mix-blend-mode: multiply; transition: filter .45s var(--ease), transform .6s var(--ease); pointer-events: none; }
.tile:hover img, .tile:focus-visible img, .tile.lit img { filter: none; mix-blend-mode: normal; transform: scale(1.04); }

.dock {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(840px, calc(100% - 2 * var(--m))); background: var(--ink); color: var(--paper);
  padding: 28px 28px 22px; display: grid; gap: 22px;
}
.dock-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.dock-line { font: 600 clamp(1.375rem, 1.1rem + .9vw, 1.75rem)/1.32 var(--serif); letter-spacing: .01em; }
.dock-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 26px; font-size: .9375rem; }
.dock-nav a { text-decoration: none; color: #d9d1cd; transition: color .2s; }
.dock-nav a:hover { color: #fff; }
.dock-nav .wordmark { color: var(--paper); font-size: 1.25rem; margin-right: auto; }

/* ---------- studio ---------- */
.studio {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px;
  padding: clamp(96px, 12vw, 180px) var(--m) clamp(96px, 10vw, 160px);
}
.studio-side { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 24px; align-self: start; position: sticky; top: 32px; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: 8px; }
.slot { position: relative; }
.slot-face {
  display: block; position: relative; aspect-ratio: 3 / 4; cursor: pointer; overflow: hidden;
  background: var(--surface); transition: background-color .2s var(--ease);
}
.slot[data-kind="design"] .slot-face { background: var(--f-blush); }
.slot[data-kind="hand"] .slot-face { background: var(--f-stone); }
.slot-face:hover { background: var(--paper) !important; }
.slot-pic { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transition: opacity .3s var(--ease); }
.slot.has .slot-pic { opacity: 1; }
.slot-empty { position: absolute; inset: 0; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.slot.has .slot-empty { display: none; }
.slot-name { font: 600 1.375rem/1.2 var(--serif); }
.slot-hint { font-size: .9375rem; line-height: 1.45; color: var(--muted); }
.slot-empty::before, .slot-empty::after {
  content: ""; position: absolute; left: 18px; top: 31px; width: 30px; height: 3px; background: var(--ink);
  transition: transform .3s var(--ease);
}
.slot-empty::after { transform: rotate(90deg); }
.slot-face:hover .slot-empty::before { transform: rotate(90deg); }
.slot-face:hover .slot-empty::after { transform: rotate(180deg); }
.slot-clear {
  position: absolute; right: 0; top: 0; display: none; min-height: 40px; padding: 0 14px;
  border: 0; background: var(--ink); color: var(--paper); font-size: .875rem; cursor: pointer;
}
.slot.has .slot-clear { display: block; }

.length { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.length legend { float: left; font-weight: 600; margin-right: 10px; padding: 0; }
.length label { cursor: pointer; }
.length input { position: absolute; opacity: 0; pointer-events: none; }
.length span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--surface); font-size: .9375rem; transition: background-color .2s, color .2s; }
.length input:checked + span { background: var(--ink); color: var(--paper); }
.length input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-go { width: 100%; min-height: 64px; font-size: 1.1875rem; }
.note { font-size: var(--step-small); color: var(--muted); min-height: 1.6em; }
.note.err { color: #8c2f24; }

.stage { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: 12px; }
.frame { position: relative; aspect-ratio: 3 / 4; background: var(--surface); overflow: hidden; touch-action: manipulation; }
.frame-img, .frame-live { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.frame-live { opacity: 0; pointer-events: none; }
.stage.live .frame-live { opacity: 1; }
.frame-tag { position: absolute; left: 16px; top: 14px; font-size: .875rem; background: var(--paper); padding: 4px 10px; }
.stage[data-state="result"] .frame-tag { display: none; }
.frame-wait { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--f-blush); text-align: center; padding: 24px; }
.stage[data-state="wait"] .frame-wait { display: flex; }
.wait-tips { display: flex; align-items: flex-end; gap: 12px; height: 92px; margin-bottom: 18px; }
.wait-tips span {
  width: 30px; height: 46px; border-radius: 15px 15px 9px 9px; background: var(--paper);
  transform-origin: bottom; animation: paint 2.6s var(--ease) infinite;
}
.wait-tips span:nth-child(1) { height: 52px; animation-delay: 0s; }
.wait-tips span:nth-child(2) { height: 64px; animation-delay: .18s; }
.wait-tips span:nth-child(3) { height: 70px; animation-delay: .36s; }
.wait-tips span:nth-child(4) { height: 62px; animation-delay: .54s; }
.wait-tips span:nth-child(5) { height: 48px; animation-delay: .72s; }
@keyframes paint {
  0%, 12% { background: var(--paper); transform: scaleY(.92); }
  40%, 70% { background: var(--ink); transform: scaleY(1); }
  100% { background: var(--paper); transform: scaleY(.92); }
}
.wait-text { font: 400 3rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.wait-sub { color: var(--muted); font-size: .9375rem; }

.stage-bar { display: flex; flex-wrap: wrap; gap: var(--gap); }
.chip {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 0; background: var(--surface); cursor: pointer;
  font-size: .9375rem; transition: background-color .2s, color .2s, transform .15s;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.chip:hover:not([disabled]) { background: var(--paper); }
.chip:active:not([disabled]) { transform: scale(.97); }
.chip[disabled] { color: #a59c98; cursor: default; }

#b-live.on { background: var(--ink); color: var(--paper); }

/* ---------- index with preview ---------- */
.index { padding: clamp(96px, 10vw, 180px) var(--m); background: var(--paper); }
.index-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 20px; margin-bottom: 56px; }
.index-head h2 { grid-column: 1 / span 7; }
.index-head .lead { grid-column: 8 / span 5; align-self: end; }
.index-body { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
.index-list { grid-column: 1 / span 6; list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.index-list li { display: block; }
.ix {
  width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border: 0; background: transparent; text-align: left; cursor: pointer;
  transition: background-color .24s var(--ease), opacity .24s var(--ease);
}
.ix-name { font: 600 clamp(1.25rem, 1rem + 1vw, 1.75rem)/1.2 var(--serif); }
.ix-fact { font-size: .9375rem; color: var(--muted); }
.ix-thumb { display: none; }
.index-list.hovering .ix { opacity: .38; }
.index-list .ix.cur, .index-list .ix:hover, .index-list .ix:focus-visible { opacity: 1; background: var(--bg); }
.ix-use { font-size: .875rem; font-weight: 600; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.ix:hover .ix-use, .ix:focus-visible .ix-use, .ix.cur .ix-use { opacity: 1; }
.index-preview { grid-column: 8 / span 4; position: sticky; top: 32px; align-self: start; }
.index-credit { margin-top: 10px; font-size: var(--step-small); color: var(--muted); }
.index-frame { position: relative; aspect-ratio: 3 / 4; background: var(--f-blush); overflow: hidden; transition: background-color .24s var(--ease); }
.index-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .24s var(--ease), transform .6s var(--ease); transform: scale(1.04); }
.index-frame img.on { opacity: 1; transform: none; }

/* ---------- how: tiles that grow ---------- */
.how { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 10px; padding: clamp(96px, 10vw, 180px) var(--m); position: relative; }
.how-h { grid-column: 1 / span 6; grid-row: 1; align-self: start; max-width: 9em; }
.how-row { display: contents; }
.how-step { grid-row: 1; align-self: end; display: flex; flex-direction: column; gap: 16px; }
.how-step.s1 { grid-column: 1 / span 3; margin-top: 260px; }
.how-step.s2 { grid-column: 4 / span 4; }
.how-step.s3 { grid-column: 8 / span 5; }
.how-tile { position: relative; overflow: hidden; }
.s1 .how-tile { height: 30vh; min-height: 220px; }
.s2 .how-tile { height: 44vh; min-height: 320px; }
.s3 .how-tile { height: 60vh; min-height: 420px; }
.how-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.how-step figcaption { display: grid; gap: 4px; padding-right: 12%; }
.how-name { font: 600 1.25rem/1.3 var(--serif); }
.how-text { font-size: 1rem; color: var(--muted); }

/* ---------- pair ---------- */
.pair { display: grid; grid-template-columns: 1fr 1fr; }
.pair-panel { position: relative; height: 92svh; min-height: 600px; overflow: hidden; }
.pair-obj { position: absolute; left: 50%; bottom: 0; width: 135%; max-width: none; height: auto; transform: translateX(-50%); top: -6%; }
.pair-h { position: absolute; left: 28px; top: 28px; z-index: 2; font-size: clamp(2rem, 1.4rem + 1.6vw, 2.75rem); background: var(--f-stone); padding: 4px 10px 8px 0; }
.pair-row { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 20px 28px 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pair-row p { display: grid; gap: 2px; background: var(--paper); padding: 12px 16px; }
.pair-name { font: 600 1.25rem/1.3 var(--serif); }
.pair-fact { font-size: 1.0625rem; }
.pair-act { display: flex; gap: var(--gap); }
.pair-credit { position: absolute; right: 28px; top: 28px; z-index: 2; font-size: .8125rem; background: var(--paper); padding: 4px 10px; }

/* ---------- faq ---------- */
.faq { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; padding: clamp(96px, 10vw, 180px) var(--m); }
.faq-h { grid-column: 1 / span 4; position: sticky; top: 96px; align-self: start; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.75rem); }
.faq-list { grid-column: 5 / span 8; display: flex; flex-direction: column; gap: var(--gap); }
.faq details { background: var(--surface); transition: background-color .25s var(--ease), color .25s var(--ease); }
.faq details[open] { background: var(--accent); color: var(--accent-ink); }
.faq summary {
  list-style: none; cursor: pointer; min-height: 72px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font: 600 1.25rem/1.35 var(--serif);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { position: relative; flex: 0 0 16px; height: 16px; }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 0; top: 6.5px; width: 16px; height: 3px; background: currentColor; transition: transform .25s var(--ease); }
.faq summary i::after { transform: rotate(90deg); }
.faq details[open] summary i::after { transform: rotate(0deg); }
.faq details p { padding: 0 24px 26px; max-width: 52ch; font-size: 1.0625rem; }

/* ---------- footer of tiles ---------- */
.foot { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); padding: 0 10px 10px; }
.ft { padding: 24px; display: flex; flex-direction: column; justify-content: space-between; min-height: 220px; text-decoration: none; }
.ft-say { grid-column: 1 / span 4; }
.ft-nav { grid-column: 5 / span 3; justify-content: flex-start; gap: 8px; font-size: 1.0625rem; }
.ft-nav a { text-decoration: none; } .ft-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.ft-time { grid-column: 8 / span 2; }
.ft-mail { grid-column: 10 / span 3; }
.ft-big { font: 600 1.5rem/1.35 var(--serif); }
.ft-mid { font: 400 1.375rem/1.3 var(--serif); font-variant-numeric: tabular-nums; text-decoration: none; overflow-wrap: anywhere; }
.ft-small { font-size: var(--step-small); color: var(--muted); }
.ft-mark { grid-column: 1 / span 8; min-height: 320px; background: var(--ink); color: var(--paper); align-items: center; justify-content: center; }
.ft-wm { font-size: clamp(3.5rem, 9vw, 9rem); line-height: 1; letter-spacing: -0.02em; }
.ft-cta { grid-column: 9 / span 4; min-height: 320px; background: var(--accent); color: var(--accent-ink); }
.ft-cta span { font: 600 1.75rem/1.3 var(--serif); }
.ft-cta svg { align-self: flex-end; transition: transform .3s var(--ease); }
.ft-cta:hover svg { transform: translate(6px, -6px); }

.toast { position: fixed; left: 50%; bottom: 24px; visibility: hidden; transform: translate(-50%, calc(100% + 48px)); background: var(--ink); color: var(--paper); padding: 14px 20px; font-size: .9375rem; z-index: 20; transition: transform .35s var(--ease); max-width: calc(100% - 32px); }
.toast.show { visibility: visible; transform: translate(-50%, 0); }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.pair-obj { transition: transform 1.4s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .row { transform: none !important; }
  .wait-tips span { animation: none; background: var(--ink); }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .wall { --t: 26vw; gap: 6px; }
  .row { gap: 6px; }
  .hero { height: 100svh; min-height: 620px; }
  .dock { left: 0; bottom: 0; transform: none; width: 100%; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); gap: 18px; }
  .dock-main { flex-direction: column; align-items: stretch; gap: 18px; }
  .dock-line { font-size: 6vw; }
  .dock-main .btn { width: 100%; }
  .dock-nav { gap: 6px 18px; font-size: .875rem; }
  .dock-nav .wordmark { width: 100%; margin: 0 0 2px; }

  .studio { display: flex; flex-direction: column; gap: 28px; padding-top: 72px; }
  .studio-side { position: static; gap: 20px; }
  .stage { order: 2; }
  .length legend { width: 100%; margin-bottom: 6px; }
  .btn-go { position: sticky; bottom: 12px; z-index: 5; }

  .index-head, .index-body { display: block; }
  .index-head .lead { margin-top: 16px; }
  .index-head { margin-bottom: 28px; }
  .index-preview { display: none; }
  .ix { padding: 10px; align-items: center; justify-content: flex-start; }
  .ix-thumb { display: block; flex: 0 0 60px; height: 80px; background: var(--f-blush); overflow: hidden; }
  .ix-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .ix-txt { display: grid; gap: 2px; flex: 1; }
  .ix-use { opacity: 1; }
  .index-list.hovering .ix { opacity: 1; }

  .how { display: flex; flex-direction: column; gap: 28px; }
  .how-h { max-width: none; font-size: 1.875rem; }
  .how-step.s1 { margin-top: 0; }
  .s1 .how-tile { height: 34vw; min-height: 0; }
  .s2 .how-tile { height: 46vw; min-height: 0; }
  .s3 .how-tile { height: 62vw; min-height: 0; }
  .how-tile img { object-position: center 30%; }

  .pair { grid-template-columns: 1fr; }
  .pair-panel { height: 78svh; min-height: 480px; }
  .pair-obj { width: 150%; }
  .pair-h { left: 18px; top: 18px; font-size: 1.625rem; }
  .pair-row { flex-direction: column; align-items: stretch; padding: 16px 18px 20px; }
  .pair-act { display: grid; grid-template-columns: 1fr 1fr; }
  .pair-credit { right: 18px; top: 18px; }

  .faq { display: block; }
  .faq-h { position: static; font-size: 9vw; margin-bottom: 24px; }
  .faq-list { gap: 6px; }
  .faq summary { min-height: 64px; padding: 14px 20px; font-size: 1.125rem; }
  .faq details p { padding: 0 20px 20px; font-size: 1rem; }

  .foot { grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 6px 6px; }
  .ft { padding: 20px; min-height: 150px; }
  .ft-mark { grid-column: 1 / -1; order: 1; min-height: 160px; }
  .ft-cta { grid-column: 1 / -1; order: 2; min-height: 160px; }
  .ft-nav { grid-column: 1; order: 3; }
  .ft-mail { grid-column: 2; order: 4; }
  .ft-time { grid-column: 1; order: 5; }
  .ft-say { grid-column: 2; order: 6; }
  .ft-big { font-size: 1.25rem; }
  .ft-mid { font-size: 1.0625rem; }
  .ft-wm { font-size: 15vw; }
}

/* ---------- match: read the hand, find on Xiaohongshu ---------- */
.match { padding: clamp(96px, 10vw, 180px) var(--m); background: var(--f-blush); }
.match-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 20px; margin-bottom: 48px; }
.match-head h2 { grid-column: 1 / span 7; max-width: 11em; }
.match-head .lead { grid-column: 8 / span 5; align-self: end; }
.match-ctl { display: flex; flex-wrap: wrap; align-items: stretch; gap: 16px 24px; }
.match-hand { display: flex; align-items: center; gap: 14px; border: 0; padding: 0 18px 0 0; background: var(--paper); cursor: pointer; min-height: 96px; text-align: left; transition: background-color .2s; }
.match-hand:hover { background: #fff; }
.mh-pic { width: 72px; height: 96px; background: var(--f-stone) center / cover no-repeat; flex: 0 0 72px; }
.mh-txt { font: 600 1.0625rem/1.4 var(--serif); max-width: 9em; }
.prefs { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 420px; }
.prefs legend { float: left; font-weight: 600; margin-right: 10px; padding: 0; }
.prefs label { cursor: pointer; }
.prefs input { position: absolute; opacity: 0; pointer-events: none; }
.prefs span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--paper); font-size: .9375rem; transition: background-color .2s, color .2s; }
.prefs input:checked + span { background: var(--ink); color: var(--paper); }
.prefs input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.match-go { min-height: 64px; padding: 0 40px; font-size: 1.1875rem; align-self: center; }

.match-run { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 32px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.steps li { padding: 10px 16px; background: var(--paper); color: var(--muted); font-size: .9375rem; transition: background-color .3s, color .3s; }
.steps li.on { background: var(--ink); color: var(--paper); }
.steps li.ok { background: var(--paper); color: var(--ink); }
.steps-s { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }

.reading { margin-top: 40px; background: var(--ink); color: var(--paper); padding: clamp(24px, 3vw, 48px); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 28px; }
.reading-say { grid-column: 1 / span 7; font: 400 clamp(1.25rem, 1rem + 1vw, 1.75rem)/1.55 var(--serif); }
.reading-facts { grid-column: 9 / span 4; margin: 0; display: grid; gap: 8px; align-content: start; font-size: 1rem; }
.reading-facts div { display: grid; grid-template-columns: 3em 1fr; gap: 12px; }
.reading-facts dt { color: #bdb3ae; }
.reading-facts dd { margin: 0; }
.reading-cols { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.reading-k { color: #bdb3ae; font-size: .9375rem; margin-bottom: 6px; }
.reading-v { font-size: 1.0625rem; line-height: 1.6; }
.reading-note { grid-column: 1 / -1; color: #bdb3ae; font-size: var(--step-small); }

.picks { margin-top: 12px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.pick { grid-column: span 4; display: flex; flex-direction: column; background: var(--paper); }
.pick.big { grid-column: span 6; }
.pick.mid { grid-column: span 6; }
.pick-frame { position: relative; aspect-ratio: 3 / 4; background: var(--surface); overflow: hidden; }
.pick-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .4s var(--ease); }
.pick-frame .p-try { opacity: 0; }
.pick.tried .pick-frame .p-try { opacity: 1; }
.pick.tried.showsrc .pick-frame .p-try { opacity: 0; }
.pick-tag { position: absolute; left: 12px; top: 12px; background: var(--paper); padding: 4px 10px; font-size: .8125rem; }
.pick-busy { position: absolute; inset: auto 0 0 0; background: var(--ink); color: var(--paper); padding: 10px 14px; font-size: .875rem; display: none; }
.pick.busy .pick-busy { display: block; }
.pick-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pick-why { font: 600 1.125rem/1.5 var(--serif); }
.pick-src { font-size: .875rem; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pick-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.pick-act .chip { background: var(--surface); }
.pick-act a.chip { display: inline-flex; align-items: center; text-decoration: none; }
.pick-act .chip.primary { background: var(--ink); color: var(--paper); }
.picks-note { margin-top: 16px; font-size: var(--step-small); color: var(--muted); }
.match-err { margin-top: 24px; font-size: 1.0625rem; color: #8c2f24; }

@media (max-width: 760px) {
  .match-head { display: block; margin-bottom: 28px; }
  .match-head .lead { margin-top: 16px; }
  .match-ctl { flex-direction: column; }
  .match-hand { width: 100%; }
  .prefs { flex: none; }
  .prefs legend { width: 100%; margin-bottom: 6px; }
  .match-go { width: 100%; align-self: stretch; }
  .reading { display: flex; flex-direction: column; gap: 20px; }
  .reading-cols { grid-template-columns: 1fr; gap: 16px; }
  .picks { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pick, .pick.mid { grid-column: span 1; }
  .pick.big { grid-column: 1 / -1; }
  .pick-body { padding: 12px; }
  .pick-why { font-size: 1rem; }
}

/* ---------- phone-first refinements ---------- */
html { -webkit-tap-highlight-color: transparent; }
button, a, label { touch-action: manipulation; }
.toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
@media (max-width: 760px) {
  .studio-side h2 { font-size: 2.125rem; }
  .slots { gap: 6px; }
  .slot-empty { padding: 14px; }
  .slot-name { font-size: 1.25rem; }
  .slot-hint { font-size: .875rem; }
  .slot-empty::before, .slot-empty::after { left: 14px; top: 26px; width: 26px; }
  .length span { min-height: 48px; }
  .btn-go { min-height: 60px; }
  .frame { margin: 0 calc(-1 * var(--m)); }
  .frame-tag { left: 12px; top: 12px; }
  .stage-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .chip { min-height: 48px; font-size: 1rem; }
  .wait-text { font-size: 2.5rem; }

  .match { padding-left: 0; padding-right: 0; }
  .match-head, .match-ctl, .match-run, .reading, .picks-note, .match-err { margin-left: var(--m); margin-right: var(--m); }
  .match-hand { min-height: 88px; }
  .prefs span { min-height: 44px; padding: 0 14px; }
  .steps li { padding: 8px 12px; font-size: .875rem; }
  .reading { padding: 22px 20px; }
  .reading-say { font-size: 1.1875rem; }
  .reading-facts { grid-template-columns: 1fr 1fr; gap: 14px 12px; }
  .reading-facts div { grid-template-columns: 1fr; gap: 2px; }
  .reading-facts dt { font-size: .8125rem; }
  .reading-facts dd { font-size: .9375rem; line-height: 1.4; }

  .picks { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px var(--m) 12px; scroll-padding: 0 var(--m); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .picks::-webkit-scrollbar { display: none; }
  .pick, .pick.big, .pick.mid { flex: 0 0 84vw; scroll-snap-align: start; }
  .pick-body { padding: 14px 14px 16px; }
  .pick-why { font-size: 1.0625rem; }
  .pick-act { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .pick-act .chip { min-height: 46px; justify-content: center; font-size: .9375rem; padding: 0 8px; text-align: center; }
  .pick-act a.chip { justify-content: center; }

  .faq summary { min-height: 60px; }
  .ft-cta span { font-size: 1.5rem; }
}

/* ---------- dock buttons, AI label ---------- */
.dock-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.btn-dark { background: #3b3430; color: var(--paper); }
.btn-dark:hover { background: var(--accent); color: var(--accent-ink); }
.frame-ai { position: absolute; right: 12px; bottom: 12px; font-size: .75rem; color: #fff; background: rgba(43, 38, 34, .55); padding: 3px 8px; display: none; pointer-events: none; }
.stage[data-state="result"] .frame-ai { display: block; }
@media (max-width: 760px) {
  .dock-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .dock-btns .btn { width: 100%; }
}
@media (max-width: 760px) {
  .ft-say .ft-big { font-size: 1.0625rem; }
  .ft-mail .ft-mid { font-size: .875rem; font-family: var(--sans); overflow-wrap: normal; word-break: keep-all; }
}

/* ---------- prefs v2: color / base / effects / decor / wish ---------- */
.prefs-all { flex: 1 1 100%; display: flex; flex-direction: column; gap: 14px; order: 2; }
.match-ctl .match-hand { order: 1; }
.match-ctl .match-go { order: 3; }
.prefs { flex: none; }
.prefs legend { min-width: 2.6em; }
.prefs span { gap: 6px; }
.prefs input:checked + span .sw-w { box-shadow: none; }
.sw { width: 12px; height: 12px; border-radius: 50%; background: var(--c); display: inline-block; flex: 0 0 12px; }
.sw-w { outline: 1px solid #cfc6c2; outline-offset: -1px; }
.prefs-hint { font-size: var(--step-small); color: var(--muted); min-height: 1.5em; }
.prefs-hint.hot { color: var(--ink); }
.wish { display: grid; gap: 8px; }
.wish-k { font-weight: 600; }
.wish textarea {
  width: 100%; resize: none; border: 0; border-radius: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--sans); padding: 12px 14px; min-height: 72px;
}
.wish textarea:focus { outline: 3px solid var(--accent); outline-offset: 0; }
.wish textarea::placeholder { color: #9d938f; }
.match-go { align-self: flex-start; }
.pick-tags { font-size: .8125rem; color: var(--ink); display: flex; flex-wrap: wrap; gap: 6px; }
.pick-tags span { background: var(--bg); padding: 3px 8px; }
.pick-tags .lvl { background: var(--ink); color: var(--paper); }
.stage-tags { font-size: .9375rem; line-height: 1.5; background: var(--paper); padding: 12px 14px; }
.stage-tags b { font-weight: 600; }
@media (max-width: 760px) {
  .prefs-all { gap: 16px; }
  .prefs { gap: 6px; }
  .prefs legend { width: 100%; margin-bottom: 4px; }
  .prefs span { padding: 0 12px; min-height: 42px; font-size: .9375rem; }
  .match-go { align-self: stretch; }
  .stage-tags { margin: 0; }
}
