/* =====================================================
   دیگ و دم — Design System
   Warm Premium Editorial · RTL · fa-IR
   Palette: lacquer red #A6242B · cream #FAF6EB · warm charcoal
   ===================================================== */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/Vazirmatn-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Estedad";
  src: url("/assets/fonts/Estedad-var-arabic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
}
@font-face {
  font-family: "Estedad";
  src: url("/assets/fonts/Estedad-var-latin.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F;
}

/* ---------- Tokens ---------- */
:root {
  --c-bg: #faf6eb;
  --c-surface: #ffffff;
  --c-surface-warm: #f5efdf;
  --c-ink: #2b211b;
  --c-ink-soft: #56493f;
  --c-ink-mute: #6e6257;
  --c-brand: #a6242b;
  --c-brand-deep: #7c161d;
  --c-brand-dark: #47080c;
  --c-brand-tint: #f7e8e0;
  --c-gold: #b98d44;
  --c-gold-text: #8a6526;
  --c-warn: #b3541e;
  --c-warn-text: #9a4517;
  --c-warn-bg: #fdf6f0;
  --c-line-strong: #998565;
  --c-brand-bright: #b32b31;
  --c-footer-ink: #e9ddcf;
  --c-footer-link: #f0e6d8;
  --c-footer-soft: #cbbcae;
  --c-footer-mute: #b7a698;
  --c-gold-soft: #e9dcbf;
  --c-line: #e7ddc9;
  --c-line-soft: #efe7d6;
  --c-cream-soft: #fdfbf3;
  --c-success: #256a4d;
  --c-success-tint: #e5f1ea;

  --font-body: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --font-head: "Estedad", "Vazirmatn", Tahoma, sans-serif;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --shadow-s: 0 1px 3px rgb(60 35 20 / 0.08);
  --shadow-m: 0 6px 24px -6px rgb(60 35 20 / 0.14);

  --w-content: 74rem;
  --w-prose: 46rem;
  --w-wide: 62rem;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.9;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--c-brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--c-brand-deep); }
:focus-visible {
  outline: 3px solid var(--c-gold-text);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--c-brand); color: #fff; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.45;
  color: var(--c-ink);
  text-wrap: balance;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 850; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.8rem); font-weight: 780; margin-top: 2em; }
h3 { font-size: clamp(1.13rem, 1rem + 0.6vw, 1.35rem); font-weight: 700; margin-top: 1.6em; }
p { margin: 0 0 1.15em; }
ul, ol { padding-inline-start: 1.4em; margin: 0 0 1.2em; }
li { margin-bottom: 0.45em; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--c-line); margin: 2.5rem 0; }
blockquote {
  margin: 1.6em 0;
  padding: 0.9em 1.3em;
  border-inline-start: 4px solid var(--c-gold);
  background: var(--c-surface-warm);
  border-radius: var(--radius-s);
  color: var(--c-ink-soft);
}
code { font-family: ui-monospace, monospace; font-size: 0.9em; background: var(--c-surface-warm); padding: 0.1em 0.4em; border-radius: 4px; }

.container { max-width: var(--w-content); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.prose { max-width: var(--w-prose); }

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--c-brand);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-s);
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-bg);
  background: color-mix(in srgb, var(--c-bg) 97%, var(--c-ink));
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-height: 4.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--c-ink);
  font-family: var(--font-head);
  flex-shrink: 0;
}
.brand__logo { width: 43px; height: 45px; }
.brand__name { font-size: 1.35rem; font-weight: 850; line-height: 1.1; color: var(--c-brand); }
.brand__tag { display: block; font-family: var(--font-body); font-size: 0.67rem; font-weight: 500; color: var(--c-ink-mute); letter-spacing: 0; }

.nav-toggle-input { display: none; }
.nav-toggle {
  display: none;
  flex-shrink: 0;
  margin-inline-start: auto;
  cursor: pointer;
  padding: 0.55rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  line-height: 0;
}
.nav-toggle svg { width: 22px; height: 22px; max-width: none; flex-shrink: 0; stroke: var(--c-ink); }
.nav-toggle .i-close { display: none; }

.site-nav { display: flex; align-items: center; gap: 0.2rem; margin-inline-start: auto; }
.site-nav a {
  text-decoration: none;
  color: var(--c-ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-s);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--c-brand); background: var(--c-brand-tint); }
.site-nav a.btn { margin-inline-start: 0.5rem; padding: 0.5rem 1.15rem; font-size: 0.92rem; min-height: 40px; line-height: 1.7; color: #fff; background: var(--c-brand); }
.site-nav a.btn:hover { background: var(--c-brand-deep); color: #fff; }
.btn:focus-visible, .site-nav a.btn:focus-visible { outline-color: #fff; }

@media (max-width: 68rem) {
  .nav-toggle-input { display: block; position: absolute; opacity: 0; pointer-events: none; }
  .nav-toggle-input:focus-visible ~ .nav-toggle { outline: 3px solid var(--c-gold-text); outline-offset: 2px; }
  .nav-toggle { display: inline-flex; }
  .brand { flex-shrink: 1; min-width: 0; }
  .brand > span { min-width: 0; }
  .brand__tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .site-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-line);
    padding: 0.8rem clamp(1rem, 4vw, 2rem) 1.2rem;
    box-shadow: var(--shadow-m);
    max-height: calc(100vh - 4.25rem);
    max-height: calc(100dvh - 4.25rem);
    overflow-y: auto;
  }
  .site-nav a { padding: 0.7rem 0.8rem; font-size: 1.02rem; }
  .site-nav a.btn { margin: 0.6rem 0 0; text-align: center; }
  .nav-toggle-input:checked ~ .site-nav { display: flex; }
  .nav-toggle-input:checked ~ .nav-toggle .i-menu { display: none; }
  .nav-toggle-input:checked ~ .nav-toggle .i-close { display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  border: 2px solid transparent;
  background: var(--c-brand);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--c-brand-deep); color: #fff; }
.btn:focus-visible, .site-nav a.btn:focus-visible { outline-color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; border-color: var(--c-brand); color: var(--c-brand); }
.btn--ghost:hover { background: var(--c-brand-tint); color: var(--c-brand-deep); }
.btn--light { background: var(--c-surface-warm); color: var(--c-brand-deep); }
.btn--light:hover { background: #fff; color: var(--c-brand); }
.btn--lg { padding: 0.9rem 2rem; font-size: 1.1rem; }
.btn svg { width: 1.15em; height: 1.15em; }

/* ---------- Chips / meta ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--c-brand-tint);
  color: var(--c-brand-deep);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.18rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
}
a.chip:hover { background: var(--c-brand); color: #fff; }
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.1rem;
  color: var(--c-ink-mute);
  font-size: 0.88rem;
}
.meta-row svg { width: 1em; height: 1em; vertical-align: -0.12em; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
  gap: 1.3rem;
}
.card-grid--few { grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr)); max-width: 46rem; margin-inline: auto; }
.card-grid--few .card__media { aspect-ratio: auto; min-height: 0; height: clamp(8rem, 22vw, 11rem); }
.card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-s);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-m); transform: translateY(-3px); }
.card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 7.5;
  background:
    radial-gradient(circle at 78% 20%, rgb(255 255 255 / 0.5), transparent 42%),
    linear-gradient(150deg, var(--c-surface-warm), var(--c-gold-soft));
}
.card__media svg { width: 3.4rem; height: 3.4rem; color: var(--c-brand); opacity: 0.9; }
.card__media--brand {
  background:
    radial-gradient(circle at 78% 18%, rgb(255 255 255 / 0.14), transparent 45%),
    linear-gradient(150deg, var(--c-brand), var(--c-brand-deep));
}
.card__media--brand svg { color: var(--c-surface-warm); }
.card__body { padding: 1.1rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.card__title { font-size: 1.08rem; font-weight: 780; margin: 0; line-height: 1.55; }
.card__title a { color: var(--c-ink); text-decoration: none; }
.card__title a:hover { color: var(--c-brand); }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card__excerpt { color: var(--c-ink-mute); font-size: 0.92rem; margin: 0; line-height: 1.8; }
.card__body .meta-row { margin-top: auto; padding-top: 0.4rem; }
.card__body .chip { position: relative; z-index: 1; align-self: flex-start; }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 130%, rgb(166 36 43 / 0.09), transparent 55%),
    repeating-conic-gradient(from 0deg at 50% 115%, rgb(166 36 43 / 0.045) 0deg 4deg, transparent 4deg 12deg),
    var(--c-bg);
  border-bottom: 1px solid var(--c-line);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
.hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.8vw, 3.1rem); font-weight: 900; margin-bottom: 0.5em; }
.hero h1 em { font-style: normal; color: var(--c-brand); }
.hero__lead { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem); color: var(--c-ink-soft); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.hero__art { display: flex; justify-content: center; }
.hero__art svg, .hero__art img { height: auto; }
@media (max-width: 52rem) {
  .hero__inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero__art { order: -1; }
  .brand-badge svg { width: min(11rem, 46vw); }
}

/* ---------- Brand badge ---------- */
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border-radius: 30px;
  background:
    repeating-conic-gradient(from 0deg at 50% 54%, rgb(255 255 255 / 0.05) 0deg 5deg, transparent 5deg 10deg),
    radial-gradient(circle at 50% 40%, var(--c-brand-bright), var(--c-brand) 70%);
  box-shadow: 0 22px 44px -14px rgb(124 22 29 / 0.45);
}
.brand-badge svg { width: min(15rem, 48vw); height: auto; display: block; }

/* ---------- Trust bar / stats ---------- */
.stat-band { border-block: 1px solid var(--c-line); background: var(--c-surface); }
.stat-band__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  padding-block: 1.6rem;
  text-align: center;
}
.stat__num { font-family: var(--font-head); font-size: 1.7rem; font-weight: 850; color: var(--c-brand); display: block; line-height: 1.3; }
.stat__label { color: var(--c-ink-mute); font-size: 0.9rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(2.6rem, 6vw, 4.5rem); }
.section--alt { background: var(--c-surface); border-block: 1px solid var(--c-line-soft); }
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.8rem;
}
.section__head h2 { margin: 0; }
.section__head .more { font-weight: 700; font-size: 0.95rem; text-decoration: none; white-space: nowrap; }
.section__head .more:hover { text-decoration: underline; }
.section__kicker {
  display: block;
  color: var(--c-gold-text);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0;
  margin-bottom: 0.35rem;
}

/* ---------- Answer / note boxes ---------- */
.answer-box, .note-box, .warn-box, .exp-box {
  border-radius: var(--radius-m);
  padding: 1.1rem 1.4rem;
  margin: 1.6rem 0;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
}
.answer-box {
  border-inline-start: 5px solid var(--c-brand);
  background: linear-gradient(180deg, var(--c-brand-tint), var(--c-surface) 130%);
}
.answer-box__label, .box-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--c-brand-deep);
  margin-bottom: 0.4rem;
}
.answer-box p:last-child, .note-box p:last-child, .warn-box p:last-child { margin-bottom: 0; }
.note-box { border-inline-start: 5px solid var(--c-gold); background: var(--c-cream-soft); }
.note-box .box-label { color: var(--c-gold-text); }
.warn-box { border-inline-start: 5px solid var(--c-warn); background: var(--c-warn-bg); }
.warn-box .box-label { color: var(--c-warn-text); }
.exp-box { border: 1px dashed var(--c-gold); background: var(--c-cream-soft); }
.exp-box .box-label { color: var(--c-gold-text); }

/* ---------- CTA banner (in-article & sections) ---------- */
.container > .cta-banner { max-width: var(--w-wide); margin-inline: auto; }
.cta-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  background:
    radial-gradient(circle at 85% 0%, rgb(255 255 255 / 0.12), transparent 45%),
    linear-gradient(140deg, var(--c-brand) 0%, var(--c-brand-deep) 100%);
  color: #fff;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  margin: 2.4rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}
.cta-banner__text { max-width: 34em; }
.cta-banner__title { font-family: var(--font-head); font-weight: 850; font-size: 1.3rem; margin: 0 0 0.35em; color: #fff; }
.cta-banner p { margin: 0; color: rgb(255 255 255 / 0.88); font-size: 0.97rem; }
.cta-banner__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.cta-banner .phone-link { color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; direction: ltr; unicode-bidi: isolate; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  background: var(--c-surface);
  box-shadow: var(--shadow-s);
  margin: 1.6rem 0;
}
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 34rem; }
.table-title {
  font-weight: 800;
  font-family: var(--font-head);
  margin: 1.6rem 0 0;
}
.table-title + .table-wrap { margin-top: 0.6rem; }
th, td { padding: 0.7rem 1.1rem; text-align: start; border-bottom: 1px solid var(--c-line-soft); vertical-align: top; }
thead th {
  background: var(--c-brand-dark);
  color: var(--c-surface-warm);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--c-cream-soft); }
td strong { color: var(--c-brand-deep); }
@media (max-width: 48rem) {
  .table-wrap.has-scroll::before {
    content: "برای دیدن همه ستون‌ها، جدول را بکشید ⟵";
    display: block;
    position: sticky;
    inset-inline-start: 0;
    font-size: 0.76rem;
    color: var(--c-ink-mute);
    padding: 0.45rem 1.1rem 0;
  }
}
.table-note { font-size: 0.85rem; color: var(--c-ink-mute); margin-top: -0.9rem; margin-bottom: 1.6rem; }

/* ---------- FAQ ---------- */
.faq { margin: 1.5rem 0; }
.faq details {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  margin-bottom: 0.7rem;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 0.95rem 1.2rem;
  font-weight: 750;
  font-family: var(--font-head);
  font-size: 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--c-brand);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details[open] summary { border-bottom: 1px solid var(--c-line-soft); }
.faq .faq__a { padding: 0.9rem 1.2rem; }
.faq .faq__a p:last-child { margin-bottom: 0; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 0.85rem; color: var(--c-ink-mute); margin: 1.2rem auto 0.2rem; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.breadcrumbs li { margin: 0; display: flex; align-items: center; gap: 0.25rem; }
.breadcrumbs li:not(:last-child)::after { content: "‹"; color: var(--c-gold); font-weight: 700; }
.breadcrumbs a { color: var(--c-ink-mute); text-decoration: none; }
.breadcrumbs a:hover { color: var(--c-brand); }
.breadcrumbs [aria-current] { color: var(--c-ink-soft); font-weight: 600; }

/* ---------- Article ---------- */
.article-head { padding-top: 0.6rem; }
.article-head .chip { margin-bottom: 0.9rem; }
.article-head h1 { margin-bottom: 0.45em; }
.article-head .dek { font-size: 1.13rem; color: var(--c-ink-soft); max-width: 40em; margin-bottom: 1.1rem; }
.article-head .meta-row { padding-bottom: 1.4rem; border-bottom: 1px solid var(--c-line); margin-bottom: 0.4rem; }
.article-head { max-width: var(--w-wide); margin-inline: auto; }
.article-head--center { text-align: center; }
.article-body { padding-block: 1rem 2rem; }
.article-body { display: grid; grid-template-columns: 1fr min(var(--w-prose), 100%) 1fr; }
.article-body > * { grid-column: 2; min-width: 0; }
.article-body > .table-wrap,
.article-body > .cta-banner,
.article-body > .compare-grid,
.article-body > .card-grid,
.article-body > figure,
.article-body > .calc,
.article-body > .plan-scroll,
.article-body > section {
  grid-column: 1 / -1;
  width: min(100%, var(--w-wide));
  margin-inline: auto;
}
.article-body h2 {
  scroll-margin-top: 6rem;
  padding-top: 0.6em;
  border-top: 1px solid var(--c-line-soft);
}
.article-body h2:first-child { border-top: 0; padding-top: 0; }
.article-body img { border-radius: var(--radius-m); }
.article-body ol:not(.steps), .faq__a ol { list-style-type: persian; }
.update-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--c-success-tint);
  color: var(--c-success);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
}


/* ---------- Article shell + TOC rail ---------- */
.article-shell { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 80rem) {
  .article-shell--toc { grid-template-columns: 15rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .article-shell > .article-main { min-width: 0; }
}
.toc-rail { display: none; }
@media (min-width: 80rem) {
  .toc-rail {
    display: block;
    position: sticky;
    top: 6rem;
    font-size: 0.88rem;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-m);
    padding: 1rem 1.2rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
  }
  .toc-rail__title { font-family: var(--font-head); font-weight: 800; margin-bottom: 0.6rem; color: var(--c-ink-soft); }
  .toc-rail ol { list-style: none; padding: 0; margin: 0; }
  .toc-rail li { margin-bottom: 0.45em; }
  .toc-rail a { color: var(--c-ink-mute); text-decoration: none; display: block; line-height: 1.6; }
  .toc-rail a:hover { color: var(--c-brand); }
}

/* ---------- Author box ---------- */
.author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-l);
  padding: 1.2rem 1.4rem;
  margin: 2.2rem 0;
}
.author-box__avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--c-brand-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.author-box__avatar svg { width: 30px; height: 30px; color: var(--c-brand); }
.author-box__name { font-weight: 800; font-family: var(--font-head); }
.author-box p { margin: 0.2em 0 0; font-size: 0.92rem; color: var(--c-ink-mute); }

/* ---------- Sources / footnotes ---------- */
.sources {
  font-size: 0.9rem;
  color: var(--c-ink-mute);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  padding: 1.1rem 1.4rem;
  margin: 2rem 0;
}
.sources__title { font-weight: 800; color: var(--c-ink-soft); margin-bottom: 0.5rem; font-family: var(--font-head); }
.sources ol { margin: 0; list-style-type: persian; }
.sources a { overflow-wrap: anywhere; }

/* ---------- Forms ---------- */
.form-card {
  margin-inline: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-l);
  padding: clamp(1.4rem, 4vw, 2.2rem);
  box-shadow: var(--shadow-m);
}
.form-grid { display: grid; gap: 1rem; }
.field label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--c-ink);
  background: var(--c-bg);
  border: 1.5px solid var(--c-line-strong);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  min-height: 48px;
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-tint);
}
.field input[type="tel"], .field input[type="email"] { direction: ltr; text-align: end; }
.field .hint { font-size: 0.82rem; color: var(--c-ink-mute); margin-top: 0.25rem; }
.field ::placeholder { color: var(--c-ink-mute); opacity: 1; }
.hint--warn { color: var(--c-warn-text); font-weight: 600; }
.form-fallback-note {
  display: none;
  border: 1.5px solid var(--c-gold);
  background: var(--c-cream-soft);
  border-radius: var(--radius-s);
  padding: 0.8rem 1.1rem;
  font-size: 0.95rem;
}
.form-fallback-note.show { display: block; }
.form-note { font-size: 0.85rem; color: var(--c-ink-mute); }

/* ---------- Calculator ---------- */
.calc {
  max-width: var(--w-wide);
  margin-inline: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-m);
  overflow: hidden;
  margin: 2rem 0;
}
.calc__head { background: var(--c-brand-dark); color: var(--c-surface-warm); padding: 1.1rem 1.5rem; }
.calc__head h2 { color: inherit; margin: 0; font-size: 1.2rem; border: 0 !important; padding: 0 !important; }
.calc__body { padding: clamp(1.2rem, 3.5vw, 2rem); display: grid; gap: 1.1rem; }
.calc__row { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.calc__result {
  border-top: 2px dashed var(--c-line);
  padding: 1.3rem clamp(1.2rem, 3.5vw, 2rem);
  background: var(--c-cream-soft);
}
.calc__total { font-family: var(--font-head); font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 900; color: var(--c-brand-deep); }
.calc__result table { min-width: 0; }
@media (max-width: 48rem) {
  .calc__result th, .calc__result td { padding: 0.55rem 0.65rem; font-size: 0.88rem; }
}
.calc__disclaimer { font-size: 0.83rem; color: var(--c-ink-mute); margin-top: 0.8rem; }

/* ---------- Plan diagrams ---------- */
.plan-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 48rem) {
  .plan-scroll::before {
    content: "برای دیدن کل پلان، آن را بکشید ⟵";
    display: block;
    position: sticky;
    inset-inline-start: 0;
    font-size: 0.76rem;
    color: var(--c-ink-mute);
    padding: 0.35rem 0.4rem 0.2rem;
  }
}
.plan-scroll svg { min-width: 700px; display: block; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.6rem 0; display: grid; gap: 1rem; }
.steps > li {
  counter-increment: step;
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  padding: 1rem 3.6rem 1rem 1.2rem;
}
.steps > li::before {
  content: counter(step, persian);
  position: absolute;
  inset-inline-start: 0.9rem;
  top: 0.9rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-brand);
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  font-family: var(--font-head);
}
.steps > li strong:first-child { display: block; font-family: var(--font-head); margin-bottom: 0.2em; }

/* ---------- Compare grid ---------- */
.compare-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.6rem 0; }
.compare-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: 1.2rem 1.3rem; }
.compare-card h3, .compare-card h4 { margin-top: 0; }
.compare-card ul { margin-bottom: 0; font-size: 0.93rem; }
.pros li::marker { content: "✓ "; color: var(--c-success); }
.cons li::marker { content: "✗ "; color: var(--c-brand); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  background: var(--c-brand-dark);
  color: var(--c-footer-ink);
  font-size: 0.93rem;
}
.site-footer a { color: var(--c-footer-link); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__main {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 2.5rem;
  padding-block: 3rem 2rem;
}
@media (max-width: 56rem) { .site-footer__main { grid-template-columns: 1fr 1fr; } }
@media (max-width: 34rem) { .site-footer__main { grid-template-columns: 1fr; } }
.site-footer h2, .site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 0.9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.45em; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem; }
.footer-brand svg { width: 40px; height: 42px; }
.footer-brand__name { font-family: var(--font-head); font-weight: 850; font-size: 1.25rem; color: #fff; }
.footer-about { color: var(--c-footer-soft); line-height: 1.9; max-width: 30em; }
.site-footer__bottom {
  border-top: 1px solid rgb(255 255 255 / 0.12);
  padding-block: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  color: var(--c-footer-mute);
  font-size: 0.85rem;
}
.footer-phone { direction: ltr; unicode-bidi: isolate; font-weight: 700; }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.ltr { direction: ltr; unicode-bidi: isolate; }
.phone-big {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--c-brand-deep);
  direction: ltr;
  unicode-bidi: isolate;
  text-decoration: none;
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .cta-banner, .nav-toggle, .hero__actions, .breadcrumbs { display: none !important; }
  body { background: #fff; }
  a { color: inherit; text-decoration: none; }
  .table-wrap { overflow: visible; box-shadow: none; border-color: #999; }
  .table-wrap::before { display: none; }
  table { min-width: 0; }
  thead th { background: #fff !important; color: #000 !important; border-bottom: 2px solid #000; }
  tbody tr:nth-child(even) { background: #fff; }
  .card, .form-card, details { break-inside: avoid; }
}
