/* ============================================================================
 * LOYALTY — styles.css — shared design system
 * Light, warm, premium. RTL-safe (logical properties). Per-restaurant accent
 * via --accent (override with inline style on <body> from brand_color).
 * ========================================================================== */

/* ---- fonts: Bricolage Grotesque (display), Hanken Grotesk (body), Cairo (arabic) ---- */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Hanken+Grotesk:wght@400;500;600;700;800&family=Cairo:wght@400;600;700;800&display=swap');

:root {
  /* palette */
  --bg:        #f6f4f0;
  --surface:   #ffffff;
  --surface-2: #fbfaf8;
  --ink:       #1b1a18;
  --ink-2:     #57534d;
  --ink-3:     #6f6a61;          /* darkened for WCAG AA on small text (was #8b857c) */
  --line:      #e8e4dd;
  --accent:    #0e7c66;          /* default; overridden per-restaurant */
  --accent-ink:#ffffff;
  --accent-soft:#e6f2ee;
  --danger:    #d64545;
  --warn:      #d98a2b;
  --ok:        #2f9e6f;
  --gold:      #c99a2e;
  /* AA-safe INK variants for tinted status pills (text on light tint) */
  --ok-ink:    #1c7a53;
  --warn-ink:  #8a5a12;
  --bad-ink:   #b02a2a;

  /* type scale — ~1.25 modular ratio (real hierarchy) */
  --fs-xs:  0.75rem;    /* 12 */
  --fs-sm:  0.875rem;   /* 14 */
  --fs-base:1rem;       /* 16 */
  --fs-lg:  1.25rem;    /* 20 */
  --fs-xl:  1.5625rem;  /* 25 */
  --fs-2xl: 1.953rem;   /* 31 */
  --fs-3xl: 2.44rem;    /* 39 */
  --fs-4xl: 3.05rem;    /* 49 */

  /* shape */
  --radius:   14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow:   0 1px 2px rgba(20,18,15,.04), 0 8px 24px rgba(20,18,15,.06);
  --shadow-lg:0 12px 40px rgba(20,18,15,.12);
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* author display rules must never resurrect [hidden] elements */
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Hanken Grotesk', 'Cairo', system-ui, sans-serif;
  font-size: var(--fs-base); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
:lang(ar), [dir="rtl"] { font-family: 'Cairo', 'Hanken Grotesk', system-ui, sans-serif; }

h1,h2,h3,h4 { line-height: 1.15; margin: 0 0 .4em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p  { margin: 0 0 1rem; color: var(--ink-2); }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.num { font-family: 'Bricolage Grotesque', 'Hanken Grotesk', sans-serif; font-feature-settings: 'tnum'; }
.muted { color: var(--ink-3); }
.foot-link { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.foot-link:hover { color: var(--accent); }
.small { font-size: var(--fs-sm); }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); }

/* ---- layout ---- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.center { text-align: center; }
.hide { display: none !important; }

/* ---- nav ---- */
.nav { position: sticky; top: 0; z-index: 40; background: rgba(246,244,240,.85);
  backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between;
  height: 60px; }
.brand { font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.02em;
  display: flex; align-items: center; gap: 9px; color: var(--ink); }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: var(--fs-sm); cursor: pointer;
  padding: 11px 18px; min-height: 44px; border-radius: 999px; border: 1px solid transparent;
  background: var(--surface); color: var(--ink); border-color: var(--line);
  touch-action: manipulation;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 15px 26px; font-size: var(--fs-base); }
.btn-sm { padding: 8px 13px; font-size: var(--fs-xs); }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* wallet buttons — official-feel: black Apple, white bordered Google; ≥48px tap */
.btn-wallet { display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: #000; color: #fff; border: none; padding: 13px 20px; min-height: 50px;
  font: inherit; font-weight: 700; font-size: var(--fs-sm); border-radius: 12px;
  cursor: pointer; touch-action: manipulation; transition: transform .08s ease, filter .15s ease; }
.btn-wallet:hover { filter: brightness(1.15); }
.btn-wallet:active { transform: scale(.98); }
.btn-wallet.google { background: #fff; color: #3c4043; border: 1px solid var(--line); }
.btn-wallet.google:hover { filter: none; background: #f8f9fa; }
.btn-wallet svg { flex: none; }

/* ---- cards / surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-tight { padding: 14px 16px; }
.section { padding: 40px 0; }

/* ---- loyalty card face (the star) ---- */
.loyalty-card { position: relative; border-radius: var(--radius-lg); padding: 22px;
  color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
  box-shadow: var(--shadow-lg); overflow: hidden; }
.loyalty-card::after { content: ''; position: absolute; inset-block-start: -40%;
  inset-inline-end: -10%; width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,.10); }
.lc-top { display: flex; justify-content: space-between; align-items: flex-start;
  position: relative; z-index: 1; }
.lc-shop { font-weight: 800; font-size: var(--fs-lg); }
.lc-sub { opacity: .8; font-size: var(--fs-sm); }
.lc-count { font-family: 'Bricolage Grotesque', 'Hanken Grotesk', sans-serif; font-size: var(--fs-4xl);
  font-weight: 700; line-height: 1; margin-top: 14px; position: relative; z-index: 1; }
.lc-count small { font-size: var(--fs-lg); opacity: .8; }
.lc-progress { position: relative; z-index: 1; margin-top: 16px; height: 8px;
  border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; }
.lc-progress > span { display: block; width: 100%; height: 100%; background: #fff;
  border-radius: 999px; transform-origin: inline-start; transform: scaleX(var(--p, 0));
  transition: transform .4s ease; }
.lc-ready { position: relative; z-index: 1; margin-top: 14px; font-weight: 800;
  background: #fff; color: var(--accent); display: inline-block; padding: 6px 14px;
  border-radius: 999px; font-size: var(--fs-sm); }
/* stamp dots variant */
.stamps { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; position: relative; z-index: 1; }
.stamp { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55);
  display: grid; place-items: center; font-size: var(--fs-sm); }
.stamp.on { background: #fff; color: var(--accent); border-color: #fff; font-weight: 800; }

/* ---- stat tiles ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; }
.stat .k { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3); }
.stat .v { font-family: 'Bricolage Grotesque', 'Hanken Grotesk', sans-serif; font-size: var(--fs-2xl); font-weight: 700;
  margin-top: 4px; }
.stat.feature { background: var(--accent); color: #fff; border-color: transparent; }
.stat.feature .k { color: rgba(255,255,255,.85); }

/* ---- forms ---- */
label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; font-size: var(--fs-base);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.field + .field { margin-top: 14px; }
.help { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 5px; }

/* ---- pills / badges ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs);
  font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-2); }
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, #fff); color: var(--ok-ink);
  border-color: color-mix(in srgb, var(--ok) 34%, #fff); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, #fff); color: var(--warn-ink);
  border-color: color-mix(in srgb, var(--warn) 36%, #fff); }
.pill.bad { background: color-mix(in srgb, var(--danger) 14%, #fff); color: var(--bad-ink);
  border-color: color-mix(in srgb, var(--danger) 32%, #fff); }

/* ---- table ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th { text-align: start; font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: none; }
.tbl-card { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }

/* ---- tabs ---- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px;
  overflow-x: auto; }
.tab { padding: 12px 16px; min-height: 44px; font-weight: 700; font-size: var(--fs-sm); color: var(--ink-3);
  cursor: pointer; border: none; background: none; border-bottom: 3px solid transparent;
  white-space: nowrap; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- modal ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,18,15,.45); z-index: 100;
  display: grid; place-items: center; padding: 20px; animation: modalBgIn .18s ease-out; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 24px;
  max-width: 460px; width: 100%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto;
  animation: modalIn .22s cubic-bezier(.22,1,.36,1); }
@keyframes modalBgIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.modal-close { float: inline-end; background: none; border: none; font-size: var(--fs-xl);
  cursor: pointer; color: var(--ink-3); line-height: 1; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 999px; margin: -6px -6px 0 0; }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }

/* ---- toast ---- */
#toast { position: fixed; inset-block-end: 22px; inset-inline: 0; display: flex;
  justify-content: center; z-index: 200; pointer-events: none; }
#toast .t { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: var(--fs-sm); box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* ---- hero (enroll landing) ---- */
.hero { padding: 48px 0 28px; text-align: center; }
.hero h1 { font-size: var(--fs-3xl); }
.hero .lead { font-size: var(--fs-lg); color: var(--ink-2); max-width: 540px; margin-inline: auto; }

/* ---- lang switch ---- */
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; background: var(--surface); }
.lang-switch button { border: none; background: none; padding: 7px 14px; min-height: 40px;
  min-width: 44px; font-weight: 700; font-size: var(--fs-sm); cursor: pointer; color: var(--ink-3); }
.lang-switch button.on { background: var(--accent); color: #fff; }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 48px;
  color: var(--ink-3); font-size: var(--fs-sm); }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---- empty state ---- */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty h3 { color: var(--ink); }

/* ============================================================================
 * PHASE C — a11y (focus, skip link), states (loading, offline), pitch motion.
 * ========================================================================== */

/* ---- keyboard focus rings (:focus-visible so mouse clicks don't show them) ---- */
.btn:focus-visible, .tab:focus-visible, .lang-switch button:focus-visible,
.modal-close:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: inherit;
}
/* wallet buttons sit on black/blue — need a light ring to be visible */
.btn-wallet:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- skip link (real class, logical props so RTL works) ---- */
.skip-link { position: absolute; inset-inline-start: -9999px; inset-block-start: 0;
  z-index: 300; background: var(--surface); color: var(--ink); font-weight: 700;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) 0; }
.skip-link:focus { inset-inline-start: 0; }

/* ---- loading skeleton (shimmer; killed by reduced-motion below) ---- */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2);
  border-radius: var(--radius-sm); color: transparent !important; }
.skeleton::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.stat.skeleton { min-height: 74px; }
.load-row td { text-align: center; color: var(--ink-3); }

/* ---- button busy state (spinner; static dots under reduced-motion) ---- */
.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after { content: ''; position: absolute; width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  color: var(--accent-ink); animation: spin .7s linear infinite; }
.btn-primary.is-loading::after, .btn-danger.is-loading::after { color: #fff; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ---- offline banner + persistent inline status (staff till) ---- */
.offline-banner { display: flex; align-items: center; gap: 8px; justify-content: center;
  background: color-mix(in srgb, var(--warn) 16%, #fff); color: var(--warn-ink);
  border-block-end: 1px solid color-mix(in srgb, var(--warn) 34%, #fff);
  font-weight: 700; font-size: var(--fs-sm); padding: 8px 14px; }
.status-line { display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 11px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: var(--fs-sm);
  margin-top: 12px; }
.status-line.ok  { background: color-mix(in srgb, var(--ok) 14%, #fff); color: var(--ok-ink); }
.status-line.bad { background: color-mix(in srgb, var(--danger) 12%, #fff); color: var(--bad-ink); }

/* ---- horizontal-scroll wrapper for tables on narrow tills ---- */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-scroll .tbl { min-width: 460px; }

/* ---- demo badge ---- */
.demo-badge { background: var(--gold); color: #fff; border-color: transparent; }

/* ---- armed (two-tap confirm) destructive button ---- */
.btn-danger.is-armed { background: #a81f1f;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 35%, #fff); }

/* ---- field-level validation ---- */
input.invalid, select.invalid { border-color: var(--danger);
  outline: 2px solid color-mix(in srgb, var(--danger) 40%, #fff); outline-offset: 0; }

/* ============================================================================
 * PITCH MOTION — the loyalty card is "the star". Make stamps land + rewards pop.
 * All guarded by prefers-reduced-motion (block at the very end of this file).
 * ========================================================================== */
.stamp { transition: transform .2s ease, background .2s ease; }
.stamp.stamp-new { animation: stampPop .4s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes stampPop {
  0%   { transform: scale(0) rotate(-24deg); opacity: 0; }
  60%  { transform: scale(1.25) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.lc-ready { animation: rewardPop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes rewardPop {
  0%   { transform: scale(.6); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
/* whole-card celebration pulse (added briefly on reward unlock) */
.loyalty-card.celebrate { animation: cardCelebrate .7s ease; }
@keyframes cardCelebrate {
  0%,100% { transform: scale(1); filter: brightness(1); }
  35%     { transform: scale(1.03); filter: brightness(1.12); }
}
/* confetti burst (spans injected then removed) */
.confetti { position: absolute; inset-block-start: 40%; inset-inline-start: 50%;
  width: 8px; height: 8px; border-radius: 2px; z-index: 2; pointer-events: none;
  animation: confettiFall .9s ease-out forwards; }
@keyframes confettiFall {
  0%   { transform: translate(0,0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* ---- card-face polish: inset light border + soft second sheen ---- */
.loyalty-card { box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,.14); }
.loyalty-card::before { content: ''; position: absolute; inset-block-start: -30%;
  inset-inline-start: -20%; width: 60%; height: 120%; z-index: 0;
  background: linear-gradient(115deg, rgba(255,255,255,.16), transparent 60%);
  pointer-events: none; }

/* ---- Arabic typography: Latin tracking (± either way) breaks joined Arabic script ---- */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4,
[dir="rtl"] .brand, [dir="rtl"] .eyebrow, [dir="rtl"] .stat .k, [dir="rtl"] .tbl th,
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) h4, :lang(ar) .eyebrow {
  letter-spacing: 0;
}

/* ---- responsive ---- */
@media (max-width: 720px) {
  h1 { font-size: var(--fs-2xl); }
  .hero { padding: 32px 0 20px; }
  .lc-count { font-size: var(--fs-3xl); }
  .row-between { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .btn:hover, .btn:active { transform: none; }
  .skeleton::after { display: none; }
  .btn.is-loading::after { animation: none; border-top-color: currentColor; opacity: .6; }
}

/* ============================================================================
 * PAGE: staff.html — till ergonomics (scoped to .page-staff)
 * Fat targets, distinct active-card zone, unmissable two-tap redeem arming,
 * icon+text status pills, hairline section rhythm. Consumes existing tokens.
 * ========================================================================== */

/* primary actions: ≥48px tall everywhere in the action zone */
.page-staff .btn-lg { min-height: 48px; }

/* the stamp button is THE button — biggest target, instant pressed feedback */
.page-staff #btnStamp { min-height: 60px; font-size: var(--fs-lg); }
.page-staff #btnStamp:active,
.page-staff #btnAmount:active,
.page-staff #btnRedeem:active { transform: scale(.98); }
.page-staff #btnAmount { min-height: 52px; }
.page-staff #btnRedeem { min-height: 52px; margin-block-start: 10px; }

/* find card compacts once a card is active — keeps find→act vertically tight */
.page-staff #findCard.is-compact { padding: 14px 16px; }
.page-staff #findCard.is-compact #findSub,
.page-staff #findCard.is-compact #findHelp { display: none; }
.page-staff #findCard.is-compact #findTitle { font-size: var(--fs-base); margin-bottom: 8px; }

/* active-card panel: visually distinct from the find card (accent-mixed 1px
   border + tinted top surface behind the kicker) */
.page-staff .active-panel {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--accent) 7%, transparent);
}
.page-staff .active-panel .eyebrow { display: block; margin-block-end: 8px; }
.page-staff .active-cust { margin-block-end: 12px; }
.page-staff .cust-name { font-weight: 800; font-size: var(--fs-lg); }
.page-staff #balancePill { font-weight: 800; font-size: var(--fs-sm); padding: 6px 14px;
  font-variant-numeric: tabular-nums; }

/* hairline section rhythm inside the panel: identity / earn / redeem */
.page-staff .earn-zone { border-block-start: 1px solid var(--line);
  padding-block-start: 16px; }
.page-staff .redeem-zone { margin-block-start: 14px; padding-block-start: 14px;
  border-block-start: 1px solid var(--line); }
.page-staff .reward-pill { font-size: var(--fs-sm); padding: 6px 14px; }
.page-staff .reward-pill svg { flex: none; }
.page-staff .redeem-zone .help { margin-block-start: 8px; }

/* two-tap redeem arming: label swaps in JS; here the button goes darker and
   pulses its ring so the armed state is unmissable at arm's length */
.page-staff .btn-danger.is-armed {
  background: #a81f1f;
  animation: staffArmPulse 1.1s ease-in-out infinite;
}
@keyframes staffArmPulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 45%, #fff); }
  50%      { box-shadow: 0 0 0 9px color-mix(in srgb, var(--danger) 18%, #fff); }
}

/* status pills/banner are icon+text (never color-only) — keep icons snug */
.page-staff #pendingPill svg,
.page-staff .offline-banner svg { flex: none; }

@media (prefers-reduced-motion: reduce) {
  /* armed state stays unmissable without motion: heavy static ring */
  .page-staff .btn-danger.is-armed { animation: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 50%, #fff),
                0 0 0 7px color-mix(in srgb, var(--danger) 22%, #fff); }
}


/* ============================================================================
 * PAGE — dashboard.html (scoped: .page-dashboard) — scanability pass.
 * Section rhythm, tab affordance, weekly-visits chart, sign-up kit, tables.
 * Consumes the shared system (skeleton, empty, pills, btn) — no new tokens.
 * ========================================================================== */

/* ---- section rhythm: 24px between blocks inside a pane, 40px page bottom ---- */
.page-dashboard main { padding-block: 24px 40px; }
.page-dashboard main > section > * + * { margin-block-start: 24px; }

/* ---- tabs: hover/focus affordance on top of the shared .tab ---- */
.page-dashboard .tab { border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color .15s ease, background .15s ease; }
.page-dashboard .tab:hover { color: var(--ink); background: var(--surface-2); }
.page-dashboard .tab.active:hover { color: var(--accent); background: transparent; }

/* ---- retention-bars loading skeleton (three bar-height lines) ---- */
.page-dashboard .rb-skel { height: 32px; }
.page-dashboard .rb-skel + .rb-skel { margin-block-start: 12px; }

/* ---- weekly-visits chart: gridlines on --line, tnum labels, hover/focus ---- */
.page-dashboard .wk-skel { height: 112px; }
.page-dashboard .wk-chart { display: flex; align-items: flex-end; gap: 6px;
  position: relative; border-block-end: 1px solid var(--line); }
.page-dashboard .wk-chart::before,
.page-dashboard .wk-chart::after { content: ''; position: absolute; inset-inline: 0;
  border-block-start: 1px dashed var(--line); pointer-events: none; z-index: 0; }
.page-dashboard .wk-col { position: relative; z-index: 1; }  /* bars paint above gridlines */
.page-dashboard .wk-chart::before { inset-block-end: 42px; }  /* mid gridline */
.page-dashboard .wk-chart::after  { inset-block-end: 84px; }  /* max gridline */
.page-dashboard .wk-col { flex: 1; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; gap: 4px;
  border-radius: var(--radius-sm); cursor: default; }
.page-dashboard .wk-val { font-size: var(--fs-xs); color: var(--ink-3); }
.page-dashboard .wk-bar { width: 100%; background: var(--accent);
  border-start-start-radius: 5px; border-start-end-radius: 5px;
  opacity: .8; transition: opacity .15s ease; }
.page-dashboard .wk-col:hover .wk-bar,
.page-dashboard .wk-col:focus-visible .wk-bar { opacity: 1; }
.page-dashboard .wk-col:hover .wk-val,
.page-dashboard .wk-col:focus-visible .wk-val { color: var(--ink); font-weight: 700; }
.page-dashboard .wk-cap { margin-block-start: 8px; }

/* ---- flagged-bills heading: icon + text (no color-only signal) ---- */
.page-dashboard .fraud-h { display: flex; align-items: center; gap: 7px;
  color: var(--warn-ink); }
.page-dashboard .fraud-h svg { flex: none; }

/* ---- sign-up kit: composed as a kit — QR preview + actions in a row ---- */
.page-dashboard .kit { display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap; margin-block-start: 16px; }
.page-dashboard .kit-qr { flex: none; width: 132px; height: 132px; padding: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-3); display: grid; place-items: center; }
.page-dashboard .kit-qr img { display: block; width: 116px; height: 116px; }
.page-dashboard .kit-qr-skel { width: 116px; height: 116px; }
.page-dashboard .kit-body { flex: 1; min-inline-size: 240px; }
.page-dashboard .kit-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-dashboard .kit-actions .btn svg { flex: none; }
.page-dashboard #joinUrlLine { margin-block-start: 10px; word-break: break-all; }

/* ---- tables: hover rows + sticky header once the card scrolls ---- */
.page-dashboard .tbl-scroll { max-block-size: 65vh; overflow: auto; }
.page-dashboard .tbl thead th { position: sticky; inset-block-start: 0; z-index: 2;
  background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.page-dashboard .tbl tbody tr { transition: background .12s ease; }
.page-dashboard .tbl tbody tr:not(.load-row):hover { background: var(--surface-2); }

/* ============================================================================
 * ADMIN (page-scoped: .page-admin) — density + truth.
 * Compact stat row (no hero-metric tile), icon+text status pills, grouped
 * create-modal fieldsets, tight table rows with hover, swatch alignment.
 * ========================================================================== */

/* product-scale page title (h1 ≤ --fs-2xl on product surfaces) */
.page-admin main h1 { font-size: var(--fs-2xl); }

/* ---- compact stat row: label + value on one baseline, no hero tile ---- */
.page-admin .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.page-admin .stat { display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 2px 10px; padding: 10px 14px; }
.page-admin .stat .v { font-size: var(--fs-lg); margin-block-start: 0; }
.page-admin .stat.skeleton { min-height: 44px; }

/* ---- status pills: icon + text, never colour-only ---- */
.page-admin .pill svg { flex: none; }

/* ---- table density + row hover (data rows only, not empty/error rows) ---- */
.page-admin .tbl td { padding-block: 9px; }
.page-admin #rows tr:hover > td:not([colspan]) { background: var(--surface-2); }

/* ---- tenant cell: swatch optically aligned with the name block ---- */
.page-admin .tenant-cell { display: flex; align-items: center; gap: 10px; }
.page-admin .tenant-name { font-weight: 700; line-height: 1.35; }
.page-admin .tenant-sub { line-height: 1.35; }
.page-admin .swatch { inline-size: 20px; block-size: 20px; border-radius: 6px; flex: none;
  border: 1px solid var(--line); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.page-admin .row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---- create modal: grouped fields (identity / rule / reward) ---- */
.page-admin .fgroup { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.page-admin .fgroup + .fgroup { margin-block-start: 18px; padding-block-start: 14px;
  border-block-start: 1px solid var(--line); }
.page-admin .fgroup-title { display: block; padding: 0; margin-block-end: 10px;
  font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); letter-spacing: 0; }

/* ============================================================================
 * LOGIN — page-scoped polish (trust + calm)
 * View crossfade, inline field errors, warn confirmation notice, info demo
 * pill, onboarding welcome grouping. Consumes system tokens only.
 * ========================================================================== */

/* view crossfade — class-driven, ≤200ms; the global reduced-motion block
   (animation:none) makes it an instant swap */
.login-view.view-in { animation: loginViewIn .18s cubic-bezier(.22,1,.36,1); }
@keyframes loginViewIn { from { opacity: 0; transform: translateY(4px); } }

/* inline field errors — .field.invalid set on blur, cleared on input */
.login-view .field.invalid label { color: var(--bad-ink); }
.login-view .field.invalid input { border-color: var(--danger); }
.login-view .field-err { font-size: var(--fs-xs); font-weight: 600;
  color: var(--bad-ink); margin-block: 5px 0; margin-inline: 0; }

/* unconfirmed-email / check-your-inbox notice as a warn status line */
#viewNotice .status-line.warn { margin-block: 0 14px; justify-content: flex-start;
  background: color-mix(in srgb, var(--warn) 16%, #fff); color: var(--warn-ink); }
#viewNotice .status-line svg { flex: none; }

/* demo notice — informational (accent-soft), not a warning */
#demoNotice { border-color: color-mix(in srgb, var(--accent) 20%, var(--line)); }
#demoNotice .pill { background: var(--accent-soft); color: var(--ink-2);
  border-color: color-mix(in srgb, var(--accent) 30%, #fff); }
#demoNotice .pill svg { color: var(--accent); flex: none; }

/* onboarding — welcome header + grouped fields + the one primary CTA */
#viewOnboard .ob-welcome { display: flex; align-items: center; gap: 12px;
  margin-block-end: 16px; }
#viewOnboard .ob-icon { flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); display: grid;
  place-items: center; }
#viewOnboard .ob-welcome h2 { font-size: var(--fs-lg); margin: 0; }
#viewOnboard .ob-welcome p { margin-block: 2px 0; margin-inline: 0; }
#viewOnboard .ob-group { background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px; }
#viewOnboard .ob-group input, #viewOnboard .ob-group select { background: var(--surface); }

/* ============================================================================
 * PAGE-SCOPED — tent.html (A6 table-tent print page)
 * Moved out of the page's former inline <style> block; print fidelity fixed:
 * the old card was 105mm wide × 148mm+ tall INSIDE 6mm page margins, i.e. it
 * could never fit A6 (93×136mm printable) and spilled to a second page. The
 * card now sizes to the printable area, exact color reproduction is forced,
 * and the QR keeps a 4mm quiet zone at a 34mm printed size (30mm scan floor).
 * Screen preview shows a dashed trim guide + size note.
 * All rules are scoped to tent-only hooks (.tent-*, body.tent-page).
 * ========================================================================== */

.tent-toolbar { max-width: 560px; margin: 20px auto 0; padding-inline: 16px;
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tent-toolbar .btn svg { flex: none; }
[dir="rtl"] .tent-arrow { transform: scaleX(-1); }

/* screen preview stage: dashed line = trim edge (hidden in print) */
.tent-stage { width: fit-content; margin: 30px auto 0;
  outline: 2px dashed color-mix(in srgb, var(--ink-3) 55%, transparent);
  outline-offset: 10px; border-radius: 8px; }
.tent-trim-note { text-align: center; font-size: var(--fs-xs); color: var(--ink-3);
  margin: 28px auto 8px; padding-inline: 16px; max-width: 60ch; }
.tent-trim-note .ar { display: block; letter-spacing: 0; margin-block-start: 2px; }

/* A6 tent card (105 × 148 mm). Bilingual, centred, print-optimised. */
.tent { width: 105mm; min-height: 148mm; margin: 0 auto; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  padding: 12mm 8mm; text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* bilingual halves: EN in the brand display face, AR in Cairo directly under it,
   sized to read as equals (Cairo runs visually larger per pt, so AR steps down).
   Sizes are pt (print-first) and budgeted so a 3-line EN name + AR + reward +
   URL still totals <= 134mm inside the 136mm A6 printable height. */
.tent-shop { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 20pt; line-height: 1.12; color: var(--ink); text-wrap: balance; }
.tent-shop .ar { display: block; font-family: 'Cairo', sans-serif; font-weight: 700;
  font-size: 14pt; letter-spacing: 0; color: var(--ink-2); margin-block-start: 1mm; }
.tent-cta { font-weight: 800; font-size: 14pt; line-height: 1.2; color: var(--accent);
  margin-block: 2.5mm 2mm; }
.tent-cta .ar { display: block; font-family: 'Cairo', sans-serif; font-weight: 700;
  font-size: 12pt; letter-spacing: 0; margin-block-start: 0.5mm; }

/* QR: 42mm box − 4mm white padding = 34mm of code (scan floor is 30mm) and the
   padding IS the quiet zone — keep it white, keep nothing inside it */
.tent-qr { width: 42mm; height: 42mm; display: grid; place-items: center;
  background: #fff; padding: 4mm; border-radius: 6px; margin-inline: auto; }
.tent-qr svg, .tent-qr canvas, .tent-qr img { width: 100%; height: 100%; }

.tent-reward { margin-block-start: 2mm; font-weight: 700; font-size: 10.5pt;
  line-height: 1.25; color: var(--ink); }
.tent-reward .ar { display: block; font-family: 'Cairo', sans-serif;
  letter-spacing: 0; color: var(--ink-2); font-size: 9pt; margin-block-start: 0.5mm; }
.tent-reward-icon { display: inline-block; width: 14px; vertical-align: -2px;
  margin-inline-end: 5px; color: var(--accent); }
.tent-reward-icon svg { display: block; width: 100%; height: auto; }

.tent-url { margin-block-start: 2mm; font-size: 7.5pt; line-height: 1.4;
  color: var(--ink-3); word-break: break-all; }
.tent-foot { margin-block-start: 2mm; font-size: 7pt; line-height: 1.4;
  color: var(--ink-3); }

/* on a phone screen, let the tent shrink to fit (print still uses A6 below) */
@media screen and (max-width: 460px) {
  .tent-stage { width: auto; margin-inline: 20px; }
  .tent { width: 100%; min-height: auto; padding: 24px 18px; }
}

/* print: A6 sheet, 6mm margins → 93 × 136 mm printable. The card is a fixed
   93mm column (max-width caps it if a browser ignores @page and prints with
   fatter dialog margins), so on A4 it stays tent-sized and cuttable; chrome
   (border/shadow/guides/toast) is stripped.
   NOTE: this is a NAMED page bound via `page: tent` on the card — an unnamed
   top-level @page in this shared stylesheet would force A6 on every OTHER
   page of the app, and @page nested inside @media is ignored by Chromium.
   Named, it only fires where a `.tent` element exists — i.e. tent.html.
   Browsers without named-page support fall back to the paper picked in the
   print dialog; the 93mm column prints correctly on A6 and A4 alike. */
@page tent { size: A6; margin: 6mm; }
.tent { page: tent; }
@media print {
  .tent-toolbar, .tent-trim-note, .tent-page .no-print,
  .tent-page #toast { display: none !important; }
  body.tent-page { background: #fff; }
  .tent-stage { width: auto; margin: 0; outline: none; border-radius: 0; }
  .tent { width: 93mm; max-width: 100%; min-height: 120mm; margin: 0 auto;
    padding: 5mm 6mm; border: none; box-shadow: none; border-radius: 0;
    break-inside: avoid; }
}

/* ============================================================================
 * MARKETING SITE — landing (index.html), rich footer, public nav, legal pages.
 * Scroll-reveal is JS-gated (body.reveal-ready) so content is fully visible
 * with no JS / reduced motion / headless. All motion respects the global
 * prefers-reduced-motion block above (its !important transitions win).
 * ========================================================================== */

/* public marketing nav links */
.lp-navlinks { display: flex; align-items: center; gap: 4px; }
.lp-navlinks a { color: var(--ink-2); font-weight: 600; font-size: var(--fs-sm);
  padding: 8px 12px; border-radius: 999px; }
.lp-navlinks a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
@media (max-width: 800px) { .lp-navlinks { display: none; } }

/* hero */
.lp-hero { padding-block: clamp(40px, 8vw, 88px) clamp(32px, 6vw, 64px); }
.lp-hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px);
  align-items: center; }
@media (max-width: 860px) { .lp-hero-grid { grid-template-columns: 1fr; } }
.lp-hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.04; letter-spacing: -.03em;
  text-wrap: balance; margin-block-end: 18px; }
.lp-hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--ink-2);
  max-width: 42ch; margin-block-end: 26px; }
.lp-cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.lp-note { margin-block-start: 16px; font-size: var(--fs-sm); color: var(--ink-3);
  display: flex; align-items: center; gap: 8px; }
.lp-note svg { flex: none; color: var(--ok); }

/* hero visual: floating loyalty card + halo */
.lp-hero-visual { position: relative; display: grid; place-items: center; min-height: 300px; }
.lp-hero-visual::before { content: ''; position: absolute; inset: 8% 4%;
  background: radial-gradient(60% 60% at 50% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(8px); z-index: 0; }
.lp-hero-visual .loyalty-card { position: relative; z-index: 1; width: min(360px, 92%);
  transform: rotate(-3deg); box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,.14); }
body.reveal-ready .lp-hero-visual .loyalty-card { animation: lpFloat 6s ease-in-out infinite; }
@keyframes lpFloat { 0%,100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-2deg) translateY(-10px); } }

/* section scaffold */
.lp-section { padding-block: clamp(48px, 8vw, 96px); }
.lp-section-head { max-width: 640px; margin-inline: auto; text-align: center; margin-block-end: 48px; }
.lp-section-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -.02em; text-wrap: balance; }
.lp-section-head p { font-size: var(--fs-lg); color: var(--ink-2); }
.lp-alt { background: var(--surface-2); border-block: 1px solid var(--line); }

/* how it works — 3 steps */
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 760px) { .lp-steps { grid-template-columns: 1fr; } }
.lp-step { text-align: center; padding: 8px; }
.lp-step-n { width: 46px; height: 46px; margin-inline: auto; margin-block-end: 16px;
  display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-weight: 800; font-family: 'Bricolage Grotesque', sans-serif;
  font-size: var(--fs-lg); }
.lp-step h3 { font-size: var(--fs-lg); margin-block-end: 6px; }
.lp-step p { color: var(--ink-2); font-size: var(--fs-sm); max-width: 30ch; margin-inline: auto; }

/* features grid */
.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.lp-feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: transform .2s var(--ease-out, ease), box-shadow .2s ease; }
.lp-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lp-feature-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-block-end: 14px; }
.lp-feature h3 { font-size: var(--fs-base); font-weight: 700; margin-block-end: 6px; }
.lp-feature p { color: var(--ink-2); font-size: var(--fs-sm); margin: 0; }

/* pricing / for restaurants */
.lp-price { max-width: 520px; margin-inline: auto; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 44px); box-shadow: var(--shadow); }
.lp-price .amt { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.4rem); line-height: 1; letter-spacing: -.02em; }
.lp-price .amt small { font-size: var(--fs-lg); color: var(--ink-3); font-weight: 600; }
.lp-price ul { list-style: none; padding: 0; margin: 22px 0; text-align: start; display: grid; gap: 10px; }
.lp-price li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: var(--fs-sm); }
.lp-price li svg { flex: none; color: var(--ok); margin-block-start: 1px; }

/* FAQ */
.lp-faq { max-width: 720px; margin-inline: auto; display: grid; gap: 12px; }
.lp-faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; }
.lp-faq-q { width: 100%; text-align: start; background: none; border: none; cursor: pointer;
  padding: 18px 20px; font: inherit; font-weight: 700; font-size: var(--fs-base); color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lp-faq-q svg { flex: none; transition: transform .2s var(--ease-out, ease); color: var(--ink-3); }
.lp-faq-item.open .lp-faq-q svg { transform: rotate(180deg); }
.lp-faq-a { max-height: 0; overflow: hidden; transition: max-height .28s var(--ease-out, ease); }
.lp-faq-item.open .lp-faq-a { max-height: 320px; }
.lp-faq-a p { padding: 0 20px 18px; margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }

/* final CTA band */
.lp-cta { text-align: center; }
.lp-cta-card { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, #000));
  color: #fff; border-radius: var(--radius-lg); padding: clamp(36px, 6vw, 64px); position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg); }
.lp-cta-card::after { content: ''; position: absolute; inset-block-start: -50%; inset-inline-end: -10%;
  width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.10); }
.lp-cta-card h2 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); position: relative; z-index: 1; }
.lp-cta-card p { color: rgba(255,255,255,.88); position: relative; z-index: 1; max-width: 46ch; margin-inline: auto; }
.lp-cta-card .btn { position: relative; z-index: 1; margin-block-start: 22px; background: #fff; color: var(--accent); }
.lp-cta-card .btn:hover { filter: brightness(.97); }

/* rich footer (public marketing pages) */
.lp-footer { background: var(--ink); color: #fff; padding-block: 56px 28px; margin-block-start: 0; }
.lp-footer .wrap { display: block; }
.lp-foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 760px) { .lp-foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.lp-foot-brand .brand { color: #fff; }
.lp-foot-brand p { color: rgba(255,255,255,.6); font-size: var(--fs-sm); margin-block-start: 12px; max-width: 32ch; }
.lp-foot-col h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.5); margin-block-end: 14px; }
.lp-foot-col a { display: block; color: rgba(255,255,255,.82); font-size: var(--fs-sm);
  padding-block: 6px; }
.lp-foot-col a:hover { color: #fff; text-decoration: none; }
.lp-foot-bottom { border-block-start: 1px solid rgba(255,255,255,.12); margin-block-start: 40px;
  padding-block-start: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: rgba(255,255,255,.55); font-size: var(--fs-sm); }
.lp-foot-bottom a { color: rgba(255,255,255,.7); }

/* legal / prose pages */
.prose { max-width: 760px; margin-inline: auto; padding-block: 40px; }
.prose h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-block-end: 8px; }
.prose .updated { color: var(--ink-3); font-size: var(--fs-sm); margin-block-end: 32px; }
.prose h2 { font-size: var(--fs-xl); margin-block: 32px 10px; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.7; }
.prose ul { padding-inline-start: 22px; }
.prose li { margin-block: 6px; }

/* scroll reveal — only active once JS confirms motion is OK */
body.reveal-ready .reveal { opacity: 0; transform: translateY(18px);
  transition: opacity .6s var(--ease-out, ease), transform .6s var(--ease-out, ease); }
body.reveal-ready .reveal.in { opacity: 1; transform: none; }
body.reveal-ready .reveal.d1 { transition-delay: .08s; }
body.reveal-ready .reveal.d2 { transition-delay: .16s; }
body.reveal-ready .reveal.d3 { transition-delay: .24s; }

/* ===== PAGE: enroll ===== */
/* 3-step progress (phone → code → wallet). Flex + logical props = RTL-safe. */
.enroll-steps { list-style: none; display: flex; align-items: center; gap: 6px;
  margin: 0 0 18px; padding: 0; }
.estep { display: flex; align-items: center; gap: 7px; color: var(--ink-3);
  font-size: var(--fs-xs); font-weight: 700; }
.estep-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); background: var(--surface); font-size: var(--fs-xs);
  transition: background .2s ease, border-color .2s ease, color .2s ease; }
.estep-t { display: none; }
@media (min-width: 420px) { .estep-t { display: inline; } }
.estep.on { color: var(--ink); }
.estep.on .estep-n { border-color: var(--accent); background: var(--accent); color: #fff; }
.estep.done .estep-n { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
/* connector line between steps */
.estep + .estep { flex: 1; justify-content: flex-end; }
.estep + .estep::before { content: ''; flex: 1; height: 2px; border-radius: 2px;
  background: var(--line); margin-inline: 4px; }
.estep.on + .estep::before, .estep.done + .estep::before { background: var(--line); }
.estep.done + .estep::before { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* ============================================================================
 * LANDING v2 — "dark roast & ink". Scoped ENTIRELY to body.page-home so the
 * app surfaces (light, quiet, tool-like) are untouched. Kills the cream-SaaS
 * template: espresso surface, cream ink, date-honey accent, stamp-seal motif,
 * punch-card strips, perforated dividers. Motion = stamps landing (stampPop
 * exists) — all silenced by the global reduced-motion block.
 * ========================================================================== */
body.page-home {
  --hb: #201812;            /* espresso body */
  --hb-2: #2a2018;          /* raised surface */
  --hink: #f4ead9;          /* cream ink */
  --hink-2: rgba(244,234,217,.78);
  --hink-3: rgba(244,234,217,.58);
  --honey: #d9a441;         /* date honey — landing accent */
  --hline: rgba(244,234,217,.14);
  background: var(--hb); color: var(--hink);
}
body.page-home::before { /* faint paper grain, no images: layered radials */
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(217,164,65,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(217,164,65,.05), transparent 55%);
}
body.page-home .nav { background: rgba(32,24,18,.82); border-bottom: 1px solid var(--hline); }
body.page-home .brand { color: var(--hink); }
body.page-home .brand .dot { background: var(--honey); }
body.page-home .lp-navlinks a { color: var(--hink-2); }
body.page-home .lp-navlinks a:hover { color: var(--hink); background: var(--hb-2); }
body.page-home .lang-switch { border-color: var(--hline); background: transparent; }
body.page-home .lang-switch button { color: var(--hink-3); }
body.page-home .lang-switch button.on { background: var(--honey); color: #2a1d08; }
body.page-home .btn { background: transparent; color: var(--hink); border-color: var(--hline); }
body.page-home .btn:hover { box-shadow: none; background: var(--hb-2); }
body.page-home .btn-primary { background: var(--honey); color: #2a1d08; border-color: transparent; }
body.page-home .btn-primary:hover { filter: brightness(1.08); }
body.page-home a { color: var(--honey); }
body.page-home h1, body.page-home h2, body.page-home h3 { color: var(--hink); }
body.page-home p, body.page-home .lead { color: var(--hink-2); }
body.page-home .skip-link { background: var(--hb-2); color: var(--hink); }

/* hero: huge type, seal chip instead of the tracked eyebrow */
.h2-hero { padding-block: clamp(56px, 10vw, 120px) clamp(40px, 7vw, 80px); }
.h2-hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
@media (max-width: 900px) { .h2-hero-grid { grid-template-columns: 1fr; } }
.h2-hero h1 { font-family: 'Bricolage Grotesque', 'Cairo', sans-serif;
  font-size: clamp(2.6rem, 7.2vw, 5rem); line-height: .98; letter-spacing: -.03em;
  text-wrap: balance; margin: 18px 0; font-weight: 800; }
[dir="rtl"] .h2-hero h1 { letter-spacing: 0; line-height: 1.15; }
.h2-hero .lead { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 44ch; }
.h2-kicker { display: inline-flex; align-items: center; gap: 10px; }

/* the seal — a rubber-stamp mark. Used as kicker chip, step marker, CTA slam */
.seal { display: inline-grid; place-items: center; text-align: center;
  border: 2.5px solid var(--honey); color: var(--honey); border-radius: 999px;
  padding: 7px 16px; font-weight: 800; font-size: var(--fs-sm);
  white-space: nowrap;   /* a rubber stamp never wraps */
  transform: rotate(-4deg); position: relative;
  box-shadow: inset 0 0 0 1.5px transparent, inset 0 0 14px rgba(217,164,65,.12); }
@media (max-width: 380px) { .seal { font-size: var(--fs-xs); padding: 6px 12px; } }
.seal::after { content: ''; position: absolute; inset: 3px; border: 1px solid var(--honey);
  border-radius: inherit; opacity: .45; }
.seal-lg { width: 92px; height: 92px; padding: 0; border-radius: 50%;
  font-family: 'Bricolage Grotesque', 'Cairo', sans-serif; font-size: var(--fs-2xl); }
[dir="rtl"] .seal, [dir="rtl"] .seal-lg { transform: rotate(4deg); letter-spacing: 0; }
/* stamp-in: scale from above + rotate settle, like ink hitting paper */
body.reveal-ready .stamp-in { opacity: 0; transform: scale(1.6) rotate(-10deg); }
body.reveal-ready .stamp-in.in { animation: sealSlam .45s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes sealSlam {
  0% { opacity: 0; transform: scale(1.6) rotate(-10deg); }
  60% { opacity: 1; transform: scale(.94) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(-4deg); }
}

/* hero visual: the real card component on a dark stage */
.h2-stage { position: relative; display: grid; place-items: center; min-height: 320px; }
.h2-stage::before { content: ''; position: absolute; inset: 6%;
  background: radial-gradient(55% 55% at 50% 42%, rgba(217,164,65,.16), transparent 70%); }
.h2-stage .loyalty-card { position: relative; width: min(380px, 94%); transform: rotate(-3deg); }
body.reveal-ready .h2-stage .loyalty-card { animation: lpFloat 7s ease-in-out infinite; }

/* perforated divider — the tear line of a paper punch card */
.perf { border: 0; height: 0; margin: 0; position: relative;
  border-top: 2px dashed var(--hline); }
.perf::before, .perf::after { content: ''; position: absolute; top: -11px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--hb); border: 1px solid var(--hline); }
.perf::before { inset-inline-start: -10px; }
.perf::after { inset-inline-end: -10px; }

/* sections */
.h2-section { padding-block: clamp(56px, 9vw, 110px); }
.h2-head { max-width: 720px; margin-block-end: clamp(28px, 5vw, 56px); }
.h2-head h2 { font-family: 'Bricolage Grotesque', 'Cairo', sans-serif;
  font-size: clamp(1.9rem, 4.6vw, 3rem); letter-spacing: -.02em; line-height: 1.05;
  text-wrap: balance; }
[dir="rtl"] .h2-head h2 { letter-spacing: 0; line-height: 1.25; }
.h2-head p { font-size: var(--fs-lg); color: var(--hink-3); max-width: 52ch; }

/* steps: three seals on a clothesline, not numbered circles in cards */
.h2-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 4vw, 44px); }
@media (max-width: 780px) { .h2-steps { grid-template-columns: 1fr; } }
.h2-step h3 { font-size: var(--fs-lg); margin: 14px 0 6px; }
.h2-step p { color: var(--hink-3); font-size: var(--fs-sm); max-width: 34ch; margin: 0; }

/* the punch strip — replaces the 6-card feature grid. One long loyalty card. */
.punch { border: 1px solid var(--hline); border-radius: var(--radius-lg);
  background: var(--hb-2); overflow: hidden; }
.punch-row { display: grid; grid-template-columns: 64px 1fr; align-items: center;
  gap: 6px; padding: 18px clamp(16px, 3vw, 28px); position: relative; }
.punch-row + .punch-row { border-top: 2px dashed var(--hline); }
.punch-hole { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--hline);
  display: grid; place-items: center; color: var(--hink-3); font-weight: 800;
  transition: border-color .2s ease, color .2s ease, background .2s ease; }
.punch-row.on .punch-hole { border-color: var(--honey); color: #2a1d08; background: var(--honey); }
.punch-row h3 { display: inline; font-size: var(--fs-base); margin: 0; }
.punch-row p { display: inline; color: var(--hink-3); font-size: var(--fs-sm); margin: 0; }
.punch-row .sep { color: var(--hink-3); opacity: .5; margin-inline: 8px; }
@media (max-width: 560px) { .punch-row h3, .punch-row p { display: block; } .punch-row .sep { display: none; } }

/* price: a till receipt, not a SaaS card */
.receipt { max-width: 460px; margin-inline: auto; background: var(--hink); color: #241b12;
  border-radius: 6px; padding: clamp(24px, 4vw, 36px);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  -webkit-mask: radial-gradient(circle at 8px 100%, transparent 7px, #000 8px) -8px 0 / 16px 100% repeat-x,
    linear-gradient(#000, #000) 0 0 / 100% calc(100% - 8px) no-repeat; 
  mask: radial-gradient(circle at 8px 100%, transparent 7px, #000 8px) -8px 0 / 16px 100% repeat-x,
    linear-gradient(#000, #000) 0 0 / 100% calc(100% - 8px) no-repeat; }
.receipt h3 { color: #241b12; font-size: var(--fs-base); letter-spacing: .04em; text-transform: uppercase; }
[dir="rtl"] .receipt h3 { letter-spacing: 0; }
.receipt .amt { font-family: 'Bricolage Grotesque', 'Cairo', sans-serif; font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1; margin: 10px 0 2px; }
.receipt .amt small { font-size: var(--fs-lg); font-weight: 700; opacity: .65; }
.receipt ul { list-style: none; margin: 18px 0; padding: 0; border-top: 2px dashed rgba(36,27,18,.25); }
.receipt li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0;
  border-bottom: 2px dashed rgba(36,27,18,.18); font-size: var(--fs-sm); color: #3a2e20; }
.receipt li b { font-weight: 700; }
.receipt .btn-primary { width: 100%; margin-top: 14px; background: #241b12; color: var(--hink); }
.receipt .total { font-weight: 800; }

/* FAQ — borderless, ledger style */
body.page-home .lp-faq-item { background: transparent; border: 0; border-top: 2px dashed var(--hline); border-radius: 0; }
body.page-home .lp-faq-item:last-child { border-bottom: 2px dashed var(--hline); }
body.page-home .lp-faq-q { color: var(--hink); padding-inline: 4px; }
body.page-home .lp-faq-q svg { color: var(--hink-3); }
body.page-home .lp-faq-a p { color: var(--hink-3); padding-inline: 4px; }

/* final CTA: the big slam */
.h2-cta { text-align: center; padding-block: clamp(64px, 10vw, 128px); position: relative; }
.h2-cta h2 { font-family: 'Bricolage Grotesque', 'Cairo', sans-serif;
  font-size: clamp(2rem, 5.4vw, 3.6rem); letter-spacing: -.025em; text-wrap: balance; }
[dir="rtl"] .h2-cta h2 { letter-spacing: 0; }
.h2-cta .seal-lg { margin-block-end: 22px; }

/* footer on dark: merge, don't restart */
body.page-home .lp-footer { background: transparent; border-top: 1px solid var(--hline); }

/* landing reveal default (non-stamp elements rise gently) */
body.page-home.reveal-ready .reveal { transform: translateY(14px); }

/* ============================================================================
 * DARK SHELL — shared espresso chrome for the PUBLIC pages (login, legal),
 * matching the landing. App/tool pages stay light: in the product the TENANT'S
 * brand colour is the hero, not ours. Cards inside the shell stay light paper,
 * so form content keeps its dark-on-light readability.
 * ========================================================================== */
body.dark-shell {
  --hb: #201812; --hb-2: #2a2018;
  --hink: #f4ead9; --hink-2: rgba(244,234,217,.78); --hink-3: rgba(244,234,217,.58);
  --honey: #d9a441; --hline: rgba(244,234,217,.14);
  --accent: #d9a441; --accent-ink: #2a1d08;   /* platform pages wear honey */
  background: var(--hb); color: var(--hink);
}
body.dark-shell .nav { background: rgba(32,24,18,.82); border-bottom: 1px solid var(--hline); }
body.dark-shell .brand { color: var(--hink); }
body.dark-shell .brand .dot { background: var(--honey); }
body.dark-shell .lang-switch { border-color: var(--hline); background: transparent; }
body.dark-shell .lang-switch button { color: var(--hink-3); }
body.dark-shell .lang-switch button.on { background: var(--honey); color: #2a1d08; }
body.dark-shell > main a:not(.btn), body.dark-shell .prose a { color: var(--honey); }
body.dark-shell .nav .btn { background: transparent; color: var(--hink); border-color: var(--hline); }
body.dark-shell .nav .btn:hover { background: var(--hb-2); box-shadow: none; }
body.dark-shell .nav .btn-primary { background: var(--honey); color: #2a1d08; border-color: transparent; }
body.dark-shell .eyebrow { color: var(--honey); }
body.dark-shell h1, body.dark-shell h2, body.dark-shell h3 { color: var(--hink); }
body.dark-shell .hero .lead, body.dark-shell p { color: var(--hink-2); }
body.dark-shell .muted, body.dark-shell .help { color: var(--hink-3); }
body.dark-shell .skip-link { background: var(--hb-2); color: var(--hink); }
/* light paper cards keep their own ink */
body.dark-shell .card { color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.5); border-color: transparent; }
body.dark-shell .card h1, body.dark-shell .card h2, body.dark-shell .card h3 { color: var(--ink); }
body.dark-shell .card p { color: var(--ink-2); }
body.dark-shell .card .muted, body.dark-shell .card .help { color: var(--ink-3); }
body.dark-shell .card a:not(.btn) { color: var(--accent-ink); text-decoration: underline; }
/* legal prose sits directly on the espresso */
body.dark-shell .prose h1, body.dark-shell .prose h2 { color: var(--hink); }
body.dark-shell .prose p, body.dark-shell .prose li { color: var(--hink-2); }
body.dark-shell .prose .updated { color: var(--hink-3); }
body.dark-shell .footer { border-top: 1px solid var(--hline); color: var(--hink-3); }
body.dark-shell .foot-link { color: var(--hink-3); }
body.dark-shell .lp-footer { background: transparent; border-top: 1px solid var(--hline); }
