:root {
  --mint: #7fd8be;
  --mint-dark: #2f9e7f;
  --mint-soft: #e6f6f1;
  --ink: #1d2b27;
  --muted: #6b7c76;
  --bg: #f4faf8;
  --card: #ffffff;
  --line: #d9ece6;
  --danger: #d9534f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
#app { padding: 12px 12px 84px; max-width: 560px; margin: 0 auto; }
a { color: var(--mint-dark); text-decoration: none; }
h1 { font-size: 22px; margin: 8px 0 14px; }
h2 { font-size: 17px; margin: 18px 0 10px; }
.muted { color: var(--muted); font-size: 13px; }

.loader { text-align: center; padding: 60px 0; color: var(--muted); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.topbar .back { font-size: 22px; padding: 4px 8px; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; background: var(--card); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mint); border-color: transparent; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
textarea { min-height: 72px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--mint-dark); color: #fff; border: none; border-radius: 10px;
  padding: 11px 16px; font-size: 15px; cursor: pointer; width: 100%;
}
.btn:active { filter: brightness(0.95); }
.btn.secondary { background: var(--mint-soft); color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.small { width: auto; padding: 7px 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-size: 13px; color: var(--ink);
}
.chip.active { background: var(--mint-dark); color: #fff; border-color: var(--mint-dark); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.b-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.b-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--mint-soft); }
.b-card .body { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.b-card .name { font-weight: 600; font-size: 14px; }
.b-card .price { color: var(--mint-dark); font-weight: 700; }
.b-detail img { width: 100%; border-radius: 14px; aspect-ratio: 1; object-fit: cover; background: var(--mint-soft); }
.b-detail .price { font-size: 22px; font-weight: 700; color: var(--mint-dark); margin: 10px 0; }
.desc { color: var(--muted); font-size: 14px; white-space: pre-line; }

.cart-item { display: flex; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; align-items: center; }
.cart-item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--mint-soft); flex-shrink: 0; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .name { font-weight: 600; font-size: 14px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 16px; cursor: pointer; }
.remove { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px; }

.total-row { display: flex; justify-content: space-between; align-items: center; margin: 14px 0; font-size: 17px; font-weight: 700; }

.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
}
.bottom-bar .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.bottom-bar .sum { font-weight: 700; white-space: nowrap; }

.order-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--mint-soft); }
.badge.new { background: #fff3cd; }
.badge.cancelled { background: #f8d7da; }
.badge.delivered { background: #d4edda; }

.notice { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.success-num { font-size: 26px; font-weight: 800; color: var(--mint-dark); margin: 8px 0; }
.pay-link { display: block; margin: 14px 0; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; z-index: 50; max-width: 90%;
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.pager .btn { width: auto; }
