/* The customer pages of the mobile order app, ported from the mockup of the customer pages.
   The first rules are the ones templates/layout.html has, which the customer pages still use. */
:root { --ink: #1d1b19; --muted: #6b645c; --line: #e4ddd3; --bg: #faf7f2; --card: #fff; --accent: #8a4b16; --good: #2f6b3a; --bad: #a3271f; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
header { background: var(--ink); color: #fff; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
header .brand { font-weight: 700; margin-right: auto; color: #fff; text-decoration: none; }
header a, header button { color: #f3e6d6; background: none; border: 0; font: inherit; padding: 0; cursor: pointer; text-decoration: none; }
header form { margin: 0; }
/* The top of a customer page: a small logo and the store name only. Nothing to press, not fixed */
header.brandmark { background: none; color: var(--muted); justify-content: center; gap: 8px; padding: 14px 16px 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
header.brandmark img { width: 28px; height: 28px; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
main.wide { max-width: 1180px; }
/* Customers use the app on a phone */
body[data-app="customer"] main { max-width: 480px; }
.logo { display: block; width: 160px; height: 160px; margin: 32px auto 40px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack form { margin: 0; }
.stack .button { display: block; width: 100%; text-align: center; }
.stack .or { text-align: center; margin: 4px 0; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0; }
.flash { background: #fff4df; border: 1px solid #ecd2a2; border-radius: 8px; padding: 10px 14px; margin: 12px 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.big { font-size: 2rem; font-weight: 700; }
.up { color: var(--bad); } .down { color: var(--good); }
.button, button.button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.button.small { padding: 4px 10px; font-size: 0.85rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat .label { color: var(--muted); font-size: 0.85rem; } .stat .value { font-size: 1.25rem; font-weight: 600; }
label { display: block; margin: 8px 0 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], select { width: 100%; max-width: 360px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
input.qty { width: 72px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td form { display: inline-block; margin: 2px 0; }
td input[type=text] { width: 90px; padding: 4px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #efe7dc; font-size: 0.8rem; }
.pill.payment_failed, .pill.closed_unpaid { background: #f6d5d2; } .pill.at_register, .pill.checking_out { background: #fbe8c4; } .pill.closed { background: #d8ead9; }
svg.ticker { width: 100%; height: auto; background: #fffdf9; border: 1px solid var(--line); border-radius: 8px; }
.qr { display: block; margin: 12px auto; width: min(80vw, 320px); image-rendering: pixelated; }
.scroll { overflow-x: auto; }
.orders { padding: 0 16px; }
.order { padding: 12px 0; border-bottom: 1px solid var(--line); }
.order:last-child { border-bottom: 0; }
.order-head { display: flex; justify-content: space-between; font-weight: 600; }
.order ul { list-style: none; margin: 4px 0 0; padding: 0; }
.order li { display: flex; gap: 8px; }
dialog.sheet { border: 0; border-radius: 20px; padding: 24px 16px; width: calc(100% - 24px); max-width: 456px; margin: auto auto calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 12px 40px rgb(0 0 0 / 0.25); touch-action: none; user-select: none; }
dialog.sheet[open] { animation: card-in 0.25s cubic-bezier(.2,.8,.2,1.1); }
@keyframes card-in { from { transform: translateY(40px) scale(0.96); opacity: 0; } }
dialog.sheet:focus { outline: none; }
dialog.sheet::backdrop { background: rgb(0 0 0 / 0.4); }
dialog.sheet h2 { margin-top: 0; }

/* Entrance, login and sign-up */
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.entry { display: flex; flex-direction: column; min-height: 100dvh; padding-top: 24px; padding-bottom: 32px; }
.entry .logo { margin: 24px auto 8px; width: 128px; height: 128px; }
.entry .store { text-align: center; font-size: 1.25rem; font-weight: 700; margin: 0 0 12px; }
.entry .actions { margin-top: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #efe7dc; font: inherit; font-size: 0.95rem; color: var(--ink); border: 0; }
button.chip { cursor: pointer; }
.chip .icon { color: var(--accent); }
.chip.off { color: var(--muted); }
.center { display: flex; justify-content: center; }
.stack .button, .button.block { display: block; width: 100%; padding: 14px 16px; text-align: center; font-size: 1.05rem; }
.button.block { margin-top: 20px; }
.textbutton { background: none; border: 0; padding: 8px; font: inherit; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.textbutton.muted { color: var(--muted); font-weight: 400; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 8px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.sub { display: block; text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: -4px; }
.back { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 0 8px -10px; color: var(--ink); }
.back .icon { width: 24px; height: 24px; }
.greeting { font-size: 1.5rem; font-weight: 700; margin: 24px 0 12px; }
.form label { margin: 16px 0 6px; }
.form input[type=text], .form input[type=email], .form input[type=password] { max-width: none; height: 48px; padding: 0 12px; border-radius: 8px; }
.form input[aria-invalid=true] { border-color: var(--bad); }
.form .hint { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; }
.form .error { color: var(--bad); font-size: 0.85rem; margin: 6px 0 0; display: flex; gap: 4px; align-items: center; }
.password { position: relative; }
.password input { padding-right: 48px !important; }
.password button { position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.notice { display: flex; gap: 8px; align-items: flex-start; border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: 0.95rem; }
.notice .icon { margin-top: 2px; }
.notice.bad { background: #fbe9e7; color: var(--bad); }
.notice.info { background: #fff4df; color: var(--ink); }
.notice.good { background: #e3f1e4; color: var(--good); align-items: center; white-space: nowrap; }
.benefits { list-style: none; padding: 0; margin: 0 0 8px; color: var(--muted); }
.benefits li { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.benefits .icon { color: var(--good); }
.switch { text-align: center; margin-top: 24px; color: var(--muted); }
.switch a { color: var(--accent); font-weight: 600; }
.state { text-align: center; margin: 48px 0 24px; }
.state > .icon { width: 56px; height: 56px; }
.state.good > .icon { color: var(--good); }
.state.bad > .icon { color: var(--bad); }
.state h1 { margin: 12px 0 4px; }
.state p { margin: 0; color: var(--muted); }
.sheet .rate { font-size: 2rem; font-weight: 700; text-align: center; margin: 8px 0 0; }
.sheet .facts { list-style: none; padding: 0; margin: 12px 0 20px; color: var(--muted); text-align: center; }
.sheet .facts li { margin: 2px 0; }
.toast { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); width: min(448px, calc(100% - 32px)); display: flex; gap: 8px; align-items: center; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.2); z-index: 20; transition: opacity 0.4s, transform 0.4s; }
.toast .icon { color: #9fd4a6; }
.toast.gone { opacity: 0; transform: translate(-50%, -12px); pointer-events: none; }
.sheet .button:focus:not(:focus-visible) { outline: none; }
.sheet .rate-label { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }
.sheet .rate-label + .rate { margin-top: 0; }
/* The cover charge and the cap per visit, side by side in figures of the same size */
.rate-pair { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 0 12px; }
.rate-pair > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px; }
.rate-pair > div + div { border-left: 1px solid var(--line); }
.rate-pair .rate-label { margin: 0; font-size: 0.85rem; }
.rate-pair .rate { margin: 0; font-size: 1.75rem; line-height: 1.2; }
.rate-pair .rate small { font-size: 0.9rem; font-weight: 600; color: var(--muted); margin-left: 2px; }
/* With no cap per visit, the cover charge stands alone in the middle */
.rate-pair > div:only-child { grid-column: 1 / -1; }

/* The tab bar at the bottom */
:root { --tabbar-h: 64px; }
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; justify-content: center; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; max-width: 120px; height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 0.7rem; }
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a .icon { padding: 4px 18px; box-sizing: content-box; border-radius: 999px; }
.tabbar a[aria-current=page] { color: var(--accent); font-weight: 700; }
.tabbar a[aria-current=page] .icon { background: #f3e1cd; }

/* Menu */
.menu h2 { margin: 16px 0 4px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.menu h2:first-child { margin-top: 4px; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li { border-bottom: 1px solid var(--line); }
.menu li button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 0; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.menu .name { flex: 1; }
.menu .thumb { width: 48px; height: 48px; border-radius: 8px; flex: none; object-fit: cover; }
.menu li button { padding: 8px 0; }
.sheet .item-photo { display: block; width: calc(100% + 32px); aspect-ratio: 2 / 1; max-height: 220px; margin: -24px -16px 16px; object-fit: cover; border-radius: 20px 20px 0 0; -webkit-user-drag: none; pointer-events: none; }
.menu .price { color: var(--muted); }
.menu .count { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.choices { border: 0; padding: 0; margin: 16px 0 0; }
.choices legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; padding: 0; }
.choices label { display: inline-block; margin: 0 8px 8px 0; font-weight: 400; }
.choices input { position: absolute; opacity: 0; }
.choices span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.choices input:checked + span { border-color: var(--accent); background: #f6ece1; color: var(--accent); font-weight: 600; }
.choices input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 20px 0 24px; }
.stepper .step { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.stepper .step:disabled { opacity: 0.35; cursor: default; }
.stepper output { font-size: 1.75rem; font-weight: 700; min-width: 2ch; text-align: center; }
.lines li button { display: flex; justify-content: space-between; width: 100%; padding: 0; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.lines small { display: block; color: var(--muted); font-size: 0.8rem; }
body.has-cart { padding-bottom: calc(var(--tabbar-h) + 84px + env(safe-area-inset-bottom)); }
/* On a page without the tab bar (login, sign-up), the bar sits at the bottom edge */
body.has-cart:not(.has-tabbar) { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
body:not(.has-tabbar) .cartbar { bottom: env(safe-area-inset-bottom); }
.cartbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 14; padding: 12px 16px; background: linear-gradient(transparent, var(--bg) 30%); }
.cartbar .button { display: flex; justify-content: space-between; max-width: 448px; margin: 0 auto; padding: 14px 18px; font-size: 1.05rem; width: 100%; }
.lines { list-style: none; margin: 0 0 8px; padding: 0; }
.lines li { display: flex; justify-content: space-between; padding: 6px 0; }
.lines li.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; }
/* Exit QR */
.exit-qr { text-align: center; margin: 32px 0 16px; }
.qr-card { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px 16px 12px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.08); }
.qr-card .qr { margin: 0; width: min(72vw, 300px); }
.qr-timer { height: 4px; margin-top: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.qr-timer span { display: block; height: 100%; background: var(--accent); animation: qr-left 5s linear infinite; transform-origin: left; }
@keyframes qr-left { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.exit-qr .exit-hint { margin: 0 0 16px; font-weight: 600; }
.exit-qr .exit-amount { margin: 16px 0 0; font-size: 2rem; font-weight: 700; line-height: 1.2; }
.exit-amount span { display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
/* Account */
.profile { display: flex; align-items: center; gap: 14px; width: 100%; margin: 16px 0; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
div.profile { cursor: default; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.avatar.guest { background: #efe7dc; color: var(--muted); }
.who { flex: 1; display: flex; flex-direction: column; }
.who .muted { font-size: 0.85rem; }
.profile > .icon, .menu-rows .icon:last-child { color: var(--muted); }
.menu-rows { list-style: none; margin: 0 0 24px; padding: 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.menu-rows li + li { border-top: 1px solid var(--line); }
.menu-rows a, .menu-rows .disabled { display: flex; align-items: center; gap: 12px; min-height: 56px; color: inherit; text-decoration: none; }
.menu-rows a > span:first-of-type, .menu-rows .disabled > span:first-of-type { flex: 1; }
.menu-rows .disabled { color: var(--muted); }
.menu-rows .disabled .muted { font-size: 0.8rem; }
.visits a > span:first-child { display: flex; align-items: center; gap: 8px; }
dialog.sheet input { user-select: text; touch-action: auto; }

/* Receipt */
.receipt-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.receipt-head h1 { margin: 0; font-size: 1.25rem; }
.bill-row.pay-line { border-bottom: 0; color: var(--muted); font-size: 0.9rem; padding-top: 0; }
.bill-row.pay-line div:first-child { display: flex; align-items: center; gap: 6px; }
.bill-row.pay-line.bad { color: var(--bad); font-weight: 600; }
.receipt-ids { text-align: left; color: var(--muted); font-size: 0.75rem; margin: 8px 0 16px; }

/* PayPal */
.terms { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin: 16px 0 12px; font-size: 0.85rem; color: var(--ink); }
.terms .muted { font-size: 0.75rem; }
.agree { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 600; cursor: pointer; }
.agree input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.agree:has(input:checked) { border-color: var(--accent); background: #fbf3ea; }
.button:disabled { opacity: 0.4; cursor: default; }
.linked-card { display: flex; align-items: center; gap: 12px; padding: 16px; margin: 16px 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.linked-card .icon { width: 32px; height: 32px; color: var(--good); flex: none; }
.linked-card div { display: flex; flex-direction: column; }
.linked-card .muted { font-size: 0.85rem; }
.textbutton.danger { color: var(--bad); }
.textbutton:disabled { opacity: 0.4; cursor: default; }
.button.danger { background: var(--bad); }

/* Bill */
.bill-hero { text-align: center; margin: 24px 0 16px; }
.bill-hero .label { margin: 0; color: var(--muted); font-size: 0.9rem; }
.bill-hero .amount { margin: 0; font-size: 3rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.bill-hero .muted { margin: 4px 0 0; }
.bill { padding: 4px 16px; }
.bill-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bill-row.total { border-bottom: 0; border-top: 1px solid var(--line); font-weight: 700; font-size: 1.1rem; }
.bill-amount { font-weight: 600; white-space: nowrap; }
.bill-rate { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; margin-top: 2px; }
.spark { width: 72px; height: 20px; }
.bill .orders { padding: 0 0 0 12px; border-bottom: 0; }
.bill .order { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.bill .order-head { font-weight: 400; font-size: 0.9rem; }
.bill .order ul { font-size: 0.9rem; }
.note { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 0.9rem; margin: 8px 0 16px; }
[hidden] { display: none !important; }
