@import url('/css/fonts.css');

/* ============ tokens ============ */
:root {
  color-scheme: light dark;
  --brand: #4f46e5; --brand-2: #7c3aed; --on-brand: #ffffff; --brand-text: #4338ca;
  --bg: #f5f4fb; --surface: #ffffff; --surface-2: #f0eff8; --ink: #17152e; --ink-2: #45435f; --muted: #66647f;
  --line: #e4e2f0; --line-strong: #cfcce0;
  --ok: #047857; --ok-soft: #d8f5e9; --warn: #a15c07; --warn-soft: #fdeecb; --bad: #c2271f; --bad-soft: #fde3e1; --info-soft: #e6e9fb;
  --wa: #0e7a6e;
  --brand-soft: color-mix(in srgb, var(--brand) 11%, var(--surface));
  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(23, 21, 46, .06), 0 1px 3px rgba(23, 21, 46, .04);
  --sh-2: 0 4px 12px rgba(23, 21, 46, .07), 0 12px 32px rgba(23, 21, 46, .07);
  --sh-3: 0 18px 48px rgba(23, 21, 46, .18);
  --font: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Calistoga', 'IBM Plex Sans Arabic', Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-in: cubic-bezier(.4, 0, 1, 1);
  --t-press: 90ms; --t-fast: 160ms; --t: 240ms; --t-slow: 420ms;
  --nav-h: 68px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand-text: #b4b9ff;
    --bg: #111019; --surface: #1c1b29; --surface-2: #262536; --ink: #f1f0fa; --ink-2: #cfcde0; --muted: #a09eb8;
    --line: #2f2e42; --line-strong: #45435c;
    --ok: #4ade9f; --ok-soft: #123527; --warn: #f5c15f; --warn-soft: #3a2c10; --bad: #ff8a80; --bad-soft: #401b19; --info-soft: #25284a;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 8px 28px rgba(0, 0, 0, .45); --sh-3: 0 20px 56px rgba(0, 0, 0, .6);
  }
}

/* ============ base ============ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font: 400 1.75rem/1.15 var(--display); letter-spacing: -.01em; }
h2 { font: 400 1.35rem/1.2 var(--display); }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--brand-text); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-text) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); font-size: .9rem; }
.center { text-align: center; }
.eyebrow { font-size: .75rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.lg { width: 24px; height: 24px; } .ic.xl { width: 32px; height: 32px; }
[dir=rtl] .flip { transform: scaleX(-1); }

.wrap { max-width: 620px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); }
.wrap.wide { max-width: 1180px; padding-bottom: 48px; }
.wrap.plain { padding-bottom: 40px; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 20px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.view-in > * { animation: rise var(--t-slow) var(--ease) both; }
.view-in > *:nth-child(2) { animation-delay: 40ms; } .view-in > *:nth-child(3) { animation-delay: 80ms; }
.view-in > *:nth-child(4) { animation-delay: 120ms; } .view-in > *:nth-child(n+5) { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border: 0; border-radius: var(--r-sm);
  background: var(--brand); color: var(--on-brand); font-weight: 650; text-decoration: none; text-align: center;
  transition: transform var(--t-press) var(--ease), filter var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); filter: brightness(.95); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.soft { background: var(--brand-soft); color: var(--brand-text); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: var(--bad); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #2a0a08; } }
.btn.ghost.danger-text { color: var(--bad); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.big { width: 100%; min-height: 64px; font-size: 1.15rem; border-radius: var(--r); }
.btn.block { width: 100%; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: .9rem; }
.iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; flex: none;
  background: transparent; color: var(--ink-2); transition: background var(--t-fast), transform var(--t-press);
}
.iconbtn:hover { background: var(--surface-2); }
.iconbtn:active { transform: scale(.92); }
.iconbtn.danger-text { color: var(--bad); }

/* ============ forms ============ */
.field { margin: 14px 0; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend, label.lbl { display: block; margin-bottom: 6px; padding: 0; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
input:not([type=radio]):not([type=checkbox]):not([type=color]):not([type=file]), select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-text) 22%, transparent); }
textarea { resize: vertical; }
.hint { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.inline { display: flex; gap: 12px; align-items: flex-end; }
.inline > * { flex: 1; min-width: 0; margin: 0; }
.searchbox { position: relative; }
.searchbox .ic { position: absolute; inset-inline-start: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.searchbox input[type=search] { padding-inline-start: 44px !important; border-radius: var(--r-pill) !important; }
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.segmented label { flex: 1; margin: 0; }
.segmented input, .iconpick input, .tplgrid input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 10px; border-radius: 9px; font-size: .875rem; font-weight: 600; color: var(--ink-2); text-align: center; cursor: pointer; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.segmented input:checked + span { background: var(--surface); color: var(--brand-text); box-shadow: var(--sh-1); }
.segmented input:focus-visible + span, .iconpick input:focus-visible + span, .tplgrid input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand-text) 70%, transparent); outline-offset: 2px; }
.iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.iconpick span { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 72px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 12px; font-size: .75rem; font-weight: 600; text-align: center; line-height: 1.2; color: var(--ink-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast); }
.iconpick input:checked + span { border-color: var(--brand-text); background: var(--brand-soft); color: var(--brand-text); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; font-weight: 550; }
.switch input { appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 99px; background: var(--line-strong); cursor: pointer; transition: background var(--t-fast); }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: translate var(--t-fast) var(--ease); }
.switch input:checked { background: var(--brand-text); }
.switch input:checked::after { translate: 18px 0; }
[dir=rtl] .switch input:checked::after { translate: -18px 0; }
.langpick { position: relative; display: inline-block; }
.langbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-2); font-size: .875rem; font-weight: 600; transition: box-shadow var(--t-fast), color var(--t-fast); }
.langbtn:hover, .langbtn[aria-expanded=true] { box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--ink); }
.langbtn .ic { width: 18px; height: 18px; }
.langbtn .chev { width: 16px; height: 16px; opacity: .7; transition: transform var(--t-fast) var(--ease); }
.langbtn[aria-expanded=true] .chev { transform: rotate(180deg); }
.langmenu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 50; min-width: 180px; padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: var(--sh-3), inset 0 0 0 1px var(--line); animation: menuin var(--t-fast) var(--ease); }
.langmenu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font-size: .95rem; font-weight: 550; text-align: start; }
.langmenu button:hover, .langmenu button:focus-visible { background: var(--surface-2); outline: none; }
.langmenu button[aria-selected=true] { color: var(--brand-text); font-weight: 650; }
.langmenu button .ic { width: 18px; height: 18px; flex: none; }
@keyframes menuin { from { opacity: 0; transform: translateY(-4px); } }

/* ============ surfaces & lists ============ */
.panel { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--sh-1); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-head a { font-size: .875rem; font-weight: 600; text-decoration: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; padding-bottom: 2px; }
.row:first-child { padding-top: 2px; }
.row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .grow > span { display: block; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.row, a.rowlink { color: inherit; text-decoration: none; }
a.row:hover b, a.rowlink:hover b { color: var(--brand-text); }
.rowlink { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; overflow: hidden; background: var(--surface-2); font: 400 1rem var(--display); }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.avatar.sm { width: 36px; height: 36px; border-radius: 11px; font-size: .85rem; }
.avatar.lg { width: 72px; height: 72px; border-radius: 22px; font-size: 1.6rem; }
.avatar.person { border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font: 650 .9rem var(--font); }
.avatar.ev { border-radius: 50%; background: var(--surface-2); color: var(--ink-2); width: 38px; height: 38px; }
.avatar.ev.earn { background: var(--ok-soft); color: var(--ok); } .avatar.ev.redeem { background: var(--warn-soft); color: var(--warn); }
.avatar.ev.join { background: var(--info-soft); color: var(--brand-text); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-text); font-weight: 650; font-size: .8rem; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.grey { background: var(--surface-2); color: var(--ink-2); }
.pill .ic { width: 14px; height: 14px; }
.pill.ltr { direction: ltr; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; min-height: 40px; padding: 6px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); font-size: .875rem; font-weight: 600; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.chips button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips button b { font-weight: 700; opacity: .7; margin-inline-start: 4px; }
code.link { display: block; padding: 12px; background: var(--surface-2); border-radius: var(--r-sm); font: .8rem/1.4 ui-monospace, Consolas, monospace; word-break: break-all; direction: ltr; text-align: left; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 28px 12px; text-align: center; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; padding: 9px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); box-sizing: content-box; }
.empty b { color: var(--ink); }
.skeleton { border-radius: var(--r); background: linear-gradient(100deg, var(--surface-2) 40%, var(--surface) 50%, var(--surface-2) 60%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--brand-text); transition: width var(--t-slow) var(--ease); }
.menu { padding: 4px 16px; }
.menu a { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.menu a:last-child { border-bottom: 0; }
.menu .mi { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.menu b { display: block; font-weight: 600; } .menu span.d { display: block; font-size: .85rem; color: var(--muted); }
.menu a > .ic:last-child { color: var(--muted); }
.menu a:hover b { color: var(--brand-text); }

/* ============ app shell ============ */
.appbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.appbar h1 { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar .sub { font-size: .78rem; color: var(--muted); }
.subhead { display: flex; align-items: center; gap: 4px; margin: 0 -8px 8px; }
.subhead h1 { font-size: 1.35rem; flex: 1; min-width: 0; }
nav.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: center; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
nav.tabs a { display: grid; justify-items: center; gap: 3px; padding: 8px 2px; color: var(--muted); font-size: .7rem; font-weight: 600; text-decoration: none; transition: color var(--t-fast); }
nav.tabs a .ic { width: 24px; height: 24px; transition: transform var(--t) var(--ease); }
nav.tabs a[aria-current=page] { color: var(--brand-text); }
nav.tabs a[aria-current=page] .ic { transform: translateY(-2px) scale(1.06); }
nav.tabs .fab { display: grid; place-items: center; justify-self: center; width: 62px; height: 62px; margin-top: -26px; border: 4px solid var(--bg); border-radius: 50%; background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 45%, transparent); transition: transform var(--t-press) var(--ease); }
nav.tabs .fab .ic { width: 26px; height: 26px; }
nav.tabs .fab:active { transform: scale(.92); }
nav.tabs .fab span, nav.tabs .brandmark { display: none; }
@media (min-width: 900px) {
  body.app { padding-inline-start: 240px; }
  nav.tabs { inset-inline: 0 auto; top: 0; bottom: 0; width: 240px; height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 20px 14px; border-top: 0; border-inline-end: 1px solid var(--line); background: var(--surface); }
  nav.tabs .brandmark { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font: 400 1.15rem var(--display); }
  nav.tabs a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: .95rem; }
  nav.tabs a[aria-current=page] { background: var(--brand-soft); }
  nav.tabs a[aria-current=page] .ic { transform: none; }
  nav.tabs .fab { order: -1; width: auto; height: 52px; margin: 0 0 12px; border: 0; border-radius: 14px; display: flex; gap: 10px; font-weight: 650; }
  nav.tabs .fab span { display: inline; }
  nav.tabs .brandmark { order: -2; }
  .wrap { max-width: 720px; padding-bottom: 48px; }
  .appbar { padding-inline: 24px; }
}

/* ============ home ============ */
.scan-cta { position: relative; display: flex; align-items: center; gap: 16px; width: 100%; padding: 20px; border: 0; border-radius: var(--r-lg); overflow: hidden; text-align: start; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 62%, #000)); color: var(--on-brand); box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 35%, transparent); transition: transform var(--t-press) var(--ease); }
.scan-cta:active { transform: scale(.985); }
.scan-cta::after { content: ''; position: absolute; inset-inline-end: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-2) 80%, transparent), transparent); opacity: .7; pointer-events: none; }
.scan-cta .ring { position: relative; z-index: 1; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: color-mix(in srgb, var(--on-brand) 18%, transparent); flex: none; }
.scan-cta .ring .ic { width: 32px; height: 32px; }
.scan-cta .ring::before { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 2px solid currentColor; opacity: .5; animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.45); opacity: 0; } }
.scan-cta b { position: relative; z-index: 1; display: block; font: 400 1.4rem/1.15 var(--display); }
.scan-cta span.d { position: relative; z-index: 1; display: block; opacity: .88; font-size: .9rem; margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 720px) { .kpis.auto { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { position: relative; background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: var(--sh-1); min-width: 0; }
.kpi .ki { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-text); margin-bottom: 10px; }
.kpi .ki .ic { width: 18px; height: 18px; }
.kpi b { display: block; font: 400 1.7rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.kpi span { display: block; color: var(--muted); font-size: .8rem; line-height: 1.3; margin-top: 2px; }
.kpi .trend { position: absolute; top: 14px; inset-inline-end: 12px; }
.kpis.three .kpi { padding: 12px; text-align: center; } .kpis.three .kpi b { font-size: 1.45rem; }

/* ============ chart ============ */
.chart { display: grid; grid-template-columns: repeat(14, 1fr); align-items: end; gap: 5px; height: 150px; margin-top: 22px; direction: ltr; }
.chart .bar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.chart .bar i { display: block; width: 100%; min-height: 3px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--brand-text) 32%, var(--surface-2)); transform-origin: bottom; animation: grow var(--t-slow) var(--ease) both; animation-delay: calc(var(--i) * 22ms); }
.chart .bar.today i { background: var(--brand-text); }
.chart .bar em { position: absolute; inset-inline: -6px; text-align: center; font-style: normal; font-size: .7rem; font-weight: 650; color: var(--ink-2); translate: 0 -4px; }
.chart-x { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; margin-top: 6px; font-size: .68rem; color: var(--muted); text-align: center; direction: ltr; }
@keyframes grow { from { transform: scaleY(0); } }
.rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: .8rem; font-weight: 700; flex: none; }
.rank.r1 { background: #fbe7a8; color: #6b4a00; }

/* ============ loyalty card (phone) ============ */
.lcard { position: relative; overflow: hidden; isolation: isolate; padding: 20px; border-radius: var(--r-lg); background: var(--lc-bg); color: var(--lc-on); box-shadow: 0 16px 36px color-mix(in srgb, var(--c1) 34%, transparent), var(--sh-1); }
.lcard::before { content: ''; position: absolute; inset: 0; z-index: -1; }
.lcard.tpl-aurora::before { background: radial-gradient(90% 80% at 100% 0%, color-mix(in srgb, var(--c2) 85%, transparent), transparent 62%), radial-gradient(70% 60% at 0% 115%, color-mix(in srgb, var(--c1) 60%, #fff), transparent 70%), linear-gradient(135deg, var(--c1), color-mix(in srgb, var(--c1) 62%, #000)); }
.lcard.tpl-classic::before { inset: 9px; border: 1.5px solid color-mix(in srgb, var(--lc-on) 34%, transparent); border-radius: 16px; }
.lcard.tpl-minimal { box-shadow: var(--sh-2); border: 1px solid #e4e2f0; }
.lcard.tpl-minimal::before { inset-inline: 0 auto; width: 10px; background: linear-gradient(var(--c1), var(--c2)); }
.lcard.tpl-minimal { padding-inline-start: 28px; }
.lcard.tpl-split::before { background: linear-gradient(112deg, transparent 0 66%, var(--c2) 66.2% 100%); }
[dir=rtl] .lcard.tpl-split::before { background: linear-gradient(248deg, transparent 0 66%, var(--c2) 66.2% 100%); }
.lcard.tpl-pattern::before { background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c2) 45%, transparent), transparent 60%); }
.lcard.tpl-night::before { background: radial-gradient(90% 80% at 100% 0%, color-mix(in srgb, var(--c1) 70%, transparent), transparent 65%), radial-gradient(70% 60% at 0% 115%, color-mix(in srgb, var(--c2) 34%, transparent), transparent 70%); }
.lcard::after { content: ''; position: absolute; inset: 0; z-index: 3; background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .22) 50%, transparent 58%); translate: -120% 0; animation: sheen 1.1s var(--ease) .35s 1 both; pointer-events: none; }
@keyframes sheen { to { translate: 120% 0; } }
.lcard-bg { position: absolute; inset: 0; z-index: -1; }
.lcard-bg svg { width: 100%; height: 100%; }
/* A veil in the card colour keeps the name and stamps readable over busy artwork */
.lcard-bg::after { content: ''; position: absolute; inset: 0; opacity: .9; background: linear-gradient(90deg, var(--lc-bg) 12%, color-mix(in srgb, var(--lc-bg) 46%, transparent) 100%); }
[dir=rtl] .lcard-bg::after { background: linear-gradient(270deg, var(--lc-bg) 12%, color-mix(in srgb, var(--lc-bg) 46%, transparent) 100%); }
.lcard.has-art .stamps i:not(.on) { background: color-mix(in srgb, var(--lc-bg) 62%, transparent); }
[dir=rtl] .lcard-bg svg:not(.noflip) { transform: scaleX(-1); }
.lcard.has-art::before { display: none; }
.lcard-motif { position: absolute; z-index: -1; inset-inline-end: -26px; bottom: -34px; opacity: .12; rotate: -12deg; pointer-events: none; }
.lcard-motif .ic { width: 190px; height: 190px; stroke-width: 1.1; }
.lcard-head { display: flex; align-items: center; gap: 12px; }
.lcard-logo { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 15px; overflow: hidden; }
.lcard-logo img { width: 100%; height: 100%; object-fit: contain; }
.lcard-logo.plate { background: #fff; padding: 6px; }
.lcard-logo.mono { background: var(--lc-fill); color: var(--lc-fill-ink); font: 400 1.2rem var(--display); }
.lcard-id { min-width: 0; }
.lcard-biz { font: 400 1.2rem/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard-sub { font-size: .78rem; opacity: .82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard-who { margin-top: 18px; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard-meta { font-size: .85rem; opacity: .85; }
.lcard-meta a { color: inherit; }
.stamps { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 9px; margin-top: 16px; max-width: 420px; }
.stamps i { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--lc-on) 46%, transparent); color: color-mix(in srgb, var(--lc-on) 42%, transparent); }
.stamps i .ic { width: 46%; height: 46%; }
.stamps i.on { border: 0; background: var(--lc-fill); color: var(--lc-fill-ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); animation: pop var(--t-slow) var(--ease) both; animation-delay: calc(var(--i) * 35ms + 120ms); }
.lcard-count { margin-top: 12px; font-size: .9rem; opacity: .9; } .lcard-count b { font-size: 1.15rem; }
.lcard-points { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.lcard-points b { font: 400 3.4rem/1 var(--display); font-variant-numeric: tabular-nums; } .lcard-points span { opacity: .88; font-weight: 600; }
.lcard-next { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--lc-soft); font-size: .9rem; font-weight: 600; }
.lcard-next .ic { width: 18px; height: 18px; }
.lcard-next.ready { background: var(--lc-fill); color: var(--lc-fill-ink); }
.qrbox { display: grid; justify-items: center; gap: 10px; padding: 20px 16px 16px; text-align: center; }
.qrbox .qr { width: min(240px, 66vw); padding: 12px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1.5px #e4e2f0; }
.qrbox .qr img { width: 100%; height: auto; }
.qr-full { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px; background: #fff; color: #17152e; animation: fadein var(--t-fast); }
.qr-full img { width: min(86vw, 70vh); height: auto; }
.reward-row { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.reward-row:last-child { border-bottom: 0; }
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.banner .ic { width: 26px; height: 26px; } .banner small { display: block; font-weight: 500; opacity: .9; }
.banner.promo { background: var(--brand-soft); color: var(--brand-text); }
.banner.bday { background: var(--warn-soft); color: var(--warn); }
.ic.inl { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; }
.daypick { display: flex; flex-wrap: wrap; gap: 6px; }
.daypick input { position: absolute; opacity: 0; pointer-events: none; }
.daypick span { display: grid; place-items: center; min-width: 52px; min-height: 44px; padding: 6px 10px; border: 1.5px solid var(--line-strong); border-radius: 12px; font-size: .85rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.daypick input:checked + span { background: var(--brand-text); border-color: var(--brand-text); color: var(--surface); }
.daypick input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand-text) 70%, transparent); outline-offset: 2px; }
.artpair { display: grid; grid-template-columns: 1.56fr 1fr; gap: 12px; align-items: start; }
.standprev { aspect-ratio: 1050 / 1480; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .14), 0 10px 24px rgba(23, 21, 46, .18); }
.standprev svg { width: 100%; height: 100%; }
.filelist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.filelist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.menu .mrow { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.menu .mrow:last-child { border-bottom: 0; }
.menu .mrow b { display: block; font-weight: 600; }
.menu .mrow .d { display: block; font-size: .85rem; color: var(--muted); }
.menu .mrow > .ic:last-child { color: var(--muted); }
.menu .mrow:hover b { color: var(--brand-text); }
.menu .mrow.danger b { color: var(--bad); }
.menu .mrow.danger .mi { background: var(--bad-soft); color: var(--bad); }
.menu .mrow.danger:hover b { color: var(--bad); }
.menu .row.mrow-static { padding: 14px 0; }
.footnote { margin-top: 24px; text-align: center; font-size: .78rem; color: var(--muted); }
.steps { display: grid; gap: 10px; counter-reset: step; }
.steps li { display: flex; align-items: center; gap: 12px; list-style: none; font-weight: 550; }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: .85rem; flex: none; }
ol.steps { margin-inline: 0; margin-bottom: 0; }
ol.steps:not(.panel) { padding: 0; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.earnbar { display: flex; gap: 10px; align-items: stretch; margin-top: 14px; }
.earnbar .btn.big { flex: 1; width: auto; }

/* ============ feedback layers ============ */
.toast { position: fixed; inset-inline: 16px; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 90; display: flex; align-items: center; justify-content: center; gap: 10px; width: fit-content; max-width: min(440px, calc(100vw - 32px)); margin-inline: auto; padding: 12px 18px; border-radius: 14px; background: #17152e; color: #fff; font-weight: 600; box-shadow: var(--sh-3); animation: rise var(--t) var(--ease); }
.toast .ic { color: #6ee7b7; }
.toast.bad { background: #8f1d17; } .toast.bad .ic { color: #fff; }
.toast.out { opacity: 0; translate: 0 8px; transition: opacity var(--t-fast) var(--ease-in), translate var(--t-fast) var(--ease-in); }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; background: rgba(12, 10, 28, .56); animation: fadein var(--t-fast); }
.sheet { width: 100%; max-width: 540px; max-height: 92dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--sh-3); animation: sheetup var(--t) var(--ease); }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } }
.modal.out { opacity: 0; transition: opacity var(--t-fast) var(--ease-in); }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 12px 4px 20px; }
[dir=rtl] .sheet-head { padding: 16px 20px 4px 12px; }
.sheet-head h3 { flex: 1; font: 400 1.2rem/1.25 var(--display); }
.sheet-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.sheet-ic.danger { background: var(--bad-soft); color: var(--bad); }
.sheet-body { padding: 0 20px; overflow-y: auto; }
.sheet .btns { display: flex; gap: 10px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); }
.sheet .btns .btn { flex: 1; }
@media (min-width: 600px) { .modal { place-items: center; padding: 20px; } .sheet { border-radius: var(--r-lg); } }
.scanner { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: #000; color: #fff; }
.scanner video { flex: 1; width: 100%; min-height: 0; object-fit: cover; }
.scanner .frame { position: absolute; top: 46%; left: 50%; width: min(70vw, 300px); aspect-ratio: 1; translate: -50% -50%; border-radius: 28px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); pointer-events: none; }
.scanner .frame::before { content: ''; position: absolute; inset: -3px; border-radius: 30px; border: 4px solid #fff; mask: conic-gradient(#000 0 0) top left / 44px 44px no-repeat, conic-gradient(#000 0 0) top right / 44px 44px no-repeat, conic-gradient(#000 0 0) bottom left / 44px 44px no-repeat, conic-gradient(#000 0 0) bottom right / 44px 44px no-repeat; }
.scanner .frame::after { content: ''; position: absolute; inset-inline: 14px; top: 10%; height: 3px; border-radius: 3px; background: #fff; box-shadow: 0 0 14px 2px rgba(255, 255, 255, .8); animation: sweep 2.2s ease-in-out infinite alternate; }
@keyframes sweep { to { top: 88%; } }
.scanner .bar { position: relative; z-index: 1; display: grid; gap: 12px; justify-items: center; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); text-align: center; background: #000; font-weight: 550; }
.scanner .bar .btn { background: #fff; color: #000; min-width: 160px; }
.flash { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; align-content: center; gap: 14px; background: color-mix(in srgb, #047857 94%, transparent); color: #fff; font: 400 2.2rem var(--display); text-align: center; animation: flashout 1.15s var(--ease) forwards; pointer-events: none; }
.flash .tick { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: #fff; color: #047857; animation: pop var(--t-slow) var(--ease) both; }
.flash .tick .ic { width: 52px; height: 52px; stroke-width: 3; }
@keyframes flashout { 0%, 62% { opacity: 1; } 100% { opacity: 0; } }
.confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; }

/* ============ card designer ============ */
.designer { display: grid; gap: 16px; }
.stage { position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 5; padding: 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--sh-2); }
.stage .segmented { margin-bottom: 12px; }
.pcard { position: relative; aspect-ratio: 856 / 540; border-radius: 3.72% / 5.9%; overflow: hidden; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .14), 0 14px 30px rgba(23, 21, 46, .22); }
.pcard svg { width: 100%; height: 100%; }
/* Card artwork is laid out left-to-right; in an Arabic interface it must not inherit right-to-left text direction
   (that moved punctuation and right-aligned lines). Arabic words inside still read right-to-left. */
svg.cardart { direction: ltr; unicode-bidi: isolate; }
.pcard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, .2), transparent 34%, transparent 70%, rgba(255, 255, 255, .08)); pointer-events: none; }
/* 3D preview: the card turns over between front and back and leans towards the pointer */
.card3d { perspective: 1400px; max-width: 440px; margin: 0 auto; }
.card3d-inner { position: relative; aspect-ratio: 856 / 540; transform-style: preserve-3d; transition: transform .7s var(--ease); transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--turn, 0deg))); }
.card3d[data-side=back] .card3d-inner { --turn: 180deg; }
.card3d.tilting .card3d-inner { transition: transform 90ms linear; }
.card3d .pcard { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card3d .face-back { transform: rotateY(180deg); }
.fontgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.fontgrid input { position: absolute; opacity: 0; pointer-events: none; }
.fontgrid span { display: grid; gap: 2px; min-height: 68px; align-content: center; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; text-align: center; transition: border-color var(--t-fast), background var(--t-fast); }
.fontgrid span b { font-size: 1.25rem; line-height: 1.2; font-weight: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fontgrid span em { font: 600 .72rem var(--font); font-style: normal; color: var(--muted); letter-spacing: 0; text-transform: none; }
.fontgrid input:checked + span { border-color: var(--brand-text); background: var(--brand-soft); }
.fontgrid input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand-text) 70%, transparent); outline-offset: 2px; }
.finish-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.stage .pcard { animation: fadein var(--t); }
.stage .phonepreview { max-width: 360px; margin: 0 auto; }
.stage .caption { margin-top: 10px; text-align: center; font-size: .78rem; color: var(--muted); }
.dropzone { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border: 2px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); text-align: start; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.dropzone:hover, .dropzone.over { border-color: var(--brand-text); background: var(--brand-soft); }
.dropzone .dz-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-text); flex: none; overflow: hidden; }
.dropzone .dz-ic img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.dropzone b { display: block; } .dropzone span.d { display: block; font-size: .85rem; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; display: flex; width: 64px; height: 44px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), var(--sh-1); transition: transform var(--t-press) var(--ease); }
.swatch i { flex: 2; } .swatch i + i { flex: 1; }
.swatch:active { transform: scale(.94); }
.swatch[aria-pressed=true] { outline: 3px solid var(--brand-text); outline-offset: 2px; }
.colorpair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.colorfield { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-size: .85rem; font-weight: 600; cursor: pointer; }
.colorfield input { width: 40px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; flex: none; }
.colorfield code { display: block; font: .75rem ui-monospace, Consolas, monospace; color: var(--muted); text-transform: uppercase; }
.tplgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 1100px) { .tplgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tplgrid label { display: block; cursor: pointer; }
.tplgrid span { display: block; padding: 5px; border-radius: 12px; border: 2px solid transparent; transition: border-color var(--t-fast), background var(--t-fast); }
.tplgrid input:checked + span { border-color: var(--brand-text); background: var(--brand-soft); }
.tplgrid .pcard { box-shadow: var(--sh-1); }
.tplgrid em { display: block; margin-top: 6px; text-align: center; font-style: normal; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
@media (min-width: 1100px) {
  .wrap.designer-wrap { max-width: 1040px; }
  .designer { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; gap: 24px; }
  .stage { top: 76px; }
}

/* ============ platform admin ============ */
.adminbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.adminbar .logo { display: flex; align-items: center; gap: 10px; font: 400 1.25rem var(--display); }
.adminbar .logo i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }
@media (max-width: 520px) { .adminbar { padding: 10px 14px; gap: 8px; } .adminbar .btn span { display: none; } .adminbar .btn { padding: 6px 12px; } }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0 12px; }
.toolbar .searchbox { flex: 1 1 240px; }
.biz-table { width: 100%; border-collapse: collapse; }
.biz-table th { padding: 10px 12px; text-align: start; font-size: .72rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.biz-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .92rem; }
.biz-table tr:last-child td { border-bottom: 0; }
.biz-table tbody tr { transition: background var(--t-fast); }
.biz-table tbody tr:hover { background: var(--surface-2); }
.biz-table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.biz-name { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.biz-name b { display: block; font-weight: 650; } .biz-name div span { display: block; font-size: .8rem; color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 860px) {
  .biz-table thead { display: none; }
  .biz-table, .biz-table tbody, .biz-table tr, .biz-table td { display: block; }
  .biz-table tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .biz-table tr:last-child { border-bottom: 0; }
  .biz-table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .biz-table td[data-l]::before { content: attr(data-l); font-size: .8rem; color: var(--muted); }
  .biz-table td.first { padding-bottom: 8px; } .biz-table td.last { padding-top: 10px; }
  .actions { justify-content: stretch; width: 100%; } .actions .btn { flex: 1; }
}

.brandlogo { display: inline-flex; align-items: center; gap: 10px; font: 400 1.3rem var(--display); color: var(--ink); text-decoration: none; }
.brandlogo i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; font-style: normal; }
.brandmark { display: block; flex: none; width: 38px; height: 38px; border-radius: 12px; box-shadow: 0 6px 16px -8px rgb(79 70 229 / .55); }
.adminbar .logo .brandmark { width: 36px; height: 36px; border-radius: 11px; }
.formerror { display: flex; gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: .9rem; }

/* ============ auth ============ */
.auth { min-height: 100dvh; display: grid; }
.auth-form { display: grid; align-content: center; gap: 20px; padding: 24px; max-width: 440px; width: 100%; margin: 0 auto; }
.auth-art { display: none; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1fr 1fr; }
  .auth-art { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(80% 70% at 100% 0%, #7c3aed, transparent 60%), linear-gradient(150deg, #4338ca, #1e1b4b); color: #fff; padding: 48px; }
  .auth-art .inner { max-width: 400px; display: grid; gap: 28px; }
  .auth-art h2 { font-size: 2rem; line-height: 1.15; }
}

/* ============ landing ============ */
.lp { background: var(--bg); }
.lp-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lp-nav .logo { display: flex; align-items: center; gap: 10px; font: 400 1.3rem var(--display); color: var(--ink); text-decoration: none; }
.lp-nav .logo i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }
.lp-nav .links { display: none; gap: 24px; margin-inline: auto; }
.lp-nav .links a { color: var(--ink-2); font-weight: 550; text-decoration: none; }
.lp-nav .links a:hover { color: var(--brand-text); }
.lp-nav .end { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
@media (min-width: 860px) { .lp-nav .links { display: flex; } .lp-nav .end { margin-inline-start: 0; } }
.lp-hero { display: grid; gap: 40px; max-width: 1180px; margin: 0 auto; padding: 36px 20px 56px; align-items: center; }
.lp-hero h1 { font-size: clamp(2.2rem, 7vw, 3.9rem); line-height: 1.05; }
.lp-hero h1 em { font-style: normal; color: var(--brand-text); }
.lp-hero p.lead { margin-top: 18px; font-size: 1.1rem; color: var(--ink-2); max-width: 54ch; }
.lp-hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.lp-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; margin-bottom: 18px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-text); font-size: .85rem; font-weight: 650; }
.lp-art { position: relative; min-height: 440px; display: grid; place-items: center; }
.lp-art .glow { position: absolute; inset: 8% 4%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, #7c3aed 38%, transparent), transparent); filter: blur(10px); }
.lp-phone { position: relative; width: min(292px, 76vw); padding: 12px; border-radius: 40px; background: #17152e; box-shadow: var(--sh-3); rotate: -4deg; animation: floaty 7s ease-in-out infinite; }
.lp-phone .screen { border-radius: 30px; overflow: hidden; background: var(--bg); padding: 16px 12px 18px; }
.lp-phone .lcard { padding: 16px; } .lp-phone .lcard-who { margin-top: 12px; font-size: 1.05rem; } .lp-phone .stamps { gap: 6px; margin-top: 12px; }
.lp-phone .fakeqr { width: 112px; margin: 14px auto 0; padding: 8px; border-radius: 14px; background: #fff; }
.lp-pcard { position: absolute; width: min(250px, 62vw); inset-inline-end: 0; bottom: 6%; rotate: 9deg; animation: floaty 8s ease-in-out -3s infinite; }
@keyframes floaty { 50% { translate: 0 -10px; } }
@media (min-width: 960px) { .lp-hero { grid-template-columns: 1.05fr .95fr; padding-top: 64px; } }
.lp-section { max-width: 1180px; margin: 0 auto; padding: 56px 20px; }
.lp-section > header { max-width: 640px; margin-bottom: 28px; }
.lp-section > header h2 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); }
.lp-section > header p { margin-top: 10px; color: var(--ink-2); font-size: 1.05rem; }
.lp-steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); counter-reset: s; }
.lp-steps .panel { position: relative; padding: 24px; }
.lp-steps .panel::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font: 400 1.3rem var(--display); }
.lp-steps p, .lp-bento p { margin-top: 6px; color: var(--ink-2); }
.lp-bento { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.lp-bento .panel { padding: 24px; transition: transform var(--t) var(--ease), box-shadow var(--t); }
.lp-bento .panel:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.lp-bento .fi { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: 15px; background: var(--brand-soft); color: var(--brand-text); }
.lp-types { display: flex; flex-wrap: wrap; gap: 10px; }
.lp-types span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; background: var(--surface); box-shadow: var(--sh-1); font-weight: 600; }
.lp-types .ic { color: var(--brand-text); }
.lp-end { margin: 24px 20px 56px; }
.lp-end .inner { max-width: 1140px; margin: 0 auto; padding: 48px 24px; border-radius: 32px; text-align: center; color: #fff; background: radial-gradient(70% 90% at 100% 0%, #7c3aed, transparent 60%), linear-gradient(150deg, #4338ca, #1e1b4b); }
.lp-end h2 { font-size: clamp(1.7rem, 5vw, 2.6rem); } .lp-end p { margin: 12px 0 24px; opacity: .88; }
.btn.wa-bright { background: #25d366; color: #05300f; }
.lp-foot { padding: 24px 20px 40px; text-align: center; color: var(--muted); font-size: .85rem; }
.reveal { opacity: 0; translate: 0 18px; transition: opacity .6s var(--ease), translate .6s var(--ease); }
.reveal.in { opacity: 1; translate: 0 0; }

/* ============ wide screens: use the width ============ */
.cols { display: flex; flex-direction: column; gap: 20px; }
.cols > .col { display: contents; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.pageactions { display: flex; gap: 8px; flex: 1 1 100%; }
.pageactions .btn { flex: 1; }
.filterbar { display: grid; gap: 12px; }
.rows-grid > .empty, .rows-grid > .skeleton { grid-column: 1 / -1; }
.setnav { display: none; }
.menu a[aria-current=page] .mi { background: var(--brand); color: var(--on-brand); }
.menu a[aria-current=page] b { color: var(--brand-text); }
@media (max-width: 1099.98px) { .wide-only { display: none !important; } }
@media (min-width: 900px) {
  /* the side rail already shows the business: the top bar only stays for the "admin mode" notice */
  .appbar { position: static; justify-content: flex-end; padding: 14px 32px 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .appbar:not(.acting) { display: none; }
  .appbar > .avatar, .appbar h1 { display: none; }
  .appbar .grow { flex: 0 1 auto; }
  .appbar .sub { padding: 4px 12px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-weight: 650; }
  .stage { top: 16px; }
}
@media (min-width: 1100px) {
  body.app .wrap { max-width: 1480px; padding: 28px 40px 56px; }
  .wrap.designer-wrap { max-width: 1240px; }
  .designer { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 32px; }
  .stage { top: 24px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .cols > .col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
  .cols > .col > * { order: 0 !important; margin-top: 0; }
  .pageactions { flex: 0 0 auto; }
  .pageactions .btn { flex: none; }
  .filterbar { grid-template-columns: minmax(280px, 440px) minmax(0, 1fr); align-items: center; }
  .rows-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); column-gap: 36px; }
  .rows-grid > .row:last-child { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .kpis.auto { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .kpis.three .kpi { padding: 16px 12px; }
  .setgrid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; }
  .setnav { display: block; position: sticky; top: 24px; }
  .setnav .menu { padding: 8px; }
  .setnav .menu a { padding: 9px 10px; border-bottom: 0; border-radius: 12px; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
  .setnav .menu a:hover { background: var(--surface-2); }
  .setnav .menu a[aria-current=page] { background: var(--brand-soft); }
  .setnav .menu a .mi { transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
  .setnav .menu .d { display: none; }
  .pane-in > * { animation: fadein var(--t-fast) var(--ease) both; }
  .setnav .menu .mi { width: 36px; height: 36px; border-radius: 11px; }
  .setmain { max-width: 820px; min-width: 0; }
  .setmain .subhead { margin-inline: 0; }
  .setmain .subhead > .iconbtn:first-child { display: none; }
  .artpair { max-width: 620px; }
}
@media (min-width: 1500px) { .tplgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---- landing: sections added in the second version ---- */
.lp section[id] { scroll-margin-top: 76px; }
.lp-burger { display: none; }
@media (max-width: 859.98px) { .lp-burger { display: inline-grid; } .hide-sm { display: none !important; } .lp-nav .end { gap: 4px; } }
.lp-mobile { position: fixed; inset-inline: 0; top: 64px; z-index: 19; display: grid; gap: 2px; padding: 8px 20px 18px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--sh-2); animation: menuin var(--t-fast) var(--ease); }
.lp-mobile a:not(.btn) { padding: 13px 4px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; text-decoration: none; }
.lp-mobile .btn { margin-top: 12px; }
@media (min-width: 860px) { .lp-mobile { display: none !important; } }
.lp-trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: .92rem; font-weight: 550; }
.lp-trust li { display: inline-flex; align-items: center; gap: 8px; }
.lp-trust .ic { width: 14px; height: 14px; padding: 4px; box-sizing: content-box; border-radius: 50%; background: var(--ok-soft); color: var(--ok); stroke-width: 3; }
.lp-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.lp-kpis div { padding: 20px 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-1); text-align: center; }
.lp-kpis b { display: block; font: 400 2rem/1.1 var(--display); color: var(--brand-text); }
.lp-kpis span { display: block; margin-top: 4px; color: var(--muted); font-size: .88rem; }
@media (min-width: 860px) { .lp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lp-section > header .eyebrow { display: block; margin-bottom: 8px; color: var(--brand-text); }
.lp-section > header.center { margin-inline: auto; text-align: center; }
.lp-section.narrow { max-width: 820px; }
.lp-why { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.lp-why .panel { padding: 24px; }
.lp-why p { margin-top: 6px; color: var(--ink-2); }
.lp-why .fi { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: 15px; }
.lp-why .fi.bad { background: var(--bad-soft); color: var(--bad); }
.lp-demo { display: grid; gap: 36px; align-items: center; }
@media (min-width: 960px) { .lp-demo { grid-template-columns: 1fr 1fr; } }
.lp-demo h2 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); }
.lead-sm { margin-top: 10px; color: var(--ink-2); font-size: 1.05rem; }
.lp-checks { display: grid; gap: 14px; margin: 24px 0 0; padding: 0; list-style: none; }
.lp-checks li { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.lp-checks .ic { width: 20px; height: 20px; padding: 10px; box-sizing: content-box; border-radius: 13px; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.lp-demo-stage { display: grid; justify-items: center; gap: 18px; }
.lp-phone.flat { rotate: 0deg; animation: none; width: min(320px, 84vw); }
.lp-phone.flat .lcard { padding: 18px; }
.center-x { justify-content: center; }
.lp-demo-stage .btn.big { width: auto; min-width: 230px; }
.lp-demo-msg { min-height: 1.5em; margin: 0; color: var(--ok); font-weight: 650; text-align: center; }
.lp-product { display: grid; gap: 24px; align-items: center; padding: 28px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.lp-product + .lp-product { margin-top: 20px; }
.lp-product .fi { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--brand-soft); color: var(--brand-text); }
.lp-product h3 { margin-top: 14px; font: 400 1.6rem/1.2 var(--display); }
.lp-product p { margin-top: 8px; color: var(--ink-2); }
@media (min-width: 960px) { .lp-product { grid-template-columns: 1fr 1.1fr; padding: 40px 44px; } .lp-product.flip-x > :first-child { order: 2; } }
.lp-bullets { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.lp-bullets li { position: relative; padding-inline-start: 30px; font-weight: 550; }
.lp-bullets li::before { content: "\2713"; position: absolute; inset-inline-start: 0; top: 1px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 11px; font-weight: 800; }
.lp-product-art { display: grid; place-items: center; min-height: 240px; }
.lp-product-art .pair { position: relative; width: 100%; max-width: 500px; aspect-ratio: 1.3; }
.pair .pcard { position: absolute; width: 72%; }
.pair .tilt-l { inset-inline-start: 0; top: 2%; rotate: -6deg; z-index: 1; }
.pair .tilt-r { inset-inline-end: 0; bottom: 2%; rotate: 5deg; }
.pair.review .standprev { position: absolute; inset-inline-start: 6%; top: 0; width: 42%; rotate: -4deg; z-index: 1; }
.pair.review .pcard { inset-inline-end: 0; bottom: 8%; width: 64%; rotate: 5deg; }
.between-lg { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.lp-section > header.between-lg { max-width: none; }
.lp-section > header.between-lg > div { max-width: 640px; }
.lp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.lp-gallery figure { margin: 0; }
.lp-gallery figcaption { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.lp-gallery figcaption .ic { width: 16px; height: 16px; }
.lp-gallery.fresh figure { animation: rise var(--t-slow) var(--ease) both; }
.lp-gallery.fresh figure:nth-child(2) { animation-delay: 50ms; }
.lp-gallery.fresh figure:nth-child(3) { animation-delay: 100ms; }
.lp-gallery.fresh figure:nth-child(4) { animation-delay: 150ms; }
.lp-gallery.fresh figure:nth-child(5) { animation-delay: 200ms; }
.lp-gallery.fresh figure:nth-child(6) { animation-delay: 250ms; }
#features .lp-types { margin-top: 28px; justify-content: center; }
.lp-plans { display: grid; gap: 22px; max-width: 920px; margin: 0 auto; }
@media (min-width: 800px) { .lp-plans { grid-template-columns: 1fr 1fr; align-items: start; } }
.plan { position: relative; display: grid; gap: 12px; padding: 28px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.plan h3 { display: flex; align-items: center; gap: 10px; font: 400 1.4rem/1.2 var(--display); }
.plan h3 .ic { color: var(--brand-text); }
.plan .price { margin-top: 4px; }
.plan .price b { font: 400 2.4rem/1 var(--display); }
.plan .price small { margin-inline-start: 6px; color: var(--muted); font-weight: 600; }
.plan .alt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-2); font-size: .92rem; }
.plan.featured { box-shadow: 0 0 0 2px var(--brand-text), var(--sh-2); }
.plan .tag { position: absolute; top: -13px; inset-inline-end: 22px; padding: 5px 12px; background: var(--brand); color: var(--on-brand); }
.plan .lp-bullets { margin: 4px 0 8px; }
.lp-faq { display: grid; gap: 10px; }
.lp-faq details { border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-1); }
.lp-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 16px 20px; font-weight: 650; cursor: pointer; list-style: none; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary .ic { flex: none; color: var(--muted); transition: transform var(--t) var(--ease); }
.lp-faq details[open] summary .ic { transform: rotate(180deg); }
.lp-faq summary:hover span { color: var(--brand-text); }
.lp-faq details p { padding: 0 20px 18px; color: var(--ink-2); }
.lp-footer { padding: 44px 20px 26px; border-top: 1px solid var(--line); background: var(--surface); }
.lp-footer .cols { display: grid; gap: 28px; max-width: 1180px; margin: 0 auto; }
@media (min-width: 760px) { .lp-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.lp-footer .about p { margin-top: 12px; max-width: 40ch; color: var(--muted); }
.lp-footer nav { display: grid; gap: 10px; align-content: start; }
.lp-footer nav a { color: var(--ink-2); font-weight: 550; text-decoration: none; }
.lp-footer nav a:hover { color: var(--brand-text); }
.lp-footer .copy { max-width: 1180px; margin: 28px auto 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* ---- privacy page ---- */
.pv-hero { display: grid; justify-items: center; gap: 10px; padding: 56px 20px 40px; text-align: center; background: radial-gradient(55% 90% at 50% 0%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 72%); }
.pv-ico { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-text); }
.pv-ico .ic { width: 30px; height: 30px; }
.pv-hero .eyebrow { color: var(--brand-text); }
.pv-hero h1 { font-size: clamp(2.1rem, 6vw, 3.2rem); }
.pv-hero p { max-width: 56ch; color: var(--ink-2); font-size: 1.08rem; }
.pv-hero .pill { margin-top: 6px; gap: 6px; }
.pv-sum { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.pv-sum .panel { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.pv-sum .panel p { font-weight: 600; line-height: 1.45; }
.pv-sum .fi, .pv-sec .fi { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); }
.pv-layout { display: grid; gap: 28px; max-width: 1100px; margin: 0 auto; padding: 40px 20px 8px; }
.pv-toc { display: none; }
@media (min-width: 960px) {
  .pv-layout { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
  .pv-toc { display: block; position: sticky; top: 88px; }
}
.pv-toc .eyebrow { margin: 0 0 10px 12px; }
.pv-toc nav { display: grid; gap: 2px; padding: 8px; border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-1); }
.pv-toc a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-size: .92rem; font-weight: 600; text-decoration: none; transition: background var(--t-fast), color var(--t-fast); }
.pv-toc a:hover, .pv-toc a.on { background: var(--brand-soft); color: var(--brand-text); }
.pv-toc .n { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2); font-size: .78rem; font-weight: 700; }
.pv-toc a.on .n { background: var(--brand); color: var(--on-brand); }
.pv-sections { display: grid; gap: 16px; }
.pv-sec { scroll-margin-top: 88px; padding: 24px 26px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.pv-sec h2 { display: flex; align-items: center; gap: 14px; font: 400 1.35rem/1.25 var(--display); }
.pv-sec .fi { background: var(--brand-soft); color: var(--brand-text); }
.pv-sec p { margin-top: 12px; color: var(--ink-2); font-size: 1.02rem; line-height: 1.75; }
@media (min-width: 960px) { .pv-sec p { padding-inline-start: 58px; } }
.pv-end { margin-top: 40px; }
.lp-footer nav a[aria-current=page] { color: var(--brand-text); }

/* ============ reduced motion ============ */


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; translate: 0 0; }
}
