:root {
    --red: #eb0a1e;
    --red-ink: #c40818;
    --red-soft: #fdecee;
    --ink: #121417;
    --ink-2: #4a4f57;
    --ink-3: #8a9099;
    --line: #e6e8eb;
    --bg: #f5f6f8;
    --card: #ffffff;
    --ok: #12805c;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(18, 20, 23, .04), 0 8px 24px rgba(18, 20, 23, .06);
    --shadow-lift: 0 2px 6px rgba(18, 20, 23, .06), 0 16px 40px rgba(18, 20, 23, .10);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --font: 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --display: 'Prompt', var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
[v-cloak] { display: none; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 16px/1.55 var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--red-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(235, 10, 30, .35); outline-offset: 2px; }

/* top bar */
.topbar {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar__inner { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; }
.topbar__logo { height: 34px; width: auto; }
.topbar__tag {
    font: 600 12px/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
    color: var(--red-ink); background: var(--red-soft); padding: 7px 10px; border-radius: 999px;
}

.shell { max-width: 720px; margin: 0 auto; padding: 0 16px 128px; }

/* hero */
.hero { padding: 28px 2px 18px; }
.hero__eyebrow { margin: 0 0 6px; font: 600 13px/1 var(--display); color: var(--red); letter-spacing: .02em; }
.hero__title { margin: 0; font: 700 clamp(26px, 6vw, 34px)/1.2 var(--display); letter-spacing: -.01em; }
.hero__sub { margin: 8px 0 0; color: var(--ink-2); }

/* stepper */
.stepper { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stepper__item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.stepper__item:not(:last-child)::after {
    content: ''; position: absolute; top: 16px; left: calc(50% + 22px); right: calc(-50% + 22px);
    height: 2px; border-radius: 2px; background: var(--line); transition: background .3s var(--ease);
}
.stepper__item.is-done::after { background: var(--red); }
.stepper__dot {
    width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); background: var(--card);
    display: grid; place-items: center; font: 600 14px/1 var(--display); color: var(--ink-3);
    transition: all .25s var(--ease); cursor: default; padding: 0;
}
.stepper__dot svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.is-active .stepper__dot { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }
.is-done .stepper__dot { border-color: var(--red); background: var(--red); cursor: pointer; }
.stepper__label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.is-active .stepper__label, .is-done .stepper__label { color: var(--ink); }

/* panel */
.panel { animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel__title { margin: 22px 0 12px; font: 600 17px/1.3 var(--display); display: flex; align-items: baseline; gap: 8px; }
.panel__title small { font: 500 13px/1 var(--font); color: var(--ink-3); }
.empty { margin: 0; padding: 20px; text-align: center; color: var(--ink-2); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

/* shared selected-check */
.check {
    position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid var(--line); background: var(--card); transition: all .2s var(--ease);
}
.is-selected .check { border-color: var(--red); background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center/14px no-repeat; }

/* branch */
.branch-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .branch-grid { grid-template-columns: 1fr 1fr; } }
.branch {
    position: relative; display: flex; align-items: flex-start; gap: 12px; text-align: left; cursor: pointer;
    padding: 16px 44px 16px 16px; background: var(--card); border: 1.5px solid transparent; border-radius: var(--radius);
    box-shadow: var(--shadow); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.branch:hover { box-shadow: var(--shadow-lift); }
.branch:active { transform: scale(.99); }
.branch.is-selected { border-color: var(--red); }
.branch__pin { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); transition: background .2s; }
.branch__pin svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; }
.is-selected .branch__pin { background: var(--red-soft); }
.is-selected .branch__pin svg { stroke: var(--red); }
.branch__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.branch__name { font: 600 16px/1.3 var(--display); }
.branch__addr { font-size: 13px; color: var(--ink-3); }
.branch__tel { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* cars */
.car-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .car-grid { grid-template-columns: repeat(3, 1fr); } }
.car {
    position: relative; display: flex; flex-direction: column; cursor: pointer; padding: 0; text-align: left;
    background: var(--card); border: 1.5px solid transparent; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.car:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.car:active { transform: scale(.98); }
.car.is-selected { border-color: var(--red); }
.car__img { aspect-ratio: 4 / 3; background: linear-gradient(180deg, #fafbfc, #eef0f3); display: grid; place-items: center; padding: 10px; }
.car__img img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s var(--ease); }
.car:hover .car__img img { transform: scale(1.04); }
.car__name { padding: 10px 12px 12px; font: 600 13.5px/1.35 var(--display); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.car--skeleton { pointer-events: none; }
.car--skeleton .car__img, .car--skeleton .car__name::before, .slot--skeleton {
    background: linear-gradient(90deg, #eceef1 25%, #f6f7f9 50%, #eceef1 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite;
}
.car--skeleton .car__name::before { content: ''; display: block; height: 12px; width: 60%; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* step 2 summary */
.pick-summary {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px;
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.pick-summary img { width: 72px; height: 52px; object-fit: contain; background: var(--bg); border-radius: 10px; }
.pick-summary div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pick-summary strong { font: 600 15px/1.3 var(--display); }
.pick-summary span { font-size: 13px; color: var(--ink-3); }
.link { background: none; border: 0; padding: 6px 4px; color: var(--red-ink); font-weight: 600; font-size: 14px; cursor: pointer; }

/* dates */
.date-strip {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr); gap: 8px;
    overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 6px; margin: 0 -2px;
    scrollbar-width: none;
}
.date-strip::-webkit-scrollbar { display: none; }
.date {
    scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
    padding: 10px 4px; background: var(--card); border: 1.5px solid transparent; border-radius: var(--radius-sm);
    box-shadow: var(--shadow); transition: all .2s var(--ease);
}
.date__dow { font-size: 12.5px; color: var(--ink-3); }
.date.is-weekend .date__dow { color: var(--red-ink); }
.date__day { font: 700 22px/1.1 var(--display); }
.date__mon { font-size: 12px; color: var(--ink-3); }
.date.is-selected { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: var(--shadow-lift); }
.date.is-selected .date__dow, .date.is-selected .date__mon { color: rgba(255, 255, 255, .7); }

/* time slots */
.slot-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 420px) { .slot-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 620px) { .slot-grid { grid-template-columns: repeat(4, 1fr); } }
.slot {
    height: 48px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--card);
    font: 500 14.5px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer; transition: all .18s var(--ease);
}
.slot:hover:not(:disabled) { border-color: var(--ink-2); }
.slot.is-selected { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(235, 10, 30, .28); }
.slot:disabled { cursor: not-allowed; color: #b9bdc4; background: #f0f1f3; border-color: transparent; text-decoration: line-through; }
.slot--skeleton { height: 48px; border-radius: var(--radius-sm); }

/* ticket summary */
.ticket {
    position: relative; padding: 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    overflow: hidden;
}
.ticket::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--red); }
.ticket__car { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.ticket__car img { width: 76px; height: 54px; object-fit: contain; background: var(--bg); border-radius: 10px; }
.ticket__car strong { font: 600 17px/1.3 var(--display); }
.ticket__rows { margin: 12px 0 0; display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 8px; }
.ticket__rows div { min-width: 0; }
.ticket__rows dt { font-size: 12px; color: var(--ink-3); }
.ticket__rows dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.ticket__car strong { flex: 1; min-width: 0; }
.ticket__car .link { flex: none; align-self: flex-start; }

/* form */
.form { display: grid; gap: 14px; }
.row2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .row2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--area { margin-top: 22px; }
.field__label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field__label em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.field input, .field textarea {
    width: 100%; font: 400 16px/1.4 var(--font); color: var(--ink);
    padding: 13px 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease); -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 72px; }
.field input::placeholder, .field textarea::placeholder { color: #aab0b8; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(18, 20, 23, .07); }
.has-error input { border-color: var(--red); }
.has-error input:focus { box-shadow: 0 0 0 4px var(--red-soft); }
.field__err { font-size: 13px; color: var(--red-ink); }

.consent { position: relative; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; padding: 4px 0; }
.consent input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.consent__box {
    flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 1.5px solid #c9cdd3; background: var(--card);
    transition: all .18s var(--ease);
}
.consent input:checked + .consent__box { background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--red); }
.consent input:focus-visible + .consent__box { box-shadow: 0 0 0 4px var(--red-soft); }
.consent.has-error .consent__box { border-color: var(--red); }
.hint { margin: 0; font-size: 13.5px; color: var(--ink-3); display: flex; gap: 8px; }

/* sticky action bar */
.actionbar {
    position: fixed; inset: auto 0 0 0; z-index: 30;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
.actionbar__inner { max-width: 720px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 10px; }
.btn {
    height: 52px; padding: 0 22px; border-radius: 14px; border: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 16px/1 var(--display); transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { flex: 1; background: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(235, 10, 30, .28); }
.btn--primary:hover:not(:disabled) { background: var(--red-ink); }
.btn--primary:disabled { background: #d5d8dd; box-shadow: none; cursor: not-allowed; }
.btn--ghost { background: var(--bg); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { background: #eceef1; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toast */
.toast {
    position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
    max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 500;
    background: var(--ink); color: #fff; box-shadow: var(--shadow-lift);
}
.toast--error { background: #2a0c10; }
.toast--error::before { content: '!'; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; background: var(--red); font-weight: 700; font-size: 13px; }
.toast-enter-active, .toast-leave-active { transition: all .25s var(--ease); }
.toast-enter, .toast-leave-to { opacity: 0; transform: translate(-50%, 10px); }

/* thank page */
.done { padding: 40px 0 24px; text-align: center; }
.done__mark {
    width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; background: var(--red); display: grid; place-items: center;
    box-shadow: 0 0 0 12px var(--red-soft); animation: pop .5s var(--ease);
}
.done__mark svg { width: 40px; height: 40px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s .25s var(--ease) forwards; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h1 { margin: 0; font: 700 clamp(26px, 6vw, 32px)/1.25 var(--display); }
.done p { margin: 8px auto 0; max-width: 380px; color: var(--ink-2); }
.next-steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.next-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.next-steps b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--red-soft); color: var(--red-ink); font: 600 14px/1 var(--display); }
.next-steps span { font-size: 14.5px; color: var(--ink-2); }
.next-steps strong { display: block; color: var(--ink); font-family: var(--display); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
