/* CarRent theme — navy + amber (แนวเว็บเช่ารถ) ; ฟอนต์ Prompt (หัวข้อ) + IBM Plex Sans Thai (เนื้อหา) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@400;500;600&family=Prompt:wght@500;600;700&display=swap');

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --brand: #0b1f3a;          /* navy: header / hero / footer */
  --brand-2: #13315c;
  --on-brand: #f1f5f9;
  --on-brand-muted: #9fb0c8;
  --accent: #f59e0b;         /* amber: ปุ่มหลัก */
  --accent-hover: #d97706;
  --on-accent: #1c1204;
  --primary: #1d4ed8;        /* ลิงก์ */
  --primary-text: #ffffff;
  --error: #c62828;
  --success: #15803d;
  --notice-bg: #fff4d6;
  --notice-text: #7a5300;
  --line: #06c755;
  --line-text: #ffffff;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 8px 24px rgb(15 23 42 / 0.07);
  --shadow-lg: 0 20px 50px rgb(11 31 58 / 0.18);
  --radius: 14px;
  /* ใส่รูปหน้าแรก: --hero-image: url('/img/hero.jpg'); */
  --hero-image: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1120;
    --surface: #111a2e;
    --surface-2: #0e1628;
    --text: #e5e9f2;
    --muted: #94a3b8;
    --border: #22304d;
    --brand: #060d1a;
    --brand-2: #0f2140;
    --on-brand: #e5e9f2;
    --on-brand-muted: #8da0bb;
    --accent: #fbbf24;
    --accent-hover: #f59e0b;
    --on-accent: #1c1204;
    --primary: #7aa7ff;
    --primary-text: #0b1420;
    --error: #ef6b6b;
    --success: #4ade80;
    --notice-bg: #3a2f10;
    --notice-text: #f6d77f;
    --line: #06c755;
    --line-text: #ffffff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    --shadow-lg: 0 20px 50px rgb(0 0 0 / 0.45);
  }
}

* { box-sizing: border-box; }

/* ให้ hidden ชนะ display: flex/grid ของ class อื่น */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .logo, button, a.button, .button-like { font-family: "Prompt", "IBM Plex Sans Thai", system-ui, sans-serif; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.25; margin: 0 0 16px; font-weight: 600; }
h2 { font-size: 1.2rem; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 1.05rem; margin: 16px 0 8px; font-weight: 600; }
a { color: var(--primary); }
img { max-width: 100%; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
main.container { padding-block: 32px 48px; min-height: 60vh; }
main.narrow { max-width: 760px; }

/* ---------- header ---------- */
.site-header {
  background: var(--brand); color: var(--on-brand);
  position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgb(255 255 255 / 0.06);
}
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-block: 12px; }
.logo {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 700; font-size: 1.3rem; color: var(--on-brand); letter-spacing: 0.2px;
}
.logo-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
}
.logo-mark svg { width: 22px; height: 22px; }
.logo .accent { color: var(--accent); }
.tagline { color: var(--on-brand-muted); font-size: 0.9rem; }
.site-nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.site-nav a { color: var(--on-brand); text-decoration: none; font-size: 0.95rem; opacity: 0.9; }
.site-nav a:hover { opacity: 1; color: var(--accent); }
.site-nav a.nav-cta {
  background: var(--accent); color: var(--on-accent); padding: 7px 16px; border-radius: 999px; font-weight: 600; opacity: 1;
}
.site-nav a.nav-cta:hover { background: var(--accent-hover); color: var(--on-accent); }
.site-nav button.link { color: var(--on-brand-muted); }
.site-nav button.link:hover { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { background: var(--brand); color: var(--on-brand-muted); margin-top: 48px; }
.footer-inner { display: grid; gap: 24px; padding-block: 40px 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h4 { color: var(--on-brand); margin: 0 0 10px; font-size: 1rem; }
.site-footer a { color: var(--on-brand-muted); text-decoration: none; display: block; padding: 2px 0; }
.site-footer a:hover { color: var(--accent); }
.site-footer .logo { color: var(--on-brand); margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / 0.08); padding-block: 16px; font-size: 0.85rem; }

/* ---------- ฟอร์ม ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(245 158 11 / 0.2);
}
textarea { resize: vertical; }
input[readonly], input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; padding: 0; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0; }
legend { color: var(--muted); font-size: 0.9rem; padding-inline: 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
label.check.consent { align-items: flex-start; }
label.check.consent input { margin-top: 5px; flex: 0 0 auto; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
input.narrow-input { width: 96px; flex: 0 0 auto; }
form h3 { margin: 8px 0 0; }

/* ---------- ปุ่ม ---------- */
button, a.button, .button-like {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 20px;
  background: var(--accent); color: var(--on-accent);
  transition: background 0.15s, transform 0.05s, border-color 0.15s;
}
button:hover, a.button:hover, .button-like:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
button.secondary, a.button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
button.secondary:hover, a.button.secondary:hover { border-color: var(--accent); background: transparent; }
button.small, .button-like.small { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }
button.link { background: none; border: 0; color: var(--primary); padding: 0; font-weight: 500; font-family: inherit; }
button.link:hover { background: none; text-decoration: underline; }
a.button.provider-line { background: var(--line); color: var(--line-text); }
a.button.provider-google { background: var(--surface); color: var(--text); border-color: var(--border); }

/* ---------- ส่วนประกอบทั่วไป ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-tight { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row input { flex: 1 1 200px; }
.row label > input, .row label > select { flex: 0 0 auto; }  /* label เป็น flex แนวตั้ง — ไม่ให้ basis 200px กลายเป็นความสูง */
.status { min-height: 1.5em; margin: 6px 0 0; color: var(--muted); }
.status.error { color: var(--error); }
.status.success { color: var(--success); }
.muted { color: var(--muted); }
.small-text { font-size: 0.85rem; }
.notice { display: inline-block; background: var(--notice-bg); color: var(--notice-text); padding: 6px 12px; border-radius: 8px; }

.badge {
  display: inline-block; font-size: 0.78rem; padding: 2px 10px; border-radius: 999px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text); background: var(--surface-2); white-space: nowrap;
}
.badge.ok { border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
.badge.warn { border-color: color-mix(in srgb, var(--notice-text) 35%, transparent); color: var(--notice-text); background: var(--notice-bg); }
.badge.danger { border-color: color-mix(in srgb, var(--error) 40%, transparent); color: var(--error); background: color-mix(in srgb, var(--error) 8%, var(--surface)); }

.list { list-style: none; padding: 0; margin: 0 0 12px; }
.list li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
summary { cursor: pointer; color: var(--primary); font-weight: 500; }
details > :not(summary) { margin-top: 10px; }

/* ตารางเลื่อนแนวนอนได้บนจอมือถือ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; background: var(--surface-2); }
td.actions { white-space: nowrap; }
td.actions button + button { margin-left: 6px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

dialog {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); width: min(440px, calc(100% - 32px));
}
dialog::backdrop { background: rgb(0 0 0 / 0.5); }

/* ---------- หน้าแรก ---------- */
.hero {
  position: relative; color: var(--on-brand); overflow: hidden;
  background:
    linear-gradient(115deg, rgb(11 31 58 / 0.96) 35%, rgb(11 31 58 / 0.55)),
    var(--hero-image) center / cover no-repeat,
    radial-gradient(circle at 85% 20%, rgb(245 158 11 / 0.35), transparent 45%),
    linear-gradient(160deg, var(--brand) 0%, var(--brand-2) 100%);
  padding-block: 56px 140px;
}
.hero::after { /* เส้นถนน */
  content: ""; position: absolute; left: 0; right: 0; bottom: 70px; height: 4px; opacity: 0.25;
  background: repeating-linear-gradient(90deg, var(--accent) 0 40px, transparent 40px 80px);
}
.hero h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3rem); max-width: 16ch; margin-bottom: 12px; }
.hero h1 .accent { color: var(--accent); }
.hero p.lead { color: var(--on-brand-muted); font-size: 1.1rem; max-width: 52ch; margin: 0 0 20px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 0; list-style: none; }
.trust li { display: flex; align-items: center; gap: 8px; color: var(--on-brand); font-size: 0.95rem; }
.trust svg { width: 18px; height: 18px; color: var(--accent); flex: 0 0 auto; }

.quote-card {
  position: relative; z-index: 2; margin-top: -100px;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 22px;
  border: 1px solid var(--border);
}
.quote-card h2 { display: flex; align-items: center; gap: 8px; }
.quote-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.quote-head h2 { margin: 0; }
.segmented { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented label { flex-direction: row; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { padding: 7px 16px; border-radius: 9px; color: var(--muted); font-weight: 500; font-family: "Prompt", sans-serif; }
.segmented input:checked + span { background: var(--brand); color: var(--on-brand); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.option-card .actions-row { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.route-points { display: flex; flex-direction: column; gap: 10px; }
.route-point { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; }
.route-dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 700; color: #fff; background: var(--brand-2);
}
.route-dot.start { background: var(--success); }
.route-dot.end { background: var(--error); }
.quote-options { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-top: 14px; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-top: 16px; }

/* ช่องค้นหาสถานที่ + รายการแนะนำ */
.place-field { position: relative; display: block; }
.place-field input { width: 100%; }
.place-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto;
}
.place-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.place-list li:hover, .place-list li[aria-selected=true] { background: var(--surface-2); }
.place-list .addr { display: block; color: var(--muted); font-size: 0.82rem; }

.results { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); margin-top: 24px; }
@media (max-width: 860px) { .results { grid-template-columns: 1fr; } }
.map-box {
  min-height: 380px; height: 100%; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); box-shadow: var(--shadow);
}
.map-box.small { min-height: 300px; height: 300px; }
.route-summary { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.stat { display: flex; flex-direction: column; }
.stat .value { font-family: "Prompt", sans-serif; font-size: 1.5rem; font-weight: 600; color: var(--text); }
.stat .label { color: var(--muted); font-size: 0.85rem; }

.option-card {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: start;
  padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.option-card + .option-card { margin-top: 10px; }
.option-card.unavailable { opacity: 0.75; }
.option-card .price { font-family: "Prompt", sans-serif; font-size: 1.45rem; font-weight: 700; text-align: right; }
.option-card .price small { display: block; font-size: 0.78rem; font-weight: 400; color: var(--muted); }
.option-card details { grid-column: 1 / -1; }
.breakdown { width: 100%; min-width: 0; border: 0; }
.breakdown td { padding: 4px 0; border: 0; }
.breakdown td:last-child { text-align: right; white-space: nowrap; }
.breakdown tr.deadhead td { color: var(--muted); border-top: 1px dashed var(--border); padding-top: 8px; }
.breakdown tr.total td { font-weight: 700; border-top: 1px solid var(--border); padding-top: 8px; }

.section { padding-block: 48px 8px; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 28px; }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow { color: var(--accent-hover); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.5px; text-transform: uppercase; }
.feature { text-align: left; }
.feature .icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent-hover);
}
.feature .icon svg { width: 24px; height: 24px; }
.feature h3 { margin-top: 0; }
.feature p { color: var(--muted); margin: 0; }
.steps { counter-reset: step; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps .card { position: relative; padding-top: 44px; }
.steps .card::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 14px; left: 22px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
  background: var(--brand); color: var(--accent);
}
.cta-band {
  margin-top: 40px; border-radius: 18px; padding: 32px; color: var(--on-brand);
  background: radial-gradient(circle at 90% 10%, rgb(245 158 11 / 0.35), transparent 50%), linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.cta-band h2 { font-size: 1.5rem; margin: 0 0 4px; }
.cta-band p { margin: 0; color: var(--on-brand-muted); }

/* ---------- เอกสาร (partner, review, vehicle) ---------- */
.doc-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; }
.doc-review { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.doc-thumb {
  flex: 0 0 160px; height: 110px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); text-decoration: none;
}
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdf-label { color: var(--muted); text-align: center; font-weight: 600; }
.role-block { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.role-block h3 { margin: 0; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 8px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- รถ ---------- */
.vehicle-grid { display: grid; gap: 18px; margin-bottom: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.vehicle-card {
  display: flex; flex-direction: column; gap: 10px; padding: 12px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.vehicle-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.vehicle-cover {
  height: 170px; border-radius: 10px; overflow: hidden; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
}
.vehicle-cover img { width: 100%; height: 100%; object-fit: cover; }

.photo-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.photo-tile { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); }
.photo-box {
  position: relative; aspect-ratio: 4 / 3; border: 1px dashed var(--border); border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--surface-2);
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.cover-badge { position: absolute; top: 6px; left: 6px; }

/* ---------- การจอง / งาน ---------- */
.price-tag { font-family: "Prompt", sans-serif; font-size: 1.3rem; font-weight: 700; text-align: right; }
.price-tag small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.booking-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
.assigned { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.progress { display: flex; list-style: none; padding: 0; margin: 0; gap: 4px; }
.progress li {
  flex: 1; text-align: center; font-size: 0.75rem; color: var(--muted); padding-top: 8px;
  border-top: 4px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.progress li.done { border-top-color: var(--accent); color: var(--text); font-weight: 500; }
.pay-now { padding: 14px; border-radius: 12px; border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); margin: 10px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pay-now p { margin: 0; }
.qr-box { background: #fff; padding: 10px; border-radius: 10px; border: 1px solid var(--border); text-align: center; color: #0f172a; }
.qr-box svg { width: 220px; height: 220px; display: block; margin: 0 auto; }
.route-list { margin: 0 0 8px; padding-left: 20px; }
.route-list li { padding: 2px 0; }
.suggestion { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.suggestion.best { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.split { display: grid; gap: 18px; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.side-list { display: flex; flex-direction: column; gap: 8px; }
.side-item {
  text-align: left; display: block; width: 100%; padding: 12px; border-radius: 10px; font-family: inherit; font-weight: 400;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.side-item:hover { background: var(--surface); border-color: var(--accent); }
.side-item.active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs button { background: var(--surface); color: var(--muted); border-color: var(--border); padding: 7px 14px; font-weight: 500; }
.tabs button.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* ---------- แชท ---------- */
.chat { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.chat-log { display: flex; flex-direction: column; gap: 6px; padding: 12px; height: 320px; overflow-y: auto; background: var(--surface-2); }
.chat-day { align-self: center; font-size: 0.75rem; color: var(--muted); background: var(--surface); padding: 2px 10px; border-radius: 999px; margin: 4px 0; }
.bubble {
  max-width: 82%; align-self: flex-start; display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border);
}
.bubble.mine { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-color: var(--brand); border-radius: 14px 14px 4px 14px; }
.bubble.from-driver:not(.mine) { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.bubble .who { font-size: 0.75rem; font-weight: 600; color: var(--accent-hover); }
.bubble .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .at { font-size: 0.7rem; opacity: 0.6; align-self: flex-end; }
.chat-form { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; min-height: 42px; border-radius: 20px; padding: 10px 14px; }
.chat-form button { border-radius: 20px; }

/* ---------- รับส่ง (มือถือก่อน) ---------- */
.mobile-wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 6px 12px; font-size: 0.85rem; font-weight: 500; font-family: inherit;
}
.chip:hover { border-color: var(--accent); background: var(--surface); }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; cursor: pointer;
  padding: 14px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
}
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .price { font-family: "Prompt", sans-serif; font-size: 1.3rem; font-weight: 700; }
.step-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-family: "Prompt", sans-serif; font-weight: 600; }
.step-title .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; background: var(--brand); color: var(--accent); }
.big-button { width: 100%; padding: 14px; font-size: 1.05rem; border-radius: 14px; }
.sticky-bottom { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.status-hero { text-align: center; padding: 18px; }
.status-hero .big { font-family: "Prompt", sans-serif; font-size: 1.4rem; font-weight: 700; }
.kind-badge { background: var(--brand); color: var(--accent); border-color: var(--brand); }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: 6px; }
  .doc-thumb { flex-basis: 100%; height: 180px; }
  .card, .quote-card { padding: 16px; }
  .hero { padding-block: 36px 120px; }
}

/* ---------- คนขับ: รับงาน / เช็คอิน / แต้ม ---------- */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 4px 0 2px; padding: 0; list-style: none; counter-reset: step; }
.stepper li { position: relative; text-align: center; font-size: .78rem; color: var(--muted); padding-top: 30px; line-height: 1.3; }
.stepper li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 2px solid var(--border); font-weight: 600; font-size: .75rem; z-index: 1;
}
.stepper li::after { content: ""; position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--border); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--text); }
.stepper li.done::before { content: "✓"; background: var(--success); border-color: var(--success); color: #fff; }
.stepper li.done::after, .stepper li.now::after { background: var(--success); }
.stepper li.now { color: var(--text); font-weight: 600; }
.stepper li.now::before { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.job-action { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.job-action.offer { background: var(--notice-bg); border-color: color-mix(in srgb, var(--notice-text) 30%, transparent); }
.job-action .row { gap: 8px; }
.job-action .row > button { flex: 1; }
.job-action .hint { font-size: .85rem; color: var(--muted); margin: 0; }
.photo-pick { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.photo-pick img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.booking-card.needs-action { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), var(--shadow); }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--success); border-radius: 99px; }
.meter.warn > span { background: var(--accent); }
.meter.danger > span { background: var(--error); }
.standing { display: flex; flex-direction: column; gap: 8px; }
.standing .doc-head strong { font-family: "Prompt", sans-serif; font-size: 1.05rem; }
.timeline { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.timeline li { display: flex; gap: 10px; align-items: baseline; font-size: .9rem; }
.timeline time { color: var(--muted); min-width: 44px; font-variant-numeric: tabular-nums; }
.attention { border-left: 4px solid var(--error); }
.booking-card .status:empty { display: none; }

/* ---------- คืนเงิน (ลูกค้า) ---------- */
.refund-box { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--success) 45%, transparent); background: color-mix(in srgb, var(--success) 5%, var(--surface)); }
.refund-item + .refund-item { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.refund-payee { margin-top: 8px; }
.refund-payee .status:empty { display: none; }
