/* ==========================================================================
   احسبها — ملف التنسيق الرئيسي
   ========================================================================== */

/* --- 1. المتغيرات والألوان ------------------------------------------------ */
:root {
  --brand: #0b6e5f;
  --brand-dark: #085449;
  --brand-soft: #e7f3f0;
  --brand-ring: rgba(11, 110, 95, .18);
  --accent: #b8811a;
  --accent-soft: #fdf5e6;

  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-2: #f0f4f3;
  --text: #14201e;
  --muted: #5d6b68;
  --border: #e2e8e6;

  --danger: #b42318;
  --danger-soft: #fdeceb;
  --ok: #087443;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 28, .05);
  --shadow: 0 4px 16px rgba(16, 32, 28, .07);
  --shadow-lg: 0 12px 34px rgba(16, 32, 28, .10);

  --wrap: 1120px;
  --font: "IBM Plex Sans Arabic", "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --brand: #2fa78f;
  --brand-dark: #24907b;
  --brand-soft: #12302b;
  --brand-ring: rgba(47, 167, 143, .25);
  --accent: #dfa93f;
  --accent-soft: #2b2313;

  --bg: #0e1513;
  --surface: #161f1d;
  --surface-2: #1d2826;
  --text: #e6ecea;
  --muted: #96a5a1;
  --border: #26332f;

  --danger: #f2837a;
  --danger-soft: #33201e;
  --ok: #4ec98a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, .45);
}

/* --- 2. إعادة الضبط ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  line-height: 1.45;
  margin: 0 0 .6em;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.75rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }

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

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.skip-link {
  position: absolute; inset-inline-start: -999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { inset-inline-start: 0; }

/* --- 3. الهيدر ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 14px;
  height: 66px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.22rem; color: var(--text);
  text-decoration: none; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, var(--brand), var(--brand-dark));
  color: #fff; display: grid; place-items: center;
  font-size: 1.05rem; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.logo-mark span { transform: translateY(-1px); }

.main-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 13px; border-radius: 9px; color: var(--muted);
  font-size: .95rem; font-weight: 500; white-space: nowrap;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.main-nav a.is-active { color: var(--brand); background: var(--brand-soft); }

.icon-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--muted); cursor: pointer;
  transition: .15s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.nav-toggle { display: none; margin-inline-start: auto; }

@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .theme-btn { margin-inline-start: 0; }
  .main-nav {
    position: absolute; inset-inline: 0; top: 66px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px 20px 18px; margin: 0;
    box-shadow: var(--shadow); display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 11px 14px; font-size: 1rem; }
}

/* --- 4. الواجهة الرئيسية -------------------------------------------------- */
.hero {
  padding: 62px 0 46px;
  text-align: center;
  background:
    radial-gradient(900px 380px at 50% -140px, var(--brand-soft), transparent 70%);
}
.hero h1 { margin-bottom: .35em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero-sub {
  max-width: 620px; margin: 0 auto 26px;
  font-size: 1.08rem; color: var(--muted);
}
.hero-badges { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 13px; border-radius: 999px;
  font-size: .87rem; color: var(--muted); box-shadow: var(--shadow-sm);
}

/* --- 5. شبكة الأدوات ------------------------------------------------------ */
.section { padding: 44px 0; }
.section-head { margin-bottom: 26px; }
.section-head h2 { margin-bottom: .25em; }
.section-head p { color: var(--muted); margin: 0; }

.tool-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.tool-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  color: inherit; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool-card:hover {
  text-decoration: none; transform: translateY(-3px);
  box-shadow: var(--shadow-lg); border-color: var(--brand);
}
.tool-card .ico {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 4px;
}
.tool-card h3 { margin: 0; font-size: 1.06rem; }
.tool-card p { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.7; }
.tool-card .go {
  margin-top: auto; padding-top: 10px;
  font-size: .88rem; font-weight: 600; color: var(--brand);
}

/* --- 6. صفحة الأداة ------------------------------------------------------- */
.breadcrumb { font-size: .87rem; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin-inline: 6px; opacity: .5; }

.tool-head { padding: 14px 0 28px; }
.tool-head h1 { margin-bottom: .3em; }
.tool-head .lede { color: var(--muted); font-size: 1.05rem; margin: 0; max-width: 70ch; }

.layout {
  display: grid; gap: 26px;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  padding-bottom: 50px;
}
@media (max-width: 980px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 20px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

/* --- 7. النماذج ----------------------------------------------------------- */
.field-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .92rem; font-weight: 600; }
.field .hint { font-size: .8rem; color: var(--muted); line-height: 1.6; }

input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%; padding: 11px 13px;
  font-family: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
input:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="date"] { min-height: 45px; }
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='%235d6b68' d='M7 9 0 2l1.5-1.5L7 6l5.5-5.5L14 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 13px center;
  padding-inline-start: 13px; padding-inline-end: 36px;
}

.input-affix { position: relative; }
.input-affix input { padding-inline-end: 52px; }
.input-affix .affix {
  position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%);
  font-size: .85rem; color: var(--muted); pointer-events: none;
}

.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 500; font-size: .93rem;
  background: var(--surface); transition: .15s;
}
.radio-row input { accent-color: var(--brand); margin: 0; }
.radio-row label:has(input:checked) {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand);
}

/* زر مشاركة النتيجة */
.result-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--brand); background: transparent; color: var(--brand);
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: .15s;
}
.share-btn:hover { background: var(--brand); color: #fff; }
.share-btn:disabled { opacity: .55; cursor: default; }
.share-msg { font-size: .85rem; color: var(--muted); }
@media print { .result-actions { display: none; } }

/* شريط تثبيت التطبيق (PWA) */
.install-bar {
  position: fixed; inset-inline: 12px; bottom: 12px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  max-width: 520px; margin-inline: auto;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
  transform: translateY(130%); opacity: 0;
  transition: transform .32s cubic-bezier(.2, .8, .3, 1), opacity .32s;
}
.install-bar.is-in { transform: none; opacity: 1; }
.install-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 700;
}
.install-txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.install-txt strong { font-size: .92rem; }
.install-txt > span { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.ios-share { width: 15px; height: 15px; vertical-align: -3px; }
.install-go {
  flex: 0 0 auto; padding: 9px 18px; border: 0; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font: inherit; font-weight: 600;
  font-size: .88rem; cursor: pointer;
}
.install-go:hover { filter: brightness(1.08); }
.install-x {
  flex: 0 0 auto; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font-size: .8rem; cursor: pointer; line-height: 1;
}
.install-x:hover { background: var(--bg); }
@media print { .install-bar { display: none; } }

/* مجموعات البدلات داخل النماذج */
.allow-group { margin-bottom: 20px; }
.allow-group:last-of-type { margin-bottom: 6px; }
.allow-title {
  font-weight: 600; font-size: .9rem; color: var(--brand);
  padding-bottom: 6px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.allow-group .hint { display: block; margin-top: 8px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; font-weight: 600;
  border: 1.5px solid transparent; cursor: pointer;
  transition: .15s; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }

/* --- 8. النتائج ----------------------------------------------------------- */
.result { margin-top: 24px; display: none; }
.result.show { display: block; animation: rise .3s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.result-hero {
  background: linear-gradient(140deg, var(--brand), var(--brand-dark));
  color: #fff; border-radius: var(--radius);
  padding: 26px 24px; text-align: center;
  box-shadow: var(--shadow);
}
.result-hero .label { font-size: .95rem; opacity: .85; margin-bottom: 4px; }
.result-hero .value {
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.7rem);
  font-weight: 700; line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.result-hero .sub { font-size: .92rem; opacity: .85; margin-top: 6px; }

.breakdown { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.breakdown-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 12px 16px; font-size: .95rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row:nth-child(odd) { background: var(--surface-2); }
.breakdown-row .k { color: var(--muted); }
.breakdown-row .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }
@media (max-width: 460px) {
  .breakdown-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .breakdown-row .v { white-space: normal; text-align: start; }
}
.breakdown-row.total { background: var(--brand-soft); }
.breakdown-row.total .k, .breakdown-row.total .v { color: var(--brand); font-weight: 700; }
.breakdown-row .v.neg { color: var(--danger); }
.breakdown-row .v.pos { color: var(--ok); }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  font-size: .89rem; line-height: 1.75; margin-top: 16px;
}
.note.error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.note .ico { flex-shrink: 0; margin-top: 3px; }
.note p:last-child { margin-bottom: 0; }

/* --- 9. الجداول ----------------------------------------------------------- */
.table-scroll { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 420px; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 600; font-size: .89rem; white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }

/* --- 10. المقال ----------------------------------------------------------- */
.article { max-width: 74ch; }
.article h2 { margin-top: 1.7em; padding-top: .2em; }
.article h3 { margin-top: 1.4em; font-size: 1.1rem; }
.article ul, .article ol { padding-inline-start: 1.3em; margin: 0 0 1.2em; }
.article li { margin-bottom: .5em; }
.article strong { font-weight: 600; color: var(--text); }
.article blockquote {
  margin: 1.4em 0; padding: 14px 18px;
  border-inline-start: 4px solid var(--brand);
  background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted); font-size: .95rem;
}
.article blockquote p:last-child { margin-bottom: 0; }
.calc-example {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 1.3em 0;
  font-size: .95rem;
}
.calc-example .t { font-weight: 700; margin-bottom: 8px; color: var(--brand); }

/* --- 11. الأسئلة الشائعة -------------------------------------------------- */
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; background: var(--surface); overflow: hidden;
}
.faq summary {
  padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: .98rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-size: 1.3rem; color: var(--brand); flex-shrink: 0; line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq .answer { padding: 14px 18px; color: var(--muted); font-size: .95rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* --- 12. الشريط الجانبي --------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 86px; }
@media (max-width: 980px) { .sidebar { position: static; } }
.side-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.side-card h3 { font-size: .95rem; margin-bottom: 12px; color: var(--muted); font-weight: 600; }
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-list a {
  display: block; padding: 9px 11px; border-radius: 8px;
  font-size: .93rem; color: var(--text);
}
.side-list a:hover { background: var(--surface-2); text-decoration: none; color: var(--brand); }

/* --- 13. خانات الإعلانات -------------------------------------------------- */
/* بطاقة عرض إحالة في الشريط الجانبي */
.promo-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 9px;
}
.promo-tag {
  align-self: flex-start; font-size: .68rem; font-weight: 600; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px;
}
.promo-brand { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.promo-brand span {
  font-family: ui-monospace, Menlo, monospace; direction: ltr; unicode-bidi: isolate;
  display: inline-block; font-size: .72rem; font-weight: 400; color: var(--muted);
  margin-inline-start: 5px;
}
.promo-txt { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.7; }
.promo-txt strong { color: var(--brand); }

.promo-code { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.promo-label { font-size: .78rem; color: var(--muted); }
.promo-copy {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px dashed var(--brand); background: var(--brand-soft);
  border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer;
  font: inherit; transition: .15s;
}
.promo-copy:hover { background: var(--brand); }
.promo-copy:hover .code, .promo-copy:hover .copy-hint { color: #fff; }
.promo-copy .code {
  font-family: ui-monospace, Menlo, monospace; direction: ltr; unicode-bidi: isolate;
  font-weight: 700; font-size: .95rem; color: var(--brand); letter-spacing: .04em;
}
.promo-copy .copy-hint { font-size: .72rem; color: var(--muted); }
.promo-copy.copied { border-style: solid; border-color: var(--ok); background: var(--surface-2); }
.promo-copy.copied .copy-hint { color: var(--ok); font-weight: 600; }

.promo-btn {
  display: block; text-align: center; margin-top: 2px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: .92rem;
  padding: 10px 16px; border-radius: var(--radius-sm);
}
.promo-btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.promo-fine { margin: 2px 0 0; font-size: .72rem; color: var(--muted); line-height: 1.6; }
@media print { .promo-card { display: none; } }

.ad-slot {
  margin: 26px auto; text-align: center; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ad-slot[data-placeholder]::before {
  content: "مساحة إعلانية";
  display: block; width: 100%; padding: 34px 10px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--muted); font-size: .82rem; background: var(--surface-2);
}
.ad-slot.side { min-height: 250px; margin: 0; }

/* --- 14. الفوتر ----------------------------------------------------------- */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 42px 0 26px; margin-top: 20px; font-size: .93rem;
}
.footer-grid {
  display: grid; gap: 28px 24px;
  grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr));
  margin-bottom: 30px;
}
.footer-brand p { max-width: 32ch; }
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { max-width: 60ch; }
}
@media (max-width: 620px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 400px) { .footer-grid { grid-template-columns: 1fr; gap: 22px; } }
.footer-grid h4 { font-size: .95rem; margin-bottom: 12px; }
.footer-grid p { color: var(--muted); margin: 0; max-width: 34ch; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--brand); }
.operator {
  border-top: 1px solid var(--border); margin-top: 26px; padding-top: 18px;
  color: var(--muted); font-size: .87rem;
}
.operator strong { color: var(--text); font-weight: 600; }
.operator .doc-no {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  direction: ltr; unicode-bidi: isolate; display: inline-block;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 8px; font-size: .84em; color: var(--brand);
}
.operator + .footer-bottom { border-top: 0; padding-top: 12px; margin-top: 0; }

.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  color: var(--muted); font-size: .87rem;
}
.disclaimer {
  background: var(--surface-2); border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 15px 18px;
  color: var(--muted); font-size: .86rem; line-height: 1.8; margin-bottom: 26px;
}
.disclaimer p { margin: 0 0 8px; }
.disclaimer p:last-child { margin-bottom: 0; }
.disclaimer .d-lead {
  font-weight: 700; font-size: .95rem; color: var(--text);
  margin-bottom: 6px;
}
.disclaimer strong { color: var(--text); font-weight: 600; }

/* --- 15. مساعدات ---------------------------------------------------------- */
.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;
}
.num { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--muted); }

@media print {
  .site-header, .site-footer, .sidebar, .btn-row, .ad-slot, .breadcrumb, .faq, .article { display: none !important; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .result-hero { background: #fff !important; color: #000 !important; border: 2px solid #000; }
}

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

/* --- سطر الأدوات العامة في الفوتر --- */
.f-inline { margin: 0; font-size: .88rem; line-height: 2; color: var(--muted); }
.f-inline a { color: var(--muted); }
.f-inline a:hover { color: var(--text); }

/* --- سطر آخر تحديث --- */
.page-updated { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--muted); }
