:root {
  --bg: #f7f1e6; --card: #fffdf8; --ink: #23231f; --muted: #6b665c; --line: #e6dccb;
  --green: #1f3b2d; --green-ink: #f7f1e6; --red: #a4232f; --red-dark: #861b25; --gold: #c9a24a;
  --ok: #1f7a46; --warn: #b26b00;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
header.top { background: var(--green); color: var(--green-ink); padding: 18px 0 14px; border-bottom: 4px solid var(--gold); }
header.top h1 { margin: 0; font: 700 1.5rem/1.2 Georgia, "Times New Roman", serif; }
header.top p { margin: 4px 0 0; opacity: .85; font-size: .95rem; }
.banner { background: #fff3cd; color: #5c4400; padding: 8px 16px; text-align: center; font-size: .9rem; border-bottom: 1px solid #f0d98a; }
.banner.info { background: #e5f2ea; color: #164a2c; border-color: #b6dcc4; }
.banner a { color: inherit; font-weight: 700; }
h2.cat { font: 700 1.15rem Georgia, serif; color: var(--red); margin: 22px 0 8px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px 14px; margin-bottom: 8px; width: 100%; text-align: left; color: inherit; }
.item:active { transform: scale(.99); }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 650; overflow-wrap: anywhere; }
.item .inc { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.item .price { font-weight: 700; white-space: nowrap; }
.item .add { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 1.4rem; line-height: 1; flex: none; display: grid; place-items: center; }
.item .qtybadge { background: var(--green); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .8rem; margin-left: 6px; }
.item.soldout { opacity: .5; }
.item.soldout .add { background: #999; }
.spacer { height: calc(110px + env(safe-area-inset-bottom)); }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 15px 18px; font-weight: 700; font-size: 1.05rem; background: var(--red); color: #fff; text-align: center; text-decoration: none; }
.btn:active { background: var(--red-dark); }
.btn[disabled] { opacity: .55; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.green { background: var(--green); }
.cartbar .btn { max-width: 608px; margin: 0 auto; display: flex; justify-content: space-between; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; z-index: 10; }
.sheet-bg.open { display: block; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain; visibility: hidden; background: var(--card); border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); z-index: 11; transform: translateY(105%); transition: transform .2s ease; }
.sheet.open { transform: none; visibility: visible; }
.sheet:not(.open) { transition: transform .2s ease, visibility 0s .2s; }
body.locked { overflow: hidden; }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet .x { flex: none; width: 44px; height: 44px; margin: -8px -6px 0 0; border: 0; border-radius: 50%; background: #efe7d8; color: var(--ink); font-size: 1.5rem; line-height: 1; }
.sheet-foot { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: var(--card); padding: 4px 0 calc(18px + env(safe-area-inset-bottom)); margin-bottom: calc(-18px - env(safe-area-inset-bottom)); }
.group-label.missing { color: var(--red); }
.chips.missing .chip { border-color: var(--red); }
.sheet-inner { max-width: 608px; margin: 0 auto; }
.sheet h3 { margin: 0 0 4px; font: 700 1.25rem Georgia, serif; overflow-wrap: anywhere; }
.sheet .sub { color: var(--muted); margin: 0 0 12px; font-size: .9rem; }
.group-label { font-weight: 700; margin: 14px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 9px 16px; min-height: 44px; }
.chip.on { border-color: var(--green); background: var(--green); color: #fff; }
.stepper { display: flex; align-items: center; gap: 14px; margin: 16px 0; }
.stepper button { width: 44px; height: 44px; color: var(--ink); border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.3rem; }
.stepper span { font-weight: 700; min-width: 20px; text-align: center; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.line { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line .info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.line .amt { white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 2px; flex: none; }
.qty button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 1.25rem; line-height: 1; }
.qty button.rm { color: var(--red); font-size: 1rem; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; }
.line .opts { color: var(--muted); font-size: .85rem; }
.total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.15rem; margin: 14px 0; }
label.f { display: block; font-weight: 650; margin: 12px 0 6px; }
input.f, textarea.f, select.f { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; font-size: 16px; }
input.f:focus, textarea.f:focus { outline: 2px solid var(--green); border-color: var(--green); }
.err { color: var(--red); font-weight: 600; margin: 10px 0; min-height: 1.2em; }
.err:empty { margin: 4px 0; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--green); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 650; box-shadow: 0 6px 20px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.wrapw { overflow-wrap: anywhere; }
.small { color: var(--muted); font-size: .85rem; }
.center { text-align: center; }
.big-num { font: 800 4.5rem/1 Georgia, serif; color: var(--green); margin: 8px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 0; }
.status { border-radius: 14px; padding: 18px; text-align: center; font-weight: 700; font-size: 1.2rem; margin: 16px 0; }
.status.paid { background: #e5f2ea; color: #164a2c; }
.status.ready { background: var(--ok); color: #fff; font-size: 1.5rem; animation: pulse 1.4s infinite; }
.status.done { background: #eee; color: #555; }
.status.pending { background: #fff3cd; color: #5c4400; }
@keyframes pulse { 50% { transform: scale(1.03); } }
