/* زبان بصری روا — رنگ لوگو (سرمه‌ای و نیلی) + نمودارها و حرکت واژه‌ها.
   رنگ‌های وضعیت (خوب/میانه/ضعیف) جدا از رنگ‌های امضا هستند و همیشه کنارشان برچسب متنی می‌آید. */
:root {
  /* ۲.۳: رنگ‌ها به رنگ لوگو و رنگ‌بندی قبلی برگشت (سرمه‌ای و آبی نیلی). --ch1/--ch2 فقط برای دو سری نمودار است. */
  --s1: #2F45A0; --s2: #4A62C6; --s3: #8C9CE0; --ch1: #3D58C4; --ch2: #C97F10; --good: #1F7A55; --warn: #9C6410; --bad: #B4483A; --neutral: #9AA0B2;
  --good-soft: #E4F0E9; --warn-soft: #F6ECD9; --bad-soft: #F7E4E0; --grad: linear-gradient(100deg, var(--s1), var(--s2) 55%, var(--s3));
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --s1: #8FA2F0; --s2: #A9B8EE; --s3: #C8D2F6; --ch1: #6A80E4; --ch2: #C2841F; --good: #4CAF87; --warn: #D29A3A; --bad: #E07A68; --neutral: #6B7183; --good-soft: #13241C; --warn-soft: #2A2112; --bad-soft: #2B1714; } }
:root[data-theme="dark"] { --s1: #8FA2F0; --s2: #A9B8EE; --s3: #C8D2F6; --ch1: #6A80E4; --ch2: #C2841F; --good: #4CAF87; --warn: #D29A3A; --bad: #E07A68; --neutral: #6B7183; --good-soft: #13241C; --warn-soft: #2A2112; --bad-soft: #2B1714; }

/* ---------- واژه‌ها */
.x-gt { background: var(--grad); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: x-shift 9s ease-in-out infinite alternate; padding-block: .12em; }
@keyframes x-shift { to { background-position: 100% 0; } }
.x-rise > * { display: block; animation: x-rise .9s cubic-bezier(.2,.7,.2,1) both; } .x-rise > *:nth-child(2) { animation-delay: .14s; } .x-rise > *:nth-child(3) { animation-delay: .28s; }
@keyframes x-rise { from { opacity: 0; transform: translateY(.55em); filter: blur(6px); } }
.x-rot { display: inline-grid; vertical-align: bottom; overflow: hidden; padding-block: .1em; margin-block: -.1em; }
.x-rot > span { grid-area: 1 / 1; transition: transform .7s cubic-bezier(.2,.7,.2,1), opacity .5s; transform: translateY(105%); opacity: 0; white-space: nowrap; }
.x-rot > span.on { transform: none; opacity: 1; } .x-rot > span.out { transform: translateY(-105%); opacity: 0; }
.x-rot { border-bottom: .09em solid color-mix(in srgb, var(--s2) 55%, transparent); border-radius: 2px; }
.x-kick { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .86rem; color: var(--muted); }
.x-kick::before { content: ""; width: 22px; height: 4px; border-radius: 4px; background: var(--grad); }
.x-live { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--muted); }
.x-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); animation: x-ping 2.2s ease-out infinite; }
@keyframes x-ping { to { box-shadow: 0 0 0 9px transparent; } }
.x-marq { overflow: hidden; direction: ltr; border-block: 1px solid var(--line); padding: 14px 0; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.x-marq > div { display: flex; gap: 44px; width: max-content; animation: x-marq 46s linear infinite; }
.x-marq span { direction: rtl; white-space: nowrap; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.1rem, 2.4vw, 1.7rem); color: color-mix(in srgb, var(--ink) 26%, transparent); }
.x-marq span:nth-child(3n+1) { color: color-mix(in srgb, var(--ink) 80%, transparent); } .x-marq span:nth-child(3n+2) { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.x-marq:hover > div { animation-play-state: paused; }
@keyframes x-marq { to { transform: translateX(-50%); } }

/* ---------- پس‌زمینه زنده بالای صفحه */
.x-aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.x-aurora i { position: absolute; width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; border-radius: 50%; filter: blur(80px); opacity: .13; animation: x-float 22s ease-in-out infinite alternate; }
.x-aurora i:nth-child(1) { background: var(--s1); top: -18%; right: -8%; } .x-aurora i:nth-child(2) { background: var(--s2); top: 10%; left: -12%; animation-duration: 27s; animation-delay: -6s; }
.x-aurora i:nth-child(3) { background: var(--s3); bottom: -34%; right: 30%; opacity: .1; animation-duration: 31s; animation-delay: -11s; }
@keyframes x-float { to { transform: translate3d(6%, 8%, 0) scale(1.14); } }

/* ---------- کارت تحلیل نهایی */
.x-ac { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: clamp(18px, 3vw, 26px); display: grid; gap: 16px; position: relative; }
.x-ac::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; pointer-events: none; }
.x-ac-tag { position: absolute; top: -11px; inset-inline-start: 22px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .72rem; padding: 1px 12px; border-radius: 999px; z-index: 1; }
.x-ac-top { display: flex; align-items: center; gap: 16px; } .x-ac-id { display: grid; gap: 7px; min-width: 0; }
.x-ac-sym { font-size: 1.3rem; font-weight: 800; line-height: 1.4; } .x-ac-sym small { font-weight: 400; color: var(--muted); font-size: .8rem; margin-inline-start: 6px; }
.x-ring { width: 108px; height: 108px; flex: none; position: relative; display: grid; place-items: center; }
.x-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); } .x-ring circle { fill: none; stroke-width: 10; } .x-ring .t { stroke: var(--line); }
.x-ring .a { stroke-linecap: round; transition: stroke-dashoffset 1.3s cubic-bezier(.2,.7,.2,1); } .x-ring b { font-size: 2rem; font-weight: 800; line-height: 1; } .x-ring small { color: var(--muted); font-size: .7rem; display: block; text-align: center; }
.sig { --c: var(--ch1); } .good { --c: var(--good); --cs: var(--good-soft); } .mid { --c: var(--warn); --cs: var(--warn-soft); } .bad { --c: var(--bad); --cs: var(--bad-soft); } .na { --c: var(--neutral); --cs: var(--sunken); }
.x-ring .a { stroke: var(--c); } .x-ring, .x-bar, .x-hbar, .x-gauge, .x-pill, .x-hist-c div { color: var(--ink); }
.x-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--cs); color: var(--ink); border-radius: 999px; padding: 2px 14px; font-size: .88rem; font-weight: 700; }
.x-pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.x-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .x-chip { border: 1px solid var(--line); border-radius: 999px; padding: 1px 11px; font-size: .78rem; color: var(--muted); } .x-chip b { color: var(--ink); font-weight: 600; }
.x-bars { display: grid; gap: 9px; } .x-bar { display: grid; grid-template-columns: 80px 1fr 30px; align-items: center; gap: 10px; font-size: .88rem; }
.x-bar i { height: 8px; border-radius: 99px; background: var(--line); display: block; position: relative; } .x-bar i::after { content: ""; position: absolute; inset-block: -3px; inset-inline-start: 50%; width: 1px; background: color-mix(in srgb, var(--ink) 25%, transparent); }
.x-bar u { display: block; height: 100%; border-radius: 99px; background: var(--c); width: 0; transition: width 1.2s cubic-bezier(.2,.7,.2,1); } .x-bar b { text-align: end; font-variant-numeric: tabular-nums; }
.x-why { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .9rem; } .x-why li { padding-inline-start: 24px; position: relative; }
.x-why li::before { position: absolute; inset-inline-start: 0; font-weight: 800; } .x-why .p::before { content: "＋"; color: var(--good); } .x-why .n::before { content: "－"; color: var(--bad); } .x-why .f::before { content: "⚑"; color: var(--bad); }
.x-lock { position: relative; border: 1px dashed var(--line); border-radius: 16px; padding: 12px 14px; overflow: hidden; }
.x-lock ul { position: absolute; inset: 12px 14px; margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; align-content: center; filter: blur(5px); opacity: .55; user-select: none; } .x-lock li { height: 10px; border-radius: 8px; background: var(--line); } .x-lock li:nth-child(2) { width: 72%; } .x-lock li:nth-child(3) { width: 54%; }
.x-lock > div { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; text-align: center; font-size: .86rem; padding: 2px 4px; }
.x-lock a { font-weight: 700; white-space: nowrap; } .x-ac-foot { color: var(--muted); font-size: .76rem; line-height: 1.8; }
.x-find { position: relative; } .x-find input { width: 100%; box-sizing: border-box; font: inherit; padding: 13px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); outline: 0; transition: border-color .2s, box-shadow .2s; }
.x-find input:focus { border-color: var(--s2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--s2) 18%, transparent); }
.x-find ul { position: absolute; z-index: 5; inset-inline: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); max-height: 300px; overflow: auto; }
.x-find li { padding: 8px 12px; border-radius: 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; } .x-find li small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .x-find li:hover, .x-find li.on { background: var(--sunken); }
.x-find-hint { font-size: .8rem; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .x-find-hint button { font: inherit; font-size: .8rem; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 0 10px; cursor: pointer; } .x-find-hint button:hover { border-color: var(--s2); }

/* ---------- نبض بازار */
.x-pulse { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); display: grid; grid-template-columns: auto minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 34px); align-items: center; }
.x-gauge { width: 220px; text-align: center; position: relative; } .x-gauge svg { width: 100%; display: block; } .x-gauge path { fill: none; stroke-width: 14; stroke-linecap: round; } .x-gauge .t { stroke: var(--line); } .x-gauge .a { stroke: var(--c); transition: stroke-dashoffset 1.5s cubic-bezier(.2,.7,.2,1); }
.x-gauge-n { position: absolute; inset-inline: 0; top: 34%; font-size: 2.7rem; font-weight: 800; line-height: 1; } .x-gauge-l { margin-top: 6px; display: grid; gap: 4px; justify-items: center; } .x-gauge small { color: var(--muted); font-size: .76rem; }
.x-lines { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .93rem; } .x-lines li { padding-inline-start: 16px; position: relative; line-height: 1.9; } .x-lines li::before { content: ""; position: absolute; inset-inline-start: 0; top: .8em; width: 6px; height: 6px; border-radius: 50%; background: var(--s2); }
.x-hist { display: grid; gap: 6px; } .x-hist-c { display: flex; align-items: flex-end; gap: 2px; height: 110px; direction: ltr; border-bottom: 1px solid var(--line); }
.x-hist-c div { flex: 1; display: flex; justify-content: center; align-items: flex-end; height: 100%; } .x-hist-c u { display: block; width: min(24px, 100%); border-radius: 4px 4px 0 0; background: var(--c); height: 0; transition: height 1s cubic-bezier(.2,.7,.2,1); min-height: 1px; }
.x-hist-c div:hover u { filter: brightness(1.15); } .x-hist-x { display: flex; justify-content: space-between; direction: ltr; font-size: .72rem; color: var(--muted); } .x-hist h4, .x-h4 { margin: 0; font-size: .86rem; font-weight: 600; color: var(--muted); }
.x-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; } .x-tile { border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; background: var(--surface); display: grid; gap: 2px; }
.x-tile > span { color: var(--muted); font-size: .8rem; } .x-tile b { font-size: 1.7rem; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; } .x-tile small { color: var(--muted); font-size: .76rem; }
.x-tile b i { font-style: normal; font-size: .9rem; font-weight: 600; margin-inline-start: 4px; }
@media (max-width: 900px) { .x-pulse { grid-template-columns: 1fr; justify-items: stretch; } .x-gauge { margin: 0 auto; } }

/* ---------- نمودار خطی */
.x-chart { position: relative; direction: ltr; } .x-chart svg { display: block; width: 100%; overflow: visible; } .x-chart text { font: 11px "Vazirmatn", Tahoma, sans-serif; fill: var(--muted); }
.x-chart .g { stroke: var(--line); stroke-width: 1; } .x-chart .l { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; } .x-chart .cross { stroke: color-mix(in srgb, var(--ink) 30%, transparent); stroke-width: 1; }
.x-chart circle { stroke: var(--surface); stroke-width: 2; } .x-chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: x-draw 1.6s cubic-bezier(.3,.6,.2,1) forwards; }
@keyframes x-draw { to { stroke-dashoffset: 0; } }
.x-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); direction: rtl; margin-bottom: 6px; } .x-legend span { display: inline-flex; align-items: center; gap: 6px; } .x-legend i { width: 14px; height: 3px; border-radius: 3px; background: var(--c); }
.x-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 6px 10px; font-size: .78rem; line-height: 1.7; direction: rtl; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5); opacity: 0; transition: opacity .12s; white-space: nowrap; }
.x-tip.on { opacity: 1; } .x-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-inline-end: 6px; }
.x-hbars { display: grid; gap: 8px; } .x-hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 34px; gap: 10px; align-items: center; font-size: .86rem; } .x-hbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-hbar i { height: 10px; background: var(--line); border-radius: 4px; display: block; } .x-hbar u { display: block; height: 100%; border-radius: 4px; background: var(--c); width: 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1); } .x-hbar b { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- نقشه جریان موتورها */
.x-flow { position: relative; max-width: 940px; margin: 0 auto 26px; } .x-flow svg { width: 100%; display: block; overflow: visible; }
.x-flow .w { fill: none; stroke: var(--line); stroke-width: 1.5; } .x-flow .f { fill: none; stroke: url(#xg); stroke-width: 2; stroke-dasharray: 6 12; stroke-linecap: round; animation: x-dash 2.4s linear infinite; }
@keyframes x-dash { to { stroke-dashoffset: -36; } }
.x-flow .nd rect { fill: var(--surface); stroke: var(--line); } .x-flow .nd text { font: 600 13px "Vazirmatn", Tahoma, sans-serif; fill: var(--ink); text-anchor: middle; }
.x-flow .core rect { fill: var(--accent); stroke: var(--accent); } .x-flow .core text { fill: var(--accent-ink); font-size: 15px; font-weight: 800; } .x-flow .out rect { fill: var(--surface); stroke: var(--s2); stroke-width: 1.5; } .x-flow .out text { font-size: 13px; }
.x-flow .pk { fill: var(--s2); }
@media (max-width: 760px) { .x-flow { display: none; } }

/* ---------- صفحه‌های داخلی (نبض بازار، نماد) */
.x-page { max-width: 1040px; margin: 0 auto; padding: clamp(22px, 4vw, 44px) 16px 70px; display: grid; gap: 22px; } .x-page h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); } .x-page h2 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
.x-box { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(16px, 2.6vw, 24px); display: grid; gap: 12px; } .x-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 22px; align-items: start; }
.x-engs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; } .x-eng { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 4px; background: var(--surface); } .x-eng b { font-size: .95rem; } .x-eng small { color: var(--muted); font-size: .78rem; line-height: 1.7; }
.x-prog { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; } .x-prog u { display: block; height: 100%; background: var(--grad); border-radius: 99px; width: 0; transition: width 1.2s; }
.x-tbl { width: 100%; border-collapse: collapse; font-size: .9rem; } .x-tbl th, .x-tbl td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); } .x-tbl th { color: var(--muted); font-weight: 500; font-size: .8rem; }
.x-note { color: var(--muted); font-size: .86rem; line-height: 2; } .pos { color: var(--good); } .neg { color: var(--bad); }
.btn.primary { position: relative; } .btn.primary:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--s2) 30%, transparent), 0 14px 30px -14px color-mix(in srgb, var(--s1) 70%, transparent); }
@media (prefers-reduced-motion: reduce) { .x-gt, .x-rise > *, .x-marq > div, .x-aurora i, .x-flow .f, .x-live::before, .x-chart .draw { animation: none !important; } .x-chart .draw { stroke-dashoffset: 0; } .x-bar u, .x-hbar u, .x-hist-c u, .x-ring .a, .x-gauge .a, .x-rot > span, .x-prog u { transition: none !important; } }
@media print { .x-aurora, .x-marq, .x-find, .x-lock > div a { display: none !important; } }
