@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
/* ممیز «٫» و جداکننده هزارگان وزیرمتن در عدد درشت بزرگ و پررنگ‌اند؛ همین چند نویسه
   از همان فایل ولی کوچک‌تر کشیده می‌شوند (بدون تغییر متن یا HTML) */
@font-face {
  font-family: "VazirNum";
  src: url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+066B;
  size-adjust: 60%;
}
@font-face {
  font-family: "VazirNum";
  src: url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+002C, U+066C;
  size-adjust: 78%;
}

/* ---------- توکن‌ها: «شب زمردی» با دو حالت؛ data-theme را اسکریپت سر صفحه می‌گذارد ---------- */
:root {
  color-scheme: dark;
  /* سطح‌ها */
  --bg: #0d1116;
  --surface: #151a21;
  --surface-2: #1c222b;
  --surface-3: #262d38;
  --hairline: rgba(255, 255, 255, .08);
  --border: #2a313c;
  /* متن */
  --text: #f3f6f9;
  --text-2: #c0c8d2;
  --muted: #8a94a1;
  /* تأکید: زمردی نعنایی با گرادیان به لیمویی */
  --accent: #3ee8a6;
  --accent-2: #b8f35c;
  --accent-soft: rgba(62, 232, 166, .13);
  --accent-glow: rgba(62, 232, 166, .35);
  --on-accent: #03150e;
  --grad: linear-gradient(120deg, var(--accent), var(--accent-2));
  /* معنا */
  --good: #3ee8a6;
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, .13);
  --warn: #ffc857;
  --warn-soft: rgba(255, 200, 87, .11);
  /* کارت ثروت خالص در هر دو حالت تیره و درخشان است */
  --hero-1: #104a37;
  --hero-2: #0a1a15;
  --shadow: 0 1px 0 var(--hairline) inset, 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-lg: 0 -12px 48px rgba(0, 0, 0, .55);
  --float-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  --glow-1: rgba(62, 232, 166, .15);
  --glow-2: rgba(184, 243, 92, .07);
  --desk-bg: #0b0e12;
  --radius: 22px;
  --radius-sm: 14px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  /* پالت دسته‌ای (ترتیب ثابت؛ رنگ دنبال گروه است) */
  --s0: #6b7480;
  --s1: #5b9cff;
  --s2: #ff8a5b;
  --s3: #3ee8a6;
  --s4: #ffc857;
  --s5: #ff7eb6;
  --s6: #7ee081;
  --s7: #a78bfa;
  --s8: #ff6b6b;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5f4;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --surface-3: #e5ebe8;
  --hairline: rgba(16, 40, 30, .07);
  --border: #e1e7e4;
  --text: #0e1714;
  --text-2: #43514b;
  --muted: #74807b;
  --accent: #0ea371;
  --accent-2: #7cc520;
  --accent-soft: rgba(14, 163, 113, .1);
  --accent-glow: rgba(14, 163, 113, .25);
  --on-accent: #04190f;
  --good: #0ea371;
  --bad: #e5484d;
  --bad-soft: rgba(229, 72, 77, .1);
  --warn: #a8650a;
  --warn-soft: rgba(240, 170, 40, .14);
  --shadow: 0 1px 2px rgba(16, 40, 30, .05), 0 8px 24px rgba(16, 40, 30, .06);
  --shadow-lg: 0 -12px 40px rgba(16, 40, 30, .16);
  --float-shadow: 0 12px 32px rgba(16, 40, 30, .14);
  --glow-1: rgba(14, 163, 113, .1);
  --glow-2: rgba(124, 197, 32, .07);
  --desk-bg: #dfe6e3;
  --s0: #8b949e;
  --s1: #2f7be5;
  --s2: #f06a35;
  --s3: #0ea371;
  --s4: #dd9f00;
  --s5: #e5609a;
  --s6: #3fae4a;
  --s7: #7c5ce6;
  --s8: #e5484d;
}

/* ---------- پایه ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "VazirNum", "Vazirmatn", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  background:
    radial-gradient(90% 40% at 85% -5%, var(--glow-1), transparent 70%),
    radial-gradient(70% 35% at 0% 0%, var(--glow-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* وزیرمتن همه جا: کنترل‌های فرم و حتی بلوک‌های کد (توکن، راهنمای Shortcuts) هم */
button, input, select, textarea, optgroup, code, pre, kbd, samp, ::placeholder {
  font-family: "VazirNum", "Vazirmatn", system-ui, -apple-system, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
small { font-size: .8em; }

.i { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.neg { color: var(--bad); }

/* ---------- پوسته ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  padding-top: var(--safe-t);
  view-transition-name: appbar;
}

.appbar-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px 10px;
  min-height: 56px;
  display: flex;
  align-items: center;
}

.appbar h1 { font-size: 1.6rem; font-weight: 900; letter-spacing: -.02em; }
.greet { display: flex; flex-direction: column; line-height: 1.3; }

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 4px 16px calc(var(--tabbar-h) + var(--safe-b) + 44px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tabbar {
  position: fixed;
  inset: auto 12px calc(var(--safe-b) + 10px) 12px;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  height: var(--tabbar-h);
  padding: 0 6px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  backdrop-filter: saturate(1.8) blur(22px);
  -webkit-backdrop-filter: saturate(1.8) blur(22px);
  border: 1px solid var(--hairline);
  box-shadow: var(--float-shadow);
  view-transition-name: tabbar;
}

.tabbar a {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 600;
  transition: color .2s var(--ease), transform .15s var(--ease);
}

.tabbar a .i { width: 24px; height: 24px; transition: transform .25s var(--ease); }
.tabbar a { position: relative; }
.tabbar a.on { color: var(--text); }
.tabbar a.on .i { color: var(--accent); transform: translateY(-1px) scale(1.1);
  filter: drop-shadow(0 0 8px var(--accent-glow)); }
.tabbar a.on::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.tabbar a:active { transform: scale(.92); }

/* ---------- کارت‌ها ---------- */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 70%, var(--surface)), var(--surface));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  color: inherit;
}

.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.card-head h2, .card > h2 { font-size: 1rem; font-weight: 800; }
.card-head a { font-weight: 600; }

.section-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
  margin: 8px 4px -6px;
}

.lead { color: var(--text-2); font-size: .9rem; padding: 0 4px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini { display: flex; flex-direction: column; gap: 2px; transition: transform .2s var(--spring); }
a.mini:active, a.card:active { transform: scale(.97); }
.mini strong { font-size: 1.3rem; font-weight: 900; letter-spacing: -.01em; }
.mini .bubble { margin-bottom: 4px; width: 34px; height: 34px; border-radius: 11px; }
.mini .bubble .i { width: 18px; height: 18px; }
.mini-label { color: var(--muted); font-size: .78rem; font-weight: 500; }

/* ---------- قهرمان داشبورد ---------- */
.hero {
  --accent: #3ee8a6;
  --accent-glow: rgba(62, 232, 166, .35);
  --on-accent: #03150e;
  --bad: #ff7b7b;
  --bad-soft: rgba(255, 107, 107, .16);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 28px;
  padding: 20px 20px 22px;
  color: #fff;
  background: linear-gradient(160deg, var(--hero-1), var(--hero-2) 70%);
  border: 1px solid rgba(62, 232, 166, .18);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .03) inset;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* دو هاله نوری که آرام جابه‌جا می‌شوند */
.hero::before, .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

.hero::before {
  width: 220px; height: 220px; top: -90px; left: -60px;
  background: rgba(62, 232, 166, .45);
  animation: drift 14s ease-in-out infinite alternate;
}

.hero::after {
  width: 180px; height: 180px; bottom: -110px; right: -40px;
  background: rgba(184, 243, 92, .22);
  animation: drift 18s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 20px) scale(1.15); }
}

.spark { display: block; width: 100%; height: 56px; margin: 10px 0 -4px; overflow: visible; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; filter: drop-shadow(0 0 6px var(--accent-glow));
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s var(--ease) .2s forwards; }
.spark path.area { fill: url(#spark-fill); opacity: 0; animation: fade .8s ease .6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero-label { font-size: .85rem; color: rgba(255, 255, 255, .7); font-weight: 600; }
.hero-value { font-size: 2.9rem; font-weight: 900; letter-spacing: -.03em; line-height: 1.15; margin-top: 10px;
  text-shadow: 0 0 30px rgba(62, 232, 166, .25); }
.hero-value small { font-size: 1rem; font-weight: 600; opacity: .85; }
.hero-sub { font-size: .85rem; color: rgba(255, 255, 255, .6); }

[data-unit-switch] [data-unit-value] { display: none; animation: fade-up .25s var(--ease); }
[data-unit-switch][data-unit="toman"] [data-unit-value="toman"],
[data-unit-switch][data-unit="usd"] [data-unit-value="usd"],
[data-unit-switch][data-unit="gold"] [data-unit-value="gold"] { display: inline; }

.unit-toggle {
  display: flex;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  padding: 3px;
}

.unit-toggle button {
  font: inherit;
  font-size: .75rem;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 3px 11px;
  cursor: pointer;
  opacity: .8;
  transition: background .2s var(--ease), color .2s, opacity .2s;
}

.unit-toggle button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); opacity: 1;
  box-shadow: 0 0 14px var(--accent-glow); }
.unit-toggle button:disabled { opacity: .35; cursor: default; }

.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: .82rem;
  font-weight: 700;
  background: rgba(62, 232, 166, .14);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 10px 3px 12px;
  align-self: flex-start;
}

.delta.down { background: var(--bad-soft); color: var(--bad); }

.delta .i { width: 16px; height: 16px; }
.delta-when { opacity: .75; font-weight: 400; }

.loan-hero .hero-value { font-size: 2.4rem; }

/* ---------- اعلان‌ها ---------- */
.notices { display: flex; flex-direction: column; gap: 8px; }

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--warn);
  background: var(--warn-soft);
  transition: transform .15s var(--ease);
}

.notice:active { transform: scale(.98); }
.notice span { flex: 1; display: flex; flex-direction: column; line-height: 1.5; }
.notice small { opacity: .85; }
.i.end { width: 18px; height: 18px; opacity: .6; }

.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .85rem;
  margin-top: 10px;
}

.alert .i { width: 18px; height: 18px; }
.alert.danger { background: var(--bad-soft); color: var(--bad); }

/* ---------- جریان نقدی و نوار سنج ---------- */
.flow-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.flow-numbers div { display: flex; flex-direction: column; }
.flow-numbers strong { font-size: 1rem; font-weight: 800; }

.meter {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
}

.meter-fill {
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--w);
  border-radius: 999px;
  background: var(--grad);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: grow .9s var(--ease) both;
  transform-origin: right;
}

.meter.over .meter-fill { background: var(--bad); box-shadow: 0 0 12px rgba(255, 107, 107, .4); }

.meter-mark {
  position: absolute;
  top: -4px;
  bottom: -4px;
  right: var(--at);
  width: 2px;
  border-radius: 2px;
  background: var(--text-2);
}

.meter-legend { display: flex; justify-content: space-between; font-size: .82rem; margin-top: 8px; }

.progress {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 6px 0 2px;
}

.progress > span {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 999px;
  background: var(--accent);
  animation: grow .7s var(--ease) both;
  transform-origin: right;
}

/* ---------- ترکیب دارایی ---------- */
.stack-bar {
  display: flex;
  gap: 3px;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  animation: grow .8s var(--ease) both;
  transform-origin: right;
}

.seg-fill { width: var(--w); min-width: 4px; }

.legend { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legend a { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: inherit;
  text-decoration: none; padding: 4px 0; }
.legend-label { flex: 1; }
.legend-pct { color: var(--muted); font-size: .8rem; min-width: 44px; text-align: left; }
.legend-value { font-weight: 700; min-width: 96px; text-align: left; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.seg-fill, .dot { background: var(--c); }

.chart-box { position: relative; height: 200px; }

/* ---------- فهرست‌ها ---------- */
/* خلاصه بالای هر فهرست: نسخه کوچک کارت درخشان صفحه اصلی */
.summary {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--hairline));
  box-shadow: var(--shadow);
}

.summary strong { font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.3; }
.summary.two { flex-direction: row; gap: 24px; }
.summary.two > div { display: flex; flex-direction: column; }
.summary.two strong { font-size: 1.3rem; }

.list {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  text-align: right;
  cursor: pointer;
  position: relative;
  transition: background .15s;
}

.row + .row, .row-form + .row, .row + .row-form { border-top: 1px solid var(--border); }
.row:active { background: var(--surface-2); }
.row.static { cursor: default; }
.row.static:active { background: none; }
.row.dim { opacity: .55; }
.row.tall { align-items: flex-start; padding-top: 14px; padding-bottom: 14px; }
.row.danger .row-title { color: var(--bad); }
.row-form { margin: 0; }

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: .8rem; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.row-end strong { font-weight: 700; }

.bubble {
  --c: var(--s0);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
}

.bubble .i { width: 21px; height: 21px; }
.bubble.big { width: 52px; height: 52px; border-radius: 16px; }
.bubble.s0 { color: var(--text-2); background: var(--surface-2); }

.pill {
  font-size: .72rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
}

.pill.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- زبانه‌های بالای صفحه ---------- */
.seg {
  display: flex;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}

.seg a {
  flex: 1;
  text-align: center;
  padding: 7px 8px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: .88rem;
  font-weight: 600;
  transition: background .2s var(--ease), color .2s;
}

.seg a.on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); }
:root[data-theme="light"] .seg a.on { background: var(--surface); }

/* ---------- حالت خالی و خوش‌آمد ---------- */
.empty {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 8px;
}

.empty-icon .i { width: 34px; height: 34px; }
.empty h2 { font-size: 1.1rem; }
.empty p { color: var(--muted); font-size: .9rem; max-width: 320px; margin-bottom: 8px; }

.welcome { display: flex; flex-direction: column; gap: 8px; padding: 22px; }
.welcome h2 { font-size: 1.25rem; margin-top: 6px; }
.steps { margin: 4px 0 8px; padding-right: 22px; color: var(--text-2); list-style: persian; }
.steps li { padding: 2px 0; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- میان‌برها ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 4px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  transition: transform .2s var(--spring), border-color .2s;
}

.quick-btn .bubble { width: 44px; height: 44px; border-radius: 15px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 25%, transparent); }

.quick-btn:active { transform: scale(.95); }

/* ---------- دکمه‌ها ---------- */
.btn {
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: var(--grad);
  color: var(--on-accent);
  box-shadow: 0 8px 24px rgba(62, 232, 166, .25);
  cursor: pointer;
  transition: transform .12s var(--ease), filter .2s, opacity .2s;
}

.btn:active { transform: scale(.97); filter: brightness(.95); }
.btn .i { width: 20px; height: 20px; }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.btn.danger-ghost { background: var(--bad-soft); color: var(--bad); padding: 0 16px; box-shadow: none; }
.htmx-request .btn[type="submit"], .btn.htmx-request { opacity: .6; pointer-events: none; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-2);
}

.icon-btn .i { width: 18px; height: 18px; }

.fab {
  position: fixed;
  z-index: 25;
  left: max(16px, calc(50% - 304px));
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
  width: 56px;
  height: 56px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: var(--on-accent);
  box-shadow: 0 10px 30px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, .15) inset;
  transition: transform .15s var(--ease);
  animation: pop .35s var(--ease) both;
}

.fab .i { width: 26px; height: 26px; }
.fab:active { transform: scale(.9); }

/* ---------- فرم‌ها ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full, .field:has(textarea) { grid-column: 1 / -1; }
.field[hidden] { display: none; }

.label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.opt { color: var(--muted); font-weight: 400; font-size: .75rem; }

.input { position: relative; display: flex; align-items: center; }

input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* جلوگیری از بزرگ‌نمایی خودکار iOS */
  color: inherit;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 11px 12px;
  min-height: 48px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8494' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px;
  padding-left: 36px;
}

input:focus, select:focus, textarea:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.input.has-unit input { padding-left: 56px; }
.unit { position: absolute; left: 12px; color: var(--muted); font-size: .8rem; pointer-events: none; }
input[data-money], input[data-num], input[inputmode="numeric"] { direction: ltr; text-align: right; }
.money-words { font-size: .78rem; color: var(--accent); min-height: 1.2em; margin-top: -2px; }
textarea { min-height: 72px; resize: vertical; }

.hint { color: var(--muted); font-size: .76rem; }
.error { color: var(--bad); font-size: .78rem; font-weight: 600; }
.has-error input, .has-error select { border-color: var(--bad); background: var(--bad-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .12s var(--ease);
}

.chip span .i { width: 18px; height: 18px; }
.chip span:active { transform: scale(.95); }
.chip input:checked + span { background: var(--accent-soft); color: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 14px rgba(62, 232, 166, .15); }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.track {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  flex: none;
  transition: background .2s var(--ease);
}

.track::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .25s var(--ease);
}

.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(-18px); }

details.group { padding: 0; }
details.group > summary, details.disclosure > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details > summary::-webkit-details-marker { display: none; }
details.group > summary::after, details.disclosure > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-left: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .2s var(--ease);
}

details[open].group > summary::after, details[open].disclosure > summary::after { transform: rotate(135deg); }
details.group .fields { padding: 0 16px 16px; animation: fade-up .25s var(--ease); }
details.disclosure { padding: 0; }
details.disclosure > :not(summary) { margin: 0 16px 16px; }

.sticky-actions {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 22px); /* بالای نوار تب شناور */
  z-index: 5;
}

.sticky-actions .btn { box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent); }

.price-row { align-items: center; }
.price-row .input.compact { width: 46%; max-width: 220px; }
.price-row input { min-height: 42px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; }

.steps-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps-head { display: flex; justify-content: space-between; font-size: .88rem; }

.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th, .table td { padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: right; }
.table .num { text-align: left; }

.disclaimer { color: var(--muted); font-size: .78rem; text-align: center; }
.footnote { color: var(--muted); font-size: .75rem; text-align: center; margin-top: 12px; }

/* ---------- برگه پایین ---------- */
.sheet {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
  width: 100%;
  max-width: 600px;
  max-height: 92dvh;
  padding: 0 16px calc(16px + var(--safe-b));
  border: 0;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet[open] { animation: sheet-in .38s var(--ease) both; }
.sheet.closing { animation: sheet-out .22s ease-in both; }
.sheet::backdrop { background: rgba(10, 14, 20, .42); backdrop-filter: blur(2px); animation: fade .3s ease both; }
.sheet.closing::backdrop { animation: fade .22s ease reverse both; }

.sheet-grip {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 22px;
  background: var(--surface);
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
  cursor: grab;
}

.sheet-grip::before { content: ""; width: 40px; height: 5px; border-radius: 999px; background: var(--border); }

.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.sheet-head h2 { font-size: 1.15rem; font-weight: 800; }

.sheet-actions {
  position: sticky;
  bottom: calc(-16px - var(--safe-b));
  display: flex;
  gap: 8px;
  padding: 12px 0 calc(16px + var(--safe-b));
  margin-bottom: calc(-16px - var(--safe-b));
  background: linear-gradient(to top, var(--surface) 75%, transparent);
}

.sheet-actions .btn.wide { flex: 1; }

/* ---------- پیام کوتاه ---------- */
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: calc(var(--safe-t) + 12px);
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  animation: toast 2.8s var(--ease) both;
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- ورود ---------- */
.auth {
  max-width: 380px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.auth h1 { font-size: 1.5rem; }
.auth .form { margin-top: 12px; }

.auth-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--hero-1) 35%, transparent);
}

.auth-logo .i { width: 34px; height: 34px; }

/* ---------- حرکت ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { from { transform: none; } to { transform: translateY(100%); } }

@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -16px) scale(.96); }
  10%, 85% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -16px) scale(.96); }
}

.page > *, .live > * { animation: rise .5s var(--ease) both; }
.page > *:nth-child(2), .live > *:nth-child(2) { animation-delay: .05s; }
.page > *:nth-child(3), .live > *:nth-child(3) { animation-delay: .1s; }
.page > *:nth-child(4), .live > *:nth-child(4) { animation-delay: .15s; }
.page > *:nth-child(5), .live > *:nth-child(5) { animation-delay: .2s; }
.page > *:nth-child(n+6), .live > *:nth-child(n+6) { animation-delay: .25s; }
.live.refreshed > * { animation: none; } /* تازه‌سازی خودکار نباید صفحه را دوباره بلرزاند */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

::view-transition-old(root) { animation: .14s ease both fade reverse; }
::view-transition-new(root) { animation: .22s var(--ease) both fade-up; }
::view-transition-old(tabbar), ::view-transition-new(tabbar),
::view-transition-old(appbar), ::view-transition-new(appbar) { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- روی صفحه بزرگ (مک): اپ داخل قاب آیفون ---------- */
/* قاب گوشی دسکتاپ حذف شد؛ نسخه دسکتاپ واقعی در انتهای فایل است */

@media (max-width: 360px) {
  .fields { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- مبلغ: عدد درشت، واحد ریز ---------- */
.amt { white-space: nowrap; }
.amt small { font-size: .6em; font-weight: 600; opacity: .7; margin-inline-start: .3em; letter-spacing: 0; }
.hero-value .amt small { font-size: .45em; opacity: .85; }
.legend-value .amt small, .row-end .amt small { font-size: .72em; }

/* شماره رنگ هر گروه؛ پس از .bubble تا رنگ پیش‌فرض آن را بازنویسی کند */
.s0 { --c: var(--s0); } .s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); }
.s4 { --c: var(--s4); } .s5 { --c: var(--s5); } .s6 { --c: var(--s6); } .s7 { --c: var(--s7); }
.s8 { --c: var(--s8); }

/* جا برای دکمه شناور تا ردیف آخر زیر آن نرود */
.page:has(.fab) { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }
/* مبالغ بزرگ‌اند؛ همیشه تمام‌عرض */
.field:has(input[data-money]) { grid-column: 1 / -1; }

/* ---------- وضعیت منبع قیمت ---------- */
.source-card { display: flex; flex-direction: column; gap: 10px; }
.source-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.status-dot.ok { background: var(--good); }
.status-dot.bad { background: var(--bad); }

/* ---------- داشبورد زنده ---------- */
.live { display: flex; flex-direction: column; gap: 14px; }
.page > .live { animation: none; }

.other-prices .list.flat { box-shadow: none; margin: 0 0 8px; }
.other-prices > .list { margin: 0; }
.source-note { flex-basis: 100%; font-size: .78rem; padding-inline-start: 17px; }
.source-note.warn { color: var(--warn); }
.source-note.bad { color: var(--bad); }

/* ---------- پیامک بانکی ---------- */
.sms-text { white-space: pre-line; font-size: .88rem; line-height: 1.6; }
.sms-actions { display: flex; gap: 8px; margin-top: 8px; }
.sms-actions form { margin: 0; }
.small-btn { min-height: 34px; padding: 0 14px; font-size: .82rem; border-radius: 10px; }
.sms-quote {
  white-space: pre-wrap;
  font: inherit;
  font-size: .85rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0;
}
.upload-form { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.upload-form input[type="file"] { flex: 1; min-width: 180px; min-height: 0; padding: 8px; }
.setup h3 { font-size: .92rem; margin: 6px 0; }
.setup ol { padding-right: 20px; margin: 0 0 10px; font-size: .86rem; color: var(--text-2); }
.setup li { margin-bottom: 6px; }
.setup pre, .setup code { font-size: .78rem; background: var(--surface-2); border-radius: 6px; padding: 2px 6px; }
.setup pre { padding: 8px; white-space: pre-wrap; word-break: break-all; text-align: left; }
.token { display: block; word-break: break-all; padding: 8px; background: var(--surface-2); border-radius: 8px; margin-bottom: 8px; }

/* ---------- خرج‌ها ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-nav strong { font-size: 1.05rem; }
.month-nav .icon-btn .i { transform: scaleX(-1); }
.month-nav .icon-btn .i.end { transform: none; }
.cat-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cat-bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: .9rem; }
.cat-value { font-weight: 700; }
.cat-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cat-fill { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--c); }
.flow-numbers.four { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
.flow-numbers a { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.spend-total { display: block; color: inherit; text-decoration: none; margin-bottom: 12px; }
.spend-total strong { font-size: 1.5rem; font-weight: 800; }

/* ---------- صفحه اصلی: جزئیات «شب زمردی» ---------- */
.greet .muted { font-weight: 600; }
.flow-numbers strong { font-weight: 900; font-size: 1.1rem; }
.flow-numbers > * { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.flow-numbers .free { background: var(--accent-soft); }
.flow-numbers .free strong { color: var(--accent); }
.flow-numbers .free strong.neg { color: var(--bad); }
.cat-fill { box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); }
.legend .dot { box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
.notice { border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem;
  color: rgba(255, 255, 255, .6); margin-top: 6px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(62, 232, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 232, 166, 0); } }
.delta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px; }
.delta-row .delta { margin-top: 0; white-space: nowrap; }
.delta-row .delta-when { font-size: .75rem; color: rgba(255, 255, 255, .55); }

/* ---------- انتخاب ظاهر ---------- */
.theme-pick { display: flex; gap: 8px; padding: 12px 14px; }
.theme-pick button {
  flex: 1;
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .2s, color .2s, transform .2s var(--spring);
}
.theme-pick button:active { transform: scale(.95); }
.theme-pick button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 14px var(--accent-soft); }
.theme-swatch { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--hairline); }
.theme-swatch.light { background: linear-gradient(135deg, #ffffff 50%, #f0f4f2 50%); }
.theme-swatch.dark { background: linear-gradient(135deg, #1c222b 50%, #0d1116 50%); }
.theme-swatch.system { background: linear-gradient(135deg, #ffffff 50%, #0d1116 50%); }

/* ---------- صفحه‌های ورود ---------- */
.auth-link { display: inline-block; margin-top: 8px; font-size: .88rem; font-weight: 600; }
.auth-link.as-button { background: none; border: 0; font: inherit; color: var(--accent); cursor: pointer; }
.auth-alt { color: var(--muted); font-size: .88rem; margin-top: 10px; }
.auth-alt a { font-weight: 700; }
.code-input { text-align: center !important; font-size: 1.5rem !important; letter-spacing: .5em;
  font-weight: 800; }
.brand-logo { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 6px;
  box-shadow: 0 16px 40px rgba(62, 232, 166, .22); animation: pop .5s var(--spring) both; }
.brand-name { font-size: 2.2rem !important; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.brand-dot { color: var(--accent); text-shadow: 0 0 14px var(--accent-glow); }
.brand-tag { color: var(--text-2); font-weight: 600; font-size: .9rem; margin-top: -4px; }
.pos { color: var(--good); }
.spend-in { display: flex; justify-content: space-between; align-items: baseline; color: inherit;
  text-decoration: none; margin: -4px 0 12px; padding: 8px 12px; border-radius: 12px;
  background: var(--accent-soft); }

/* ---------- ویرایش دسته‌ها ---------- */
.cat-editor { display: flex; flex-direction: column; gap: 10px; }
.cat-edit-row { display: flex; align-items: center; gap: 10px; transition: opacity .2s; }
.cat-edit-row input:not([type=checkbox]) { flex: 1; min-height: 44px; }
.cat-edit-row.is-hidden { opacity: .5; }
.hide-toggle { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted);
  white-space: nowrap; cursor: pointer; }
.hide-toggle input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }

/* ---------- قیمت‌های من ---------- */
.watch { display: flex; flex-direction: column; gap: 8px; }
.watch-head { margin: 4px 4px 0; }
.watch-scroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.watch-scroll::-webkit-scrollbar { display: none; }
.watch-card { flex: 0 0 auto; min-width: 138px; scroll-snap-align: start; display: flex;
  flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.watch-label { font-size: .75rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.watch-card strong { font-size: 1rem; font-weight: 900; white-space: nowrap; }
.watch-change { display: inline-flex; align-items: center; gap: 2px; font-size: .74rem;
  font-weight: 700; color: var(--muted); }
.watch-change .i { width: 14px; height: 14px; }
.watch-change.up { color: var(--good); }
.watch-change.down { color: var(--bad); }

/* ---------- ریزه‌کاری‌های «شب زمردی» در همه صفحه‌ها ---------- */
.row { transition: background .15s, transform .15s var(--ease); }
.row:active { transform: scale(.99); }
.row-end strong { font-weight: 800; }
.bubble { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 18%, transparent); }
.empty-icon { box-shadow: 0 0 40px var(--accent-soft); }
.seg { border: 1px solid var(--hairline); }
.seg a.on { color: var(--accent); }
details.group, details.disclosure { transition: border-color .2s; }
details[open].group, details[open].disclosure { border-color: color-mix(in srgb, var(--accent) 22%, var(--hairline)); }
.progress > span, .cat-fill { background-image: linear-gradient(90deg, var(--c, var(--accent)), color-mix(in srgb, var(--c, var(--accent)) 70%, #fff)); }
.source-card { background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 60%), var(--surface); }

/* ---------- از وزیر بپرس ---------- */
.ask-vazir { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  color: inherit; text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--hairline));
  background: radial-gradient(120% 160% at 100% 0%, var(--accent-soft), transparent 65%), var(--surface);
  box-shadow: var(--shadow); transition: transform .2s var(--spring); }
.ask-vazir:active { transform: scale(.98); }
.ask-vazir img { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 0 18px var(--accent-glow); }
.ask-vazir span { flex: 1; display: flex; flex-direction: column; line-height: 1.5; }
.ask-vazir small { color: var(--muted); font-size: .78rem; }
.assistant-consent { display: flex; flex-direction: column; gap: 12px; text-align: center; }

/* چت تمام‌صفحه: سربرگ، پیام‌ها (تنها بخش اسکرول‌خور) و جای نوشتن پایین */
.chat-app { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background:
    radial-gradient(80% 35% at 85% 0%, var(--glow-1), transparent 70%),
    var(--bg); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 10px) 14px 10px;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px); }
.chat-back .i { transform: scaleX(-1); }
.chat-head-logo { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 16px var(--accent-glow); }
.chat-head-title { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.chat-head-title strong { font-size: 1.05rem; font-weight: 900; }
.chat-head-title span { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--muted); }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent); }
.chat-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 auto; }
.chat-row { display: flex; animation: rise .3s var(--ease) both; }
.chat-row.me { justify-content: flex-start; }
.chat-row.vazir { justify-content: flex-end; }
.chat-msg { max-width: 86%; padding: 10px 14px; border-radius: 20px; line-height: 1.85; font-size: .94rem;
  overflow-wrap: anywhere; }
.chat-msg.me { background: var(--grad); color: var(--on-accent); font-weight: 600;
  border-bottom-right-radius: 6px; white-space: pre-wrap; }
.chat-msg.vazir { background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow);
  border-bottom-left-radius: 6px; }
.chat-msg.vazir p { margin: 0 0 6px; } .chat-msg.vazir p:last-child { margin: 0; }
.chat-msg.vazir ul, .chat-msg.vazir ol { margin: 4px 0 8px; padding-right: 20px; }
.chat-msg.vazir li { margin: 2px 0; }
.chat-msg.vazir li::marker { color: var(--accent); }
.chat-msg.vazir strong { font-weight: 800; color: var(--text); }
.chat-msg.error { border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: blink 1.2s infinite ease-in-out both; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-hello { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 24px 6px 8px; animation: rise .5s var(--ease) both; }
.chat-hello img { width: 76px; height: 76px; border-radius: 22px; box-shadow: 0 16px 40px var(--accent-glow); }
.chat-hello h2 { font-size: 1.35rem; font-weight: 900; }
.chat-hello p { color: var(--muted); font-size: .9rem; max-width: 300px; }
.chat-starters { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 14px; }
.starter { display: flex; align-items: center; gap: 10px; text-align: right; font: inherit; font-size: .9rem;
  font-weight: 600; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow);
  transition: transform .2s var(--spring), border-color .2s; }
.starter:active { transform: scale(.98); border-color: var(--accent); }
.starter .i { width: 18px; height: 18px; color: var(--accent); flex: none; }
.chat-composer { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 8px;
  border-radius: 24px; border: 1px solid var(--hairline); background: var(--surface-2);
  box-shadow: var(--float-shadow); }
.chat-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chat-composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border: 0;
  background: transparent; padding: 11px 10px; line-height: 1.6; box-shadow: none !important; }
.chat-send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; display: grid;
  place-items: center; background: var(--grad); color: var(--on-accent); cursor: pointer;
  box-shadow: 0 6px 18px var(--accent-glow); transition: transform .2s var(--spring), opacity .2s; }
.chat-send:disabled { opacity: .35; box-shadow: none; cursor: default; }
.chat-send:not(:disabled):active { transform: scale(.9); }
.chat-disclaimer { text-align: center; color: var(--muted); font-size: .7rem;
  padding: 6px 16px calc(var(--safe-b) + 8px); }

/* کارت تأیید ثبت در چت */
.action-card { width: 86%; padding: 12px 14px; border-radius: 18px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--hairline)); box-shadow: var(--shadow);
  animation: rise .35s var(--ease) both; }
.action-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--accent); }
.action-head .i { width: 18px; height: 18px; }
.action-card dl { margin: 0 0 10px; display: flex; flex-direction: column; gap: 4px; }
.action-card dl div { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; }
.action-card dt { color: var(--muted); }
.action-card dd { margin: 0; font-weight: 700; text-align: left; }
.action-buttons { display: flex; gap: 8px; }
.action-buttons .btn { flex: 1; min-height: 42px; }
.action-buttons .btn.ghost { flex: 0 0 auto; padding: 0 18px; }
.action-card.done { display: flex; align-items: center; gap: 8px; width: auto; font-weight: 700;
  color: var(--accent); padding: 10px 14px; }
.action-card.done .i { width: 18px; height: 18px; }
.action-card.cancelled { color: var(--muted); border-color: var(--hairline); }

/* ---------- پرسونا: آواتار، مصاحبه و کارت شخصیت ---------- */
.avatar { --size: 44px; width: var(--size); height: var(--size); flex: none; display: grid; place-items: center;
  border-radius: 30%; position: relative; overflow: hidden;
  background:
    radial-gradient(70% 60% at 30% 20%, hsl(var(--h, 160) 95% 80% / .9), transparent 70%),
    linear-gradient(145deg, hsl(var(--h, 160) 80% 58%), hsl(calc(var(--h, 160) + 45) 75% 38%));
  box-shadow: 0 6px 16px hsl(var(--h, 160) 70% 40% / .35), inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -6px 12px rgba(0, 0, 0, .15); }
.avatar-emoji { font-size: calc(var(--size) * .58); line-height: 1;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.avatar.xl { --size: 112px; border-radius: 34px; }
.avatar.avatar-empty { background: var(--surface-2); color: var(--accent); box-shadow: none; border: 1px dashed var(--border); }
.avatar.avatar-empty .i { width: 20px; height: 20px; }
.appbar-inner .greet { flex: 1; }
.greet-avatar { display: block; border-radius: 32%; transition: transform .2s var(--spring); }
.greet-avatar:active { transform: scale(.92); }
.greet-avatar .avatar { --size: 42px; }

.persona-cta { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  color: inherit; text-decoration: none; border: 1px solid color-mix(in srgb, var(--s7) 35%, var(--hairline));
  background: radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--s7) 18%, transparent), transparent 65%), var(--surface);
  box-shadow: var(--shadow); transition: transform .2s var(--spring); }
.persona-cta:active { transform: scale(.98); }
.persona-cta-stack { display: flex; flex: none; }
.persona-cta-stack .avatar { --size: 34px; border: 2px solid var(--surface); }
.persona-cta-stack .avatar + .avatar { margin-inline-start: -12px; }
.persona-cta-text { flex: 1; display: flex; flex-direction: column; line-height: 1.5; }
.persona-cta-text small { color: var(--muted); font-size: .78rem; }
.persona-row .avatar { --size: 40px; }

/* مصاحبه: هر سؤال یک پیام وزیر و چند گزینه؛ با جاوااسکریپت یکی‌یکی ظاهر می‌شوند */
.interview-progress { width: 64px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.interview-progress span { display: block; height: 100%; width: var(--p, 0%); background: var(--grad);
  transition: width .4s var(--ease); }
.interview .chat-scroll { padding-bottom: calc(var(--safe-b) + 32px); }
.q { display: flex; flex-direction: column; gap: 10px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; padding-inline-start: 10%;
  animation: rise .35s var(--ease) both; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: 10px 14px; border-radius: 16px; font-size: .9rem; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--hairline)); background: var(--surface);
  color: var(--text); box-shadow: var(--shadow); transition: transform .2s var(--spring), background .2s, border-color .2s; }
.choice:active span { transform: scale(.95); }
.choice input:checked + span { background: var(--grad); color: var(--on-accent); border-color: transparent; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.q-next { align-self: center; }
.btn.small { min-height: 40px; padding: 0 18px; font-size: .88rem; }
.q-answer { display: none; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; width: 100%; }
.q.answered .choices { display: none; }
.q.answered .q-answer { display: flex; }
.interview.js .q { display: none; }
.interview.js .q.shown { display: flex; }
.note-box { display: flex; flex-direction: column; gap: 10px; animation: rise .35s var(--ease) both; }
.note-box textarea { min-height: 70px; resize: vertical; }

/* کارت شخصیت: کارت کلکسیونی با قاب فویل، کمیابی، شماره و چهار ویژگی */
.tcard-stage { perspective: 1100px; padding: 6px 4px 4px; overflow-x: clip; overflow-y: visible; }
.tcard { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 4px; padding: 14px 16px 16px; border-radius: 30px; color: #f5f7fa;
  max-width: 380px; margin: 0 auto;
  background:
    radial-gradient(120% 70% at 50% 0%, hsl(var(--h) 85% 55% / .55), transparent 62%),
    radial-gradient(90% 60% at 100% 100%, hsl(calc(var(--h) + 50) 80% 50% / .35), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .07) 1px, transparent 0) 0 0 / 14px 14px,
    linear-gradient(175deg, hsl(var(--h) 35% 14%), #07090c 85%);
  border: 1.5px solid transparent;
  box-shadow: 0 24px 60px hsl(var(--h) 70% 30% / .45), 0 2px 0 rgba(255, 255, 255, .06) inset;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s var(--ease); }
.tcard::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1;
  background: conic-gradient(from 0deg, hsl(var(--h) 90% 65%), hsl(calc(var(--h) + 60) 90% 65%),
    hsl(calc(var(--h) + 180) 90% 70%), hsl(calc(var(--h) + 300) 90% 65%), hsl(var(--h) 90% 65%));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .8; }
.tcard.tilting { transition: transform .08s linear; }
.tcard-foil { position: absolute; inset: 0; pointer-events: none; z-index: 2; mix-blend-mode: color-dodge; opacity: .35;
  background:
    radial-gradient(40% 35% at var(--mx) var(--my), rgba(255, 255, 255, .55), transparent 70%),
    repeating-linear-gradient(115deg, hsl(var(--h) 100% 70% / .0) 0 12px, hsl(calc(var(--h) + 120) 100% 70% / .25) 18px,
      hsl(calc(var(--h) + 240) 100% 70% / .0) 26px); }
.tcard.common .tcard-foil { opacity: .12; }
.tcard.rare .tcard-foil { opacity: .22; }
.tcard.legendary { box-shadow: 0 24px 70px hsl(var(--h) 80% 40% / .6), 0 0 0 1px rgba(255, 215, 120, .35); }
.tcard.reveal { animation: cardin 1.1s var(--spring) both; }
@keyframes cardin { 0% { opacity: 0; transform: rotateY(-120deg) scale(.7); } 60% { opacity: 1; } 100% { transform: none; } }
.tcard-top { width: 100%; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.tcard-rarity { font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); }
.tcard.epic .tcard-rarity { background: hsl(275 70% 55% / .35); border-color: hsl(275 80% 70% / .5); }
.tcard.legendary .tcard-rarity { background: linear-gradient(90deg, #f7d774, #f0a35b); color: #2a1a00; border: 0; }
.tcard.rare .tcard-rarity { background: hsl(205 80% 55% / .3); border-color: hsl(205 80% 70% / .45); }
.tcard-no { font-size: .8rem; font-weight: 800; color: rgba(245, 247, 250, .75); }
.tcard-no small { font-weight: 600; opacity: .6; }
.tcard-art { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin: 4px 0 2px; }
.tcard-ring { position: absolute; inset: 8px; border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--h) 90% 65% / .55), hsl(var(--h) 90% 50% / .08) 60%, transparent 70%);
  box-shadow: 0 0 0 1px hsl(var(--h) 90% 75% / .25), 0 0 0 14px hsl(var(--h) 90% 75% / .06);
  animation: pulse-ring 3.2s ease-in-out infinite; }
@keyframes pulse-ring { 50% { transform: scale(1.06); opacity: .8; } }
.tcard-emoji { position: relative; font-size: 88px; line-height: 1; animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .45));
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
@keyframes float { 50% { transform: translateY(-7px) rotate(-3deg); } }
.tcard-kicker { font-size: .7rem; font-weight: 700; color: rgba(245, 247, 250, .55); }
.tcard-name { font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.25;
  background: linear-gradient(180deg, #fff, hsl(var(--h) 70% 85%)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tcard-twin { font-size: .8rem; color: rgba(245, 247, 250, .7); }
.tcard-tag { font-size: .92rem; line-height: 1.85; max-width: 320px; margin: 6px 0 4px; color: rgba(245, 247, 250, .92); }
.tcard-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; position: relative; z-index: 1; }
.tstat { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 6px; padding: 9px 11px;
  border-radius: 14px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .07); text-align: right; }
.tstat span { font-size: .72rem; color: rgba(245, 247, 250, .65); }
.tstat b { font-size: .95rem; font-weight: 900; }
.tstat i { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.tstat em { display: block; height: 100%; width: var(--w); border-radius: 3px;
  background: linear-gradient(90deg, hsl(var(--h) 90% 62%), hsl(calc(var(--h) + 50) 90% 68%)); }
.tcard-traits { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.tcard-traits span { padding: 4px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); }
@media (prefers-reduced-motion: reduce) { .tcard-emoji, .tcard-ring { animation: none; } }

.persona-summary { margin-top: 16px; }
.persona-summary-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.persona-summary-head img { width: 28px; height: 28px; border-radius: 9px; }
.persona-summary p { line-height: 1.9; color: var(--text-2); }
.persona-risk { margin-top: 12px; }
.persona-risk-sub { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); margin-top: 10px; }
.persona-risk + .ask-vazir { margin-top: 12px; }
.avatar-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; min-width: 0;
  border-radius: 16px; border: 1px solid transparent; background: none; color: var(--text-2);
  font: inherit; cursor: pointer; position: relative; transition: transform .2s var(--spring), background .2s; }
.avatar-pick:active { transform: scale(.92); }
.avatar-pick .avatar { --size: 50px; }
.avatar-name { font-size: .64rem; font-weight: 700; line-height: 1.4; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.avatar-pick.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.avatar-pick.mine::after { content: "★"; position: absolute; top: 2px; inset-inline-end: 4px; font-size: .8rem;
  color: var(--warn); text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }

/* مصاحبه با وزیر */
.persona-intro { display: flex; justify-content: center; padding: 6px 0 4px; }
.persona-intro .avatar { --size: 40px; border: 2px solid var(--bg); animation: rise .5s var(--ease) both; }
.persona-intro .avatar + .avatar { margin-inline-start: -10px; }
.persona-intro .avatar:nth-child(2) { animation-delay: .06s; } .persona-intro .avatar:nth-child(3) { animation-delay: .12s; }
.persona-intro .avatar:nth-child(4) { animation-delay: .18s; } .persona-intro .avatar:nth-child(5) { animation-delay: .24s; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-inline-start: 10%; animation: rise .35s var(--ease) both; }
.chip-reply { font: inherit; font-size: .88rem; font-weight: 600; padding: 9px 14px; border-radius: 16px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--hairline)); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); transition: transform .2s var(--spring), border-color .2s; }
.chip-reply:active { transform: scale(.95); border-color: var(--accent); }
.quick-link { align-self: center; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.redo { margin-top: 18px; }

/* ---------- نمودار قیمت و تغییر روزانه ---------- */
a.watch-card { color: inherit; text-decoration: none; transition: transform .2s var(--spring), border-color .2s; }
a.watch-card:active { transform: scale(.96); border-color: var(--accent); }
.chart-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.chart-link .i { width: 16px; height: 16px; color: var(--accent); }
.day-change { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 800; margin-top: 2px; }
.day-change .i { width: 13px; height: 13px; }
.day-change small { font-weight: 600; color: var(--muted); }
.day-change.up { color: var(--good); } .day-change.down { color: var(--bad); } .day-change.flat { color: var(--muted); font-weight: 600; }
.pc-now { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.pc-now strong { font-size: 1.5rem; font-weight: 900; letter-spacing: -.01em; }
.pc-ranges { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.pc-ranges button { flex: 1; font: inherit; font-size: .8rem; font-weight: 700; padding: 8px 4px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.pc-ranges button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pc-ranges button:disabled { opacity: .35; cursor: default; }
.pc-range-change { margin: 10px 2px 4px; }
.pc-range-change strong.up { color: var(--good); } .pc-range-change strong.down { color: var(--bad); }
.chart-box.pc-box { height: 230px; }
.pc-since { margin: 6px 2px 0; }
.pc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.pc-stats div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--hairline); }
.pc-stats span { font-size: .72rem; color: var(--muted); }
.pc-stats b { font-size: .92rem; font-weight: 800; }
.pc-stats b.up { color: var(--good); } .pc-stats b.down { color: var(--bad); }
.pc-stats small { font-size: .7rem; color: var(--muted); }
.pc-empty { padding: 20px 0; text-align: center; }
.pc-ask { margin-top: 6px; }

/* ---------- عکس در چت وزیر ---------- */
.chat-attach { width: 40px; height: 44px; flex: none; display: grid; place-items: center; color: var(--muted);
  cursor: pointer; border-radius: 50%; transition: color .2s, transform .2s var(--spring); }
.chat-attach:active { transform: scale(.9); }
.chat-attach:hover { color: var(--accent); }
.chat-attach .i { width: 22px; height: 22px; }
.chat-attach-preview { display: flex; align-items: center; gap: 10px; margin: 0 12px 8px; padding: 8px 10px;
  border-radius: 18px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  animation: rise .3s var(--ease) both; }
.chat-attach-preview[hidden] { display: none; }
.chat-attach-preview img { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; flex: none; }
.chat-attach-preview p { flex: 1; font-size: .74rem; line-height: 1.7; color: var(--text-2); }
.chat-photo { display: block; max-width: 220px; max-height: 260px; border-radius: 14px; margin-bottom: 6px; object-fit: cover; }
.chat-msg.me:has(.chat-photo) { padding: 6px; }
.confirm-all { width: 86%; min-height: 46px; }

/* ---------- صفحه معرفی عمومی: شفق متحرک، گوشی با گفتگوی زنده، نوار قیمت، کارت‌ها ---------- */
.lx { position: relative; overflow: hidden; min-height: 100dvh; isolation: isolate; }
.lx-aurora { position: absolute; inset: -20% -10% auto; height: 900px; z-index: -2; filter: blur(70px); opacity: .7; pointer-events: none; }
.lx-aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 18s ease-in-out infinite alternate; }
.lx-aurora i:nth-child(1) { width: 520px; height: 520px; top: 0; right: 5%; background: #1fbf86; }
.lx-aurora i:nth-child(2) { width: 420px; height: 420px; top: 140px; left: 0; background: #6d5cff; animation-duration: 22s; }
.lx-aurora i:nth-child(3) { width: 360px; height: 360px; top: 320px; right: 30%; background: #b8f35c; opacity: .6; animation-duration: 26s; }
:root[data-theme="light"] .lx-aurora { opacity: .35; }
:root[data-theme="light"] .lx-aurora i { mix-blend-mode: multiply; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 40px) scale(1.15); } 100% { transform: translate(-40px, 80px) scale(.95); } }
.lx-grid { position: absolute; inset: 0 0 auto; height: 900px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent 75%);
  mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent 75%); }

.lx-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  max-width: 1080px; margin: 0 auto; padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5); }
.lx-nav nav { display: flex; align-items: center; gap: 14px; }
.lx-brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: 1.25rem; font-weight: 900; }
.lx-brand img { border-radius: 10px; box-shadow: 0 0 18px var(--accent-glow); }
.lx-link { color: var(--text-2); text-decoration: none; font-weight: 700; font-size: .9rem; }
.lx main { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.lx-hero { display: grid; gap: 34px; align-items: center; padding: 34px 0 26px; }
@media (min-width: 880px) { .lx-hero { grid-template-columns: 1.1fr .9fr; padding-top: 70px; } }
.lx-hero-text { display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: center; }
@media (min-width: 880px) { .lx-hero-text { text-align: right; align-items: flex-start; } }
.lx-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 800;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.lx-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.lx-hero h1 { font-size: clamp(2.1rem, 9vw, 3.6rem); font-weight: 900; line-height: 1.3; letter-spacing: -.03em;
  background: linear-gradient(100deg, var(--text) 20%, var(--accent) 45%, var(--accent-2) 55%, var(--text) 80%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -150% 0; } }
.lx-lead { color: var(--text-2); font-size: 1.02rem; line-height: 2.05; max-width: 520px; }
.lx-ask { font-size: .95rem; color: var(--muted); min-height: 1.9em; }
.lx-typed { color: var(--text); font-weight: 800; }
.lx-caret { display: inline-block; width: 2px; height: 1.1em; margin-inline-start: 2px; vertical-align: -3px; background: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.lx-cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lx-cta .btn { min-width: 150px; min-height: 52px; font-size: 1rem; }
.lx-cta .flip { transform: none; }
.lx-glow { position: relative; box-shadow: 0 10px 34px var(--accent-glow); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 14px 48px var(--accent-glow), 0 0 0 6px var(--accent-soft); } }
.lx-trust { font-size: .78rem; color: var(--muted); }

/* گوشی نمایشی با گفتگوی خودکار */
.lx-phone-wrap { position: relative; display: grid; place-items: center; padding: 30px 0; }
.lx-phone { position: relative; width: 300px; height: 560px; border-radius: 44px; padding: 14px; overflow: hidden;
  background: linear-gradient(160deg, #1b222c, #0a0d11); border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55), inset 0 0 0 6px #05070a, 0 0 80px color-mix(in srgb, var(--accent) 25%, transparent);
  animation: hover 7s ease-in-out infinite; color: #f3f6f9; display: flex; flex-direction: column; }
@keyframes hover { 50% { transform: translateY(-10px) rotate(-1deg); } }
.lx-notch { width: 96px; height: 24px; border-radius: 0 0 14px 14px; background: #05070a; margin: -14px auto 8px; }
.lx-phone-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.lx-phone-head img { width: 32px; height: 32px; border-radius: 10px; }
.lx-phone-head span { display: flex; flex-direction: column; line-height: 1.3; }
.lx-phone-head small { display: flex; align-items: center; gap: 4px; font-size: .66rem; color: #8a94a1; }
.lx-phone-head small i { width: 6px; height: 6px; border-radius: 50%; background: #3ee8a6; box-shadow: 0 0 6px #3ee8a6; }
.lx-chat { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px 6px; overflow: hidden; }
.lx-msg { max-width: 84%; padding: 8px 12px; border-radius: 16px; font-size: .78rem; line-height: 1.8; animation: pop .45s var(--spring) both; }
.lx-msg.me { align-self: flex-start; background: linear-gradient(120deg, #3ee8a6, #b8f35c); color: #03150e; font-weight: 700; border-bottom-right-radius: 4px; }
.lx-msg.vazir { align-self: flex-end; background: #1c222b; border: 1px solid rgba(255, 255, 255, .07); border-bottom-left-radius: 4px; }
.lx-msg.typing { display: flex; gap: 4px; padding: 11px 13px; }
.lx-msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: #3ee8a6; animation: blink 1.2s infinite both; }
.lx-msg.typing i:nth-child(2) { animation-delay: .15s; } .lx-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
.lx-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.lx-bars div { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 6px; font-size: .64rem; color: #c0c8d2; }
.lx-bars i { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #3ee8a6, #b8f35c); width: 0; transition: width 1s var(--ease) .2s; }
.lx-msg-card { margin-top: 6px; padding: 6px 10px; border-radius: 10px; text-align: center; font-weight: 800; font-size: .72rem;
  background: linear-gradient(120deg, #3ee8a6, #b8f35c); color: #03150e; }
.lx-phone-input { display: flex; align-items: center; justify-content: space-between; margin: 4px; padding: 6px 6px 6px 12px;
  border-radius: 22px; background: #1c222b; font-size: .72rem; color: #8a94a1; }
.lx-phone-input b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(120deg, #3ee8a6, #b8f35c); color: #03150e; }
.lx-phone-input .i { width: 16px; height: 16px; }
.lx-orbit { position: absolute; width: 400px; height: 400px; animation: spin 40s linear infinite; pointer-events: none; }
.lx-orbit > span { position: absolute; top: 50%; left: 50%; transform: rotate(calc(var(--i) * 60deg)) translate(200px) rotate(calc(var(--i) * -60deg)); margin: -22px; }
.lx-orbit .avatar { --size: 44px; animation: spin 40s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 420px) { .lx-orbit { width: 340px; height: 340px; } .lx-orbit > span { transform: rotate(calc(var(--i) * 60deg)) translate(170px) rotate(calc(var(--i) * -60deg)); } }

/* نوار قیمت زنده */
.lx-ticker { position: relative; overflow: hidden; margin: 10px -16px 0; padding: 12px 0; border-block: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 70%, transparent); direction: ltr;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.lx-ticker-track { display: flex; width: max-content; gap: 34px; animation: marquee 40s linear infinite; }
.lx-ticker:hover .lx-ticker-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.lx-tick { direction: rtl; display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: .9rem; font-weight: 700; }
.lx-tick b { color: var(--muted); font-weight: 600; font-size: .8rem; }
.lx-tick em { font-style: normal; font-size: .78rem; }
.lx-tick em.up, .lx-chart-nums b.up { color: var(--good); } .lx-tick em.down, .lx-chart-nums b.down { color: var(--bad); }

/* بخش‌ها و کارت‌ها */
.lx-section { margin-top: 72px; }
.lx-section > h2, .lx-chart h2, .lx-persona h2 { font-size: clamp(1.45rem, 5.5vw, 2.1rem); font-weight: 900; letter-spacing: -.02em; text-align: center; }
.lx-sub { color: var(--text-2); text-align: center; line-height: 2; max-width: 560px; margin: 10px auto 22px; }
.lx-bento, .lx-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.lx-card { --mx: 50%; --my: 50%; position: relative; overflow: hidden; padding: 20px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--hairline); box-shadow: var(--shadow);
  transition: transform .3s var(--spring), border-color .3s; }
.lx-card::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--accent-soft), transparent 70%); }
.lx-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline)); }
.lx-card:hover::before { opacity: 1; }
.lx-card h3 { font-size: 1.05rem; font-weight: 800; margin: 12px 0 6px; }
.lx-card p { color: var(--muted); font-size: .88rem; line-height: 1.95; }

.lx-chart { display: grid; gap: 20px; align-items: center; padding: 26px 20px; border-radius: 30px;
  background: linear-gradient(170deg, #0f2a20, #07090c); color: #f3f6f9; border: 1px solid rgba(62, 232, 166, .2);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
@media (min-width: 880px) { .lx-chart { grid-template-columns: .8fr 1.2fr; padding: 36px; } .lx-chart h2, .lx-chart .lx-sub { text-align: right; margin-inline: 0; } }
.lx-chart .lx-sub { color: #c0c8d2; }
.lx-chart-nums { display: flex; gap: 22px; justify-content: center; }
@media (min-width: 880px) { .lx-chart-nums { justify-content: flex-start; } }
.lx-chart-nums span { display: flex; flex-direction: column; }
.lx-chart-nums small { color: #8a94a1; font-size: .75rem; }
.lx-chart-nums b { font-size: 1.5rem; font-weight: 900; }
.lx-line { width: 100%; height: 220px; overflow: visible; }
.lx-line .lx-area { fill: url(#lx-fill); opacity: 0; transition: opacity 1.2s ease 1.2s; }
.lx-line .lx-stroke { fill: none; stroke: url(#lx-stroke); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 8px rgba(62, 232, 166, .6)); transition: stroke-dashoffset 2.2s var(--ease); }
.lx-chart.in .lx-stroke { stroke-dashoffset: 0; }
.lx-chart.in .lx-area { opacity: 1; }

.lx-persona { display: grid; gap: 30px; align-items: center; }
@media (min-width: 880px) { .lx-persona { grid-template-columns: 1fr 1fr; } .lx-persona-text h2, .lx-persona-text .lx-sub { text-align: right; margin-inline: 0; } }
.lx-persona-text { display: flex; flex-direction: column; align-items: center; }
@media (min-width: 880px) { .lx-persona-text { align-items: flex-start; } }
.lx-fan { position: relative; height: 300px; display: grid; place-items: center; perspective: 900px; }
.lx-mini { position: absolute; width: 150px; height: 210px; border-radius: 22px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; padding: 12px; text-align: center; color: #f3f6f9;
  background: radial-gradient(90% 60% at 50% 0%, hsl(var(--h) 85% 55% / .6), transparent 70%), linear-gradient(175deg, hsl(var(--h) 35% 16%), #07090c 90%);
  border: 1px solid hsl(var(--h) 80% 65% / .5); box-shadow: 0 20px 40px rgba(0, 0, 0, .4);
  transform: rotate(calc(var(--i) * 12deg)) translateX(calc(var(--i) * -46px)) translateY(calc(var(--i) * var(--i) * 6px));
  animation: fan 6s ease-in-out infinite; animation-delay: calc(var(--i) * .2s); }
.lx-mini span { font-size: 54px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .4)); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.lx-mini b { font-weight: 900; font-size: .95rem; }
.lx-mini small { font-size: .65rem; color: rgba(243, 246, 249, .65); }
@keyframes fan { 50% { transform: rotate(calc(var(--i) * 15deg)) translateX(calc(var(--i) * -56px)) translateY(calc(var(--i) * var(--i) * 6px - 8px)); } }

.lx-steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: none; }
.lx-steps li { position: relative; padding: 22px 20px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--hairline); }
.lx-step-no { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; font-weight: 900; font-size: 1.1rem;
  background: var(--grad); color: var(--on-accent); box-shadow: 0 8px 22px var(--accent-glow); }
.lx-steps h3 { font-size: 1.05rem; font-weight: 800; margin: 12px 0 4px; }
.lx-steps p { color: var(--muted); font-size: .88rem; line-height: 1.9; }
.lx-privacy { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 20px;
  border-radius: 30px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.lx-privacy h2 { font-size: 1.4rem; font-weight: 900; }
.lx-privacy p { color: var(--text-2); line-height: 2; max-width: 560px; }
/* ورود با چهره: اسکن متحرک */
.lx-face { display: grid; gap: 26px; align-items: center; justify-items: center; padding: 30px 20px; border-radius: 30px;
  background: linear-gradient(170deg, #0f2a20, #07090c); color: #f3f6f9; border: 1px solid rgba(62, 232, 166, .2);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.lx-face-text { text-align: center; }
@media (min-width: 880px) { .lx-face { grid-template-columns: auto 1fr; padding: 40px 48px; justify-items: start; }
  .lx-face-text { text-align: right; } .lx-face-text .lx-sub { text-align: right; margin-inline: 0; } }
.lx-face h2 { font-size: clamp(1.45rem, 5.5vw, 2.1rem); font-weight: 900; }
.lx-face .lx-sub { color: #c0c8d2; }
.lx-scan { position: relative; width: 150px; height: 150px; display: grid; place-items: center; color: #3ee8a6; }
.lx-scan > .i { width: 96px; height: 96px; stroke-width: 1.3; filter: drop-shadow(0 0 12px rgba(62, 232, 166, .55)); }
.lx-scan-ring { position: absolute; inset: 0; border-radius: 40px; border: 1.5px solid rgba(62, 232, 166, .35);
  animation: scan-ring 3.2s ease-in-out infinite; }
.lx-scan-line { position: absolute; inset-inline: 22px; top: 22px; height: 2px; border-radius: 2px; background: #3ee8a6;
  box-shadow: 0 0 14px 3px rgba(62, 232, 166, .7); animation: scan-line 3.2s ease-in-out infinite; }
.lx-scan-ok { position: absolute; bottom: -6px; inset-inline-end: -6px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: var(--on-accent); box-shadow: 0 8px 22px rgba(62, 232, 166, .45); animation: scan-ok 3.2s ease-in-out infinite; }
.lx-scan-ok .i { width: 20px; height: 20px; }
@keyframes scan-line { 0%, 100% { top: 22px; opacity: 0; } 10%, 55% { opacity: 1; } 60% { top: calc(100% - 24px); opacity: 0; } }
@keyframes scan-ring { 0%, 55% { transform: scale(1); opacity: .6; } 70% { transform: scale(1.08); opacity: 1; border-color: #3ee8a6; } 100% { transform: scale(1); opacity: .6; } }
@keyframes scan-ok { 0%, 58% { transform: scale(0); } 68% { transform: scale(1.15); } 75%, 92% { transform: scale(1); } 100% { transform: scale(0); } }
.lx-face-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
@media (min-width: 880px) { .lx-face-points { justify-content: flex-start; } }
.lx-face-points li { padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #3ee8a6;
  background: rgba(62, 232, 166, .1); border: 1px solid rgba(62, 232, 166, .25); }
.lx-face-points li::before { content: "✓ "; }

/* همه دستگاه‌ها */
.lx-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lx-app { display: flex; flex-direction: column; }
.lx-app p { flex: 1; }
.lx-app .btn { margin-top: 12px; align-self: flex-start; gap: 6px; }
@media (max-width: 420px) { .lx-hide-sm { display: none; } }

.lx-faq { margin-bottom: 8px; max-width: 760px; margin-inline: auto; }
.lx-faq p { color: var(--text-2); line-height: 1.95; padding-top: 8px; }
.lx-final { margin: 80px auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lx-final img { border-radius: 22px; box-shadow: 0 18px 50px var(--accent-glow); animation: hover 6s ease-in-out infinite; }
.lx-final h2 { font-size: clamp(1.4rem, 6vw, 2.2rem); font-weight: 900; }
.lx-final .btn { min-width: 200px; min-height: 54px; }
.lx-footer { text-align: center; color: var(--muted); font-size: .75rem; padding: 40px 16px calc(var(--safe-b) + 24px); }

/* ظاهر شدن هنگام اسکرول */
.lx.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.lx.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .lx *, .lx *::before { animation: none !important; transition: none !important; }
  .lx.js [data-reveal] { opacity: 1; transform: none; }
  .lx-line .lx-stroke { stroke-dashoffset: 0; } .lx-line .lx-area { opacity: 1; }
}

/* صفحه معرفی روی دسکتاپ پس‌زمینه ساده دارد. body نباید ظرف اسکرول شود (overflow جز visible):
   با overscroll-behavior: none، اسکرول ترک‌پد و موس مک روی body قفل می‌شد و صفحه پایین نمی‌رفت. */
@media (min-width: 700px) {
  body.site { display: block; background: var(--bg); }
}

/* =====================================================================
   طراحی دوم «وزیر»: سلسله‌مراتب روشن، سطح‌های تخت و آرام، عدد درشت بی‌شکست
   (این لایه روی قبلی می‌نشیند؛ ترتیب فایل مهم است)
   ===================================================================== */
:root {
  --bg: #0a0c10;
  --surface: #12161c;
  --surface-2: #191e26;
  --surface-3: #232a34;
  --hairline: rgba(255, 255, 255, .06);
  --radius: 22px;
  --shadow: none;
}
:root[data-theme="light"] {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f2f4f6;
  --surface-3: #e7eaee;
  --hairline: rgba(10, 20, 30, .07);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
}
body { font-size: 15px; letter-spacing: -.005em; }
.page { gap: 16px; padding-top: 8px; }

/* عنوان صفحه و بخش‌ها */
.appbar h1 { font-size: 1.75rem; font-weight: 900; letter-spacing: -.025em; }
.section-title { font-size: .95rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; margin: 10px 4px -4px; }

/* سطح‌ها: تخت، بدون گرادیان و سایه سنگین */
.card, .list { background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.card { padding: 18px; }
.bubble { width: 40px; height: 40px; border-radius: 13px; }
.bubble .i { width: 20px; height: 20px; }

/* عدد و واحد: عدد پررنگ، واحد کوچک و کم‌رنگ، هرگز دو خط */
.amt { white-space: nowrap; font-weight: 800; }
.amt small { font-size: .62em; font-weight: 600; opacity: .55; margin-inline-start: .28em; }
.pos { color: var(--good); } .neg { color: var(--bad); }

/* ---------- قهرمان صفحه اصلی ---------- */
.hero.hx { padding: 20px 20px 16px; gap: 6px; border-radius: 28px; }
.hero.hx .hero-value { font-size: 2.7rem; margin-top: 6px; line-height: 1.2; }
.hero.hx .hero-value .amt small { font-size: .4em; opacity: .7; }
.hero-meta { display: flex; align-items: center; gap: 8px; min-height: 26px; flex-wrap: wrap; }
.hero.hx .spark { height: 48px; margin: 4px 0 0; }
.hero-mix { display: flex; gap: 3px; height: 6px; margin: 14px 0 2px; }
.hero-mix span { width: var(--w); min-width: 6px; border-radius: 3px; background: var(--c, var(--accent)); }
.hero-split { display: grid; grid-template-columns: 1fr 1fr; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.hero-split a { display: flex; flex-direction: column; gap: 2px; color: #fff; padding-inline-end: 12px; }
.hero-split a + a { padding-inline: 14px 0; border-inline-start: 1px solid rgba(255, 255, 255, .08); }
.hero-split small { font-size: .74rem; color: rgba(255, 255, 255, .6); font-weight: 600; }
.hero-split strong { font-size: 1.15rem; }

/* اقدام‌های سریع: چهار دکمه گرد زیر قهرمان، مثل اپ‌های بانکی */
.qa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 2px; }
.qa-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-2); font-size: .78rem; font-weight: 700;
  transition: transform .2s var(--spring); }
.qa-btn:active { transform: scale(.92); }
.qa-ic { width: 56px; height: 56px; border-radius: 20px; display: grid; place-items: center; background: var(--surface);
  border: 1px solid var(--hairline); color: var(--accent); box-shadow: var(--shadow); }
.qa-ic .i { width: 24px; height: 24px; }
.qa-ai .qa-ic { background: linear-gradient(145deg, #0f3a2b, #08130f); border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 8px 24px var(--accent-glow); }
.qa-ai .qa-ic img { width: 34px; height: 34px; border-radius: 10px; }
.qa-ai { color: var(--text); }

/* پنل‌های صفحه اصلی */
.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px 16px 18px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { font-size: 1rem; font-weight: 800; }
.panel-head a { font-size: .8rem; font-weight: 700; }
.month-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.month-split a { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); color: var(--text); }
.month-split small, .flow-grid small, .sum-card small { color: var(--muted); font-size: .76rem; font-weight: 600; }
.month-split strong { font-size: 1.35rem; }
.cat-bars.slim { gap: 10px; }
.cat-bars.slim .cat-track { height: 6px; }
.flow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-bottom: 14px; }
.flow-grid > * { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.flow-grid strong { font-size: 1.05rem; }
.flow-grid .free strong { font-size: 1.05rem; }
.mix-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mix-list a { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 9px 0; color: var(--text); font-size: .9rem; }
.mix-list li + li a { border-top: 1px solid var(--hairline); }
.mix-pct { color: var(--muted); font-size: .8rem; min-width: 34px; text-align: left; }
.mix-value { min-width: 96px; text-align: left; }

/* قیمت‌های من: ردیف فشرده و افقی */
.watch-head h2 { font-size: .95rem; font-weight: 800; }
.watch-card, a.watch-card { min-width: 124px; padding: 10px 12px; border-radius: 16px; gap: 2px; background: var(--surface); border-color: var(--hairline); box-shadow: var(--shadow); }
.watch-card strong { font-size: .98rem; }
.watch-card strong .amt small { font-size: .6em; }
.watch-label { font-size: .72rem; }
.watch-change { font-size: .72rem; }

/* کارت جمع صفحه‌های فهرست */
.summary, .sum-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 24px; background:
  radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--surface);
  border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.summary strong, .sum-card strong { font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.25; }
.summary.two, .sum-card.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sum-card.two > div { display: flex; flex-direction: column; gap: 2px; }
.sum-card.two > div + div { border-inline-start: 1px solid var(--hairline); padding-inline-start: 14px; }
.sum-card.two strong { font-size: 1.35rem; }
.sum-card .hero-mix span { background: var(--c); }
.mix-chips { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: .76rem; color: var(--muted); font-weight: 600; }
.mix-chips span { display: inline-flex; align-items: center; gap: 5px; }
.mix-chips .dot { width: 8px; height: 8px; }

/* فهرست گروه‌بندی‌شده: یک کارت، برچسب گروه داخلش */
.list.grouped { padding: 4px 0; }
.list-label { padding: 12px 16px 2px; font-size: .74rem; font-weight: 800; color: var(--muted); }
.list-label + .row { border-top: 0 !important; }
.row { min-height: 66px; padding: 10px 16px; gap: 12px; }
.row + .row { border-top-color: var(--hairline); }
.row-title { font-size: .95rem; font-weight: 700; }
.row-sub { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.row-end strong { font-size: .98rem; }
.row-share { font-size: .7rem; color: var(--muted); font-weight: 600; }

/* بدهی‌ها: مبلغ کنار نام، نوار پیشرفت تمام‌عرض */
.row.debt { align-items: flex-start; padding-block: 14px; }
.row.debt .row-main { gap: 4px; }
.debt-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.debt-line strong { font-size: 1rem; white-space: nowrap; }
.debt-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin: 6px 0 2px; }
.debt-progress .progress { height: 7px; margin: 0; width: 100%; }
.debt-count { font-size: .72rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.amt-inline { color: var(--text-2); }

/* دکمه افزودن: گرد و جمع‌وجور بالای نوار پایین */
.fab { width: 56px; height: 56px; border-radius: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 26px); }

/* نوار پایین: کمی بلندتر و آرام‌تر */
.tabbar { border-radius: 26px; }
.tabbar a { font-size: .68rem; font-weight: 700; }

/* انتخاب ظاهر: سگمنت جمع‌وجور به‌جای سه کاشی بزرگ */
.theme-pick { padding: 6px; gap: 4px; }
.theme-pick button { flex-direction: row; justify-content: center; gap: 8px; padding: 10px 8px; min-height: 0; border-radius: 14px; font-size: .85rem; }
.theme-pick .theme-swatch { width: 16px; height: 16px; border-radius: 50%; flex: none; }

/* صفحه اصلی در حالت روشن: قهرمان تیره می‌ماند */
:root[data-theme="light"] .qa-ai .qa-ic { background: linear-gradient(145deg, #0f3a2b, #0a1a14); }

/* بازار: فهرست قیمت مثل اپ بورس؛ ثبت دستی فقط در حالت ویرایش */
.appbar-inner { justify-content: space-between; gap: 12px; }
.appbar-action { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .85rem; }
.appbar-action .i { width: 16px; height: 16px; }
.market-row { min-height: 62px; }
.market-row .row-end strong { font-size: 1rem; }
.chg { display: inline-block; min-width: 58px; text-align: center; padding: 2px 8px; border-radius: 8px;
  font-size: .74rem; font-weight: 800; direction: ltr; }
.chg.up { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.chg.down { color: var(--bad); background: var(--bad-soft); }
.chg.flat { color: var(--muted); background: var(--surface-2); font-weight: 600; direction: rtl; }
.other-prices .list.flat { background: none; border: 0; box-shadow: none; }

/* =====================================================================
   طراحی سوم: عدد سبک‌تر، نوار پایین با «وزیر» در مرکز
   ===================================================================== */
/* عددها ۷۰۰ به‌جای ۹۰۰: خواناتر و ظریف‌تر؛ عنوان‌ها ۸۰۰ */
.amt, .hero-value, .hero.hx .hero-value, .summary strong, .sum-card strong, .row-end strong, .month-split strong,
.flow-grid strong, .hero-split strong, .watch-card strong, .mix-value, .debt-line strong, .pc-now strong,
.market-row .row-end strong, .tstat b, .chart-nums b { font-weight: 700; letter-spacing: -.01em; }
.hero.hx .hero-value { font-size: 2.55rem; letter-spacing: -.02em; }
.amt small, .hero-value small { font-weight: 500; }
.appbar h1 { font-weight: 800; }
.panel-head h2, .section-title, .card-head h2 { font-weight: 800; }
.row-title { font-weight: 600; }

/* نوار پایین: آیکون در قرص روشن برای تب فعال، «وزیر» گرد و درخشان در مرکز */
.tabbar { height: 70px; padding: 0 8px; align-items: center; border-radius: 28px; overflow: visible; }
.tabbar a { gap: 3px; font-size: .68rem; font-weight: 700; color: var(--muted); }
.tabbar a.on::after { display: none; }
.tab-ic { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; transition: background .25s var(--ease); }
.tabbar a .tab-ic .i { width: 22px; height: 22px; }
.tabbar a.on .tab-ic { background: var(--accent-soft); }
.tabbar a.on .tab-ic .i { transform: none; filter: none; }
.tabbar a.on { color: var(--text); }
.tab-vazir { position: relative; }
.tab-vazir-orb { width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #134d38, #07120d 75%); border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 8px 24px var(--accent-glow), 0 0 0 5px var(--bg); transition: transform .25s var(--spring); }
.tab-vazir-orb img { width: 34px; height: 34px; border-radius: 10px; }
.tab-vazir:active .tab-vazir-orb { transform: scale(.92); }
.tab-vazir span:last-child { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .tab-vazir-orb { animation: orb 4s ease-in-out infinite; }
  @keyframes orb { 50% { box-shadow: 0 8px 30px var(--accent-glow), 0 0 0 5px var(--bg), 0 0 0 9px color-mix(in srgb, var(--accent) 12%, transparent); } }
}
/* زبانه‌های بالای صفحه: سه یا چهار گزینه در یک ردیف */
.seg a { font-size: .85rem; padding-inline: 4px; white-space: nowrap; }

/* =====================================================================
   نسخه دسکتاپ: نوار کناری به‌جای نوار پایین، محتوای پهن و دوستونه
   ===================================================================== */
.tabbar .side-brand { display: none; }
@media (min-width: 900px) {
  :root { --side-w: 236px; }
  .tabbar { inset: 16px 16px 16px auto; width: var(--side-w); height: auto; flex-direction: column; justify-content: flex-start;
    align-items: stretch; gap: 4px; padding: 18px 12px; border-radius: 28px; }
  .tabbar .side-brand { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px;
    padding: 4px 10px 18px; margin-bottom: 6px; color: var(--text); font-size: 1.3rem; font-weight: 900;
    border-bottom: 1px solid var(--hairline); border-radius: 0; background: none !important; }
  .side-brand img { width: 38px; height: 38px; border-radius: 12px; box-shadow: 0 0 18px var(--accent-glow); }
  .tabbar a { flex: none; max-width: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px;
    border-radius: 16px; font-size: .95rem; font-weight: 700; }
  .tabbar a:hover { background: var(--surface-2); color: var(--text); }
  .tabbar a.on { background: var(--accent-soft); color: var(--text); }
  .tabbar a.on .tab-ic, .tab-ic { width: auto; height: auto; background: none; }
  .tab-vazir-orb { width: 36px; height: 36px; margin: -4px 0; animation: none !important; box-shadow: 0 4px 14px var(--accent-glow); border-width: 1px; }
  .tab-vazir-orb img { width: 24px; height: 24px; border-radius: 7px; }
  .tabbar .tab-vazir { order: 9; margin-top: auto; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent); }
  .tab-vazir span:last-child { color: var(--text); }
  .appbar { margin-inline-start: calc(var(--side-w) + 32px); padding-top: 18px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .appbar-inner { max-width: 1080px; padding-inline: 24px; margin-inline: 0 auto; }
  .page { margin-inline-start: calc(var(--side-w) + 32px); max-width: 1080px; margin-inline-end: auto; padding: 8px 24px 48px; }
  .page:not(.page-dashboard) > :not(.fab) { max-width: 760px; width: 100%; }
  #live { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  #live > .hero, #live > .qa, #live > .notices, #live > .watch, #live > .persona-cta { grid-column: 1 / -1; }
  #live > .hero { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  #live > .hero > .hero-top, #live > .hero > .hero-value, #live > .hero > .hero-meta { grid-column: 1; }
  #live > .hero > .spark { grid-column: 2; grid-row: 1 / span 3; height: 120px; align-self: center; }
  #live > .hero > .hero-mix, #live > .hero > .hero-split { grid-column: 1 / -1; }
  .qa { grid-template-columns: repeat(4, minmax(0, 140px)); justify-content: start; }
  .watch-scroll { flex-wrap: wrap; overflow: visible; }
  .fab { bottom: 32px; left: 32px; }
  .sheet { inset: 0; margin: auto; max-width: 560px; max-height: 86dvh; border-radius: 28px; padding: 18px 20px 20px; }
  .sheet-grip { display: none; }
  .chat-composer, .chat-attach-preview { width: min(720px, calc(100% - 24px)); margin-inline: auto; }
  .chat-head { padding-inline: max(14px, calc((100% - 720px) / 2)); }
  .toast { left: calc((100% - var(--side-w) - 32px) / 2); }
}

/* صفحه نصب اپ */
.install { max-width: 520px; margin: 0 auto; padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 32px);
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.install-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.install h1 { font-size: 1.5rem; font-weight: 900; }
.install-done { color: var(--good); font-weight: 800; }
.install-card { width: 100%; text-align: right; padding: 18px; border-radius: 22px; background: var(--surface);
  border: 1px solid var(--hairline); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; opacity: .75; }
.install-card.mine { opacity: 1; border-color: color-mix(in srgb, var(--accent) 40%, var(--hairline)); box-shadow: 0 10px 30px var(--accent-soft); }
.install-card h2 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 800; }
.install-card h2 .i { width: 20px; height: 20px; color: var(--accent); }
.install-card ul { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); line-height: 1.95; font-size: .92rem; }
.install-card h2 .bubble { width: 34px; height: 34px; }
.privacy-contact { font-weight: 700; }
.lx-footer a { color: var(--text-2); }
.install-card ol { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); line-height: 1.9; font-size: .92rem; }

/* ورود با چهره */
.passkey-login { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.passkey-login .or { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: 10px; }
.passkey-login .or::before, .passkey-login .or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.passkey-login .btn .i, .passkey-card .btn .i { width: 20px; height: 20px; }
.passkey-card { align-items: center; text-align: center; gap: 12px; }
.passkey-card p { color: var(--text-2); line-height: 1.9; font-size: .92rem; }
.passkey-face { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.passkey-face .i { width: 34px; height: 34px; }
