/*
  Site styles for the home page and the booking flow (index, policy,
  thank-you).  kmitl-guide and tour still use styles.css; its tokens
  match these so the pages read as one site.
*/

:root {
  --ink: #0d254c;
  --ink-surface: #0d254c;
  --text: #1d1d1f;
  --text-2: #596b83;
  --text-3: #7a8699;

  --accent: #3f5fe0;
  --accent-rgb: 63, 95, 224;
  --accent-hover: #3350c8;
  --accent-text: #3f5fe0;
  --accent-soft: #eef1fd;

  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --fill: #e8ecf2;
  --line: #e5eaf1;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --danger: #b91c1c;

  --font: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-hero: clamp(2.5rem, 1.2rem + 5.5vw, 5rem);
  --fs-h2: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --fs-lead: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);

  --nav-h: 48px;
  --maxw: 1080px;
  --gutter: max(16px, 4vw);
  --radius: 18px;
  --radius-lg: 28px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f7;
    --ink-surface: #13213d;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;

    --accent-hover: #5572f0;
    --accent-text: #8ea4ff;
    --accent-soft: rgba(var(--accent-rgb), 0.18);

    --bg: #000000;
    --bg-alt: #111113;
    --surface: #1c1c1e;
    --surface-2: #1c1c1e;
    --fill: #2c2c2e;
    --line: #38383a;
    --nav-bg: rgba(22, 22, 23, 0.72);
    --danger: #ff6b6b;

    color-scheme: dark;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

/* Thai stacks vowels and tone marks above the line; tighter than 1.25 clips them */
h1, h2, h3 { color: var(--ink); line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; }
h1, h2, .lead { text-wrap: balance; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: clamp(72px, 10vw, 128px) 0; }
.section.alt { background: var(--bg-alt); }
.anchor { display: block; }

.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 64px); }
.eyebrow {
  display: block;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.headline { font-size: var(--fs-h2); }
.lead {
  color: var(--text-2);
  font-size: var(--fs-lead);
  max-width: 38ch;
  margin: 1rem auto 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 1.05rem;
  transition: background-color 0.2s var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--fill); color: var(--ink); }
.btn.secondary:hover { background: var(--line); }
.btn.small { min-height: 32px; padding: 0.25rem 0.9rem; font-size: 0.85rem; }

.link {
  color: var(--accent-text);
  font-size: 1.05rem;
  font-weight: 500;
}
.link:hover { text-decoration: underline; }
.link::after { content: " ›"; }

/* ---------- Global nav ---------- */
.gnav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.gnav .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.gnav-logo { font-weight: 600; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.01em; }
.gnav-links { display: flex; gap: 1.75rem; margin-left: auto; }
.gnav-links a { font-size: 0.85rem; color: var(--text-2); transition: color 0.2s; }
.gnav-links a:hover { color: var(--ink); }
.gnav-menu { display: none; width: 44px; height: 44px; margin-right: -10px; }
.gnav-menu span {
  display: block; width: 18px; height: 1.5px; margin: 5px auto;
  background: var(--ink); transition: transform 0.3s var(--ease);
}
.gnav.open .gnav-menu span:first-child { transform: translateY(3.25px) rotate(45deg); }
.gnav.open .gnav-menu span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

@media (max-width: 820px) {
  .gnav .wrap { gap: 0.75rem; }
  .gnav .btn.small { margin-left: auto; }
  .gnav-menu { display: block; }
  .gnav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .gnav.open .gnav-links { display: flex; }
  .gnav-links a {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ink);
    padding: 0.6rem 0;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 96px));
  text-align: center;
}
.hero h1 { font-size: var(--fs-hero); letter-spacing: -0.025em; line-height: 1.05; }
.hero .lead { margin-top: 1rem; }
.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.hero-media {
  margin: clamp(40px, 6vw, 64px) auto 0;
  width: min(1280px, calc(100% - 2 * var(--gutter)));
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 8;
  background: var(--fill);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
@media (max-width: 640px) {
  .hero-media { aspect-ratio: 4 / 5; }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: clamp(40px, 6vw, 64px);
  text-align: center;
}
.stat strong {
  display: block;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat span { color: var(--text-2); font-size: 0.95rem; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
}

/* ---------- Rooms ---------- */
.rooms {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (max-width: 720px) { .rooms { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-media { aspect-ratio: 4 / 3; background: var(--fill); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.75rem 1.75rem 2rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.card-body h3 { font-size: 1.6rem; }
.card-size { color: var(--accent-text); font-weight: 600; font-size: 1.05rem; }
.card-body ul { color: var(--text-2); display: grid; gap: 0.35rem; }
.card-body li { padding-left: 1.4rem; position: relative; }
.card-body li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.55em;
  width: 0.45rem;
  height: 0.25rem;
  border-left: 2px solid var(--accent-text);
  border-bottom: 2px solid var(--accent-text);
  transform: rotate(-45deg);
}
.card-actions { display: flex; gap: 1.25rem; align-items: center; margin-top: auto; padding-top: 0.75rem; flex-wrap: wrap; }

/* Plans panel */
.plans {
  margin-top: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.plans-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.plans-head h3 { font-size: 1.4rem; }
.plans-controls { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.plans-figure {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;             /* plan drawings are black-on-white in both themes */
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}
.plans-figure img { width: 100%; height: 100%; object-fit: contain; }
.plans-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
  color: var(--text-2);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--fill);
  gap: 2px;
}
.segmented button {
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  transition: background-color 0.2s, color 0.2s;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.segmented[hidden] { display: none; }

/* ---------- Facilities bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.tile {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 240px;
}
.tile.wide { grid-column: span 2; }
.tile.dark { background: var(--ink-surface); }
.tile.dark h3, .tile.dark .tile-num { color: #fff; }
.tile.dark p { color: rgba(255, 255, 255, 0.75); }
.tile.dark .tile-icon { color: #8ea4ff; }
.tile-icon { width: 40px; height: 40px; color: var(--accent-text); margin-bottom: auto; }
.tile h3 { font-size: 1.35rem; margin-top: 1.25rem; }
.tile p { color: var(--text-2); }
.tile-num { font-size: clamp(3rem, 2rem + 3vw, 4.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.chips span {
  padding: 0.3rem 0.8rem;
  border-radius: 980px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
}
@media (max-width: 820px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .tile.wide { grid-column: span 2; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .tile.wide { grid-column: auto; }
  .tile { min-height: 0; }
}

/* ---------- Location ---------- */
.location {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 1.25rem;
  align-items: stretch;
}
@media (max-width: 820px) { .location { grid-template-columns: 1fr; } }

.groups { display: grid; gap: 1.5rem; align-content: start; }
.group-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem 1rem;
}
.list { background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  position: relative;
}
.list li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1rem;
  right: 0;
  border-top: 1px solid var(--line);
}
.list .dist { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 420px;
  background: var(--fill);
}
.map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; }

.link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
  margin-top: 2rem;
}

/* ---------- Gallery ---------- */
.gallery-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.gallery-head .headline { text-align: left; }
.gallery-nav { display: flex; gap: 0.75rem; }
.gallery-nav button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: background-color 0.2s, opacity 0.2s;
}
.gallery-nav button:hover { background: var(--line); }
.gallery-nav button:disabled { opacity: 0.35; cursor: default; }
.gallery-nav svg { width: 20px; height: 20px; }

.track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 0 var(--gutter) 0.5rem;
  scrollbar-width: none;
  /* line the first slide up with .wrap on wide screens */
  padding-left: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  scroll-padding-left: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 min(84vw, 760px);
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--fill);
}
.slide img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Booking ---------- */
.booking {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) { .booking { grid-template-columns: 1fr; } }

.booking-steps { display: grid; gap: 1.25rem; min-width: 0; }

.step {
  border: 0;
  min-width: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.step legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
}
.step > :not(legend) { clear: both; }
.step-no {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.85rem;
  font-weight: 700;
}

.segmented.wide { display: flex; width: 100%; }
.segmented.wide button { flex: 1; padding: 0.55rem 0.5rem; }
.segmented .count { margin-left: 0.2rem; font-size: 0.8rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.segmented button[aria-pressed="true"] .count { color: var(--accent-text); }

/* Room picker */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}
@media (max-width: 560px) {
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .step { padding: 1.25rem 1rem; }
}
.room {
  position: relative;
  display: grid;
  gap: 0.1rem;
  padding: 1rem 1rem 0.9rem;
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition: box-shadow 0.15s var(--ease), background-color 0.15s var(--ease);
}
.room:hover { box-shadow: inset 0 0 0 1px var(--text-3); }
.room:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.4); outline-offset: 2px; }
.room[aria-checked="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.room[aria-checked="true"]::after {
  content: "";
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M6 12.5l4 4 8-9"/></svg>') center / 14px no-repeat;
}
.room .id { font-size: 1.35rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.room .where { font-size: 0.85rem; color: var(--text-2); }
.room .price { margin-top: 0.4rem; font-weight: 600; color: var(--ink); }
.room .when { font-size: 0.8rem; color: var(--accent-text); font-weight: 500; }
.room .tag {
  justify-self: start;
  margin-top: 0.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 980px;
  background: var(--fill);
  color: var(--text-2);
  font-size: 0.72rem;
}

.room-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text-2);
  display: grid;
  gap: 0.5rem;
  justify-items: center;
}
.room-empty strong { color: var(--ink); font-size: 1.1rem; }
.room-empty .btn { margin-top: 0.5rem; }
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--fill);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Floating-label fields */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field { position: relative; display: block; }
.field.full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
.field input,
.field textarea {
  width: 100%;
  padding: 1.45rem 1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15); }
.field span {
  position: absolute;
  left: 1rem;
  top: 0.95rem;
  color: var(--text-3);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.15s var(--ease);
}
.field input:focus + span,
.field input:not(:placeholder-shown) + span,
.field textarea:focus + span,
.field textarea:not(:placeholder-shown) + span { transform: translateY(-0.6rem) scale(0.78); }
.field.invalid input { border-color: var(--danger); }
.field.invalid span { color: var(--danger); }

/* iOS-style switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; }
.switch-row strong { display: block; font-weight: 500; color: var(--ink); }
.switch-row small { color: var(--text-2); font-size: 0.9rem; }
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 31px;
  background: var(--fill);
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease);
}
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.4); outline-offset: 2px; }
.parking-note { margin-top: 0.75rem; color: var(--text-2); font-size: 0.95rem; }

/* Summary */
.summary {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
@media (max-width: 900px) { .summary { position: static; } }
.summary h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.summary dt { color: var(--text-2); }
.summary dd { color: var(--ink); font-weight: 500; text-align: right; }
.summary .cost-group { margin-bottom: 1.25rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { background: var(--accent); }
.summary-hint { text-align: center; color: var(--text-3); font-size: 0.85rem; margin: 0.6rem 0 1rem; }
.summary .link { display: block; text-align: center; font-size: 0.95rem; }

/* Money: what is paid now vs. at move-in.  Keep these two visibly apart;
   a single big monthly total read as "pay this to book". */
.cost-group { margin-top: 1rem; }
.cost-group-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.02em;
  margin-bottom: 0.1rem;
}
.cost-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; }
.cost-row span:first-child { color: var(--text-2); }
.cost-row span:last-child { color: var(--ink); font-weight: 500; text-align: right; }
.cost-row.total { border-top: 1px solid var(--line); margin-top: 0.25rem; padding-top: 0.65rem; }
.cost-row.total span { color: var(--ink); font-weight: 600; }
.due-now {
  margin: 1.1rem 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.due-now-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.due-now-head span { font-weight: 600; color: var(--ink); }
.due-now-head strong { font-size: 1.6rem; color: var(--accent-text); letter-spacing: -0.01em; }
.due-now p { margin-top: 0.3rem; font-size: 0.85rem; color: var(--text-2); line-height: 1.5; }

/* ---------- Booking flow pages (policy, thank-you) ---------- */
.flow {
  min-height: 100vh;
  background: var(--bg-alt);
  padding: calc(var(--nav-h) + clamp(32px, 6vw, 64px)) 0 clamp(64px, 8vw, 96px);
}
.flow .wrap { max-width: 720px; }
.flow-head { text-align: center; margin-bottom: 2rem; }
.flow-head h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); }
.flow-head .lead { margin-top: 0.75rem; }
.gnav-back { margin-left: auto; font-size: 0.85rem; color: var(--accent-text); }

.stepper {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--text-3);
  flex-wrap: wrap;
}
.stepper li { display: flex; align-items: center; gap: 0.4rem; }
.stepper li + li::before { content: ""; width: 1.25rem; height: 1px; background: var(--line); margin-right: 0.1rem; }
.stepper .dot {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 700;
}
.stepper .done .dot { background: var(--accent-soft); color: var(--accent-text); }
.stepper .current { color: var(--ink); font-weight: 600; }
.stepper .current .dot { background: var(--accent); color: #fff; }
@media (max-width: 560px) {
  .stepper { gap: 0.4rem 1rem; }
  .stepper li + li::before { display: none; }
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: 1rem;
}
.panel h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.panel.notice { text-align: center; }
.panel.notice p { color: var(--text-2); margin-bottom: 1rem; }

.terms { counter-reset: term; display: grid; gap: 1rem; }
.terms li { counter-increment: term; position: relative; padding-left: 2.25rem; color: var(--text-2); }
.terms li::before {
  content: counter(term);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.terms strong { color: var(--ink); }
.terms .example {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.92rem;
}

.ack {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--ink);
  margin-bottom: 1.25rem;
}
.ack input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 0.15rem;
  border-radius: 6px;
  border: 2px solid var(--text-3);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.ack input:checked {
  background: var(--accent) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 12.5l4 4 8-9"/></svg>') center / 16px no-repeat;
  border-color: var(--accent);
}
.ack input:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.4); outline-offset: 2px; }
.flow-actions { display: grid; gap: 0.75rem; justify-items: center; }
.flow-actions .btn { width: 100%; }
.btn .spinner {
  width: 1em;
  height: 1em;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
}

/* thank-you */
.done-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
}
.done-badge svg { width: 32px; height: 32px; }
.code-card { text-align: center; }
.code-card .label { color: var(--text-2); font-size: 0.95rem; }
.code-value {
  display: block;
  margin: 0.25rem 0 0.75rem;
  font-size: clamp(2.5rem, 2rem + 3vw, 3.5rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.next-steps { display: grid; gap: 1.25rem; }
.next-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 0.9rem; align-items: start; }
.next-steps .num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.next-steps strong { display: block; color: var(--ink); }
.next-steps p { color: var(--text-2); font-size: 0.95rem; }
.line-cta { display: flex; gap: 1.5rem; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.line-cta .btn { min-width: 220px; }
.qr-code { width: 150px; height: 150px; border-radius: 14px; background: #fff; padding: 8px; }
@media (max-width: 700px) { .qr-code { display: none; } }   /* scanning your own screen does not work */
.guide { max-width: 420px; margin: 0 auto; }
.guide img { border-radius: var(--radius); width: 100%; }

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-alt);
  color: var(--text-3);
  font-size: 0.8rem;
  padding: 1.75rem 0 5rem;
}
.footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer a:hover { color: var(--text); text-decoration: underline; }

/* ---------- 360 dialog ---------- */
.tour {
  border: 0;
  padding: 0;
  width: min(1100px, 94vw);
  max-height: 90vh;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  margin: auto;
}
.tour::backdrop { background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tour-head { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0.75rem 0.75rem 1.25rem; }
.tour-head h3 { font-size: 1.1rem; }
.tour-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--fill); font-size: 1.2rem; line-height: 1;
}
.tour iframe { display: block; width: 100%; height: min(70vh, 620px); border: 0; }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity 0.3s linear; }
}
