/* ── Waffir Premium design system (Apple-clean): deep pine, emerald primary, gold as a fine accent.
   Self-hosted Inter (Latin) + IBM Plex Sans Arabic (Arabic UI); Aref Ruqaa stays for the brand wordmark.
   All weights are woff2 under web/fonts/ (listed in sw.js so they work offline); the strict CSP has no
   font-src, so fonts fall back to default-src 'self' — self-hosting is the only way that does not break CSP. */
@font-face { font-family: Inter; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 800; font-style: normal; font-display: swap; src: url(fonts/inter-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format('woff2'); }

:root {
  /* emerald primary (reads on white and carries the primary actions, links, hero text) */
  --green: #117A4F; --green-2: #12553F; --green-soft: #E7F6EE; --ink: #111A15; --muted: #5A6660;
  --ground: #EEF0EC; --card: #FFFFFF; --line: #E3E6E1; --amber: #D9A83C; --amber-soft: #F6E7BF;
  --red: #A5321F; --red-soft: #FBE9E5; --blue: #1F4B7A; --blue-soft: #DCE6F2;
  /* premium accents: deep pine for hero grounds, the emerald pair for button gradients, gold accent */
  --pine: #0B3A2C; --pine-2: #12553F; --emer: #1F9D63; --emer-d: #117A4F; --gold: #D9A83C; --gold-l: #F0CD7C;
  --shadow: 0 18px 44px -28px rgba(11, 58, 44, 0.42); --lift: 0 12px 30px -24px rgba(11, 58, 44, 0.4);
  --soft: 0 1px 2px rgba(17, 26, 21, 0.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); }
body { font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* figures line up cleanly across money, codes, KPIs and tables */
.big, .code, .price, .owe-amount, .kpi .big, .stepcount .big, th, td, .kv, .certrow, .verify-cash, .verify-name, table { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 800; } h2 { font-size: 17px; letter-spacing: -0.01em; font-weight: 700; }
a { color: var(--green); }
.boot { margin: 40vh auto 0; text-align: center; font-size: 40px; font-weight: 700; color: var(--green); }
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
#app.wide { max-width: 1040px; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 20px 16px 24px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.end { margin-top: auto; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.bold { font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.big { font-size: 30px; font-weight: 700; line-height: 1.2; }
.price { color: var(--green); font-weight: 700; font-size: 18px; }
.strike { text-decoration: line-through; color: var(--muted); font-size: 13px; }

.hero { color: #EEFFF6; padding: 44px 24px 34px; display: flex; flex-direction: column; gap: 12px; isolation: isolate;
  background: radial-gradient(130% 100% at 12% -12%, #1A7355 0%, transparent 56%),
    radial-gradient(90% 72% at 104% 0%, rgba(217, 168, 60, 0.30) 0%, transparent 50%),
    linear-gradient(165deg, var(--pine), var(--pine-2)); }
.hero .muted { color: rgba(238, 255, 246, 0.82); font-size: 15px; }
.hero h1 { text-wrap: balance; }
@font-face { font-family: Ruqaa; font-weight: 700; font-display: swap; src: url(fonts/aref-ruqaa-arabic-700-normal.woff2) format('woff2'); }
.brand { font-family: Ruqaa, system-ui, sans-serif; font-size: 52px; font-weight: 700; line-height: 1.2; }
.boot { font-family: Ruqaa, system-ui, sans-serif; }
.sheet { flex: 1; background: var(--ground); border-radius: 28px 28px 0 0; margin-top: -20px; padding: 24px 20px;
  display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--card); border: 1px solid #EFF1ED; border-radius: 20px; box-shadow: var(--soft); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.green { color: #EAFFF5; border: 0; box-shadow: var(--shadow);
  background: radial-gradient(120% 120% at 10% -10%, #1A7355 0%, transparent 60%), linear-gradient(160deg, #17694B, var(--pine)); }
.card.green .muted { color: rgba(234, 255, 245, 0.82); }
.card.amber { background: var(--amber); box-shadow: none; }
.card.dark { background: var(--ink); color: #fff; }
.card.link { cursor: pointer; text-align: start; border: 0; width: 100%; }
.note { background: var(--green-soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.note.warn { background: var(--amber-soft); color: #4A3000; }
.note.bad { background: var(--red-soft); color: #5E1C12; }
.bar { background: var(--ink); color: #fff; font-size: 13px; padding: 10px 16px; text-align: center; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 14px;
  border: 1.5px solid var(--green); background: #fff; color: var(--green); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.primary { background: linear-gradient(180deg, var(--emer), var(--emer-d)); border-color: var(--emer-d); color: #fff;
  box-shadow: 0 12px 24px -12px rgba(31, 157, 99, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.btn.gold { background: linear-gradient(180deg, var(--gold-l), var(--gold)); color: #3A2A05; border-color: var(--gold); box-shadow: 0 10px 22px -14px rgba(217, 168, 60, 0.8); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.plain { border-color: transparent; background: transparent; min-height: 44px; }
.btn.sm { min-height: 44px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .chip:focus-visible, .nav button:focus-visible {
  outline: 3px solid var(--amber); outline-offset: 2px; }
.round { width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 24px; font-size: 24px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: #3D4A44; }
.field input, .field select, .field textarea { min-height: 50px; padding: 10px 14px; border: 1.5px solid #C9D2CC; border-radius: 12px; background: #fff; width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex: none; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid #D5DBD6; background: #fff; cursor: pointer; font-size: 14px; }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--amber-soft); white-space: nowrap; }
.badge.ok { background: #E7F6EE; color: var(--green); }
.badge.bad { background: #FBE9E5; color: #B23A26; }
.badge.gold { background: var(--amber); color: #3A2A05; }
.badge.grey { background: #ECEEE9; color: #3D4A44; }
.thumb { flex: none; width: 76px; height: 84px; border-radius: 12px; background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; }
.thumb.c-restaurant { background: var(--amber-soft); color: #7A4E00; }
.thumb.c-supermarket { background: var(--blue-soft); color: var(--blue); }
.thumb.c-sweets { background: var(--red-soft); color: var(--red); }

.code { font-size: 46px; font-weight: 800; letter-spacing: 3px; line-height: 1.2; text-align: center; direction: ltr; }
.dash { border-top: 2px dashed #C9D2CC; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.kv > :first-child { color: var(--muted); }
.card.green .kv > :first-child { color: #D5E6DD; }
.stamps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #8FBBA8; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #D5E6DD; }
.stamp.on { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.meter { display: flex; gap: 5px; }
.meter i { flex: 1; height: 10px; border-radius: 5px; background: var(--blue-soft); }
.meter i.on { background: var(--blue); }
.stars { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.star { width: 52px; height: 52px; border-radius: 26px; border: 1.5px solid #C9D2CC; background: #fff; font-size: 24px; cursor: pointer; color: #B4BDB7; }
.star.on { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.qr { width: 200px; height: 200px; align-self: center; background: #fff; border-radius: 12px; }
.receipt-img { width: 100%; max-height: 520px; object-fit: contain; border-radius: 12px; background: #ECEEE9; }

.nav { position: sticky; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav button { flex: 1; min-height: 60px; border: 0; background: transparent; font-size: 13px; color: var(--muted); cursor: pointer; }
.nav button.on { color: var(--green); font-weight: 700; box-shadow: inset 0 3px 0 var(--green); }
.tablewrap { overflow-x: auto; background: #fff; border-radius: 18px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th, td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
#toast { position: fixed; inset-inline: 16px; bottom: 84px; margin: 0 auto; max-width: 480px; padding: 14px 16px; border-radius: 14px;
  background: var(--ink); color: #fff; text-align: center; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 10; }
#toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
@media print { .nav, .btn, #toast, .bar { display: none !important; } body, html { background: #fff; } .card { box-shadow: none; border: 1px solid #C9D2CC; } .card.green { background: #fff; color: #10231C; } .card.green .muted, .card.green .kv > :first-child { color: #55635C; } }
button.note { border: 0; width: 100%; text-align: start; cursor: pointer; font: inherit; }
.nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.num { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--amber); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.logomark { flex: none; display: block; }
.chipicon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: inline-flex; align-items: center; justify-content: center; }
.stack.tight { gap: 0; align-items: flex-end; }
.hero .btn.gold { align-self: flex-start; min-width: 180px; margin-top: 6px; }
.foot { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.printonly { display: none; }
@media print { .printonly { display: block; margin-bottom: 12px; } }
.badge { color: var(--ink); }
.badge.ok { color: var(--green); } .badge.bad { color: var(--red); } .badge.grey { color: #3D4A44; }
#toast { top: 14px; bottom: auto; }
.badge.deal { background: #E4572E; color: #fff; }
/* design review fixes */
:focus-visible { outline: 3px solid var(--ink) !important; outline-offset: 2px; box-shadow: 0 0 0 2px var(--amber); }
#toast { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
.code { font-size: clamp(30px, 11vw, 46px); letter-spacing: .04em; }
.price, .big { white-space: nowrap; }
.field input, .field select, .field textarea, .chip, .star { border-color: #7C8A83; }
.star { color: #6E7A74; }
.badge.deal { background: #C7401A; color: #fff; font-size: 13px; }
.meter i { box-shadow: inset 0 0 0 1px #7C8A83; }
button.badge { border: 0; min-height: 44px; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cta { position: sticky; bottom: 0; background: var(--ground); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
[dir="rtl"] p.ltr, [dir="rtl"] span.ltr.block { text-align: right; }
h1:focus { outline: none; }
.preview { background: var(--amber-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; color: #4A3000; }
body:not(.offline) .bar { display: none; }
h1:focus-visible { outline: none !important; box-shadow: none; }
/* ── adapts by itself: small phones, phones, tablets, desktop ── */
#app { min-height: 100dvh; }
.hero { padding-top: calc(44px + env(safe-area-inset-top)); }
.screen { padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
img, svg, video { max-width: 100%; }
@media (max-width: 359px) {            /* very small phones */
  .screen { padding: 16px 12px 20px; } h1 { font-size: 21px; } .big { font-size: 25px; } .brand { font-size: 42px; }
  .grid2 { gap: 8px; } .nav button { font-size: 12px; } .thumb { width: 60px; height: 70px; } .star { width: 44px; height: 44px; }
}
@media (min-width: 700px) {            /* tablets (iPad portrait), large phones in landscape */
  #app { max-width: 760px; }
  .screen { padding: 28px 28px 32px; gap: 18px; } .sheet { padding: 32px 36px; } .hero { padding-left: 36px; padding-right: 36px; }
  h1 { font-size: 28px; }
}
@media (min-width: 1100px) {           /* iPad landscape, laptops, desktop: navigation moves to the side */
  #app, #app.wide { max-width: 1180px; }
  #app:has(> .stack > .hero) { max-width: 760px; }
  .shell { flex-direction: row; align-items: flex-start; }
  .shell > .screen { flex: 1; min-width: 0; }
  .shell > .nav { order: -1; flex: none; flex-direction: column; justify-content: flex-start; width: 220px; height: 100dvh; top: 0; bottom: auto; gap: 6px; padding: 24px 10px; border-top: 0; border-inline-end: 1px solid var(--line); }
  .shell > .nav button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 10px; font-size: 15px; box-shadow: none; }
  .shell > .nav button.on { background: var(--green-soft); box-shadow: none; }
  .shell > .bar { display: none; }
  #toast { bottom: 24px; }
}
@media (hover: hover) { .btn:hover, .chip:hover, .card.link:hover { filter: brightness(0.97); } }
.pricerow { gap: 6px 10px; }
.card.link .grow { min-width: 0; }
.nav { overflow-x: auto; scrollbar-width: none; } .nav::-webkit-scrollbar { display: none; }
.nav button { flex: 1 0 auto; min-width: 62px; padding: 0 8px; white-space: nowrap; }
html { overflow-x: hidden; } body { overflow-x: clip; }
@media (max-width: 359px) { .price { font-size: 16px; } .thumb { width: 54px; } .card { padding: 12px; } }

.joy { text-align: center; font-family: Ruqaa, system-ui, sans-serif; font-weight: 700; font-size: 22px; line-height: 1.5; color: var(--green, #0E5A43); padding: 4px 8px; }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; } .check input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--green); }
.chip.gold { border-color: var(--amber); } .chip.gold.on { background: var(--amber); color: var(--ink); }
.joy.light { color: #fff; } .code.small { font-size: 22px; letter-spacing: 3px; }
.invoice .total { border-top: 2px solid var(--green); padding-top: 10px; margin-top: 6px; }
@media print { .invoice .card.amber { border: 1px solid #C9A23A; } }
.invoice .badge { align-self: center; }

.swipe { position: relative; height: 60px; border-radius: 30px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; padding: 4px; user-select: none; -webkit-user-select: none; overflow: hidden; }
.swipe-label { font-weight: 700; font-size: 16px; padding-inline-start: 56px; pointer-events: none; }
.swipe-thumb { position: absolute; inset-inline-start: 4px; top: 4px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--amber); color: var(--ink); font-size: 22px; font-weight: 700; touch-action: none; cursor: grab; }
.swipe.busy { opacity: .6; } .swipe.busy .swipe-thumb { cursor: progress; }
@media print { .swipe { display: none; } }
.swipe { width: 100%; box-sizing: border-box; } .end > .stack { align-self: stretch; width: 100%; }

.modal-bg { position: fixed; inset: 0; background: rgba(16, 35, 28, .55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; z-index: 50; }
.modal, .modal-out { background: var(--card); border-radius: 20px; padding: 22px 20px; width: 100%; max-width: 440px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 16px; font-size: 17px; line-height: 1.7; }
.modal .row, .modal-out .row { gap: 10px; } .modal .btn, .modal-out .btn { flex: 1; }
@media (min-width: 700px) { .modal-bg { align-items: center; } }
.field textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; background: var(--card); color: var(--ink); resize: vertical; }
.note.small { font-size: 14px; }

/* design review, round two */
#toast { top: calc(12px + env(safe-area-inset-top)) !important; bottom: auto !important; }
.swipe + p { margin-top: 8px; padding-inline: 12px; }
.card.amber .muted { color: #4A3000; } .strike { font-size: 14px; }
.receipt-img { max-height: 320px; width: auto; max-width: 100%; display: block; margin-inline: auto; }
.cards > :only-child { grid-column: 1 / -1; max-width: 520px; }
th { white-space: nowrap; }

.pin { font-size: 34px; letter-spacing: 12px; text-align: center; padding: 12px; border: 2px solid var(--green); border-radius: 14px; width: 100%; box-sizing: border-box; background: var(--card); color: var(--ink); }
.swipe-label { font-size: 15px; padding-inline-end: 10px; }

/* ── partner contract: reader, signing screen, signed copy ── */
.reader { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); max-height: min(70vh, 680px); overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 22px 18px; scrollbar-gutter: stable; }
.doc { font-size: 15.5px; line-height: 2; overflow-wrap: break-word; text-align: start; }
.doc h1 { font-size: 20px; line-height: 1.6; margin: 0 0 14px; text-align: center; }
.doc h2 { font-size: 16px; color: var(--green); margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.doc h3 { font-size: 15px; margin: 16px 0 6px; }
.doc p { margin: 0 0 10px; }
.doc ol, .doc ul { margin: 0 0 10px; padding-inline-start: 24px; }
.doc li { margin-bottom: 6px; padding-inline-start: 2px; } .doc li::marker { color: var(--green); font-weight: 700; }
.doc blockquote { margin: 0 0 16px; padding: 12px 14px; background: var(--green-soft); border-radius: 12px; font-size: 14px; line-height: 1.85; } .doc blockquote p { margin: 0; }
.doc table { min-width: 0; width: 100%; font-size: 14px; line-height: 1.7; margin: 6px 0 12px; table-layout: fixed; }
.doc th, .doc td { border: 1px solid #D5DBD6; padding: 8px 10px; overflow-wrap: anywhere; vertical-align: top; white-space: normal; }
.doc th { background: var(--ground); color: var(--ink); font-weight: 600; }
.doc .d-parties, .doc .d-sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0 0 16px; }
.doc .d-party, .doc .d-sign > div { border: 1px solid #D5DBD6; border-radius: 12px; padding: 12px 14px; min-width: 0; }
.doc .d-party p, .doc .d-sign p { margin: 0 0 4px; }
.doc .d-tag { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.6; color: #fff; background: var(--green); border-radius: 20px; padding: 2px 12px; margin-bottom: 8px; }
.doc .d-box { height: 60px; border: 1px dashed #8A948E; border-radius: 8px; }
.fill { background: var(--amber-soft); border-radius: 5px; padding: 1px 6px; font-weight: 700; unicode-bidi: plaintext; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.fill.blank { background: #fff; box-shadow: inset 0 0 0 1.5px var(--amber); color: #7A4E00; font-weight: 400; }
.fill.none { background: #fff; box-shadow: inset 0 0 0 1px #C9D2CC; color: #55635C; font-weight: 400; }
.fill.pending { background: var(--green-soft); color: var(--green); font-weight: 600; font-size: 0.9em; }
.fill.unknown { background: var(--red-soft); color: var(--red); font-weight: 600; }
.summary .kv { align-items: baseline; } .summary .kv > :last-child { text-align: end; overflow-wrap: anywhere; min-width: 0; }
.hint { margin-top: -6px; } .badtext { color: var(--red); font-weight: 600; }
.sigpad { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; border: 1.5px dashed #7C8A83; border-radius: 14px; touch-action: none; cursor: crosshair;
  background: #fff linear-gradient(#C9D2CC, #C9D2CC) no-repeat 50% 78% / 84% 1.5px; }
.sigpad.off { opacity: 0.35; cursor: not-allowed; }
ul.plain { margin: 6px 0 0; padding-inline-start: 20px; } ul.plain li { margin-bottom: 4px; }
.consent .check a, .check a { font-weight: 700; }
.signed { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 24px 18px; display: flex; flex-direction: column; gap: 20px; }
.signed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 3px solid var(--green); }
.signed-head .brand { font-size: 34px; color: var(--green); }
.signed .fill { background: none; padding: 0; border-radius: 0; border-bottom: 1px dotted #8A948E; }
.signed .fill.blank, .signed .fill.none { box-shadow: none; }
.cert { border: 1.5px solid var(--green); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; break-inside: avoid; }
.cert h2 { color: var(--green); margin-bottom: 6px; }
.certrow { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 4px 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.certrow > :first-child { color: var(--muted); } .certrow > :last-child { overflow-wrap: anywhere; }
[dir="rtl"] .certrow > .ltr { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.sigimg { display: block; width: 100%; max-width: 240px; height: auto; border-bottom: 1.5px solid var(--ink); }
.sigtyped { display: inline-block; font-family: Ruqaa, system-ui, sans-serif; font-size: 28px; line-height: 1.5; padding: 0 10px; border-bottom: 1.5px solid var(--ink); }
.certcheck { margin: 12px 0 8px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.certcheck.ok { background: var(--green-soft); color: var(--green); } .certcheck.warn { background: var(--amber-soft); color: #4A3000; }
@media (max-width: 420px) { .certrow { grid-template-columns: minmax(0, 1fr); gap: 0; } .reader { padding: 18px 14px; } .signed { padding: 18px 14px; } .doc { font-size: 15px; } }
@media (min-width: 700px) { .reader, .signed { padding: 32px 36px; } .doc { font-size: 16px; } }
/* Print → Save as PDF: an A4 document without any app chrome */
@page contract { size: A4; margin: 16mm 15mm 18mm; }
@media print {
  .noprint { display: none !important; }
  #app:has(.signed) { max-width: none; }
  .screen:has(.signed) { padding: 0; } .screen:has(.signed) > .row { display: none; }
  .signed { page: contract; box-shadow: none; border-radius: 0; padding: 0; gap: 14px; }
  .signed .doc { font-size: 11.5pt; line-height: 1.85; }
  .signed .fill { border-bottom: 0; }
  .doc h2 { break-after: avoid; } .doc li, .doc .d-party, .doc .d-sign, .doc tr { break-inside: avoid; }
  .certrow { font-size: 10pt; padding: 6px 0; grid-template-columns: 34% minmax(0, 1fr); }
}

.field input.bad { border-color: var(--red); background: var(--red-soft); }
.summary .field { margin: 0; }

/* ── launch improvements: shop photo, daily ops, onboarding ── */
.thumb.photo { padding: 0; overflow: hidden; background: var(--green-soft); }
.thumb.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-hero { width: 100%; max-height: 220px; object-fit: cover; border-radius: 16px; display: block; background: var(--green-soft); }
.shop-photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: 14px; display: block; background: var(--green-soft); }
@media (max-width: 359px) { .shop-hero { max-height: 170px; } }

.ops-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.ops-alert { display: flex; align-items: center; gap: 10px; }
.ops-alert .grow { text-align: start; }
.ops-arrow { flex: none; font-weight: 700; opacity: .6; }

.intro { padding: calc(20px + env(safe-area-inset-top)) 20px calc(22px + env(safe-area-inset-bottom)); gap: 16px; }
.intro .brand { font-size: 32px; color: var(--green); }
.intro-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 8px 6px; }
.intro-art { display: flex; align-items: center; justify-content: center; min-height: 150px; }
.intro-icon { width: 138px; height: 138px; border-radius: 40px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }
.intro-stage h1 { font-size: 26px; max-width: 18ch; }
.intro-line { font-size: 16px; max-width: 30ch; }
.intro-dots { display: flex; gap: 8px; justify-content: center; padding: 4px 0; }
.intro-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background .2s; }
.intro-dot.on { background: var(--green); }
@media (prefers-reduced-motion: reduce) { .intro-dot { transition: none; } }
@media (min-width: 700px) { .intro { max-width: 560px; margin: 0 auto; } }

/* ── owner accounting: profit/loss stats and a plain CSS/div trend (no chart library) ── */
.card.ok { background: var(--green-soft); }
.card.bad { background: var(--red-soft); color: #5E1C12; }
.neg-num { color: var(--red); }
.acc-trend { display: flex; align-items: stretch; gap: 6px; height: 150px; overflow-x: auto; padding-top: 6px; }
.acc-col { flex: 1 0 22px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.acc-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.acc-bar-fill { width: 100%; min-height: 3px; background: var(--green); border-radius: 6px 6px 0 0; }
.acc-bar.neg .acc-bar-fill { background: var(--red); }
.acc-bar-lab { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── admin clarity ("übersichtlich"): section labels, the owner's "at a glance" KPI tiles, Google sign-in ── */
/* Calm section label with a small amber marker, so long admin pages read as grouped blocks. */
.sech { font-size: 15px; font-weight: 700; color: var(--green); margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.sech::before { content: ""; flex: none; width: 4px; height: 17px; border-radius: 3px; background: var(--amber); }
.ops h2 { margin-top: 4px; }
/* Owner home: one clear row of key figures. */
.ops-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: start; }
.kpi { text-align: center; gap: 4px; }
.big.pos { color: var(--green); } .big.warn { color: #B7791F; }
/* Optional "Sign in with Google" for customers (gated by config.js → googleAuth). */
.gauth { gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.google { display: inline-flex; align-items: center; justify-content: center; gap: 12px; background: #fff; color: #1F1F1F; border: 1px solid #DADCE0; box-shadow: 0 1px 2px rgba(16, 35, 28, 0.08); }
.gicon { flex: none; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.gicon .gsvg { display: block; }

/* ── merchant pass: day screen, counter, finance, reviews, shop, onboarding ──
   Reuses the admin primitives (.kpi/.ops-kpis/.sech/.big.pos/.big.warn/cards/badges).
   No new colours or fonts: only the CSS variables already defined at the top. */

/* KPI tiles that hold a money value (long with the currency word) wrap instead of overflowing. */
.kpi .big { white-space: normal; overflow-wrap: anywhere; font-size: clamp(22px, 7vw, 30px); line-height: 1.15; }
/* Today — the quantity stepper: a big, friendly "how many bags" control. */
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--green-soft); border-radius: 16px; padding: 10px 14px; }
.stepper .round { width: 56px; height: 56px; min-height: 56px; border-radius: 28px; font-size: 30px; background: #fff; }
.stepper .round.primary { background: var(--green); color: #fff; }
.stepcount { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 0; }
.stepcount .big { font-size: 40px; color: var(--green); }
.stepcount .muted { margin-top: -2px; }
/* The pickup window shown next to the status, so the owner reads it at a glance. */
.winline { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); }
.winline .bold { color: var(--ink); font-size: 16px; }
/* Today's swipe code — the counter needs it legible but calm. */
.pincard { align-items: center; text-align: center; gap: 6px; background: var(--amber-soft); }
.pincard .code { color: var(--ink); }

/* Counter (verify) — POS-grade: one big code field, one big result, one huge confirm. */
.verify-code input { min-height: 68px; font-size: clamp(30px, 10vw, 40px); font-weight: 800; text-align: center; letter-spacing: .12em; direction: ltr; }
.btn.huge { min-height: 68px; font-size: 20px; border-radius: 16px; }
.verify-result { color: #EAFFF5; border-radius: 18px; padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
  background: radial-gradient(120% 120% at 10% -10%, #1A7355 0%, transparent 60%), linear-gradient(160deg, #17694B, var(--pine)); }
.verify-result .vr-code { align-self: flex-start; }
.verify-name { font-size: 26px; font-weight: 800; line-height: 1.2; }
.verify-qty { font-size: 16px; color: #D5E6DD; }
.verify-cash { font-size: 20px; font-weight: 800; background: rgba(255,255,255,.14); border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between; gap: 12px; }
.verify-flag { background: var(--amber); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
/* The two "something's wrong" actions sit apart from the confirm, so they are not mis-tapped. */
.verify-secondary { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.verify-big-note { font-size: 18px; font-weight: 700; text-align: center; padding: 16px; }

/* Finance — the reassuring "you owe X, pay by DATE" hero. */
.owe-hero { color: #EAFFF5; border-radius: 20px; padding: 22px 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
  background: radial-gradient(120% 120% at 10% -10%, #1A7355 0%, transparent 60%), linear-gradient(160deg, #17694B, var(--pine)); }
.owe-hero.clear { background: var(--green-soft); color: var(--ink); box-shadow: none; }
.owe-hero.clear .muted, .owe-hero.clear .kv > :first-child { color: var(--muted); }
.owe-amount { font-size: 38px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.owe-hero .muted, .owe-hero .kv > :first-child { color: #D5E6DD; }
.owe-due { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; background: var(--amber); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; }
.bankline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Reviews — the rating hero and gold stars. */
.rating-hero { align-items: center; text-align: center; gap: 4px; }
.rating-hero .big { font-size: 44px; }
.starline { color: var(--amber); font-weight: 700; letter-spacing: 2px; }
[dir="rtl"] .starline { direction: ltr; unicode-bidi: isolate; }

/* Shop profile status strip. */
.shopstatus { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Onboarding — a clear two-step progress indicator. */
.steps { display: flex; align-items: center; gap: 8px; }
.steps .step { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.steps .step-bar { height: 6px; border-radius: 3px; background: var(--line); }
.steps .step.on .step-bar, .steps .step.done .step-bar { background: var(--green); }
.steps .step-lab { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.steps .step.on .step-lab { color: var(--green); font-weight: 700; }
.steps .step-num { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.steps .step.on .step-num { background: var(--green); color: #fff; }
.steps .step.done .step-num { background: var(--green); color: #fff; }
.welcome-card { color: #EAFFF5; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
  background: radial-gradient(120% 120% at 10% -10%, #1A7355 0%, transparent 60%), linear-gradient(160deg, #17694B, var(--pine)); }
.welcome-card .muted { color: rgba(234, 255, 245, 0.82); }
.welcome-card ul.plain { margin: 4px 0 0; }
.welcome-card ul.plain li { margin-bottom: 6px; }

/* ───────── Sign-in (vAuth): a warm, layered "save & rescue" scene ─────────
   Depth is pure CSS and tiny: a deep-green gradient and slow blurred colour blobs behind a
   frosted sign-in card that tilts to the pointer; the mascot illustration greets in the hero.
   Only transform/opacity animate. Under prefers-reduced-motion it settles to a clean static state. */
.auth { position: relative; overflow: hidden; gap: 0; min-height: 100dvh; color: #fff;
  background: radial-gradient(120% 90% at 50% 0%, #1A7355 0%, #12553F 42%, #0B3A2C 100%); }

/* depth layer (decorative, aria-hidden) */
.auth-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .55; will-change: transform; }
.blob.b1 { width: 300px; height: 300px; top: -60px; inset-inline-start: -70px; background: radial-gradient(circle at 30% 30%, rgba(244,183,64,.9), rgba(244,183,64,0) 70%); animation: blobdrift1 16s ease-in-out infinite; }
.blob.b2 { width: 340px; height: 340px; top: 120px; inset-inline-end: -110px; background: radial-gradient(circle at 50% 50%, rgba(90,200,150,.7), rgba(90,200,150,0) 70%); animation: blobdrift2 21s ease-in-out infinite; }
.blob.b3 { width: 260px; height: 260px; bottom: -70px; inset-inline-start: 22%; background: radial-gradient(circle at 50% 50%, rgba(244,183,64,.5), rgba(244,183,64,0) 70%); animation: blobdrift3 25s ease-in-out infinite; }

/* hero: brand seal, wordmark, welcoming headline, slogan */
.auth-hero { position: relative; z-index: 1; background: transparent; text-align: center; align-items: center;
  padding: calc(40px + env(safe-area-inset-top)) 24px 18px; gap: 6px;
  animation: authrise .7s cubic-bezier(.22,.61,.36,1) both; }
.auth-seal { display: block; filter: drop-shadow(0 10px 22px rgba(0,0,0,.28)); animation: floaty 7s ease-in-out infinite; }
.auth-brand { color: #fff; font-size: 64px; line-height: 1; margin-top: 2px;
  text-shadow: 0 1px 0 rgba(255,255,255,.22), 0 10px 26px rgba(0,0,0,.35), 0 3px 8px rgba(9,65,47,.55); }
.auth-head { color: #fff; font-size: 22px; font-weight: 700; margin: 4px 0 0; }
.auth-slogan { color: #D5E6DD; font-size: 16px; margin: 0; }

/* the elevated glass card */
.auth-card-wrap { position: relative; z-index: 1; margin-top: 6px;
  padding: 4px 16px calc(28px + env(safe-area-inset-bottom));
  animation: authrise .8s cubic-bezier(.22,.61,.36,1) .12s both; }
.auth .auth-card { flex: none; margin: 0; padding: 22px 20px; border-radius: 24px; color: var(--ink);
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 2px 6px rgba(9,65,47,.18), 0 18px 40px rgba(6,40,28,.34), inset 0 1px 0 rgba(255,255,255,.7);
  transform: perspective(900px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)); transform-style: preserve-3d;
  transition: transform .25s ease; }
.auth .auth-card .auth-tabs { justify-content: center; }

@keyframes authrise { from { opacity: 0; transform: translateY(26px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes blobdrift1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(24px, 20px); } }
@keyframes blobdrift2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 18px); } }
@keyframes blobdrift3 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, -22px); } }

@media (max-width: 359px) { .auth-brand { font-size: 52px; } .auth-head { font-size: 20px; } }
@media (min-width: 700px) { .auth-card-wrap { padding-inline: 24px; } .auth-brand { font-size: 72px; } }

@media (prefers-reduced-motion: reduce) {
  .auth-hero, .auth-card-wrap, .blob, .auth-seal { animation: none; }
  .auth .auth-card { transition: none; transform: none; }
}

/* ═══════════ Waffir Premium: grouped lists, slide-to-confirm, charts, polish ═══════════ */

/* iOS-style grouped list feel: calm hairline dividers between stacked key/value rows inside a card. */
.card > .kv + .kv, .owe-hero > .kv + .kv, .verify-cash + .kv, .signbox .kv + .kv { border-top: 1px solid #F0F0EC; padding-top: 10px; margin-top: 2px; }
.card.green > .kv + .kv, .owe-hero > .kv + .kv, .verify-result .kv + .kv { border-top-color: rgba(255, 255, 255, 0.16); }
/* Links/rows with a chevron read like iOS list rows. */
.chev { color: #C3C8C2; font-weight: 700; flex: none; }
[dir="rtl"] .chev { transform: scaleX(-1); }

/* Section labels already exist (.sech); give admin/merchant lists a touch more air. */
.sech { letter-spacing: 0.01em; }

/* ── Slide-to-confirm (counter hand-over + customer pickup) ──
   A light track, an emerald fill that trails the white knob, a centred label. Fully themeable,
   keyboard-operable (role=button + Enter/Space via a confirm dialog), with a visible focus ring. */
.swipe { position: relative; height: 62px; border-radius: 31px; background: #E9EBE7; color: var(--emer-d);
  display: flex; align-items: center; justify-content: center; padding: 4px; overflow: hidden;
  user-select: none; -webkit-user-select: none; touch-action: none; cursor: grab;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08); width: 100%; box-sizing: border-box; --sx: 0px; }
/* The fill is a full-width bar sliding inside a clipping wrapper: the drag, the settle and the completion move it with
   transform only (no width/layout animation). At rest exactly the part under the knob shows. */
.swipe-fillwrap { position: absolute; inset: 4px; border-radius: 27px; overflow: hidden; pointer-events: none; }
.swipe-fill { position: absolute; inset: 0; border-radius: 27px; background: linear-gradient(180deg, var(--emer), var(--emer-d));
  transform: translateX(calc(-100% + var(--sx) + 54px)); }
[dir="rtl"] .swipe-fill { transform: translateX(calc(100% - var(--sx) - 54px)); }
.swipe-label { position: relative; z-index: 1; font-weight: 700; font-size: 15px; color: var(--emer-d); pointer-events: none; padding-inline: 10px; }
.swipe-thumb { position: absolute; z-index: 2; top: 4px; inset-inline-start: 4px; width: 54px; height: 54px; border-radius: 50%; border: 0;
  background: #fff; color: var(--emer-d); font-size: 22px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.35); transform: translateX(var(--sx)); }
[dir="rtl"] .swipe-thumb { transform: translateX(calc(-1 * var(--sx))); }
/* settle: released early, knob and fill spring back; completed, they glide to the end and the knob confirms with a pop */
.swipe-thumb, .swipe-fill { transition: transform 0.34s cubic-bezier(.2, .9, .3, 1.12); }
.swipe-label { transition: opacity 0.2s ease; }
.swipe.dragging .swipe-thumb, .swipe.dragging .swipe-fill, .swipe.dragging .swipe-label { transition: none; }
.swipe.dragging { cursor: grabbing; }
.swipe:not(.dragging):not(.busy):not(.ok) .swipe-thumb { animation: swipe-nudge 2.6s ease-in-out 1.2s infinite; }
.swipe.busy { cursor: progress; } .swipe.busy .swipe-thumb { animation: swipe-wait 1s ease-in-out infinite; }
.swipe.ok .swipe-thumb { color: var(--emer-d); animation: swipe-pop 0.42s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes swipe-nudge { 0%, 72%, 100% { translate: 0 0; } 82% { translate: 7px 0; } 90% { translate: 0 0; } 95% { translate: 3px 0; } }
[dir="rtl"] .swipe:not(.dragging):not(.busy):not(.ok) .swipe-thumb { animation-name: swipe-nudge-rtl; }
@keyframes swipe-nudge-rtl { 0%, 72%, 100% { translate: 0 0; } 82% { translate: -7px 0; } 90% { translate: 0 0; } 95% { translate: -3px 0; } }
@keyframes swipe-wait { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes swipe-pop { 0% { scale: 1; } 45% { scale: 1.16; } 100% { scale: 1; } }
.swipe:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 2px var(--amber); }
@media (prefers-reduced-motion: reduce) { .swipe-thumb, .swipe-fill { transition: none; } }
@media print { .swipe { display: none; } }

/* ── Premium SVG charts (owner accounting): area/line trend + donut ── */
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-area { stroke: none; }
.chart-line { fill: none; stroke: var(--emer); stroke-width: 2; }
.chart-dot { fill: var(--gold); stroke: #fff; stroke-width: 2; }
.chart-axis { fill: var(--muted); font-size: 9px; }
.chart-num { fill: var(--emer-d); font-weight: 700; font-size: 9px; }
.donut-track { fill: none; stroke: var(--line); }
.donut-num { fill: var(--ink); font-weight: 700; font-size: 13px; }
.chart-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.chart-legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
.chart-legend .lg { display: flex; align-items: center; gap: 8px; }
.chart-legend .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.chart-legend .dot.a { background: var(--emer); } .chart-legend .dot.b { background: var(--gold); } .chart-legend .dot.c { background: #9AA8A0; }
.chart-legend .lv { margin-inline-start: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Stepper numerals in the big friendly "how many bags" control line up. */
.stepcount .big, .stepper b { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
/* keep the big "you owe" amount from clipping on narrow phones */
.owe-amount { font-size: clamp(28px, 9vw, 38px); overflow-wrap: anywhere; }

/* ───────── premium customer discover + personal impact (TGTG-style) ───────── */
/* Personalised greeting + round avatar */
.greet { display: flex; align-items: center; gap: 12px; }
.greet-txt { min-width: 0; }
.greet-hi { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0; }
.greet-sub { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); margin: 2px 0 0; text-wrap: balance; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff; text-transform: uppercase; border: 2px solid #fff;
  background: linear-gradient(140deg, var(--emer), var(--pine)); box-shadow: 0 8px 18px -10px rgba(17, 122, 79, .75); }
.avatar.lg { width: 48px; height: 48px; font-size: 19px; }
.avatar-btn { flex: none; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 50%; }
.avatar-btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
@media (max-width: 359px) { .greet-sub { font-size: 20px; } }

/* Premium search field: a magnifier tucked inside (data-URI icon, no extra DOM) */
.field input.searchbar { background-repeat: no-repeat; background-size: 20px 20px; padding-inline-start: 44px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6660' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>"); }
[dir="rtl"] .field input.searchbar { background-position: right 14px center; }
[dir="ltr"] .field input.searchbar { background-position: left 14px center; }

/* Category / filter pills carry an icon */
.chip { display: inline-flex; align-items: center; gap: 7px; }
.chip svg { flex: none; }
.chip.on svg { stroke: #fff; }
.chip.gold.on svg { stroke: var(--ink); }

/* Offer card (image-forward) – see "Customer home" below */
.rating-badge { flex: none; display: inline-flex; align-items: center; gap: 4px; background: var(--amber-soft); color: #7A4E00;
  font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 9px; }
.rating-badge svg { fill: var(--gold); stroke: var(--gold); }
.pick-chip { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; background: var(--green-soft); color: var(--green-2);
  font-weight: 700; font-size: 12.5px; padding: 5px 10px; border-radius: 10px; margin-top: 2px; }
.pick-chip svg { flex: none; stroke: var(--green); }
.stack.tightish { gap: 4px; } .stack.tightest { gap: 0; }
.badge.urgent { display: inline-flex; align-items: center; gap: 5px; background: var(--red-soft); color: #B23A26; }
.badge.urgent svg { flex: none; fill: #C7401A; stroke: #C7401A; }
.deal-tag { background: linear-gradient(180deg, var(--gold-l), var(--gold)); color: #3A2A05; font-weight: 800; font-size: 12.5px;
  padding: 6px 12px; border-radius: 12px; box-shadow: 0 10px 20px -10px rgba(217, 168, 60, .85); }

/* Personal impact / savings tiles */
.impact-card h2 { margin-bottom: 2px; }
.impact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.impact-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 8px; border-radius: 16px; background: var(--green-soft); }
.impact-tile.money { background: var(--amber-soft); } .impact-tile.co2 { background: var(--blue-soft); }
.impact-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .62); }
.impact-ic svg { stroke: var(--green); }
.impact-tile.money .impact-ic svg { stroke: #7A4E00; } .impact-tile.co2 .impact-ic svg { stroke: var(--blue); }
.impact-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: center; }
.impact-num { font-size: 17px; font-weight: 800; line-height: 1.15; overflow-wrap: break-word; }
.impact-lab { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
/* the home teaser: one compact strip – two figures, a hairline between them, a chevron */
.impact.teaser { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; text-align: start; width: 100%; }
.impact.teaser .impact-tile { flex: 1 1 0; min-width: 0; flex-direction: row; align-items: center; text-align: start; gap: 8px; padding: 0; border-radius: 0; background: transparent; }
.impact.teaser .impact-tile + .impact-tile { border-inline-start: 1px solid var(--line); padding-inline-start: 10px; }
.impact.teaser .impact-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--green-soft); }
.impact.teaser .impact-tile.money .impact-ic { background: var(--amber-soft); }
.impact.teaser .impact-txt { align-items: flex-start; gap: 0; }
.impact.teaser .impact-num { font-size: 16px; white-space: nowrap; }
.impact-fig { display: block; max-width: 100%; } .impact-unit { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.impact.teaser .impact-lab { font-size: 11px; line-height: 1.3; }
.impact.teaser .impact-tile.money { flex-grow: 1.7; }
.impact.teaser .impact-txt { min-width: 0; }
.impact.teaser .impact-lab { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chev-ic { flex: none; display: inline-flex; color: #A9B2AC; } [dir="rtl"] .chev-ic { transform: scaleX(-1); }
.impact-zero { align-items: center; gap: 8px; }
.impact-zero .big-ic { width: 54px; height: 54px; border-radius: 16px; background: var(--green-soft); display: inline-flex; align-items: center; justify-content: center; }
.impact-zero .big-ic svg { stroke: var(--green); }

/* Glassmorphism bottom nav (solid fallback where backdrop-filter is unsupported, for legibility) */
.nav { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid rgba(227, 230, 225, .8); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .nav { background: #fff; } }
.nav { z-index: 5; }   /* content scrolling underneath (badges, tiles) never paints over the bar */

/* ═══════════ Customer home: header band, circular categories, image-forward offer cards ═══════════ */
/* visually hidden, still read by screen readers (the home screen's <h1>, quiet labels) */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.screen { --pad: 16px; }

/* Header band: deep-green gradient with rounded bottom corners; location line, greeting, search. */
.screen.has-band { padding-top: 0; }
.band { position: relative; isolation: isolate; margin-inline: calc(-1 * var(--pad)); padding: calc(12px + env(safe-area-inset-top)) var(--pad) 22px;
  border-radius: 0 0 28px 28px; color: #fff; display: flex; flex-direction: column; gap: 14px;
  background: radial-gradient(130% 100% at 12% -12%, #1A7355 0%, transparent 56%),
    radial-gradient(90% 72% at 104% 0%, rgba(217, 168, 60, 0.30) 0%, transparent 50%),
    linear-gradient(165deg, var(--pine), var(--pine-2));
  box-shadow: 0 18px 36px -26px rgba(11, 58, 44, 0.75); }
.band-top { display: flex; align-items: center; gap: 10px; }
.loc { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 2px 0; border: 0; background: transparent;
  color: #fff; text-align: start; cursor: pointer; border-radius: 12px; }
.loc > svg { flex: none; } .loc > svg:first-child { color: var(--gold-l); }
.loc.live > svg:first-child { fill: var(--gold-l); stroke: var(--pine); }
.loc > svg:last-child { opacity: 0.7; }
.loc-col { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.loc-cap { font-size: 11.5px; color: rgba(255, 255, 255, 0.72); }
.loc-txt { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc:disabled { opacity: 0.7; }
.band .stamps-chip { flex: none; min-height: 38px; padding: 0 12px; font-size: 12.5px; color: #fff; background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 0 0 1px rgba(240, 205, 124, 0.6); }
.band .avatar { width: 40px; height: 40px; font-size: 17px; border-color: var(--gold-l); background: rgba(255, 255, 255, 0.14); box-shadow: none; }
.band .greet-hi { color: rgba(255, 255, 255, 0.8); }
.band .greet-sub { color: #fff; font-size: 23px; }
.band .field > span, .sortsel > span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.band .field { position: relative; }
.band .field input.searchbar { min-height: 52px; border: 0; border-radius: 16px; color: var(--ink); box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.55); }
.band .loc:focus-visible, .band .stamps-chip:focus-visible, .band .avatar-btn:focus-visible { outline-color: #fff !important; }

.home { gap: 14px; }
/* Circular category buttons: gold ring, tinted disc, inline icon, label underneath; scrolls sideways edge to edge. */
.cats { display: flex; gap: 4px; overflow-x: auto; margin-inline: calc(-1 * var(--pad)); padding: 6px calc(var(--pad) - 4px) 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 76px; padding: 4px 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 7px; scroll-snap-align: start; }
.cat-ring { position: relative; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; color: var(--green);
  border: 2.5px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(140deg, var(--gold-l), var(--gold) 55%, #B8862B) border-box;
  box-shadow: 0 10px 18px -14px rgba(11, 58, 44, 0.6); transition: transform 0.24s cubic-bezier(.3, 1.35, .5, 1); }
.cat-ring::before, .cat-ring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; }
.cat-ring::before { background: var(--green-soft); }
.cat-ring::after { background: linear-gradient(160deg, var(--emer), var(--pine)); opacity: 0; transition: opacity 0.2s ease; }
.cat-ring svg { position: relative; z-index: 1; }
.cat.c-restaurant .cat-ring { color: #7A4E00; } .cat.c-restaurant .cat-ring::before { background: var(--amber-soft); }
.cat.c-sweets .cat-ring { color: var(--red); } .cat.c-sweets .cat-ring::before { background: var(--red-soft); }
.cat.c-supermarket .cat-ring { color: var(--blue); } .cat.c-supermarket .cat-ring::before { background: var(--blue-soft); }
.cat.gold .cat-ring::before { background: var(--amber-soft); } .cat.gold .cat-ring { color: #7A4E00; }
.cat.on .cat-ring { color: #fff; transform: scale(1.06); }
.cat.on .cat-ring::after { opacity: 1; }
.cat-lab { font-size: 12.5px; line-height: 1.25; text-align: center; color: #3D4A44; }
.cat.on .cat-lab { color: var(--green); font-weight: 700; }

/* Section heading for the offers; the sort and the count/updated line stay visually quiet. */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; min-width: 0; }
.sec-ic { flex: none; display: inline-flex; } .sec-ic svg { fill: var(--gold); stroke: #B8862B; }
.field.sortsel { flex: none; position: relative; }
.field.sortsel select { width: auto; max-width: 150px; min-height: 40px; padding: 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.sec-info { display: flex; justify-content: space-between; gap: 10px; margin-top: -8px; font-size: 12px; color: var(--muted); }

/* The offers grid: one column on very small phones, two from 360px, more on tablets and desktop. */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: stretch; }
@media (min-width: 360px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card.offer { position: relative; isolation: isolate; padding: 0; gap: 0; overflow: hidden; border-radius: 20px; box-shadow: var(--soft), 0 16px 30px -26px rgba(11, 58, 44, 0.55); }
.offer-media { position: relative; width: 100%; aspect-ratio: 4 / 3; flex: none; }
.cards > .offer:only-child .offer-media { aspect-ratio: 16 / 9; }
.offer-media .thumb { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
/* no photo: a clean tinted tile with the category icon (never a drawn illustration) */
.offer-media .thumb:not(.photo) { background-image: radial-gradient(120% 95% at 14% 0%, rgba(255, 255, 255, 0.8), transparent 62%); }
.offer-media .thumb:not(.photo) svg { stroke-width: 1.5; opacity: 0.92; }
.thumb.photo img { opacity: 0; transition: opacity 0.3s ease; } .thumb.photo img.in { opacity: 1; }
.offer-media .badge, .offer-media .deal-tag, .offer-media .rating-badge { position: absolute; z-index: 1; }
.offer-left { top: 8px; inset-inline-start: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 3px 9px; box-shadow: 0 6px 12px -8px rgba(0, 0, 0, 0.45); }
.offer-media .rating-badge { top: 8px; inset-inline-end: 8px; font-size: 12px; padding: 2px 7px; background: rgba(255, 255, 255, 0.94); color: var(--ink); box-shadow: 0 6px 12px -8px rgba(0, 0, 0, 0.45); }
.offer-media .deal-tag { bottom: 8px; inset-inline-start: 8px; font-size: 12px; padding: 4px 10px; border-radius: 10px; transform: rotate(-3deg); }
[dir="rtl"] .offer-media .deal-tag { transform: rotate(3deg); }
.offer-marks { position: absolute; z-index: 1; bottom: 8px; inset-inline-end: 8px; display: flex; align-items: center; gap: 6px; }
.offer-marks .badge { position: static; font-size: 11px; padding: 3px 8px; }
.fav-mark { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: #C7401A; display: grid; place-items: center; box-shadow: 0 6px 12px -8px rgba(0, 0, 0, 0.45); }
.fav-mark svg { fill: currentColor; }
.offer-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 10px 12px 12px; }
.offer-name { font-size: 15px; line-height: 1.35; letter-spacing: -0.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offer-place { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer .pick-chip { margin-top: 0; font-size: 12px; padding: 4px 8px; gap: 5px; white-space: nowrap; }
.offer-foot { margin-top: auto; padding-top: 4px; display: flex; flex-direction: column; align-items: flex-start; }
.offer-foot .strike { font-size: 12.5px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.offer-foot .big-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; white-space: normal; line-height: 1.15; }
.price-num { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; } .price-cur { font-size: 11.5px; font-weight: 600; }
.card.offer.out { opacity: 0.62; } .card.offer.out .thumb { filter: grayscale(0.85); }
@media (max-width: 359px) { .screen { --pad: 12px; } .offer-media { aspect-ratio: 16 / 9; } .band .greet-sub { font-size: 20px; } .band .stamps-chip { padding: 0 9px; } }
@media (min-width: 700px) {
  .screen { --pad: 28px; } .screen.has-band { padding-top: 28px; }
  .band { margin-inline: 0; border-radius: 28px; padding: 22px 26px 26px; } .cats { margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; }
  .offer-name { font-size: 16px; } .cards > .offer:only-child .offer-media { aspect-ratio: 4 / 3; } .cards > .offer:only-child { max-width: 320px; }
}

/* Empty states (orders, no offers) and the slots for real illustrations (web/art/, listed in config.js → art). */
.empty { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 24px 12px; }
.empty h2 { font-size: 21px; font-weight: 800; } .empty .muted { max-width: 30ch; font-size: 15px; }
.empty .btn { min-width: min(240px, 100%); margin-top: 10px; }
.empty-ic { width: 104px; height: 104px; border-radius: 34px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.empty-offers { padding: 8px 12px 16px; gap: 4px; } .cards > .empty { max-width: none; }
.art { display: block; flex: none; height: auto; max-width: 100%; aspect-ratio: 1 / 1; object-fit: contain; opacity: 0; transition: opacity 0.3s ease;
  animation: art-float 6s ease-in-out infinite; }
.art.in { opacity: 1; }
.art-intro { width: min(66vw, 264px); }
.art-empty { width: min(42vw, 160px); } .art-empty.sm { width: min(36vw, 136px); }
/* small companions: reward on the loyalty card, trophy by the medals, confirmation on the receipt, kindness-bag note */
.art-party { width: 104px; } .art-badge { width: 96px; margin-block: -4px; } .art-joy { width: 88px; margin-block: -44px -4px; } .art-note { width: 80px; }
/* receipt: the "pay cash" label keeps one line and the amount drops below it when both do not fit side by side */
.paybox { gap: 4px; } .paybox .row { gap: 2px 12px; } .paybox .bold { white-space: nowrap; } .paybox .big { font-size: clamp(24px, 7vw, 30px); }
.reward-row { display: flex; align-items: center; gap: 12px; } .reward-row > p { flex: 1; min-width: 0; }
.joy-row { display: flex; align-items: center; justify-content: center; gap: 10px; } .joy-row .joy { min-width: 0; }
.joy-row:has(.art) .joy { text-align: start; padding-inline: 0; }
.note.with-art { display: flex; align-items: center; gap: 12px; } .note.with-art > span { flex: 1; min-width: 0; }
@media print { .art { display: none; } }
/* sign-in: the mascot greets small, the brand seal sits on its corner as a badge (the pair floats as one) */
.auth-seal.with-art { position: relative; width: 104px; height: 104px; }
.auth-seal.with-art .art-login { width: 104px; animation: none; }
.auth-seal.with-art .logomark { position: absolute; inset-inline-end: -8px; bottom: -4px; }
@keyframes art-float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -8px, 0); } }
.shops-line { text-align: center; } .quiet-link { color: var(--muted); font-weight: 600; text-underline-offset: 4px; }
@media (max-width: 359px) { .auth-seal.with-art, .auth-seal.with-art .art-login { width: 88px; height: 88px; } }

/* ═══════════ Motion system ═══════════
   One coherent set of primitives (helpers in app.js: mount(), stagger(), countUp(), skel*(), closeModal(), artSlot()).
   Rules: only transform and opacity are animated (compositor-only, smooth on a low-end phone); durations stay short
   (0.14–0.36s); nothing loops except the skeleton shimmer, the art float and the swipe hint; everything is switched off
   under prefers-reduced-motion (the block at the very end of this file). */
:root { --ease-out: cubic-bezier(.22, .8, .26, 1); --ease-spring: cubic-bezier(.3, 1.35, .5, 1); }

/* 1 · Route change: the screen fades in with a soft rise; deeper pages slide in from the end, "back" from the start. */
@keyframes route-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes route-x { from { opacity: 0; transform: translate3d(var(--rx, 20px), 0, 0); } to { opacity: 1; transform: none; } }
.route-in { animation: route-in 0.24s var(--ease-out); }
.route-fwd { --rx: 22px; animation: route-x 0.24s var(--ease-out); }
.route-back { --rx: -22px; animation: route-x 0.24s var(--ease-out); }
[dir="rtl"] .route-fwd { --rx: -22px; } [dir="rtl"] .route-back { --rx: 22px; }

/* 2 · Lists: staggered entrance. stagger() numbers the items (--i, capped), each starts 50ms after the one before.
   "backwards" fill only: once landed, an item is free again for the press feedback below. */
@keyframes rise { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.985); } to { opacity: 1; transform: none; } }
.stg { animation: rise 0.36s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 50ms); }

/* 3 · Loading: skeleton placeholders. Static grey blocks; ONE light sweep per card moves across them (transform). */
.skel { display: block; flex: none; background: #E4E8E3; border-radius: 8px; }
.sk-line { height: 12px; } .sk-line.tall { height: 20px; } .sk-line.mid { margin-inline: auto; }
.w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w90 { width: 90%; }
.sk-media { width: 100%; aspect-ratio: 4 / 3; border-radius: 0; }
.skel-card { position: relative; overflow: hidden; pointer-events: none; animation: fade-in 0.2s ease-out 0.1s backwards; }
.skel-card .offer-body { gap: 9px; padding-top: 12px; }
.skel-card::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.72) 50%, transparent 75%); animation: shimmer 1.3s ease-in-out infinite; }
[dir="rtl"] .skel-card::after { transform: translateX(100%); animation-name: shimmer-rtl; }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes shimmer-rtl { to { transform: translateX(-100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@media (max-width: 359px) { .sk-media { aspect-ratio: 16 / 9; } }

/* 4 · Numbers: countUp() in app.js; the figures use tabular numerals so they do not jitter while counting. */
.impact-num, .price-num { font-variant-numeric: tabular-nums; }

/* 5 · Touch feedback: a subtle press scale on everything tappable. */
.btn, .card.link, .cat, .chip, .nav button, button.badge, button.note, .avatar-btn, .star, .loc {
  -webkit-tap-highlight-color: transparent; transition: transform 0.14s var(--ease-out), filter 0.14s ease; }
.btn:active:not(:disabled), .chip:active, button.badge:active, .star:active, .avatar-btn:active { transform: scale(0.96); }
.card.link:active:not(:disabled), button.note:active { transform: scale(0.98); }
.cat:active .cat-ring { transform: scale(0.93); } .loc:active { transform: scale(0.98); }
.nav button:active { transform: scale(0.94); }
.nav button.on svg { animation: nav-pop 0.34s var(--ease-spring); }
@keyframes nav-pop { from { transform: scale(0.8); } to { transform: none; } }

/* 6 · Dialogs and sheets: the backdrop fades, the sheet slides up; closing plays the reverse, shorter (closeModal()). */
@keyframes sheet-up { from { opacity: 0; transform: translate3d(0, 28px, 0) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-down { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(0, 20px, 0) scale(0.98); } }
.modal-bg { animation: fade-in 0.18s ease-out; }
.modal { animation: sheet-up 0.28s var(--ease-out); }
.modal-bg.out { pointer-events: none; animation: fade-out 0.17s ease-in forwards; }
.modal-out { animation: sheet-down 0.17s ease-in forwards; }

/* 7 · Toast: drops in from the top and lifts away. */
#toast { transform: translate3d(0, -16px, 0) scale(0.97); transition: opacity 0.24s var(--ease-out), transform 0.24s var(--ease-out); }
#toast.show { transform: none; }

/* 8 · Onboarding: the illustration pops in softly and the lines rise when the slide changes. */
@keyframes pop-in { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes rise-a { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes rise-b { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
.intro-pop { display: flex; align-items: center; justify-content: center; animation: pop-in 0.4s var(--ease-spring) backwards; }
.swap-a h1, .swap-a .intro-line { animation: rise-a 0.34s var(--ease-out) backwards; }
.swap-b h1, .swap-b .intro-line { animation: rise-b 0.34s var(--ease-out) backwards; }
.swap-a .intro-line, .swap-b .intro-line { animation-delay: 60ms; }
.intro-dot { transition: transform 0.24s var(--ease-spring), opacity 0.2s; } .intro-dot.on { transform: scale(1.35); }

/* Reduced motion: no animation and no transition anywhere – every state is simply shown. (Keep this block last.) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .skel-card::after { display: none; }
}
