/* ==========================================================================
   BotFlights - หน้าค้นหา (index) - ธีม "Refined Sky"
   ฟอนต์ Anuphan + Plus Jakarta Sans (self-host woff2 -> CSP-safe ไม่เรียก CDN)
   *** อย่าเปลี่ยนชื่อ class/id - ต้องตรงกับ index.js / index.html ***
   ========================================================================== */

/* self-host fonts (variable: 1 ไฟล์/subset ครอบทุกน้ำหนัก) */
@font-face {
  font-family: 'Anuphan'; font-style: normal; font-weight: 400 700; font-display: optional;
  src: url('/static/fonts/anuphan-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Anuphan'; font-style: normal; font-weight: 400 700; font-display: optional;
  src: url('/static/fonts/anuphan-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600 800; font-display: optional;
  src: url('/static/fonts/jakarta-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600 800; font-display: optional;
  src: url('/static/fonts/jakarta-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy: #0a2540;
  --navy-2: #13457d;
  --blue: #0770e3;
  --blue-dark: #0559b3;
  --blue-soft: rgba(7, 112, 227, 0.12);
  --green: #05836b;
  --green-dark: #036b48;
  --green-soft: #e6f4ee;
  --red: #c8102e;
  --red-soft: #fdeef0;
  --bg: #f4f7fb;
  --card: #ffffff;
  --border: #e6ecf4;
  --border-input: #d3dce6;
  --text: #14181f;
  --muted: #67748a;
  --shadow: 0 1px 3px rgba(10, 37, 64, 0.08), 0 12px 32px rgba(10, 37, 64, 0.08);
  --shadow-lift: 0 1px 3px rgba(10, 37, 64, 0.08), 0 16px 40px rgba(10, 37, 64, 0.10);
  --font-body: "Anuphan", "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif;
  --font-disp: "Plus Jakarta Sans", "Anuphan", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
/* กัน element ที่มี hidden โผล่ (เช่น form { display:flex } ไป override [hidden]) */
[hidden] { display: none !important; }
/* กัน scroll แนวนอนบนมือถือ - ต้องใส่ทั้ง html และ body (iOS Safari ใช้ html เป็น
   scroll container จริง ใส่แค่ body เพียวไม่พอ) */
/* html { background } เฉยๆ ไม่พอสำหรับ Safari มือถือจริง - overflow-x:hidden บน html
   (จำเป็นกันเครื่องบินตกแต่งดันให้ scroll แนวนอน) ทำให้ Safari ไม่ propagate พื้นหลัง html
   เข้าไปในโซน elastic overscroll (ลากดึงเกินขอบบนตอน pull-to-refresh) เจอขาวโพล่งอยู่ดี
   ทั้งที่ตั้ง background ไว้แล้ว (ผู้ใช้ทดสอบจริงบน Safari ก.ค. 2026) แก้ด้วย fixed
   pseudo-element ปักหลังทุกอย่าง สูง 100vh วางเหนือขอบจอพอดี (top:-100vh ชนขอบล่างที่ y=0)
   ไม่ผูกกับ document scroll เลยจึงไม่โดน quirk เดียวกัน */
html { overflow-x: hidden; width: 100%; background: var(--navy); }
body::before {
  content: "";
  position: fixed;
  top: -100vh; left: 0; right: 0; height: 100vh;
  background: var(--navy);
  z-index: -1;
  pointer-events: none;
}
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-disp); letter-spacing: -0.01em; }

/* ---- hero: แถบหัวน้ำเงิน + การ์ดฟอร์มลอยซ้อนขึ้นด้วย margin ติดลบ ---- */
.hero {
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(78, 150, 232, 0.55), transparent 55%),
    linear-gradient(150deg, var(--navy) 20%, var(--navy-2) 75%, #1e5aa0 100%);
  padding: 20px 16px 80px;
  color: #fff;
}
.hero-inner { max-width: 520px; margin: 0 auto; }
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-brand { font-family: var(--font-disp); font-weight: 800; font-size: 1.9rem; color: #fff; text-decoration: none; letter-spacing: 0.01em; position: relative; top: 10px; }
.hero-brand span { color: var(--sky, #82b4f2); }
.hero h1 {
  margin: 22px 0 6px;
  font-size: 1.62rem;
  font-weight: 800;
  color: #fff;
}
.hero-sub { margin: 0; font-size: 0.9rem; color: rgba(255, 255, 255, 0.72); }
.top-links { text-align: right; position: relative; top: 10px; }
.top-links a {
  display: inline-block;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  margin-left: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  transition: background 0.15s;
}
.top-links a:hover { background: rgba(255, 255, 255, 0.12); }

.card { max-width: 552px; margin: -48px auto 0; padding: 0 16px 28px; }

/* ส่วนค้นหารายเดือน - การ์ดเต็มกว้างใต้ฟอร์มรายวัน (ซ่อนบนมือถือ - ผู้ใช้ขอ ก.ค. 2026) */
.col-head { font-family: var(--font-disp); font-size: 1.02rem; font-weight: 800; margin: 0 0 14px; }
.month-block {
  margin-top: 24px;
  padding: 20px 20px 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(10, 37, 64, 0.06);
}
.month-block .month-body { padding: 0; }
.month-block .month-body .results { margin-top: 20px; }
.month-block .month-body .results h2 { margin: 0 0 30px; }
@media (max-width: 768px) {
  /* มือถือตัดค้นหารายเดือนออก (ผู้ใช้ขอ ก.ค. 2026) - ยังใช้ได้บนเดสก์ท็อป */
  .month-block { display: none; }
}
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
}
.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
select, input {
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(10, 37, 64, 0.04);   /* นุ่มละมุนเข้าชุดกล่อง dropdown */
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:hover, input:hover { border-color: #c4d0de; }
select:focus, input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.date-field input { cursor: pointer; background: #fff; }
.date-picker {
  display: none;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.date-picker.show { display: block; }
.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 0.92rem;
}
.date-picker-header button {
  width: 34px; height: 34px;
  margin: 0; padding: 0;
  border: none;
  background: #eef3f9;
  border-radius: 10px;
  box-shadow: none;   /* กัน generic button box-shadow (เงาฟ้าใหญ่) มาทับ */
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
}
.date-picker-header button:hover { background: #e2eaf3; }
.date-picker-weekdays, .date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}
.date-picker-weekdays span { font-size: 0.72rem; color: #9aa8ba; padding: 4px 0; }
.date-picker-days button {
  height: 38px; width: 100%; min-width: 0;
  margin: 0; padding: 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  box-shadow: none;   /* กัน generic button box-shadow (เงาฟ้าใหญ่) - ให้แบนเรียบ */
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.date-picker-days button:hover:not(:disabled) { background: #eef3f9; }
.date-picker-days button:disabled { color: #ccd3db; cursor: not-allowed; }
.date-picker-days button.selected { background: var(--blue); color: #fff; font-weight: 700; }

.time-range { display: flex; align-items: center; gap: 8px; }
.time-range select { flex: 1; min-width: 0; }

/* gap กว้างพอให้ปุ่มสลับ (36px) อยู่ในช่องว่างกลาง ไม่คร่อมทับ input
   (hit-area สี่เหลี่ยมของปุ่มเคยกินขอบช่อง เลยคลิก/ชี้โดนปุ่มแทนช่อง) */
.route-row { display: flex; gap: 46px; position: relative; }
.route-row .field { flex: 1; min-width: 0; }
/* ปุ่มสลับต้นทาง-ปลายทาง - หมุน 180 องศาตอน hover */
.swap-btn {
  position: absolute;
  top: 29px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 40px; height: 40px;
  margin: 0; padding: 0;
  border: 1px solid var(--border-input);
  border-radius: 11px;
  background: #fff;
  color: var(--navy);
  font-size: 1rem; line-height: 1;
  box-shadow: none;   /* กัน generic button box-shadow (เงาฟ้าใหญ่) มาทับ */
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.swap-btn:hover {
  background: #fff;   /* กัน generic button:hover (น้ำเงิน) ที่ specificity สูงกว่ามาทับ */
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: none;
  transform: translateX(-50%) rotate(180deg);
}

/* ---- กล่องเลือกสนามบิน ---- */
.ap-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  z-index: 40;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}
/* กล่องสนามบินเป็น combobox (คลิกเปิดรายการได้) - ใช้ pointer (มือ) ให้เห็นชัด
   แทน I-beam เส้นบางที่มองหายง่าย พิมพ์ค้นหาได้ตามปกติ */
.ap-input { cursor: pointer; }
.ap-panel.show { display: block; }
.ap-group { padding: 8px 10px 4px; font-size: 0.85rem; font-weight: 700; color: var(--text); }
.ap-item { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px 9px 22px; border-radius: 8px; font-size: 0.9rem; cursor: pointer; }
.ap-item:hover { background: #eef4fb; }
.ap-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-code { flex: none; font-size: 0.78rem; font-weight: 700; color: #7a8b9a;
  background: #f1f5fa; border-radius: 6px; padding: 2px 7px; letter-spacing: 0.02em; }
.ap-empty { padding: 12px 10px; font-size: 0.85rem; color: #9aa8ba; text-align: center; }

/* ชิปบอกสนามบินจริงของแถว - โผล่เฉพาะโหมด "เมือง (ทุกสนามบิน)" ที่รวมผลหลายสนามบิน
   ไว้ด้วยกัน ต้องอ่านออกทันทีว่าเที่ยวนี้ออกจากสุวรรณภูมิหรือดอนเมือง */
.flight-airports { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px;
  font-size: 0.78rem; color: var(--muted); }
.ap-chip { background: var(--blue-soft); color: var(--blue-dark); border-radius: 6px;
  padding: 1px 7px; font-weight: 600; white-space: nowrap; }

/* ---- custom dropdown แทน native <select> (มุมมนเข้าชุดกล่องสนามบิน) ---- */
.cs { position: relative; width: 100%; }
.time-range .cs { flex: 1; min-width: 0; }
.cs-trigger {
  width: 100%; height: 46px; margin: 0; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border); border-radius: 14px;
  background: #fff; color: var(--text);
  font-size: 0.95rem; font-weight: 400; font-family: inherit; text-align: left;
  box-shadow: 0 1px 2px rgba(10, 37, 64, 0.04);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cs-trigger:hover { background: #fff; border-color: #c4d0de; transform: none; }
.cs-trigger.open { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.cs-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-chev { flex: 0 0 auto; color: #9aa8ba; font-size: 1rem; line-height: 1; transition: transform 0.15s; }
.cs-trigger.open .cs-chev { transform: rotate(180deg); }
.cs-panel {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; padding: 4px;
}
.cs-panel.show { display: block; }
.cs-item { padding: 9px 12px; border-radius: 8px; font-size: 0.9rem; cursor: pointer; }
.cs-item:hover { background: #eef4fb; }
.cs-item.sel { background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; }
.cs-item.disabled { color: #c0c8d2; cursor: default; }
.cs-item.disabled:hover { background: transparent; }

button {
  margin-top: 4px;
  height: 50px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: var(--font-disp);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(7, 112, 227, 0.28);
  transition: background 0.15s, transform 0.12s;
}
button:hover { background: var(--blue-dark); transform: translateY(-1px); }
button:disabled { opacity: 0.7; cursor: wait; transform: none; }
/* จุดกระเด้งระหว่างค้นหา (ปุ่มโชว์ "กำลังค้นหา" + 3 จุดเด้งไล่กัน) */
.ld { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.ld > span { width: 4px; height: 4px; border-radius: 50%; background: currentColor;
  animation: ldbounce 1s infinite ease-in-out; }
.ld > span:nth-child(2) { animation-delay: 0.15s; }
.ld > span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ldbounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ld > span { animation: none; } }
.alert-button { display: none; background: var(--green); box-shadow: 0 8px 20px rgba(5, 131, 107, 0.25); }
.alert-button.show { display: block; }
.alert-button:hover { background: var(--green-dark); }

.error {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.9rem;
  text-align: center;
}

.results { margin-top: 26px; }
.results h2 { font-size: 1rem; color: var(--text); margin: 0 0 12px; font-weight: 800; }

.rt-summary {
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1.5px solid #9be0c4;
  border-radius: 14px;
  background: linear-gradient(180deg, #f2fdf8, #fff);
}
.rt-summary-title { font-size: 1rem; font-weight: 800; color: var(--green); }
.rt-summary-sub { margin-top: 2px; font-size: 0.8rem; color: var(--muted); }
.leg-note { margin: 0 0 10px; font-size: 0.78rem; color: #9aa8ba; }
.rt-return-head { margin-top: 22px !important; }

/* overflow-anchor:none กัน browser scroll anchoring คำนวณตำแหน่ง scroll พลาดตอนกด ▾
   แล้วแผงตัวเลือกการจองโผล่ (เนื้อหาโตขึ้นทันที) - เกิดชัดตอนเที่ยวอยู่ใกล้ขอบล่างจอ
   กระโดดไปบนสุดผิดที่ (เจอทั้งมือถือ/คอม พบจากทดสอบจริง ก.ค. 2026) */
.flight-list { display: flex; flex-direction: column; gap: 11px; overflow-anchor: none; }
.flight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.flight-row:hover { border-color: #c4d3e3; box-shadow: 0 4px 14px rgba(10, 37, 64, 0.10); }
.flight-row.cheapest {
  border: 1.5px solid #9be0c4;
  background: linear-gradient(180deg, #f2fdf8, #fff);
  box-shadow: 0 6px 18px rgba(5, 131, 107, 0.10);
}
.flight-row.soldout { opacity: 0.55; }

/* ปุ่มกางตัวเลือกการจอง */
.bo-toggle {
  flex: 0 0 auto;
  margin: 0 0 0 4px;
  width: 32px; height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: #9aa8ba;
  font-size: 0.9rem; font-weight: 400;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.15s, color 0.15s;
}
.bo-toggle:hover { border-color: var(--blue); color: var(--blue); background: #fff; transform: none; }
/* ไฮไลต์ตอนกำลังดึงราคาจาก Google (panel ยังซ่อนอยู่ - โผล่ครั้งเดียวตอนข้อมูลพร้อม
   กันกระตุกจากโชว์ own-row -> "กำลังโหลด" -> แถวจริง เป็น 3 จังหวะ) ไม่หมุน (ผู้ใช้ขอ
   เอาแอนิเมชันหมุนออก ก.ค. 2026) */
.bo-toggle.bo-loading { color: var(--blue); border-color: var(--blue); }
.flight-row.cheapest .bo-toggle { border-color: #cfe6dc; color: var(--green); }
.bo-toggle.open { transform: rotate(180deg); }

.booking-options {
  margin: -6px 0 2px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 14px 14px;
  background: #fafcfe;
  font-size: 0.88rem;
}
/* ไม่มีเนื้อหา (ยังไม่กาง/ไม่มีตัวเลือก) = ไม่ต้องโชว์กล่องเปล่า */
.booking-options:empty { display: none; }
.bo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 118px;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid #eef2f6;
}
.bo-row:last-child { border-bottom: none; }
.bo-row:hover { background: #f2f6fb; border-radius: 10px; }
/* ชื่อ (bo-name-text) กับ tag "สายการบิน" แยกกันคนละ element - ให้ตัดคำเฉพาะชื่อ
   (ยาวได้ไม่จำกัด) โดย tag คงเต็มรูปเสมอ ไม่โดนตัดคำไปด้วย (เคยอยู่บรรทัดเดียวกัน
   ทำให้จอแคบ ellipsis ตัดเข้าไปกลาง tag กลายเป็น "สายการ..." - พบจากทดสอบมือถือจริง) */
.bo-name { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text); }
.bo-row.bo-air .bo-name { font-weight: 600; }
.bo-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bo-name .bo-airline-tag {
  flex-shrink: 0;
  padding: 1px 7px;
  border: 1px solid #9ad9bd;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--green);
  white-space: nowrap;
}
.bo-price { font-weight: 600; color: #55606c; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.bo-price.best { color: var(--green); }
.bo-price .bo-baht { font-size: 0.72rem; font-weight: 400; color: #9aa8ba; margin-left: 3px; }
.bo-link {
  justify-self: end;
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid #b9d4f3;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.bo-link:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.bo-nolink { justify-self: end; color: #b7bfc8; font-size: 0.78rem; }
/* แถวสายตัวเอง: ราคา (คอลัมน์กลาง) ซ่อนไว้เป็นค่าเริ่มต้น (ดู index.html/index.js) -
   ปักคอลัมน์ชัดเจนให้ปุ่ม "ไปเว็บสายการบิน" อยู่คอลัมน์ 3 เสมอ ไม่งั้น grid auto-place
   จะเลื่อนปุ่มมาแทนคอลัมน์ 2 ตอนราคายังซ่อนอยู่ (เพราะ display:none ไม่กินคอลัมน์)
   ทำให้เหลือช่องว่างว่างเปล่าทางขวาแทน */
.bo-row-own .bo-own-price { grid-column: 2; }
.bo-row-own .bo-link { grid-column: 3; }
.bo-loading, .bo-error { padding: 8px 4px; color: #8b95a1; }
.bo-error { color: var(--red); }
@media (max-width: 520px) {
  .bo-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 8px 6px; }
  .bo-link { padding: 4px 10px; font-size: 0.74rem; }
}

.flight-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.flight-code { font-weight: 700; font-size: 1rem; color: var(--text); }
.flight-airline {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  vertical-align: 1px;
}
.flight-time { font-size: 0.83rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.flight-price-wrap { text-align: right; flex-shrink: 0; }
/* ราคาชิดขวา - เขียว = ถูกสุด */
.flight-price {
  font-family: var(--font-disp);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
.flight-row.cheapest .flight-price { color: var(--green); }
/* เที่ยวที่ยังไม่เช็ค OTA sync (ทุกเที่ยวยกเว้นถูกสุด) - เบลอราคาไว้ก่อน (ราคาตั้งต้นอาจไม่ตรงจริง)
   ระหว่างรอ JS เช็คเบื้องหลัง (ดู index.js) จาง+เบลอบอกผู้ใช้ว่ายังไม่นิ่ง กะพริบเบาๆ
   ให้รู้ว่ากำลังโหลดอยู่ ไม่ใช่ค้าง (ผู้ใช้ขอ ก.ค. 2026) */
.flight-price.price-pending {
  filter: blur(3.5px);
  opacity: 0.55;
  transition: filter 0.35s ease, opacity 0.35s ease;
  animation: price-pending-pulse 1.6s ease-in-out infinite;
}
@keyframes price-pending-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.8; } }
@media (prefers-reduced-motion: reduce) { .flight-price.price-pending { animation: none; } }
.flight-price .baht { font-size: 0.68rem; font-weight: 600; color: #9aa8ba; margin-left: 2px; }
.flight-row.cheapest .flight-price .baht { color: #5aa88f; }
.cheapest-badge {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 600;
}
.flight-soldout-label { font-size: 0.85rem; color: #9aa8ba; font-weight: 600; }
.empty { margin-top: 24px; text-align: center; color: #8b95a1; font-size: 0.9rem; }

.alert-box {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f6f9fc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.checkbox-row { display: flex; align-items: center; gap: 9px; }
.checkbox-row input[type="checkbox"] {
  width: auto; height: auto;
  accent-color: var(--green);
  box-shadow: none !important;
}
.checkbox-row label { font-size: 0.9rem; color: var(--text); margin: 0; font-weight: 400; }
#alert_price_field, #alert_email_field, #month_email_field, #month_price_field { display: none; }
#alert_price_field.show, #alert_email_field.show, #month_email_field.show, #month_price_field.show { display: block; }

.notice {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.87rem;
  text-align: center;
}

/* ---- ส่วนค้นหาทั้งเดือน ---- */
.month-body { padding: 0 20px 14px; display: flex; flex-direction: column; gap: 14px; }
.month-body .results h2 { margin-bottom: 22px; }  /* เว้นหัวเดือนกับปฏิทินให้ห่างขึ้น */
#month-form { padding: 0; border: none; border-radius: 0; box-shadow: none; }
.section-desc { margin: 0; font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* ปฏิทินราคารายวันทั้งเดือน - เขียวเข้ม=ถูกสุด เขียวอ่อน=ใกล้เคียง ขาว=กลาง ส้ม=แพงสุด */
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.month-grid-wd { text-align: center; font-size: 0.68rem; color: #9aa8ba; padding-bottom: 2px; }
.month-day {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 7px 2px;
  text-align: center;
}
/* เขียวเฉพาะวันถูกสุดพอ - วันอื่นเป็นกลาง (ไม่ไล่เฉดเขียว) แพงสุดคงป้ายส้มไว้ */
.month-day.cheapest { border: 1px solid #6dc39a; background: #dff5ea; }
.month-day.cheapest .month-day-price { color: var(--green); }
.month-day.priciest { border: 1px solid #f2cfae; background: #fef4ea; }
.month-day.priciest .month-day-price { color: #c05f10; }
.month-day.soldout { opacity: 0.5; }
.month-day-date { font-size: 0.72rem; font-weight: 600; color: #55606c; }
.month-day-price { margin-top: 2px; font-size: 0.78rem; font-weight: 700; color: #55606c; font-variant-numeric: tabular-nums; }
.month-day-none { margin-top: 2px; font-size: 0.76rem; color: #ccd3db; }
.month-day-al { margin-top: 1px; font-size: 0.55rem; color: #9aa8ba; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-day.clickable { cursor: pointer; }
.month-day.clickable:hover { box-shadow: 0 0 0 2px var(--blue-soft), 0 2px 8px rgba(10, 37, 64, 0.10); }
/* วันที่ยังรอผลจาก /search-month/progress (poll เบื้องหลัง) - แท่งเทาสั่นเบาๆ แทน
   ตำแหน่งราคา บอกว่ากำลังโหลด ไม่ใช่ค้าง (ผู้ใช้ขอ ค้นทั้งเดือนแบบ async ก.ค. 2026) */
.month-day-skeleton {
  margin: 5px auto 0; width: 60%; height: 11px; border-radius: 4px;
  background: #e7ecf2; animation: monthDaySkeletonPulse 1.3s ease-in-out infinite;
}
@keyframes monthDaySkeletonPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .month-day-skeleton { animation: none; } }
/* จอแคบ: ตัวเลขเล็กไปอ่านยาก (7 คอลัมน์เท่ากันบีบทุกจอ) - ขยายฟอนต์ + ลด gap ให้มี
   ที่เหลือมากขึ้น (พบจากทดสอบมือถือจริง ก.ค. 2026) */
@media (max-width: 480px) {
  .month-grid { gap: 4px; }
  .month-day { padding: 9px 2px; border-radius: 9px; }
  .month-grid-wd { font-size: 0.72rem; }
  .month-day-date { font-size: 0.82rem; }
  .month-day-price { font-size: 0.86rem; margin-top: 3px; }
}
/* กระพริบสีตาม tier เดิมของช่อง (เขียว/ส้ม/น้ำเงิน) - ตั้งตัวแปรสีต่อ tier แล้ว
   keyframe เดียวอ่านตัวแปรใช้ร่วมกัน ไม่ต้องแยก keyframe ต่อสี */
.month-day.loading {
  --blink: var(--blue);
  --blink-soft: var(--blue-soft);
  --blink-bg: #eaf2fd;
  animation: monthDayBlink 0.7s ease-in-out infinite;
}
.month-day.cheapest.loading { --blink: var(--green); --blink-soft: #6dc39a; --blink-bg: #dff5ea; }
.month-day.priciest.loading { --blink: #c05f10; --blink-soft: #f2cfae; --blink-bg: #fef4ea; }
@keyframes monthDayBlink {
  0%, 100% { box-shadow: 0 0 0 2px var(--blink); background: var(--blink-bg); }
  50% { box-shadow: 0 0 0 2px var(--blink-soft); background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  .month-day.loading { animation: none; box-shadow: 0 0 0 2px var(--blink); }
}

/* ป้าย price insights จาก Google */
.gi-card {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  border: 1px solid var(--border);
}
.gi-card .gi-src {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}
.gi-low { background: var(--green-soft); color: var(--green); border-color: #9be0c4; }
.gi-high { background: #fef4ea; color: #c05f10; border-color: #f2cfae; }
.gi-typical { background: #eef3f9; color: #55606c; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
