/* ---------- tokens ---------- */
:root {
  /* brand = orange accents (logo, links, arrows); cta = the "จอง" button (white text 5.2:1) */
  --brand: #ea580c;
  --brand-ink: #c2410c;
  --brand-soft: #fff4ec;
  --cta: #c2410c;
  --cta-ink: #c2410c;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --muted: #6b7280;
  --line: #e9e6e3;
  --bg: #ffffff;
  --bg-2: #f8f6f4;
  --card: #ffffff;
  --good: #15803d;
  --good-soft: #e8f6ed;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 40 / .04), 0 4px 16px rgb(16 24 40 / .05);
  --font: "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #ff8a3d;
    --brand-ink: #ffa366;
    --brand-soft: #2a1d14;
    --cta: #c2410c;
    --ink: #eef0f3;
    --ink-2: #c3c7cf;
    --muted: #9aa1ad;
    --line: #2a2e36;
    --bg: #14161a;
    --bg-2: #1b1e23;
    --card: #1d2026;
    --good: #5fd39a;
    --good-soft: #15291f;
    --warn: #ffb067;
    --warn-soft: #2d2014;
    --shadow: none;
    color-scheme: dark;
  }
}

@view-transition { navigation: auto; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font: 400 17px/1.65 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); }
.h3 { font-size: 1.1rem; }
p { margin: 0 0 .5em; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.strong { font-weight: 600; }
.accent { color: var(--cta-ink); }
@media (prefers-color-scheme: dark) { .accent { color: #ff9a5a; } }
.plain { list-style: none; margin: 0; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--card); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); margin-bottom: .25em; }
.link { color: var(--brand-ink); font-weight: 600; text-decoration: none; font-size: .95rem; }
.link:hover { text-decoration: underline; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--cta); color: #fff; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; }
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--ink-2); font: inherit; font-size: .9rem; text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill { display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--bg-2); font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .75rem; font-weight: 600; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.block { padding: 40px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }

/* ---------- header / footer ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em; text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: .95rem; }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav { align-items: center; }
.nav-menu { display: none; position: relative; }
.nav-menu summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: var(--ink); cursor: pointer; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu[open] summary { background: var(--bg-2); }
.nav-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgb(0 0 0 / .14); }
.nav-panel a { padding: 12px 14px; font-size: 1rem; color: var(--ink); }
.nav-panel a.nav-panel-cta { margin-bottom: 4px; background: var(--cta); color: #fff; font-weight: 600; text-align: center; border-radius: 10px; }
.nav-panel a.nav-panel-cta:hover { background: var(--cta); color: #fff; filter: brightness(1.08); }
@media (max-width: 720px) {
  .nav .nav-wide { display: none; }
  .nav-menu { display: block; }
}

.site-footer { margin-top: 56px; padding: 40px 0 96px; border-top: 1px solid var(--line); background: var(--bg-2); }
.foot-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 24px; }
.foot-grid a { text-decoration: none; color: var(--ink-2); line-height: 2; }
.foot-grid a:hover { color: var(--brand-ink); }
.logo-text { font-weight: 600; font-size: 1.15rem; }
.foot-h { font-weight: 600; }

/* ---------- home ---------- */
.hero { padding: 48px 0 32px; background: linear-gradient(180deg, var(--brand-soft), var(--bg) 85%); }
.hero h1 { max-width: 28ch; }
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 56ch; }
.br-sm { display: none; }
@media (max-width: 480px) { .br-sm { display: inline; } }
.finder { position: relative; margin-top: 24px; padding: 8px 8px 14px; max-width: 760px; }
.types { display: flex; gap: 4px; padding: 4px 4px 10px; }
.types a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: .95rem; }
.types a[aria-current] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.finder-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 58px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--muted); }
.finder-input:focus-within { border-color: var(--brand); }
.finder-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 1.1rem; color: var(--ink); }
.finder-results { position: absolute; left: 8px; right: 8px; z-index: 5; margin-top: 6px; max-height: 340px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / .12); }
.finder-results a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; text-decoration: none; }
.finder-results a:hover, .finder-results a:focus { background: var(--bg-2); outline: 0; }
.finder-results li + li { border-top: 1px solid var(--line); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 4px 0; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 24px; color: var(--ink-2); }
.stats strong { font-size: 1.35rem; color: var(--ink); margin-right: 4px; }

.route-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.route-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; height: 100%; text-decoration: none; transition: border-color .15s, transform .15s; }
.route-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.rc-top { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 1.05rem; flex-wrap: wrap; }
.arrow-sm { color: var(--brand); }
.rc-meta { display: flex; gap: 12px; font-size: .85rem; color: var(--ink-2); margin-top: 6px; }
.rc-price { margin-top: auto; padding-top: 8px; font-size: .9rem; color: var(--muted); }
.rc-price strong { font-size: 1.2rem; color: var(--ink); }

.regions { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.regions a { display: flex; flex-direction: column; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.regions a:hover { border-color: var(--brand); }

.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: s; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-n { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

.co-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.co-scroll li { scroll-snap-align: start; }
.co-tile { display: block; overflow: hidden; text-decoration: none; height: 100%; }
.co-tile > img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-2); }
.co-tile-body { display: flex; gap: 10px; align-items: center; padding: 12px; }
.co-tile-body img { border-radius: 8px; flex: none; object-fit: contain; background: #fff; }
.co-tile-body > span { display: flex; flex-direction: column; line-height: 1.4; }

/* ---------- route ---------- */
.route-hero { padding: 20px 0 28px; background: linear-gradient(180deg, var(--brand-soft), var(--bg)); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); margin-bottom: 20px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.route-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 4px; }
.route-title .arrow { width: .9em; height: .9em; color: var(--brand); }
.stations { color: var(--ink-2); font-size: .95rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; margin: 20px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts div { background: var(--card); padding: 12px 16px; }
@media (max-width: 480px) { .facts div:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 0; font-size: 1.2rem; font-weight: 600; }
.next-bus { display: inline-flex; gap: 8px; align-items: center; margin-top: 14px; padding: 6px 14px; border-radius: 999px; background: var(--good-soft); color: var(--good); font-weight: 600; font-size: .95rem; }
.next-bus::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.route-layout { display: grid; gap: 24px; padding-top: 24px; }
.route-layout > * { min-width: 0; }  /* lets the date strip scroll instead of widening the column */
@media (min-width: 960px) { .route-layout { grid-template-columns: 1fr 300px; align-items: start; } .side { position: sticky; top: 76px; } }
.sort { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted); }
.sort select { font: inherit; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.divider { width: 1px; background: var(--line); margin: 4px 4px; }

.trips { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: -8px; }
.trips thead th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 0 16px; }
.trips tbody tr { background: var(--card); box-shadow: var(--shadow); }
.trips td { padding: 14px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; }
.trips td:first-child { border-left: 1px solid var(--line); border-radius: var(--radius) 0 0 var(--radius); }
.trips td:last-child { border-right: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0; }
.trips tbody tr:hover td { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.trips tr.is-next td { border-color: var(--good); }
.t-time { white-space: nowrap; }
.t-time strong { display: block; font-size: 1.35rem; line-height: 1.2; }
.t-time .to { color: var(--ink-2); }
.t-time sup { color: var(--warn); font-weight: 600; margin-left: 2px; }
.t-time .dur { display: block; font-size: .8rem; color: var(--muted); }
.co-wrap { display: flex; gap: 12px; align-items: center; }
.co-wrap > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.co-name { font-weight: 600; line-height: 1.35; text-decoration: none; }
.co-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .8rem; color: var(--muted); }
.feat::before { content: "✓ "; color: var(--good); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.t-price { font-size: 1.3rem; font-weight: 600; text-align: right; white-space: nowrap; }
.t-book { text-align: right; width: 1%; }
.trust { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; }
.trust svg { flex: none; margin-top: 3px; color: var(--good); }

/* the table becomes a stack of cards on phones */
@media (max-width: 720px) {
  .trips thead { display: none; }
  .trips, .trips tbody { display: block; }
  .trips { border-spacing: 0; margin-top: 0; }
  .trips tbody tr {
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "time price" "co book";
    gap: 8px 12px; padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius);
  }
  .trips tr.is-next { border-color: var(--good); }
  .trips td { display: block; padding: 0; border: 0 !important; border-radius: 0 !important; }
  .t-time { grid-area: time; }
  .t-time .dur { display: inline; margin-left: 6px; }
  .t-price { grid-area: price; align-self: start; }
  .t-co { grid-area: co; align-self: end; min-width: 0; }
  .t-book { grid-area: book; width: auto; align-self: end; }
}

.search-card { padding: 20px; }
.busx-slot { min-height: 52px; margin-top: 12px; }

.co-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.co-card { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
.co-card img { flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.co-card p { margin: 0; }

.prose p { max-width: 70ch; color: var(--ink-2); }
/* หน้าบริษัท: ย่อหน้าสรุป */
.co-lead { margin: 16px 0 0; max-width: 78ch; color: var(--ink-2); line-height: 1.75; }
.co-summary p { max-width: 78ch; margin: 0 0 10px; color: var(--ink-2); line-height: 1.75; }
.co-summary strong { color: var(--ink); }
/* /เบอร์โทร */
.ph-cc { margin: 12px 0 0; color: var(--ink-2); }
.ph-cc a { color: var(--cta); white-space: nowrap; }
.ph-filter { margin-top: 18px; }
.ph-co.block { padding: 24px 0 0; }
.ph-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ph-head h2 { margin: 0; }
.ph-head h2 a { color: var(--ink); text-decoration: none; }
.ph-head h2 a:hover { color: var(--brand-ink); }
.ph-list { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.ph-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.ph-list li:first-child { border-top: 0; }
.ph-loc { min-width: 0; }
.ph-loc a { margin-left: 4px; white-space: nowrap; }
.ph-tel { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-tel a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-tel a::before { content: "📞 "; }
.ph-tel a:hover { border-color: var(--brand); }
.ph-without { display: flex; flex-wrap: wrap; gap: 8px; }
/* เกี่ยวกับเรา / ติดต่อเรา / นโยบายความเป็นส่วนตัว */
.info-page > * { max-width: 760px; }
.info-page h2 { margin: 1.6em 0 .4em; font-size: 1.2rem; }
.info-page ul:not(.plain) { padding-left: 1.2em; color: var(--ink-2); }
.info-page li { margin: .35em 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 20px 0; }
.stats li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.stats b { display: block; font-size: 1.4rem; color: var(--brand-ink); }
.stats span { font-size: .85rem; color: var(--muted); }
.contact-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact-list span { width: 90px; color: var(--muted); }
.stations-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 16px; }
.stations-grid .card { padding: 16px; }

.faq { border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 32px 16px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.4rem; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding-bottom: 16px; margin: 0; }

.near { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.near a { display: flex; flex-direction: column; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.near a:hover { border-color: var(--brand); }

.sticky-cta { display: none; }
@media (max-width: 720px) {
  .sticky-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgb(0 0 0 / .06);
  }
  .sticky-cta > div { display: flex; flex-direction: column; line-height: 1.2; }
  .sticky-cta strong { font-size: 1.3rem; }
}

/* sample-data placeholders (logos / bus photos) */
.avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; font-weight: 600; font-size: .95rem; background: var(--c, #6b7280); }
.avatar.lg { width: 48px; height: 48px; font-size: 1.05rem; }
.photo { display: block; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--c, #6b7280), color-mix(in srgb, var(--c, #6b7280) 55%, #000)); position: relative; }
.photo::after { content: "🚌"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; opacity: .85; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.logo-accent { color: var(--brand); }

/* ---------- company / station / province pages ---------- */
.page-hero { padding: 20px 0 28px; background: linear-gradient(180deg, var(--brand-soft), var(--bg)); }
.ident { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.ident h1 { margin: 0; }
.avatar.xl { width: 64px; height: 64px; border-radius: 16px; font-size: 1.35rem; }
.lead-sm { color: var(--ink-2); max-width: 70ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); filter: none; }
.cover { border-radius: var(--radius); overflow: hidden; margin-top: 20px; }
.cover .photo { aspect-ratio: 21 / 7; }
@media (max-width: 720px) { .cover .photo { aspect-ratio: 16 / 9; } }

/* in-page section nav */
.toc { position: sticky; top: 60px; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.toc ul { margin: 0 auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.toc a { display: block; padding: 12px 14px; white-space: nowrap; text-decoration: none; color: var(--ink-2); font-size: .95rem; border-bottom: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-bottom-color: var(--brand); }

/* route list rows */
.rlist { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.rlist li + li { border-top: 1px solid var(--line); }
.rlist a { display: grid; grid-template-columns: 1fr auto auto 20px; gap: 16px; align-items: center; padding: 14px 16px; text-decoration: none; }
.rlist a:hover { background: var(--bg-2); }
.rlist a::after { content: "›"; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.rl-name { font-weight: 600; }
.rl-name small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.rl-trips { color: var(--ink-2); font-size: .9rem; white-space: nowrap; }
.rl-price { font-weight: 600; white-space: nowrap; text-align: right; min-width: 72px; }
.rl-price small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
@media (max-width: 560px) {
  .rlist a { grid-template-columns: 1fr auto 14px; grid-template-areas: "name price arr" "trips price arr"; gap: 2px 12px; }
  .rl-name { grid-area: name; } .rl-trips { grid-area: trips; } .rl-price { grid-area: price; }
}
.more { margin-top: 12px; }

/* fleet / class cards */
.fleet { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.fleet .card { padding: 16px; }
.fleet h3 { font-size: 1.05rem; margin: 6px 0 2px; }
.amen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.amen span { padding: 2px 10px; border-radius: 999px; background: var(--bg-2); font-size: .8rem; color: var(--ink-2); }

/* info list (address, phone, hours) */
.info { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.info > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 16px; }
.info > div + div { border-top: 1px solid var(--line); }
.info dt { color: var(--muted); font-size: .9rem; }
.info dd { margin: 0; }
.two-col { display: grid; gap: 24px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* map placeholder — production: static map image, not an embedded iframe */
.map { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: repeating-linear-gradient(0deg, transparent 0 38px, var(--line) 38px 39px), repeating-linear-gradient(90deg, transparent 0 38px, var(--line) 38px 39px), var(--bg-2); }
.map::after { content: "📍"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -80%); font-size: 2.2rem; }
.map a { position: absolute; right: 12px; bottom: 12px; }

/* getting there */
.getting { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.getting .card { padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.getting .ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); font-size: 1.2rem; }
.getting p { margin: 0; }

.tip { align-self: start; padding: 16px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-2); max-width: 820px; }
.tip strong { color: var(--ink); }

/* ---------- route: return-trip swap, date strip, sort, class comparison ---------- */
.swap-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: 4px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--brand-ink); font-size: 1.1rem; font-weight: 400; text-decoration: none; }
.swap-btn:hover { border-color: var(--brand); }

.dates { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; padding-bottom: 2px; }
.dates::-webkit-scrollbar { display: none; }
.dates button { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink-2); font: inherit; font-size: .78rem; line-height: 1.3; cursor: pointer; }
.dates button strong { font-size: 1.1rem; color: var(--ink); }
.dates button:hover { border-color: var(--brand); }
.dates button[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.dates button[aria-pressed="true"] strong { color: var(--brand-ink); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 420px; padding: 4px; margin-bottom: 12px; border-radius: 12px; background: var(--bg-2); }
.seg button { min-height: 38px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: inherit; font-size: .95rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / .1); }

.compare-wrap { padding: 4px 16px; overflow-x: auto; max-width: 820px; }
.compare { width: 100%; border-collapse: collapse; font-size: .95rem; }
.compare th, .compare td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare tbody th { color: var(--muted); font-weight: 400; white-space: nowrap; }
.compare .hl { background: var(--brand-soft); }
@media (max-width: 520px) { .compare-wrap { padding: 0 8px; } .compare { font-size: .84rem; } .compare th, .compare td { padding: 10px 5px; } }

/* ---------- real-data additions ---------- */
.co-logo { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.co-logo.lg { width: 48px; height: 48px; }
.changes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.changes span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .85rem; color: var(--ink-2); }
.co-phone { font-size: .85rem; }
.co-phone a { color: var(--ink); font-weight: 600; text-decoration: none; }
.nearby { margin: 10px 0 8px; padding: 0; list-style: none; font-size: .88rem; }
.nearby li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px dashed var(--line); }
.nearby li span:last-child { color: var(--muted); white-space: nowrap; }
.counter { font-size: .88rem; margin: 4px 0 8px; }

/* ---------- point-to-point pages ---------- */
.via { color: var(--ink-2); }
.via::before { content: "• "; color: var(--muted); }
.p2p-points { display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 760px) { .p2p-points { grid-template-columns: 1fr 1fr; } }
.pt { position: relative; padding: 14px 16px 14px 44px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pt::before { content: ""; position: absolute; left: 16px; top: 18px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--good); background: var(--card); }
.pt.to::before { border-color: var(--cta); background: var(--cta); }
.pt .strong { line-height: 1.4; }
.pt p { margin: 0 0 4px; }
.pt .links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: .9rem; }

.alt-board { width: 100%; border-collapse: collapse; font-size: .95rem; }
.alt-board th, .alt-board td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.alt-board thead th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.alt-board tbody tr:last-child > * { border-bottom: 0; }
.alt-board .t { font-weight: 600; white-space: nowrap; }
.alt-board .diff { color: var(--good); font-size: .85rem; white-space: nowrap; }
@media (max-width: 560px) { .alt-board { font-size: .85rem; } .alt-board th, .alt-board td { padding: 10px 6px; } }

.lines details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.lines details + details { margin-top: 8px; }
.lines summary { cursor: pointer; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.lines summary .muted { font-size: .85rem; }
.stoplist { list-style: none; margin: 0; padding: 4px 16px 14px 36px; position: relative; font-size: .92rem; }
.stoplist::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 22px; border-left: 2px dashed var(--line); }
.stoplist li { position: relative; padding: 3px 0; color: var(--ink-2); }
.stoplist li::before { content: ""; position: absolute; left: -19px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.stoplist li.end { color: var(--ink); font-weight: 600; }
.stoplist li.end::before { background: var(--brand); width: 10px; height: 10px; left: -20px; top: 10px; }

.warn-box { padding: 14px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.warn-box strong { color: var(--warn); }
.warn-box p { margin: 0; }
.warn-box ul { margin: 8px 0 0; padding-left: 20px; }

/* hourly departures as a time board (airport shuttles) */
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.time-grid a { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; }
.time-grid a:hover { border-color: var(--cta); }
.time-grid strong { font-size: 1.25rem; line-height: 1.2; }
.time-grid span { font-size: .78rem; color: var(--muted); }
.time-grid a.is-next { border: 2px solid var(--good); }
.time-grid a.is-past { opacity: .45; }
.land { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--bg-2); }
.land input { font: inherit; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.land output { font-weight: 600; }
.en { display: block; font-size: 1rem; font-weight: 400; color: var(--muted); margin-top: 2px; }

/* loading wave (BusX widget) */
.wave { display: flex; justify-content: center; align-items: center; gap: 6px; height: 52px; }
.wave i { width: 6px; height: 28px; border-radius: 3px; background: var(--cta); animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s; }
.wave i:nth-child(3) { animation-delay: .2s; }
.wave i:nth-child(4) { animation-delay: .3s; }
.wave i:nth-child(5) { animation-delay: .4s; }
@keyframes wave { 0%, 60%, 100% { transform: scaleY(.35); opacity: .5; } 30% { transform: scaleY(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wave i { animation: none !important; opacity: .7; } }

/* BusX search widget dialog */
.busx-dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); box-shadow: 0 24px 64px rgb(0 0 0 / .25); }
.busx-dialog::backdrop { background: rgb(16 18 22 / .55); }
.busx-dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px 20px; }
.busx-dialog-head h2 { margin: 0; }
.busx-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bg-2); color: var(--ink); font-size: 1rem; cursor: pointer; }
.busx-dialog #busx-search-form { padding: 8px 16px 20px; min-height: 92px; }

/* overlay while leaving for the booking site */
.leaving { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(2px); }
.leaving[hidden] { display: none; }
.leaving .wave { gap: 8px; height: 64px; }
.leaving .wave i { width: 8px; height: 40px; }

/* data disclaimer under the trip table */
.data-note { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-size: .88rem; color: var(--ink-2); }
.data-note p { margin: 0; }
.data-note strong { color: var(--ink); }

/* company page */
.co-logo.xl { width: 64px; height: 64px; border-radius: 16px; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 360px); gap: 10px; margin-top: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 6px; }
.gallery figure { margin: 0; scroll-snap-align: start; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.gallery img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 720px) { .gallery { grid-auto-columns: 80%; } }
.route-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-top: 10px; }
.route-group > summary { cursor: pointer; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.route-group .rlist { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.route-group .more { padding: 0 16px 14px; }

/* company page: ขึ้นที่ → ลงที่ */
.route-finder { margin-top: 20px; padding: 16px 18px; max-width: 920px; }
.route-finder h2 { margin: 0 0 10px; }
.rf-fields { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 10px; align-items: end; }
.rf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rf-field span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.rf-field select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
.rf-field select:focus { border-color: var(--brand); outline: none; }
.rf-arrow { padding-bottom: 12px; color: var(--brand); font-size: 1.2rem; }
.rf-fields .btn { min-height: 48px; }
.rf-btns { display: flex; gap: 8px; }
.btn-line { background: var(--card); color: var(--cta); box-shadow: inset 0 0 0 1.5px var(--cta); }
.btn-line:hover { background: var(--cta); color: #fff; filter: none; }
.rf-hint { margin: 8px 0 0; }
@media (max-width: 720px) {
  .rf-fields { grid-template-columns: 1fr; }
  .rf-arrow { display: none; }
  .rf-btns .btn { flex: 1; }
}
#routes .route-finder, #dest .route-finder { margin: 0 0 14px; }
.rf-or { margin: 0 0 4px; }
#photos .gallery { margin-top: 0; }
.std-note { margin: 0 0 10px; }

/* company page: line details (province headers, departure list) */
.stoplist li.prov { padding: 8px 0 2px; margin-left: -16px; font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.stoplist li.prov::before { display: none; }
.line-foot { padding: 0 16px 16px; }
.line-foot p { margin: 0 0 8px; }
.dep-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dep-list span { padding: 2px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.dep-list small { margin-left: 6px; font-weight: 400; font-size: .78rem; color: var(--muted); }
.badge:not(.good):not(.warn) { background: var(--bg-2); color: var(--ink-2); }

/* /จุด: jump to province */
.jump { padding: 12px 4px 4px; max-width: 420px; }
.jump select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }

/* ---------- home page hero with the booking search box ---------- */
/* ไม่ใช้ overflow:hidden (ตัดรายการตัวเลือกของกล่องค้นหา) และไม่ตั้ง z-index (หน้าต่างค้นหาเต็มจอบนมือถือของ widget
   ต้องอยู่เหนือแถบเมนูด้านบน — ถ้าส่วนนี้เป็น stacking context หน้าต่างจะถูกขังไว้ใต้แถบเมนู) */
.home-hero { position: relative; padding: 40px 0 36px; color: #fff;
  background: radial-gradient(1200px 400px at 85% -10%, rgb(255 255 255 / .16), transparent 60%), linear-gradient(135deg, #9a3412 0%, #c2410c 45%, #ea580c 100%); }
.home-hero::before { content: ""; position: absolute; right: 0; bottom: 0; width: min(320px, 40vw); height: 200px; opacity: .1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='3' y='5' width='26' height='20' rx='6' fill='%23fff'/%3E%3Crect x='7' y='9' width='8' height='6' rx='1.5' fill='%23c2410c'/%3E%3Crect x='17' y='9' width='8' height='6' rx='1.5' fill='%23c2410c'/%3E%3Ccircle cx='10' cy='26' r='3' fill='%23fff'/%3E%3Ccircle cx='22' cy='26' r='3' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / contain; }
.home-hero .wrap { position: relative; }   /* วาดทับลายพื้นหลัง (::before) ตามลำดับใน DOM */
.hh-kicker { display: inline-block; margin: 0 0 10px; padding: 4px 12px; border-radius: 999px; background: rgb(255 255 255 / .16); font-size: .85rem; font-weight: 600; }
.home-hero h1 { max-width: 22ch; color: #fff; margin-bottom: 10px; }
.hh-lead { max-width: 58ch; font-size: 1.05rem; color: rgb(255 255 255 / .9); margin-bottom: 20px; }
.hh-search { padding: 18px 18px 10px; color: var(--ink); box-shadow: 0 18px 48px rgb(60 20 0 / .28); border: 0; }
.hh-search h2 { margin: 0 0 6px; }
.hh-search #busx-search-form { min-height: 150px; }   /* จองพื้นที่ไว้ก่อน widget โหลด หน้าจะได้ไม่กระโดด */
@media (max-width: 720px) { .hh-search #busx-search-form { min-height: 420px; } }
.hh-stats { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 20px; color: rgb(255 255 255 / .9); }
.hh-stats strong { font-size: 1.3rem; color: #fff; margin-right: 4px; }
.hh-finder { max-width: none; margin-top: 0; padding: 18px; }
.hh-finder h2 { margin: 0; }
.hh-finder > p { margin: 2px 0 12px; }
.why { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.why .card { padding: 18px; }
.why p { margin: 0 0 4px; }
.why-ico { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border-radius: 12px; background: var(--brand-soft); font-size: 1.3rem; }

/* /วิธีจองตั๋ว */
.howto-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; counter-reset: none; }
.howto-toc a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; font-size: .9rem; }
.howto-toc a:hover { border-color: var(--brand); }
.howto-toc span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; font-size: .8rem; }
.howto { display: grid; gap: 16px; padding-top: 24px; }
.howto-step { display: grid; gap: 20px; padding: 20px; align-items: center; scroll-margin-top: 80px; }
@media (min-width: 760px) { .howto-step { grid-template-columns: 1fr 300px; padding: 28px 32px; } }
.howto-text h2 { margin: 12px 0 6px; }
.howto-text p { margin: 0; font-size: 1.02rem; }
.howto-shot { margin: 0; justify-self: center; width: min(300px, 80vw); border-radius: 22px; overflow: hidden; border: 6px solid var(--ink); background: var(--bg-2); box-shadow: 0 12px 30px rgb(16 24 40 / .15); }
.howto-shot img { display: block; width: 100%; height: auto; }
.howto-note { margin-top: 20px; }

/* เมนู "ค้นหาตั๋ว" — ปุ่มหลักของเว็บ */
.nav a.nav-cta { background: var(--cta); color: #fff; font-weight: 600; border-radius: 999px; padding: 8px 16px; margin-right: 4px; }
.nav a.nav-cta:hover { background: var(--cta); color: #fff; filter: brightness(1.08); }

/* company page: booking-system screenshot */
.shot { margin: 0; max-width: 820px; }
.shot img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--bg-2); }
.shot figcaption { margin-top: 8px; }
