/* unifyaccess web app (unifyaccess.ca/login): Get the app, and a store's Shop in a browser. Mobile first. */
:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-alt: #ecf1ee;
  --border: #e0e7e3;
  --text: #0f1a15;
  --muted: #5b6b64;
  --green: #12b76a;
  --green-deep: #0b7a47;
  --green-soft: #dff5ea;
  --lime: #d4f65c;
  --danger: #e5484d;
  --warning: #b7791f;
  --grad: linear-gradient(135deg, #17c77a, #0b8f55);
  --night: #07130e;
  --forest: #0c2a1d;
  --radius: 20px;
  --shadow: 0 12px 32px rgba(12, 42, 29, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0; letter-spacing: -0.02em; }
a { color: var(--green-deep); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ─── Brand ─────────────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.brand img { border-radius: 9px; }
.wordmark { font-weight: 800; font-size: 20px; letter-spacing: -0.04em; }
.wordmark span { color: var(--green); }
.brand.light { color: #fff; }

/* ─── Controls ──────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.field small { font-weight: 500; }
input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* no zoom on iPhone */
}
textarea {
  width: 100%; min-height: 92px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; line-height: 1.4; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
.code-input { font-size: 26px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 20px; border-radius: 18px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(18, 183, 106, 0.25); }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-danger { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); margin-top: 24px; }
.btn-ghost { background: transparent; color: var(--muted); margin-top: 8px; }
.btn-block { width: 100%; }
.link { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: var(--green-deep); cursor: pointer; }
.form-error { color: var(--danger); font-size: 14px; margin: 0 0 12px; }
.form-ok { color: var(--green-deep); font-size: 14px; margin: 0 0 12px; }
.note { background: var(--green-soft); border-radius: 16px; padding: 14px 16px; font-size: 14px; margin: 16px 0; }
.note p { margin: 4px 0 0; }
.note.warn { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); }
.iab-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ─── Boot ──────────────────────────────────────────────────────────────── */
.boot { min-height: calc(100vh - var(--banner-h, 0px)); display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--green-soft); border-top-color: var(--green); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Signed-out / onboarding cards ─────────────────────────────────────── */
.auth {
  min-height: calc(100vh - var(--banner-h, 0px));
  display: grid;
  place-items: start center;
  padding: 24px 16px 48px;
  background:
    radial-gradient(60% 40% at 0% 0%, rgba(23, 199, 122, 0.16), transparent 70%),
    radial-gradient(50% 40% at 100% 100%, rgba(212, 246, 92, 0.22), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  margin-top: min(6vh, 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
}
.auth-card.wide { max-width: 520px; }
.auth-card > .brand, .auth-card > .row-between { margin-bottom: 22px; }
.step { font-size: 13px; font-weight: 700; color: var(--green-deep); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.06em; }

.captures { display: grid; gap: 12px; margin: 18px 0; }
.capture { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px dashed var(--border); border-radius: 18px; cursor: pointer; }
.capture:hover { border-color: var(--green); }
.capture.done { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.capture-img { width: 76px; height: 76px; border-radius: 14px; background: var(--surface-alt); display: grid; place-items: center; overflow: hidden; }
.capture-img img { width: 100%; height: 100%; object-fit: cover; }
.capture-icon { font-size: 30px; }
.capture-text { display: grid; gap: 2px; }
.capture-text small { color: var(--muted); font-size: 13px; }
.stripe-box { min-height: 120px; margin: 18px 0; }

/* ─── App shell ─────────────────────────────────────────────────────────── */
.app { min-height: calc(100vh - var(--banner-h, 0px)); }

/* Get the app (phones): Google Play on Android, the App Store on iPhone. */
.install-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border); color: var(--text);
}
.install-icon { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.install-text strong { font-size: 14px; }
.install-text small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.install-go {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 14px; border: none; border-radius: 999px;
  background: var(--grad); color: #fff; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.install-go svg { width: 16px; height: 16px; background: #fff; border-radius: 50%; padding: 2px; }
.install-close { flex: none; width: 32px; height: 32px; border: none; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }

/* Free shipping at the store: a slim bar across the top, in the store's colour (darkened for white text). */
.promo-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 14px;
  padding: 8px 16px; background: color-mix(in srgb, var(--green-deep) 88%, #000); color: #fff;
  font-size: 14px; font-weight: 600; line-height: 1.35; text-align: center;
}
.promo-banner-dates { white-space: nowrap; }
.promo-banner-go { color: #fff; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.promo-banner-go:hover { text-decoration-thickness: 2px; }
.appbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; }
.tabs a.on { background: var(--green-soft); color: var(--green-deep); }
.tabs .ico { font-size: 16px; }
.page { max-width: 560px; margin: 0 auto; padding: 20px 16px 120px; }
.greet { margin: 4px 0 0; }

/* Phones: tabs become a bottom bar, like the app. */
@media (max-width: 720px) {
  /* backdrop-filter would make the header the containing block of the fixed tab bar. */
  .appbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .appbar .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    margin: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around; gap: 0;
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .tabs a { flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 10px; min-width: 64px; }
  .tabs .ico { font-size: 20px; }
}

.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; }
.avatar.big { width: 88px; height: 88px; font-size: 36px; margin: 0 auto 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 18px; padding: 6px 12px; border-radius: 999px; border: none; background: var(--surface-alt); font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }

/* ─── Membership card ───────────────────────────────────────────────────── */
.member-card {
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(212, 246, 92, 0.18), transparent 60%),
    var(--card-grad, linear-gradient(160deg, #0f5c3a, #0b3d27 60%, #0c2a1d));
  color: #fff; border-radius: 28px; padding: 20px; box-shadow: 0 20px 40px rgba(11, 61, 39, 0.3);
}
.member-card .wordmark span { color: #46d98f; }
.badge { background: var(--lime); color: var(--night); font-weight: 800; font-size: 12px; letter-spacing: 0.08em; padding: 5px 10px; border-radius: 999px; }
.qr { display: block; margin: 18px auto 10px; padding: 14px; background: #fff; border: none; border-radius: 20px; cursor: zoom-in; width: min(260px, 70vw); aspect-ratio: 1; }
.qr span, .qr-big span { display: block; width: 100%; height: 100%; }
.qr svg, .qr-big svg { width: 100%; height: 100%; display: block; }
.qr-status { text-align: center; font-size: 13px; opacity: 0.8; margin: 0 0 16px; min-height: 20px; }
.member-meta { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; }
.member-meta small { display: block; font-size: 11px; letter-spacing: 0.1em; opacity: 0.7; }
.member-meta strong { font-size: 18px; }
.member-meta .right { text-align: right; }
.qr-dialog { padding: 0; border: none; background: transparent; }
.qr-dialog::backdrop { background: rgba(5, 12, 9, 0.85); }
.qr-big { display: grid; gap: 12px; background: none; border: none; color: #fff; cursor: zoom-out; }
.qr-big span { width: min(86vw, 520px); aspect-ratio: 1; background: #fff; border-radius: 24px; padding: 18px; }
.qr-big small { text-align: center; opacity: 0.8; }

/* ─── Door ──────────────────────────────────────────────────────────────── */
.unlock-wrap { display: grid; place-items: center; padding: 26px 0 12px; }
.unlock {
  position: relative; width: 210px; height: 210px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle, rgba(18, 183, 106, 0.18), rgba(18, 183, 106, 0.04) 70%);
  display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none;
}
.unlock-inner { position: relative; z-index: 1; width: 150px; height: 150px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-content: center; gap: 6px; font-weight: 700; font-size: 14px; box-shadow: 0 16px 36px rgba(18, 183, 106, 0.35); }
.lock { font-size: 36px; }
.unlock-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--p, 0) * 1turn), transparent 0); mask: radial-gradient(circle, transparent 66%, #000 67%); -webkit-mask: radial-gradient(circle, transparent 66%, #000 67%); }
.unlock.busy .unlock-inner { opacity: 0.7; }
.unlock.ok .unlock-inner { background: linear-gradient(135deg, #46d98f, #12b76a); }
.door-status { text-align: center; font-weight: 700; min-height: 24px; margin: 0 0 8px; }
.door-status.error { color: var(--danger); }
.door-status.ok { color: var(--green-deep); }
.card-link { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; text-decoration: none; color: var(--text); }
.card-link small { display: block; color: var(--muted); font-size: 13px; }
.card-link > span:first-child { width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); display: grid; place-items: center; font-size: 20px; }

/* ─── Lists ─────────────────────────────────────────────────────────────── */
.list { display: grid; gap: 10px; margin: 16px 0; }
.purchase { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; font: inherit; color: var(--text); cursor: pointer; width: 100%; }
.purchase:hover { border-color: var(--green); }
.purchase strong { font-size: 16px; }
.purchase .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.purchase small { color: var(--muted); font-size: 13px; grid-column: 1 / -1; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 40px; display: block; margin-bottom: 8px; }
.store-row { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); font: inherit; color: var(--text); cursor: pointer; width: 100%; }
.store-row small { color: var(--muted); }
.store-row.on { border-color: var(--green); background: var(--green-soft); }

/* ─── Profile ───────────────────────────────────────────────────────────── */
.profile-head { text-align: center; padding: 8px 0 12px; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 2px 0; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); margin: 22px 4px 8px; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 15px 16px; background: none; border: none; border-top: 1px solid var(--border); font: inherit; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
.group > .row:first-child { border-top: none; }
div.row { cursor: default; grid-template-columns: auto 1fr; }
.row .value { color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pref-row { grid-template-columns: 1fr auto; }
.pref-text { display: grid; gap: 2px; }
.pref-text b { font-weight: 600; }
.pref-text small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.pref-note { margin: 8px 4px 0; }
.danger-link { color: var(--danger); }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; padding: 0; border-radius: 999px; border: none; background: var(--border); position: relative; cursor: pointer; transition: background 0.2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: 0.5; cursor: default; }
.switch:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; box-shadow: none; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill.green { background: var(--green-soft); color: var(--green-deep); }
.pill.amber { background: color-mix(in srgb, var(--warning) 16%, var(--surface)); color: var(--warning); }
.pill.red { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }

/* ─── Dialogs ───────────────────────────────────────────────────────────── */
dialog { width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: none; border-radius: 24px; padding: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(5, 12, 9, 0.5); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dialog-actions .btn { height: 46px; }
.receipt { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 10px; }
.receipt td { padding: 7px 0; border-bottom: 1px dashed var(--border); vertical-align: top; }
.receipt td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt tr.voided td { color: var(--muted); text-decoration: line-through; }
.receipt tr.total td { font-weight: 800; border-bottom: none; padding-top: 12px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 30; max-width: calc(100vw - 32px); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow); }

@media (min-width: 721px) {
  .page { padding-bottom: 60px; }
  .toast { bottom: 28px; }
  .auth-card { padding: 34px 32px; }
}

/* ─── New-system notice and app badges (signed-out pages) ───────────────── */
.auth-notice {
  width: 100%;
  max-width: 440px;
  margin-top: min(4vh, 32px);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--forest);
  color: #e6f4ec;
  box-shadow: var(--shadow);
}
.auth-notice svg { flex: none; width: 22px; height: 22px; color: var(--lime); margin-top: 1px; }
.auth-notice p { margin: 0; font-size: 15px; line-height: 1.45; }
.auth-notice strong { color: #fff; }
.auth-notice + .auth-card { margin-top: 14px; }
.app-badges { width: 100%; max-width: 440px; margin-top: 22px; text-align: center; }
.app-badges p { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 168px;
  padding: 8px 16px 8px 12px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  text-align: left;
  text-decoration: none;
}
a.store-badge:hover { background: #1a1f1c; }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge span { display: flex; flex-direction: column; font-size: 18px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.store-badge small { font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; color: #c9d4ce; text-transform: uppercase; }
#auth { align-content: start; }
@media (max-width: 420px) {
  .store-badge { min-width: 0; gap: 8px; padding: 7px 12px 7px 9px; }
  .store-badge svg { width: 22px; height: 22px; }
  .store-badge span { font-size: 15.5px; }
  .store-badge small { font-size: 9px; }
}

/* ─── Store branding (a store's own look: services/branding.js on the server) ─── */
.brand img.store-logo { border-radius: 9px; object-fit: contain; background: #fff; }
.store-search { margin: 4px 0 12px; }
.store-list { display: grid; gap: 8px; margin-top: 8px; }
.store-pick { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.store-pick:hover, .store-pick:focus-visible { border-color: var(--green); }
.store-pick img, .store-pick .initial { width: 48px; height: 48px; border-radius: 12px; object-fit: contain; background: #fff; }
.store-pick .initial { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px; background: var(--pick, #0b7a47); }
.store-pick strong { display: block; }
.store-pick small { color: var(--muted); }
.store-pick .go { color: var(--muted); font-size: 20px; }
.change-store { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.powered { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

.brand .store-initial { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--green); color: #fff; font-weight: 800; font-size: 17px; }

/* ─── Shop: preorders from the home store (services/shop.js on the server) ─── */
.page.wide { max-width: 920px; }
.btn-small { height: 40px; padding: 0 14px; border-radius: 14px; font-size: 14px; }
.shop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shop-head h1 { margin-bottom: 2px; }
.shop-head p { margin: 0; }
.shop-head .btn { flex: none; margin-top: 2px; }
.shop-pickup { margin: 10px 0 0; color: var(--muted); }
.shop-pickup strong { color: var(--text); }
.shop-shipping { margin: 10px 0 0; color: var(--muted); }
.shop-shipping strong { color: var(--text); }
.shop-pickup + .shop-shipping { margin-top: 4px; }
/* Free shipping until a date: highlighted. Every order is a preorder: a quiet info line. */
.shop-promo { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; margin: 12px 0 0; padding: 7px 14px; border-radius: 999px; background: var(--green-soft); color: var(--green-deep); font-size: 14px; font-weight: 700; }
/* The weekly order deadline: same family as the free-shipping pill, outlined, and room to wrap. */
/* The weekly shipment: a card right under the Shop's title, with the store's colour down the side. */
.shipment-notice {
  margin: 14px 0 12px; padding: 14px 16px 14px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--green) 30%, var(--border)); border-left: 5px solid var(--green);
  box-shadow: 0 6px 18px rgba(12, 42, 29, 0.05);
}
.shipment-head { display: block; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; color: var(--text); }
.shipment-body { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
[data-browse-shipment] .shipment-notice { margin: 10px 0 14px; }
.shop-closes { margin: 2px 0 0; }
.nowrap { white-space: nowrap; }
.shop-expected { margin: 10px 0 0; }
.shop-done .shop-expected { margin-top: 8px; color: var(--text); }
.order-expected { color: var(--green-deep); font-size: 13px; font-weight: 600; }
.shop-notice { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; color: var(--muted); line-height: 1.45; }
.shop-pickup + .shop-notice, .shop-shipping + .shop-notice { margin-top: 4px; }
.notice-ico { flex: none; display: inline-flex; margin-top: 2px; color: var(--green-deep); }
.notice-ico svg { width: 16px; height: 16px; }
.shop-dialog .shop-notice { margin: 0 0 14px; }
.shop-dialog .shop-done + .shop-notice { margin-top: 16px; }

/* Search: a full-width box above the categories (or the grid); 16px text so iPhones don't zoom. */
.shop-search { margin: 16px 0 0; }
.shop-search-box { position: relative; display: block; }
.shop-search-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--muted); pointer-events: none; }
.shop-search-ico svg { width: 20px; height: 20px; }
input.shop-search-input { -webkit-appearance: none; appearance: none; padding-left: 46px; padding-right: 12px; font-size: 16px; }
input.shop-search-input::-webkit-search-cancel-button { -webkit-appearance: searchfield-cancel-button; cursor: pointer; }
.shop-search-status { margin: 8px 4px 0; color: var(--muted); }
.shop-search-ask { font-size: 14px; }
.shop-search + .shop-cats { margin-top: 10px; }
.shop-cats.searching .shop-cat { opacity: 0.55; }
/* Categories: a row of buttons that scrolls sideways on a phone (never wraps), then a section per category. */
.shop-cats {
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  margin: 16px -16px 0; padding: 2px 16px 4px; scroll-padding-inline: 16px;
}
.shop-cats::-webkit-scrollbar { display: none; }
.shop-cat {
  flex: none; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.shop-cat:hover { border-color: var(--green); }
.shop-cat[aria-pressed="true"] { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.shop-cat:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 45%, transparent); outline-offset: 2px; }
.shop-cat-head { margin: 22px 4px 0; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; }
.shop-cat-count { color: var(--muted); font-weight: 600; }
.shop-section .shop-grid { margin-top: 10px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 16px 0 8px; }
@media (max-width: 520px) { .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.shop-item { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.shop-pic { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: var(--surface-alt); }
.shop-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-pic { color: var(--muted); font-size: 13px; font-weight: 600; }
.shop-info { flex: 1; display: grid; gap: 3px; align-content: start; padding: 10px 12px 0; min-width: 0; }
.shop-name { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.shop-desc { color: var(--muted); font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-price { font-weight: 800; font-variant-numeric: tabular-nums; }
.shop-price small { color: var(--muted); font-size: 12px; font-weight: 600; }
.shop-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; color: var(--muted); font-size: 12.5px; }
.shop-meta .pill { padding: 1px 8px; font-size: 12px; }
.shop-status { color: var(--green-deep); font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.shop-buy { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px; }
.shop-add { flex: 1 0 64px; box-shadow: none; }
.shop-item.sold-out .shop-pic { opacity: 0.5; }

.stepper { flex: 1 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 4px; height: 40px; padding: 3px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.step { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: none; border-radius: 10px; background: var(--surface-alt); color: var(--text); font: inherit; font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; }
.step:disabled { opacity: 0.35; cursor: default; }
.step-qty { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* The basket: above the bottom tab bar on phones. */
.basket-bar {
  position: fixed; left: 16px; right: 16px; bottom: 20px; z-index: 9;
  max-width: 528px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 8px 0 18px; border: none; border-radius: 18px;
  background: var(--grad); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 14px 30px rgba(12, 42, 29, 0.28);
}
.basket-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.basket-go { flex: none; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.2); }
.basket-bar.bump { animation: basket-bump 0.35s ease; }
@keyframes basket-bump { 40% { transform: scale(1.03); } }
[data-view="shop"].has-basket { padding-bottom: 76px; }
#app:has([data-view="shop"].has-basket:not([hidden])) ~ .toast { bottom: 96px; }
/* The website has no tab bar now (the Shop is its only signed-in page): the basket sits at the bottom. */
@media (max-width: 720px) {
  .basket-bar { bottom: calc(20px + env(safe-area-inset-bottom)); }
  #app:has([data-view="shop"].has-basket:not([hidden])) ~ .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
/* Five or six tabs (Shop and Points on) in a narrow desktop header. */
@media (min-width: 721px) and (max-width: 820px) {
  .tabs.crowded { gap: 0; }
  .tabs.crowded a { padding: 8px 9px; }
}
@media (min-width: 721px) and (max-width: 900px) {
  .tabs.six { gap: 0; }
  .tabs.six a { padding: 8px 7px; font-size: 14px; gap: 4px; }
}
/* Five or six tabs on a phone: let them share the width. */
@media (max-width: 420px) {
  .tabs.crowded a { min-width: 0; flex: 1 1 auto; padding: 6px 2px; }
}
@media (max-width: 720px) {
  .tabs.six a { min-width: 0; flex: 1 1 auto; padding: 6px 2px; font-size: 11.5px; }
}

/* The review */
.review-lines { margin: 2px 0 4px; }
.review-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.review-name { display: grid; min-width: 0; }
.review-name strong { overflow-wrap: break-word; line-height: 1.3; }
.review-name small { color: var(--muted); font-size: 13px; }
.review-line .stepper { flex: none; height: 36px; }
.review-line .step { width: 28px; height: 28px; }
.review-line .num { min-width: 62px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Small phones: the name on its own row, then quantity and amount. */
@media (max-width: 380px) {
  .review-line { grid-template-columns: auto minmax(0, 1fr); row-gap: 6px; }
  .review-name { grid-column: 1 / -1; }
}
.shop-nudge { margin: 10px 0 0; color: var(--green-deep); font-weight: 600; }
.shop-dialog .btn-block { margin-top: 4px; }
/* Product requests: a card under the Shop's items, and its form (a dialog like the guest checkout). */
.request-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px 14px; align-items: center;
  margin: 18px 0 8px; padding: 16px 18px; border: 1px dashed color-mix(in srgb, var(--green) 45%, var(--border)); border-radius: 18px;
  background: color-mix(in srgb, var(--green) 5%, var(--surface));
}
.request-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); font-size: 20px; }
.request-text strong { display: block; font-size: 16px; line-height: 1.3; }
.request-text p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.request-go { white-space: nowrap; }
@media (max-width: 520px) {
  .request-card { grid-template-columns: auto minmax(0, 1fr); }
  .request-go { grid-column: 1 / -1; width: 100%; }
}
.request-lead { margin: 0 0 14px; font-size: 15px; }
.request-form .field { margin-bottom: 12px; }
.request-form .field small { font-weight: 500; }
.request-form [aria-invalid="true"] { border-color: var(--danger); }
.request-trap { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.request-why { margin: 0 0 12px; line-height: 1.45; }
.request-again { margin: 12px 0 0; }
.shop-dialog .btn-block + .btn-block { margin-top: 10px; }
.shop-dialog .form-error { margin: 0 0 10px; }
.shop-done { text-align: center; padding: 6px 0 2px; }
.shop-done-tick { width: 56px; height: 56px; margin-bottom: 8px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--grad); color: #fff; font-size: 28px; font-weight: 800; }
.shop-done-title { display: block; font-size: 22px; letter-spacing: -0.02em; }
.shop-done p { margin: 6px 0 0; color: var(--muted); }

/* My preorders */
#shop-orders, .order { scroll-margin-top: 84px; }
.orders { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); align-items: start; }
.orders-empty { margin: 0 4px; }
.orders-problem { display: grid; gap: 8px; justify-items: start; margin: 0 4px; }
.orders-problem p { margin: 0; }
.order { display: grid; gap: 3px; min-width: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.order-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.order-when, .order-paid { color: var(--muted); font-size: 13px; }
.order .receipt { margin-top: 4px; font-size: 14px; }
.order.cancelled .receipt td { color: var(--muted); }
.order-cancel { justify-self: start; margin-top: 8px; color: var(--danger); }
.order.ready { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); }
.order-ready { margin: 6px 0 2px; padding: 10px 12px; border-radius: 14px; background: var(--green-soft); font-size: 14px; }
.order-ready strong { color: var(--green-deep); }
.order-ready p { margin: 2px 0 0; }
.pill.plain { background: var(--surface-alt); color: var(--text); }
.pill.solid { background: var(--green); color: #fff; padding: 4px 12px; font-size: 14px; }
.ready-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 14px 0 0; padding: 12px 16px; border-radius: 16px; background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); }
.ready-banner strong { color: var(--green-deep); }
.ready-banner small { display: block; color: var(--muted); font-size: 13px; }
.ready-icon { font-size: 22px; }

/* Preorders outside the Shop: under Transactions, and on Home while one is ready */
.preorders .section-label:first-child { margin-top: 18px; }
.preorders + .list { margin-top: 0; }
.orders-past { margin-top: 10px; }
.orders-past > summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; font-size: 14px; font-weight: 700; color: var(--green-deep); cursor: pointer; list-style: none; }
.orders-past > summary::-webkit-details-marker { display: none; }
.orders-past > summary::before { content: "›"; display: inline-block; font-size: 18px; line-height: 1; transition: transform 0.15s; }
.orders-past[open] > summary::before { transform: rotate(90deg); }
.orders-past > .orders { margin-top: 6px; }
[data-home-ready] .ready-banner { margin: 0 0 16px; }
a.ready-banner { color: inherit; text-decoration: none; }
.ready-banner.go { border: 1.5px solid var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); padding: 14px 16px; }
.ready-banner.go:hover { background: color-mix(in srgb, var(--green) 16%, var(--surface)); }
.ready-banner.go strong { font-size: 16px; line-height: 1.3; }
.ready-banner.go small { margin-top: 2px; line-height: 1.4; }
.ready-go { font-weight: 700; font-size: 14px; color: var(--green-deep); white-space: nowrap; }

/* ─── A store's Shop before signing in: the same cards, then a bar to sign in ─── */
/* The bar is sticky (not fixed), so it keeps its own room below the last row of items. */
.browse { display: flex; flex-direction: column; }
.browse .page { flex: 1 0 auto; width: 100%; padding-bottom: 28px; }
.browse-stores { margin-left: auto; font-size: 15px; text-decoration: none; }
.browse-how { margin: 0; }
.browse .powered { margin-top: 28px; }
.browse .empty .btn { margin-top: 4px; }
.shop-info:last-child { padding-bottom: 12px; } /* no buttons below */
.browse-bar {
  position: sticky; bottom: 0; z-index: 9;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -12px 30px rgba(12, 42, 29, 0.08);
}
.browse-bar-inner { max-width: 888px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.browse-bar p { flex: 1 1 260px; margin: 0; font-weight: 700; line-height: 1.35; }
.browse-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.browse-actions .btn { flex: 1 1 auto; height: 48px; padding: 0 18px; font-size: 15px; }
.browse-actions .btn-primary { box-shadow: none; }
/* A guest's basket: the member Shop's basket bar, in the bar along the bottom instead of its sign-in pitch. */
.browse-bar .basket-bar { position: static; flex: 1 1 100%; max-width: 560px; margin: 0 auto; box-shadow: none; }
#browse.has-basket .browse-bar-inner > p, #browse.has-basket .browse-actions { display: none; }
/* Guest checkout: details, then the card. */
.guest-form .field { margin-bottom: 12px; }
.guest-form input[aria-invalid="true"] { border-color: var(--danger); }
.guest-why, .guest-hold { margin: 0 0 6px; line-height: 1.45; }
.guest-form .receipt { margin: 4px 0 12px; }
.guest-card { margin: 14px 0; }
.guest-back { font-size: 14px; }
.guest-join { margin: 14px 0 0; }
@media (max-width: 720px) {
  .browse-bar p { text-align: center; font-size: 15px; }
  .browse-actions { flex: 1 1 100%; }
}

/* ─── Get the app (#/app): its store on a phone, both with QR codes on a computer ─── */
.get-app-stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px; margin: 22px 0 4px; }
.get-app-store { display: grid; justify-items: center; gap: 12px; }
.get-app-qr { width: 156px; height: 156px; padding: 12px; border: 1px solid var(--border); border-radius: 18px; background: #fff; }
.get-app-qr svg { display: block; width: 100%; height: 100%; }
.get-app .store-badge { min-width: 176px; }
.get-app-scan, .get-app-account { margin: 14px 0 0; }
/* Its badges are the page: not again below the card, or in the bar across the top. */
#auth:has([data-view="app"]:not([hidden])) .app-badges,
body:has(#auth:not([hidden]) [data-view="app"]:not([hidden])) .install-bar { display: none; }
/* Signed in, the Shop's header: Get the app and Log out in place of the tabs. */
.appbar-links { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 15px; }
.appbar-links a { text-decoration: none; }

/* Get the app and log-in pages: into a Shop. The store list: which have one. */
.browse-link { margin: 18px 0 0; }
.browse-link:hover { border-color: var(--green); }
.browse-link > span:last-child { color: var(--muted); font-size: 20px; }
.pick-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.pick-shop { padding: 1px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green-deep); font-size: 11.5px; font-weight: 700; line-height: 1.5; }

/* ─── Points & Membership: the home store's (app.js: showPoints) ─────────── */
.points-link { margin: 16px 0 0; }
.points-link:hover { border-color: var(--green); }
.points-link > span:last-child { color: var(--muted); font-size: 20px; }
.points-store { margin: 0; }
.points-card, .plan-card { margin: 16px 0 0; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; }
.points-card { box-shadow: var(--shadow); }
.points-label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }
.points-balance { margin: 2px 0 0; font-size: 18px; font-weight: 700; color: var(--muted); }
.points-balance strong { margin-right: 6px; font-size: 48px; line-height: 1.05; letter-spacing: -0.04em; color: var(--green-deep); font-variant-numeric: tabular-nums; }
.points-worth { margin: 0; font-weight: 600; }
.points-progress { height: 10px; margin: 16px 0 6px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.points-progress span { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.points-next { margin: 0; font-size: 14px; color: var(--muted); }
.points-use { margin: 14px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--green-soft); font-size: 14px; line-height: 1.45; }
.points-use strong { display: block; font-size: 16px; color: var(--green-deep); }
.points-use p { margin: 2px 0 0; }
.points-how { margin: 14px 0 0; font-size: 14px; line-height: 1.45; }
.points-rate { margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.points-rate b { color: var(--text); }
.plan-card h2 { font-size: 18px; line-height: 1.3; }
.plan-lead { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }
.plan-line { margin: 6px 0 0; font-weight: 700; }
.plan-when, .plan-perk { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.plan-card .note { margin: 12px 0; }
.plans { display: grid; gap: 10px; margin: 14px 0 12px; }
.plan { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 16px; background: var(--surface); cursor: pointer; }
.plan:hover { border-color: color-mix(in srgb, var(--green) 50%, var(--border)); }
.plan.on { border-color: var(--green); background: var(--green-soft); }
.plan input { width: 20px; height: 20px; margin: 0; padding: 0; border: none; box-shadow: none; accent-color: var(--green-deep); }
.plan input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.plan-name strong { display: block; }
.plan-name small, .plan-price small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.plan-price { display: grid; justify-items: end; gap: 2px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.plan-save { padding: 1px 8px; font-size: 12px; }
.plan-charge { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.plan-card > .btn-block + .btn-block { margin-top: 10px; }
.plan-card > a.btn-block { margin-top: 2px; }
.points-history { margin-bottom: 8px; }
.point-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 16px; border-top: 1px solid var(--border); }
.point-row:first-child { border-top: none; }
.point-what strong { display: block; font-weight: 600; }
.point-what small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.point-amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.point-amt.plus { color: var(--green-deep); }
.point-row.pending .point-amt, .point-row.pending .point-what strong { color: var(--warning); }
.points-dialog [data-body] > p { margin: 0 0 10px; line-height: 1.45; }
.points-dialog .plan-line { margin-top: 0; }
.points-dialog .btn-ghost { margin-top: 4px; }
