:root {
  --bg: #FBF6EE; --card: #FFFFFF; --ink: #2B2016; --muted: #7B6D5F; --faint: #A89A8B; --line: #EBDFD0;
  --pri: #C2410C; --pri-d: #9A3412; --pri-soft: #FDEBDD; --pri-ink: #7C2D12;
  --veg: #15803D; --nveg: #B91C1C;
  --ok: #166534; --ok-soft: #DCFCE7; --warn: #92400E; --warn-soft: #FEF3C7; --err: #991B1B; --err-soft: #FEE2E2;
  --info: #1E40AF; --info-soft: #DBEAFE;
  --r: 14px; --r-sm: 10px; --shadow: 0 1px 2px rgba(60,40,20,.06), 0 2px 8px rgba(60,40,20,.05);
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
a { color: var(--pri-d); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-family: var(--display); font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.wrap { max-width: 720px; margin: 0 auto; padding: 14px 16px 24px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrapx { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt0 { margin-top: 0 !important; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(251,246,238,.94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 19px; }
.brand svg { color: var(--pri); }
.soc-pill { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); max-width: 52%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-pill svg { flex: none; }
.linkbtn { background: none; border: 0; padding: 4px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }

/* bottom tab bar */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar .in { max-width: 720px; margin: 0 auto; display: flex; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px; font-size: 11.5px; color: var(--muted); position: relative; }
.tabbar a.on { color: var(--pri); font-weight: 600; }
.tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--pri); color: #fff; border-radius: 99px; font-size: 10.5px; min-width: 17px; height: 17px; padding: 0 5px; display: grid; place-items: center; font-weight: 700; }

/* flashes */
.flash { border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--err-soft); color: var(--err); }
.flash.info { background: var(--info-soft); color: var(--info); }
.banner { border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner b { display: block; margin-bottom: 2px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 + * { margin-top: 6px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 0 10px; }
.section-h:first-child { margin-top: 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 12px; padding: 11px 16px; font: 600 15px/1.1 inherit; font-family: inherit; cursor: pointer; text-align: center; background: var(--pri); color: #fff; min-height: 44px; }
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--pri-d); border-color: var(--line); }
.btn.soft { background: var(--pri-soft); color: var(--pri-ink); }
.btn.ok { background: var(--ok); }
.btn.danger { background: #fff; color: var(--err); border-color: #F3C9C9; }
.btn.sm { padding: 7px 12px; min-height: 34px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled], .btn.off { background: #EFE7DD; color: var(--faint); cursor: not-allowed; border-color: transparent; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-btn { width: 38px; height: 38px; border-radius: 11px; border: 1.5px solid var(--pri); background: #fff; color: var(--pri); display: grid; place-items: center; cursor: pointer; padding: 0; }
.add-btn:disabled { border-color: var(--line); color: var(--faint); cursor: not-allowed; }

/* forms */
label.f { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; border: 1px solid #DDCFBF; border-radius: 11px; padding: 11px 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); min-height: 46px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pri); outline-offset: 0; border-color: var(--pri); }
.field + .field { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.prefix { position: relative; }
.prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; }
.prefix input { padding-left: 50px; }
.prefix.rs input { padding-left: 28px; }
.choice { display: grid; gap: 8px; }
.choice.two { grid-template-columns: 1fr 1fr; }
.choice.three { grid-template-columns: 1fr 1fr 1fr; }
.choice label { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; background: #fff; font-size: 14px; }
.choice label:has(input:checked) { border-color: var(--pri); background: #FFF8F2; }
.choice input { accent-color: var(--pri); margin: 2px 0 0; width: 17px; height: 17px; flex: none; }
.choice label b { display: block; font-size: 14.5px; }
.choice label small { display: block; font-size: 12.5px; }
.chips-in { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-in label { border: 1.5px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 13.5px; cursor: pointer; background: #fff; user-select: none; }
.chips-in label:has(input:checked) { border-color: var(--pri); background: var(--pri-soft); color: var(--pri-ink); font-weight: 600; }
.chips-in input { position: absolute; opacity: 0; pointer-events: none; }
.otp { letter-spacing: .5em; text-align: center; font-size: 24px !important; font-weight: 700; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13.5px; font-weight: 600; margin-bottom: 6px; padding: 0; }

/* date strip & tabs */
.dates { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 6px; margin: 0 -16px; scrollbar-width: none; }
.dates::-webkit-scrollbar { display: none; }
.dates a { flex: none; width: 56px; padding: 7px 0; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; text-align: center; color: var(--ink); }
.dates a small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dates a b { font-size: 18px; }
.dates a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.dates a.on small { color: #E8DccD; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #F1E7DA; border-radius: 12px; padding: 4px; gap: 4px; }
.seg a { text-align: center; padding: 9px 6px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg a .n { font-weight: 500; color: var(--faint); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 38px; background: #fff; }

/* chef group + product cards */
.chef-h { display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--pri-soft); color: var(--pri-ink); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 28px; border-radius: 16px; }
.chef-h h3 a { color: var(--ink); }
.chef-h small { display: block; font-size: 12.5px; }
.items { display: grid; gap: 10px; }
.pcard { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; box-shadow: var(--shadow); }
.pcard .ph { width: 92px; height: 92px; border-radius: 11px; overflow: hidden; flex: none; background: #F3EADF; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.pcard .bd { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pcard .nm { display: flex; gap: 6px; align-items: flex-start; font-weight: 650; color: var(--ink); line-height: 1.25; }
.pcard .nm .vd { margin-top: 2px; }
.pcard .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pcard .ft { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { font-weight: 700; font-size: 16px; }
.cut { font-size: 11.5px; color: var(--muted); }
.cut.closed { color: var(--err); font-weight: 600; }
.left { font-size: 11.5px; color: var(--warn); font-weight: 600; }
.ph-ph { width: 100%; height: 100%; display: grid; place-items: center; color: #C9B49C; }

/* veg/non-veg marks (FSSAI style) */
.vd { width: 14px; height: 14px; border: 1.6px solid var(--veg); border-radius: 3px; display: inline-grid; place-items: center; flex: none; background: #fff; }
.vd::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--veg); }
.vd.nv { border-color: var(--nveg); }
.vd.nv::after { border-radius: 0; width: 8px; height: 7px; background: var(--nveg); clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* tags */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #F1E7DA; color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.err { background: var(--err-soft); color: var(--err); }
.tag.info { background: var(--info-soft); color: var(--info); }
.tag.pri { background: var(--pri-soft); color: var(--pri-ink); }
.st-awaiting_payment { background: var(--warn-soft); color: var(--warn); }
.st-payment_claimed { background: var(--info-soft); color: var(--info); }
.st-paid, .st-preparing, .st-ready { background: var(--ok-soft); color: var(--ok); }
.st-completed { background: #E7E1D8; color: #574A3C; }
.st-cancelled { background: var(--err-soft); color: var(--err); }

/* product page */
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img, .gallery .ph-ph { flex: none; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r); scroll-snap-align: center; background: #F3EADF; }
.gallery.multi img { width: 88%; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chips a { border: 1.5px solid var(--line); border-radius: 99px; padding: 6px 11px; font-size: 13px; color: var(--ink); background: #fff; }
.day-chips a.on { border-color: var(--pri); background: var(--pri-soft); color: var(--pri-ink); font-weight: 600; }
.day-chips a.x { color: var(--faint); text-decoration: line-through; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.qty button { width: 42px; height: 44px; border: 0; background: none; font-size: 20px; color: var(--pri); cursor: pointer; }
.qty input { width: 44px; border: 0; text-align: center; font-weight: 700; padding: 0; min-height: 44px; border-radius: 0; }
.qty input:focus { outline: none; }
.sticky-cta { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(251,246,238,0), var(--bg) 30%); padding: 18px 0 4px; margin-top: 8px; }

/* cart + orders */
.line { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.line:first-of-type { border-top: 0; }
.line .th { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: #F3EADF; flex: none; }
.line .th img { width: 100%; height: 100%; object-fit: cover; }
.line .err { color: var(--err); font-size: 12.5px; font-weight: 600; }
.qty-sm select { min-height: 36px; padding: 4px 8px; width: 64px; font-size: 15px; }
.totals { font-size: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-weight: 700; font-size: 16px; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 8px; }
.ocard { display: block; color: inherit; }
.ocard .no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; color: var(--muted); }

/* payment */
.pay { text-align: center; }
.pay .amt { font-family: var(--display); font-size: 34px; font-weight: 700; margin: 2px 0; }
.qr { display: inline-block; padding: 10px; background: #fff; border-radius: 16px; border: 1px solid var(--line); margin: 6px auto 0; }
.qr svg { display: block; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12.5px; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.copyrow { display: flex; align-items: center; gap: 8px; background: #FAF5EE; border: 1px solid var(--line); border-radius: 11px; padding: 8px 8px 8px 12px; text-align: left; }
.copyrow + .copyrow { margin-top: 8px; }
.copyrow small { display: block; font-size: 11.5px; }
.copyrow b { font-size: 15px; word-break: break-all; }
.steps { display: flex; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; font-size: 11.5px; color: var(--faint); }
.steps li { flex: 1; text-align: center; position: relative; padding-top: 18px; }
.steps li::before { content: ""; position: absolute; top: 4px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: #E5D9CA; transform: translateX(-50%); z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px; background: #E5D9CA; }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--ok); font-weight: 600; }
.steps li.done::before, .steps li.done::after { background: var(--ok); }

/* chef dashboard */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); color: inherit; display: block; }
.stat b { display: block; font-family: var(--display); font-size: 26px; line-height: 1.1; }
.stat small { font-size: 12.5px; }
.stat.hl { background: var(--pri); border-color: var(--pri); color: #fff; }
.stat.hl small { color: #FFE4D2; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.tile svg { color: var(--pri); }
.tile small { font-weight: 400; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle { width: 50px; height: 30px; border-radius: 99px; background: #D8CBBB; border: 0; position: relative; cursor: pointer; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on { background: var(--ok); }
.toggle.on::after { left: 23px; }
.subnav { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.subnav a { flex: none; padding: 7px 13px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.subnav a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.plist .pcard .ph { width: 64px; height: 64px; }
.plist .pcard.inactive { opacity: .6; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs label { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; cursor: pointer; border: 2px solid transparent; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs input { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; accent-color: var(--err); }
.thumbs label:has(input:checked) { border-color: var(--err); opacity: .55; }
.upload { border: 1.5px dashed #D6C4AF; border-radius: 12px; padding: 14px; text-align: center; background: #FFFCF8; }
.upload input { width: 100%; font-size: 14px; }
.svc { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.svc:first-child { border-top: 0; }
.svc .money { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.svc .money input { min-height: 38px; padding: 7px 10px 7px 26px; font-size: 15px; }
.olist .card + .card { margin-top: 10px; }
.ohead { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.daylabel { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }

/* admin */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td { padding: 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.table tr:first-child td { border-top: 0; }
.adm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.adm-stats .stat b { font-size: 22px; }

/* auth */
.auth { max-width: 420px; margin: 0 auto; padding-top: 8px; }
.hero { text-align: center; padding: 18px 8px 6px; }
.hero .mark { width: 64px; height: 64px; border-radius: 20px; background: var(--pri); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; box-shadow: 0 6px 18px rgba(194,65,12,.28); }
.hero p { color: var(--muted); margin: 8px 0 0; }
.devotp { background: #1F2937; color: #F9FAFB; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.devotp b { font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: .15em; color: #FCD34D; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { color: #D3C2AE; margin: 0 auto 10px; }

@media (min-width: 640px) {
  .items { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .adm-stats { grid-template-columns: repeat(6, 1fr); }
}
[hidden] { display: none !important; }

.grid2 > *, .grid3 > * { min-width: 0; }
input[type=date] { min-width: 0; display: block; }
.meta2 { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.meta2 .no { font-size: 12.5px; }
.sub-card { display: block; color: inherit; }
.sub-card small { display: block; margin-top: 2px; font-size: 13px; }
.sub-card.expired, .sub-card.none { background: var(--err-soft); border-color: #F3C9C9; color: var(--err); }
.sub-card.expiring { background: var(--warn-soft); border-color: #F5DFA0; color: var(--warn); }
.slugin { display: flex; align-items: center; border: 1px solid #DDCFBF; border-radius: 11px; background: #fff; overflow: hidden; }
.slugin span { padding: 0 2px 0 12px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.slugin input { border: 0; padding-left: 0; min-width: 0; }
.slugin:focus-within { outline: 2px solid var(--pri); border-color: var(--pri); }
.slugin input:focus { outline: none; }
.plans { display: grid; gap: 10px; }
.plan { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px; background: #fff; cursor: pointer; }
.plan:has(input:checked) { border-color: var(--pri); background: #FFF8F2; }
.plan input { accent-color: var(--pri); width: 18px; height: 18px; flex: none; margin: 0; }
.plan .pp { font-family: var(--display); font-size: 22px; font-weight: 700; }
.plan .save { margin-left: 6px; }
.tiles { grid-template-columns: 1fr 1fr 1fr; }
.tile { padding: 12px; font-size: 14px; }
.tile small { font-size: 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(6, 1fr); } }
.adm-stats { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .adm-stats { grid-template-columns: repeat(4, 1fr); } }
