:root {
  color-scheme: light;
  --bg: #e8edf2;
  --surface: #ffffff;
  --line: rgba(16, 24, 32, 0.1);
  --line-strong: rgba(16, 24, 32, 0.18);
  --ink: #131a21;
  --ink-2: #55616d;
  --ink-3: #5a6470;
  --amber: #9a5b00;
  --amber-fill: #ffb020;
  --amber-ink: #1a1204;
  --cyan: #0b5c68;
  --focus: #0b5c68;
  --card: rgba(255, 255, 255, 0.96);
  --text: #131a21;
  --muted: #5a6470;
  --accent: #0b5c68;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, input { font: inherit; }

#map { position: fixed; inset: 0; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) clamp(16px, 5vw, 48px) calc(20px + env(safe-area-inset-bottom));
}
.brand { display: flex; align-items: flex-start; gap: 12px; }
.logo {
  width: 52px; height: 52px; flex: none;
  border-radius: 14px; background: var(--amber-fill); color: var(--amber-ink);
  display: grid; place-items: center; font-size: 26px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(255, 176, 32, 0.35);
}
.brand-copy { flex: 1; min-width: 0; }
.brand h1 { margin: 0; font-size: clamp(22px, 4.5vw, 30px); font-weight: 800; color: var(--ink); }
.sub { margin: 4px 0 8px; font-size: 13px; letter-spacing: 0.14em; color: var(--ink-3); }
.road { height: 3px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--amber-fill) 0 26px, transparent 26px 44px); }
.chip { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.tiles { display: grid; gap: 18px; margin-top: 22px; }
.tile {
  display: block; text-decoration: none; color: inherit;
  border-radius: 20px; padding: clamp(22px, 4vw, 30px);
  border: 1px solid transparent;
  transition: transform 260ms var(--ease), background 260ms var(--ease), border-color 260ms var(--ease), box-shadow 260ms var(--ease);
}
.tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(16, 24, 32, 0.12); }
.tile:active { transform: translateY(-1px) scale(0.995); }
.tile--amber { background: #ffe7bd; border-color: rgba(214, 138, 0, 0.42); }
.tile--amber:hover { background: #ffdb9b; border-color: rgba(214, 138, 0, 0.66); }
.tile--cyan { background: #c6e3ea; border-color: rgba(11, 92, 104, 0.34); }
.tile--cyan:hover { background: #b2d7e1; border-color: rgba(11, 92, 104, 0.56); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; }
.tile--amber .icon { background: var(--amber-fill); color: var(--amber-ink); }
.tile--cyan .icon { background: var(--cyan); color: #fff; }
.arrow { color: var(--ink-3); transition: transform 260ms var(--ease), color 260ms var(--ease); }
.tile:hover .arrow { transform: translateX(4px); }
.tile--amber:hover .arrow { color: #7d4a00; }
.tile--cyan:hover .arrow { color: var(--cyan); }
.tile h2 { margin: 14px 0 6px; font-size: clamp(20px, 3.6vw, 25px); font-weight: 800; }
.tile p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags span { font-size: 12px; padding: 4px 11px; border-radius: 999px; background: rgba(16, 24, 32, 0.04); border: 1px solid var(--line); }
.cta { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 700; }
.tile--amber .cta { color: #7d4a00; }
.tile--cyan .cta { color: var(--cyan); }
.tile--meal { grid-column: 1 / -1; background: #ffd9df; border-color: rgba(180, 40, 60, 0.35); }
.tile--meal:hover { background: #ffc9d2; border-color: rgba(180, 40, 60, 0.55); }
.tile--meal .icon { background: #c4314a; color: #fff; }
.tile--meal:hover .arrow, .tile--meal .cta { color: #9f1239; }
.meal { max-width: 880px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) clamp(16px, 5vw, 48px) calc(24px + env(safe-area-inset-bottom)); }
.meal-bar { display: flex; align-items: center; gap: 12px; }
.meal-bar h1 { margin: 0; font-size: 22px; }
.meal-theme { color: var(--ink-2); }
.meal-facts { display: grid; gap: 10px; }
.meal-facts p { margin: 0; padding: 12px 14px; border-radius: 16px; background: #fff; }
.meal-facts strong { display: block; font-size: 18px; }
.meal-facts span { color: var(--ink-2); font-size: 14px; }
.meal-form, .meal-ticket { margin: 16px 0; padding: 16px; border-radius: 16px; background: #fff; }
.meal-form label { display: block; font-weight: 700; margin-bottom: 8px; }
.meal-form input { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; font-size: 16px; }
.meal-form button, .admin-login button, .redeem button { margin-top: 12px; width: 100%; border: 0; border-radius: 999px; background: #c4314a; color: #fff; font-weight: 700; padding: 14px; }
.meal-msg { color: #9f1239; }
.meal-ticket { text-align: center; }
.meal-ticket img { width: 220px; height: 220px; }
.meal-code { font-size: 22px; font-weight: 800; letter-spacing: 0.12em; }
.meal h2 { font-size: 18px; }
.meal li { line-height: 1.7; color: var(--ink-2); }
.meal-org { font-size: 13px; color: var(--ink-3); }
footer { margin-top: 22px; font-size: 12px; color: var(--ink-3); }
.ad { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.ad[hidden] { display: none; }
.ad-mask { position: absolute; inset: 0; background: rgba(16, 24, 32, 0.45); }
.ad-card {
  position: relative; width: min(420px, 92vw); background: var(--surface);
  border-radius: 22px; border: 1px solid var(--line-strong);
  box-shadow: 0 30px 70px rgba(16, 24, 32, 0.24); overflow: hidden;
}
.ad-body { display: block; text-decoration: none; background: #fff; }
.ad-banner, .ad-bike { display: block; width: 100%; height: auto; }
.ad-bike { max-height: 46vh; object-fit: contain; background: #fff; }
.ad-close {
  position: absolute; top: 10px; right: 10px; min-width: 44px; min-height: 44px;
  border: 0; border-radius: 999px; background: rgba(26, 18, 4, 0.4); color: #fff; font-weight: 700; font-size: 13px;
}
.ad-close:disabled { opacity: 1; }
.ad-foot { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 12px; color: var(--ink-3); }
@media (min-width: 720px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.subpage { min-height: 100%; padding: 12px; }
.placeholder {
  margin: 96px 8px 0;
  color: var(--muted);
  line-height: 1.6;
}
.back {
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  padding: 8px 12px;
  text-decoration: none;
}
.hidden { display: none !important; }

.topbar {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.eyebrow { margin: 0; font-size: 12px; color: var(--muted); }
h1 { margin: 2px 0 0; font-size: 18px; font-weight: 700; }

#locateBtn, .radii button, .go {
  border: 0;
  border-radius: 999px;
  background: #0ea5e9;
  color: white;
  padding: 8px 12px;
  cursor: pointer;
}

.status {
  position: fixed;
  top: calc(86px + env(safe-area-inset-top));
  left: 12px;
  z-index: 10;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  font-size: 13px;
}

.status.warn { color: #be123c; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  max-height: 46vh;
  display: flex;
  flex-direction: column;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 4px auto 10px;
  border-radius: 999px;
  background: #cbd5e1;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.radii { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.radii button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 8px;
  font-size: 12px;
}
.radii button.active { background: #0ea5e9; color: white; border-color: transparent; }

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
}

.item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
}

.dist {
  min-width: 64px;
  font-weight: 700;
  color: var(--accent);
}

.name { margin: 0; font-size: 15px; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); padding: 16px 4px; }

.go { flex: none; text-decoration: none; font-size: 13px; }

.setup {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 247, 251, 0.82);
}
.setup.hidden { display: none; }
.setup-card {
  max-width: 420px;
  padding: 20px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
}
.setup-card h2 { margin-top: 0; }
.hint { color: var(--muted); font-size: 13px; }
code { color: #0369a1; }
