/* บินไหนดี — สีฟ้าท้องฟ้า + เหลืองแดด, Prompt (หัวข้อ) + Sarabun (เนื้อหา), มือถือเป็นหลัก */
:root {
  --sky: #2b8fe0;
  --sky-dark: #0b5cab;
  --sky-soft: #e6f2fc;
  --sun: #ffc83d;
  --sun-soft: #fff4d6;
  --ink: #17263a;
  --muted: #5d6f84;
  --line: #dbe6f1;
  --bg: #f4f9ff;
  --card: #ffffff;
  --cheap: #2fa66a;   --cheap-bg: #e3f6ec;
  --mid: #c99400;     --mid-bg: #fff4d6;
  --pricey: #d9534f;  --pricey-bg: #fde8e7;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(11, 92, 171, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 "Sarabun", system-ui, sans-serif;
}
h1, h2, h3, .brand, .btn, .chip, .price { font-family: "Prompt", "Sarabun", sans-serif; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .4em; font-weight: 600; }
a { color: var(--sky-dark); }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* header */
.top {
  background: linear-gradient(160deg, var(--sky) 0%, var(--sky-dark) 100%);
  color: #fff; padding: 14px 0 22px; border-radius: 0 0 24px 24px;
}
.top .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 22px; font-weight: 600; }
.brand svg { width: 30px; height: 30px; }
.brand b { color: var(--sun); font-weight: 600; }
.nav a { color: #fff; text-decoration: none; font-size: 14px; margin-left: 12px; opacity: .92; }
.nav a.on { font-weight: 600; opacity: 1; border-bottom: 2px solid var(--sun); }
.hero { margin-top: 14px; }
.hero h1 { font-size: 24px; color: #fff; }
.hero p { margin: 0; opacity: .9; font-size: 15px; }

/* controls */
.seg { display: inline-flex; background: rgba(255,255,255,.18); border-radius: 999px; padding: 4px; margin-top: 14px; }
.seg button {
  border: 0; background: transparent; color: #fff; padding: 8px 16px; border-radius: 999px;
  font: 500 15px "Prompt", sans-serif; cursor: pointer;
}
.seg button.on { background: #fff; color: var(--sky-dark); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.chip.on { border-color: var(--sky); background: var(--sky-soft); color: var(--sky-dark); font-weight: 500; }

/* notice */
.note {
  background: var(--sun-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px;
  color: #6b5200; margin: 14px 0;
}
.muted { color: var(--muted); font-size: 14px; }

/* deal cards */
.list { display: grid; gap: 12px; margin: 8px 0 24px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.deal { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.deal h3 { font-size: 18px; margin: 0; }
.deal .sub { color: var(--muted); font-size: 14px; }
.price { font-size: 22px; font-weight: 600; color: var(--sky-dark); text-align: right; }
.badge {
  display: inline-block; background: var(--cheap-bg); color: var(--cheap); font: 500 12px "Prompt", sans-serif;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px;
}
.deal .actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 10px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; padding: 10px 14px; font-size: 15px; font-weight: 500;
  cursor: pointer; text-decoration: none; min-height: 44px;
}
.btn-sun { background: var(--sun); color: var(--ink); flex: 1; }
.btn-ghost { background: var(--sky-soft); color: var(--sky-dark); }
.btn-sky { background: var(--sky); color: #fff; }
.btn-line { background: #06c755; color: #fff; width: 100%; font-size: 17px; }
.btn-tg { background: #229ed9; color: #fff; }
.btn-danger { background: transparent; color: var(--pricey); padding: 6px 8px; min-height: 0; }
.btn[disabled] { opacity: .5; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.cal-head h2 { font-size: 18px; margin: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 2px; }
.day {
  aspect-ratio: 1 / 1.1; border-radius: 10px; background: var(--card); border: 0; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: inherit;
  color: var(--ink); cursor: pointer;
}
.day .d { font-size: 13px; }
.day .p { font: 500 11px "Prompt", sans-serif; }
.day.empty { background: transparent; cursor: default; }
.day.none { color: #b4c0cd; cursor: default; }
.day.cheap { background: var(--cheap-bg); } .day.cheap .p { color: var(--cheap); }
.day.mid { background: var(--mid-bg); } .day.mid .p { color: var(--mid); }
.day.pricey { background: var(--pricey-bg); } .day.pricey .p { color: var(--pricey); }
.day.sel { outline: 2.5px solid var(--sky); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin: 10px 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 4px; vertical-align: -1px; }

/* forms */
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
select, input[type=number] {
  width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); min-height: 46px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.switch:first-of-type { border-top: 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--sky); }
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.alert-row:first-child { border-top: 0; }

/* sheet (รายละเอียดวัน) */
.sheet { position: fixed; inset: auto 0 0 0; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.12);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .25s; z-index: 10; }
.sheet.open { transform: none; }

/* legal pages */
.doc { background: #fff; border-radius: var(--radius); padding: 18px; margin: 16px 0 24px; box-shadow: var(--shadow); }
.doc h2 { font-size: 18px; margin-top: 1.2em; }
.doc li { margin: 4px 0; }

/* ทางเลือกเมืองอื่น (หน้าปฏิทิน) */
.alt-h { font: 600 15px "Prompt", sans-serif; margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.alts { display: grid; gap: 8px; }
.alt {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  background: var(--sky-soft); border: 0; border-radius: 12px; padding: 10px 12px; text-align: left;
  font: inherit; color: var(--ink); cursor: pointer;
}
.alt-p { font: 600 17px "Prompt", sans-serif; color: var(--sky-dark); text-align: right; white-space: nowrap; }
.alt .save { font: 500 12px "Prompt", sans-serif; color: var(--cheap); }

footer { text-align: center; font-size: 13px; color: var(--muted); padding: 8px 16px 32px; }
footer a { color: var(--muted); margin: 0 6px; }
.empty-state { text-align: center; padding: 28px 12px; color: var(--muted); }
