@font-face { font-family: "Vazirmatn"; src: url("/assets/vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --blue: #0b5cff; --blue2: #0019e0; --cyan: #00c2ff;
  --grad: linear-gradient(135deg, #00c2ff 0%, #0b5cff 55%, #0019e0 100%);
  --bg: #ffffff; --surface: #f5f7fc; --card: #ffffff; --text: #14203a; --muted: #67738f; --line: #e6eaf3;
  --ok: #12a150; --warn: #e08a00; --bad: #e03131; --img-radius: 16px; --vis: 3.2;
  --shadow: 0 1px 2px rgba(20,32,58,.05), 0 8px 24px rgba(20,32,58,.07);
  --nav-h: 56px;
}
:root[data-theme="dark"] {
  --bg: #0b1122; --surface: #121a30; --card: #151e37; --text: #e8edf8; --muted: #93a0bd; --line: #222d4a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: "Vazirmatn", system-ui, Tahoma, sans-serif; background: var(--surface); color: var(--text); font-size: 14px; line-height: 1.7; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.ic { width: 22px; height: 22px; flex: none; }
.ltr { direction: ltr; text-align: left; unicode-bidi: plaintext; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.app { max-width: 720px; margin: 0 auto; min-height: 100%; background: var(--bg); position: relative; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); box-shadow: 0 0 0 1px var(--line); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.search-pill { flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; background: var(--surface); border-radius: 21px; color: var(--muted); border: 1px solid transparent; }
.search-pill input { flex: 1; border: 0; background: none; outline: none; min-width: 0; }
.avatar-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-items: center; color: var(--text); position: relative; }
.avatar-btn.in { background: var(--grad); color: #fff; }
.backbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; position: sticky; top: 0; z-index: 20; background: var(--bg); }
.backbar .ttl { flex: 1; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { width: 40px; height: 40px; border: 0; background: none; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.iconbtn:active { background: var(--surface); }

.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(720px, 100%); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); z-index: 30; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; color: var(--muted); }
.bottom-nav a .ic { width: 23px; height: 23px; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.bottom-nav a.active { color: var(--blue); font-weight: 700; }
.bottom-nav a.active .ic { transform: translateY(-2px) scale(1.12); }

.sec { padding: 14px 0 4px; }
.sec-h { display: flex; align-items: center; padding: 0 14px 8px; }
.sec-h h2 { margin: 0; font-size: 16px; font-weight: 800; flex: 1; }
.sec-h a { font-size: 12px; color: var(--blue); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar, .rail::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* کاروسل: ارتفاع و عرض برابر، بخشی از کارت بعدی دیده می‌شود */
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 14px 10px; scrollbar-width: none; }
.rail > * { flex: none; width: calc((100% - 28px - 12px * (var(--vis) - 1)) / var(--vis)); scroll-snap-align: start; }
@media (min-width: 560px) { :root { --vis: 4.2; } }
.fc { display: block; }
.fc .cv { aspect-ratio: 1; border-radius: var(--img-radius); background: var(--surface) center/cover no-repeat; overflow: hidden; position: relative; box-shadow: 0 0 0 1px var(--line) inset; }
.fc .cv img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.fc .cv img.ld { opacity: 1; }
.fc .tt { margin-top: 7px; font-size: 12.5px; font-weight: 600; line-height: 1.5; height: 3em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-wrap: balance; }
.fc .mt { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; height: 1.6em; overflow: hidden; white-space: nowrap; }
.fc .pr { font-size: 11.5px; font-weight: 700; height: 1.7em; display: flex; gap: 6px; align-items: baseline; }
.pr s { color: var(--muted); font-weight: 400; font-size: 10.5px; }
.badge { position: absolute; top: 6px; right: 6px; background: var(--bad); color: #fff; font-size: 10px; padding: 0 7px; border-radius: 99px; }

.list { padding: 0 14px; }
.row-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row-item .cv { width: 64px; height: 64px; border-radius: var(--img-radius); background: var(--surface) center/cover; flex: none; overflow: hidden; }
.row-item .cv img { width: 100%; height: 100%; object-fit: cover; }
.row-item .tx { flex: 1; min-width: 0; }
.row-item .tx b { display: block; font-size: 13.5px; line-height: 1.5; text-wrap: balance; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 9px 18px; border-radius: 12px; font-weight: 600; }
.btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 8px 20px rgba(11,92,255,.28); }
.btn.green { background: var(--ok); color: #fff; border: 0; }
.btn.sm { padding: 5px 14px; border-radius: 99px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; }

/* صفحه فایل */
.fhead { display: flex; gap: 14px; padding: 6px 14px 12px; align-items: flex-start; }
.fhead .cv { width: 104px; height: 104px; border-radius: var(--img-radius); background: var(--surface) center/cover; flex: none; overflow: hidden; box-shadow: 0 0 0 1px var(--line) inset; }
.fhead .cv img { width: 100%; height: 100%; object-fit: cover; }
.fhead h1 { margin: 0; font-size: 17px; line-height: 1.55; text-wrap: balance; }
.fhead .sub { color: var(--muted); font-size: 12.5px; }
.stats { display: flex; margin: 4px 14px 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stats > div { flex: 1; text-align: center; padding: 9px 4px; border-inline-start: 1px solid var(--line); }
.stats > div:first-child { border-inline-start: 0; }
.stats b { display: block; font-size: 14px; }
.stats span { font-size: 11px; color: var(--muted); }
.vers { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 10px; }
.ver { padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: right; min-width: 110px; }
.ver.on { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 25%, transparent); }
.ver b { display: block; font-size: 13px; }
.ver span { font-size: 11px; color: var(--muted); }
.actionbar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15; display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.actionbar .price { min-width: 92px; }
.actionbar .price b { font-size: 15px; display: block; line-height: 1.3; }
.actionbar .btn { flex: 1; }
.pin { margin: 0 14px 10px; padding: 10px 14px; background: color-mix(in srgb, var(--blue) 9%, var(--bg)); border-radius: 12px; font-size: 12.5px; }
.box { margin: 0 14px 10px; padding: 10px 14px; border-radius: 12px; border-inline-start: 4px solid var(--blue); background: var(--surface); font-size: 13px; }
.box.warning { border-color: var(--warn); } .box.tip { border-color: var(--ok); } .box b { display: block; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.info-grid > div { display: flex; gap: 9px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); min-width: 0; }
.info-grid > div:nth-child(2n+1) { border-inline-start: 0; }
.info-grid .ic { width: 20px; height: 20px; color: var(--blue); }
.info-grid small { display: block; font-size: 11px; color: var(--muted); line-height: 1.3; }
.info-grid span { font-size: 12.5px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.prose { padding: 0 14px; white-space: pre-wrap; line-height: 1.95; font-size: 13.5px; }
.prose.clamp { max-height: 7.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.gal { display: flex; gap: 10px; overflow-x: auto; padding: 0 14px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.gal img { height: 200px; width: auto; border-radius: var(--img-radius); scroll-snap-align: start; background: var(--surface); }

/* ورق پایین‌آمده و پرداخت */
.sheet-overlay { position: fixed; inset: 0; background: rgba(8,14,30,0); z-index: 60; display: flex; align-items: flex-end; justify-content: center; transition: background .25s; }
.sheet-overlay.show { background: rgba(8,14,30,.5); }
.sheet { width: min(720px, 100%); background: var(--bg); border-radius: 22px 22px 0 0; max-height: 92vh; overflow: auto; transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.9,.3,1); padding-bottom: env(safe-area-inset-bottom); }
.sheet.show { transform: none; }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 2px; }
.sheet-head { display: flex; align-items: center; padding: 8px 16px; } .sheet-head b { flex: 1; font-size: 15px; }
.sheet-head .x { border: 0; background: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.sheet-body { padding: 4px 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); outline: none; font-size: 15px; }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.pay-file { display: flex; gap: 12px; align-items: center; padding: 8px 0 12px; }
.pay-file .cv { width: 54px; height: 54px; border-radius: 14px; background: var(--surface) center/cover; overflow: hidden; flex: none; } .pay-file .cv img { width: 100%; height: 100%; object-fit: cover; }
.opt { display: flex; gap: 12px; align-items: center; padding: 12px; border: 2px solid var(--ok); border-radius: 14px; margin-bottom: 10px; background: color-mix(in srgb, var(--ok) 6%, var(--bg)); }
.opt .ic { color: var(--ok); width: 26px; height: 26px; }
.note { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface); border-radius: 12px; font-size: 12.5px; margin-bottom: 12px; }
.note.bad { color: var(--bad); }
.chipsrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sumline { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.sumline.t { font-weight: 800; font-size: 15px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.done { text-align: center; padding: 18px 0; }
.done .tick { width: 78px; height: 78px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 0 auto 10px; animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.done .tick .ic { width: 42px; height: 42px; stroke-width: 2.6; }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.toasts { position: fixed; bottom: calc(var(--nav-h) + 24px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; }
.toast { background: #101a3d; color: #fff; padding: 10px 18px; border-radius: 14px; font-size: 13px; animation: up .25s; max-width: 88vw; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); } .toast.out { opacity: 0; transition: opacity .4s; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* اسکلت بارگذاری */
.sk { background: linear-gradient(100deg, var(--surface) 30%, color-mix(in srgb, var(--surface) 60%, var(--bg)) 50%, var(--surface) 70%); background-size: 300% 100%; animation: sh 1.2s infinite linear; border-radius: 12px; }
@keyframes sh { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-card .a { aspect-ratio: 1; } .sk-card .b { height: 12px; margin-top: 8px; } .sk-card .c { height: 12px; margin-top: 6px; width: 60%; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { width: 84px; height: 84px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; margin: 0 auto 12px; color: var(--blue); }
.empty .big .ic { width: 40px; height: 40px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: right; }
.menu-list .ic { color: var(--blue); }
.hero-card { margin: 8px 14px 4px; padding: 18px; border-radius: 20px; background: var(--grad); color: #fff; }
.hero-card .bal { font-size: 24px; font-weight: 800; }
.tx-pos { color: var(--ok); } .tx-neg { color: var(--bad); }
.chart { width: 100%; height: 140px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
