/* ===== Design tokens ===== */
:root {
  --red: #8E1F2C;
  --red-dark: #5E1019;
  --red-soft: #F8E9EA;
  --gold: #D9A441;
  --gold-soft: #F7EBD3;
  --ink: #241B19;
  --muted: #6B5E5A;
  --bg: #F7F2EA;
  --card: #FFFFFF;
  --line: #ECE3D7;
  --green: #22693F;
  --green-soft: #E2F1E7;
  --amber: #8F5A0C;
  --amber-soft: #FBEFD9;
  --blue: #1F3A63;
  --blue-soft: #EAF0F9;

  --r-lg: 18px;
  --r-md: 12px;
  --tap: 44px;               /* ขนาดปุ่มกดขั้นต่ำ */
  --gutter: 16px;

  /* ฟอนต์: เปลี่ยนที่นี่ที่เดียว (ต้องโหลดใน index.html ด้วย) */
  --font-head: "Prompt", system-ui, sans-serif;
  --font-body: "Prompt", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
/* ทั้งหน้าใช้ Prompt */
h1, h2, h3, .eyebrow, .time, .chip, .btn, .stay-night, .inout b, .countdown b {
  font-family: var(--font-head);
  font-weight: 500;
}
.hero h1 { font-weight: 600; }
/* ตัวเลขเงิน: ใช้ฟอนต์เนื้อหา น้ำหนักกลาง ๆ ไม่ทึบ ตัวเลขกว้างเท่ากัน */
.price, .sum-main strong, .sum-sub strong, .day-total {
  font-family: var(--font-body);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
a { color: inherit; }

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(circle at 88% 12%, rgba(217,164,65,.30) 0 70px, transparent 71px),
    linear-gradient(160deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  text-align: center;
  padding: calc(28px + env(safe-area-inset-top)) var(--gutter) 64px;
}
.eyebrow { color: var(--gold); font-weight: 600; font-size: 14px; letter-spacing: .03em; }
.hero h1 { font-size: 28px; line-height: 1.3; margin: 4px 0 2px; }
.dates { font-size: 15px; opacity: .9; }
.countdown {
  display: inline-block; margin-top: 14px; padding: 6px 16px;
  background: rgba(255,255,255,.12); border-radius: 999px; font-size: 14px;
}
.countdown b { color: var(--gold-soft); }

/* ===== Layout ===== */
main { max-width: 680px; margin: -44px auto 0; padding: 0 var(--gutter) 24px; }
.card {
  background: var(--card); border-radius: var(--r-lg);
  box-shadow: 0 1px 2px rgba(60,20,20,.05), 0 6px 20px rgba(94,16,25,.06);
  padding: 18px 16px; margin-bottom: 16px;
}
.section { margin: 28px 0 16px; }
.sec-title { font-size: 19px; line-height: 1.4; margin-bottom: 12px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.hint + .hint { margin-top: 2px; }

/* ===== Summary ===== */
.sum-main {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  background: var(--gold-soft); border-radius: var(--r-md); padding: 14px;
}
.sum-label { display: block; font-size: 13px; color: var(--muted); }
.sum-main strong { font-size: 24px; line-height: 1.2; color: var(--red); }
.sum-main .per { text-align: right; }
.sum-main .per strong { font-size: 18px; color: var(--ink); }
.sum-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; }
.sum-sub div { background: var(--bg); border-radius: var(--r-md); padding: 10px 12px; }
.sum-sub strong { font-size: 17px; }

/* ===== Sticky day nav ===== */
.day-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 6px; overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter)) 12px;
  padding: 8px var(--gutter);
  background: rgba(247,242,234,.94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none; scroll-snap-type: x proximity;
}
.day-nav::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  min-width: 52px; min-height: var(--tap);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: var(--r-md);
  text-decoration: none; line-height: 1.2;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
}
.chip small { font-size: 11px; color: var(--muted); }
.chip b { font-size: 15px; }
.chip.empty { opacity: .55; }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; opacity: 1; }
.chip.active small { color: rgba(255,255,255,.8); }
.chip.today:not(.active) { border-color: var(--red); border-width: 2px; }
.chip.extra { flex-direction: row; gap: 4px; font-size: 14px; font-weight: 600; }

/* ===== Day card ===== */
.day-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.day-icon {
  flex: 0 0 44px; height: 44px; display: grid; place-items: center;
  font-size: 22px; background: var(--gold-soft); border-radius: var(--r-md);
}
.day-head .grow { flex: 1; min-width: 0; }
.day-head h2 { font-size: 18px; line-height: 1.35; }
.day-head p { font-size: 14px; color: var(--muted); line-height: 1.45; }
.day-total {
  flex: none; font-size: 14px; color: var(--red);
  background: var(--red-soft); padding: 4px 10px; border-radius: 999px;
}
.today-badge {
  display: inline-block; margin-left: 6px; vertical-align: middle;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--red);
  padding: 1px 8px; border-radius: 999px;
}
.placeholder {
  padding: 14px; text-align: center; color: var(--muted); font-size: 14px;
  background: var(--bg); border-radius: var(--r-md);
}
.day.is-empty .day-head { border-bottom: 0; margin-bottom: 4px; padding-bottom: 8px; }

/* ===== Timeline ===== */
.timeline { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid; grid-template-columns: 36px 1fr; column-gap: 12px;
  position: relative; padding-bottom: 20px;
}
.item:last-child { padding-bottom: 0; }
.item:not(:last-child)::before {
  content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px;
  width: 2px; background: var(--line); border-radius: 2px;
}
.dot {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--card); border: 2px solid var(--line); border-radius: 50%;
  font-size: 16px;
}
.body { min-width: 0; padding-top: 1px; }
.time {
  display: inline-block; font-weight: 700; font-size: 15px; color: var(--red);
  font-variant-numeric: tabular-nums;
}
.body h3 { font-size: 16px; line-height: 1.45; font-weight: 600; margin-top: 1px; overflow-wrap: anywhere; }
.tz {
  display: inline-block; margin-top: 6px; padding: 2px 8px;
  background: var(--blue-soft); color: var(--blue);
  border-radius: 8px; font-size: 13px; font-weight: 500; line-height: 1.5;
}
.notes { margin: 6px 0 0; padding-left: 18px; font-size: 15px; color: #3A2F2C; }
.notes li + li { margin-top: 2px; }
.notes li::marker { color: var(--gold); }

.cost { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; }
.price { font-size: 16px; }
.native { font-size: 13px; color: var(--muted); }
.cost-label { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.booked { background: var(--green-soft); color: var(--green); }
.badge.est { background: var(--amber-soft); color: var(--amber); }

/* ===== Buttons ===== */
.actions { display: grid; gap: 8px; margin-top: 12px; }
.links { display: flex; gap: 8px; }
.btn {
  flex: 1 1 0; min-width: 0;
  min-height: var(--tap); padding: 8px 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.3; text-align: center;
  border-radius: var(--r-md); border: 0; cursor: pointer; text-decoration: none;
  background: var(--red-soft); color: var(--red);
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, .chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.primary { width: 100%; background: var(--red); color: #fff; }
.btn.primary.done { background: var(--green); }

/* ===== Stays ===== */
.stays { display: grid; gap: 12px; }
.stay { margin: 0; }
.stay.home { background: var(--gold-soft); box-shadow: none; }
.stay-night { font-size: 13px; font-weight: 700; color: var(--red); }
.stay h3 { font-size: 17px; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.stay .en { font-size: 14px; color: var(--muted); }
.addr {
  margin-top: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.5;
  background: var(--bg); border-radius: var(--r-md); overflow-wrap: anywhere;
}
.stay.home .addr { background: rgba(255,255,255,.6); }
.inout { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.inout div { border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; }
.inout span { display: block; font-size: 12px; color: var(--muted); }
.inout b { font-size: 16px; }
.stay .cost { margin-top: 10px; }

/* ===== Checklist ===== */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li + li { border-top: 1px solid var(--line); }
.checklist label {
  display: flex; gap: 12px; align-items: flex-start;
  min-height: var(--tap); padding: 10px 0; cursor: pointer; font-size: 15px;
}
.checklist input { flex: none; margin: 2px 0 0; width: 22px; height: 22px; accent-color: var(--red); }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }

footer { text-align: center; padding: 8px var(--gutter) calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; }

/* ===== Larger screens ===== */
@media (min-width: 640px) {
  .hero h1 { font-size: 36px; }
  .card { padding: 22px 24px; }
  .sum-sub { grid-template-columns: 1fr 1fr; }
  .stays { grid-template-columns: 1fr 1fr; }
  .stay.home { grid-column: 1 / -1; }
  .day-nav { margin-left: 0; margin-right: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
