:root {
  --font: Inter;
  color-scheme: light;
  --ink: #111111;
  --muted: #6f6a63;
  --line: #e8e6e2;
  --paper: #ffffff;
  --soft: #f4f2ee;
  --panel: #f8f5ef;
  --shadow: rgba(18, 17, 15, 0.18);
  --radius: 0px;
  font-family: var(--font);
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
}

button,
input { font: inherit; }

button { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  justify-items: stretch;
  gap: 16px;
  width: 100%;
  min-width: 0;
  padding:
    calc(16px + env(safe-area-inset-top, 0px))
    max(min(48px, 5vw), env(safe-area-inset-right, 0px))
    18px
    max(min(48px, 5vw), env(safe-area-inset-left, 0px));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.header-brand {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 28px;
}

.lang-switch {
  grid-column: 3;
  justify-self: end;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
}

.lang-button {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
}

.lang-button.is-active {
  color: var(--ink);
}

.lang-button:hover {
  color: var(--ink);
}

.lang-sep {
  color: var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.wordmark {
  grid-column: 2;
  justify-self: center;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font);
  font-size: clamp(1.85rem, 2.5vw, 2.6rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-align: center;
}

.nav-tabs {
  display: flex;
  align-items: center;
  justify-content: safe center;
  gap: clamp(16px, 2.4vw, 36px);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
  scroll-snap-type: x proximity;
}

.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  appearance: none;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  padding: 0 0 5px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-family: var(--font);
  font-size: clamp(0.92rem, 1.05vw, 1.06rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  scroll-snap-align: center;
}

.nav-tab.is-active {
  border-bottom-color: var(--ink);
}

main {
  padding: 0;
}

.hero-carousel {
  grid-template-columns: minmax(104px, 0.56fr) minmax(500px, 3.1fr) minmax(104px, 0.56fr);
  gap: clamp(18px, 2.4vw, 36px);
  align-items: stretch;
  width: 100%;
  min-height: 390px;
  height: clamp(390px, calc(100vh - 250px), 560px);
  overflow: hidden;
}

body[data-active-tab="books"] .hero-carousel,
html[data-active-tab="books"] .hero-carousel {
  display: grid;
}

/* Only the Books tab shows the featured carousel + shelf. */
body:not([data-active-tab="books"]) .hero-carousel,
html:not([data-active-tab="books"]) .hero-carousel,
body:not([data-active-tab="books"]) .shelf-section,
html:not([data-active-tab="books"]) .shelf-section {
  display: none !important;
}

body:not([data-active-tab="maps"]) .travel-section,
html:not([data-active-tab="maps"]) .travel-section {
  display: none !important;
}

body:not([data-active-tab="design"]) .page-section[data-page="design"],
body:not([data-active-tab="calendar"]) .page-section[data-page="calendar"],
body:not([data-active-tab="meadow"]) .page-section[data-page="meadow"],
body:not([data-active-tab="yisheng"]) .page-section[data-page="yisheng"],
body:not([data-active-tab="music"]) .page-section[data-page="music"],
body:not([data-active-tab="games"]) .page-section[data-page="games"],
body:not([data-active-tab="cards"]) .page-section[data-page="cards"],
body:not([data-active-tab="art"]) .page-section[data-page="art"],
body:not([data-active-tab="magazine"]) .page-section[data-page="magazine"],
body:not([data-active-tab="app"]) .page-section[data-page="app"],
body:not([data-active-tab="cups"]) .page-section[data-page="cups"],
body:not([data-active-tab="about"]) .page-section[data-page="about"] {
  display: none !important;
}

body[data-active-tab="games"] .notta-ai,
html[data-active-tab="games"] .notta-ai {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.feature-card,
.side-panel {
  position: relative;
  min-height: inherit;
  overflow: hidden;
  background: var(--panel);
}

.feature-card {
  isolation: isolate;
}

.feature-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-position: center;
  background-size: cover;
  filter: blur(26px) saturate(0.82);
  transform: scale(1.09);
  opacity: 0.42;
}

.feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.46)),
    rgba(246, 242, 235, 0.38);
}

.feature-content {
  display: grid;
  grid-template-columns: minmax(210px, 0.5fr) minmax(280px, 0.9fr);
  gap: clamp(28px, 4vw, 62px);
  align-items: center;
  height: 100%;
  padding: clamp(28px, 3.8vw, 50px);
}

.cover-frame {
  justify-self: end;
  width: min(280px, 23vw);
  background: #ebe5d8;
  box-shadow: 0 22px 48px var(--shadow);
}

.cover-frame img,
.side-panel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-frame img {
  aspect-ratio: 2 / 3;
}

.feature-copy {
  align-self: center;
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.42);
  max-width: 780px;
  padding-bottom: 0;
}

.feature-kicker,
.feature-date {
  margin: 0 0 14px;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.feature-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(1.85rem, 2.7vw, 3.55rem);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: 0.01em;
}

.feature-copy p {
  margin: 0;
  font-size: clamp(1rem, 1.25vw, 1.3rem);
  line-height: 1.65;
}

.feature-controls {
  position: absolute;
  right: clamp(26px, 3.4vw, 52px);
  bottom: clamp(20px, 2.4vw, 34px);
  display: flex;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.slide-button {
  appearance: none;
  width: 56px;
  height: 50px;
  border: 0;
  border-radius: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-family: var(--font);
  font-size: 2.4rem;
  line-height: 1;
}

.slide-button + .slide-button {
  border-left: 2px solid rgba(255, 255, 255, 0.9);
}

.side-panel {
  opacity: 0.48;
}

.side-panel-left { transform: translateX(-18%); }
.side-panel-right { transform: translateX(18%); }

.side-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
}


.page-section {
  padding: clamp(48px, 7vw, 96px) min(48px, 5vw) clamp(72px, 10vw, 140px);
}

.page-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  text-align: center;
}

.page-title {
  margin: 0 0 18px;
  font-family: var(--font);
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 1px;
  margin: 18px auto 0;
  background: var(--ink);
}

.page-lead {
  margin: 0;
  color: var(--muted);
  font-family: var(--font);
  font-size: clamp(0.98rem, 1.2vw, 1.12rem);
  line-height: 1.85;
}

.app-section {
  background: #ffffff;
  padding-top: clamp(12px, 2vw, 20px);
  padding-bottom: clamp(40px, 6vw, 72px);
}

.app-shell {
  width: min(820px, 100%);
  margin: 0 auto;
}

.app-catalog {
  display: grid;
  border-top: 1px solid var(--line);
}

.app-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: clamp(16px, 2.4vw, 28px);
  align-items: center;
  padding: clamp(22px, 3vw, 28px) 0;
  border-bottom: 1px solid var(--line);
  animation: app-row-enter 640ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-row:nth-child(2) { animation-delay: 60ms; }
.app-row:nth-child(3) { animation-delay: 120ms; }
.app-row:nth-child(4) { animation-delay: 180ms; }
.app-row:nth-child(5) { animation-delay: 240ms; }
.app-row:nth-child(n + 6) { animation-delay: calc(var(--i, 5) * 60ms); }

.app-empty {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.app-row-icon {
  width: 72px;
  height: 72px;
  display: block;
  background: transparent;
  border-radius: 22%;
  object-fit: cover;
}

.app-row-copy {
  min-width: 0;
  text-align: left;
}

.app-row-name {
  margin: 0 0 6px;
  font-family: var(--font);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.app-row-tagline {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
}

.app-row-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.app-row-action {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: center;
}

.app-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease;
}

.app-download-button:hover {
  background: #000;
  transform: translateY(-1px);
}

.app-store-button {
  color: var(--ink);
  background: transparent;
}

.app-store-button:hover {
  color: #fff;
  background: var(--ink);
}

.app-store-button.is-coming-soon {
  position: relative;
}

.app-store-button.is-coming-soon .app-btn-hover {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .app-store-button.is-coming-soon:hover .app-btn-label {
    display: none;
  }

  .app-store-button.is-coming-soon:hover .app-btn-hover {
    display: inline;
  }
}

.app-download-version {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.app-footnote {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
  text-align: left;
}

@keyframes app-row-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .app-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px 10px;
    align-items: center;
  }

  .app-row-icon {
    width: 56px;
    height: 56px;
  }

  .app-row-name {
    font-size: 1.05rem;
    margin-bottom: 4px;
  }

  .app-row-tagline {
    font-size: 0.88rem;
    margin-bottom: 4px;
  }

  .app-row-meta {
    font-size: 0.7rem;
  }

  .app-row-action {
    justify-items: end;
    align-self: center;
    padding-top: 0;
  }

  .app-download-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.76rem;
  }

  .app-download-version {
    font-size: 0.68rem;
  }

  .app-footnote {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-row,
  .app-download-button {
    animation: none;
    transition: none;
  }
}

.cups-section {
  padding-top: clamp(18px, 3vw, 34px);
  padding-bottom: clamp(44px, 7vw, 92px);
  background: linear-gradient(180deg, #ffffff 0%, #f7f3eb 100%);
}

.cups-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.cups-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.cups-stage,
.cups-tools,
.cup-gallery {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 46px rgba(44, 35, 23, 0.08);
}

.cups-stage {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr);
  min-height: clamp(520px, calc(100dvh - var(--site-header-height, 112px) - 86px), 720px);
}

.cups-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 3vw, 30px) clamp(20px, 3vw, 34px) 0;
}

.cups-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cups-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.05;
}

.cup-canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 24px);
  min-width: 0;
}

.cup-svg {
  display: block;
  width: min(100%, 720px);
  aspect-ratio: 7 / 6;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    #fffaf1;
  background-size: 24px 24px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  touch-action: none;
}

.cup-node {
  fill: var(--ink);
  stroke: #ffffff;
  stroke-width: 3;
  cursor: grab;
  vector-effect: non-scaling-stroke;
}

.cup-node:active {
  cursor: grabbing;
}

.cup-node.is-active {
  fill: #f0b35a;
  stroke: var(--ink);
  stroke-width: 4;
}

.cup-live {
  position: absolute;
  left: 24px;
  bottom: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.cups-tools {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: clamp(20px, 3vw, 28px);
}

.cup-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cup-field input[type="text"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.cup-field input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
}

.cup-size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cup-preset-field {
  gap: 10px;
}

.cup-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}

.cup-preset {
  appearance: none;
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cup-preset:last-child {
  border-right: 0;
}

.cup-preset:hover,
.cup-preset:focus-visible,
.cup-preset.is-active {
  color: #fff;
  background: var(--ink);
}

.cup-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cup-field.is-color {
  min-width: 0;
}

.cup-field input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  padding: 3px;
  background: #fff;
  cursor: pointer;
}

.cups-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cups-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--ink);
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cups-action:hover,
.cups-action:focus-visible {
  color: #fff;
  background: var(--ink);
}

.cups-action.is-primary {
  color: #fff;
  background: var(--ink);
}

.cups-action.is-primary:hover,
.cups-action.is-primary:focus-visible {
  background: #000;
}

.cups-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.cup-gallery {
  margin-top: clamp(18px, 3vw, 34px);
  padding: clamp(20px, 3vw, 30px);
}

.cup-gallery-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.cup-gallery h2 {
  margin: 0;
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  letter-spacing: 0.04em;
}

.cup-gallery p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.cup-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.cup-card {
  appearance: none;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 10px;
  color: var(--ink);
  background: #fffaf1;
  cursor: pointer;
  text-align: left;
}

.cup-card:hover,
.cup-card:focus-visible {
  border-color: var(--ink);
}

.cup-card svg {
  width: 100%;
  aspect-ratio: 7 / 6;
}

.cup-card span,
.cup-card em,
.cup-gallery-empty {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cup-card span {
  color: var(--ink);
}

.cup-card em {
  margin-top: -4px;
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .cups-board {
    grid-template-columns: 1fr;
  }

  .cups-stage {
    min-height: 0;
  }

  .cups-tools {
    order: -1;
  }
}

@media (max-width: 560px) {
  .cups-stage-head,
  .cup-gallery-head {
    align-items: stretch;
    flex-direction: column;
  }

  .cups-action.is-primary {
    width: 100%;
  }

  .cup-tool-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cup-size-grid {
    grid-template-columns: 1fr;
  }

  .cup-live {
    left: 16px;
    bottom: 10px;
  }
}

.about-shell {
  width: min(920px, 100%);
  margin: 0 auto;
}

.about-hero-head {
  display: grid;
  justify-items: center;
  margin-bottom: clamp(28px, 4vw, 42px);
}

.about-title {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.about-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 1px;
  margin: 18px auto 0;
  background: var(--ink);
}

.about-blocks {
  display: grid;
  gap: 0;
}

.about-block {
  padding: clamp(28px, 4vw, 40px) 0;
  border-top: 1px solid var(--line);
}

.about-block:last-child {
  border-bottom: 1px solid var(--line);
}

.about-block h2 {
  margin: 0 0 14px;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.about-block p {
  margin: 0;
  max-width: 68ch;
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(0.96rem, 1.15vw, 1.08rem);
  line-height: 1.9;
}

.shelf-section {
  padding: clamp(74px, 9vw, 132px) 0 clamp(86px, 11vw, 150px);
  background: #ffffff;
}

.shelf-heading {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0 auto clamp(34px, 5vw, 64px);
  padding: 0 24px;
  text-align: center;
}

.shelf-heading p {
  margin: 0;
  color: #8a867f;
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.shelf-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.12em;
}

.book-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  align-items: end;
  gap: clamp(42px, 5.2vw, 82px) clamp(28px, 3.8vw, 62px);
  width: min(1180px, calc(100% - 56px));
  min-height: clamp(560px, 54vw, 780px);
  margin: 0 auto;
  padding: clamp(72px, 8vw, 112px) clamp(48px, 6vw, 86px) clamp(64px, 7vw, 104px);
  overflow: visible;
  background:
    radial-gradient(ellipse at 50% 76%, rgba(38, 35, 31, 0.2), transparent 38%),
    radial-gradient(circle at 48% 16%, rgba(255, 255, 255, 0.78), transparent 42%),
    linear-gradient(108deg, #f2f1ed 0%, #dedcd6 54%, #cac8c2 100%);
}

.book-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 24%, transparent 76%, rgba(40, 38, 35, 0.08)),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.54), transparent 52%);
  pointer-events: none;
}

.stage-loading {
  grid-column: 1 / -1;
  margin: 0;
  color: #6c6861;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
}

.shelf-book {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  align-items: end;
  color: var(--ink);
  text-decoration: none;
  transform: translateY(var(--lift)) rotate(var(--tilt));
  transform-origin: 50% 100%;
  transition: transform 220ms ease, filter 220ms ease;
}

.shelf-book::after {
  display: none;
}

.shelf-book:hover,
.shelf-book:focus-visible {
  filter: saturate(1.04);
  transform: translateY(calc(var(--lift) - 10px)) rotate(var(--tilt));
}

/* Aligned with NottaShelf BS-12「实体·厚册纸砖」: fold light + thick paper edge. */
.book-object {
  --book-spine-w: 14px;
  --book-page-w: 12px;
  position: relative;
  display: block;
  width: min(158px, 100%);
  margin: 0 auto;
  aspect-ratio: 2 / 3;
  border-radius: 3px 4px 4px 3px;
  background: transparent;
  overflow: visible;
  box-shadow:
    0 22px 32px rgba(40, 34, 26, 0.26),
    6px 8px 0 rgba(72, 63, 52, 0.07);
  transform: perspective(840px) rotateY(-14deg) rotateX(2deg);
  transform-origin: center;
  transform-style: preserve-3d;
  transition: transform 220ms ease;
}

.shelf-book:hover .book-object,
.shelf-book:focus-visible .book-object {
  transform: perspective(840px) rotateY(-10deg) rotateX(2deg) translateY(-3px);
}

.book-object::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--book-spine-w);
  border-radius: 3px 0 0 3px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.12) 42%,
    rgba(255, 255, 255, 0.08) 72%,
    transparent 100%
  );
  mix-blend-mode: multiply;
  z-index: 3;
  pointer-events: none;
}

.book-object::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 2%;
  bottom: -18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(40, 34, 26, 0.24);
  filter: blur(12px);
  z-index: -1;
}

.book-pages {
  position: absolute;
  top: 3px;
  right: calc(var(--book-page-w) * -1);
  bottom: 3px;
  width: var(--book-page-w);
  border-radius: 0 1px 1px 0;
  background:
    repeating-linear-gradient(
      90deg,
      #faf4ea 0 1px,
      #e8dcc8 1px 2px,
      #f3eadc 2px 3px,
      #ddd0bb 3px 4px
    );
  box-shadow:
    inset 3px 0 5px rgba(70, 58, 43, 0.2),
    3px 0 0 rgba(90, 78, 62, 0.14);
  z-index: 1;
  pointer-events: none;
}

.book-bottom-edge {
  position: absolute;
  left: 2%;
  right: calc(var(--book-page-w) * -0.3);
  bottom: -3px;
  height: 3px;
  background: linear-gradient(90deg, rgba(90, 78, 62, 0.35), #d7c6ad 40%, #b9a58b);
  z-index: 0;
  pointer-events: none;
}

.book-object img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px 2px 2px 3px;
  box-shadow:
    inset calc(var(--book-spine-w) * 0.55) 0 calc(var(--book-spine-w) * 0.7)
      rgba(0, 0, 0, 0.22),
    inset 2px 0 0 rgba(255, 255, 255, 0.12),
    inset -1px 0 0 rgba(0, 0, 0, 0.08);
}

.book-caption {
  display: grid;
  gap: 4px;
  min-height: 64px;
  color: #2c2a27;
  font-family: var(--font);
  text-align: center;
  transform: rotate(calc(var(--tilt) * -1));
}

.book-caption strong {
  overflow: hidden;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-caption span {
  overflow: hidden;
  color: #716d66;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.travel-section {
  padding: clamp(24px, 3vw, 48px) 0 clamp(36px, 4.5vw, 64px);
  background: #ffffff;
}

/* Catalog index: keep the spread inside one viewport under the sticky header. */
body[data-active-tab="maps"][data-travel-view="catalog"] .travel-section,
html[data-active-tab="maps"]:not([data-initial-route="maps-detail"]) .travel-section {
  padding: 0 0 10px;
}

/* /maps index: world map + handbook intro
   Height scales with viewport: roomy on large screens, still one-screen on laptops. */
.map-catalog {
  --map-catalog-chrome: calc(var(--site-header-height, 104px) + 28px);
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  height: clamp(500px, calc(100dvh - var(--map-catalog-chrome)), 680px);
  max-height: calc(100dvh - var(--map-catalog-chrome));
}

@media (min-width: 1280px) {
  .map-catalog {
    width: min(1400px, calc(100% - 40px));
    height: clamp(560px, calc(100dvh - var(--map-catalog-chrome)), 740px);
  }
}

@media (min-width: 1600px) {
  .map-catalog {
    --map-catalog-chrome: calc(var(--site-header-height, 104px) + 40px);
    width: min(1520px, calc(100% - 56px));
    height: clamp(620px, calc(100dvh - var(--map-catalog-chrome)), 820px);
  }
}

.map-catalog-spread {
  position: relative;
  display: grid;
  grid-template-columns: minmax(400px, 1.08fr) minmax(320px, 0.92fr);
  height: 100%;
  min-height: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(28, 26, 23, 0.12) 50%, transparent calc(50% + 1px)),
    #ffffff;
  box-shadow: 0 12px 32px rgba(24, 21, 18, 0.08);
}

.map-catalog-map-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 10px 10px 8px;
}

.map-catalog-map-shell {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 42% 28%, rgba(255, 255, 255, 0.8), transparent 34%),
    linear-gradient(135deg, #eceae6, #d4d2cd);
}

.catalog-map {
  width: 100%;
  height: 100%;
}

/* Basemap ink comes from raster-saturation in buildMapStyle; avoid CSS filter on
   the WebGL canvas (it can interfere with overlay compositing in some browsers). */

.map-region-pin {
  appearance: none;
  display: grid;
  justify-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  filter: none;
}

.map-region-pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #111111;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 5px rgba(17, 17, 17, 0.35);
}

.map-region-pin.is-active .map-region-pin-dot {
  width: 15px;
  height: 15px;
  border-width: 2.5px;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.42);
}

.map-region-pin-label {
  display: none;
  max-width: 9.5em;
  padding: 2px 6px;
  border-radius: 2px;
  color: #171717;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(24, 21, 18, 0.12);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.map-region-pin.is-label-on .map-region-pin-label,
.map-region-pin.is-active .map-region-pin-label {
  display: block;
}

.catalog-switch-row {
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  border-top: 0;
}

.catalog-chip.is-soon {
  opacity: 0.55;
}

.map-catalog-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: clamp(20px, 2.4vw, 32px) clamp(18px, 2.4vw, 32px);
  overflow: auto;
  background: #ffffff;
}

.map-catalog-kicker {
  margin: 0;
  color: #8a867f;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.map-catalog-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: 0.02em;
}

.map-catalog-meta {
  margin: 0;
  color: #5c5852;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
}

.map-catalog-caption {
  margin: 2px 0 0;
  color: #3f3b36;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
}

.map-catalog-blurb {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 4px;
  color: #4a463f;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.65;
  overflow: auto;
}

.map-catalog-blurb p {
  margin: 0;
}

.map-catalog-blurb p + p {
  margin-top: 0.9em;
}

.map-catalog-card.is-overview .map-catalog-open {
  display: none;
}

.map-catalog-open {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  flex: 0 0 auto;
  margin-top: auto;
  border: 1px solid rgba(17, 17, 17, 0.82);
  border-radius: 0;
  min-height: 38px;
  padding: 0 16px;
  color: #f7f3ea;
  background: #171717;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.map-catalog-open:hover,
.map-catalog-open:focus-visible {
  background: #2a2a2a;
  outline: none;
}

.map-catalog-open.is-soon,
.map-catalog-open:disabled {
  border-color: rgba(17, 17, 17, 0.18);
  color: #8a867f;
  background: transparent;
  cursor: not-allowed;
}

.map-catalog-card.is-soon .map-catalog-title {
  color: #6c6861;
}

body[data-travel-view="detail"] .map-catalog,
html[data-initial-route="maps-detail"] .map-catalog {
  display: none !important;
}

/* Legacy map cover shelf styles (unused by catalog index) */
.map-stage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  justify-content: center;
  justify-items: center;
  align-items: start;
  gap: clamp(22px, 2.8vw, 36px) clamp(14px, 2vw, 28px);
  width: min(1080px, calc(100% - 40px));
  min-height: 0;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 48px) clamp(24px, 3.5vw, 40px) clamp(28px, 3.5vw, 40px);
  overflow: visible;
  background: transparent;
  border: 0;
}

.map-stage::before {
  display: none;
}

.map-stage::after {
  display: none;
}

.map-stage .shelf-book {
  gap: 12px;
  transform: none;
  transform-origin: 50% 50%;
  transition: transform 180ms ease;
}

.map-stage .shelf-book::after {
  display: none;
}

.map-stage .shelf-book:hover,
.map-stage .shelf-book:focus-visible {
  filter: none;
  transform: none;
}

.map-stage .book-object {
  width: min(156px, 100%);
  box-shadow: none;
  border: 1px solid rgba(34, 31, 27, 0.12);
  transition: border-color 180ms ease, transform 180ms ease;
}

.map-stage .book-object::before,
.map-stage .book-object::after,
.map-stage .book-pages,
.map-stage .book-bottom-edge {
  display: none;
}

.map-stage .book-caption {
  min-height: 44px;
  transform: none;
}

.map-manual {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: center;
  /* forwards only: avoid opacity:0 sticking when catalog renders under [hidden] */
  animation: map-manual-enter 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--enter-delay, 0ms);
}

@keyframes map-manual-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.map-manual-featured {
  z-index: 2;
}

.map-manual-featured .book-object {
  width: min(156px, 100%);
  box-shadow: none;
}

.map-manual-featured:hover .book-object,
.map-manual-featured:focus-visible .book-object {
  border-color: rgba(34, 31, 27, 0.36);
  transform: translateY(-3px);
}

.map-manual-featured .book-caption em,
.map-manual.is-soon .book-caption em {
  display: inline-block;
  margin-top: 2px;
  font-family: var(--font);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-manual.is-soon {
  cursor: default;
}

.map-manual.is-soon .book-object {
  width: min(156px, 100%);
  box-shadow: none;
}

.map-manual.is-soon:hover,
.map-manual.is-soon:focus-visible {
  filter: none;
  transform: none;
}

.map-manual.is-soon:hover .book-object,
.map-manual.is-soon:focus-visible .book-object {
  transform: none;
  border-color: rgba(34, 31, 27, 0.12);
}

.map-stage .book-object.map-cover {
  width: min(168px, 100%);
}

.map-cover {
  position: relative;
  overflow: hidden;
  color: #f4f1ea;
  border-color: rgba(20, 18, 16, 0.2) !important;
  isolation: isolate;
}

.map-cover::after {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: 3;
  border: 1px solid rgba(244, 241, 234, 0.18);
  pointer-events: none;
}

.map-cover-motif,
.map-cover-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-cover-motif {
  z-index: 0;
  opacity: 1;
}

.map-cover-veil {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 30%),
    linear-gradient(180deg, transparent 38%, rgba(10, 9, 8, 0.62) 100%);
}

.map-cover-inner {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: end;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 22px 18px 20px;
  text-align: left;
}

.map-cover-kicker,
.map-cover-meta,
.map-cover-status {
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.72);
}

.map-cover-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-width: 9em;
  margin: 2px 0 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(244, 241, 234, 0.22);
  font-size: clamp(1.05rem, 1.5vw, 1.32rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.map-manual .book-caption span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.map-manual-featured .book-caption em {
  color: #1c1a17;
}

.map-manual.is-soon .book-caption em.is-soon-label {
  color: #8a847a;
  font-weight: 700;
}

.map-manual.is-soon .book-caption {
  min-height: 44px;
}

.map-manual.is-soon .map-cover {
  filter: saturate(0.72) brightness(1.04);
}

.map-manual.is-soon .map-cover-veil {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, transparent 34%),
    linear-gradient(180deg, transparent 48%, rgba(12, 11, 10, 0.42) 100%);
}

/* Scotland — coast ink + island silhouette */
.map-cover-scotland {
  background:
    radial-gradient(ellipse at 78% 18%, rgba(140, 170, 156, 0.42), transparent 40%),
    linear-gradient(155deg, #4a635b 0%, #243530 44%, #0c1211 100%);
}

.map-cover-scotland .map-cover-motif {
  background:
    radial-gradient(ellipse 48% 30% at 58% 36%, transparent 54%, rgba(244, 241, 234, 0.22) 55% 58%, transparent 59%),
    radial-gradient(ellipse 30% 18% at 32% 54%, transparent 52%, rgba(244, 241, 234, 0.16) 53% 56%, transparent 57%),
    repeating-linear-gradient(112deg, transparent 0 11px, rgba(244, 241, 234, 0.06) 11px 12px);
}

/* Scotland regions — whole-country atlas (lattices vs island silhouettes) */
.map-cover-scotland-regions {
  background:
    radial-gradient(ellipse at 22% 22%, rgba(168, 186, 160, 0.38), transparent 42%),
    linear-gradient(148deg, #3f554c 0%, #1c2924 48%, #0a100e 100%);
}

.map-cover-scotland-regions .map-cover-motif {
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(244, 241, 234, 0.14) 18% 19%, transparent 19% 48%, rgba(244, 241, 234, 0.12) 48% 49%, transparent 49% 72%, rgba(244, 241, 234, 0.1) 72% 73%, transparent 73%),
    linear-gradient(0deg, transparent 0 28%, rgba(244, 241, 234, 0.1) 28% 29%, transparent 29% 52%, rgba(244, 241, 234, 0.12) 52% 53%, transparent 53% 78%, rgba(244, 241, 234, 0.08) 78% 79%, transparent 79%),
    radial-gradient(circle at 70% 30%, rgba(244, 241, 234, 0.16) 0 1.5px, transparent 2px),
    radial-gradient(circle at 40% 58%, rgba(244, 241, 234, 0.14) 0 1.5px, transparent 2px),
    radial-gradient(circle at 58% 72%, rgba(244, 241, 234, 0.12) 0 1.5px, transparent 2px);
}

/* Peru — altitude bands / Andean green */
.map-cover-peru {
  background:
    radial-gradient(circle at 16% 14%, rgba(222, 198, 120, 0.36), transparent 34%),
    linear-gradient(160deg, #6a7d54 0%, #3d5138 46%, #141c12 100%);
}

.map-cover-peru .map-cover-motif {
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 9px,
      rgba(244, 241, 234, 0.11) 9px 10px
    ),
    linear-gradient(115deg, transparent 38%, rgba(222, 198, 120, 0.18) 39% 42%, transparent 43%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 76%);
}

/* Beijing — hutong grid / ink street */
.map-cover-beijing {
  background:
    radial-gradient(circle at 84% 14%, rgba(210, 170, 110, 0.3), transparent 32%),
    linear-gradient(152deg, #5a4a3c 0%, #2c241e 50%, #0f0d0b 100%);
}

.map-cover-beijing .map-cover-motif {
  background:
    linear-gradient(90deg, rgba(244, 241, 234, 0.13) 0 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(0deg, rgba(244, 241, 234, 0.13) 0 1px, transparent 1px) 0 0 / 16px 16px,
    radial-gradient(circle at 28% 32%, rgba(244, 241, 234, 0.28) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 64% 46%, rgba(244, 241, 234, 0.2) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 42% 60%, rgba(244, 241, 234, 0.16) 0 2px, transparent 3px);
}

/* (removed Qianmen cover motif) */

/* Beijing food finds — warm kitchen / night-market ember */
.map-cover-beijing-food {
  background:
    radial-gradient(circle at 22% 18%, rgba(220, 140, 90, 0.34), transparent 36%),
    linear-gradient(154deg, #6a4534 0%, #3a261c 50%, #140e0b 100%);
}

.map-cover-beijing-food .map-cover-motif {
  background:
    radial-gradient(circle at 70% 30%, rgba(244, 241, 234, 0.2) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 38% 52%, rgba(244, 241, 234, 0.14) 0 2px, transparent 3px),
    repeating-linear-gradient(118deg, transparent 0 13px, rgba(244, 241, 234, 0.05) 13px 14px);
}

/* Beijing ware — hutong ink + ash glaze */
.map-cover-beijing-ceramics {
  background:
    radial-gradient(circle at 78% 18%, rgba(210, 200, 180, 0.28), transparent 36%),
    linear-gradient(150deg, #6a5e52 0%, #3a342e 48%, #141210 100%);
}

.map-cover-beijing-ceramics .map-cover-motif {
  background:
    linear-gradient(90deg, rgba(244, 241, 234, 0.1) 0 1px, transparent 1px) 0 0 / 15px 15px,
    linear-gradient(0deg, rgba(244, 241, 234, 0.1) 0 1px, transparent 1px) 0 0 / 15px 15px,
    radial-gradient(circle at 68% 30%, transparent 16%, rgba(244, 241, 234, 0.16) 17% 18%, transparent 19%),
    radial-gradient(circle at 68% 30%, transparent 26%, rgba(244, 241, 234, 0.1) 27% 28%, transparent 29%);
}

/* Kyoto — ash glaze + kiln rings */
.map-cover-kyoto {
  background:
    radial-gradient(circle at 72% 20%, rgba(220, 224, 226, 0.34), transparent 38%),
    linear-gradient(148deg, #7a8488 0%, #41494d 50%, #15191c 100%);
}

.map-cover-kyoto .map-cover-motif {
  background:
    radial-gradient(circle at 70% 28%, transparent 14%, rgba(244, 241, 234, 0.22) 15% 17%, transparent 18%),
    radial-gradient(circle at 70% 28%, transparent 24%, rgba(244, 241, 234, 0.16) 25% 27%, transparent 28%),
    radial-gradient(circle at 70% 28%, transparent 34%, rgba(244, 241, 234, 0.12) 35% 37%, transparent 38%);
}

/* Generic ceramic (Japan soon) */
.map-cover-ceramic {
  background:
    radial-gradient(circle at 24% 20%, rgba(230, 226, 216, 0.22), transparent 38%),
    linear-gradient(150deg, #8a8680 0%, #55524e 48%, #262422 100%);
}

.map-cover-ceramic .map-cover-motif {
  background:
    radial-gradient(circle at 50% 36%, transparent 22%, rgba(244, 241, 234, 0.12) 23% 24%, transparent 25%),
    radial-gradient(circle at 50% 36%, transparent 34%, rgba(244, 241, 234, 0.08) 35% 36%, transparent 37%),
    repeating-linear-gradient(0deg, transparent 0 16px, rgba(244, 241, 234, 0.04) 16px 17px);
}

/* Generic coffee fallback */
.map-cover-coffee {
  background:
    radial-gradient(circle at 20% 18%, rgba(196, 160, 120, 0.24), transparent 36%),
    linear-gradient(154deg, #6b5646 0%, #3d2f26 50%, #171310 100%);
}

.map-cover-coffee .map-cover-motif {
  background:
    radial-gradient(circle at 72% 28%, transparent 14%, rgba(244, 241, 234, 0.14) 15% 16%, transparent 17%),
    radial-gradient(circle at 72% 28%, transparent 22%, rgba(244, 241, 234, 0.09) 23% 24%, transparent 25%),
    repeating-linear-gradient(125deg, transparent 0 12px, rgba(244, 241, 234, 0.04) 12px 13px);
}

/* Shanghai — concession street grain */
.map-cover-shanghai {
  background:
    linear-gradient(155deg, #6a5f56 0%, #3a342f 48%, #171513 100%);
}

.map-cover-shanghai .map-cover-motif {
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(244, 241, 234, 0.05) 10px 11px),
    linear-gradient(180deg, transparent 55%, rgba(196, 168, 122, 0.12) 100%);
}

/* Shenzhen — bay light / maker grid */
.map-cover-shenzhen {
  background:
    radial-gradient(ellipse at 80% 12%, rgba(120, 160, 170, 0.28), transparent 40%),
    linear-gradient(152deg, #4d5d62 0%, #2c383c 50%, #12181a 100%);
}

.map-cover-shenzhen .map-cover-motif {
  background:
    linear-gradient(90deg, rgba(244, 241, 234, 0.06) 0 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(0deg, rgba(244, 241, 234, 0.06) 0 1px, transparent 1px) 0 0 / 14px 14px;
  mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 70%);
}

/* Tokyo — kissaten lamp dusk */
.map-cover-tokyo {
  background:
    radial-gradient(circle at 30% 22%, rgba(214, 170, 110, 0.28), transparent 32%),
    linear-gradient(158deg, #5a4638 0%, #32261f 48%, #120e0c 100%);
}

.map-cover-tokyo .map-cover-motif {
  background:
    radial-gradient(circle at 30% 24%, rgba(244, 241, 234, 0.18) 0 3px, transparent 4px),
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(244, 241, 234, 0.04) 18px 19px);
}

.map-manual-featured:hover .map-cover-motif,
.map-manual-featured:focus-visible .map-cover-motif {
  transform: scale(1.03);
  transition: transform 320ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .map-manual {
    animation: none;
  }

  .map-manual-featured:hover .map-cover-motif,
  .map-manual-featured:focus-visible .map-cover-motif {
    transform: none;
  }
}

body[data-travel-view="detail"] .travel-section,
html[data-initial-route="maps-detail"] .travel-section {
  padding: 0 0 16px;
}

.travel-detail {
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
}

.map-detail-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin: 0 0 6px;
  padding: 0 2px;
}

.map-back {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.map-back:hover,
.map-back:focus-visible {
  opacity: 0.72;
  outline: none;
}

.open-map-book {
  appearance: none;
  border: 1px solid var(--ink);
  border-radius: 0;
  min-height: 40px;
  padding: 0 16px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.open-map-book {
  width: fit-content;
  margin-top: 4px;
  color: #ffffff;
  background: var(--ink);
}

.map-book-teaser {
  display: grid;
  gap: 16px;
  max-width: 520px;
}

.map-book-teaser h3 {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 4.2rem);
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: 0.03em;
}

.map-book-teaser p:not(.feature-date) {
  margin: 0;
  color: #4f4b45;
  font-family: var(--font);
  font-size: clamp(0.98rem, 1.2vw, 1.1rem);
  font-weight: 650;
  line-height: 1.9;
}

.map-book-rail {
  display: grid;
  align-content: start;
  gap: 22px;
  padding-top: clamp(18px, 2.6vw, 34px);
}

.map-book-card {
  appearance: none;
  border: 0;
  display: grid;
  gap: 18px;
  width: 100%;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.map-book-object {
  position: relative;
  display: grid;
  align-content: end;
  gap: 10px;
  width: min(220px, 100%);
  aspect-ratio: 2 / 3;
  padding: 28px 22px;
  color: #f8f4ea;
  background:
    linear-gradient(180deg, rgba(18, 17, 15, 0.12), rgba(18, 17, 15, 0.58)),
    radial-gradient(circle at 26% 18%, rgba(244, 240, 226, 0.26), transparent 34%),
    linear-gradient(142deg, #54645a 0%, #273b36 48%, #171f1e 100%);
  box-shadow:
    12px 14px 0 rgba(35, 33, 30, 0.12),
    28px 34px 50px rgba(21, 18, 16, 0.28);
  transform: perspective(720px) rotateY(-8deg) rotateZ(-1.4deg);
}

.map-book-object::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 26px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(255, 255, 255, 0.08));
}

.map-book-object::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(248, 244, 234, 0.34);
  pointer-events: none;
}

.map-book-cover-kicker,
.map-book-cover-meta {
  position: relative;
  z-index: 1;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.map-book-cover-title {
  position: relative;
  z-index: 1;
  max-width: 7em;
  font-size: clamp(1.35rem, 2.1vw, 1.9rem);
  font-weight: 580;
  line-height: 1.18;
  letter-spacing: 0.04em;
}

.map-book-cover-meta {
  opacity: 0.8;
}

.map-book-caption {
  display: grid;
  gap: 6px;
  font-family: var(--font);
}

.map-book-caption strong {
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.3;
}

.map-book-caption span {
  color: #716d66;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
}

.map-book-spread {
  position: relative;
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(380px, 0.95fr);
  height: min(820px, calc(100vh - 140px));
  min-height: 560px;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(28, 26, 23, 0.12) 50%, transparent calc(50% + 1px)),
    #ffffff;
  box-shadow: 0 12px 32px rgba(24, 21, 18, 0.08);
}

.map-book-spread::before,
.map-book-spread::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  width: 18px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.1), transparent);
  pointer-events: none;
  z-index: 2;
}

.map-book-spread::before { left: 0; }
.map-book-spread::after {
  right: 0;
  transform: scaleX(-1);
}

.map-page,
.map-notes-page {
  min-width: 0;
  min-height: 0;
  padding: clamp(12px, 1.5vw, 20px);
}

.map-page {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  height: 100%;
  overflow: hidden;
}

.travel-map-shell {
  position: relative;
  isolation: isolate;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.travel-map {
  position: relative;
  isolation: isolate;
  z-index: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  background:
    radial-gradient(circle at 42% 28%, rgba(255, 255, 255, 0.8), transparent 34%),
    linear-gradient(135deg, #eceae6, #d4d2cd);
  overflow: hidden;
}

.map-dim-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgba(17, 17, 17, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(18, 17, 15, 0.1);
}

.map-dim-btn {
  appearance: none;
  border: 0;
  border-radius: 0;
  min-width: 30px;
  min-height: 26px;
  padding: 0 8px;
  color: #3f3b36;
  background: transparent;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  line-height: 1;
}

.map-dim-btn + .map-dim-btn {
  border-left: 1px solid rgba(17, 17, 17, 0.12);
}

.map-dim-btn:hover,
.map-dim-btn:focus-visible {
  background: #f6f5f2;
  outline: none;
}

.map-dim-btn.is-active {
  color: #f7f3ea;
  background: #171717;
}

.map-labels-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0 7px;
}

.map-labels-icon {
  display: block;
  width: 12px;
  height: 12px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M1.5 2.5h8.2l4.8 5.1-4.8 5.1H1.5V2.5zm2.2 2.1v5.8h5.3l3.2-2.9-3.2-2.9H3.7zm2.1 1.4a1.15 1.15 0 1 1 0 2.3 1.15 1.15 0 0 1 0-2.3z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M1.5 2.5h8.2l4.8 5.1-4.8 5.1H1.5V2.5zm2.2 2.1v5.8h5.3l3.2-2.9-3.2-2.9H3.7zm2.1 1.4a1.15 1.15 0 1 1 0 2.3 1.15 1.15 0 0 1 0-2.3z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.region-switch-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
}

.region-switch {
  display: flex;
  flex: 1 1 0;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding: 2px 0;
  scrollbar-width: none;
}

.region-switch::-webkit-scrollbar {
  display: none;
}

.region-chip {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid rgba(28, 26, 23, 0.14);
  min-height: 32px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.55);
  color: #3f3b36;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.region-chip:hover,
.region-chip:focus-visible {
  border-color: rgba(17, 17, 17, 0.42);
  background: rgba(255, 255, 255, 0.88);
}

.region-chip.is-active {
  border-color: rgba(17, 17, 17, 0.72);
  background: #171717;
  color: #f7f3ea;
}

.region-chip.is-parent {
  border-color: rgba(17, 17, 17, 0.5);
  background: rgba(23, 23, 23, 0.08);
  color: #171717;
}

.region-chip-cafe {
  font-weight: 650;
  color: #4f4b45;
  background: rgba(255, 255, 255, 0.42);
}

.region-autoplay {
  appearance: none;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(28, 26, 23, 0.14);
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  color: #2a2723;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.region-autoplay:hover,
.region-autoplay:focus-visible {
  border-color: rgba(17, 17, 17, 0.42);
  background: rgba(255, 255, 255, 0.88);
}

.region-autoplay.is-playing {
  border-color: rgba(17, 17, 17, 0.72);
  background: #171717;
  color: #f7f3ea;
}

.region-autoplay-icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
}

.region-autoplay.is-playing .region-autoplay-icon {
  width: 8px;
  height: 10px;
  margin-left: 0;
  border: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 2.5px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 2.5px 100% no-repeat;
}

.map-notes-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-left: 1px solid rgba(34, 31, 27, 0.1);
  background: #ffffff;
}

.map-notes-head {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.map-notes-kicker {
  margin: 0 0 8px;
  color: #8a867f;
  font-family: var(--font);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.map-book-intro {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(0.98rem, 1.15vw, 1.12rem);
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.map-book-blurb {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(34, 31, 27, 0.1);
  color: #6a655e;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
}

.map-notes-head.is-overview .map-book-blurb {
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.map-notes-head #region-title[hidden],
.map-notes-head #region-label[hidden] {
  display: none !important;
}

.map-notes-page h3 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 2.2vw, 2.4rem);
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: 0.03em;
}

.region-eyebrow {
  margin: 0;
  color: #6a655e;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.45;
}

.region-article {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  font-family: var(--font);
}

.region-meta {
  margin: 0 0 1.15em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.region-meta-row {
  display: grid;
  grid-template-columns: 4.2em 1fr;
  gap: 10px;
  align-items: start;
  color: #2f2c28;
  font-size: 0.9rem;
  line-height: 1.55;
}

.region-meta-key {
  color: #8a867f;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 0.2em;
}

.region-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.region-tag {
  border: 1px solid var(--line);
  padding: 3px 8px;
  color: #4f4b45;
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.region-article p {
  margin: 0 0 1.05em;
  color: #2f2c28;
  font-size: clamp(0.92rem, 1.05vw, 1.02rem);
  font-weight: 500;
  line-height: 1.85;
}

.region-article p:last-child {
  margin-bottom: 0.2em;
}

.mapboxgl-ctrl-group,
.maplibregl-ctrl-group {
  border-radius: 0;
  box-shadow: 0 6px 18px rgba(18, 17, 15, 0.12);
}

@media (max-width: 980px) {
  .site-header {
    gap: 12px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: 14px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
  }

  .header-brand {
    min-height: 32px;
  }

  .wordmark {
    text-align: center;
  }

  .nav-tabs {
    justify-content: flex-start;
    gap: 20px;
    padding: 0 4px 2px;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
  }

  .lang-switch {
    padding-left: 8px;
  }

  .lang-button {
    min-height: 32px;
    padding: 6px 2px;
  }

  .hero-carousel {
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
    overflow: hidden;
  }

  .side-panel { display: none; }

  .feature-card {
    min-height: 0;
    height: auto;
  }

  .feature-content {
    grid-template-columns: 1fr;
    justify-items: center;
    justify-content: center;
    align-content: start;
    gap: 26px;
    padding: 32px 20px 100px;
    text-align: center;
  }

  .cover-frame {
    justify-self: center;
    margin-inline: auto;
    width: min(220px, 52vw);
  }

  .feature-copy {
    display: grid;
    justify-items: center;
    gap: 0;
    width: min(100%, 36rem);
    max-width: 36rem;
    margin-inline: auto;
    text-align: center;
  }

  .feature-kicker,
  .feature-date {
    margin: 0 0 16px;
  }

  .feature-copy h1 {
    margin: 0 0 16px;
    font-size: clamp(1.55rem, 6vw, 2.1rem);
  }

  .feature-copy p {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .feature-controls {
    left: 50%;
    right: auto;
    bottom: 18px;
    width: fit-content;
    transform: translateX(-50%);
  }

  .slide-button {
    width: 48px;
    height: 44px;
    font-size: 2rem;
  }

  .shelf-section {
    padding: 48px 0 64px;
  }

  .shelf-heading {
    margin-bottom: 28px;
  }

  .book-stage {
    display: flex;
    gap: 18px;
    width: 100%;
    min-height: 0;
    padding: 36px max(20px, env(safe-area-inset-right, 0px)) 36px max(18px, env(safe-area-inset-left, 0px));
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .book-stage::-webkit-scrollbar { display: none; }

  .shelf-book {
    flex: 0 0 118px;
    gap: 12px;
    scroll-snap-align: center;
  }

  .book-object {
    --book-spine-w: 10px;
    --book-page-w: 8px;
    width: 104px;
    transform: perspective(840px) rotateY(-12deg) rotateX(2deg);
    box-shadow:
      0 16px 24px rgba(40, 34, 26, 0.24),
      5px 6px 0 rgba(72, 63, 52, 0.06);
  }

  .shelf-book:hover .book-object,
  .shelf-book:focus-visible .book-object {
    transform: perspective(840px) rotateY(-9deg) rotateX(2deg) translateY(-2px);
  }

  .book-object::after {
    bottom: -12px;
    height: 14px;
    filter: blur(10px);
  }

  .shelf-book::after {
    display: none;
  }

  .book-caption {
    min-height: 44px;
  }

  .book-caption strong {
    font-size: 0.82rem;
  }

  .book-caption span {
    font-size: 0.68rem;
  }

  .map-stage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;
    justify-items: center;
    gap: 28px 18px;
    width: min(100%, calc(100% - 24px));
    min-height: 0;
    margin: 0 auto;
    padding: 28px 20px 32px;
    overflow: visible;
  }

  .map-manual,
  .map-manual.is-soon {
    display: grid;
    justify-items: center;
    width: 100%;
    max-width: 168px;
    margin-inline: auto;
  }

  .map-stage .book-object,
  .map-manual-featured .book-object,
  .map-manual.is-soon .book-object {
    width: min(148px, 100%);
    margin-inline: auto;
    box-shadow: none;
  }

  .map-manual .book-caption {
    min-height: 0;
    width: 100%;
    text-align: center;
  }

  .map-stage .shelf-book,
  .map-stage .shelf-book:hover,
  .map-stage .shelf-book:focus-visible {
    transform: none;
  }

  .map-manual {
    animation: none;
  }

  .travel-section {
    padding: 20px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  }

  body[data-active-tab="maps"][data-travel-view="catalog"] .travel-section,
  html[data-active-tab="maps"]:not([data-initial-route="maps-detail"]) .travel-section {
    padding: 0 0 calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .map-catalog {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .map-catalog-spread {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: 0;
    box-shadow: none;
    background: #ffffff;
  }

  .map-catalog-map-col {
    height: auto;
    padding: 10px 12px 8px;
  }

  .map-catalog-map-shell {
    flex: none;
    height: clamp(260px, 44dvh, 380px);
  }

  .map-catalog-card {
    height: auto;
    max-height: none;
    padding: 18px 16px 22px;
    background: #ffffff;
  }

  .map-catalog-title {
    font-size: 1.45rem;
  }

  .map-catalog-open {
    width: 100%;
    justify-content: center;
  }

  body[data-travel-view="detail"] .travel-section,
  html[data-initial-route="maps-detail"] .travel-section {
    padding: 0 0 calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .travel-detail {
    width: 100%;
    max-width: none;
  }

  .map-detail-bar {
    width: min(100%, calc(100% - 24px));
    margin: 0 auto 8px;
    padding: 0 4px;
  }

  .map-book-spread {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: 0;
    box-shadow: none;
    background: #ffffff;
  }

  .map-book-spread::before,
  .map-book-spread::after { display: none; }

  .map-page {
    gap: 0;
    height: auto;
    padding: 0;
    overflow: visible;
  }

  .travel-map-shell,
  .travel-map {
    width: 100%;
    height: min(58vh, 460px);
    height: min(58dvh, 460px);
    min-height: 280px;
  }

  .travel-map {
    border: 0;
    border-bottom: 1px solid rgba(34, 31, 27, 0.08);
  }

  .region-switch-row {
    position: sticky;
    top: calc(var(--site-header-height, 104px) + env(safe-area-inset-top, 0px));
    z-index: 5;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(34, 31, 27, 0.08);
    backdrop-filter: blur(12px);
  }

  .region-switch {
    gap: 8px;
    padding: 0 4px 0 0;
    scroll-snap-type: x proximity;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent);
  }

  .region-chip {
    scroll-snap-align: center;
  }

  .map-notes-page {
    border-left: 0;
    border-top: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 22px max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px));
    background: #ffffff;
  }

  .map-notes-head {
    text-align: left;
    margin-bottom: 16px;
  }

  .region-article {
    max-height: none;
    overflow: visible;
    padding-right: 0;
    -webkit-overflow-scrolling: touch;
  }

  .region-chip,
  .region-autoplay {
    min-height: 36px;
  }

  .region-autoplay {
    width: 36px;
    height: 36px;
  }

  .region-article p {
    line-height: 1.78;
  }

  .page-section {
    padding: 40px max(20px, env(safe-area-inset-right, 0px)) calc(64px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  }

  .about-shell,
  .page-shell {
    width: min(100%, 100%);
  }
}

@media (max-width: 560px) {
  .wordmark { font-size: 1.65rem; }

  .lang-switch {
    gap: 4px;
  }

  .lang-button,
  .lang-sep {
    font-size: 0.7rem;
  }

  .nav-tabs {
    gap: 16px;
    padding: 0 2px 2px;
  }

  .nav-tab {
    font-size: 0.88rem;
    letter-spacing: 0.06em;
  }

  .hero-carousel {
    padding: 0 8px;
  }

  .feature-content {
    gap: 20px;
    padding: 26px 16px 92px;
  }

  .cover-frame {
    width: min(180px, 48vw);
  }

  .feature-kicker,
  .feature-date {
    margin-bottom: 14px;
  }

  .feature-copy h1 {
    margin-bottom: 14px;
    font-size: 1.55rem;
  }

  .feature-copy p {
    font-size: 0.92rem;
  }

  .feature-controls {
    bottom: 14px;
  }

  .slide-button {
    width: 44px;
    height: 40px;
    font-size: 1.8rem;
  }

  .shelf-heading h2,
  .page-title,
  .about-title {
    font-size: clamp(1.4rem, 5.4vw, 1.75rem);
    letter-spacing: 0.1em;
  }

  .book-stage {
    gap: 14px;
    padding: 28px 14px 32px 12px;
  }

  .shelf-book {
    flex-basis: 96px;
    gap: 10px;
  }

  .book-object {
    --book-spine-w: 8px;
    --book-page-w: 7px;
    width: 86px;
  }

  .book-caption {
    min-height: 40px;
  }

  .book-caption strong {
    font-size: 0.76rem;
  }

  .book-caption span {
    font-size: 0.64rem;
  }

  .shelf-book::after {
    display: none;
  }

  .map-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
    width: calc(100% - 16px);
    padding: 24px 14px 28px;
  }

  .map-manual,
  .map-manual.is-soon {
    max-width: none;
  }

  .map-stage .book-object,
  .map-manual-featured .book-object,
  .map-manual.is-soon .book-object {
    width: min(100%, 132px);
    box-shadow: none;
  }

  .map-cover-inner {
    padding: 14px 12px;
    gap: 6px;
  }

  .map-cover-title {
    max-width: none;
    font-size: 0.88rem;
    -webkit-line-clamp: 3;
  }

  .map-cover-kicker,
  .map-cover-meta,
  .map-cover-status {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .map-manual-featured .book-caption em {
    font-size: 0.62rem;
  }

  .travel-section {
    padding-top: 18px;
  }

  body[data-travel-view="detail"] .travel-section,
  html[data-initial-route="maps-detail"] .travel-section {
    padding-top: 0;
  }

  .map-catalog-map-shell {
    height: clamp(220px, 40dvh, 300px);
  }

  .map-catalog-card {
    padding: 16px 14px 20px;
  }

  .map-detail-bar {
    width: min(100%, calc(100% - 16px));
    margin: 0 auto 6px;
  }

  .map-page {
    padding: 0;
  }

  .map-notes-page {
    padding: 18px max(14px, env(safe-area-inset-right, 0px)) 24px max(14px, env(safe-area-inset-left, 0px));
  }

  .travel-map-shell,
  .travel-map {
    height: min(52vh, 380px);
    height: min(52dvh, 380px);
    min-height: 250px;
  }

  .map-notes-page h3 {
    font-size: 1.35rem;
  }

  .region-switch-row {
    padding: 8px 10px;
  }

  .region-chip {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.74rem;
  }

  .about-block p,
  .page-lead {
    font-size: 0.95rem;
    line-height: 1.8;
  }
}

@media (max-width: 380px) {
  .map-stage {
    gap: 20px 10px;
    padding: 20px 10px 24px;
  }

  .map-stage .book-object,
  .map-manual-featured .book-object,
  .map-manual.is-soon .book-object {
    width: min(100%, 118px);
    box-shadow: none;
  }

  .cover-frame {
    width: min(160px, 46vw);
  }

  .nav-tabs {
    gap: 14px;
  }
}

/* —— Admin / Analytics (same visual language as the public site) —— */
.admin-page {
  background: var(--paper);
  color: var(--ink);
}

.admin-layout {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 clamp(72px, 10vw, 120px);
}

.admin-header .header-brand {
  gap: 12px;
}

.admin-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-nav {
  justify-content: center;
}

.admin-hero {
  padding: clamp(36px, 6vw, 64px) 0 8px;
  text-align: center;
}

.admin-eyebrow {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8a867f;
}

.admin-title {
  margin: 0 auto;
}

.admin-lead {
  margin: 18px auto 0;
  max-width: 42rem;
}

.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: end;
  margin: 28px 0 22px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.analytics-toolbar .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.analytics-token-field {
  flex: 1 1 220px;
}

.analytics-range-field {
  flex: 0 1 120px;
}

.analytics-token-field span,
.analytics-range-field span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-token-field input,
.analytics-range-field select {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.analytics-refresh {
  min-height: 42px;
  padding: 10px 18px;
}

.analytics-status {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.admin-card.analytics-card {
  margin: 0 0 22px;
  padding: 22px 0 8px;
  border-top: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
}

.analytics-heading {
  margin-bottom: 12px;
}

.analytics-heading .eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a867f;
}

.analytics-heading h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.analytics-totals {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.analytics-uniques {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.analytics-uniques-note {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 36px;
}

.analytics-grid .analytics-card {
  min-width: 0;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.legend-item::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--ink);
}

.legend-secondary::before {
  background: #8a867f;
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.analytics-chart-svg {
  width: 100%;
  min-width: 360px;
  height: auto;
  display: block;
}

.chart-grid {
  stroke: rgba(17, 17, 17, 0.08);
  stroke-width: 1;
}

.chart-label {
  fill: #8a867f;
  font-size: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.chart-line {
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-visit { stroke: #111111; }
.chart-line-secondary { stroke: #8a867f; }

.analytics-table-wrap {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.45;
}

.analytics-table th,
.analytics-table td {
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.analytics-table th {
  color: #8a867f;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.analytics-table .num,
.analytics-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.analytics-table tbody tr:last-child td {
  border-bottom: 0;
}

.analytics-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: #5f5a52;
}

.meadow-admin-card .admin-card-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.meadow-admin-style {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 7.5rem;
}

.meadow-admin-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
  background: #f4f7ee;
  border: 1px solid var(--line);
}

.meadow-admin-thumb-empty {
  display: inline-block;
  background: #f0eeea;
}

.meadow-admin-name {
  font-weight: 650;
  white-space: nowrap;
}

.meadow-admin-body {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #3f3b36;
}

.meadow-admin-muted {
  color: #a39e96;
}

.meadow-admin-time {
  white-space: nowrap;
}

.meadow-admin-empty {
  padding: 28px 6px !important;
  color: var(--muted);
  text-align: center !important;
}

.meadow-delete-tent {
  appearance: none;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.meadow-delete-tent:hover,
.meadow-delete-tent:focus-visible {
  background: #111;
  color: #fff;
  outline: none;
}

@media (max-width: 720px) {
  .meadow-admin-body {
    max-width: 12rem;
  }
}

.ai-limit-toolbar {
  align-items: end;
  border-bottom: 0;
  padding: 0;
}

.ai-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.ai-legend-item {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.ai-legend-item.is-user {
  color: #14532d;
  background: #dcfce7;
}

.ai-legend-item.is-thinking {
  color: #854d0e;
  background: #fef08a;
}

.ai-legend-item.is-assistant {
  color: #1e3a8a;
  background: #dbeafe;
}

.ai-jsonl-view {
  max-height: 640px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  color: #201c18;
  background: #fbfaf7;
  font-size: 0.86rem;
  line-height: 1.55;
}

.ai-session-timeline {
  display: grid;
  gap: 10px;
}

.ai-hl-block {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
}

.ai-hl-block.is-user {
  color: #14532d;
  background: #dcfce7;
  border-color: #86efac;
}

.ai-hl-block.is-thinking {
  color: #713f12;
  background: #fef9c3;
  border-color: #fde047;
}

.ai-hl-block.is-assistant {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #93c5fd;
}

.ai-hl-block.is-error {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fca5a5;
}

.ai-hl-block.is-blocked {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fdba74;
}

.ai-hl-block.is-meta {
  color: #3f3f46;
  background: #f4f4f5;
  border-color: #e4e4e7;
}

.ai-hl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-hl-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-hl-meta {
  color: inherit;
  opacity: 0.72;
  font-size: 0.72rem;
}

.ai-hl-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ai-jsonl-raw {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ai-jsonl-raw summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.ai-jsonl-raw pre {
  margin: 10px 0 0;
  overflow: auto;
  max-height: 280px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #201c18;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.admin-page .empty-state {
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.notta-ai {
  position: fixed;
  right: max(22px, env(safe-area-inset-right, 0px));
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  z-index: 80;
  font-family: var(--font);
}

.notta-ai-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 0;
  padding: 11px 14px;
  color: #111;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 8px 20px rgba(18, 17, 15, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.notta-ai-button:hover,
.notta-ai-button:focus-visible,
.notta-ai-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(18, 17, 15, 0.14);
  outline: none;
}

.notta-ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: #111;
}

.notta-ai-panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(390px, calc(100vw - 28px));
  height: min(560px, calc(100dvh - 120px));
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.14);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(18, 17, 15, 0.2);
  backdrop-filter: blur(22px);
}

.notta-ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.notta-ai-head h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.1;
}

.notta-ai-context {
  margin: 6px 0 0;
  max-width: 16rem;
  font-size: 0.72rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.notta-ai-close {
  appearance: none;
  border: 0;
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.notta-ai-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  background: #fbfaf7;
}

.notta-ai-message {
  max-width: 88%;
  padding: 10px 12px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.notta-ai-message.is-assistant {
  align-self: flex-start;
  color: #171411;
  background: #ffffff;
}

.notta-ai-message.is-user {
  align-self: flex-end;
  color: #ffffff;
  background: #111111;
  border-color: #111111;
}

.notta-ai-speaker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.72;
  margin-bottom: 4px;
}

.notta-ai-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.notta-ai-message.is-pending {
  opacity: 0.72;
}

/* Meadow chat reuses the same frosted chip as other pages (no solid dark fill). */
.notta-ai.is-meadow-chat .notta-ai-button {
  color: #111;
  background: rgba(255, 255, 255, 0.52);
  border: 0;
  box-shadow: 0 8px 20px rgba(18, 17, 15, 0.08);
}

.notta-ai.is-meadow-chat .notta-ai-button:hover,
.notta-ai.is-meadow-chat .notta-ai-button:focus-visible,
.notta-ai.is-meadow-chat .notta-ai-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(18, 17, 15, 0.14);
}

.notta-ai.is-meadow-chat .notta-ai-dot {
  background: #111;
}

.notta-ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.notta-ai-form textarea {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  font-size: 0.9rem;
  line-height: 1.35;
}

.notta-ai-form button {
  appearance: none;
  align-self: end;
  border: 0;
  padding: 0 14px;
  min-height: 42px;
  color: #fff;
  background: #111;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.06em;
}

@media (max-width: 820px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .notta-ai {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }

  .notta-ai-panel {
    right: -4px;
    bottom: 56px;
    width: calc(100vw - 20px);
    height: min(540px, calc(100dvh - 98px));
  }
}

/* ===== Music record room ===== */
.music-section {
  padding: 0;
  background: #111111;
  overflow: clip;
}

.music-shop {
  width: 100%;
  margin: 0;
  padding: 0;
}

.music-stage {
  position: relative;
  width: 100%;
  margin: 0;
  aspect-ratio: 2400 / 1329;
  min-height: min(560px, calc(100dvh - var(--site-header-height, 96px)));
  max-height: calc(100dvh - var(--site-header-height, 96px));
  border: 0;
  border-bottom: 1px solid #2a2825;
  overflow: hidden;
  background: #141210;
}

.music-stage-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  display: block;
}

.music-stage-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 7, 6, 0.5) 0%, rgba(8, 7, 6, 0.12) 18%, transparent 36%, transparent 62%, rgba(8, 7, 6, 0.28) 100%),
    radial-gradient(ellipse 42% 34% at 42% 48%, rgba(255, 210, 140, 0.08), transparent 70%);
}

.music-shop-header {
  position: absolute;
  top: 28px;
  left: 50%;
  z-index: 6;
  width: min(360px, calc(100% - 32px));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  color: #f4f1ea;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
}

.music-disc-btn {
  position: fixed;
  top: calc(var(--site-header-height, 96px) + 16px);
  left: max(14px, 1.6vw);
  z-index: 9;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  transition: transform 160ms ease, filter 160ms ease;
}

.music-disc-btn:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}

.music-disc-btn:focus-visible {
  outline: 2px solid rgba(244, 241, 234, 0.85);
  outline-offset: 3px;
}

.music-disc {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), transparent 28%),
    radial-gradient(circle at 50% 50%, #2a2420 0 14%, #1a1512 15% 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 5px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.music-disc-groove,
.music-disc-groove--mid {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 170, 0.08),
    inset 0 0 0 3px rgba(0, 0, 0, 0.25),
    inset 0 0 0 5px rgba(255, 220, 170, 0.05);
}

.music-disc-groove--mid {
  inset: 28%;
}

.music-disc-label {
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, rgba(255, 236, 210, 0.55), transparent 45%),
    linear-gradient(145deg, #c4a07a, #8a6244 55%, #6d4a32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.music-disc-hole {
  position: absolute;
  inset: 45%;
  border-radius: 50%;
  background: #0d0b0a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.music-disc-btn.is-playing .music-disc {
  animation: music-disc-spin 2.8s linear infinite;
}

@keyframes music-disc-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .music-disc-btn.is-playing .music-disc {
    animation: none;
  }
}

.music-audio-host {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.music-yt-host {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 200px;
  height: 200px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.music-artist-switch {
  position: absolute;
  top: 18px;
  right: max(16px, 2vw);
  z-index: 7;
}

.music-artist-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 118px;
  max-width: min(200px, 42vw);
  border: 0;
  border-radius: 0;
  padding: 9px 30px 9px 12px;
  color: #f4f1ea;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23f4f1ea' d='M1.1 1.2 6 6.1l4.9-4.9'/%3E%3C/svg%3E")
      right 11px center / 10px no-repeat,
    rgba(18, 16, 14, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  transition: background-color 160ms ease;
}

.music-artist-select:hover,
.music-artist-select:focus-visible {
  background-color: rgba(18, 16, 14, 0.72);
  outline: none;
}

.music-artist-select option {
  color: #171411;
  background: #f7f3ea;
}

.music-kicker {
  margin: 0 0 8px;
  color: rgba(244, 241, 234, 0.72);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.music-title {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f7f3ea;
}

.music-title::after {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  margin: 12px auto 0;
  background: rgba(247, 243, 234, 0.75);
}

.music-lead {
  margin: 0 auto;
  max-width: 34ch;
  color: rgba(244, 241, 234, 0.78);
  font-size: 0.84rem;
  line-height: 1.6;
}

.music-wall {
  position: absolute;
  left: 1.8%;
  right: 1.8%;
  top: 10.5%;
  bottom: 32.5%;
  z-index: 4;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 2.4%;
  padding: 0.4% 0.8%;
}

.music-wall-status {
  grid-row: 1 / -1;
  place-self: center;
  margin: 0;
  padding: 10px 14px;
  color: #f4f1ea;
  background: rgba(17, 17, 17, 0.55);
  letter-spacing: 0.04em;
}

.music-shelf {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 0;
  animation: musicShelfIn 700ms ease both;
  animation-delay: var(--shelf-delay, 0ms);
}

/* Top shelf overlay sits a touch high on the photo; nudge only that row. */
.music-shelf:first-child {
  padding-top: 2.2%;
  box-sizing: border-box;
}

.music-spines {
  display: flex;
  align-items: end;
  justify-content: space-evenly;
  gap: 1px;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.music-nook-gap {
  flex: 0 0 clamp(88px, 14vw, 168px);
  height: 100%;
  pointer-events: none;
}

.music-spine {
  position: relative;
  appearance: none;
  flex: 0 0 auto;
  width: clamp(15px, 1.7vw, 24px);
  height: var(--spine-h, 90%);
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  background: rgba(255, 246, 228, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #1d1a16;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    filter 180ms ease;
}

.music-spine::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent 45%, rgba(255, 255, 255, 0.16));
  opacity: 0.35;
  pointer-events: none;
}

.music-spine.tone-warm { background: rgba(226, 210, 183, 0.52); }
.music-spine.tone-paper { background: rgba(247, 241, 230, 0.58); }
.music-spine.tone-ink { background: rgba(36, 33, 30, 0.55); color: #f3eee5; }
.music-spine.tone-clay { background: rgba(210, 180, 154, 0.55); }
.music-spine.tone-sand { background: rgba(234, 217, 184, 0.55); }
.music-spine.tone-stone { background: rgba(196, 188, 176, 0.5); }

.music-spine:hover,
.music-spine:focus-visible,
.music-spine.is-active {
  transform: translateY(-12px);
  background: rgba(255, 250, 240, 0.94);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.35),
    0 12px 22px rgba(0, 0, 0, 0.32);
  outline: none;
  z-index: 3;
  filter: brightness(1.05);
}

.music-spine:hover::before,
.music-spine:focus-visible::before,
.music-spine.is-active::before {
  opacity: 1;
}

.music-spine-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max-content;
  max-width: 110px;
  transform: translate(-50%, -50%);
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0.92;
}

.music-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 8;
  width: min(260px, calc(100% - 24px));
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 18, 16, 0.88);
  color: #f4f1ea;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: musicTipIn 160ms ease both;
  backdrop-filter: blur(8px);
}

.music-tip-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.music-tip-meta,
.music-tip-blurb {
  margin: 0;
  color: rgba(244, 241, 234, 0.72);
  font-size: 0.8rem;
  line-height: 1.55;
}

.music-tip-blurb {
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.music-deck {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: start center;
  padding: clamp(18px, 3.2vh, 36px) 16px 16px;
  background: rgba(8, 7, 6, 0.52);
  backdrop-filter: blur(4px);
  animation: musicDeckIn 220ms ease both;
}

.music-deck[hidden] {
  display: none !important;
}

.music-deck-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(820px, 100%);
  max-height: min(86%, calc(100% - 28px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(250, 246, 238, 0.97);
  color: var(--ink);
  padding: clamp(18px, 2.8vw, 28px);
  padding-top: clamp(22px, 3vw, 30px);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.45);
  animation: musicDeckPanelIn 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.music-deck-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.music-deck-close:hover { color: var(--ink); }

.music-deck-head {
  flex: 0 0 auto;
  margin: 0 0 14px;
  padding-right: 36px;
}

.music-deck-summary {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-track-tabs {
  display: none;
}

.music-deck-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 22px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.music-tracklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  align-content: start;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: 6px;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.music-track-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 2rem 1fr 1.2rem;
  gap: 10px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 9px 8px;
  text-align: left;
  cursor: pointer;
}

.music-track-btn:hover { background: var(--soft); }

.music-track-btn.is-active {
  background: #efe8db;
  box-shadow: inset 2px 0 0 var(--ink);
}

.music-track-num,
.music-track-flag {
  color: var(--muted);
  font-size: 0.78rem;
}

.music-track-name {
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.music-now {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.music-now .music-audio {
  display: none;
  width: 100%;
  height: 40px;
  flex: 0 0 auto;
}

.music-now .music-audio.is-ready {
  display: block;
}

.music-lyrics {
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--ink);
}

.music-lyrics:empty::before {
  content: attr(data-empty);
  color: var(--muted);
  font-size: 0.86rem;
}

.music-admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.site-admin-tabs-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 12px;
}

.music-admin-lyrics-field,
.music-admin-actions { grid-column: 1 / -1; }

.music-admin-form textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.music-admin-catalog { display: grid; gap: 18px; }

.music-admin-album header h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 650;
}

.music-admin-album header p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.music-admin-album ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.music-admin-track {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.music-admin-track-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.music-admin-track-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.music-admin-track-actions button {
  appearance: none;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.music-admin-track-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.app-admin-item-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.app-admin-thumb {
  width: 40px;
  height: 40px;
  border-radius: 22%;
  object-fit: cover;
  flex: 0 0 auto;
  background: #f3f3f3;
}

.app-admin-thumb-empty {
  display: inline-block;
}

.app-admin-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.app-admin-badge.is-muted {
  color: var(--muted);
}

.app-admin-check span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.app-admin-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font: inherit;
  background: #fff;
}

@keyframes musicShelfIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes musicTipIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes musicDeckIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes musicDeckPanelIn {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes musicDeckSheetIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  .music-stage {
    width: 100%;
    aspect-ratio: auto;
    min-height: calc(100dvh - var(--site-header-height, 96px));
    height: calc(100dvh - var(--site-header-height, 96px));
    max-height: none;
  }

  .music-stage-photo {
    object-position: center 40%;
  }

  .music-shop-header {
    top: max(24px, calc(env(safe-area-inset-top, 0px) + 14px));
    width: calc(100% - 24px);
  }

  .music-disc-btn {
    top: calc(var(--site-header-height, 96px) + 12px);
    left: max(12px, env(safe-area-inset-left, 0px));
    width: 40px;
    height: 40px;
  }

  .music-artist-switch {
    top: 12px;
    right: 12px;
  }

  .music-artist-select {
    min-width: 104px;
    padding: 8px 26px 8px 10px;
    font-size: 0.72rem;
  }

  .music-kicker {
    margin-bottom: 4px;
    font-size: 0.58rem;
  }

  .music-title {
    margin-bottom: 0;
    font-size: 1.2rem;
    letter-spacing: 0.14em;
  }

  .music-title::after {
    margin-top: 8px;
  }

  .music-lead { display: none; }

  .music-wall {
    left: 1%;
    right: 1%;
    top: 13%;
    bottom: 38%;
    gap: 1.8%;
    padding: 0.2% 0.4%;
  }

  .music-spine {
    width: 18px;
  }

  .music-spine:hover,
  .music-spine:focus-visible,
  .music-spine.is-active {
    transform: translateY(-8px);
  }

  .music-spine-label {
    font-size: 0.42rem;
    max-width: 96px;
  }

  .music-nook-gap {
    flex-basis: clamp(40px, 14vw, 88px);
  }

  /* Bottom-sheet deck: full-screen overlay, no outer scroll. */
  .music-deck {
    position: fixed;
    inset: 0;
    z-index: 90;
    place-items: end stretch;
    padding: 0;
    background: rgba(8, 7, 6, 0.58);
  }

  .music-deck-inner {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, calc(100dvh - 8px));
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    padding-top: 18px;
    border: 0;
    border-top: 1px solid rgba(17, 17, 17, 0.08);
    box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.35);
    animation: musicDeckSheetIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .music-deck-close {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.55rem;
  }

  .music-deck-head {
    margin-bottom: 10px;
    padding-right: 40px;
  }

  .music-deck-summary {
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .music-track-tabs {
    display: flex;
    gap: 8px;
    margin: 0 -14px;
    padding: 0 14px 2px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .music-track-tabs::-webkit-scrollbar {
    display: none;
  }

  .music-track-tab {
    appearance: none;
    flex: 0 0 auto;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    padding: 8px 4px 10px;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    white-space: nowrap;
    cursor: pointer;
  }

  .music-track-tab.is-active {
    color: var(--ink);
    border-bottom-color: var(--ink);
  }

  .music-deck-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }

  .music-tracklist {
    display: none;
  }

  .music-now,
  .music-lyrics {
    min-height: 0;
    height: 100%;
  }

  .music-lyrics {
    padding: 14px;
    font-size: 0.92rem;
    line-height: 1.8;
  }

  .music-tip {
    width: min(280px, calc(100% - 20px));
    padding: 12px 14px;
  }

  .music-admin-form { grid-template-columns: 1fr; }
  .site-admin-tabs-form { grid-template-columns: 1fr; }
}

/* Touch devices: tips are noisy; labels stay readable without hover. */
@media (hover: none), (pointer: coarse) {
  .music-tip {
    display: none !important;
  }

  .music-spine-label {
    opacity: 0.95;
  }
}

body.music-deck-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .music-shelf,
  .music-tip,
  .music-deck,
  .music-deck-inner,
  .music-spine {
    animation: none !important;
    transition: none !important;
  }
}

/* ——— Meadow (草地) ——— */
body[data-active-tab="meadow"],
html[data-active-tab="meadow"] {
  overflow: hidden;
}

.meadow-section.page-section {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: var(--meadow-height, calc(100dvh - var(--site-header-height, 120px)));
  height: var(--meadow-height, calc(100dvh - var(--site-header-height, 120px)));
  max-height: var(--meadow-height, calc(100dvh - var(--site-header-height, 120px)));
  overflow: hidden;
  background: #ffffff;
}

.meadow-root {
  position: relative;
  width: 100%;
  height: 100%;
  --meadow-cell: 88px;
  background: #ffffff;
  color: #2c3824;
}

.meadow-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 28px) 8px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0));
}

.meadow-topbar-copy,
.meadow-topbar-actions,
.meadow-pitch-btn,
.meadow-locate-btn {
  pointer-events: auto;
}

.meadow-topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.meadow-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.meadow-lead {
  margin: 6px 0 0;
  max-width: 36rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(44, 56, 36, 0.78);
}

.meadow-mine-note {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: rgba(44, 56, 36, 0.7);
}

.meadow-pitch-btn {
  flex: 0 0 auto;
  margin-top: 4px;
  border: 1px solid rgba(44, 56, 36, 0.28);
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.88);
  color: #2c3824;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.meadow-pitch-btn.is-active {
  background: #2c3824;
  color: #f4f7ee;
  border-color: #2c3824;
}

.meadow-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.meadow-viewport:active {
  cursor: grabbing;
}

.meadow-locate-btn {
  flex: 0 0 auto;
  margin: 4px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(44, 56, 36, 0.22);
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.92);
  color: #2c3824;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(40, 55, 30, 0.12);
}

.meadow-locate-btn::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 252, 245, 0.95);
  background: #2c3824;
}

.meadow-locate-btn:hover {
  background: #fff;
}

.meadow-locate-btn:active {
  transform: translateY(1px);
}

.meadow-cell-hover {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--meadow-cell, 88px);
  height: var(--meadow-cell, 88px);
  box-sizing: border-box;
  pointer-events: none;
  border: 2px solid rgba(44, 56, 36, 0.62);
  background: rgba(255, 252, 245, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 252, 245, 0.45),
    0 0 0 1px rgba(44, 56, 36, 0.08);
  border-radius: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  contain: layout style paint;
}

.meadow-cell-hover.is-pulse {
  animation: meadow-cell-pulse 0.85s ease-out;
}

@keyframes meadow-cell-pulse {
  0% {
    background: rgba(255, 252, 245, 0.42);
    box-shadow:
      inset 0 0 0 1px rgba(255, 252, 245, 0.7),
      0 0 0 0 rgba(44, 56, 36, 0.28);
  }
  100% {
    background: rgba(255, 252, 245, 0.16);
    box-shadow:
      inset 0 0 0 1px rgba(255, 252, 245, 0.45),
      0 0 0 12px rgba(44, 56, 36, 0);
  }
}

@media (hover: none), (pointer: coarse) {
  .meadow-cell-hover:not(.is-pulse) {
    display: none !important;
  }
}

.meadow-camera {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: visible;
  transform-origin: 0 0;
  will-change: transform;
}

.meadow-grid-plane {
  position: absolute;
  /* Extent must be an integer multiple of --meadow-cell so lines pass through origin. */
  left: calc(var(--meadow-cell, 88px) * -128);
  top: calc(var(--meadow-cell, 88px) * -128);
  width: calc(var(--meadow-cell, 88px) * 256);
  height: calc(var(--meadow-cell, 88px) * 256);
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.08) 1px, transparent 1px);
  background-size: var(--meadow-cell, 88px) var(--meadow-cell, 88px);
  background-position: 0 0;
  pointer-events: none;
}

.meadow-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: visible;
}

.meadow-tent {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-origin: center bottom;
  z-index: 1;
  pointer-events: auto;
  filter: drop-shadow(0 6px 10px rgba(40, 55, 30, 0.28));
}

.meadow-tent::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 42px;
  height: 14px;
  border-radius: 50%;
  background: rgba(44, 56, 36, 0.2);
  transform: translateX(-50%);
  pointer-events: none;
}

.meadow-tent img {
  position: relative;
  z-index: 1;
  width: 92%;
  height: 92%;
  object-fit: contain;
  pointer-events: none;
  transition: transform 160ms ease;
}

.meadow-tent:hover img,
.meadow-tent:focus-visible img {
  transform: translateY(-4px) scale(1.06);
}

.meadow-tent-name {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  max-width: 110%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 252, 245, 0.88);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(44, 56, 36, 0.92);
  pointer-events: none;
}

.meadow-sheet {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  align-items: end;
  background: rgba(30, 40, 24, 0.28);
}

.meadow-sheet-panel {
  margin: 0;
  padding: 18px clamp(16px, 3vw, 24px) calc(18px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #f7f4ec;
  color: #2a2a28;
  box-shadow: 0 -12px 40px rgba(20, 30, 10, 0.18);
  max-height: min(78dvh, 640px);
  overflow: auto;
}

.meadow-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.meadow-sheet-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.meadow-sheet-close {
  border: 0;
  background: transparent;
  color: rgba(42, 42, 40, 0.65);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 4px;
}

.meadow-field {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 0.86rem;
}

.meadow-field input,
.meadow-field textarea {
  width: 100%;
  border: 1px solid rgba(42, 42, 40, 0.16);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  resize: vertical;
}

.meadow-cell-line {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: rgba(42, 42, 40, 0.7);
}

.meadow-styles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.meadow-style-option {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 6px;
  border: 1px solid rgba(42, 42, 40, 0.14);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 0.72rem;
  color: rgba(42, 42, 40, 0.8);
}

.meadow-style-option img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.meadow-style-option.is-selected {
  border-color: #2c3824;
  box-shadow: inset 0 0 0 1px #2c3824;
}

.meadow-form-error {
  margin: 0 0 10px;
  color: #9b3b2e;
  font-size: 0.86rem;
}

.meadow-submit {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #2c3824;
  color: #f4f7ee;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.meadow-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.meadow-view-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding-bottom: 8px;
}

.meadow-view-img {
  width: min(160px, 42vw);
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(40, 55, 30, 0.18));
}

.meadow-view-name {
  margin: 4px 0 0;
  font-size: 1.2rem;
}

.meadow-view-body {
  margin: 0;
  max-width: 28rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(42, 42, 40, 0.82);
  white-space: pre-wrap;
}

.meadow-view-meta {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(42, 42, 40, 0.55);
}

.meadow-locate-short {
  display: none;
}

.meadow-placing-banner {
  display: none;
  position: absolute;
  left: 50%;
  top: auto;
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(44, 56, 36, 0.9);
  color: #f4f7ee;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(20, 30, 10, 0.22);
}

@media (max-width: 640px) {
  .meadow-topbar {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px 28px;
  }

  .meadow-title {
    font-size: 1.35rem;
  }

  .meadow-lead {
    margin-top: 4px;
    font-size: 0.78rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .meadow-mine-note {
    margin-top: 6px;
    font-size: 0.76rem;
  }

  .meadow-pitch-btn,
  .meadow-locate-btn {
    align-self: flex-start;
    margin-top: 0;
    padding: 10px 12px;
    font-size: 0.84rem;
    min-height: 40px;
  }

  .meadow-locate-full {
    display: none;
  }

  .meadow-locate-short {
    display: inline;
  }

  .meadow-sheet-panel {
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    max-height: min(88dvh, 720px);
    border-radius: 16px 16px 0 0;
  }

  .meadow-styles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .meadow-style-option {
    min-height: 84px;
    padding: 8px 4px;
  }

  .meadow-style-option img {
    width: 48px;
    height: 48px;
  }

  .meadow-field input,
  .meadow-field textarea {
    font-size: 16px; /* avoid iOS zoom on focus */
  }

  .meadow-submit {
    min-height: 46px;
  }

  .meadow-tent-name {
    font-size: 10px;
    padding: 2px 5px;
  }

  .meadow-placing-banner {
    display: none;
  }

  .meadow-placing-banner.is-on {
    display: block;
  }
}

@media (max-width: 420px) {
  .meadow-lead {
    -webkit-line-clamp: 1;
  }
}

/* —— 对话 / Dialogue —— */
.yisheng-section.page-section {
  --yisheng-ink: #1c1b19;
  --yisheng-muted: #6a6560;
  --yisheng-line: #ddd8d0;
  --yisheng-soft: #f3f0ea;
  --yisheng-paper: #ffffff;
  --yisheng-accent: #3d5a4c;
  background: #ffffff;
  min-height: calc(100dvh - var(--site-header-height, 96px));
  /* Drop the generic page-section top pad — nav already provides chrome. */
  padding: clamp(10px, 1.4vw, 16px) min(32px, 4vw) clamp(48px, 6vw, 88px);
}

.yisheng-root {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 4px 0 56px;
}

.yisheng-page {
  display: grid;
  gap: 28px;
  animation: yisheng-enter 0.55s ease both;
}

@keyframes yisheng-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.yisheng-hero {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.yisheng-kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yisheng-accent);
}

.yisheng-title {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--yisheng-ink);
  line-height: 1.05;
}

.yisheng-subtitle,
.yisheng-intro,
.yisheng-empty,
.yisheng-status,
.yisheng-error,
.yisheng-muted,
.yisheng-reflection-hint {
  margin: 0;
  color: var(--yisheng-muted);
  line-height: 1.65;
  font-size: 0.98rem;
}

.yisheng-subtitle {
  font-size: 1.08rem;
  color: var(--yisheng-ink);
}

.yisheng-form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.yisheng-label {
  font-size: 0.86rem;
  color: var(--yisheng-ink);
}

.yisheng-topic,
.yisheng-reflection-box {
  width: 100%;
  border: 1px solid var(--yisheng-line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--yisheng-ink);
  padding: 14px 14px;
  font: inherit;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}

.yisheng-topic:focus,
.yisheng-reflection-box:focus {
  border-color: #9aa89f;
  box-shadow: 0 0 0 3px rgba(61, 90, 76, 0.12);
}

.yisheng-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.yisheng-topics {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.yisheng-topics-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.yisheng-topics-title {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--yisheng-accent);
  font-weight: 650;
}

.yisheng-topics-hint {
  margin: 4px 0 0;
  color: var(--yisheng-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.yisheng-kind-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yisheng-kind {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--yisheng-muted);
  padding: 6px 10px;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.yisheng-kind.is-active,
.yisheng-kind:hover,
.yisheng-kind:focus-visible {
  color: var(--yisheng-ink);
  border-color: var(--yisheng-line);
  background: rgba(255, 255, 255, 0.55);
  outline: none;
}

.yisheng-example {
  border: 1px solid var(--yisheng-line);
  background: rgba(255, 255, 255, 0.42);
  color: var(--yisheng-muted);
  padding: 12px 12px 11px;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-height: 100%;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}

.yisheng-example-kind {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--yisheng-accent);
}

.yisheng-example-text {
  color: var(--yisheng-ink);
  line-height: 1.45;
}

.yisheng-example:hover,
.yisheng-example:focus-visible {
  border-color: #b7c2bb;
  color: var(--yisheng-ink);
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
  outline: none;
}

.yisheng-example.is-saved {
  border-color: #c5d0c8;
  background: rgba(61, 90, 76, 0.06);
}

.yisheng-topics-toggle {
  appearance: none;
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--yisheng-muted);
  padding: 0;
  font: inherit;
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.yisheng-topics-toggle:hover,
.yisheng-topics-toggle:focus-visible {
  color: var(--yisheng-ink);
  outline: none;
}

.yisheng-history {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--yisheng-line);
}

.yisheng-history-empty {
  margin: 0;
  color: var(--yisheng-muted);
  font-size: 0.88rem;
}

.yisheng-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.yisheng-history-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(221, 216, 208, 0.7);
}

.yisheng-history-item:last-child {
  border-bottom: 0;
}

.yisheng-history-topic {
  margin: 0;
  color: var(--yisheng-ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.yisheng-history-meta {
  margin: 4px 0 0;
  color: var(--yisheng-muted);
  font-size: 0.8rem;
}

.yisheng-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.yisheng-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: start center;
  padding:
    max(12px, env(safe-area-inset-top, 0px))
    12px
    calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(28, 27, 25, 0.28);
  backdrop-filter: blur(6px);
  overflow: auto;
}

.yisheng-share-sheet {
  width: min(520px, 100%);
  max-height: min(92dvh, 900px);
  overflow: auto;
  background: #faf8f4;
  border: 1px solid var(--yisheng-line);
  padding: 14px 14px 16px;
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.yisheng-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yisheng-share-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.yisheng-share-actions,
.yisheng-share-export {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yisheng-share-tab {
  flex: 1 1 calc(50% - 4px);
  min-width: 140px;
  justify-content: center;
  text-align: center;
}

.yisheng-share-tab.is-active {
  background: var(--yisheng-ink);
  border-color: var(--yisheng-ink);
  color: #f7f4ee;
}

.yisheng-share-note {
  margin: 0;
  color: var(--yisheng-muted);
  font-size: 0.88rem;
}

.yisheng-share-previews {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.yisheng-share-preview {
  margin: 0;
  border: 1px solid var(--yisheng-line);
  background: #fff;
  overflow: hidden;
}

.yisheng-share-caption {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--yisheng-line);
  color: var(--yisheng-muted);
  font-size: 0.8rem;
  background: rgba(247, 244, 238, 0.9);
}

.yisheng-share-preview img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.yisheng-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.yisheng-btn {
  border: 1px solid var(--yisheng-line);
  background: #fff;
  color: var(--yisheng-ink);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.yisheng-btn:hover:not(:disabled),
.yisheng-btn:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: #b7c2bb;
}

.yisheng-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.yisheng-btn-primary {
  background: var(--yisheng-ink);
  border-color: var(--yisheng-ink);
  color: #f7f4ee;
}

.yisheng-btn-primary:hover:not(:disabled),
.yisheng-btn-primary:focus-visible:not(:disabled) {
  background: #2a2926;
}

.yisheng-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--yisheng-muted);
}

.yisheng-btn-ghost:hover:not(:disabled),
.yisheng-btn-ghost:focus-visible:not(:disabled) {
  color: var(--yisheng-ink);
  border-color: var(--yisheng-line);
  background: rgba(255, 255, 255, 0.4);
}

.yisheng-hero.is-compact {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.yisheng-compact-topic {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--yisheng-ink);
}

.yisheng-progress {
  margin: 0;
  color: var(--yisheng-muted);
  font-size: 0.88rem;
}

.yisheng-floor-hint {
  margin: 14px 0 0;
  color: var(--yisheng-muted);
  font-size: 0.86rem;
}

.yisheng-page.has-field {
  padding-bottom: calc(var(--yisheng-dock-space, 88px) + 24px);
}

.yisheng-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: grid;
  gap: 8px;
  padding:
    10px
    max(16px, env(safe-area-inset-right, 0px))
    calc(10px + env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  background: rgba(247, 244, 238, 0.94);
  border-top: 1px solid var(--yisheng-line);
  box-shadow: 0 -10px 28px rgba(28, 27, 25, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.yisheng-dock-note {
  margin: 0 auto;
  width: min(1180px, 100%);
  color: var(--yisheng-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.yisheng-dock-note.is-error {
  color: #8a3b32;
}

.yisheng-dock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.yisheng-dock-primary {
  min-width: 0;
}

.yisheng-dock-primary .yisheng-btn-primary {
  width: 100%;
  min-height: 46px;
  white-space: nowrap;
}

.yisheng-dock-secondary {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.yisheng-dock .yisheng-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
}

.yisheng-dock-secondary .yisheng-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 721px) {
  .yisheng-dock-row {
    grid-template-columns: minmax(200px, 1.2fr) minmax(0, 1.8fr);
    align-items: center;
    gap: 10px;
  }

  .yisheng-dock-secondary {
    justify-content: flex-end;
  }

  .yisheng-dock-secondary .yisheng-btn {
    flex: 0 1 auto;
    padding-left: 14px;
    padding-right: 14px;
  }
}

body.yisheng-dock-typing .yisheng-dock {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

body:not([data-active-tab="yisheng"]) .yisheng-dock,
html:not([data-active-tab="yisheng"]) .yisheng-dock {
  display: none;
}

body[data-active-tab="yisheng"].yisheng-dock-open:not(.yisheng-dock-typing) .notta-ai,
html[data-active-tab="yisheng"] body.yisheng-dock-open:not(.yisheng-dock-typing) .notta-ai {
  bottom: calc(var(--yisheng-dock-space, 88px) + 12px);
}

body[data-active-tab="yisheng"].yisheng-dock-open:not(.yisheng-dock-typing) .notta-ai-panel,
html[data-active-tab="yisheng"] body.yisheng-dock-open:not(.yisheng-dock-typing) .notta-ai-panel {
  bottom: calc(var(--yisheng-dock-space, 88px) + 56px);
}

.yisheng-error {
  color: #8a3b32;
}

.yisheng-status {
  animation: yisheng-pulse 1.4s ease-in-out infinite;
}

@keyframes yisheng-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.yisheng-context,
.yisheng-panel,
.yisheng-reflection {
  border-top: 1px solid var(--yisheng-line);
  padding-top: 18px;
}

.yisheng-section-title,
.yisheng-panel-title,
.yisheng-round-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--yisheng-ink);
  letter-spacing: -0.01em;
}

.yisheng-context-bg {
  margin: 0 0 14px;
  color: var(--yisheng-muted);
  line-height: 1.7;
}

.yisheng-context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.yisheng-context-grid h3,
.yisheng-narrator-block h3 {
  margin: 0 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yisheng-accent);
  font-weight: 600;
}

.yisheng-context-grid p,
.yisheng-narrator-block p,
.yisheng-role-card p,
.yisheng-message p {
  margin: 0 0 10px;
  color: var(--yisheng-ink);
  line-height: 1.65;
  font-size: 0.94rem;
}

.yisheng-context-grid ul,
.yisheng-narrator-block ul {
  margin: 0 0 14px;
  padding-left: 1.1em;
  color: var(--yisheng-muted);
  line-height: 1.6;
}

.yisheng-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.3fr) minmax(220px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.yisheng-role-list,
.yisheng-messages {
  display: grid;
  gap: 12px;
}

.yisheng-role-card,
.yisheng-message {
  border: 1px solid var(--yisheng-line);
  background: rgba(255, 255, 255, 0.55);
  padding: 14px;
  animation: yisheng-card-in 0.45s ease both;
}

@keyframes yisheng-card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.yisheng-role-card h3,
.yisheng-message strong {
  margin: 0;
  font-size: 1rem;
  color: var(--yisheng-ink);
}

.yisheng-speaker,
.yisheng-role-card header h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 2px;
  margin: 0;
  line-height: 1.35;
}

.yisheng-role-hint {
  color: var(--yisheng-muted);
  font-size: 0.88em;
  font-weight: 500;
}

.yisheng-role-identity {
  display: block;
  margin-top: 2px;
  color: var(--yisheng-muted);
  font-size: 0.84rem;
}

.yisheng-role-card p span {
  display: block;
  margin-bottom: 2px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yisheng-accent);
}

.yisheng-round {
  margin-bottom: 18px;
}

.yisheng-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yisheng-tags span {
  border: 1px solid var(--yisheng-line);
  padding: 3px 7px;
  font-size: 0.76rem;
  color: var(--yisheng-muted);
  background: var(--yisheng-soft);
}

.yisheng-tags em {
  font-style: normal;
  margin-right: 4px;
  color: var(--yisheng-accent);
}

.yisheng-reflection-box {
  margin: 10px 0;
}

.yisheng-reflection-note {
  margin: 0;
  color: var(--yisheng-accent);
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .yisheng-board,
  .yisheng-context-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .yisheng-section.page-section {
    padding-top: 8px;
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
  }

  .yisheng-root {
    width: min(100% - 16px, 1180px);
    padding-top: 0;
  }

  .yisheng-title {
    font-size: 2rem;
  }

  .yisheng-topic,
  .yisheng-reflection-box {
    font-size: 16px;
  }

  .yisheng-example {
    width: 100%;
  }

  .yisheng-examples {
    grid-template-columns: 1fr;
  }

  .yisheng-dock {
    gap: 10px;
    padding:
      12px
      max(14px, env(safe-area-inset-right, 0px))
      calc(12px + env(safe-area-inset-bottom, 0px))
      max(14px, env(safe-area-inset-left, 0px));
  }

  .yisheng-dock-note {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .yisheng-dock-primary .yisheng-btn-primary {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 0.95rem;
    font-weight: 650;
  }

  .yisheng-dock-secondary {
    gap: 6px;
  }

  .yisheng-dock-secondary .yisheng-btn {
    min-height: 40px;
    padding: 8px 4px;
    font-size: 0.78rem;
  }

  .yisheng-dock-secondary .yisheng-btn-ghost {
    color: var(--yisheng-muted);
  }
}

/* —— Calendar —— */
body[data-active-tab="calendar"],
html[data-active-tab="calendar"] {
  background: #ffffff;
}

.calendar-section.page-section {
  padding: 0 min(28px, 4vw) clamp(48px, 8vw, 96px);
  background: #ffffff;
}

.calendar-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(440px, 100%) minmax(0, 1fr);
  align-items: start;
  width: 100%;
  margin: 0;
}

.calendar-year-progress {
  grid-column: 1;
  justify-self: end;
  margin-right: clamp(36px, 5.5vw, 88px);
  position: sticky;
  top: var(--site-header-height, 96px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 6px;
}

.calendar-year-progress-pct {
  margin: 0;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: #111111;
}

.calendar-year-dots {
  display: grid;
  grid-template-columns: repeat(var(--calendar-year-dot-cols, 14), 4px);
  gap: 1.5px;
}

.calendar-year-dot {
  width: 4px;
  height: 4px;
  box-sizing: border-box;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #d8d4ce;
}

.calendar-year-dot.is-elapsed {
  background: #111111;
  box-shadow: none;
}

.calendar-main {
  grid-column: 2;
  min-width: 0;
}

.calendar-head {
  position: sticky;
  top: var(--site-header-height, 96px);
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 22px;
  padding: 6px 0 10px;
  background: #ffffff;
}

.calendar-today {
  appearance: none;
  border: 0;
  background: #ffffff;
  color: #111111;
  padding: 5px 0;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.calendar-today:hover,
.calendar-today:focus-visible {
  background: transparent;
  color: #111111;
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.calendar-head .calendar-year-title {
  margin: 0;
}

.calendar-today[hidden] {
  display: none;
}

.calendar-year + .calendar-year {
  margin-top: 56px;
}

.calendar-year {
  margin: 0 0 42px;
}

.calendar-year-title {
  margin: 0 0 22px;
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #111111;
}

.calendar-year-months {
  display: grid;
  gap: 28px;
}

.calendar-month-title {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #6f6a63;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  margin-bottom: 2px;
}

.calendar-weekdays span {
  padding: 0 0 4px 5px;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: #b0aaa3;
}

.calendar-cell {
  position: relative;
  appearance: none;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid #eceae6;
  border-right: 0;
  border-bottom: 0;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font: inherit;
}

.calendar-days .calendar-cell:nth-child(7n) {
  border-right: 1px solid #eceae6;
}

.calendar-days .calendar-cell:nth-last-child(-n + 7) {
  border-bottom: 1px solid #eceae6;
}

.calendar-cell.is-empty {
  cursor: default;
  background: #ffffff;
  pointer-events: none;
}

.calendar-cell-day {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
}

.calendar-cell.is-today .calendar-cell-day {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.calendar-cell:hover:not(.is-empty):not(.is-selected) {
  background: #f7f6f3;
}

.calendar-cell.is-selected {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
  z-index: 1;
}

.calendar-cell.is-selected .calendar-cell-day {
  text-decoration: none;
}

.calendar-cell:focus-visible {
  outline: 1px solid #111111;
  outline-offset: -1px;
  z-index: 2;
}

@media (max-width: 640px) {
  .calendar-section.page-section {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .calendar-page {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .calendar-year-progress {
    margin-right: 14px;
  }

  .calendar-cell-day {
    font-size: 0.64rem;
    top: 2px;
    left: 4px;
  }
}

/* Games hub */
.games-section.page-section {
  padding: clamp(28px, 4.5vw, 52px) clamp(20px, 4vw, 48px) clamp(56px, 8vw, 96px);
}

.games-shell {
  width: min(1240px, 100%);
  margin: 0;
  text-align: left;
}

.games-hub-header {
  margin-bottom: clamp(24px, 4vw, 36px);
  max-width: 40rem;
}

.games-hub-header .page-title::after {
  margin-left: 0;
  margin-right: auto;
}

.games-hub-header .page-lead {
  text-align: left;
}

.games-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(16px, 2vw, 22px);
  width: 100%;
}

.games-card {
  display: flex;
  flex-direction: column;
  width: 280px;
  max-width: 100%;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.games-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.games-card-art {
  display: block;
  width: 100%;
  height: 200px;
  flex: 0 0 200px;
  object-fit: cover;
  object-position: center 42%;
  background: #1c1612;
}

.games-card-art--plain {
  background: linear-gradient(145deg, #f5f0e8, #e8dfd3);
}

.games-card-body {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  flex: 1;
  align-content: center;
  border-top: 3px solid var(--game-accent, var(--ink));
}

.games-card-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.games-card-blurb {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.games-missing {
  color: var(--muted);
}

/* Vocabulary cards */
.cards-section.page-section {
  padding: clamp(28px, 4.5vw, 52px) clamp(20px, 4vw, 48px) clamp(56px, 8vw, 96px);
}

.cards-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  text-align: left;
}

.cards-hub-header {
  margin-bottom: clamp(24px, 4vw, 36px);
  max-width: 40rem;
}

.cards-hub-header .page-title::after {
  margin-left: 0;
  margin-right: auto;
}

.cards-hub-header .page-lead {
  text-align: left;
}

.cards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(16px, 2vw, 22px);
  width: 100%;
}

.cards-set-card {
  display: flex;
  flex-direction: column;
  width: min(320px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cards-set-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.cards-set-art {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: center;
  background: #f3eee6;
}

.cards-set-body {
  display: grid;
  gap: 6px;
  padding: 14px 16px 16px;
  border-top: 3px solid var(--cards-accent, var(--ink));
}

.cards-set-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.cards-set-blurb {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
}

.cards-deck-header {
  display: grid;
  gap: 10px;
  margin-bottom: clamp(16px, 3vw, 24px);
}

.cards-back {
  width: fit-content;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.cards-back:hover {
  color: var(--ink);
}

.cards-deck-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 20px;
  min-width: 0;
}

.cards-deck-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  min-width: 0;
  flex: 1 1 auto;
}

.cards-deck-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: right;
  flex: 0 1 auto;
  min-width: 0;
}

.cards-viewer {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.cards-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  padding: 4px 6vw 12px;
  outline: none;
  scrollbar-width: none;
}

.cards-track::-webkit-scrollbar {
  display: none;
}

.cards-slide {
  flex: 0 0 min(720px, 88vw);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  min-width: 0;
}

.cards-figure {
  margin: 0;
  display: grid;
  gap: 12px;
}

.cards-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f0ebe3;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.cards-image:not([src]) {
  min-height: min(58vw, 420px);
}

.cards-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 0 2px;
}

.cards-phonetic {
  font-family: "Lucida Grande", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.cards-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.cards-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 4px 0 8px;
  position: sticky;
  bottom: 0;
}

.cards-nav-btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cards-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.cards-counter {
  margin: 0;
  min-width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.92rem;
}

.cards-loading,
.cards-empty,
.cards-missing {
  color: var(--muted);
}

@media (max-width: 720px) {
  .cards-slide {
    flex-basis: calc(100vw - 48px);
  }

  .cards-deck-heading {
    gap: 8px 12px;
  }

  .cards-deck-meta {
    font-size: 0.82rem;
  }

  .cards-deck-title {
    font-size: 0.98rem;
  }

  .cards-controls {
    gap: 28px;
    padding-top: 8px;
  }

  .cards-nav-btn {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  }
}

/* Stories / poem frames */
.stories-section.page-section {
  padding-bottom: 48px;
}

.stories-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 0 20px;
}

.stories-hub-header {
  margin-bottom: 28px;
}

.stories-hub-header .page-title::after {
  content: none;
}

.stories-hub-header .page-lead {
  max-width: 36rem;
}

.stories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
}

.stories-set-card {
  display: flex;
  flex-direction: column;
  width: min(280px, 100%);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stories-set-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.stories-set-art {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f3eee4;
}

.stories-set-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 16px;
  border-top: 3px solid var(--stories-accent, var(--ink));
}

.stories-set-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.stories-set-blurb {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.stories-deck-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.stories-back {
  flex: 0 0 auto;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding-top: 4px;
}

.stories-back:hover {
  color: var(--ink);
}

.stories-deck-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.stories-deck-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.stories-deck-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.stories-viewer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stories-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  outline: none;
  touch-action: pan-x;
}

.stories-track::-webkit-scrollbar {
  display: none;
}

.stories-slide {
  flex: 0 0 min(860px, calc(100vw - 64px));
  scroll-snap-align: center;
}

.stories-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stories-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f3eee4;
  border: 1px solid var(--line);
  touch-action: pan-y;
  user-select: none;
}

.stories-image:not([src]) {
  min-height: 200px;
}

.stories-caption {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
  font-size: 1.02rem;
  line-height: 1.55;
  white-space: pre-line;
}

.stories-line {
  display: block;
}

.stories-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 4px 0 8px;
}

.stories-nav-btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.stories-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.stories-counter {
  margin: 0;
  min-width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.92rem;
}

.stories-loading,
.stories-empty {
  color: var(--muted);
}

@media (max-width: 720px) {
  .stories-slide {
    flex-basis: calc(100vw - 48px);
  }

  .stories-nav-btn {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
  }
}

/* Poetry / picture poems */
.poetry-section.page-section {
  padding-bottom: 48px;
}

.poetry-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 20px;
}

.poetry-hub-header {
  margin-bottom: 28px;
}

.poetry-hub-header .page-title::after {
  content: none;
}

.poetry-hub-header .page-lead {
  max-width: 36rem;
}

.poetry-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
}

.poetry-set-card {
  display: flex;
  flex-direction: column;
  width: min(280px, 100%);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.poetry-set-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.poetry-set-art {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f3eee4;
}

.poetry-set-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 16px;
  border-top: 3px solid var(--poetry-accent, var(--ink));
}

.poetry-set-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.poetry-set-blurb {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.poetry-deck-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.poetry-back {
  flex: 0 0 auto;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding-top: 4px;
}

.poetry-back:hover {
  color: var(--ink);
}

.poetry-deck-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.poetry-deck-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.poetry-deck-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.poetry-reader {
  outline: none;
}

.poetry-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  outline: none;
  touch-action: pan-x;
}

.poetry-track::-webkit-scrollbar {
  display: none;
}

.poetry-page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.poetry-spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.poetry-figure,
.poetry-text {
  margin: 0;
  min-width: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  box-sizing: border-box;
}

.poetry-figure {
  overflow: hidden;
  background: transparent;
}

.poetry-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: transparent;
  border: none;
  touch-action: pan-y;
  user-select: none;
}

.poetry-image:not([src]) {
  min-height: 0;
  background: #f0e6d2;
}

.poetry-text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4.5%, 36px);
  overflow: auto;
  overflow-wrap: anywhere;
  color: #2a241c;
  border: 1px solid rgba(70, 55, 35, 0.18);
  background-color: #f0e6d2;
  background-image:
    radial-gradient(rgba(60, 45, 25, 0.045) 0.6px, transparent 0.7px),
    linear-gradient(165deg, #f5ebda 0%, #efe4cf 48%, #e8dcc4 100%);
  background-size: 3px 3px, 100% 100%;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.35);
}

.poetry-stanza {
  display: flex;
  flex-direction: column;
  gap: 0.55em;
  width: 100%;
  max-width: 22em;
  box-sizing: border-box;
  text-align: left;
  font-size: clamp(1rem, 1.55vw, 1.28rem);
  line-height: 1.75;
  letter-spacing: 0.02em;
}

.poetry-author {
  margin: 0.85em 0 0;
  font-size: 0.78em;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: rgba(42, 36, 28, 0.72);
}

.poetry-line {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.poetry-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 0 8px;
}

.poetry-nav-btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.poetry-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.poetry-counter {
  margin: 0;
  min-width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.92rem;
}

.poetry-loading,
.poetry-empty {
  color: var(--muted);
}

@media (max-width: 820px) {
  .poetry-spread {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .poetry-text {
    padding: clamp(16px, 5vw, 28px);
  }

  .poetry-stanza {
    max-width: none;
    font-size: 1.05rem;
    line-height: 1.7;
  }

  .poetry-nav-btn {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
  }
}

/* Hand-net roast */
.handnet-app {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.handnet-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.handnet-header-body {
  min-width: 0;
}

.handnet-brief {
  max-width: 520px;
  display: grid;
  gap: 12px;
  padding: clamp(16px, 3vw, 24px);
}

.handnet-lead,
.handnet-how {
  margin: 0;
  line-height: 1.5;
}

.handnet-how {
  color: var(--muted);
  font-size: 0.9rem;
}

.handnet-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.handnet-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.handnet-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.handnet-metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
}

.handnet-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.handnet-canvas-wrap {
  flex: 1;
  min-height: 280px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 40% at 48% 86%, rgba(255, 92, 24, 0.22), transparent 58%),
    linear-gradient(180deg, #2f261e 0%, #1a120e 100%);
  border-color: #4a3424;
  box-shadow:
    inset 0 0 0 1px rgba(216, 176, 106, 0.14),
    0 14px 28px rgba(28, 16, 8, 0.16);
}

.handnet-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  touch-action: none;
  cursor: grab;
}

.handnet-canvas:active {
  cursor: grabbing;
}

.handnet-bar {
  display: flex;
}

.handnet-bar .roast-btn {
  min-height: 48px;
}

@media (min-width: 900px) {
  .handnet-header {
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }

  .handnet-app--play {
    height: calc(100svh - var(--site-header-height, 104px) - 64px);
    max-height: calc(100svh - var(--site-header-height, 104px) - 64px);
    overflow: hidden;
  }

  .handnet-canvas-wrap,
  .handnet-canvas {
    min-height: 360px;
  }
}

@media (min-width: 900px) {
  .hamlet-app--play {
    height: calc(100svh - var(--site-header-height, 104px) - 64px);
    max-height: calc(100svh - var(--site-header-height, 104px) - 64px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .hamlet-app--play .hamlet-canvas-wrap,
  .hamlet-app--play .hamlet-canvas {
    min-height: 0;
  }
}

/* Coffee roast game */
.roast-app {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 16px);
}

.roast-app--step-roast,
.roast-app--step-brief {
  min-height: 0;
}

.roast-campaign-title {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.roast-header-titles {
  min-width: 0;
}

.roast-level-progress {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.roast-level-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.roast-level-dot.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.roast-level-dot.is-done {
  border-color: #6a994e;
  background: rgba(106, 153, 78, 0.14);
  color: #4d7238;
}

.roast-level-goal {
  margin: 8px 0 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(188, 108, 37, 0.08);
  border: 1px solid rgba(188, 108, 37, 0.18);
}

.roast-level-goal-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a5b1d;
}

.roast-level-goal-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
}

.roast-level-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.roast-level-bean {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.roast-total-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.roast-total-meta span {
  font-weight: 600;
}

.roast-level-summary {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.02);
}

.roast-level-summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.roast-level-summary-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.roast-level-summary-list strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.roast-score-panel--complete .roast-score-value {
  margin-top: 4px;
}

.roast-stage {
  min-height: 0;
}

.roast-step-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.roast-stage--brief {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(14px, 3vw, 18px);
}

.roast-pick-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.roast-start-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.roast-btn-start {
  min-height: 52px;
}

.roast-stage--roast {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.roast-stage-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.roast-app--step-roast .roast-stage-body {
  display: grid;
  grid-template-areas:
    "metrics"
    "hint"
    "chart"
    "controls";
  grid-template-rows: auto auto minmax(80px, 1fr) auto;
}

.roast-app--step-roast .roast-metrics {
  grid-area: metrics;
}

.roast-app--step-roast .roast-fc-hint {
  grid-area: hint;
}

.roast-app--step-roast .roast-chart-wrap {
  grid-area: chart;
}

.roast-app--step-roast .roast-controls {
  grid-area: controls;
}

.roast-live {
  display: grid;
  gap: 12px;
}

.roast-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.roast-header {
  display: grid;
  gap: 10px;
  margin-bottom: 2px;
}

.roast-nav {
  display: flex;
  align-items: center;
}

.roast-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 6px 0;
  font: inherit;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
}

.roast-back-icon {
  font-size: 1rem;
  line-height: 1;
}

.roast-back:hover {
  color: var(--ink);
}

.roast-header-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.roast-title {
  margin: 0;
  font-size: clamp(1.5rem, 4.5vw, 1.85rem);
  letter-spacing: -0.02em;
}

.roast-phase-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(196, 43, 43, 0.08);
  color: #a02424;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.roast-phase-badge--dev {
  background: rgba(200, 85, 61, 0.14);
  color: #9a3a28;
}

.roast-flow-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.roast-fc-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(200, 85, 61, 0.12);
  border: 1px solid rgba(200, 85, 61, 0.22);
  color: #8f3a28;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}

.roast-event-hint--sc {
  background: rgba(154, 42, 18, 0.12);
  border-color: rgba(154, 42, 18, 0.28);
  color: #7a2412;
}

.roast-event-hint--smoke,
.roast-event-hint--fire {
  background: rgba(196, 43, 43, 0.14);
  border-color: rgba(196, 43, 43, 0.35);
  color: #8f1414;
}

.roast-event-hint--fire {
  animation: roast-fire-pulse 0.7s ease-in-out infinite;
}

.roast-phase-badge--sc {
  background: rgba(154, 42, 18, 0.14);
  color: #7a2412;
}

.roast-phase-badge--fire {
  background: #c42b2b;
  color: #fff8f0;
  animation: roast-fire-pulse 0.7s ease-in-out infinite;
}

.roast-chart-wrap {
  position: relative;
}

.roast-toast {
  position: absolute;
  left: 50%;
  top: 18px;
  z-index: 2;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.88);
  color: #fff8f0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.roast-toast[data-kind="sc"] {
  background: rgba(154, 42, 18, 0.92);
}

.roast-toast[data-kind="smoke"],
.roast-toast[data-kind="fire"] {
  background: #c42b2b;
}

.roast-toast[hidden] {
  display: none;
}

.roast-chart-wrap.is-smoking {
  box-shadow: inset 0 0 0 2px rgba(180, 80, 20, 0.25);
}

.roast-chart-wrap.is-fire {
  box-shadow: inset 0 0 0 3px rgba(196, 43, 43, 0.45);
}

.roast-app--fire .roast-controls {
  outline: 2px solid rgba(196, 43, 43, 0.35);
}

.roast-score-panel--fire .roast-score-value {
  color: #c42b2b;
}

@keyframes roast-fire-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

.roast-fc-hint[hidden] {
  display: none;
}

.roast-flow-hint[hidden] {
  display: none;
}

.roast-setup {
  padding: clamp(14px, 3vw, 18px);
}

.roast-setup-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.roast-setup-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.roast-bean-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.roast-bean-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.roast-bean-card.is-selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.roast-bean-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.roast-bean-origin,
.roast-bean-note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.roast-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 14px;
  font-size: 0.82rem;
}

.roast-metric-cell strong {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.roast-metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.roast-metric-accent {
  color: #c42b2b;
}

.roast-chart-wrap {
  position: relative;
  overflow: hidden;
  background: #f7f5f0;
  touch-action: none;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 160px;
}

.roast-chart {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 140px;
  height: auto;
}

.roast-controls {
  display: grid;
  gap: 14px;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
}

.roast-gas {
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
}

.roast-gas-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.roast-gas-readout {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-height: 52px;
}

.roast-gas-value {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1;
}

.roast-gas-stepper {
  display: grid;
  grid-template-columns: 72px minmax(4.5rem, 1fr) 72px;
  align-items: stretch;
  gap: 10px;
}

.roast-gas-btn {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.roast-gas-btn:active {
  transform: scale(0.98);
}

.roast-gas-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.roast-gas-preset {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.roast-gas-preset.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.roast-gas-preset:active {
  transform: scale(0.98);
}

.roast-actions {
  display: flex;
  gap: 10px;
}

.roast-btn {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.roast-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.roast-btn-drop {
  border-color: #c42b2b;
  color: #c42b2b;
}

.roast-btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.roast-score-panel {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.roast-score-value {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
}

.roast-score-value span {
  font-size: 0.35em;
  font-weight: 600;
  color: var(--muted);
}

.roast-score-tier {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.roast-feedback {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--line);
}

.roast-feedback-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.roast-feedback-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.roast-feedback-item {
  position: relative;
  padding-left: 16px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.roast-feedback-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6a994e;
}

.roast-feedback-item--warn::before {
  background: #c8553d;
}

.roast-notes {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.roast-score-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  font-size: 0.85rem;
}

.roast-score-breakdown dt {
  color: var(--muted);
  font-weight: 500;
}

.roast-score-breakdown dd {
  margin: 0;
  font-weight: 700;
}

@media (min-width: 900px) {
  body[data-active-tab="games"] .games-section.page-section {
    padding: 28px 40px 36px;
  }

  body[data-active-tab="games"] .games-shell {
    margin-inline: auto;
  }

  .games-hub {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .games-hub-header {
    text-align: center;
  }

  .games-hub-header .page-title::after {
    margin-inline: auto;
  }

  .games-hub-header .page-lead {
    text-align: center;
  }

  .games-grid {
    justify-content: center;
  }

  .handnet-app,
  .hamlet-app,
  .roast-app {
    width: min(520px, 100%);
    margin-inline: auto;
  }

  .handnet-app--brief,
  .hamlet-app--brief,
  .roast-app--step-brief,
  .handnet-app--score,
  .hamlet-app--score,
  .roast-app--step-score,
  .roast-app--step-complete {
    padding-top: clamp(20px, 7vh, 72px);
  }

  .handnet-app--brief .handnet-header,
  .hamlet-app--brief .hamlet-header,
  .handnet-app--score .handnet-header,
  .hamlet-app--score .hamlet-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .handnet-app--play,
  .hamlet-app--play,
  .roast-app--step-roast {
    width: min(880px, 100%);
    padding-top: 0;
  }

  .handnet-brief,
  .hamlet-brief,
  .roast-stage--brief,
  .roast-score-panel {
    width: 100%;
    max-width: none;
    margin-inline: auto;
  }

  .roast-app {
    gap: 14px;
  }

  .roast-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    margin-bottom: 0;
  }

  .roast-nav {
    flex: 0 0 auto;
  }

  .roast-header-body {
    flex: 1;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
  }

  .roast-header-body .roast-level-progress {
    margin: 0 0 0 auto;
  }

  .roast-title {
    font-size: 1.7rem;
  }

  .roast-stage--brief {
    max-width: 520px;
    padding: 22px 24px;
  }

  .roast-pick-actions {
    margin-top: 18px;
  }

  .roast-btn-start {
    width: auto;
    max-width: 220px;
    padding: 0 28px;
  }

  .roast-score-panel {
    max-width: 560px;
  }

  .roast-app--step-roast {
    height: calc(100svh - var(--site-header-height, 104px) - 64px);
    max-height: calc(100svh - var(--site-header-height, 104px) - 64px);
    overflow: hidden;
  }

  .roast-app--step-roast .roast-flow-hint {
    margin: 0;
  }

  .roast-app--step-roast .roast-stage-body {
    grid-template-rows: auto auto minmax(240px, 1fr) auto;
  }

  .roast-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 16px;
    padding: 14px 18px;
  }

  .roast-chart-wrap {
    min-height: 240px;
  }

  .roast-chart {
    min-height: 220px;
  }

  .roast-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
  }

  .roast-actions {
    flex: 0 0 auto;
    width: auto;
  }

  .roast-actions .roast-btn {
    flex: 0 0 auto;
    min-width: 96px;
    padding: 0 22px;
  }

  .roast-gas {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
  }

  .roast-gas-stepper {
    flex: 0 0 220px;
    grid-template-columns: 44px minmax(72px, 1fr) 44px;
    gap: 8px;
  }

  .roast-gas-btn,
  .roast-gas-readout {
    min-height: 42px;
  }

  .roast-gas-value {
    font-size: 1.15rem;
  }

  .roast-gas-presets {
    flex: 1;
    max-width: 360px;
  }

  .roast-gas-preset {
    min-height: 42px;
  }
}

@media (max-width: 920px) {
  .games-grid {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  body[data-active-tab="games"] .games-section.page-section {
    overflow: hidden;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  }

  body[data-active-tab="games"] .games-shell {
    height: calc(100svh - var(--site-header-height, 88px));
    max-height: calc(100svh - var(--site-header-height, 88px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  body[data-active-tab="games"] #games-root {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-active-tab="games"] #games-root:has(.roast-app--step-roast),
  body[data-active-tab="games"] #games-root:has(.handnet-app--play),
  body[data-active-tab="games"] #games-root:has(.hamlet-app--play),
  body[data-active-tab="games"] #games-root:has(.court-h5-app) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .games-hub {
    padding-bottom: 12px;
  }

  .games-hub-header {
    margin-bottom: 14px;
  }

  .games-hub-header .page-title {
    font-size: 1.45rem;
  }

  .games-hub-header .page-lead {
    margin-top: 6px;
    font-size: 0.86rem;
  }

  .handnet-app--play,
  .hamlet-app--play,
  .hamlet-app--brief,
  .roast-app--step-brief,
  .roast-app--step-roast,
  .roast-app--step-score,
  .roast-app--step-complete {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .handnet-canvas-wrap,
  .handnet-canvas {
    min-height: 0;
  }

  .hamlet-canvas-wrap,
  .hamlet-canvas {
    min-height: 0;
  }

  .handnet-stage {
    flex: 1;
    min-height: 0;
  }

  .roast-header {
    flex-shrink: 0;
    gap: 6px;
    margin-bottom: 0;
  }

  .roast-title {
    font-size: 1.35rem;
  }

  .roast-step-kicker,
  .roast-app--step-roast .roast-flow-hint {
    display: none;
  }

  .roast-header-body .roast-level-progress {
    margin: 0;
  }

  .roast-stage--brief {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 10px 12px 12px;
  }

  .roast-bean-grid {
    grid-template-columns: 1fr;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
  }

  .roast-bean-card {
    padding: 10px;
  }

  .roast-stage--roast {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .roast-stage-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 6px;
  }

  .roast-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 6px;
    padding: 8px 10px;
    font-size: 0.68rem;
  }

  .roast-metric-label {
    font-size: 0.62rem;
  }

  .roast-metric-cell strong {
    font-size: 0.78rem;
  }

  .roast-chart-wrap {
    min-height: 0;
    overflow: hidden;
  }

  .roast-chart {
    min-height: 0;
  }

  .roast-controls {
    position: static;
    flex-shrink: 0;
    box-shadow: none;
    padding: 8px 10px;
    gap: 8px;
  }

  .roast-gas {
    gap: 6px;
  }

  .roast-gas-stepper {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 8px;
  }

  .roast-gas-btn {
    min-height: 40px;
    font-size: 1.25rem;
    border-radius: 10px;
  }

  .roast-gas-readout {
    min-height: 40px;
    gap: 0;
  }

  .roast-gas-value {
    font-size: 1.05rem;
  }

  .roast-gas-presets {
    gap: 6px;
  }

  .roast-gas-preset {
    min-height: 34px;
    font-size: 0.76rem;
  }

  .roast-actions {
    gap: 8px;
  }

  .roast-actions .roast-btn {
    min-height: 46px;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .games-card {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
  }

  .games-card-art {
    height: 132px;
    flex: 0 0 132px;
  }

  .games-card-body {
    padding: 10px 12px;
  }

  .games-card-blurb {
    font-size: 0.78rem;
  }

  .roast-header-body {
    align-items: flex-start;
  }

  .roast-app {
    padding-bottom: 0;
  }
}

@media (max-width: 900px) {
  html[data-game-immersive="1"] {
    --site-header-height: 0px;
  }

  html[data-game-immersive="1"] .site-header,
  body[data-game-immersive="1"] .site-header {
    display: none;
  }

  body[data-game-immersive="1"] {
    overflow: hidden;
  }

  body[data-game-immersive="1"] .games-section.page-section {
    overflow: hidden;
    padding:
      max(8px, env(safe-area-inset-top, 0px))
      12px
      calc(8px + env(safe-area-inset-bottom, 0px));
  }

  body[data-game-immersive="1"] .games-shell {
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  body[data-game-immersive="1"] #games-root {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  body[data-game-immersive="1"] .hamlet-app--play {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body[data-game-immersive="1"] .hamlet-canvas-wrap,
  body[data-game-immersive="1"] .hamlet-canvas {
    flex: 1;
    min-height: 0;
  }

  body[data-game-immersive="1"] .hamlet-inspect,
  body[data-game-immersive="1"] .hamlet-pick {
    flex: 0 0 auto;
  }

  body[data-game-immersive="1"] .roast-back {
    position: relative;
    z-index: 2;
    min-height: 44px;
    padding: 8px 4px;
    color: var(--ink);
  }

  body[data-game-immersive="1"] .handnet-header-body,
  body[data-game-immersive="1"] .hamlet-header-body,
  body[data-game-immersive="1"] .roast-header-titles {
    display: none;
  }

  body[data-game-immersive="1"] .court-h5-app {
    flex: 1;
    min-height: 0;
  }

  body[data-game-immersive="1"] .court-h5-back {
    min-height: 44px;
  }
}

/* Retro court H5 embeds (pingpong / tennis / badminton) */
.court-h5-app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: min(92svh, 920px);
  min-height: 520px;
  background: #ebe4d6;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(42, 36, 28, 0.1);
}

.court-h5-back {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: max(10px, env(safe-area-inset-left, 0px));
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 12px 0 8px;
  border: 1px solid rgba(42, 36, 28, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  color: #2a241c;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(42, 36, 28, 0.08);
}

.court-h5-back-chevron {
  font-size: 1.35rem;
  line-height: 1;
}

.court-h5-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #ebe4d6;
}

/* Little Hamlets */
.hamlet-app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.hamlet-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.hamlet-header-body {
  min-width: 0;
}

.hamlet-brief {
  max-width: 520px;
  display: grid;
  gap: 12px;
  padding: clamp(16px, 3vw, 24px);
}

.hamlet-lead,
.hamlet-how {
  margin: 0;
  line-height: 1.5;
}

.hamlet-how {
  color: var(--muted);
  font-size: 0.9rem;
}

.hamlet-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.hamlet-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hamlet-temple {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.hamlet-temple strong {
  justify-self: end;
  color: var(--ink);
}

.hamlet-meter {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.hamlet-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: #6a994e;
}

.hamlet-pause {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
}

.hamlet-toast {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
  flex-shrink: 0;
}

.hamlet-canvas-wrap {
  flex: 1;
  min-height: min(52svh, 420px);
  overflow: hidden;
  background: #6fa24a;
  border-color: #5a8a3a;
}

.hamlet-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.hamlet-inspect,
.hamlet-pick {
  flex: 0 0 auto;
}

.hamlet-inspect {
  display: grid;
  gap: 8px;
}

.hamlet-inspect-head strong {
  font-size: 0.92rem;
}

.hamlet-bag-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.hamlet-chip-send {
  margin-left: auto;
}

.hamlet-stocks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 2px;
}

.hamlet-stocks div {
  display: grid;
  gap: 2px;
}

.hamlet-stocks span {
  font-size: 0.7rem;
  color: var(--muted);
}

.hamlet-stocks strong {
  font-size: 1.05rem;
}

.hamlet-stocks .is-low strong {
  color: #b42318;
}

.hamlet-pick {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f1e6;
}

.hamlet-pick[hidden] {
  display: none;
}

.hamlet-pick p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.hamlet-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hamlet-chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--paper);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.hamlet-chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hamlet-chip.is-on {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.hamlet-tray {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.hamlet-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: inherit;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.hamlet-tool small {
  font-size: 0.56rem;
  opacity: 0.62;
}

.hamlet-tool:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.hamlet-tool.is-on {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  background: #f4efe4;
}

.hamlet-score-shot {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: center 40%;
  border-radius: 12px;
  background: #6fa24a;
}
