/* AlfaOne SBM — one stylesheet. Tokens first. The brand colour is set per business (brand_style()). */
:root {
  /* AlfaOne palette: red, black and white, grey neutrals. The brand colour can be changed per business (brand_style()). */
  --accent: #E10A17;
  --accent-dark: #BF0813;
  --accent-ink: #fff;
  --accent-soft: #FFF1F2;
  --ink: #0B0B0C;
  --ink-2: #3B3B42;
  --muted: #6B6B74;
  --charcoal: #17171A;
  --charcoal-2: #26262B;
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --line: #E6E6EA;
  --line-2: #F0F0F2;
  --ok: #0F9D4E;
  --ok-soft: #E7F6EE;
  --warn: #B86E00;
  --warn-soft: #FDF3E3;
  --info: #1D5BD6;
  --info-soft: #EAF0FC;
  --bad: #BF0813;
  --bad-soft: #FFF1F2;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Montserrat", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r: 14px;
  --r-sm: 10px;
  --tap: 48px;
  --bar: 56px;
  --tabbar: 62px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-wrap: anywhere; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
.i { flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ───────────── Buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 1rem;
  border: 1px solid transparent; transition: transform .12s ease, opacity .12s ease; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.sec { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--accent); padding: 0 8px; }
.btn.danger { background: var(--card); color: var(--bad); border-color: var(--line); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }

/* ───────────── Forms ───────────── */
.form { display: grid; gap: 14px; }
.form h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 8px; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); min-width: 0; }
label > input, label > select, label > textarea, label > .money-input, label > .seg { margin-top: 6px; }
label > .money-input { display: block; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: var(--tap); padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  font-size: 16px; /* 16px stops iPhone zooming on focus */ font-weight: 400; color: var(--ink);
  appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236B6B74' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea { min-height: 96px; resize: vertical; }
input[type="date"], input[type="time"] { display: block; text-align: left; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
input[type="file"] { padding: 11px 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 6px; flex: none; position: relative; }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 > * { min-width: 0; }
.money-input { position: relative; }
.money-input::before { content: var(--cur, "$"); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }
.money-input input { padding-left: var(--curw, 28px); }
.big-input input { font-size: 28px; font-weight: 700; min-height: 64px; letter-spacing: -.01em; }
.big-input.money-input::before { font-size: 28px; font-weight: 700; left: 16px; }
.big-input.money-input input { padding-left: 36px; }
.help { font-size: .8rem; color: var(--muted); font-weight: 400; }
label > .help { margin-left: 4px; }
label > input ~ .help, label > .seg ~ .help, label > .money-input ~ .help, label > select ~ .help { display: block; margin: 6px 0 0; }
.file-pick { position: relative; display: block; }
.file-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.file-pick .btn { pointer-events: none; }
.file-pick.has-file .btn { border-color: var(--ok); color: var(--ok); }

/* Segmented pills */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg label { flex: none; display: flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg input:checked + label { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + label { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.stepper button { width: 46px; height: 46px; font-size: 1.4rem; font-weight: 500; color: var(--ink); }
.stepper button:active { background: var(--bg); }
.stepper input { width: 56px; min-height: 46px; border: 0; border-radius: 0; text-align: center; padding: 0; font-weight: 700; box-shadow: none; }

/* ───────────── App shell ───────────── */
body.app { min-height: 100vh; min-height: 100dvh; }
.appbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line); padding-top: var(--safe-t);
}
.appbar-in { max-width: 760px; margin: 0 auto; height: var(--bar); display: flex; align-items: center; gap: 4px; padding: 0 calc(8px + var(--safe-r)) 0 calc(8px + var(--safe-l)); }
.appbar-title { flex: 1; min-width: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; }
.appbar-btn + .appbar-title { padding-left: 0; }
.appbar-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.appbar-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink); }
.appbar-btn:active { background: var(--bg); }
.appbar-actions .btn.sm { margin-right: 4px; }
.dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }

.app-main {
  max-width: 760px; margin: 0 auto;
  padding: 16px calc(16px + var(--safe-r)) calc(var(--tabbar) + var(--safe-b) + 28px) calc(16px + var(--safe-l));
  animation: fade .18s ease-out;
}
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
}
.tabbar a { flex: 1; max-width: 152px; height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.tabbar a.on { color: var(--accent); }
.tabbar a:active .tab-ic { transform: scale(.9); }
.tab-ic { position: relative; transition: transform .12s ease; }
.tab-ic .dot { top: -6px; right: -12px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 12px); transform: translateX(-50%); z-index: 40; width: min(92vw, 520px); padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 500; font-size: .92rem; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: toast-in .25s ease-out; }
.toast.err { background: var(--bad); }
.toast.hide { opacity: 0; transform: translate(-50%, 8px); transition: all .3s ease; }
.toast + .toast { bottom: calc(var(--tabbar) + var(--safe-b) + 68px); }
body.auth .toast { bottom: calc(var(--safe-b) + 16px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ───────────── Building blocks ───────────── */
.section { margin-top: 22px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 8px; }
.section-head h2, .section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.section-head a { font-size: .9rem; font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card { margin-top: 12px; }
.card.pad-0 { padding: 0; overflow: hidden; }

.hero-stat { background: var(--ink); color: #fff; border-radius: 18px; padding: 20px; }
.hero-stat .label { font-size: .8rem; opacity: .7; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.hero-stat .value { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; }
.hero-stat .sub { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: .9rem; }
.hero-stat .sub span { opacity: .75; }
.hero-stat .sub strong { font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.stat .label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .value { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.wide { grid-column: 1 / -1; }

.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.action { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); font-weight: 600; font-size: .95rem; min-width: 0; }
.action .ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.action span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action:active { transform: scale(.98); }

/* Lists */
.list { list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; color: var(--ink); min-width: 0; }
a.li:active, button.li:active { background: var(--bg); }
button.li { width: 100%; text-align: left; }
.li-main { flex: 1; min-width: 0; }
.li-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { font-size: .84rem; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.li-end { flex: none; text-align: right; display: flex; align-items: center; gap: 8px; }
.li-end .amount { font-weight: 700; white-space: nowrap; }
.li-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg); color: var(--ink-2); flex: none; }
.li-ic.accent { background: var(--accent-soft); color: var(--accent); }
.li .chev { color: #C5C9CF; }
.li-form { display: flex; align-items: center; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--muted); }
.icon-btn:active { background: var(--bg); }
.icon-btn.del:hover, .icon-btn.del:active { color: var(--bad); }

.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.tag.low, .tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }

.note { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: .92rem; }
.note.ok { background: var(--ok-soft); border-color: transparent; color: #1f5a38; }
.note.err { background: var(--bad-soft); border-color: transparent; color: #8c2a1f; }
.note.warn { background: var(--warn-soft); border-color: transparent; color: #7a4a0e; }
.note + .note, .note + form, .note + .card { margin-top: 12px; }

.banner { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--ink); margin-bottom: 16px; }
.banner .banner-ic { color: var(--accent); flex: none; }
.banner .banner-text { flex: 1; min-width: 0; font-size: .9rem; }
.banner .banner-text strong { display: block; }

.empty { text-align: center; padding: 36px 20px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--r); }
.empty-title { font-weight: 700; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

details.more-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
details.more-box > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 16px; font-weight: 600; cursor: pointer; }
details.more-box > summary::-webkit-details-marker { display: none; }
details.more-box > summary::after { content: ""; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; margin-top: -4px; }
details.more-box[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.more-box > .more-body { padding: 0 16px 16px; }

/* Chips row (filters / categories) */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; scroll-padding: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Sell grid */
.sell-bar { position: sticky; top: calc(var(--safe-t) + var(--bar)); z-index: 10; background: var(--bg); margin: -16px -16px 0; padding: 12px 16px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.sell-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sell-row .seg { flex: 1; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 84px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-align: left; min-width: 0; transition: transform .1s ease, border-color .1s; }
.tile:active { transform: scale(.96); border-color: var(--accent); }
.tile-name { font-weight: 700; font-size: .95rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile-price { font-size: .88rem; color: var(--muted); font-weight: 600; }
.cat-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin: 20px 4px 8px; scroll-margin-top: calc(var(--safe-t) + var(--bar) + 130px); }

/* Bars (reports / today) */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .82rem; }
.bar-track { display: grid; gap: 3px; min-width: 0; }
.bar { height: 8px; border-radius: 4px; background: var(--accent); min-width: 3px; }
.bar.exp { background: #C9CDD3; }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin-right: 6px; vertical-align: -1px; }
.legend i.exp { background: #C9CDD3; }

.share-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.share-row:first-child { border-top: 0; }
.share-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row .meter { width: 70px; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; flex: none; }
.share-row .meter span { display: block; height: 100%; background: var(--accent); }
.share-row .amount { font-weight: 700; white-space: nowrap; min-width: 74px; text-align: right; }

.receipt-thumb { width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; background: var(--bg); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { text-align: right; font-weight: 600; min-width: 0; }
code.copy { display: block; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: .8rem; word-break: break-all; user-select: all; }

/* ───────────── Auth (login / installer) ───────────── */
body.auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b)); background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; }
.auth-card.wide { max-width: 520px; }
.auth-card h1 { font-size: 1.5rem; letter-spacing: -.02em; }
.auth-card .brand-mark { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 16px; }
.auth-card .form { margin-top: 20px; }
.auth-card .note { margin-top: 16px; }
.checks { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 16px 0 4px; font-size: .82rem; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--bad); font-weight: 700; }

/* ───────────── Shared layout pieces ───────────── */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 calc(20px + var(--safe-r)) 0 calc(20px + var(--safe-l)); }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.menu-cat { margin-top: 28px; scroll-margin-top: 80px; }
.menu-cat h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 4px; }
.menu-list { list-style: none; display: grid; grid-template-columns: 1fr; column-gap: 40px; }
.menu-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.menu-list .m-name { font-weight: 600; }
.menu-list .m-desc { font-size: .9rem; color: var(--muted); margin-top: 2px; }
.menu-list .m-price { font-weight: 700; white-space: nowrap; }
.info-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.info { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); min-width: 0; }
.info .i { color: var(--accent); margin-top: 2px; }
.info strong { display: block; }
.info span { color: var(--ink-2); font-size: .95rem; }

@media (min-width: 720px) {
  .menu-list { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat.wide { grid-column: auto; }
  .actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .row2 { grid-template-columns: 1fr; }
  .hero-stat .value { font-size: 2rem; }
  .tabbar a { font-size: .64rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Shopping items expand in place */
details.shop-item > summary { list-style: none; cursor: pointer; }
details.shop-item > summary::-webkit-details-marker { display: none; }
details.shop-item[open] > summary { background: var(--bg); }
details.shop-item[open] .li-ic { background: var(--accent); color: var(--accent-ink); }

/* Menu ↔ stock link rows */
.link-row { grid-template-columns: minmax(0, 1fr) 96px; }

/* Sell: search, stock status on tiles, quick-add feedback */
.sell-search { position: relative; }
.sell-search input { padding-left: 40px; min-height: 44px; }
.sell-search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tile { position: relative; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.tile .tag { height: 20px; padding: 0 7px; font-size: .68rem; }
.tile.added { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.tile.added::after { content: "✓"; position: absolute; top: 8px; right: 10px; color: var(--ok); font-weight: 800; }
.li.new { animation: flash-in 1.2s ease-out; }
@keyframes flash-in { from { background: var(--ok-soft); } to { background: transparent; } }
.no-match { display: none; }
.no-match.show { display: block; margin-top: 16px; }

/* ───────────── POS register ───────────── */
.sell-bar .chips { margin-top: 2px; }
.tile.in-ticket { border-color: var(--accent); background: #F5F5F7; }
.tile.added { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tile.added::after { content: none; }
.tile-qty { position: absolute; top: -8px; right: -6px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .82rem; line-height: 26px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }

body.has-cart .app-main { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 96px); }
.cartbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + var(--safe-b)); z-index: 25; padding: 8px calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l)); background: linear-gradient(to top, rgba(245,246,248,1) 60%, rgba(245,246,248,0)); }
.cartbar-main { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 736px; margin: 0 auto; min-height: 56px; padding: 0 18px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1rem; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 32%, transparent); }
.cartbar-main:active { transform: scale(.98); }
.cartbar-count { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px; background: rgba(255,255,255,.22); line-height: 28px; text-align: center; font-size: .9rem; }
.cartbar-label { flex: 1; text-align: left; }
.cartbar strong { font-size: 1.1rem; white-space: nowrap; }
.toast { z-index: 60; }
body.has-cart .toast { bottom: calc(var(--tabbar) + var(--safe-b) + 84px); }

.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0); transition: background .2s ease; display: flex; align-items: flex-end; justify-content: center; }
.sheet.open { background: rgba(0,0,0,.38); }
.sheet-panel { width: 100%; max-width: 760px; max-height: calc(100% - var(--safe-t) - 24px); display: flex; flex-direction: column; background: var(--bg); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .22s ease-out; overflow: hidden; }
.sheet.open .sheet-panel { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.sheet-head h2 { font-size: 1.1rem; font-weight: 700; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 16px calc(16px + var(--safe-r)) 16px calc(16px + var(--safe-l)); }
.sheet-foot { flex: none; padding: 12px calc(16px + var(--safe-r)) calc(12px + var(--safe-b)) calc(16px + var(--safe-l)); background: var(--card); border-top: 1px solid var(--line); }
.sheet-foot-row { display: flex; gap: 10px; }
.btn.grow { flex: 1; min-height: 54px; font-size: 1.05rem; }
.sheet-foot .btn.sec { min-height: 54px; }
.sheet-foot [data-ticket-new] { min-height: 54px; font-size: 1.05rem; }
body.sheet-open { overflow: hidden; }

.ticket-line { gap: 10px; }
.stepper.sm button { width: 38px; height: 38px; font-size: 1.2rem; display: grid; place-items: center; }
.stepper-val { min-width: 26px; text-align: center; font-weight: 700; }
.line-amt { min-width: 64px; text-align: right; font-weight: 700; white-space: nowrap; }

.ticket-sum { display: grid; gap: 10px; font-size: .95rem; }
.ticket-sum > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket-sum > div > span:first-child { color: var(--ink-2); }
.ticket-sum .grand { padding-top: 10px; border-top: 1px solid var(--line); font-size: 1.3rem; font-weight: 800; }
.ticket-sum .grand span:first-child { color: var(--ink); }
.ticket-sum .disc { width: 120px; }
.ticket-sum .disc input { min-height: 40px; text-align: right; }
.change-row { display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; padding-top: 4px; }
.change-row strong { font-size: 1.4rem; }

.done { text-align: center; padding: 28px 8px 12px; }
.done-check { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.done-num { font-weight: 700; color: var(--ink-2); }
.done-total { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; margin: 4px 0; }
.done-change { margin: 16px auto 0; display: inline-block; padding: 10px 18px; border-radius: 12px; background: var(--warn-soft); color: #7a4a0e; font-weight: 800; font-size: 1.2rem; }

/* Menu photos (admin) */
.menu-photo-preview { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--bg); }
.li-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg); }
.li-thumb.empty { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 1.1rem; }

/* ───────────── More POS pieces ───────────── */
.menu-note { margin-top: 24px; }
@media (max-width: 559px) {
  /* Phones: compact rows, photo on the left, so more of the menu fits on screen */
}

/* Register: bigger, calmer product buttons */
.sell-bar { gap: 10px; }
[data-pos] .tiles { gap: 10px; }
[data-pos] .tile { min-height: 92px; padding: 14px; border-radius: 16px; }
[data-pos] .tile-name { font-size: 1rem; }
[data-pos] .tile-price { font-size: .95rem; color: var(--ink-2); }
[data-pos] .cat-title { margin-top: 18px; }

/* ───────────── Sign-in ───────────── */
body.pos-login {
  min-height: 100vh; min-height: 100dvh; margin: 0; color: #fff;
  background:
    radial-gradient(120% 70% at 85% -10%, color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, var(--accent) 0%, transparent) 60%),
    radial-gradient(90% 60% at -10% 110%, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 0%, transparent) 60%),
    #0B0B0C;
  display: flex; align-items: center; justify-content: center;
  padding: calc(28px + var(--safe-t)) 20px calc(28px + var(--safe-b));
}
.pl-wrap { width: 100%; max-width: 400px; }
.pl-brand { text-align: center; margin-bottom: 28px; animation: fade .35s ease-out; }
.pl-icon { width: 76px; height: 76px; border-radius: 20px; margin: 0 auto 18px; box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 0 1px rgba(255,255,255,.08); }
.pl-brand h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.pl-brand p { color: rgba(255,255,255,.6); margin-top: 6px; font-size: .95rem; }
.pl-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 22px; padding: 22px 18px; display: grid; gap: 16px; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: fade .45s ease-out; }
.pl-field { display: grid; gap: 7px; color: rgba(255,255,255,.75); font-size: .82rem; font-weight: 600; }
.pl-field input { margin: 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; min-height: 52px; border-radius: 14px; font-size: 16px; padding: 0 16px; }
.pl-field input::placeholder { color: rgba(255,255,255,.35); }
.pl-field input:focus { border-color: var(--accent-bright, var(--accent)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); background: rgba(255,255,255,.1); }
.pl-field input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 100px #26262B inset; caret-color: #fff; }
.pl-pass { position: relative; display: block; }
.pl-pass input { padding-right: 72px; }
.pl-show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 40px; padding: 0 12px; border-radius: 10px; color: rgba(255,255,255,.75); font-size: .85rem; font-weight: 600; }
.pl-show:active { background: rgba(255,255,255,.08); }
.pl-btn { margin-top: 4px; min-height: 54px; border-radius: 14px; background: var(--accent-bright, var(--accent)); color: var(--accent-bright-ink, var(--accent-ink)); font-weight: 700; font-size: 1.05rem; box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .12s ease; }
.pl-btn:active { transform: scale(.98); }
.pl-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: rgba(255,255,255,.55); font-size: .82rem; }
.pl-note .i { color: var(--accent); }
.pl-error { background: rgba(192, 57, 43, .18); border: 1px solid rgba(192, 57, 43, .45); color: #ffd7d1; border-radius: 12px; padding: 11px 14px; font-size: .9rem; }
.pl-foot { text-align: center; color: rgba(255,255,255,.4); font-size: .8rem; margin-top: 20px; }

/* Nav: transparent over the photo, solid after scrolling */

/* Hero */

/* Welcome */

/* Favourites rail */

/* Menu */

/* Visit */

/* Footer */

/* POS buttons with the product photo */
[data-pos] .tile.has-photo { padding: 0; overflow: hidden; gap: 0; justify-content: flex-start; }
[data-pos] .tile.has-photo .tile-img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg); }
[data-pos] .tile.has-photo .tile-name { padding: 10px 12px 0; }
[data-pos] .tile.has-photo .tile-foot { padding: 4px 12px 12px; margin-top: auto; }
[data-pos] .tile.has-photo .tile-qty { z-index: 2; }
[data-pos] .tile { overflow: visible; }
[data-pos] .tile.has-photo { overflow: visible; }
[data-pos] .tile.has-photo .tile-img { border-radius: 15px 15px 0 0; }
[data-pos] .tiles { align-items: start; }

/* Bottom bar: payment + Complete (no extra screen) */
body.has-cart .app-main { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 200px); }
body.has-cart .toast { bottom: calc(var(--tabbar) + var(--safe-b) + 190px); }
.cartbar { padding: 0; background: none; }
.cartbar-in { max-width: 760px; margin: 0 auto; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.08); border-radius: 18px 18px 0 0; padding: 10px calc(14px + var(--safe-r)) 12px calc(14px + var(--safe-l)); display: grid; gap: 10px; }
.cartbar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cartbar-edit { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 600; color: var(--ink); }
.cartbar-edit .cartbar-count { background: var(--accent); color: var(--accent-ink); }
.cartbar-clear { min-height: 36px; padding: 0 10px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.seg.seg-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg.seg-bar label { justify-content: center; min-height: 40px; padding: 0 6px; font-size: .9rem; }
@media (min-width: 600px) { .seg.seg-bar { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.cartbar-complete { min-height: 56px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.1rem; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.cartbar-complete:active { transform: scale(.98); }
.cartbar-complete.busy, .cartbar-complete[disabled] { opacity: .6; pointer-events: none; }
body.sheet-open .toast { bottom: calc(var(--safe-b) + 92px); }

/* App-styled confirm box */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; padding: 16px calc(12px + var(--safe-r)) calc(16px + var(--safe-b)) calc(12px + var(--safe-l)); background: rgba(0,0,0,0); transition: background .18s ease; }
.modal.open { background: rgba(0,0,0,.42); }
.modal-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 20px; padding: 22px 18px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); transform: translateY(24px); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
.modal.open .modal-card { transform: none; opacity: 1; }
.modal-msg { font-size: 1.05rem; font-weight: 600; line-height: 1.4; text-align: center; padding: 0 6px 18px; color: var(--ink); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions .btn { min-height: 50px; }
.btn.danger-solid { background: var(--bad); color: #fff; }
@media (min-width: 600px) { .modal { align-items: center; } }

/* Full-page message (expired form, errors) */
.msg-card { text-align: center; }
.msg-card .msg-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; }
.msg-card p { margin: 8px 0 20px; }

/* POS: tap selects (✓), tap again removes; no double-tap zoom */
[data-pos] .tile, .cartbar button, .seg label { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
[data-pos] .tile.in-ticket { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
[data-pos] .tile.has-photo.in-ticket .tile-img { opacity: .85; }

/* POS tabs: Popular · Food · Drinks */
.pos-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: #E9EBEF; border-radius: 14px; }
.pos-tab { min-height: 44px; border-radius: 11px; font-weight: 700; font-size: .98rem; color: var(--ink-2); touch-action: manipulation; }
.pos-tab.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.pos-panel { padding-top: 14px; }
.pos-panel .chips { margin-bottom: 2px; }
.pos-panel .cat-title:first-of-type { margin-top: 10px; }

/* Count badge (tap = +1) and − to take one off */
[data-pos] .tile-qty { min-width: 30px; height: 30px; line-height: 30px; font-size: .95rem; top: -9px; right: -7px; }
.tile-minus { position: absolute; top: -9px; left: -7px; z-index: 3; width: 30px; height: 30px; border-radius: 15px; background: var(--ink); color: #fff; font-weight: 800; font-size: 1.15rem; line-height: 28px; text-align: center; box-shadow: 0 0 0 2px var(--bg); cursor: pointer; }
.tile-minus::before { content: ""; position: absolute; inset: -8px; }   /* bigger tap area */
[data-pos] .tile.in-ticket:not(.has-photo) { padding-top: 26px; }

/* ───────────── Passcode screen ───────────── */
.lock-wrap { max-width: 360px; margin: 8px auto 0; text-align: center; }
.lock-ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.lock-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.lock-sub { color: var(--muted); margin-top: 4px; }
.lock-sub strong { color: var(--ink); }
.lock-form { margin-top: 24px; }
.lock-dots { display: flex; justify-content: center; gap: 14px; height: 18px; }
.lock-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-2); transition: background .12s, transform .12s; }
.lock-dots span.on { background: var(--ink); border-color: var(--ink); transform: scale(1.05); }
.lock-dots.shake { animation: shake .35s ease; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.lock-error { min-height: 22px; margin: 12px 0 6px; color: var(--bad); font-weight: 600; font-size: .92rem; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 6px; }
.key { height: 68px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); font-size: 1.6rem; font-weight: 600; color: var(--ink); touch-action: manipulation; -webkit-user-select: none; user-select: none; transition: transform .08s, background .08s; }
.key:active { transform: scale(.94); background: #E9EBEF; }
.key-fn { background: transparent; border-color: transparent; font-size: 1.4rem; color: var(--ink-2); }
.key-go { background: var(--accent); border-color: var(--accent); color: #fff; display: grid; place-items: center; }
.lock-alt { display: inline-block; margin-top: 18px; font-size: .9rem; font-weight: 600; }
.lock-pw { text-align: center; font-size: 18px; }
.tab-lock { position: absolute; right: -9px; bottom: -3px; width: 16px; height: 16px; border-radius: 8px; background: var(--card); color: var(--muted); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--line); }

/* ═════════════ v011 · Professional POS ═════════════ */
.appbar-brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.appbar-brand img { width: 34px; height: 34px; border-radius: 10px; flex: none; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 25%, transparent); }
.appbar-brand > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.appbar-brand strong { font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-brand small { font-size: .74rem; color: var(--muted); font-weight: 500; white-space: nowrap; }

/* Product cards: same shape for every product (photo, or a lettered tile) */
[data-pos] .tile.ptile { padding: 0; min-height: 0; gap: 0; border-radius: 18px; overflow: hidden; justify-content: flex-start; border: 1px solid #E8EAEE; box-shadow: 0 1px 2px rgba(12, 14, 18, .05); transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease; }
[data-pos] .tile.ptile:active { transform: scale(.97); }
[data-pos] .tile.ptile.in-ticket { padding-top: 0; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 6px 16px color-mix(in srgb, var(--accent) 18%, transparent); background: #fff; }
[data-pos] .tile.ptile.added { box-shadow: 0 0 0 2px var(--accent), 0 0 0 7px var(--accent-soft); }
.tile-media { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; background: #F0F0F2; overflow: hidden; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-initial { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; color: var(--accent); background: linear-gradient(140deg, var(--accent-soft) 0%, color-mix(in srgb, var(--accent) 20%, white) 100%); letter-spacing: -.02em; }
.tile-out { position: absolute; left: 8px; bottom: 8px; padding: 4px 9px; border-radius: 999px; background: rgba(192, 57, 43, .92); color: #fff; font-size: .72rem; font-weight: 700; }
.tile-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; text-align: left; min-width: 0; }
[data-pos] .ptile .tile-name { font-size: .95rem; font-weight: 700; line-height: 1.25; padding: 0; color: var(--ink); }
[data-pos] .ptile .tile-price { font-size: .92rem; font-weight: 700; color: var(--accent); }
[data-pos] .ptile .tile-qty { top: 8px; right: 8px; min-width: 32px; height: 32px; line-height: 32px; border-radius: 16px; font-size: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
[data-pos] .ptile .tile-minus { top: 8px; left: 8px; width: 32px; height: 32px; line-height: 30px; border-radius: 16px; background: rgba(22,22,22,.85); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.pos-tabs { box-shadow: inset 0 1px 2px rgba(0,0,0,.04); }
.pos-panel .cat-title { font-size: .72rem; letter-spacing: .12em; color: var(--muted); margin: 18px 4px 10px; }
.pos-panel .cat-title:first-of-type { margin-top: 6px; }

/* Order panel parts used only on wide screens */
.side-head, .side-lines, .side-sum { display: none; }

/* Tablets and computers: products on the left, the order always open on the right */
@media (min-width: 900px) {
  body.pos-page .appbar-in { max-width: none; padding-right: calc(16px + var(--safe-r)); }
  body.pos-page .app-main, body.pos-page.has-cart .app-main { max-width: none; margin: 0 380px 0 0; padding: 18px 24px calc(var(--tabbar) + var(--safe-b) + 28px); }
  body.pos-page .sell-bar { margin: -18px -24px 0; padding: 14px 24px; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); align-items: center; }
  body.pos-page .sell-bar .pos-tabs { grid-column: 1; }
  body.pos-page .sell-bar .sell-search { grid-column: 2; }
  body.pos-page .tiles { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
  body.pos-page .toast, body.pos-page.has-cart .toast { left: calc(50% - 190px); bottom: calc(var(--tabbar) + var(--safe-b) + 16px); }

  .cartbar, .cartbar.hidden { display: block !important; position: fixed; top: calc(var(--safe-t) + var(--bar) + 1px); right: 0; left: auto; bottom: calc(var(--tabbar) + var(--safe-b)); width: 380px; z-index: 20; padding: 0; background: none; }
  .cartbar-in { height: 100%; max-width: none; margin: 0; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.04); display: flex; flex-direction: column; gap: 0; padding: 0; }
  .cartbar .cartbar-top { display: none; }
  .side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
  .side-head strong { font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; }
  .side-lines { display: block; flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px; }
  .side-lines .list { border: 0; background: transparent; }
  .side-lines .list > li { border-top-color: #F0F0F2; }
  .side-line { gap: 10px; padding: 10px 6px; min-height: 0; }
  .side-qty { flex: none; min-width: 32px; font-weight: 800; color: var(--accent); }
  .side-line .li-title { white-space: normal; line-height: 1.25; }
  .side-ctrl { display: flex; gap: 4px; flex: none; }
  .side-ctrl button { width: 32px; height: 32px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font-size: 1.15rem; font-weight: 600; color: var(--ink); touch-action: manipulation; }
  .side-ctrl button:active { background: #E3E6EA; }
  .side-line .amount { min-width: 64px; text-align: right; }
  .side-empty { height: 100%; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; }
  .side-empty-ic { width: 54px; height: 54px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 4px; }
  .side-empty strong { color: var(--ink); }
  .side-sum { display: grid; gap: 6px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }
  .side-sum > div { display: flex; justify-content: space-between; }
  .side-more { justify-self: start; color: var(--accent); font-weight: 600; font-size: .85rem; padding: 4px 0 0; }
  .cartbar .seg.seg-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 18px; }
  .cartbar .cartbar-complete { margin: 12px 18px calc(16px + var(--safe-b)); min-height: 60px; font-size: 1.15rem; }
  .cartbar-in > .seg-bar { padding-top: 4px; }
}

/* ═════════════ v011 · Passcode screen (branded) ═════════════ */
body.lock-page .app-main { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--bar) - var(--tabbar)); min-height: calc(100dvh - var(--bar) - var(--tabbar) - var(--safe-t) - var(--safe-b)); padding-top: 20px; padding-bottom: calc(var(--tabbar) + var(--safe-b) + 20px); }
body.lock-page .lock-wrap {
  width: 100%; max-width: 380px; margin: 0 auto; padding: 30px 22px 24px; border-radius: 28px; color: #fff; text-align: center;
  background: radial-gradient(120% 70% at 90% -10%, color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, var(--accent) 0%, transparent) 60%), radial-gradient(90% 60% at -10% 110%, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent) 0%, transparent) 60%), #0B0B0C;
  box-shadow: 0 24px 60px rgba(10, 12, 16, .28);
}
body.lock-page .lock-ic { width: 60px; height: 60px; border-radius: 18px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: #fff; }
body.lock-page .lock-title { color: #fff; font-size: 1.5rem; }
body.lock-page .lock-sub { color: rgba(255,255,255,.6); }
body.lock-page .lock-sub strong { color: #fff; }
body.lock-page .lock-dots span { border-color: rgba(255,255,255,.55); width: 14px; height: 14px; }
body.lock-page .lock-dots span.on { background: #fff; border-color: #fff; }
body.lock-page .lock-error { color: #FFB4A8; }
body.lock-page .keypad { gap: 12px; margin-top: 8px; }
body.lock-page .key { height: 66px; border-radius: 50%; width: 66px; justify-self: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff; font-size: 1.6rem; font-weight: 500; }
body.lock-page .key:active { background: rgba(255,255,255,.22); }
body.lock-page .key-fn { background: transparent; border-color: transparent; color: rgba(255,255,255,.75); }
body.lock-page .key-go { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent); }
body.lock-page .lock-alt { color: rgba(255,255,255,.7); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.3); }
body.lock-page .lock-pw { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
body.lock-page .lock-pw::placeholder { color: rgba(255,255,255,.4); }
[data-pos] .ptile .tile-qty, [data-pos] .ptile .tile-minus { z-index: 4; }

/* ───────────── Settings: business type, colour, icon ───────────── */
.opt-list { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.lbl { font-weight: 600; font-size: .92rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: -4px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink); }
.swatch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 4px; }
.color-row { display: flex; gap: 10px; margin-top: 6px; }
.color-row input[type="color"] { width: 56px; min-width: 56px; height: var(--tap); padding: 4px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); }
.icon-row { display: flex; align-items: center; gap: 14px; }
.icon-row img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); }
.pl-maker { margin-top: 6px; opacity: .7; }
.pl-maker a { color: inherit; }
.icon-row .file-pick { min-width: 0; }
.icon-row .file-pick .btn { white-space: normal; text-align: center; }

/* Headings: Montserrat bold; body: Manrope */
h1, h2, h3, .appbar-title, .appbar-brand strong, .hero-stat .value, .pl-brand h1, .section-head h2, .cat-title { font-family: var(--font-head); }
.btn:not(.sec):not(.ghost):not(.danger):hover, .cartbar-complete:hover, .pl-btn:hover { filter: none; background-color: var(--accent-dark, var(--accent)); }
.tag.info, .note.info { background: var(--info-soft); color: var(--info); }

/* ───────────── Splash screen (app opening) ───────────── */
.splash { position: fixed; inset: 0; z-index: 9999; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--safe-t) 24px var(--safe-b); transition: opacity .4s ease, visibility .4s ease; }
.splash.out { opacity: 0; visibility: hidden; }
html.splashing, html.splashing body { overflow: hidden; }
.splash-in { display: flex; flex-direction: column; align-items: center; animation: splash-in .6s cubic-bezier(.2,.8,.2,1) both; }
.splash-logo { width: 220px; height: auto; }
.splash-tag { margin-top: 18px; font-family: var(--font-head); font-weight: 600; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: #6B6B74; text-align: center; }
.splash-bar { position: relative; width: 120px; height: 3px; margin-top: 28px; border-radius: 3px; background: #F0F0F2; overflow: hidden; }
.splash-bar i { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 3px; background: #E10A17; animation: splash-bar 1s ease-in-out infinite; }
.splash-foot { position: absolute; bottom: calc(28px + var(--safe-b)); font-size: .8rem; font-weight: 600; color: #9B9BA3; letter-spacing: .02em; }
@keyframes splash-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes splash-bar { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .splash-in, .splash-bar i { animation: none; } }

/* Animals */
.health-li .li-title { white-space: normal; line-height: 1.3; }
.health-li .li-sub { white-space: normal; }
.health-li .li-end { flex-direction: column; align-items: flex-end; gap: 6px; }

/* ───────────── Sign-in, sign-up and codes ───────────── */
.pl-logo { width: 150px; height: auto; margin: 0 auto; }
.pl-sub { margin-top: 10px; font-family: var(--font-head); font-weight: 600; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.pl-h { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.pl-p { color: rgba(255,255,255,.65); font-size: .92rem; margin-top: -8px; }
.pl-p strong { color: #fff; }
.pl-wrap > .pl-note, .pl-card .pl-note { display: block; text-align: center; background: rgba(15,157,78,.16); border: 1px solid rgba(15,157,78,.4); color: #c9f2db; border-radius: 12px; padding: 10px 14px; font-size: .86rem; margin-bottom: 14px; }
.pl-card .pl-note { margin-bottom: 0; }
.pl-note-small { display: flex; align-items: center; justify-content: center; gap: 6px; color: rgba(255,255,255,.55); font-size: .82rem; }
.pl-note-small .i { color: var(--accent); }
.pl-code { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-weight: 700; }
.pl-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; }
.pl-link { color: rgba(255,255,255,.8); font-size: .88rem; font-weight: 600; background: none; border: 0; padding: 6px 2px; text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 3px; }
.pl-foot a { color: #fff; }
.pl-card select { margin: 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; min-height: 52px; border-radius: 14px; }
.pl-card select option { color: #0B0B0C; }
.pl-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.pl-check { display: flex; gap: 10px; align-items: flex-start; color: rgba(255,255,255,.7); font-size: .85rem; line-height: 1.4; }
.pl-check input { margin-top: 2px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.pl-check a { color: #fff; }
.pl-steps { display: flex; justify-content: center; gap: 6px; margin: -10px 0 18px; }
.pl-steps i { width: 26px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); }
.pl-steps i.on { background: var(--accent); }
.pl-wrap.wide { max-width: 460px; }

/* ───────────── Billing ───────────── */
.plan-card { margin-bottom: 12px; }
.plan-card.hl { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-price strong { font-size: 1.3rem; font-family: var(--font-head); }
.plan-feats { list-style: none; display: grid; gap: 6px; margin-top: 12px; font-size: .92rem; }
.plan-feats li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feats .i { color: var(--ok); margin-top: 3px; }
.trial-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--accent-soft); color: var(--ink); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; }
.trial-bar a { font-weight: 700; white-space: nowrap; }

/* ───────────── Platform admin (/platform) ───────────── */
body.padmin { padding: 0; }
.pa-top { background: #0B0B0C; color: #fff; position: sticky; top: 0; z-index: 30; }
.pa-top-in { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.pa-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-family: var(--font-head); font-weight: 700; }
.pa-brand img { height: 30px; width: auto; }
.pa-brand span { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.25); font-size: .95rem; }
.pa-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.pa-nav a { color: rgba(255,255,255,.7); font-weight: 600; padding: 8px 12px; border-radius: 10px; font-size: .92rem; }
.pa-nav a.on, .pa-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.pa-out { margin-left: auto; }
.pa-out button { color: rgba(255,255,255,.7); font-weight: 600; font-size: .9rem; }
.pa-main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.pa-h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
.pa-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.pa-stats a.stat { color: inherit; }
.pa-stats .stat.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pa-search { display: flex; gap: 10px; margin-bottom: 14px; }
.pa-search input { flex: 1; margin: 0; }
.pa-table-wrap { padding: 0; overflow-x: auto; }
.pa-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pa-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pa-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2, #F0F0F2); vertical-align: top; }
.pa-table tbody tr { cursor: pointer; }
.pa-table tbody tr:hover { background: var(--bg); }
.pa-table a { color: var(--ink); }
.pa-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pa-grid h3 { font-size: 1.05rem; }
.pa-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.price-rows { display: grid; gap: 8px; }
.price-row { display: grid; grid-template-columns: 90px minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.price-row input { margin: 0; }
.price-row.head span { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 820px) { .pa-grid { grid-template-columns: 1fr; } .pa-out { margin-left: 0; } }
.support-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #0B0B0C; color: #fff; padding: 8px 14px; border-radius: 12px; margin-bottom: 12px; font-size: .85rem; }
.support-bar a { color: #fff; font-weight: 700; }
[hidden] { display: none !important; }
