/* ===================== tokens ===================== */
:root {
  --brand: #1d4ed8;        /* น้ำเงินหลัก: ปุ่ม ลิงก์ */
  --brand-ink: #1e40af;    /* hover */
  --brand-2: #3b82f6;      /* ไอคอน เส้น */
  --brand-soft: #eff6ff;   /* พื้นอ่อน */
  --brand-soft-2: #dbeafe;
  --accent: #f59e0b;       /* ไฮไลต์เล็กๆ เท่านั้น */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-2: #f6f9fc;
  --card: #ffffff;
  --hero-1: #1e3a8a;
  --hero-2: #1d4ed8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 6px 24px rgb(15 23 42 / .06);
  --shadow-lg: 0 12px 40px rgb(30 58 138 / .18);
  --font: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #60a5fa; --brand-ink: #93c5fd; --brand-2: #60a5fa;
    --brand-soft: #172036; --brand-soft-2: #1e2a47;
    --ink: #e8edf5; --ink-2: #c3cbd8; --muted: #94a0b4; --line: #263042;
    --bg: #0d1220; --bg-2: #111827; --card: #151d2e;
    --hero-1: #0f1d45; --hero-2: #1a3a8f;
    --shadow: none; --shadow-lg: 0 12px 40px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #60a5fa; --brand-ink: #93c5fd; --brand-2: #60a5fa;
  --brand-soft: #172036; --brand-soft-2: #1e2a47;
  --ink: #e8edf5; --ink-2: #c3cbd8; --muted: #94a0b4; --line: #263042;
  --bg: #0d1220; --bg-2: #111827; --card: #151d2e;
  --hero-1: #0f1d45; --hero-2: #1a3a8f;
  --shadow: none; --shadow-lg: 0 12px 40px rgb(0 0 0 / .4);
  color-scheme: dark;
}

/* ===================== base ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; font: 400 16.5px/1.7 var(--font); color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; }
h1, h2, h3 { line-height: 1.3; margin: 0; overflow-wrap: anywhere; font-weight: 700; letter-spacing: -.005em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
img { max-width: 100%; display: block; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }

/* ===================== header ===================== */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 19px; white-space: nowrap; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #2563eb, #1e3a8a); display: grid; place-items: center; flex: none; }
.logo b { color: var(--brand); font-weight: 700; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink-2); font-weight: 500; font-size: 15.5px; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.top-cta { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: #fff; font-weight: 600; font-size: 15px; padding: 9px 16px; border-radius: 999px; white-space: nowrap; }
.top-cta:hover { background: var(--brand-ink); color: #fff; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; color: var(--ink); cursor: pointer; }
@media (max-width: 960px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 64px; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .menu-btn { display: grid; place-items: center; }
  .top-cta { display: none; }
}

/* ===================== hero ===================== */
.hero { position: relative; color: #fff; background: radial-gradient(1200px 500px at 85% -10%, rgb(96 165 250 / .45), transparent 60%), linear-gradient(160deg, var(--hero-1), var(--hero-2)); overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto 0 -1px 0; height: 64px; background: var(--bg); clip-path: ellipse(70% 100% at 50% 100%); }
.hero .wrap { position: relative; z-index: 1; padding: 52px 0 104px; display: grid; grid-template-columns: 1fr auto; gap: 28px 48px; align-items: end; }
.hero .search-card { grid-column: 1 / -1; }
.hero-stats { margin-top: 0 !important; display: grid !important; grid-template-columns: repeat(2, auto); gap: 14px 36px !important; padding: 18px 24px; border-radius: 16px; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .16); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .2); padding: 5px 12px; border-radius: 999px; }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgb(74 222 128 / .25); }
.hero h1 { font-size: clamp(30px, 4.6vw, 48px); margin: 18px 0 14px; }
.hero h1 span { color: #fcd34d; }
.hero-lead { font-size: 18px; color: rgb(255 255 255 / .86); max-width: 34em; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 28px; font-weight: 700; line-height: 1.2; }
.hero-stats small { font-size: 14px; color: rgb(255 255 255 / .75); }

.search-card { background: var(--card); color: var(--ink); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-lg); }
.search-card h2 { font-size: 19px; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.search-card > p { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }
#busx-search-form { min-height: 220px; }
.search-trust { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--ink-2); }
.search-trust span { display: inline-flex; align-items: center; gap: 6px; }
.search-trust svg { color: #16a34a; flex: none; }
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; padding: 36px 0 88px; gap: 24px; }
  .hero-stats { grid-template-columns: repeat(4, auto) !important; justify-content: space-between; padding: 14px 16px; gap: 8px 16px !important; }
  .hero-stats b { font-size: 22px !important; }
  .hero-stats small { font-size: 12.5px !important; }
}

/* ===================== sections ===================== */
section { padding: 56px 0; }
.sec-alt { background: var(--bg-2); }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.sec-head h2 { font-size: clamp(22px, 3vw, 28px); }
.sec-head p { color: var(--muted); margin-top: 4px; }
.more { font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* ---- destination cards (ภาพ) ---- */
.dest-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.dest { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 4; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; isolation: isolate; box-shadow: var(--shadow); transition: transform .2s ease; }
.dest:hover { transform: translateY(-3px); color: #fff; }
.dest img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .4s ease; }
.dest:hover img { transform: scale(1.05); }
.dest::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgb(15 23 42 / .85)); }
.dest small { font-size: 13px; opacity: .85; }
.dest h3 { font-size: 21px; margin: 2px 0 6px; }
.dest .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 12.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: rgb(255 255 255 / .18); backdrop-filter: blur(6px); }
@media (max-width: 1024px) { .dest-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
  .dest-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .dest { scroll-snap-align: start; }
}

/* ---- route list ---- */
.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.route { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.route:hover { border-color: var(--brand-2); box-shadow: var(--shadow); color: var(--ink); }
.route-line { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.route-line i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--brand-2); }
.route-line i:last-child { background: var(--brand-2); }
.route-line span { width: 2px; height: 14px; background: repeating-linear-gradient(var(--brand-2) 0 3px, transparent 3px 6px); }
.route-txt { flex: 1; min-width: 0; line-height: 1.45; }
.route-txt b { display: block; font-weight: 600; }
.route-txt small { color: var(--muted); font-size: 13.5px; }
.route-n { text-align: right; flex: none; }
.route-n b { display: block; color: var(--brand); font-size: 18px; line-height: 1.2; }
.route-n small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 960px) { .route-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .route-grid { grid-template-columns: 1fr; } }

/* ---- regions ---- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.tab { flex: none; font: 500 15px var(--font); padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab small { opacity: .7; margin-left: 4px; }
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.prov { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.prov:hover { border-color: var(--brand-2); color: var(--brand); }
.prov small { color: var(--muted); font-weight: 400; font-size: 13px; white-space: nowrap; }

/* ---- stations ---- */
.st-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.st { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; color: var(--ink); }
.st:hover { border-color: var(--brand-2); color: var(--ink); }
.st-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.st-txt { flex: 1; min-width: 0; line-height: 1.45; }
.st-txt b { display: block; font-weight: 600; }
.st-txt small { color: var(--muted); font-size: 13.5px; }
.st-n { flex: none; text-align: right; }
.st-n b { color: var(--brand); font-size: 18px; display: block; line-height: 1.2; }
.st-n small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 760px) { .st-grid { grid-template-columns: 1fr; } }

/* ---- carriers ---- */
.op-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.op { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 10px 14px; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.op:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.op img { width: 64px; height: 64px; border-radius: 14px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.op b { font-weight: 600; font-size: 15px; line-height: 1.35; }
.op small { color: var(--muted); font-size: 13px; }
@media (max-width: 1024px) { .op-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .op-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- steps ---- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: 18px; right: 18px; font-size: 40px; font-weight: 700; line-height: 1; color: var(--brand-soft-2); }
.step-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; margin-bottom: 14px; }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--ink-2); font-size: 15px; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---- why + faq ---- */
.two { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: start; }
.why { display: grid; gap: 14px; }
.why-item { display: flex; gap: 14px; }
.why-item .st-ico { width: 40px; height: 40px; }
.why-item b { display: block; font-weight: 600; }
.why-item p { color: var(--ink-2); font-size: 15px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 44px 14px 16px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 16px 16px; color: var(--ink-2); }
@media (max-width: 960px) { .two { grid-template-columns: 1fr; gap: 32px; } }

/* ---- help band ---- */
.help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.help a { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius); background: var(--brand-soft); color: var(--ink); border: 1px solid transparent; }
.help a:hover { border-color: var(--brand-2); color: var(--ink); }
.help b { display: block; font-weight: 600; }
.help small { color: var(--muted); font-size: 14px; }
.help .st-ico { background: var(--card); }
@media (max-width: 860px) { .help { grid-template-columns: 1fr; } }

/* ===================== footer ===================== */
footer { background: #0b1736; color: #c7d2e5; padding: 48px 0 24px; font-size: 15px; }
footer a { color: #c7d2e5; }
footer a:hover { color: #fff; }
.foot { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.foot h3 { color: #fff; font-size: 16px; margin-bottom: 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot .logo { color: #fff; margin-bottom: 12px; }
.foot .logo b { color: #93c5fd; }
.foot p { color: #94a3c0; }
.callc { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 20px; font-weight: 700; color: #fff !important; }
.copy { border-top: 1px solid rgb(255 255 255 / .1); margin-top: 32px; padding-top: 18px; color: #7c8aa8; font-size: 14px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 860px) { .foot { grid-template-columns: 1fr 1fr; } .foot > div:first-child { grid-column: 1 / -1; } }

/* mockup only */
.mock-note { position: fixed; bottom: 12px; right: 12px; z-index: 99; background: #111827; color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 999px; opacity: .85; }
.theme-btn { position: fixed; bottom: 12px; left: 12px; z-index: 99; font: 500 13px var(--font); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }

/* =====================================================================
   หน้าเส้นทาง (คู่จังหวัด)
   ===================================================================== */
.crumb { font-size: 14px; color: rgb(255 255 255 / .75); display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 14px; }
.crumb a { color: rgb(255 255 255 / .9); }
.crumb a:hover { color: #fff; text-decoration: underline; }
.crumb span[aria-hidden] { opacity: .5; }

.p-hero { color: #fff; background: radial-gradient(900px 400px at 90% -20%, rgb(96 165 250 / .4), transparent 60%), linear-gradient(160deg, var(--hero-1), var(--hero-2)); padding: 28px 0 0; }
.p-hero .wrap { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; padding-bottom: 32px; }
.p-hero h1 { font-size: clamp(26px, 4vw, 40px); margin-bottom: 10px; }
.p-hero h1 small { display: block; font-size: .5em; font-weight: 500; color: rgb(255 255 255 / .75); margin-top: 4px; }
.p-hero .lead { color: rgb(255 255 255 / .88); max-width: 40em; }
.od { display: flex; align-items: center; gap: 12px; margin: 18px 0 16px; }
.od-pt { background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .18); border-radius: 12px; padding: 8px 14px; line-height: 1.35; }
.od-pt small { display: block; font-size: 12.5px; color: rgb(255 255 255 / .7); }
.od-pt b { font-size: 18px; }
.od-arrow { flex: none; color: #fcd34d; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; padding: 5px 12px; border-radius: 999px; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .16); }
.chip b { font-weight: 700; }

.book { background: var(--card); color: var(--ink); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-lg); }
.book h2 { font-size: 18px; margin-bottom: 12px; }
.field { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.field small { display: block; color: var(--muted); font-size: 12.5px; }
.field b { font-weight: 600; }
.field input { border: 0; padding: 0; font: 600 16px var(--font); color: var(--ink); background: none; width: 100%; outline: none; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; background: var(--brand); color: #fff; border: 0; border-radius: 12px; font: 600 17px var(--font); padding: 13px 16px; cursor: pointer; }
.btn:hover { background: var(--brand-ink); color: #fff; }
.btn-sm { display: inline-flex; width: auto; font-size: 14.5px; padding: 7px 14px; border-radius: 10px; }
.btn-ghost { background: var(--brand-soft); color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft-2); color: var(--brand-ink); }
.book-note { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }
.book-rev { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14.5px; font-weight: 500; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
@media (max-width: 960px) { .p-hero .wrap { grid-template-columns: 1fr; } }

/* page layout: content + sidebar */
.page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; padding: 32px 0 56px; align-items: start; }
.page > aside { position: sticky; top: 124px; display: grid; gap: 16px; }
.page section { padding: 0; margin-bottom: 40px; scroll-margin-top: 130px; }
.page h2 { font-size: clamp(20px, 2.6vw, 24px); margin-bottom: 6px; }
.page .sub { color: var(--muted); margin-bottom: 16px; }
@media (max-width: 1024px) { .page { grid-template-columns: minmax(0, 1fr); } .page > aside { position: static; } }

.toc-bar { position: sticky; top: 64px; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.toc { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.toc a { flex: none; font-size: 14.5px; font-weight: 500; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.toc a:hover { color: var(--brand); border-color: var(--brand-2); }

.answer { background: var(--brand-soft); border: 1px solid var(--brand-soft-2); border-left: 4px solid var(--brand); border-radius: 12px; padding: 18px 20px; }
.answer h2 { font-size: 18px !important; margin-bottom: 8px !important; }
.answer ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--ink-2); }
.answer b { color: var(--ink); }

/* booking rows */
.rows { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row:hover { background: var(--bg-2); }
.row.hidden { display: none; }
.rows.open .row.hidden { display: grid; }
.row-od { min-width: 0; line-height: 1.45; }
.row-od b { font-weight: 600; display: block; }
.row-od small { color: var(--muted); font-size: 13.5px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #dcfce7; color: #166534; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-main { background: var(--brand-soft-2); color: var(--brand-ink); }
.badge-off, :root .badge.badge-off { background: var(--bg-2) !important; color: var(--muted) !important; border: 1px solid var(--line); }
.badge-off::before { display: none; }
.h3-off { font-size: 17px; margin: 28px 0 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge:not(.badge-main) { background: #14321f; color: #86efac; } }
:root[data-theme="dark"] .badge:not(.badge-main) { background: #14321f; color: #86efac; }
@media (max-width: 640px) {
  .row, .rows.open .row.hidden { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .row .badge { grid-column: 1; grid-row: 2; justify-self: start; }
  .row .btn-sm { grid-row: 1 / span 2; grid-column: 2; }
}
.more-btn { display: block; width: 100%; padding: 12px; border: 0; border-top: 1px solid var(--line); background: var(--bg-2); color: var(--brand); font: 600 15px var(--font); cursor: pointer; }
.fine { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* map */
#map { height: 400px; border-radius: 14px; border: 1px solid var(--line); z-index: 0; background: var(--bg-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .25); }
.legend i.ln { width: 18px; height: 4px; border-radius: 2px; border: 0; box-shadow: none; vertical-align: 3px; }

/* stop lists */
.stops2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.stops2 h3 { font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-a { background: #2563eb; } .dot-b { background: #f59e0b; }
.slist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.slist li { border-top: 1px solid var(--line); }
.slist li:first-child { border-top: 0; }
.slist a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; color: var(--ink); font-size: 15px; line-height: 1.45; }
.slist a:hover { background: var(--bg-2); color: var(--brand); }
.slist small { color: var(--muted); white-space: nowrap; font-size: 13px; }
.slist li.hidden { display: none; }
.slist.open li.hidden { display: list-item; }
.slist li.mb { border-top: 1px solid var(--line); }
.slist li.mb button { border-top: 0; }
@media (max-width: 760px) { .stops2 { grid-template-columns: minmax(0, 1fr); } }

/* carriers (list) */
.ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.op2 { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); }
.op2:hover { border-color: var(--brand-2); color: var(--ink); }
.op2 img, .op2 .ph { width: 48px; height: 48px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.op2 .ph { display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.op2 div { flex: 1; min-width: 0; line-height: 1.4; }
.op2 b { font-weight: 600; display: block; }
.op2 div small { color: var(--muted); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op2 em { font-style: normal; color: var(--brand); font-weight: 700; font-size: 18px; flex: none; text-align: right; line-height: 1.2; }
.op2 em small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.ops .hidden { display: none; }
.ops.open .hidden { display: flex; }
@media (max-width: 640px) { .ops { grid-template-columns: minmax(0, 1fr); } }

/* timeline */
.tl-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.tl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.tl-head img { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; object-fit: contain; }
.tl-head div { flex: 1; }
.tl-head b { display: block; font-weight: 600; }
.tl-head small { color: var(--muted); font-size: 13.5px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 12px 30px; line-height: 1.45; }
.tl li::before { content: ""; position: absolute; left: 6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--brand-2); background: var(--card); z-index: 1; }
.tl li::after { content: ""; position: absolute; left: 11px; top: 14px; bottom: -6px; width: 2px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl li.end::before { background: var(--brand-2); }
.tl .pv { display: inline-block; font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 0 7px; margin-bottom: 2px; }
.tl a { color: var(--ink); }
.tl a:hover { color: var(--brand); }

/* route accordion */
.acc details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 8px; overflow: hidden; }
.acc summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary img, .acc summary .ph { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; object-fit: contain; flex: none; }
.acc summary .ph { display: grid; place-items: center; font-size: 13px; color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.acc summary b { flex: 1; font-weight: 600; }
.acc summary small { color: var(--muted); font-size: 13.5px; }
.acc summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px; transition: transform .2s; }
.acc details[open] summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.acc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.acc td, .acc th { text-align: left; padding: 8px 14px; border-top: 1px solid var(--line); }
.acc th { font-weight: 600; color: var(--muted); font-size: 13px; background: var(--bg-2); }
.acc td:last-child, .acc th:last-child { text-align: right; white-space: nowrap; }
.code { font-size: 12.5px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; white-space: nowrap; }

/* landmarks + related */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 14.5px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
a.tag:hover { border-color: var(--brand-2); color: var(--brand); }
.rel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.rel h3 { font-size: 16px; margin-bottom: 6px; }
.rel ul { list-style: none; margin: 0; padding: 0; }
.rel a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; color: var(--ink); font-size: 15px; border-top: 1px solid var(--line); }
.rel li:first-child a { border-top: 0; }
.rel a:hover { color: var(--brand); }
.rel small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.side-cta { background: linear-gradient(160deg, var(--hero-1), var(--hero-2)); color: #fff; border-radius: 14px; padding: 18px; }
.side-cta b { display: block; font-size: 17px; margin-bottom: 4px; }
.side-cta p { color: rgb(255 255 255 / .82); font-size: 14.5px; margin-bottom: 12px; }
.side-cta .btn { background: #fff; color: #1d4ed8; }
.side-cta .btn:hover { background: #eff6ff; color: #1e40af; }

/* sticky mobile book bar */
.mbar { display: none; }
@media (max-width: 1024px) {
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; transform: translateY(110%); transition: transform .25s ease; gap: 12px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgb(15 23 42 / .08); }
  .mbar div { flex: 1; line-height: 1.3; min-width: 0; }
  .mbar b { display: block; font-size: 15px; }
  .mbar small { color: var(--muted); font-size: 12.5px; }
  .mbar .btn { width: auto; padding: 11px 20px; flex: none; }
  .mbar.show { transform: none; }
  body.has-mbar { padding-bottom: 72px; }
  body.has-mbar .mock-note, body.has-mbar .theme-btn { bottom: 84px; }
}

/* กล่องค้นหาของระบบจอง (หน้าเส้นทาง) */
.alt-search { background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 24px 0 28px; scroll-margin-top: 64px; }
.alt-search[hidden] { display: none; }
/* รายการเลือกจังหวัดของกล่องค้นหาต้องอยู่เหนือแถบสารบัญ (sticky z 40) — ยกเฉพาะตอนใช้งาน ไม่งั้นตอนเลื่อนจะทับแถบ */
.alt-search:focus-within, .alt-search:hover { position: relative; z-index: 45; }
.alt-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 14px; }
.alt-head h2 { font-size: 20px; margin-bottom: 2px; }
.alt-head p { color: var(--muted); font-size: 14.5px; }
.alt-close { flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 16px; cursor: pointer; }
.alt-close:hover { border-color: var(--brand-2); color: var(--brand); }
#alt-search #busx-search-form { min-height: 140px; }
.book-alt { display: block; width: 100%; margin-top: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--brand); font: 500 15px var(--font); cursor: pointer; }
.book-alt:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 20px; border-radius: 14px; background: var(--brand-soft); border: 1px dashed var(--brand-2); }
.notice b { display: block; font-weight: 600; }
.notice p { color: var(--ink-2); font-size: 15px; }

/* =====================================================================
   หน้าบริษัทรถ
   ===================================================================== */
.co-hero .wrap { grid-template-columns: 1fr 460px; align-items: center; }
.co-id { display: flex; align-items: center; gap: 16px; }
.co-logo { flex: none; width: 84px; height: 84px; border-radius: 20px; background: #fff; display: grid; place-items: center; padding: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / .18); }
.co-logo img, .co-logo .ph { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.co-logo .ph { display: grid; place-items: center; font-size: 32px; font-weight: 700; color: #1d4ed8; background: #eff6ff; }
.co-id h1 { margin: 0; }
.co-en { color: rgb(255 255 255 / .75); font-size: 15px; }
.co-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.co-cta .btn { width: auto; padding: 11px 20px; font-size: 16px; }
.co-cta .btn:first-child { background: #fff; color: #1d4ed8; }
.co-cta .btn:first-child:hover { background: #eff6ff; color: #1e40af; }
.btn-line { background: transparent; border: 1px solid rgb(255 255 255 / .45); color: #fff; }
.btn-line:hover { background: rgb(255 255 255 / .1); color: #fff; }
.co-photo { margin: 0; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 16 / 10; background: rgb(255 255 255 / .08); }
.co-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 960px) {
  .co-hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .co-photo { aspect-ratio: 16 / 9; }
  .co-logo { width: 68px; height: 68px; border-radius: 16px; }
}

/* จองตามเส้นทาง: 2 คอลัมน์ */
.rows-2 .row { grid-template-columns: 1fr auto; }
@media (min-width: 1100px) {
  .rows-2 { display: grid; grid-template-columns: 1fr 1fr; }
  .rows-2 .row { border-top: 1px solid var(--line); }
  .rows-2 .row:nth-child(odd) { border-right: 1px solid var(--line); }
  .rows-2 .row:nth-child(-n+2) { border-top: 0; }
  .rows-2 .more-btn { grid-column: 1 / -1; }
}
@media (max-width: 640px) { .rows-2 .row .btn-sm { grid-row: auto; } }

/* gallery */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 150px; gap: 10px; }
.gallery .g { position: relative; border-radius: 12px; overflow: hidden; background: var(--bg-2); }
.gallery .g-main { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery .g:hover img { transform: scale(1.04); }
.gallery span { position: absolute; left: 8px; bottom: 8px; font-size: 12.5px; font-weight: 500; color: #fff; background: rgb(15 23 42 / .6); padding: 1px 8px; border-radius: 999px; }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 120px; } .gallery .g-main { grid-column: 1 / -1; grid-row: span 2; } }

/* จังหวัดตามภาค */
.pgroup { margin-bottom: 14px; }
.pgroup h3 { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.pgroup h3 small { color: var(--muted); font-weight: 400; }
.tag small { color: var(--muted); font-size: 12.5px; }

/* ตารางสายรถ */
.rt-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.rt-tools input { flex: 1; min-width: 0; font: 400 15.5px var(--font); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.rt-tools input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.rt-tools span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.rtable { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.rtable table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rtable th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg-2); padding: 9px 14px; }
.rtable td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.rtable td:first-child { width: 1%; white-space: nowrap; }
.rtable td:last-child, .rtable th:last-child { text-align: right; white-space: nowrap; color: var(--ink-2); }
.rtable td a { color: var(--ink); }
.rtable td a:hover { color: var(--brand); }
.rtable td b { font-weight: 600; }
.rtable td small { display: block; color: var(--muted); font-size: 13px; }
.rtable tr[hidden] { display: none; }

/* dropdown จุดขึ้น-ลงในกล่องจอง */
.fsel { position: relative; cursor: pointer; }
.fsel select { appearance: none; -webkit-appearance: none; width: 100%; border: 0; padding: 0 24px 0 0; margin: 0; background: none; font: 600 16px var(--font); color: var(--ink); cursor: pointer; outline: none; text-overflow: ellipsis; }
.fsel select option { color: #0f172a; background: #fff; }
.fsel::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-20%) rotate(45deg); pointer-events: none; }
.fsel:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft-2); }

/* Google Maps embed (หน้าสถานี) */
.gmap { width: 100%; height: clamp(280px, 48vw, 440px); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.gmap iframe { display: block; width: 100%; height: 100%; border: 0; }

/* หน้าจังหวัด */
.pv-hero .wrap { min-height: 320px; align-items: center; }
.pv-landmark { display: inline-block; font-size: 14.5px; background: rgb(255 255 255 / .14); border: 1px solid rgb(255 255 255 / .2); border-radius: 999px; padding: 3px 12px; margin-top: 2px; }

/* หน้าสายรถ: ไทม์ไลน์ + ปุ่มจองต่อจุด + หมุดตัวเลข */
.tl-line li { padding-bottom: 14px; }
.tl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tl-row > div { min-width: 0; }
.tl-row small { display: block; color: var(--muted); font-size: 13px; }
.tl-book { flex: none; font-size: 13.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-soft-2); border-radius: 999px; padding: 3px 12px; white-space: nowrap; }
.tl-book:hover { background: var(--brand-soft-2); color: var(--brand-ink); }
@media (max-width: 560px) { .tl-row { flex-direction: column; align-items: flex-start; gap: 4px; } }
.num-pin { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #1d4ed8; border: 2px solid #1d4ed8; font: 700 11px var(--font); box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.num-pin.end { background: #1d4ed8; color: #fff; }

/* หน้าจุด → จุด */
.pp-h1 { font-size: clamp(22px, 3.2vw, 32px) !important; line-height: 1.4 !important; }
.pp-k { color: #fcd34d; }
.pp-ends { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.ops3 { display: grid; gap: 10px; }
.op3 { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.op3 img, .op3 .ph { width: 48px; height: 48px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.op3 .ph { display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.op3 > div { min-width: 0; line-height: 1.5; }
.op3 b { font-weight: 600; color: var(--ink); }
.op3 small { display: block; color: var(--muted); font-size: 13px; }
.op3 p { font-size: 14px; margin-top: 4px; }
.row-od a { color: var(--ink); }
.row-od a:hover { color: var(--brand); text-decoration: underline; }

/* ลิงก์หน้าจุด→จุด จัดกลุ่ม */
.pgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pg { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.pg h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.pg h3 small { color: var(--muted); font-weight: 400; }
.pgl { list-style: none; margin: 0; padding: 0; }
.pgl li { border-top: 1px dashed var(--line); }
.pgl li:first-child { border-top: 0; }
.pgl a { display: block; padding: 6px 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
.pgl a:hover { color: var(--brand); }
.pgl li.hidden { display: none; }
.pgl.open li.hidden { display: list-item; }
.pg-more button { border: 0; background: none; padding: 6px 0; color: var(--brand); font: 600 14px var(--font); cursor: pointer; }
@media (max-width: 760px) { .pgs { grid-template-columns: minmax(0, 1fr); } }
.tl-pair { display: inline-block; font-size: 13px; margin-top: 2px; }
.tl a.tl-pair { color: var(--brand); }
.tl a.tl-pair:hover { color: var(--brand-ink); text-decoration: underline; }

.pgcity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.pgcity b { font-size: 14.5px; margin-right: 4px; }

/* ปุ่มขากลับ (ในกล่องจอง) */
.rev-btn { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--brand-2); background: var(--brand-soft); color: var(--brand); font-size: 14.5px; line-height: 1.35; }
.rev-btn:hover { background: var(--brand-soft-2); color: var(--brand-ink); }
.rev-btn svg { flex: none; }
.rev-btn b { font-weight: 600; }
.rev-btn small { display: block; color: var(--muted); font-size: 12.5px; }

/* ปุ่มขากลับแบบไอคอน (ในแถบ ต้นทาง → ปลายทาง) */
.od { flex-wrap: wrap; }
.rev-ico { display: inline-flex; align-items: center; gap: 6px; align-self: center; height: 40px; padding: 0 14px; border-radius: 999px;
  background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .3); color: #fff; font: 600 14px var(--font); white-space: nowrap; }
.rev-ico:hover { background: #fff; color: #1d4ed8; }
.rev-ico svg { flex: none; }

