/* فونت: میزبانی داخلی؛ منبع و نسخه در README */
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
       url("fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* رنگ‌ها از design/pulava-app-design_V1_2.html */
:root {
  /* بیرون قاب (تیره) */
  --bg: #0B1311; --bg2: #0E1A17; --panel: #122220; --panel-2: #16302B;
  --line: rgba(232,239,236,.10); --line-2: rgba(232,239,236,.16);
  --cream: #E9F0ED; --muted: #8AA39D; --muted-2: #5F7670;
  --brand-lite: #34D3B8; --gold: #E0A126;
  /* داخل گوشی (روشن) */
  --p-bg: #FAFAF9; --p-card: #FFFFFF; --p-ink: #15201D; --p-soft: #6C7B77;
  --p-line: #ECEEEB; --p-line-2: #E0E3DF;
  --p-brand: #0F7B6C; --p-brand-deep: #0A574C; --p-brand-tint: #E7F3F1;
  --p-gold: #C98A1E; --p-gold-tint: #FBF2DD;
  --p-green: #188C64; --p-green-tint: #E6F4ED;
  --p-red: #C5503B; --p-red-tint: #FBEAE6;
  --body: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--cream);
  font-family: var(--body); font-weight: 400; line-height: 1.7;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
.ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ============ چیدمان صفحه ============ */
/* dir=rtl: اولین فرزند (گوشی) سمت راست، پنل فنی سمت چپ */
.stage {
  height: 100vh; display: flex; align-items: center; gap: 4vh;
  padding: 5vh 4vw;
  background: radial-gradient(120% 100% at 85% -20%, rgba(15,123,108,.25), transparent 60%), var(--bg);
}
.phone-wrap { flex: none; display: flex; align-items: center; justify-content: center; }

/* ابعاد پایه ماکت؛ app.js آن را با zoom به حدود ۹۰ درصد ارتفاع صفحه می‌رساند */
.phone {
  width: 300px; background: #080d0c; border-radius: 44px; padding: 9px;
  box-shadow: 0 0 0 2px #1c2b28, 0 40px 70px -34px rgba(0,0,0,.9), inset 0 0 0 1px rgba(255,255,255,.04);
}
.screen { position: relative; height: 626px; border-radius: 36px; overflow: hidden; background: var(--p-bg); display: flex; flex-direction: column; color: var(--p-ink); }
.notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 104px; height: 24px; background: #080d0c; border-radius: 0 0 16px 16px; z-index: 9; }
.home-ind { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); width: 108px; height: 4px; border-radius: 99px; background: rgba(0,0,0,.28); z-index: 9; }

/* نوار وضعیت */
.sb { height: 42px; flex: none; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 22px 4px; font-size: 12.5px; font-weight: 600; }
.sb__r { display: flex; align-items: center; gap: 6px; }
.sb__r .ic { width: 15px; height: 15px; stroke-width: 2.2; }

/* ناحیه پیمایش */
.app { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding-bottom: 40px; }
.app::-webkit-scrollbar { display: none; }

/* نوار بالا */
.tb { display: flex; align-items: center; gap: 10px; padding: 6px 18px 12px; }
.tb__t { font-size: 18px; font-weight: 700; flex: 1; }
.tb__btn { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--p-card); border: 1px solid var(--p-line); color: var(--p-ink); text-decoration: none; }
.tb__btn .ic { width: 19px; height: 19px; }

/* نوار پایین */
.nav { flex: none; height: 66px; background: #fff; border-top: 1px solid var(--p-line); display: flex; align-items: center; justify-content: space-around; padding: 0 8px 6px; position: relative; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #9AA8A4; font-size: 10px; width: 54px; text-decoration: none; }
.nav a .ic { width: 21px; height: 21px; }
.nav a.on { color: var(--p-brand); }
.nav a.off { opacity: .4; cursor: not-allowed; }
.nav .navfab {
  width: 58px; height: 58px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: linear-gradient(145deg, var(--p-brand), var(--p-brand-deep));
  display: grid; place-items: center; color: #fff; position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  box-shadow: 0 12px 26px -6px rgba(15,123,108,.7), 0 0 0 5px var(--p-bg);
}
.nav .navfab .ic { width: 26px; height: 26px; stroke-width: 2; }
.nav .navslot { width: 58px; }
.nav .navgap { width: 54px; }

/* اجزای عمومی */
.pad { padding: 0 18px; }
.card { background: var(--p-card); border: 1px solid var(--p-line); border-radius: 16px; }
.muted { color: var(--p-soft); }
.amt { font-variant-numeric: tabular-nums; font-weight: 700; }
.pos { color: var(--p-green); }
.neg { color: var(--p-red); }
/* واحد کنار مبلغ، با قلم کوچک‌تر */
.unit { font-size: .72em; font-weight: 500; opacity: .8; }
/* مبلغ در جای تنگ: عدد در یک خط، واحد در خط دوم */
.num { display: block; white-space: nowrap; }
.unit-line { display: block; font-size: 10px; font-weight: 500; opacity: .85; white-space: nowrap; line-height: 1.4; }
/* نام شخص همیشه یک خطی؛ اگر جا نشد سه‌نقطه */
.name, .ct .cn b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ ۲·۱ خانه ============ */
.hello { padding: 2px 18px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hello b { font-size: 16px; font-weight: 700; display: block; line-height: 1.5; }
.hello .av { width: 38px; height: 38px; border-radius: 12px; background: var(--p-brand-tint); color: var(--p-brand-deep); display: grid; place-items: center; flex: none; }
.hello .av .ic { width: 20px; height: 20px; }

.balance {
  margin: 0 18px; border-radius: 20px; padding: 18px 18px 16px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--p-brand) 0%, #0c6a5d 55%, var(--p-brand-deep) 100%);
}
.balance::after { content: ""; position: absolute; inset: auto -30px -40px auto; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.06); }
.balance .lab { font-size: 12px; opacity: .85; position: relative; }
.balance .big { font-size: 27px; font-weight: 800; margin-top: 4px; position: relative; }
.balance .big small { font-size: 14px; font-weight: 500; opacity: .85; margin-right: 4px; }

.banks { display: flex; gap: 10px; padding: 12px 18px 0; }
.bank { flex: 1; min-width: 0; padding: 10px 8px; }
.bank .t { font-size: 11px; color: var(--p-soft); display: flex; align-items: center; gap: 5px; }
.bank .t .ic { width: 14px; height: 14px; }
.bank .v { font-size: 14px; margin-top: 2px; }

.sec-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px; }
.sec-h b { font-size: 14px; font-weight: 700; }
.sec-h a { font-size: 12px; color: var(--p-brand); text-decoration: none; }

.sumrow { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sumrow .muted { font-size: 12.5px; min-width: 0; }
.sumrow b { flex: none; white-space: nowrap; }

.empty { margin: 0 18px; padding: 18px 14px; text-align: center; font-size: 12.5px; color: var(--p-soft); border: 1px dashed var(--p-line-2); border-radius: 14px; }

/* ============ ۴·۱ طرف‌حساب‌ها ============ */
.totals { display: flex; gap: 10px; margin-bottom: 6px; }
.totals .card { flex: 1; min-width: 0; padding: 12px 8px; text-align: center; }
.totals .muted { font-size: 11px; }
.totals b { font-size: 15px; display: block; }

.grp { padding: 14px 18px 4px; font-size: 12px; font-weight: 700; color: var(--p-soft); display: flex; justify-content: space-between; }
.grp span { font-weight: 500; }

.ct { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: inherit; text-decoration: none; }
.ct + .ct { border-top: 1px solid var(--p-line); }
.ct .ca { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; background: var(--p-brand-tint); color: var(--p-brand-deep); }
.ct .ca.owe { background: var(--p-gold-tint); color: var(--p-gold); }
.ct .ca.zero { background: #eee; color: #888; }
.ct .cn { flex: 1; min-width: 0; }
.ct .cn b { font-size: 14px; font-weight: 600; display: block; }
.ct .cn span { font-size: 11.5px; color: var(--p-soft); }
.ct .cb { flex: none; text-align: left; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============ صورت‌حساب شخص ============ */
.stmt-hero { margin: 0 18px; padding: 16px; text-align: center; }
.stmt-hero .ca { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; font-weight: 700; font-size: 19px; background: var(--p-brand-tint); color: var(--p-brand-deep); }
.stmt-hero .lab { font-size: 12px; color: var(--p-soft); margin-top: 6px; }
.stmt-hero .big { font-size: 24px; font-weight: 800; }
.stmt-hero .tag { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 10px; border-radius: 99px; }
.tag.pos { background: var(--p-green-tint); }
.tag.neg { background: var(--p-red-tint); }
.tag.zero { background: #eee; color: #777; }

.rows { margin: 0 18px; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; }
.row + .row { border-top: 1px solid var(--p-line); }
.row .rx { flex: 1; min-width: 0; font-size: 13px; }
.row .rx span { display: block; font-size: 11px; color: var(--p-soft); }
.row .ra { flex: none; text-align: left; font-size: 13px; }

.err { margin: 40px 18px; text-align: center; font-size: 13px; color: var(--p-red); }

/* ============ پنل نمای فنی ============ */
.tech {
  flex: 1; align-self: stretch; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px;
}
.tech__head { display: flex; align-items: center; gap: 10px; }
.tech__head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.tech__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted-2); }
.tech__empty { color: var(--muted); font-size: 17px; font-weight: 300; margin: 18px 0 0; }

/* صفحه باریک (مثلا گوشی): پنل فنی زیر قاب */
@media (max-width: 760px) {
  body { overflow: auto; }
  .stage { flex-direction: column; height: auto; min-height: 100vh; padding: 16px; }
  .tech { align-self: stretch; width: 100%; }
}
