/* 掌心萌物馆 · POCKET SPECIMENS
   1 tokens · 2 base · 3 primitives · 4 nav · 5 spotlight · 6 catalogue
   7 colophon · 8 theater · 9 prompt drawer · 10 motion preferences */

/* ---------- 1 · tokens ---------- */
:root {
  --paper: #F7F3EC;
  --paper-deep: #F1EBE0;
  --porcelain: #FFFDF9;
  --line: #E5DDD0;
  --line-strong: #D6CBBB;
  --ink: #1E1916;
  --ink-soft: #3A302A;
  --stone: #6F655B;
  --seal: #CE4B32;
  --accent: #D97B34;
  --accent-soft: #FBF1E4;

  --serif: "Songti SC", "STSong", "Noto Serif SC", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 1px 2px rgba(74, 52, 32, .05), 0 10px 28px -14px rgba(74, 52, 32, .16);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 2px 4px rgba(74, 52, 32, .06), 0 22px 44px -18px rgba(74, 52, 32, .26);
  --shadow-vitrine: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 4px rgba(74, 52, 32, .05), 0 34px 70px -30px rgba(74, 52, 32, .34);

  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 2 · base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: only light;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
main { flex: 1; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; border-radius: 6px; }
::selection { background: #F3D5CB; color: var(--ink); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 50; padding: 12px 16px; background: var(--ink); color: var(--porcelain); border-radius: 10px; }
.skip-link:focus { top: 12px; }

/* ---------- 3 · primitives ---------- */
.code {
  font: 500 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--seal);
  white-space: nowrap;
}
.eyebrow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: .12em;
  color: var(--stone);
}
.sep { color: var(--line-strong); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills li {
  padding: 4px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 12.5px; line-height: 1.5;
  white-space: nowrap;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 12px;
  font: 500 15px/1 var(--sans); letter-spacing: .02em; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 13.5px; border-radius: 10px; }
.btn-primary { background: var(--ink); color: var(--porcelain); box-shadow: 0 8px 18px -10px rgba(30, 25, 22, .55); }
.btn-ghost { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.btn-quiet { color: var(--stone); padding-inline: 12px; }
.btn-primary.is-copied { background: var(--seal); }

@media (hover: hover) {
  .btn-primary:hover { background: var(--ink-soft); transform: translateY(-1px); box-shadow: 0 12px 22px -10px rgba(30, 25, 22, .5); }
  .btn-ghost:hover { background: var(--porcelain); border-color: var(--ink); }
  .btn-quiet:hover { color: var(--ink); background: rgba(30, 25, 22, .05); }
}

.cue-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--seal); flex: none; animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(206, 75, 50, .45); }
  50% { box-shadow: 0 0 0 6px rgba(206, 75, 50, 0); }
}

/* ---------- 4 · nav ---------- */
.nav { border-bottom: 1px solid var(--line); }
.nav-inner {
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; }
.brand-mark { width: 38px; height: 38px; flex: none; color: var(--ink); transition: transform .5s var(--ease); }
.brand-text { display: grid; gap: 3px; }
.brand-cn { font: 600 19px/1.1 var(--serif); letter-spacing: .08em; }
.brand-en { font: 500 9.5px/1 var(--mono); letter-spacing: .26em; color: var(--stone); }
@media (hover: hover) { .brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); } }

.nav-links { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--stone); }
.count-pill { display: inline-flex; align-items: center; min-height: 44px; margin-right: 6px; }
.pill-face {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--porcelain); color: var(--ink-soft);
  font-size: 12.5px; line-height: 1.4; white-space: nowrap;
  transition: border-color .2s var(--ease);
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--seal); }
.nav-sisters { display: flex; }
.nav-sisters a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; border-radius: 8px; white-space: nowrap; transition: color .2s var(--ease); }
.lang-switch {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 36px; padding: 0 12px; margin-left: 4px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--porcelain); color: var(--ink);
  font: 500 12px/1 var(--mono); letter-spacing: .08em; white-space: nowrap;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
@media (hover: hover) {
  .count-pill:hover .pill-face { border-color: var(--line-strong); }
  .nav-sisters a:hover { color: var(--ink); }
  .lang-switch:hover { border-color: var(--ink); background: var(--ink); color: var(--porcelain); }
}
@media (max-width: 820px) { .nav-sisters { display: none; } .count-pill { margin-right: 0; } }
@media (max-width: 480px) { .count-pill { display: none; } }

/* ---------- 5 · spotlight ---------- */
.spotlight {
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto; padding: clamp(18px, 3.4vh, 40px) var(--gutter) clamp(24px, 4vh, 44px);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "copy vitrine" "tray tray";
  column-gap: clamp(28px, 4.5vw, 64px); row-gap: clamp(20px, 3.4vh, 34px);
  align-items: center;
}
.spot-copy { grid-area: copy; display: grid; gap: 14px; justify-items: start; min-width: 0; }
.spot-title {
  font: 600 clamp(34px, 3.7vw, 54px)/1.16 var(--serif);
  letter-spacing: .02em; text-wrap: balance;
  margin-top: 4px;
}
.spot-names { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: -4px; }
.spot-en { font: italic 400 clamp(20px, 1.8vw, 25px)/1.2 var(--serif); color: var(--ink-soft); }
.spot-latin { font: italic 400 13.5px/1.3 var(--serif); color: var(--stone); letter-spacing: .02em; }
.spot-latin::before { content: ""; display: inline-block; width: 18px; height: 1px; margin-right: 10px; vertical-align: middle; background: var(--accent); }
.spot-tagline { max-width: 30em; font-size: 16px; line-height: 1.75; color: var(--ink-soft); text-wrap: pretty; }
.spot-tagline code { font: 13px var(--mono); padding: 1px 6px; border-radius: 5px; background: var(--paper-deep); }
.spot-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

.vitrine {
  grid-area: vitrine; display: block; min-width: 0;
  padding: 12px 12px 0;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--porcelain);
  box-shadow: var(--shadow-vitrine);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s var(--ease);
}
.vitrine-glass {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--line);
}
.vitrine-glass img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.vitrine-glass::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, 0) 26%);
}
.vitrine-cue {
  position: absolute; left: 50%; bottom: 14px; z-index: 1; translate: -50% 0;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px;
  border: 1px solid rgba(30, 25, 22, .1); border-radius: 999px;
  background: rgba(255, 253, 249, .9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 13px; line-height: 1; letter-spacing: .04em; white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(74, 52, 32, .4);
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.vitrine-plate {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 42px; padding: 0 4px;
  font: 500 11px/1.3 var(--mono); letter-spacing: .1em; color: var(--stone);
}
.plate-telemetry::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.plate-model { text-align: right; }
@media (hover: hover) {
  .vitrine:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 3px 6px rgba(74, 52, 32, .06), 0 44px 80px -30px rgba(74, 52, 32, .42); }
  .vitrine:hover .vitrine-glass img { transform: scale(1.025); }
  .vitrine:hover .vitrine-cue { background: var(--ink); color: var(--porcelain); transform: translateY(-2px); }
}

.is-swapped { animation: swap-in .42s var(--ease) both; }
@keyframes swap-in { from { opacity: 0; transform: translateY(8px); } }

.tray {
  grid-area: tray; min-width: 0;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px;
  padding: 8px;
  border: 1px solid var(--line); border-radius: 18px;
  background: rgba(255, 253, 249, .6);
}
.tray-item {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; min-height: 60px; padding: 6px 10px 6px 6px;
  border: 1px solid transparent; border-radius: 12px;
  text-align: left;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.tray-item img {
  width: 48px; height: 48px; flex: none;
  border-radius: 10px; object-fit: cover; object-position: 38% 50%;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform .3s var(--ease);
}
.tray-label { display: grid; gap: 3px; min-width: 0; }
.tray-no { font: 500 10px/1 var(--mono); letter-spacing: .12em; color: var(--stone); }
.tray-name { font-size: 12.5px; line-height: 1.3; color: var(--ink-soft); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.tray-item[aria-pressed="true"] { background: var(--porcelain); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 6px 16px -10px rgba(74, 52, 32, .4); }
.tray-item[aria-pressed="true"] .tray-no { color: var(--seal); }
.tray-item[aria-pressed="true"] .tray-name { color: var(--ink); }
@media (hover: hover) {
  .tray-item:hover { background: var(--accent-soft); }
  .tray-item:hover img { transform: scale(1.06) rotate(-2deg); }
}

@media (max-width: 1080px) {
  .tray { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
  .tray::-webkit-scrollbar { display: none; }
  .tray-item { flex: 0 0 150px; scroll-snap-align: start; }
}
@media (max-width: 860px) {
  .spotlight { grid-template-columns: minmax(0, 1fr); grid-template-areas: "vitrine" "tray" "copy"; row-gap: 14px; }
  .vitrine { padding: 8px 8px 0; border-radius: 16px; }
  .vitrine-plate { min-height: 36px; font-size: 10px; letter-spacing: .06em; }
  .vitrine-cue { bottom: 10px; padding: 8px 13px; font-size: 12px; }
  .tray { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); border-inline: 0; border-radius: 0; scroll-padding-inline: var(--gutter); }
  .tray-item { flex: 0 0 auto; width: 84px; flex-direction: column; align-items: center; gap: 6px; padding: 6px 4px; text-align: center; }
  .tray-item img { width: 56px; height: 56px; border-radius: 14px; }
  .tray-no { display: none; }
  .tray-name { font-size: 11.5px; }
  .spot-copy { gap: 10px; padding-top: 6px; }
  .spot-tagline { font-size: 15px; line-height: 1.7; }
  .spot-actions { width: 100%; }
  .spot-actions .btn-primary { flex: 1 0 100%; }
  .spot-actions .btn-ghost { flex: 1 1 0; padding-inline: 12px; }
}

/* ---------- 6 · catalogue ---------- */
.collection {
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto; padding: 0 var(--gutter) clamp(56px, 8vw, 104px);
}
.collection-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px 32px;
  padding: clamp(28px, 4vw, 44px) 0 clamp(20px, 3vw, 30px);
  border-top: 1px solid var(--line);
}
.collection-head h2 { margin-top: 10px; font: 600 clamp(27px, 2.8vw, 38px)/1.2 var(--serif); letter-spacing: .03em; }
.collection-lede { max-width: 34em; color: var(--stone); font-size: 14.5px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 26px); }

.card {
  min-width: 0;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--porcelain);
  box-shadow: var(--shadow-card);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease);
}
.card article { display: flex; flex-direction: column; height: 100%; padding: 14px 14px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 12px; }
.card-habitat { font-size: 12px; color: var(--stone); letter-spacing: .04em; text-align: right; }
.card-figure { display: block; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--accent-soft); box-shadow: 0 0 0 1px var(--line); }
.card-figure img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card-body { flex: 1; display: grid; align-content: start; gap: 6px; padding: 16px 4px 16px; }
.card-material { font-size: 12px; color: var(--stone); letter-spacing: .03em; }
.card-material::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.card-title { font: 600 23px/1.3 var(--serif); letter-spacing: .02em; }
.card-en { font: 400 16px/1.3 var(--serif); color: var(--stone); }
.card-tagline { margin: 4px 0 8px; font-size: 14px; line-height: 1.65; color: var(--ink-soft); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.card-actions { display: flex; align-items: center; gap: 2px; margin: 0 -14px; padding: 10px 12px; border-top: 1px solid var(--line); }
.card-actions .btn-primary { margin-right: auto; padding-inline: 20px; }
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); box-shadow: var(--shadow-lift); }
  .card:hover .card-figure img { transform: scale(1.035); }
  .card:hover .pills li { background: var(--porcelain); }
}

.card-note {
  grid-column: span 2; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: clamp(24px, 3.4vw, 48px);
  border: 1px dashed var(--line-strong); border-radius: 16px;
}
.note-lede { max-width: 26em; font: 400 clamp(19px, 1.9vw, 25px)/1.6 var(--serif); color: var(--ink-soft); text-wrap: pretty; }
.note-facts { display: flex; flex-wrap: wrap; gap: 14px clamp(22px, 3vw, 44px); margin-top: 6px; }
.note-facts dt { font: 500 28px/1 var(--mono); color: var(--ink); }
.note-facts dd { margin-top: 8px; font-size: 12.5px; color: var(--stone); }

@media (max-width: 1020px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card-note { grid-column: span 1; } }
@media (max-width: 660px) { .grid { grid-template-columns: minmax(0, 1fr); } .card-title { font-size: 22px; } }

/* Opening-launch balanced 2-column layout (when only 1 specimen is live) */
.grid.is-opening { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: stretch; }
.grid.is-opening .card-note { grid-column: auto; justify-content: space-between; }
.opening-compare {
  min-width: 0;
  display: flex; flex-direction: column; gap: 16px;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--porcelain);
  box-shadow: var(--shadow-card);
}
.opening-plates {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.mini-plate {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper);
  transition: transform .28s var(--ease), border-color .25s var(--ease), background-color .25s var(--ease);
}
.mini-plate img {
  width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 7px; box-shadow: 0 0 0 1px var(--line);
}
.grid.is-opening .note-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px;
}
.mini-plate-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.mini-plate-model { font: 600 13.5px/1.3 var(--sans); color: var(--ink); }
.mini-plate-meta { font: 500 11px/1 var(--mono); letter-spacing: .04em; color: var(--stone); }
.opening-compare-note { font-size: 14px; line-height: 1.7; color: var(--ink-soft); }
.opening-compare-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 4px; }
@media (hover: hover) {
  .mini-plate:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--accent-soft); }
}
@media (max-width: 960px) {
  .grid.is-opening { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .opening-plates { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 7 · colophon ---------- */
.colophon { border-top: 1px solid var(--line); background: var(--paper-deep); }
.colophon-inner {
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto; padding: 26px var(--gutter) calc(26px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 32px;
}
.colophon-title { font: 600 16px/1.5 var(--serif); letter-spacing: .04em; }
.colophon-en { font: 500 11px/1 var(--mono); letter-spacing: .2em; }
.colophon-curator { font: italic 400 15px/1 var(--serif); letter-spacing: 0; color: var(--ink-soft); }
.colophon-note { margin-top: 4px; font-size: 12.5px; color: var(--stone); }
.colophon-links { display: flex; flex-wrap: wrap; align-items: center; margin-left: -10px; font-size: 13.5px; color: var(--stone); }
.colophon-links > span { display: flex; flex-wrap: wrap; }
.colophon-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 8px; transition: color .2s var(--ease); }
.colophon-links > a { color: var(--seal); }
@media (hover: hover) { .colophon-links a:hover { color: var(--ink); } }

/* ---------- 8 · theater ---------- */
.theater {
  position: fixed; inset: 0; z-index: 100;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--paper-deep);
  animation: theater-in .32s var(--ease) both;
}
@keyframes theater-in { from { opacity: 0; transform: scale(1.012); } }

.t-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 5px max(10px, env(safe-area-inset-right)) 5px max(10px, env(safe-area-inset-left));
  padding-top: max(5px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.t-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: none;
  min-width: 44px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--porcelain); color: var(--ink);
  font: 500 13.5px/1 var(--sans); white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.t-btn:active { transform: scale(.96); }
.t-step { padding: 0; font-size: 20px; line-height: 1; padding-bottom: 2px; }
.t-switcher { display: flex; align-items: center; gap: 4px; min-width: 0; }
.t-current { display: flex; align-items: baseline; justify-content: center; gap: 10px; min-width: 0; padding: 0 8px; }
.t-name { font: 600 17px/1.3 var(--serif); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.t-modes { display: flex; flex: none; margin-inline: auto; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-deep); overflow: hidden; }
.t-modes button {
  min-height: 44px; padding: 0 15px;
  font: 500 13.5px/1 var(--sans); color: var(--stone); white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.t-modes button + button { border-left: 1px solid var(--line); }
.t-modes button[aria-pressed="true"] { background: var(--ink); color: var(--porcelain); border-left-color: var(--ink); }
.t-modes button:focus-visible { outline-offset: -3px; }
@media (hover: hover) {
  .t-btn:hover { border-color: var(--ink); }
  .t-modes button:not([aria-pressed="true"]):hover { color: var(--ink); background: var(--porcelain); }
}

.t-note {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px; padding: 6px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
  font-size: 13px; line-height: 1.6; color: var(--ink-soft); text-align: left;
}
.t-note-label { flex: none; font: 500 11px/1 var(--mono); letter-spacing: .12em; color: var(--seal); }
.t-note-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-note-chevron { flex: none; color: var(--stone); line-height: 1; transition: transform .25s var(--ease); translate: 0 -3px; }
.t-note[aria-expanded="true"] { align-items: flex-start; padding-block: 12px; }
.t-note[aria-expanded="true"] .t-note-label { margin-top: 5px; }
.t-note[aria-expanded="true"] .t-note-text { white-space: normal; }
.t-note[aria-expanded="true"] .t-note-chevron { transform: rotate(180deg); translate: 0 6px; }

.t-bar, .t-note, .t-guide { flex: none; }
.t-stage { flex: 1 1 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; }
.t-stage[data-mode="compare"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-strong); }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.pane-label {
  display: none; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px;
  min-height: 32px; padding: 4px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--porcelain);
  font: 500 11px/1.5 var(--mono); letter-spacing: .06em; color: var(--stone);
}
.t-stage[data-mode="compare"] .pane-label { display: flex; }
.pane-model { color: var(--ink); }
.pane-model::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--seal); vertical-align: 1px; }
.pane[data-edition="neon"] .pane-model::before { background: var(--stone); }
.pane-label { flex: none; }
.pane-view { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; background: var(--paper); }
.pane-view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--paper); transition: opacity .4s var(--ease); }
.pane-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .45; filter: blur(6px) saturate(.9); }
.pane-status {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 253, 249, .92); color: var(--ink-soft);
  font-size: 13px; line-height: 1; white-space: nowrap;
}
.pane.is-loading iframe { opacity: 0; }
.pane:not(.is-loading) .pane-poster, .pane:not(.is-loading) .pane-status { display: none; }

.t-guide {
  display: flex; align-items: center; gap: 12px;
  min-height: 36px; padding: 5px max(14px, env(safe-area-inset-right)) 5px max(14px, env(safe-area-inset-left));
  padding-bottom: max(5px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-size: 12.5px; line-height: 1.55; color: var(--ink-soft);
}
.t-guide-label { flex: none; font: 500 11px/1 var(--mono); letter-spacing: .12em; color: var(--seal); }
.t-guide-text { flex: 1; min-width: 0; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.t-guide-text::-webkit-scrollbar { display: none; }
.t-guide-text span + span::before { content: "·"; margin: 0 10px; color: var(--line-strong); }
.t-guide-text kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; margin: 0 1px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  background: var(--porcelain); color: var(--ink);
  font: 500 11px/16px var(--mono); text-align: center;
}
.t-guide-meta { flex: none; font: 500 11px/1 var(--mono); letter-spacing: .06em; color: var(--stone); white-space: nowrap; }

@media (max-width: 1180px) {
  .t-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "back switcher open" "modes modes prompt"; gap: 6px; padding-block: 6px; }
  .t-back { grid-area: back; }
  .t-switcher { grid-area: switcher; justify-content: center; }
  .t-open { grid-area: open; }
  .t-modes { grid-area: modes; margin: 0; }
  .t-modes button { flex: 1; }
  .t-prompt { grid-area: prompt; }
  .t-current { flex: 0 1 auto; }
  .t-guide-meta { display: none; }
}
@media (max-width: 900px) {
  .t-stage[data-mode="compare"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .lg { display: none; }
  .t-btn { padding: 0 12px; }
  .t-step, .t-back, .t-open { padding: 0; }
  .t-switcher { justify-content: space-between; }
  .t-current { flex: 1; flex-direction: column; align-items: center; gap: 3px; padding: 0 2px; }
  .t-current .code { font-size: 10px; }
  .t-name { max-width: 100%; font-size: 15px; line-height: 1.2; }
  .t-modes button { padding: 0 8px; }
  .t-note { padding-inline: 12px; gap: 8px; font-size: 12.5px; }
  .t-guide { align-items: flex-start; gap: 8px; padding-inline: 12px; font-size: 11.5px; }
  .t-guide-label { margin-top: 4px; font-size: 10px; }
  .t-guide-text { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
  .t-guide-text span + span::before { margin: 0 5px; }
  .pane-label { padding-inline: 12px; font-size: 10px; letter-spacing: .02em; }
}

/* ---------- 9 · prompt drawer ---------- */
.drawer-root { position: fixed; inset: 0; z-index: 200; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(30, 25, 22, .36); animation: fade-in .25s ease both; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(760px, 100%);
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 70px -30px rgba(30, 25, 22, .4);
  animation: drawer-in .36s var(--ease) both;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes drawer-in { from { transform: translateX(36px); opacity: 0; } }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
  padding: 16px clamp(16px, 4vw, 32px); padding-top: max(16px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: var(--porcelain);
}
.drawer-heading { min-width: 0; flex: 1 1 220px; }
.drawer-head h2 { margin-top: 6px; font: 600 22px/1.3 var(--serif); letter-spacing: .03em; }
.drawer-actions { display: flex; align-items: center; gap: 8px; }
.drawer-actions .btn { min-width: 148px; }
.drawer-close { padding: 0; font-size: 14px; }

.drawer-body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 8px clamp(16px, 4vw, 32px) calc(48px + env(safe-area-inset-bottom));
  font-size: 14.5px; line-height: 1.8; color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.drawer-body:focus-visible { outline-offset: -2px; }
.drawer-body p { margin: 14px 0; }
.drawer-body strong { font-weight: 600; color: var(--ink); }
.drawer-body code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--porcelain); font: 12.5px/1.5 var(--mono); color: var(--ink); }
.drawer-body pre { margin: 14px 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--porcelain); }
.drawer-body pre code { padding: 0; border: 0; background: none; white-space: pre; }
.drawer-body hr { margin: 26px 0; border: 0; border-top: 1px solid var(--line); }
.md-h { color: var(--ink); font-family: var(--serif); font-weight: 600; text-wrap: balance; }
.md-h1 { margin: 24px 0 14px; font-size: 24px; line-height: 1.4; }
.md-h2 { margin: 26px 0 10px; font-size: 20px; line-height: 1.45; }
.md-h3 { margin: 22px 0 8px; font-size: 16.5px; line-height: 1.5; }
.md-h4 { margin: 18px 0 6px; font-size: 15px; }
.md-h code { font-size: .82em; }
.md-list { margin: 10px 0; display: grid; gap: 7px; }
.md-list li { display: flex; gap: 10px; }
.md-marker { flex: none; min-width: 12px; color: var(--seal); font: 500 13px/1.95 var(--mono); text-align: center; }
.md-d1 { padding-left: 22px; } .md-d2 { padding-left: 44px; } .md-d3 { padding-left: 66px; }
.md-d1 .md-marker, .md-d2 .md-marker, .md-d3 .md-marker { color: var(--stone); }

@media (max-width: 640px) {
  .drawer-head { padding-block: 12px; }
  .drawer-head h2 { font-size: 19px; }
  .drawer-heading { flex-basis: 100%; }
  .drawer-actions { width: 100%; }
  .drawer-actions .btn { flex: 1; }
  .md-d1 { padding-left: 14px; } .md-d2 { padding-left: 28px; } .md-d3 { padding-left: 42px; }
}

/* ---------- 10 · motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .vitrine:hover, .card:hover, .btn-primary:hover, .vitrine:hover .vitrine-cue { transform: none; }
  .vitrine:hover .vitrine-glass img, .card:hover .card-figure img, .tray-item:hover img { transform: none; }
}
