/* ققنوس پی — Minimalist + Rounded UI · primary #14C269
   Note on contrast: white on #14C269 is only 2.3:1, so filled green surfaces use a dark green
   label (#06280f, 7:1) and green TEXT on light surfaces uses the darker --primary-text. */

@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-SemiBold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-ExtraBold.woff") format("woff"); font-weight: 800; font-style: normal; font-display: swap; }

/* ───────────── tokens ───────────── */
:root {
  color-scheme: light dark;

  --primary: #14c269;
  --primary-hover: #11b161;
  --primary-press: #0e9e55;
  --primary-soft: #e6f8ee;
  --primary-ring: rgba(20, 194, 105, 0.32);
  --on-primary: #06280f;
  --primary-text: #08783b;

  --bg: #f3f8f5;
  --surface: #ffffff;
  --surface-2: #f1f6f3;
  --border: #dde7e0;
  --border-strong: #c3d3c8;
  --text: #0e1a12;
  --muted: #566a5d;
  --placeholder: #86978c;

  --danger: #d3263a;
  --danger-soft: #fdeef0;
  --warning: #9a5200;
  --warning-soft: #fff4dc;
  --info: #1b63c4;
  --info-soft: #e9f1fd;

  --shadow-md: 0 14px 34px -16px rgba(12, 70, 40, 0.28), 0 2px 8px rgba(12, 70, 40, 0.05);
  --shadow-lg: 0 34px 70px -24px rgba(6, 36, 20, 0.45);

  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: "Vazirmatn", ui-sans-serif, system-ui, "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-soft: #113a25;
    --primary-text: #4fdc8e;
    --bg: #09100c;
    --surface: #111a14;
    --surface-2: #18231c;
    --border: #243329;
    --border-strong: #35503f;
    --text: #e8f2eb;
    --muted: #98ab9f;
    --placeholder: #70847a;
    --danger: #ff7a88;
    --danger-soft: #2e1519;
    --warning: #ffb85c;
    --warning-soft: #2c2110;
    --info: #86b8ff;
    --info-soft: #12253f;
    --shadow-md: 0 14px 34px -16px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 34px 70px -24px rgba(0, 0, 0, 0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary-soft: #113a25;
  --primary-text: #4fdc8e;
  --bg: #09100c;
  --surface: #111a14;
  --surface-2: #18231c;
  --border: #243329;
  --border-strong: #35503f;
  --text: #e8f2eb;
  --muted: #98ab9f;
  --placeholder: #70847a;
  --danger: #ff7a88;
  --danger-soft: #2e1519;
  --warning: #ffb85c;
  --warning-soft: #2c2110;
  --info: #86b8ff;
  --info-soft: #12253f;
  --shadow-md: 0 14px 34px -16px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 34px 70px -24px rgba(0, 0, 0, 0.8);
}
:root[data-theme="light"] { color-scheme: light; }

/* ───────────── base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: radial-gradient(900px 520px at 50% -12%, rgba(20, 194, 105, 0.17), transparent 70%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { flex: none; width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ───────────── splash / real loading screen ───────────── */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center;
  background: radial-gradient(900px 520px at 50% -12%, rgba(20, 194, 105, 0.2), transparent 70%), var(--bg);
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
}
.splash.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__logo { width: 96px; height: 96px; border-radius: 30px; box-shadow: 0 24px 48px -16px rgba(20, 194, 105, 0.75); animation: float 3.2s ease-in-out infinite; }
.splash__title { font-size: 1.6rem; font-weight: 800; margin-top: 6px; }
.splash__bar { width: min(260px, 70vw); height: 7px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; margin-top: 10px; }
.splash__fill { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--primary); transform-origin: right center; transform: scaleX(var(--p, 0)); }
.splash__status { color: var(--muted); font-size: 0.9rem; min-height: 1.6em; }
.splash__pct { font-weight: 700; font-size: 0.85rem; color: var(--primary-text); font-variant-numeric: tabular-nums; }
.splash__error { display: grid; gap: 14px; justify-items: center; max-width: 320px; }
.splash__error p { color: var(--muted); font-size: 0.95rem; }
.splash.is-error .splash__bar, .splash.is-error .splash__pct, .splash.is-error .splash__status { display: none; }
.splash.is-error .splash__logo { animation: none; filter: grayscale(0.6); }

/* ───────────── layout ───────────── */
.screen {
  min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.card {
  width: min(100%, 440px); min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 32px 26px; box-shadow: var(--shadow-md); animation: rise 0.55s var(--ease) both;
}
.card--wide { width: min(100%, 620px); }
@media (max-width: 420px) { .card { padding: 26px 18px; border-radius: 24px; } }

.brand { display: grid; justify-items: center; text-align: center; gap: 6px; margin-bottom: 26px; }
.brand__logo { width: 64px; height: 64px; border-radius: 20px; box-shadow: 0 14px 28px -12px rgba(20, 194, 105, 0.8); margin-bottom: 10px; }
.brand h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.4; }
.brand p { color: var(--muted); font-size: 0.95rem; }
.brand h1:focus { outline: none; }

.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.form + .form { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 460px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.switch { text-align: center; color: var(--muted); font-size: 0.92rem; margin-top: 22px; }
.link { color: var(--primary-text); font-weight: 700; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; }
.link:hover { text-decoration: underline; }
.link[disabled] { color: var(--muted); cursor: default; text-decoration: none; font-weight: 500; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 2px 0; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

/* ───────────── form controls ───────────── */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.field__label { font-size: 0.875rem; font-weight: 600; }
.field__label .opt { color: var(--muted); font-weight: 400; font-size: 0.78rem; margin-inline-start: 6px; }
.field__box {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 54px; padding-inline: 16px;
  background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--r-md);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.field__box:hover { border-color: var(--border-strong); }
.field__box:focus-within { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.field--error .field__box { border-color: var(--danger); background: var(--danger-soft); }
.field--error .field__box:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 25%, transparent); }
.field--ok .field__box { border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
.field__icon { color: var(--muted); display: grid; place-items: center; flex: none; transition: color 0.2s; }
.field__box:focus-within .field__icon { color: var(--primary-text); }
.field--error .field__icon { color: var(--danger); }
.field__input {
  flex: 1; min-width: 0; height: 52px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 1rem; color: var(--text);
}
textarea.field__input { height: auto; min-height: 96px; padding: 14px 0; resize: vertical; line-height: 1.8; }
.field__input::placeholder { color: var(--placeholder); opacity: 1; }
.field__input[dir="ltr"] { text-align: right; }
.field__input[dir="ltr"]:focus { text-align: left; }
.field__action { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-inline-end: -8px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; }
.field__action:hover { background: var(--border); color: var(--text); }
.field__status { flex: none; display: grid; place-items: center; width: 22px; height: 22px; }
.field__status .spinner { width: 16px; height: 16px; border-width: 2px; color: var(--muted); }
.field__status .ok { color: var(--primary-text); }
.field__status .bad { color: var(--danger); }
.field__msg { display: flex; gap: 6px; align-items: flex-start; font-size: 0.82rem; line-height: 1.7; color: var(--danger); }
.field__msg:empty { display: none; }
.field__hint { font-size: 0.8rem; color: var(--muted); line-height: 1.7; }

.select { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.select select { appearance: none; -webkit-appearance: none; width: 100%; height: 52px; border: 0; outline: 0; background: transparent; font-size: 1rem; padding-inline-end: 28px; cursor: pointer; }
.select select option { color: #0e1a12; background: #fff; }
.select__chev { position: absolute; inset-inline-end: 0; pointer-events: none; color: var(--muted); }

.phone-box { direction: ltr; }
.phone-box .field__input { text-align: left; direction: ltr; }
.dial-chip { flex: none; padding: 5px 11px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums; direction: ltr; }
.code-input { letter-spacing: 0.55em; padding-inline-start: 0.55em; text-align: center !important; font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.pin-input { letter-spacing: 0.6em; text-align: center !important; font-weight: 700; direction: ltr; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 24px;
  border: 1.5px solid transparent; border-radius: var(--r-pill); background: none; font-size: 1rem; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s, border-color 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.985); }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 14px 26px -14px rgba(20, 194, 105, 0.95); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--primary:active { background: var(--primary-press); }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost { color: var(--primary-text); min-height: 46px; }
.btn--ghost:hover { background: var(--primary-soft); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { min-height: 42px; width: auto; padding: 0 18px; font-size: 0.9rem; }
.btn[disabled], .btn.is-loading { cursor: not-allowed; opacity: 0.65; box-shadow: none; }
.btn.is-loading { pointer-events: none; }
.btn .ico { width: 1.3em; height: 1.3em; }
.ico-google { width: 1.3em; height: 1.3em; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-inline-end-color: transparent; animation: spin 0.7s linear infinite; flex: none; }

/* alerts, chips */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); font-size: 0.9rem; line-height: 1.8; animation: rise 0.3s var(--ease) both; }
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--info { background: var(--info-soft); color: var(--info); }
.alert .ico { margin-top: 3px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-text); font-size: 0.88rem; font-weight: 600; max-width: 100%; }
.chip bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }

/* complete-registration sections */
.section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.section + .section { margin-top: 10px; padding-top: 22px; border-top: 1px dashed var(--border); }
.section__title { display: flex; align-items: center; gap: 10px; font-size: 0.98rem; font-weight: 800; }
.section__title .bubble { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px; background: var(--primary-soft); color: var(--primary-text); }
.verify-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; border-radius: var(--r-md); background: var(--primary-soft); }
.verify-email { font-weight: 700; color: var(--primary-text); direction: ltr; unicode-bidi: isolate; }
.verify-box p { font-size: 0.9rem; line-height: 1.9; }
.verify-box .field__box { background: var(--surface); }
.verify-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.88rem; color: var(--muted); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 2px; }
.meter i { height: 6px; border-radius: var(--r-pill); background: var(--border); transition: background 0.25s; }
.meter[data-level="1"] i:nth-child(-n + 1) { background: var(--danger); }
.meter[data-level="2"] i:nth-child(-n + 2) { background: #e69b00; }
.meter[data-level="3"] i:nth-child(-n + 3) { background: #7bc043; }
.meter[data-level="4"] i { background: var(--primary); }
.meter-label { font-size: 0.8rem; color: var(--muted); display: flex; justify-content: space-between; }
.rules { display: flex; flex-wrap: wrap; gap: 6px; }
.rule { font-size: 0.76rem; padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); transition: all 0.2s; }
.rule.ok { background: var(--primary-soft); color: var(--primary-text); }

/* ───────────── dialogs & toasts ───────────── */
.dlg-backdrop {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: end center; padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom));
  background: rgba(5, 16, 9, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.2s ease both;
}
@media (min-width: 560px) { .dlg-backdrop { place-items: center; } }
.dlg-backdrop.is-closing { animation: fadeOut 0.18s ease both; }
.dlg { width: min(100%, 410px); background: var(--surface); border-radius: 30px; padding: 30px 24px 22px; text-align: center; box-shadow: var(--shadow-lg); animation: sheet 0.4s var(--ease) both; }
.dlg-backdrop.is-closing .dlg { animation: sheetOut 0.18s ease both; }
.dlg__art { width: 92px; height: 92px; margin: 0 auto 14px; }
.dlg__art svg { width: 100%; height: 100%; overflow: visible; }
.art-soft { fill: var(--tone-soft); }
.art-solid { fill: var(--tone); }
.art-glyph { fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.art-spark { stroke: var(--tone); stroke-width: 2.4; stroke-linecap: round; opacity: 0.55; fill: none; }
.art-dot { fill: var(--tone); opacity: 0.4; }
.art-ring { fill: none; stroke: var(--tone); stroke-width: 2; opacity: 0.25; transform-origin: 46px 46px; animation: ring 2.4s ease-out infinite; }
.tone-success { --tone: var(--primary); --tone-soft: var(--primary-soft); }
.tone-error { --tone: #e5384d; --tone-soft: var(--danger-soft); }
.tone-warning { --tone: #f09a0a; --tone-soft: var(--warning-soft); }
.tone-info { --tone: #2f7be0; --tone-soft: var(--info-soft); }
.tone-offline { --tone: #6b7f90; --tone-soft: var(--surface-2); }
.tone-lock { --tone: #7a5af8; --tone-soft: color-mix(in srgb, #7a5af8 14%, var(--surface)); }
.dlg__title { font-size: 1.2rem; font-weight: 800; line-height: 1.6; margin-bottom: 6px; }
.dlg__msg { color: var(--muted); font-size: 0.95rem; line-height: 1.95; margin-bottom: 22px; white-space: pre-line; }
.dlg__msg bdi { color: var(--text); font-weight: 700; direction: ltr; }
.dlg__actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

.toasts { position: fixed; z-index: 180; inset-inline: 0; bottom: max(18px, env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: min(100%, 440px); padding: 12px 14px 12px 18px;
  border-radius: var(--r-pill); background: var(--text); color: var(--bg); font-size: 0.92rem; line-height: 1.7; box-shadow: var(--shadow-lg); animation: toastIn 0.4s var(--ease) both;
}
.toast.is-closing { animation: toastOut 0.25s ease both; }
.toast__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.toast--error .toast__dot { background: #ff5d6e; }
.toast--warning .toast__dot { background: #ffb020; }
.toast--info .toast__dot { background: #5aa2ff; }
.toast__btn { border: 0; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; border-radius: var(--r-pill); padding: 4px 12px; cursor: pointer; font-weight: 700; font-size: 0.85rem; }
.toast__close { border: 0; background: none; color: inherit; opacity: 0.7; cursor: pointer; display: grid; place-items: center; padding: 2px; }

/* ───────────── home ───────────── */
.home { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.topbar__brand img { width: 36px; height: 36px; border-radius: 12px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background 0.2s, transform 0.15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.95); }
.home__main { display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: 32px 20px 64px; }
.home__main h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: -0.015em; }
.home__main p { color: var(--muted); }

/* ───────────── motion ───────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes sheet { from { opacity: 0; transform: translateY(28px) scale(0.96); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes ring { 0% { transform: scale(0.82); opacity: 0.45; } 100% { transform: scale(1.18); opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.shake { animation: shake 0.4s ease; }
.page-enter { animation: rise 0.45s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ═══════════════════════════ Phase 2 — app shell, wallets, sheets, admin ═══════════════════════════ */

:root {
  --nav-h: 70px;
  --wcard-1: #053b24;
  --wcard-2: #0a7a43;
  --success: #08783b;
  --success-soft: #e6f8ee;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --success: #4fdc8e; --success-soft: #113a25; } }
:root[data-theme="dark"] { --success: #4fdc8e; --success-soft: #113a25; }

.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }

/* ───────────── app shell ───────────── */
.app { min-height: 100dvh; width: min(100%, 620px); margin-inline: auto; display: flex; flex-direction: column; }
.app--wide { width: min(100%, 1040px); }
.app__main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 18px; padding: 16px max(16px, env(safe-area-inset-right)) calc(var(--nav-h) + 34px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.app .topbar { border-bottom: 0; background: color-mix(in srgb, var(--bg) 78%, transparent); }
.topbar__user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 16px; background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 1.1rem; }
.topbar__hello { display: grid; line-height: 1.5; min-width: 0; }
.topbar__hello small { color: var(--muted); font-size: 0.78rem; }
.topbar__hello strong { font-size: 1rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn--sm { width: 38px; height: 38px; border-radius: 13px; }
.icon-btn { position: relative; }
.icon-btn .ico { width: 1.35em; height: 1.35em; }
.badge { position: absolute; top: -5px; inset-inline-start: -5px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 800; border: 2px solid var(--bg); line-height: 1; font-variant-numeric: tabular-nums; }

.bottom-nav {
  position: fixed; z-index: 30; bottom: 0; inset-inline: 0; margin-inline: auto; width: min(100%, 620px);
  padding: 8px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  pointer-events: none;
}
.bottom-nav__bar { pointer-events: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px; border-radius: 26px; background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.bn-item { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 7px; border-radius: 20px; text-decoration: none; color: var(--muted); font-size: 0.74rem; font-weight: 600; transition: background 0.2s, color 0.2s, transform 0.15s; }
.bn-item .ico { width: 1.55em; height: 1.55em; }
.bn-item:active { transform: scale(0.96); }
.bn-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); font-weight: 800; }

/* ───────────── wallet card ───────────── */
.wallets { display: grid; gap: 12px; }
.wallets__track {
  display: flex; scroll-behavior: smooth; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left))); padding-inline: max(16px, env(safe-area-inset-left)); scroll-padding-inline: 16px; padding-block: 4px 6px;
  overscroll-behavior-x: contain; touch-action: pan-x pan-y;
}
.wallets__track::-webkit-scrollbar { display: none; }
.wallets__track.is-dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.wcard {
  --accent: var(--primary);
  position: relative; isolation: isolate; overflow: hidden; flex: 0 0 min(88%, 420px); scroll-snap-align: center; scroll-snap-stop: always; min-height: 0; display: grid; align-content: space-between; gap: 10px;
  padding: 16px 16px 15px; border-radius: 24px; color: var(--text);
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
}
.wcard::before { content: ""; position: absolute; z-index: -1; inset-inline-start: -70px; top: -80px; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%); }
.wcard::after { content: ""; position: absolute; z-index: -1; inset-inline-end: -56px; bottom: -86px; width: 210px; height: 210px; border-radius: 50%; border: 26px solid color-mix(in srgb, var(--accent) 9%, transparent); }
.wcard--AFN { --accent: #7bbf2a; }
.wcard--USD { --accent: #0fa88f; }
.wcard--TRY { --accent: #3fb950; }
.wcard--IRT { --accent: #14c269; }
.wcard--IQD { --accent: #2f9e6e; }
.wcard--PKR { --accent: #12a150; }
.wcard--SAR { --accent: #55b04a; }
.wcard__mark { position: absolute; z-index: -1; inset-inline-end: 14px; top: 30px; font-size: 5rem; line-height: 1; font-weight: 800; color: color-mix(in srgb, var(--accent) 14%, transparent); pointer-events: none; user-select: none; }
.wcard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wcard__name { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.88rem; min-width: 0; }
.wcard__main-tag { padding: 1px 8px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-text); font-size: 0.6rem; font-weight: 800; white-space: nowrap; }
.field--locked .field__box { background: var(--surface-2); border-style: dashed; }
.field--locked .field__input { color: var(--muted); cursor: not-allowed; -webkit-text-fill-color: var(--muted); }
.field--locked .field__icon { opacity: 0.6; }
.cur-badge[data-len="2"] { font-size: 0.78rem; }
.cur-badge[data-len="3"] { font-size: 0.66rem; letter-spacing: -0.02em; }
.chip-cur .cur-badge[data-len="2"] { font-size: 0.62rem; }
.chip-cur .cur-badge[data-len="3"] { font-size: 0.52rem; }
.wcard__mark[data-len="2"] { font-size: 3.6rem; }
.wcard__mark[data-len="3"] { font-size: 3rem; }
.cur-badge { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 1.05rem; line-height: 1; }
.wcard__eye { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); cursor: pointer; }
.wcard__eye:hover { background: var(--surface); }
.wcard__balance { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wcard__label { width: 100%; font-size: 0.68rem; line-height: 1.4; color: var(--muted); }
.wcard__amount { font-size: clamp(1.4rem, 5.8vw, 1.75rem); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; direction: ltr; unicode-bidi: isolate; }
.wcard__unit { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.wcard__code { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 5px 5px 12px; border-radius: 15px; background: color-mix(in srgb, var(--surface) 72%, transparent); font-size: 0.72rem; }
.wcard__code span { color: var(--muted); }
.wcard__code b { font-size: 0.88rem; letter-spacing: 0.08em; font-weight: 800; direction: ltr; unicode-bidi: isolate; }
.wcard__copy { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.wcard__copy:hover { background: var(--surface-2); }
.wcard .ico { width: 1.1em; height: 1.1em; }
.wcard .cur-badge { width: 28px; height: 28px; border-radius: 10px; }

.wallets__dots { display: flex; justify-content: center; gap: 7px; }
.dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--border-strong); cursor: pointer; transition: width 0.25s var(--ease), background 0.25s; }
.dot[aria-current="true"] { width: 24px; background: var(--primary); }


.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 6px; }
.qa { position: relative; display: grid; justify-items: center; align-content: start; gap: 8px; padding: 8px 4px; border: 0; border-radius: 22px; background: transparent; color: var(--text); cursor: pointer; font-size: 0.8rem; font-weight: 700; line-height: 1.5; text-align: center; transition: transform 0.15s var(--ease); -webkit-tap-highlight-color: transparent; }
.qa:hover { background: transparent; }
.qa:active { transform: scale(0.96); }
.qa__ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: var(--primary-soft); color: var(--primary-text); }
.qa__ico .ico { width: 1.45em; height: 1.45em; }
.qa__soon { position: absolute; top: 6px; inset-inline-start: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--warning-soft); color: var(--warning); font-size: 0.62rem; font-weight: 800; }

.skeleton { border-radius: 24px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--border) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.wallets__skeleton { height: 157px; }

/* ───────────── empty pages ───────────── */
.page-title { font-size: 1.35rem; font-weight: 800; }
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 44px 20px; color: var(--muted); }
.empty__art { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 30px; background: var(--primary-soft); color: var(--primary-text); margin-bottom: 6px; }
.empty__art .ico { width: 2.6em; height: 2.6em; stroke-width: 1.5; }
.empty h2 { color: var(--text); font-size: 1.1rem; font-weight: 800; }
.empty p { font-size: 0.92rem; max-width: 300px; }

.profile-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 26px; background: var(--surface); border: 1px solid var(--border); }
.profile-card .avatar { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 20px; }
.profile-card b { display: block; font-size: 1.05rem; }
.profile-card small { color: var(--muted); direction: ltr; unicode-bidi: isolate; display: block; overflow: hidden; text-overflow: ellipsis; }

/* ───────────── lists / menu rows ───────────── */
.menu { display: grid; gap: 10px; }
.menu-item { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text); text-align: start; cursor: pointer; transition: background 0.2s, border-color 0.2s, transform 0.15s; }
.menu-item:hover:not([disabled]) { background: var(--surface-2); border-color: var(--border-strong); }
.menu-item:active:not([disabled]) { transform: scale(0.985); }
.menu-item[disabled] { opacity: 0.6; cursor: not-allowed; }
.menu-item__ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 17px; background: var(--primary-soft); color: var(--primary-text); }
.menu-item__ico .ico { width: 1.45em; height: 1.45em; }
.menu-item__text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.menu-item__text b { font-size: 1rem; font-weight: 800; }
.menu-item__text small { color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.menu-item__caret { color: var(--muted); }
.menu-item--danger .menu-item__ico { background: var(--danger-soft); color: var(--danger); }
.soon { padding: 2px 9px; border-radius: var(--r-pill); background: var(--warning-soft); color: var(--warning); font-size: 0.7rem; font-weight: 800; }

/* ───────────── sheets ───────────── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 140; display: grid; place-items: end center; background: rgba(5, 16, 9, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.2s ease both; }
@media (min-width: 640px) { .sheet-backdrop { place-items: center; padding: 24px; } }
.sheet-backdrop.is-closing { animation: fadeOut 0.19s ease both; }
.sheet { display: flex; flex-direction: column; width: min(100%, 520px); max-height: min(92dvh, 860px); background: var(--bg); border-radius: 30px 30px 0 0; box-shadow: var(--shadow-lg); animation: sheetUp 0.42s var(--ease) both; overflow: hidden; }
.sheet--lg { width: min(100%, 640px); }
@media (min-width: 640px) { .sheet { border-radius: 30px; } }
/* full-screen sheet (currency exchange) */
.sheet--full, .sheet--full.sheet { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
@media (min-width: 640px) { .sheet--full, .sheet--full.sheet { border-radius: 0; } }
.sheet-backdrop.is-closing .sheet { animation: sheetOut 0.19s ease both; }
.sheet.is-busy { cursor: progress; }
.sheet:focus { outline: none; }
.sheet__head { flex: none; display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.sheet__head::before { content: ""; position: absolute; }
.sheet__title { text-align: center; font-size: 1.05rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet__head .icon-btn[hidden] { display: block !important; visibility: hidden; }
.sheet__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 18px max(22px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.sheet__body > * { min-width: 0; }
.view-forward { animation: viewIn 0.32s var(--ease) both; }
.view-back { animation: viewBack 0.32s var(--ease) both; }
@keyframes sheetUp { from { opacity: 0; transform: translateY(40px) scale(0.98); } }
@keyframes viewIn { from { opacity: 0; transform: translateX(-22px); } }
@keyframes viewBack { from { opacity: 0; transform: translateX(22px); } }

.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.stack--sm { gap: 10px; }
.hint-text { color: var(--muted); font-size: 0.88rem; line-height: 1.9; }
.sheet-actions { display: grid; gap: 8px; margin-top: 6px; }
.sticky-actions { position: sticky; bottom: 0; padding-top: 12px; margin-top: 4px; background: linear-gradient(to top, var(--bg) 70%, transparent); }

/* currency chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin-inline: -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-cur { flex: none; display: grid; justify-items: start; gap: 2px; min-width: 104px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); cursor: pointer; text-align: start; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.chip-cur:hover { border-color: var(--border-strong); }
.chip-cur[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-ring); }
.chip-cur[disabled] { opacity: 0.45; cursor: not-allowed; }
.chip-cur__top { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.92rem; }
.chip-cur .cur-badge { width: 26px; height: 26px; border-radius: 9px; background: var(--primary); color: var(--on-primary); font-size: 0.85rem; }
.chip-cur small { color: var(--muted); font-size: 0.74rem; direction: ltr; unicode-bidi: isolate; }
.field-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; display: block; }

.suffix { flex: none; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.summary { display: grid; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); overflow: hidden; }
.summary__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; font-size: 0.92rem; }
.summary__row + .summary__row { border-top: 1px dashed var(--border); }
.summary__row span { color: var(--muted); flex: none; }
.summary__row b { font-weight: 700; text-align: end; min-width: 0; overflow-wrap: anywhere; }
.summary__row--total { background: var(--primary-soft); }
.summary__row--total b { color: var(--primary-text); font-weight: 800; }
.fee-box { display: grid; border-radius: 18px; background: var(--surface-2); padding: 4px 14px; font-size: 0.86rem; }
.fee-box .summary__row { padding: 8px 0; }
.fee-box .summary__row + .summary__row { border-top-color: var(--border); }

/* bank accounts */
.acct { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); }
.acct__head { display: flex; align-items: center; gap: 12px; }
.acct__head .menu-item__ico { width: 44px; height: 44px; border-radius: 15px; }
.acct__head b { display: block; font-size: 1rem; }
.acct__head small { color: var(--muted); }
.acct__tag { margin-inline-start: auto; padding: 3px 10px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-text); font-size: 0.74rem; font-weight: 800; white-space: nowrap; }
.acct__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 16px; background: var(--surface-2); }
.acct__row span { color: var(--muted); font-size: 0.8rem; flex: none; }
.acct__row b { flex: 1; min-width: 0; text-align: end; font-size: 0.94rem; font-weight: 700; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; letter-spacing: 0.02em; }
.copy-btn { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 12px; background: var(--surface); color: var(--primary-text); cursor: pointer; box-shadow: 0 0 0 1px var(--border) inset; }
.copy-btn:hover { background: var(--primary-soft); }
.acct__note { font-size: 0.82rem; color: var(--muted); line-height: 1.8; }

/* receipt upload */
.drop { position: relative; display: grid; justify-items: center; gap: 6px; padding: 22px 16px; border: 2px dashed var(--border-strong); border-radius: 22px; background: var(--surface); text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.drop:hover, .drop:focus-within { border-color: var(--primary); background: var(--primary-soft); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop .ico { width: 2em; height: 2em; color: var(--primary-text); }
.drop b { font-size: 0.95rem; }
.drop small { color: var(--muted); }
.drop--filled { border-style: solid; border-color: var(--primary); }
.drop__preview { width: 100%; max-height: 190px; object-fit: contain; border-radius: 14px; background: var(--surface-2); }
.field--error .drop { border-color: var(--danger); background: var(--danger-soft); }

/* QR */
.qr-card { display: grid; justify-items: center; gap: 14px; padding: 22px 18px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); text-align: center; }
.qr-card__user { display: grid; gap: 2px; }
.qr-card__user small { color: var(--muted); font-size: 0.8rem; }
.qr-card__user b { font-size: 1.45rem; font-weight: 800; letter-spacing: 0.04em; direction: ltr; unicode-bidi: isolate; }
.qr-card__code { width: min(100%, 268px); padding: 10px; border-radius: 22px; background: #fff; box-shadow: 0 0 0 1px var(--border), var(--shadow-md); }
.qr-card__code svg { width: 100%; height: auto; border-radius: 12px; }
.qr-card__row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* scanner */
.scanner { position: relative; overflow: hidden; border-radius: 26px; background: #06100a; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner__frame { position: relative; width: 62%; aspect-ratio: 1; border-radius: 26px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45); }
.scanner__frame i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--primary); }
.scanner__frame i:nth-child(1) { top: 0; inset-inline-start: 0; border-width: 4px 4px 0 0; border-top-right-radius: 22px; }
.scanner__frame i:nth-child(2) { top: 0; inset-inline-end: 0; border-width: 4px 0 0 4px; border-top-left-radius: 22px; }
.scanner__frame i:nth-child(3) { bottom: 0; inset-inline-start: 0; border-width: 0 4px 4px 0; border-bottom-right-radius: 22px; }
.scanner__frame i:nth-child(4) { bottom: 0; inset-inline-end: 0; border-width: 0 0 4px 4px; border-bottom-left-radius: 22px; }
[dir="rtl"] .scanner__frame i:nth-child(1) { border-width: 4px 0 0 4px; border-radius: 22px 0 0 0; }
.scanner__laser { position: absolute; inset-inline: 6%; height: 3px; border-radius: 3px; background: var(--primary); box-shadow: 0 0 18px 4px rgba(20, 194, 105, 0.7); animation: laser 2.2s ease-in-out infinite alternate; }
@keyframes laser { from { top: 8%; } to { top: 90%; } }
.scanner__msg { position: absolute; inset-inline: 14px; bottom: 14px; padding: 9px 14px; border-radius: 16px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 0.84rem; text-align: center; line-height: 1.7; }
.scanner__off { display: grid; justify-items: center; gap: 10px; padding: 24px; color: #cfe3d5; text-align: center; font-size: 0.9rem; }
.scanner__off .ico { width: 2.4em; height: 2.4em; opacity: 0.8; }
.pick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.pick-row .btn { min-height: 54px; }

/* recipient */
.recipient { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 22px; background: var(--primary-soft); }
.recipient b { display: block; font-size: 1.02rem; }
.recipient small { color: var(--primary-text); direction: ltr; unicode-bidi: isolate; display: block; font-weight: 700; }

/* history rows */
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 18px; background: var(--surface-2); margin-bottom: 14px; }
.tab { padding: 9px 8px; border: 0; border-radius: 14px; background: none; color: var(--muted); font-weight: 700; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(12, 70, 40, 0.1); }
.list { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.row__ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 15px; background: var(--surface-2); color: var(--muted); }
.row__ico--in { background: var(--success-soft); color: var(--success); }
.row__ico--out { background: var(--danger-soft); color: var(--danger); }
.row__ico--wait { background: var(--warning-soft); color: var(--warning); }
.row__main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row__title { font-weight: 700; font-size: 0.93rem; overflow-wrap: anywhere; line-height: 1.6; }
.row__sub { color: var(--muted); font-size: 0.78rem; line-height: 1.6; overflow-wrap: anywhere; }
.row__amt { flex: none; text-align: end; display: grid; gap: 1px; font-weight: 800; font-size: 0.95rem; direction: ltr; unicode-bidi: isolate; }
.row__amt small { font-weight: 500; color: var(--muted); font-size: 0.72rem; }
.row__amt.pos { color: var(--success); }
.row__amt.neg { color: var(--danger); }
.pill { display: inline-block; padding: 1px 9px; border-radius: var(--r-pill); font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.pill--pending { background: var(--warning-soft); color: var(--warning); }
.pill--approved { background: var(--success-soft); color: var(--success); }
.pill--rejected { background: var(--danger-soft); color: var(--danger); }
.more-btn { justify-self: center; margin-top: 6px; }

/* notifications */
.note { position: relative; display: grid; gap: 4px; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.note.is-unread { border-color: color-mix(in srgb, var(--primary) 55%, transparent); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.note.is-unread::before { content: ""; position: absolute; top: 18px; inset-inline-end: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.note b { font-size: 0.97rem; padding-inline-end: 18px; }
.note p { color: var(--muted); font-size: 0.9rem; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }
/* browser-notification permission card */
.pushcard { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 20px; background: color-mix(in srgb, var(--primary-soft) 70%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.pushcard[hidden] { display: none; }
.pushcard__ico { flex: none; width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.pushcard__ico svg { width: 22px; height: 22px; }
.pushcard__txt { display: grid; gap: 6px; min-width: 0; }
.pushcard__txt b { font-size: 0.96rem; }
.pushcard__txt p { color: var(--muted); font-size: 0.86rem; line-height: 1.9; }
.pushcard__act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.note small { color: var(--muted); font-size: 0.76rem; }

.ref-code { font-size: 1.7rem; font-weight: 800; letter-spacing: 0.18em; text-align: center; direction: ltr; padding: 16px; border-radius: 22px; background: var(--primary-soft); color: var(--primary-text); }

/* ───────────── admin ───────────── */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin-inline: -4px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 0.88rem; cursor: pointer; white-space: nowrap; }
.admin-tab[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.admin-tab .badge { position: static; border: 0; min-width: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 4px; }
.stat b { font-size: 1.8rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: 0.86rem; }
.card-box { padding: 16px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.card-box h3 { font-size: 1rem; font-weight: 800; }
.kv { display: grid; gap: 6px; font-size: 0.9rem; }
.kv div { display: flex; justify-content: space-between; gap: 12px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 700; text-align: end; overflow-wrap: anywhere; min-width: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 120px; }
.btn--tiny { min-height: 38px; font-size: 0.84rem; padding: 0 14px; width: auto; }
.btn--ok { background: var(--success-soft); color: var(--success); }
.btn--no { background: var(--danger-soft); color: var(--danger); }
.receipt-img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 16px; background: var(--surface-2); }
.rate-grid { display: grid; gap: 10px; }
.rate-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.fee-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.table-wrap { overflow-x: auto; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.table th, .table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 700; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.toggle { position: relative; width: 50px; height: 30px; border: 0; border-radius: var(--r-pill); background: var(--border-strong); cursor: pointer; transition: background 0.2s; }
.toggle::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.toggle[aria-checked="true"] { background: var(--primary); }
.toggle[aria-checked="true"]::after { transform: translateX(-20px); }

.app__main { animation: rise 0.45s var(--ease) both; }
.topbar__brand h1 { font-size: 1.15rem; }

/* ── utilities (CSP-safe replacements for inline styles) ── */
.u-center { justify-self: center; }
.u-grid { display: grid; }
.u-text-center { text-align: center; }
.stat--btn { text-align: start; cursor: pointer; color: inherit; }
.page-title--sm { font-size: 1rem; }
.field__input--cell { height: 42px; background: var(--surface-2); border-radius: 12px; padding: 0 10px; width: 100%; }
.field__input--row { height: 46px; background: var(--surface-2); border-radius: 14px; padding: 0 12px; }
body:has(.bottom-nav) .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ── home: wallet transactions, info chip, theme switch ── */
.info-chip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 18px; background: var(--info-soft); color: var(--info); font-size: 0.86rem; line-height: 1.7; }
.info-chip .ico { flex: none; }
.info-chip b { color: inherit; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-head h2 { font-size: 1.02rem; font-weight: 800; }
.section-head .link-btn { border: 0; background: none; color: var(--primary-text); font-weight: 700; font-size: 0.86rem; cursor: pointer; padding: 6px 4px; }
.home-tx { display: grid; gap: 10px; }
.home-tx__list { transition: opacity 0.18s; }
.home-tx__list.is-loading { opacity: 0.45; }
.home-tx .empty { padding: 26px 16px; }
.home-tx .empty__art { width: 68px; height: 68px; border-radius: 22px; }
.home-tx .empty__art .ico { width: 2em; height: 2em; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: 14px; background: none; color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: background 0.2s, color 0.2s; }
.seg button .ico { width: 1.4em; height: 1.4em; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--primary-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.main-wallet { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); font: inherit; text-align: start; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.main-wallet:hover { background: var(--surface-2); }
.main-wallet[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); }
.main-wallet__text { flex: 1; min-width: 0; display: grid; line-height: 1.6; }
.main-wallet__text small { color: var(--muted); }
.main-wallet__radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; }
.main-wallet[aria-checked="true"] .main-wallet__radio { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.main-wallet__radio .ico { width: 14px; height: 14px; opacity: 0; }
.main-wallet[aria-checked="true"] .main-wallet__radio .ico { opacity: 1; }
.home-tx__skeleton { height: 150px; }

/* ───────────── currency exchange (تبدیل ارز) ───────────── */
.xc__cards { position: relative; display: grid; gap: 10px; }
.xc__card { display: grid; gap: 10px; padding: 14px 16px 16px; border-radius: 24px; border: 1px solid var(--border); background: var(--surface); transition: border-color 0.2s, box-shadow 0.2s; }
.xc__card:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.xc__card--to { background: var(--surface-2); }
.xc__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.xc__bal { display: inline-flex; align-items: center; gap: 4px; }
.xc__max { border: 0; padding: 3px 10px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-text); font-size: 0.72rem; font-weight: 800; cursor: pointer; }
.xc__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.xc__amount, .xc__out { flex: 1 1 auto; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: clamp(1.5rem, 7vw, 1.9rem); font-weight: 800; text-align: right; direction: ltr; unicode-bidi: isolate; padding: 0; }
.xc__amount::placeholder { color: var(--muted); opacity: 0.55; }
.xc__out { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity 0.2s; }
.xc__out.is-empty { color: var(--muted); opacity: 0.55; }
.xc__out.is-loading { opacity: 0.4; }
.xc__cur { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font-size: 0.92rem; cursor: pointer; transition: background 0.2s, transform 0.15s; }
.xc__cur:hover { background: var(--surface-2); }
.xc__cur:active { transform: scale(0.97); }
.xc__cur::after { content: ""; width: 6px; height: 6px; margin-inline-start: 2px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.xc__cur .cur-badge { width: 26px; height: 26px; border-radius: 9px; }
.xc__swapwrap { position: relative; height: 0; z-index: 2; display: grid; place-items: center; }
.xc__swap { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--bg, var(--surface-2)); background: var(--primary); color: var(--on-primary); cursor: pointer; transition: transform 0.25s var(--ease); }
.xc__swap:active { transform: rotate(180deg) scale(0.94); }
.xc__swap .ico { width: 1.3em; height: 1.3em; transform: rotate(90deg); }
.xc__err { min-height: 0; margin: 0; color: var(--danger); font-size: 0.84rem; font-weight: 600; }
.xc__err:empty { display: none; }
.xc-pick { display: grid; gap: 8px; }
.xc-pick__row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); text-align: start; cursor: pointer; }
.xc-pick__row[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.xc-pick__name { flex: 1; font-weight: 700; }
.xc-pick__bal { color: var(--muted); font-size: 0.85rem; direction: ltr; unicode-bidi: isolate; }

/* ───────────── transaction rows + details popup ───────────── */
.row--btn { width: 100%; text-align: start; color: var(--text); cursor: pointer; font: inherit; transition: background 0.2s, border-color 0.2s, transform 0.15s; }
.row--btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.row--btn:active { transform: scale(0.985); }
.txd__hero { display: grid; justify-items: center; gap: 6px; padding: 6px 0 4px; text-align: center; }
.txd__ico { width: 56px; height: 56px; border-radius: 20px; }
.txd__ico .ico { width: 1.5em; height: 1.5em; }
.txd__title { font-size: 1.02rem; }
.txd__amt { font-size: 1.6rem; font-weight: 800; direction: ltr; unicode-bidi: isolate; }
.txd__amt small { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.txd__amt.pos { color: var(--success); }
.txd__amt.neg { color: var(--danger); }

.sheet--full .sheet__body { align-content: stretch; grid-template-rows: minmax(min-content, 1fr); }
.sheet--full .xc { display: flex; flex-direction: column; gap: 14px; width: min(100%, 560px); margin-inline: auto; }
.sheet--full .xc .btn[type=submit] { margin-top: auto; }
.sheet--full .xc__card { padding: 18px 18px 20px; }
.sheet--full .xc__amount, .sheet--full .xc__out { font-size: clamp(1.9rem, 9vw, 2.4rem); }

/* ───── KYC (احراز هویت) ───── */
.seg--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kyc-hero { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 22px 16px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface-2); }
.kyc-hero p { color: var(--muted); font-size: 0.88rem; line-height: 1.8; }
.kyc-hero__ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--surface); color: var(--muted); }
.kyc-hero__ico .ico { width: 28px; height: 28px; }
.kyc-hero--pending { background: var(--warning-soft); } .kyc-hero--pending .kyc-hero__ico { color: var(--warning); }
.kyc-hero--approved { background: var(--info-soft); } .kyc-hero--approved .kyc-hero__ico { color: var(--primary-text); }
.kyc-hero--rejected { background: var(--danger-soft); } .kyc-hero--rejected .kyc-hero__ico { color: var(--danger); }
.kyc-reason { padding: 14px 16px; border-radius: 18px; background: var(--danger-soft); color: var(--danger); display: grid; gap: 4px; }
.kyc-reason p { color: var(--text); font-size: 0.9rem; line-height: 1.8; overflow-wrap: anywhere; }
.kyc-checklist { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); font-size: 0.9rem; }
.kyc-checklist ul { display: grid; gap: 8px; padding-inline-start: 18px; color: var(--muted); line-height: 1.8; }
.kyc-steps { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.kyc-steps__i { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.kyc-steps__i i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-style: normal; background: var(--surface-2); border: 1px solid var(--border); }
.kyc-steps__i.is-on { color: var(--primary-text); }
.kyc-steps__i.is-on i { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.kyc-steps__bar { flex: 1; height: 2px; background: var(--border); min-width: 12px; }
.kyc-photo { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.kyc-photo.field--error { border-color: var(--danger); }
.kyc-photo__head { display: flex; align-items: center; gap: 10px; }
.kyc-photo__head > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.kyc-photo__head small { color: var(--muted); font-size: 0.78rem; line-height: 1.6; }
.kyc-photo__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--surface-2); color: var(--primary-text); flex: none; }
.kyc-badge { font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); flex: none; }
.kyc-badge.is-req { background: var(--warning-soft); color: var(--warning); }
.kyc-drop { display: grid; justify-items: center; gap: 4px; width: 100%; padding: 18px 10px; border: 2px dashed var(--border-strong); border-radius: 16px; background: var(--surface-2); color: var(--muted); font: inherit; cursor: pointer; }
.kyc-drop:hover, .kyc-drop:focus-visible { border-color: var(--primary); color: var(--primary-text); }
.kyc-drop small { font-size: 0.74rem; }
.kyc-busy { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px 10px; color: var(--muted); font-size: 0.9rem; }
.kyc-pic { display: flex; align-items: center; gap: 12px; }
.kyc-pic img { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); flex: none; }
.kyc-pic__meta { display: grid; gap: 4px; min-width: 0; }
.kyc-pic__meta small { color: var(--muted); font-size: 0.78rem; }
.kyc-pic__act { display: flex; gap: 14px; margin-top: 4px; }
.link-btn { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 0.86rem; font-weight: 700; color: var(--primary-text); cursor: pointer; }
.link-btn--danger { color: var(--danger); }
.datebtn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 14px; border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.datebtn .field__icon { flex: none; }
.datebtn__text { flex: 1; min-width: 0; }
.datebtn__text.is-empty { color: var(--placeholder); }
.dp__head, .dp__cols { display: grid; grid-template-columns: 1.1fr 1.4fr 0.9fr; gap: 8px; }
.dp__head span { text-align: center; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.dp__col { height: 220px; overflow-y: auto; display: grid; align-content: start; gap: 2px; padding: 4px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); scroll-behavior: smooth; position: relative; }
.dp__item { border: 0; border-radius: 12px; padding: 10px 4px; background: none; color: var(--text); font: inherit; font-size: 0.95rem; cursor: pointer; }
.dp__item[aria-selected="true"] { background: var(--primary); color: var(--on-primary); font-weight: 800; }
.wallets__one { padding-block: 4px 6px; }
.wallets__one .wcard { width: 100%; }

/* ───── bank cards ───── */
.bcard { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 22px; padding: 18px; border-radius: 22px; color: #fff; direction: rtl;
  background: linear-gradient(135deg, #0f7a45, #14c269 60%, #7bbf2a); box-shadow: var(--shadow-md); aspect-ratio: 1.6 / 1; align-content: space-between; max-width: 380px; width: 100%; margin-inline: auto; }
.bcard::after { content: ""; position: absolute; z-index: -1; inset-inline-end: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.bcard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; }
.bcard__bank { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard__chip .ico { width: 1.7em; height: 1.7em; opacity: 0.9; }
.bcard__num { direction: ltr; unicode-bidi: isolate; text-align: center; font-size: clamp(1.1rem, 5.4vw, 1.45rem); letter-spacing: 0.08em; font-weight: 700; }
.bcard__bottom { display: grid; gap: 2px; }
.bcard__bottom small { opacity: 0.8; font-size: 0.72rem; }
.bcard__holder { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bitem { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); }
.bitem__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bitem__meta small { color: var(--muted); }
.bitem > .link-btn { justify-self: start; }

/* ───── product catalogue (دسته‌بندی) ───── */
.pcats { display: grid; gap: 26px; }
.pcat { display: grid; gap: 12px; }
.pcat__title { font-size: 1.05rem; font-weight: 800; padding-inline: 2px; }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ptile { display: grid; justify-items: center; align-content: start; gap: 10px; padding: 14px 6px 12px; min-height: 116px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: center; transition: transform 0.15s var(--ease), border-color 0.2s; -webkit-tap-highlight-color: transparent; }
.ptile:hover { border-color: var(--border-strong); }
.ptile:active { transform: scale(0.96); }
.ptile:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ptile__logo { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; --t: var(--primary-text); color: var(--t); background: color-mix(in srgb, var(--t) 13%, var(--surface)); }
.ptile__logo .ico { width: 28px; height: 28px; }
.ptile__logo--green { --t: #0f8a4b; } .ptile__logo--blue { --t: #1b63c4; } .ptile__logo--amber { --t: #c27a00; } .ptile__logo--teal { --t: #0e8f8f; } .ptile__logo--violet { --t: #7a46d1; } .ptile__logo--rose { --t: #d3365a; }
.ptile__name { font-size: 0.8rem; font-weight: 700; line-height: 1.55; overflow-wrap: anywhere; }
@media (max-width: 340px) { .ptile { padding-inline: 4px; } .ptile__name { font-size: 0.74rem; } .ptile__logo { width: 48px; height: 48px; } }
.pcat .empty { padding: 22px 10px; border: 1px dashed var(--border-strong); border-radius: 22px; }

/* ── Phase 11: agents & remittances ── */
.astate { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 18px; background: var(--primary-soft); color: var(--text); }
.astate svg { flex: none; width: 24px; height: 24px; margin-top: 2px; }
.astate div { display: grid; gap: 2px; min-width: 0; }
.astate small { color: var(--muted); line-height: 1.7; }
.astate--approved svg { color: #15803d; } .astate--pending { background: #fef3c7; } .astate--pending svg { color: #b45309; } .astate--rejected { background: #fee2e2; } .astate--rejected svg { color: #b91c1c; }
.opill { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.opill--ok { background: #dcfce7; color: #15803d; } .opill--bad { background: #fee2e2; color: #b91c1c; } .opill--wait { background: #fef3c7; color: #b45309; } .opill--info { background: #dbeafe; color: #1d4ed8; }
.result { text-align: center; justify-items: center; }
.result .summary { width: 100%; text-align: start; }
.result__art { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; }
.result__art svg { width: 38px; height: 38px; }
.result__art--ok { background: #dcfce7; color: #15803d; } .result__art--wait { background: #fef3c7; color: #b45309; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; gap: 2px; padding: 0 22px 14px 0; border-inline-start: 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 4px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline small { color: var(--muted); }
.agent-card { display: grid; gap: 4px; padding: 14px; border-radius: 18px; border: 1.5px solid var(--primary); background: var(--primary-soft); }
.agent-card small { color: var(--muted); line-height: 1.7; }
.awallet { display: grid; gap: 10px; padding: 18px; border-radius: 26px; color: #fff; background: linear-gradient(135deg, #0f8a4b, #17c26a); box-shadow: var(--shadow-md); }
.awallet small { opacity: 0.85; }
.awallet__amt { font-size: 1.9rem; font-weight: 800; letter-spacing: 0.01em; }
.awallet .btn { background: #fff; color: #0f6b3a; }
.ledger-row { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.ledger-row__top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-weight: 700; }
.ledger-row__bal { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.78rem; }
.ledger-row .pos { color: var(--success); } .ledger-row .neg { color: var(--danger); }
.seg-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.seg-tabs button { flex: none; padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 700; font-size: 0.82rem; cursor: pointer; }
.seg-tabs button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.photo-add { display: grid; gap: 10px; }
.section-title { margin: 6px 2px 0; font-size: 1rem; font-weight: 800; }
.ledger-row--btn { cursor: pointer; }

/* vertical rhythm between list rows (orders, agent lists) */
.rows { display: flex; flex-direction: column; gap: 12px; }

.code-big { margin: 0; text-align: center; font-size: 2rem; font-weight: 800; letter-spacing: .3em; color: var(--brand, #0f8f5a); user-select: all; }
.seg-tabs--wrap { flex-wrap: wrap; overflow-x: visible; }
.field input[type="date"] { text-align: start; }
.row__amt .row__prev { direction: rtl; font-weight: 500; white-space: nowrap; }
.inv-rules { display: grid; gap: 6px; padding: 14px 16px; border-radius: 18px; background: var(--primary-soft); color: var(--primary-text); }
.inv-rules p { margin: 0; display: flex; gap: 8px; align-items: center; font-weight: 700; }
.inv-rules svg { width: 20px; height: 20px; flex: none; }
.inv-rules small { color: var(--muted); }
.inv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inv-stats > div { display: grid; gap: 2px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--border); text-align: center; }
.inv-stats b { font-size: 1.15rem; }
.inv-stats small { color: var(--muted); }
.inv-stats__wide { grid-column: 1 / -1; }
.inv-amt { max-width: 46%; }
.inv-amt .pos { color: var(--success); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-head .section-title { margin: 0; }
.section-head .btn { flex: none; }

/* ── Phase 14: «کریدت افغانستان» ── */
.stack--tight { gap: 8px; }
.qamts { display: flex; flex-wrap: wrap; gap: 8px; }
.qamt { padding: 8px 16px; border: 1.5px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color 0.18s, background 0.18s, transform 0.15s var(--ease); }
.qamt:active { transform: scale(0.95); }
.qamt:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.qamt.is-on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.topup__limit { margin-top: -6px; }
.topup__recent { margin-top: 8px; }
.trow-list { display: grid; gap: 8px; }
.trow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); font: inherit; text-align: start; cursor: pointer; width: 100%; }
.trow:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.trow__logo { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.trow__logo img { width: 30px; height: 30px; object-fit: contain; }
.trow__main, .trow__side { display: grid; gap: 2px; min-width: 0; }
.trow__main { flex: 1; }
.trow__side { justify-items: end; text-align: end; }
.trow small { color: var(--muted, var(--text-2)); font-size: 0.74rem; }
.st--success { color: #15803d !important; } .st--pending { color: #b45309 !important; } .st--failed { color: #b91c1c !important; }
.result__art--fail { background: #fee2e2; color: #b91c1c; }

/* two facts on one line inside a summary (date | tracking code) */
.summary__row--pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; }
.summary__cell { display: grid; gap: 3px; padding: 10px 16px; min-width: 0; }
.summary__cell + .summary__cell { border-inline-start: 1px dashed var(--border); }
.summary__cell span { font-size: 0.74rem; }
.summary__cell b { font-size: 0.88rem; text-align: start; }

/* operator logo inside the mobile field (replaces the phone icon) */
.mlogo { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: transparent; transition: background 0.2s; }
.mlogo.is-on { background: #fff; box-shadow: 0 0 0 1px var(--border); animation: mlogo-in 0.22s var(--ease, ease-out); }
.mlogo__img { width: 28px; height: 28px; object-fit: contain; display: block; }
.mlogo__img[hidden] { display: none; }
@keyframes mlogo-in { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mlogo.is-on { animation: none; } }

.row__ico--logo { background: #fff; box-shadow: 0 0 0 1px var(--border); }
.row__ico--logo img { width: 28px; height: 28px; object-fit: contain; display: block; }

/* agent: «بررسی کد» button inside the code field + success line */
.code-input{min-width:0}
.field .btn.btn--sm{white-space:nowrap}
.field-ok{display:flex;align-items:center;gap:6px;margin:6px 2px 0;color:var(--ok,#0a8f4e);font-size:.85rem}
.field-ok svg{width:18px;height:18px;flex:none}
.field-ok[hidden]{display:none}

/* ── manual products (catalogue) ── */
.ptile__logo--img { background: #fff; box-shadow: 0 0 0 1px var(--border); overflow: hidden; }
.ptile__logo--img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.row__logo, .pdetail__logo { --t: var(--primary-text); flex: none; display: grid; place-items: center; overflow: hidden; color: var(--t); background: color-mix(in srgb, var(--t) 13%, var(--surface)); }
.row__logo { width: 46px; height: 46px; border-radius: 15px; }
.row__logo .ico { width: 24px; height: 24px; }
.pdetail__logo { width: 64px; height: 64px; border-radius: 20px; }
.pdetail__logo .ico { width: 32px; height: 32px; }
.row__logo--img, .pdetail__logo--img { background: #fff; box-shadow: 0 0 0 1px var(--border); }
.row__logo--img img, .pdetail__logo--img img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.row__logo--green, .pdetail__logo--green { --t: #0f8a4b; } .row__logo--blue, .pdetail__logo--blue { --t: #1b63c4; } .row__logo--amber, .pdetail__logo--amber { --t: #c27a00; }
.row__logo--teal, .pdetail__logo--teal { --t: #0e8f8f; } .row__logo--violet, .pdetail__logo--violet { --t: #7a46d1; } .row__logo--rose, .pdetail__logo--rose { --t: #d3365a; }
.row__sub--clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pdetail { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; }
.pdetail__txt { display: grid; gap: 2px; min-width: 0; }
.pdetail__txt h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.pdetail__price { grid-column: 1 / -1; justify-self: start; padding: 6px 14px; border-radius: 999px; background: var(--primary-soft, var(--surface-2)); color: var(--primary-text); font-weight: 800; }
.pdetail__desc { margin: 0; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; color: var(--muted); }
.pdelivery { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--success-soft); color: var(--text); white-space: pre-line; overflow-wrap: anywhere; user-select: all; }
/* code box with the «بررسی کد» button beside it: keep all 6 digits visible */
.field:has(.suffix) .code-input, .field:has(.btn) .code-input { letter-spacing: 0.22em; padding-inline-start: 0.22em; font-size: 1.3rem; text-indent: 0; }

/* بسته‌های افغانستان: five operators on one row */
.opcards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; direction: rtl; }
.opcard { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px 8px; min-width: 0; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface, #fff); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; font: inherit; color: inherit; }
.opcard__img { width: 44px; height: 44px; object-fit: contain; display: block; }
.opcard__name { font-size: 0.68rem; font-weight: 700; line-height: 1.3; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opcard.is-on { border-color: var(--primary, #16a34a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #16a34a) 18%, transparent); }
.opcard:active { transform: scale(0.97); }
.opcard:focus-visible { outline: 2px solid var(--primary, #16a34a); outline-offset: 2px; }
.bunhead { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }
.bunhead .hint-text { margin-inline-start: auto; direction: ltr; }
.bungroup { margin: 10px 2px 2px; font-size: 0.88rem; font-weight: 800; color: var(--muted); }

/* تماس بین‌المللی: the three applications, and the operator grid */
.appcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; direction: rtl; }
.appcard { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 8px; min-width: 0; border-radius: 16px; border: 1.5px solid var(--border); background: #fff; cursor: pointer; font: inherit; color: inherit; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.appcard__img { width: 64px; height: 64px; object-fit: contain; display: block; }
.appcard__name { font-size: 0.8rem; font-weight: 800; }
.appcard.is-on { border-color: var(--primary, #16a34a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #16a34a) 18%, transparent); }
.appcard:active { transform: scale(0.97); }
.appcard:focus-visible { outline: 2px solid var(--primary, #16a34a); outline-offset: 2px; }
.opcards--wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opcard--call { padding: 14px 4px 10px; }
.opcard--call .opcard__name { font-size: 0.78rem; white-space: normal; }
.opcard__ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #e8f0fe; color: #2563eb; }

/* «بل برق افغانستان»: the QR-scan button inside the bill-number field */
.field-scan { flex: none; width: 38px; height: 38px; color: var(--primary-text); }
.field-scan svg { width: 22px; height: 22px; }

/* «شارژ ایران»: four operator logos on one line */
.opcards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opcards--4 .opcard { padding: 10px 4px; }
.opcards--4 .opcard__img { width: 52px; height: 52px; }

/* receipt: choose the account that was paid into */
.acct--pick { position: relative; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.acct--pick:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.acct--selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.acct__check { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; width: 26px; height: 26px; border-radius: 50%; display: none; align-items: center; justify-content: center; background: var(--primary); color: #fff; }
.acct__check svg { width: 16px; height: 16px; }
.acct--selected .acct__check { display: flex; }
.acct--pick .acct__tag { margin-inline-end: 34px; }
.acct-summary { display: grid; gap: 2px; padding: 12px 14px; border-radius: 18px; background: var(--primary-soft); color: var(--primary-text); }
.acct-summary small { opacity: .85; }

.pdelivery-box { display: grid; gap: 8px; }
.pdelivery-copy { justify-self: start; }

/* ───── phase 31: agent panel — orders ───── */
.seg-tabs__n { display: inline-block; min-width: 18px; margin-inline-start: 6px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.72rem; line-height: 18px; text-align: center; }
.agent-orders-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; }
.agent-orders-link > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.agent-orders-link small { color: var(--muted); }
.agent-orders-link svg { width: 20px; height: 20px; color: var(--primary); }
