/* legal.css — the four legal pages of darbone.sa (privacy, terms, dpa, retention). Mobile first.
   Loaded after ds/darb/fonts.css and ds/darb/tokens.css; every value comes from their tokens.

   The page is navy (html[data-theme="navy"]) and its dark surfaces take the landing's «hero» character
   (owner, 2026-11-14: every dark surface in Darb takes it; a flat dark fill looks poor): a deep navy ground lit
   from below, dark glass with a hairline gold edge, poured gold for the one main action. This overrules the
   0.2 book's «flat surfaces» rule (هـ3) on the dark surfaces only. The document itself is read on a flat paper
   sheet ([data-theme="paper"]): navy ink, teal accents, no gold but one decorative diamond on its edge. */

/* ---------------------------------------------------------------------------------------------------------
   0. Page values. Plain token values first, for engines without color-mix(); the hero recipes below them.
   --------------------------------------------------------------------------------------------------------- */
:root {
  --lg-top-h: 64px;
  --lg-pad: var(--gutter-mobile);
  --lg-wrap: 1096px; /* toc 17rem + gap 32px + sheet (680px of text + 2 x 56px) */
  --lg-ground: linear-gradient(180deg, var(--navy), var(--ink));
  --lg-bar: linear-gradient(var(--ink), var(--ink));
  --lg-glass: linear-gradient(var(--navy-700), var(--navy-700));
  --lg-glass-btn: linear-gradient(var(--navy), var(--navy));
  --lg-edge: linear-gradient(var(--line), var(--line));
  --lg-pour: linear-gradient(var(--gold), var(--gold));
  --lg-hairline: linear-gradient(var(--gold-line), var(--gold-line));
  --lg-glow: none;
  --lg-tint: var(--surface-quiet);
  --lg-tint-gold: var(--accent-wash);
  --lg-lift: none;
  --lg-pour-lift: none;
}

/* brand-ok: hero character on dark surfaces (owner 2026-11-14); every colour is mixed from a palette token */
@supports (color: color-mix(in srgb, white 50%, black)) {
  :root {
    --lg-ground:
      radial-gradient(1400px 900px at 50% 108%, color-mix(in srgb, var(--teal) 42%, transparent), transparent 70%),
      linear-gradient(180deg, color-mix(in srgb, var(--navy) 55%, var(--ink)) 0%, var(--ink) 45%, color-mix(in srgb, var(--teal) 10%, var(--ink)) 100%);
    /* nearly opaque: the paper sheet passes under it, and a lighter bar over paper reads as a smudge */
    --lg-bar: linear-gradient(180deg, color-mix(in srgb, var(--depth) 97%, transparent), color-mix(in srgb, var(--ink) 95%, transparent));
    /* the gold edge shows a little through the glass (the landing's sheen); a touch more body keeps text legible there */
    --lg-glass: linear-gradient(160deg, color-mix(in srgb, var(--navy-700) 70%, transparent), color-mix(in srgb, var(--ink) 78%, transparent));
    --lg-glass-btn: linear-gradient(color-mix(in srgb, var(--navy) 60%, transparent), color-mix(in srgb, var(--navy) 60%, transparent));
    --lg-edge: linear-gradient(145deg,
      color-mix(in srgb, var(--gold-soft) 55%, transparent),
      color-mix(in srgb, var(--gold-soft) 8%, transparent) 32%,
      color-mix(in srgb, var(--gold-soft) 5%, transparent) 68%,
      color-mix(in srgb, var(--gold-soft) 38%, transparent));
    --lg-pour: linear-gradient(180deg,
      color-mix(in srgb, var(--gold-soft) 75%, var(--white)) 0%,
      color-mix(in srgb, var(--gold) 65%, var(--gold-soft)) 50%,
      color-mix(in srgb, var(--gold) 80%, var(--gold-ink)) 100%);
    --lg-hairline: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold-soft) 40%, transparent) 18%, color-mix(in srgb, var(--gold-soft) 40%, transparent) 82%, transparent);
    --lg-glow: radial-gradient(520px 360px at 82% 0%, color-mix(in srgb, var(--gold-soft) 10%, transparent), transparent 72%);
    --lg-tint: color-mix(in srgb, var(--ink) 40%, transparent);
    --lg-tint-gold: color-mix(in srgb, var(--gold) 12%, transparent);
    --lg-lift: 0 32px 64px -36px color-mix(in srgb, var(--depth) 90%, transparent), inset 0 1px 0 color-mix(in srgb, var(--white) 6%, transparent);
    --lg-pour-lift: 0 12px 28px -14px color-mix(in srgb, var(--gold) 80%, transparent), inset 0 1px 0 color-mix(in srgb, var(--white) 55%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--depth) 18%, transparent);
  }
}

@media (min-width: 768px) {
  :root { --lg-pad: var(--gutter); }
}
@media (min-width: 1024px) {
  :root { --lg-top-h: 72px; }
}

/* ---------------------------------------------------------------------------------------------------------
   1. Base
   --------------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* anchors and focus land under the sticky bar, never behind it */
  scroll-padding-top: calc(var(--lg-top-h) + var(--space-4));
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body.lg {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ink);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-body-lg);
  line-height: var(--text-body-lg--line-height);
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
/* the ground: one fixed layer, lit from below (no background-attachment: fixed, which repaints on scroll) */
body.lg::before {
  content: "";
  position: fixed;
  inset: 0;
  /* brand-ok: a ground layer sits under everything, below --z-base */
  z-index: -1;
  pointer-events: none;
  background: var(--lg-ground);
}

/* base rules carry no weight (:where), so every component's own colour and spacing win */
:where(.lg) img { display: block; max-width: 100%; }
:where(.lg) a { color: inherit; }
:where(.lg) :is(h1, h2, p) { margin: 0; }
:where(.lg) :is(ul, ol) { margin: 0; padding: 0; list-style: none; }
:where(.lg) bdi { unicode-bidi: isolate; }
/* touch feedback is drawn by each component (:active below), not by the browser's grey flash */
:where(.lg) :is(a, summary) { -webkit-tap-highlight-color: transparent; }

.lg :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.lg ::selection { background: var(--lg-tint-gold); }
.lg [data-theme="paper"] ::selection { background: var(--accent-wash); }

.lg-ico {
  flex: none;
  width: var(--icon-md);
  height: var(--icon-md);
}
[dir="rtl"] .lg-ico--dir { transform: scaleX(-1); }

.lg-wrap {
  width: 100%;
  max-width: calc(var(--lg-wrap) + 2 * var(--lg-pad));
  margin-inline: auto;
  padding-inline: var(--lg-pad);
}

/* dark glass with a hairline gold edge */
.lg-glass {
  border: 1px solid transparent;
  background: var(--lg-glass) padding-box, var(--lg-edge) border-box;
  box-shadow: var(--lg-lift);
}

/* ---------------------------------------------------------------------------------------------------------
   2. Skip link
   --------------------------------------------------------------------------------------------------------- */
.lg-skip {
  position: absolute;
  top: var(--space-2);
  inset-inline-start: var(--space-4);
  z-index: var(--z-nav);
  display: inline-flex;
  align-items: center;
  min-height: var(--control-md);
  padding-inline: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--navy);
  font-weight: 600;
  font-size: var(--text-body);
  text-decoration: none;
  transform: translateY(-200%);
}
.lg-skip:focus { transform: none; }

/* ---------------------------------------------------------------------------------------------------------
   3. Top bar: navy, nearly transparent, the lockup, one poured-gold action
   --------------------------------------------------------------------------------------------------------- */
.lg-top {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--lg-bar);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
.lg-top::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: var(--lg-hairline);
  pointer-events: none;
}
.lg-top__in {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: calc(var(--lg-wrap) + 2 * var(--lg-pad));
  height: var(--lg-top-h);
  margin-inline: auto;
  padding-inline: var(--lg-pad);
}
.lg-brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: var(--control-md);
  border-radius: var(--radius-sm);
}
.lg-brand img { width: auto; height: 36px; }
.lg-top__nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
  min-width: 0;
}
.lg-top__home {
  display: none;
  align-items: center;
  min-height: var(--control-md);
  padding-inline: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .lg-top__home:hover { color: var(--fg); }
}
.lg-top__login .lg-ico { display: none; }

/* buttons: the poured gold is the one main action; glass is the second */
.lg-btn {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-md);
  padding-inline: var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-display);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.lg-btn--gold {
  color: var(--on-action);
  background: var(--lg-pour);
  box-shadow: var(--lg-pour-lift);
}
.lg-btn--gold::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--white) 55%, transparent) 50%, transparent 70%);
  transform: translateX(120%);
  transition: transform var(--dur-reveal) var(--ease-out-expo);
}
.lg-btn--glass {
  color: var(--fg);
  border: 1px solid transparent;
  background: var(--lg-glass-btn) padding-box, var(--lg-edge) border-box;
}
@media (hover: hover) {
  .lg-btn--gold:hover { transform: translateY(-1px); }
  .lg-btn--gold:hover::after { transform: translateX(-120%); }
  .lg-btn--glass:hover { color: var(--accent-ink); }
}

@media (max-width: 374.98px) {
  /* 360px phones: the lockup at its smallest size (32px) and tighter buttons, so the bar holds all three */
  .lg-brand img { height: 32px; }
  .lg-btn { padding-inline: var(--space-2); }
}
@media (max-width: 359.98px) {
  /* the narrowest phones: the band's facts stack instead of wrapping around their separator */
  .lg-facts { flex-direction: column; align-items: flex-start; }
  .lg-facts .lg-sep { display: none; }
  .lg-fold__sum { gap: var(--space-2); }
  /* «دخول منصتك» becomes its icon (the words stay for screen readers) */
  .lg-top__login { width: var(--control-md); padding-inline: 0; }
  .lg-top__login .lg-ico { display: block; }
  .lg-top__login-t {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (min-width: 640px) {
  .lg-top__home { display: inline-flex; }
  .lg-btn { padding-inline: var(--space-4); }
  .lg-top__login .lg-ico { display: block; }
}
@media (min-width: 1024px) {
  .lg-brand img { height: 44px; }
  .lg-top__in { gap: var(--space-4); }
}

/* ---------------------------------------------------------------------------------------------------------
   4. The band: ordinal and version, the title, the entity and date, the four documents
   --------------------------------------------------------------------------------------------------------- */
.lg-hero { position: relative; isolation: isolate; }
.lg-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  /* brand-ok: the band's light sits under its own text, inside the band's isolated stacking context */
  z-index: -1;
  pointer-events: none;
  background: var(--lg-glow);
}
.lg-hero__in {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding-block: var(--space-8) var(--space-10);
}
.lg-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
  font-weight: 500;
}
.lg-dia {
  flex: none;
  width: 8px;
  height: 8px;
  margin-inline-end: var(--space-1);
  background: var(--gold);
  transform: rotate(45deg);
}
.lg-sep {
  flex: none;
  width: 4px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: currentColor;
  opacity: 0.6;
}
.lg-title {
  max-width: 30ch;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 2.5rem;
  font-weight: 700;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.lg-title:focus { outline: none; } /* brand-ok: a programmatic focus target (back to top), never reached by Tab */
.lg-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-2);
  color: var(--fg-muted);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
}
.lg-docs { width: 100%; margin-top: var(--space-3); }
.lg-docs ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.lg-docs li { flex: 1 1 auto; display: flex; }
.lg-chip {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: var(--control-md);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--lg-tint);
  color: var(--fg-muted);
  font-size: var(--text-body);
  line-height: 1.25rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .lg-chip:hover { color: var(--fg); border-color: var(--line-control); }
}
.lg-chip[aria-current="page"] {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--lg-tint-gold);
}

@media (min-width: 640px) {
  .lg-docs li { flex: 0 0 auto; }
}
@media (min-width: 768px) {
  .lg-title { font-size: 2rem; line-height: 2.75rem; }
  .lg-hero__in { padding-block: var(--space-12); }
}
@media (min-width: 1024px) {
  .lg-title { font-size: var(--text-display-md); line-height: var(--text-display-md--line-height); }
  .lg-hero__in { position: relative; gap: var(--space-4); padding-block: var(--space-16) var(--space-12); }
  /* the brand lattice in the band's empty half, fading out before the text (one surface, at most 12% on dark,
     never under text). A copy of --darb-pattern-on-dark from ds/darb/pattern.css (scripts/build_assets.py). */
  .lg-hero__in::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: 42%;
    /* brand-ok: the lattice sits under the band's text layer, inside the band's isolated stacking context */
    z-index: -1;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22120%22%20height%3D%22120%22%20viewBox%3D%220%200%20120%20120%22%3E%3Cpath%20d%3D%22M26.00%200.00%20L18.38%207.62%20L18.38%2018.38%20L7.62%2018.38%20L0.00%2026.00%20L-7.62%2018.38%20L-18.38%2018.38%20L-18.38%207.62%20L-26.00%200.00%20L-18.38%20-7.62%20L-18.38%20-18.38%20L-7.62%20-18.38%20L-0.00%20-26.00%20L7.62%20-18.38%20L18.38%20-18.38%20L18.38%20-7.62ZM10.09%204.18%20L4.18%2010.09%20L-4.18%2010.09%20L-10.09%204.18%20L-10.09%20-4.18%20L-4.18%20-10.09%20L4.18%20-10.09%20L10.09%20-4.18ZM146.00%200.00%20L138.38%207.62%20L138.38%2018.38%20L127.62%2018.38%20L120.00%2026.00%20L112.38%2018.38%20L101.62%2018.38%20L101.62%207.62%20L94.00%200.00%20L101.62%20-7.62%20L101.62%20-18.38%20L112.38%20-18.38%20L120.00%20-26.00%20L127.62%20-18.38%20L138.38%20-18.38%20L138.38%20-7.62ZM130.09%204.18%20L124.18%2010.09%20L115.82%2010.09%20L109.91%204.18%20L109.91%20-4.18%20L115.82%20-10.09%20L124.18%20-10.09%20L130.09%20-4.18ZM26.00%20120.00%20L18.38%20127.62%20L18.38%20138.38%20L7.62%20138.38%20L0.00%20146.00%20L-7.62%20138.38%20L-18.38%20138.38%20L-18.38%20127.62%20L-26.00%20120.00%20L-18.38%20112.38%20L-18.38%20101.62%20L-7.62%20101.62%20L-0.00%2094.00%20L7.62%20101.62%20L18.38%20101.62%20L18.38%20112.38ZM10.09%20124.18%20L4.18%20130.09%20L-4.18%20130.09%20L-10.09%20124.18%20L-10.09%20115.82%20L-4.18%20109.91%20L4.18%20109.91%20L10.09%20115.82ZM146.00%20120.00%20L138.38%20127.62%20L138.38%20138.38%20L127.62%20138.38%20L120.00%20146.00%20L112.38%20138.38%20L101.62%20138.38%20L101.62%20127.62%20L94.00%20120.00%20L101.62%20112.38%20L101.62%20101.62%20L112.38%20101.62%20L120.00%2094.00%20L127.62%20101.62%20L138.38%20101.62%20L138.38%20112.38ZM130.09%20124.18%20L124.18%20130.09%20L115.82%20130.09%20L109.91%20124.18%20L109.91%20115.82%20L115.82%20109.91%20L124.18%20109.91%20L130.09%20115.82ZM86.00%2060.00%20L78.38%2067.62%20L78.38%2078.38%20L67.62%2078.38%20L60.00%2086.00%20L52.38%2078.38%20L41.62%2078.38%20L41.62%2067.62%20L34.00%2060.00%20L41.62%2052.38%20L41.62%2041.62%20L52.38%2041.62%20L60.00%2034.00%20L67.62%2041.62%20L78.38%2041.62%20L78.38%2052.38ZM70.09%2064.18%20L64.18%2070.09%20L55.82%2070.09%20L49.91%2064.18%20L49.91%2055.82%20L55.82%2049.91%20L64.18%2049.91%20L70.09%2055.82ZM34.0%2060.0%20L0%2060.0%20M86.0%2060.0%20L120%2060.0%20M60.0%2034.0%20L60.0%200%20M60.0%2086.0%20L60.0%20120M26%200%20L94%200%20M26%20120%20L94%20120%20M0%2026%20L0%2094%20M120%2026%20L120%2094M41.62%2041.62%20L18.38%2018.38M78.38%2041.62%20L101.62%2018.38M41.62%2078.38%20L18.38%20101.62M78.38%2078.38%20L101.62%20101.62%22%20fill%3D%22none%22%20stroke%3D%22%23F7F5F0%22%20stroke-width%3D%221.1%22%20stroke-opacity%3D%220.55%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cg%20fill%3D%22%23c8a24a%22%20fill-opacity%3D%220.95%22%3E%3Crect%20x%3D%22-3.6%22%20y%3D%2256.4%22%20width%3D%227.2%22%20height%3D%227.2%22%20transform%3D%22rotate%2845%200%2060.0%29%22%2F%3E%3Crect%20x%3D%22116.4%22%20y%3D%2256.4%22%20width%3D%227.2%22%20height%3D%227.2%22%20transform%3D%22rotate%2845%20120%2060.0%29%22%2F%3E%3Crect%20x%3D%2256.4%22%20y%3D%22-3.6%22%20width%3D%227.2%22%20height%3D%227.2%22%20transform%3D%22rotate%2845%2060.0%200%29%22%2F%3E%3Crect%20x%3D%2256.4%22%20y%3D%22116.4%22%20width%3D%227.2%22%20height%3D%227.2%22%20transform%3D%22rotate%2845%2060.0%20120%29%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 0 0 / 170px;
    opacity: var(--opacity-pattern-dark-max);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 30%, black 45%, transparent 92%);
    mask-image: linear-gradient(90deg, transparent, black 30%, black 45%, transparent 92%);
  }
}

/* ---------------------------------------------------------------------------------------------------------
   5. Reading area: the paper sheet; the contents fold on a phone, a sticky glass column from 1024px
   --------------------------------------------------------------------------------------------------------- */
.lg-body.lg-wrap { padding-inline: 0; }
.lg-side { display: none; }

.lg-sheet {
  position: relative;
  border-radius: var(--radius-2xl);
  background: var(--bg);
  color: var(--fg);
  padding: var(--space-8) var(--space-5) var(--space-10);
}
/* one decorative gold diamond where the paper meets the dark */
.lg-sheet::before {
  content: "";
  position: absolute;
  top: -6px;
  inset-inline-start: 50%;
  width: 12px;
  height: 12px;
  background: var(--gold);
  transform: translateX(50%) rotate(45deg);
}
.lg-sheet:focus-visible { outline-color: var(--gold-soft); outline-offset: 4px; }
.lg-sheet > * { max-width: 42.5rem; } /* 680px: about 70 letters a line */

/* the contents, folded (phone and tablet) */
.lg-fold {
  margin-block-end: var(--space-8);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.lg-fold__sum {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  cursor: pointer;
  list-style: none;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  line-height: 1.5rem;
  font-weight: 600;
}
.lg-fold__sum::-webkit-details-marker { display: none; }
.lg-fold__sum::marker { content: ""; }
.lg-fold__ico { color: var(--accent-ink); }
.lg-fold__h { white-space: nowrap; }
.lg-fold__n {
  white-space: nowrap;
  margin-inline-start: auto;
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 400;
}
.lg-fold__chev { color: var(--fg-muted); transition: transform var(--dur-base) var(--ease-out); }
.lg-fold[open] .lg-fold__chev { transform: rotate(180deg); }
.lg-fold__list {
  padding: var(--space-2);
  border-top: 1px solid var(--line);
}

/* the contents list (shared by the fold and the column) */
.lg-fold__list a,
.lg-toc__list a {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-height: var(--control-md);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--fg-muted);
  font-size: var(--text-body);
  line-height: 1.75rem;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.lg-tn {
  flex: none;
  min-width: 1.75rem;
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.lg-tt { min-width: 0; overflow-wrap: break-word; }
@media (hover: hover) {
  .lg-fold__list a:hover { color: var(--fg); background: var(--surface-quiet); }
}
.lg-fold__list a[aria-current="true"] { color: var(--fg); background: var(--accent-wash); }

/* the sections */
.lg-sec { margin-block-start: var(--space-10); }
.lg-sec:first-of-type { margin-block-start: 0; }
.lg-sec h2 {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--text-heading-md);
  line-height: var(--text-heading-md--line-height);
  font-weight: 600;
  letter-spacing: 0;
}
.lg-n {
  flex: none;
  min-width: 1.6em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.lg-h { min-width: 0; text-wrap: balance; overflow-wrap: break-word; }
.lg-sec p {
  color: var(--fg);
  font-size: var(--text-body-lg);
  line-height: 2rem;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.lg-sec p + p { margin-block-start: var(--space-4); }
.lg-sec p a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: auto;
}
@media (hover: hover) {
  .lg-sec p a:hover { text-decoration-thickness: 2px; }
}

/* after the text: the other documents, and whom to ask */
.lg-end {
  margin-block-start: var(--space-12);
  padding-block-start: var(--space-8);
  border-top: 1px solid var(--line);
}
.lg-end__h {
  margin-block-end: var(--space-4);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--text-heading-sm);
  line-height: var(--text-heading-sm--line-height);
  font-weight: 600;
}
.lg-others {
  display: grid;
  gap: var(--space-3);
}
.lg-other {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  height: 100%;
  min-height: 64px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.lg-other__txt { display: flex; flex-direction: column; min-width: 0; }
.lg-other__ord {
  color: var(--fg-muted);
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
}
.lg-other__t {
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
  font-weight: 600;
}
.lg-other .lg-ico { color: var(--accent-ink); transition: transform var(--dur-fast) var(--ease-out); }
@media (hover: hover) {
  .lg-other:hover { border-color: var(--line-control); }
  [dir="rtl"] .lg-other:hover .lg-ico--dir { transform: scaleX(-1) translateX(3px); }
}
.lg-ask {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-block-start: var(--space-8);
}
.lg-ask__t {
  color: var(--fg-muted);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
  font-weight: 500;
}
.lg-ask__links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.lg-ask__a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-md);
  padding-inline: var(--space-4);
  border: 1px solid var(--line-control);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.lg-ask__a .lg-ico { color: var(--accent-ink); }
@media (hover: hover) {
  .lg-ask__a:hover { border-color: var(--fg); }
}

@media (min-width: 640px) {
  .lg-body.lg-wrap { padding-inline: var(--lg-pad); }
  .lg-sheet { padding: var(--space-10) var(--space-10) var(--space-12); }
  .lg-others { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* the contents as a sticky glass column beside the sheet */
@media (min-width: 1024px) {
  .lg-body {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    column-gap: var(--space-8);
    align-items: start;
  }
  .lg-side {
    display: block;
    position: sticky;
    top: calc(var(--lg-top-h) + var(--space-6));
  }
  .lg-fold { display: none; }
  .lg-sheet { padding: var(--space-12) var(--space-12) var(--space-16); }
  .lg-sec h2 { font-size: var(--text-heading-lg); line-height: var(--text-heading-lg--line-height); }
}
.lg-toc {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--lg-top-h) - var(--space-12));
  padding: var(--space-5) var(--space-2) var(--space-2);
  border-radius: var(--radius-xl);
}
.lg-toc__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
  padding-inline: var(--space-3);
}
.lg-toc__h {
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  line-height: 1.5rem;
  font-weight: 600;
}
.lg-toc__n {
  color: var(--fg-muted);
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
}
.lg-toc__list {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.lg-toc__list a { min-height: var(--control-sm); line-height: 1.25rem; }
@media (hover: hover) {
  .lg-toc__list a:hover { color: var(--fg); background: var(--lg-tint); }
}
.lg-toc__list a[aria-current="true"] { color: var(--fg); background: var(--lg-tint-gold); }
@media (any-pointer: coarse) {
  .lg-toc__list a { min-height: var(--control-md); }
}

/* ---------------------------------------------------------------------------------------------------------
   6. Footer: the landing page's own (site/foot.html + foot.css, written from the exported landing by the design
      system's scripts/footer_extract.mjs), so «منصة موثقة رسميا» and all below it are the landing's, exactly
      (the owner, 2026-11-16). Every rule of foot.css is scoped under .lgf; here only its seat on the page.
   --------------------------------------------------------------------------------------------------------- */
.lgf { position: relative; z-index: 1; }

/* ---------------------------------------------------------------------------------------------------------
   7. Back to top (legal.js shows it once the reader is past the band, hides it over the footer)
   --------------------------------------------------------------------------------------------------------- */
.lg-totop {
  position: fixed;
  inset-inline-end: var(--space-4);
  bottom: var(--space-4);
  z-index: var(--z-raised);
  display: grid;
  place-items: center;
  width: var(--control-md);
  height: var(--control-md);
  border-radius: var(--radius-md);
  color: var(--accent-ink);
  opacity: 0;
  visibility: hidden; /* out of the tab order while it is not shown */
  transform: translateY(var(--space-2));
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
}
.lg-totop[hidden] { display: none; }
.lg-totop.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* touch feedback (no hover on a phone): the pressed state of each control */
.lg-top__home:active,
.lg-btn--glass:active { color: var(--accent-ink); }
.lg-btn--gold:active { transform: translateY(1px); }
.lg-chip:active { color: var(--fg); border-color: var(--line-control); }
.lg-fold__sum:active,
.lg-fold__list a:active { background: var(--surface-quiet); }
.lg-toc__list a:active { background: var(--lg-tint); }
.lg-other:active,
.lg-ask__a:active { border-color: var(--line-control); }

/* ---------------------------------------------------------------------------------------------------------
   8. Reduced motion: the token switch zeroes every duration; the gold glint goes too
   --------------------------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .lg-btn--gold::after { display: none; }
  .lg-btn--gold:hover { transform: none; }
}

/* ---------------------------------------------------------------------------------------------------------
   9. Print: the document alone, black on white
   --------------------------------------------------------------------------------------------------------- */
@media print {
  @page { margin: 16mm 15mm; }
  html { color-scheme: light; background: white; }
  body.lg { background: white; color: black; }
  body.lg::before,
  .lg-skip, .lg-top, .lg-docs, .lg-side, .lg-fold, .lg-end, .lgf, .lg-totop, .lg-dia,
  .lg-sheet::before, .lg-hero::before, .lg-hero__in::after { display: none !important; }
  .lg-wrap, .lg-body.lg-wrap { display: block; max-width: none; padding: 0; }
  .lg-hero__in { display: block; padding: 0 0 6mm; }
  .lg-kicker, .lg-title, .lg-facts, .lg-sheet, .lg-sec h2, .lg-n, .lg-sec p, .lg-sec p a { color: black !important; }
  .lg-kicker, .lg-facts { display: flex; margin-block-end: 2mm; }
  .lg-title { max-width: none; margin-block-end: 2mm; font-size: 20pt; line-height: 1.4; }
  .lg-sep { background: black; }
  .lg-sheet { padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .lg-sheet > * { max-width: none; }
  .lg-sec { margin-block-start: 6mm; }
  .lg-sec h2 { font-size: 13pt; line-height: 1.5; break-after: avoid; }
  .lg-sec p { font-size: 11pt; line-height: 1.8; orphans: 3; widows: 3; }
  .lg-sec p a { text-decoration: none; }
}
