:root {
  --green: #2f7d32;
  --green-dark: #1f5a22;
  --lime: #91c11e;
  --bg: #f6f7f2;
  --card: #fff;
  --ink: #1d231c;
  --muted: #6a7366;
  --line: #e3e7dc;
  --chip: #eef5e2;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121611;
    --card: #1b211a;
    --ink: #e9eee5;
    --muted: #9aa595;
    --line: #2b3329;
    --chip: #233020;
    --green: #5fb062;
    --green-dark: #8fd18f;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(96px + var(--safe-b));
}
button { font: inherit; color: inherit; cursor: pointer; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 20px; letter-spacing: -.3px; }
.brand b { color: var(--green); }
.logo { font-size: 24px; }
.link { background: none; border: 0; color: var(--green); font-weight: 600; padding: 8px 0; }

main { max-width: 720px; margin: 0 auto; padding: 0 16px; }

.hero { padding: 20px 0 8px; }
.hero h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.15; letter-spacing: -.5px; }
.hero p { margin: 0; color: var(--muted); }

.people {
  display: flex; align-items: center; gap: 10px; margin: 16px 0 4px;
  font-size: 14px; color: var(--muted);
}
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--muted);
}
.chip[aria-pressed="true"] { background: var(--chip); border-color: var(--green); color: var(--green-dark); }

.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.card.on { border-color: var(--green); box-shadow: 0 0 0 2px var(--green) inset; }
.pic {
  height: 128px; display: grid; place-items: center; font-size: 64px;
  position: relative;
}
.tag {
  position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,.92); color: #1d231c;
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.body h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.meta { display: flex; gap: 12px; font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.add {
  margin-top: 8px; width: 100%; border: 0; border-radius: 12px; padding: 11px;
  background: var(--chip); color: var(--green-dark); font-weight: 700;
}
.card.on .add { background: var(--green); color: #fff; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(0,0,0,.08);
}
.bar-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar-info { flex: 1; min-width: 0; }
.bar-info b { display: block; }
.bar-info span { color: var(--muted); font-size: 13px; }
.cta {
  border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 800;
  background: var(--green); color: #fff; white-space: nowrap;
}
.cta:disabled { opacity: .45; }
.cta.wide { width: 100%; padding: 15px; font-size: 17px; }

.dots { display: flex; gap: 4px; margin-top: 4px; }
.dots i { width: 18px; height: 5px; border-radius: 3px; background: var(--line); }
.dots i.f { background: var(--lime); }

/* checkout */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.panel h2 { margin: 0 0 10px; font-size: 18px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.row:last-child { border-bottom: 0; }
.row span:last-child { text-align: right; color: var(--muted); }
.row.total { font-weight: 800; font-size: 18px; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 6px; padding-top: 12px; }
.row.total span:last-child { color: var(--green); }
.strike { text-decoration: line-through; }
.fine { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.paybox {
  border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted);
}
.paybox b { color: var(--ink); display: block; margin-bottom: 4px; }

/* list */
.aisle { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.items { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.items li { border-bottom: 1px solid var(--line); }
.items li:last-child { border-bottom: 0; }
.items label { display: flex; align-items: center; gap: 12px; padding: 13px 14px; cursor: pointer; }
.items input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.items .name { flex: 1; }
.items .qty { font-weight: 700; white-space: nowrap; }
.items .for { display: block; font-size: 12px; color: var(--muted); }
.items li.got .name, .items li.got .qty { text-decoration: line-through; opacity: .45; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0 0; }
.progress i { display: block; height: 100%; background: var(--green); width: 0; transition: width .2s; }
.actions { display: flex; gap: 10px; margin: 14px 0; }
.ghost { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px; font-weight: 700; }
.toast {
  position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 20;
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
