/* Kasuwa v0.1 — warm market palette. Mobile first, system fonts only.
   Contrast: white on --coral-d 5.0:1 (AA), --ink on --bg 15:1 and --muted on --bg 8:1 (AAA). */
:root {
  --bg: #fff8f0; --card: #ffffff; --ink: #2b1d14; --muted: #5e4a3b; --line: #f0e2d2;
  /* coral: --coral for decoration and large text, --coral-d for buttons / text on light (AA with white) */
  --coral: #e4572e; --coral-d: #c4431f; --coral-dd: #a2361a; --coral-l: #fde8df;
  --mango: #ffb627; --mango-d: #7a5200; --mango-l: #fff1d1;
  --teal: #1b998b; --teal-d: #12705f; --teal-l: #dff3ef;
  --red: #b3261e; --red-l: #fbe9e7; --r: 16px; --tabs: 64px;
  --shadow: 0 1px 2px rgba(80, 40, 10, .06), 0 3px 12px rgba(80, 40, 10, .07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 12px);
}
body.has-cartbar { padding-bottom: calc(var(--tabs) + 84px); }
a { color: var(--coral-d); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.12rem; }
p { margin: .4em 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
body.saver img { display: none !important; }

/* ---------- chrome ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--coral); }
.logo { flex: none; display: block; }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.wordmark {
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; color: var(--coral); text-transform: lowercase;
}
.brand-sub { font-size: .78rem; font-weight: 600; color: var(--muted); margin-top: 2px; }
.top-sub { display: flex; justify-content: flex-end; }
.role-tag { font-size: .8rem; font-weight: 700; color: var(--mango-d); background: var(--mango-l); border-radius: 20px; padding: 3px 10px; }
.ico { display: block; flex: none; }
.top-sub { flex: 1; color: var(--muted); font-size: .9rem; }
.top { box-shadow: 0 1px 0 var(--line); }
.top-title { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  min-width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; text-decoration: none; color: var(--ink); cursor: pointer;
}
.me-btn { margin-left: auto; font-weight: 700; font-size: .9rem; background: var(--coral-l); color: var(--coral-dd); border-color: transparent; }
.main { max-width: 720px; margin: 0 auto; padding: 14px 14px 8px; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); height: calc(var(--tabs) + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative;
  text-decoration: none; color: var(--muted); font-size: .78rem; font-weight: 600; min-height: 48px;
}
.tab-ico { line-height: 0; }
.tab.on { color: var(--coral-d); font-weight: 800; }
.tab.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--coral-d); }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--mango); color: var(--ink); font-weight: 800; border-radius: 10px; font-size: .72rem; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; }

.offline { background: #3a2618; color: #fff; border-left: 6px solid var(--mango); padding: 10px 14px; font-size: .9rem; position: sticky; top: 0; z-index: 25; }
.offline[hidden] { display: none; }
.cached { font-size: .85rem; color: var(--muted); background: var(--mango-l); border-radius: 10px; padding: 6px 10px; }

.cartbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 8px); z-index: 28; padding: 0 12px; }
.cartbar[hidden] { display: none; }
.cartbar-in {
  max-width: 696px; margin: 0 auto; display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--coral-d); color: #fff; text-decoration: none; padding: 10px 14px 10px 10px; min-height: 56px; border-radius: 28px; box-shadow: 0 6px 18px rgba(196, 67, 31, .35); font-weight: 600;
}
.cartbar-in:active { background: var(--coral-dd); }
.cartbar-count { flex: none; display: inline-flex; align-items: center; gap: 4px; background: var(--mango); color: var(--ink); font-weight: 800; border-radius: 18px; padding: 5px 10px 5px 8px; }
.cartbar-sum { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cartbar-go { flex: none; font-weight: 800; white-space: nowrap; }

.outbox { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 8px); z-index: 29; padding: 0 12px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
body.has-cartbar .outbox { bottom: calc(var(--tabs) + 82px); }
.ob {
  max-width: 696px; width: 100%; margin: 0 auto; display: flex; gap: 10px; align-items: center; pointer-events: auto;
  background: #fffaf2; border: 1px solid #f1d2ae; border-left: 5px solid var(--mango); border-radius: 12px; padding: 8px 12px; font-size: .88rem; box-shadow: var(--shadow);
}
.ob-sent { border-color: #b5e0d8; border-left-color: var(--teal); background: var(--teal-l); }
.ob-failed { border-color: #f0b8b3; border-left-color: var(--red); background: var(--red-l); }
.ob-ico { font-size: 1.1rem; }
.ob-text { flex: 1; }
.ob-x { border: 0; background: transparent; font-size: 1.4rem; min-width: 40px; min-height: 40px; cursor: pointer; color: var(--muted); }
.ob-state { color: var(--mango-d); font-weight: 600; }

/* ---------- generic ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; box-shadow: var(--shadow); display: block; color: inherit; text-decoration: none; }
.card.warn { background: var(--red-l); border-color: #f0c4bf; }
.card.attention { border-color: var(--mango); box-shadow: 0 0 0 2px var(--mango-l), var(--shadow); }
.card.pending { background: #fffaf2; border-style: dashed; border-color: #e7b47f; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.lg { font-size: 1.08rem; }
.center { text-align: center; }
.warn-text { color: var(--red); font-weight: 600; }
.note { background: var(--mango-l); border-radius: 12px; padding: 10px 12px; font-size: .92rem; color: var(--ink); }
.page-h { margin-top: 4px; }
.aisle { margin: 18px 2px 10px; font-size: 1.05rem; color: #3b3a2f; }
.demo-note { text-align: center; color: var(--muted); font-size: .8rem; margin: 22px 0 8px; }
.demo-chip { display: inline-block; font-size: .72rem; background: var(--mango-l); color: var(--mango-d); padding: 1px 8px; border-radius: 10px; font-weight: 600; vertical-align: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700;
  text-decoration: none; cursor: pointer; touch-action: manipulation;
}
.btn.primary { background: var(--coral-d); border-color: var(--coral-d); color: #fff; }
.btn.primary:active { background: var(--coral-dd); }
.btn.primary[disabled] { opacity: .45; }
.btn.danger { color: var(--red); border-color: #efc2bd; background: #fff; }
.btn.ok { color: var(--teal-d); border-color: #a9dcd3; background: var(--teal-l); }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn.big { min-height: 56px; font-size: 1.08rem; }
.btn.block { display: flex; width: 100%; margin: 10px 0; }
.btn-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.btn-row.wrap { flex-wrap: wrap; }
.btn-row .grow { flex: 1; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 4px 0 8px; }
.chip {
  flex: none; min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--card);
  font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--coral-d); border-color: var(--coral-d); color: #fff; }
.chip.ghost { background: transparent; border-style: dashed; }
.chip small { font-weight: 500; opacity: .75; }

.seg { display: flex; background: #efe8dc; border-radius: 14px; padding: 4px; gap: 4px; margin: 6px 0 12px; }
.seg > * {
  flex: 1; min-height: 44px; border: 0; background: transparent; border-radius: 10px; font-weight: 700; color: var(--muted);
  cursor: pointer; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 4px 6px;
}
.seg > .on { background: var(--card); color: var(--coral-dd); box-shadow: var(--shadow); }
.seg.small > * { min-height: 40px; font-size: .86rem; }
.seg.big > * { min-height: 54px; font-size: 1.02rem; }
.count { background: var(--mango); color: var(--ink); font-weight: 800; border-radius: 10px; padding: 0 7px; font-size: .75rem; }

.pill { flex: none; display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: #eee7da; color: #4b4538; white-space: nowrap; }
.st-placed, .st-confirming { background: #fdecd8; color: var(--mango-d); }
.st-needs_approval { background: var(--mango); color: var(--ink); }
.st-needs_approval::before { content: "! "; }
.st-buying, .st-bought { background: #fdecc8; color: var(--mango-d); }
.st-ready_for_pickup, .st-rider_assigned, .st-picked_up { background: #e6ecfa; color: #2d4a8a; }
.st-delivered, .st-collected { background: var(--teal-l); color: var(--teal-d); }
.st-delivered::before, .st-collected::before { content: "✓ "; }
.st-failed::before { content: "⚠ "; }
.st-cancelled { background: #eeeae4; color: #6d665a; }
.st-failed { background: var(--red-l); color: var(--red); }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-emoji { font-size: 2.6rem; }

/* ---------- home / sellers ---------- */
.intro { margin: 2px 0 10px; }
.intro h1 { font-size: 1.4rem; }
.intro p { margin: 0; color: var(--muted); font-size: .95rem; }
.hero { background: linear-gradient(135deg, var(--coral-d) 0%, #2c7f48 100%); color: #fff; border-radius: 20px; padding: 18px; margin-bottom: 12px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--mango); opacity: .9; }
.hero h1 { font-size: 1.35rem; max-width: 80%; position: relative; z-index: 1; }
.hero p { opacity: .92; margin: 0; max-width: 85%; position: relative; z-index: 1; font-size: .95rem; }
.emoji-tile { flex: none; width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; }
.emoji-tile.sm { width: 40px; height: 40px; font-size: 1.3rem; border-radius: 11px; }
.emoji-tile.big { width: 60px; height: 60px; font-size: 2rem; }
.emoji-tile.huge { width: 76px; height: 76px; font-size: 2.6rem; border-radius: 20px; }
.seller-list { display: flex; flex-direction: column; gap: 10px; }
.seller-row { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); min-height: 76px; }
.seller-row.closed { opacity: .65; }
.seller-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.seller-main .muted { font-size: .86rem; }
.blurb { color: #4d4a40; font-size: .9rem; }
.seller-main .blurb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); font-size: 1.6rem; }
.seller-head { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.seller-head h1 { margin: 0 0 2px; font-size: 1.35rem; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.tile.out { opacity: .55; }
.tile-emoji { height: 78px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin-bottom: 6px; }
.tile-name { font-weight: 700; line-height: 1.2; font-size: .96rem; }
.tile-unit { color: var(--muted); font-size: .82rem; }
.tile-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; gap: 4px; min-height: 48px; }
.price { font-size: 1.05rem; }
.add { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--coral-d); color: #fff; font-size: 1.7rem; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(196, 67, 31, .35); flex: none; }
.add:active { background: var(--coral-dd); }
.out-today { font-size: .82rem; font-weight: 700; color: var(--red); }
.stall-where { font-size: .88rem; color: var(--muted); }
.stall-kind { font-size: .8rem; color: var(--muted); }
.seller-head .stall-where { font-weight: 600; color: var(--ink); }
.stepper { display: inline-flex; align-items: center; background: var(--coral-l); border-radius: 23px; flex: none; min-height: 46px; }
.stepper button { width: 40px; height: 46px; border: 0; background: transparent; font-size: 1.35rem; font-weight: 700; color: var(--coral-dd); cursor: pointer; }
.stepper span { min-width: 20px; text-align: center; font-weight: 800; color: var(--coral-dd); }

/* ---------- map ---------- */
.map-box { position: relative; height: 58vh; min-height: 320px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #e9e4da; margin-bottom: 12px; }
.map-box.small { height: 260px; min-height: 0; margin-top: 10px; }
.map-canvas { position: absolute !important; inset: 0; width: 100%; height: 100%; }
.map-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; color: var(--muted); gap: 10px; }
.map-hint { position: absolute; left: 10px; top: 10px; background: rgba(255, 255, 255, .92); padding: 6px 10px; border-radius: 10px; font-size: .85rem; font-weight: 600; }
.layers-btn {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.layers-card { position: absolute; top: 118px; right: 10px; z-index: 4; background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 6px 22px rgba(0, 0, 0, .25); width: 250px; }
.layers-title { font-weight: 800; margin-bottom: 8px; }
.layers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.layer-tile { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 6px; font-size: .8rem; font-weight: 700; display: flex; flex-direction: column; gap: 4px; align-items: center; cursor: pointer; min-height: 72px; }
.layer-tile.on { border-color: var(--coral-d); color: var(--coral-dd); }
.swatch { width: 100%; height: 38px; border-radius: 8px; }
.sw-light { background: linear-gradient(135deg, #f4f3ef 40%, #dfe6ea 40% 55%, #f4f3ef 55%); }
.sw-dark { background: linear-gradient(135deg, #2b2f36 40%, #444b55 40% 55%, #2b2f36 55%); }
.sw-satellite { background: radial-gradient(circle at 30% 40%, #6f7b4c, #3e4a2b 60%, #8a7d5a); }
.pin { border: 0; cursor: pointer; padding: 0; background: transparent; }
.pin-seller { width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 3px solid var(--coral-d); font-size: 1.2rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); display: flex; align-items: center; justify-content: center; }
.pin-closed { border-color: #aaa; opacity: .7; }
.pin-drop { font-size: 2rem; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.pin-market span { display: block; background: var(--mango); color: var(--ink); font-weight: 800; font-size: .8rem; padding: 4px 10px; border-radius: 14px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); white-space: nowrap; }
.pin-card { position: relative; }
.pin-card .ob-x { position: absolute; right: 4px; top: 4px; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ---------- cart / checkout ---------- */
.cart-line { border-top: 1px solid var(--line); padding: 12px 0 4px; margin-top: 10px; }
.line-total { text-align: right; font-weight: 700; margin: 4px 0; }
.mini-label { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 8px 0 4px; text-transform: uppercase; letter-spacing: .03em; }
.note-in { width: 100%; min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.sum { margin: 10px 0; }
.sumline { display: flex; justify-content: space-between; padding: 6px 2px; gap: 10px; }
.sumline.total { border-top: 2px solid var(--line); margin-top: 4px; padding-top: 10px; font-size: 1.12rem; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .95rem; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, label.inline input, .sel-sm {
  min-height: 50px; border: 1.5px solid #ddd3c2; border-radius: 12px; padding: 10px 12px; background: #fff; font-weight: 500; width: 100%;
}
.sel-sm { min-height: 42px; width: auto; max-width: 100%; padding: 6px 10px; font-size: .9rem; }
.form input:focus, .form select:focus, .form textarea:focus, .note-in:focus { outline: 3px solid #f7c3b1; border-color: var(--coral-d); }
label.check { flex-direction: row !important; align-items: center; gap: 10px !important; font-weight: 600 !important; }
label.check input { width: 24px; height: 24px; accent-color: var(--coral-d); flex: none; }
label.check.big { padding: 6px 0; }
label.inline { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .9rem; margin-top: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice-col { display: flex; flex-direction: column; gap: 8px; }
.choice { position: relative; font-weight: 400 !important; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: flex; flex-direction: column; border: 1.5px solid #ddd3c2; border-radius: 12px; padding: 10px 12px; background: #fff; min-height: 56px; justify-content: center; cursor: pointer; }
.choice small { color: var(--muted); font-size: .8rem; }
.choice input:checked + span { border-color: var(--coral-d); background: var(--coral-l); box-shadow: inset 0 0 0 1px var(--coral-d); }
.choice input:focus-visible + span { outline: 3px solid #f7c3b1; }
.pinrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pinrow .muted { flex: 1 1 100%; }
.form-err { color: var(--red); font-weight: 700; margin: 0; min-height: 1em; }
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input { flex: 1; min-width: 0; min-height: 50px; border: 1.5px solid #ddd3c2; border-radius: 12px; padding: 10px 14px; background: #fff; }

/* ---------- orders ---------- */
.order-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 56px; }
.order-row .grow { display: flex; flex-direction: column; }
.action-needed { display: block; background: var(--mango-l); color: var(--mango-d); padding: 8px 10px; border-radius: 10px; font-weight: 700; font-size: .9rem; text-decoration: none; margin-bottom: 6px; }
.steps { list-style: none; padding: 0; margin: 6px 0 14px; display: flex; gap: 4px; }
.steps li { flex: 1; font-size: .72rem; color: var(--muted); text-align: center; display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.steps li span { height: 6px; border-radius: 3px; background: #e6dfd2; }
.steps li.done span { background: var(--coral); }
.steps li.now span { background: var(--mango); }
.steps li.now { color: var(--ink); }
.item-line { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.item-line:first-of-type { border-top: 0; }
.item-line .grow { display: flex; flex-direction: column; }
.item-line.struck b { text-decoration: line-through; color: var(--muted); }
.amt { font-weight: 700; white-space: nowrap; }
.chg { display: inline-block; margin-top: 4px; background: var(--mango-l); color: var(--mango-d); font-weight: 700; font-size: .85rem; padding: 2px 8px; border-radius: 8px; align-self: flex-start; }
.chg.out { background: var(--red-l); color: var(--red); }
.code-card { text-align: center; background: #fffdf8; border: 2px dashed var(--coral-d); }
.code-label { font-weight: 700; color: var(--muted); }
.code { font-size: 2.6rem; font-weight: 800; letter-spacing: .3em; color: var(--coral-dd); font-variant-numeric: tabular-nums; padding-left: .3em; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-top: 1px solid var(--line); }
.kv:first-child { border-top: 0; }
.kv b { text-align: right; }
.stars { display: flex; gap: 6px; }
.stars button { font-size: 2rem; width: 52px; height: 52px; border: 1px solid var(--line); background: #fff; border-radius: 12px; color: #d99100; cursor: pointer; }
.events summary { cursor: pointer; color: var(--muted); padding: 10px 0; min-height: 44px; }

/* ---------- agent ---------- */
.order-card { display: flex; flex-direction: column; gap: 6px; }
.items-sum { font-size: .92rem; margin: 6px 0; }
.pickup-inline { background: var(--coral-l); padding: 6px 10px; border-radius: 10px; font-size: .9rem; }
.pref-tag { display: inline-block; margin: 4px 0; background: var(--mango-l); padding: 2px 8px; border-radius: 8px; font-size: .86rem; }
.dec-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.dec { min-height: 46px; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; font-weight: 700; font-size: .82rem; cursor: pointer; padding: 2px; }
.dec.on { color: #fff; }
.dec-ok { background: var(--teal-d); border-color: var(--teal-d); }
.dec-qty.on, .dec-price.on, .dec-sub.on { background: var(--mango); border-color: var(--mango); color: var(--ink); }
.dec-out { background: var(--red); border-color: var(--red); }
.sticky-act { position: sticky; bottom: calc(var(--tabs) + 6px); background: linear-gradient(transparent, var(--bg) 30%); padding-top: 14px; }
.code-in { font-size: 1.5rem !important; letter-spacing: .4em; text-align: center; font-weight: 800 !important; font-variant-numeric: tabular-nums; }

/* ---------- rider ---------- */
.rider-status.online { border-color: var(--teal); }
.toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; border: 0; border-radius: 14px; background: #ece5d8; padding: 8px 14px; font-weight: 800; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.toggle .knob { width: 54px; height: 32px; border-radius: 16px; background: #c9c0b0; position: relative; flex: none; transition: background .2s; }
.toggle .knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle.on { background: var(--teal-l); color: var(--teal-d); }
.toggle.on .knob { background: var(--teal-d); }
.toggle.on .knob::after { left: 25px; }
.route { font-size: 1.08rem; }
.arrow { color: var(--coral); font-weight: 800; }
.fee { font-size: 1.3rem; color: var(--coral-dd); white-space: nowrap; }
.job .muted { margin-top: 4px; }
.leg { border-left: 4px solid var(--line); padding: 4px 0 8px 12px; margin: 12px 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.leg > * { max-width: 100%; }
.leg.now { border-color: var(--mango); }
.leg.done { border-color: var(--teal); opacity: .8; }
.leg-h { font-size: .8rem; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.leg .row { width: 100%; }
.codeform { width: 100%; margin-top: 6px; }
.collect { background: var(--mango-l); color: var(--mango-d); font-weight: 800; padding: 6px 10px; border-radius: 10px; }
.failform { margin-top: 10px; }
.failform[hidden] { display: none; }
.earn { text-align: center; }
.big-num { font-size: 2.4rem; font-weight: 800; color: var(--coral-dd); }

/* ---------- SMS ---------- */
.sms-list { display: flex; flex-direction: column; gap: 8px; }
.sms { max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: .92rem; background: #fff; border: 1px solid var(--line); word-wrap: break-word; }
.sms-in { align-self: flex-end; background: var(--mango-l); border-color: #f1d2ae; }
.sms-out { align-self: flex-start; background: var(--coral-l); border-color: #f5cbbb; }
.sms-meta { font-size: .74rem; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
input.sim-body { font-size: 1.15rem !important; font-weight: 700 !important; letter-spacing: .03em; }
.sim-result .effect { color: var(--coral-dd); font-family: ui-monospace, Menlo, monospace; }
.invite-code { font-size: 1.1rem; background: var(--coral-l); padding: 8px 12px; border-radius: 10px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--coral-d); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; flex: none; }

@media (min-width: 720px) { .main { padding-top: 20px; } }
.cart-head { display: flex; flex-direction: column; }
.cart-head + .cart-line { margin-top: 6px; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.seg > * { white-space: nowrap; }
.veh { margin-top: 10px; }
.veh summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.veh summary::-webkit-details-marker { display: none; }
.veh .link { color: var(--coral-d); font-weight: 700; text-decoration: underline; }
.veh[open] .link { visibility: hidden; }
.zoomed-out .pin-seller { display: none; }
.map-wrap:not(.zoomed-out) .pin-market span { opacity: .92; transform: translateY(-40px); }
.btn-row .sel-sm { flex: 1 1 160px; min-width: 0; }

/* Product cards: + sits on the picture corner and grows into a stepper. */
.tile-emoji { position: relative; height: 104px; }
.tile-ctl { position: absolute; right: 6px; bottom: 6px; font-size: 1rem; line-height: 1; }
.tile-ctl .stepper { background: #fff; box-shadow: 0 2px 8px rgba(80, 40, 10, .2); }
.tile .price { margin-top: 2px; font-size: 1.12rem; }
.tile .out-today { margin-top: 4px; }
.seller-head { display: block; margin-bottom: 8px; }
.seller-head .row { align-items: center; }
.seller-head .blurb { margin: 10px 0 0; }

/* Market agent flow */
.status-line { font-weight: 700; font-size: 1.02rem; margin: 0 0 8px; }
.order-row .small { color: var(--ink); margin-top: 2px; }
.hold-inline { display: inline-block; background: var(--mango-l); color: var(--mango-d); font-weight: 800; font-size: .85rem; padding: 2px 10px; border-radius: 10px; }
.group-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; padding: 8px 10px; background: var(--bg); border-radius: 12px; }
form.row .inline { margin-top: 0; }
form.row { align-items: flex-end; }

/* Map tools: locate button, blue dot, dropped pin, toast */
.locate-btn {
  position: absolute; top: 64px; right: 10px; z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.locate-btn.on { color: #1a73e8; }
.locate-btn.on svg path { fill: currentColor; }
.locate-btn.busy svg { animation: kPulse 1s ease-in-out infinite; }
@keyframes kPulse { 50% { opacity: .35; } }
.my-dot { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15), 0 1px 4px rgba(0, 0, 0, .35); }
.my-acc { border-radius: 50%; background: rgba(26, 115, 232, .14); border: 1px solid rgba(26, 115, 232, .35); pointer-events: none; }
.drop-pin { width: 30px; height: 40px; cursor: grab; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 40'%3E%3Cpath d='M15 39C15 39 28 24 28 14A13 13 0 0 0 2 14C2 24 15 39 15 39Z' fill='%23E4572E' stroke='%23A2361A' stroke-width='2'/%3E%3Ccircle cx='15' cy='14' r='5' fill='%23fff'/%3E%3C/svg%3E"); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.maplibregl-popup-content { border-radius: 14px; padding: 12px 14px; box-shadow: 0 6px 20px rgba(80, 40, 10, .25); font: inherit; }
.drop-card b { font-size: 1rem; }
.drop-co { font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.drop-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.drop-btns .btn { min-height: 40px; }
.map-toast { position: absolute; z-index: 6; left: 50%; bottom: 34px; transform: translateX(-50%); background: rgba(43, 29, 20, .92); color: #fff; font-size: .9rem;
  padding: 8px 14px; border-radius: 20px; pointer-events: none; transition: opacity .3s; white-space: nowrap; opacity: 0; }
.near-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.km { flex: none; font-weight: 800; font-size: .88rem; color: var(--coral-dd); background: var(--coral-l); border-radius: 12px; padding: 2px 8px; }
.map-hint-below { margin: 6px 2px 0; }

/* ---------- illustrated icons (/icons.svg sprite; part of the offline shell, so they stay on in data saver) ---------- */
.emoji-tile, .tile-emoji { position: relative; }
.emoji-tile > .art, .tile-emoji > .art { display: block; width: 80%; height: 80%; }
.tile-emoji { display: flex; align-items: center; justify-content: center; }
.tile-emoji > .art { width: auto; height: 84%; aspect-ratio: 1; }
.tile-emoji .tile-ctl { z-index: 2; }
.emoji-tile > .cut, .tile-emoji > .cut { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 7%; z-index: 1; }
body:not(.saver) .has-cut > .art, body:not(.saver) .has-cut > .emo { visibility: hidden; }
.chip-ico { display: inline-block; width: 24px; height: 24px; margin: -4px 6px -4px -6px; vertical-align: middle; }
.chip.on .chip-ico { background: var(--card); border-radius: 50%; }
.banner, .status-pic { display: flex; justify-content: center; border-radius: 18px; margin: 0 0 12px; padding: 4px 0; }
.banner { background: var(--mango-l); }
.status-pic { background: var(--teal-l); }
.banner .scene { width: 100%; max-width: 300px; height: 140px; }
.status-pic .scene { width: 100%; max-width: 270px; height: 126px; }

/* ---------- home carousel (real product photos) ---------- */
.carousel { margin: 0 0 14px; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 20px; }
.car-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; display: flex; align-items: center; gap: 8px; min-height: 168px; padding: 16px 10px 16px 18px;
  background: var(--mango-l); color: var(--ink); text-decoration: none; position: relative; }
.slide:nth-child(5n+2) { background: #FBE3DA; } .slide:nth-child(5n+3) { background: #E3F2EC; } .slide:nth-child(5n+4) { background: #F3EBDD; } .slide:nth-child(5n+5) { background: #E8F1DC; }
.slide-txt { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.slide-tag { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--coral-d); }
.slide-name { font-size: 1.25rem; line-height: 1.15; }
.slide-price { font-size: 1.15rem; font-weight: 800; } .slide-price small { font-weight: 500; color: var(--muted); font-size: .85rem; }
.slide-seller { font-size: .85rem; color: var(--muted); }
.slide-img { flex: none; width: 46%; max-width: 190px; aspect-ratio: 1; object-fit: contain; }
.car-dots { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.car-dots .dot { width: 24px; height: 24px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.car-dots .dot::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .2s, background .2s; }
.car-dots .dot.on::before { width: 20px; background: var(--coral-d); }

/* ---------- product detail ---------- */
.tile-emoji { cursor: pointer; }
.tile-link { position: absolute; inset: 0; z-index: 1; }
a.tile-name { color: inherit; text-decoration: none; display: block; }
.pd-hero { position: relative; overflow: hidden; isolation: isolate; height: 300px; border-radius: 22px; margin: 2px 0 14px; display: flex; align-items: center; justify-content: center; font-size: 6rem; background: #fff !important; }
.pd-hero > .cut { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4%; z-index: 0; }
.pd-hero > svg { width: 70%; height: 70%; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + 90px); transform: translateX(-50%); z-index: 60; background: #2B1D14; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: .9rem; transition: opacity .3s; pointer-events: none; }
.pd-name { font-size: 1.55rem; margin: 0; }
.pd-unit { color: var(--muted); margin-top: 2px; }
.pd-price { font-size: 1.9rem; font-weight: 800; margin: 8px 0 2px; }
.pd-price small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.pd-stock { font-weight: 700; font-size: .95rem; }
.pd-stock.yes { color: #13776c; } .pd-stock.no { color: var(--red, #b3261e); }
.pd-seller { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none; }
.pd-seller .grow { display: flex; flex-direction: column; }
.pd-sec { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.pd-sec h2 { font-size: 1.05rem; margin-bottom: 8px; }
.hrow { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -14px; padding: 2px 14px 8px; scrollbar-width: none; }
.hrow::-webkit-scrollbar { display: none; }
.hrow > .tile { flex: 0 0 44%; scroll-snap-align: start; }
.pd-note { color: var(--muted); font-size: .85rem; margin: 18px 0 110px; }
.pd-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); z-index: 29; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(60, 30, 10, .08); }
.pd-bar-in { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; align-items: center; padding: 10px 14px; }
.stepper.big { min-height: 52px; padding: 0 6px; font-size: 1.15rem; background: var(--bg); border-radius: 999px; display: inline-flex; align-items: center; }
.stepper.big button { min-width: 44px; min-height: 44px; font-size: 1.4rem; }
.stepper.big span { min-width: 28px; text-align: center; font-weight: 700; }
.pd-bar .btn.big { min-height: 52px; border-radius: 999px; white-space: nowrap; }

/* photo tiles sit on white, like a product shot */
.tile-emoji.has-cut, .emoji-tile.has-cut { background: #fff !important; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- duty, seller refunds, cash ledger ---------- */
.duty-card { padding: 10px; }
.duty-card .toggle { min-height: 52px; font-size: 1rem; }
.duty-card p { margin: 8px 4px 0; }
.duty-card.online { border-color: var(--teal); }
.refund-inline { display: inline-block; background: var(--red-l); color: var(--red); font-weight: 700; font-size: .88rem; padding: 3px 10px; border-radius: 10px; margin-top: 4px; }
.refund-card.open { border-left: 5px solid var(--red); }
.refund-card h2 { font-size: 1.1rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.refund-card p { margin: 4px 0; }
.refund-card .form { margin-top: 8px; }
.rf-kept { margin-top: 10px; }
.rf-kept > summary, .cash-form > summary { cursor: pointer; font-weight: 700; color: var(--coral-d); min-height: 44px; display: flex; align-items: center; }
.rf-kept .form { margin-top: 4px; }
.refund-line { color: var(--red); }
.refund-line b { color: var(--red); }
.kv.total { border-top: 2px solid var(--line); font-weight: 700; }
.two-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-cards .card { margin: 0 0 12px; padding: 12px; }
.two-cards .mini-label { margin-top: 0; }
.bal .kv { font-size: .92rem; gap: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two-col .kv { font-size: .92rem; gap: 6px; }
.btn-col { display: flex; flex-direction: column; margin-top: 6px; border-top: 1px solid var(--line); }
.cash-form { border-bottom: 1px solid var(--line); }
.cash-form:last-child { border-bottom: 0; }
.cash-form .form { padding: 2px 0 12px; }
.rf-row { background: var(--red-l); border-radius: 10px; padding: 6px 10px 0; margin: 6px 0; }
.rf-row .cash-form { border-bottom: 0; }
.rec-agent.has-refund { border-left: 5px solid var(--red); }
.filter-row { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .92rem; margin: 0 0 12px; }
.filter-row .sel-sm { flex: 1; }
.move b { white-space: nowrap; }
.move span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 360px) { .two-cards, .two-col { grid-template-columns: 1fr; } }
