:root {
  --bg: #f5f3ef; --surface: #fff; --surface-2: #f9f7f3; --ink: #1c1a17; --ink-2: #67615a; --line: #e5e0d7;
  --brand: #0f6b5a; --brand-ink: #fff; --brand-soft: #e1f1eb; --accent: #e8a33d;
  --bad: #b42318; --bad-soft: #fde8e6; --good: #137a3a; --good-soft: #e3f4e9; --warn: #a15c00; --warn-soft: #fbeed9;
  --radius: 14px; --tabs-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211; --surface: #1c1b19; --surface-2: #242320; --ink: #f2efe9; --ink-2: #a9a399; --line: #33312d;
    --brand: #43b996; --brand-ink: #08201a; --brand-soft: #16382f; --accent: #f0b35a;
    --bad: #f2867b; --bad-soft: #3d1d1a; --good: #6fd49a; --good-soft: #163522; --warn: #f0b35a; --warn-soft: #3a2a12;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
[hidden] { display: none !important; }

.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
.mark { width: 34px; height: 34px; display: block; flex: none; }
.wordmark { font-family: "Space Grotesk", -apple-system, "Segoe UI", sans-serif; font-weight: 700; letter-spacing: -0.02em; font-size: 19px; }
.bar-link { font-weight: 600; text-decoration: none; font-size: 15px; }

.view { max-width: 720px; margin: 0 auto; padding: 14px 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: grid; justify-items: center; gap: 1px; padding: 8px 0 9px; text-decoration: none; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.tabs a.on { color: var(--brand); }
.ti { font-size: 21px; line-height: 1.2; position: relative; }
.dot { position: absolute; top: -3px; right: -10px; background: var(--bad); color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 5px; font-style: normal; }

.store-card { background: var(--brand); color: var(--brand-ink); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.store-card h1 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.store-card p { margin: 4px 0 0; opacity: .88; font-size: 14px; }
.store-card .pill { display: inline-block; margin-top: 10px; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.store-switch { color: inherit; font-size: 13px; float: right; opacity: .9; }

.search { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.p { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.p .img { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; font-size: 34px; color: var(--ink-2); }
.p .img img { width: 100%; height: 100%; object-fit: cover; }
.p .body { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.p .name { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p .price { font-weight: 800; }
.p .left { font-size: 12px; color: var(--warn); font-weight: 600; }
.p .foot { margin-top: auto; padding-top: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 10px 16px; border-radius: 12px; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.block { width: 100%; padding: 14px; font-size: 16px; }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; }
.step { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.step button { border: 0; background: var(--surface-2); width: 38px; height: 34px; font-size: 18px; font-weight: 700; cursor: pointer; }
.step span { font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.line { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .grow { flex: 1; min-width: 0; }
.line .t { font-weight: 600; font-size: 15px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
h2 { font-size: 22px; margin: 6px 0 14px; letter-spacing: -.01em; }
h3 { font-size: 16px; margin: 0 0 10px; }
.total { font-size: 20px; font-weight: 800; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.empty { text-align: center; color: var(--ink-2); padding: 48px 12px; }
.empty .big { font-size: 42px; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.field input, .field textarea { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 400; }
.field input:focus, .field textarea:focus, .search:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); flex: none; }
.error { color: var(--bad); font-size: 14px; min-height: 1em; }

.code { text-align: center; padding: 20px 12px; border-radius: var(--radius); background: var(--ink); color: var(--bg); }
.code .digits { font-size: 44px; font-weight: 800; letter-spacing: .16em; font-variant-numeric: tabular-nums; padding-left: .16em; }
.code .lbl { font-size: 13px; opacity: .75; }
.timeline { display: grid; gap: 0; margin: 4px 0; }
.tl { display: flex; gap: 12px; align-items: flex-start; position: relative; padding-bottom: 16px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .b { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); flex: none; display: grid; place-items: center; font-size: 13px; color: var(--brand-ink); }
.tl.done .b { background: var(--brand); border-color: var(--brand); }
.tl.now .b { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tl .t { font-weight: 700; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.s-placed { background: var(--warn-soft); color: var(--warn); }
.s-accepted { background: var(--brand-soft); color: var(--brand); }
.s-ready { background: var(--good); color: #fff; }
.s-picked_up { background: var(--good-soft); color: var(--good); }
.s-cancelled { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

.gate { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; padding: 24px; text-align: center; }
.gate .box { max-width: 360px; }
.gate .mark { width: 84px; height: 84px; margin: 0 auto 18px; }
.gate h1 { font-size: 26px; margin: 0 0 8px; }
.gate p { color: var(--ink-2); margin: 0 0 24px; }
.gate .btns { display: grid; gap: 10px; }

.install { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + 12px + env(safe-area-inset-bottom)); z-index: 20; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; font-size: 14px; max-width: 696px; margin: 0 auto; }
.install .grow { flex: 1; }
.install button { background: transparent; border: 0; color: inherit; font-weight: 700; cursor: pointer; padding: 6px; }
.install .go { background: var(--brand); color: var(--brand-ink); border-radius: 9px; padding: 7px 12px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(10px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); color: #fff; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); height: 220px; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .toast { transition: none; } }
