/* ============================================================
   المدونة (/blog/) — ناف وفوتر غامقين زي صفحة الهبوط،
   والمحتوى على خلفية فاتحة عشان القراية تبقى مريحة.
   كل الاتجاهات logical (inline-start/end) فبتشتغل RTL و LTR.
   ============================================================ */
:root {
  --deep: #070c1c;
  --deep-2: #0d1428;
  --deep-line: #1c2846;
  --paper: #f6f8fe;
  --surface: #ffffff;
  --line: #e1e7f5;
  --primary: #2b4bff;
  --primary-dark: #1c34c9;
  --accent: #00b8a0;
  --accent-soft: #e3f8f4;
  --warn: #b7791f;
  --ink: #0f1b33;
  --ink-2: #2c3a5a;
  --ink-soft: #5b6785;
  --on-deep: #eaf0ff;
  --on-deep-mut: #9fb0d6;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif; }
h1, h2, h3, h4 { font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif; line-height: 1.3; }
a { color: var(--primary); }
img { max-width: 100%; height: auto; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.b-container { width: 100%; max-width: 1160px; margin: 0 auto; padding-inline: 24px; }
.b-narrow { max-width: 860px; }

/* ---------- الأزرار ---------- */
.b-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: 1.5px solid transparent;
  font-family: 'Tajawal', sans-serif; font-weight: 700; font-size: 15px;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.b-btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 8px 22px rgba(43,75,255,.28); }
.b-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(43,75,255,.38); }
.b-btn-ghost { color: var(--on-deep); border-color: rgba(255,255,255,.25); }
.b-btn-ghost:hover { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.05); }
.b-btn-sm { padding: 9px 18px; font-size: 14px; }
.b-btn-lg { padding: 15px 30px; font-size: 16.5px; }

/* ---------- الناف بار ---------- */
.b-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,12,28,.86);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.b-nav-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.b-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on-deep); text-decoration: none; font-family: 'Tajawal', sans-serif; font-weight: 900; font-size: 16px; }
.b-nav-links { display: flex; gap: 22px; margin-inline: auto; }
.b-nav-links a { color: var(--on-deep-mut); text-decoration: none; font-size: 14px; font-weight: 600; }
.b-nav-links a:hover, .b-nav-links a[aria-current] { color: var(--on-deep); }
.b-nav-actions { display: flex; align-items: center; gap: 10px; }
.b-lang {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22); color: var(--on-deep); text-decoration: none;
  font-family: 'Tajawal', sans-serif; font-weight: 700; font-size: 13px; white-space: nowrap;
}
.b-lang:hover { border-color: rgba(255,255,255,.55); }

/* ---------- هيرو صفحة المدونة ---------- */
.b-hero {
  background: radial-gradient(900px 380px at 50% -40%, rgba(43,75,255,.45), transparent 70%), var(--deep);
  color: var(--on-deep); text-align: center; padding: 64px 0 72px;
}
.b-eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: #7ff0de; background: rgba(0,184,160,.12); border: 1px solid rgba(0,184,160,.3);
  border-radius: 999px; padding: 5px 14px; margin-bottom: 16px;
}
.b-hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 900; margin: 0 0 14px; }
.b-hero p { color: var(--on-deep-mut); font-size: 17px; max-width: 62ch; margin: 0 auto; }

/* ---------- القائمة ---------- */
.b-list { padding-top: 36px; padding-bottom: 64px; }
.b-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.b-chip {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2);
}
.b-chip:hover { border-color: var(--primary); }
.b-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.b-empty { text-align: center; color: var(--ink-soft); }

.b-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.b-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.b-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(15,27,51,.09); border-color: #c9d4f3; }
.b-card[hidden] { display: none; }
.b-card-link { display: flex; flex-direction: column; height: 100%; padding: 24px; color: inherit; text-decoration: none; }
.b-card-title { font-size: 20px; font-weight: 800; margin: 14px 0 10px; color: var(--ink); }
.b-card-desc { color: var(--ink-soft); font-size: 15px; margin: 0 0 18px; flex: 1; }
.b-card-meta { font-size: 13px; color: var(--ink-soft); display: flex; gap: 6px; flex-wrap: wrap; }

.b-card-cat {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  font-size: 13px; font-weight: 700; padding: 5px 12px 5px 10px; border-radius: 999px;
}
.b-card-cat svg { width: 16px; height: 16px; }
.b-cat-alerts   { background: #fff3e0; color: #a85d00; }
.b-cat-analysis { background: #e8edff; color: var(--primary-dark); }
.b-cat-reports  { background: var(--accent-soft); color: #00796b; }
.b-cat-campaigns { background: #fde8ef; color: #b4235a; }
.b-cat-guides   { background: #f1ebff; color: #5b3cc4; }

/* ---------- رأس المقالة ---------- */
.b-post-head {
  background: radial-gradient(800px 320px at 50% -30%, rgba(43,75,255,.4), transparent 70%), var(--deep);
  color: var(--on-deep); padding: 34px 0 44px;
}
.b-crumbs { font-size: 13.5px; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; color: var(--on-deep-mut); }
.b-crumbs a { color: var(--on-deep-mut); text-decoration: none; }
.b-crumbs a:hover { color: var(--on-deep); }
.b-post-head .b-card-cat { background: rgba(255,255,255,.08); color: #cfe0ff; }
.b-post-head h1 { font-size: clamp(28px, 4.4vw, 42px); font-weight: 900; margin: 16px 0 14px; }
.b-lead { font-size: 18px; color: var(--on-deep-mut); margin: 0 0 24px; max-width: 70ch; }
.b-byline { display: flex; align-items: center; gap: 12px; }
.b-byline img { border-radius: 50%; background: #fff; padding: 3px; }
.b-byline strong { display: block; font-size: 15px; }
.b-byline-meta { font-size: 13.5px; color: var(--on-deep-mut); }

/* ---------- جسم المقالة + الفهرس ---------- */
.b-post-layout {
  display: grid; grid-template-columns: 250px minmax(0, 760px); gap: 48px;
  justify-content: center; padding-top: 40px; padding-bottom: 56px;
}
.b-toc-wrap { position: relative; }
.b-toc {
  position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
}
.b-toc summary { font-family: 'Tajawal', sans-serif; font-weight: 800; cursor: pointer; font-size: 15px; }
.b-toc ol { margin: 12px 0 0; padding-inline-start: 18px; display: grid; gap: 8px; }
.b-toc a { color: var(--ink-2); text-decoration: none; font-size: 14px; line-height: 1.55; }
.b-toc a:hover { color: var(--primary); }
.b-post-layout:not(:has(.b-toc-wrap)) { grid-template-columns: minmax(0, 760px); }

.b-prose { font-size: 18px; line-height: 1.95; color: var(--ink-2); min-width: 0; }
html[lang="en"] .b-prose { font-size: 17.5px; line-height: 1.8; }
.b-prose > :first-child { margin-top: 0; }
.b-prose p { margin: 0 0 1.15em; }
.b-prose h2 { font-size: 27px; font-weight: 800; color: var(--ink); margin: 1.9em 0 .6em; scroll-margin-top: 84px; }
.b-prose h3 { font-size: 21px; font-weight: 800; color: var(--ink); margin: 1.5em 0 .5em; }
.b-prose ul, .b-prose ol { margin: 0 0 1.2em; padding-inline-start: 1.4em; }
.b-prose li { margin-bottom: .45em; }
.b-prose li::marker { color: var(--primary); font-weight: 700; }
.b-prose strong { color: var(--ink); }
.b-prose a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.b-prose code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: .86em; direction: ltr; unicode-bidi: isolate;
  background: #eaf0ff; color: var(--primary-dark); padding: 2px 7px; border-radius: 6px;
}
.b-prose blockquote {
  margin: 1.5em 0; padding: 4px 22px; border-inline-start: 4px solid var(--primary);
  color: var(--ink); font-size: 1.05em; font-weight: 500;
}

/* صناديق ملاحظة / خطوات */
.b-note, .b-tip, .b-warn {
  border-radius: 14px; padding: 16px 20px; margin: 1.5em 0; font-size: 16.5px; line-height: 1.8;
  border: 1px solid var(--line); background: var(--surface);
}
.b-note { border-inline-start: 4px solid var(--primary); }
.b-tip { background: var(--accent-soft); border-color: #bfeee4; border-inline-start: 4px solid var(--accent); }
.b-warn { background: #fff8eb; border-color: #f6dfb4; border-inline-start: 4px solid #e8a33d; }
.b-note > :last-child, .b-tip > :last-child, .b-warn > :last-child { margin-bottom: 0; }

.b-steps { counter-reset: step; list-style: none; padding: 0 !important; }
.b-steps > li {
  counter-increment: step; position: relative; padding-inline-start: 52px; margin-bottom: 1.1em;
}
.b-steps > li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 2px;
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-family: 'Tajawal', sans-serif; font-weight: 800; font-size: 16px;
}

/* الجداول */
.b-table { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.b-table table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.6; }
.b-table th, .b-table td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.b-table th { background: #f1f4fd; color: var(--ink); font-weight: 700; white-space: nowrap; }
.b-table tr:last-child td { border-bottom: 0; }

/* صور الواجهة (لقطات موبايل) */
.b-fig { margin: 2em 0; text-align: center; }
.b-phone {
  display: inline-block; width: min(360px, 100%); padding: 10px; border-radius: 28px;
  background: linear-gradient(160deg, #1b2440, #0b1122); box-shadow: 0 24px 48px rgba(15,27,51,.18);
}
.b-phone img { display: block; width: 100%; border-radius: 20px; background: #eef2fc; }
.b-fig figcaption { font-size: 14px; color: var(--ink-soft); margin-top: 12px; }

/* CTA جوه المقالة */
.b-cta-inline {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin: 2em 0; padding: 20px 22px; border-radius: 16px;
  background: linear-gradient(135deg, #eef1ff, #e6faf6); border: 1px solid #d3dcfb;
}
.b-cta-inline strong { font-family: 'Tajawal', sans-serif; font-size: 18px; color: var(--ink); }
.b-cta-inline p { margin: 4px 0 0; font-size: 15px; line-height: 1.7; color: var(--ink-soft); }

/* الأسئلة الشائعة */
.b-faq details { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; margin-bottom: 10px; }
.b-faq summary {
  cursor: pointer; padding: 15px 20px; font-weight: 700; color: var(--ink); font-size: 17px;
  list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.b-faq summary::-webkit-details-marker { display: none; }
.b-faq summary::after { content: '+'; color: var(--primary); font-size: 22px; line-height: 1; }
.b-faq details[open] summary::after { content: '−'; }
.b-faq details > div { padding: 0 20px 16px; font-size: 16.5px; line-height: 1.85; }

/* المشاركة + الكاتب */
.b-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2.4em 0 1.6em; font-size: 14px; }
.b-share span { font-weight: 700; color: var(--ink); margin-inline-end: 4px; }
.b-share a, .b-share button {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.b-share a:hover, .b-share button:hover { border-color: var(--primary); color: var(--primary); }
.b-author {
  display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.b-author img { border-radius: 12px; flex: none; }
.b-author strong { font-family: 'Tajawal', sans-serif; font-size: 17px; color: var(--ink); }
.b-author p { margin: 4px 0 0; font-size: 15px; line-height: 1.75; color: var(--ink-soft); }

/* CTA آخر الصفحة */
.b-end-cta {
  background: radial-gradient(700px 300px at 85% 0%, rgba(0,184,160,.22), transparent 70%),
              radial-gradient(700px 300px at 10% 100%, rgba(43,75,255,.35), transparent 70%), var(--deep);
  color: var(--on-deep); padding: 56px 0;
}
.b-end-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.b-end-cta h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 900; margin: 0 0 10px; max-width: 24ch; }
.b-end-cta p { color: var(--on-deep-mut); margin: 0; max-width: 56ch; }
.b-end-actions { display: flex; gap: 12px; flex-wrap: wrap; flex: none; }

.b-related { padding-top: 52px; padding-bottom: 64px; }
.b-related > h2 { font-size: 26px; font-weight: 900; margin: 0 0 22px; }
.b-related .b-card-title { font-size: 18px; }

.b-404 { text-align: center; padding-top: 90px; padding-bottom: 110px; }
.b-404 h1 { font-size: 34px; margin: 0 0 10px; }
.b-404 p { color: var(--ink-soft); margin: 0 0 24px; }

/* ---------- الفوتر ---------- */
.b-footer { background: var(--deep); color: var(--on-deep); border-top: 1px solid rgba(255,255,255,.07); padding-top: 48px; }
.b-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 36px; padding-bottom: 34px; }
.b-footer-about p { font-size: 14px; color: var(--on-deep-mut); margin: 14px 0 0; max-width: 42ch; }
.b-footer-col h2 { font-size: 15px; margin: 4px 0 14px; }
.b-footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.b-footer-col a { color: var(--on-deep-mut); text-decoration: none; font-size: 14px; }
.b-footer-col a:hover { color: var(--on-deep); }
.b-footer-bottom { border-top: 1px solid rgba(255,255,255,.07); padding: 20px 0 26px; font-size: 13px; color: #6b7aa3; }
.b-footer-bottom a { color: #8fa2ff; font-weight: 600; text-decoration: none; white-space: nowrap; }

/* ---------- الشاشات الأصغر ---------- */
@media (max-width: 980px) {
  .b-grid { grid-template-columns: repeat(2, 1fr); }
  .b-post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 24px; }
  .b-toc { position: static; margin-bottom: 28px; }
  .b-end-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .b-nav-links { display: none; }
  .b-nav-inner { justify-content: space-between; }
}
@media (max-width: 640px) {
  .b-container { padding-inline: 16px; }
  .b-grid { grid-template-columns: 1fr; gap: 14px; }
  .b-hero { padding: 44px 0 50px; }
  .b-hero p { font-size: 16px; }
  .b-brand span { font-size: 15px; }
  .b-nav-actions .b-btn-sm { padding: 8px 12px; font-size: 13px; }
  .b-lang { padding: 7px 10px; }
  .b-post-head { padding: 24px 0 32px; }
  .b-lead { font-size: 16.5px; }
  .b-prose { font-size: 17px; line-height: 1.9; }
  .b-prose h2 { font-size: 23px; }
  .b-prose h3 { font-size: 19px; }
  .b-cta-inline { flex-direction: column; align-items: stretch; text-align: center; }
  .b-end-actions { width: 100%; }
  .b-end-actions .b-btn { flex: 1; }
  .b-footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; }
  .b-footer-about { grid-column: 1 / -1; }
}
@media (max-width: 400px) {
  .b-nav .b-brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .b-card, .b-btn { transition: none; }
}

/* رأس المقالة بيتحاذى مع عمود النص (الفهرس 250 + المسافة 48) على الشاشات الكبيرة */
.b-post-head .b-narrow { max-width: 1106px; }
@media (min-width: 981px) {
  .b-post-head.has-toc .b-narrow { padding-inline-start: calc(24px + 298px); }
}

/* «اقرأ أيضًا» جوه المقالة */
.b-read-also { margin: 2.2em 0 1.6em; padding: 16px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); }
.b-read-also-title { margin: 0 0 8px !important; font-family: 'Tajawal', sans-serif; font-weight: 800; font-size: 17px; color: var(--ink); }
.b-read-also ul { margin: 0; padding-inline-start: 1.2em; }
.b-read-also li { margin-bottom: .35em; font-size: 16px; line-height: 1.7; }

/* ---------- صفحات المواضيع (Pillar) ---------- */
.b-topics { padding-top: 40px; }
.b-topics > h2 { font-size: 22px; font-weight: 900; margin: 0 0 16px; }
.b-topics-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.b-topic-card {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.b-topic-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15,27,51,.08); border-color: #c9d4f3; }
.b-topic-card strong { font-family: 'Tajawal', sans-serif; font-size: 16px; line-height: 1.45; flex: 1; }
.b-topic-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.b-topic-count { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.b-list { padding-top: 28px; }
a.b-card-cat { text-decoration: none; }
.b-post-head a.b-card-cat:hover { background: rgba(255,255,255,.16); }

.b-topic-links { list-style: none; padding: 0 !important; margin: 1em 0 1.6em !important; display: grid; gap: 10px; }
.b-topic-links li { margin: 0 !important; }
.b-topic-links a {
  display: block; padding: 14px 18px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); border-inline-start: 4px solid var(--primary); text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.b-topic-links a:hover { border-color: #c9d4f3; box-shadow: 0 10px 24px rgba(15,27,51,.07); }
.b-topic-links strong { display: block; font-family: 'Tajawal', sans-serif; font-size: 17.5px; line-height: 1.5; color: var(--ink); }
.b-topic-links span { display: block; font-size: 15px; line-height: 1.7; color: var(--ink-soft); margin-top: 4px; }
.b-topic-index { columns: 2; column-gap: 32px; font-size: 15.5px; }
.b-topic-index li { break-inside: avoid; }
.b-topic-more { margin-top: 2.4em; padding: 16px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.b-topic-more ul { margin: 0; padding-inline-start: 1.2em; }
.b-topic-more li { font-size: 16px; margin-bottom: .35em; }

@media (max-width: 980px) { .b-topics-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
  .b-topics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .b-topic-card { padding: 14px; }
  .b-topic-card strong { font-size: 14.5px; }
  .b-topic-index { columns: 1; }
}

/* ---------- الحاسبات (/tools/) ---------- */
.c-narrow { max-width: 900px; }
.c-head { padding-bottom: 96px; }
.c-head h1 { margin-top: 4px; }
.c-lead p { margin: 0; }
.c-lead strong { color: var(--on-deep); }

.c-tool { margin-top: -64px; position: relative; z-index: 2; }
.c-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 26px; box-shadow: 0 24px 60px rgba(15,27,51,.12);
}
.c-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; }
.c-fields label { display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
.c-fields input {
  font: inherit; font-size: 18px; font-weight: 700; color: var(--ink); width: 100%;
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #f8faff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.c-fields input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(43,75,255,.12); background: #fff; }
.c-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 22px; }
.c-out { padding: 14px 16px; border-radius: 14px; background: #f1f4fd; display: flex; flex-direction: column; gap: 4px; }
.c-out span { font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.4; }
.c-out b { font-family: 'Tajawal', sans-serif; font-size: 24px; font-weight: 900; color: var(--ink); text-align: start; unicode-bidi: plaintext; }
.c-out--main { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.c-out--main span { color: rgba(255,255,255,.85); }
.c-out--main b { color: #fff; font-size: 30px; }
.c-card.is-bad .c-out--main { background: linear-gradient(135deg, #d6455d, #e8833d); }
.c-explain { margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 15.5px; line-height: 1.8; }
.c-explain:empty { display: none; }
.c-card.is-bad .c-explain { background: #fff1f1; }
.c-tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.c-privacy { font-size: 13.5px; color: var(--ink-soft); }
.c-share {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.c-share:hover { border-color: var(--primary); color: var(--primary); }
.c-prose { padding-top: 24px; padding-bottom: 40px; }

.c-hub { padding-top: 40px; padding-bottom: 56px; }
.c-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.c-hub-card {
  display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.c-hub-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(15,27,51,.09); border-color: #c9d4f3; }
.c-hub-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: #eef1ff; }
.c-hub-card h2, .c-hub-card h3 { font-size: 19px; font-weight: 800; margin: 6px 0 0; }
.c-hub-card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.7; flex: 1; }
.c-hub-go { font-size: 14px; font-weight: 700; color: var(--primary); }
.c-hub-text { max-width: 820px; margin: 48px auto 0; }
.c-others { padding-bottom: 56px; }
.c-others > h2 { font-size: 24px; font-weight: 900; margin: 0 0 18px; }
.c-hub-grid--sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.c-hub-grid--sm .c-hub-card { flex-direction: row; align-items: center; padding: 14px 16px; gap: 12px; }
.c-hub-grid--sm .c-hub-icon { width: 40px; height: 40px; font-size: 20px; flex: none; }
.c-hub-grid--sm h3 { font-size: 15.5px; margin: 0; }

@media (max-width: 640px) {
  .c-head { padding-bottom: 80px; }
  .c-tool { margin-top: -56px; }
  .c-card { padding: 18px; border-radius: 18px; }
  .c-fields { grid-template-columns: 1fr 1fr; gap: 12px; }
  .c-fields label { font-size: 13px; }
  .c-fields input { font-size: 17px; padding: 11px 12px; }
  .c-results { grid-template-columns: 1fr 1fr; gap: 10px; }
  .c-out--main { grid-column: 1 / -1; }
  .c-out b { font-size: 21px; }
  .c-out--main b { font-size: 28px; }
}
/* المعادلات في صفحات الحاسبات: نص عربي مش كود، فيمشي RTL بخط الصفحة */
.c-prose p > code:only-child { display: inline-block; font-family: inherit; font-size: .95em; font-weight: 600; padding: 6px 14px; border-radius: 10px; }
html[dir="rtl"] .c-prose p > code:only-child { direction: rtl; }

/* ---------- أدوات /tools/ النصية (2026-10-21) ---------- */
.c-fields .c-wide { grid-column: 1 / -1; }
.c-fields select, .c-fields textarea {
  font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); width: 100%;
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #f8faff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.c-fields input[data-type] { font-size: 16px; font-weight: 600; }
.c-fields select {
  appearance: none; cursor: pointer; padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6785' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
html[dir="rtl"] .c-fields select { background-position: left 14px center; }
.c-fields textarea { resize: vertical; min-height: 120px; line-height: 1.7; font-weight: 500; }
.c-fields select:focus, .c-fields textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(43,75,255,.12); background-color: #fff; }
.c-out--wide { grid-column: 1 / -1; }
.c-copyrow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.c-copyrow code, .c-copyrow a {
  flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14.5px; font-weight: 600;
  line-height: 1.6; word-break: break-all; text-align: left; color: var(--ink); background: none; padding: 0;
}
.c-copyrow a { color: var(--primary); font-family: inherit; font-size: 16px; font-weight: 800; word-break: normal; text-align: start; }
.c-out--main .c-copyrow code, .c-out--main .c-copyrow a { color: #fff; }
.c-copy {
  flex: none; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.c-copy:hover { border-color: var(--primary); color: var(--primary); }
.c-out--main .c-copy { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.15); color: #fff; }
.c-out.is-warn { background: #fff6e6; }
.c-out.is-warn b { color: var(--warn); }
.c-out.is-over { background: #fff1f1; }
.c-out.is-over b { color: #c8323f; }
.c-card--static { display: flex; flex-direction: column; gap: 18px; }

/* معاينة الإعلان (عدّاد الحروف) */
.c-pv { margin-top: 22px; max-width: 470px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 10px 28px rgba(15,27,51,.08); }
.c-pv-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.c-pv-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); flex: none; }
.c-pv-top strong { display: block; font-size: 14.5px; color: var(--ink); }
.c-pv-top small { font-size: 12.5px; color: var(--ink-soft); }
.c-pv-text { padding: 0 14px 10px; font-size: 15px; line-height: 1.6; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.c-pv-more { color: var(--ink-soft); font-weight: 700; }
.c-pv-img { aspect-ratio: 1.91 / 1; background: linear-gradient(135deg, #dfe6ff, #d9f6f0); display: grid; place-items: center; color: #8a97b8; font-size: 13px; font-weight: 700; }
.c-pv-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #f2f4f8; }
.c-pv-bar div { flex: 1; min-width: 0; }
.c-pv-bar strong { display: block; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-pv-bar small { display: block; font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-pv-btn { flex: none; padding: 8px 14px; border-radius: 8px; background: #e4e6eb; font-size: 14px; font-weight: 800; color: var(--ink); }

/* دليل المقاسات */
.c-spec { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 22px; align-items: start; margin-top: 22px; }
.c-frame { position: relative; width: 100%; max-height: 380px; aspect-ratio: 4 / 5; margin-inline: auto; border-radius: 14px; overflow: hidden;
  background: linear-gradient(160deg, #e8edff, #dcf7f1); border: 1.5px solid #c9d4f3; transition: aspect-ratio .25s ease; }
.c-frame-top, .c-frame-bottom { position: absolute; left: 0; right: 0; height: 0; background: repeating-linear-gradient(45deg, rgba(214,69,93,.16) 0 8px, rgba(214,69,93,.08) 8px 16px); }
.c-frame-top { top: 0; } .c-frame-bottom { bottom: 0; }
.c-frame-ratio { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Tajawal', sans-serif; font-size: 26px; font-weight: 900; color: var(--primary); }
.c-spec dl { margin: 0; display: grid; gap: 10px; }
.c-spec dl div { padding: 12px 14px; border-radius: 12px; background: #f1f4fd; }
.c-spec dt { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.c-spec dd { margin: 3px 0 0; font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.6; }
.c-spec-legend { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin: 8px 0 0; }
.c-spec-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; background: rgba(214,69,93,.22); }

/* قوالب Excel */
.c-dl { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.c-dl strong { font-family: 'Tajawal', sans-serif; font-size: 19px; color: var(--ink); }
.c-dl p { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.7; }
.c-dl-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.c-dl .b-btn-ghost { color: var(--ink-2); border-color: var(--line); background: var(--surface); }
.c-dl .b-btn-ghost:hover { color: var(--primary); border-color: var(--primary); }
.c-sheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.c-sheets div { padding: 14px 16px; border-radius: 14px; background: #f1f4fd; }
.c-sheets b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.c-sheets span { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.c-preview { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.c-preview table { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
.c-preview th { background: var(--primary); color: #fff; padding: 8px 10px; font-weight: 700; }
.c-preview td { padding: 7px 10px; border-top: 1px solid var(--line); color: var(--ink-2); }
.c-preview td.f { background: #eefaf7; color: #0b7a69; font-weight: 700; }

/* أقسام صفحة الأدوات */
.c-hub-sec + .c-hub-sec { margin-top: 44px; }
.c-hub-sec > h2 { font-size: 24px; font-weight: 900; margin: 0 0 6px; }
.c-hub-sec > p { margin: 0 0 18px; color: var(--ink-soft); font-size: 15.5px; }

@media (max-width: 640px) {
  .c-fields select, .c-fields textarea { font-size: 16px; padding: 11px 12px; }
  .c-copyrow { flex-direction: column; align-items: stretch; }
  .c-spec { grid-template-columns: 1fr; }
  .c-frame { max-width: 240px; }
}
