/* Chaoly design system v1. Light theme first, dark ready. Docs: docs/design/DESIGN-SYSTEM.md
   Shape rule: controls 10px, cards 14px, sheets 22px, chips and tags full pill. One brand hue: Chaoly orange.
   Orange #FF6B2C is for marks and highlights only; text and filled buttons use --accent-strong for AA contrast. */

/* ---------- 0. Thai face: self-hosted Noto Sans Thai (OFL, public/fonts), downloaded only for Thai glyphs ---------- */
@font-face { font-family: 'Chaoly Thai'; src: local('Noto Sans Thai'), url('/fonts/noto-sans-thai.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62.5% 100%; font-display: swap; unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }

/* ---------- 1. tokens ---------- */
:root {
  /* colour: neutrals are cool grey so the orange reads warm against them */
  --bg: #F7F7F8; --surface: #FFFFFF; --surface-2: #F0F1F3; --surface-3: #E5E7EB;
  --ink: #14171A; --ink-2: #545B65; --ink-3: #6B7280; --line: #E3E5E8; --line-2: #CDD1D6;
  --accent: #FF6B2C; --accent-strong: #C2410C; --accent-hover: #A8380A; --on-accent: #FFFFFF;
  --accent-soft: #FFF1EA; --accent-ink: #9A3412; --accent-line: #FDCDB4;
  --ok: #15803D; --ok-soft: #EAF7EF; --warn: #8A5A00; --warn-soft: #FFF6E0; --bad: #B42318; --bad-soft: #FDECEA;
  --focus: #C2410C;
  --scrim: rgb(20 23 26 / .48);
  /* type: system fonts only; Thai falls back to the platform Thai face (Noto Sans Thai on Android/Linux, Sukhumvit/Thonburi on Apple, Leelawadee on Windows) */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Chaoly Thai', 'Noto Sans', 'Noto Sans Thai', 'Sukhumvit Set', Thonburi, 'Leelawadee UI', 'Leelawadee', Tahoma, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.375rem;
  --fs-2xl: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem); --fs-3xl: clamp(2rem, 1.2rem + 3.6vw, 3.5rem);
  --lh-tight: 1.12; --lh-body: 1.55; --tr-tight: -0.025em;
  /* space: 4px base */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 48px; --s-9: 64px; --s-10: 96px;
  /* radius */
  --r-ctl: 10px; --r-card: 14px; --r-sheet: 22px; --r-pill: 999px;
  /* elevation: shadows tinted to the ink hue, never pure black */
  --sh-1: 0 1px 2px rgb(20 23 26 / .06), 0 1px 1px rgb(20 23 26 / .04);
  --sh-2: 0 6px 16px -6px rgb(20 23 26 / .14), 0 2px 4px rgb(20 23 26 / .05);
  --sh-3: 0 24px 48px -16px rgb(20 23 26 / .28);
  --shadow: var(--sh-2);
  /* motion */
  --ease-out: cubic-bezier(.23, 1, .32, 1); --ease-in-out: cubic-bezier(.77, 0, .175, 1); --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;
  /* layers */
  --z-nav: 100; --z-bar: 110; --z-sheet: 200; --z-toast: 300;
  /* layout */
  --nav-h: 60px; --tab-h: 60px; --safe-b: env(safe-area-inset-bottom, 0px);
  --r-ctl-legacy: var(--r-ctl);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1114; --surface: #171A1E; --surface-2: #1E2227; --surface-3: #282D33;
    --ink: #ECEEF0; --ink-2: #A3AAB3; --ink-3: #8D959F; --line: #262B31; --line-2: #363C44;
    --accent: #FF7A3D; --accent-strong: #FF7A3D; --accent-hover: #FF925E; --on-accent: #1A0D05;
    --accent-soft: #2A1A12; --accent-ink: #FFB48F; --accent-line: #5A2E17;
    --ok: #4ADE80; --ok-soft: #12261A; --warn: #FBBF24; --warn-soft: #2A2210; --bad: #F87171; --bad-soft: #2C1615;
    --focus: #FF925E; --scrim: rgb(0 0 0 / .6);
    --sh-1: 0 1px 2px rgb(0 0 0 / .4); --sh-2: 0 8px 20px -8px rgb(0 0 0 / .6); --sh-3: 0 24px 48px -16px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1114; --surface: #171A1E; --surface-2: #1E2227; --surface-3: #282D33;
  --ink: #ECEEF0; --ink-2: #A3AAB3; --ink-3: #8D959F; --line: #262B31; --line-2: #363C44;
  --accent: #FF7A3D; --accent-strong: #FF7A3D; --accent-hover: #FF925E; --on-accent: #1A0D05;
  --accent-soft: #2A1A12; --accent-ink: #FFB48F; --accent-line: #5A2E17;
  --ok: #4ADE80; --ok-soft: #12261A; --warn: #FBBF24; --warn-soft: #2A2210; --bad: #F87171; --bad-soft: #2C1615;
  --focus: #FF925E; color-scheme: dark;
}

/* ---------- 2. base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-md)/var(--lh-body) var(--font); -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, .h3 { line-height: var(--lh-tight); letter-spacing: var(--tr-tight); margin: 0 0 .5em; font-weight: 650; text-wrap: balance; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3, .h3 { font-size: var(--fs-lg); letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
/* Thai: no negative tracking (it collides vowel marks), taller lines for stacked tone marks */
:lang(th) body, body:lang(th) { line-height: 1.7; }
:lang(th) h1, :lang(th) h2, :lang(th) h3, :lang(th) .h3 { letter-spacing: 0; line-height: 1.32; }
:lang(th) .eyebrow, :lang(th) .tag, :lang(th) .readout > span, :lang(th) .spec-sheet dt { letter-spacing: 0; text-transform: none; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--s-4); }
@media (min-width: 768px) { .wrap { padding: 0 var(--s-7); } }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }
.lead { font-size: var(--fs-lg); color: var(--ink-2); max-width: 56ch; }
.accent { color: var(--accent-strong); }
.big { font-size: 2.6rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.i { width: 1.25em; height: 1.25em; flex: none; }
.link { color: var(--ink); font-weight: 550; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; display: inline-flex; gap: .3em; align-items: center; }
.link:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
.link .i { width: 1em; height: 1em; }
code { font: .85em var(--mono); background: var(--surface-2); padding: .1em .4em; border-radius: 6px; word-break: break-all; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r-ctl); z-index: var(--z-toast); }
.skip:focus { left: 8px; }
.hide-sm { display: none !important; }
@media (min-width: 900px) { .hide-sm { display: inline-flex !important; } }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- 3. buttons ---------- */
.btn, .btn-ghost, .btn-quiet { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; border-radius: var(--r-ctl); font: 600 var(--fs-md)/1.2 var(--font); padding: 0 1.25em; text-decoration: none; cursor: pointer; white-space: nowrap; border: 1px solid transparent; transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2), border-color var(--dur-2), color var(--dur-2); -webkit-user-select: none; user-select: none; }
.btn { background: var(--accent-strong); color: var(--on-accent); box-shadow: var(--sh-1); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-quiet { background: transparent; color: var(--ink); padding: 0 .75em; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent-hover); }
  .btn-ghost:hover { border-color: var(--ink-3); background: var(--surface-2); }
  .btn-quiet:hover { background: var(--surface-2); }
}
.btn:active, .btn-ghost:active, .btn-quiet:active { transform: scale(.97); }
.btn[disabled], .btn-ghost[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 44px; padding: 0 1em; font-size: var(--fs-sm); }
.btn-lg { min-height: 54px; font-size: var(--fs-lg); }
.btn-block { width: 100%; }
.btn-icon { padding: 0 .9em; }
.btn .i, .btn-ghost .i, .btn-quiet .i { width: 1.15em; height: 1.15em; }
.danger { color: var(--bad); }

/* ---------- 4. tags, chips, badges ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; font: 600 var(--fs-xs)/1.4 var(--font); letter-spacing: .02em; color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-pill); padding: 2px 9px; }
.tag-line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.tag-soon { color: var(--warn); background: var(--warn-soft); margin-left: 6px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.chip .i { width: 1.1em; height: 1.1em; color: var(--ink-2); }
.chip.is-off { color: var(--ink-2); border-style: dashed; background: transparent; }
a.chip, label.chip { cursor: pointer; transition: background-color var(--dur-2), border-color var(--dur-2), transform var(--dur-1) var(--ease-out); }
a.chip:active, label.chip:active { transform: scale(.97); }
.chip[aria-current="true"], .chip-radio:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-radio { position: relative; }
.chip-radio input, .seg input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; pointer-events: none; }
.chip-radio:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip-radio.is-off { cursor: not-allowed; }
.chip-x { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.chip-x .i { color: currentColor; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--s-4) * -1); padding: 2px var(--s-4) var(--s-2); scroll-snap-type: x proximity; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { scroll-snap-align: start; }
.chips-active { margin: var(--s-2) 0; }
.badge { display: inline-flex; align-items: center; font: 600 var(--fs-xs)/1.5 var(--font); padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); text-transform: capitalize; white-space: nowrap; }
.badge-active, .badge-confirmed, .badge-test_paid, .badge-paid, .badge-completed, .badge-approved, .badge-free { background: var(--ok-soft); color: var(--ok); }
.badge-free { text-transform: none; }
.badge-pending, .badge-unpaid, .badge-maintenance, .badge-service_due, .badge-low_fuel { background: var(--warn-soft); color: var(--warn); }
.badge-expired, .badge-cancelled, .badge-geofence_exit, .badge-overspeed, .badge-suspended, .badge-sold, .badge-rejected { background: var(--bad-soft); color: var(--bad); }
.count-dot { min-width: 20px; height: 20px; border-radius: var(--r-pill); background: var(--accent-strong); color: var(--on-accent); font: 700 .7rem/20px var(--font); text-align: center; padding: 0 5px; }
.eyebrow { display: block; font: 600 var(--fs-xs) var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); margin: 0 0 var(--s-4); }

/* ---------- 5. nav, language switch, tab bar ---------- */
.nav { position: sticky; top: 0; z-index: var(--z-nav); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: var(--s-5); height: var(--nav-h); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.2rem; text-decoration: none; letter-spacing: -0.04em; min-height: 44px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.logo-mark span { width: 12px; height: 12px; border: 3px solid #fff; border-right-color: transparent; border-radius: 50%; transform: rotate(-45deg); }
.nav-links { display: none; gap: var(--s-1); margin-left: var(--s-3); }
.nav-links a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .95rem; padding: 10px 12px; border-radius: var(--r-ctl); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); background: var(--surface-2); }
.nav-act { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
.nav-login { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .95rem; align-items: center; min-height: 44px; padding: 0 6px; }
.nav-login:hover { color: var(--ink); }
@media (min-width: 900px) { .nav-links { display: flex; } }
.lang { display: inline-flex; background: var(--surface-2); border-radius: var(--r-pill); padding: 3px; }
.lang a { min-width: 44px; min-height: 38px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: var(--r-pill); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.lang a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar); display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar a { min-height: var(--tab-h); display: grid; justify-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--ink-2); font-size: .7rem; font-weight: 600; transition: color var(--dur-2); }
.tabbar .i { width: 24px; height: 24px; transition: transform var(--dur-2) var(--ease-out); }
.tabbar a[aria-current] { color: var(--accent-strong); }
.tabbar a:active .i { transform: scale(.9); }
.is-public { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
@media (min-width: 900px) { .tabbar { display: none; } .is-public { padding-bottom: 0; } }

/* ---------- 6. surfaces: cards, panels, notices, toast, sheet ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s-5); margin-bottom: var(--s-5); }
.notice { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink); border-radius: var(--r-card); padding: 12px 16px; margin: 12px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notice > .i { color: var(--accent-strong); }
.toaster { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .toaster { bottom: 24px; } }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); border-radius: var(--r-card); padding: 12px 16px; box-shadow: var(--sh-3); font-size: var(--fs-sm); font-weight: 500; display: flex; gap: 10px; align-items: center; }
.toast-bad { background: var(--bad); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in var(--dur-3) var(--ease-out); }
  .toast.out { opacity: 0; transform: translateY(8px); transition: opacity var(--dur-2), transform var(--dur-2); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
}

/* Bottom sheet on phones, side panel from 900px. Works without JS via :target. */
.sheet { position: fixed; inset: 0; z-index: var(--z-sheet); display: none; background: var(--scrim); }
.sheet:target, .sheet.open { display: block; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88dvh; display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--sh-3); padding-bottom: var(--safe-b); }
.sheet-panel::before { content: ''; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); position: absolute; top: 8px; left: 50%; translate: -50% 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s-5) var(--s-5) var(--s-2); }
.sheet-head .h-sub { margin: 0; }
.sheet-body { overflow-y: auto; padding: var(--s-2) var(--s-5); overscroll-behavior: contain; }
.sheet-foot { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .sheet-panel { left: auto; top: 0; width: 420px; max-height: none; border-radius: var(--r-sheet) 0 0 var(--r-sheet); }
  .sheet-panel::before { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet.open { animation: fade var(--dur-2) ease-out; }
  .sheet.open .sheet-panel { animation: sheet-up 380ms var(--ease-drawer); }
  .sheet.closing { animation: fade var(--dur-2) ease-in reverse forwards; }
  .sheet.closing .sheet-panel { transition: transform var(--dur-2) ease-in; transform: translateY(100%); }
  @keyframes fade { from { opacity: 0; } }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  @media (min-width: 900px) { .sheet.open .sheet-panel { animation-name: sheet-left; } .sheet.closing .sheet-panel { transform: translateX(100%); } @keyframes sheet-left { from { transform: translateX(100%); } } }
}
.has-sheet { overflow: hidden; }

/* ---------- 7. forms ---------- */
.field { display: grid; gap: 6px; margin: 0 0 var(--s-4); border: 0; padding: 0; min-width: 0; }
label, legend { font-weight: 550; font-size: var(--fs-sm); }
legend { margin-bottom: 6px; padding: 0; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-ctl); padding: 0 14px; min-height: 48px; width: 100%; min-width: 0; transition: border-color var(--dur-2), box-shadow var(--dur-2); }
textarea { padding: 12px 14px; }
select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=file] { padding: 10px; }
input[type=checkbox], input[type=radio] { min-height: 0; }
input[disabled], select[disabled] { opacity: .6; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input[aria-invalid="true"] { border-color: var(--bad); }
input[type=date], input[type=time] { color-scheme: inherit; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: var(--fs-md); padding: 10px 0; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent-strong); flex: none; margin: 2px 0 0; }
.check.is-off { color: var(--ink-2); cursor: not-allowed; }
.check.small { font-size: var(--fs-sm); }
.check-card { border: 1px solid var(--line-2); border-radius: var(--r-ctl); padding: 13px 14px; margin-bottom: var(--s-2); background: var(--surface); transition: border-color var(--dur-2), background-color var(--dur-2); }
.check-card:has(input:checked) { border-color: var(--accent-strong); background: var(--accent-soft); }
.check-card.is-off { border-style: dashed; background: transparent; }
.check-price { margin-left: auto; white-space: nowrap; }
.two { display: grid; gap: var(--s-3); grid-template-columns: 1fr 1fr; }
@media (max-width: 360px) { .two { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 4px; }
.form-error { color: var(--bad); font-weight: 550; }
.hint { display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.hint .i { width: 1.1em; height: 1.1em; margin-top: .2em; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: var(--r-ctl); padding: 4px; margin-bottom: var(--s-4); }
.seg label { position: relative; display: grid; place-items: center; min-height: 40px; border-radius: 7px; cursor: pointer; font-size: var(--fs-md); transition: background-color var(--dur-2); }
.seg label:has(input:checked) { background: var(--surface); box-shadow: var(--sh-1); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); }

/* ---------- 8. stepper ---------- */
.stepper { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); counter-reset: none; }
.stepper li { position: relative; }
.stepper li > button, .stepper li { font: inherit; color: inherit; }
.stepper li > button { all: unset; display: block; width: 100%; cursor: pointer; border-radius: 6px; }
.stepper li > button[disabled] { cursor: default; }
.stepper li > button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.stepper li::before { content: ''; display: block; height: 4px; border-radius: 2px; background: var(--surface-3); margin-bottom: 8px; transition: background-color var(--dur-3) var(--ease-out); }
.stepper li.is-done::before, .stepper li.is-current::before { background: var(--accent-strong); }
.stepper-n { display: none; }
.stepper-l { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.stepper .is-current .stepper-l { color: var(--ink); }
.stepper .is-done .stepper-l { color: var(--ink); }
@media (min-width: 480px) { .stepper-l { font-size: var(--fs-sm); } }

/* ---------- 9. hero, home ---------- */
.hero { display: grid; gap: var(--s-7); padding-top: var(--s-7); padding-bottom: var(--s-8); align-items: center; }
.hero-copy h1 { max-width: 16ch; }
.hero-a .hero-copy h1 { max-width: 13ch; }
:lang(th) .hero-copy h1 { max-width: none; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.hero-map .map { height: 340px; }
@media (min-width: 1024px) { .hero { grid-template-columns: 5fr 6fr; padding-top: var(--s-9); padding-bottom: var(--s-9); } .hero-map .map { height: 520px; } }

/* omni search: one box, optional date, big button */
.omni { display: grid; gap: var(--s-2); grid-template-columns: 1fr; background: var(--surface); border: 1px solid var(--line-2); border-radius: calc(var(--r-card) + 4px); padding: var(--s-2); box-shadow: var(--sh-2); max-width: 620px; margin-top: var(--s-5); }
.omni-q { position: relative; display: flex; align-items: center; }
.omni-q .i { position: absolute; left: 14px; color: var(--ink-2); pointer-events: none; }
.omni-q input { padding-left: 44px; }
.omni .omni-q input { border-color: transparent; background: var(--surface-2); }
.omni-d { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s-3); padding-left: 14px; background: var(--surface-2); border-radius: var(--r-ctl); }
.omni-d label { color: var(--ink-2); font-weight: 500; }
.omni-d input { border-color: transparent; background: transparent; padding-left: 0; }
.omni .btn { min-height: 52px; }
@media (min-width: 640px) { .omni { grid-template-columns: 1.6fr 1fr auto; } .omni .btn { min-height: 48px; } }

/* category tiles: 2 x 2 on phones, tinted, live from-price */
.cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.cat { position: relative; display: grid; align-content: space-between; gap: var(--s-5); min-height: 138px; padding: var(--s-4); border-radius: var(--r-card); text-decoration: none; overflow: hidden; border: 1px solid var(--line); background: var(--surface); transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2); }
.cat:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .cat:hover { box-shadow: var(--sh-2); transform: translateY(-2px); } }
.cat-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--sh-1); }
.cat-ic .i { width: 26px; height: 26px; }
.cat-name { font-weight: 650; font-size: var(--fs-lg); line-height: 1.2; letter-spacing: -0.01em; }
.cat-meta { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.cat-a { background: var(--accent-soft); border-color: var(--accent-line); }
.cat-a .cat-ic { color: var(--accent-strong); }
.cat-b { background: color-mix(in srgb, #2F5FD0 8%, var(--surface)); }
.cat-b .cat-ic { color: #2F5FD0; }
.cat-c { background: color-mix(in srgb, #15803D 8%, var(--surface)); }
.cat-c .cat-ic { color: var(--ok); }
.cat-d { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cat-b .cat-ic { color: #8DB0FF; } }
@media (min-width: 1024px) { .hero-a .cats { gap: var(--s-4); } .cat { min-height: 180px; padding: var(--s-5); } }

/* horizontal rail of cards */
.rail-sec { padding-top: 0; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 72%); gap: var(--s-4); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 0 var(--s-4); scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 768px) { .rail { grid-auto-columns: minmax(260px, 1fr); } }
@media (min-width: 1100px) { .rail { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; } .rail > :nth-child(n+5) { display: none; } }

/* ---------- 10. maps ---------- */
.map { width: 100%; border-radius: var(--r-card); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); z-index: 0; }
.map-full { height: calc(100dvh - var(--nav-h) - var(--tab-h) - var(--safe-b)); border-radius: 0; border: 0; }
@media (min-width: 900px) { .map-full { height: calc(100dvh - var(--nav-h)); } }
.map-sm { height: 260px; }
.map-pick { height: 220px; margin-bottom: 8px; }
.map-admin { height: 420px; margin-bottom: 24px; }
.map-page { position: relative; }
.map-legend { position: absolute; left: 12px; right: 12px; bottom: 16px; z-index: 500; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 10px 14px; display: flex; gap: 14px; flex-wrap: wrap; box-shadow: var(--sh-2); font-size: var(--fs-sm); align-items: center; }
.map-legend span { display: inline-flex; gap: 6px; align-items: center; }
@media (min-width: 640px) { .map-legend { right: auto; } }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.5); } }
.leaflet-container { background: var(--surface-2); font-family: var(--font); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-container a { color: var(--accent-strong); }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--ink-2); }
.pin { background: var(--accent-strong); color: #fff; border-radius: var(--r-pill); padding: 3px 9px; font: 700 12px var(--font); white-space: nowrap; box-shadow: 0 4px 12px rgb(20 23 26 / .3); border: 2px solid #fff; display: inline-flex; align-items: center; gap: 4px; }
.pin.tech { background: #14171A; color: #fff; }
.leaflet-div-icon.pin-wrap { background: none; border: 0; }

/* ---------- 11. sections ---------- */
.section { padding-top: var(--s-8); padding-bottom: var(--s-8); }
@media (min-width: 768px) { .section { padding-top: 80px; padding-bottom: 80px; } }
.section-tight { padding-top: var(--s-6); padding-bottom: var(--s-8); }
.narrow { max-width: 760px; }
.h-page { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); }
.h-sub { font-size: var(--fs-xl); margin-top: var(--s-7); }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.row-head .h-sub { margin: 0; }
.row-head .link { min-height: 44px; }

/* garage: bikes as instrument clusters */
.garage > .lead { margin-bottom: var(--s-7); }
.rigs { display: grid; gap: var(--s-6); }
.rig { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--sh-1); }
.rig-img { display: block; background: var(--surface-2); }
.rig-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; transition: transform .6s var(--ease-out); }
@media (hover: hover) { .rig:hover .rig-img img { transform: scale(1.025); } }
.rig-panel { padding: var(--s-5); display: grid; gap: var(--s-5); align-content: space-between; }
.rig-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rig-head h3 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); margin: 10px 0 2px; letter-spacing: -0.03em; }
.rig-head p { margin: 0; }
.swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2), inset 0 -6px 10px rgb(0 0 0 / .25); flex: none; display: inline-block; }
.swatch-sm { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; border-width: 1px; }
.cluster { display: grid; grid-template-columns: auto 1fr; gap: var(--s-5); align-items: center; }
.gauge { --v: .5; width: 128px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(from -135deg, var(--accent) calc(var(--v) * 270deg), var(--surface-3) 0 270deg, transparent 0); }
.gauge-in { width: calc(100% - 20px); aspect-ratio: 1; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.gauge-in strong { font-size: 1.9rem; line-height: 1; }
.gauge-in span { font: 600 .72rem var(--font); color: var(--ink-2); text-transform: uppercase; letter-spacing: .1em; }
.gauge-lg { width: 150px; }
.readouts { display: grid; gap: 14px; min-width: 0; }
.readout { display: grid; gap: 4px; min-width: 0; }
.readout > span { font: 600 .7rem var(--font); color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.readout strong { font-size: 1rem; }
.readout-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 12px; }
.readout > .odo { display: inline-flex; align-items: center; gap: 3px; font: 650 1.3rem var(--mono); color: var(--ink); text-transform: none; letter-spacing: 0; }
.odo span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; min-width: 1.35em; text-align: center; }
.odo span:last-of-type { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.odo em { font-style: normal; font-size: .75rem; color: var(--ink-2); margin-left: 6px; }
.rig-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; }
.rig-price { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; }
.rig-price strong { font-size: 2rem; }
.rig-price span { color: var(--ink-2); font-size: .9rem; }
.rig-price em { grid-column: 1 / -1; font-style: normal; font-family: var(--mono); }
@media (min-width: 900px) {
  .rig { grid-template-columns: 7fr 5fr; }
  .rig-flip { grid-template-columns: 5fr 7fr; }
  .rig-flip .rig-img { order: 2; }
  .rig-panel { padding: var(--s-7); }
  .gauge { width: 150px; }
}
@media (max-width: 480px) {
  .cluster { grid-template-columns: 92px 1fr; gap: 14px; }
  .gauge, .gauge-lg { width: 92px; }
  .gauge-in { width: calc(100% - 14px); }
  .gauge-in strong { font-size: 1.35rem; }
  .readout > .odo { font-size: 1.05rem; gap: 2px; }
  .odo span { padding: 2px 4px; }
}

/* rides strip */
.rides { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ride-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-top: 8px; }
.ride { scroll-snap-align: start; border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; background: var(--bg); display: grid; gap: 10px; align-content: start; }
.ride > .i { width: 28px; height: 28px; color: var(--accent-strong); }
.ride-km { display: flex; align-items: baseline; gap: 8px; }
.ride-km strong { font-size: 2.4rem; line-height: 1; }
.ride-km span { color: var(--ink-2); font-size: .86rem; }
.ride-line { height: 2px; position: relative; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px); }
.ride-line span { position: absolute; inset: 0 auto 0 0; width: calc(var(--k) * 100%); background: var(--accent); }
.ride-line span::after { content: ''; position: absolute; right: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ride h3 { margin: 4px 0 0; }
.ride p { margin: 0; }
.ride-fit { color: var(--ink-2); font-size: .8rem; font-weight: 600; }
@media (min-width: 1100px) { .ride-track { grid-auto-flow: row; grid-template-columns: 1.3fr 1fr 1fr 1fr; overflow: visible; } }

/* flow steps (auth side) */
.flow { display: grid; gap: 32px; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; position: relative; }
.flow-steps li { display: grid; grid-template-columns: 48px 1fr; gap: 18px; padding-bottom: 26px; position: relative; }
.flow-steps li:not(:last-child)::before { content: ''; position: absolute; left: 23px; top: 52px; bottom: 4px; width: 1px; background: var(--line-2); }
.flow-steps > li > .i { width: 48px; height: 48px; padding: 12px; border-radius: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.flow-steps li.is-on > .i { background: var(--accent-strong); color: var(--on-accent); border-color: transparent; }
.flow-steps .h3 { margin: 4px 0 4px; }
.flow-steps p { color: var(--ink-2); margin: 0; }

.delivery-band { display: grid; gap: 16px; align-items: center; }
.delivery-band .h-sub { margin: 0 0 6px; }
.delivery-band p { margin: 0; }
@media (min-width: 900px) { .delivery-band { grid-template-columns: 1fr 1.4fr; } .delivery-band .chips { justify-content: flex-end; } }

.owner-cta { display: grid; gap: 20px; align-items: center; border-top: 1px solid var(--line); margin-bottom: 40px; padding-top: 40px; }
.owner-cta .lead { margin: 0; }
.owner-cta h2 { font-size: var(--fs-xl); }
@media (min-width: 768px) { .owner-cta { grid-template-columns: 1fr auto; } }

/* requirements list */
.needs { display: grid; gap: var(--s-6); }
.needs-list { margin: 0; display: grid; border-top: 1px solid var(--line); }
.needs-list > div { display: grid; gap: 6px; padding: 18px 0; }
.needs-list > div + div { border-top: 1px solid var(--line); }
.needs-list dt { font-weight: 650; display: flex; gap: 10px; align-items: center; }
.needs-list dt .i { color: var(--accent-strong); width: 22px; height: 22px; }
.needs-list dd { margin: 0; color: var(--ink-2); max-width: 60ch; }
@media (min-width: 1024px) { .needs { grid-template-columns: 5fr 7fr; align-items: start; } .needs-list > div { grid-template-columns: 260px 1fr; gap: 24px; } }
.zone-pub { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.zone-pub li { display: flex; gap: 8px; align-items: baseline; }
.zone-pub .i { color: var(--accent-strong); align-self: center; }
.pay-strip ul { list-style: none; margin: 0 0 40px; padding: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--ink-2); font-size: .92rem; border-top: 1px solid var(--line); }
.pay-strip li { display: inline-flex; align-items: center; gap: 8px; }
.pay-strip .i { color: var(--ink); }
.pay-inline { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pay-inline span { display: inline-flex; gap: 6px; align-items: center; }
.pay-grid { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 12px; }
@media (min-width: 640px) { .pay-grid { grid-template-columns: repeat(3, 1fr); } }
.bank-details { white-space: pre-wrap; margin: 4px 0 8px; padding: 10px 12px; border: 1px solid var(--line, #2a2f36); border-radius: 8px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }
.pay-btn { justify-content: flex-start; }
.quote-hint { margin: 8px 0 0; display: flex; gap: 6px; align-items: baseline; }

/* ---------- 12. product cards and search results ---------- */
.grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: var(--s-4); }
.card { background: var(--surface); border-radius: var(--r-card); overflow: hidden; text-decoration: none; border: 1px solid var(--line); transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3); display: flex; flex-direction: column; }
@media (hover: hover) and (pointer: fine) { .card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); } }
.card:active { transform: scale(.99); }
.card-img { aspect-ratio: 4 / 3; background: var(--surface-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.card-top { display: flex; gap: 6px; flex-wrap: wrap; }
.card h3 { margin: 4px 0 0; font-size: var(--fs-md); }
.card-spec { margin: 0; }
.card-price { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.card-price strong, .result-price strong, .actionbar-price strong { font-size: 1.2rem; font-family: var(--font); font-weight: 700; letter-spacing: -0.02em; }
.unit { color: var(--ink-2); font-size: var(--fs-sm); margin-left: 3px; }
.card-free { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 550; }
.card-free .i { width: 1em; height: 1em; }
.empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-card); display: grid; justify-items: center; }
.empty > .i { width: 40px; height: 40px; color: var(--ink-3); margin-bottom: 8px; }

/* search A: sticky bar, chips, result rows */
.search-bar { position: sticky; top: var(--nav-h); z-index: calc(var(--z-nav) - 1); background: var(--bg); border-bottom: 1px solid var(--line); padding: var(--s-2) 0; }
.has-sheet .search-bar, .search-bar:has(.sheet:target) { z-index: var(--z-sheet); }
.search-bar-in { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2); }
.search-bar .omni-q input { background: var(--surface); }
.search-a .h-page { margin: var(--s-5) 0 var(--s-3); }
.result-count { margin: var(--s-3) 0; }
.results { list-style: none; margin: 0 0 var(--s-8); padding: 0; display: grid; gap: var(--s-3); }
.result { display: grid; grid-template-columns: 112px 1fr; gap: var(--s-4); padding: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); text-decoration: none; transition: box-shadow var(--dur-2), transform var(--dur-1) var(--ease-out); }
.result:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) { .result:hover { box-shadow: var(--sh-2); } }
.result img { width: 112px; height: 112px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.result-body { display: grid; gap: 4px; align-content: start; min-width: 0; }
.result-body h3 { margin: 2px 0 0; font-size: var(--fs-md); }
.result-body p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-body .tag { justify-self: start; }
.result-foot { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; }
@media (min-width: 768px) { .results { grid-template-columns: 1fr 1fr; } .result { grid-template-columns: 160px 1fr; } .result img { width: 160px; height: 120px; } }
@media (min-width: 1100px) { .results { grid-template-columns: 1fr 1fr 1fr; } }

/* search B: filter panel + grid */
.filters { display: grid; gap: 0; }
.filters .field { margin-bottom: var(--s-3); }
.search-b-grid { display: grid; gap: var(--s-5); }
@media (min-width: 1024px) { .search-b-grid { grid-template-columns: 300px 1fr; align-items: start; } .search-b .filters { position: sticky; top: calc(var(--nav-h) + 16px); } }

/* ---------- 13. product page and booking ---------- */
.crumbs { padding: var(--s-4) 0 var(--s-3); color: var(--ink-2); }
.crumbs a { text-decoration: none; display: inline-block; padding: 10px 2px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.product-grid { display: grid; gap: var(--s-7); padding-bottom: var(--s-9); }
@media (min-width: 1024px) { .product-grid { grid-template-columns: minmax(0, 7fr) minmax(340px, 4fr); align-items: start; } .book-box { position: sticky; top: calc(var(--nav-h) + 16px); } }
.product-photo { margin: 0 0 var(--s-5); }
.product-photo img { border-radius: var(--r-card); width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.product-a .product-photo { margin-left: calc(var(--s-4) * -1); margin-right: calc(var(--s-4) * -1); }
.product-a .product-photo img { border-radius: 0; border-width: 1px 0; }
@media (min-width: 768px) { .product-a .product-photo { margin-left: 0; margin-right: 0; } .product-a .product-photo img { border-radius: var(--r-card); border-width: 1px; } }
.product-head h1 { font-size: var(--fs-2xl); margin-bottom: 4px; }
.product-b .product-head { margin-bottom: var(--s-4); }
.credit { margin: 8px 2px 0; padding: 0 var(--s-4); }
@media (min-width: 768px) { .credit { padding: 0; } }
.credit a { color: inherit; }
.desc { max-width: 65ch; color: var(--ink-2); margin-top: var(--s-4); }
.promo { display: inline-flex; gap: 8px; align-items: center; background: var(--accent-soft); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-pill); font-weight: 550; margin: var(--s-2) 0; }
.cockpit { display: grid; grid-template-columns: auto 1fr; gap: var(--s-6); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s-5); margin: var(--s-5) 0; }
@media (max-width: 480px) { .cockpit { grid-template-columns: 92px 1fr; gap: 14px; padding: 16px; } }
.book-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s-5); box-shadow: var(--sh-2); scroll-margin-top: calc(var(--nav-h) + 12px); }
.price { font-size: 1.9rem; font-family: var(--font); font-weight: 700; letter-spacing: -0.03em; }
.price-row { margin-bottom: var(--s-5); display: grid; gap: var(--s-3); }
.price-row p { margin: 0; }
.ladder { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; }
.ladder div { padding: 8px 10px; display: grid; gap: 2px; }
.ladder div + div { border-left: 1px solid var(--line); }
.ladder dt { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
.ladder dd { margin: 0; font-weight: 650; }
.spec-sheet { margin: 0 0 8px; display: grid; gap: 1px; grid-template-columns: 1fr 1fr; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.spec-sheet > div { background: var(--surface); padding: 12px 16px; display: grid; gap: 2px; }
.spec-sheet dt { font: 600 .72rem var(--font); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.spec-sheet dd { margin: 0; font-weight: 550; }
@media (max-width: 360px) { .spec-sheet { grid-template-columns: 1fr; } }

/* booking steps: wizard (A) shows one step at a time once JS runs; flat (B) shows all */
.step { border: 0; padding: 0; margin: 0 0 var(--s-5); min-width: 0; }
.step-h { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: 650; margin-bottom: var(--s-4); letter-spacing: -0.01em; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--bg); font-size: var(--fs-sm); flex: none; }
.book-wizard .step-n { display: none; }
.book-flat .step + .step { border-top: 1px solid var(--line); padding-top: var(--s-5); }
.js .book-wizard .step:not(.is-on) { display: none; }
.step-nav { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); margin-top: var(--s-5); }
.step-nav .btn { width: 100%; }
.step-nav span:empty { display: none; }
.step-nav:has(span:empty) { grid-template-columns: 1fr; }
.no-js-hide { display: none; }
.js .no-js-hide { display: initial; }
html:not(.js) .step-nav { display: none; }
@media (prefers-reduced-motion: no-preference) { .js .book-wizard .step.is-on { animation: step-in var(--dur-3) var(--ease-out); } @keyframes step-in { from { opacity: 0; transform: translateX(12px); } } }
.unit-pick { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.deposit-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px; border-radius: var(--r-ctl); background: var(--surface-2); margin: var(--s-2) 0 var(--s-4); }
.deposit-card > .i { width: 24px; height: 24px; color: var(--ok); }
.deposit-card p { margin: 2px 0 0; }
.gate { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border-radius: var(--r-ctl); padding: 12px 14px; margin: 6px 0 12px; }
.gate > .i { width: 24px; height: 24px; color: var(--accent-strong); }
.gate p { margin: 2px 0 0; }
.quote { background: var(--surface-2); border-radius: var(--r-ctl); padding: 14px; margin: 8px 0 16px; }
.quote p { margin: 0; }
.quote dl, .summary { margin: 0; display: grid; gap: 8px; }
.quote dl div, .summary div { display: flex; justify-content: space-between; gap: 12px; }
.quote dt, .summary dt { color: var(--ink-2); }
.quote dd, .summary dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.quote .total, .summary .total { border-top: 1px solid var(--line-2); padding-top: 8px; font-size: var(--fs-lg); }
.quote .total dt, .summary .total dt { color: var(--ink); font-weight: 650; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; margin: 24px 0; }

/* mobile action bar (product A): replaces the tab bar on product pages */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar); display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 10px var(--s-4) calc(10px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgb(20 23 26 / .2); transition: transform var(--dur-3) var(--ease-out); }
.actionbar .btn { min-width: 44%; }
.actionbar.is-hidden { transform: translateY(110%); }
.has-actionbar .tabbar { display: none; }
@media (min-width: 1024px) { .actionbar { display: none; } }

/* availability calendar */
.calendar { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cal-month h3 { margin: 0 0 8px; font-weight: 600; font-size: var(--fs-md); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: var(--fs-sm); text-align: center; font-variant-numeric: tabular-nums; }
.cal-grid > * { min-height: 40px; display: grid; place-items: center; border-radius: 8px; }
.cal-grid .dow { color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; min-height: 24px; }
.cal-grid button { all: unset; box-sizing: border-box; width: 100%; min-height: 40px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; background: var(--surface); border: 1px solid var(--line); }
.cal-grid button:hover { border-color: var(--accent-strong); }
.cal-grid button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cal-grid .busy { background: var(--surface-2); color: var(--ink-3); text-decoration: line-through; }
.cal-grid .past { color: var(--ink-3); }
.cal-grid .sel { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: var(--s-3); }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; margin-right: -8px; vertical-align: -2px; }
.lg-free { background: var(--surface); border: 1px solid var(--line-2); }
.lg-busy { background: var(--surface-3); }
.lg-sel { background: var(--accent-strong); }

/* confirmation */
.confirm-head { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); align-items: start; margin-top: var(--s-4); }
.confirm-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.confirm-ic .i { width: 28px; height: 28px; }
.confirm .h-page { margin-bottom: 4px; }

/* ---------- 14. legal, auth, account ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.2rem; margin: 32px 0 10px; }
.legal p, .legal li { color: var(--ink-2); }
.legal strong { color: var(--ink); font-weight: 600; }
.legal ul { padding-left: 20px; display: grid; gap: 6px; margin: 0 0 1em; }
.auth { display: grid; gap: 32px; padding-top: var(--s-6); padding-bottom: 72px; align-items: start; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s-5); max-width: 480px; width: 100%; box-shadow: var(--sh-1); }
.auth-side { padding-top: 12px; }
@media (min-width: 900px) { .auth { grid-template-columns: 480px 1fr; gap: 72px; padding-top: 64px; } .auth-card { padding: 32px; } }
.btn-google { margin: 18px 0 6px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: .82rem; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.account-grid { display: grid; gap: 28px; }
@media (min-width: 1024px) { .account-grid { grid-template-columns: 3fr 2fr; } }
.doc-panel { display: grid; gap: 10px; }
.doc-head { display: flex; gap: 12px; align-items: center; }
.doc-head > .i { width: 44px; height: 44px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.doc-head h3 { margin: 0; }
.doc-head p { margin: 0; }
.doc-head .badge { margin-left: auto; }
.doc-approved .doc-head > .i { background: var(--ok-soft); color: var(--ok); }
.bookings { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bookings li { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; }
.bookings a { text-decoration: none; display: grid; gap: 2px; min-height: 44px; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 40px 0 28px; margin-top: 24px; }
.footer-in { display: grid; gap: 28px; margin-bottom: 20px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer-cols a { display: flex; align-items: center; min-height: 40px; text-decoration: none; color: var(--ink-2); }
.footer-cols a:hover { color: var(--ink); text-decoration: underline; }
.footer-h { margin: 0 0 4px; font-weight: 650; font-size: var(--fs-sm); letter-spacing: 0; }
.footer-in p { margin-top: 12px; max-width: 40ch; }
@media (min-width: 768px) { .footer-in { grid-template-columns: 1fr 1fr; } }
.no-footer-gap .footer { display: none; }

/* crypto payment */
.crypto-grid { display: grid; gap: 20px; align-items: start; margin: 16px 0; }
@media (min-width: 720px) { .crypto-grid { grid-template-columns: 220px 1fr; } }
.qr { background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--r-card); padding: 10px; aspect-ratio: 1; max-width: 220px; }
.qr svg { width: 100%; height: auto; display: block; }
.crypto-pay .summary { margin: 0; }
.crypto-pay .addr dd { overflow-wrap: anywhere; text-align: right; }
.crypto-pay dd { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.crypto-pick { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 12px; }
@media (min-width: 640px) { .crypto-pick { grid-template-columns: 1fr auto; align-items: end; } .crypto-pick .field { margin: 0; } }

/* ---------- 15. motion: entrance and reveal, transform and opacity only ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .7s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 100ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
  .js .reveal-up:not(.in), .js .ride:not(.in) { opacity: 0; transform: translateY(14px); }
  .js .reveal-up.in, .js .ride.in { opacity: 1; transform: none; transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
  .js .gauge { transition: --v 1.1s var(--ease-out) .15s; }
  .js .reveal-up:not(.in) .gauge { --v: 0 !important; }
  .js .ride-line span { transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease-out) .2s; }
  .js .ride.in .ride-line span { transform: none; }
}
@property --v { syntax: '<number>'; inherits: true; initial-value: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- 16. admin (owned by the backend branch; kept on the new tokens) ---------- */
.is-admin .nav-in { gap: 12px; overflow-x: auto; }
.is-admin .ph { font-size: 1.1em; }
.admin-tag { font: 600 .72rem var(--font); background: var(--surface-3); color: var(--ink); border-radius: 999px; padding: 2px 8px; }
.admin-links { display: flex; gap: 2px; margin-left: auto; }
.admin-links a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 8px 10px; border-radius: var(--r-ctl); color: var(--ink-2); font-size: .88rem; white-space: nowrap; min-height: 40px; }
.admin-links a:hover { background: var(--surface-2); color: var(--ink); }
.admin-links span { display: none; }
@media (min-width: 1480px) { .admin-links span { display: inline; } }
.admin { padding-top: 28px; padding-bottom: 64px; }
.is-admin .panel h2 { font-size: var(--fs-xl); }
.is-admin input, .is-admin select { min-height: 42px; }
table.panel { display: block; overflow-x: auto; padding: 0; }
.panel table { width: 100%; display: block; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; vertical-align: top; }
thead th { color: var(--ink-2); font-weight: 600; font-size: .8rem; border-bottom: 1px solid var(--line); }
tbody tr + tr td { border-top: 1px solid var(--line); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; display: grid; gap: 4px; }
.kpi span { color: var(--ink-2); font-size: .82rem; }
.kpi strong { font: 650 1.6rem var(--mono); }
.admin-cols { display: grid; gap: 20px; }
@media (min-width: 1024px) { .admin-cols { grid-template-columns: 1fr 1fr; } }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 160px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar span { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar em { font: normal .68rem var(--mono); color: var(--ink-2); }
.list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 120px; }
.inline { display: inline; }
.price-inline { display: flex; gap: 6px; align-items: center; }
.price-inline input { width: 90px; padding: 0 .5em; }
.price-inline select { width: auto; padding: 0 2em 0 .5em; }
.form-grid { display: grid; gap: 4px 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } .span2 { grid-column: span 2; } }
fieldset.span2 { border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; margin: 8px 0 16px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { text-decoration: none; padding: 8px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); text-transform: capitalize; font-size: .88rem; }
.tabs a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.verify-list { display: grid; gap: 12px; }
.verify-item { display: grid; gap: 12px; margin: 0; }
.verify-item .small { margin-top: 4px; }
.verify-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.verify-actions .price-inline input { width: 160px; }
@media (min-width: 900px) { .verify-item { grid-template-columns: 1fr auto; align-items: center; } }
.creative-grid { display: grid; gap: 20px; }
.creative-row { display: grid; grid-template-columns: 1fr .56fr 1.1fr; gap: 10px; align-items: start; margin-bottom: 10px; }
.creative-row img { border-radius: 8px; border: 1px solid var(--line); }
.creative-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.zone-layout { display: grid; gap: 20px; }
@media (min-width: 1100px) { .zone-layout { grid-template-columns: 7fr 6fr; align-items: start; } }
.zone-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.zone-tools .on { border-color: var(--accent-strong); color: var(--accent-strong); }
.zone-radius { display: inline-flex; gap: 6px; align-items: center; }
.zone-radius input { width: 80px; padding: 0 .5em; }
.map.is-drawing { cursor: crosshair; }
.zone-pending { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 6px; }
.zone-pending li.muted { list-style: none; margin-left: -20px; }
.zone-pending input { width: auto; padding: 0 .5em; }
.zone-rule { display: grid; gap: 0 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .zone-rule { grid-template-columns: 1fr; } }
.zone-bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.zone-bulkbar input, .zone-bulkbar select { width: auto; flex: 0 1 110px; padding: 0 .5em; }
.zone-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.zone-item { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); transition: border-color .3s; }
.zone-item.is-off { opacity: .65; }
.zone-item.flash { border-color: var(--accent-strong); }
.zone-item > input { width: 18px; height: 18px; margin-top: 8px; accent-color: var(--accent-strong); }
.zone-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.zone-edit input, .zone-edit select { width: auto; padding: 0 .5em; }
.zone-edit input[name=name] { flex: 1 1 160px; }
.zone-edit input[type=number] { width: 86px; }
.zone-sum { flex-basis: 100%; }
.assistant { display: grid; gap: 20px; }
@media (min-width: 1100px) { .assistant { grid-template-columns: 8fr 4fr; align-items: start; } }
.chat-log { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; max-height: 60dvh; overflow-y: auto; }
.chat-log li { display: grid; gap: 4px; }
.chat-body { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); max-width: 75ch; }
.chat-user { justify-items: end; }
.chat-user .chat-body { background: var(--accent-soft); }
.chat-error .chat-body { background: var(--bad-soft); color: var(--bad); }
.chat-wait { font-family: var(--mono); }
