/* PostPal creator portal. Mobile-first (390px reference), dark/light via [data-theme],
   RTL-native through logical properties. All colours come from the tokens below. */
:root {
  /* One calm palette shared with the PostPal app: indigo for the brand, teal for money that is yours, amber for waiting. */
  --bg: #f5f6fa; --bg-grad: radial-gradient(120% 60% at 0% 0%, rgba(61,78,216,.08), transparent 60%);
  --surface: #ffffff; --surface-2: #eef0f8; --surface-3: #e4e7f2;
  --border: rgba(30,41,90,.10); --border-strong: rgba(30,41,90,.18);
  --text: #0f172a; --muted: #545d73; --faint: #576075;
  --primary: #3d4ed8; --primary-2: #5468e8; --primary-soft: rgba(61,78,216,.1); --on-primary: #fff;
  --success: #0e7c6b; --success-soft: rgba(14,124,107,.11);
  --warning: #d97706; --warning-soft: rgba(217,119,6,.13);
  --danger: #c81e45; --danger-soft: rgba(200,30,69,.1);
  --info: #2b66b0; --info-soft: rgba(43,102,176,.11);
  /* Text and icons that sit on white or on a soft tint use the -ink colours (WCAG AA >= 4.5:1 on every surface
     and tint they are used on, see tests/portal-static.test.js); the base colours stay for fills, dots and charts. */
  --primary-ink: #3341c7; --success-ink: #0b6b5c; --warning-ink: #8f4a05; --danger-ink: #b3173c; --info-ink: #235a9e;
  --on-success: #fff; --btn-from: #3b43c8; --btn-to: #3d4ed8; /* white text on every point of this gradient >= 6:1 */
  /* the brand card (hero): white text on every point >= 4.5:1 */
  --hero-grad: linear-gradient(135deg, #3b43c8 0%, #3d4ed8 50%, #2b5fa6 100%);
  --chart-1: #3d4ed8; --chart-2: #14a38f; --chart-3: #f59e0b; --chart-4: #8b5cf6;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --glow: 0 6px 18px rgba(61,78,216,.26);
  --chart-grid: rgba(30,41,90,.08); --chart-prev: #b4bad0;
  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 26px;
  --font: 'Inter','Cairo',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --tabbar-h: 68px; --topbar-h: 58px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0b1120; --bg-grad: radial-gradient(110% 55% at 100% 0%, rgba(84,104,232,.16), transparent 62%);
  --surface: #151c2e; --surface-2: #1e2740; --surface-3: #26304c;
  --border: rgba(160,175,230,.13); --border-strong: rgba(160,175,230,.24);
  --text: #f1f5f9; --muted: #a3adc2; --faint: #98a3bb;
  --primary: #8b98ff; --primary-2: #a5b0ff; --primary-soft: rgba(139,152,255,.16);
  --success: #2dd4bf; --success-soft: rgba(45,212,191,.13);
  --warning: #f5a524; --warning-soft: rgba(245,165,36,.15);
  --danger: #ff6b86; --danger-soft: rgba(255,107,134,.14);
  --info: #60a5fa; --info-soft: rgba(96,165,250,.15);
  --primary-ink: #aab4ff; --success-ink: #2dd4bf; --warning-ink: #f5b041; --danger-ink: #ff8098; --info-ink: #7cb5ff; --on-success: #042521;
  --btn-from: #3b43c8; --btn-to: #4553dc;
  --hero-grad: linear-gradient(135deg, #343cb8 0%, #3d4ed8 50%, #285a9c 100%);
  --chart-1: #8b98ff; --chart-2: #2dd4bf; --chart-3: #fbbf24; --chart-4: #c4b5fd;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35);
  --glow: 0 8px 22px rgba(61,78,216,.38);
  --chart-grid: rgba(160,175,230,.1); --chart-prev: #5b6688;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; min-height: 100vh; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; background: var(--bg-grad); pointer-events: none; z-index: 0; }
[dir='rtl'] body, [dir='rtl'] { font-family: 'Cairo','Inter',system-ui,'Segoe UI',sans-serif; }
h1, h2, h3, p { margin: 0; }
a { color: var(--primary-ink); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- shell ---------- */
.app { position: relative; z-index: 1; width: 100%; max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 16px; direction: ltr;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar .spacer { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -.01em; }
.brand-logo { display: block; flex: none; border-radius: 22%; background: #000; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--primary) 55%, transparent), var(--glow); object-fit: cover; }
/* Signed-out brand block: the real PostPal logo, with EMI and POP beside it on the main screens */
.auth-hero { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 2px 0 0; }
.auth-hero .brand-logo { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 60%, transparent), 0 10px 30px color-mix(in srgb, var(--primary) 35%, transparent); }
.auth-hero .mascot-img { height: auto; filter: drop-shadow(0 10px 22px rgba(61,78,216,.28)); }
.platform-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.platform-strip li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 700; font-size: 13px; }
.platform-strip img, .platform-strip svg { flex: none; border-radius: 8px; }
.onboard-mascot { flex: none; height: auto; filter: drop-shadow(0 8px 16px rgba(61,78,216,.24)); }
.empty .empty-mascot { display: block; margin: 0 auto 6px; width: 72px; height: auto; border-radius: 0; filter: drop-shadow(0 8px 16px rgba(61,78,216,.24)); }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-grid; place-items: center; box-shadow: var(--shadow); }
.icon-btn .dot { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--btn-from); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.chip-btn { height: 44px; padding: 0 12px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.main { flex: 1; padding: 6px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
.main.no-tabbar { padding-bottom: 32px; }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; margin: 0 auto; max-width: 480px; z-index: 30; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 8px 10px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); }
.tab { border: 0; background: transparent; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.tab[aria-current='page'] { color: var(--primary-ink); background: var(--primary-soft); }
.page-title { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.page-title h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-title .ico { color: var(--primary); }
.page-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
/* the padding makes the touch target 44 px; the negative margin keeps the layout where it was */
.link-btn { background: none; border: 0; padding: 12px 8px; margin: -12px -8px; color: var(--primary-ink); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(5,6,20,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 60; top: 0; bottom: 0; inset-inline-start: 0; width: min(300px, 84vw); background: var(--surface); border-inline-end: 1px solid var(--border); padding: 18px 14px; transform: translateX(-105%); transition: transform .22s ease; display: flex; flex-direction: column; gap: 4px; }
[dir='rtl'] .drawer { transform: translateX(105%); }
.drawer.open { transform: none; }
.drawer a, .drawer button.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 14px; color: var(--text); background: none; border: 0; font-weight: 600; text-align: start; }
.drawer a[aria-current='page'] { background: var(--primary-soft); color: var(--primary-ink); }
.drawer hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; width: 100%; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.card.hero { background: linear-gradient(160deg, var(--surface-2), var(--surface)); border-color: var(--border-strong); position: relative; overflow: hidden; }
.card.hero::after { content: ''; position: absolute; inset-inline-end: -40px; top: -40px; width: 160px; height: 160px; background: radial-gradient(circle, var(--primary-soft), transparent 70%); pointer-events: none; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-title h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title .ico { color: var(--primary); }
.tile { width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); flex: none; }
.tile.success { background: var(--success-soft); color: var(--success-ink); } .tile.warning { background: var(--warning-soft); color: var(--warning-ink); }
.tile.info { background: var(--info-soft); color: var(--info-ink); } .tile.danger { background: var(--danger-soft); color: var(--danger-ink); }
.amount { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--success-ink); line-height: 1.1; }
.amount.plain { color: var(--text); }
.label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 6px; text-align: center; box-shadow: var(--shadow); }
.kpi .ico { color: var(--primary); margin-bottom: 4px; }
.kpi .val { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.kpi .cap { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 1px; overflow-wrap: anywhere; } /* long German words carry soft hyphens in the texts; anywhere is the last resort on very narrow screens */
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; margin-top: 4px; direction: ltr; }
.delta.up { color: var(--success-ink); } .delta.down { color: var(--danger-ink); } .delta.flat { color: var(--muted); }
.kpi-wide { text-align: start; padding: 14px; display: flex; gap: 12px; align-items: flex-start; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 15px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 700; font-size: 15px; transition: transform .08s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--btn-from), var(--btn-to)); border-color: transparent; color: var(--on-primary); box-shadow: var(--glow); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger-ink); background: var(--danger-soft); border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 44px; padding: 0 12px; font-size: 13.5px; border-radius: 13px; }
.btn[disabled], .btn[aria-busy='true'] { opacity: .6; pointer-events: none; }
.btn[aria-busy='true']::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 13.5px; font-weight: 700; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12.5px; color: var(--danger-ink); font-weight: 600; min-height: 0; }
.input, .select, .textarea { width: 100%; min-height: 50px; padding: 0 14px; border-radius: 15px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.field.invalid .input, .field.invalid .select { border-color: var(--danger); }
.input-wrap { position: relative; }
.input-wrap .ico-start { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap .ico-end { position: absolute; inset-inline-end: 3px; top: 50%; transform: translateY(-50%); }
.input-wrap.has-start .input { padding-inline-start: 44px; }
.input-wrap.has-end .input { padding-inline-end: 52px; }
.input.ltr { direction: ltr; text-align: start; }
[dir='rtl'] .input.ltr { text-align: right; }
/* An LTR field (e-mail, handle, password) on an RTL page: its own start side is the LEFT, but the icons sit on the page's
   start side (the RIGHT) and the show/hide button on the page's end side (the LEFT), so the padding is set by physical side. */
[dir='rtl'] .input-wrap.has-start .input.ltr { padding-inline-start: 14px; padding-inline-end: 44px; }
[dir='rtl'] .input-wrap.has-end .input.ltr { padding-inline-start: 52px; }
[dir='rtl'] .input-wrap.has-start.has-end .input.ltr { padding-inline-start: 52px; padding-inline-end: 44px; }
.phone-row { display: grid; grid-template-columns: 112px 1fr; gap: 8px; direction: ltr; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 15px; background: var(--surface-2); border: 1px solid var(--border); gap: 4px; }
.segmented button { min-height: 44px; border: 0; border-radius: 12px; background: transparent; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.segmented button[aria-pressed='true'], .segmented button[aria-selected='true'] { background: linear-gradient(135deg, var(--btn-from), var(--btn-to)); color: #fff; box-shadow: var(--glow); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); min-height: 44px; padding-block: 2px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); margin: 2px 0 0; flex: none; }
.banner { padding: 12px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; }
.banner.error { background: var(--danger-soft); color: var(--danger-ink); } .banner.info { background: var(--info-soft); color: var(--info-ink); }
.banner.success { background: var(--success-soft); color: var(--success-ink); } .banner.warning { background: var(--warning-soft); color: var(--warning-ink); }

/* ---------- pills, lists, tabs ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.success { background: var(--success-soft); color: var(--success-ink); } .pill.warning { background: var(--warning-soft); color: var(--warning-ink); }
.pill.info { background: var(--info-soft); color: var(--info-ink); } .pill.danger { background: var(--danger-soft); color: var(--danger-ink); } .pill.primary { background: var(--primary-soft); color: var(--primary-ink); }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--border); background: none; border-inline: 0; border-top: 0; width: 100%; text-align: start; color: inherit; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 700; font-size: 14.5px; }
.list-row .s { color: var(--muted); font-size: 12.5px; }
.list-row .chev { color: var(--faint); flex: none; }
[dir='rtl'] .list-row .chev { transform: scaleX(-1); }
.section-label { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .02em; margin: 16px 4px 8px; text-transform: none; }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; }
.tabs button { min-height: 44px; border: 0; background: transparent; border-radius: 12px; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.tabs button[aria-selected='true'] { background: linear-gradient(135deg, var(--btn-from), var(--btn-to)); color: #fff; box-shadow: var(--glow); }
.progress { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.steps { display: flex; align-items: flex-start; justify-content: space-between; margin: 10px 4px 18px; position: relative; }
.steps .step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; position: relative; z-index: 1; }
.steps .step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-strong); background: var(--surface); font-weight: 700; }
.steps .step.current .n { border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 0 0 4px var(--primary-soft); }
.steps .step.done .n { background: var(--success-ink); border-color: var(--success-ink); color: var(--on-success); }
.steps::before { content: ''; position: absolute; top: 15px; inset-inline: 12%; height: 2px; background: var(--border-strong); z-index: 0; }

/* ---------- feedback ---------- */
.skeleton { border-radius: 14px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; min-height: 18px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.empty { text-align: center; padding: 26px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ico { color: var(--primary); }
.empty img { width: 92px; height: 92px; object-fit: contain; border-radius: 22px; }
.empty .t { font-weight: 800; color: var(--text); font-size: 15.5px; }
.toast-root { position: fixed; z-index: 90; inset-inline: 0; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 440px; width: 100%; padding: 13px 16px; border-radius: 15px; font-weight: 700; font-size: 14px; display: flex; gap: 10px; align-items: center; pointer-events: auto; box-shadow: var(--shadow); border: 1px solid var(--border); background: var(--surface); animation: toast-in .2s ease; }
.toast.success { background: var(--success-soft); color: var(--success-ink); border-color: transparent; backdrop-filter: blur(10px); }
.toast.error { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; backdrop-filter: blur(10px); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet { position: fixed; z-index: 70; inset-inline: 0; bottom: 0; margin: 0 auto; max-width: 480px; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); border: 1px solid var(--border); transform: translateY(105%); transition: transform .25s ease; }
.sheet.open { transform: none; }
.sheet .grab { width: 44px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 14px; }
.sheet h2 { font-size: 18px; margin-bottom: 12px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.chart text { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .grid.base { stroke-dasharray: none; stroke: var(--border-strong); }
.chart .line { fill: none; stroke: var(--chart-1); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chart .line.prev { stroke: var(--chart-prev); stroke-dasharray: 4 4; stroke-width: 2; }
.chart .bar { fill: var(--chart-1); } .chart .bar.alt, .chart .bar.teal { fill: var(--chart-2); } .chart .bar.amber { fill: var(--chart-3); } .chart .bar.violet { fill: var(--chart-4); }
.chart .bar.prev { fill: var(--chart-prev); opacity: .6; }
.chart .bar-v { fill: var(--text); font-weight: 800; font-size: 11px; }
.chart .peak { fill: var(--surface); stroke: var(--chart-1); stroke-width: 2.4; }
.chart .badge-bg { fill: var(--btn-from); } .chart .badge-t { fill: #fff; font-weight: 700; }
.chart .guide { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tip-bg { fill: var(--text); opacity: .94; }
.chart .tip-t { fill: var(--bg); font-size: 10px; font-weight: 600; opacity: .85; }
.chart .tip-v { fill: var(--bg); font-size: 11.5px; font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 8px; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; background: var(--chart-1); }
.legend i.prev { background: var(--chart-prev); }
.legend i.dot { width: 10px; height: 10px; border-radius: 3px; }
.legend i.teal, .key i.teal { background: var(--chart-2); } .legend i.amber, .key i.amber { background: var(--chart-3); } .legend i.violet, .key i.violet { background: var(--chart-4); } .legend i.muted, .key i.muted { background: var(--chart-prev); }
.hbar { display: grid; grid-template-columns: 26px 92px 1fr 52px; gap: 8px; align-items: center; margin: 9px 0; font-size: 13px; font-weight: 600; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--chart-1), var(--chart-2)); }
.chart-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin: -4px 0 8px; }
.chart-head .big { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.spark { display: block; width: 100%; height: 40px; }
.donut .ring { stroke: var(--surface-3); }
.donut .seg { stroke: var(--chart-1); } .donut .seg.teal { stroke: var(--chart-2); } .donut .seg.amber { stroke: var(--chart-3); } .donut .seg.violet { stroke: var(--chart-4); } .donut .seg.muted { stroke: var(--chart-prev); }
.donut .donut-v { fill: var(--text); font-size: 19px; font-weight: 800; font-family: inherit; }
.donut .donut-s { fill: var(--muted); font-size: 10.5px; font-weight: 600; font-family: inherit; }
.split { display: flex; align-items: center; gap: 16px; }
.split .keys { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.key { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; }
.key i { width: 12px; height: 12px; border-radius: 4px; background: var(--chart-1); }
.key b { font-variant-numeric: tabular-nums; }
.key small { grid-column: 2 / 4; color: var(--muted); font-size: 12px; margin-top: -6px; }
/* funnel: one bar per step, the width is the share of clicks; the step rate sits between bars */
.funnel-bars { display: flex; flex-direction: column; gap: 4px; }
.funnel-bars .step { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; }
.funnel-bars .step .bar { position: relative; height: 34px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.funnel-bars .step .bar > i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 10px; background: var(--primary-soft); border-inline-start: 4px solid var(--chart-1); }
.funnel-bars .step.s1 .bar > i { border-color: var(--info); background: var(--info-soft); }
.funnel-bars .step.s2 .bar > i { border-color: var(--chart-3); background: var(--warning-soft); }
.funnel-bars .step.s3 .bar > i { border-color: var(--chart-2); background: var(--success-soft); }
.funnel-bars .step .bar > span { position: relative; z-index: 1; display: flex; align-items: center; height: 100%; padding-inline: 12px; font-weight: 700; font-size: 13.5px; }
.funnel-bars .step b { font-size: 16px; min-width: 3ch; text-align: end; }
.funnel-bars .rate { margin-inline-start: 44px; font-size: 11.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 4px; padding-block: 1px; }
.funnel .stage { text-align: center; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.funnel { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: center; }
.funnel .stage b { display: block; font-size: 17px; }

/* ---------- brand card and stat tiles ---------- */
.card.brand { background: var(--hero-grad); color: #fff; border: 0; position: relative; overflow: hidden; box-shadow: 0 14px 34px rgba(43,58,180,.28); }
.card.brand::before { content: ''; position: absolute; inset-inline-end: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%); pointer-events: none; }
.card.brand .label, .card.brand .muted, .card.brand .small { color: rgba(255,255,255,.88); }
.card.brand .amount { color: #fff; }
.card.brand .glass { background: rgba(8,12,60,.18); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.card.brand .glass b { display: block; font-size: 18px; color: #fff; }
.card.brand .glass .label { font-size: 12px; color: #fff; }
.card.brand .tile { background: rgba(255,255,255,.16); color: #fff; }
.card.brand .spark { color: #fff; opacity: .9; margin-top: 6px; }
.card.brand .btn.light { background: #fff; color: #2c37b0; border-color: transparent; box-shadow: 0 6px 16px rgba(10,14,60,.2); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 13px 14px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stat .top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.stat .top .tile { width: 28px; height: 28px; border-radius: 9px; }
.stat .val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat .delta { margin-top: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.mini-stats > div { padding: 12px 8px; text-align: center; min-width: 0; }
.mini-stats > div + div { border-inline-start: 1px solid var(--border); }
.mini-stats > div:nth-child(4) { border-inline-start: 0; }
.mini-stats > div:nth-child(n+4) { border-top: 1px solid var(--border); }
.mini-stats b { display: block; font-size: 17px; font-weight: 800; }
.mini-stats span { font-size: 11.5px; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.list-row.me { background: var(--primary-soft); border-radius: 12px; padding-inline: 8px; border-bottom-color: transparent; }
.month-h { font-size: 12.5px; font-weight: 800; color: var(--muted); margin: 12px 4px 2px; display: flex; justify-content: space-between; }
.status-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.status-bar i { display: block; height: 100%; background: var(--chart-1); }
.status-bar i.teal { background: var(--chart-2); } .status-bar i.amber { background: var(--chart-3); } .status-bar i.violet { background: var(--chart-4); }

/* ---------- misc ---------- */
.avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--btn-from), var(--btn-to)); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 20px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.social-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.social-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--text); }
.social-btn img, .social-btn svg { width: 28px; height: 28px; border-radius: 8px; }
.qr-box { width: 112px; height: 112px; border-radius: 16px; background: #fff; padding: 8px; flex: none; display: grid; place-items: center; overflow: hidden; }
.qr-box img { width: 100%; height: 100%; }
.hero-img { display: block; margin: 0 auto; }
.grad-text { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tile-plan { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-plan > .row { flex-wrap: wrap; gap: 6px; }
.tile-plan .price { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.center-screen { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
@media (min-width: 560px) { body { padding: 18px 0; } .app { min-height: calc(100vh - 36px); border: 1px solid var(--border); border-radius: 32px; background: color-mix(in srgb, var(--bg) 96%, var(--primary)); overflow: clip; box-shadow: 0 30px 80px rgba(20,20,70,.18); } .topbar { border-radius: 32px 32px 0 0; } .tabbar { border-radius: 0 0 32px 32px; bottom: 18px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- landing / shared additions ---------- */
a.tab { text-decoration: none; }
[dir='rtl'] .flip { transform: scaleX(-1); }
.hero-h1 { font-size: 34px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.hero-visual { position: relative; height: 270px; margin: 6px auto 0; max-width: 360px; }
.hero-visual .mascot { position: absolute; filter: drop-shadow(0 12px 28px rgba(61,78,216,.28)); }
.hero-visual .emi { left: 50%; top: 0; width: 150px; height: auto; transform: translateX(-62%); }
.hero-visual .pop { left: 50%; bottom: 0; width: 120px; height: auto; transform: translateX(8%); }
.float-card { position: absolute; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 700; text-align: start; }
.float-card.a { top: 6px; inset-inline-start: 0; } .float-card.b { top: 100px; inset-inline-end: 0; } .float-card.c { bottom: 14px; inset-inline-start: 0; }
.section-h { font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

[hidden] { display: none !important; }
.platform-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px; border-radius: 16px; border: 1.5px solid var(--border-strong); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--text); }
.platform-tile[aria-checked='true'] { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }

.foot-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.card-link { display: inline-flex; align-items: center; min-height: 44px; margin-block: -8px; }
.rank-badge { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-3); color: var(--muted); flex: none; }
.rank-badge.r1 { background: linear-gradient(135deg, #f5c542, #e8a317); color: #3b2a00; } .rank-badge.r2 { background: linear-gradient(135deg, #d5d9e6, #aab1c6); color: #23283d; } .rank-badge.r3 { background: linear-gradient(135deg, #e0a070, #c27b45); color: #3a1e08; }

/* First-visit language picker */
.lang-pick { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.lang-pick-title { font-size: 20px; font-weight: 800; text-align: center; line-height: 1.5; max-width: 520px; }
.lang-pick-title .sep { color: var(--muted, #888); }
.lang-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 520px; }
.lang-card { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px; border-radius: 18px; border: 1.5px solid var(--border, rgba(127,127,127,.25)); background: var(--surface, transparent); color: inherit; font: inherit; text-align: start; cursor: pointer; transition: border-color .15s, transform .15s, background .15s; }
.lang-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.lang-card[aria-pressed='true'] { border-color: var(--primary); background: var(--primary-soft); }
.lang-mark { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; line-height: 1; background: var(--primary-soft); color: var(--primary-ink); font-weight: 800; }
.lang-text { display: flex; flex-direction: column; min-width: 0; }
.lang-name { font-weight: 800; font-size: 17px; }
.lang-hello { font-size: 13px; opacity: .75; overflow-wrap: anywhere; }
@media (max-width: 360px) { .lang-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .lang-card { transition: none; } .lang-card:hover { transform: none; } }
