/* ============================================================
   ذكاء الآن — نظام التصميم
   عربي RTL · خط Cairo · متغيرات CSS
   ============================================================ */

/* ---------- 1. المتغيرات ---------- */
:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --brand-ink: #1e1b4b;

  --accent: #f59e0b;
  --ok: #059669;
  --warn: #d97706;
  --err: #dc2626;

  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --surface: #ffffff;

  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;

  --line: #e2e8f0;
  --line-2: #cbd5e1;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, .12);

  --wrap: 1160px;
  --font: 'Cairo', 'Tajawal', 'Segoe UI', 'Noto Sans Arabic', system-ui, sans-serif;
  --mono: 'Fira Code', ui-monospace, Consolas, monospace;
}

[data-theme='dark'] {
  --bg: #0b1120;
  --bg-2: #111827;
  --bg-3: #1a2236;
  --surface: #131c2f;

  --text: #e9eefb;
  --text-2: #a5b2cc;
  --text-3: #6b7a99;

  --line: #243049;
  --line-2: #2f3d5c;

  --brand-soft: #1c2547;
  --brand-ink: #e0e7ff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 18px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}

/* ---------- 2. الأساسيات ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  font-size: 17px;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-2); }

h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .6em; font-weight: 800; letter-spacing: -.2px; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p { margin: 0 0 1.1em; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.wrap-narrow { max-width: 760px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 10px; z-index: 999;
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 8px;
}
.skip-link:focus { inset-inline-start: 16px; color: #fff; }

/* ---------- 3. الترويسة ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-in {
  display: flex; align-items: center; gap: 20px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.25rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 11px; color: #fff; font-size: 1.15rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
}
.brand-name span { color: var(--brand); }

.nav { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.nav a {
  padding: 8px 14px; border-radius: 9px; color: var(--text-2);
  font-weight: 600; font-size: .95rem;
}
.nav a:hover { background: var(--bg-3); color: var(--text); }
.nav a.active { color: var(--brand); background: var(--brand-soft); }

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

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 1.05rem;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

.menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .nav {
    position: absolute; inset-inline: 0; top: 68px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px; box-shadow: var(--shadow); display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

/* ---------- 4. الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 11px; border: 1px solid transparent;
  font-family: var(--font); font-size: .97rem; font-weight: 700;
  cursor: pointer; transition: transform .12s, box-shadow .12s, background .15s;
  text-decoration: none; line-height: 1.5;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 6px 18px rgba(79, 70, 229, .3);
}
.btn-primary:hover { color: #fff; box-shadow: 0 10px 26px rgba(79, 70, 229, .4); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { color: var(--brand-2); }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- 5. القسم البطل ---------- */
.hero {
  padding: 70px 0 60px;
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(700px 380px at 10% 0%, color-mix(in srgb, var(--brand-2) 12%, transparent), transparent 70%);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 1.12rem; color: var(--text-2); max-width: 54ch; margin-bottom: 1.6em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 1.6em; }
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 1.5rem; color: var(--brand); line-height: 1.2; }
.hero-stats span { font-size: .88rem; color: var(--text-2); }

.hero-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-lg);
}
.hero-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.hero-card pre {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; font-family: var(--mono); font-size: .78rem; line-height: 1.75;
  overflow-x: auto; margin: 0; color: var(--text-2); direction: ltr; text-align: left;
}
.hero-card pre .k { color: var(--brand); font-weight: 700; }
.hero-card pre .s { color: var(--ok); }
.hero-card pre .c { color: var(--text-3); font-style: italic; }

@media (max-width: 900px) {
  .hero { padding: 46px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
}

/* ---------- 6. الأقسام ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head p { color: var(--text-2); margin: 0; max-width: 62ch; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 800; letter-spacing: .4px;
  color: var(--brand); background: var(--brand-soft);
  padding: 5px 13px; border-radius: 999px; margin-bottom: 12px;
}

/* ---------- 7. الشبكات والبطاقات ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 940px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.card h3 { margin-bottom: .4em; font-size: 1.08rem; }
.card h3 a { color: inherit; }
.card p { color: var(--text-2); font-size: .94rem; margin-bottom: 1em; flex: 1; }

.chip {
  display: inline-block; font-size: .76rem; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
  background: var(--bg-3); color: var(--text-2);
}
.chip-brand { background: var(--brand-soft); color: var(--brand); }

.card-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: .8rem; color: var(--text-3); margin-top: auto;
}

.tool-icon {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 12px; font-size: 1.4rem; margin-bottom: 14px;
  background: var(--brand-soft);
}

/* ---------- 8. تنسيق المقال (الأهم للمحتوى) ---------- */
.article-head { padding: 44px 0 26px; border-bottom: 1px solid var(--line); }
.breadcrumb { font-size: .85rem; color: var(--text-3); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb span::after { content: '‹'; margin: 0 7px; opacity: .55; }

.article-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: .86rem; color: var(--text-3); margin-top: 16px;
}
.article-meta b { color: var(--text-2); font-weight: 700; }

.prose { font-size: 1.07rem; line-height: 2; color: var(--text); padding: 34px 0 20px; }
.prose h2 {
  margin-top: 1.9em; padding-inline-start: 14px;
  border-inline-start: 4px solid var(--brand); font-size: 1.5rem;
}
.prose h3 { margin-top: 1.5em; font-size: 1.18rem; color: var(--text); }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin-bottom: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--brand); font-weight: 700; }

.prose blockquote {
  margin: 1.7em 0; padding: 18px 22px;
  background: var(--brand-soft); border-inline-start: 4px solid var(--brand);
  border-radius: var(--radius-sm); color: var(--text-2); font-size: 1rem;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose table {
  width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .93rem;
  display: block; overflow-x: auto;
}
.prose th, .prose td { padding: 11px 14px; border: 1px solid var(--line); text-align: right; }
.prose th { background: var(--bg-3); font-weight: 800; white-space: nowrap; }

.callout {
  padding: 18px 22px; border-radius: var(--radius); margin: 1.7em 0;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  background: var(--brand-soft);
}
.callout.warn { background: color-mix(in srgb, var(--warn) 10%, var(--bg-2)); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.callout.ok { background: color-mix(in srgb, var(--ok) 10%, var(--bg-2)); border-color: color-mix(in srgb, var(--ok) 32%, var(--line)); }
.callout-title { font-weight: 800; margin-bottom: .4em; display: flex; align-items: center; gap: 8px; }
.callout p:last-child { margin-bottom: 0; }

.code-block {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 15px 18px; font-family: var(--mono); font-size: .86rem; line-height: 1.8;
  overflow-x: auto; direction: ltr; text-align: left; margin: 1.5em 0;
}

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step; position: relative;
  padding-inline-start: 56px; margin-bottom: 1.3em; min-height: 40px;
}
.steps li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 2px;
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; font-size: 1rem;
}

.faq { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1.6em 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  padding: 15px 20px; cursor: pointer; font-weight: 700;
  background: var(--bg-2); list-style: none; display: flex;
  align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.3rem; color: var(--brand); font-weight: 800; flex-shrink: 0; }
.faq details[open] summary::after { content: '−'; }
.faq .faq-body { padding: 16px 20px; color: var(--text-2); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* جدول محتويات */
.toc {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; margin: 30px 0;
}
.toc-title { font-weight: 800; margin-bottom: .7em; display: flex; align-items: center; gap: 8px; }
.toc ol { margin: 0; padding-inline-start: 1.3em; }
.toc li { margin-bottom: .35em; }
.toc a { color: var(--text-2); font-size: .93rem; }
.toc a:hover { color: var(--brand); }

/* ---------- 9. الأدوات ---------- */
.tool-hero { padding: 40px 0 26px; border-bottom: 1px solid var(--line); }
.tool-layout { display: grid; grid-template-columns: 1fr 320px; gap: 34px; padding: 32px 0 60px; align-items: start; }
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}
.panel-title { font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; font-size: 1.05rem; }

.field { margin-bottom: 17px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 7px; color: var(--text-2); }
.field .hint { font-size: .82rem; color: var(--text-3); font-weight: 500; margin-top: 5px; display: block; }

.input, .textarea, .select {
  width: 100%; padding: 12px 15px; font-family: var(--font); font-size: .97rem;
  color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.textarea { min-height: 170px; resize: vertical; line-height: 1.8; }
.textarea-lg { min-height: 260px; }
.select { cursor: pointer; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

.result-box {
  margin-top: 22px; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg-2);
}
.result-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; background: var(--bg-3); border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: .9rem;
}
.result-body {
  padding: 20px; white-space: pre-wrap; word-break: break-word;
  line-height: 1.9; font-size: .98rem; min-height: 110px;
}
.result-body.empty { color: var(--text-3); text-align: center; padding: 42px 20px; }

.alert { padding: 13px 17px; border-radius: var(--radius-sm); font-size: .92rem; margin-bottom: 16px; font-weight: 600; }
.alert-err { background: color-mix(in srgb, var(--err) 10%, var(--bg-2)); color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 30%, var(--line)); }
.alert-info { background: var(--brand-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); }
.alert-warn { background: color-mix(in srgb, var(--warn) 10%, var(--bg-2)); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line)); }

.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.related { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 40px; }

/* ---------- 10. النشرة البريدية ---------- */
.newsletter-box {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-radius: var(--radius-lg); padding: 38px; text-align: center;
}
.newsletter-box h2 { color: #fff; margin-bottom: .3em; }
.newsletter-box p { color: rgba(255,255,255,.9); max-width: 56ch; margin-inline: auto; }
.newsletter-form { display: flex; gap: 10px; max-width: 470px; margin: 22px auto 0; }
.newsletter-form input {
  flex: 1; padding: 13px 18px; border-radius: 11px; border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.14); color: #fff; font-family: var(--font); font-size: .97rem;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.7); }
.newsletter-form input:focus { outline: none; background: rgba(255,255,255,.22); }
@media (max-width: 560px) { .newsletter-form { flex-direction: column; } }

/* ---------- 11. الإعلانات ---------- */
.ad-slot {
  margin: 26px 0; text-align: center;
  background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 10px, var(--bg-3) 10px, var(--bg-3) 20px);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  overflow: hidden; min-height: 92px;
  display: flex; align-items: center; justify-content: center;
}
.ad-slot[data-size='leaderboard'] { min-height: 118px; }
.ad-slot[data-size='rect'] { min-height: 268px; }
.ad-label {
  font-size: .68rem; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 1.4px; font-weight: 700; margin-bottom: 4px;
}
.ad-inner { padding: 14px; }
.ad-placeholder-note { font-size: .8rem; color: var(--text-3); }

/* ---------- 12. التذييل ---------- */
.site-footer {
  background: var(--bg-2); border-top: 1px solid var(--line);
  padding: 46px 0 26px; margin-top: 60px;
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 34px; margin-bottom: 34px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-size: .95rem; margin-bottom: .8em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .5em; }
.footer-grid a { color: var(--text-2); font-size: .92rem; }
.footer-grid a:hover { color: var(--brand); }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 20px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .85rem; color: var(--text-3);
}
.site-footer .brand { color: var(--text); }

/* ---------- 13. لوحة التحكم ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 800px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-side { background: var(--bg-2); border-inline-end: 1px solid var(--line); padding: 20px 14px; }
.admin-side h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); margin: 18px 10px 8px; }
.admin-side a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: .92rem;
}
.admin-side a:hover { background: var(--bg-3); color: var(--text); }
.admin-side a.active { background: var(--brand-soft); color: var(--brand); }
.admin-main { padding: 28px; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.admin-bar h1 { margin: 0; font-size: 1.5rem; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.stat b { display: block; font-size: 1.75rem; color: var(--brand); line-height: 1.3; }
.stat span { font-size: .84rem; color: var(--text-2); font-weight: 600; }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; font-size: .9rem; }
.bar-row .lbl { flex: 0 0 42%; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 9px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; }
.bar-row .val { flex: 0 0 auto; font-weight: 700; color: var(--text-2); min-width: 42px; text-align: left; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .93rem; }
.switch input { display: none; }
.switch .track {
  width: 44px; height: 25px; border-radius: 999px; background: var(--line-2);
  position: relative; transition: background .18s; flex-shrink: 0;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; inset-inline-end: 3px;
  width: 19px; height: 19px; border-radius: 50%; background: #fff;
  transition: transform .18s; box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(-19px); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.tab {
  padding: 11px 18px; border: 0; background: none; cursor: pointer;
  font-family: var(--font); font-size: .95rem; font-weight: 700;
  color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- 14. متفرقات ---------- */
.breadcrumb-list { font-size: .85rem; color: var(--text-3); }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-state .big { font-size: 3rem; margin-bottom: 12px; }

.to-top {
  position: fixed; inset-inline-start: 22px; bottom: 22px; z-index: 40;
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--brand); border-color: var(--brand); }

@media print {
  .site-header, .site-footer, .ad-slot, .newsletter-box, .to-top, .tool-layout .panel { display: none !important; }
  body { font-size: 12pt; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}