/* دکمه‌ی تنظیمات نمایش (روشن/تیره/خودکار) — بالا سمت چپ، روی همه‌ی صفحات */
.theme-toggle-btn {
  position: fixed;
  top: 16px;
  inset-inline-end: 16px; /* فارسی: بالا-چپ؛ انگلیسی: بالا-راست (منوی کناری در انگلیسی سمت چپ است) */
  z-index: 9999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card, var(--panel, #fff));
  border: 2px solid var(--border, #f4e3cc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.06), 0 6px 14px rgba(0,0,0,0.1);
  transition: transform .12s ease;
  padding: 0;
}
.theme-toggle-btn:active { transform: scale(0.92); }

.theme-menu {
  position: fixed;
  top: 66px;
  inset-inline-end: 16px;
  z-index: 9999;
  background: var(--card, var(--panel, #fff));
  border: 2px solid var(--border, #f4e3cc);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.15);
  min-width: 170px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.theme-menu.open { display: flex; }

.theme-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: start;
  background: none;
  border: none;
  padding: 11px 12px;
  border-radius: 11px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #2b2320);
}
.theme-menu button:hover { background: var(--bg, #fffaf3); }
.theme-menu button.active {
  background: var(--orange-soft, #ffe4cf);
  color: var(--orange-dark, #e8611a);
}

.theme-menu-hint {
  font-size: 11px;
  color: var(--text-dim, #8a7d70);
  padding: 8px 10px 4px;
  border-top: 1px solid var(--border, #f4e3cc);
  margin-top: 4px;
  line-height: 1.6;
}

/* ---------- منوی دوسطحی چرخ‌دنده ---------- */
/* سطح اول دو گزینه دارد (تنظیمات نور / خروج) و با کلیک روی «تنظیمات نور»
   سطح دوم با سه گزینه‌ی روشن، تیره و خودکار جای آن را می‌گیرد. */
.theme-menu-level { display: flex; flex-direction: column; gap: 6px; }
.theme-menu-level[hidden] { display: none; }

.theme-menu-back {
  font-size: 11px !important;
  opacity: .75;
  padding-block: 6px !important;
}
.theme-menu button.danger { color: #F87171; }
.theme-menu button.danger:hover { background: rgba(239, 68, 68, .12); color: #FCA5A5; }
:root[data-theme='light'] .theme-menu button.danger { color: #DC2626; }
:root[data-theme='light'] .theme-menu button.danger:hover { color: #B91C1C; }

/* گزینه‌ی زبانِ فعال، هم‌رنگ با بقیه‌ی حالت‌های «انتخاب‌شده»ی سایت */
.theme-menu button[data-lang].active {
  background: var(--select-bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--select-edge);
}
.theme-menu-hint[hidden] { display: none; }

/* آیکون پشتیبانی: درست کنار دکمه‌ی چرخ‌دنده (۱۶ + ۴۴ + ۱۰ پیکسل از لبه) با همان اندازه و سایه */
.support-icon-btn {
  position: fixed;
  top: 16px;
  inset-inline-end: 70px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card, var(--panel, #fff));
  border: 2px solid var(--border, #f4e3cc);
  color: var(--text, inherit);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 rgba(0,0,0,0.06), 0 6px 14px rgba(0,0,0,0.1);
  transition: transform .12s ease, border-color .12s ease, color .12s ease;
  text-decoration: none;
}
.support-icon-btn:hover { border-color: var(--orange, #ff8a3d); color: var(--orange-dark, var(--orange, #e8590c)); }
.support-icon-btn:active { transform: scale(0.92); }
