@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/cg-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/cg-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/cg-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/cg-400-italic.woff2") format("woff2"); }

:root {
  --paper: #f7f0e4;
  --card: #fcf8f0;
  --ink: #26211c;
  --ink-soft: #6b6358;
  --cinnabar: #a92618;
  --cinnabar-dark: #8a1d12;
  --gold: #b8995a;
  --gold-text: #8f7038;
  --gold-soft: #d3bd8f;
  --line: #e4d6b8;
  --field: #b9ad97;
  --top: 56px;
  --tab: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  --cjk: "Songti TC", "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", "PingFang HK", "PingFang TC", "Microsoft JhengHei", "PMingLiU", serif;
  --serif: "Cormorant Garamond", Garamond, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, var(--cjk);
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body {
  min-height: 100vh; min-height: 100svh;
  padding-top: var(--top);
  padding-bottom: calc(var(--tab) + var(--safe-b));
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42  0 0 0 0 .33  0 0 0 0 .2  0 0 0 .2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  -webkit-tap-highlight-color: transparent;
}
html[lang="zh-Hant"] body { font-size: 1.1rem; }
[hidden] { display: none !important; }
a { color: var(--cinnabar); }
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }
.caps { text-transform: uppercase; letter-spacing: .28em; padding-left: .28em; }
html[lang="zh-Hant"] .caps { letter-spacing: .2em; padding-left: .2em; }
.zh { font-family: var(--cjk); }

/* ================= top bar ================= */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 30; height: var(--top);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  background: rgba(247, 240, 228, .9);
  -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid rgba(184, 153, 90, .35);
  view-transition-name: topbar;
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand img { width: 30px; height: 30px; }
.brand-name { font-size: 1.3rem; font-weight: 500; letter-spacing: .06em; }
.brand-name i { color: var(--cinnabar); font-weight: 400; padding: 0 .15em; }
.toplinks { display: none; }
.lang { display: flex; align-items: center; gap: .1rem; font-size: 1rem; color: var(--ink-soft); }
.lang button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: .3rem .45rem; min-height: 44px; min-width: 40px; border-radius: 4px; letter-spacing: .06em; }
.lang button[aria-pressed="true"] { color: var(--cinnabar); font-weight: 600; }

/* ================= bottom tab bar (phones) ================= */
.tabbar {
  position: fixed; inset: auto 0 0; z-index: 30;
  height: calc(var(--tab) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(var(--n, 4), 1fr);
  background: rgba(252, 248, 240, .94);
  -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px);
  border-top: 1px solid rgba(184, 153, 90, .45);
  view-transition-name: tabbar;
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-soft); text-decoration: none; font-size: .9rem; font-weight: 600; letter-spacing: .02em; line-height: 1.1;
}
html[lang="zh-Hant"] .tabbar a { font-size: .8rem; font-family: var(--cjk); font-weight: 500; }
.tabbar svg { width: 25px; height: 25px; }
.tabbar a[aria-current="page"] { color: var(--cinnabar); }
.tabbar a[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 50%; width: 26px; height: 2px; margin-left: -13px; background: var(--cinnabar); border-radius: 0 0 2px 2px;
}
.tabbar a:active { background: rgba(169, 38, 24, .05); }

@media (min-width: 820px) {
  :root { --top: 64px; }
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topbar { padding: 0 2rem; }
  .toplinks { display: flex; gap: .3rem; margin-left: auto; }
  .toplinks a {
    position: relative; color: var(--ink); text-decoration: none; font-size: 1.05rem; font-weight: 500;
    letter-spacing: .2em; text-transform: uppercase; padding: .6rem .9rem;
  }
  html[lang="zh-Hant"] .toplinks a { letter-spacing: .15em; font-family: var(--cjk); font-size: 1rem; }
  .toplinks a:hover { color: var(--cinnabar); }
  .toplinks a[aria-current="page"] { color: var(--cinnabar); }
  .toplinks a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: .2rem; width: 5px; height: 5px; margin-left: -2.5px; background: var(--cinnabar); transform: rotate(45deg); }
  .lang { margin-left: 1rem; padding-left: 1rem; border-left: 1px solid var(--gold-soft); }
}

/* ================= shared page parts ================= */
.wrap { max-width: 36rem; margin: 0 auto; padding: 0 var(--gutter) 2.5rem; }
.page-head { text-align: center; padding: 1.8rem 0 1.4rem; }
.eyebrow { font-size: .85rem; font-weight: 600; color: var(--gold-text); }
.page-head h1 { font-weight: 500; font-size: clamp(2.2rem, 9vw, 3rem); line-height: 1.1; margin-top: .3rem; }
html[lang="zh-Hant"] .page-head h1 { font-family: var(--cjk); font-weight: 600; letter-spacing: .1em; font-size: clamp(1.9rem, 8vw, 2.5rem); }
.ornament { display: flex; align-items: center; justify-content: center; gap: .7rem; margin-top: .9rem; }
.ornament span { width: 48px; height: 1px; background: var(--gold-soft); }
.ornament svg { width: 16px; height: 16px; }
.lede { text-align: center; color: var(--ink-soft); margin-top: .7rem; font-style: italic; }
html[lang="zh-Hant"] .lede { font-style: normal; }

.card {
  position: relative; background: var(--card); border: 1px solid var(--gold-soft); border-radius: 10px;
  padding: 1.15rem 1.2rem 1.25rem; margin-top: .85rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 6px 18px -14px rgba(80, 55, 20, .45);
}
.card::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(211, 189, 143, .45); border-radius: 7px; pointer-events: none; }
.label { display: block; font-size: .8rem; font-weight: 600; color: var(--gold-text); margin-bottom: .3rem; }
.big { font-size: 1.45rem; font-weight: 500; line-height: 1.25; }
html[lang="zh-Hant"] .big { font-size: 1.3rem; }
.soft { color: var(--ink-soft); }
.card p + p { margin-top: .35rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: 1.05rem; letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  padding: .7rem 1.4rem; min-height: 50px; border-radius: 4px; cursor: pointer;
  color: #fff; background: var(--cinnabar); border: 1px solid var(--cinnabar);
  transition: background-color .15s, transform .1s;
}
.btn:hover { background: var(--cinnabar-dark); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn.ghost { color: var(--cinnabar); background: transparent; }
.btn.ghost:hover { background: rgba(169, 38, 24, .06); }
.btn.quiet { color: var(--ink); background: #fff; border-color: var(--field); letter-spacing: .04em; text-transform: none; font-size: 1.1rem; font-weight: 500; }
.btn.quiet:hover { border-color: var(--ink-soft); background: #fff; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.block { display: flex; width: 100%; }
html[lang="zh-Hant"] .btn { letter-spacing: .25em; font-family: var(--cjk); font-weight: 500; }
html[lang="zh-Hant"] .btn.quiet { letter-spacing: .05em; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; }
.btn-row .wide { grid-column: 1 / -1; }
.linkbtn { font: inherit; color: var(--cinnabar); background: none; border: 0; padding: .4rem 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

footer.foot { text-align: center; color: var(--ink-soft); font-size: 1rem; padding: 2rem 0 .5rem; }

.stagger > * { animation: rise .55s cubic-bezier(.2, .7, .3, 1) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; }
.stagger > *:nth-child(n+6) { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================= home ================= */
.hero {
  position: relative; display: grid; place-items: center; text-align: center;
  min-height: calc(100svh - var(--top) - var(--tab) - var(--safe-b));
  padding: 2.2rem calc(var(--gutter) + 1.2rem);
}
@media (min-width: 820px) { .hero { min-height: calc(100svh - var(--top)); } }
.frame { position: absolute; inset: 10px; --r: 18px; pointer-events: none; }
.frame.inner { inset: 17px; --r: 12px; opacity: .55; }
@media (min-width: 820px) { .frame { inset: 22px; --r: 26px; } .frame.inner { inset: 29px; --r: 18px; } }
.frame .line {
  position: absolute; inset: 0; border: 1px solid var(--gold);
  -webkit-mask-image:
    radial-gradient(circle at 0 0, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px)),
    radial-gradient(circle at 100% 0, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px)),
    radial-gradient(circle at 0 100%, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px)),
    radial-gradient(circle at 100% 100%, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px));
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(circle at 0 0, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px)),
    radial-gradient(circle at 100% 0, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px)),
    radial-gradient(circle at 0 100%, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px)),
    radial-gradient(circle at 100% 100%, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px));
  mask-composite: intersect;
}
.frame .c { position: absolute; width: var(--r); height: var(--r); border: 0 solid var(--gold); }
.frame .tl { top: 0; left: 0; border-width: 0 1px 1px 0; border-bottom-right-radius: var(--r); }
.frame .tr { top: 0; right: 0; border-width: 0 0 1px 1px; border-bottom-left-radius: var(--r); }
.frame .bl { bottom: 0; left: 0; border-width: 1px 1px 0 0; border-top-right-radius: var(--r); }
.frame .br { bottom: 0; right: 0; border-width: 1px 0 0 1px; border-top-left-radius: var(--r); }

.hero-card { position: relative; width: 100%; max-width: 44rem; }
.seal { display: block; width: clamp(78px, 22vw, 140px); height: auto; margin: 0 auto clamp(1.1rem, 4vh, 2.4rem); }
.hero h1 { font-weight: 500; font-size: clamp(2.5rem, 11vw, 4.7rem); line-height: 1.08; letter-spacing: .01em; }
.hero h1 .amp { color: var(--cinnabar); font-style: italic; font-weight: 400; padding: 0 .1em; }
.hero h1 .nb { white-space: nowrap; }
.zh-names { margin-top: .6rem; font-family: var(--cjk); font-size: clamp(1.05rem, 4.4vw, 1.5rem); letter-spacing: .4em; padding-left: .4em; color: var(--gold-text); }
.rule { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: clamp(1.1rem, 3.5vh, 2.4rem) auto; }
.rule span { display: block; height: 1px; width: clamp(48px, 16vw, 140px); background: var(--gold-soft); }
.rule svg { width: 24px; height: 24px; flex: none; }
.hero .date { font-weight: 600; font-size: clamp(1.05rem, 4.6vw, 1.6rem); }
html[lang="zh-Hant"] .hero .date { font-family: var(--cjk); font-weight: 500; letter-spacing: .12em; padding-left: .12em; }
.hero .hero-place { margin-top: .45rem; font-weight: 500; font-size: clamp(.85rem, 3.4vw, 1.05rem); color: var(--ink-soft); }
.countdown { margin-top: .9rem; font-style: italic; color: var(--gold-text); font-size: 1.15rem; min-height: 1.5em; }
html[lang="zh-Hant"] .countdown { font-style: normal; font-family: var(--cjk); font-size: 1.02rem; letter-spacing: .1em; }
.cta { margin-top: clamp(1.3rem, 4vh, 2.6rem); min-height: 6.3rem; display: flex; flex-direction: column; align-items: center; gap: .7rem; }
.cta .btn { min-width: 12rem; }
.cta p { font-style: italic; color: var(--ink-soft); font-size: 1.08rem; }
html[lang="zh-Hant"] .cta p { font-style: normal; font-size: 1rem; }
.cta .done-chip { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); font-size: 1.15rem; }
.cta .done-chip svg { width: 20px; height: 20px; color: var(--cinnabar); }
.hero-card > * { animation: rise .8s cubic-bezier(.2, .7, .3, 1) both; }
.hero-card > *:nth-child(2) { animation-delay: .08s; }
.hero-card > *:nth-child(3) { animation-delay: .14s; }
.hero-card > *:nth-child(n+4) { animation-delay: .22s; }
@media (max-height: 620px) { .seal { display: none; } }

/* ================= wedding day ================= */
.timeline { list-style: none; margin-top: .2rem; }
.timeline li { display: flex; align-items: baseline; gap: 1rem; padding: .35rem 0; }
.timeline li + li { border-top: 1px dashed var(--line); }
.timeline .time { min-width: 5.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
html[lang="zh-Hant"] .timeline .time { font-family: var(--cjk); font-weight: 500; min-width: 6rem; }

dialog.taxi {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: var(--card); color: var(--ink);
}
dialog.taxi[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1.2rem; animation: rise .25s both; }
dialog.taxi::backdrop { background: rgba(38, 33, 28, .5); }
.taxi .ask { font-family: var(--cjk); font-size: 1.4rem; color: var(--ink-soft); letter-spacing: .2em; }
.taxi .addr { font-family: var(--cjk); font-weight: 700; font-size: clamp(2.1rem, 10vw, 3.6rem); line-height: 1.35; letter-spacing: .06em; }
.taxi .name { font-family: var(--cjk); font-weight: 700; font-size: clamp(2.4rem, 12vw, 4rem); color: var(--cinnabar); letter-spacing: .15em; }
.taxi .en { color: var(--ink-soft); font-size: 1.15rem; }
.taxi .btn { margin-top: 1rem; min-width: 10rem; }

/* ================= RSVP ================= */
.progress { margin: 0 auto .4rem; text-align: center; }
.progress ol { list-style: none; display: flex; justify-content: center; gap: .45rem; }
.progress li { width: 8px; height: 8px; transform: rotate(45deg); border: 1px solid var(--gold); transition: background-color .2s; }
.progress li.done { background: var(--gold-soft); }
.progress li.now { background: var(--cinnabar); border-color: var(--cinnabar); }
.progress p { margin-top: .5rem; font-size: .95rem; color: var(--ink-soft); }

.step { animation: rise .35s cubic-bezier(.2, .7, .3, 1) both; }
.step h2 { font-weight: 500; font-size: 1.75rem; line-height: 1.2; text-align: center; outline: none; }
html[lang="zh-Hant"] .step h2 { font-family: var(--cjk); font-size: 1.45rem; letter-spacing: .06em; }
.step .hint { text-align: center; color: var(--ink-soft); margin-top: .35rem; font-size: 1.05rem; }
.step .card:first-of-type { margin-top: 1.1rem; }

.big-choice { display: grid; gap: .7rem; margin-top: 1.2rem; }
.big-choice label {
  display: flex; align-items: center; gap: .9rem; padding: 1.05rem 1.1rem; min-height: 68px; cursor: pointer;
  background: var(--card); border: 1px solid var(--gold-soft); border-radius: 10px; font-size: 1.35rem; font-weight: 500;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
html[lang="zh-Hant"] .big-choice label { font-family: var(--cjk); font-size: 1.2rem; letter-spacing: .1em; }
.big-choice input { position: absolute; opacity: 0; pointer-events: none; }
.big-choice .mark { flex: none; width: 26px; height: 26px; border: 1px solid var(--field); border-radius: 50%; display: grid; place-items: center; background: #fff; }
.big-choice .mark::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--cinnabar); transform: scale(0); transition: transform .15s; }
.big-choice label:has(input:checked) { border-color: var(--cinnabar); box-shadow: inset 0 0 0 1px var(--cinnabar); background: #fffaf6; }
.big-choice label:has(input:checked) .mark { border-color: var(--cinnabar); }
.big-choice label:has(input:checked) .mark::after { transform: scale(1); }
.big-choice label:has(input:focus-visible) { outline: 2px solid var(--cinnabar); outline-offset: 2px; }

.field { margin-top: 1.1rem; }
.field:first-child { margin-top: 0; }
.field > label, .field > .label-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-weight: 600; font-size: 1.12rem; margin-bottom: .4rem; }
.field .opt-tag { font-weight: 400; font-style: italic; color: var(--ink-soft); font-size: 1rem; }
input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%; font: inherit; font-size: max(16px, 1.15rem); color: var(--ink);
  background: #fff; border: 1px solid var(--field); border-radius: 6px; padding: .7rem .8rem; min-height: 50px;
  -webkit-appearance: none; appearance: none;
}
textarea { min-height: 6.5rem; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 1px; border-color: var(--cinnabar); }
::placeholder { color: #a99f8f; }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.stepper .label { margin: 0; font-size: 1.1rem; color: var(--ink); text-transform: none; letter-spacing: 0; padding: 0; font-weight: 600; }
.stepper .ctrl { display: flex; align-items: center; gap: .3rem; }
.stepper button {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--field); background: #fff; color: var(--ink);
  font: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 2.2rem; text-align: center; font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.guest-name + .guest-name { margin-top: .9rem; }
.guest-name label { font-size: .85rem !important; color: var(--gold-text); text-transform: uppercase; letter-spacing: .2em; }

.meal-group + .meal-group { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px dashed var(--gold-soft); }
.meal-group legend { font-weight: 600; font-size: 1.15rem; margin-bottom: .55rem; }
.meals { display: grid; gap: .5rem; }
.meal {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; align-items: start; cursor: pointer;
  padding: .7rem .85rem; min-height: 56px; background: #fff; border: 1px solid var(--field); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.meal input { position: absolute; opacity: 0; pointer-events: none; }
.meal .mark { grid-row: span 2; margin-top: .3rem; width: 20px; height: 20px; border: 1px solid var(--field); border-radius: 50%; display: grid; place-items: center; }
.meal .mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cinnabar); transform: scale(0); transition: transform .15s; }
.meal b { font-weight: 600; font-size: 1.15rem; line-height: 1.3; }
.meal small { color: var(--ink-soft); font-size: .98rem; line-height: 1.3; }
.meal:has(input:checked) { border-color: var(--cinnabar); box-shadow: inset 0 0 0 1px var(--cinnabar); background: #fffaf6; }
.meal:has(input:checked) .mark { border-color: var(--cinnabar); }
.meal:has(input:checked) .mark::after { transform: scale(1); }
.meal:has(input:focus-visible) { outline: 2px solid var(--cinnabar); outline-offset: 2px; }

.seg { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--field); border-radius: 999px; padding: 3px; background: #fff; margin-bottom: .7rem; }
.seg button { font: inherit; font-size: 1.05rem; border: 0; background: none; border-radius: 999px; padding: .35rem 1.2rem; min-height: 40px; cursor: pointer; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--cinnabar); color: #fff; font-weight: 600; }

.review { list-style: none; }
.review li { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .65rem 0; }
.review li + li { border-top: 1px solid var(--line); }
.review .k { font-size: .8rem; font-weight: 600; color: var(--gold-text); text-transform: uppercase; letter-spacing: .2em; }
.review .v { font-size: 1.15rem; overflow-wrap: anywhere; }
.review .v small { display: block; color: var(--ink-soft); font-size: 1rem; }
.review .linkbtn { flex: none; min-height: 36px; padding: 0; font-size: 1rem; }

.actionbar {
  position: sticky; bottom: calc(var(--tab) + var(--safe-b)); z-index: 10;
  display: flex; gap: .6rem; margin: 1.4rem calc(var(--gutter) * -1) 0; padding: .7rem var(--gutter);
  background: linear-gradient(to top, var(--paper) 70%, rgba(247, 240, 228, 0));
}
.actionbar .btn { flex: 1; }
.actionbar .btn.ghost { flex: 0 0 auto; padding: .7rem 1rem; letter-spacing: .08em; }
@media (min-width: 820px) { .actionbar { bottom: 0; } }

.msg { margin-top: 1rem; padding: .75rem .95rem; border-radius: 6px; font-size: 1.05rem; }
.msg.err { background: #fbeae7; border: 1px solid #e2b1aa; color: #7c1c12; }
.msg.info { background: #f4ecd9; border: 1px solid var(--gold-soft); text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lookup { margin-top: 1.4rem; text-align: center; }
.lookup form { margin-top: .6rem; text-align: left; }
.lookup .row { display: flex; gap: .5rem; }
.lookup .row input { flex: 1; min-width: 0; }
.lookup .row .btn { letter-spacing: .08em; padding: .6rem 1.1rem; }
.lookup label { display: block; font-weight: 600; margin-bottom: .4rem; }

.done { text-align: center; }
.done .seal-sm { width: 64px; margin: .4rem auto .6rem; display: block; }
.done h2 { font-size: 2rem; }
.done .review { text-align: left; margin-top: 1rem; }
.done .btn { margin-top: 1.2rem; }
.editlink { margin-top: 1.4rem; font-size: 1rem; color: var(--ink-soft); }
.editlink code { display: block; margin: .6rem 0 .2rem; padding: .55rem .6rem; background: #fff; border: 1px solid #d9cfba; border-radius: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; color: var(--ink); overflow-wrap: anywhere; }

/* ================= race night ================= */
.race-hero { text-align: center; }
.race-hero .big { font-size: 1.6rem; }
.tips { list-style: none; counter-reset: tip; }
.tips li { counter-increment: tip; display: grid; grid-template-columns: 2rem 1fr; gap: .2rem .6rem; padding: .55rem 0; }
.tips li + li { border-top: 1px dashed var(--line); }
.tips li::before { content: counter(tip); grid-row: span 2; width: 1.7rem; height: 1.7rem; border-radius: 4px; background: var(--cinnabar); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 1rem; margin-top: .15rem; }
.tips b { font-weight: 600; }
.tips span { color: var(--ink-soft); }
.tbc { color: var(--cinnabar); font-style: italic; }

/* ================= Hong Kong ================= */
body[data-page="hk"] .wrap { max-width: 72rem; }
.hk { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.map-wrap {
  position: sticky; top: var(--top); z-index: 5; margin: 0 calc(var(--gutter) * -1);
  background: var(--paper); border-bottom: 1px solid var(--gold-soft);
}
#map { height: 36svh; min-height: 220px; background: #efe6d4; }
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: .6rem var(--gutter); scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; font: inherit; font-size: 1.02rem; font-weight: 500; padding: .3rem 1rem; min-height: 40px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--field); background: #fff; color: var(--ink); scroll-snap-align: start;
}
html[lang="zh-Hant"] .chips button { font-family: var(--cjk); font-size: .95rem; }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.places { list-style: none; padding-top: .4rem; }
.place {
  display: grid; grid-template-columns: 2rem 1fr; gap: 0 .8rem; padding: 1rem .2rem; cursor: pointer;
  border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top) + 36svh + 70px); transition: background-color .2s;
}
.place.active { background: rgba(169, 38, 24, .045); }
.place .num { width: 1.8rem; height: 1.8rem; border-radius: 5px; background: var(--cinnabar); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 1rem; margin-top: .2rem; }
.place.ours .num { background: var(--gold-text); }
.place h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.25; }
html[lang="zh-Hant"] .place h3 { font-family: var(--cjk); font-size: 1.15rem; }
.place .area { font-size: .78rem; font-weight: 600; color: var(--gold-text); text-transform: uppercase; letter-spacing: .2em; margin-top: .1rem; }
.place p { color: var(--ink-soft); margin-top: .25rem; line-height: 1.4; }
.place .go { display: inline-flex; align-items: center; gap: .3rem; margin-top: .35rem; font-size: 1.02rem; min-height: 40px; text-underline-offset: 3px; }
.place .tag { display: inline-block; margin-left: .45rem; padding: 0 .4rem; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); border: 1px dashed var(--field); border-radius: 3px; vertical-align: .2em; }
.practical { margin-top: 1.6rem; }
.practical h2 { font-weight: 500; font-size: 1.7rem; text-align: center; }
html[lang="zh-Hant"] .practical h2 { font-family: var(--cjk); font-size: 1.4rem; letter-spacing: .1em; }
.practical .card h3 { font-size: 1.2rem; font-weight: 600; }
.practical .card p { color: var(--ink-soft); margin-top: .2rem; }

.pin {
  width: 28px; height: 28px; border-radius: 6px; background: var(--cinnabar); color: #fff; display: grid; place-items: center;
  font: 600 15px/1 var(--serif); box-shadow: 0 0 0 2px var(--card), 0 3px 8px rgba(40, 20, 10, .35); transition: transform .15s;
}
.pin.ours { background: var(--gold-text); }
.pin.active { transform: scale(1.25); }
.leaflet-tile-pane { filter: grayscale(.85) sepia(.35) brightness(1.04) contrast(.9); }
.leaflet-container { font-family: var(--serif); }
.leaflet-popup-content-wrapper { border-radius: 8px; background: var(--card); }
.leaflet-popup-content { margin: .6rem .9rem; font-size: 1.05rem; }
.leaflet-popup-tip { background: var(--card); }
.leaflet-control-attribution { font-size: 10px !important; }

@media (min-width: 900px) {
  .hk { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2rem; align-items: start; }
  .hk .page-head { grid-column: 1 / -1; }
  .map-wrap { order: 2; margin: 0; top: calc(var(--top) + 1rem); border: 1px solid var(--gold-soft); border-radius: 10px; overflow: hidden; }
  #map { height: calc(100svh - var(--top) - 5.5rem); }
  .place { scroll-margin-top: calc(var(--top) + 1rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}

/* a solid button whose label reads as words rather than small caps */
.btn.plain { text-transform: none; letter-spacing: .03em; font-size: 1.2rem; }
html[lang="zh-Hant"] .btn.plain { letter-spacing: .1em; font-size: 1.1rem; }

/* ================= race-night invitation card (invited households only) ================= */
.invite {
  position: relative; display: grid; gap: .15rem; justify-items: center; text-align: center; text-decoration: none; color: var(--ink);
  width: 100%; max-width: 22rem; margin: 1.1rem auto 0; padding: .95rem 1rem 1rem;
  background: #fffaf3; border: 1px solid var(--cinnabar); border-radius: 10px;
  box-shadow: 0 8px 20px -16px rgba(169, 38, 24, .6);
}
.invite::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(169, 38, 24, .25); border-radius: 7px; pointer-events: none; }
.invite-k { font-size: .75rem; font-weight: 600; color: var(--cinnabar); }
.invite-t { font-size: 1.3rem; font-weight: 600; line-height: 1.25; }
html[lang="zh-Hant"] .invite-t { font-family: var(--cjk); font-size: 1.15rem; letter-spacing: .08em; }
.invite-s { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.35; }
.invite-go { margin-top: .25rem; color: var(--cinnabar); font-weight: 600; font-size: 1.02rem; }
.invite:active { transform: scale(.99); }
.done .invite { margin-top: 1.2rem; }
.cta .invite { margin-top: .3rem; }
.invite.compact { display: flex; align-items: center; justify-content: center; gap: .6rem; max-width: 20rem; padding: .6rem 1rem; min-height: 48px; }
.invite.compact .invite-t { font-size: 1.12rem; }
.invite.compact .invite-go { margin: 0; }

/* extra guests' own contact, inside the guest-name card */
.guest-name .field.sub { margin-top: .7rem; }
.guest-name .field.sub > label { font-size: 1.02rem !important; color: var(--ink) !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 500; }
