/* =========================================================
   ویگل (Vigol) — کتابخانه دیجیتال
   سیستم طراحی اصلی | حالت روشن/تاریک | RTL | وزیرمتن
   ========================================================= */

/* ---------- متغیرهای تم ---------- */
:root {
  /* رنگ برند */
  --brand: #0d9488;
  --brand-2: #059669;
  --brand-3: #14b8a6;
  --brand-rgb: 13, 148, 136;
  --gold: #c8901a;
  --gold-2: #e0a82e;
  --violet: #6d5cf0;
  --rose: #e0517a;

  /* پس‌زمینه و سطوح */
  --bg: #f6f2ea;
  --bg-soft: #fbf8f2;
  --surface: #ffffff;
  --surface-2: #f4efe6;
  --elev: #ffffff;

  /* متن */
  --text: #1b2330;
  --text-soft: #586273;
  --text-mute: #8a93a3;
  --on-brand: #ffffff;

  /* خطوط و سایه */
  --border: rgba(20, 30, 50, .10);
  --border-strong: rgba(20, 30, 50, .16);
  --ring: rgba(var(--brand-rgb), .35);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow: 0 8px 24px rgba(16, 24, 40, .10);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .16);
  --shadow-brand: 0 14px 40px rgba(var(--brand-rgb), .35);

  /* شعاع */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --maxw: 1240px;
  --nav-h: 74px;

  --grad-brand: linear-gradient(135deg, var(--brand-3), var(--brand-2) 55%, #0b7c6e);
  --grad-gold: linear-gradient(135deg, #f3cf6b, var(--gold-2) 60%, #b5790f);
  --grad-hero: radial-gradient(900px 500px at 88% -8%, rgba(var(--brand-rgb), .16), transparent 60%),
               radial-gradient(700px 420px at 4% 8%, rgba(109, 92, 240, .12), transparent 55%);
}

[data-bs-theme="dark"] {
  --brand: #2dd4bf;
  --brand-2: #14b8a6;
  --brand-3: #34e0c8;
  --brand-rgb: 45, 212, 191;
  --gold: #f1c34a;
  --gold-2: #f6d06a;
  --violet: #8b7bff;
  --rose: #ff6f9c;

  --bg: #0a0e16;
  --bg-soft: #0e1320;
  --surface: #141b2b;
  --surface-2: #182134;
  --elev: #182032;

  --text: #eef2f8;
  --text-soft: #a7b1c2;
  --text-mute: #6f7b8e;
  --on-brand: #052420;

  --border: rgba(255, 255, 255, .085);
  --border-strong: rgba(255, 255, 255, .16);
  --ring: rgba(var(--brand-rgb), .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 12px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
  --shadow-brand: 0 16px 44px rgba(var(--brand-rgb), .28);

  --grad-hero: radial-gradient(900px 520px at 86% -10%, rgba(var(--brand-rgb), .18), transparent 60%),
               radial-gradient(700px 460px at 2% 6%, rgba(139, 123, 255, .16), transparent 55%);
}

/* ---------- پایه ---------- */
* { scroll-behavior: smooth; }
html { scroll-padding-top: calc(var(--nav-h) + 14px); }

body {
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .4s ease, color .4s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .fw-900 { font-weight: 800; letter-spacing: -.01em; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; transition: color .2s, opacity .2s; }
a:hover { color: var(--brand-2); }
p { color: var(--text-soft); }
img { max-width: 100%; }
::selection { background: rgba(var(--brand-rgb), .25); }

.container-x { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

/* اعداد فارسی خوانا */
.num { font-feature-settings: "ss01"; }

/* یوتیلیتی‌های متن و پس‌زمینه */
.text-soft { color: var(--text-soft) !important; }
.text-mute { color: var(--text-mute) !important; }
.text-brand { color: var(--brand) !important; }
.bg-surface { background: var(--surface) !important; }
.bg-soft { background: var(--bg-soft) !important; }
.fw-800 { font-weight: 800 !important; }
.fw-900 { font-weight: 900 !important; }
.rounded-xl { border-radius: var(--r-lg) !important; }
.border-soft { border: 1px solid var(--border) !important; }
.divider { height: 1px; background: var(--border); border: 0; }

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--brand), var(--brand-2));
  border-radius: 20px; border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ---------- متن گرادیانی ---------- */
.text-grad {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.text-gold {
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- دکمه‌ها ---------- */
.btn { font-weight: 600; border-radius: 999px; padding: .62rem 1.35rem; transition: transform .18s, box-shadow .25s, background .25s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-brand {
  background: var(--grad-brand); color: var(--on-brand); border: none;
  box-shadow: var(--shadow-brand);
}
.btn-brand:hover { color: var(--on-brand); transform: translateY(-2px); box-shadow: 0 18px 48px rgba(var(--brand-rgb), .45); }
.btn-gold { background: var(--grad-gold); color: #3a2806; border: none; box-shadow: 0 12px 34px rgba(200, 144, 26, .35); }
.btn-gold:hover { color: #3a2806; transform: translateY(-2px); }
.btn-ghost {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text); border: 1.5px solid var(--border-strong);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.btn-soft { background: rgba(var(--brand-rgb), .12); color: var(--brand); border: none; }
.btn-soft:hover { background: rgba(var(--brand-rgb), .2); color: var(--brand); }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.02rem; }

/* ---------- نشان‌ها ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
}
.badge-free { background: rgba(16, 185, 129, .16); color: #0f9d6b; border: 1px solid rgba(16,185,129,.3); }
[data-bs-theme="dark"] .badge-free { color: #4ade9f; }
.badge-premium { background: linear-gradient(135deg, rgba(240,168,46,.22), rgba(200,144,26,.18)); color: var(--gold); border: 1px solid rgba(200,144,26,.4); }
.badge-vol { background: rgba(109,92,240,.16); color: var(--violet); border: 1px solid rgba(109,92,240,.3); }

/* ---------- نوبار ---------- */
.nav-vigol {
  position: sticky; top: 0; z-index: 1030; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg-soft) 78%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s, background .3s;
}
.nav-vigol.scrolled { box-shadow: var(--shadow); background: color-mix(in srgb, var(--bg-soft) 92%, transparent); }
.brand-logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 900; font-size: 1.5rem; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--grad-brand); color: #fff; font-size: 1.35rem; box-shadow: var(--shadow-brand);
  transform: rotate(-6deg); transition: transform .35s;
}
.brand-logo:hover .brand-mark { transform: rotate(0) scale(1.05); }
.nav-link-x { color: var(--text-soft); font-weight: 600; padding: .5rem .9rem; border-radius: 12px; position: relative; }
.nav-link-x:hover, .nav-link-x.active { color: var(--brand); background: rgba(var(--brand-rgb), .1); }

.theme-toggle {
  width: 46px; height: 46px; border-radius: 14px; border: 1.5px solid var(--border-strong);
  background: var(--surface); color: var(--text); display: grid; place-items: center;
  cursor: pointer; font-size: 1.2rem; transition: transform .35s, color .25s, border-color .25s;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); transform: rotate(18deg); }

.search-pill {
  display: flex; align-items: center; gap: .5rem; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 999px; padding: .35rem .9rem;
  transition: border-color .2s, box-shadow .2s; min-width: 260px;
}
.search-pill:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.search-pill input { border: none; background: transparent; outline: none; color: var(--text); width: 100%; font-family: inherit; }
.search-pill input::placeholder { color: var(--text-mute); }

/* ---------- هیرو ---------- */
.hero { position: relative; padding: clamp(3rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 4rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; background: var(--grad-hero); z-index: -2;
}
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; z-index: -1; animation: float 14s ease-in-out infinite; }
.blob.b1 { width: 380px; height: 380px; background: rgba(var(--brand-rgb), .5); top: -120px; left: -80px; }
.blob.b2 { width: 320px; height: 320px; background: rgba(109,92,240,.4); bottom: -120px; right: 6%; animation-delay: -5s; }
.blob.b3 { width: 240px; height: 240px; background: rgba(224,168,46,.4); top: 30%; right: 40%; animation-delay: -9s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(30px,-25px) scale(1.07); } 66% { transform: translate(-20px,20px) scale(.95); } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; padding: .4rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-weight: 600; font-size: .9rem; color: var(--text-soft);
}
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.7rem); font-weight: 900; line-height: 1.35; }
.hero-lead { font-size: clamp(1rem, 2.3vw, 1.18rem); color: var(--text-soft); max-width: 34rem; }

.stat-pop { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 900; line-height: 1; }

/* مجموعه کتاب شناور در هیرو */
.hero-stack { position: relative; height: 440px; perspective: 1400px; }
.float-book {
  position: absolute; border-radius: 12px; box-shadow: var(--shadow-lg);
  overflow: hidden; transition: transform .5s; animation: bob 6s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,.18);
}
.float-book img { display: block; width: 100%; height: 100%; object-fit: cover; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(var(--rot,0deg)); } 50% { transform: translateY(-18px) rotate(var(--rot,0deg)); } }

/* ---------- سرتیتر بخش ---------- */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.sec-eyebrow { color: var(--brand); font-weight: 700; letter-spacing: .04em; }
.sec-title { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 900; }
.sec-line { width: 54px; height: 4px; border-radius: 4px; background: var(--grad-brand); }

/* ---------- کارت کتاب ---------- */
.book-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; transition: transform .3s, box-shadow .3s, border-color .3s; height: 100%;
  display: flex; flex-direction: column; position: relative;
}
.book-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: rgba(var(--brand-rgb), .4); }
.book-cover {
  position: relative; aspect-ratio: 3/4.4; overflow: hidden;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.book-card:hover .book-cover img { transform: scale(1.06); }
.book-cover .spine { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 7px; background: linear-gradient(var(--brand), var(--brand-2)); opacity: .9; }
.book-cover .badges { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.book-cover .quickbar {
  position: absolute; inset-inline: 10px; bottom: 10px; display: flex; gap: 6px; justify-content: center;
  transform: translateY(140%); transition: transform .35s; opacity: 0;
}
.book-card:hover .quickbar { transform: translateY(0); opacity: 1; }
.qbtn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong); color: var(--text); cursor: pointer; transition: .2s;
}
.qbtn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.book-body { padding: 1rem 1.05rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.book-title { font-weight: 700; font-size: 1.02rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-title a { color: var(--text); }
.book-title a:hover { color: var(--brand); }
.book-author { font-size: .86rem; color: var(--text-mute); }
.book-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: .6rem; border-top: 1px solid var(--border); }
.price { font-weight: 800; }
.price .free { color: #0f9d6b; }
[data-bs-theme="dark"] .price .free { color: #4ade9f; }
.rating { color: var(--gold); font-size: .85rem; }

/* ---------- پیل دسته ---------- */
.cat-card {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.4rem 1.1rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border); transition: .28s; text-align: center; align-items: center;
}
.cat-card:hover { transform: translateY(-6px); border-color: var(--brand); box-shadow: var(--shadow); }
.cat-ico { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; color: #fff; }

/* ---------- آواتار شخص ---------- */
.person-card { text-align: center; }
.person-ava {
  width: 96px; height: 96px; border-radius: 50%; margin-inline: auto; object-fit: cover;
  border: 3px solid var(--surface); box-shadow: var(--shadow); background: var(--grad-brand);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.8rem;
}
.role-tags { display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap; }

/* ---------- آمار شمارنده ---------- */
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 1.4rem; text-align: center; }

/* ---------- اشتراک ---------- */
.plan {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg);
  padding: 1.8rem 1.5rem; height: 100%; display: flex; flex-direction: column; position: relative; transition: .3s;
}
.plan:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow-brand); }
.plan.featured::before {
  content: "پرطرفدارترین"; position: absolute; top: -13px; inset-inline-start: 50%; transform: translateX(50%);
  background: var(--grad-brand); color: #fff; font-size: .78rem; font-weight: 700; padding: .25rem 1rem; border-radius: 999px;
}
.plan-price { font-size: 2.4rem; font-weight: 900; line-height: 1; }
.plan-feats { list-style: none; padding: 0; margin: 1.2rem 0; display: flex; flex-direction: column; gap: .7rem; }
.plan-feats li { display: flex; gap: .6rem; align-items: flex-start; color: var(--text-soft); font-size: .95rem; }
.plan-feats i { color: var(--brand); margin-top: .25rem; }

/* ---------- گالری و انتخاب کاور ---------- */
.gallery-main {
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border);
  background: var(--surface-2); aspect-ratio: 3/4.2; position: relative; box-shadow: var(--shadow);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.cover-flag { position: absolute; top: 12px; inset-inline-start: 12px; }
.thumbs { display: flex; gap: .6rem; flex-wrap: wrap; }
.thumb {
  width: 64px; aspect-ratio: 3/4.2; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; position: relative; transition: .2s; flex: 0 0 auto;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.thumb .cover-dot { position: absolute; top: 3px; inset-inline-end: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--grad-gold); color: #3a2806; display: none; place-items: center; font-size: .6rem; }
.thumb.is-cover .cover-dot { display: grid; }

/* ---------- انتخاب جلد ---------- */
.vol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: .5rem; }
.vol-chip {
  border: 1.5px solid var(--border); border-radius: 12px; padding: .5rem; text-align: center; cursor: pointer;
  background: var(--surface); font-weight: 700; transition: .18s; font-size: .9rem;
}
.vol-chip:hover { border-color: var(--brand); color: var(--brand); }
.vol-chip.active { background: var(--grad-brand); color: #fff; border-color: transparent; }
.vol-chip small { display: block; font-weight: 500; font-size: .68rem; opacity: .8; }

/* ---------- جدول مشخصات ---------- */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: .7rem .2rem; border-bottom: 1px dashed var(--border); text-align: start; vertical-align: top; }
.spec-table th { color: var(--text-mute); font-weight: 600; width: 38%; white-space: nowrap; }
.spec-table td { font-weight: 600; }

/* ---------- فرم‌ها ---------- */
.form-control, .form-select {
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text);
  border-radius: var(--r-sm); padding: .7rem 1rem; font-family: inherit;
}
.form-control:focus, .form-select:focus { background: var(--surface); color: var(--text); border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.form-control::placeholder { color: var(--text-mute); }
.form-label { font-weight: 600; margin-bottom: .4rem; }

/* ---------- منطق درخواست کتاب (۳+) ---------- */
.req-meter { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.req-fill { height: 100%; background: var(--grad-brand); border-radius: 999px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.req-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 1.1rem 1.2rem; transition: .25s; }
.req-card:hover { box-shadow: var(--shadow); }
.req-card.hot { border-color: var(--gold); background: linear-gradient(180deg, rgba(224,168,46,.07), transparent); }
.vote-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; transition: .18s; }
.vote-btn:hover, .vote-btn.voted { border-color: var(--brand); color: var(--brand); background: rgba(var(--brand-rgb), .1); }

/* ---------- کارت شیشه‌ای ---------- */
.glass {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: var(--r-lg);
}

/* ---------- فوتر ---------- */
.footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding-top: 3.5rem; margin-top: 2rem; }
.footer h6 { font-weight: 800; margin-bottom: 1rem; }
.footer a { color: var(--text-soft); display: inline-block; padding: .22rem 0; }
.footer a:hover { color: var(--brand); transform: translateX(-4px); }
.soc { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: .2s; }
.soc:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: translateY(-3px); }

/* ---------- نوار اعلان بالا ---------- */
.topbar { background: var(--grad-brand); color: #fff; font-size: .86rem; }
.topbar a { color: #fff; text-decoration: underline; }

/* ---------- انیمیشن اسکرول ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }

/* ---------- اسکلت بارگذاری ---------- */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- بردکرامب ---------- */
.crumb { font-size: .88rem; color: var(--text-mute); }
.crumb a { color: var(--text-soft); }
.crumb a:hover { color: var(--brand); }

/* ---------- اسکرول افقی کتاب ---------- */
.h-scroll { display: flex; gap: 1.1rem; overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x mandatory; }
.h-scroll > * { scroll-snap-align: start; flex: 0 0 auto; width: 200px; }
.h-scroll::-webkit-scrollbar { height: 8px; }

/* ---------- ابزار شناور پایین (موبایل) ---------- */
.mobile-dock {
  position: fixed; inset-inline: 14px; bottom: 14px; z-index: 1040; display: none;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: .5rem; justify-content: space-around;
}
.mobile-dock a { color: var(--text-soft); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; padding: .35rem .6rem; border-radius: 12px; }
.mobile-dock a.active { color: var(--brand); background: rgba(var(--brand-rgb), .12); }
.mobile-dock i { font-size: 1.25rem; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 991px) {
  .search-pill { min-width: 0; }
  .hero-stack { height: 320px; margin-top: 1rem; }
}
@media (max-width: 768px) {
  :root { --nav-h: 64px; }
  .mobile-dock { display: flex; }
  body { padding-bottom: 78px; }
  .hero-stack { display: none; }
}

/* ---------- منوی کشویی ---------- */
.dropdown-menu {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: .5rem; min-width: 220px;
}
.dropdown-item { color: var(--text); border-radius: 10px; padding: .55rem .8rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.dropdown-item:hover, .dropdown-item:focus { background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.dropdown-item i { color: var(--brand); width: 20px; }

/* ---------- خوانندهٔ آنلاین ---------- */
.reader { min-height: 100vh; display: flex; flex-direction: column; transition: background .3s, color .3s; }
.reader.theme-light { background: #f7f4ee; color: #1b2330; }
.reader.theme-sepia { background: #f3e9d6; color: #4a3b26; }
.reader.theme-dark  { background: #11151c; color: #cdd4df; }
.reader-bar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); background: color-mix(in srgb, var(--surface) 80%, transparent); border-bottom: 1px solid var(--border); }
.reader-page { max-width: 720px; margin-inline: auto; padding: clamp(1.5rem, 5vw, 3.5rem); font-size: var(--reader-fs, 1.15rem); line-height: 2.2; }
.reader-page h2 { text-align: center; margin: 2rem 0; }
.reader-page p { color: inherit; text-align: justify; margin-bottom: 1.3rem; }
.reader-progress { height: 4px; background: var(--grad-brand); width: 0; transition: width .3s; }
.toc-item { padding: .5rem .8rem; border-radius: 10px; cursor: pointer; color: var(--text-soft); }
.toc-item:hover, .toc-item.active { background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.hl { background: linear-gradient(transparent 60%, rgba(240,200,80,.55) 60%); cursor: pointer; }
.reader-ctrl { width: 40px; height: 40px; border-radius: 11px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: .2s; }
.reader-ctrl:hover, .reader-ctrl.active { border-color: var(--brand); color: var(--brand); }

/* ---------- پخش‌کنندهٔ کتاب صوتی ---------- */
.audio-player { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1rem 1.2rem; }
.audio-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; cursor: pointer; }
.audio-fill { height: 100%; width: 32%; background: var(--grad-brand); border-radius: 999px; }
.audio-play { width: 54px; height: 54px; border-radius: 50%; background: var(--grad-brand); color: #fff; border: none; font-size: 1.4rem; box-shadow: var(--shadow-brand); }

/* ---------- گیمیفیکیشن ---------- */
.streak-flame { font-size: 2.4rem; }
.badge-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 1.1rem; text-align: center; transition: .25s; }
.badge-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.badge-tile.locked { opacity: .45; filter: grayscale(.6); }
.badge-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; color: #fff; margin-inline: auto; }
.ring { --p: 0; width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring::before { content: ""; position: absolute; width: 100px; height: 100px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-weight: 900; font-size: 1.4rem; }

/* ---------- قفسه ---------- */
.shelf-tab { padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text-soft); font-weight: 700; cursor: pointer; white-space: nowrap; }
.shelf-tab.active { background: var(--grad-brand); color: #fff; border-color: transparent; }

/* ---------- مجموعه‌ها ---------- */
.collection-card { position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 220px; display: flex; align-items: flex-end; padding: 1.3rem; color: #fff; }
.collection-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.7)); z-index: 1; }
.collection-card > * { position: relative; z-index: 2; }
.collection-card .covers { position: absolute; inset: 0; display: flex; z-index: 0; }
.collection-card .covers img { width: 25%; object-fit: cover; }

/* ---------- پنل مدیریت ---------- */
.admin-sidebar { background: var(--surface); border-inline-end: 1px solid var(--border); min-height: 100vh; }
.admin-nav a { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border-radius: 12px; color: var(--text-soft); font-weight: 600; margin-bottom: .25rem; cursor: pointer; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 1.2rem; }
.kpi .v { font-size: 1.8rem; font-weight: 900; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: start; color: var(--text-mute); font-weight: 600; padding: .7rem; border-bottom: 1px solid var(--border); font-size: .85rem; white-space: nowrap; }
.admin-table td { padding: .7rem; border-bottom: 1px solid var(--border); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- نمودار میله‌ای کوچک ---------- */
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.mini-bars span { flex: 1; background: var(--grad-brand); border-radius: 3px 3px 0 0; opacity: .85; }

/* احترام به کاهش حرکت */
@media (prefers-reduced-motion: reduce) {
  *, .blob, .float-book { animation: none !important; transition: none !important; }
}
