:root {
  color-scheme: light;
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --ink: #1C1917;
  --ink-2: #44403C;
  --muted: #57534E;
  --line: #E7E2DA;
  --soft: #F5F0E8;
  --stripe-a: #EFE6DA;
  --stripe-b: #E9DDCD;
  --accent: #C2410C;
  --accent-ink: #9A3412;
  --accent-soft: #FDEBDD;
  --green: #15803D;
  --green-soft: #DCFCE7;
  --red: #B91C1C;
  --red-soft: #FEE2E2;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); }
body {
  color: var(--ink);
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: #B4350B; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
.loading { padding: 60px 20px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* app frame */
.screen { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.content { flex: 1; padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.content.with-nav { padding-bottom: calc(96px + var(--safe-b)); }
.content.with-bar { padding-bottom: calc(110px + var(--safe-b)); }
.content.with-nav-bar { padding-bottom: calc(170px + var(--safe-b)); }
.cartbar.above-nav { bottom: calc(68px + var(--safe-b)); padding-bottom: 10px; background: none; }

/* top bars */
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 6px; }
.topbar h1 { font-size: 20px; font-weight: 700; }
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); text-decoration: none;
}
.icon-btn svg { width: 20px; height: 20px; }

/* inputs */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
input, select, textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
  min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); width: 100%;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #FDBA8C; outline-offset: 1px; }
.search { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.search input { border: 0; min-height: 0; padding: 0; height: 100%; background: transparent; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid #FDBA8C; outline-offset: 1px; }

/* buttons */
.btn {
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-ink); }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn.danger { color: var(--red); border-color: #F3C9C9; }
.btn.ghost { border-color: transparent; background: transparent; color: #B4350B; padding: 0 8px; min-height: 44px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.ph {
  background: repeating-linear-gradient(135deg, var(--stripe-a) 0 10px, var(--stripe-b) 10px 20px);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; overflow: hidden;
}
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* home */
.addr-btn { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.addr-btn .lbl { font-size: 12px; color: var(--muted); }
.addr-btn .val { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; }
.addr-btn select { all: unset; font-size: 17px; font-weight: 700; cursor: pointer; max-width: 100%; }
.banner { border-radius: 20px; background: var(--ink); color: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.banner .k { font-size: 12px; color: #FDBA8C; font-weight: 600; }
.banner .t { font-size: 17px; font-weight: 700; line-height: 1.35; }
.rest {
  display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: var(--ink);
}
.rest .ph { width: 84px; height: 84px; flex-shrink: 0; border-radius: 14px; }
.rest.closed { opacity: .6; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.b-open { background: var(--green-soft); color: var(--green); }
.b-closed { background: var(--red-soft); color: var(--red); }
.b-accent { background: var(--accent-soft); color: var(--accent-ink); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

/* restaurant */
.cover { height: 200px; position: relative; }
.cover .ph { position: absolute; inset: 0; font-size: 13px; }
.cover-bar { position: absolute; top: 14px; right: 16px; left: 16px; display: flex; justify-content: space-between; }
.cover-bar .icon-btn { border: 0; }
.rinfo { margin: -30px 16px 0; position: relative; display: flex; flex-direction: column; gap: 8px; }
.rinfo h1 { font-size: 22px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-top: 1px solid #EFEAE2; padding-top: 10px; }
.stats span { display: block; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sec-title { font-size: 17px; font-weight: 700; padding-top: 6px; scroll-margin-top: 12px; }
.item { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #EFEAE2; }
.item:last-child { border-bottom: 0; }
.item .ph { position: relative; width: 88px; height: 88px; flex-shrink: 0; border-radius: 14px; overflow: visible; }
.item .ph img { border-radius: 14px; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .s { font-size: 15px; font-weight: 700; color: var(--accent-ink); }
.price .u { font-size: 12px; color: var(--muted); }
.price .o { font-size: 12px; color: var(--ink); opacity: .75; font-weight: 600; }
.add {
  position: absolute; bottom: -6px; left: -6px; width: 40px; height: 40px; border-radius: 12px; border: 0;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.stepper {
  position: absolute; bottom: -6px; left: -6px; height: 40px; padding: 0 4px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; gap: 2px; font-weight: 700;
}
.stepper button, .qty button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--accent); font-size: 20px; cursor: pointer; border-radius: 10px; }
.stepper span { min-width: 18px; text-align: center; }

/* bottom bars */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; }
.bottom-inner { max-width: 520px; margin: 0 auto; }
.cartbar { padding: 12px 16px calc(14px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.cartbar a {
  display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 18px; border-radius: 16px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 6px 18px rgba(194,65,12,.3);
}
.cartbar .n { min-width: 28px; height: 28px; border-radius: 9px; background: #fff; color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.nav { background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav .bottom-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 68px; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; position: relative; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--accent); font-weight: 700; }
.nav .dot { position: absolute; top: 10px; left: calc(50% - 18px); min-width: 18px; height: 18px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* cart */
.line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #EFEAE2; }
.line:last-child { border-bottom: 0; }
.qty { display: flex; align-items: center; gap: 2px; background: var(--bg); border-radius: 12px; padding: 2px; font-weight: 700; }
.qty span { min-width: 22px; text-align: center; }
.opt { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; }
.opt.on { border: 2px solid var(--accent); padding: 13px; }
.opt input[type=radio], .opt input[type=checkbox] { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.opt.disabled { background: var(--soft); cursor: default; }
.sum { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.sum .r { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.sum .t { border-top: 1px dashed #D6CFC4; padding-top: 10px; font-size: 17px; font-weight: 700; color: var(--ink); }
.warn { padding: 10px 14px; border-radius: 12px; background: #FEF3C7; color: #92400E; font-size: 14px; font-weight: 500; }
.err { padding: 10px 14px; border-radius: 12px; background: var(--red-soft); color: var(--red); font-size: 14px; font-weight: 500; }
.loc-status { font-size: 13px; color: var(--muted); }
.loc-status.ok { color: var(--green); font-weight: 600; }

/* tracking */
.map { height: 200px; border-radius: 20px; background-color: #ECE6DC; background-image: linear-gradient(#E0D8CB 1px, transparent 1px), linear-gradient(90deg, #E0D8CB 1px, transparent 1px); background-size: 32px 32px; overflow: hidden; }
.eta .k { font-size: 13px; color: var(--muted); }
.eta .v { font-size: 24px; font-weight: 700; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps .rail { display: flex; flex-direction: column; align-items: center; }
.steps .dotc { width: 24px; height: 24px; border-radius: 999px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
.steps .done .dotc { background: var(--green); }
.steps .cur .dotc { background: #fff; border: 6px solid var(--accent); }
.steps .todo .dotc { background: #fff; border: 2px solid #D6CFC4; }
.steps .bar { width: 2px; height: 24px; background: #E7E2DA; }
.steps .done .bar { background: var(--green); }
.steps .lbl { padding-top: 2px; font-size: 14px; font-weight: 600; }
.steps .cur .lbl { color: var(--accent-ink); font-weight: 700; }
.steps .todo .lbl { color: var(--muted); font-weight: 500; }
.avatar { width: 48px; height: 48px; border-radius: 999px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.wa { background: var(--green); border-color: var(--green); color: #fff; }
.order-row { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: var(--ink); }
.st { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.st-pending { background: var(--accent-soft); color: var(--accent-ink); }
.st-accepted, .st-preparing, .st-ready, .st-picked_up { background: #FEF3C7; color: #92400E; }
.st-delivered { background: var(--green-soft); color: var(--green); }
.st-cancelled, .st-rejected { background: var(--red-soft); color: var(--red); }

/* auth */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 14px; padding: 4px; }
.seg button { border: 0; background: transparent; min-height: 44px; border-radius: 11px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.logo { width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0; }

/* toasts */
#toasts { position: fixed; top: 16px; left: 16px; right: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 480px; }
.toast.err { background: var(--red); }

/* offers: coupons and loyalty stamps */
.offers { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.offer { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: right; width: 100%;
  background: var(--accent-soft); border: 1px dashed #F4B58D; border-radius: 14px; padding: 10px 12px; font: inherit; color: var(--ink); cursor: pointer; }
.offer.loyal { cursor: default; background: #FFF7ED; }
.stamps { display: inline-flex; gap: 4px; vertical-align: middle; }
.stamps i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #F4B58D; background: #fff; display: inline-block; }
.stamps i.on { background: var(--accent); border-color: var(--accent); }
.sum .r.disc { color: var(--green); }


/* ---------- dark appearance (auto by system, or forced with data-theme) ---------- */
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) { color-scheme: dark;
  --bg: #12100E; --surface: #1C1916; --ink: #F5F0E8; --ink-2: #D6D0C8; --muted: #A8A29E;
  --line: #34302B; --soft: #25211D; --stripe-a: #2A2520; --stripe-b: #302A24;
  --accent: #C2410C; --accent-ink: #EA580C; --accent-soft: #3A2214;
  --green: #4ADE80; --green-soft: #12301E; --red: #F87171; --red-soft: #3B1717;
  --blue: #93C5FD; --blue-soft: #1E2A44; }
:root:not([data-theme="light"]) a:not([class]), :root:not([data-theme="light"]) .btn.ghost { color: #FB923C; }
:root:not([data-theme="light"]) a:not([class]):hover { color: #FDBA74; }
:root:not([data-theme="light"]) .chip.on, :root:not([data-theme="light"]) .btn.dark { background: var(--accent); border-color: var(--accent); color: #fff; }
:root:not([data-theme="light"]) .toast, :root:not([data-theme="light"]) .avatar, :root:not([data-theme="light"]) .collect, :root:not([data-theme="light"]) .banner { background: #2E2925; color: #fff; }
:root:not([data-theme="light"]) .toast.err { background: #991B1B; }
:root:not([data-theme="light"]) .wa, :root:not([data-theme="light"]) .icon-btn.wa, :root:not([data-theme="light"]) .steps .done .dotc, :root:not([data-theme="light"]) .steps .done .bar, :root:not([data-theme="light"]) .switch.on .knob, :root:not([data-theme="light"]) .online-btn.on .dot { background: #16A34A; border-color: #16A34A; }
:root:not([data-theme="light"]) .switch .knob { background: #DC2626; }
:root:not([data-theme="light"]) .btn.danger, :root:not([data-theme="light"]) .switch { border-color: #5B2121; }
:root:not([data-theme="light"]) .switch.on { border-color: #1F5130; }
:root:not([data-theme="light"]) .warn, :root:not([data-theme="light"]) .st-accepted, :root:not([data-theme="light"]) .st-preparing, :root:not([data-theme="light"]) .st-ready, :root:not([data-theme="light"]) .st-picked_up, :root:not([data-theme="light"]) .b-ready, :root:not([data-theme="light"]) .b-picked_up { background: #3A2E0E; color: #FCD34D; }
:root:not([data-theme="light"]) .note { background: #3A320E; color: #FDE68A; }
:root:not([data-theme="light"]) .order.s-pending, :root:not([data-theme="light"]) .drv-card.hot { border-color: #9A3412; }
:root:not([data-theme="light"]) .online-btn.on .dot { box-shadow: 0 0 0 4px #14532D; }
:root:not([data-theme="light"]) .stats, :root:not([data-theme="light"]) .item, :root:not([data-theme="light"]) .line { border-color: var(--line); }
:root:not([data-theme="light"]) .sum .t { border-top-color: #4A443D; }
:root:not([data-theme="light"]) .map { background-color: #25211D; background-image: linear-gradient(#34302B 1px, transparent 1px), linear-gradient(90deg, #34302B 1px, transparent 1px); }
:root:not([data-theme="light"]) .steps .cur .dotc, :root:not([data-theme="light"]) .steps .todo .dotc { background: var(--surface); }
:root:not([data-theme="light"]) .steps .todo .dotc { border-color: #4A443D; }
:root:not([data-theme="light"]) .steps .bar { background: #3A3530; }
:root:not([data-theme="light"]) .offer { border-color: #7C3A12; }
:root:not([data-theme="light"]) .offer.loyal { background: #2A1E14; }
:root:not([data-theme="light"]) .stamps i { background: var(--surface); border-color: #7C3A12; }
:root:not([data-theme="light"]) .seg button.on { box-shadow: none; }
:root:not([data-theme="light"]) img.logo { box-shadow: none; }
}
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #12100E; --surface: #1C1916; --ink: #F5F0E8; --ink-2: #D6D0C8; --muted: #A8A29E;
  --line: #34302B; --soft: #25211D; --stripe-a: #2A2520; --stripe-b: #302A24;
  --accent: #C2410C; --accent-ink: #EA580C; --accent-soft: #3A2214;
  --green: #4ADE80; --green-soft: #12301E; --red: #F87171; --red-soft: #3B1717;
  --blue: #93C5FD; --blue-soft: #1E2A44; }
:root[data-theme="dark"] a:not([class]), :root[data-theme="dark"] .btn.ghost { color: #FB923C; }
:root[data-theme="dark"] a:not([class]):hover { color: #FDBA74; }
:root[data-theme="dark"] .chip.on, :root[data-theme="dark"] .btn.dark { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .toast, :root[data-theme="dark"] .avatar, :root[data-theme="dark"] .collect, :root[data-theme="dark"] .banner { background: #2E2925; color: #fff; }
:root[data-theme="dark"] .toast.err { background: #991B1B; }
:root[data-theme="dark"] .wa, :root[data-theme="dark"] .icon-btn.wa, :root[data-theme="dark"] .steps .done .dotc, :root[data-theme="dark"] .steps .done .bar, :root[data-theme="dark"] .switch.on .knob, :root[data-theme="dark"] .online-btn.on .dot { background: #16A34A; border-color: #16A34A; }
:root[data-theme="dark"] .switch .knob { background: #DC2626; }
:root[data-theme="dark"] .btn.danger, :root[data-theme="dark"] .switch { border-color: #5B2121; }
:root[data-theme="dark"] .switch.on { border-color: #1F5130; }
:root[data-theme="dark"] .warn, :root[data-theme="dark"] .st-accepted, :root[data-theme="dark"] .st-preparing, :root[data-theme="dark"] .st-ready, :root[data-theme="dark"] .st-picked_up, :root[data-theme="dark"] .b-ready, :root[data-theme="dark"] .b-picked_up { background: #3A2E0E; color: #FCD34D; }
:root[data-theme="dark"] .note { background: #3A320E; color: #FDE68A; }
:root[data-theme="dark"] .order.s-pending, :root[data-theme="dark"] .drv-card.hot { border-color: #9A3412; }
:root[data-theme="dark"] .online-btn.on .dot { box-shadow: 0 0 0 4px #14532D; }
:root[data-theme="dark"] .stats, :root[data-theme="dark"] .item, :root[data-theme="dark"] .line { border-color: var(--line); }
:root[data-theme="dark"] .sum .t { border-top-color: #4A443D; }
:root[data-theme="dark"] .map { background-color: #25211D; background-image: linear-gradient(#34302B 1px, transparent 1px), linear-gradient(90deg, #34302B 1px, transparent 1px); }
:root[data-theme="dark"] .steps .cur .dotc, :root[data-theme="dark"] .steps .todo .dotc { background: var(--surface); }
:root[data-theme="dark"] .steps .todo .dotc { border-color: #4A443D; }
:root[data-theme="dark"] .steps .bar { background: #3A3530; }
:root[data-theme="dark"] .offer { border-color: #7C3A12; }
:root[data-theme="dark"] .offer.loyal { background: #2A1E14; }
:root[data-theme="dark"] .stamps i { background: var(--surface); border-color: #7C3A12; }
:root[data-theme="dark"] .seg button.on { box-shadow: none; }
:root[data-theme="dark"] img.logo { box-shadow: none; }

/* favorites, ratings, promos, reviews, invite */
.fav { border: 0; background: none; font-size: 18px; line-height: 1; padding: 4px; cursor: pointer; min-height: 0; }
.fav.sm { font-size: 15px; padding: 2px; }
.cover-bar .fav { background: var(--surface); border-radius: 999px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.rating { color: var(--ink); font-weight: 600; white-space: nowrap; }
.promos { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.promos::-webkit-scrollbar { display: none; }
.promo { flex: 0 0 78%; max-width: 320px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: right;
  background: linear-gradient(135deg, #C2410C, #EA580C); color: #fff; border: 0; border-radius: 18px; padding: 14px 16px; font: inherit; cursor: pointer; }
.promo-k { font-size: 12px; opacity: .85; font-weight: 600; }
.promo-t { font-size: 16px; font-weight: 700; }
.promo-s { font-size: 12px; opacity: .9; }
.order-wrap { display: flex; flex-direction: column; gap: 2px; }
.reorder { align-self: flex-start; font-size: 14px; min-height: 36px; }
.review { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.stars { color: #F59E0B; letter-spacing: 1px; font-size: 14px; }
.stars.big { font-size: 22px; }
.stars .off { color: var(--line); }
.rating-btn { background: none; border: 0; padding: 0; min-height: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.rating-more { color: var(--accent); font-weight: 700; }
.ig-sheet.rv-sheet { justify-content: flex-end; padding: 0; }
.ig-card.rv-card { max-width: 520px; border-radius: 24px 24px 0 0; text-align: right; align-items: stretch; max-height: 80vh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.ig-card.rv-card h2 { text-align: center; }
.ig-card.rv-card > p { text-align: center; margin: 0; }
.rv-list { width: 100%; overflow-y: auto; margin-top: 4px; }
.rv-list .review:last-child { border-bottom: 0; }
.star-pick { display: flex; gap: 6px; direction: ltr; justify-content: center; }
.star-pick button { font-size: 34px; background: none; border: 0; color: var(--line); cursor: pointer; min-height: 0; padding: 0 2px; line-height: 1; }
.star-pick button.on { color: #F59E0B; }
.code-big { font-size: 22px; font-weight: 700; letter-spacing: 3px; text-align: center; background: var(--soft); border: 1px dashed var(--line); border-radius: 12px; padding: 8px; }

/* ---------- invoice ---------- */
.invoice { background: #fff; color: #1C1917; border-radius: 18px; padding: 20px 18px; box-shadow: 0 2px 14px rgba(0,0,0,.08); border: 1px solid #EFEAE2; }
.inv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 2px dashed #EFEAE2; }
.inv-brand { display: flex; align-items: center; gap: 10px; }
.inv-brand img { border-radius: 12px; }
.inv-brand b { display: block; color: #C2410C; font-size: 20px; line-height: 1.2; }
.inv-brand span { font-size: 12px; color: #78716C; }
.inv-no { text-align: left; }
.inv-no span { display: block; font-size: 12px; color: #78716C; }
.inv-no b { font-size: 20px; }
.inv-meta { margin: 14px 0; display: grid; gap: 6px; font-size: 14px; }
.inv-meta div { display: flex; gap: 10px; }
.inv-meta dt { color: #78716C; min-width: 78px; }
.inv-meta dd { margin: 0; font-weight: 600; }
.inv-items { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 12px; }
.inv-items th { text-align: right; font-size: 12px; color: #78716C; font-weight: 600; padding: 8px 4px; border-bottom: 1px solid #EFEAE2; background: #FAF7F2; }
.inv-items td { padding: 9px 4px; border-bottom: 1px solid #F5F0E8; vertical-align: top; }
.inv-items th:not(:first-child), .inv-items td:not(:first-child) { text-align: left; white-space: nowrap; }
.inv-sum { display: grid; gap: 6px; font-size: 14px; padding-top: 4px; }
.inv-sum div { display: flex; justify-content: space-between; gap: 10px; }
.inv-sum .disc span:last-child { color: #15803D; }
.inv-sum .total { margin-top: 6px; padding-top: 10px; border-top: 2px dashed #EFEAE2; font-size: 18px; font-weight: 800; align-items: baseline; }
.inv-sum .total small { display: block; font-size: 12px; color: #78716C; font-weight: 500; text-align: left; }
.inv-pay { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; background: #FAF7F2; border-radius: 12px; font-size: 13px; font-weight: 600; }
.inv-foot { margin-top: 14px; text-align: center; font-size: 12px; color: #78716C; display: grid; gap: 2px; }
@media print {
  body { background: #fff !important; }
  .no-print, .bottom, .cart-bar, #toasts { display: none !important; }
  .content { padding: 0 !important; }
  .invoice { box-shadow: none; border: 0; padding: 0; }
}

/* invoices list */
.inv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.inv-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.inv-stats b { font-size: 18px; }
.inv-month { font-size: 15px; margin: 18px 2px 8px; color: var(--muted); font-weight: 600; }
.inv-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.inv-ico svg { width: 22px; height: 22px; }
.ok-txt { color: #16A34A; font-weight: 600; }

/* featured shops (Talla Plus for shops) */
.rest.featured { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.feat-badge { display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: linear-gradient(135deg, #F59E0B, var(--accent)); color: #fff; margin-inline-start: 4px; }

/* legal pages */
.legal { line-height: 1.85; }
.legal h2 { font-size: 16px; margin: 18px 0 6px; }
.legal h2:first-of-type { margin-top: 10px; }
.legal p, .legal ul { margin: 0 0 8px; }
.legal ul { padding-inline-start: 20px; }
.legal li { margin-bottom: 4px; }
.seg a { text-decoration: none; color: var(--muted); font-weight: 600; min-height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* install guide */
.inst-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.inst-banner img { border-radius: 10px; flex: none; }
.inst-banner b { display: block; font-size: 14px; }
.inst-banner span { font-size: 12px; color: var(--muted); }
.inst-banner .x { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 6px; cursor: pointer; min-width: 32px; min-height: 32px; }
.inst-hero { display: flex; gap: 14px; align-items: center; }
.inst-hero img { border-radius: 18px; flex: none; }
.inst-hero b { display: block; font-size: 20px; }
.inst-hero span { font-size: 13px; color: var(--muted); }
.inst-warn { line-height: 1.7; }
.inst-ok { color: #16A34A; font-weight: 600; }
.inst-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.inst-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.inst-steps .n { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.inst-steps b { font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inst-steps p { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.inst-steps .ico { width: 22px; height: 22px; display: inline-block; vertical-align: middle; color: var(--accent); }

/* home: reorder strip, new shops, quick filters */
.sec-h { font-size: 17px; margin: 6px 0 -2px; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.mini { flex: 0 0 auto; width: 156px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); position: relative; }
.mini.again { width: 172px; }
.mini-ph { height: 76px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; overflow: hidden; font-size: 30px; font-weight: 800; color: var(--accent); }
.mini-ph img { width: 100%; height: 100%; object-fit: cover; }
.mini-t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-t span { font-size: 12px; color: var(--muted); }
.mini .btn { width: 100%; }
.new-tag { position: absolute; top: 14px; inset-inline-start: 14px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.fchip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 34px; }
.fchip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
/* reorder: one compact row per shop (logo · name/date · button) */
.mini.again { width: 236px; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; }
.mini.again .mini-ph { flex: 0 0 44px; width: 44px; height: 44px; font-size: 20px; border-radius: 12px; }
.mini.again .mini-t { flex: 1; min-width: 0; }
.mini.again .mini-t b { font-size: 13px; }
.mini.again .mini-t span { font-size: 11px; }
.mini.again .btn { width: auto; flex: 0 0 auto; min-height: 32px; padding: 6px 12px; font-size: 13px; border-radius: 12px; box-shadow: none; }
.mini-t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Turnstile anti-bot widget (hidden unless a check is needed) */
.cf-box { display: flex; justify-content: center; }
.cf-box:empty { display: none; }

/* phone number with country code */
.phone-in { display: flex; gap: 8px; direction: ltr; }
.phone-in select { flex: 0 0 auto; width: 118px; min-height: 48px; font: inherit; font-size: 16px; padding: 0 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.phone-in input { flex: 1; min-width: 0; text-align: left; }
div.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.rc-code { font: 900 28px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; text-align: center; padding: 16px; border-radius: 14px; background: var(--soft); border: 2px dashed var(--line); user-select: all; }

/* install overlay (smartInstall) */
.ig-sheet { position: fixed; inset: 0; z-index: 90; background: rgba(15, 8, 4, .62); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px 16px; animation: igIn .2s ease-out; }
.ig-sheet.bottom { justify-content: flex-end; padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
.ig-sheet.top { justify-content: flex-start; padding-top: calc(110px + env(safe-area-inset-top)); }
.ig-card:focus { outline: none; }
.ig-card { position: relative; width: 100%; max-width: 420px; background: var(--surface); color: var(--ink); border-radius: 24px; padding: 22px 18px 16px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ig-card img { border-radius: 14px; }
.ig-card h2 { margin: 0; font-size: 20px; }
.ig-card p { margin: 0; font-size: 15px; line-height: 1.7; }
.ig-card ol { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: right; }
.ig-card li { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-radius: 14px; padding: 10px 12px; font-size: 15px; }
.ig-card li .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.ig-card li small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ig-card .ico { width: 20px; height: 20px; vertical-align: -4px; color: var(--accent); }
.ig-card .x { position: absolute; top: 8px; left: 8px; background: none; border: 0; color: var(--muted); font-size: 18px; padding: 6px; cursor: pointer; min-width: 40px; min-height: 40px; }
.ig-arrow { width: 0; height: 0; border-left: 22px solid transparent; border-right: 22px solid transparent; border-top: 30px solid #fff; margin-top: 18px; animation: igBounce 1s ease-in-out infinite; filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)); }
.ig-sheet.top .ig-arrow { order: -1; margin: 0 0 18px; border-top: 0; border-bottom: 30px solid #fff; align-self: flex-start; margin-inline-start: 40px; }
@keyframes igBounce { 50% { transform: translateY(10px); } }
.ig-sheet.top .ig-arrow { animation-name: igBounceUp; }
@keyframes igBounceUp { 50% { transform: translateY(-10px); } }
@keyframes igIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ig-arrow, .ig-sheet { animation: none; } }

/* the hidden attribute must win over .stack/.row display rules */
[hidden] { display: none !important; }

/* item options */
.opt-hint { color: var(--accent); font-weight: 600; }
.add .add-n { position: absolute; top: -6px; left: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.opt-sheet .opt-list { width: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.opt-g { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.opt-g legend { padding: 0 0 6px; font-size: 15px; }
.opt-c { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; min-height: 0; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; font-size: 15px; }
.opt-c.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.opt-c input { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; flex: none; }
.opt-foot { width: 100%; gap: 12px; margin-top: 8px; position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
.opt-foot .qty { flex: none; }
.opt-foot .btn[disabled] { opacity: .55; }

/* info-only shops (bakery, gas): what's in stock */
.stock-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--soft); }
.stock-head .stock-ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex-shrink: 0; background: var(--surface); }
.stock-head b, .stock-head .small { display: block; }
.stock-head.yes { background: var(--green-soft); color: var(--green); }
.stock-head.yes .stock-ic { background: var(--green); color: #fff; }
.stock-head.no { background: var(--red-soft); color: var(--red); }
.stock-head.no .stock-ic { background: var(--red); color: #fff; }
.stock-head.off { color: var(--muted); }
.stock-note { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.stock-list { display: flex; flex-direction: column; gap: 10px; }
.stock-row { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.stock-row.out b { color: var(--muted); }
.stock-pill { flex-shrink: 0; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 99px; }
.stock-pill.yes { background: var(--green-soft); color: var(--green); }
.stock-pill.no { background: var(--red-soft); color: var(--red); }
.stock-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.stock-acts .btn { flex: 1; min-width: 100px; }
.stock-mini { font-weight: 700; }
.stock-mini.yes { color: var(--green); }
.stock-mini.no { color: var(--red); }
.crowd { font-weight: 700; }
.crowd.yes { color: var(--green); }
.crowd.mid { color: #B45309; }
.crowd.no { color: var(--red); }
.crowd-row { font-size: 14px; }
.duty-badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #1E1B4B; color: #E0E7FF; vertical-align: middle; }
.duty-banner { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, #1E1B4B, #312E81); color: #EEF2FF; }
.duty-banner .duty-ic { font-size: 26px; }
.duty-banner a.grow { color: inherit; text-decoration: none; }
.duty-banner .k { display: block; font-size: 12px; opacity: .8; }
.duty-banner b { display: block; font-size: 16px; }
.duty-banner .small { display: block; opacity: .85; }
.duty-banner .btn { background: #fff; color: #1E1B4B; border-color: #fff; flex-shrink: 0; }

/* skeleton placeholders while content loads */
.sk { background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 55%, var(--surface)) 50%, var(--line) 75%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
.sk-line { display: block; height: 14px; border-radius: 7px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* Shop promo video (landscape 16:9) on the shop page */
.shop-video { position: relative; margin: 12px auto 0; width: min(calc(100% - 32px), 260px); aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0c1d42; box-shadow: var(--shadow-lg, 0 6px 24px rgba(0,0,0,.18)); }
.shop-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sv-sound { position: absolute; bottom: 8px; inset-inline-start: 8px; width: 34px; height: 34px; border: 0; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); cursor: pointer; }
.sv-sound:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
