:root {
  --green-900: #07402F;
  --green-700: #0B6E4F;
  --green-500: #16A374;
  --mint: #E3F5EC;
  --paper: #F6FAF7;
  --surface: #FFFFFF;
  --ink: #12261F;
  --faint: #5B7068;
  --line: #DCE8E1;
  --mango: #F7C948;
  --chili: #C7371F;
  --r-sm: 10px;
  --r-md: 16px;
  --shadow: 0 8px 24px rgba(7, 64, 47, .10);
  --body: "Anuphan", "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
  --hand: "Sriracha", "Anuphan", "Leelawadee UI", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--green-900); color: var(--ink);
  font: 400 16px/1.55 var(--body);
}
h1, h2, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h2 { font-size: 1.15rem; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: not-allowed; }
small { font-size: .82rem; }
:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; border-radius: 6px; }

.icon { width: 24px; height: 24px; flex: none; }
.faint { color: var(--faint); }
.grow { flex: 1; min-width: 0; }
.pad { padding: 20px 16px; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.stack > section > h2 { margin-bottom: 8px; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 14px; }
.stack > .page-title { margin-bottom: 0; }

.shell {
  max-width: 480px; min-height: 100dvh; margin: 0 auto; background: var(--paper);
  position: relative; padding-bottom: 92px; overflow-x: clip;
}
.shell.wide { max-width: 1120px; padding-bottom: 32px; }

/* Home header: the curved green band from the campaign art. */
.hero {
  background: var(--green-700); color: #fff;
  padding: calc(16px + env(safe-area-inset-top)) 16px 46px;
  border-radius: 0 0 50% 50% / 0 0 26px 26px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand b { display: block; font-size: 1.4rem; line-height: 1.15; }
.brand span { font-size: .86rem; color: #D2EDE0; }
.logo { flex: none; display: block; }
.address {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 9px 12px;
  background: #fff; color: var(--ink); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.address > span:nth-child(2) { flex: 1; min-width: 0; }
.address small { display: block; color: var(--faint); line-height: 1.2; }
.address b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.address .pin { color: var(--green-700); display: flex; }
.address > .icon { color: var(--faint); width: 18px; height: 18px; }

.searchbox {
  display: flex; align-items: center; gap: 10px; margin: -24px 16px 0; padding: 12px 14px;
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 999px;
  color: var(--faint);
}

.demo-note { margin: 10px 16px 0; font-size: .84rem; color: #8A6100; text-align: center; }
.notice.banner { margin: 10px 16px 0; }
.free-hint { margin-top: 4px; color: var(--green-700); font-weight: 600; }
.pickup-hint { margin-bottom: 8px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-top: 14px; background: rgba(255,255,255,.16); border-radius: 12px; }
.seg button { padding: 7px 8px; border-radius: 9px; text-align: center; font-weight: 600; color: #fff; }
.seg button.on { background: #fff; color: var(--green-700); }
.stack .seg { margin: 0 0 10px; background: var(--mint); }
.stack .seg button { color: var(--green-700); }
.stack .seg button.on { background: var(--green-700); color: #fff; }

.depts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px 0; }
.dept { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1.500px solid var(--line); border-radius: var(--r-md); }
.dept span { grid-row: span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--mint); color: var(--green-700); }
.dept b { line-height: 1.25; }
.dept small { color: var(--faint); line-height: 1.25; }
.dept.on { border-color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-700); }
.dept.on span { background: var(--green-700); color: #fff; }

.goods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.product { display: flex; flex-direction: column; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.product-art { display: grid; place-items: center; height: 88px; margin-bottom: 6px; font-size: 2.6rem; border-radius: var(--r-sm); background: var(--mint); }
.product.tea .product-art, .tile.tea { background: #fff; }
.product.tea .product-art, .product-art:has(img) { height: auto; aspect-ratio: 1; background: #fff; }
.item-toggle span.tag { flex: none; }
.item-thumb { flex: none; width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 8px; }
.product-art img, .tile img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.tile.big { overflow: hidden; }
.dept span img { width: 42px; height: 42px; border-radius: 50%; background: #fff; }
.dept.on span:has(img) { background: #fff; }
.tile.mart { background: var(--mint); }
.product strong { font-weight: 600; line-height: 1.3; }
.product .faint { font-size: .82rem; line-height: 1.3; flex: 1; }
.product b { margin-top: 4px; color: var(--green-700); }
.product:disabled { opacity: .55; }

.dept-tag { padding: 0 6px; border-radius: 5px; font-size: .76rem; font-weight: 600; background: var(--mint); color: var(--green-700); }
.dept-tag.tea { background: #F6DFC3; color: #6E4310; }
.tag.pickup { background: #FBEBC8; color: #6E4E00; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.staff .section-head h2 { margin: 0; }
.item-toggle .link { flex: none; }

/* The one loud element on Home: a dry-brush ribbon. */
.brush {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin: 20px 0 8px -6px; padding: 14px 12px 14px 26px; color: #fff; background: var(--green-700);
  transform: rotate(-1.5deg);
  clip-path: polygon(0 12%, 3% 4%, 9% 8%, 22% 2%, 41% 6%, 60% 1%, 79% 5%, 93% 0, 100% 9%, 98% 28%, 100% 47%, 97% 68%, 100% 90%, 94% 96%, 76% 93%, 55% 99%, 33% 95%, 15% 100%, 4% 94%, 2% 76%, 0 58%, 2% 34%);
}
.brush > div { min-width: 0; }
.brush-title { font: 400 2.1rem/1.15 var(--hand); }
.brush-sub { font-size: .86rem; color: #E3F5EC; }
.brush-sub b { color: var(--mango); }
.brush .scooter { width: 96px; flex: none; }
.scooter { display: block; --sc-body: #0B6E4F; --sc-trim: #16A374; --sc-mark: #fff; }
.brush .scooter, .track .scooter, .login-art .scooter { --sc-body: #fff; --sc-trim: #BFE8D3; --sc-mark: #0B6E4F; }

.pillars { display: grid; grid-template-columns: repeat(4, 1fr); padding: 14px 8px 0; }
.pillar { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 6px; text-align: center; }
.pillar + .pillar { border-left: 1px solid var(--line); }
.pillar span {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: var(--mint); color: var(--green-700);
}
.pillar.on span { background: var(--green-700); color: #fff; }
.pillar small { line-height: 1.25; font-weight: 500; }
.pillar.on small { color: var(--green-700); font-weight: 700; }

.cats { display: flex; gap: 12px; overflow-x: auto; padding: 18px 16px 2px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.cat span {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface); border: 1.500px solid var(--line); font-size: 1.6rem; color: var(--green-700);
}
.cat.on span { border-color: var(--green-700); box-shadow: inset 0 0 0 1.500px var(--green-700); }
.cat.on small { font-weight: 700; color: var(--green-700); }

.section { padding: 20px 16px 0; }
.shops { margin-top: 8px; }
.shop, .order-row { display: flex; gap: 12px; padding: 12px 0; align-items: center; }
.shop + .shop, .order-row + .order-row { border-top: 1px solid var(--line); }
.shop.closed { opacity: .62; }
.shop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-text strong { font-size: 1.05rem; font-weight: 700; }
.tile {
  flex: none; display: grid; place-items: center; width: 76px; height: 76px;
  border-radius: var(--r-md); font-size: 2.3rem;
}
.tile.big { width: 88px; height: 88px; font-size: 2.8rem; }
.tile.small { width: 44px; height: 44px; font-size: 1.4rem; background: var(--mint); border-radius: 50%; }
.meta { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; font-size: .86rem; margin-top: 2px; }
.rate { color: #9A6B00; font-weight: 700; }
.tag {
  display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--mint);
  color: var(--green-700); font-size: .8rem; font-weight: 600;
}
.tag.off { background: #F3E3DF; color: var(--chili); }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface);
  border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 5;
}
.tabbar a { display: flex; flex-direction: column; align-items: center; font-size: .78rem; color: var(--faint); }
.tabbar a.on { color: var(--green-700); font-weight: 700; }

.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 72px; z-index: 6;
  width: calc(100% - 24px); max-width: 456px; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--green-900); color: #fff; border-radius: var(--r-md); box-shadow: var(--shadow);
}
.cartbar span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell:not(:has(.tabbar)) .cartbar { bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 10px 18px; border-radius: 12px; background: var(--green-700); color: #fff;
  font-weight: 700; text-align: center;
}
.btn:hover { background: var(--green-900); }
.btn:disabled { background: #B9CCC3; }
.btn.ghost { background: transparent; color: var(--green-700); box-shadow: inset 0 0 0 1.500px var(--green-700); }
.btn.ghost:hover { background: var(--mint); }
.btn.block { display: flex; width: 100%; }
.link { color: var(--green-700); font-weight: 600; }
.link.light { color: #fff; font-size: .9rem; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: .92rem; font-weight: 600; }
.field input, .field textarea, .searchfield {
  width: 100%; padding: 11px 12px; background: #fff; border: 1.500px solid var(--line);
  border-radius: 12px; font-weight: 400; font-size: 1rem;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green-700); }
.searchfield { display: flex; align-items: center; gap: 8px; color: var(--faint); margin-bottom: 14px; }
.searchfield:focus-within { border-color: var(--green-700); }
.searchfield input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); }
.hint { padding: 8px 0; }

.topbar { display: flex; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top)) 12px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar a { display: flex; padding: 4px; }
.topbar h1 { font-size: 1.15rem; font-weight: 700; }

.shop-hero { position: relative; height: 160px; display: grid; place-items: center; }
.shop-emoji { font-size: 5rem; }
.round {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 50%; background: #fff; color: var(--green-700);
}
.round.solid { background: var(--green-700); color: #fff; }
.shop-hero .round { position: absolute; left: 12px; top: calc(12px + env(safe-area-inset-top)); }
.shop-info { padding: 16px 16px 0; }
.shop-info h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.25; }
.shop-info .tag { margin-top: 6px; }
.notice { padding: 10px 12px; margin-top: 8px; border-radius: var(--r-sm); background: #FBEAE5; color: #8E2412; font-weight: 500; }
.menu { margin-top: 4px; }
.dish { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; }
.dish + .dish { border-top: 1px solid var(--line); }
.dish .tile { width: 60px; height: 60px; font-size: 1.8rem; }
.dish-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish-text strong { font-weight: 600; }
.dish:disabled { opacity: .55; }

#overlay { display: none; }
#overlay.open { display: block; position: fixed; inset: 0; z-index: 20; }
.scrim { position: absolute; inset: 0; background: rgba(7, 64, 47, .55); }
.sheet {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  max-height: 88dvh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); animation: rise .2s ease-out;
}
@keyframes rise { from { transform: translate(-50%, 24px); opacity: 0; } }
.sheet > h2 { font-size: 1.3rem; margin-bottom: 8px; }
.sheet-head { display: flex; gap: 12px; align-items: center; }
.sheet-head h2 { font-size: 1.25rem; line-height: 1.25; }
.options { border: 0; padding: 0; margin: 16px 0 12px; }
.options legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.options label { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.options label span:nth-child(2) { flex: 1; }
.options input, .item-toggle input { width: 20px; height: 20px; accent-color: var(--green-700); }
.sheet .field { margin-top: 12px; }
.sheet-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.stepper { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.stepper button {
  width: 42px; height: 42px; border-radius: 50%; text-align: center; font-size: 1.3rem;
  color: var(--green-700); box-shadow: inset 0 0 0 1.500px var(--green-700);
}
.stepper.small { gap: 8px; }
.stepper.small button { width: 32px; height: 32px; font-size: 1rem; }

.cart-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line .grow > * { display: block; }
.cart-line strong { font-weight: 600; }
.cart-emoji { font-size: 1.7rem; }
.line-link { display: flex; flex-direction: column; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.promo { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; }
.promo .btn { min-height: 49px; }
.stack > .promo { margin-top: 0; }
.pay { font-weight: 600; }
.sum { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.sum.total { font-size: 1.2rem; font-weight: 700; padding-top: 8px; margin-top: 6px; border-top: 2px dashed var(--line); }

.status { font-size: .86rem; font-weight: 600; color: var(--green-700); }
.status.s-pending { color: #8A6100; }
.status.s-cancelled { color: var(--chili); }
.status.s-delivered { color: var(--faint); }

/* Tracking: the scooter drives the campaign's winding road to the door. */
.track { background: var(--green-700); color: #fff; padding: 18px 16px 12px; }
.track.stopped { background: #55655F; }
.track-title { font: 400 1.9rem/1.2 var(--hand); }
.track-sub { color: #D2EDE0; font-size: .92rem; }
.road { position: relative; height: 150px; margin-top: 8px; }
.road > svg { position: absolute; inset: 22px 0 0; width: 100%; height: 120px; overflow: visible; }
.road-bed { fill: none; stroke: var(--green-900); stroke-width: 22; stroke-linecap: round; }
.road-line { fill: none; stroke: #fff; stroke-width: 2.500; stroke-dasharray: 10 10; vector-effect: non-scaling-stroke; }
.road-start, .road-end {
  position: absolute; display: grid; place-items: center; width: 38px; height: 38px; background: #fff;
  color: var(--green-700); border-radius: 50%; font-size: 1.2rem; box-shadow: var(--shadow);
}
.road-start { left: -2px; bottom: 0; }
.road-end { right: -4px; top: 6px; }
.rider { position: absolute; left: -31px; top: -46px; width: 62px; }
.track.stopped .rider { filter: grayscale(1); }

.steps li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 0 0 12px 26px; color: var(--faint); }
.steps li::before {
  content: ""; position: absolute; left: 3px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 0 0 2px var(--line);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: -4px; width: 2px; background: var(--line); }
.steps li.done { color: var(--ink); font-weight: 500; }
.steps li.done::before { background: var(--green-500); box-shadow: 0 0 0 2px var(--green-500); }
.steps time { color: var(--faint); font-weight: 400; }
.rider-card { display: flex; align-items: center; gap: 12px; }
.rider-card .grow > * { display: block; }
.starpick { display: flex; gap: 6px; }
.starpick button { font-size: 2.2rem; line-height: 1; color: var(--mango); }

.address-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.address-row .grow { display: flex; flex-direction: column; }
.address-row + .btn { margin-top: 12px; }

.login { min-height: 100dvh; }
.login-art { background: var(--green-700); color: #fff; padding: 28px 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.login-art p { font: 400 2.2rem/1.2 var(--hand); }
.login-art .scooter { width: 120px; transform: translateY(14px); }
.demo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.btn.line { background: #06C755; color: #052E16; }
.btn.line:hover { background: #05B34C; }
.staff-login summary { cursor: pointer; font-weight: 600; color: var(--green-700); padding: 4px 0; }
.staff-login form { margin-top: 10px; }
.contact-field { margin-bottom: 14px; }
.field select { width: 100%; padding: 11px 12px; background: #fff; border: 1.500px solid var(--line); border-radius: 12px; font-weight: 400; font-size: 1rem; }
.field[hidden] { display: none; }
.secret { margin: 8px 0; padding: 12px; background: var(--mint); border-radius: var(--r-sm); font-size: 1.3rem; font-weight: 700; text-align: center; letter-spacing: .04em; user-select: all; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 14px; }
tr.inactive td { color: var(--faint); }
.add-staff { margin-top: 12px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 20px; text-align: center; color: var(--faint); }
.empty .scooter { width: 120px; }

#toast {
  position: fixed; left: 50%; bottom: 140px; transform: translate(-50%, 12px); z-index: 30;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Staff views */
.staffbar { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: var(--green-700); color: #fff; flex-wrap: wrap; }
.staffbar .grow b { display: block; font-size: 1.15rem; line-height: 1.2; }
.staffbar .grow span { font-size: .84rem; color: #D2EDE0; }
.switch { padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.switch.on { background: var(--mango); color: var(--green-900); }
.staff { padding: 16px; }
.staff .section { padding-left: 0; padding-right: 0; }
.staff .section > h2 { margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.stat { background: var(--surface); padding: 12px 14px; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.25; color: var(--green-700); font-variant-numeric: tabular-nums; }
.stat span { font-size: .84rem; color: var(--faint); }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; align-items: start; }
.column h2 { margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.count { font-size: .84rem; min-width: 24px; text-align: center; padding: 0 6px; background: var(--mint); color: var(--green-700); border-radius: 999px; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 12px; }
.ticket header, .ticket footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ticket header { margin-bottom: 4px; }
.ticket footer { margin-top: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ticket footer > b { margin-right: auto; }
.ticket li { padding: 2px 0; }
.ticket li small { display: block; }
.ticket time { color: var(--faint); font-size: .86rem; }
.note { color: #8A6100; }
.earn { color: var(--green-700); font-weight: 700; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.item-toggle { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.item-toggle span { flex: 1; min-width: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: .84rem; color: var(--faint); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.top li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.top li span:first-child { flex: 1; }

@media (max-width: 760px) {
  .board { grid-template-columns: 1fr; }
  .staffbar .grow { flex-basis: calc(100% - 50px); }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, #toast { transition: none; animation: none; }
}
