:root {
    --teal: #0E8F87;
    --teal-bright: #14B8AC;
    --deep: #0A3D3A;
    --coral: #FF7A59;
    --coral-deep: #F0623E;
    --mist: #F2F7F6;
    --ink: #16302E;
    --card: #FFFFFF;
    --line: #DCE8E6;
    --muted: #5B726F;
    --ring: rgba(14,143,135,.35);
    --shadow: 0 10px 40px -12px rgba(10,61,58,.22);
    --shadow-lg: 0 24px 70px -20px rgba(10,61,58,.30);
    --radius: 20px;
    --sans: 'IRANSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --mist: #0B1A19;
      --ink: #E9F3F1;
      --card: #112625;
      --line: #22403D;
      --muted: #8FA9A5;
      --deep: #CFEDE9;
      --ring: rgba(20,184,172,.40);
      --shadow: 0 10px 40px -12px rgba(0,0,0,.5);
      --shadow-lg: 0 24px 70px -20px rgba(0,0,0,.6);
    }
  }
  :root[data-theme="light"] {
    --mist:#F2F7F6; --ink:#16302E; --card:#FFFFFF; --line:#DCE8E6; --muted:#5B726F; --deep:#0A3D3A; --ring:rgba(14,143,135,.35);
    --shadow:0 10px 40px -12px rgba(10,61,58,.22); --shadow-lg:0 24px 70px -20px rgba(10,61,58,.30);
  }
  :root[data-theme="dark"] {
    --mist:#0B1A19; --ink:#E9F3F1; --card:#112625; --line:#22403D; --muted:#8FA9A5; --deep:#CFEDE9; --ring:rgba(20,184,172,.40);
    --shadow:0 10px 40px -12px rgba(0,0,0,.5); --shadow-lg:0 24px 70px -20px rgba(0,0,0,.6);
  }

  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0; font-family: var(--sans); direction: rtl;
    background: var(--mist); color: var(--ink);
    line-height: 1.7; overflow-x: hidden;
    min-height: 100dvh; display: flex; flex-direction: column;
    transition: background .4s ease, color .4s ease;
  }
  /* 🔴 قفلِ تک‌صفحه‌ای فقط برای صفحه‌ی چت (index) — که عمداً تمام‌صفحه و بدونِ اسکرول است.
     این قانون موقعِ استخراجِ CSS مشترک، سهواً همه‌ی صفحه‌ها را قفل کرد و هیچ صفحه‌ای
     اسکرول نمی‌شد. حالا فقط با کلاسِ صریحِ .lock-screen روی <body> اعمال می‌شود. */
  @media (min-height: 720px) and (min-width: 640px) {
    body.lock-screen { height: 100dvh; overflow: hidden; }
  }
  ::selection { background: var(--teal); color:#fff; }

  /* ---------- top bar ---------- */
  .nav {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px clamp(16px, 4vw, 48px);
    backdrop-filter: saturate(180%) blur(14px);
    background: color-mix(in srgb, var(--mist) 78%, transparent);
    border-bottom: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 20px; letter-spacing: -.3px;
    color: inherit; text-decoration: none; cursor: pointer; transition: opacity .2s; }
  .brand:hover { opacity: .78; }
  .brand .logo { width: 38px; height: 38px; }
  /* 🔴 ناوبریِ سه‌بخشی: برند (راست) | منو (وسطِ واقعی) | آیکون‌ها (چپ).
     برند و آیکون‌ها هم‌عرض‌اند (flex:1) تا منو دقیقاً وسطِ صفحه بیفتد،
     نه وسطِ فضای باقی‌مانده. */
  .nav-side { flex: 1 1 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .nav-side.left { justify-content: flex-end; }
  .nav-center { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
  .nav-center a {
    color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600;
    padding: 9px 15px; border-radius: 11px; transition: .2s; white-space: nowrap;
  }
  .nav-center a:hover { color: var(--ink); background: color-mix(in srgb, var(--teal) 10%, transparent); }
  .nav-center a.on { color: var(--teal); font-weight: 700; }

  /* دستیار: کنارِ بقیه‌ی منو ولی به‌شکلِ دکمه‌ی متمایز (نه آیکون) */
  .nav-assist {
    display: inline-flex !important; align-items: center; gap: 7px;
    background: var(--teal); color: #fff !important; padding: 9px 16px !important;
    border-radius: 11px !important; box-shadow: 0 6px 18px -7px var(--ring);
    font-weight: 700 !important; margin-inline-start: 6px;
  }
  .nav-assist:hover { background: var(--deep) !important; transform: translateY(-1px); }
  .nav-assist svg { width: 16px; height: 16px; flex-shrink: 0; }

  /* آیکون‌های ابزار: سرچ، تم، ورود — همه هم‌شکل و هم‌اندازه */
  .icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0;
    border: 1px solid var(--line); border-radius: 12px; background: var(--card);
    color: var(--muted); cursor: pointer; transition: .2s; text-decoration: none;
  }
  .icon-btn:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-1px); }
  .icon-btn svg { width: 19px; height: 19px; }
  /* «بخش مشترکین» — دکمه‌ی متنی (نه آیکون). عمداً طرحِ خطیِ مرجانی دارد تا با
     دکمه‌ی پُرِ فیروزه‌ایِ «دستیار هوشمند» رقابت نکند: دستیار کنشِ اصلی است. */
  /* ================= کرکره‌ی یکپارچه (مرکز دانش + سوالات متداول) =================
     🔴 بازخوردِ کاربر: باکس‌های جدا با فاصله «ساده و زمخت و دِمُده» بود.
     حالا یک کارتِ واحد با خطوطِ جداکننده — چسبیده، جمع‌وجور، مدرن. */
  .acc-wrap {
    border: 1px solid var(--line); border-radius: 18px; background: var(--card);
    overflow: hidden; box-shadow: var(--shadow);
  }
  .acc-wrap .acc {
    border: none; border-radius: 0; margin: 0; background: none; box-shadow: none;
    border-top: 1px solid var(--line);
  }
  .acc-wrap .acc:first-child { border-top: none; }
  .acc-wrap .acc.open { box-shadow: none; }
  .acc-wrap .acc-head { position: relative; padding: 15px 18px; }
  /* نوارِ رنگیِ کنارِ گروهِ باز — نشانگرِ ظریفِ «اینجایی» */
  .acc-wrap .acc.open > .acc-head { background: color-mix(in srgb, var(--teal) 6%, transparent); }
  .acc-wrap .acc.open > .acc-head::before {
    content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px;
    background: var(--teal);
  }
  .acc-wrap .acc.urgent.open > .acc-head::before { background: var(--coral); }
  /* 🔴 باز/بسته با display، نه grid-template-rows.
     تستِ مرورگر نشان داد روشِ `0fr → 1fr` اینجا کار نمی‌کند (ارتفاع حتی با ستِ
     دستیِ 1fr صفر می‌ماند — تداخل با overflow:hidden ِ .acc-wrap). این روش
     انیمیشنِ ارتفاع ندارد ولی **قطعی** است؛ نرمی را با fade/slide محتوا می‌گیریم. */
  .acc-wrap .acc > .acc-body { display: none; }
  .acc-wrap .acc.open > .acc-body { display: block; animation: accIn .26s ease; }
  @keyframes accIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

  .btn-users {
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
    font-family: inherit; font-size: 14px; font-weight: 700; text-decoration: none;
    color: var(--coral-deep); background: color-mix(in srgb, var(--coral) 9%, transparent);
    border: 1px solid color-mix(in srgb, var(--coral) 42%, transparent);
    padding: 9px 16px; border-radius: 12px; transition: .2s; white-space: nowrap;
  }
  .btn-users:hover {
    background: var(--coral); color: #fff; border-color: var(--coral);
    transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(240,98,62,.55);
  }
  .btn-users svg { width: 17px; height: 17px; flex-shrink: 0; }
  /* در عرضِ کم متن حذف و فقط آیکون بماند تا نوار نشکند */
  @media (max-width: 1150px) {
    .btn-users span { display: none; }
    .btn-users { padding: 10px; gap: 0; }
  }
  .theme-btn { /* سازگاری با نامِ قدیمی در index */
    display: inline-grid; place-items: center; width: 40px; height: 40px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--card);
    color: var(--muted); cursor: pointer; transition: .2s;
  }
  .theme-btn:hover { border-color: var(--teal); color: var(--teal); }

  /* موبایل: منوی وسط پنهان، منوی کشویی جایش را می‌گیرد */
  .nav-burger { display: none; }
  @media (max-width: 900px) {
    .nav-center { display: none; }
    .nav-burger { display: inline-grid; }
    .brand span { font-size: 15.5px; }
  }
  /* کشوی موبایل */
  .nav-drawer {
    position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, var(--mist) 97%, transparent);
    display: none; flex-direction: column; padding: 22px; gap: 6px;
    backdrop-filter: blur(8px);
  }
  .nav-drawer.open { display: flex; }
  .nav-drawer a {
    color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 600;
    padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  }
  .nav-drawer a.assist { background: var(--teal); color: #fff; border-color: var(--teal); text-align: center; }
  .nav-drawer .close {
    align-self: flex-end; width: 42px; height: 42px; border-radius: 12px; margin-bottom: 10px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    font-size: 21px; cursor: pointer; line-height: 1;
  }
  .hide-mobile { }
  @media (max-width: 720px) { .hide-mobile { display: none; } }
  /* ================= صفحاتِ محتوایی (درباره/سوالات/مرکز دانش/خدمات) =================
     این بخش بعد از استخراجِ پایه از index.html اضافه شد؛ index خودش این‌ها را لازم ندارد. */
  .page { max-width: 1080px; margin: 0 auto; padding: 40px 22px 70px; }
  .page-narrow { max-width: 760px; }

  /* سربرگِ صفحه */
  .ph { text-align: center; margin-bottom: 46px; }
  .ph .kicker {
    display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .3px;
    color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, transparent);
    padding: 6px 14px; border-radius: 100px; margin-bottom: 16px;
  }
  .ph h1 { font-size: clamp(28px, 4.6vw, 44px); font-weight: 800; letter-spacing: -.5px; margin-bottom: 14px; }
  .ph h1 .accent { color: var(--teal); }
  .ph p { font-size: clamp(14.5px, 1.8vw, 17px); color: var(--muted); max-width: 620px; margin: 0 auto; line-height: 1.85; }

  /* کارت */
  .card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px; box-shadow: var(--shadow); transition: .22s;
  }
  a.card { display: block; color: inherit; text-decoration: none; }
  a.card:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: var(--shadow-lg); }
  .grid { display: grid; gap: 18px; }
  .grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

  /* آیکونِ گردِ کارت */
  .card-ico {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal); margin-bottom: 16px;
  }
  .card-ico svg { width: 23px; height: 23px; }
  .card h3 { font-size: 17.5px; font-weight: 800; margin-bottom: 9px; }
  .card p { font-size: 14px; color: var(--muted); line-height: 1.85; }

  /* بخش‌بندیِ درونِ صفحه */
  .sec { margin-top: 54px; }
  .sec-title { font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; margin-bottom: 8px; }
  .sec-sub { font-size: 14px; color: var(--muted); margin-bottom: 26px; line-height: 1.8; }

  /* متنِ بلندِ خوانا */
  .prose { font-size: 15.5px; line-height: 2.05; color: var(--ink); }
  .prose p { margin-bottom: 16px; }
  .prose h2 { font-size: 21px; font-weight: 800; margin: 34px 0 12px; }
  .prose h3 { font-size: 17px; font-weight: 800; margin: 26px 0 10px; color: var(--teal); }
  .prose ul { margin: 12px 0 18px; padding-inline-start: 22px; }
  .prose li { margin: 7px 0; }
  .prose strong { font-weight: 800; color: var(--teal-bright); }

  /* نشان‌ها */
  .badges { display: flex; flex-wrap: wrap; gap: 9px; }
  .badge {
    font-size: 13px; font-weight: 600; color: var(--muted);
    border: 1px solid var(--line); border-radius: 100px; padding: 7px 15px; background: var(--card);
  }
  .badge.on { color: var(--teal); border-color: var(--teal); }

  /* فراخوانِ برگشت به چت — پُلِ همیشگیِ صفحات به دستیار */
  .ask-cta {
    margin-top: 46px; padding: 30px; border-radius: var(--radius); text-align: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 11%, var(--card)), var(--card));
    border: 1px solid var(--line);
  }
  .ask-cta h3 { font-size: 19px; font-weight: 800; margin-bottom: 9px; }
  .ask-cta p { font-size: 14px; color: var(--muted); margin-bottom: 18px; line-height: 1.8; }
  .btn {
    display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
    font-family: inherit; font-size: 15px; font-weight: 700; color: #fff; text-decoration: none;
    background: var(--coral); padding: 12px 24px; border-radius: 14px; transition: .2s;
    box-shadow: 0 8px 20px -8px rgba(240,98,62,.6);
  }
  .btn:hover { background: var(--coral-deep); transform: translateY(-1px); }
  .btn svg { width: 17px; height: 17px; }
  .btn-ghost {
    background: transparent; color: var(--teal); border: 1px solid var(--teal); box-shadow: none;
  }
  .btn-ghost:hover { background: color-mix(in srgb, var(--teal) 10%, transparent); color: var(--teal); }
  .btn-row { display: flex; gap: 11px; justify-content: center; flex-wrap: wrap; }

  /* فوترِ مشترک */
  .site-footer {
    border-top: 1px solid var(--line); margin-top: 60px; padding: 34px 22px;
    text-align: center; font-size: 13px; color: var(--muted); line-height: 2;
  }
  .site-footer a { color: var(--muted); text-decoration: none; }
  .site-footer a:hover { color: var(--teal); }
  .footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }

  @media (max-width: 520px) {
    .page { padding: 26px 16px 50px; }
    .card { padding: 20px; }
    .sec { margin-top: 40px; }
  }
