/* Menu viewer — shared styles for every restaurant */
:root {
  --bg: #15120f;
  --bar: rgba(21, 18, 15, 0.86);
  --fg: #f4ede4;
  --muted: #a89a88;
  --accent: #c9a77c;
  --line: rgba(255, 255, 255, 0.09);
  --chip: rgba(255, 255, 255, 0.06);
  --top: 56px;
  --bot: 72px;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}
/* each restaurant's colours are set in src/sites.json ("colors") and written into its page */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
img { -webkit-user-drag: none; user-select: none; }

/* ---------- layout ---------- */
.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows:
    auto
    minmax(0, 1fr)
    calc(var(--bot) + env(safe-area-inset-bottom));
}

.topbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
  min-height: calc(var(--top) + env(safe-area-inset-top));
  padding: calc(env(safe-area-inset-top) + 4px) max(12px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left));
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.brand {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  text-decoration: none;
}
.brand-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
  white-space: nowrap;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  flex: none;
  transition: background 0.15s, opacity 0.15s;
}
.icon-btn:hover { background: var(--chip); }
.icon-btn:active { background: rgba(255, 255, 255, 0.12); }
.icon-btn:disabled { opacity: 0.28; cursor: default; background: transparent; }
.icon-btn svg { width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- stage ---------- */
.stage {
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.stage.zoomed { cursor: move; }
.stage:active { cursor: grabbing; }
.track { position: absolute; inset: 0; will-change: transform; }
.slide { position: absolute; top: 0; width: 100%; height: 100%; }
.zoomer {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  transform-origin: 50% 50%;
  will-change: transform;
}
.pg {
  position: relative;
  flex: 1 1 0;
  background: #2a2622 center / cover no-repeat;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.pg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.pg img.on { opacity: 1; }
.zoomer.spread::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 48px;
  margin-left: -24px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.14) 46%, rgba(0, 0, 0, 0.24) 50%, rgba(0, 0, 0, 0.14) 54%, transparent);
}
.pg .spin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.2s;
}
.pg.loading .spin { opacity: 1; transition-delay: 0.35s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* side arrows — only on devices with a mouse */
.side {
  position: absolute;
  top: 50%;
  margin-top: -26px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bar);
  display: none;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  transition: opacity 0.2s, background 0.15s;
}
.side:hover { background: rgba(60, 52, 44, 0.92); }
.side:disabled { opacity: 0; pointer-events: none; }
.side svg { width: 24px; height: 24px; }
.side.prev { left: 16px; }
.side.next { right: 16px; }
@media (hover: hover) and (pointer: fine) {
  .side { display: grid; }
}

/* ---------- bottom bar ---------- */
.bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 max(10px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(10px, env(safe-area-inset-left));
  background: var(--bar);
  border-top: 1px solid var(--line);
  z-index: 5;
}
.nav { display: flex; align-items: center; gap: 4px; }
.pager {
  min-width: 112px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  white-space: nowrap;
}
.pager:hover { background: rgba(255, 255, 255, 0.1); }
.pager .of { color: var(--muted); }
.tool-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 64px;
  height: 52px;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
}
.tool-label svg { width: 22px; height: 22px; color: var(--fg); }
.tool-label:hover { background: var(--chip); }
.tool-label.active svg, .tool-label.active { color: var(--accent); }

/* ---------- page picker sheet ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}
.sheet.open { visibility: visible; pointer-events: auto; }
.sheet .backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.sheet.open .backdrop { opacity: 1; }
.panel {
  position: relative;
  width: 100%;
  max-width: 1040px;
  height: min(88dvh, 900px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(104%);
  transition: transform 0.34s var(--ease);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}
.sheet.open .panel { transform: none; }
.panel-head {
  padding: 10px 16px 0;
  flex: none;
}
.grabber {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 10px;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panel-title h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}
.panel-title h2 small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { background: rgba(255, 255, 255, 0.1); }
.chip.on { background: var(--accent); color: #1a150f; border-color: var(--accent); font-weight: 600; }
.panel-body {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px calc(24px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sec-title {
  margin: 18px 0 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sec-title:first-child { margin-top: 6px; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 10px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.card.wide { grid-column: span 2; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 820px) { .grid.g2 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid.g2 .card.wide { grid-column: auto; }
.card .thumbs {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s, transform 0.15s;
  background: #2a2622;
}
.card:hover .thumbs { transform: translateY(-2px); }
.card.current .thumbs { outline-color: var(--accent); }
.card .thumbs img {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: var(--ratio, 0.78125);
  object-fit: cover;
  display: block;
}
.card .t {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .s {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
  margin-top: -3px;
}
.card.current .t { color: var(--accent); }

/* ---------- toast / hint ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bot) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 12px);
  background: rgba(30, 27, 24, 0.94);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
  z-index: 30;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .panel, .backdrop, .toast { transition-duration: 0.01s; }
}

/* the 1 page / 2 pages button shows what is on screen now */
#layout .i-two, #layout.two .i-one { display: none; }
#layout.two .i-two { display: block; }
/* phones: a slimmer bottom bar so ห้าปุ่ม fit (contents · ‹ page › · page view · zoom) */
@media (max-width: 480px) {
  .bottombar { gap: 2px; padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  .tool-label { width: 54px; font-size: 10.5px; }
  .bottombar .icon-btn { width: 40px; }
  .pager { min-width: 92px; padding: 0 10px; }
  .nav { gap: 2px; }
}
/* narrow phones: hide text labels on tool buttons */
@media (max-width: 360px) {
  .tool-label { width: 46px; }
  .tool-label span { display: none; }
  .pager { min-width: 96px; padding: 0 12px; }
}

/* ======================= intro (book cover + party size) ======================= */
.intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.intro::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 60%),
    var(--bg);
  transition: opacity 0.7s ease 0.3s;
}
.intro-inner {
  /* centred when it fits; taller than the screen, it starts at the top instead of sliding under the back button */
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 980px;
  padding: 24px 16px 28px;
  transition: opacity 0.35s ease;
}
.book {
  position: relative;
  height: min(42dvh, 480px);
  aspect-ratio: var(--ratio, 0.78125);
  perspective: 1800px;
  cursor: pointer;
  flex: none;
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition: opacity 0.7s ease, transform 0.9s var(--ease);
}
.intro.show .book { opacity: 1; transform: none; }
.cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.05s cubic-bezier(0.55, 0.05, 0.3, 1);
  border-radius: 2px 6px 6px 2px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.cover img { width: 100%; height: 100%; display: block; }
/* spine crease + a slow sheen across the cover */
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.08) 3%, transparent 7%);
  pointer-events: none;
}
.cover::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 40%;
  left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: skewX(-12deg);
  animation: sheen 5.5s ease-in-out 1.4s infinite;
  pointer-events: none;
}
@keyframes sheen { 0% { left: -60%; } 38%, 100% { left: 130%; } }
.cover-inside {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 2px 6px 6px 2px;
  background: #e8dfd2;
  transform: translate(5px, 4px);
  box-shadow: inset 6px 0 10px rgba(0, 0, 0, 0.12), 3px 3px 0 #d6cab9, 6px 6px 0 #c4b7a4;
  transition: opacity 0.5s ease 0.45s;
}
.book:hover .cover { transform: rotateY(-9deg); }

.intro-q { text-align: center; width: 100%; max-width: 420px; }
.intro-q > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.7s var(--ease);
}
.intro.show .intro-q > * { opacity: 1; transform: none; }
.intro.show .intro-q > :nth-child(2) { transition-delay: 0.08s; }
.intro.show .intro-q > :nth-child(3) { transition-delay: 0.14s; }
.intro.show .intro-q > :nth-child(4) { transition-delay: 0.22s; }
.intro.show .intro-q > :nth-child(5) { transition-delay: 0.3s; }
.intro.show .intro-q > :nth-child(6) { transition-delay: 0.36s; }
.intro-hi {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--accent);
}
.intro-q h2 { margin: 6px 0 2px; font-size: 28px; font-weight: 600; }
.intro-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.party { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.party button {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 6px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--chip);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.party button:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.09); }
.party button:active { transform: scale(0.97); }
.party b { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; color: var(--accent); }
.party span { font-size: 14px; }
.party small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: 4px; }
.open-all {
  margin-top: 14px;
  height: 46px;
  width: 100%;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #1a150f;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.open-all:hover { filter: brightness(1.07); }
.open-all:active { transform: scale(0.98); }
.intro-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.intro-note svg { width: 16px; height: 16px; flex: none; }

/* opening: the cover swings open, everything else fades to reveal the menu */
.intro.opening { pointer-events: none; }
.intro.opening::before { opacity: 0; }
.intro.opening .book .cover { transform: rotateY(-118deg); }
.intro.opening .cover-inside { opacity: 0; }
.intro.opening .intro-q > * { opacity: 0; transform: translateY(10px); transition-delay: 0s; }
.intro.opening .book { opacity: 0; transition: opacity 0.45s ease 0.6s, transform 1s var(--ease); transform: scale(1.06); }

@media (min-width: 820px) and (min-aspect-ratio: 1/1) {
  .intro-inner { flex-direction: row; justify-content: center; gap: 64px; }
  .book { height: min(74dvh, 640px); }
  .intro-q { text-align: left; }
  .intro-q h2 { font-size: 34px; }
  .intro-note { justify-content: flex-start; }
}
@media (max-height: 640px) and (max-width: 819px) {
  .book { height: 34dvh; }
  .intro-inner { gap: 14px; padding-top: 14px; }
}

/* ======================= top bar: sound + heart ======================= */
.brand-name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .brand-name { letter-spacing: 0.14em; font-size: 14px; } }
#sound .i-off { display: none; }
#sound[aria-pressed="false"] .i-on { display: none; }
#sound[aria-pressed="false"] .i-off { display: block; }
#sound[aria-pressed="true"] { color: var(--accent); }
#sound[aria-pressed="true"] .i-on path { animation: drift 3.2s ease-in-out infinite alternate; }
#sound[aria-pressed="true"] .i-on path:nth-child(2) { animation-delay: -1.1s; }
#sound[aria-pressed="true"] .i-on path:nth-child(3) { animation-delay: -2.2s; }
@keyframes drift { from { transform: translateX(-1.6px); } to { transform: translateX(1.6px); } }

.fav-wrap { position: relative; flex: none; }
#fav { position: relative; }
#fav svg { fill: transparent; transition: fill 0.2s, color 0.2s; }
#fav.on { color: #ec7a63; }
#fav.on svg { fill: #ec7a63; }
#fav.pop svg { animation: heart-pop 0.45s var(--ease); }
@keyframes heart-pop { 0% { transform: scale(1); } 35% { transform: scale(1.38); } 70% { transform: scale(0.92); } 100% { transform: scale(1); } }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.burst i {
  position: absolute;
  width: 5px;
  height: 5px;
  margin: -2.5px;
  border-radius: 50%;
  background: #ec7a63;
  opacity: 0;
}
.burst i:nth-child(2n) { background: var(--accent); }
#fav.pop .burst i { animation: burst 0.6s ease-out forwards; }
.burst i:nth-child(1) { --a: 0deg; } .burst i:nth-child(2) { --a: 60deg; } .burst i:nth-child(3) { --a: 120deg; }
.burst i:nth-child(4) { --a: 180deg; } .burst i:nth-child(5) { --a: 240deg; } .burst i:nth-child(6) { --a: 300deg; }
@keyframes burst {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(-6px) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-22px) scale(0.4); }
}
.fav-pop {
  position: absolute;
  right: -40px;
  top: 50px;
  z-index: 15;
  width: 250px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(32, 28, 24, 0.98);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.fav-pop p { margin: 6px 10px 8px; font-size: 12px; color: var(--muted); }
.fav-pop button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.fav-pop button:hover { background: var(--chip); }
.fav-pop img { width: 36px; aspect-ratio: var(--ratio, 0.78125); border-radius: 3px; object-fit: cover; flex: none; }
.fav-pop .nm { flex: 1; font-size: 14px; font-weight: 500; }
.fav-pop svg { width: 20px; height: 20px; fill: transparent; stroke: currentColor; stroke-width: 1.8; }
.fav-pop .on { color: #ec7a63; }
.fav-pop .on svg { fill: #ec7a63; }

.tool-label { position: relative; }
.badge {
  position: absolute;
  top: 3px;
  left: 36px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ec7a63;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* favourites inside the contents sheet */
.sec-title .clear {
  order: 2;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.sec-title .clear:hover { color: var(--fg); background: var(--chip); }
.sec-title.fav-title { color: #ec7a63; }
.fav-hint { margin: -4px 0 10px; font-size: 12px; color: var(--muted); }
.card .thumbs { position: relative; }
.card.faved .thumbs::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(20, 17, 14, 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ec7a63' d='M12 20.5s-7.5-4.6-9.2-9.4C1.6 7.6 3.9 4.5 7.2 4.5c2 0 3.6 1.1 4.8 2.8 1.2-1.7 2.8-2.8 4.8-2.8 3.3 0 5.6 3.1 4.4 6.6-1.7 4.8-9.2 9.4-9.2 9.4z'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* ======================= page turn (both views) ======================= */
/* --p goes 0 → 1 while the page turns (set from app.js); shading follows it */
.turn { position: absolute; z-index: 2; pointer-events: none; --p: 0; }
.turn img {
  width: 100%;
  height: 100%;
  display: block;
  background-size: 100% 100%;
  background-color: #2a2622;
}
.turn .half, .turn .under { position: absolute; top: 0; height: 100%; overflow: hidden; }
.turn .under { left: 0; width: 100%; }
.turn .half { width: 50%; }
.turn .half.l { left: 0; }
.turn .half.r { left: 50%; }
.turn .shade { position: absolute; inset: 0; pointer-events: none; }
.turn .leaf {
  position: absolute;
  top: 0;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}
.turn.one .leaf { left: 0; width: 100%; transform-origin: left center; }
.turn.two .leaf { width: 50%; }
.turn.two.next .leaf { left: 50%; transform-origin: left center; }
.turn.two.prev .leaf { left: 0; transform-origin: right center; }
.turn .face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.turn .face.back { transform: rotateY(180deg); }
.turn .face::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
/* the back of a single page: the print shows faintly through the paper */
.turn .paper { background: #f3eee6; }
.turn .paper img.mirror { transform: scaleX(-1); opacity: 0.16; filter: grayscale(0.4); }

/* the turning page darkens as it rises edge-on, then lightens as it lands */
.turn.next .face.front::after { background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.12) 55%, rgba(255, 255, 255, 0.08)); opacity: calc(var(--p) * 1.9); }
.turn.next .face.back::after { background: linear-gradient(270deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.08) 50%, transparent); opacity: calc((1 - var(--p)) * 1.9); }
.turn.prev .face.front::after { background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.12) 55%, rgba(255, 255, 255, 0.08)); opacity: calc((1 - var(--p)) * 1.9); }
.turn.prev .face.back::after { background: linear-gradient(270deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.08) 50%, transparent); opacity: calc(var(--p) * 1.9); }
.turn.two.prev .face.front::after { background: linear-gradient(270deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.12) 55%, rgba(255, 255, 255, 0.08)); }
.turn.two.prev .face.back::after { background: linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.08) 50%, transparent); }

/* the shadow the lifted page casts on the page underneath */
.turn.one .shade { background: linear-gradient(90deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.42) 45%, rgba(0, 0, 0, 0.3)); }
.turn.one.next .shade { opacity: calc(1 - var(--p)); }
.turn.one.prev .shade { opacity: var(--p); }
.turn.two .half.r .shade { background: linear-gradient(90deg, rgba(0, 0, 0, 0.45), transparent 70%); }
.turn.two .half.l .shade { background: linear-gradient(270deg, rgba(0, 0, 0, 0.45), transparent 70%); }
.turn.two.next .half.r .shade { opacity: calc(1 - var(--p)); }
.turn.two.next .half.l .shade { opacity: var(--p); }
.turn.two.prev .half.l .shade { opacity: calc(1 - var(--p)); }
.turn.two.prev .half.r .shade { opacity: var(--p); }
/* the corner-curl turn draws everything on one canvas over the reading area */
.turn.curl canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* spine crease between two pages */
.turn.two::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 48px;
  margin-left: -24px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.14) 46%, rgba(0, 0, 0, 0.24) 50%, rgba(0, 0, 0, 0.14) 54%, transparent);
}
/* a thin edge of paper along the spine side of a single page while it turns */
.turn.one .under::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent);
}

@media (prefers-reduced-motion: reduce) {
  .cover::after, #sound .i-on path { animation: none !important; }
  .cover, .book, .intro-q > * { transition-duration: 0.01s !important; }
}

/* sound button with a small "mute" caption underneath */
.icon-btn.labeled {
  flex-direction: column;
  gap: 1px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.labeled svg { width: 20px; height: 20px; }
.snd-label {
  white-space: nowrap;
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
}
#sound[aria-pressed="true"] .snd-label { color: var(--accent); }

/* ======================= book tabs: food / drinks / desserts ======================= */
.tabs {
  order: 10;
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  margin: 4px auto 6px;
}
.tabs .home {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--fg);
  cursor: pointer;
}
.tabs .home svg { width: 19px; height: 19px; }
.tabs .home:hover { border-color: var(--accent); color: var(--accent); }
.tabs .seg {
  flex: 1;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
}
.tabs .seg button {
  flex: 1;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tabs .seg button:hover { color: var(--fg); }
.tabs .seg button.on { background: var(--accent); color: #1a150f; font-weight: 600; }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 860px) {
  .topbar { flex-wrap: nowrap; }
  .tabs {
    position: absolute;
    left: 50%;
    top: calc(env(safe-area-inset-top) + (var(--top) - 40px) / 2 + 2px);
    transform: translateX(-50%);
    width: 452px;
    margin: 0;
  }
  .brand { max-width: calc(50% - 250px); margin-right: auto; }
}

/* table of contents: book name, other books, saved items from another book */
#sheet-book { color: var(--accent); }
.card .bk {
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
}
.toc-more { display: grid; gap: 10px; margin: 28px 0 8px; }
.toc-more button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--chip);
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}
.toc-more button:hover { border-color: var(--accent); }
.toc-more img { width: 44px; aspect-ratio: var(--ratio, 0.78125); object-fit: cover; border-radius: 4px; flex: none; }
.toc-more span { flex: 1; }
.toc-more i { font-style: normal; color: var(--accent); }

/* ======================= intro: choose a menu ======================= */
.hub { text-align: center; max-width: 760px; }
.hub > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.7s var(--ease);
}
.intro.show .hub > * { opacity: 1; transform: none; }
.intro.show .hub > :nth-child(2) { transition-delay: 0.06s; }
.intro.show .hub > :nth-child(3) { transition-delay: 0.12s; }
.intro.show .hub > :nth-child(4) { transition-delay: 0.18s; }
.intro.show .hub > :nth-child(5) { transition-delay: 0.3s; }
.hub .intro-hi { margin-bottom: -14px; }
.hub-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 8.5vw, 54px);
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.hub .intro-sub { margin: -10px 0 0; }
.hub-books {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.hub-book {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 0 4px;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.6s var(--ease), opacity 0.45s ease;
}
.hb-img {
  display: block;
  width: 100%;
  aspect-ratio: var(--ratio, 0.78125);
  margin-bottom: 8px;
  border-radius: 4px 8px 8px 4px;
  overflow: hidden;
  background: #2a2622;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.hb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hub-book:hover .hb-img { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(0, 0, 0, 0.55), 0 2px 5px rgba(0, 0, 0, 0.3); }
.hub-book:active .hb-img { transform: scale(0.97); }
.hub-book:focus-visible { outline: none; }
.hub-book:focus-visible .hb-img { outline: 2px solid var(--accent); outline-offset: 3px; }
.hub-book b { font-size: 17px; font-weight: 600; }
.hub-book small {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.hub .intro-note { margin-top: 0; }
@media (min-width: 700px) {
  .hub-books { gap: 26px; }
  .hub-book b { font-size: 19px; }
}
@media (max-height: 640px) {
  .hub-books { max-width: 420px; margin: 0 auto; }
}
/* opening a book from this screen: the picked book moves to the middle and its cover swings open */
.hb-img { position: relative; overflow: visible; perspective: 900px; }
.hb-img img { position: relative; z-index: 1; border-radius: inherit; transform-origin: left center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.hb-img::before {
  /* the first page inside the cover */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #efe8dd;
  box-shadow: inset 6px 0 10px rgba(0, 0, 0, 0.14);
}
.intro.from-hub .hub > :not(.hub-books) { opacity: 0; transition-delay: 0s; }
.intro.from-hub .hub-book:not(.picked) { opacity: 0; transform: scale(0.94); }
.intro.from-hub .hub-book.picked {
  z-index: 3;
  transform: translate(var(--dx, 0), var(--dy, 0)) scale(var(--zoom, 1.6));
  transition: transform 0.75s var(--ease);
}
.intro.from-hub .hub-book.picked b,
.intro.from-hub .hub-book.picked small { opacity: 0; transition: opacity 0.25s; }
.intro.from-hub .hub-book.picked .hb-img img { transform: rotateY(-118deg); transition: transform 1s cubic-bezier(0.55, 0.05, 0.3, 1) 0.3s; }
.intro.from-hub .hub-book.picked .hb-img { box-shadow: none; transition: box-shadow 0.4s 0.3s; }
.intro.from-hub .hub-book.picked .hb-img::before { opacity: 0; transition: opacity 0.3s ease 0.35s; }
.intro.from-hub .hub-book.picked .hb-img img { opacity: 0; transition: transform 1s cubic-bezier(0.55, 0.05, 0.3, 1) 0.3s, opacity 0.3s ease 0.95s; }

.intro-back {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  left: max(12px, env(safe-area-inset-left));
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease 0.3s;
}
.intro.show .intro-back { opacity: 1; }
.intro.opening .intro-back { opacity: 0; transition-delay: 0s; }
.party-stage { padding-top: 58px; }
@media (min-width: 820px) and (min-aspect-ratio: 1/1) { .party-stage { padding-top: 24px; } }

/* labelled heart / share, and a gentle nudge the first time */
#fav.labeled svg, #share.labeled svg { width: 21px; height: 21px; }
#fav.on .snd-label { color: #ec7a63; }
#fav .burst { top: 38%; }
#fav.nudge svg { animation: nudge 1.1s ease-in-out 2; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.28); } 55% { transform: scale(0.94); } }

/* ---------- per-restaurant: brand entrance "hearth" (menu data feel.intro = "hearth") ----------
   The shelf at the back of the hearth kitchen: the light comes up, faint smoke, the branch menus are set down. */
.intro.is-hearth { padding: 0; overflow: hidden; }
.intro.is-hearth::before { display: none; }
.hearth { position: fixed; inset: 0; z-index: 1; overflow: hidden; background: #0d0907; color: #f4ede4; transition: opacity 0.75s ease; }
.hearth.leaving { opacity: 0; pointer-events: none; }
.h-back { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(30px) brightness(0.32) saturate(0.9); }
.h-scene { position: absolute; }
/* the photo keeps one look (a touch of depth of field so the books stand out); the light coming up and
   going down is a dark layer fading, which phones can animate smoothly */
.h-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.88) blur(0.7px); transform: scale(1.01); }
.h-dim { position: absolute; inset: 0; background: #0b0705; opacity: 0.86; will-change: opacity; transition: opacity 2.8s ease 0.2s; }
.hearth.in .h-dim { opacity: 0.3; } /* the kitchen stays a little dim, lit by the fire */
.hearth.again .h-dim { transition-duration: 0.6s; transition-delay: 0s; }
.hearth.in.picking .h-dim { opacity: 0.7; transition: opacity 1.1s ease; }
/* darker at the top for the greeting, warm glow rising from the hearth below */
.h-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(10, 7, 5, 0.8) 0%, rgba(10, 7, 5, 0.42) 24%, rgba(10, 7, 5, 0) 42%, rgba(10, 7, 5, 0) 74%, rgba(10, 7, 5, 0.6) 100%);
}
.h-veil::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 18% 100%, rgba(255, 138, 56, 0.2), transparent 55%);
  mix-blend-mode: screen;
  will-change: opacity;
  animation: h-flicker 3.4s ease-in-out infinite alternate;
}
@keyframes h-flicker { 0% { opacity: 0.5; } 40% { opacity: 0.95; } 70% { opacity: 0.68; } 100% { opacity: 1; } }
/* faint smoke drifting up past the shelf */
.h-smoke i {
  position: absolute;
  bottom: 4%;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 226, 214, 0.1), rgba(236, 226, 214, 0) 62%);
  filter: blur(16px);
  opacity: 0;
  will-change: transform, opacity;
  animation: h-smoke 19s linear infinite;
  pointer-events: none;
}
.h-smoke i:nth-child(1) { left: -12%; animation-delay: 0.8s; --drift: 9%; }
.h-smoke i:nth-child(2) { left: 30%; animation-delay: 5.5s; animation-duration: 22s; --drift: -7%; }
.h-smoke i:nth-child(3) { left: 52%; animation-delay: 10s; --drift: 11%; }
.h-smoke i:nth-child(4) { left: 12%; animation-delay: 14.5s; animation-duration: 21s; --drift: 5%; }
@keyframes h-smoke {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  18% { opacity: 0.85; }
  65% { opacity: 0.4; }
  100% { transform: translate(var(--drift, 6%), -150%) scale(1.9); opacity: 0; }
}
/* the menu books on the shelf: real 3D books (cover, spine, page edges), lit from the left like the photo */
.h-shelf { position: absolute; inset: 0; }
/* each book has its own 3D stage, so the shadows (flat, behind) never cut through it */
.hb-stage { position: absolute; inset: 0; perspective: 520px; perspective-origin: 50% 34%; }
.h-book {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: 50% 100%;
  opacity: 0;
  transform: translateY(-16%) scale(1.07) rotate(calc(var(--lean) * -3));
  --ry: 26deg;
}
.h-book[data-side="r"] { --ry: -26deg; }
.hearth.in .h-book {
  opacity: 1;
  transform: rotate(var(--lean));
  transition: transform 1.15s cubic-bezier(0.2, 0.85, 0.3, 1.12), opacity 0.5s ease;
  transition-delay: calc(1.6s + var(--i) * 0.55s);
}
.hearth.again .h-book { transition-delay: calc(0.15s + var(--i) * 0.12s); transition-duration: 0.5s; }
/* a slow sway, like the warm air moving around the hearth */
.hb-sway { position: absolute; inset: 0; transform-style: preserve-3d; animation: hb-sway 7s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -3.1s); }
@keyframes hb-sway { from { transform: rotateY(-1.4deg); } to { transform: rotateY(1.4deg); } }
.hb-body {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
  /* leaning back against the wall, turned toward the middle, following the pointer / phone tilt */
  transform: rotateX(calc(7deg + var(--tilt-x, 0deg))) rotateY(calc(var(--ry) + var(--tilt-y, 0deg)));
  transition: transform 0.9s cubic-bezier(0.25, 0.8, 0.3, 1);
}
.h-book:hover .hb-body, .h-book:focus-visible .hb-body { transform: rotateX(calc(2deg + var(--tilt-x, 0deg))) rotateY(calc(var(--ry) * 0.6 + var(--tilt-y, 0deg))) translateZ(14px); }
.hb-face { position: absolute; display: block; backface-visibility: hidden; }
/* front cover board */
.hb-front {
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: 0 50%;
  transform: translateZ(calc(var(--t) / 2));
  border-radius: 1px 4px 4px 1px;
  transition: transform 1.05s cubic-bezier(0.35, 0, 0.15, 1);
}
.hb-front::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  backface-visibility: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.55;
  box-shadow: inset 1px 0 0 rgba(255, 220, 190, 0.12), inset -1px 0 1px rgba(0, 0, 0, 0.45), inset 0 -2px 2px rgba(0, 0, 0, 0.35);
}
.hb-light { z-index: 2; }
.hb-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; backface-visibility: hidden; }
/* light on the cover: sun from the left, a breathing glow from the hearth below, a soft hinge near the spine */
.hb-light {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.32) 0, rgba(0, 0, 0, 0.05) 3%, rgba(255, 255, 255, 0.09) 4.2%, rgba(0, 0, 0, 0) 6%),
    radial-gradient(ellipse 70% 55% at var(--sheen-x, 50%) 18%, rgba(255, 238, 214, var(--sheen, 0.14)), transparent 70%),
    linear-gradient(to right, rgba(255, 236, 210, var(--sheen, 0.14)) 0%, rgba(255, 236, 210, 0) 45%, rgba(0, 0, 0, var(--shade, 0.3)) 100%),
    linear-gradient(to top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 22%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 220, 190, 0.18);
}
.hb-light::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 90% 60% at 10% 108%, rgba(255, 140, 60, 0.26), transparent 65%);
  mix-blend-mode: screen;
  animation: h-flicker 3.2s ease-in-out infinite alternate;
}
.h-book[data-side="l"] { --sheen: 0.1; --shade: 0.36; }
.h-book[data-side="r"] { --sheen: 0.2; --shade: 0.24; }
/* inside of the cover board, seen when it opens */
.hb-in { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(to left, #4a1a12, #6d281b 70%, #5a2016); transform: rotateY(180deg); backface-visibility: hidden; }
.hb-back { inset: 0; border-radius: 3px 1px 1px 3px; background: #4e1a12; transform: rotateY(180deg) translateZ(calc(var(--t) / 2)); }
/* spine (left side): faces the light */
.hb-spine {
  top: 0;
  bottom: 0;
  left: 50%;
  width: var(--t);
  margin-left: calc(var(--t) / -2);
  background: linear-gradient(to right, #5a1d14, #8a3324 45%, #6b2418 80%, #4f1a12);
  transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.h-book[data-side="r"] .hb-spine { filter: brightness(0.7); }
/* page block: right edge and top, a little inside the boards */
.hb-edge {
  top: 1.6%;
  bottom: 1.6%;
  left: 50%;
  width: calc(var(--t) - 3px);
  margin-left: calc((var(--t) - 3px) / -2);
  background: repeating-linear-gradient(to right, #ece2cf 0 1px, #cdbfa3 1px 2px);
  transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 3px));
  filter: brightness(0.62);
}
.h-book[data-side="l"] .hb-edge { filter: brightness(0.5); }
.hb-top {
  left: 0.5%;
  right: 1.6%;
  top: 50%;
  height: calc(var(--t) - 3px);
  margin-top: calc((var(--t) - 3px) / -2);
  background: repeating-linear-gradient(to bottom, #f1e8d6 0 1px, #d2c4a9 1px 2px);
  transform: rotateX(90deg) translateZ(calc(var(--h) / 2 - 3px));
  filter: brightness(0.95);
}
/* the first page, under the cover */
.hb-inside { top: 0.8%; left: 0; width: 98.4%; height: 98.4%; object-fit: cover; background: #2a1d15; transform: translateZ(calc(var(--t) / 2 - 2px)); }
/* shadows: on the shelf (contact) and on the wall behind, both falling to the right */
/* shadows, light from the upper left like the photo:
   · on the shelf: a soft shadow lying on the wood, stretching away to the right
   · right at the foot of the book: a thin dark line where it touches the shelf
   · on the wall behind: a blurred shadow, also to the right */
.hb-shadow {
  position: absolute;
  left: 16%;
  right: -58%;
  bottom: -4.5%;
  height: 11%;
  transform: skewX(-55deg);
  transform-origin: 0 100%;
  background: linear-gradient(to right, rgba(8, 3, 1, 0.95), rgba(10, 4, 2, 0.7) 30%, rgba(14, 6, 2, 0.32) 65%, transparent);
  -webkit-mask-image: linear-gradient(to top, #000 50%, transparent);
  mask-image: linear-gradient(to top, #000 50%, transparent);
  filter: blur(2.5px);
  transition: opacity 0.3s;
}
.h-book[data-side="r"] .hb-shadow { left: 8%; right: -50%; }
.hb-ao {
  position: absolute;
  left: 1%;
  right: 3%;
  bottom: -1.6%;
  height: 4.2%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(4, 1, 0, 1), rgba(8, 3, 1, 0.7) 50%, transparent 80%);
  filter: blur(1.2px);
  transition: opacity 0.3s;
}
.h-book[data-side="l"] .hb-ao { left: -2%; right: 8%; }
.h-book[data-side="r"] .hb-ao { left: 8%; right: -2%; }
.hb-cast {
  position: absolute;
  top: 3%;
  bottom: 1%;
  left: 12%;
  right: -16%;
  border-radius: 4px;
  background: rgba(18, 8, 3, 0.62);
  filter: blur(11px);
  transform: skewX(-9deg) translateX(6%);
  transform-origin: 50% 100%;
  transition: opacity 0.3s;
}
.h-book.last .hb-light { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(217, 167, 126, 0.85), 0 0 26px rgba(217, 167, 126, 0.5); }
.hb-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 34px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 18px 6px;
  border: 1px solid rgba(255, 228, 196, 0.24);
  border-radius: 12px;
  background: rgba(16, 10, 7, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.8s ease calc(2.8s + var(--i) * 0.3s);
}
.hearth.in .hb-label { opacity: 1; }
.hearth.again .hb-label { transition-delay: 0.4s; }
.hb-label b { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0.22em; line-height: 1.2; margin-right: -0.22em; }
.hb-label small { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(244, 237, 228, 0.72); }
/* a spelled-out branch name (branch.label): large Thai in the restaurant's lettering, English under it,
   easy to read for everyone, older guests included */
.hb-label.named { padding: 7px 16px 8px; gap: 2px; }
.hb-label.named b { font-family: var(--display, var(--sans)); font-size: 21px; font-weight: 700; letter-spacing: 0; margin-right: 0; line-height: 1.25; }
.hb-label.named small { font-size: 12px; letter-spacing: 0.06em; text-transform: none; color: rgba(244, 237, 228, 0.86); }
.hearth.tiny .hb-label.named b, .hearth.short .hb-label.named b { font-size: 17px; }
.hearth.tiny .hb-label.named small, .hearth.short .hb-label.named small { font-size: 11px; }
/* picked: the book turns to face you, comes forward, its cover swings open, the kitchen fades */
.hearth.in .h-book.picked {
  z-index: 5;
  opacity: 1;
  transform-origin: 50% 50%;
  transform: translate(var(--dx), var(--dy)) scale(var(--zoom));
  transition: transform 1.05s cubic-bezier(0.45, 0, 0.2, 1);
  transition-delay: 0s;
  will-change: transform;
}
.h-book.picked .hb-sway { animation: none; }
.h-book.picked .hb-body { transform: none; transition: transform 0.95s cubic-bezier(0.4, 0, 0.2, 1); }
.hearth .h-book.picked .hb-shadow, .hearth .h-book.picked .hb-cast, .hearth .h-book.picked .hb-ao, .hearth .h-book.picked .hb-label { opacity: 0; transition: opacity 0.3s; }
.h-book.opening .hb-front { transform: translateZ(calc(var(--t) / 2)) rotateY(-162deg); }
.hearth.picking .h-book:not(.picked), .hearth.picking .h-top, .hearth.picking .h-bottom { opacity: 0; transition: opacity 0.6s ease; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) { .hb-sway { animation: none; } }
.h-sparks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.hearth.picking .h-sparks { opacity: 0.5; transition: opacity 0.8s ease; }
/* a soft band of light crossing the cover now and then, like the Glass House Boho menu cover */
.hb-glint { position: absolute; inset: 0; z-index: 3; overflow: hidden; border-radius: inherit; pointer-events: none; backface-visibility: hidden; }
.hb-glint i {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 238, 214, 0.2), transparent);
  transform: translateX(-140%) skewX(-12deg);
  animation: hb-glint 6s ease-in-out infinite;
  animation-delay: calc(4.2s + var(--i) * 1.6s);
  will-change: transform;
}
@keyframes hb-glint { 0% { transform: translateX(-140%) skewX(-12deg); } 40%, 100% { transform: translateX(320%) skewX(-12deg); } }
.h-book.picked .hb-glint { display: none; }
/* a single turning page melts away as it leaves the book (and appears softly as it comes back) */
.turn.one .leaf .face { opacity: var(--leaf, 1); }
@media (prefers-reduced-motion: reduce) { .hb-glint i { animation: none; } }
/* greeting at the top, sound at the bottom */
.h-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; padding: max(24px, env(safe-area-inset-top)) 20px 0; text-align: center; pointer-events: none; }
.h-logo { width: min(44vw, 200px); filter: drop-shadow(0 2px 18px rgba(0, 0, 0, 0.6)); }
.h-hi { margin: 12px 0 0; font-family: var(--display, var(--sans)); font-size: clamp(30px, 8vw, 42px); font-weight: 700; line-height: 1.2; color: #fff3e6; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7); }
.h-sub { margin: 2px 0 0; font-size: 13.5px; color: rgba(244, 237, 228, 0.82); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.h-ask { margin: 12px 0 0; font-family: var(--display, var(--sans)); font-size: 20px; font-weight: 500; color: var(--accent); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85); }
.h-bottom { position: absolute; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 2; display: flex; justify-content: center; }
.h-sound { padding: 7px 14px; border: 1px solid rgba(255, 228, 196, 0.22); border-radius: 999px; background: rgba(16, 10, 7, 0.55); color: rgba(244, 237, 228, 0.8); font-size: 12.5px; cursor: pointer; }
.h-sound::after { content: " · ปิดอยู่"; opacity: 0.7; }
.h-sound.on { border-color: var(--accent); color: var(--accent); }
.h-sound.on::after { content: " · เปิดอยู่"; }
.h-logo, .h-hi, .h-sub, .h-ask, .h-sound { opacity: 0; transform: translateY(8px); transition: opacity 1.2s ease, transform 1.2s ease; }
.h-logo { transition-delay: 0.9s; }
.h-hi { transition-delay: 1.3s; }
.h-sub { transition-delay: 1.6s; }
.h-ask { transition-delay: 3.3s; }
.h-sound { transition-delay: 3.6s; }
.hearth.in .h-logo, .hearth.in .h-hi, .hearth.in .h-sub, .hearth.in .h-ask, .hearth.in .h-sound { opacity: 1; transform: none; }
.hearth.again .h-logo, .hearth.again .h-hi, .hearth.again .h-sub, .hearth.again .h-ask, .hearth.again .h-sound { transition-delay: 0.1s; transition-duration: 0.6s; }
@media (prefers-reduced-motion: reduce) {
  .h-smoke, .h-veil::after { display: none; }
  .hearth, .hearth * { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}
body[data-feel="hearth"] .brand-name { font-family: var(--display, var(--sans)); text-transform: none; letter-spacing: 0; font-size: 19px; font-weight: 700; }
/* "skip the story" while on the pages before the food */
.skip-story {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bot) + 14px + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 1px solid rgba(255, 228, 196, 0.3);
  border-radius: 999px;
  background: rgba(20, 13, 10, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.skip-story i { font-style: normal; }

/* ---------- contact panel ("see you soon") ---------- */
.visit { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.visit .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.25s; }
.visit.open .backdrop { opacity: 1; }
.v-panel {
  position: relative;
  width: min(100%, 460px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 20px max(20px, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}
.visit.open .v-panel { transform: none; }
@media (min-width: 700px) { .visit { align-items: center; } .v-panel { border-radius: 22px; } }
.v-logo { width: 130px; margin: 4px auto 6px; display: block; }
.v-panel h2 { margin: 0; font-family: var(--display, var(--sans)); font-size: 30px; font-weight: 700; }
.v-branch { margin: 2px 0 16px; color: var(--accent); }
.v-links { display: grid; gap: 8px; }
.v-link { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--chip); color: var(--fg); text-align: left; text-decoration: none; }
.v-link b { min-width: 76px; }
.v-link span { flex: 1; color: var(--muted); font-size: 13.5px; }
.v-link i { color: var(--muted); font-style: normal; }
.v-link:hover { border-color: var(--accent); }
.v-hours, .v-note { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }
.v-close { margin-top: 16px; padding: 10px 28px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; }

/* ---------- contents: local-dialect headings with their meaning, notes, little dictionary ---------- */
.sec-title.has-m { align-items: flex-end; margin-top: 24px; }
.sec-name { display: flex; flex-direction: column; gap: 1px; }
.sec-title.has-m .sec-name { font-family: var(--display, var(--sans)); font-size: 21px; font-weight: 700; letter-spacing: 0; color: var(--fg); line-height: 1.25; }
.sec-name small { font-family: var(--sans); font-size: 11.5px; font-weight: 400; letter-spacing: 0.02em; color: var(--muted); }
.toc-note { margin: 22px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.toc-visit { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--chip); text-align: left; cursor: pointer; }
.toc-visit b { font-family: var(--display, var(--sans)); font-size: 19px; color: var(--accent); }
.toc-visit span { flex: 1; color: var(--muted); font-size: 13px; }
.toc-visit i { font-style: normal; color: var(--muted); }
.words { margin: 14px 0 8px; padding: 2px 14px; border: 1px solid var(--line); border-radius: 14px; }
.words summary { padding: 12px 0; cursor: pointer; font-family: var(--display, var(--sans)); font-size: 18px; font-weight: 700; color: var(--accent); }
.words dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 14px; margin: 0 0 14px; font-size: 13.5px; }
.words dt { font-weight: 600; }
.words dd { margin: 0; color: var(--muted); }

/* ---------- dish videos (menu data: videos) ---------- */
/* the play button sitting on a dish: stays the same size when the page is zoomed */
.dish-play {
  position: absolute;
  z-index: 3;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  padding: 0;
  border: 1px solid rgba(255, 236, 214, 0.9);
  border-radius: 50%;
  background: rgba(20, 12, 8, 0.38);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #fff6ec;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transform: scale(calc(1 / var(--z, 1)));
  transition: background 0.2s;
}
/* a bigger invisible finger area around the small mark */
.dish-play::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
/* the triangle's centre of mass sits exactly on the circle's centre */
.dish-play svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: currentColor; display: block; }
.dish-play .ring { position: absolute; inset: -1px; border-radius: 50%; border: 1px solid rgba(255, 220, 180, 0.7); animation: dish-ring 3.2s ease-out infinite; pointer-events: none; }
@keyframes dish-ring { 0% { transform: scale(1); opacity: 0.8; } 60%, 100% { transform: scale(1.7); opacity: 0; } }
.dish-play:hover, .dish-play:focus-visible { background: rgba(60, 30, 16, 0.6); }
/* contents cards with a clip */
.card .thumbs { position: relative; }
.vid-badge { position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 50%; background: rgba(22, 13, 8, 0.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff3e6' d='M9.5 7.2v9.6l7.6-4.8z'/%3E%3C/svg%3E") center / 15px no-repeat; border: 1px solid rgba(255, 228, 196, 0.6); }
/* the player: sits right over the menu page the clip belongs to (placed by placeVideo in app.js) */
.vplayer { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.vp-dim { position: fixed; border-radius: 4px; background: rgba(10, 6, 4, 0.55); opacity: 0; transition: opacity 0.45s ease; }
.vplayer.open .vp-dim { opacity: 1; }
.vp-frame {
  position: fixed;
  border-radius: 12px;
  overflow: hidden;
  background: #120c09;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 228, 196, 0.18);
  pointer-events: auto;
  touch-action: none;
  opacity: 0;
  transform: scale(0.94);
  transition: transform 0.55s cubic-bezier(0.2, 0.85, 0.25, 1), opacity 0.4s ease;
  will-change: transform;
}
.vplayer.open .vp-frame { opacity: 1; transform: none; }
.vp-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #120c09; }
.vp-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 34%), linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 22%); }
.vp-title { position: absolute; left: 10px; right: 10px; bottom: 11px; color: #fff; pointer-events: none; display: flex; flex-direction: column; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
.vp-title b { font-family: var(--display, var(--sans)); font-size: calc(17px * var(--s, 1)); font-weight: 700; line-height: 1.2; }
.vp-title small { font-size: 11px; color: rgba(244, 237, 228, 0.82); margin-top: 2px; }
.vp-frame.small .vp-title small { display: none; }
.vp-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.18); }
.vp-progress i { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform 0.25s linear; }
.vp-btn { position: absolute; top: 6px; width: 30px; height: 30px; padding: 6.5px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.42); color: #fff; cursor: pointer; }
.vp-btn svg { width: 100%; height: 100%; display: block; }
.vp-close { right: 6px; }
.vp-mute { left: 6px; }
.vp-mute .i-off, .vp-mute.muted .i-on { display: none; }
.vp-mute.muted .i-off { display: block; }
/* paused / ended: a soft play mark in the middle; loading: a quiet spinner */
.vp-state { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(0, 0, 0, 0.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9.5 7.2v9.6l7.6-4.8z'/%3E%3C/svg%3E") center / 26px no-repeat; opacity: 0; transform: scale(0.8); transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
.vplayer.paused .vp-state, .vplayer.ended .vp-state { opacity: 1; transform: none; }
.vplayer.ended .vp-state { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12a8 8 0 1 0 2.3-5.6'/%3E%3Cpath d='M4 4v4h4'/%3E%3C/svg%3E"); background-size: 24px; }
.vp-fail { position: absolute; left: 12px; right: 12px; top: 50%; transform: translateY(-50%); text-align: center; color: #fff; font-size: 13px; line-height: 1.4; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.vp-fail small { font-size: 11px; color: rgba(244, 237, 228, 0.8); }
.vplayer.failed .vp-fail { opacity: 1; }
.vplayer.failed .vp-frame video { opacity: 0.3; }
.vp-frame video { transition: opacity 0.3s; }
.vplayer.failed .vp-state { opacity: 0; }
.vplayer.loading .vp-state { opacity: 1; transform: none; background: none; border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: spin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .dish-play .ring { animation: none; } }

/* ---------- ใบจด: order list (menu data: dishes) ---------- */
.obar { position: fixed; left: 0; right: 0; bottom: calc(var(--bot) + 10px + env(safe-area-inset-bottom)); z-index: 15; display: flex; justify-content: center; padding: 0 14px; pointer-events: none; animation: obar-in 0.35s var(--ease); }
.obar button { pointer-events: auto; display: flex; align-items: center; gap: 10px; width: min(100%, 420px); padding: 11px 16px; border: 1px solid rgba(255, 228, 196, 0.22); border-radius: 16px; background: rgba(32, 22, 16, 0.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--fg); font-size: 14.5px; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.obar svg { width: 21px; height: 21px; color: var(--accent); flex: none; }
.obar .ob-t { flex: 1; text-align: left; font-weight: 500; }
.obar .ob-sum { color: var(--accent); font-weight: 600; }
.obar i { font-style: normal; color: var(--muted); font-size: 20px; line-height: 1; }
@keyframes obar-in { from { transform: translateY(20px); opacity: 0; } }
body.has-order .stage { margin-bottom: 62px; }
body.has-order .toast { bottom: calc(var(--bot) + env(safe-area-inset-bottom) + 76px); }
.odlg { position: fixed; inset: 0; z-index: 55; display: flex; align-items: flex-end; justify-content: center; }
.odlg .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.25s; }
.odlg.open .backdrop { opacity: 1; }
.o-panel { position: relative; width: min(100%, 520px); max-height: 86dvh; display: flex; flex-direction: column; padding: 10px 0 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; background: var(--bg); transform: translateY(100%); transition: transform 0.32s var(--ease); box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5); }
.odlg.open .o-panel { transform: none; }
@media (min-width: 700px) { .odlg { align-items: center; } .o-panel { border-radius: 22px; border-bottom: 1px solid var(--line); } }
.o-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 0 20px; }
.o-head h2 { margin: 0; font-family: var(--display, var(--sans)); font-size: 24px; font-weight: 700; }
.o-body { overflow-y: auto; padding: 4px 20px max(18px, env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.o-hint, .o-branch { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.o-branch { color: var(--accent); margin-top: -2px; }
.o-sub { margin: 14px 0 2px; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.o-row { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 0; border-top: 1px solid var(--line); }
.o-nm { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 15px; line-height: 1.35; }
.o-nm small { font-size: 11.5px; color: var(--muted); }
.o-nm.link { cursor: pointer; }
.o-row.on .o-nm span { color: var(--accent); }
.o-pr { color: var(--muted); font-size: 14px; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.o-step { display: flex; align-items: center; gap: 8px; flex: none; }
.o-step .minus[aria-hidden="true"] { visibility: hidden; }
.o-step b { min-width: 18px; text-align: center; font-size: 15px; font-variant-numeric: tabular-nums; }
.o-q { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--chip); color: var(--fg); font-size: 19px; line-height: 1; cursor: pointer; }
.o-q.plus { border-color: rgba(217, 167, 126, 0.55); color: var(--accent); }
.o-step.has .o-q.plus { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.o-foot { position: sticky; bottom: 0; display: grid; gap: 8px; padding: 14px 0 2px; background: linear-gradient(to top, var(--bg) 78%, transparent); }
.o-main { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 16px; border: 1px solid transparent; border-radius: 14px; background: var(--accent); color: var(--bg); font-size: 15.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
.o-main.line { background: #06c755; color: #fff; }
.o-main.quiet { background: var(--chip); color: var(--fg); border: 1px solid var(--line); }
.o-main svg { width: 22px; height: 22px; }
.o-ghost { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--chip); color: var(--fg); font-size: 14px; text-decoration: none; cursor: pointer; }
.o-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; border-top: 1px solid var(--line); font-size: 15px; }
.o-total b { font-size: 19px; color: var(--accent); }
.o-fine { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.o-note { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.o-note textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--chip); color: var(--fg); font: inherit; font-size: 15px; resize: vertical; }
.o-send { display: grid; gap: 8px; }
.o-row2 { display: flex; gap: 8px; }
.o-clear { display: block; margin: 16px auto 0; padding: 6px 12px; border: 0; background: none; color: var(--muted); font-size: 12.5px; text-decoration: underline; cursor: pointer; }
.ostaff { position: fixed; inset: 0; z-index: 70; overflow-y: auto; padding: max(28px, env(safe-area-inset-top)) 24px 32px; background: #fbf6ef; color: #1b120c; }
.ostaff h2 { margin: 0; font-family: var(--display, var(--sans)); font-size: 34px; }
.os-branch { margin: 2px 0 18px; color: #8a5a36; font-size: 16px; }
.ostaff ul { list-style: none; margin: 0; padding: 0; }
.ostaff li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.12); font-size: 22px; line-height: 1.3; }
.ostaff li b { white-space: nowrap; }
.os-note { margin: 18px 0 0; font-size: 18px; }
.os-close { margin: 26px 0 0; text-align: center; color: #8a7a6a; font-size: 13px; }

/* ---------- a phone turned sideways: short screens ---------- */
/* any short screen (a phone sideways, a flip phone's outer screen): slimmer bars so the menu keeps most of
   the height; labels under the icons go */
@media (max-height: 500px) {
  :root { --top: 44px; --bot: 52px; }
  .topbar { padding-top: calc(env(safe-area-inset-top) + 2px); padding-bottom: 2px; }
  .topbar .snd-label { display: none; }
  .brand-name { font-size: 13px; letter-spacing: 0.08em; white-space: nowrap; }
  .topbar .tabs { max-width: 400px; }
  .tool-label { height: 44px; }
  .tool-label span { display: none; }
  .pager { height: 38px; }
  body.has-order .stage { margin-bottom: 54px; }
  .obar { bottom: calc(var(--bot) + 6px + env(safe-area-inset-bottom)); }
  .obar button { padding: 8px 14px; }
}
/* the entrance sideways: the words in a column on the left, the shelf photo closer, the sound switch bottom right */
.hearth.short .h-top { right: auto; bottom: 0; width: calc((100vw - var(--scene-w, 420px)) / 2); min-width: 170px; justify-content: center; padding: 12px 10px 12px max(14px, env(safe-area-inset-left)); }
.hearth.short .h-logo { width: min(150px, 86%); }
.hearth.short .h-sub { font-size: 11.5px; }
.hearth.short .h-ask { font-size: 16px; margin-top: 10px; line-height: 1.4; }
.hearth.short .h-bottom { left: auto; right: max(14px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
.hearth.short .hb-label { top: calc(100% + 18px); }
.brand-name.fit1 { letter-spacing: 0.07em; font-size: 13px; }
.brand-name.fit2 { letter-spacing: 0.02em; font-size: 11.5px; }
.hearth.tiny .h-top { padding-top: max(10px, env(safe-area-inset-top)); }
.hearth.tiny .h-logo { width: min(34vw, 120px); }
.hearth.tiny .h-sub { display: none; }
.hearth.tiny .h-ask { font-size: 14px; margin-top: 4px; }
.hearth.tiny .hb-label { top: calc(100% + 12px); }
.hearth.tiny .hb-label b { font-size: 16px; }
.hearth.tiny .h-sound { padding: 5px 10px; font-size: 11px; }
.hearth.tiny .h-bottom { left: auto; bottom: auto; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); }

/* ---------- full screen on a phone turned sideways (body.immersive, set in app.js) ---------- */
body.immersive .app { grid-template-rows: minmax(0, 1fr); }
body.immersive .topbar, body.immersive .bottombar {
  position: fixed; left: 0; right: 0; z-index: 12;
  transition: transform 0.3s var(--ease), opacity 0.3s ease;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
body.immersive .topbar { top: 0; transform: translateY(-105%); opacity: 0; }
body.immersive .bottombar { bottom: 0; height: calc(var(--bot) + env(safe-area-inset-bottom)); transform: translateY(105%); opacity: 0; }
body.immersive.chrome .topbar, body.immersive.chrome .bottombar { transform: none; opacity: 1; }
@media (hover: none) { body.immersive .side { display: none; } } /* touch: edges and swipes turn pages; a mouse keeps its arrows */
body.immersive .toast { bottom: calc(14px + env(safe-area-inset-bottom)); }
body.immersive.chrome .toast { bottom: calc(var(--bot) + env(safe-area-inset-bottom) + 12px); }

/* the welcome questions on a phone turned sideways: everything on one screen, no scrolling */
@media (orientation: landscape) and (max-height: 500px) {
  .party-stage { padding-top: 10px; }
  .party-stage .intro-hi, .party-stage .intro-note { display: none; }
  .party-stage .intro-q h2 { margin: 0; font-size: 24px; }
  .party-stage .intro-sub { margin: 0 0 8px; font-size: 13px; }
  .party-stage .party { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .party-stage .party button { padding: 6px 10px; border-radius: 12px; }
  .party-stage .party b { font-size: 22px; }
  .party-stage .party span { font-size: 12.5px; }
  .party-stage .party small { font-size: 11px; margin-top: 1px; }
  .party-stage .open-all { margin-top: 8px; padding-top: 9px; padding-bottom: 9px; }
  .party-stage .book { max-height: calc(100dvh - 30px); }
}
/* the name still doesn't fit even tightened (set by fitBrand in app.js): the name takes its own width, so the
   tabs drop to the next row instead of squeezing it */
.topbar.stack .brand { flex: 1 0 auto; max-width: 100%; }

/* the welcome questions fit the screen without scrolling (Safari and in-app browsers leave less height) */
@media (orientation: portrait) and (max-height: 780px) {
  .party-stage .intro-note { display: none; }
  .party-stage .book { height: min(28dvh, 300px); }
  .party-stage .party button { padding: 9px 12px; }
  .party-stage .party b { font-size: 26px; }
  .party-stage .open-all { margin-top: 10px; }
}
@media (orientation: portrait) and (max-height: 600px) {
  .party-stage { padding-top: 48px; }
  .party-stage .book { height: 22dvh; }
  .party-stage .intro-hi { display: none; }
  .party-stage .intro-q h2 { font-size: 24px; margin-top: 0; }
  .party-stage .intro-sub { margin-bottom: 10px; }
}
/* a tiny screen (a flip phone's cover screen): no book picture, just the question */
@media (max-height: 460px) and (orientation: portrait) {
  .party-stage .book { display: none; }
}
/* sideways: the book beside the questions, and the three books of the welcome screen a little smaller */
@media (orientation: landscape) and (max-height: 500px) {
  .party-stage { flex-direction: row; align-items: center; justify-content: center; gap: 28px; padding-bottom: 10px; }
  .party-stage .book { height: calc(100dvh - 34px); max-height: none; }
  /* the back button stays on top of the book picture, on a solid chip so it reads over the cover */
  .party-stage .intro-back { z-index: 5; background: rgba(21, 18, 15, 0.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .party-stage .intro-q { text-align: left; }
  .hub { padding-top: 8px; }
  .hub .intro-hi, .hub .intro-note { display: none; }
  .hub .hub-name { font-size: 36px; }
  .hub .intro-sub { margin-top: -4px; }
  .hub .hub-books { max-width: 336px; margin: 0 auto; }
}

/* ---------- a page that tells you it has a clip (MENU.feel.clipCue = "alive") ---------- */
.clip-dish { position: absolute; pointer-events: none; }
.clip-steam { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
/* "แตะจานดูคลิป": a dark glass pill in a clean modern Thai sans, with a glowing coal in place of a play icon.
   It glides up into place each time its page arrives, then a slow sheen passes over it now and then.
   Sized to the page, so it reads at arm's length on a phone and stays in proportion on a big screen. */
.clip-hint {
  position: absolute; z-index: 3; overflow: hidden;
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: clamp(12.5px, calc(var(--pw, 360px) * 0.04), 21px);
  padding: 0.5em 1em 0.5em 0.75em;
  border: 1px solid rgba(255, 214, 170, 0.42); border-radius: 999px;
  background: linear-gradient(180deg, rgba(40, 24, 14, 0.72), rgba(18, 10, 6, 0.78));
  -webkit-backdrop-filter: blur(8px) saturate(1.2); backdrop-filter: blur(8px) saturate(1.2);
  box-shadow: 0 0.5em 1.4em rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 236, 214, 0.14);
  color: #fff4e8; font-family: "IBM Plex Sans Thai", var(--sans); font-weight: 600; line-height: 1; letter-spacing: 0.005em; white-space: nowrap;
  cursor: pointer; --hx: 0%;
  transform: translate(var(--hx), -50%); opacity: 0;
}
.clip-hint.c { --hx: -50%; }
.clip-hint.r { --hx: -100%; }
.clip-hint.on { animation: hint-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both; }
.clip-hint span { position: relative; padding-top: 0.06em; }
/* the sheen: a soft band of light crossing the pill every few seconds */
.clip-hint::after {
  content: ""; position: absolute; inset: -20% auto -20% 0; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 238, 214, 0.28) 45%, rgba(255, 250, 240, 0.42) 50%, rgba(255, 238, 214, 0.28) 55%, transparent);
  transform: translateX(-120%) skewX(-12deg); opacity: 0;
}
.clip-hint.on::after { animation: hint-sheen 5.5s cubic-bezier(0.45, 0, 0.25, 1) 1.6s infinite; }
@keyframes hint-in {
  from { opacity: 0; transform: translate(var(--hx), -50%) translateY(0.7em) scale(0.94); filter: blur(5px); }
  to { opacity: 1; transform: translate(var(--hx), -50%); filter: blur(0); }
}
@keyframes hint-sheen { 0% { transform: translateX(-120%) skewX(-12deg); opacity: 1; } 28%, 100% { transform: translateX(330%) skewX(-12deg); opacity: 1; } }
.clip-hint .coal {
  position: relative; width: 0.58em; height: 0.58em; flex: none; transform: rotate(45deg); border-radius: 2px;
  background: radial-gradient(circle at 50% 50%, #fff3c4 0%, #ffb347 35%, #e8572a 70%, #7a1f0c 100%);
  box-shadow: 0 0 0.35em 0.12em rgba(255, 120, 40, 0.85), 0 0 0.9em 0.3em rgba(255, 90, 20, 0.35);
  animation: coal 2.4s ease-in-out infinite;
}
@keyframes coal {
  0%, 100% { filter: brightness(0.85); box-shadow: 0 0 0.25em 0.08em rgba(255, 120, 40, 0.7), 0 0 0.7em 0.2em rgba(255, 90, 20, 0.25); }
  45% { filter: brightness(1.25); box-shadow: 0 0 0.45em 0.16em rgba(255, 140, 50, 0.95), 0 0 1.1em 0.4em rgba(255, 100, 30, 0.45); }
  70% { filter: brightness(1.05); }
}
/* Khun Kumpoy: her portrait (half length) in a slowly turning gold ring, always fully inside the page, with a
   glowing play badge on it — she is the one sign that this dish has a clip. She fades in softly when the page
   settles; the first time on a page a cream label unfurls out of the portrait — "จานนี้มีเรื่องเล่า" — and folds back. */
.clip-host {
  position: absolute; z-index: 4; right: 3%; top: 50%;
  width: clamp(52px, calc(var(--pw, 360px) * 0.17), 96px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  font-size: clamp(13px, calc(var(--pw, 360px) * 0.04), 21px);
  transform: translateY(-50%) scale(0.7); opacity: 0; filter: blur(6px);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease, filter 0.9s ease;
}
.clip-host.l { right: auto; left: 3%; }
.clip-host.in { opacity: 1; filter: none; transform: translateY(-50%) scale(0.88); }
.clip-host.in.talk { transform: translateY(-50%) scale(1); }
.clip-host .ring {
  position: absolute; inset: 0; border-radius: 50%; padding: 6%;
  background: rgba(20, 12, 8, 0.55);
  box-shadow: 0 0.5em 1.3em rgba(0, 0, 0, 0.45);
}
.clip-host .ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, #ffe2a8, #f2a65a, #c8641f, #f7c77a, #fff0cf, #e08a3c, #ffe2a8);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: host-ring 6s linear infinite;
}
@keyframes host-ring { to { transform: rotate(1turn); } }
/* a soft glow breathes behind her while she rests, so the eye finds her */
.clip-host .ring::after {
  content: ""; position: absolute; inset: -14%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 170, 90, 0.4), rgba(255, 170, 90, 0));
  animation: host-glow 3.2s ease-in-out infinite;
}
@keyframes host-glow { 0%, 100% { opacity: 0.25; transform: scale(0.92); } 50% { opacity: 0.85; transform: scale(1.06); } }
/* (the page's own picture rules hide images until they load: this one is always shown) */
.pg .clip-host img {
  position: relative; inset: auto; opacity: 1; transition: none; max-width: none; z-index: 1;
  display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 20%;
}
/* the play badge: a glowing ember disc with a cream triangle, at her lower inner side (towards the page) */
.clip-host .play {
  position: absolute; z-index: 3; left: -6%; bottom: -4%; width: 40%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffd08a, #f0873a 55%, #b8441a);
  box-shadow: 0 0 0 2px rgba(255, 244, 228, 0.9), 0 0.25em 0.7em rgba(0, 0, 0, 0.45), 0 0 0.9em rgba(255, 130, 50, 0.55);
}
.clip-host.l .play { left: auto; right: -6%; }
.clip-host .play::before {
  content: ""; width: 34%; height: 40%; margin-left: 10%; background: #fffaf2;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
/* a ripple spreads from the badge now and then: "press me" */
.clip-host .play::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 190, 120, 0.85);
  animation: play-ripple 2.8s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
@keyframes play-ripple { 0% { transform: scale(1); opacity: 0.9; } 70%, 100% { transform: scale(1.9); opacity: 0; } }
.clip-host .bubble {
  position: absolute; right: calc(100% - 0.6em); top: 50%; z-index: -1;
  padding: 0.62em 1.7em 0.62em 1em; border-radius: 999px;
  background: linear-gradient(180deg, #fffdf8, #fbefdf); color: #3b2414;
  box-shadow: 0 0.55em 1.4em rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(200, 140, 80, 0.25);
  font-family: "IBM Plex Sans Thai", var(--sans); font-weight: 600; line-height: 1.15; white-space: nowrap;
  transform: translateY(-50%); pointer-events: none;
  clip-path: inset(0 0 0 100% round 999px);
  transition: clip-path 0.55s cubic-bezier(0.6, 0, 0.4, 1);
}
.clip-host .bubble span { display: inline-block; opacity: 0; transform: translateX(0.5em); filter: blur(3px); transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease; }
.clip-host.l .bubble { right: auto; left: calc(100% - 0.6em); padding: 0.62em 1em 0.62em 1.7em; clip-path: inset(0 100% 0 0 round 999px); }
.clip-host.l .bubble span { transform: translateX(-0.5em); }
.clip-host.in.talk .bubble { clip-path: inset(0 0 0 0 round 999px); transition: clip-path 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.55s; pointer-events: auto; }
.clip-host.in.talk .bubble span { opacity: 1; transform: none; filter: none; transition: opacity 0.6s ease 0.95s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.95s, filter 0.6s ease 0.95s; }
@media (prefers-reduced-motion: reduce) {
  .clip-hint, .clip-hint .coal, .clip-hint::after, .clip-host .ring::before, .clip-host .ring::after, .clip-host .play::after { animation: none; }
  .clip-hint { opacity: 1; }
}
