/* ai-coding.ir — کدنما: تازه‌های هوش مصنوعی و کدنویسی
   پالت: لاجوردی (سرمه‌ای کاشی)، فیروزه‌ای، زعفرانی. نمودارها با پالت اعتبارسنجی‌شده. */

/* فونت استعداد (Estedad، مجوز OFL): متغیر ۱۰۰ تا ۹۰۰، زیرمجموعه‌ی فارسی و لاتین */
@font-face {
  font-family: "Estedad";
  src: url("../fonts/Estedad-var.woff2") format("woff2-variations"), url("../fonts/Estedad-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f2f5f8;
  --surface: #fcfcfb;
  --surface-2: #eef2f6;
  --ink: #0f1d2e;
  --ink-2: #44526a;
  --muted: #6f7b8c;
  --line: #dce3ea;
  --line-strong: #c3ccd7;
  --navy: #0f2a47;
  --navy-2: #0a2038;
  --navy-ink: #dbe7f3;
  --accent: #0b7a80;      /* فیروزه‌ای برای متن و پیوند */
  --accent-soft: #d6efee;
  --accent-2: #e0a12a;    /* زعفرانی */
  --pos: #006300;
  --neg: #b42828;
  --good: #0ca30c;
  --bad: #d03b3b;
  --warn: #8a6100;
  /* سری‌های نمودار */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --s1-track: #cde2fb;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --shadow: 0 1px 2px rgba(15, 29, 46, .06), 0 6px 20px rgba(15, 29, 46, .06);
  --radius: 12px;
  --font: "Estedad", Tahoma, system-ui, sans-serif;
  /* مقیاس تایپوگرافی: بدنه ۱۶ پیکسل، نسبت حدود ۱٫۲ */
  --fs-h1: 1.75rem; --fs-h2: 1.375rem; --fs-h3: 1.125rem; --fs-lead: 1.0625rem;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0b1320; --surface: #111b2a; --surface-2: #162336; --ink: #e6edf5; --ink-2: #b4c0cf; --muted: #8796a8;
    --line: #223047; --line-strong: #31425c; --navy: #0a1a2e; --navy-2: #071322; --navy-ink: #d2deea;
    --accent: #3fc1b8; --accent-soft: #123536; --accent-2: #f2b33d; --pos: #19b519; --neg: #ee7777; --warn: #e2b24a;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --s1-track: #184f95; --grid: #24324a; --axis: #3a4a63;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1320; --surface: #111b2a; --surface-2: #162336; --ink: #e6edf5; --ink-2: #b4c0cf; --muted: #8796a8;
  --line: #223047; --line-strong: #31425c; --navy: #0a1a2e; --navy-2: #071322; --navy-ink: #d2deea;
  --accent: #3fc1b8; --accent-soft: #123536; --accent-2: #f2b33d; --pos: #19b519; --neg: #ee7777; --warn: #e2b24a;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  --s1-track: #184f95; --grid: #24324a; --axis: #3a4a63;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.85; font-weight: 400;
  font-synthesis: none; text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; }
/* در خط فارسی فاصله‌ی حروف (letter-spacing) اتصال حروف را می‌شکند؛ هیچ‌جا استفاده نمی‌شود */
h1, h2, h3 { line-height: 1.55; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 650; }
p { margin: 0 0 .9em; }
ol { list-style-type: persian; }
ol ::marker, ol > li::marker { font-weight: 600; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
small { font-size: .78em; }
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.fine { font-size: .82rem; color: var(--muted); line-height: 1.7; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
.tnum { white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ── سربرگ ─────────────────────────────── */
.site-head { background: var(--navy); color: var(--navy-ink); position: sticky; top: 0; z-index: 30; }
.head-row { display: flex; align-items: center; gap: 22px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 36px; height: 36px; color: #3fc1b8; --accent-2: #f2b33d; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-fa { font-weight: 800; font-size: 1.02rem; }
.brand-en { font-size: .72rem; color: #9fb5cc; letter-spacing: .03em; }
.brand-tag { display: none; font-size: .74rem; font-weight: 500; color: #9fb5cc; }
.site-nav { display: flex; gap: 2px; flex-wrap: wrap; margin-inline-start: auto; }
.site-nav a { color: var(--navy-ink); text-decoration: none; padding: 8px 11px; border-radius: 8px; font-size: .93rem; font-weight: 500; position: relative; }
.site-nav a:hover { background: rgba(255, 255, 255, .07); }
.site-nav a[aria-current] { color: #fff; font-weight: 700; }
.site-nav a[aria-current]::after { content: ""; position: absolute; inset-inline: 11px; bottom: 2px; height: 2px; background: #3fc1b8; border-radius: 2px; }
.nav-toggle, .theme-toggle { background: none; border: 1px solid rgba(255, 255, 255, .18); color: var(--navy-ink); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.nav-toggle svg, .theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle svg { fill: currentColor; stroke: none; }
.nav-toggle { display: none; margin-inline-start: auto; }

.ticker { background: var(--navy-2); border-top: 1px solid rgba(255, 255, 255, .06); overflow: hidden; font-size: .82rem; color: #b9cadc; }
.ticker-track { display: inline-flex; white-space: nowrap; animation: tick 60s linear infinite; padding-block: 6px; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-dup { display: inline-flex; }
.t-item { padding-inline: 18px; border-inline-end: 1px solid rgba(255, 255, 255, .08); }
.t-item b { color: #fff; font-weight: 700; }
.t-k { color: #8ea6bf; }
.ticker .pos { color: #4fd44f; }
.ticker .neg { color: #ff8a8a; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker-track { animation: none; }
  .ticker-dup { display: none; }
  html { scroll-behavior: auto; }
}

/* ── صفحه ─────────────────────────────── */
main { padding-block: 32px 64px; min-height: 60vh; }
.page-head { margin-block: 8px 28px; max-width: 820px; }
.lead { font-size: var(--fs-lead); color: var(--ink-2); line-height: 1.95; }
.crumb { font-size: .9rem; margin-bottom: 4px; }
.block { margin-block: 44px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 16px; }
.block-head h2 { margin: 0; }
.more { font-size: .9rem; font-weight: 600; white-space: nowrap; }

/* قهرمان صفحه‌ی اصلی: یک جمله‌ی ساخته‌شده از داده‌ی زنده */
.hero { padding-block: 12px 8px; max-width: 980px; }
.hero-date { color: var(--muted); font-size: .92rem; margin-bottom: 6px; }
.hero-line { font-size: 1.5rem; font-weight: 600; line-height: 1.9; margin-bottom: 16px; }
.hero-line .num { color: var(--accent); font-weight: 800; }
.hero-line .ent { font-weight: 750; border-bottom: 2px solid var(--accent-2); }
.hero-facts { display: grid; gap: 2px; color: var(--ink-2); font-size: 1rem; border-inline-start: 3px solid var(--accent); padding-inline-start: 16px; }
.hero-facts p { margin: 0; }
.hero-facts b { color: var(--ink); }

.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; }
.home-grid.two { grid-template-columns: 1fr 1fr; }
.home-grid > .block { margin-block: 44px 0; }

/* اخبار */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.cat-mark { width: 10px; height: 10px; border-radius: 3px; margin-top: .65em; background: var(--s1); display: inline-block; flex-shrink: 0; }
.cat-models { background: var(--s1); } .cat-tools { background: var(--s2); } .cat-business { background: var(--s3); }
.cat-open { background: var(--s6); } .cat-research { background: var(--s7); } .cat-security { background: var(--s8); }
.cat-iran { background: var(--s5); } .cat-general { background: var(--s4); }
.news-title { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1.75; }
.news-title:hover { color: var(--accent); text-decoration: underline; }
.news-title[dir="ltr"] { display: block; text-align: left; }
.news-orig { display: block; font-size: .8rem; color: var(--muted); text-align: left; }
.news-sum { margin: 4px 0 2px; color: var(--ink-2); font-size: .93rem; line-height: 1.85; }
.news-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.news-meta .src { color: var(--ink-2); font-weight: 600; }
.lang-tag { border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 8px; font-size: .72rem; }
.news-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.news-layout aside { position: sticky; top: 120px; display: grid; gap: 20px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: .9rem; color: var(--ink-2); }
.pager { display: flex; gap: 18px; align-items: center; justify-content: center; margin-top: 24px; }

/* فیلترها */
.filters { margin-bottom: 18px; display: grid; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); text-decoration: none; font: inherit; font-size: .88rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-current], .chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .cat-mark { margin: 0; }
.chip-n { opacity: .7; font-size: .8em; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; }
.field { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }
.field.grow { flex: 1 1 240px; }
.field.inline { display: inline-grid; }
.field input, .field select, .calc-form input, .calc-form select {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 7px 11px; min-height: 40px; min-width: 0;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink-2); min-height: 40px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.btn { font: inherit; font-weight: 650; font-size: .92rem; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px; padding: 8px 18px; min-height: 40px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn.ghost { background: transparent; color: var(--accent); }
[data-theme="dark"] .btn:not(.ghost) { color: #062022; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .btn:not(.ghost) { color: #062022; } }

/* جدول‌ها */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap.tall { max-height: 720px; overflow-y: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: start; font-weight: 650; font-size: .78rem; color: var(--muted); background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.tbl-compact td, .tbl-compact th { padding: 6px 10px; }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]::after { content: "↕"; opacity: .35; margin-inline-start: 4px; font-size: .9em; }
.tbl th[aria-sort="ascending"]::after { content: "↑"; opacity: .9; }
.tbl th[aria-sort="descending"]::after { content: "↓"; opacity: .9; }
.num-col { width: 56px; text-align: center !important; }
.m-name { font-weight: 650; display: inline-block; }
.m-id { display: block; font-size: .72rem; color: var(--muted); background: none; padding: 0; margin-top: 2px; text-align: left; }
.m-flags { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-inline-start: 4px; }
.tag { display: inline-block; font-size: .7rem; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 650; vertical-align: middle; line-height: 1.7; white-space: nowrap; }
.tag.soft { background: var(--surface-2); color: var(--ink-2); }
.sym { font-size: .75rem; color: var(--muted); margin-inline-start: 6px; font-weight: 500; }
.cmp .sym { display: block; margin: 0; }
.role { display: block; font-size: .8rem; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.table-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: .88rem; }
.meter { display: inline-block; width: 64px; height: 6px; border-radius: 6px; background: var(--s1-track); vertical-align: middle; overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--v); background: var(--s1); border-radius: 6px; }
.yn { white-space: nowrap; font-weight: 600; font-size: .86rem; }
.yn-yes { color: var(--pos); }
.yn-partial { color: var(--warn); }
.yn-no { color: var(--muted); }

/* کاشی‌های بازار */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { display: grid; gap: 2px; padding: 14px 16px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s; }
.tile:hover { border-color: var(--accent); }
.tile-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tile-name { font-weight: 700; font-size: .95rem; }
.tile-sym { font-size: .75rem; color: var(--muted); }
.tile-val { font-size: 1.45rem; font-weight: 750; }
.tile-delta { font-size: .85rem; font-weight: 650; }
.tile-delta small { color: var(--muted); font-weight: 400; }
.tile .spark { width: 100%; height: 36px; margin-top: 4px; }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--s1); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--s1); opacity: .1; }
.spark-dot { fill: var(--s1); stroke: var(--surface); stroke-width: 1.5; }
.spark-empty { display: inline-block; width: 60px; height: 2px; background: var(--line); }

/* فهرست‌های ساده */
.plain-list, .learn-list, .trend-list { margin: 0; padding: 0; list-style: none; }
.plain-list li, .learn-list li, .trend-list li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.plain-list .muted, .learn-list .muted, .trend-list .muted { font-size: .84rem; }
.learn-list { counter-reset: l; }
.learn-list li { counter-increment: l; }
.learn-list li::before { content: counter(l, persian); color: var(--accent); font-weight: 800; min-width: 1.4em; }
.trend-list { columns: 2; column-gap: 32px; }
.trend-list li { break-inside: avoid; }

/* سرویس‌ها */
.side-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 8px; align-self: start; }
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-list li { display: grid; grid-template-columns: 24px 1fr auto; grid-template-areas: "s n u" "s t u"; column-gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.svc-list li:last-child { border-bottom: 0; }
.svc-list .svc-state { grid-area: s; }
.svc-list a { grid-area: n; font-weight: 650; color: var(--ink); text-decoration: none; }
.svc-list a:hover { color: var(--accent); }
.svc-type { grid-area: t; font-size: .78rem; color: var(--muted); }
.svc-up { grid-area: u; align-self: center; font-size: .88rem; color: var(--ink-2); }
.svc-state { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .72rem; font-weight: 800; margin-top: 4px; }
.svc-state.ok { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--pos); }
.svc-state.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--neg); }
.svc-state.unk { background: var(--surface-2); color: var(--muted); }
.profile-head .svc-state { width: auto; height: auto; border-radius: 999px; padding: 1px 10px; font-size: .8rem; margin: 0; }
.uptime { display: inline-flex; gap: 2px; align-items: end; height: 18px; vertical-align: middle; }
.uptime i { width: 3px; height: 16px; border-radius: 1px; background: var(--good); }
.uptime i.u-bad { background: var(--bad); height: 10px; }
.up-cell { min-width: 190px; }
.up-num { display: block; font-size: .78rem; color: var(--muted); }

.guide { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.guide-row { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: baseline; }
.guide-row:last-child { border-bottom: 0; }
.guide-row p { margin: 0; }
.guide-need { font-weight: 650; }
.guide-pick a { font-weight: 650; }

.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 20px; margin-block: 44px; }
.profile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 14px; scroll-margin-top: 130px; display: flex; flex-direction: column; }
.profile:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.profile-head h2 { margin: 0; font-size: 1.25rem; }
.profile-type { font-size: .78rem; color: var(--accent); background: var(--accent-soft); padding: 1px 10px; border-radius: 999px; font-weight: 650; }
.profile-sum { color: var(--ink-2); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.pros-cons h3 { font-size: .9rem; margin-bottom: 4px; }
.pros-cons ul { margin: 0; padding-inline-start: 18px; font-size: .88rem; color: var(--ink-2); }
.pros-cons li { margin-bottom: 4px; }
.pros li::marker { content: "+ "; color: var(--pos); font-weight: 800; }
.cons li::marker { content: "− "; color: var(--neg); font-weight: 800; }
.profile-src { margin-top: auto; padding-top: 10px; }
.profile .table-wrap { margin-bottom: 10px; }

.note-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 10px; }
.note-block ul { padding-inline-start: 20px; color: var(--ink-2); }
.note-block li { margin-bottom: 6px; }

/* کد */
.code { position: relative; background: #0d1b2b; border-radius: 10px; margin: 14px 0 18px; border: 1px solid #1d3048; }
.code pre { margin: 0; padding: 34px 16px 14px; overflow-x: auto; color: #d6e2ee; font-family: var(--mono); font-size: .86rem; line-height: 1.65; text-align: left; }
.code code { background: none; padding: 0; color: inherit; font-size: inherit; }
.code-lang { position: absolute; top: 7px; left: 14px; font-size: .7rem; color: #7f97b0; font-family: var(--mono); }
.copy { position: absolute; top: 6px; right: 8px; font: inherit; font-size: .75rem; background: #1a2d44; color: #cfe0f0; border: 1px solid #2a4260; border-radius: 6px; padding: 1px 10px; cursor: pointer; }
.copy:hover { background: #24405f; }

/* بازار */
.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); }
.timeline li { position: relative; padding: 6px 18px 10px; display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li.upcoming::before { background: var(--accent-2); border-color: var(--accent-2); }
.timeline time { color: var(--muted); font-size: .85rem; min-width: 120px; }
.src-link { font-size: .8rem; }
.big-figure { font-size: 2.25rem; font-weight: 750; margin: 0; }
.big-figure small { font-size: 1rem; color: var(--muted); font-weight: 500; }

/* نمودارها */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; margin-block: 28px; }
.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 10px; position: relative; }
.chart-head { display: grid; gap: 2px; margin-bottom: 8px; }
.chart-title { font-weight: 750; }
.chart-sub { font-size: .8rem; color: var(--muted); }
.chart-canvas { position: relative; width: 100%; }
.chart-canvas svg { display: block; width: 100%; overflow: visible; font-family: var(--font); direction: ltr; }
.chart-canvas text { fill: var(--muted); font-size: 11.5px; }
.chart-canvas .lbl { fill: var(--ink-2); font-size: 12px; }
.chart-canvas .val, .chart-canvas .lbl { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart-canvas .val { fill: var(--ink); font-size: 12px; font-weight: 650; }
.chart-canvas .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-canvas .axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart-canvas .line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-canvas .area { fill: var(--s1); opacity: .1; }
.chart-canvas .bar { fill: var(--s1); }
.chart-canvas .dot { stroke: var(--surface); stroke-width: 2; }
.chart-canvas .g-closed { fill: var(--s1); }
.chart-canvas .g-open { fill: var(--s2); }
.chart-canvas .hit { fill: transparent; cursor: crosshair; }
.chart-canvas .xhair { stroke: var(--line-strong); stroke-width: 1; }
.chart-canvas .end { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.ch-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); margin: 2px 0 6px; }
.ch-legend .g-closed-bg { background: var(--s1); }
.ch-legend .g-open-bg { background: var(--s2); }
.ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.ch-tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow); border-radius: 8px; padding: 6px 10px; font-size: .8rem; line-height: 1.6; white-space: nowrap; z-index: 5; opacity: 0; transition: opacity .1s; }
.ch-tip b { font-weight: 750; }
.chart-table { margin-top: 6px; font-size: .85rem; }
.chart-table summary { cursor: pointer; color: var(--muted); font-size: .8rem; }
.chart-table .table-wrap { margin-top: 8px; max-height: 300px; }
.chart-source { font-size: .76rem; color: var(--muted); margin: 6px 0 0; }

/* ماشین‌حساب‌ها */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 12px; scroll-margin-top: 130px; }
.calc .block-head { border: 0; padding: 0; margin-bottom: 10px; }
.calc-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; }
.calc-form .field { flex: 1 1 150px; }
.calc-form .field.grow { flex: 3 1 260px; }
.calc-out { margin: 14px 0 6px; padding: 14px 16px; background: var(--surface-2); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 10px 36px; align-items: baseline; }
.calc-out .co-main { font-size: 1.6rem; font-weight: 800; }
.calc-out .co-main small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.calc-out .co-sub { color: var(--ink-2); font-size: .92rem; }

/* اوپن‌مدل */
.labs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lab { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.lab h3 { font-size: .95rem; margin-bottom: 6px; }
.lab ul { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.lab li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.lab li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* آموزش */
.learn-index { list-style: none; margin: 0; padding: 0; counter-reset: li; display: grid; gap: 4px; max-width: 860px; }
.learn-index li { counter-increment: li; position: relative; padding: 18px 0 14px; padding-inline-start: 64px; border-bottom: 1px solid var(--line); }
.learn-index li::before { content: counter(li, persian); position: absolute; inset-inline-start: 0; top: 12px; font-size: 1.6rem; font-weight: 750; color: var(--accent); line-height: 1.4; }
.learn-index h3 { font-size: var(--fs-h3); margin: 0 0 4px; }
.learn-index a { color: var(--ink); text-decoration: none; }
.learn-index a:hover h3 { color: var(--accent); }
.learn-index p { margin: 0 0 4px; color: var(--ink-2); }
.article-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 130px; font-size: .88rem; border-inline-start: 2px solid var(--line); padding-inline-start: 14px; }
.toc-title { font-weight: 700; margin-bottom: 6px; }
.toc ol { margin: 0; padding-inline-start: 18px; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.prose { max-width: 70ch; font-size: 1.0625rem; line-height: 2; }
.prose h2 { margin-top: 1.8em; font-size: var(--fs-h2); scroll-margin-top: 130px; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-inline-start: 22px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 18px 0; padding: 10px 16px; border-inline-start: 3px solid var(--accent-2); background: var(--surface); border-radius: 0 8px 8px 0; color: var(--ink-2); }
.prose .table-wrap { margin: 16px 0; }
.next-article { margin-top: 40px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 650; max-width: 860px; }

.contact-card { background: var(--navy); color: var(--navy-ink); border-radius: var(--radius); padding: 26px 28px; max-width: 820px; }
.contact-card h2 { color: #fff; margin-bottom: 6px; }
.contact-mail { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.contact-mail a { color: #3fc1b8; text-decoration: none; }
.notfound { padding-block: 40px; }

/* پانویس */
.site-foot { background: var(--surface); border-top: 1px solid var(--line); padding-block: 36px 20px; font-size: .9rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1.2fr 1fr; gap: 32px; }
.foot-title { font-weight: 750; margin-bottom: 6px; }
.foot-tag { display: block; font-weight: 400; font-size: .88rem; color: var(--muted); }
.foot-grid p { margin-bottom: 6px; }
.foot-base { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; }
.email-pic { display: inline-block; color: var(--accent); line-height: 0; }
.email-pic svg { height: 22px; width: auto; display: block; }
.email-pic.big svg { height: 34px; }
.contact-card .email-pic { color: #3fc1b8; }
.email-png { height: 26px; width: auto; }
[data-theme="dark"] .email-png { filter: brightness(1.6); }
.email-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.btn.small { min-height: 34px; padding: 4px 14px; font-size: .85rem; }
.contact-card .btn.ghost { color: #3fc1b8; border-color: #3fc1b8; }
.contact-note { color: #9fb5cc; margin-top: 10px; }
.mail-line { margin-bottom: 10px; }

/* ── واکنش‌گرا ─────────────────────────── */
@media (max-width: 1080px) and (min-width: 721px) {
  .nav-toggle { display: grid; }
  .site-nav { display: none; position: absolute; top: 64px; inset-inline: 0; background: var(--navy); flex-direction: column; padding: 8px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 12px 24px rgba(0, 0, 0, .25); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 12px; font-size: 1rem; }
  .site-nav a[aria-current]::after { inset-inline: auto 0; top: 10px; bottom: 10px; width: 3px; height: auto; inset-inline-start: 0; }
  .head-row { position: relative; }
}
@media (max-width: 900px) {
  .home-grid, .home-grid.two, .news-layout, .article-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .news-layout aside { position: static; margin-top: 28px; }
  .toc { position: static; margin-bottom: 18px; }
  .foot-grid { grid-template-columns: 1fr; gap: 16px; }
  .guide-row { grid-template-columns: 1fr; gap: 2px; }
  .trend-list { columns: 1; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .wrap { padding-inline: 14px; }
  main { padding-top: 22px; }
  .brand-en { display: none; }
  .brand-tag { display: block; }
  .head-row { gap: 10px; }
  .pros-cons { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 0 0; }
  .facts dd { margin-bottom: 8px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px; }
  .tile-val { font-size: 1.15rem; }
  .learn-index li { padding-inline-start: 46px; }
  .learn-index li::before { font-size: 1.35rem; }
  .profile { padding: 18px 16px 12px; }
  .table-foot { flex-wrap: wrap; }
}
@media print {
  .site-head, .site-foot, .filters, .chips, .calc { display: none; }
  body { background: #fff; }
}


/* ════════ موبایل ════════ */
.tabbar, .sheet { display: none; }
@media (max-width: 720px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .site-head { position: relative; }
  .head-row { min-height: 56px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-fa { font-size: .95rem; }
  .nav-toggle, .site-nav { display: none !important; }
  .theme-toggle { margin-inline-start: auto; width: 38px; height: 38px; }
  .ticker { font-size: .78rem; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; min-height: 50px; justify-content: center;
    color: var(--muted); text-decoration: none; font: inherit; font-size: .7rem; font-weight: 600; background: none; border: 0; cursor: pointer; border-radius: 10px;
  }
  .tabbar svg, .sheet-grid svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar [aria-current], .tabbar .is-current, .tabbar [aria-expanded="true"] { color: var(--accent); }
  .tabbar [aria-current] svg, .tabbar .is-current svg { stroke-width: 2.1; }

  .sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(5, 12, 22, .45); }
  .sheet-panel {
    position: absolute; inset-inline: 0; bottom: 0; background: var(--surface); border-radius: 18px 18px 0 0;
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0, 0, 0, .2); animation: sheetUp .18s ease-out;
  }
  .sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 2px auto 14px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .sheet-grid a {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; background: var(--surface-2);
    color: var(--ink); text-decoration: none; font-size: .85rem; font-weight: 600; text-align: center;
  }
  .sheet-grid a[aria-current] { background: var(--accent-soft); color: var(--accent); }
  .sheet-close { display: block; width: 100%; margin-top: 12px; min-height: 46px; font: inherit; font-weight: 650; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
  body.sheet-open { overflow: hidden; }

  main { padding-top: 18px; }
  .page-head { margin-bottom: 18px; }
  :root { --fs-h1: 1.5rem; --fs-h2: 1.25rem; --fs-h3: 1.0625rem; --fs-lead: 1rem; }
  .lead { line-height: 1.9; }
  .block { margin-block: 30px; }
  .home-grid > .block { margin-top: 30px; }
  .block-head { padding-bottom: 8px; margin-bottom: 12px; }

  .hero-line { font-size: 1.25rem; line-height: 1.9; margin-bottom: 14px; }
  .hero-facts { font-size: .92rem; padding-inline-start: 12px; gap: 6px; }

  /* چیپ‌ها: یک ردیف لغزنده */
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-inline: -14px; padding-inline: 14px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; min-height: 38px; }
  .filter-row { gap: 10px; }
  .filter-row .field { flex: 1 1 45%; }
  .filter-row .field.grow { flex-basis: 100%; }
  .check { flex: 1 1 45%; font-size: .85rem; }
  .btn { min-height: 44px; }

  /* جدول‌های کارتی */
  .table-wrap:has(> .stack) { background: transparent; border: 0; border-radius: 0; overflow: visible; max-height: none; }
  .stack thead { display: none; }
  .stack, .stack tbody { display: block; }
  .stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
  .stack tr[hidden] { display: none; }
  .stack td { display: block; padding: 0; border: 0; min-width: 0; white-space: normal; }
  .stack td::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); font-weight: 500; margin-bottom: 1px; }
  .stack td:first-child, .stack td.num-col + td, .stack td.span-all { grid-column: 1 / -1; }
  .stack td:first-child::before, .stack td.num-col + td::before { content: none; }
  .stack td.num-col { position: absolute; top: 12px; inset-inline-end: 14px; width: auto; color: var(--accent); font-weight: 800; font-size: .9rem; }
  .stack td.num-col::before { content: "#"; display: inline; font-size: .9rem; color: var(--accent); }
  .stack td.num-col + td { padding-inline-end: 44px; }
  .stack tbody tr:hover td { background: none; }
  .stack .m-id { font-size: .7rem; }
  .stack .role { font-size: .78rem; }
  .stack .spark { width: 100%; max-width: 220px; }
  .stack td.wide { grid-column: 1 / -1; }

  .tiles { grid-template-columns: 1fr 1fr; }
  .tile-val { font-size: 1.1rem; }
  .chart { padding: 12px 10px 8px; }
  .chart-grid { gap: 14px; }
  .calc { padding: 14px; }
  .calc-form .field, .calc-form .field.grow { flex: 1 1 100%; }
  .calc-out .co-main { font-size: 1.35rem; }
  .side-block { margin-top: 30px; }
  .news-item { padding: 12px 0; }
  .news-title { font-size: .98rem; }
  .profile { padding: 16px 14px 10px; }
  .profile-head h2 { font-size: 1.12rem; }
  .guide-row { padding: 12px 14px; }
  .timeline time { min-width: 0; width: 100%; }
  .site-foot { padding-bottom: 16px; }
  .contact-card { padding: 20px 18px; }
  .email-pic.big svg { height: 26px; }
  .prose { font-size: 1rem; line-height: 1.95; }
  .code pre { font-size: .8rem; }
  .learn-index li { padding-inline-start: 46px; }
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel { animation: none; } }

/* مسیر آموزش، واژه‌نامه، ناوبری درس */
.track { margin-top: 34px; max-width: 860px; }
.track-head { display: grid; gap: 2px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.track-head h2 { margin: 0; font-size: var(--fs-h2); }
.track-head p { margin: 0; }
.lvl { display: inline-block; font-size: .74rem; font-weight: 700; padding: 0 8px; border-radius: 99px; margin-inline-end: 6px; border: 1px solid currentColor; }
.lvl-a { color: var(--accent); }
.lvl-b { color: var(--ink-2); }
.lvl-c { color: var(--ink); border-color: var(--accent-2); }
.glossary-card { display: grid; gap: 2px; max-width: 860px; margin-top: 18px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent-2); color: var(--ink); text-decoration: none; }
.glossary-card:hover { border-color: var(--accent); border-inline-start-color: var(--accent-2); }
.gc-title { font-weight: 800; font-size: 1.05rem; }
.gc-desc { color: var(--ink-2); font-size: .92rem; }
.toc-mobile { display: none; }
.toc-gloss { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }
.lesson-nav a { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; }
.lesson-nav a:hover { border-color: var(--accent); }
.lesson-nav a .fine { font-weight: 400; }
.lesson-nav .ln-next { text-align: left; grid-column: 2; }
.gloss-search { display: flex; max-width: 520px; margin: 8px 0 18px; }
.glossary { margin: 0; max-width: 860px; }
.g-item { padding: 14px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 130px; }
.g-item:target { background: var(--accent-soft); margin-inline: -12px; padding-inline: 12px; border-radius: 8px; }
.g-item dt { font-weight: 800; font-size: 1.05rem; }
.g-en { font-weight: 500; font-size: .86rem; color: var(--muted); margin-inline-start: 6px; }
.g-item dd { margin: 4px 0 0; color: var(--ink-2); line-height: 1.95; }
.g-item dd a { font-size: .9rem; }
@media (max-width: 900px) {
  .toc { display: none; }
  .toc-mobile { display: block; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .toc-mobile summary { padding: 10px 14px; font-weight: 700; cursor: pointer; }
  .toc-mobile ol { margin: 0; padding: 0 34px 12px 14px; }
  .toc-mobile li { margin-bottom: 6px; }
  .toc-mobile a { color: var(--ink-2); text-decoration: none; }
}
@media (max-width: 720px) {
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-nav .ln-next { grid-column: 1; }
  .track { margin-top: 26px; }
}
