/* EkuBites — homely cream, terracotta, dark brown. Mobile-only, large targets, AA contrast.
   Motion: short, purposeful, ease-out for things arriving; nothing animates on money/ordering decisions
   beyond press feedback. Everything respects prefers-reduced-motion. */
:root {
  /* colour */
  --bg: #FBF4E9; --surface: #FFFDF8; --surface-2: #F5EADB; --line: #E6D5BE; --field-line: #9F846C;
  --ink: #3B2418; --ink-2: #5E4334; --muted: #6E5546;
  --brand: #B04A22; --brand-ink: #FFFFFF; --brand-soft: #F6E1D5; --brand-dark: #8E3916;
  --ok: #2E6E47; --ok-soft: #E2F0E6; --warn: #8A5A00; --warn-soft: #FBEFD5; --bad: #A8231B; --bad-soft: #F9E0DD; --info: #2F5D86; --info-soft: #E2ECF5;
  --wa: #1F7A4D; --focus: #2F5D86;
  /* shape & depth */
  --r-s: 10px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(59,36,24,.06), 0 4px 14px rgba(59,36,24,.07);
  --shadow-lift: 0 2px 4px rgba(59,36,24,.08), 0 12px 32px rgba(59,36,24,.14);
  /* spacing (4pt rhythm) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  /* motion (Emil Kowalski: strong ease-out for UI, iOS-like drawer curve) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --t-press: 140ms; --t-fast: 180ms; --t-med: 240ms;
  /* safe areas */
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --nav-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; scroll-padding-bottom: calc(var(--nav-h) + 24px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; }
.boot { display: grid; place-items: center; align-content: center; gap: 16px; min-height: 100dvh; color: var(--brand); }
.boot-mark { font-weight: 800; font-size: 24px; letter-spacing: -.3px; }
a { color: var(--brand-dark); text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--s2); letter-spacing: -.2px; text-wrap: balance; }
h1 { font-size: 24px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
p { margin: 0 0 var(--s2); text-wrap: pretty; }
.muted { color: var(--muted); } .small { font-size: 15px; line-height: 1.45; } .tiny { font-size: 13.5px; line-height: 1.45; }
.strong { font-weight: 700; } .center { text-align: center; } .right { text-align: right; }
.tabnum, .price, .kv > :last-child, .countdown { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .spread { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: var(--s3); } .gap-s > * + * { margin-top: 6px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.ic { flex: 0 0 auto; display: inline-block; vertical-align: middle; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[tabindex="-1"]:focus { outline: none; }
button, a, summary, label, input, select, textarea { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
::selection { background: var(--brand-soft); }

/* ---------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(251,244,233,.92); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  padding: calc(8px + var(--safe-t)) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l)); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; min-height: 60px; }
.top h1 { font-size: 19px; margin: 0 0 0 4px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .iconbtn.back + h1 { margin-left: 0; }
.brandmark { font-weight: 800; color: var(--brand); font-size: 21px; letter-spacing: -.3px; padding-left: 4px; }
.iconbtn { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink); border-radius: 12px; display: inline-grid; place-items: center; font-size: 22px; cursor: pointer; position: relative; padding: 0 6px; text-decoration: none;
  transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.iconbtn:active { background: var(--surface-2); transform: scale(.94); }
.dot { position: absolute; top: 4px; right: 2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg); font-variant-numeric: tabular-nums; }

main.page { padding: var(--s4) calc(16px + var(--safe-r)) calc(var(--nav-h) + 40px + var(--safe-b)) calc(16px + var(--safe-l)); }
main.page.nonav { padding-bottom: calc(40px + var(--safe-b)); }

/* ---------------------------------------------------------------- bottom nav */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 30; background: rgba(255,253,248,.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 0 var(--safe-r) var(--safe-b) var(--safe-l); transition: transform var(--t-med) var(--ease-out); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 7px 2px 8px; min-height: var(--nav-h); text-decoration: none; color: var(--muted); font-size: 12.5px; font-weight: 650; position: relative; }
.nav a .ic { width: 56px; height: 30px; padding: 4px 0; border-radius: 15px; font-size: 20px; line-height: 22px; text-align: center; transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.nav a:active .ic { transform: scale(.92); }
.nav a[aria-current="page"] { color: var(--brand-dark); font-weight: 800; }
.nav a[aria-current="page"] .ic { background: var(--brand-soft); color: var(--brand-dark); }
/* While typing, the on-screen keyboard needs the space: tuck the tab bar away. */
body:has(:is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), textarea, select):focus) .nav { transform: translate(-50%, 110%); }

/* ---------------------------------------------------------------- cards & lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tap { cursor: pointer; text-decoration: none; color: inherit; display: block; transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-fast) ease; }
.card.tap:active { transform: scale(.985); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: var(--s6) 2px var(--s3); }
.section-title h2 { margin: 0; font-size: 18px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 56px; text-decoration: none; color: inherit; border: 0; width: 100%; background: transparent; font: inherit; text-align: left; }
.list > .item + .item { border-top: 1px solid var(--line); }
button.item, a.item { cursor: pointer; transition: background-color var(--t-fast) ease; }
button.item:active, a.item:active { background: var(--surface-2); }
.item > .ic:first-child, .item-ic { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--surface-2); color: var(--brand-dark); flex: 0 0 40px; }
.chev { color: var(--muted); font-size: 22px; display: inline-grid; place-items: center; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; }
.kv > :first-child { color: var(--ink-2); min-width: 0; } .kv > :last-child { text-align: right; flex: 0 0 auto; max-width: 62%; }
.kv.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 18px; }
.kv.total > :first-child { color: var(--ink); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: var(--s3) 0; }

/* ---------------------------------------------------------------- dish card & photos */
.dish, .card.tap.dish { display: grid; grid-template-columns: 1fr 96px; gap: 12px; align-items: start; }
.dish .ph, .ph { width: 96px; height: 96px; border-radius: 14px; background: radial-gradient(circle at 30% 25%, #F8EBDA, #EBD6BD); display: grid; place-items: center; overflow: hidden; color: #9A7457; position: relative; }
.ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--t-med) ease; }
.ph img.in { opacity: 1; }
.ph.big { width: 100%; height: auto; aspect-ratio: 16 / 10; max-height: 260px; border-radius: var(--r-lg); }
.price { font-weight: 800; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
.hscroll::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 14px; border: 1.5px solid transparent; font: 700 16.5px/1.15 var(--font); cursor: pointer; text-decoration: none; text-align: center; user-select: none;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease, border-color var(--t-fast) ease, opacity var(--t-fast) ease; }
.btn:active:not([disabled]) { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 0 rgba(142,57,22,.5), 0 4px 12px rgba(176,74,34,.22); }
.btn.primary:active:not([disabled]) { background: var(--brand-dark); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--field-line); }
.btn.secondary:active:not([disabled]) { background: var(--surface-2); }
.btn.soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--brand-dark); padding: 0 12px; text-decoration: underline; text-decoration-color: rgba(142,57,22,.35); text-underline-offset: 3px; }
.btn.danger { background: var(--surface); color: var(--bad); border-color: #D9958E; }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.wa { background: var(--wa); color: #fff; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn[aria-busy="true"] { opacity: .85; cursor: progress; }
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover:not([disabled]) { background: #A2421D; }
  .btn.secondary:hover:not([disabled]), .iconbtn:hover { background: var(--surface-2); }
  .card.tap:hover { box-shadow: var(--shadow-lift); }
  button.item:hover, a.item:hover { background: #FBF5EC; }
}
.spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: 0 0 auto; }
.boot .spin { width: 24px; height: 24px; }
@keyframes spin { to { transform: rotate(360deg); } }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--field-line); border-radius: 14px; background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--brand-dark); cursor: pointer; display: grid; place-items: center; border-radius: 12px; transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease; }
.stepper button:active:not([disabled]) { transform: scale(.9); background: var(--surface-2); }
.stepper button[disabled] { color: var(--line); cursor: not-allowed; }
.stepper span { min-width: 30px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.sticky-cta { position: sticky; bottom: calc(var(--nav-h) + 8px + var(--safe-b)); z-index: 10; padding: 12px 0 6px; background: linear-gradient(to top, var(--bg) 72%, rgba(251,244,233,0)); }
main.nonav .sticky-cta { bottom: calc(8px + var(--safe-b)); }

/* ---------------------------------------------------------------- forms */
label.field { display: block; }
.field > .lbl { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.field > .hint { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; }
.field > .err { display: flex; gap: 6px; align-items: center; font-size: 14.5px; color: var(--bad); margin-top: 6px; font-weight: 650; }
input, textarea, select { width: 100%; font: 17px/1.3 var(--font); color: var(--ink); background: var(--surface); border: 1.5px solid var(--field-line); border-radius: 12px; padding: 12px 14px; min-height: 52px;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease; scroll-margin-block: 96px 160px; }
input::placeholder, textarea::placeholder { color: #8F7767; }
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px rgba(176,74,34,.16); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
input[disabled], textarea[disabled], select[disabled] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
input[readonly] { background: var(--surface-2); border-style: dashed; }
input[type=file] { padding: 8px; font-size: 15px; color: var(--ink-2); }
input[type=file]::file-selector-button { font: 700 15px var(--font); color: var(--brand-dark); background: var(--brand-soft); border: 0; border-radius: 10px; padding: 10px 14px; margin-right: 12px; cursor: pointer; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236E5546' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; cursor: pointer; }
.check input { width: 24px; height: 24px; min-height: 0; margin: 1px 0 0; accent-color: var(--brand); flex: 0 0 auto; padding: 0; box-shadow: none; }
.list > .item.check { padding: 14px; }
.otp { letter-spacing: 12px; font-size: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; padding-left: 26px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; font: 700 15px/1.2 var(--font); color: var(--ink-2); cursor: pointer; padding: 4px 8px; transition: background-color var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.seg button:active:not([disabled]) { transform: scale(.97); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow); }
.seg button[disabled] { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; overscroll-behavior-x: contain; }
.chip { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--surface); font: 650 15px var(--font); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { position: relative; }
.search input { padding-left: 46px; border-radius: 26px; }
.search .ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
details > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 6px 0; font-weight: 700; color: var(--ink); }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-left: auto; margin-right: 6px; transition: transform var(--t-fast) var(--ease-out); opacity: .7; flex: 0 0 auto; }
details[open] > summary::after { transform: rotate(45deg); }
details[open] > summary + * { animation: reveal var(--t-fast) var(--ease-out); }

/* ---------------------------------------------------------------- badges, notices, status */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 13.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge.dotted::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.notice { border-radius: var(--r); padding: 12px 14px; background: var(--info-soft); color: #1F3F5C; font-size: 15.5px; border-left: 4px solid var(--info); animation: rise var(--t-med) var(--ease-out); }
.notice.warn { background: var(--warn-soft); color: #5E3E00; border-left-color: var(--warn); } .notice.bad { background: var(--bad-soft); color: #7A1913; border-left-color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: #1D4D30; border-left-color: var(--ok); }
.notice.brand { background: var(--brand-soft); color: #6E2C10; border-left-color: var(--brand); }
.notice b { display: block; margin-bottom: 2px; font-size: 16px; }
.notice.has-icon { display: flex; gap: 10px; align-items: flex-start; } .notice.has-icon > .ic { margin-top: 1px; }
.timer .countdown { margin: 2px 0 8px; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 34px; line-height: 1.1; letter-spacing: -.5px; }
.timer.urgent .countdown { color: var(--bad); }
.timebar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.timebar > span { display: block; height: 100%; background: var(--brand); transform-origin: left center; border-radius: 3px; transition: transform .5s linear; }
.timer.urgent .timebar > span { background: var(--bad); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 28px; font-size: 15.5px; color: var(--muted); }
.timeline li.done { color: var(--ink-2); } .timeline li.now { color: var(--ink); font-weight: 800; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--field-line); box-sizing: border-box; z-index: 1; }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.now::before { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); animation: pulse 2s var(--ease-in-out) infinite; }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: -4px; width: 2px; background: var(--line); }
.timeline li.done::after { background: var(--ok); }
.timeline li:last-child::after { display: none; }
.steps { display: flex; gap: 6px; margin: 4px 0 14px; } .steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background-color var(--t-med) ease; } .steps span.on { background: var(--brand); }

/* contact: WhatsApp first, Call always beside it */
.contact-btns { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.contact-btns > .btn:only-child { grid-column: 1 / -1; }
.contact .btn.call { padding: 0 18px; }
.contact.compact .btn { min-height: 46px; font-size: 15.5px; }
.contact-num { margin-top: 6px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- sheet / toast / banners */
.scrim { position: fixed; inset: 0; background: rgba(40,24,15,.48); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade var(--t-med) ease; }
.sheet { background: var(--surface); width: 100%; max-width: 520px; border-radius: 24px 24px 0 0; padding: 16px calc(16px + var(--safe-r)) calc(20px + var(--safe-b)) calc(16px + var(--safe-l)); max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  box-shadow: 0 -8px 40px rgba(40,24,15,.18); animation: sheet-in 300ms var(--ease-drawer); outline: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: -4px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -6px 12px 0; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.scrim.out { animation: fade-out 170ms ease forwards; }
.scrim.out .sheet { animation: sheet-out 170ms var(--ease-out) forwards; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } } @keyframes fade-out { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(246,225,213,.4); } }
/* Toasts appear at the top so they never cover the main action button or the tab bar. */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(64px + var(--safe-t)); z-index: 80; width: calc(100% - 24px); max-width: 496px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: #fff; border-radius: 14px; padding: 13px 14px; font-size: 15.5px; line-height: 1.4; box-shadow: var(--shadow-lift); pointer-events: none;
  /* Transitions (not keyframes) so a quick second toast retargets instead of restarting; enters and leaves upward. */
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); }
@starting-style { .toast { opacity: 0; transform: translateY(-16px) scale(.98); } }
.toast .ic { margin-top: 1px; opacity: .9; }
.toast.out { opacity: 0; transform: translateY(-8px) scale(.98); transition-duration: 180ms; }
.toast.bad { background: #7A1913; } .toast.ok { background: #1D4D30; }
.offline { background: #5E3E00; color: #fff; text-align: center; font-size: 14px; padding: 7px 12px; position: sticky; top: 0; z-index: 25; display: flex; gap: 8px; align-items: center; justify-content: center; animation: fade var(--t-med) ease; }
.mock { background: #2F5D86; color: #fff; font-size: 13px; text-align: center; padding: calc(4px + var(--safe-t)) 8px 4px; }
.mock + .offline + .top, .mock + .top { padding-top: 8px; }

/* ---------------------------------------------------------------- skeleton / empty */
.sk { background: linear-gradient(90deg, #F1E4D3 0%, #F8EEE2 50%, #F1E4D3 100%); background-size: 200% 100%; animation: sh 1.4s ease-in-out infinite; border-radius: var(--r-lg); }
.loading { animation: fade 300ms ease 150ms both; }
@keyframes sh { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); animation: rise var(--t-med) var(--ease-out); }
.empty-ic { width: 68px; height: 68px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-title { font-weight: 800; color: var(--ink); font-size: 18px; }
.empty-body { margin-top: 8px; font-size: 15.5px; }
.empty-body .btn, .empty-body > a.btn { margin-top: 10px; }

/* ---------------------------------------------------------------- map */
.map { height: 260px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); position: relative; background: #EADBC6; isolation: isolate; }
.map.tall { height: 340px; }
.map-fallback { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; color: var(--ink-2); font-size: 15px; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pin-dot.courier { background: #2F5D86; } .pin-dot.stale { background: #8E8E8E; } .pin-dot.kitchen { background: var(--brand-dark); border-radius: 6px; }
/* Live delivery marker: dot = real fix; arrow only with a device heading; pulse only while fresh. */
.cour { position: relative; width: 40px; height: 50px; color: #93261F; }
.cour-pin { display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); transition: filter 200ms ease; }
/* direction arrow orbits the pin head (rotation origin = head centre at 20,19) */
.cour-arrow { position: absolute; left: 20px; top: 19px; width: 0; height: 0; display: none; transition: transform 300ms var(--ease-in-out); }
.cour.has-heading .cour-arrow { display: block; }
.cour-arrow::before { content: ""; position: absolute; left: -6px; top: -28px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 8px solid currentColor; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
/* soft ground ring at the pin tip while the position is fresh */
.cour-pulse { position: absolute; left: 50%; bottom: -5px; width: 22px; height: 9px; margin-left: -11px; border-radius: 50%; background: rgba(147,38,31,.45); opacity: 0; animation: cour-pulse 2.4s var(--ease-out) infinite; }
@keyframes cour-pulse { from { transform: scale(.8); opacity: .5; } to { transform: scale(2.2); opacity: 0; } }
.cour-rider { transform-box: view-box; transform-origin: 20px 19px; transition: transform 220ms var(--ease-out); }
.cour.face-left .cour-rider { transform: scaleX(-1); }
.cour.stale .cour-pin { filter: grayscale(1) opacity(.8) drop-shadow(0 2px 3px rgba(0,0,0,.25)); } .cour.stale .cour-pulse, .cour.stale .cour-arrow { display: none; }
.map-flag { position: relative; max-width: 100%; background: rgba(255,250,243,.97); color: var(--ink); font-size: 14px; font-weight: 700; padding: 7px 12px; border-radius: 18px; box-shadow: 0 2px 8px rgba(40,24,15,.18); display: flex; gap: 6px; align-items: center; animation: fade var(--t-med) ease; }
.leaflet-container { font: 13px var(--font); }
.leaflet-control-attribution { font-size: 10px; }

.popup-card { position: relative; }
.close-x { position: absolute; top: 6px; right: 6px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid .ph { width: 100%; height: 92px; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.simple td, table.simple th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.simple td.num, table.simple th.num { text-align: right; white-space: nowrap; }
.pill-count { background: var(--brand); color: #fff; border-radius: 10px; font-size: 12px; font-weight: 800; padding: 1px 7px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.lock { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: grid; place-items: center; padding: 24px calc(24px + var(--safe-r)) calc(24px + var(--safe-b)) calc(24px + var(--safe-l)); animation: fade var(--t-med) ease; }
.hero-ic { width: 76px; height: 76px; border-radius: 24px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; margin: 0 auto 12px; }

/* Reduced motion: keep quick opacity/colour changes that explain state; remove movement. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-property: opacity, background-color, color, border-color !important; scroll-behavior: auto !important; }
  .spin { animation: spin 1.6s linear infinite !important; animation-iteration-count: infinite !important; animation-duration: 1.6s !important; }
  .sk { animation: none !important; }
  .btn:active, .card.tap:active, .chip:active, .iconbtn:active { transform: none !important; }
  /* Fewer and gentler, not zero: keep short fades that explain a change; drop the movement. */
  .scrim .sheet, .badge.changed, .tick, .dot.bump, .map-flag { animation-name: fade !important; animation-duration: 200ms !important; }
  .map-round:active { transform: none !important; }
}
@media (min-width: 560px) { body { background: #EFE3D2; } #app { box-shadow: 0 0 0 1px var(--line); } }
.ic.filled path { fill: currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rot { display: inline-flex; transition: transform var(--t-fast) var(--ease-out); } .rot.on { transform: rotate(90deg); } .rot.down.on { transform: rotate(180deg); }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-right: 8px; vertical-align: middle; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.err-line { display: flex; gap: 6px; align-items: flex-start; color: var(--bad); font-weight: 650; }
.err-line .ic { margin-top: 2px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: 0 0 52px; }
.btn.copy { background: var(--surface); color: var(--brand-dark); border-color: var(--field-line); min-width: 44px; padding: 0 12px; white-space: nowrap; }
.kv.copyable { align-items: center; flex-wrap: wrap; row-gap: 4px; } .kv.copyable > span:last-child { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; max-width: none; margin-left: auto; }
.kv.copyable b { white-space: nowrap; letter-spacing: .3px; }
.btn.copy.done { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.copy-ic { display: inline-flex; animation: pop var(--t-fast) var(--ease-out); }
.btn.copy:not(.done) .copy-ic { animation: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
/* Change feedback (state indication): plays once when a value really changes, never on first paint. */
.dot.bump { animation: bump 260ms var(--ease-out); }
@keyframes bump { from { transform: scale(.7); } }
.tick { animation: tick 220ms ease; }
@keyframes tick { from { opacity: .3; } }
.badge.changed { animation: status-in 240ms var(--ease-out); }
@keyframes status-in { from { opacity: 0; transform: scale(.94); } }
ol.timeline.card { padding: 16px 16px 4px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row > .btn { width: 100%; padding: 0 10px; }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 15px; display: grid; place-items: center; flex: 0 0 28px; }
.big-money { font-size: 34px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.ph.big.nophoto { aspect-ratio: auto; height: 120px; }

/* ---------------------------------------------------------------- maps (Google or OpenStreetMap) */
.map-canvas { position: absolute; inset: 0; z-index: 0; } /* own stacking context: map-library panes stay under our controls */
.map > .map-canvas { border-radius: inherit; }
.map, .track-map, .lp-mapwrap { isolation: isolate; } /* keep map-library z-indexes inside the map */
.gmk { position: absolute; left: 0; top: 0; will-change: transform; }
.mk-kitchen { width: 22px; height: 22px; border-radius: 7px; background: var(--brand-dark); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); box-sizing: border-box; }
.mk-home svg, .lp-pin-svg svg { display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.map-round { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 1px solid var(--field-line); color: var(--ink); display: grid; place-items: center; box-shadow: 0 2px 10px rgba(40,24,15,.18); cursor: pointer; flex: 0 0 auto; touch-action: manipulation;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease; }
.map-round:active { transform: scale(.97); }
.map-ui { z-index: 2; }
.ok-line { display: flex; gap: 6px; align-items: center; color: var(--ok); font-weight: 650; }
.linkbtn { background: none; border: 0; padding: 0 2px; font: inherit; color: var(--brand-dark); text-decoration: underline; cursor: pointer; min-height: 32px; }
body.noscroll { overflow: hidden; }

/* Location picker: full screen; the card sits under the map so the pin is centred in what you see. */
.lp { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; background: var(--bg); outline: none; animation: fade var(--t-med) ease; max-width: 520px; margin: 0 auto; }
.lp-mapwrap { position: relative; flex: 1 1 auto; min-height: 200px; background: #CFEFEE; overflow: hidden; }
.lp-pin { position: absolute; left: 50%; top: 50%; z-index: 3; pointer-events: none; transform: translate(-50%, -100%); transition: transform 220ms var(--ease-out); }
.lp-pin.up { transform: translate(-50%, calc(-100% - 16px)); transition-duration: 160ms; }
.lp-shadow { position: absolute; left: 50%; bottom: -4px; width: 16px; height: 6px; margin-left: -8px; border-radius: 50%; background: rgba(0,0,0,.28); transition: transform 220ms var(--ease-out), opacity 220ms ease; }
.lp-pin.up .lp-shadow { transform: translateY(16px) scale(1.6); opacity: .45; transition-duration: 160ms; }
.lp-top { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; gap: 8px; z-index: 4; }
.lp-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--field-line); border-radius: 24px; padding: 0 14px; min-height: 48px; box-shadow: 0 2px 10px rgba(40,24,15,.18); color: var(--muted); }
.lp-search:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.lp-search input { border: 0; background: transparent; flex: 1; min-width: 0; font: 16px/1.3 var(--font); color: var(--ink); outline: none; padding: 0; min-height: 44px; }
.lp-results { position: absolute; top: calc(66px + var(--safe-t)); left: 12px; right: 12px; max-height: 45%; overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lift); z-index: 5; animation: reveal var(--t-fast) var(--ease-out); }
.lp-results .item { width: 100%; text-align: left; display: flex; gap: 10px; padding: 12px 14px; min-height: 52px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; }
.lp-locate { position: absolute; right: 12px; bottom: 34px; z-index: 4; }
.lp-card { flex: 0 0 auto; background: var(--surface); border-radius: 20px 20px 0 0; position: relative; z-index: 6; padding: 16px calc(16px + var(--safe-r)) calc(14px + var(--safe-b)) calc(16px + var(--safe-l)); box-shadow: 0 -6px 24px rgba(40,24,15,.14); display: flex; flex-direction: column; gap: 10px; }
.lp-title { font-size: 17px; margin: 0; }
.lp-addr .strong { font-size: 17px; line-height: 1.35; min-height: 23px; }
.lp-area { min-height: 24px; }

/* Delivery tracking: full-screen map ends where the bottom sheet begins (markers and map logo stay visible). */
.track-map { position: relative; height: 100%; width: 100%; background: #CFEFEE; overflow: hidden; }
.track-map.compact { height: 240px; border-radius: var(--r-lg); border: 1px solid var(--line); }
.track-flags { position: absolute; left: 12px; right: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 3; }
.map-flag.soft { background: rgba(59,36,24,.82); color: #fff; font-weight: 600; }
.track-screen { position: fixed; inset: 0; z-index: 70; background: var(--bg); max-width: 520px; margin: 0 auto; overflow: hidden; }
.track-mapwrap { position: absolute; top: 0; left: 0; right: 0; } /* resized once the sheet settles, then the camera re-fits */
.track-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(10px + var(--safe-t)) 12px 10px; display: flex; gap: 10px; align-items: center; z-index: 4; pointer-events: none; }
.track-top > * { pointer-events: auto; }
.track-title { background: var(--surface); border-radius: 24px; padding: 8px 16px; min-height: 48px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 2px 10px rgba(40,24,15,.18); min-width: 0; flex: 1; }
.track-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78%; overflow: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(40,24,15,.16); z-index: 5;
  padding: 0 calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); transition: transform 300ms var(--ease-drawer); will-change: transform; }
.track-sheet.dragging { transition: none; }
.ts-handle { display: block; width: 100%; height: 26px; border: 0; background: none; cursor: grab; touch-action: none; padding: 0; position: sticky; top: 0; }
.ts-handle span { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--field-line); margin: 10px auto 0; }
.ts-peek { padding-bottom: 12px; }
.ts-more { border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.eta { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.demo-tag { display: inline-block; background: #5E3E00; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .4px; padding: 2px 8px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .lp-pin.up { transform: translate(-50%, -100%) !important; }
  .lp-pin.up .lp-shadow { transform: none !important; opacity: 1 !important; }
}
