/* LOCA Car Rental — customer mini app (T05, restyled to the design boards 01–08 in T17).
   Palette C "deeper blue" (docs/DESIGN.md). Single column, max 480 px, 16 px gutters,
   44 px+ touch targets, 50 px primary buttons, Noto Serif Lao for Lao and Latin. */

:root {
  --navy: #082F5E;
  --brand: #0B4F9E;
  --brand-2: #2E9BF0;
  --haze: #8FD3FF;
  --brand-soft: #e7f4ff;
  --bg: #f3f7fd;
  --surface: #ffffff;
  --ink: #0b1c33;
  --ink-2: #43536b;
  --ink-3: #93a3ba;
  --line: #e6edf6;
  --green: #12b76a;
  --green-soft: #e7f8f0;
  --green-ink: #067647;
  --amber: #f79009;
  --amber-soft: #fef4e6;
  --amber-ink: #8a5a00;
  --amber-pill: #b54708;
  --red: #f04438;
  --red-soft: #fdecea;
  --red-ink: #b42318;
  --grey-soft: #eef2f7;
  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --shadow-flat: 0 1px 2px rgba(16, 24, 40, .05);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 64px;
  --cta-h: 90px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  font-family: "Noto Serif Lao", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
body.sheet-open { overflow: hidden; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; text-align: inherit; }
input, select { font: inherit; color: inherit; }
a { color: var(--brand); }
h3 { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.ok { color: var(--green); }
.err { color: var(--red); }
.brand { color: var(--brand); }
.center { text-align: center; }
.right { text-align: right; }
.wrap { overflow-wrap: anywhere; }
.pad { padding: 14px 16px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section-title { font-size: 14px; font-weight: 700; margin: 2px 0 8px; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }
.view { padding-bottom: calc(var(--tabbar-h) + 24px + var(--safe-b)); min-height: 100dvh; }
/* flow screens (results → confirmation) hide the tab bar, as on the boards */
body.flow .tabbar { display: none; }
body.flow .view { padding-bottom: calc(24px + var(--safe-b)); }
body.flow.has-cta .view { padding-bottom: calc(var(--cta-h) + var(--safe-b)); }
body.has-cta:not(.flow) .view { padding-bottom: calc(var(--tabbar-h) + var(--cta-h) + var(--safe-b)); }

/* ---------- splash and lock ---------- */
.splash, .lock {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; padding: 24px; text-align: center;
}
.splash-mark {
  width: 64px; height: 64px; border-radius: 20px; background: var(--haze); color: var(--navy);
  display: grid; place-items: center; font-weight: 800; font-size: 34px; animation: pulse 1.6s ease-in-out infinite;
}
.splash-word { margin-top: 14px; font-size: 26px; font-weight: 800; letter-spacing: .12em; }
.splash-sub { margin-top: 4px; font-size: 12px; letter-spacing: .1em; opacity: .75; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .splash-mark, .spinner, .dot { animation: none !important; } }
.lock-card { max-width: 340px; }
.lock-icon { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 22px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; }
.lock-icon svg { width: 34px; height: 34px; fill: var(--haze); }
.lock h1 { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.lock p { opacity: .85; }

/* ---------- white header (boards 02–08) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(12px + var(--safe-t)) 16px 12px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .tb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar h1 { font-size: 15px; font-weight: 700; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1.big { font-size: 20px; font-weight: 800; white-space: normal; }
.topbar .tb-sub { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.topbar .tb-right { flex: none; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.back { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--bg); color: var(--ink); }
.back svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.back.float { position: absolute; left: 16px; top: calc(12px + var(--safe-t)); background: rgba(255, 255, 255, .9); z-index: 3; }
.link { color: var(--brand); font-weight: 700; font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; padding: 0 4px; }
.lang-btn {
  width: 40px; height: 40px; border-radius: 99px; font-size: 13px; font-weight: 700; flex: none;
  background: var(--brand-soft); color: var(--brand); display: grid; place-items: center;
}
.hero .lang-btn { background: rgba(255, 255, 255, .18); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.ul-tabs { display: flex; gap: 20px; margin: 4px 0 -12px; }
.ul-tabs button { padding: 4px 0 10px; font-size: 14px; font-weight: 700; color: var(--ink-3); border-bottom: 2px solid transparent; min-height: 44px; }
.ul-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.topbar.tabs-bar { flex-wrap: wrap; padding-bottom: 0; }
.topbar.tabs-bar .ul-tabs { width: 100%; margin: 0; }

/* ---------- hero (board 01) ---------- */
.hero { background: var(--navy); color: #fff; padding: calc(18px + var(--safe-t)) 20px 58px; border-radius: 0 0 28px 28px; display: flex; flex-direction: column; gap: 10px; }
.hero .brand-row { display: flex; align-items: center; justify-content: space-between; }
.wordmark { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.wordmark span { font-weight: 400; opacity: .85; }
.hero .hello { font-size: 18px; font-weight: 700; }
.hero .sub { font-size: 14px; opacity: .85; }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: block; width: 100%; }
.card.flat { box-shadow: var(--shadow-flat); }
.card.r16 { border-radius: 16px; }
.card.r14 { border-radius: var(--radius-md); padding: 12px 14px; }
.card.disabled { opacity: .55; pointer-events: none; }
.search-card { margin: -30px 16px 0; width: auto; position: relative; z-index: 2; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; }
.seg { display: flex; gap: 4px; background: var(--bg); border-radius: 14px; padding: 4px; }
.seg button { flex: 1; min-height: 44px; padding: 6px 4px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.seg button.active { background: var(--navy); color: #fff; }
.seg button:disabled { cursor: not-allowed; color: var(--ink-3); }
.seg button small { font-size: 10px; font-weight: 600; }
.seg.white { background: var(--surface); box-shadow: var(--shadow); }

.line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.line span:first-child { color: var(--ink-2); flex: none; max-width: 55%; }
.line > b, .line > span:last-child { flex: 1 1 auto; min-width: 0; }
.line b, .line span:last-child { text-align: right; font-weight: 600; }
.line.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-size: 15px; font-weight: 800; }
.line.total span:first-child { color: var(--ink); font-weight: 800; }
.line.total b { font-weight: 800; }
.line.dep { color: var(--brand); font-weight: 700; }
.line.dep span:first-child, .line.dep b { color: var(--brand); font-weight: 700; }
.line .addr { display: block; font-weight: 400; color: var(--ink-2); }
.lines .line b { font-weight: 400; color: var(--ink); }
.row-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; padding: 8px 0; min-height: 44px; width: 100%; text-align: left; }
.row-link + .row-link { border-top: 1px solid var(--line); }
.row-link b { color: var(--brand); font-weight: 700; flex: none; }
.row-link .faint { font-weight: 400; }

.notice { background: var(--brand-soft); color: var(--brand); border-radius: var(--radius-md); padding: 10px 12px; font-size: 13px; }
.notice.warn { background: var(--amber-soft); color: var(--amber-ink); }
.notice.error { background: var(--red-soft); color: var(--red-ink); }
.notice.inset { margin: 12px 16px 0; }
.notice.icon { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; font-size: 12px; line-height: 1.45; }
.notice.icon svg { width: 20px; height: 20px; flex: none; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); flex: 1; min-width: 0; }
.field input, .field select, .dt-btn {
  width: 100%; height: 48px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface);
  padding: 0 12px; font-size: 15px; font-weight: 400; color: var(--ink); appearance: none; -webkit-appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field input:focus, .field select:focus, .dt-btn:focus-visible { outline: none; border-color: var(--brand-2); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dt-btn { display: flex; align-items: center; text-align: left; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field.narrow { flex: 0 0 112px; }
.hint { font-size: 12px; color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--ink-2); line-height: 1.45; padding: 4px 2px; min-height: 44px; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--brand); }
.check a { font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 16px; text-decoration: none; text-align: center;
}
.btn.block { display: flex; width: 100%; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--brand); border: 1.5px solid var(--brand); font-size: 15px; }
.btn.outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); font-size: 13px; min-height: 46px; }
.btn.soft { background: var(--brand-soft); color: var(--brand); font-size: 13px; min-height: 44px; padding: 0 12px; }
.btn.soft-red { background: var(--red-soft); color: var(--red); font-size: 13px; min-height: 44px; padding: 0 12px; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-outline { background: var(--surface); color: var(--red); border: 1.5px solid var(--red); font-size: 15px; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 13px; flex: none; }
.btn.pill-sm { min-height: 40px; padding: 0 16px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn.secondary.busy::after, .btn.danger-outline.busy::after, .btn.outline.busy::after, .btn.soft.busy::after { border-color: var(--brand-soft); border-top-color: var(--brand); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.text-btn { color: var(--brand); font-weight: 700; font-size: 13px; padding: 8px; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- loading and empty states ---------- */
.loading { display: grid; place-items: center; padding: 48px 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 20px; text-align: center; margin: 16px; }
.state-card p { color: var(--ink-2); margin: 10px 0 6px; }
.state-card .btn { margin-top: 10px; }
.state-icon { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto; display: grid; place-items: center; font-size: 24px; font-weight: 800; background: var(--brand-soft); color: var(--brand); }
.state-card.error .state-icon { background: var(--red-soft); color: var(--red); }
.state-card.warn .state-icon { background: var(--amber-soft); color: var(--amber); }
.stale { opacity: .55; transition: opacity .15s; }

/* ---------- home (board 01) ---------- */
.how { padding: 22px 16px 0; display: flex; flex-direction: column; gap: 12px; }
.how h2 { font-size: 16px; font-weight: 700; }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.how-card { background: var(--surface); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-flat); }
.how-num { width: 32px; height: 32px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.how-card b { font-size: 12px; font-weight: 700; line-height: 1.3; }
.how-card p { font-size: 11px; color: var(--ink-2); line-height: 1.35; }
.active-row { background: var(--surface); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-flat); width: 100%; text-align: left; }
.active-row .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: none; }
.active-row .ic svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.active-row .ic.blue { background: var(--brand-soft); color: var(--brand); }
.active-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.active-row .main b { font-size: 14px; }
.active-row .main span { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.active-row .open { font-size: 13px; font-weight: 700; color: var(--brand); flex: none; }

/* ---------- results (board 02) ---------- */
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 0; scrollbar-width: none; width: 100%; }
.chiprow::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.count-line { font-size: 12px; color: var(--ink-2); }
.list { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 12px; }
.car-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; text-align: left; color: var(--ink); }
.car-top { display: flex; gap: 12px; align-items: center; }
.car-img { width: 112px; height: 72px; flex: none; border-radius: 12px; overflow: hidden; background: var(--brand-soft); display: grid; place-items: center; }
.car-img img { width: 100%; height: 100%; object-fit: cover; }
.car-ph { width: 100%; height: 100%; display: grid; place-items: center; }
.car-ph svg { width: 56px; fill: var(--brand); opacity: .55; }
.car-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.car-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.car-name span:first-child { font-size: 15px; font-weight: 700; line-height: 1.3; }
.car-meta { font-size: 12px; color: var(--ink-2); }
.car-meta b { color: var(--ink); font-weight: 700; }
.car-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.price-block { display: flex; flex-direction: column; min-width: 0; }
.price-block .lbl { font-size: 11px; color: var(--ink-3); }
.price-block .amt { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.price-block .usd { font-size: 11px; color: var(--ink-3); }
.tag { font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 99px; background: var(--grey-soft); color: var(--ink-2); white-space: nowrap; }
.tag.ev { background: var(--green-soft); color: var(--green); }

/* ---------- listing (board 03) ---------- */
.gallery { height: 240px; background: var(--brand-soft); position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery .slide { flex: none; width: 100%; height: 100%; scroll-snap-align: start; display: grid; place-items: center; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .car-ph svg { width: 140px; }
.gallery .counter { position: absolute; right: 16px; bottom: 12px; background: rgba(8, 47, 94, .7); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.sub-line { font-size: 13px; color: var(--ink-2); }
.specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.spec { background: var(--surface); border-radius: 14px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.spec b { font-size: 14px; font-weight: 700; line-height: 1.2; }
.spec span { font-size: 10px; color: var(--ink-3); }
.rules .line { font-size: 13px; }
.tier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tier { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--surface); min-height: 44px; }
.tier .nm { font-size: 11px; color: var(--ink-3); }
.tier .dp { font-size: 12px; font-weight: 700; }
.tier .ex { font-size: 11px; color: var(--ink-2); }
.tier.selected { border-color: var(--brand); background: var(--brand-soft); }
.tier.selected .nm { color: var(--brand); font-weight: 700; }

/* ---------- sticky bars ---------- */
.sticky-cta {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b));
  width: 100%; max-width: 480px; padding: 12px 16px calc(12px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); z-index: 20;
  display: flex; align-items: center; gap: 12px;
}
body.flow .sticky-cta { bottom: 0; }
.sticky-cta .btn { flex: 1; }
.sticky-cta .price-block { flex: none; }

/* ---------- quote (board 04) ---------- */
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; min-height: 56px; }
.opt.selected { background: var(--brand-soft); border-color: var(--brand); }
.opt input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.opt .om { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt .om b { font-size: 14px; font-weight: 700; }
.opt .om span { font-size: 12px; color: var(--ink-2); }
.opt .op { font-size: 13px; font-weight: 700; flex: none; text-align: right; }
.opt.selected .op { color: var(--brand); }
.opt .xp { font-size: 13px; color: var(--ink-2); flex: none; }
.opt .om .xn { font-size: 14px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 18px; font-weight: 700; text-align: center; }
.stepper span { min-width: 22px; text-align: center; font-weight: 700; font-size: 14px; }
.summary { display: flex; flex-direction: column; gap: 4px; }
.summary .head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.summary .head b { font-size: 14px; }
.summary .head span { font-size: 12px; color: var(--ink-2); }
.summary .usd { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.summary .notice { margin-top: 6px; }

/* ---------- documents (board 05) ---------- */
.doc { background: var(--surface); border-radius: 18px; padding: 14px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-flat); width: 100%; text-align: left; min-height: 76px; cursor: pointer; }
.doc.pending { border: 1.5px dashed var(--brand-2); box-shadow: none; }
.doc.uploading { opacity: .7; }
.doc .tile { width: 64px; height: 48px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.doc.done .tile { background: var(--green-soft); color: var(--green); }
.doc .tile svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.doc.done .tile svg { stroke-width: 2.4; }
.doc .dm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc .dm b { font-size: 14px; font-weight: 700; }
.doc.pending .dm b { color: var(--brand); }
.doc .dm span { font-size: 12px; color: var(--ink-2); }
.doc .dm span.err { color: var(--red); }
.doc .retake { font-size: 13px; font-weight: 700; color: var(--brand); padding: 8px; flex: none; }
.compact-fields { display: flex; flex-direction: column; gap: 10px; }
.compact-fields .field input, .compact-fields .field select { height: 44px; font-size: 14px; }
.consent-text { font-size: 13px; }
.consent-text p { margin-bottom: 8px; }
.consent-text .draft { color: var(--amber-ink); font-weight: 700; }

/* ---------- checkout and pay (board 06) ---------- */
.rail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rail { border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; min-height: 64px; cursor: pointer; }
.rail.selected { border-color: var(--brand); background: var(--brand-soft); }
.rail b { font-size: 13px; font-weight: 700; }
.rail.selected b { color: var(--brand); }
.rail span { font-size: 11px; color: var(--ink-2); line-height: 1.35; }
.rail input { position: absolute; opacity: 0; width: 0; height: 0; }
.card-element { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 12px; margin-top: 10px; min-height: 48px; }
.radio-list { display: flex; flex-direction: column; }
.radio-line { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 14px; }
.radio-line:last-child { border-bottom: 0; }
.radio-line input { width: 20px; height: 20px; accent-color: var(--brand); }
.card-brand { font-weight: 800; font-size: 12px; background: var(--grey-soft); padding: 2px 6px; border-radius: 6px; }
.qr-card { padding: 18px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr-card h3 { margin: 0; }
.qr-frame { width: 200px; height: 200px; border-radius: 12px; border: 1.5px solid var(--line); display: grid; place-items: center; background: #fff; overflow: hidden; }
.qr { width: 100%; height: 100%; display: block; background: #fff; image-rendering: pixelated; }
.qr.small { width: 150px; height: 150px; }
.qr-frame.small { width: 150px; height: 150px; }
.pay-amount { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.pay-status { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.pay-status .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--amber); flex: none; animation: pulse 1.2s ease-in-out infinite; }
.pay-status.ok .dot { background: var(--green); animation: none; }
.pay-status.err .dot { background: var(--red); animation: none; }
.pay-status.warn { color: var(--amber-ink); }
.pay-status.ok { color: var(--green-ink); font-weight: 700; }
.pay-status.err { color: var(--red-ink); }
.segments { display: flex; gap: 4px; background: var(--surface); border-radius: 14px; padding: 4px; box-shadow: var(--shadow-flat); }
.segments button { flex: 1; min-height: 44px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segments button.active { background: var(--navy); color: #fff; }
.about { display: flex; flex-direction: column; gap: 6px; }
.about b { font-size: 13px; font-weight: 700; }
.about p { font-size: 12px; color: var(--ink-2); line-height: 1.45; }

/* ---------- confirmation and booking (board 07) ---------- */
.conf-hero { background: var(--navy); color: #fff; padding: calc(22px + var(--safe-t)) 20px 48px; border-radius: 0 0 28px 28px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.conf-hero .circle { width: 56px; height: 56px; border-radius: 99px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); display: grid; place-items: center; }
.conf-hero .circle svg { width: 28px; height: 28px; stroke: #fff; fill: none; stroke-width: 2.6; }
.conf-hero h2 { font-size: 20px; font-weight: 800; }
.conf-hero p { font-size: 13px; opacity: .85; }
.overlap { margin: -24px 16px 0; width: auto; position: relative; z-index: 2; }
.qr-show { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; text-align: center; }
.qr-show b { font-size: 13px; }
.ref { font-size: 18px; font-weight: 800; letter-spacing: .08em; }
.ref.big { font-size: 22px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill.blue { background: var(--brand-soft); color: var(--brand); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber-pill); }
.pill.red { background: var(--red-soft); color: var(--red-ink); }
.pill.grey { background: var(--grey-soft); color: var(--ink-2); }
.bring { list-style: none; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.bring li::before { content: "• "; }

/* ---------- my bookings (board 08) ---------- */
.bk-card { display: flex; flex-direction: column; gap: 12px; }
.bk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; }
.bk-head .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bk-head .t b { font-size: 15px; font-weight: 700; }
.bk-head .t span { font-size: 12px; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile-box { background: var(--bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-box .l { font-size: 11px; color: var(--ink-3); }
.tile-box .v { font-size: 13px; font-weight: 700; }
.tile-box .s { font-size: 11px; color: var(--ink-2); }
.dep-head { display: flex; align-items: center; justify-content: space-between; }
.dep-head b { font-size: 14px; }
.clock { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.clock .cl { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.bar div { height: 100%; background: var(--brand-2); border-radius: 99px; }
.bar.done div { background: var(--green); }
.clock p { font-size: 12px; color: var(--ink-2); }
.roadside { border: 1.5px solid var(--red-soft); }
.policy p { font-size: 14px; margin-bottom: 12px; }
.policy p:last-child { margin-bottom: 0; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding: 8px 8px calc(8px + var(--safe-b)); z-index: 40; height: calc(var(--tabbar-h) + var(--safe-b));
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 600; border-radius: 12px; min-height: 48px; }
.tab svg { width: 24px; height: 24px; fill: currentColor; }
.tab.active { color: var(--brand); }

/* ---------- sheet, toast, offline ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 80; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 47, 94, .45); }
.sheet {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px 18px calc(18px + var(--safe-b)); animation: up .2s ease-out;
  display: flex; flex-direction: column; gap: 10px;
}
@keyframes up { from { transform: translate(-50%, 30px); opacity: 0; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 0 auto 2px; }
.sheet h2 { font-size: 18px; font-weight: 800; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + var(--safe-b)); transform: translate(-50%, 20px);
  max-width: calc(100% - 32px); width: max-content; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red-ink); }
.toast.ok { background: var(--green-ink); }
.toast.warn { background: #93370d; }
.offline-bar { position: sticky; top: 0; z-index: 35; background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; font-weight: 600; padding: 8px 16px; text-align: center; }

@media (min-width: 481px) {
  body { background: #e9eef6; }
  #app { background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
}

/* ---------- Sprint 2 (T20): with-driver packages, photos, claims ---------- */
.search-card .hint { margin-top: -4px; }
.wd-card { display: flex; flex-direction: column; gap: 10px; cursor: default; }
.pkg-list { display: flex; flex-direction: column; gap: 8px; }
.pkg { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-md); background: var(--bg); min-height: 56px; }
.pkg:active { border-color: var(--brand); }
.pkg .pm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pkg .pm b { font-size: 14px; }
.pkg .pm span { font-size: 11.5px; color: var(--ink-2); }
.pkg .pp { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.pkg .pp b { font-size: 14px; color: var(--brand); }
.pkg .pp span { font-size: 11px; color: var(--ink-3); }
.tier-grid.one { grid-template-columns: 1fr; }
.wd-pkg .line { padding: 0; }
a.row-link { text-decoration: none; color: inherit; }
.pairs { display: flex; flex-direction: column; gap: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair .ph { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--ink-2); }
.pair .ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.pair .ph .faint { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border: 1px dashed var(--line); border-radius: 10px; font-size: 12px; }
.pair .cap { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.topbar .pill { flex: none; }
.sheet textarea { width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; font: inherit; font-size: 15px; min-height: 96px; resize: vertical; }
.sheet textarea:focus { border-color: var(--brand-2); outline: none; }
