:root {
  color-scheme: light;
  --brand-navy: #17317f;
  --brand-blue: #209eda;
  --anniversary-red: #e01520;
  --warm-ivory: #f5efe8;
  --warm-white: #fffdf9;
  --soft-gold: #c99b69;
  --ink: #10265f;
  --aperture-w: min(100vw, 56.25vh);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #10172a;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  color: var(--warm-white);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button {
  font: inherit;
}

#kiosk {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

#aperture {
  position: relative;
  width: var(--aperture-w);
  height: 100vh;
  max-width: 100vw;
  /* `hidden` still creates a programmatically scrollable container. Pointer
     bring-into-view moved this aperture by 8.5px on START and reset it on the
     first answer. `clip` preserves the physical mask without scroll state. */
  overflow: clip;
  isolation: isolate;
  background: #bcdaf0;
}

body[data-occlusion="1"] #aperture {
  border-radius: 42% / 14%;
}

#media-stage,
.story-video,
.story-image,
#cloud-bridge,
#cloud-bridge video,
#film-grade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story-video,
.story-image,
#cloud-bridge video {
  object-fit: cover;
  object-position: center center;
}

.story-video,
.story-image {
  z-index: 1;
  visibility: hidden;
}

.story-video.is-active,
.story-image.is-active {
  visibility: visible;
}

.story-image {
  transform: scale(1.018) translate3d(0, 0, 0);
  transform-origin: 50% 52%;
  will-change: transform;
}

.story-image.is-active {
  animation: destination-drift 9s cubic-bezier(.2,.05,.25,1) alternate infinite;
}

@keyframes destination-drift {
  from { transform: scale(1.018) translate3d(0, 0, 0); }
  to { transform: scale(1.055) translate3d(-0.6%, -0.45%, 0); }
}

#cloud-bridge {
  z-index: 4;
  display: none;
  pointer-events: none;
  overflow: hidden;
}

#cloud-bridge.is-transitioning {
  display: block;
}

#cloud-bridge video {
  will-change: transform;
  opacity: 1;
}

#cloud-bank-top {
  -webkit-mask-image: linear-gradient(to bottom,
    #000 0%, #000 49%, rgba(0, 0, 0, 0.98) 53%,
    rgba(0, 0, 0, 0.76) 57%, rgba(0, 0, 0, 0.34) 62%, transparent 68%);
  mask-image: linear-gradient(to bottom,
    #000 0%, #000 49%, rgba(0, 0, 0, 0.98) 53%,
    rgba(0, 0, 0, 0.76) 57%, rgba(0, 0, 0, 0.34) 62%, transparent 68%);
  transform: translateY(-112%);
}

#cloud-bank-bottom {
  -webkit-mask-image: linear-gradient(to top,
    #000 0%, #000 49%, rgba(0, 0, 0, 0.98) 53%,
    rgba(0, 0, 0, 0.76) 57%, rgba(0, 0, 0, 0.34) 62%, transparent 68%);
  mask-image: linear-gradient(to top,
    #000 0%, #000 49%, rgba(0, 0, 0, 0.98) 53%,
    rgba(0, 0, 0, 0.76) 57%, rgba(0, 0, 0, 0.34) 62%, transparent 68%);
  transform: translateY(112%);
}

#film-grade {
  z-index: 5;
  pointer-events: none;
  background: rgba(13, 60, 116, 0.06);
  box-shadow: inset 0 0 140px rgba(255, 252, 241, 0.12);
}

#standby-mascot {
  position: absolute;
  z-index: 3;
  right: 12%;
  bottom: 0;
  width: 46%;
  aspect-ratio: 1086 / 1448;
  visibility: hidden;
  transform-origin: 72% 96%;
  pointer-events: none;
  filter: saturate(0.86) contrast(0.94) brightness(1.02) drop-shadow(0 12px 22px rgba(13, 42, 83, 0.14));
}

#standby-mascot > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}

#standby-mascot[data-market="AU"] #standby-mascot-body {
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

#standby-mascot[data-market="AU"] #standby-mascot-head {
  display: block;
  clip-path: polygon(36% 18%, 88% 18%, 91% 67%, 41% 67%, 41% 48%);
  transform-origin: 64% 58%;
}

#standby-mascot[data-market="NZ"] #standby-mascot-body {
  clip-path: none;
}

#standby-mascot[data-market="NZ"] #standby-mascot-head {
  display: none;
}

#standby-mascot.is-visible {
  visibility: visible;
  animation: mascot-shell-breathe 8s ease-in-out infinite alternate;
}

#standby-mascot.is-visible[data-market="AU"] #standby-mascot-head {
  animation: mascot-head-turn 6.4s cubic-bezier(.45,.05,.32,1) infinite alternate;
}

#standby-mascot.is-departing {
  visibility: visible;
  animation: mascot-cloud-exit 900ms cubic-bezier(.46,.02,.62,1) both;
}

#standby-mascot.is-departing[data-market="AU"] #standby-mascot-head {
  animation: mascot-head-ack 360ms cubic-bezier(.24,.72,.28,1) both;
}

#standby-mascot.is-entering {
  visibility: visible;
  opacity: 0;
  transform: translate3d(0, 108%, 0) rotate(0.35deg) scale(0.975);
  clip-path: inset(100% 0 0 0 round 42%);
}

body[data-standby-entrance="staged"] #brand-lockup,
body[data-standby-entrance="staged"] #standby-screen .standby-copy,
body[data-standby-entrance="staged"] #standby-screen #start-button {
  opacity: 0;
}

body[data-standby-entrance="revealing"] #brand-lockup {
  animation: standby-brand-return 620ms cubic-bezier(.22,.62,.28,1) 20ms both;
}

body[data-standby-entrance="revealing"] #standby-screen .standby-copy {
  animation: standby-copy-return 680ms cubic-bezier(.22,.62,.28,1) 40ms both;
}

body[data-standby-entrance="revealing"] #standby-screen #start-button {
  animation: standby-button-return 620ms cubic-bezier(.22,.62,.28,1) 50ms both;
}

body[data-standby-entrance="revealing"] #standby-mascot.is-entering {
  animation: standby-mascot-return 1000ms cubic-bezier(.22,.62,.28,1) both;
}

body[data-standby-entrance="revealing"] #standby-mascot.is-entering[data-market="AU"] #standby-mascot-head {
  animation: mascot-first-look 380ms cubic-bezier(.22,.7,.26,1) 600ms both;
}

@keyframes standby-brand-return {
  from { opacity: 0; transform: translate(-50%, -12px); clip-path: inset(0 14% 38% round 22%); }
  to { opacity: 1; transform: translate(-50%, 0); clip-path: inset(0 0 0 round 0); }
}

@keyframes standby-copy-return {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.985); clip-path: inset(0 7% 44% round 28px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); clip-path: inset(0 0 0 round 28px); }
}

@keyframes standby-button-return {
  from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.97); clip-path: inset(0 12% 48% round 999px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); clip-path: inset(0 0 0 round 999px); }
}

@keyframes standby-mascot-return {
  from { opacity: 0; transform: translate3d(0, 108%, 0) rotate(0.35deg) scale(0.975); clip-path: inset(100% 0 0 0 round 42%); }
  48% { opacity: 0.78; clip-path: inset(44% 0 0 0 round 34%); }
  to { opacity: 1; transform: translate3d(0, 0, 0) rotate(-0.2deg) scale(0.997); clip-path: inset(0 0 0 0 round 22%); }
}

@keyframes mascot-shell-breathe {
  from { transform: translate3d(0, 0, 0) rotate(-0.25deg) scale(0.997); }
  to { transform: translate3d(0, -3px, 0) rotate(0.28deg) scale(1.006); }
}

@keyframes mascot-first-look {
  from { transform: rotate(-0.35deg); }
  62% { transform: rotate(4.35deg); }
  to { transform: rotate(2deg); }
}

@keyframes mascot-head-turn {
  from { transform: rotate(2deg); }
  to { transform: rotate(-2.35deg); }
}

@keyframes mascot-head-ack {
  from { transform: rotate(0deg); }
  to { transform: rotate(4.4deg); }
}

@keyframes mascot-cloud-exit {
  from { transform: translate3d(0, 0, 0) scale(1); clip-path: inset(0 0 0 0 round 22%); }
  45% { transform: translate3d(0, 22%, 0) scale(0.995); clip-path: inset(18% 0 0 0 round 30%); }
  to { opacity: 0; transform: translate3d(0, 118%, 0) scale(0.985); clip-path: inset(100% 0 0 0 round 48%); }
}

.critical-safe,
.touch-safe,
.card-qr-safe {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.critical-safe {
  width: var(--critical-safe-width, 50%);
}

.touch-safe {
  width: var(--touch-safe-width, 50%);
}

.card-qr-safe {
  width: var(--subject-safe-width, 64%);
}

#brand-lockup {
  z-index: 20;
  top: 15%;
  width: 64%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#brand-lockup img {
  width: 100%;
  height: auto;
  max-height: 82px;
  object-fit: contain;
  object-position: center;
}

.screen {
  z-index: 15;
  top: 18%;
  bottom: 14%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 220ms ease, transform 260ms ease;
}

.screen[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: clamp(13px, 1.4vh, 24px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--warm-white);
  text-shadow: 0 2px 14px rgba(8, 28, 72, 0.72);
}

.standby-copy {
  padding: 34px 34px 30px;
  border-radius: 28px;
  background: rgba(16, 44, 104, 0.42);
  backdrop-filter: blur(16px) saturate(0.9);
  box-shadow: 0 18px 60px rgba(8, 28, 72, 0.2);
}

h1,
h2,
p {
  margin-top: 0;
}

#standby-title {
  margin-bottom: 18px;
  max-width: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.45vh, 50px);
  line-height: 1.16;
  font-weight: 760;
  letter-spacing: 0.025em;
  text-wrap: balance;
}

#standby-title > span {
  display: block;
  white-space: nowrap;
}

#standby-origin-badge {
  display: inline-flex;
  margin: 0 auto 18px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 253, 249, 0.58);
  border-radius: 999px;
  background: rgba(16, 44, 104, 0.36);
  font-size: clamp(12px, 1.28vh, 20px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.standby-promise {
  max-width: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 1.8vh, 25px);
  letter-spacing: 0.025em;
}

.subcopy {
  max-width: 32ch;
  margin: 0 auto 9px;
  font-size: clamp(18px, 2.05vh, 30px);
  line-height: 1.42;
}

.zh {
  letter-spacing: 0.06em;
}

.primary-action,
.secondary-action {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.primary-action {
  min-width: 78%;
  min-height: 84px;
  margin-top: 38px;
  padding: 18px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  background: var(--warm-white);
  color: var(--brand-navy);
  box-shadow: 0 18px 42px rgba(5, 30, 82, 0.28);
  font-size: clamp(16px, 1.9vh, 27px);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.primary-action:focus-visible,
.answer-button:focus-visible,
.secondary-action:focus-visible {
  outline: 5px solid var(--soft-gold);
  outline-offset: 5px;
}

.primary-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.primary-action.compact {
  min-width: 58%;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  margin-top: 24px;
  box-sizing: border-box;
  flex: 0 0 72px;
}

#quiz-screen {
  top: 20%;
  bottom: 16%;
  justify-content: center;
  padding-top: 0;
}

#question-title {
  width: 100%;
  height: 3.12em;
  min-height: 3.12em;
  max-height: 3.12em;
  max-width: 100%;
  margin: 14px auto 12px;
  display: flex;
  flex: 0 0 3.12em;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.7vh, 52px);
  line-height: 1.04;
  font-weight: 500;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 3px 20px rgba(4, 31, 82, 0.7);
}

#question-title .question-line {
  display: block;
  white-space: nowrap;
}

.question-zh {
  margin: 0 auto 24px;
  font-size: clamp(17px, 1.9vh, 27px);
  text-shadow: 0 2px 16px rgba(4, 31, 82, 0.7);
}

#answer-options {
  width: 100%;
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 14px;
}

.answer-button {
  width: 100%;
  height: 82px;
  min-height: 82px;
  padding: 14px 22px;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: center;
  gap: 4px;
  border: 2px solid rgba(255, 255, 255, 0.64);
  border-radius: 22px;
  background: rgba(13, 49, 111, 0.5);
  color: var(--warm-white);
  backdrop-filter: blur(14px);
  font-size: clamp(18px, 2vh, 29px);
  line-height: 1.16;
  font-weight: 650;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.answer-button .answer-zh {
  font-size: 0.78em;
  opacity: 0.86;
  letter-spacing: 0.06em;
}

.answer-button[aria-checked="true"] {
  border-color: var(--soft-gold);
  background: var(--warm-white);
  color: var(--brand-navy);
  box-shadow: 0 12px 30px rgba(4, 31, 82, 0.26);
}

#idle-warning {
  position: absolute;
  inset: 32% 0 auto;
  padding: 28px;
  border-radius: 24px;
  background: var(--warm-ivory);
  color: var(--brand-navy);
  box-shadow: 0 18px 60px rgba(5, 30, 82, 0.35);
  font-size: clamp(20px, 2.2vh, 32px);
}

#idle-warning strong {
  display: block;
  margin-top: 10px;
  font-size: 2em;
}

#recommendation-screen {
  background: rgba(14, 50, 111, 0.42);
  backdrop-filter: blur(18px);
  border-radius: 36px;
  top: var(--critical-safe-top, 22%);
  bottom: var(--critical-safe-bottom, 22%);
  padding: 32px 28px;
  justify-content: center;
}

.recommendation-step {
  opacity: 0;
  transform: translateY(12px);
}

#recommendation-screen.is-visible .recommendation-step {
  animation: recommendation-arrive 420ms cubic-bezier(.18,.82,.22,1) both;
}

#recommendation-screen.is-visible .step-definition { animation-delay: 150ms; }
#recommendation-screen.is-visible .step-answers { animation-delay: 480ms; }
#recommendation-screen.is-visible .step-why { animation-delay: 1040ms; }

@keyframes recommendation-arrive {
  to { opacity: 1; transform: translateY(0); }
}

.recommendation-kicker > span {
  display: block;
  white-space: nowrap;
}

.recommendation-kicker > .zh {
  margin-top: 5px;
}

#recommendation-persona-en {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5.5vh, 78px);
  font-weight: 500;
  letter-spacing: 0.02em;
}

#recommendation-persona-zh {
  margin: 8px 0 0;
  color: #fff6e9;
  font-size: clamp(22px, 2.5vh, 36px);
  font-weight: 760;
}

#recommendation-definition {
  max-width: 25ch;
  margin: 14px auto 0;
  font-size: clamp(16px, 1.65vh, 24px);
  line-height: 1.45;
}

#recommendation-answers,
#recommendation-reasons {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#recommendation-answers { margin-top: 20px; }
#recommendation-reasons { margin-top: 8px; }

.answer-chip,
.reason-chip {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: clamp(13px, 1.35vh, 19px);
  font-weight: 720;
  line-height: 1.25;
}

.answer-chip {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.reason-chip {
  background: var(--warm-white);
  color: var(--brand-navy);
}

#recommendation-why {
  margin: 23px 0 0;
  color: #f4d3aa;
  font-size: clamp(13px, 1.4vh, 20px);
  font-weight: 820;
  letter-spacing: 0.11em;
}

#recommendation-city {
  margin: 13px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 4.8vh, 68px);
  font-weight: 500;
  letter-spacing: 0.04em;
}

#recommendation-route {
  margin: 12px 0 0;
  font-size: clamp(17px, 1.9vh, 28px);
  font-weight: 750;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

#stage-copy {
  z-index: 18;
  bottom: 22%;
  width: 50%;
  padding: 18px 24px 16px;
  border-radius: 22px;
  background: rgba(13, 49, 111, 0.52);
  backdrop-filter: blur(14px);
  text-align: center;
  text-shadow: 0 2px 12px rgba(4, 31, 82, 0.7);
}

#stage-copy p {
  margin: 0;
  font-size: clamp(17px, 2vh, 30px);
  font-weight: 750;
  letter-spacing: 0.08em;
}

#stage-copy .zh {
  margin-top: 5px;
  font-size: 0.82em;
  font-weight: 550;
}

#journey-meter {
  width: 100%;
  height: 4px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

#journey-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--soft-gold);
  transition: width 420ms ease;
}

#keepsake-screen {
  z-index: 22;
  top: 22%;
  bottom: 22%;
}

#booking-screen {
  z-index: 22;
  top: 22%;
  bottom: 22%;
}

#booking-panel {
  width: 100%;
  padding: 34px 30px 32px;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(155deg, rgba(255,253,249,.97), rgba(231,242,252,.96));
  color: var(--brand-navy);
  box-shadow: 0 26px 80px rgba(6, 30, 76, 0.4);
  text-align: left;
  animation: card-arrive 780ms cubic-bezier(0.16, 0.9, 0.2, 1) both;
}

#booking-panel > img {
  width: 100%;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
}

#booking-city {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(50px, 7vh, 104px);
  font-weight: 500;
}

#booking-persona,
#booking-route {
  margin: 14px 0 0;
  font-size: clamp(16px, 1.9vh, 27px);
  font-weight: 800;
  letter-spacing: .08em;
}

#booking-match {
  margin: 7px 0 0;
  color: #7b5b3d;
  font-size: clamp(13px, 1.45vh, 21px);
  font-weight: 700;
}

#booking-country {
  margin: 24px 0 0;
  color: #4d6195;
  font-size: clamp(15px, 1.7vh, 24px);
  font-weight: 700;
}

.booking-action {
  width: 100%;
  min-width: 0;
  margin-top: 22px;
  background: var(--brand-navy);
  color: var(--warm-white);
  text-decoration: none;
}

#booking-helper {
  margin: 14px 0 0;
  color: #5e6d92;
  font-size: clamp(12px, 1.35vh, 19px);
  line-height: 1.45;
}

#config-error {
  padding: 32px;
  border-radius: 28px;
  background: rgba(16, 44, 104, .88);
}

#config-error h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4.2vh, 58px);
}

#keepsake-card {
  width: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
  border-radius: 28px;
  background: var(--warm-white);
  color: var(--brand-navy);
  box-shadow: 0 26px 80px rgba(6, 30, 76, 0.4);
  transform-origin: 50% 70%;
  animation: card-arrive 780ms cubic-bezier(0.16, 0.9, 0.2, 1) both;
}

@keyframes card-arrive {
  from { transform: translateY(22%) scale(0.72); }
  to { transform: translateY(0) scale(1); }
}

#keepsake-card.is-exiting {
  animation: card-leave 640ms cubic-bezier(0.6, 0, 0.84, 0.1) both;
}

@keyframes card-leave {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-12%) scale(0.3); }
}

.card-main {
  padding: 30px 30px 24px;
  text-align: left;
}

.card-main > img {
  width: 100%;
  height: auto;
  max-height: 48px;
  object-fit: contain;
  object-position: left center;
}

.card-label {
  margin: 24px 0 10px;
  color: var(--soft-gold);
  font-size: clamp(11px, 1.2vh, 18px);
  font-weight: 800;
  letter-spacing: 0.1em;
}

#keepsake-city {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(50px, 7vh, 104px);
  font-weight: 500;
}

#keepsake-city-zh {
  margin: 5px 0 0;
  color: #4d6195;
  font-size: clamp(16px, 1.8vh, 27px);
  font-weight: 650;
  letter-spacing: 0.05em;
}

#keepsake-route {
  margin: 12px 0 8px;
  font-size: clamp(18px, 2.2vh, 32px);
  font-weight: 800;
  letter-spacing: 0.1em;
}

#keepsake-persona {
  margin: 15px 0 0;
  color: var(--brand-navy);
  font-size: clamp(14px, 1.6vh, 23px);
  font-weight: 800;
}

#keepsake-match {
  margin: 6px 0 0;
  color: #7b5b3d;
  font-size: clamp(12px, 1.35vh, 19px);
  font-weight: 650;
  line-height: 1.4;
}

#keepsake-serial,
#keepsake-date,
.not-ticket {
  margin: 6px 0;
  font-size: clamp(11px, 1.3vh, 19px);
  letter-spacing: 0.08em;
}

.not-ticket {
  color: #5e6d92;
}

#keepsake-date {
  color: #405787;
  font-weight: 700;
}

.card-stub {
  padding: 22px 28px 26px;
  display: grid;
  place-items: center;
  border-top: 2px dashed rgba(23, 49, 127, 0.28);
  background: #eef5fb;
}

#qr-code {
  width: clamp(150px, 22vw, 240px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: white;
}

#qr-code canvas,
#qr-code img {
  width: 100% !important;
  height: 100% !important;
}

.card-stub p {
  margin: 8px 0 0;
  font-size: clamp(12px, 1.4vh, 20px);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.keepsake-hint {
  margin: 18px 0 0;
  font-size: clamp(14px, 1.6vh, 24px);
  text-shadow: 0 2px 14px rgba(4, 31, 82, 0.75);
}

.secondary-action {
  min-height: 62px;
  margin-top: 14px;
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(13, 49, 111, 0.66);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.58);
  font-size: clamp(12px, 1.4vh, 20px);
  font-weight: 700;
  letter-spacing: 0.06em;
}

#hardware-safe-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  pointer-events: none;
}

body[data-debug-safe="1"] #hardware-safe-overlay {
  display: block;
}

#hardware-safe-overlay span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 3px solid;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
}

.safe-main {
  top: var(--subject-safe-top, 10%);
  bottom: var(--subject-safe-bottom, 12%);
  width: var(--subject-safe-width, 64%);
  border-color: #66ffbd !important;
}

.safe-touch {
  top: var(--critical-safe-top, 22%);
  bottom: var(--critical-safe-bottom, 22%);
  width: var(--critical-safe-width, 50%);
  border-color: #ffd257 !important;
}

.safe-card {
  top: var(--qr-safe-top, 28%);
  bottom: var(--qr-safe-bottom, 28%);
  width: var(--qr-safe-width, 40%);
  border-color: #ff758e !important;
}

#proof-status {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: 7.5%;
  transform: translateX(-50%);
  display: none;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(5, 18, 52, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

body[data-debug="1"] #proof-status {
  display: block;
}

#operator-controls {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(700px, calc(100vw - 24px));
  transform: translateX(-50%);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-radius: 16px;
  background: rgba(5, 18, 52, .88);
  color: white;
  font: 700 11px/1.2 Arial, sans-serif;
  text-align: left;
}

#operator-controls[hidden] { display: none; }

#operator-controls label,
#operator-controls select,
#operator-controls button {
  min-width: 0;
  font: inherit;
}

#operator-controls select,
#operator-controls button {
  width: 100%;
  min-height: 34px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
}

#operator-controls button {
  grid-column: 1 / -1;
  align-self: end;
  padding: 7px 10px;
  background: white;
  color: var(--brand-navy);
}

@media (max-height: 900px) {
  #brand-lockup { top: 8%; }
  .screen { top: 16%; bottom: 11%; }
  #quiz-screen { top: 16%; bottom: 11%; padding-top: 0; }
  .answer-button { height: 82px; min-height: 82px; }
  #keepsake-screen { top: 15%; bottom: 11%; }
  #booking-screen { top: 15%; bottom: 11%; }
  .card-main { padding: 22px 24px 18px; }
  .card-stub { padding: 14px 22px 18px; }
}

@media (max-height: 1100px) {
  #keepsake-screen { top: 7%; bottom: 19%; }
  #booking-screen { top: 7%; bottom: 19%; }
  .card-main { padding: 16px 18px 12px; }
  .card-main > img { max-height: 36px; }
  .card-label { margin: 12px 0 6px; font-size: 10px; }
  #keepsake-city { font-size: 42px; line-height: 0.98; }
  #keepsake-city-zh { margin-top: 4px; font-size: 14px; }
  #keepsake-persona { margin-top: 9px; font-size: 13px; }
  #keepsake-match { margin-top: 3px; font-size: 11px; }
  #keepsake-route { margin: 8px 0 5px; font-size: 17px; }
  #keepsake-serial,
  .not-ticket { margin: 3px 0; font-size: 9px; }
  .card-stub { padding: 10px 16px 12px; }
  #qr-code { width: 150px; }
  .card-stub p { margin-top: 4px; font-size: 10px; }
  .keepsake-hint { margin-top: 8px; font-size: 11px; }
  .secondary-action { min-height: 48px; margin-top: 8px; padding: 9px 14px; font-size: 10px; }
  #booking-panel { padding: 20px 18px; }
  #booking-panel > img { max-height: 36px; }
  #booking-city { font-size: 42px; }
  #booking-country { margin-top: 15px; }
  .booking-action { min-height: 58px; margin-top: 14px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  #journey-meter span,
  #keepsake-card,
  #keepsake-card.is-exiting {
    transition: none;
    animation-duration: 1ms;
  }

  .story-image.is-active {
    animation: none;
  }

  #standby-mascot.is-visible,
  #standby-mascot.is-departing {
    animation: none;
  }
}

/* The online flow is content, not a scaled replica of the physical porthole.
   Keep the offline geometry intact. On phones, allow a short content panel
   to scroll instead of pushing a title into the authoritative brand lockup. */
/* Fixed outside the porthole mask, with a full touch target on phones. */
.sound-toggle {
  position: fixed;
  z-index: 30;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: clamp(44px, 5vmin, 64px);
  height: clamp(44px, 5vmin, 64px);
  padding: 11px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,253,249,.75);
  border-radius: 50%;
  background: rgba(16,44,104,.86);
  box-shadow: 0 2px 10px rgba(0,20,60,.18);
  color: var(--warm-white);
  cursor: pointer;
  touch-action: manipulation;
}
.sound-toggle svg { width: 100%; height: 100%; }
.sound-toggle[aria-pressed="true"] .sound-muted,
.sound-toggle[aria-pressed="false"] .sound-waves { display: none; }

body[data-channel="offline"] .sound-toggle { display: none; }
/* The result card already carries the authoritative logo on white. Avoid a
   second low-contrast lockup floating over an arbitrary destination image. */
body[data-route70-state="BOOKING_CTA"] #brand-lockup,
body[data-route70-state="KEEPSAKE"] #brand-lockup { visibility: hidden; }
.sound-toggle:focus-visible,
#try-again:focus-visible,
#recovery-screen button:focus-visible {
  outline: 3px solid var(--soft-gold);
  outline-offset: 4px;
}

#try-again { width: 100%; font-size: 13px; }

#recovery-screen {
  z-index: 40;
  padding: 28px;
  background: rgba(16,44,104,.96);
  border-radius: 28px;
}

#recovery-title {
  font: 500 clamp(28px,3.6vh,52px)/1.1 Georgia, serif;
  text-wrap: balance;
}

#recovery-copy { font-size: 17px; line-height: 1.45; }
#recovery-screen button { flex-shrink: 0; }

@media (max-width: 700px), (max-height: 900px) {
  body[data-channel="online"] #aperture {
    width: min(100vw, 640px);
    height: 100dvh;
  }

  body[data-channel="online"] #brand-lockup {
    top: max(18px, env(safe-area-inset-top));
    width: calc(100% - 40px);
    max-width: 500px;
  }

  body[data-channel="online"] #brand-lockup img { max-height: 54px; }
  body[data-channel="online"][data-occlusion="1"] #brand-lockup {
    top: max(36px, env(safe-area-inset-top));
    width: 70%;
  }


  body[data-channel="online"] :is(#standby-screen, #quiz-screen, #recommendation-screen, #booking-screen, #keepsake-screen, #recovery-screen, #config-error) {
    top: max(112px, calc(env(safe-area-inset-top) + 96px));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: calc(100% - 40px);
    max-width: 500px;
    justify-content: safe center;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 6px 4px;
  }

  body[data-channel="online"] .screen > * { flex-shrink: 0; }
  body[data-channel="online"] #standby-screen { bottom: 20%; }
  body[data-channel="online"] .standby-copy { width: 100%; padding: 22px 16px; }
  body[data-channel="online"] .eyebrow { font-size: 11px; line-height: 1.4; margin-bottom: 12px; }
  body[data-channel="online"] #standby-origin-badge { font-size: 10px; line-height: 1.3; margin-bottom: 14px; }
  body[data-channel="online"] #standby-title { font-size: clamp(25px,6.8vw,36px); line-height: 1.12; letter-spacing: 0; }
  body[data-channel="online"] #standby-title > span { white-space: normal; }
  body[data-channel="online"] .standby-promise { font-size: 17px; line-height: 1.4; }
  body[data-channel="online"] .primary-action { min-height: 52px; padding: 14px 18px; margin-top: 18px; font-size: 14px; letter-spacing: .08em; }
  body[data-channel="online"] #standby-mascot { width: 40%; right: 9%; }

  body[data-channel="online"] #question-title {
    font-size: clamp(27px,7.3vw,36px);
    min-height: 0;
    height: auto;
    max-height: none;
    flex: 0 0 auto;
    line-height: 1.08;
    margin: 6px auto 18px;
  }
  body[data-channel="online"] #question-title .question-line { white-space: normal; }
  body[data-channel="online"] #answer-options { gap: 10px; }
  body[data-channel="online"] .answer-button {
    height: auto;
    min-height: 56px;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 17px;
    line-height: 1.25;
  }
  body[data-channel="online"] #next-button { height: 52px; max-height: none; flex: 0 0 auto; min-width: 68%; }

  body[data-channel="online"] #recommendation-screen { padding: 24px 18px; border-radius: 28px; }
  body[data-channel="online"] .recommendation-kicker > span { white-space: normal; }
  body[data-channel="online"] #recommendation-persona-en { font-size: clamp(32px,9.5vw,48px); line-height: 1.04; letter-spacing: 0; }
  body[data-channel="online"] #recommendation-definition { font-size: 16px; line-height: 1.35; margin-top: 12px; }
  body[data-channel="online"] #recommendation-answers { margin-top: 16px; gap: 7px; }
  body[data-channel="online"] .answer-chip,
  body[data-channel="online"] .reason-chip { font-size: 12px; line-height: 1.25; padding: 6px 9px; }
  body[data-channel="online"] #recommendation-why { font-size: 12px; margin-top: 18px; }
  body[data-channel="online"] #recommendation-city { font-size: clamp(30px,8.5vw,44px); line-height: 1.05; letter-spacing: .015em; }
  body[data-channel="online"] #recommendation-route { font-size: 16px; letter-spacing: .06em; }
  body[data-channel="online"] #stage-copy { width: calc(100% - 56px); bottom: 12%; padding: 14px 16px; }
  body[data-channel="online"] #stage-copy p { font-size: 16px; }
  body[data-channel="online"] #booking-panel { padding: 24px 20px; overflow: visible; }
  body[data-channel="online"] #booking-city { font-size: clamp(32px,10vw,48px); line-height: 1.05; overflow-wrap: anywhere; }
  body[data-channel="online"] #booking-persona,
  body[data-channel="online"] #booking-route { font-size: 16px; }
  body[data-channel="online"] #booking-helper { font-size: 12px; }
  body[data-channel="online"] #recovery-screen { padding: 24px 20px; }
}

@media (max-height: 650px) {
  /* Short phone screens must expose START without scrolling a clipped panel. */
  body[data-channel="online"] #standby-screen {
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .recommendation-step,
  #standby-mascot,
  #standby-mascot > img,
  #brand-lockup,
  .standby-copy,
  #start-button { animation: none !important; transition: none !important; }
  #recommendation-screen.is-visible .recommendation-step { opacity: 1; transform: none; }
}
