/* الخصوصية والشروط: نص قانوني مقروء بفهرس ثابت */
.lg-draft { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; max-width: 46rem; margin-bottom: 24px; padding: 14px 18px; border-radius: var(--r-sm); background: #fff4d6; border: 1.5px dashed #b7791f; color: #5c3d06; font-size: 15px; line-height: 1.7; }
.lg-draft b { color: #7a4f05; }
.lg-meta { margin-top: 16px; font-size: 13.5px; color: hsl(var(--fg-2)); }
.lg-sec { padding-top: clamp(24px, 3vw, 40px); }
.lg { display: grid; gap: 32px; }
@media (min-width: 1024px) { .lg { grid-template-columns: 16rem 1fr; gap: 72px; align-items: start; } .lg-toc { position: sticky; top: calc(var(--nav-total) + 24px); max-height: calc(100vh - var(--nav-total) - 48px); overflow-y: auto; } }
.lg-toc { padding: 18px 20px; border-radius: var(--r-md); background: hsl(var(--tint)); }
.lg-toc p { font-size: 13px; font-weight: 700; color: hsl(var(--fg-2)); margin-bottom: 6px; }
.lg-toc ol { list-style: none; counter-reset: t; display: grid; }
.lg-toc li { counter-increment: t; }
.lg-toc a { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; font-size: 14.5px; line-height: 1.5; color: hsl(var(--fg-2)); }
.lg-toc a::before { content: counter(t); min-width: 1.4em; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: hsl(var(--fg-2)); }
.lg-toc a:hover, .lg-toc a[aria-current] { color: hsl(var(--fg)); font-weight: 600; }
.lg-toc a[aria-current]::before { color: var(--red); }
@media (max-width: 1023px) { .lg-toc ol { grid-template-columns: 1fr 1fr; column-gap: 16px; } }
@media (max-width: 520px) { .lg-toc ol { grid-template-columns: 1fr; } }
.lg-body { max-width: 46rem; font-size: 17px; }
.lg-body h2 { padding-top: .6em; border-top: 1px solid hsl(var(--border)); }
.lg-body h2:first-child, .lg-summary + h2 { border-top: 0; padding-top: 0; }
.lg-body li + li { margin-top: .4em; }
.lg-body .table-wrap { margin-block: 1em; }
.lg-body .table { font-size: 15px; line-height: 1.7; }
.lg-slot { display: grid; border: 1.5px dashed hsl(38 12% 62%); border-radius: var(--r-sm); padding: 4px 18px; }
.lg-slot > div { display: grid; gap: 2px; padding: 10px 0; }
@media (min-width: 640px) { .lg-slot > div { grid-template-columns: 12rem 1fr; gap: 16px; } }
.lg-slot > div + div { border-top: 1px solid hsl(var(--border)); }
.lg-slot dt { font-size: 14.5px; color: hsl(var(--fg-2)); }
.lg-slot dd { font-weight: 600; }
.lg-summary { padding: 20px 24px; border-radius: var(--r-md); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-inline-start: 4px solid var(--red); margin-bottom: 1.6em; }
.lg-summary ul { margin-top: .4em; }
.lg-also { margin-top: 2em; padding-top: 1em; border-top: 1px solid hsl(var(--border)); font-size: 15px; color: hsl(var(--fg-2)); }

/* الرأس القصير الكريمي: التاريخ ثم تنبيه المسودة تحت الفقرة */
.lg-hero .lg-meta { margin-top: 14px; color: var(--ink-2); font-weight: 500; }
.lg-hero .lg-draft { margin: 18px 0 0; }
.lg-sec { padding-top: clamp(32px, 4vw, 56px); }

/* شريط التطريز على الكريمي: حاشية رفيعة بدل كتلة داكنة */
.lg-hero .px-hero__band { height: 18px; }

/* ——— صقل الإطلاق: قراءة النص القانوني الطويل ——— */
/* عناوين بحجم المقال لا بحجم الصفحة، ورقم القسم بلون الفعل */
.lg-body { line-height: 1.95; }
.lg-body h2 { font-size: clamp(23px, calc(15px + 1vw), 30px); line-height: 1.4; margin-top: 2em; margin-bottom: .55em; padding-top: 1.1em; text-wrap: balance; }
.lg-body h2:first-child { margin-top: 0; }
.lg-body h3 { font-size: clamp(18px, calc(14px + .4vw), 21px); line-height: 1.5; margin-top: 1.5em; margin-bottom: .35em; }
.lg-body p + p { margin-top: .8em; }
.lg-body ul { margin-block: .6em 1em; }
.lg-body bdi { white-space: nowrap; }
.lg-body a { text-underline-offset: 3px; }
/* الجداول: رأس أوضح، وصفوف تتنفس */
.lg-body .table-wrap { border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px hsl(var(--border)); background: hsl(var(--card)); }
.lg-body .table th { padding: 12px 14px; font-size: 13.5px; font-weight: 700; color: var(--ink); background: hsl(var(--tint)); white-space: nowrap; }
.lg-body .table td { padding: 12px 14px; }
.lg-body .table tr:last-child td { border-bottom: 0; }
/* خانات البيانات التي تُملأ من الإعدادات */
.lg-slot { margin-block: 1em 1.4em; background: hsl(var(--card) / .6); }
.lg-slot dd { line-height: 1.7; overflow-wrap: anywhere; }

/* الفهرس: يُطوى على الجوال، ثابت مفتوح على الشاشة العريضة */
.lg-toc__d > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; font-size: 13px; color: hsl(var(--fg-2)); }
.lg-toc__d > summary::-webkit-details-marker { display: none; }
.lg-toc__d > summary b { font-weight: 700; }
.lg-toc__d > summary span { font-size: 12.5px; font-weight: 500; }
.lg-toc__d[open] > summary { margin-bottom: 6px; }
.lg-toc a { min-height: 36px; align-items: center; }
.lg-toc a:focus-visible { outline: 2.5px solid var(--red); outline-offset: 2px; border-radius: 4px; }
@media (min-width: 1024px) {
  .lg-toc__d > summary { cursor: default; }
  .lg-toc__d > summary span { display: none; }
  .lg-toc a[aria-current] { color: var(--ink); }
}
@media (max-width: 1023px) {
  .lg-toc { padding: 0; background: hsl(var(--card)); box-shadow: inset 0 0 0 1px hsl(var(--border)); }
  .lg-toc__d > summary { min-height: 56px; padding: 0 18px; cursor: pointer; font-size: 15.5px; color: var(--ink); }
  .lg-toc__d > summary b { display: flex; align-items: center; gap: 10px; }
  .lg-toc__d > summary b::before { content: ""; width: 10px; height: 10px; background: var(--red); }
  .lg-toc__d > summary span { margin-inline-start: auto; color: hsl(var(--fg-2)); }
  .lg-toc__d > summary::after { content: "+"; font-size: 24px; font-weight: 300; line-height: 1; color: hsl(var(--fg-2)); transition: transform var(--dur-2, .2s) var(--ease, ease); }
  .lg-toc__d[open] > summary::after { transform: rotate(45deg); }
  .lg-toc__d[open] > summary { margin-bottom: 0; border-bottom: 1px solid hsl(var(--border)); }
  .lg-toc__d ol { padding: 8px 18px 14px; }
  .lg-toc a { min-height: 44px; }
}
@media (max-width: 640px) {
  .lg-body { font-size: 16.5px; line-height: 1.9; }
  .lg-body .table { font-size: 14.5px; }
  .lg-body .table th, .lg-body .table td { padding: 10px 12px; }
  .lg-draft { font-size: 14.5px; }
}
.lg-body .lg-summary + h2 { padding-top: 0; margin-top: 0; }
/* عمود النص لا يتمدد بعرض الجدول؛ الجدول وحده يتمرر أفقيًا إن ضاق */
.lg > * { min-width: 0; }
@media (max-width: 640px) { .lg-body .table th { white-space: normal; } }
