/* ຮ້ອງໄລເດີ — customer app. Brand: lime + black on a soft light background.
   Light screens use the :root tokens; anything inside .ink (hero, nav, tracking sheet) switches to the dark set. */
:root {
  --bg: #F2F3EC;
  --surface: #FFFFFF;
  --surface-2: #FAFBF6;
  --line: #E3E5DA;
  --line-strong: #C7CABD;
  --text: #11130F;
  --text-soft: #3B3F36;
  --muted: #6B7064;
  --lime: #C6F135;
  --accent: #C6F135;          /* fills: buttons, dots, markers */
  --accent-text: #3F6212;     /* lime-family text that stays readable on light */
  --on-accent: #11130F;
  --accent-dim: #EEF8CC;
  --ink: #11130F;
  --warn: #92400E;
  --warn-dim: #FEF3C7;
  --danger: #B42318;
  --danger-dim: #FEE4E2;
  --star: #F59E0B;
  --nav-h: 92px;
  --shadow: 0 1px 2px rgba(17,19,15,.04), 0 8px 24px rgba(17,19,15,.06);
  font-family: 'Noto Sans Lao', 'Noto Sans Thai', system-ui, sans-serif;
  color-scheme: light;
  -webkit-tap-highlight-color: transparent;
}
.ink {
  --bg: #11130F;
  --surface: #1C1F19;
  --surface-2: #161813;
  --line: #2C3027;
  --line-strong: #484D41;
  --text: #F4F6EE;
  --text-soft: #CFD4C5;
  --muted: #9CA192;
  --accent-text: #C6F135;
  --accent-dim: #28320E;
  --warn: #FACC15;
  --warn-dim: #2A2414;
  --danger: #FCA5A5;
  --danger-dim: #2E1A18;
  --shadow: none;
  color-scheme: dark;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
body { min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1 { margin: 0; font-size: 26px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
h2 { margin: 0; font-size: 18px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lime { color: var(--lime); }

/* ---------- app frame (phone-width column, centred on desktop) ---------- */
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; display: flow-root; }
.page { padding: calc(env(safe-area-inset-top) + 16px) 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 20px); display: flex; flex-direction: column; gap: 16px; }
.page.no-nav { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
.page > h1:first-child { font-size: 28px; padding: 8px 4px 0; }
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-size: 22px; flex: 1; }

/* home hero */
.hero { border-radius: 28px; padding: 20px 20px 22px; background: var(--bg); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: var(--lime); opacity: .14; }
.hero-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.hero-badge { width: 40px; height: 40px; border-radius: 14px; background: var(--lime); color: var(--on-accent); display: grid; place-items: center; flex-shrink: 0; }
.hero-big { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; position: relative; z-index: 1; }
.hero-sub { font-size: 14px; color: var(--muted); position: relative; z-index: 1; }

/* floating bottom nav with a raised lime "+" */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 900;
  bottom: calc(env(safe-area-inset-bottom) + 12px); width: calc(100% - 32px); max-width: 488px; height: 68px;
  display: grid; grid-template-columns: 1fr 88px 1fr; align-items: center;
  background: var(--bg); border-radius: 26px; box-shadow: 0 12px 32px rgba(17,19,15,.28);
}
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 12px; height: 100%; }
.nav a.active { color: var(--lime); font-weight: 700; }
.nav a.fab { justify-self: center; width: 64px; height: 64px; margin-top: -30px; border-radius: 50%; background: var(--lime); color: var(--on-accent); font-weight: 700; border: 5px solid #F2F3EC; box-shadow: 0 8px 20px rgba(17,19,15,.25); gap: 0; font-size: 11px; }
.nav a.fab.active { color: var(--on-accent); }

/* ---------- controls ---------- */
.btn {
  min-height: 52px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; font-size: 18px; min-height: 60px; }
.btn.primary svg { color: var(--lime); }
.ink .btn.primary, .btn.lime { background: var(--lime); border-color: var(--lime); color: var(--on-accent); }
.ink .btn.primary svg, .btn.lime svg { color: var(--on-accent); }
.btn.block { width: 100%; }
.btn.danger { border-color: var(--danger-dim); color: var(--danger); background: var(--surface); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.icon-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; text-decoration: none; box-shadow: var(--shadow); }
.round-btn { width: 50px; height: 50px; flex-shrink: 0; border-radius: 50%; border: none; display: grid; place-items: center; cursor: pointer; text-decoration: none; background: var(--surface); color: var(--text); }
.round-btn.lime { background: var(--lime); color: var(--on-accent); }
.round-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); text-decoration: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.input {
  width: 100%; min-height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); padding: 12px 16px; font-size: 16px;
}
.input::placeholder { color: #8E9386; }
.ink .input::placeholder { color: #7D8274; }
.input:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: transparent; }
.ink .input:focus { outline-color: var(--lime); }
textarea.input { min-height: 72px; resize: vertical; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button {
  min-height: 54px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; line-height: 1.25;
}
.seg button .sub { font-size: 12px; color: var(--muted); }
.seg button[aria-pressed="true"] { border: 2px solid var(--ink); background: var(--ink); color: #fff; font-weight: 700; }
.seg button[aria-pressed="true"] .sub { color: #B9BEAE; }
.ink .seg button[aria-pressed="true"] { border-color: var(--lime); background: var(--accent-dim); color: var(--lime); }

/* service tiles */
.svc { min-height: 104px !important; gap: 8px; border-radius: 22px !important; box-shadow: var(--shadow); }
.svc .bub { width: 46px; height: 46px; border-radius: 50%; background: var(--accent-dim); color: var(--accent-text); display: grid; place-items: center; }
.svc[aria-pressed="true"] .bub { background: var(--lime); color: var(--on-accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); }
.ink .card { border-color: var(--line); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.green { background: var(--accent-dim); color: var(--accent-text); }
.pill.yellow { background: var(--warn-dim); color: var(--warn); }
.pill.red { background: var(--danger-dim); color: var(--danger); }
.pill.grey { background: #ECEDE6; color: var(--text-soft); }
.label { font-size: 14px; font-weight: 700; color: var(--text-soft); margin: 4px 0 -6px 4px; }

/* route card: pickup → dropoff */
.route { padding: 4px 16px; }
.stop { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: 100%; background: none; border: none; text-align: left; cursor: pointer; color: var(--text); position: relative; }
.stop + .stop { border-top: 1px dashed var(--line-strong); }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--lime); flex-shrink: 0; box-shadow: 0 0 0 4px rgba(198,241,53,.28); border: 2px solid var(--ink); }
.ink .dot { border-color: var(--lime); }
.dot.sq { border-radius: 4px; background: var(--ink); box-shadow: 0 0 0 4px rgba(17,19,15,.1); border-color: var(--ink); }
.ink .dot.sq { background: #fff; border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.12); }
.stop .cap { font-size: 13px; color: var(--muted); }
.stop .val { font-size: 16px; font-weight: 600; }
.stop .val.empty { color: #8E9386; font-weight: 400; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex-shrink: 0; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; box-shadow: var(--shadow); }
.toggle-row { display: flex; align-items: center; gap: 12px; }
.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; border-radius: 999px; border: none; padding: 0; background: var(--line-strong); cursor: pointer; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { left: 25px; background: var(--lime); }

/* sticky price/submit bar on the order form */
.submit-bar {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 4px); z-index: 5;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 28px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px rgba(17,19,15,.12);
}
.price-line { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px; }
.price-line .fee { font-size: 22px; font-weight: 700; }

/* active order banner */
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 22px; background: var(--ink); color: #fff; text-decoration: none; cursor: pointer; width: 100%; text-align: left; }
.banner .muted { color: #A9AE9F; }
.banner svg { color: var(--lime); }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); flex-shrink: 0; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(198,241,53,.6); } 70% { box-shadow: 0 0 0 12px rgba(198,241,53,0); } 100% { box-shadow: 0 0 0 0 rgba(198,241,53,0); } }

/* ---------- map ---------- */
.map { background: #E6E8DF; }
.leaflet-container { background: #E6E8DF; font: inherit; }
.leaflet-tile-pane { filter: saturate(.35) contrast(1.02) brightness(1.03); }
.leaflet-control-attribution { background: rgba(255,255,255,.75) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-control-zoom { display: none; }
.mk { display: grid; place-items: center; }
.mk-pick { width: 24px; height: 24px; border-radius: 50%; background: var(--lime); border: 4px solid #11130F; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.mk-drop { width: 22px; height: 22px; border-radius: 6px; background: #11130F; border: 4px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.mk-rider { width: 44px; height: 44px; border-radius: 50%; background: #11130F; color: var(--lime); border: 3px solid var(--lime); box-shadow: 0 0 0 10px rgba(198,241,53,.3); }

/* full-screen map picker */
.picker { position: fixed; inset: 0; z-index: 1000; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); }
.picker .map { flex: 1; position: relative; }
.picker-top { position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 12px; right: 12px; z-index: 600; display: flex; flex-direction: column; gap: 10px; }
.picker-top .chips .chip { background: rgba(255,255,255,.96); }
.center-pin { position: absolute; left: 50%; top: 50%; z-index: 500; transform: translate(-50%, -100%); pointer-events: none; display: flex; flex-direction: column; align-items: center; }
.center-pin .head { width: 36px; height: 36px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--lime); border: 3px solid #11130F; box-shadow: 0 4px 12px rgba(0,0,0,.35); display: grid; place-items: center; }
.center-pin .head::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #11130F; }
.center-pin.drop .head { background: #11130F; border-color: #fff; }
.center-pin.drop .head::after { background: var(--lime); border-radius: 2px; }
.center-pin .stem { width: 2px; height: 10px; background: #11130F; margin-top: -2px; }
.locate { position: absolute; right: 12px; bottom: 14px; z-index: 600; }
.sheet { background: var(--bg); border-radius: 28px 28px 0 0; margin-top: -24px; position: relative; z-index: 700; padding: 22px 18px calc(env(safe-area-inset-bottom) + 18px); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -10px 30px rgba(17,19,15,.12); }

/* ---------- order view: full-screen map + black sheet that slides up ---------- */
.order-map { position: fixed; top: 0; left: 0; right: 0; margin: 0 auto; max-width: 520px; height: 100dvh; z-index: 1; overflow: hidden; contain: strict; }
.order-map .back { position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 12px; z-index: 600; }
.order-map .eta { position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 68px; right: 12px; z-index: 600; background: #11130F; color: #fff; border-radius: 18px; padding: 8px 16px; min-height: 48px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.order-map .eta .muted { color: #A9AE9F; }
.order-map .eta strong { color: var(--lime); }
.order-body {
  position: relative; z-index: 2; margin-top: 54dvh; min-height: 46dvh; background: var(--bg); border-radius: 30px 30px 0 0;
  padding: 26px 18px calc(env(safe-area-inset-bottom) + 28px); display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 -12px 40px rgba(0,0,0,.28);
}
.order-body::before { content: ''; position: absolute; top: 10px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--line-strong); }

/* status timeline: dots joined by a line */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; }
.steps div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-align: center; position: relative; line-height: 1.3; }
.steps div::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); position: relative; z-index: 1; }
.steps div:not(:last-child)::after { content: ''; position: absolute; top: 7px; left: 50%; width: 100%; height: 2px; background: var(--line); }
.steps div.done { color: var(--text-soft); }
.steps div.done::before { background: var(--lime); border-color: var(--lime); }
.steps div.done:not(:last-child)::after { background: var(--lime); }
.steps div.now { color: var(--text); font-weight: 700; }
.steps div.now::before { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 0 5px rgba(198,241,53,.25); animation: pulse 1.6s infinite; }

.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--lime); color: var(--on-accent); display: grid; place-items: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.radar { position: absolute; left: 50%; top: 27%; z-index: 550; pointer-events: none; transform: translate(-50%, -50%); }
.radar span { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px; border-radius: 50%; border: 3px solid #11130F; background: rgba(198,241,53,.18); animation: radar 2.4s ease-out infinite; opacity: 0; }
.radar span:nth-child(2) { animation-delay: .8s; }
.radar span:nth-child(3) { animation-delay: 1.6s; }
@keyframes radar { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(4.5); opacity: 0; } }
.success { width: 88px; height: 88px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; margin: 8px auto 0; box-shadow: 0 0 0 12px rgba(198,241,53,.16); }
.stars { display: flex; justify-content: center; gap: 4px; }
.stars button { width: 52px; height: 52px; border: none; background: none; cursor: pointer; color: var(--line-strong); display: grid; place-items: center; }
.stars button.on { color: var(--star); }
.proof { width: 100%; max-height: 300px; object-fit: cover; border-radius: 20px; display: block; }
.proof-ph { height: 140px; border-radius: 20px; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 7px 0; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }

/* history */
.order-item { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; width: 100%; box-shadow: var(--shadow); }

/* login */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 22px; gap: 18px; }
.logo { width: 76px; height: 76px; border-radius: 24px; background: var(--ink); color: var(--lime); display: grid; place-items: center; }
.logo svg { color: var(--lime) !important; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%); z-index: 2000; background: #11130F; color: #fff; padding: 12px 18px; border-radius: 16px; max-width: calc(100vw - 32px); width: max-content; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.toast.error { background: #7A1C14; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent-text); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo { background: #E8F0FE; color: #1E40AF; padding: 8px 14px; border-radius: 14px; font-size: 13px; }
.ink .demo { background: #1C2433; color: #93C5FD; }

.rider-name { font-size: 18px; font-weight: 700; line-height: 1.3; }
