/* حالت تیره و اندازه‌ی فونت (تنظیم کاربر؛ فقط در مرورگر خودش ذخیره می‌شود) */

/* --- حالت تیره: وارونه‌سازی رنگ (روشنایی) و چرخاندن طیف، تا رنگ برند (آبی و...) حفظ شود --- */
html[data-kb-theme="dark"] { background: #fff; filter: invert(.92) hue-rotate(180deg); }
html[data-kb-theme="dark"] img,
html[data-kb-theme="dark"] video,
html[data-kb-theme="dark"] iframe,
html[data-kb-theme="dark"] picture,
html[data-kb-theme="dark"] [style*="background-image"] { filter: invert(1) hue-rotate(180deg); }

/* بخش‌هایی که از اول تیره‌اند (هدر و فوتر): دوباره وارونه می‌شوند تا بعد از وارونگی کلی، تیره بمانند.
   تصویرهای داخلشان یک‌بار کمتر وارونه می‌شوند تا درست دیده شوند. */
html[data-kb-theme="dark"] header,
html[data-kb-theme="dark"] .mod_bot_menu,
html[data-kb-theme="dark"] .mod_copywrite { filter: invert(1) hue-rotate(180deg); }
html[data-kb-theme="dark"] header img,
html[data-kb-theme="dark"] .mod_bot_menu img,
html[data-kb-theme="dark"] .mod_copywrite img { filter: none; }

/* --- اندازه‌ی فونت: ضریب روی اندازه‌های پایه‌ی سایت --- */
html[data-kb-fs] .allmode_title a,
html[data-kb-fs] .slide_text_news a { font-size: calc(14px * var(--kb-fs, 1)) !important; }
html[data-kb-fs] .news-body,
html[data-kb-fs] .news-body p,
html[data-kb-fs] .news-body li,
html[data-kb-fs] .nt-body p,
html[data-kb-fs] .ld-snippet { font-size: calc(15px * var(--kb-fs, 1)) !important; }
html[data-kb-fs] .title_news h1,
html[data-kb-fs] .title_news a { font-size: calc(18px * var(--kb-fs, 1)) !important; line-height: 1.7 !important; }
html[data-kb-fs] .ed-picks a,
html[data-kb-fs] .kb-recent a { font-size: calc(13.5px * var(--kb-fs, 1)) !important; }

/* --- دکمه و پنل تنظیمات --- */
#kb-cm { position: fixed; right: 14px; bottom: 50px; z-index: 9997; width: 40px; height: 40px; border: 0; border-radius: 50%;
         background: #1f6f8b; color: #fff; font: bold 14px/40px inherit; text-align: center; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
#kb-cm:hover { background: #16536a; }
#kb-cmp { position: fixed; right: 14px; bottom: 98px; z-index: 9997; width: 210px; background: #fff; border: 1px solid #d5dde3; border-radius: 12px;
          padding: 10px 12px; box-shadow: 0 4px 16px rgba(0,0,0,.25); direction: rtl; font-size: 13px; color: #1b2b34; }
#kb-cmp[hidden] { display: none; }
#kb-cmp h4 { margin: 4px 0 6px; font-size: 12px; color: #5b6b76; font-weight: normal; }
#kb-cmp .kb-row { display: flex; gap: 6px; margin-bottom: 8px; }
#kb-cmp .kb-row button { flex: 1; border: 1px solid #c8d2d9; background: #f4f8fa; color: #1b2b34; border-radius: 8px; padding: 4px 0;
                         font: inherit; font-size: 12px; cursor: pointer; }
#kb-cmp .kb-row button.kb-on { background: #1f6f8b; border-color: #1f6f8b; color: #fff; }
#kb-cmp .kb-reset { border: 0; background: none; color: #1f6f8b; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }
