/* Design tokens from design/design-system/tokens.json. Components use these, never raw hex. */
:root {
  --canvas: #fcfbf7;
  --surface: #f7f7f7;
  --hairline: #ebebeb;
  --rule: #cbc4c0;
  --ink: #82716d;
  --ink-hover: #5f524f;
  --on-ink: #ffffff;
  --scrim: rgba(60, 50, 48, 0.45);
  --surface-veil: rgba(247, 247, 247, 0.85);

  --font-display: "EB Garamond", Garamond, Georgia, serif;
  --font-body: Raleway, "Helvetica Neue", Arial, sans-serif;
  --font-detail: "Open Sans", "Helvetica Neue", Arial, sans-serif;
  --font-button: Montserrat, "Helvetica Neue", Arial, sans-serif;

  --radius-card: 16px;
  --radius-map: 12px;
  --radius-pill: 9999px;
  --control-height: 48px;
  --stroke-control: 2px;
  --stroke-card: 1px;
  --gutter: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
}
a { color: var(--ink); }
a:hover { color: var(--ink-hover); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.page { max-width: 560px; margin: 0 auto; }
.pad { padding-left: var(--gutter); padding-right: var(--gutter); }
.stack { display: flex; flex-direction: column; }
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.serif { font-family: var(--font-display); font-weight: 400; }
.title-xl { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 54px; }
.title-lg { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 45px; }
.title-md { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 40px; }
.title-sm { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 36px; }
.title-card { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 32px; }
.eyebrow { margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; }
.heading { margin: 0; font-size: 17px; line-height: 23px; font-weight: 700; }
.body { margin: 0; font-size: 17px; line-height: 25.5px; }
.text { margin: 0; font-size: 16px; line-height: 24px; }
.small { margin: 0; font-size: 15px; line-height: 22px; }
.strong { font-weight: 600; }
.bold { font-weight: 700; }
.code { font-family: var(--font-detail); font-weight: 600; letter-spacing: 1px; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: center;
  min-height: 72px; padding: 14px var(--gutter);
  border-bottom: 1px solid var(--hairline);
}
.site-header .names { font-family: var(--font-display); font-size: 24px; line-height: 30px; }
.site-header.with-back { justify-content: space-between; }
.site-header.with-back .names { font-size: 22px; }
.back-link {
  min-height: 44px; display: flex; align-items: center; gap: 6px;
  text-decoration: none; font-size: 16px; font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
  height: var(--control-height); padding: 0 28px; border-radius: var(--radius-pill);
  border: var(--stroke-control) solid var(--ink); background: var(--ink); color: var(--on-ink);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px var(--font-button); text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { color: var(--on-ink); background: var(--ink-hover); border-color: var(--ink-hover); }
.btn-lg { height: 52px; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: transparent; color: var(--ink-hover); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; pointer-events: none; }
.text-action {
  align-self: flex-start; min-height: 44px; padding: 0; border: none; background: transparent;
  display: flex; align-items: center; color: var(--ink);
  font: 500 14px var(--font-body); letter-spacing: 1.3px; text-transform: uppercase;
  text-decoration: underline; cursor: pointer;
}
.link { min-height: 44px; display: inline-flex; align-items: center; font-size: 16px; font-weight: 500; }

/* ---------- Cards, alerts, pills ---------- */
.card { border: var(--stroke-card) solid var(--ink); border-radius: var(--radius-card); }
.card-strong { border: var(--stroke-control) solid var(--ink); border-radius: var(--radius-card); }
.alert { border: var(--stroke-control) solid var(--ink); border-radius: var(--radius-card); padding: 16px; display: flex; gap: 12px; }
.alert svg { flex: none; margin-top: 2px; }
.pill {
  height: 32px; padding: 0 14px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; font: 600 14px var(--font-button);
}
.pill-solid { background: var(--ink); color: var(--on-ink); }
.pill-outline { height: 34px; padding: 0 16px; border: var(--stroke-control) solid var(--ink); }
.divider-top { border-top: 1px solid var(--hairline); }
.rule-top { border-top: 1px solid var(--rule); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 15px; font-weight: 600; }
.input {
  height: var(--control-height); width: 100%; border: var(--stroke-card) solid var(--ink); border-radius: var(--radius-map);
  background: var(--canvas); padding: 0 16px; font: 400 17px var(--font-body); color: var(--ink);
}
.input::placeholder { color: var(--ink); opacity: 0.6; }
.form-error { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }

/* ---------- Password page ---------- */
.enter { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 56px 24px 40px; min-height: 100vh; }
.enter-photo { width: 100%; height: 228px; background: var(--hairline); border-radius: var(--radius-map); overflow: hidden; }
.enter-photo img { width: 100%; height: 100%; object-fit: cover; }
.enter .title-xl { font-size: clamp(36px, 11.5vw, 44px); white-space: nowrap; }
.enter form { width: 100%; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Rooms page ---------- */
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 24px; }
.step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600;
}
.night-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.night-chip {
  height: 64px; border: var(--stroke-control) solid var(--ink); border-radius: var(--radius-pill);
  background: transparent; color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.night-chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.night-chip .short { font: 600 15px var(--font-button); }
.night-chip .date { font: 400 14px var(--font-body); }
.area-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
.area-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 38px; }

.room-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: var(--stroke-card) solid var(--ink); border-radius: var(--radius-card); overflow: hidden; }
.room-card:hover { color: var(--ink); }
.photo-box { position: relative; background: var(--hairline); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-box.dim img, .photo-box.dim .photo-label { opacity: 0.55; }
.photo-label { background: var(--canvas); padding: 6px 12px; font-size: 15px; font-weight: 500; }
.room-card .photo-box { height: 196px; }
.badge {
  position: absolute; top: 12px; left: 12px; height: 32px; padding: 0 12px; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--on-ink); display: flex; align-items: center; font: 600 14px var(--font-button);
}
.room-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.price { font-size: 17px; font-weight: 600; white-space: nowrap; }
.price span { font-weight: 400; font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; line-height: 22px; }
.meta span { display: flex; align-items: center; gap: 6px; }

.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--canvas); border-top: 1px solid var(--rule);
  padding: 12px var(--gutter) calc(20px + env(safe-area-inset-bottom));
}
.cart-bar-inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-bar .total { font-size: 20px; line-height: 26px; font-weight: 700; }

/* ---------- Room detail ---------- */
.gallery { position: relative; height: 292px; background: var(--hairline); }
.gallery-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.gallery .photo-box { height: 100%; }
.gallery-count {
  position: absolute; right: 12px; bottom: 12px; height: 28px; padding: 0 12px; border-radius: var(--radius-pill);
  background: var(--surface-veil); display: flex; align-items: center; font-size: 14px; font-weight: 600;
}
.gallery-nav {
  position: absolute; top: 50%; margin-top: -22px; width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--surface-veil); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.dots { display: flex; justify-content: center; gap: 8px; padding-top: 10px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); }
.dots span.on { background: var(--ink); }
.facts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 24px; }
.facts li { display: flex; align-items: center; gap: 10px; }
.night-option {
  min-height: 64px; width: 100%; border: var(--stroke-card) solid var(--ink); border-radius: var(--radius-card);
  padding: 11px 17px; background: transparent; color: var(--ink); cursor: pointer; text-align: left;
  display: flex; align-items: center; justify-content: space-between; font-family: var(--font-body);
}
.night-option[aria-pressed="true"] { border-width: 2px; padding: 10px 16px; background: var(--surface); }
.night-option .day, .night-closed .day { font-size: 17px; font-weight: 600; }
.night-option .when, .night-closed .when { font-size: 15px; }
.checkbox {
  width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.night-option[aria-pressed="true"] .checkbox { background: var(--ink); }
.night-option[aria-pressed="false"] .checkbox svg { visibility: hidden; }
.night-closed {
  min-height: 64px; border: 1px dashed var(--rule); border-radius: var(--radius-card); padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ---------- Cart ---------- */
.cart-item { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.thumb { flex: none; width: 84px; height: 84px; border-radius: var(--radius-map); background: var(--hairline); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-between { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- Pay ---------- */
.dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; font-size: 16px; line-height: 24px; }
.dl dd { margin: 0; text-align: right; }
.copy-btn { width: 44px; height: 44px; margin: -10px -10px -10px 0; padding: 0; border: none; border-radius: 50%; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.status-panel { padding: 24px 20px; border-radius: var(--radius-card); background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr-frame { padding: 24px; border: var(--stroke-card) solid var(--ink); border-radius: var(--radius-card); background: #ffffff; }
.qr-frame svg { display: block; width: 294px; height: 294px; }
.desktop-only { display: none; }
.pay-grid { display: block; }

@media (min-width: 768px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: flex; }
  .page.page-wide { max-width: 1000px; }
  .pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: start; padding: 56px 40px; }
  .pay-grid > section { padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important; }
  .pay-grid .pad, .pay-grid .card, .pay-grid .status-panel, .pay-grid .rule-top { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0; padding-right: 0; }
  .pay-grid .card { padding-left: 24px; padding-right: 24px; }
  .pay-grid .status-panel { padding-left: 20px; padding-right: 20px; }
  .pay-grid > section:first-child > .center { text-align: left; align-items: flex-start !important; }
}

/* ---------- Confirmed / manage ---------- */
.check-circle { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.time-box { border: 1px solid var(--rule); border-radius: var(--radius-card); padding: 16px 8px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.time-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.manage-room { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.manage-room dl { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 16px; line-height: 24px; }
.manage-room dl div { display: flex; gap: 8px; }
.manage-room dt { font-weight: 600; width: 64px; flex: none; }
.manage-room dd { margin: 0; }
.manage-room.cancelled { border-style: dashed; border-color: var(--rule); }
.struck { text-decoration: line-through; }

/* ---------- Cancel bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--canvas);
  border-radius: 16px 16px 0 0; padding: 28px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px; max-height: 90vh; overflow-y: auto;
}
.sheet-inner { max-width: 520px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.lines { padding: 16px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Loading ---------- */
.loading { padding: 48px var(--gutter); text-align: center; font-size: 16px; }
