@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn.woff2') format('woff2-variations'), url('/fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-2: #f1ede6;
  --ink: #1c1a29;
  --ink-2: #5b5869;
  --ink-3: #9a96a6;
  --line: #e7e2d9;
  --brand: #ef5b2a;          /* زعفرانی */
  --brand-2: #ff8a3d;
  --brand-ink: #ffffff;
  --brand-soft: #fde8de;
  --teal: #0f9b8e;
  --teal-soft: #dcf3ef;
  --violet: #5b4bdb;
  --violet-soft: #e8e5fb;
  --danger: #d93a3a;
  --danger-soft: #fde4e4;
  --ok: #18a058;
  --ok-soft: #dff5e8;
  --warn: #c98a00;
  --warn-soft: #fff3d6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(28, 26, 41, .04), 0 6px 24px rgba(28, 26, 41, .06);
  --shadow-lg: 0 10px 40px rgba(28, 26, 41, .14);
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.4; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }
.num { font-feature-settings: 'tnum'; }

/* ───────── چیدمان ───────── */
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; }
.page { padding: 16px 16px calc(var(--tabbar-h) + var(--safe-b) + 96px); animation: in .22s ease; }
.page.no-tab { padding-bottom: calc(var(--safe-b) + 110px); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hide { display: none !important; }

/* ───────── سربرگ ───────── */
.topbar { display: flex; align-items: center; gap: 10px; padding: 6px 0 14px; }
.topbar .title { font-weight: 800; font-size: 18px; flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow);
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.icon-btn svg { width: 20px; height: 20px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 20px; letter-spacing: -.3px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: conic-gradient(from 200deg, var(--brand), var(--brand-2), #ffc15e, var(--brand));
  box-shadow: 0 4px 14px rgba(239, 91, 42, .35);
}
.logo-mark svg { width: 18px; height: 18px; }
.balance-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow); font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; border: 0;
}
.balance-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* ───────── کارت‌ها ───────── */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.tight { padding: 12px; }
.hero {
  border-radius: 24px; padding: 20px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #ff9b52 0%, var(--brand) 45%, #c7361a 100%);
  box-shadow: 0 14px 40px rgba(239, 91, 42, .35);
}
.hero::after {
  content: ''; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.hero h1 { font-size: 22px; }
.hero p { opacity: .92; font-size: 14px; margin-top: 4px; }

.tool-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); cursor: pointer; border: 0; width: 100%; text-align: right; transition: transform .12s;
}
.tool-card:active { transform: scale(.985); }
.tool-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; }
.tool-icon svg { width: 26px; height: 26px; }
.ti-text { background: var(--violet-soft); color: var(--violet); }
.ti-image { background: var(--teal-soft); color: var(--teal); }
.ti-video { background: var(--brand-soft); color: var(--brand); }
.tool-card .t { font-weight: 800; font-size: 16px; }
.tool-card .d { color: var(--ink-2); font-size: 13px; }
.tool-card .p { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.chev { color: var(--ink-3); width: 18px; height: 18px; flex-shrink: 0; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 6px; margin: 0 -16px; padding-inline: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.wrap-chips { white-space: normal; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding-inline: 0; }

/* ───────── فرم ───────── */
label.field { display: block; }
.field > .lbl { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field > .lbl small { font-weight: 500; color: var(--ink-3); }
.input, .textarea, .select {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px;
  outline: none; transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
.input.ltr { direction: ltr; text-align: left; letter-spacing: 1px; }
.input-lg { font-size: 20px; padding: 14px 16px; font-weight: 700; }
.counter { text-align: left; font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.seg { display: flex; background: var(--surface-2); padding: 4px; border-radius: 14px; gap: 4px; }
.seg button {
  flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink-2);
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

.toggle { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; cursor: pointer; }
.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: right .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.toggle.on .switch { background: var(--teal); }
.toggle.on .switch::after { right: 21px; }

/* انتخاب سطح کیفیت */
.tiers { display: grid; gap: 8px; }
.tier {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; text-align: right; width: 100%;
}
.tier.on { border-color: var(--brand); background: #fff8f4; box-shadow: 0 0 0 3px var(--brand-soft); }
.tier .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; position: relative; }
.tier.on .radio { border-color: var(--brand); }
.tier.on .radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.tier .n { font-weight: 800; }
.tier .d { font-size: 12px; color: var(--ink-2); }
.tier .pr { font-weight: 800; font-size: 14px; white-space: nowrap; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); margin-inline-start: 6px; vertical-align: middle; }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.gray { background: var(--surface-2); color: var(--ink-2); }

/* قاب‌ها */
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fmt {
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); padding: 10px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
}
.fmt .shape { background: var(--surface-2); border: 2px solid var(--ink-3); border-radius: 4px; }
.fmt.on { border-color: var(--brand); background: #fff8f4; }
.fmt.on .shape { border-color: var(--brand); background: var(--brand-soft); }

/* ───────── دکمه‌ها ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; border-radius: 14px;
  padding: 13px 18px; font-weight: 800; font-size: 15px; transition: transform .1s, opacity .15s; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: var(--brand-ink); box-shadow: 0 6px 18px rgba(239, 91, 42, .32); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* نوار پایین صفحهٔ ساخت */
.action-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, rgba(247, 244, 239, 0));
}
.action-bar .inner { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 12px; background: var(--surface); padding: 10px 10px 10px 10px; border-radius: 20px; box-shadow: var(--shadow-lg); }
.action-bar .price { padding-inline-start: 6px; }
.action-bar .price b { font-size: 17px; display: block; line-height: 1.3; }
.action-bar .price span { font-size: 12px; color: var(--ink-2); }
.action-bar .btn { flex: 1; }
.with-tabbar .action-bar { bottom: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: 12px; }

/* ───────── نوار تب پایین ───────── */
.tabbar {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tabbar .inner { max-width: 560px; margin: 0 auto; height: var(--tabbar-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--ink-3); background: none; border: 0; cursor: pointer; padding: 6px 0; }
.tab svg { width: 23px; height: 23px; }
.tab.on { color: var(--ink); }
.tab-fab { display: grid; place-items: center; }
.tab-fab span {
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; color: #fff; margin-top: -22px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 8px 22px rgba(239, 91, 42, .45);
}
.tab-fab svg { width: 26px; height: 26px; }

/* ───────── نتیجه‌ها ───────── */
.result-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.result-card .body { padding: 16px; white-space: pre-wrap; word-wrap: break-word; line-height: 2; }
.result-card .hook { font-weight: 800; font-size: 16px; margin-bottom: 6px; white-space: normal; }
.result-card .tags { padding: 0 16px 14px; color: var(--violet); font-size: 13px; direction: rtl; word-spacing: 4px; }
.result-card .foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fcfbf9; flex-wrap: wrap; }
.slide { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.slide:last-child { border-bottom: 0; }
.slide .no { width: 28px; height: 28px; border-radius: 9px; background: var(--violet-soft); color: var(--violet); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; }
.slide .st { font-weight: 800; }
.slide .meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.media-frame { background: #1c1a29; display: grid; place-items: center; position: relative; }
.media-frame img, .media-frame video, .media-frame canvas { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }

/* حالت در حال ساخت */
.making { text-align: center; padding: 36px 20px; }
.orb {
  width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--brand), var(--brand-2), #ffc15e, var(--teal), var(--violet), var(--brand));
  animation: spin 2.4s linear infinite; position: relative; filter: saturate(1.1);
}
.orb::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 99px; transition: width .6s; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), #faf8f5, var(--surface-2)); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* تاریخچه */
.hist-item { color: var(--ink); display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); cursor: pointer; }
.hist-thumb { width: 58px; height: 58px; border-radius: 12px; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); }
.hist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hist-thumb svg { width: 24px; height: 24px; }
.hist-item .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.s-done { background: var(--ok-soft); color: var(--ok); }
.s-processing, .s-pending { background: var(--warn-soft); color: var(--warn); }
.s-failed, .s-refunded { background: var(--danger-soft); color: var(--danger); }

/* کیف پول */
.wallet-hero { border-radius: 24px; padding: 22px; color: #fff; background: linear-gradient(140deg, #2a2640, #1c1a29 60%); position: relative; overflow: hidden; }
.wallet-hero::before { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; left: -70px; top: -90px; background: radial-gradient(circle, rgba(239, 91, 42, .55), transparent 70%); }
.wallet-hero .amt { font-size: 32px; font-weight: 900; letter-spacing: -.5px; position: relative; }
.wallet-hero .cur { font-size: 15px; font-weight: 600; opacity: .8; }
.pkg {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 12px; cursor: pointer; text-align: right; position: relative;
}
.pkg.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pkg .a { font-weight: 900; font-size: 17px; }
.pkg .b { font-size: 12px; color: var(--teal); font-weight: 700; }
.pkg .pop { position: absolute; top: -9px; left: 10px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.tx { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx .amt { font-weight: 800; direction: ltr; }
.plus { color: var(--ok); }
.minus { color: var(--ink); }

/* ورود */
.login-wrap { min-height: 100dvh; display: flex; flex-direction: column; padding: 24px 20px calc(24px + var(--safe-b)); }
.login-art {
  height: 34vh; min-height: 220px; border-radius: 28px; margin-bottom: 26px; position: relative; overflow: hidden;
  background: radial-gradient(90% 90% at 80% 10%, #ffb066 0%, var(--brand) 45%, #8f2a14 100%);
}
.login-art .bubble { position: absolute; background: rgba(255, 255, 255, .95); border-radius: 16px; padding: 8px 12px; font-size: 13px; font-weight: 700; box-shadow: var(--shadow-lg); color: var(--ink); }
.otp { display: flex; gap: 10px; direction: ltr; justify-content: center; }
.otp input { width: 52px; height: 60px; text-align: center; font-size: 24px; font-weight: 800; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); outline: none; }
.otp input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* پیام‌ها */
.toast-wrap { position: fixed; top: 14px; inset-inline: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: tin .25s ease; max-width: 520px; pointer-events: auto; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }
.notice { padding: 12px 14px; border-radius: 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: #7a5500; }
.notice.info { background: var(--violet-soft); color: #3b2fa0; }
.notice.err { background: var(--danger-soft); color: #8f1f1f; }
.notice.ok { background: var(--ok-soft); color: #0d6b3a; }

/* برگهٔ پایین (bottom sheet) */
.sheet-back { position: fixed; inset: 0; background: rgba(20, 18, 30, .45); z-index: 80; animation: fade .2s; }
.sheet { position: fixed; bottom: 0; inset-inline: 0; z-index: 81; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + var(--safe-b)); max-height: 88vh; overflow: auto; animation: up .25s ease; max-width: 560px; margin: 0 auto; }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* پنل مدیریت */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
.stat { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.stat .k { font-size: 12px; color: var(--ink-2); }
.stat .v { font-size: 20px; font-weight: 900; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: right; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--ink-2); font-weight: 700; font-size: 12px; }
.scroll-x { overflow-x: auto; }
.pv { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pv .led { width: 10px; height: 10px; border-radius: 50%; }
.led.on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.led.off { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.led.na { background: var(--ink-3); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 700; }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty svg { width: 54px; height: 54px; color: var(--ink-3); margin: 0 auto 10px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 2px 10px; }
.section-title a { font-size: 13px; font-weight: 700; }
.recent { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.recent .it { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; padding: 8px; font-size: 11px; color: var(--ink-2); text-align: center; position: relative; }
.recent .it svg { width: 22px; height: 22px; margin: 0 auto 4px; color: var(--violet); }
.recent .it img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 600px) {
  .page { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───────── نسخهٔ ۲: کیف پول، کارت‌به‌کارت، کارشناس‌ها، مدیریت ───────── */
.link-btn { background: none; border: 0; color: var(--brand); font-weight: 700; cursor: pointer; padding: 4px; font-size: 13px; }
.ltr-text { direction: ltr; text-align: right; letter-spacing: .5px; }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.method { border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px; cursor: pointer; display: grid; gap: 2px; text-align: right; }
.method.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.method .m-ic { font-size: 22px; }
.bank-card {
  position: relative; overflow: hidden; border-radius: 22px; padding: 20px 20px 16px; color: #fff; aspect-ratio: 1.62; max-height: 240px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 120% at 0% 0%, var(--c2), var(--c1) 60%); box-shadow: 0 18px 40px rgba(20, 15, 40, .28);
}
.bank-card::before { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; left: -80px; bottom: -140px; background: rgba(255, 255, 255, .09); }
.bank-card::after { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -60px; top: -90px; background: rgba(255, 255, 255, .07); }
.bank-card > * { position: relative; z-index: 1; }
.bank-name { font-weight: 900; font-size: 16px; }
.chip-ic { width: 42px; height: 32px; border-radius: 7px; background: linear-gradient(135deg, #f5d98b, #c9a24a); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.bank-num { font-size: clamp(20px, 6vw, 27px); font-weight: 800; letter-spacing: 2px; text-align: center; font-feature-settings: 'tnum'; text-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.bank-holder { font-weight: 700; font-size: 14px; opacity: .95; }
.copy-pill { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, .95); color: var(--ink); }
.copy-pill svg { width: 15px; height: 15px; }
.copy-pill.dark { background: var(--ink); color: #fff; }
.copy-pill:active { transform: scale(.96); }
.copy-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); }
.amount-box { background: var(--surface); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); border: 2px dashed var(--brand-soft); }
.amount-box .big { font-size: 28px; font-weight: 900; color: var(--ink); }
.amount-box .big small { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.amount-box .rial { margin-top: 6px; color: var(--ink-2); font-size: 13px; }
.tail-note { margin-top: 10px; font-size: 13px; background: var(--warn-soft); color: #7a5500; border-radius: 10px; padding: 8px 10px; }
.steps { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--ink-3); }
.steps i { flex: 1; height: 2px; background: var(--line); }
.steps span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.steps span.on { background: var(--brand); color: #fff; }
.steps span.done { background: var(--ok-soft); color: var(--ok); }
.c2c-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.mini-stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.mini-stat b { font-size: 15px; direction: ltr; }
.lowbal { max-width: 528px; margin: 0 auto 8px; display: flex; gap: 10px; align-items: center; background: #fff3d6; color: #6b4e00; border-radius: 16px; padding: 10px 12px; font-size: 13px; box-shadow: var(--shadow); }
.lowbal > span { font-size: 22px; }
.lowbal.soft { background: var(--violet-soft); color: #3b2fa0; }
.action-bar .price span:first-child { font-size: 11px; }
.ab-note { max-width: 528px; margin: 6px auto 0; font-size: 11px; color: var(--ink-3); text-align: center; }
.action-bar { pointer-events: none; } .action-bar > * { pointer-events: auto; }
.page { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 150px); }

/* گفت‌وگو با کارشناس */
.chat-page { padding-bottom: 170px; }
.msgs { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 18px; line-height: 1.9; word-wrap: break-word; white-space: pre-wrap; }
.msg.user { align-self: flex-start; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-end; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; white-space: normal; }
.msg .md p { margin: 0 0 8px; } .msg .md p:last-child { margin: 0; }
.msg .md h4 { margin: 10px 0 4px; font-size: 15px; } .msg .md ul, .msg .md ol { margin: 4px 0 8px; padding-right: 20px; }
.msg .md code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.msg-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); }
.typing { display: flex; gap: 5px; padding: 16px; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }
.composer { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; padding: 8px 12px calc(10px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 75%, rgba(247, 244, 239, 0)); }
.composer .est, .composer .comp-row { max-width: 536px; margin: 0 auto; }
.composer .est { font-size: 12px; padding: 0 6px 6px; }
.composer .est .low { color: #8f1f1f; font-weight: 700; }
.comp-row { display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border-radius: 20px; padding: 8px; box-shadow: var(--shadow-lg); }
.comp-row textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; padding: 9px 6px; max-height: 160px; line-height: 1.7; }
.comp-row .btn { padding: 10px 16px; border-radius: 14px; }
.comp-row .icon-btn { box-shadow: none; background: var(--surface-2); }

/* مدیریت */
.serp { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-family: Arial, Vazirmatn, sans-serif; }
.serp-t { color: #1a0dab; font-size: 18px; margin-top: 4px; } .serp-u { color: #006621; font-size: 13px; } .serp-d { color: #545454; font-size: 13px; }
details > summary { cursor: pointer; list-style: none; } details > summary::-webkit-details-marker { display: none; }
.stat .v { word-break: break-all; }
html, body { overflow-x: hidden; }
.row > .input, .row > input { min-width: 0; }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.tbl { white-space: nowrap; }
input[type=date].input { padding: 10px 8px; font-size: 13px; }

/* ───────── v3: تخمین هزینه، نصب اپ، اتصال‌ها ───────── */
.tool-card.soft { background: linear-gradient(135deg, var(--brand-soft), #fff 70%); border-style: dashed; }
.hero-link { position: relative; display: inline-flex; margin-top: 12px; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.12); }
.cost-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-radius: 22px; color: #fff; background: linear-gradient(140deg, #2a2640, #1c1a29 60%); position: relative; overflow: hidden; }
.cost-hero::before { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; left: -60px; top: -80px; background: radial-gradient(circle, rgba(239, 91, 42, .5), transparent 70%); }
.cost-hero > * { position: relative; }
.cost-hero span { display: block; color: #cfcbe0; font-size: 13px; }
.cost-hero b { font-size: 24px; font-weight: 900; }
.btn-light { background: #fff; color: var(--ink); }
.cost-card { display: flex; flex-direction: column; gap: 12px; }
.cost-card h3 { margin: 0; font-size: 16px; }
.cost-rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cost-rows > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 11px 14px; font-size: 14px; }
.cost-rows > div + div { border-top: 1px solid var(--line); }
.cost-rows > div:nth-child(even) { background: var(--surface-2); }
.cost-rows small { grid-column: 1 / -1; color: var(--ink-3); margin-top: -6px; font-size: 12px; }
.cost-rows .badge { font-style: normal; font-size: 10.5px; padding: 1px 7px; }
.cnt { font-size: 12px; font-weight: 800; color: var(--teal); background: var(--teal-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.cnt.zero { color: var(--danger); background: var(--danger-soft); }
.pwa-bar { position: fixed; z-index: 60; inset-inline: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); transform: translateY(24px); opacity: 0; transition: transform .28s cubic-bezier(.2,.9,.3,1.2), opacity .2s; }
.pwa-bar.in { transform: none; opacity: 1; }
.pwa-bar .pwa-ic { width: 44px; height: 44px; border-radius: 13px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); overflow: hidden; }
.pwa-bar .pwa-ic svg { width: 22px; height: 22px; } .pwa-bar .pwa-ic img { width: 100%; height: 100%; object-fit: cover; }
.pwa-bar b { display: block; font-size: 14.5px; } .pwa-bar span { display: block; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.pwa-x { border: 0; background: var(--surface-2); width: 30px; height: 30px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink-2); flex: none; }
body:not(.with-tabbar) .pwa-bar { bottom: calc(var(--safe-b) + 14px); }
.ios-steps { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.ios-steps li { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); font-size: 14.5px; }
.ios-steps li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; flex: none; }
.code-line { background: #1c1a29; color: #ffd9c7; border-radius: 12px; padding: 10px 12px; font-size: 12px; overflow-x: auto; white-space: nowrap; font-family: ui-monospace, Menlo, monospace; }
select.input { appearance: none; -webkit-appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239a96a6' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat 14px 50%; padding-left: 36px; }
details.card summary { cursor: pointer; list-style: none; } details.card summary::-webkit-details-marker { display: none; }
@media (prefers-reduced-motion: reduce) { .pwa-bar { transition: none; } }
.cost-rows .ch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; background: var(--surface-2); font-size: 14px; }
.cost-rows .ch .faint { flex-basis: 100%; font-size: 12px; }
.cost-rows .cr { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; font-size: 14px; background: var(--surface) !important; }
.cost-rows .cr .l small { display: block; color: var(--ink-3); font-size: 12px; margin: 0; }
.cost-rows .cr .r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; text-align: left; }
.cost-card > .cost-rows + .cost-rows { margin-top: -2px; }
.cost-rows .cr .r b { white-space: nowrap; }

/* ───────── v3.1: به‌روزرسانی ───────── */
.upd-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px; border-radius: 22px; color: #fff; background: linear-gradient(140deg, #2a2640, #1c1a29 60%); }
.upd-hero span { display: block; color: #cfcbe0; font-size: 13px; } .upd-hero b { font-size: 28px; font-weight: 900; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 34px 20px; border: 2px dashed var(--line); border-radius: 22px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.disabled { opacity: .5; pointer-events: none; }
.dz-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand)); }
.dz-ic svg { width: 26px; height: 26px; }
.progress { width: 100%; max-width: 320px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .15s; }
.upd-ver { font-size: 22px; font-weight: 800; text-align: center; } .upd-ver span { color: var(--ink-3); margin: 0 8px; } .upd-ver b { color: var(--brand); }
.upd-log { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.9; max-height: 260px; overflow: auto; }
.upd-log h4 { margin: 6px 0 2px; } .upd-log ul { margin: 0; padding-right: 18px; }
.bk-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bk-row:first-of-type { border-top: 0; }

/* ───────── نوار ناوبری: موبایل ───────── */
.tabbar .desk { display: none; }
.tabbar .tab-fab { order: 2; } .tabbar a.tab[href="/app"], .tabbar a.tab[href="/history"] { order: 1; } .tabbar a.tab { order: 3; }
.tab .emo { font-style: normal; font-size: 20px; line-height: 1; }
body:not(.with-tabbar) .tabbar { display: none; }

/* ───────── نسخهٔ کامپیوتر ───────── */
@media (min-width: 1024px) {
  :root { --side: 256px; }
  body { background: var(--bg); }
  body.has-nav #app { max-width: none; margin: 0; margin-inline-start: var(--side); }
  .page { max-width: 1040px; margin: 0 auto; padding: 36px 44px 72px !important; }
  .topbar .icon-btn[data-act="back"] { display: none; }
  body.has-nav .tabbar { display: block; }

  /* منوی کناری */
  .tabbar { inset: 0 0 0 auto; inset-inline-start: 0; inset-inline-end: auto; width: var(--side); height: 100dvh; border-top: 0; border-inline-end: 1px solid var(--line); background: rgba(255, 255, 255, .7); padding: 0; }
  .tabbar .inner { height: 100%; max-width: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 22px 16px; }
  .tabbar .desk { display: flex; }
  .tabbar .inner > * { order: 0 !important; }
  .nav-brand { align-items: center; gap: 10px; font-size: 20px; font-weight: 900; color: var(--ink); text-decoration: none; padding: 4px 10px 18px; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14.5px; font-weight: 700; color: var(--ink-2); padding: 11px 14px; border-radius: 14px; text-decoration: none; transition: background .15s, color .15s; }
  .tab svg { width: 21px; height: 21px; }
  .tab:hover { background: var(--surface-2); color: var(--ink); }
  .tab.on { background: var(--ink); color: #fff; }
  .tab .emo { width: 21px; text-align: center; font-size: 17px; }
  .tab-fab { display: flex; margin-bottom: 14px; padding: 0; }
  .tab-fab span { width: 100%; height: 48px; margin: 0; border-radius: 15px; display: flex; gap: 8px; box-shadow: 0 8px 22px rgba(239, 91, 42, .32); }
  .tab-fab span::after { content: 'ساختن'; font-size: 15px; font-weight: 800; }
  .tab-fab svg { width: 20px; height: 20px; }
  .tab-fab em { display: none !important; }
  .nav-foot { margin-top: auto; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
  .nav-foot .faint { font-size: 13px; padding: 0 6px; text-decoration: none; }
  .nav-bal { display: block; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
  .nav-bal span { display: block; font-size: 12px; color: var(--ink-3); } .nav-bal b { font-size: 16px; }

  /* لایه‌های شناور */
  .action-bar, .composer, .toast-wrap { inset-inline-start: var(--side); }
  .pwa-bar { inset-inline-start: auto; inset-inline-end: 24px; bottom: 24px !important; margin: 0; width: 420px; }
  .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 520px; max-width: calc(100vw - 48px); border-radius: 24px; padding: 22px 24px; transform: translate(-50%, -50%); animation: pop .2s ease; }
  .sheet .grab { display: none; }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }

  /* خانه */
  [data-view="app"] .page > .stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  [data-view="app"] .page > .stack > * { height: 100%; margin: 0 !important; }
  [data-view="history"] .page .stack > *, [data-view="chats"] .page .stack > * { margin: 0 !important; }
  [data-view="app"] .page > .balance-chip, [data-view="app"] .page > .row:first-child .balance-chip { display: none; }
  [data-view="app"] .hero { padding: 34px 36px; } [data-view="app"] .hero h1 { font-size: 30px; }
  .recent { grid-template-columns: repeat(6, 1fr); gap: 12px; }
  .sheet .stack { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .sheet .tool-card .d { display: none; }

  /* ساخت: فرم + ستون خلاصه و دکمه */
  [data-view="create"] #app > div { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; max-width: 1180px; margin: 0 auto; padding: 36px 44px 60px; align-items: start; }
  [data-view="create"] .page { padding: 0 !important; max-width: none; margin: 0; }
  [data-view="create"] .action-bar { position: sticky; top: 36px; inset: auto; padding: 0; background: none; display: flex; flex-direction: column; gap: 10px; }
  [data-view="create"] .action-bar .inner { flex-direction: column; align-items: stretch; padding: 20px; gap: 16px; border-radius: 22px; max-width: none; }
  [data-view="create"] .action-bar .price b { font-size: 26px; margin: 4px 0; }
  [data-view="create"] .action-bar .btn { padding: 15px; font-size: 16px; }
  [data-view="create"] .lowbal, [data-view="create"] .ab-note { max-width: none; margin: 0; }

  /* ساخته‌ها و نتیجه */
  [data-view="history"] .page .stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  [data-view="g"] .page { max-width: 860px; }
  [data-view="g"] .result-card img, [data-view="g"] .result-card video { max-height: 70vh; width: auto; margin: 0 auto; }

  /* کیف پول، هزینه‌ها، حساب */
  [data-view="wallet"] .page { max-width: 980px; }
  [data-view="wallet"] .grid-2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  [data-view="costs"] .topbar .icon-btn { display: none; }
  [data-view="costs"] .page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  [data-view="costs"] .page > .topbar, [data-view="costs"] .page > .cost-hero, [data-view="costs"] .page > p { grid-column: 1 / -1; }
  [data-view="profile"] .page { max-width: 720px; }

  /* گفت‌وگو */
  [data-view="x"] .page, [data-view="c"] .page { max-width: 820px; }
  .composer .est, .composer .comp-row { max-width: 780px; }
  [data-view="chats"] .page .stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  /* پنل مدیریت: منوی عمودی */
  [data-view="admin"] .page { max-width: 1240px; display: grid; grid-template-columns: 210px minmax(0, 1fr); grid-template-areas: "top top" "tabs pane"; gap: 0 28px; }
  [data-view="admin"] .page > .topbar { grid-area: top; }
  [data-view="admin"] .admin-tabs { grid-area: tabs; flex-direction: column; margin: 0; padding: 0; position: sticky; top: 24px; align-self: start; overflow: visible; }
  [data-view="admin"] .admin-tabs .chip { justify-content: flex-start; text-align: right; border-radius: 12px; padding: 10px 14px; background: transparent; border-color: transparent; }
  [data-view="admin"] .admin-tabs .chip:hover { background: var(--surface-2); }
  [data-view="admin"] .admin-tabs .chip.on { background: var(--ink); color: #fff; }
  [data-view="admin"] #pane { grid-area: pane; min-width: 0; }
  [data-view="admin"] #pane .grid-2 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  [data-view="admin"] #pane > .stack-lg > .card, [data-view="admin"] #pane > .stack-lg > .notice { max-width: 900px; }

  /* ورود: دو ستونه */
  [data-view="login"] #app { max-width: 1120px; }
  .login-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 420px; column-gap: 56px; align-content: center; padding: 40px; }
  .login-wrap > * { grid-column: 2; }
  .login-wrap > .login-art { grid-column: 1; grid-row: 1 / span 30; height: auto; min-height: 600px; margin: 0; }
}
@media (min-width: 1440px) { :root { --side: 280px; } [data-view="app"] .page > .stack { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
