/* عهدورز — اجزای سیستم طراحی، جهت «سکوت» (نسخه ۲)
   همه رنگ‌ها و اندازه‌ها از tokens.css. پیشوند av- برای همه کلاس‌ها.
   اصل‌ها: یک شیء قهرمان در هر صفحه، خط مو به جای جعبه، وزن نازک برای تیتر،
   برنج مات تنها رنگ تأکید، شیشه فقط برای لایه شناور. */

/* ---------- پایه ---------- */

.av-root {
  direction: rtl;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}
/* :where تا این پیش‌فرض‌ها هیچ‌وقت بر رنگ اجزا غلبه نکنند */
:where(.av-root) :where(p, h1, h2, h3, figure, blockquote) { margin: 0; }
:where(.av-root) :where(button) { font: inherit; color: inherit; }
.av-root :focus-visible { outline: var(--stroke-focus) solid var(--focus-ring); outline-offset: 4px; }

/* دانه فیلم: بافت ریز شب و کاغذ، همیشه زیر محتوا */
.av-root::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] .av-root::before, .av-root[data-theme="light"]::before { opacity: .05; mix-blend-mode: multiply; }

/* نور زمانِ روز پشت صفحه: سحر، شب، مغرب */
.av-tint { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.av-tint--dawn { background: radial-gradient(120% 34% at 50% 104%, rgba(196, 150, 104, .14), transparent 70%), radial-gradient(90% 40% at 50% -8%, rgba(110, 130, 180, .13), transparent 70%); }
.av-tint--night { background: radial-gradient(70% 30% at 80% -6%, rgba(120, 160, 170, .13), transparent 70%); }
.av-tint--maghrib { background: radial-gradient(110% 40% at 50% 108%, rgba(200, 115, 95, .14), transparent 70%), radial-gradient(80% 30% at 50% -6%, rgba(120, 110, 170, .12), transparent 70%); }

.av-icon { width: var(--size-icon); height: var(--size-icon); fill: none; stroke: currentColor; stroke-width: var(--stroke-icon); stroke-linecap: round; stroke-linejoin: round; flex: none; }
.av-hair { height: 1px; border: 0; margin: 0; background: var(--line); }
.av-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.av-muted { color: var(--ink-2); }
.av-faint { color: var(--ink-3); }
.av-center { text-align: center; }
.av-brass { color: var(--brass); }

/* ---------- نشانه و سربرگ ---------- */

.av-brand { display: inline-flex; align-items: center; gap: var(--space-2); }
.av-brand__mark { width: 20px; height: 20px; color: var(--brass); }
.av-brand__name { font-family: var(--font-label); font-weight: 600; font-size: 16px; line-height: 24px; }

.av-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.av-head__title { font-size: 26px; line-height: 38px; font-weight: 600; }
.av-head__sub { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-2); }

.av-iconbtn {
  width: var(--size-iconbtn); height: var(--size-iconbtn); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-pill);
  background: var(--surface-strong); color: var(--ink-2); cursor: pointer;
}
.av-iconbtn:hover { color: var(--ink); }

/* ---------- دکمه‌ها ---------- */

.av-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--size-control); padding: 0 var(--space-6);
  border: 0; border-radius: var(--radius-pill);
  font-size: 16px; font-weight: 600; line-height: 24px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: opacity .15s ease-out;
}
.av-btn:disabled { opacity: .45; cursor: default; }
.av-btn--primary { background: var(--primary); color: var(--on-primary); }
.av-btn--secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); font-weight: 500; }
.av-btn--quiet { background: transparent; color: var(--ink-2); min-height: var(--size-touch); padding: 0 var(--space-3); font-weight: 500; font-size: 15px; }
.av-btn--danger { background: transparent; color: var(--critical); box-shadow: inset 0 0 0 1px currentColor; font-weight: 500; }
.av-btn--block { width: 100%; }

/* پیوند آرام با فلش رو به جلو (در راست‌به‌چپ، چپ) */
.av-link { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
.av-link .av-icon { width: 14px; height: 14px; }

.av-chip {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  border: 0; border-radius: var(--radius-pill); background: transparent;
  box-shadow: inset 0 0 0 1px rgba(237, 232, 223, .12); color: var(--ink-2);
  font-size: 14px; text-decoration: none; cursor: pointer;
}
[data-theme="light"] .av-chip { box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------- ردیف، گزینه، فیلد ---------- */

/* ردیف فهرست با خط مو؛ پرسش‌های پیشنهادی، تنظیمات */
.av-list-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 13px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 15px; line-height: 21px;
}
.av-list-row > .av-icon { width: 16px; height: 16px; color: var(--ink-3); }

/* گزینه رادیویی به شکل ردیف؛ دایره برنجی برای انتخاب‌شده */
.av-choice { display: flex; align-items: center; gap: var(--space-4); padding: 16px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.av-choice:first-of-type { border-top: 1px solid var(--line); }
.av-choice input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; order: 2; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); display: grid; place-items: center; cursor: pointer; }
.av-choice input::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brass-hi); transform: scale(0); transition: transform .15s ease-out; }
.av-choice input:checked { box-shadow: inset 0 0 0 1px var(--brass); }
.av-choice input:checked::after { transform: scale(1); }
.av-choice input:disabled { opacity: .4; }
.av-choice__body { flex: 1; display: flex; flex-direction: column; }
.av-choice__title { font-size: 16px; line-height: 26px; font-weight: 600; }
.av-choice__desc { font-size: 13px; line-height: 20px; color: var(--ink-2); }

.av-field { display: flex; flex-direction: column; gap: 6px; }
.av-field__label { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-2); }
.av-field__hint { font-size: 12px; line-height: 18px; color: var(--ink-3); }
.av-input {
  height: var(--size-control); padding: 0 var(--space-4);
  border: 0; border-radius: var(--radius-md);
  background: var(--field); box-shadow: var(--line-ring);
  color: var(--ink); font: inherit; font-size: 16px;
}
.av-input:focus { outline: var(--stroke-focus) solid var(--focus-ring); outline-offset: 2px; }
select.av-input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: 22px 50%, 17px 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 40px; }
select.av-input option { background: var(--bg); color: var(--ink); }

/* ---------- کارت و یادداشت ---------- */

.av-card { padding: var(--space-4) 18px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--line-ring); display: flex; flex-direction: column; gap: var(--space-2); }
.av-card__title { font-size: 18px; line-height: 30px; font-weight: 600; }

.av-eyebrow { font-family: var(--font-label); font-size: 12px; line-height: 20px; font-weight: 500; color: var(--brass); }

.av-badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; }
.av-badge--verified { color: var(--positive); box-shadow: inset 0 0 0 1px currentColor; }
.av-badge--check { color: var(--caution); background: var(--caution-soft); }

.av-notice { display: flex; gap: var(--space-3); align-items: flex-start; color: var(--ink-2); }
.av-notice > .av-icon { width: 18px; height: 18px; margin-top: 2px; color: var(--ink-3); }
.av-notice__title { font-size: 14px; line-height: 22px; font-weight: 600; color: var(--ink); }
.av-notice__text { font-size: 13px; line-height: 21px; }
.av-notice--caution { padding: var(--space-4); border-radius: var(--radius-md); background: var(--caution-soft); }
.av-notice--caution > .av-icon, .av-notice--caution .av-notice__title { color: var(--caution); }

/* ---------- قهرمان شروع: پنجره طاقی رو به سحر (SVG در صفحه) ---------- */

.av-arch { display: block; margin: 0 auto; width: 216px; height: 270px; }
.av-hero-line { font-family: var(--font-hero); font-size: 30px; line-height: 64px; font-weight: 400; text-align: center; }

/* ---------- خاتم چله: هشت‌ضلعی، ۸ × ۵ = ۴۰ خط، پادساعتگرد از بالا ---------- */

.av-dial { position: relative; width: var(--size-dial); height: var(--size-dial); margin: 0 auto; --p: 0; }
.av-dial > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.av-dial__tick { stroke: var(--ink-4); stroke-width: 2; stroke-linecap: round; }
.av-dial__tick--on { stroke: var(--brass); }
.av-dial__next { fill: var(--brass-hi); animation: av-breathe var(--motion-breathe) ease-in-out infinite; }
.av-dial__khatam { fill: none; stroke: rgba(194, 162, 107, .16); stroke-width: 1; }
.av-dial__base { fill: none; stroke: rgba(237, 232, 223, .06); stroke-width: 1; }
.av-dial__run { fill: none; stroke: var(--brass-hi); stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p)); filter: drop-shadow(0 0 4px rgba(222, 194, 142, .7)); }
.av-dial__core {
  position: absolute; inset: 20.6%; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.av-dial__core:disabled { cursor: default; }
.av-dial__num { font-size: 100px; line-height: 1; font-weight: 200; font-feature-settings: "tnum"; }
.av-dial__label { margin-top: 4px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-2); }
.av-dial--done .av-dial__tick { stroke: var(--brass); }

/* ---------- خورشید امروز: منحنی ارتفاع خورشید و پنج وقت ---------- */

.av-sun { display: block; width: 100%; height: auto; }
.av-times { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; }
.av-times li { display: flex; flex-direction: column; gap: 1px; }
.av-times span { font-size: 11.5px; line-height: 18px; color: var(--ink-3); }
.av-times b { font-size: 15px; line-height: 22px; font-weight: 300; color: var(--ink-2); font-feature-settings: "tnum"; }
.av-times .is-past b { color: var(--ink-3); }
.av-times .is-next span { color: var(--brass-hi); }
.av-times .is-next b { color: var(--ink); font-weight: 400; }

/* ---------- ماه تا نیمه شعبان: دانه‌های ماه، هر شب یکی ---------- */

.av-moonbeads { display: block; width: 100%; height: 22px; }
.av-moonbeads__caption { margin-top: 8px; text-align: center; font-size: 12px; line-height: 18px; color: var(--ink-3); }
.av-moonbeads__caption b { font-weight: 500; color: var(--ink-2); }

/* ---------- رهنما: اسطرلاب، گفتگو، منبع ---------- */

.av-astrolabe { display: block; margin: 0 auto; width: var(--size-astrolabe); height: var(--size-astrolabe); overflow: visible; }
.av-astrolabe--mini { width: 22px; height: 22px; margin: 0; }

.av-bubble { align-self: flex-start; max-width: 86%; padding: 12px 18px; border-radius: 22px 22px 6px 22px; background: var(--surface-strong); box-shadow: inset 0 .5px 0 rgba(255, 255, 255, .08); font-size: 16px; line-height: 27px; }
[dir="ltr"] .av-bubble { border-radius: 22px 22px 22px 6px; }
.av-speaker { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; line-height: 20px; font-weight: 500; }
.av-speaker__meta { color: var(--ink-3); }

.av-source { margin: 0; padding: 14px 18px 16px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--line-ring); }
.av-source__ref { font-family: var(--font-label); font-size: 11.5px; line-height: 20px; color: var(--brass); }
.av-source blockquote { margin: 8px 0 0; font-family: var(--font-sacred); font-size: 18.5px; line-height: 36px; color: var(--sacred); }

.av-ask {
  height: var(--size-control); flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px; padding-inline-start: var(--space-5);
  border-radius: var(--radius-pill); background: var(--field); box-shadow: var(--line-ring);
}
.av-ask input, .av-ask__placeholder { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; }
.av-ask input::placeholder, .av-ask__placeholder { color: var(--ink-3); }
.av-ask input:focus { outline: none; }
.av-ask__send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.av-ask__send .av-icon { width: 18px; height: 18px; }

/* ---------- فهرست گام‌ها و زبانه‌های متنی ---------- */

.av-steps { list-style: none; margin: 0; padding: 0; }
.av-steps li { display: grid; grid-template-columns: 18px auto 1fr; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 22px; }
.av-steps li:first-child { border-top: 1px solid var(--line); }
.av-steps b { font-family: var(--font-label); font-weight: 500; font-size: 12px; color: var(--brass); }
.av-steps em { font-style: normal; font-size: 13px; color: var(--ink-3); text-align: end; }

.av-seg { display: flex; gap: 26px; }
.av-seg button { position: relative; border: 0; background: none; padding: 6px 0 10px; font: inherit; font-size: 15px; color: var(--ink-3); cursor: pointer; }
.av-seg [aria-selected="true"] { color: var(--ink); font-weight: 600; }
.av-seg [aria-selected="true"]::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; border-radius: 1px; background: var(--brass); }
.av-seg__n { font-weight: 400; color: var(--ink-3); margin-inline-start: 2px; }

/* ---------- خط رکعت (تازه‌راه) و حلقه سی جزء (حلقه) ---------- */

.av-rakat { display: block; width: 100%; height: auto; }
.av-ring { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.av-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.av-ring__core { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.av-ring__num { font-size: 58px; line-height: 1; font-weight: 200; font-feature-settings: "tnum"; }
.av-ring__label { margin-top: 8px; font-size: 12.5px; line-height: 18px; color: var(--ink-2); }
.av-ring__meta { margin-top: 2px; font-size: 11.5px; line-height: 18px; color: var(--ink-3); }

/* ---------- خواندن دعا ---------- */

.av-reader { --av-reader-size: 24px; display: flex; flex-direction: column; gap: var(--space-4); }
.av-reader__ar { font-family: var(--font-sacred); font-size: var(--av-reader-size); line-height: 2.1; color: var(--sacred); text-align: center; text-wrap: balance; }
.av-reader__tr { font-size: 15px; line-height: 27px; color: var(--ink-2); text-align: center; }

/* ---------- لایه‌های شناور شیشه‌ای ---------- */

.av-dock {
  position: fixed; inset-inline: 20px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 5;
  max-width: calc(var(--size-column) - 40px); margin: 0 auto; height: 64px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  border-radius: var(--radius-dock); background: var(--glass); box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(180%); backdrop-filter: blur(var(--blur-glass)) saturate(180%);
}
.av-dock a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink-3); text-decoration: none; font-size: 11px; line-height: 14px; }
.av-dock a[aria-current] { color: var(--ink); }
.av-dock a::after { content: ""; width: 4px; height: 4px; border-radius: 50%; margin-top: 1px; }
.av-dock a[aria-current]::after { background: var(--brass); }

.av-toast {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px;
  border-radius: var(--radius-pill); background: var(--glass); box-shadow: var(--shadow-glass); color: var(--ink);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(180%); backdrop-filter: blur(var(--blur-glass)) saturate(180%);
  font-size: 14px; line-height: 22px;
}

@media (prefers-reduced-transparency: reduce) {
  .av-dock, .av-toast { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- حرکت ---------- */

.av-reveal { animation: av-rise var(--motion-reveal) ease-out both; }
@keyframes av-breathe { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes av-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .av-dial__next { animation: none; opacity: 1; }
  .av-reveal { animation: none; }
}
