@font-face { font-family: Vazir; src: url('/static/fonts/vazir-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazir; src: url('/static/fonts/vazir-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazir; src: url('/static/fonts/vazir-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Vazir; src: url('/static/fonts/vazir-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0d0f14;
  --card: #171a21;
  --card2: #1e222b;
  --line: #262b36;
  --red: #e23744;
  --red2: #c22733;
  --red-soft: rgba(226, 55, 68, .12);
  --green: #2ecc71;
  --green-soft: rgba(46, 204, 113, .12);
  --amber: #f5a623;
  --text: #eef1f6;
  --muted: #8b93a5;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
/* pb44h: THE real bug. body had height:100%, so it was locked to viewport
   height and overflowing content escaped BELOW its box — the padding-bottom
   below the last card was inside the fixed box and thus never reachable.
   min-height lets the body grow with content so the padding lands at the end. */
body { min-height: 100%; }
body {
  font-family: Vazir, Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  /* pb44f: fixed tabbar grows with env(safe-area-inset-bottom) on modern
     phones; a static 76px let the LAST service card's renew row slide under
     the nav. Match the nav height + slack. */
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  overscroll-behavior: none;
}

/* ---------- app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: rgba(13, 15, 20, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 16px; color: var(--muted); }
.brand b { color: var(--red); font-weight: 700; letter-spacing: .5px; }
.brand-x { color: var(--text); font-weight: 700; }
.brand-fa { font-size: 13px; }
.role-chip {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--red-soft); color: var(--red); border: 1px solid rgba(226,55,68,.3);
}
.appbar-add {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--red); font-size: 17px; font-weight: 700; cursor: pointer;
}

/* ---------- layout ---------- */
.view { display: none; }
.view.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.content { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.page-title { font-size: 19px; font-weight: 700; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: -10px; }
.sec-title { font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 4px; }

/* ---------- wallet hero (red gradient) ---------- */
.wallet-hero {
  background: linear-gradient(135deg, #e23744 0%, #8f1d27 100%);
  border-radius: 20px; padding: 18px;
  box-shadow: 0 10px 30px rgba(226, 55, 68, .25);
  position: relative; overflow: hidden;
}
.wallet-hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 45%);
}
.wh-row { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.wh-label { font-size: 13px; opacity: .85; }
.wh-amount { font-size: 26px; font-weight: 700; margin-top: 4px; }
.wh-icon { font-size: 34px; opacity: .9; }
.wh-btn {
  position: relative; z-index: 1; width: 100%; margin-top: 16px;
  background: #fff; color: var(--red2); font-weight: 700;
  border: none; border-radius: 12px; padding: 12px; font-size: 15px; cursor: pointer;
  font-family: inherit;
}
.wh-btn:active { transform: scale(.98); }

/* ---------- mini cards ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: center;
}
.mini-card .mc-icon { font-size: 20px; margin-bottom: 6px; }
.mini-card .mc-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mini-card .mc-value { font-size: 17px; font-weight: 700; }
.mini-card .mc-value.red { color: var(--red); }

/* ---------- quick actions ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 6px; color: var(--text); font-family: inherit; font-size: 11.5px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer;
}
.quick:active { background: var(--card2); }
.quick .q-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--red-soft);
  display: grid; place-items: center; font-size: 20px;
}

/* ---------- buttons ---------- */
.btn { border: none; border-radius: 12px; padding: 13px 18px; min-height: 44px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn.primary { background: linear-gradient(135deg, #d12733, var(--red2)); color: #fff; } /* CTA: white-on-red ≥ 5:1 */
.btn.primary:active { transform: scale(.98); }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }

/* ---------- shop ---------- */
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; font-size: 13px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-family: inherit;
}
.cat-pill.on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }

.prod {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px;
}
.prod-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prod-name { font-size: 15px; font-weight: 700; }
.prod-badge { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--red-soft); color: var(--red); flex: 0 0 auto; }
.prod-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.prod-meta span { font-size: 12px; color: var(--muted); background: var(--card2); padding: 4px 10px; border-radius: 8px; }
.prod-foot { display: flex; justify-content: space-between; align-items: center; }
.prod-price { font-size: 17px; font-weight: 700; color: var(--red); }
.prod-price small { font-size: 11px; font-weight: 400; color: var(--muted); }
.prod-buy { background: linear-gradient(135deg, var(--red), var(--red2)); color: #fff; border: none; border-radius: 10px; padding: 9px 20px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.prod-buy:active { transform: scale(.96); }

/* ---------- checkout ---------- */
.co-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.co-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.co-row span { color: var(--muted); flex-shrink: 0; }
.co-row b { text-align: left; font-size: 13.5px; }
.disc-row { display: flex; gap: 10px; }
.disc-row input {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--text); font-family: inherit; font-size: 14px; outline: none;
}
.disc-row input:focus { border-color: var(--red); }
.disc-btn {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--red), var(--red2)); color: #fff; font-size: 18px; font-weight: 700;
}
.disc-msg { font-size: 12.5px; min-height: 0; }
.disc-msg.ok { color: var(--green); }
.disc-msg.err { color: var(--red); }
/* pb43a: optional account-name field */
.uname-row { margin-top: 4px; }
.uname-row input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; font-size: 14px;
  direction: ltr; text-align: left; font-family: inherit; color: var(--ink);
}
.uname-row input:focus { border-color: var(--red); outline: none; }
.uname-msg { font-size: 12.5px; min-height: 0; }
.uname-msg.ok { color: var(--green); }
.uname-msg.err { color: var(--red); }
.total-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-align: center;
}
.total-amount { font-size: 28px; font-weight: 700; color: var(--red); }
.total-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pay-opt {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer;
  margin-bottom: 10px;
}
.pay-opt.sel {
  border-color: var(--red); background: var(--red-soft);
  box-shadow: 0 0 0 1px var(--red) inset;
}
.pay-opt.disabled { opacity: .55; cursor: not-allowed; }
.po-icon { font-size: 24px; flex-shrink: 0; }
.po-body { flex: 1; min-width: 0; }
.po-title { font-size: 14px; font-weight: 600; }
.po-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.po-sub.warn { color: var(--amber); }
.pay-opt.disabled .po-sub.warn { color: var(--red); opacity: .9; }
.po-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; }
.pay-opt.sel .po-radio { border-color: var(--red); background: radial-gradient(circle, var(--red) 45%, transparent 50%); }
/* CTA base style (full width gradient button) */
.pay-cta {
  width: 100%; background: linear-gradient(135deg, var(--red), var(--red2)); color: #fff;
  font-size: 16px; font-weight: 700; padding: 15px; border-radius: 14px; border: none; cursor: pointer; font-family: inherit;
}
.pay-cta:active { transform: scale(.98); }
/* sticky CTA must never cover anything — content gets bottom padding,
   and the CTA sits in normal flow right after the payment block (no overlay) */
#view-checkout .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
#view-checkout .pay-cta {
  position: sticky; bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 25; margin-top: 14px; margin-bottom: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
/* quick-topup lives between pay-opt and CTA — keep it clear of the sticky bar */
#pay-quick-topup { margin-bottom: 0; }

/* ---------- services ---------- */
.svc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
/* usage bar: consumed / remaining traffic */
.usage { margin-top: 10px; }
.usage-bar {
  height: 8px; border-radius: 6px; background: rgba(255,255,255,.08);
  overflow: hidden; border: 1px solid rgba(255,255,255,.06);
}
.usage-fill { height: 100%; border-radius: 6px; transition: width .6s ease; min-width: 2px; }
.usage-txt {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--muted); margin-top: 6px;
}
.usage-txt b { color: var(--text); font-weight: 600; }
/* service action buttons: copy / connect / QR / renew */
.svc-link { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.svc-act {
  flex: 1; min-width: 86px; padding: 10px 8px; border-radius: 12px;
  font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  text-align: center; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 4px;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  transition: transform .15s ease, border-color .15s ease;
}
.svc-act:active { transform: scale(.96); }
.svc-act.ghost:hover { border-color: var(--red); }
.svc-act.primary {
  background: linear-gradient(135deg, var(--red), var(--red2));
  border: none; color: #fff;
}
/* QR modal */
.qr-box { text-align: center; padding: 10px 6px 4px; }
.qr-wrap { display: flex; justify-content: center; }
.qr-box canvas {
  width: min(78vw, 300px); height: min(78vw, 300px);
  border-radius: 16px; margin: 12px auto 6px; display: block;
  background: #fff; box-shadow: 0 10px 34px rgba(0,0,0,.5);
}
.qr-box .wait-text { margin: 8px 4px 12px; font-size: 12.5px; line-height: 1.7; }
.qr-box .btn { width: 100%; }
.svc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.svc-name { font-size: 15px; font-weight: 700; }
.svc-status { font-size: 11px; padding: 4px 12px; border-radius: 999px; font-weight: 600; }
.svc-status.on { background: var(--green-soft); color: var(--green); }
.svc-status.off { background: var(--red-soft); color: var(--red); }
.svc-status.soon { background: rgba(245,166,35,.14); color: var(--amber); }
.svc-info { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.svc-info span { font-size: 12px; color: var(--muted); background: var(--card2); padding: 4px 10px; border-radius: 8px; }

.empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; color: var(--muted);
}
.empty .e-icon { font-size: 40px; margin-bottom: 12px; }
.empty .e-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty .e-sub { font-size: 13px; line-height: 1.8; }
.empty .btn { margin-top: 16px; }

/* ---------- wallet / topup ---------- */
.topup-hero {
  background: var(--green-soft); border: 1px solid rgba(46,204,113,.3);
  border-radius: 20px; padding: 20px; text-align: center;
}
.th-icon { font-size: 34px; }
.th-title { font-size: 17px; font-weight: 700; margin-top: 6px; }
.th-balance { font-size: 13px; color: var(--green); margin-top: 4px; }
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.amt {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 6px; text-align: center; cursor: pointer; font-family: inherit; color: var(--text);
}
.amt b { display: block; font-size: 17px; }
.amt span { font-size: 11px; color: var(--muted); }
.amt.sel { border-color: var(--green); background: var(--green-soft); }
.amt.sel b { color: var(--green); }
.custom-amt input {
  width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; color: var(--text); font-family: inherit; font-size: 15px; outline: none; margin-top: 8px;
}
.custom-amt input:focus { border-color: var(--green); }
.ca-label { font-size: 13px; color: var(--muted); }
.ca-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.topup-cta {
  width: 100%; background: linear-gradient(135deg, #2ecc71, #1d9e54); color: #fff;
  font-size: 16px; font-weight: 700; padding: 15px; border-radius: 14px; border: none; cursor: pointer; font-family: inherit;
}
.topup-cta:active { transform: scale(.98); }
.topup-note { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.9; }

.tx { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.tx-r { text-align: left; }
.tx-amt { font-size: 15px; font-weight: 700; }
.tx-amt.in { color: var(--green); }
.tx-amt.out { color: var(--text); }
.tx-method {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  display: inline-flex; align-items: center; gap: 4px;
}
.tx-method::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: .6; }
.tx-date { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tx-title { font-size: 13px; }
.tx-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- profile ---------- */
.invite-strip { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; text-align: right; }
.invite-strip .is-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--red-soft); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.invite-strip .is-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.invite-strip .is-txt b { font-size: 14px; color: var(--text); }
.invite-strip .is-txt i { font-style: normal; font-size: 12px; color: var(--muted); }
.invite-strip .is-arrow { font-size: 20px; color: var(--muted); }
.profile-head { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--red-soft); display: grid; place-items: center; font-size: 26px; }
.p-name { font-size: 16px; font-weight: 700; }
.p-role { font-size: 12px; color: var(--muted); margin-top: 3px; }
.invite-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ic-head { display: flex; align-items: center; gap: 12px; }
.ic-gift { width: 44px; height: 44px; border-radius: 12px; background: var(--red-soft); display: grid; place-items: center; font-size: 22px; }
.ic-title { font-size: 15px; font-weight: 700; }
.ic-sub { font-size: 12px; color: var(--red); margin-top: 2px; }
.ic-desc { font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.link-box {
  display: flex; align-items: center; gap: 8px; background: var(--card2);
  border: 1px dashed var(--line); border-radius: 12px; padding: 11px 12px;
}
.link-box span { flex: 1; font-size: 12.5px; direction: ltr; text-align: left; word-break: break-all; color: var(--text); }
.copy-btn { width: 34px; height: 34px; border-radius: 9px; border: none; background: var(--red-soft); color: var(--red); font-size: 15px; cursor: pointer; flex: 0 0 auto; }
.logout-btn { width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--muted); }

.rp-inp {
  width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--text); font-family: Vazir; font-size: 15px; outline: none;
}
.rp-inp:focus { border-color: var(--red); }

/* ---------- bottom nav ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: flex-end; justify-content: space-around;
  background: rgba(19, 22, 28, .97); border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  backdrop-filter: blur(10px);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--muted); font-family: inherit; font-size: 10.5px;
  padding: 6px 2px; cursor: pointer;
}
.tab .t-icon { font-size: 20px; filter: grayscale(1) opacity(.7); }
.tab.on { color: var(--red); font-weight: 600; }
.tab.on .t-icon { filter: none; }
.tab-plus { position: relative; }
.tab-plus .plus {
  width: 50px; height: 50px; border-radius: 50%; margin-top: -26px;
  background: linear-gradient(135deg, var(--red), var(--red2)); color: #fff;
  display: grid; place-items: center; font-size: 26px; font-weight: 400;
  border: 5px solid var(--bg); box-shadow: 0 6px 18px rgba(226,55,68,.4);
}
.tab-plus.on .plus { transform: scale(1.06); }

/* ---------- modal ---------- */
#modal-root:empty { display: none; }
.modal-back {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.65);
  display: flex; align-items: flex-end; animation: fadein .2s ease;
}
.modal {
  background: var(--card); border-radius: 22px 22px 0 0; width: 100%;
  max-height: 82vh; overflow-y: auto; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: slideup .25s ease;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.modal-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.modal-row:last-of-type { border-bottom: none; }
.modal-row span { color: var(--muted); }
.modal-price { color: var(--red); font-weight: 700; }
.modal .btn { width: 100%; margin-top: 10px; }
.modal-close { float: left; background: var(--card2); border: 1px solid var(--line); color: var(--muted); width: 30px; height: 30px; border-radius: 9px; cursor: pointer; }
.wait-text { font-size: 13px; color: var(--muted); line-height: 2; }
.card-num { direction: ltr; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 2px; background: var(--card2); border-radius: 12px; padding: 12px; margin: 10px 0; font-family: monospace, Vazir; }
/* receipt upload form */
.rc-label { font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.rc-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 18px; cursor: pointer;
  background: var(--card); transition: border-color .2s; }
.rc-drop:hover { border-color: var(--red); }
.rc-drop.has { border-color: var(--green); border-style: solid; }
.rc-drop .rc-ico { font-size: 26px; }
.rc-drop .rc-hint { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.9; }
.rc-drop input[type=file] { display: none; }
.rc-preview { max-width: 100%; max-height: 160px; border-radius: 10px; display: block; }
.rc-note { width: 100%; box-sizing: border-box; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px; color: var(--text); font-family: Vazir; font-size: 13.5px;
  resize: vertical; min-height: 64px; }
.rc-note:focus { outline: none; border-color: var(--red); }
.rc-send { width: 100%; margin-top: 14px; }
.rc-ok { text-align: center; padding: 8px 0; }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #262b36; color: var(--text); padding: 11px 22px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 60;
  max-width: 88%; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- support / tickets ---------- */
.ticket-box { display: flex; flex-direction: column; gap: 10px; }
.sup-photo-row { display: flex; align-items: center; gap: 10px; }
.sup-photo-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 9px 14px; border-radius: 12px; border: 1.5px dashed var(--line);
  background: var(--card2, rgba(255,255,255,.04)); color: var(--text);
  font-size: 13px; font-weight: 600; transition: border-color .2s;
}
.sup-photo-btn:active { border-color: var(--red); }
.sup-photo-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.ticket-box textarea {
  width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; color: var(--text); font-family: Vazir; font-size: 14px; resize: vertical;
  min-height: 110px; outline: none;
}
.ticket-box textarea:focus { border-color: var(--red); }
.ticket-box .btn { width: 100%; }
.sup-dm { display: block; text-align: center; text-decoration: none; width: 100%; }

/* ---------- skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); height: 90px; margin-bottom: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- pb23: open invoices ---------- */
.inv-card-box { background: linear-gradient(135deg, rgba(220,38,38,.14), rgba(220,38,38,.05));
  border: 1px solid rgba(220,38,38,.35); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.inv-card-box .icb-t { font-family: Vazir; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.inv-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; }
.inv-item .ii-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.inv-item .ii-prod { font-family: Vazir; font-weight: 700; font-size: 15px; }
.inv-item .ii-amt { font-family: Vazir; font-weight: 800; font-size: 15px; color: var(--red); white-space: nowrap; }
.inv-item .ii-meta { font-family: Vazir; font-size: 12px; color: var(--muted); margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 6px 14px; }
.inv-item .ii-code { font-family: monospace; font-size: 11px; direction: ltr; }
.inv-badge { font-family: Vazir; font-size: 11px; padding: 3px 10px; border-radius: 999px; }
.inv-badge.wait { background: rgba(245,158,11,.16); color: #f59e0b; }
.inv-badge.sent { background: rgba(59,130,246,.16); color: #60a5fa; }
.inv-item .ii-btns { display: flex; gap: 8px; margin-top: 12px; }
.inv-item .ii-btns .btn { flex: 1; font-size: 13px; padding: 11px 8px; }
.inv-badge.wait.urgent { background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.4); animation: cdPulse 1s infinite; }
@keyframes cdPulse { 50% { opacity: .55; } }
.home-inv-banner { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, rgba(245,158,11,.16), rgba(245,158,11,.06));
  border: 1px solid rgba(245,158,11,.4); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
  cursor: pointer; transition: transform .15s; }
.home-inv-banner:active { transform: scale(.98); }
.home-inv-banner .hib-ico { font-size: 22px; }
.home-inv-banner .hib-txt { flex: 1; font-family: Vazir; font-size: 13px; font-weight: 600; line-height: 1.6; }
.home-inv-banner .is-arrow { color: var(--amber, #f59e0b); font-size: 20px; }

/* ---------- accessibility (ui-ux-pro-max) ---------- */
/* Touch targets: WCAG 2.5.5 wants 44x44 minimum hit area. */
.tab { min-height: 44px; padding: 8px 2px; }
.tab-plus { min-height: 44px; min-width: 44px; justify-content: center; align-items: center; }
.appbar-add { width: 44px; height: 44px; }
.quick { min-height: 56px; }
/* Clear keyboard focus ring for desktop / keyboard nav (RTL-aware). */
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 8px; }
.btn:focus-visible, .tab:focus-visible, .cat-pill:focus-visible, .appbar-add:focus-visible, .quick:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px;
}
/* Respect users who opt out of motion (dizzy / accessibility setting). */

/* ===== pb42: purchase stepper ===== */
.stepper {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px;
}
.stp { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.stp-dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); background: var(--card2); font-size: 12px; font-weight: 700;
  color: var(--muted); transition: all .25s ease;
}
.stp.current { color: var(--text); }
.stp.current .stp-dot {
  border-color: var(--red); background: var(--red-soft); color: var(--red);
  box-shadow: 0 0 0 4px rgba(226,55,68,.12);
}
.stp.done { color: var(--green); }
.stp.done .stp-dot { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.stp-line { width: 22px; height: 2px; border-radius: 2px; background: var(--line); transition: background .3s; }
.stp-line.filled { background: var(--green); }

/* ===== pb42: success / delivery hero ===== */
.success-hero {
  background: linear-gradient(135deg, #143d24 0%, #0f2a19 100%);
  border: 1px solid rgba(46,204,113,.35); border-radius: 20px;
  padding: 22px 18px; text-align: center;
  box-shadow: 0 10px 30px rgba(46,204,113,.15);
}
.sh-check {
  width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--green); color: #06210f; font-size: 30px; font-weight: 700;
  display: grid; place-items: center;
  animation: pop .45s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.sh-title { font-size: 18px; font-weight: 700; color: var(--green); }
.sh-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

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