:root {
  --bg0: #eef4ff;
  --bg1: #f3eeff;
  --bg2: #e7f7ff;
  --text: #0b1424;
  --text2: #3d4b66;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent2: #8b5cf6;
  --accent3: #06b6d4;
  --accent-h: #2563eb;
  --accent-s: rgba(59,130,246,.14);
  --grad-brand: linear-gradient(135deg, #3b82f6, #8b5cf6 55%, #06b6d4);
  --glass: linear-gradient(160deg, rgba(255,255,255,.74), rgba(255,255,255,.38));
  --glass-strong: linear-gradient(160deg, rgba(255,255,255,.9), rgba(255,255,255,.55));
  --glass-chip: rgba(255,255,255,.55);
  --glass-brd: rgba(255,255,255,.8);
  --edge: rgba(148,163,184,.28);
  --shadow-sm: 0 4px 18px rgba(30,41,59,.08);
  --shadow: 0 12px 44px rgba(30,41,59,.13);
  --shadow-lg: 0 28px 90px rgba(30,41,59,.2);
  --glow: rgba(59,130,246,.38);
  --glow2: rgba(139,92,246,.3);
  --header-bg: rgba(244,249,255,.62);
}

html.theme-dark {
  --bg0: #05080f;
  --bg1: #0a0e1d;
  --bg2: #071019;
  --text: #e8eef7;
  --text2: #9aa8bf;
  --muted: #67748e;
  --accent: #60a5fa;
  --accent2: #a78bfa;
  --accent3: #22d3ee;
  --accent-s: rgba(96,165,250,.15);
  --grad-brand: linear-gradient(135deg, #60a5fa, #a78bfa 55%, #22d3ee);
  --glass: linear-gradient(160deg, rgba(22,30,48,.78), rgba(13,18,32,.52));
  --glass-strong: linear-gradient(160deg, rgba(26,35,56,.9), rgba(16,22,38,.66));
  --glass-chip: rgba(255,255,255,.05);
  --glass-brd: rgba(255,255,255,.1);
  --edge: rgba(148,163,184,.17);
  --shadow-sm: 0 4px 18px rgba(0,0,0,.35);
  --shadow: 0 12px 44px rgba(0,0,0,.5);
  --shadow-lg: 0 28px 90px rgba(0,0,0,.65);
  --glow: rgba(96,165,250,.4);
  --glow2: rgba(167,139,250,.32);
  --header-bg: rgba(7,11,20,.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
html.theme-dark { color-scheme: dark; }

body {
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 600px at 85% -10%, var(--accent-s), transparent 60%),
    radial-gradient(900px 520px at -10% 40%, rgba(139,92,246,.12), transparent 55%),
    radial-gradient(800px 500px at 70% 110%, rgba(6,182,212,.10), transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 45%, var(--bg2));
  transition: background .45s ease, color .45s ease;
}

::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--accent2));
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.bg-glow { position: fixed; border-radius: 50%; filter: blur(110px); pointer-events: none; z-index: 0; }
.bg-glow-1 { width: 520px; height: 520px; background: var(--accent); top: -160px; right: -120px; opacity: .16; }
.bg-glow-2 { width: 430px; height: 430px; background: var(--accent2); bottom: 15%; left: -120px; opacity: .12; }
.bg-glow-3 { width: 320px; height: 320px; background: var(--accent3); top: 45%; right: 8%; opacity: .09; }
html.theme-dark .bg-glow-1 { opacity: .13; }
html.theme-dark .bg-glow-2 { opacity: .1; }
html.theme-dark .bg-glow-3 { opacity: .07; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.4), inset 0 -1px 0 rgba(255,255,255,.05);
}
.glass-strong {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(255,255,255,.06);
}
.gradient-text {
  background: url("/mahvexlogo.png") center/cover no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 600;
  font-size: .92rem;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s;
  white-space: nowrap;
  min-height: 48px;
  min-width: 48px;
}
.btn-ghost { color: var(--text2); background: var(--glass-chip); border: 1px solid var(--edge); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 8px 24px var(--glow), inset 0 1px 0 rgba(255,255,255,.35);
  overflow: hidden;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px var(--glow), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -70%;
  width: 45%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
  pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }
.btn-full { width: 100%; padding: 14px; margin-top: 4px; }

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--glass-brd);
  box-shadow: 0 8px 30px rgba(30,41,59,.06);
}
html.theme-dark .header { box-shadow: 0 8px 30px rgba(0,0,0,.35); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 12px;
  position: relative;
  flex-wrap: nowrap;
  min-height: 60px;
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  order: 0;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 13px;
  align-items: center;
  justify-content: center;
  background: var(--glass-chip);
  border: 1px solid var(--edge);
  transition: all .25s ease;
}
.hamburger:hover { border-color: var(--accent); transform: translateY(-1px); }
.hamburger span { width: 22px; height: 2.5px; background: var(--text); border-radius: 2px; transition: transform .3s ease, opacity .3s ease; }
.hamburger.active span:nth-child(1){ transform: translateY(7.5px) rotate(45deg); }
.hamburger.active span:nth-child(2){ opacity: 0; }
.hamburger.active span:nth-child(3){ transform: translateY(-7.5px) rotate(-45deg); }

.social-icons {
  display: flex;
  gap: 4px;
  align-items: center;
}
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glass-chip);
  border: 1px solid var(--edge);
  color: var(--text2);
  text-decoration: none;
  font-size: .8rem;
  transition: all .25s ease;
}
.social-icons a:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-s); }
.social-icons a.instagram:hover { color: #E4405F; border-color: #E4405F; }
.social-icons a.telegram:hover { color: #0088cc; border-color: #0088cc; }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.3rem;
  flex: 0 0 auto;
  order: 1;
  margin: 0 auto;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: url('/mahvexlogo.png') center/cover no-repeat;
  display: grid;
  place-items: center;
  color: transparent;
  box-shadow: 0 6px 18px var(--glow), inset 0 1px 0 rgba(255,255,255,.45);
  font-weight: 800;
  font-size: 1rem;
  transition: transform .3s ease;
  overflow: hidden;
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.logo-dot { width: 7px; height: 7px; background: var(--accent2); border-radius: 50%; animation: pulse 2.2s infinite; }
.logo-text { font-weight: 800; font-size: 1.2rem; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  order: 2;
}

.lang-selector { position: relative; display: inline-block; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--glass-chip);
  color: var(--text);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
  min-height: 32px;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 120px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-brd);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  display: none;
  z-index: 300;
}
.lang-dropdown.open { display: block; animation: fadeIn .2s ease; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .18s ease;
  font-weight: 500;
  font-size: .75rem;
  color: var(--text2);
  background: none;
  border: none;
  width: 100%;
  text-align: right;
}
.lang-option:hover { background: var(--accent-s); color: var(--accent); }
.lang-option.active { background: var(--accent-s); color: var(--accent); }
.lang-option .flag { font-size: .9rem; }
html[dir="rtl"] .lang-dropdown { right: auto; left: 0; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  background: var(--glass-chip);
  border: 1px solid var(--edge);
  font-size: .9rem;
  transition: all .25s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px var(--accent-s); }

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.menu-overlay.open { opacity: 1; visibility: visible; }
.menu-overlay .menu-content {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(32px);
  backdrop-filter: blur(32px);
  border: 1px solid var(--glass-brd);
  border-radius: 28px;
  padding: 32px 36px;
  max-width: 400px;
  width: 90%;
  transform: scale(0.92) translateY(20px);
  transition: transform .4s cubic-bezier(.2,.8,.3,1.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-lg);
}
.menu-overlay.open .menu-content { transform: scale(1) translateY(0); }
.menu-overlay .menu-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.8rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  transition: transform .2s;
  z-index: 10;
}
.menu-overlay .menu-close:hover { transform: rotate(90deg); color: var(--text); }
html[dir="rtl"] .menu-overlay .menu-close { right: auto; left: 20px; }
.menu-overlay .menu-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text2);
  transition: all .2s ease;
  text-decoration: none;
  min-height: 52px;
}
.menu-overlay .menu-link:hover { background: var(--accent-s); color: var(--accent); transform: translateX(-4px); }
.menu-overlay .menu-link i { width: 22px; color: var(--accent); }
html[dir="rtl"] .menu-overlay .menu-link:hover { transform: translateX(4px); }

.hero { position: relative; padding: 50px 0 70px; z-index: 1; }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--accent);
  border: 1px solid var(--glass-brd);
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.4);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.2);
  animation: pulse 2s infinite;
}
.hero-title { font-size: 2.8rem; font-weight: 800; line-height: 1.28; margin-bottom: 18px; letter-spacing: -.5px; }
.hero-desc { font-size: 1.05rem; color: var(--text2); margin-bottom: 28px; max-width: 500px; }

.hero-image { display: flex; justify-content: center; align-items: center; }
.hero-logo {
  width: 100%;
  max-width: 380px;
  height: auto;
  aspect-ratio: 1/1;
  border-radius: 40px;
  background: radial-gradient(ellipse at center, #0a0a1a, #000000);
  box-shadow: 0 20px 60px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05), 0 0 80px rgba(68,136,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.hero-logo:hover { transform: scale(1.02); box-shadow: 0 25px 70px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.08), 0 0 120px rgba(68,136,255,0.12); }
.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 24px;
  filter: drop-shadow(0 0 30px rgba(68,136,255,0.15));
  transition: filter 0.4s ease;
}
.hero-logo:hover img { filter: drop-shadow(0 0 50px rgba(68,136,255,0.25)); }

.categories { padding: 30px 0 50px; position: relative; z-index: 1; }
.features { padding: 20px 0 70px; position: relative; z-index: 1; }
.page-section { padding: 50px 0; position: relative; z-index: 1; border-top: 1px solid var(--edge); }

.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 32px;
  text-align: center;
  position: relative;
  display: block;
}
.section-title::after {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 4px;
  background: var(--grad-brand);
  box-shadow: 0 4px 14px var(--glow);
}

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.category-card {
  display: block;
  padding: 24px 20px;
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .35s cubic-bezier(.2,.7,.3,1.2), box-shadow .35s ease, border-color .35s ease;
}
.category-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent), 0 20px 50px var(--glow), inset 0 1px 0 rgba(255,255,255,.5);
  transform: translateY(-6px);
}
.category-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 1.5rem;
  color: var(--accent);
  background: linear-gradient(145deg, var(--accent-s), rgba(139,92,246,.14));
  border: 1px solid var(--glass-brd);
  box-shadow: 0 8px 22px var(--accent-s), inset 0 1px 0 rgba(255,255,255,.4);
}
.category-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.category-card p { font-size: .85rem; color: var(--text2); line-height: 1.6; }

.feature-card {
  padding: 24px 20px;
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .35s cubic-bezier(.2,.7,.3,1.2), box-shadow .35s ease, border-color .35s ease;
}
.feature-card:hover {
  border-color: var(--accent2);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent2), 0 20px 50px var(--glow2), inset 0 1px 0 rgba(255,255,255,.5);
  transform: translateY(-6px);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 1.5rem;
  color: var(--accent2);
  background: linear-gradient(145deg, rgba(139,92,246,.16), var(--accent-s));
  border: 1px solid var(--glass-brd);
  box-shadow: 0 8px 22px var(--glow2), inset 0 1px 0 rgba(255,255,255,.4);
}
.feature-card h3 { font-size: 1rem; margin-bottom: 6px; font-weight: 700; }
.feature-card p { color: var(--text2); font-size: .85rem; }

.footer {
  border-top: 1px solid var(--glass-brd);
  padding: 32px 0 24px;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(139,92,246,.05));
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand .logo-text { font-size: 1.2rem; font-weight: 800; }
.footer-brand p { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links button {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text2);
  padding: 6px 10px;
  border-radius: 10px;
  transition: color .2s, background .2s;
  min-height: 40px;
}
.footer-links button:hover { color: var(--accent); background: var(--accent-s); }
.copyright { width: 100%; text-align: center; font-size: .8rem; color: var(--muted); margin-top: 10px; }

.news-ticker {
  position: relative;
  z-index: 95;
  display: flex;
  align-items: stretch;
  background: linear-gradient(90deg, #0f172a, #1e293b 40%, #312e81);
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255,255,255,.12);
  overflow: hidden;
  height: 36px;
}
.news-ticker[hidden] { display: none; }
.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  white-space: nowrap;
  will-change: transform;
  animation: tickerMove 25s linear infinite;
}
.ticker-item {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  color: #e2e8f0;
  padding: 0 4px;
}
@keyframes tickerMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.toast-box {
  position: fixed;
  bottom: 30px;
  right: 50%;
  transform: translateX(50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 16px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.5);
  animation: toastIn .4s cubic-bezier(.2,.8,.3,1.1);
  pointer-events: auto;
  max-width: min(380px, 88vw);
  text-align: center;
}
.toast.hide { animation: toastOut .35s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px) scale(.95); } }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,12,24,.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 26px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.55);
  position: relative;
  animation: modalIn .35s cubic-bezier(.2,.8,.3,1.05);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(26px) scale(.96) rotateX(4deg); }
  to   { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute;
  top: 14px; left: 16px;
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 1.4rem;
  color: var(--muted);
  line-height: 1;
  z-index: 2;
  transition: all .2s ease;
}
.modal-close:hover { color: var(--text); background: var(--accent-s); transform: rotate(90deg); }
.info-modal { max-width: 600px; padding: 30px 24px; }
.info-modal h2 { font-size: 1.3rem; margin-bottom: 14px; font-weight: 800; }
.info-modal .info-body { color: var(--text2); line-height: 1.9; font-size: .9rem; }
.info-modal .info-body p { margin-bottom: 12px; }

.items-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.sq-card {
  aspect-ratio: 1;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s;
}
.sq-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.sq-card-img {
  height: 48%;
  background: linear-gradient(135deg, var(--accent-s), rgba(139,92,246,.12));
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--accent);
}
.sq-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
.sq-card-body h3 { font-size: .85rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sq-card-body .sub { font-size: .72rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sq-card-stats { margin-top: auto; display: flex; gap: 10px; font-size: .72rem; font-weight: 600; color: var(--text2); align-items: center; flex-wrap: wrap; }

.zoom-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease, visibility .4s ease;
}
.zoom-modal.open { opacity: 1; visibility: visible; }
.zoom-modal .zoom-content {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(32px);
  backdrop-filter: blur(32px);
  border: 1px solid var(--glass-brd);
  border-radius: 28px;
  padding: 32px 30px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform .4s cubic-bezier(.2,.8,.3,1.2);
  position: relative;
}
.zoom-modal.open .zoom-content { transform: scale(1) translateY(0); }
.zoom-content .zoom-close {
  position: absolute;
  top: 14px; left: 18px;
  font-size: 1.6rem;
  color: var(--muted);
  cursor: pointer;
  background: none; border: none;
  transition: transform .2s;
}
.zoom-content .zoom-close:hover { transform: rotate(90deg); color: var(--text); }
.zoom-content .zoom-icon { font-size: 3.5rem; color: var(--accent); margin-bottom: 10px; }
.zoom-content .zoom-icon img { max-width: 100%; max-height: 120px; border-radius: 12px; }
.zoom-content h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.zoom-content .zoom-sub { color: var(--text2); font-size: .95rem; margin-bottom: 14px; }
.zoom-content .zoom-long { color: var(--text2); line-height: 1.9; margin-bottom: 18px; white-space: pre-wrap; font-size: .9rem; }
.zoom-content .zoom-body { color: var(--text2); line-height: 2; white-space: pre-wrap; font-size: .9rem; }
.zoom-content .zoom-links { display: flex; flex-direction: column; gap: 8px; }
.zoom-content .zoom-links a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: var(--glass-chip);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.zoom-content .zoom-links a:hover { border-color: var(--accent); transform: translateX(-4px); }
.zoom-content .zoom-links .dl-url { font-weight: 700; color: var(--accent); font-size: .85rem; word-break: break-all; }
.zoom-content .zoom-links .dl-note { font-size: .78rem; color: var(--muted); }

.main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
  padding: 6px;
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.4);
}
.main-tab {
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .82rem;
  color: var(--text2);
  transition: all .25s ease;
  min-height: 40px;
}
.main-tab:hover { color: var(--accent); }
.main-tab.active {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 6px 18px var(--glow), inset 0 1px 0 rgba(255,255,255,.35);
  transform: translateY(-1px);
}
.sub-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.sub-tab {
  padding: 6px 12px;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text2);
  background: var(--glass-chip);
  border: 1px solid var(--edge);
  transition: all .22s ease;
  min-height: 34px;
}
.sub-tab:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.sub-tab.active {
  background: var(--accent-s);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 14px var(--accent-s);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.news-card {
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s, border-color .25s;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.news-card-img {
  height: 120px;
  background: linear-gradient(135deg, var(--accent-s), rgba(139,92,246,.14));
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--accent);
}
.news-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.news-source {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-s);
  border-radius: 100px;
  padding: 2px 10px;
}
.news-card h3 { font-size: .88rem; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card .sub { font-size: .75rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-date { font-size: .65rem; color: var(--muted); margin-right: auto; }

.radar-wrap {
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.4);
  overflow: hidden;
}
.radar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--glass-brd);
  font-size: .78rem;
  color: var(--muted);
  background: var(--glass-chip);
}
.radar-live { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #16a34a; }
.radar-live::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.22);
  animation: pulse 1.8s infinite;
}
.radar-table-wrap { overflow-x: auto; }
.radar-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.radar-table th, .radar-table td { padding: 12px 16px; text-align: right; }
.radar-table thead { background: var(--glass-chip); border-bottom: 1px solid var(--glass-brd); }
.radar-table th { font-weight: 700; color: var(--text2); font-size: .82rem; }
.radar-table tbody tr { border-bottom: 1px solid var(--glass-brd); transition: background .2s ease; }
.radar-table tbody tr:last-child { border-bottom: none; }
.radar-table tbody tr:hover { background: var(--accent-s); }
.radar-domain { font-weight: 700; font-family: ui-monospace, Consolas, monospace; }
.radar-ping-cell {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, Consolas, monospace;
  min-width: 65px;
  display: inline-block;
}
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
}
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-fast { background: rgba(34,197,94,.16); color: #15803d; }
.status-slow { background: rgba(217,119,6,.16); color: #b45309; }
.status-offline { background: rgba(239,68,68,.15); color: #b91c1c; }
.status-unknown { background: rgba(100,116,139,.18); color: #475569; }
html.theme-dark .status-fast { color: #4ade80; }
html.theme-dark .status-slow { color: #fbbf24; }
html.theme-dark .status-offline { color: #f87171; }
html.theme-dark .status-unknown { color: #94a3b8; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: .95rem;
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1.5px dashed var(--edge);
  box-shadow: var(--shadow-sm);
}
.empty-state .empty-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: var(--muted);
  background: var(--glass-chip);
  border: 1px solid var(--edge);
}

#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px var(--glow);
  font-size: 1rem;
  cursor: pointer;
  transition: all .3s ease;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
#backToTop.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
#backToTop:hover { transform: translateY(-2px) scale(1.05); }
html.dir-rtl #backToTop { right: auto; left: 20px; }

/* ============================================================ */
/* ===== RESPONSIVE - TABLET (768px - 1024px) ===== */
/* ============================================================ */
@media (max-width: 1024px) {
  .container { padding: 0 20px; }
  .hero-title { font-size: 2.2rem; }
  .items-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .news-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .hero-logo { max-width: 280px; padding: 22px; }
  .section-title { font-size: 1.5rem; }
}

/* ============================================================ */
/* ===== RESPONSIVE - MOBILE (< 768px) ===== */
/* کاملاً مستقل از دسکتاپ */
/* ============================================================ */
@media (max-width: 768px) {
  /* ===== BODY & TYPOGRAPHY ===== */
  body { font-size: 16px; line-height: 1.7; }
  .container { padding: 0 20px; }

  /* ===== HEADER - MOBILE ONLY ===== */
  .header-inner {
    padding: 12px 0;
    gap: 12px;
    min-height: 64px;
    flex-wrap: nowrap;
  }
  .nav-wrap { gap: 8px; order: 0; }
  .logo { font-size: 1.2rem; order: 1; margin: 0 auto; }
  .logo-mark { width: 34px; height: 34px; font-size: 1rem; border-radius: 10px; }
  .logo-text { font-size: 1.15rem; }
  .logo-dot { width: 7px; height: 7px; }
  .header-actions { gap: 6px; order: 2; }

  .hamburger {
    width: 44px;
    height: 44px;
    padding: 11px;
    gap: 5px;
    border-radius: 12px;
  }
  .hamburger span { width: 22px; height: 2.5px; }

  .social-icons a { width: 34px; height: 34px; font-size: .8rem; }

  .lang-toggle {
    font-size: .75rem;
    padding: 6px 12px;
    min-height: 36px;
    border-radius: 10px;
  }
  .lang-dropdown { min-width: 140px; }
  .lang-option { font-size: .85rem; padding: 10px 14px; }

  .icon-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: 12px;
  }

  /* ===== MENU OVERLAY ===== */
  .menu-overlay .menu-content {
    padding: 28px 24px;
    max-width: 340px;
    border-radius: 24px;
  }
  .menu-overlay .menu-link {
    font-size: 1rem;
    padding: 14px 16px;
    min-height: 52px;
    gap: 14px;
  }
  .menu-overlay .menu-link i { width: 22px; font-size: 1rem; }
  .menu-overlay .menu-close { font-size: 1.5rem; top: 12px; right: 16px; }

  /* ===== HERO - SINGLE COLUMN ===== */
  .hero { padding: 40px 0 50px; }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  .hero-content { order: 1; }
  .hero-image { order: 2; }
  .hero-title {
    font-size: 2rem;
    margin-bottom: 16px;
    line-height: 1.3;
  }
  .hero-desc {
    font-size: 1rem;
    margin-bottom: 24px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .badge {
    font-size: .8rem;
    padding: 8px 16px;
    margin-bottom: 16px;
  }
  .hero-logo {
    max-width: 260px;
    padding: 20px;
    border-radius: 32px;
    margin: 0 auto;
  }

  /* ===== SECTIONS ===== */
  .categories { padding: 30px 0 50px; }
  .features { padding: 20px 0 50px; }
  .page-section { padding: 40px 0; }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 28px;
  }
  .section-title::after { width: 48px; height: 3px; margin: 10px auto 0; }

  /* ===== GRIDS - SINGLE COLUMN ===== */
  .category-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .news-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* ===== CARDS ===== */
  .category-card {
    padding: 22px 20px;
    border-radius: 20px;
  }
  .category-icon {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
    border-radius: 15px;
    margin-bottom: 14px;
  }
  .category-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
  .category-card p { font-size: .9rem; line-height: 1.6; }

  .feature-card {
    padding: 22px 20px;
    border-radius: 20px;
  }
  .feature-icon {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
    border-radius: 14px;
    margin-bottom: 14px;
  }
  .feature-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
  .feature-card p { font-size: .9rem; }

  .sq-card {
    border-radius: 16px;
  }
  .sq-card-img { height: 45%; font-size: 2rem; }
  .sq-card-body { padding: 12px 14px 14px; gap: 6px; }
  .sq-card-body h3 { font-size: .9rem; }
  .sq-card-body .sub { font-size: .8rem; }
  .sq-card-stats { font-size: .75rem; gap: 8px; }

  .news-card {
    border-radius: 16px;
  }
  .news-card-img { height: 160px; font-size: 3rem; }
  .news-card-body { padding: 16px 18px 18px; gap: 8px; }
  .news-card h3 { font-size: 1rem; line-height: 1.4; }
  .news-card .sub { font-size: .85rem; }
  .news-source { font-size: .7rem; padding: 4px 12px; }
  .news-date { font-size: .7rem; }

  /* ===== TABS - SCROLLABLE ===== */
  .main-tabs {
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-tabs::-webkit-scrollbar { display: none; }
  .main-tab {
    padding: 10px 16px;
    font-size: .85rem;
    min-height: 42px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .sub-tabs {
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .sub-tabs::-webkit-scrollbar { display: none; }
  .sub-tab {
    padding: 8px 14px;
    font-size: .8rem;
    min-height: 36px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ===== RADAR TABLE ===== */
  .radar-wrap { border-radius: 18px; }
  .radar-meta {
    padding: 12px 16px;
    font-size: .8rem;
    gap: 10px;
  }
  .radar-table { font-size: .85rem; }
  .radar-table th, .radar-table td { padding: 12px 14px; }
  .radar-table th { font-size: .78rem; }
  .radar-domain { font-size: .8rem; }
  .radar-ping-cell { min-width: 55px; font-size: .8rem; }
  .status-badge { font-size: .72rem; padding: 5px 12px; }

  /* ===== ZOOM MODAL ===== */
  .zoom-modal .zoom-content {
    padding: 24px 20px;
    border-radius: 22px;
    max-height: 88vh;
  }
  .zoom-content h2 { font-size: 1.2rem; margin-bottom: 8px; }
  .zoom-content .zoom-sub { font-size: .9rem; margin-bottom: 14px; }
  .zoom-content .zoom-long { font-size: .88rem; line-height: 1.7; }
  .zoom-content .zoom-body { font-size: .88rem; line-height: 1.8; }
  .zoom-content .zoom-icon { font-size: 2.8rem; margin-bottom: 12px; }
  .zoom-content .zoom-icon img { max-height: 100px; }
  .zoom-content .zoom-links a { padding: 12px 14px; border-radius: 12px; }
  .zoom-content .zoom-links .dl-url { font-size: .82rem; }
  .zoom-content .zoom-links .dl-note { font-size: .75rem; }

  /* ===== FOOTER - VERTICAL ===== */
  .footer { padding: 28px 0 22px; }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 18px;
  }
  .footer-links {
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .footer-links button {
    font-size: .85rem;
    min-height: 40px;
    padding: 8px 12px;
  }
  .footer-brand .logo-text { font-size: 1.15rem; }
  .footer-brand p { font-size: .82rem; }
  .copyright { font-size: .78rem; margin-top: 12px; }

  /* ===== BUTTONS - TOUCH FRIENDLY ===== */
  .btn {
    padding: 12px 20px;
    font-size: .9rem;
    min-height: 48px;
    border-radius: 14px;
  }
  .btn-full { padding: 14px; font-size: .95rem; }

  /* ===== TOAST ===== */
  .toast {
    padding: 14px 20px;
    font-size: .88rem;
    max-width: min(340px, 88vw);
    border-radius: 16px;
  }

  /* ===== TICKER ===== */
  .news-ticker { height: 34px; }
  .ticker-item { font-size: .78rem; }

  /* ===== BACK TO TOP ===== */
  #backToTop {
    width: 48px;
    height: 48px;
    font-size: 1.05rem;
    bottom: 20px;
    right: 20px;
  }
  html.dir-rtl #backToTop { right: auto; left: 20px; }

  /* ===== MAINTENANCE BAR ===== */
  #maintenanceBar {
    padding: 10px 16px !important;
    min-height: 44px !important;
    font-size: .85rem !important;
    gap: 8px !important;
  }
}

/* ============================================================ */
/* ===== RESPONSIVE - SMALL MOBILE (< 480px) ===== */
/* ============================================================ */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }

  /* ===== HEADER ===== */
  .header-inner {
    padding: 10px 0;
    gap: 10px;
    min-height: 60px;
  }
  .logo-mark { width: 32px; height: 32px; font-size: .95rem; border-radius: 9px; }
  .logo-text { font-size: 1.05rem; }
  .logo-dot { width: 6px; height: 6px; }

  .hamburger {
    width: 40px;
    height: 40px;
    padding: 10px;
    gap: 4.5px;
    border-radius: 11px;
  }
  .hamburger span { width: 20px; height: 2.2px; }

  .social-icons a { width: 32px; height: 32px; font-size: .75rem; }

  .lang-toggle {
    font-size: .7rem;
    padding: 5px 10px;
    min-height: 34px;
    border-radius: 9px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    font-size: .95rem;
    border-radius: 11px;
  }

  /* ===== HERO ===== */
  .hero { padding: 30px 0 40px; }
  .hero-inner { gap: 24px; }
  .hero-title { font-size: 1.75rem; margin-bottom: 14px; }
  .hero-desc { font-size: .95rem; margin-bottom: 20px; line-height: 1.7; }
  .badge { font-size: .75rem; padding: 7px 14px; margin-bottom: 14px; }
  .hero-logo { max-width: 220px; padding: 16px; border-radius: 28px; }

  /* ===== SECTIONS ===== */
  .categories { padding: 25px 0 40px; }
  .features { padding: 15px 0 40px; }
  .page-section { padding: 32px 0; }

  .section-title {
    font-size: 1.35rem;
    margin-bottom: 24px;
  }
  .section-title::after { width: 40px; height: 3px; margin: 8px auto 0; }

  /* ===== GRIDS ===== */
  .category-grid { gap: 12px; }
  .features-grid { gap: 12px; }
  .items-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .news-grid { gap: 12px; }

  /* ===== CARDS ===== */
  .category-card { padding: 20px 18px; border-radius: 18px; }
  .category-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    border-radius: 14px;
    margin-bottom: 12px;
  }
  .category-card h3 { font-size: 1rem; }
  .category-card p { font-size: .85rem; }

  .feature-card { padding: 20px 18px; border-radius: 18px; }
  .feature-icon {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    border-radius: 13px;
    margin-bottom: 12px;
  }
  .feature-card h3 { font-size: 1rem; }
  .feature-card p { font-size: .85rem; }

  .sq-card { border-radius: 14px; }
  .sq-card-img { height: 42%; font-size: 1.8rem; }
  .sq-card-body { padding: 10px 12px 12px; }
  .sq-card-body h3 { font-size: .85rem; }
  .sq-card-body .sub { font-size: .75rem; }
  .sq-card-stats { font-size: .72rem; }

  .news-card { border-radius: 14px; }
  .news-card-img { height: 140px; font-size: 2.5rem; }
  .news-card-body { padding: 14px 16px 16px; }
  .news-card h3 { font-size: .95rem; }
  .news-card .sub { font-size: .8rem; }

  /* ===== TABS ===== */
  .main-tabs { padding: 5px; border-radius: 12px; margin-bottom: 18px; }
  .main-tab {
    padding: 9px 14px;
    font-size: .8rem;
    min-height: 40px;
    border-radius: 10px;
  }
  .sub-tabs { gap: 6px; margin-bottom: 16px; }
  .sub-tab {
    padding: 7px 12px;
    font-size: .75rem;
    min-height: 34px;
  }

  /* ===== RADAR ===== */
  .radar-table th, .radar-table td { padding: 10px 12px; font-size: .8rem; }
  .radar-meta { padding: 10px 14px; font-size: .75rem; }
  .radar-ping-cell { min-width: 50px; font-size: .75rem; }
  .status-badge { font-size: .68rem; padding: 4px 10px; }

  /* ===== ZOOM MODAL ===== */
  .zoom-modal .zoom-content { padding: 20px 16px; border-radius: 18px; }
  .zoom-content h2 { font-size: 1.1rem; }
  .zoom-content .zoom-sub { font-size: .85rem; }
  .zoom-content .zoom-long { font-size: .82rem; }
  .zoom-content .zoom-body { font-size: .82rem; }
  .zoom-content .zoom-icon { font-size: 2.4rem; }
  .zoom-content .zoom-icon img { max-height: 80px; }
  .zoom-content .zoom-links a { padding: 10px 12px; border-radius: 10px; }
  .zoom-content .zoom-links .dl-url { font-size: .78rem; }
  .zoom-content .zoom-links .dl-note { font-size: .72rem; }

  /* ===== FOOTER ===== */
  .footer { padding: 24px 0 18px; }
  .footer-inner { gap: 14px; }
  .footer-links { gap: 8px; }
  .footer-links button { font-size: .8rem; min-height: 38px; padding: 7px 10px; }
  .footer-brand .logo-text { font-size: 1.05rem; }
  .footer-brand p { font-size: .78rem; }
  .copyright { font-size: .75rem; }

  /* ===== BUTTONS ===== */
  .btn { padding: 11px 18px; font-size: .85rem; min-height: 46px; border-radius: 12px; }
  .btn-full { padding: 13px; }

  /* ===== TOAST ===== */
  .toast { padding: 12px 18px; font-size: .82rem; max-width: min(300px, 88vw); }

  /* ===== TICKER ===== */
  .news-ticker { height: 30px; }
  .ticker-item { font-size: .72rem; }

  /* ===== BACK TO TOP ===== */
  #backToTop { width: 44px; height: 44px; font-size: 1rem; bottom: 16px; right: 16px; }
  html.dir-rtl #backToTop { right: auto; left: 16px; }

  /* ===== MAINTENANCE BAR ===== */
  #maintenanceBar {
    padding: 8px 14px !important;
    min-height: 40px !important;
    font-size: .8rem !important;
    gap: 6px !important;
  }
}

/* ============================================================ */
/* ===== REDUCED MOTION ===== */
/* ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(1.25); }
}

/* ============================================================ */
/* ===== TOOLS PAGE (Tool Kit) — App-style cards ===== */
/* ============================================================ */

/* Tools grid - small app-style cards */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  padding: 8px 0 40px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.4);
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent), 0 12px 30px var(--accent-s), inset 0 1px 0 rgba(255,255,255,.5);
}

.tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 6px 20px var(--glow), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .3s ease;
}

.tool-card:hover .tool-icon {
  transform: scale(1.08) rotate(-4deg);
}

.tool-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.tool-sub {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.2;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
  .tool-card {
    padding: 16px 10px;
    border-radius: 16px;
    gap: 8px;
  }
  .tool-icon {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    border-radius: 14px;
  }
  .tool-name {
    font-size: .82rem;
  }
  .tool-sub {
    font-size: .65rem;
  }
}

@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .tool-card {
    padding: 14px 8px;
    border-radius: 14px;
  }
  .tool-icon {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    border-radius: 12px;
  }
  .tool-name {
    font-size: .78rem;
  }
  .tool-sub {
    font-size: .6rem;
  }
}

/* ============================================================ */
/* ===== TOOL PAGE STYLES (for individual tools) ===== */
/* ============================================================ */

.tool-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  position: relative;
  z-index: 1;
}

.tool-header {
  text-align: center;
  margin-bottom: 40px;
}

.tool-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-header p {
  color: var(--text2);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.tool-box {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid var(--glass-brd);
  border-radius: 24px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.5);
  padding: 28px;
  margin-bottom: 30px;
}

.tool-box textarea,
.tool-box input[type="text"],
.tool-box input[type="number"],
.tool-box select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: var(--glass-chip);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}

.tool-box textarea:focus,
.tool-box input:focus,
.tool-box select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-s);
}

.tool-box textarea {
  min-height: 180px;
  font-family: 'Inter', 'Vazirmatn', monospace;
  line-height: 1.7;
}

.tool-label {
  display: block;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 8px;
}

.tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .tool-row { grid-template-columns: 1fr; }
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tool-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.tool-stat {
  background: var(--glass-chip);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  transition: all .25s ease;
}

.tool-stat:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tool-stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.tool-stat-label {
  font-size: .78rem;
  color: var(--text2);
  font-weight: 600;
  margin-top: 4px;
}

.tool-output {
  background: var(--glass-chip);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 16px;
  font-family: 'Inter', monospace;
  font-size: .92rem;
  color: var(--text);
  word-break: break-all;
  white-space: pre-wrap;
  min-height: 60px;
  max-height: 400px;
  overflow-y: auto;
}

.tool-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: #dc2626;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 600;
  margin-top: 14px;
}

.tool-success {
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.3);
  color: #16a34a;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 600;
  margin-top: 14px;
}

.tool-help {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: 18px;
  padding: 22px 24px;
  margin-top: 26px;
}

.tool-help h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent);
}

.tool-help p,
.tool-help li {
  color: var(--text2);
  font-size: .92rem;
  line-height: 1.8;
}

.tool-help ul {
  padding-inline-start: 20px;
  margin-top: 8px;
}

.tool-help a {
  color: var(--accent);
  text-decoration: none;
}

.tool-help a:hover {
  text-decoration: underline;
}

.tool-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--text2);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--glass-chip);
  border: 1px solid var(--edge);
  transition: all .2s ease;
}

.tool-back:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateX(-4px);
}

html[dir="rtl"] .tool-back:hover {
  transform: translateX(4px);
}

.tool-copy-btn {
  position: relative;
}

.tool-related {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--edge);
}

.tool-related h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.tool-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .tool-page { padding: 24px 12px 40px; }
  .tool-header h1 { font-size: 1.6rem; }
  .tool-box { padding: 20px; border-radius: 18px; }
  .tool-stat-num { font-size: 1.4rem; }
}
