/* ============================================================================
   v4 theme — Arabic edition only.

   The visual language of the v4 booklet (Claude Design, «Document redesign
   request», main-version-v4.dc.html) expressed as CSS over the block renderer's
   existing class hooks, so the CONTENT stays editable in src/content/ar-v4/ and the
   LOOK lives here.

   WHY THIS IS A SEPARATE FILE AND NOT PART OF styles.css
   -----------------------------------------------------
   dist/styles.css is shared by both editions and sits under dist/, which is
   byte-pinned against the frozen English baseline (D13). Adding a single rule to
   it moves bytes in an English-served file. This stylesheet is written to
   dist/ar/theme-ar.css instead and linked only from /ar/ pages, so nothing
   outside dist/ar/ changes. Every rule is ALSO scoped to html[lang="ar"], so the
   file is inert if it is ever loaded somewhere it should not be.

   It LOADS AFTER styles.css and deliberately overrides it. Keep it that way: the
   cascade, not !important, is what makes this readable.

   FIDELITY NOTE
   -------------
   v4 is hand-set: 40 fixed A4 boxes with overflow:hidden and footnotes pinned
   12mm from the bottom of a named page. That cannot survive editable content —
   and it was already clipping two figures (p11 fig 2ب, p30 fig 18). So this
   reproduces v4's design LANGUAGE — palette, type scale, component shapes — and
   lets pagination be computed. It will look like v4; it is not page-for-page v4.

   Sizes are authored in rem for the screen and re-stated in px/mm in the print
   block, because v4's scale is defined at A4 and only means something there.
   ========================================================================== */

/* v4's two faces, SELF-HOSTED (R0). Naming the families is not enough — without
   these rules the page silently falls back to Segoe UI and none of v4's
   typography is what renders. Contained in this AR-only file, so the frozen
   English edition never requests them.

   The 32 rules below are Google Fonts' own css2 response for v4's link
   (IBM Plex Sans Arabic 300–700, Archivo 400–700, display=swap), block for
   block and in Google's order — the order decides which face serves a character
   two subsets share (U+0304, U+0308, U+0329) — with only each src pointed at the
   same woff2 file, vendored in src/web/fonts/ and copied by the build to
   dist/ar/fonts/. So the book no longer changes when Google changes a file, the
   PDF builds offline, and a reader's browser never calls a third party.
   Provenance, licences and the response verbatim: src/web/fonts/README.md. Do
   not edit a rule here; every line break of the book depends on these files.
   After them come five rules that are NOT Google's: the derived Arabic face
   «Dalil Sans Arabic» (W-R22, P1 — see the note above them). */
/* vietnamese */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-300-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-300-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-300-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-300-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-400-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-400-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-500-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-500-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-600-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-600-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-700-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-700-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* THE DERIVED ARABIC FACE (W-R22, P1). Five more rules, NOT Google's: «Dalil Sans Arabic», IBM Plex Sans
   Arabic's Arabic subsets above with their required ligatures split (src/scripts/make_dalil_fonts.py;
   src/web/fonts/FONTLOG-DalilSansArabic.txt). Each is the arabic rule of its weight above with the family
   and the file changed — same unicode-range — so every Arabic letter the stacks below send to Plex is now
   drawn by the derived face (the same outline at the same place, one letter per glyph in a PDF), while
   everything else — spaces, digits, Latin — still comes from Plex's own subsets: the derived face claims
   no U+0020, so each element's first available font (its line metrics) is Plex's Latin subset, as before.
   Every stack that names Plex names Dalil first. Plex's own rules above stay Google's response (the
   one-page HTML, src/web/onepage.js, still embeds them; offline_net.js pairs them with Google's). */
/* Dalil Sans Arabic 300: Google's IBM Plex Sans Arabic 300 arabic rule, the derived face */
@font-face {
  font-family: 'Dalil Sans Arabic';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/dalil-sans-arabic-300-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* Dalil Sans Arabic 400: Google's IBM Plex Sans Arabic 400 arabic rule, the derived face */
@font-face {
  font-family: 'Dalil Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/dalil-sans-arabic-400-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* Dalil Sans Arabic 500: Google's IBM Plex Sans Arabic 500 arabic rule, the derived face */
@font-face {
  font-family: 'Dalil Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/dalil-sans-arabic-500-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* Dalil Sans Arabic 600: Google's IBM Plex Sans Arabic 600 arabic rule, the derived face */
@font-face {
  font-family: 'Dalil Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/dalil-sans-arabic-600-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* Dalil Sans Arabic 700: Google's IBM Plex Sans Arabic 700 arabic rule, the derived face */
@font-face {
  font-family: 'Dalil Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/dalil-sans-arabic-700-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

html[lang="ar"] {
  /* ---- palette ----------------------------------------------------------
     These are the values v4 ACTUALLY renders. The inline fallbacks written
     throughout main-version-v4.dc.html (var(--bk-field,#ec3013) etc.) are a red
     palette that its JS overwrites on mount and that never reaches paper.
     Contrast, measured: ink/bg 14.62 · title/bg 5.29 · white/field 13.87 ·
     muted/bg 6.50 · title/panel 4.53 (AA by 0.03 — do not darken the panel).
     NOT safe: title on field (2.35) and title on ink (2.76). Never put gold
     text on a navy or ink ground.                                            */
  --v4-bg:    #f5f2ec;   /* paper                                             */
  --v4-ink:   #20201d;   /* body text, rules, table header ground             */
  --v4-field: #1c2c4c;   /* navy — part banners, step markers, caption rule   */
  --v4-title: #8a5a12;   /* gold — kickers, sub-headings, links               */
  --v4-muted: #575753;   /* computed color-mix(ink 74%, bg)                   */
  --v4-panel: #e4e1db;   /* computed color-mix(ink 8%, bg) — card grounds     */
  --v4-rule:  #a09e99;   /* computed color-mix(ink 40%, bg) — hairlines       */

  /* ---- type -------------------------------------------------------------
     Two families, as v4: IBM Plex Sans Arabic for everything, Archivo for Latin
     numerals and the small all-caps kickers where Plex's figures look weak.
     Plex's ARABIC letters come from «Dalil Sans Arabic», its derived face with
     the required ligatures split (W-R22: the same drawing, one letter per glyph
     for a PDF reader), named first wherever Plex is named.                     */
  --v4-sans: 'Dalil Sans Arabic', 'IBM Plex Sans Arabic', 'Segoe UI', 'Noto Sans Arabic', Tahoma, sans-serif;
  --v4-latin: Archivo, 'Dalil Sans Arabic', 'IBM Plex Sans Arabic', sans-serif;
}

/* Re-point EVERY token styles.css defines, so anything this file does not
   restyle still lands in the v4 palette instead of the old teal. styles.css has
   no hard-coded teal outside its :root, so re-pointing the tokens is sufficient
   and complete — verified by sweeping the rendered page for any computed colour
   whose green and blue both exceed its red. Miss one and it leaks: the first cut
   of this file re-pointed invented names (--accent, --rule) that styles.css does
   not define, and the chapter rule, the nav marker, every <strong> and the skip
   link all stayed teal. */
html[lang="ar"] {
  --teal:  var(--v4-ink);      /* headings, skip link, <strong>, nav marker   */
  --teal2: var(--v4-field);    /* secondary accent, rules                     */
  --ink:   var(--v4-ink);
  --muted: var(--v4-muted);
  --bg:    var(--v4-bg);
  --bg-alt: var(--v4-panel);
  --line:  var(--v4-rule);
  --focus: var(--v4-field);

  /* Callout grounds. This file restyles .callout directly, so these matter only
     for anything that reads them without going through that rule. */
  --tip-bg: var(--v4-panel);    --tip-bd: #8a5a12;
  --avoid-bg: #f6e7e2;          --avoid-bd: #9a2c14;
  --note-bg: var(--v4-panel);   --note-bd: var(--v4-field);
  --beyond-bg: var(--v4-field); --beyond-bd: var(--v4-field);
  --wcag-bg: var(--v4-panel);   --wcag-bd: var(--v4-field);
}

/* The paper colour goes on the ROOT element, not just on body.
   Only the root element's background is propagated to the print canvas, and the
   canvas is the whole sheet including the page margins. With it on body alone,
   the margin band stays white and the cream reads as a panel floating on white
   paper — v4's page is cream edge to edge. */
html[lang="ar"] {
  background: var(--v4-bg);
}
html[lang="ar"] body {
  background: var(--v4-bg);
  color: var(--v4-ink);
  font-family: var(--v4-sans);
  line-height: 1.6;
}

/* ---------- headings ------------------------------------------------------
   v4 (C3): the chapter title and a section heading are the SAME type — 600
   24px/1.25, tracked -.01em — and neither is ruled UNDER. A section heading is
   ruled ABOVE, a 2px ink line with 3.4mm of air under it, unless it opens its
   page; the chapter title takes that rule only where it does not open its page
   (under a part banner). h3 is 600 18px/1.3 in gold. The print values, in the
   px/mm v4 authored them in, are in the print block and on the paginated page
   below; these are their screen equivalents.
   NEGATIVE TRACKING ON AN ARABIC HEADING is carried on the word spaces too
   (C1 review F5): this Chromium leaves a cursive run's letters joined and its
   spaces at full width, so `word-spacing` = `letter-spacing` is where the
   tracking lands in an Arabic line, as it does in V0.98.                      */
html[lang="ar"] .content h1 {
  font: 600 1.6rem/1.25 var(--v4-sans);
  letter-spacing: -0.01em;
  word-spacing: -0.01em;
  color: var(--v4-ink);
  margin: 0 0 0.85rem;
  text-wrap: balance;
  border: 0;
  padding: 0;
}
html[lang="ar"] .content h2 {
  font: 600 1.5rem/1.25 var(--v4-sans);
  letter-spacing: -0.01em;
  word-spacing: -0.01em;
  color: var(--v4-ink);
  margin: 1.6rem 0 0.85rem;
  border-top: 2px solid var(--v4-ink);
  padding-top: 0.9rem;
  text-wrap: balance;
}
/* The first heading under the title opens the page's content: no rule. */
html[lang="ar"] .content h1 + h2 { border-top: 0; padding-top: 0; margin-top: 0; }
html[lang="ar"] .content h2 + * { margin-top: 0; }
html[lang="ar"] .content h3 {
  font: 600 1.125rem/1.3 var(--v4-sans);
  letter-spacing: -0.015em;
  word-spacing: -0.015em;
  color: var(--v4-title);
  margin: 1.4rem 0 0.6rem;
  text-wrap: balance;
}
/* v4's type ROLES for a heading level it sets at more than one size (lib/blocks
   heading opts.variant, html.js `h--<name>`): the 18px gold sub-heads of the
   introduction (v4 p4) and of chapter 2 (p12) («sub»), chapter 10's
   hairline-ruled 18px ink head («minor», p36) and chapter 4's five 17px gold
   heads («small», p18). All are h2 — v4 sets the gold ones as <h3> under its
   own <h2> chapter title; ours is an <h1>, so an h2 keeps the outline
   unbroken (C3 review F2) and the role prints v4's look. */
html[lang="ar"] .content h2.h--sub {
  font: 600 1.125rem/1.3 var(--v4-sans);
  letter-spacing: -0.015em;
  word-spacing: -0.015em;
  color: var(--v4-title);
  border: 0;
  padding: 0;
  margin: 1.4rem 0 0.6rem;
}
html[lang="ar"] .content h1 + h2.h--sub { margin-top: 0; }
html[lang="ar"] .content h2.h--minor {
  font: 600 1.125rem/1.3 var(--v4-sans);
  border-top: 1px solid var(--v4-rule);
  padding-top: 0.6rem;
}
html[lang="ar"] .content h2.h--small {
  font: 600 1.0625rem/1.3 var(--v4-sans);
  letter-spacing: -0.015em;
  word-spacing: -0.015em;
  color: var(--v4-title);
  border: 0;
  padding: 0;
  margin: 1rem 0 0.4rem;
}
html[lang="ar"] .content h4 {
  font: 600 1rem/1.35 var(--v4-sans);
  color: var(--v4-ink);
  margin: 1.2rem 0 0.5rem;
}

/* ---------- body ----------------------------------------------------------
   v4 sets a chapter's opening paragraph exactly as the body — 400 15px/1.6 —
   so a lead() is an ordinary paragraph to the eye (C3: it was 17px/1.65). */
html[lang="ar"] .content p {
  font: 400 1rem/1.6 var(--v4-sans);
  text-wrap: pretty;
  margin: 0 0 0.9rem;
}
html[lang="ar"] .content p.lead {
  font: 400 1rem/1.6 var(--v4-sans);
  color: var(--v4-ink);
}
/* v4's glossary opens with a muted 13.5px standfirst, ruled off under it
   (lib/blocks standfirst(), C3). */
html[lang="ar"] .content p.standfirst {
  font: 400 0.9rem/1.55 var(--v4-sans);
  color: var(--v4-muted);
  border-bottom: 1px solid var(--v4-rule);
  padding-bottom: 0.75rem;
  margin: 0 0 1.25rem;
}
html[lang="ar"] .content a { color: var(--v4-title); text-underline-offset: 3px; }
html[lang="ar"] .content a:hover { color: var(--v4-ink); }

/* ---------- lists ---------------------------------------------------------
   An ordinary list is v4's DEFAULT list (C3): a <ul> of filled round DISCS, an
   <ol> of plain ink «1.» — the marker the item's own face draws, 15px/1.6, at
   v4's indent. A square BOX is a checklist, and v4 draws one only where the
   reader ticks: the chapter closers and the quick-reference cells (their own
   rules, «THE BOXES» below). The first cut of this file drew every bullet as a
   hollow square, so every list read as a checklist.
   These rules sit under :where(), at the specificity of `html[lang] ul > li`,
   so EVERY list with a role of its own — the notes band, a closer, a card's
   steps, the contents, the reviewers — keeps its rule without an arms race.
   (A generic `.content ol > li` outranked `.pg__notes li` and printed the page
   notes at body size — C3, handover §4c.)                                     */
html[lang="ar"] :where(.content) :where(ul, ol) {
  margin: 0 0 1rem;
  font: 400 1rem/1.6 var(--v4-sans);
}
html[lang="ar"] :where(.content) ul { list-style: disc outside; padding-inline-start: 1.4rem; }
html[lang="ar"] :where(.content) ol { list-style: decimal outside; padding-inline-start: 1.5rem; }
html[lang="ar"] :where(.content) :where(ul, ol) > li { margin: 0 0 0.3rem; text-wrap: pretty; }
/* A bullet's bold lead-in («YouTube:», «صورة زخرفية:») is SemiBold, as v4 sets
   it (C6): v4 writes `<strong style="font-weight:600">` on every one of its nine
   list-item bold runs (p5, p12, p17, p33), while the bold words of its running
   text keep the browser's bold, 700 (the note box of p15). At 700 two bullets
   of p17 broke their lines elsewhere than V0.98. */
html[lang="ar"] .content ul > li > strong { font-weight: 600; }

/* ---------- tables --------------------------------------------------------
   v4 (C3): `table-layout: fixed` — equal columns unless the module gives widths
   (html.js writes them as a <colgroup>) — an ink header band with paper text, a
   1px ink frame on the header cells and a 1px hairline on every body cell; each
   row's first cell is its bold row header (<th scope="row">, table rowHeaders);
   no zebra, no outer frame, no rounded corners. styles.css's zebra
   (`tbody tr:nth-child(even)`) and its bordered, rounded scroll wrapper are
   cancelled here. The wrapper stays a scroll region on a narrow screen and
   carries the table's space below it (the table's own margin would sit INSIDE
   the scroll box, as an empty band under the last row).                      */
html[lang="ar"] .content .table-wrap {
  border: 0;
  border-radius: 0;
  margin: 0 0 1.2rem;
}
html[lang="ar"] .content table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
  font: 400 0.9rem/1.5 var(--v4-sans);
}
html[lang="ar"] .content tbody tr { background: none; }
html[lang="ar"] .content thead th {
  font: 600 0.9rem/1.4 var(--v4-sans);
  text-align: start;
  background: var(--v4-ink);
  color: var(--v4-bg);
  border: 1px solid var(--v4-ink);
  padding: var(--table-pad-block, 0.5rem) var(--table-pad-inline, 0.65rem);
}
html[lang="ar"] .content td,
html[lang="ar"] .content tbody th {
  font: 400 0.9rem/1.5 var(--v4-sans);
  text-align: start;
  border: 1px solid var(--v4-rule);
  padding: var(--table-pad-block, 0.5rem) var(--table-pad-inline, 0.65rem);
  vertical-align: top;
  text-wrap: pretty;
}
html[lang="ar"] .content tbody th { font-weight: 600; }
/* v4's TOOLS tables (chapter 12, table variant 'tools'): a 14.5px/1.3 header,
   13.5px/1.45 cells, and a tool's address as a second line of its cell in
   Archivo 11.5px — ink, not a gold underlined link, left-to-right. */
html[lang="ar"] .content table.table--tools thead th { font: 600 0.95rem/1.3 var(--v4-sans); }
html[lang="ar"] .content table.table--tools td { line-height: 1.45; }
html[lang="ar"] .content td > bdi[dir="ltr"] { font-family: Archivo, sans-serif; font-size: 0.75rem; }
html[lang="ar"] .content td > bdi[dir="ltr"] a { color: inherit; text-decoration: none; }

/* ---------- figures (C4: v4's, every one) ---------------------------------
   v4 sets EVERY picture centred on a grey PANEL — the panel ground, 3mm of
   padding, no frame and no rounding on the image (html.js `figure__panel`) —
   and the caption under it START-aligned, muted 12.5px/1.5, its 2px NAVY rule
   right beside the text. The shared stylesheet frames, rounds, centres and
   italicises figures (styles.css); all four are cancelled here.
   THE SCREEN AND THE PAGE DIFFER ON PURPOSE (C4 review M2, owner's ruling):
   v4's SIDE-BY-SIDE layouts — the figure row, the group's panels, the key
   beside its picture, the figure beside its card — are PRINT-ONLY (below,
   under @media print). On the website every figure STACKS, at every width,
   and each picture shows at its own pixel width or the column's width,
   whichever is smaller: a screenshot narrower than the column reads at 1:1,
   and a wider one shrinks only to the column (figure 6, the widest of the
   side-by-side ones, to 0.58 of its pixels at 1280px; check:style holds every
   one of them to that floor). Set side by side in a 736px column they printed
   their labels at 0.27–0.47 of their pixels, ~4px on a standard screen. So on
   the screen the panel keeps its 3mm of ground above and below the picture
   but none at its sides — a picture as wide as the column fills it. The
   PRINTED sizes are v4's own per-figure caps (the print block's «EVERY
   FIGURE AT v4'S OWN SIZE»: lib/blocks figure `fit`) and v4's own layouts
   (the @media print rules right below). */
html[lang="ar"] .content figure { margin: 1.2rem 0; text-align: start; }
html[lang="ar"] .content .figure__panel {
  background: var(--v4-panel);
  padding: 3mm;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}
html[lang="ar"] .content figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
html[lang="ar"] .content figcaption {
  font: 400 0.82rem/1.5 var(--v4-sans);
  color: var(--v4-muted);
  margin-top: 2mm;
  padding-inline-start: 2mm;
  border-inline-start: 2px solid var(--v4-field);
  text-align: start;
  font-style: normal;
  text-wrap: pretty;
}
/* A figure's KEY (lib/blocks figure `legend` — v4's figure 12, p28): each
   callout's number typed in a 5.5mm filled navy badge (white Archivo 11px),
   2.5mm from its line, the lines 2mm apart. On the screen the key stands over
   its picture; in print, beside it (below). */
html[lang="ar"] .content .figure__key {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2mm;
  font: 400 0.85rem/1.55 var(--v4-sans);
}
html[lang="ar"] .content .figure__key > li {
  display: flex;
  gap: 2.5mm;
  align-items: flex-start;
  margin: 0;
}
html[lang="ar"] .content .figure__badge {
  flex: 0 0 auto;
  width: 5.5mm;
  height: 5.5mm;
  border-radius: 50%;
  background: var(--v4-field);
  color: #fff;
  font: 600 11px/5.5mm var(--v4-latin);
  text-align: center;
}
html[lang="ar"] .content .figure__key-text { text-wrap: pretty; }
/* THE SCREEN: everything stacks. A row's figures and a beside pair's card and
   figure are blocks one under the other, each with its own margins; a group's
   panels and a key over its picture keep v4's gap between them (4mm, 5mm). */
@media screen {
  html[lang="ar"] .content .figure__panel { padding-inline: 0; }
  html[lang="ar"] .content .figure__panels { display: grid; gap: 4mm; }
  html[lang="ar"] .content .figure__keyed { display: grid; gap: 5mm; }
}
/* THE PAGE: v4's side-by-side layouts, print-only (the paginator measures in
   print media, so its page boxes see exactly these). */
@media print {
  /* A FIGURE ROW (lib/blocks figure opts.row — C3 p11/p12, C4 p16, p26, p28,
     p29): v4 sets a pair side by side — `display:flex; gap:4mm; margin:0 0
     3.2mm; align-items:stretch` — each figure an equal share, a column whose
     PANEL takes the height its caption leaves, so the two captions end level. */
  html[lang="ar"] .content .figure-row {
    display: flex;
    gap: 4mm;
    align-items: stretch;
    margin: 0 0 3.2mm;
  }
  html[lang="ar"] .content .figure-row > figure {
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  html[lang="ar"] .content .figure-row > figure > .figure__panel { flex: 1 1 auto; }
  /* A GROUP of panels under one caption (lib/blocks figureGroup — v4's figure
     7, p21): the panels side by side, 4mm apart, equal shares, stretched level. */
  html[lang="ar"] .content .figure__panels {
    display: flex;
    gap: 4mm;
    align-items: stretch;
  }
  html[lang="ar"] .content .figure__panels > .figure__panel { flex: 1 1 0; min-width: 0; }
  /* A figure with its KEY (figure 12, p28): the key in a 36% column beside the
     panel, 5mm apart. */
  html[lang="ar"] .content .figure__keyed {
    display: flex;
    gap: 5mm;
    align-items: flex-start;
  }
  html[lang="ar"] .content .figure__keyed > .figure__panel { flex: 1 1 0; min-width: 0; }
  html[lang="ar"] .content .figure__key { flex: 0 0 36%; }
  /* A FIGURE BESIDE A CARD (lib/blocks beside() — v4 p27, p30, p32): the card
     in the wide column, the figure in a column of v4's own width
     (--beside-width: 32% or 62mm), the two top-aligned, v4's gap between them
     (4mm; 5mm on p32) and v4's space under the pair (3.2mm; none on p30). The
     card and the figure carry no margin of their own inside it. */
  html[lang="ar"] .content .figure-beside {
    display: flex;
    gap: var(--beside-gap, 4mm);
    align-items: flex-start;
    margin: 0 0 var(--beside-after, 3.2mm);
  }
  html[lang="ar"] .content .figure-beside__main { flex: 1 1 0; min-width: 0; }
  html[lang="ar"] .content .figure-beside__aside {
    flex: 0 0 var(--beside-width, 32%);
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  html[lang="ar"] .content .figure-beside__main > .practical,
  html[lang="ar"] .content .figure-beside__aside > figure { margin: 0; }
}

/* ---------- callouts, walkthrough cards, closing reviews ------------------
   v4's boxes are set in ONE place, «THE BOXES (C3)» at the end of this file:
   the aside, the field box, the e-appendix strip, the «تطبيق عملي» card, the
   «مراجعة سريعة» closer, the card row and the quick-reference table. The rules
   that stood here drew v4's boxes from memory (a navy beyond-AA block, a filled
   walkthrough card, a gold bar on tips) and are gone. */

/* ---------- glossary ------------------------------------------------------
   v4 (C3): a two-column grid — the term in a 46mm gold 600 column beside its
   13.5px/1.55 definition, 5mm between them, 2mm above and below each row, a
   1px hairline between rows (not above the first row on a page). html.js wraps
   each dt/dd pair in a `glossary__row` (a <div> is a valid child of <dl> for
   exactly this). The px/mm are v4's print values, restated for the screen in
   rem; on a phone the term stacks over its definition. */
html[lang="ar"] .content dl.glossary { margin: 0 0 1rem; }
html[lang="ar"] .content .glossary__row {
  display: grid;
  grid-template-columns: 46mm minmax(0, 1fr);
  gap: 0 5mm;
  align-items: start;
  padding: 0.5rem 0;
}
html[lang="ar"] .content .glossary__row + .glossary__row { border-top: 1px solid var(--v4-rule); }
html[lang="ar"] .content .glossary dt {
  font: 600 0.95rem/1.5 var(--v4-sans);
  color: var(--v4-title);
  margin: 0;
  text-wrap: balance;
}
html[lang="ar"] .content .glossary dd {
  margin: 0;
  font: 400 0.9rem/1.55 var(--v4-sans);
  color: var(--v4-ink);
  text-wrap: pretty;
}
/* A row the paginator cut inside its definition continues on the next page as
   a row holding only the rest of the <dd>: it stays in the definition column. */
html[lang="ar"] .content .glossary__row > dd:first-child { grid-column: 2; }
@media screen and (max-width: 40rem) {
  html[lang="ar"] .content .glossary__row { grid-template-columns: minmax(0, 1fr); gap: 0.2rem 0; }
  html[lang="ar"] .content .glossary__row > dd:first-child { grid-column: 1; }
}

/* ---------- the resources list (linkList, v4 p40) ---------------------------
   v4's «مصادر التعلم» is a <dl> with no header: each entry under a 1px
   hairline, its Arabic line (14.5px/1.55) over its address on a line of its
   own — Archivo 500 13px/1.4, gold, left-to-right, flush with the LEFT edge
   (the start of an LTR line), broken anywhere rather than overflowing. */
html[lang="ar"] .content dl.link-list { margin: 0 0 1rem; }
html[lang="ar"] .content .link-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6mm;
  border-top: 1px solid var(--v4-rule);
  padding: 0.5rem 0;
}
html[lang="ar"] .content .link-list__title {
  font: 400 0.95rem/1.55 var(--v4-sans);
  margin: 0;
  text-wrap: pretty;
}
html[lang="ar"] .content .link-list__url {
  font: 500 0.85rem/1.4 Archivo, sans-serif;
  color: var(--v4-title);
  margin: 0;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
  overflow-wrap: anywhere;
}
html[lang="ar"] .content .link-list__url a { color: inherit; }

/* ---------- part divider --------------------------------------------------
   v4's navy band: white title on --v4-field, with the blurb beneath.           */
html[lang="ar"] .part-divider {
  background: var(--v4-field);
  color: #fff;
  padding: 1.4rem 1.6rem;
  border: 0;
  margin: 2rem 0;
}
html[lang="ar"] .part-kicker {
  font: 600 0.75rem/1.3 var(--v4-latin);
  letter-spacing: 0.12em;
  color: #fff;
  opacity: 0.85;
}
html[lang="ar"] .part-title {
  font: 600 1.5rem/1.25 var(--v4-sans);
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0.3rem 0 0;
}
/* The part blurb is a .lead, so the generic lead rule above reaches it and puts
   ink on navy at 1.18:1 — the single contrast failure in the first render of
   the pilot, and again in C3's first cut (C3 review F1), when that rule became
   `.content p.lead` (0,3,2) and outranked this one (0,3,1). The `.content …
   p.lead` selector (0,4,2) keeps white winning whatever the lead rule's weight;
   check_style's site checks compute the contrast on the built page (≥ 4.5:1).
   White on navy is 13.87:1. */
html[lang="ar"] .part-divider .lead,
html[lang="ar"] .part-divider p,
html[lang="ar"] .content .part-divider p.lead {
  color: #fff;
  margin: 0.6rem 0 0;
}

/* ---------- endnotes ------------------------------------------------------
   v4 pins 16 footnotes to the bottoms of named pages. Fixed-page footnotes
   cannot survive editable content, so the same notes are rendered as a short
   per-chapter «الهوامش» list, with the superscript markers linking both ways.
   On screen they are set at 0.9rem, not v4's print 10px (= 7.5 pt), which the
   review flagged as below the project's own Arabic floor.                      */
html[lang="ar"] .endnotes {
  margin: 2.4rem 0 0;
  padding-top: 0.8rem;
  border-top: 2px solid var(--v4-ink);
}
/* `.content` in the selector: the section heading rule (`.content h2`, ruled
   and 24px) must not reach the notes' own small title. */
html[lang="ar"] .content .endnotes__title {
  border: 0;
  padding: 0;
  font: 600 0.75rem/1.3 var(--v4-latin);
  letter-spacing: 0.09em;
  color: var(--v4-title);
  margin: 0 0 0.6rem;
}
html[lang="ar"] .endnotes ol {
  list-style: none;
  padding-inline-start: 0;
  margin: 0;
}
html[lang="ar"] .endnotes li {
  position: relative;
  padding-inline-start: 1.6rem;
  margin: 0 0 0.5rem;
  font: 400 0.9rem/1.55 var(--v4-sans);
  color: var(--v4-ink);
}
/* The number is the note's own `data-n` (html.js), not a counter: the printed
   book numbers its notes through the book (C2), so a chapter's first note may
   be its 5th. On the website data-n is the per-chapter number. */
html[lang="ar"] .endnotes li::before {
  content: attr(data-n);
  position: absolute;
  inset-inline-start: 0;
  font: 600 0.8rem/1.6 var(--v4-latin);
  color: var(--v4-title);
}
/* The in-text marker. A real link, so the note is reachable by keyboard and by
   a screen reader, and so the PDF gets a link annotation. v4's <sup>: Archivo
   600 11.5px, gold, line-height 0, raised, and TIGHT against the text on both
   sides — «(Hex)‏⁹،» — with no padding of its own (C3; the port's 0.15em each
   side printed «(Hex) ⁹ ،»). */
html[lang="ar"] .content .noteref {
  font: 600 0.72rem/0 Archivo, sans-serif;
  color: var(--v4-title);
  vertical-align: super;
  text-decoration: none;
  padding: 0;
}
html[lang="ar"] .content .noteref:hover,
html[lang="ar"] .content .noteref:focus-visible { text-decoration: underline; }
html[lang="ar"] .endnotes .endnote-back {
  font: 600 0.75rem var(--v4-latin);
  color: var(--v4-title);
  margin-inline-start: 0.4em;
  text-decoration: none;
}

/* ---------- running head --------------------------------------------------
   Print-only page furniture. On screen the site header already names the book
   and the nav marks the chapter, so it would be duplication. */
html[lang="ar"] .running-head { display: none; }

/* ---------- site chrome ---------------------------------------------------
   Enough to stop the v4 page sitting inside a teal header. */
html[lang="ar"] .site-header { background: var(--v4-ink); border-bottom: 0; }
html[lang="ar"] .site-title,
html[lang="ar"] .site-header a { color: var(--v4-bg); }
html[lang="ar"] .site-footer { border-top: 2px solid var(--v4-ink); color: var(--v4-muted); }
html[lang="ar"] .kicker { color: var(--v4-title); font-family: var(--v4-latin); letter-spacing: 0.09em; }

html[lang="ar"] :focus-visible {
  outline: 2px solid var(--v4-field);
  outline-offset: 2px;
}
html[lang="ar"] ::selection { background: color-mix(in srgb, var(--v4-field) 22%, transparent); }

/* ---------- print ---------------------------------------------------------
   v4's scale is defined at A4, so restate it here in the units it was authored
   in. SIZES BELOW THE OLD FLOOR, BY DESIGN: the v3 edition's print floor was
   14px/1.6 (B7b); the v4 book prints v4's OWN sizes (ruling R2 — V0.98 is the
   reference for design as well as content): body and lists 15px/1.6, but boxes,
   tables, the glossary definitions and the closers' lists 13.5px, captions
   12.5px and the page notes 10px (~7.5pt). The owner knows these are below the
   old floor; the screen sizes above stay at or above it.                       */
@media print {
  /* EDGE-TO-EDGE PAPER COLOUR.
     Chromium does not paint the canvas background into the page-margin box, so
     with a printer margin set the sheet stays white and the cream reads as a
     panel floating on white paper. The only reliable way to get v4's cream sheet
     is to take the margin to zero and re-create it as padding on the body, so
     the body box IS the whole sheet and its background covers it.
     Keep these two in step: the padding below is the printed margin. */
  /* THE PAGE BOX.
     Top and bottom are RESERVED BANDS: Chromium draws the running head and the
     folio into them via the header/footer templates, and reserving them is the
     only way content stops short of them instead of running underneath.
     Left and right are ZERO on purpose — the 16mm side inset comes from body
     padding instead, because HORIZONTAL padding applies on every page while
     vertical padding applies only once, at the start and end of the element.
     Note: `!important` is invalid on an @page margin descriptor and is silently
     dropped, so there must be exactly ONE @page margin rule in the cascade.
     The cream paper is painted UNDER the finished PDF by the build (fitz
     draw_rect with overlay=false): Chromium never paints its own background into
     a page-margin box, and a header/footer template cannot carry a background
     either — not via CSS and not via an SVG rect. Both were measured. */
  @page { margin: 24mm 0 24mm; }
  html[lang="ar"] body { padding: 0 16mm; }

  /* THE RUNNING HEAD.
     v4 prints this on EVERY page. That is not reachable in plain Chromium, and
     the reason is worth recording so nobody re-tries it:
       · `position: fixed` DOES repaint on every printed sheet, but it cannot
         reserve space — from page 2 on, the text flows underneath it. Only
         `@page { margin }` reserves a band.
       · `@page { margin }` leaves that band white: Chromium never paints the
         canvas background into the page-margin box, and a fixed layer with
         negative insets is clipped to the page area (measured — corners stayed
         255,255,255 on every page).
       · CSS Paged Media's `@top-right { content: string(...) }`, which is the
         correct mechanism, is unimplemented in Chromium. Paged.js polyfills it
         and renders it perfectly — but version 0.4.3 does not paginate RTL:
         the same document produced 4 pages with dir="ltr" and 1 with dir="rtl",
         silently dropping the overflow.
     So until the print document is paginated by the build (see V4-REVIEW §E),
     the head is laid out in flow at the top of the chapter: correct on the
     opening page, absent on continuation pages. It does NOT collide with text,
     which the fixed version did. */
  html[lang="ar"] .site-header { display: none; }   /* replaced by the running head */
  html[lang="ar"] .running-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8mm;
    margin: 0 0 6mm;
    border-bottom: 2px solid var(--v4-ink);
    padding-bottom: 5px;
    font: 400 12px/1.1 var(--v4-sans);
  }
  /* In RTL, the first child lands on the right — the chapter, as in v4. */
  html[lang="ar"] .running-head__chapter {
    font-weight: 600;
    color: var(--v4-title);
    white-space: nowrap;
  }
  html[lang="ar"] .running-head__book {
    color: var(--v4-muted);
    white-space: nowrap;
  }

  /* styles.css forces `.site-header { background: #fff }` when printing, which
     lays a white band across the top of a cream page. The Arabic edition's paper
     is cream, so the chrome has to be too. */
  html[lang="ar"],
  html[lang="ar"] body,
  html[lang="ar"] .site-header,
  html[lang="ar"] .site-body,
  html[lang="ar"] .site-footer { background: var(--v4-bg); }
  html[lang="ar"] .site-header { border-block-end-color: var(--v4-ink); }
  /* The language toggle is a website control. styles.css already hides the nav
     and pager when printing; the toggle was left, and on paper it prints as an
     empty bordered box because its label is white on a now-cream header. */
  html[lang="ar"] .lang-toggle { display: none; }

  /* v4's TYPE AND SPACING, in the px and mm it authored them in (C3) — each
     value what Chromium computes for v4's own page (scratchpad/tools/
     styleparity.js), not an estimate:
       body  15px/1.55 (the design system's); a paragraph 400 15px/1.6, 3mm under
             it — a chapter's lead() included, which v4 sets as body text;
       h1    a chapter title: 600 24px/1.25, -.01em, 3.2mm under it, NO rule
             under it (the rule it carries under a part banner is ABOVE it —
             "on the paginated page" below);
       h2    the same type, ruled ABOVE — 2px ink, 3.4mm to the text — and
             3.2mm under it; no space above: the block above keeps its own;
       h3    600 18px/1.3 gold, 2.2mm under it;
       lists 400 15px/1.6: <ul> 5.5mm indent with round discs, <ol> 6mm with
             plain ink «1.», 2.7mm under the list and 1.25mm under each item.
     Where v4 hand-fits ONE block tighter to make a page (p5's three paragraphs
     at 2.3mm, p10's lists at 1.9mm, p33's at 1.3mm/0.6mm…), the module carries
     v4's own numbers as that block's `fit` (lib/blocks), which html.js hands
     over as --p-after / --list-after / --list-gap / --h-pad / --h-after; the
     values below are the fallbacks. The boxes' own values are in «THE BOXES
     (C3)» below. */
  html[lang="ar"] body { font-size: 15px; line-height: 1.55; }
  html[lang="ar"] .content h1 { font-size: 24px; line-height: 1.25; margin: 0 0 3.2mm; }
  /* A section heading's own tighter spacing, where v4 fits one (p10, p33: 2.6mm
     to the rule, 2.4mm under), arrives as its `fit` (lib/blocks heading opts,
     --h-pad / --h-after on the heading). */
  html[lang="ar"] .content h2 { font-size: 24px; line-height: 1.25; margin: 0 0 var(--h-after, 3.2mm); padding-top: var(--h-pad, 3.4mm); }
  html[lang="ar"] .content h1 + h2 { padding-top: var(--h-pad, 3.4mm); border-top: 2px solid var(--v4-ink); margin-top: 0; }
  html[lang="ar"] .content h3 { font-size: 18px; margin: 0 0 2.2mm; }
  html[lang="ar"] .content h4 { font-size: 16px; margin: 0 0 2mm; }
  /* v4's type roles at their print values: the gold 18px sub-head — 2.2mm
     under one that sits under the title (v4 p4, p12); 4.6mm above and 2.6mm
     under one that follows text (p4) — chapter 10's hairline-ruled 18px head
     (p36) and chapter 4's 17px gold heads, 1.5mm under each (p18). */
  html[lang="ar"] .content h2.h--sub { font-size: 18px; margin: 4.6mm 0 2.6mm; padding: 0; border: 0; }
  html[lang="ar"] .content h1 + h2.h--sub { margin: 0 0 2.2mm; }
  html[lang="ar"] .content h2.h--minor { font-size: 18px; line-height: 1.3; margin: 0 0 2mm; padding-top: 2.6mm; border-top: 1px solid var(--v4-rule); }
  html[lang="ar"] .content h2.h--small { font-size: 17px; margin: 0 0 1.5mm; }
  html[lang="ar"] .content p,
  html[lang="ar"] .content p.lead { font: 400 15px/1.6 var(--v4-sans); margin: 0 0 var(--p-after, 3mm); }
  html[lang="ar"] .content p.standfirst { font: 400 13.5px/1.55 var(--v4-sans); margin: 0 0 5mm; padding-bottom: 3mm; }
  html[lang="ar"] :where(.content) :where(ul, ol) { font: 400 15px/1.6 var(--v4-sans); margin: 0 0 var(--list-after, 2.7mm); }
  html[lang="ar"] :where(.content) ul { padding-inline-start: 5.5mm; }
  html[lang="ar"] :where(.content) ol { padding-inline-start: 6mm; }
  html[lang="ar"] :where(.content) :where(ul, ol) > li { margin: 0 0 var(--list-gap, 1.25mm); }
  /* A figure is v4's `margin: 0 0 3.2mm` — nothing above it; the block above
     keeps its own space. A figure v4 sets apart (lib/blocks figure `fit`:
     figure 1, 1.4mm) carries its own. Its caption is v4's 400 12.5px/1.5, 2mm
     under the panel, 2mm from its rule; v4's 12px captions (figures 2 (a)/(b)
     and 12) are the `small-caption` type role. */
  html[lang="ar"] .content figure { margin: 0 0 var(--fig-after, 3.2mm); }
  html[lang="ar"] .content figcaption { font: 400 12.5px/1.5 var(--v4-sans); margin-top: 2mm; padding-inline-start: 2mm; }
  html[lang="ar"] .content .figure--small-caption figcaption { font-size: 12px; }
  html[lang="ar"] .content .figure__key { font: 400 13.5px/1.55 var(--v4-sans); }
  /* Tables: v4's cells — 2mm × 2.6mm, 13.5px (header 13.5px/1.4, row header
     600 13.5px/1.5, cell 400 13.5px/1.5), the table 3.2mm clear of what
     follows. A table's own tighter cells (v4 p39: 1.5mm × 2.2mm) arrive as its
     `fit` (--table-pad-block / --table-pad-inline). */
  html[lang="ar"] .content .table-wrap { margin: 0 0 3.2mm; overflow: visible; }
  html[lang="ar"] .content thead th { font: 600 13.5px/1.4 var(--v4-sans); padding: var(--table-pad-block, 2mm) var(--table-pad-inline, 2.6mm); }
  html[lang="ar"] .content td,
  html[lang="ar"] .content tbody th { font-size: 13.5px; line-height: 1.5; padding: var(--table-pad-block, 2mm) var(--table-pad-inline, 2.6mm); }
  html[lang="ar"] .content table.table--tools thead th { font: 600 14.5px/1.3 var(--v4-sans); }
  html[lang="ar"] .content table.table--tools td { line-height: 1.45; }
  html[lang="ar"] .content td > bdi[dir="ltr"] { font-size: 11.5px; }
  /* The glossary grid and the resources list at v4's print sizes. */
  html[lang="ar"] .content .glossary__row { padding: 2mm 0; }
  html[lang="ar"] .content .glossary dt { font-size: 14.5px; }
  html[lang="ar"] .content .glossary dd { font-size: 13.5px; }
  html[lang="ar"] .content dl.glossary { margin: 0; }
  html[lang="ar"] .content dl.link-list { margin: 0 0 4mm; }
  html[lang="ar"] .content .link-list__row { padding: 2.1mm 0; }
  html[lang="ar"] .content .link-list__title { font-size: 14.5px; }
  html[lang="ar"] .content .link-list__url { font-size: 13px; }
  html[lang="ar"] .content .link-list__url a { text-decoration: none; }
  html[lang="ar"] .content .noteref { font-size: 11.5px; }
  /* ...except in a quick-reference cell, where v4's own marker is 600 11px (C6:
     its p37 row template; «12» printed 0.4pt larger than V0.98's). */
  html[lang="ar"] .content ul.cell-checklist .noteref { font-size: 11px; }
  html[lang="ar"] .part-divider { margin: 0 0 5.5mm; padding: 5mm 6mm; }

  /* NOT FIXED, and not fixable here: Chromium slices a LINE BOX across the page
     boundary, leaving the clipped top of a line — about 2.4pt — at the head of
     the next page. In Arabic that is precisely the row the dots and diacritics
     occupy, so the remnant reads as speckle. `break-inside: avoid` on p/li was
     tried and does not prevent it, and it costs bottom whitespace on every page,
     which a 40-page target cannot afford. A build-time paginator cuts at line
     boundaries and removes this by construction. Until then it remains. */

  /* Keep a walkthrough, a callout and a figure whole on one page. */
  html[lang="ar"] .content .practical,
  html[lang="ar"] .content .callout,
  html[lang="ar"] .content figure { break-inside: avoid; }
  html[lang="ar"] .content h1,
  html[lang="ar"] .content h2,
  html[lang="ar"] .content h3 { break-after: avoid; }
  html[lang="ar"] .endnotes { break-before: avoid; }

  /* EVERY FIGURE AT v4'S OWN SIZE (C4). The uniform 46mm cap is gone: v4
     sets each picture's cap on the picture itself (`max-height: 44mm`, 60mm,
     90mm, 22mm … or none), and a figure carries v4's value as its `fit.height`
     (lib/blocks), which arrives here as --fig-height. The picture keeps its
     proportions and never exceeds its panel's width, so one v4 left uncapped
     (figures 11, 12, 19) is bound by its column exactly as v4's is. Its panel
     takes v4's padding (--fig-pad: 3mm; figure 1 2.5mm, figure 12 2mm) and,
     where v4 fixes one, its height (--fig-panel: figure 1's 150px) and its
     width (--fig-width, C6: figure 1's 668px, 0.74mm wider than the column —
     in RTL the ground overhangs the END margin, as V0.98's does; every other
     panel is its column's width). The images
     are v4's own files, pixel for pixel, so the same printed size is the same
     ink size of every label in a screenshot (scratchpad/c4/ink.md). */
  html[lang="ar"] .content figure img { max-height: var(--fig-height, none); }
  html[lang="ar"] .content .figure__panel { padding: var(--fig-pad, 3mm); height: var(--fig-panel, auto); width: var(--fig-width, auto); }
}

/* ===========================================================================
   PAGINATED PAGE BOXES  (src/web/paginate.js)

   These are NOT inside @media print. The paginator measures with
   getBoundingClientRect() in screen context and only then is the PDF printed,
   so the box must already have its final geometry when it measures. Only the
   page-break behaviour is print-only.
   ========================================================================= */
html[lang="ar"] .pages { margin: 0; padding: 0; }

/* THE PAGE FRAME, as custom properties so a measurement can set another
   geometry without editing the rules (scratchpad/c3/a/frames.js does).

   What ships is v4's OWN frame, sides and verticals alike (C3). Every framed
   page of main-version-v4.dc.html sets `padding:14mm 18mm 20.0mm 16mm`, a
   running head `12px/1` with `padding-bottom:5px; margin:0 0 6mm`, and a foot
   band `position:absolute; bottom:12mm; right:18mm; left:16mm`. Measured on
   v4's render and on ours alike: head rule 14 → 19.03mm, body from 25.02mm,
   content box to 277mm, folio-only foot rule at 278.39mm (check_style's page
   probes hold every one of these to v4's computed value).

   It is 40 pages only with figure 1 at v4's height. With v4's type this frame
   paginates to 41 while figure 1 takes the common 46mm cap, and to 40 — every
   chapter opening on v4's page — with figure 1 in v4's own 150px panel
   (ch01-text.js, figure `fit`: pulled forward from C4's per-figure heights,
   with v4's figure rows on p11/p12). Until C3's review, C1's stopgap shipped
   instead — top 10mm, head 4px/1.1 + 3mm gap, the foot band 7mm up, no
   clearance: 13mm more body per page, which set 20 of v4's pages and all five
   drifting notes one page early (C3 review F3).

   THE BOTTOM PADDING IS DERIVED, not typed (C1 review F8): the band's distance
   from the sheet edge, plus the height of a folio-only band — its rule, its top
   padding, the folio's top padding and the folio's one 1.0-line-height line —
   plus the CLEARANCE between the body and that rule, v4's 1.3854mm (its content
   box ends 20mm above the sheet edge: 12mm + a 25px band + this). The paginator
   reads the same clearance off the laid-out page (paginate.js footClearance)
   and keeps it above a band that notes make taller, so a new folio size moves
   the body's limit with it instead of running text under the rule.

   The SIDES are v4's: PHYSICAL right/left, not logical — v4 writes them as
   physical values on an RTL page, so its START edge (the right) gets 18mm and
   its end edge 16mm. The first cut mirrored them. The measure is 176mm either
   way, so this moves no line and no page. src/web/pdf.js reads them back from
   a laid-out page and fails the build if they are not v4's. */
html[lang="ar"] {
  --pg-pad-top: 14mm;
  --pg-pad-right: 18mm;
  --pg-pad-left: 16mm;
  --pg-foot-bottom: 12mm;
  --pg-foot-clear: 1.3854mm;    /* body-to-rule clearance on a folio-only page */
  --pg-foot-rule: 2px;          /* .pg__foot border-top */
  --pg-foot-pad: 5px;           /* .pg__foot padding-top */
  --pg-folio-pad: 3px;          /* .pg__folio padding-top */
  --pg-folio-size: 15px;        /* .pg__folio font-size, at line-height 1 */
  --pg-foot-band: calc(var(--pg-foot-rule) + var(--pg-foot-pad) + var(--pg-folio-pad) + var(--pg-folio-size));
  --pg-pad-bottom: calc(var(--pg-foot-bottom) + var(--pg-foot-band) + var(--pg-foot-clear));
  --pg-head-pad: 5px;
  --pg-head-gap: 6mm;
  --pg-head-lh: 1;
}

html[lang="ar"] .pg {
  width: 210mm;                 /* A4, as v4 is set */
  height: 297mm;
  padding: var(--pg-pad-top) var(--pg-pad-right) var(--pg-pad-bottom) var(--pg-pad-left);
  box-sizing: border-box;
  margin: 0 auto;
  background: var(--v4-bg);
  color: var(--v4-ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;             /* a page is a fixed box; nothing may spill */
  position: relative;
}

/* The running head — now a real element on a real page, so it neither overlaps
   the text nor needs a reserved band. v4's head is a flex row whose two spans
   are its only content, so the row's height is the spans' 12px/1 line plus
   its 5px padding and 2px rule; the row itself keeps the page's 15px/1.55
   (v4's computed value — it sets no font of its own). */
html[lang="ar"] .pg__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8mm;
  border-bottom: 2px solid var(--v4-ink);
  padding-bottom: var(--pg-head-pad);
  margin: 0 0 var(--pg-head-gap);
  flex: 0 0 auto;
}
/* v4: the section's head `600 12px/1` in gold on the start edge, the book's
   title `400 12px/1` muted on the end edge. */
html[lang="ar"] .pg__chap { font: 600 12px/var(--pg-head-lh) var(--v4-sans); color: var(--v4-title); white-space: nowrap; }
html[lang="ar"] .pg__book { font: 400 12px/var(--pg-head-lh) var(--v4-sans); color: var(--v4-muted); white-space: nowrap; }

/* THE PAGE BODY IS v4's FLEX COLUMN (C3). v4's page is `display:flex;
   flex-direction:column`, so its blocks are flex items: their margins never
   collapse (a list's 2.7mm and its last item's 1.25mm both count), and a
   heading's top margin adds to the space the block above keeps. A block flow
   collapses both, and printed every list, figure and sub-heading tighter than
   v4. The blocks keep their natural height (no shrinking to fit). */
html[lang="ar"] .pg__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
html[lang="ar"] .pg__body > * { flex: 0 0 auto; }
/* The first block on a page must not add its own top margin — that is what puts
   a ragged gap under the running head. */
html[lang="ar"] .pg__body > *:first-child { margin-top: 0; }
/* A heading that OPENS its page carries no rule above it (v4: «أهمية إمكانية
   الوصول الرقمي» p5, «لغة الإشارة: أربع قواعد ثابتة» p16, and every chapter
   title that is not under a part banner) — the running head's rule is right
   above it. One that does not open its page is ruled, the chapter title
   included (under a part banner, v4 p9/p25). A heading's own `rule` (lib/blocks
   heading opts, html.js h--rule-keep / h--rule-none) is v4's exception where
   it makes one: p13 keeps the rule on a page-opening heading, p10 prints a
   section heading with none. */
html[lang="ar"] .pg__body > h1:not([class]):not(:first-child) {
  border-top: 2px solid var(--v4-ink);
  padding-top: 3.4mm;
}
html[lang="ar"] .pg__body > h2:first-child:not(.h--rule-keep) { border-top: 0; padding-top: 0; }
html[lang="ar"] .content h2.h--rule-none { border-top: 0; padding-top: 0; }

/* The foot band: this page's footnotes on the start edge, the folio on the end
   edge — in RTL the notes right and the folio LEFT, as v4 has it. Pinned to the
   sheet --pg-foot-bottom from its bottom edge, as v4 pins its band, and growing
   UPWARD as notes are added; the paginator keeps the body clear of it
   (paginate.js limitOf). It is out of the flow, so the body's box ends at the
   page's bottom padding, --pg-pad-bottom, derived to end v4's clearance above a
   folio-only band's rule. A page whose notes make the band taller is held above
   it by the paginator, not by the padding. */
html[lang="ar"] .pg__foot {
  position: absolute;
  bottom: var(--pg-foot-bottom);
  right: var(--pg-pad-right);
  left: var(--pg-pad-left);
  border-top: var(--pg-foot-rule) solid var(--v4-ink);
  padding-top: var(--pg-foot-pad);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8mm;
}
/* A page v4 prints with no folio (the publication page, p2) prints no foot
   band at all while it has no notes: no rule, nothing. */
html[lang="ar"] .pg--nofolio .pg__foot:not(:has(.pg__notes > li)) { display: none; }
/* THE NOTES BAND (C3, handover §4c) — v4's foot row: the notes a grid 0.8mm
   apart; each note a flex row — its number (Archivo 600 10px, gold, 1px down),
   a 2mm gap, then its text as ONE column (html.js endnote__text) at 400
   10px/1.5 — its addresses plain ink, not gold links. Every selector carries
   `.content .pg__notes`, so it outranks the ordinary list rules on any
   engine's reading of the cascade (the port's `.content ol > li` beat
   `.pg__notes li` and printed the notes at 13.5px, under the folio). */
html[lang="ar"] .content .pg__notes {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.8mm;
  counter-reset: none;
  font: 400 10px/1.5 var(--v4-sans);
}
html[lang="ar"] .content .pg__notes > li {
  display: flex;
  gap: 2mm;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  font: 400 10px/1.5 var(--v4-sans);
  color: var(--v4-ink);
}
/* The note's number is a real span (paginate.js setNotes, P1 — generated
   content is drawn outside every tag of Chromium's PDF), laid out as the
   ::before it replaces was: a flex item, v4's Archivo 600 10px gold, 1px down. */
html[lang="ar"] .content .pg__notes > li::before { content: none; }
html[lang="ar"] .content .pg__notes > li > .pg__noteno {
  flex: 0 0 auto;
  padding-top: 1px;
  font: 600 10px Archivo, sans-serif;
  color: var(--v4-title);
}
html[lang="ar"] .content .pg__notes .endnote__text { text-wrap: pretty; min-width: 0; }
html[lang="ar"] .content .pg__notes a { color: inherit; text-decoration: none; }
html[lang="ar"] .content .pg__notes li .endnote-back { display: none; }  /* meaningless on paper */
html[lang="ar"] .pg__folio {
  font: 600 var(--pg-folio-size)/1 var(--v4-latin);
  color: var(--v4-title);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  padding-top: var(--pg-folio-pad);
}

@media print {
  /* The page box IS the sheet, so the printer margin must be zero and the site
     chrome must go. */
  @page { size: A4; margin: 0; }
  html[lang="ar"] body { padding: 0; }
  html[lang="ar"] .site-header,
  html[lang="ar"] .site-nav,
  html[lang="ar"] .site-footer,
  html[lang="ar"] .pager,
  html[lang="ar"] .running-head { display: none; }
  html[lang="ar"] .site-body { display: block; padding: 0; }
  html[lang="ar"] .content { max-width: none; padding: 0; }
  html[lang="ar"] .pg { break-after: page; }
  html[lang="ar"] .pg:last-child { break-after: auto; }
  /* The page box sits flush with the sheet's start edge, as v4's section.page
     does (C6) — not centred. Centred in the 1280px layout the book is printed
     from, every page began a fraction of a pixel off v4's (243.156px against
     v4's 486.3125px: .156px apart), and the PDF kept that fraction: every glyph
     printed 0.041mm left of V0.98's and a dozen box edges rounded to the
     neighbouring pixel (0.26mm). Flush, both are V0.98's to 0.00mm
     (CONVERSION-COMPARISON-v4.md). The screen preview stays centred. No other
     margin may reach the page box in print (test_render), and its start edge
     is held to v4's within 0.01px (check_style «page box start edge, to the
     pixel»): a fraction of a pixel is all it takes. */
  html[lang="ar"] .pg { margin: 0; }
}

/* A plain page — same sheet, no running head or folio. */
html[lang="ar"] .pg--plain {
  display: block;
  padding: 24mm 18mm 20mm 16mm;
}

/* ===========================================================================
   v4's FRONT MATTER (C1) — the cover (p1), the publication data (p2) and the
   contents (p3), in the values v4's own markup sets. Selectors carry `.content`
   plus a class of their own, so they outrank the generic `.content p` / `h1` /
   `ul > li` rules above in screen and print alike, without !important.
   ========================================================================= */

/* ---------- the cover (p1): a full-bleed sheet of five positioned bands ---- */
html[lang="ar"] .pg--cover { padding: 0; }
/* printCss centres a cover and pushes it 26vh down; v4's is laid out by
   position, from the sheet's own edges. */
html[lang="ar"] .print-cover--v4 { padding: 0; margin: 0; text-align: start; }
html[lang="ar"] .cover__project {
  position: absolute; top: 18mm; right: 20mm; left: 18mm;
  display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 2px solid var(--v4-ink);
  padding-bottom: 6px;
}
html[lang="ar"] .content .cover__project-name {
  font: 600 12px/1 var(--v4-sans); color: var(--v4-title); margin: 0;
}
html[lang="ar"] .cover__heading { position: absolute; top: 44mm; right: 20mm; left: 18mm; }
/* NEGATIVE TRACKING ON AN ARABIC TITLE: `word-spacing` = `letter-spacing`
   (C1 review F5). v4 tracks its display titles in (−0.02em / −0.01em), and the
   engine that set V0.98 applied that to the WORD SPACES of an Arabic run too.
   This Chromium does not: it leaves a cursive run's letters joined (correctly)
   AND its spaces at full width, so the cover title's spaces printed 10.62pt
   against V0.98's 9.72pt, with every glyph identical to 0.01pt. The word-spacing
   puts the tracking back on the spaces, which is the only place it lands in
   an Arabic line. The same pair is on the cover tagline and the p2/p3 titles. */
html[lang="ar"] .content .cover__title {
  font: 600 60px/1.12 var(--v4-sans); letter-spacing: -0.02em; word-spacing: -0.02em; margin: 0;
  color: var(--v4-ink); text-wrap: balance;
}
html[lang="ar"] .cover__band {
  position: absolute; top: 132mm; right: 0; left: 0;
  background: var(--v4-field);
  padding: 16mm 20mm;
}
/* White on navy: 13.87:1. */
html[lang="ar"] .content .cover__tagline {
  font: 600 36px/1.25 var(--v4-sans); letter-spacing: -0.01em; word-spacing: -0.01em; margin: 0; color: #fff;
}
html[lang="ar"] .cover__meta {
  position: absolute; top: 196mm; right: 20mm; left: 18mm;
  display: grid; grid-template-columns: 22mm 1fr; gap: 0 8mm; align-items: start;
}
html[lang="ar"] .content .cover__year {
  font: 600 15px/1.4 var(--v4-latin); color: var(--v4-title); margin: 0;
  border-top: 2px solid var(--v4-field); padding-top: 6px;
}
/* v4 sets the paragraph at 16px/1.8 and its text in a 15px span, so the lines
   keep the 16px paragraph's 28.8px pitch. */
html[lang="ar"] .content .cover__attribution {
  font: 400 16px/1.8 var(--v4-sans); margin: 0; text-wrap: pretty;
  border-top: 2px solid var(--v4-ink); padding-top: 6px;
}
html[lang="ar"] .cover__attribution > span { font-size: 15px; }
html[lang="ar"] .cover__logos {
  position: absolute; bottom: 0; right: 0; left: 0;
  padding: 4mm 20mm 6mm 20mm;
  border-top: 2px solid var(--v4-bg);   /* v4: a rule in the paper colour */
  background: var(--v4-bg);
  display: flex; justify-content: center;
}
html[lang="ar"] .cover__logos img { display: block; width: 427px; height: 105px; max-width: 100%; }

/* ---------- the publication data (p2) ------------------------------------ */
/* A printed page headed by something other than its section's title (the
   module's printHeading — v4 heads p2 with the BOOK's title) sets that heading
   at v4's 34px with no rule. html.js gives such a heading the class
   `print-heading`; nothing here is keyed on a module id (C1 review F6). */
html[lang="ar"] .content h1.print-heading {
  font: 600 34px/1.15 var(--v4-sans); letter-spacing: -0.02em; word-spacing: -0.02em;
  margin: 0 0 2mm; border: 0; padding: 0;
}
/* The front matter's DISPLAY titles (module printTitle, html.js
   `print-title--<name>`, C3): the introduction's 40px «مقدمة الدليل» (v4 p4,
   6mm under it) and the glossary's 36px «المصطلحات الأساسية», which opens
   mid-page under the introduction's last note (R10; 2mm under it). Tracked
   -.02em, on the word spaces too (C1 review F5); never ruled. */
html[lang="ar"] .content h1.print-title--front,
html[lang="ar"] .content h1.print-title--front-inline {
  font: 600 40px/1.1 var(--v4-sans); letter-spacing: -0.02em; word-spacing: -0.02em;
  margin: 0 0 6mm; border: 0; padding: 0;
}
html[lang="ar"] .content h1.print-title--front-inline { font-size: 36px; margin: 0 0 2mm; }
html[lang="ar"] .content p.subtitle {
  font: 500 18px/1.5 var(--v4-sans); color: var(--v4-title); margin: 0 0 6mm;
}
/* v4's imprint page (p2) opens its first paragraph under a 2px rule, in its own
   15px/1.6. Scoped to that PAGE by its named variant — the module declares
   `printPage: 'imprint'` and the paginator gives each of its pages the class
   `pg--imprint` — so a subtitle() used anywhere else leaves the paragraph after
   it alone (C1 review F9). */
html[lang="ar"] .pg--imprint p.subtitle + p {
  font: 400 15px/1.6 var(--v4-sans); margin: 0 0 5mm;
  border-top: 2px solid var(--v4-ink); padding-top: 4mm;
}
/* labelGrid(): a 52mm label column, a hairline above every row and under the
   last. */
html[lang="ar"] .content .kv { margin: 0 0 5mm; border-bottom: 1px solid var(--v4-rule); }
html[lang="ar"] .content .kv__row {
  display: grid; grid-template-columns: 52mm 1fr; gap: 0 6mm; align-items: baseline;
  border-top: 1px solid var(--v4-rule); padding: 1.8mm 0;
}
html[lang="ar"] .content .kv__row--list { align-items: start; }
html[lang="ar"] .content .kv__label { font: 600 13.5px/1.5 var(--v4-sans); color: var(--v4-title); margin: 0; }
html[lang="ar"] .content .kv__value { font: 400 15px/1.6 var(--v4-sans); margin: 0; text-wrap: pretty; }
/* The reviewers: a real list with NO marker — v4 prints these names bare, where
   an ordinary list (C3) would draw its round disc before each. The name is bold
   ink; the rest of the line (the role) is muted, as v4 prints it. */
html[lang="ar"] .content ul.kv__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0.6mm; font: 400 14px/1.5 var(--v4-sans);
}
html[lang="ar"] .content ul.kv__list > li {
  padding: 0; margin: 0; font: inherit; color: var(--v4-muted); text-wrap: pretty;
}
html[lang="ar"] .content ul.kv__list > li::before { content: none; }
html[lang="ar"] .content ul.kv__list > li strong { color: var(--v4-ink); font-weight: 600; }
/* infoGroup(): a titled group under a rule; the first one (heavy) beside v4's
   38mm QR code. */
html[lang="ar"] .content .info-group { border-top: 1px solid var(--v4-rule); padding-top: 3mm; margin: 0 0 4mm; }
html[lang="ar"] .content .info-group:last-child { margin-bottom: 0; }
html[lang="ar"] .content .info-group--heavy { border-top: 2px solid var(--v4-ink); }
html[lang="ar"] .content .info-group--image {
  display: grid; grid-template-columns: 1fr 38mm; gap: 6mm; align-items: start;
}
/* v4's title is a plain <p>, untracked: `word-spacing: normal` too (C6), or the
   -0.01em every Arabic <h2> carries in place of v4's heading tracking (above)
   put each word of these three titles up to 0.21mm off V0.98's. */
html[lang="ar"] .content .info-group__title {
  font: 600 16px/1.4 var(--v4-sans); letter-spacing: normal; word-spacing: normal; color: var(--v4-ink);
  margin: 0 0 1.5mm; border: 0; padding: 0;
}
html[lang="ar"] .content .info-group__line { font: 400 15px/1.6 var(--v4-sans); margin: 0; }
html[lang="ar"] .content .info-group--image .info-group__line { margin: 0 0 2mm; }
/* v4: `direction:ltr; unicode-bidi:isolate; text-align:end` — the dir="ltr"
   attribute is the first two, so `end` is the RIGHT edge here, as in v4.
   The font is v4's EXACT stack, `Archivo, sans-serif`, not --v4-latin (C1
   review F4): Archivo has no Arabic, so the line's Arabic placeholder
   «[رابط مكتوب]» falls through to the SYSTEM sans-serif — that is what V0.98
   prints (Segoe UI Semibold) — where --v4-latin would catch it in IBM Plex
   Sans Arabic first. */
html[lang="ar"] .content .info-group__link {
  font: 500 14px/1.5 Archivo, sans-serif; color: var(--v4-title); margin: 0; text-align: end;
}
/* The owner's edit E1 (CONTENT-CHANGES-v4.md): the line is a webLink() (html.js
   infoGroupLinksHtml). In the PRINT document it is the ADDRESS, a link in the
   PDF drawn exactly as v4's line (its gold, unmarked); on the WEBSITE — a
   digital copy — the LABEL, a link in the text's own face and direction, marked
   as every link of the site is. */
html[lang="ar"] .content .info-group__link:not(.info-group__link--label) a { color: inherit; text-decoration: none; }
html[lang="ar"] .content .info-group__link--label { font: 500 15px/1.6 var(--v4-sans); text-align: start; }
/* The owner's edit E3: a DIGITAL-ONLY link (lib/inline {{digital}}) in the print
   document — the e-mail address and the phone number of p2 — prints exactly as
   the text around it; the PDF keeps the link (html-util LINK_AS_TEXT). */
html[lang="ar"] .content a.link-as-text { color: inherit; text-decoration: none; }
html[lang="ar"] .content .info-group__image {
  display: block; width: 38mm; height: 38mm; max-width: none;
  border: 2px solid var(--v4-ink); background: #fff; padding: 1.5mm; box-sizing: border-box;
}
/* On a phone the 52mm label column leaves the values a sliver: stack each pair
   (label over value) and the QR code under its text. Screen only — the printed
   page is v4's two-column grid. */
@media screen and (max-width: 40rem) {
  html[lang="ar"] .content .kv__row,
  html[lang="ar"] .content .info-group--image { grid-template-columns: 1fr; gap: 1mm 0; }
}

/* ---------- the contents (p3) -------------------------------------------- */
html[lang="ar"] .content h1.toc-title {
  font: 600 40px/1.1 var(--v4-sans); letter-spacing: -0.02em; word-spacing: -0.02em;
  margin: 0 0 8mm; border: 0; padding: 0;
}
/* Rows are a real list with NO marker (not a checklist). */
html[lang="ar"] .content ul.toc-list { list-style: none; margin: 0; padding: 0; }
html[lang="ar"] .content ul.toc-list > li { padding: 0; margin: 0; font: inherit; }
html[lang="ar"] .content ul.toc-list > li::before { content: none; }
html[lang="ar"] .content .toc-row > a {
  display: grid; grid-template-columns: 1fr auto; gap: 0 5mm; align-items: baseline;
  border-top: 1px solid var(--v4-rule); padding: 6px 0;
  font: 400 15px/1.5 var(--v4-sans); color: var(--v4-ink); text-decoration: none;
}
/* A chapter row: a 9mm number column (no full stop), the title, the page. */
html[lang="ar"] .content .toc-row--chapter > a { grid-template-columns: 9mm 1fr auto; }
/* The first row (v4: «بيانات النشر») opens the list under a 2px ink rule. */
html[lang="ar"] .content .toc-row:first-child > a {
  border-top: 2px solid var(--v4-ink); padding: 9px 0 7px; font: 600 16px/1.5 var(--v4-sans);
}
/* A part row: gold, under a 2px navy rule, 6mm clear of the row above. */
html[lang="ar"] .content .toc-row--part > a {
  border-top: 2px solid var(--v4-field); padding: 9px 0 7px; margin-top: 6mm;
  font: 600 16px/1.5 var(--v4-sans); color: var(--v4-title);
}
/* The last row closes the list with a 2px ink rule. */
html[lang="ar"] .content .toc-row:last-child { border-bottom: 2px solid var(--v4-ink); }
html[lang="ar"] .content .toc-num { font: 500 13px var(--v4-latin); color: var(--v4-title); }
html[lang="ar"] .content .toc-page {
  font: 400 14px var(--v4-latin); font-variant-numeric: tabular-nums; color: var(--v4-muted);
}
html[lang="ar"] .content .toc-row:first-child .toc-page { font-weight: 600; }
html[lang="ar"] .content .toc-row--part .toc-page { font-weight: 600; color: inherit; }

/* ---------- part divider, in the PRINT document ---------------------------
   The site renders a part as `.part-divider`; the print document renders it as
   `.print-part` with `.print-kicker` + <h1>. v4's banner (C3, p9/p25): a navy
   band, 5mm × 6mm inside, 5.5mm under it; the kicker Archivo 600 12px/1.3
   tracked .12em, 2mm under it; the title 600 30px/1.17 tracked -.015em, 2.5mm
   under it; the description 400 15px/1.6. White on navy is 13.87:1. Part C
   prints ONE line (`printLine`, v4 p37): a 3mm × 6mm band, 4mm under it, the
   line 600 20px/1.2 tracked -.01em. Every selector carries `.content`, so the
   chapter-title rules (`.content h1`) cannot reach the banner's title. */
html[lang="ar"] .content .print-part {
  background: var(--v4-field);
  color: #fff;
  padding: 5mm 6mm;
  margin: 0 0 5.5mm;
  text-align: start;
  break-before: auto;
}
html[lang="ar"] .content .print-part .print-kicker {
  font: 600 12px/1.3 Archivo, sans-serif;
  letter-spacing: 0.12em;
  color: #fff;
  opacity: 1;
  margin: 0 0 2mm;
}
html[lang="ar"] .content .print-part h1 {
  font: 600 30px/1.17 var(--v4-sans);
  letter-spacing: -0.015em;
  word-spacing: -0.015em;
  color: #fff;
  margin: 0 0 2.5mm;
  border: 0;
  padding: 0;
}
html[lang="ar"] .content .print-part p.lead {
  font: 400 15px/1.6 var(--v4-sans);
  color: #fff;
  margin: 0;
  text-wrap: pretty;
}
/* Part C prints no description in v4, so its paragraph is empty — do not let it
   add a blank line under the banner. */
html[lang="ar"] .content .print-part p.lead:empty { display: none; }
html[lang="ar"] .content .print-part--line {
  padding: 3mm 6mm;
  margin: 0 0 4mm;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6mm;
}
html[lang="ar"] .content .print-part--line h1 {
  font: 600 20px/1.2 var(--v4-sans);
  letter-spacing: -0.01em;
  word-spacing: -0.01em;
  margin: 0;
}

/* ===========================================================================
   THE BOXES (C3) — v4's asides, walkthrough cards, closing reviews, card row,
   quick-reference table and e-appendix strip, each exactly as v4 draws it.

   Every value below is v4's own, read from its markup (main-version-v4.dc.html)
   and checked against what Chromium computes for v4's page
   (scratchpad/tools/styleparity.js). The SHAPES and COLOURS apply on screen and
   on paper; the SIZES are v4's print values, in the px/mm it authored them in,
   and apply in print only (the paginator measures in print media).

   One model difference is handled here on purpose. v4's page is a flex column,
   so its blocks' margins never collapse: a closer 4mm under a list whose own
   margin is 2.7mm starts 6.7mm below it. A block flow would collapse the two to
   4mm. So where v4 gives a box a TOP margin (the closer, the card row), that
   space is drawn INSIDE the box (padding), and the box's own top margin is
   zero: the block above keeps its margin, and the gap is v4's sum in either
   model. (Since C3's type the page body IS v4's flex column — `.pg__body` —
   so the two models agree on paper; the site's page is still a block flow.)

   A box's own spacing, where v4 sets it apart (lib/blocks `fit`, emitted by
   html.js as custom properties on that box), overrides the common values:
     --callout-pad-block/-pad-inline/-after, --card-pad-block/-pad-inline/-after,
     --closer-before/-pad/-row-gap.
   ========================================================================= */

/* ---------- the aside (callout) ----------------------------------------------
   v4: panel ground, a 4px NAVY bar on the start edge whatever the variant
   («قاعدة عملية», «توصية» and the beyond-AA box included), square corners,
   the label 600 IBM Plex in gold (no tracking, no Archivo), the body ONE
   paragraph at 13.5px/1.55. styles.css adds a 1px frame, a 6px bar and a 4px
   radius; all three are cancelled here. */
html[lang="ar"] .content .callout {
  background: var(--v4-panel);
  color: var(--v4-ink);
  border: 0;
  border-inline-start: 4px solid var(--v4-field);
  border-radius: 0;
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.2rem;
}
html[lang="ar"] .content .callout p { margin: 0; text-wrap: pretty; }
html[lang="ar"] .content .callout p.callout__label {
  font: 600 0.9rem/1.4 var(--v4-sans);
  letter-spacing: normal;
  text-transform: none;
  color: var(--v4-title);
  opacity: 1;
  margin: 0 0 0.5rem;
}
/* Paragraphs of one box are ONE BLANK LINE apart — v4 types them as <br><br>
   inside its paragraph (p5's statistics, p23's beyond-AA box). A paragraph's
   own lines (lib/blocks: an array of lines) are joined by <br>, no gap. */
html[lang="ar"] .content .callout p + p { margin-top: 1.55em; }
html[lang="ar"] .content .callout > .callout__label + p { margin-top: 0; }
/* v4's inline labels «قبل:» / «بعد:», «ما يوصى به:» / «بدلاً من:» (lineLabels):
   gold, same weight as the line. Gold on the panel is 4.53:1. */
html[lang="ar"] .content .callout .callout__lead { color: var(--v4-title); }

/* The FIELD box (v4 p5): navy ground, white 500 text, no bar, no label; its
   note markers white. White on navy is 13.87:1. */
html[lang="ar"] .content .callout--field {
  background: var(--v4-field);
  color: #fff;
  border: 0;
  padding: 1.2rem 1.45rem;
  margin: 0 0 1.4rem;
}
html[lang="ar"] .content .callout--field p { color: #fff; font-weight: 500; }
html[lang="ar"] .content .callout--field .noteref { color: inherit; }

/* The E-APPENDIX STRIP (v4 p37): an ink band, the label then the text in a
   two-column grid on one baseline, the address in Archivo 500 as plain text.
   Paper on ink is 14.6:1. On the printed page it is pinned to the foot of the
   page body (below). */
html[lang="ar"] .content .callout--strip {
  background: var(--v4-ink);
  color: var(--v4-bg);
  border: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1mm 6mm;
  align-items: baseline;
  padding: 3mm 5mm;
}
html[lang="ar"] .content .callout--strip p,
html[lang="ar"] .content .callout--strip p.callout__label { color: var(--v4-bg); margin: 0; }
html[lang="ar"] .content .callout--strip a { color: inherit; text-decoration: none; }
html[lang="ar"] .content .callout--strip bdi { font-family: Archivo, sans-serif; font-weight: 500; }

/* ---------- the walkthrough card (practical) ---------------------------------
   v4: a 2px ink frame, no ground, square corners; the kicker «تطبيق عملي» on
   its own line (Archivo 12px, gold, tracked .09em); the title an ink h3; the
   tool line muted, no bold run; plain ink «1.» step markers; a 1px hairline
   above «تحقق من النتيجة»; the «انتبه» line in gold. */
html[lang="ar"] .content .practical {
  background: none;
  border: 2px solid var(--v4-ink);
  border-radius: 0;
  padding: 0.95rem 1.25rem;
  margin: 0 0 1.2rem;
}
html[lang="ar"] .content .practical .practical__kicker {
  font: 600 0.75rem/1.3 var(--v4-latin);
  letter-spacing: 0.09em;
  text-transform: none;
  color: var(--v4-title);
  margin: 0 0 1.5mm;
}
/* v4's design system tracks EVERY heading in by -0.015em; on an Arabic line
   that lands on the word spaces (C1 review F5), so word-spacing carries it. */
html[lang="ar"] .content .practical .practical__title {
  font: 600 1.125rem/1.3 var(--v4-sans);
  letter-spacing: -0.015em;
  word-spacing: -0.015em;
  color: var(--v4-ink);
  margin: 0 0 2.5mm;
  border: 0;
  padding: 0;
}
html[lang="ar"] .content .practical > p { margin: 0; }
html[lang="ar"] .content .practical > p.practical__program { color: var(--v4-muted); margin: 0 0 2.5mm; }
html[lang="ar"] .content .practical > ol { margin: 0; padding-inline-start: 6mm; }
/* A card's own steps and verification spacing, where v4 sets it tighter (lib/blocks
   practical `fit`: stepGap, verifyBefore, verifyPad — v4 p30/p31 and ch8's
   reading-order card), arrive as --card-step-gap / --card-verify-before /
   --card-verify-pad; the values here are the common ones. */
html[lang="ar"] .content .practical > ol > li { margin: 0 0 var(--card-step-gap, 1.25mm); text-wrap: pretty; }
/* The marker is the item's own glyph — Plex 400, ink — not a navy Archivo digit. */
html[lang="ar"] .content .practical > ol > li::marker { font: inherit; color: var(--v4-ink); }
html[lang="ar"] .content .practical > p.practical__verify {
  margin: var(--card-verify-before, 3mm) 0 0;
  border-top: 1px solid var(--v4-rule);
  padding-top: var(--card-verify-pad, 2.5mm);
}
html[lang="ar"] .content .practical > p.practical__caution { margin: 2mm 0 0; color: var(--v4-title); }
html[lang="ar"] .content .practical > p strong { color: inherit; font-weight: 600; }

/* STEP BADGES (practical `badges`, v4 p27): the number typed in a 7mm circle,
   no full stop; the filled range navy with a white numeral (13.87:1), the rest
   an ink ring. The card is set a little looser, as v4 sets it. */
html[lang="ar"] .content .practical--badges { padding: 1.1rem 1.4rem; }
html[lang="ar"] .content .practical--badges .practical__title { margin-bottom: 3mm; }
html[lang="ar"] .content .practical > ol.practical__badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2mm;
}
html[lang="ar"] .content .practical > ol.practical__badges > li {
  display: flex;
  gap: 3mm;
  align-items: flex-start;
  margin: 0;
}
html[lang="ar"] .content .step-badge {
  flex: 0 0 auto;
  width: 7mm;
  height: 7mm;
  border-radius: 50%;
  box-sizing: border-box;
  font: 600 13px/7mm var(--v4-latin);
  text-align: center;
  margin-top: 1px;
}
html[lang="ar"] .content .step-badge--filled { background: var(--v4-field); color: #fff; }
html[lang="ar"] .content .step-badge--outline { border: 2px solid var(--v4-ink); color: var(--v4-ink); line-height: 6mm; }
html[lang="ar"] .content .practical--badges > p.practical__verify { margin-top: 3.5mm; padding-top: 3mm; }

/* ---------- the closing review (closer) ---------------------------------------
   v4: a 2px NAVY rule, the heading an 18px/1.3 600 GOLD h3, then the list —
   11px square boxes with a 1.5px ink border, items 13.5px/1.5, in one column
   or two. The rule is drawn on the HEADING (so the continuation of a closer
   the paginator carries to the next page does not repeat it), and the space v4
   puts above it is the closer's own padding (see the note at the top). */
html[lang="ar"] .content .closer { margin: 0; padding-top: var(--closer-before, 4mm); }
html[lang="ar"] .content .closer--cols-2 { padding-top: var(--closer-before, 3mm); }
html[lang="ar"] .content .closer > .closer__title {
  font: 600 1.125rem/1.3 var(--v4-sans);
  letter-spacing: -0.015em;
  word-spacing: -0.015em;
  color: var(--v4-title);
  border: 0;
  border-top: 2px solid var(--v4-field);
  padding: var(--closer-pad, 2.5mm) 0 0;
  margin: 0 0 2.2mm;
}
html[lang="ar"] .content .closer > .checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--closer-row-gap, 1.3mm);
}
html[lang="ar"] .content .closer--cols-2 > .checklist {
  grid-template-columns: 1fr 1fr;
  gap: var(--closer-row-gap, 1.6mm) 6mm;
  align-items: start;
}
/* The box: v4 puts an empty 11×11 span 2.5mm before the text (flex). Here it
   is the item's ::before in the item's start padding — the same place, and an
   item whose text carries a link or a marker stays one run of text. */
html[lang="ar"] .content .closer > .checklist > li {
  position: relative;
  margin: 0;
  padding: 0;
  padding-inline-start: calc(11px + 2.5mm);
  text-wrap: pretty;
}
html[lang="ar"] .content .closer > .checklist > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 5px;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
  border: 1.5px solid var(--v4-ink);
  border-radius: 0;
  background: none;
}
@media screen and (max-width: 40rem) {
  html[lang="ar"] .content .closer--cols-2 > .checklist { grid-template-columns: 1fr; }
}

/* ---------- the card row (cards, v4 p36) ---------------------------------------
   Three columns, each card under a 2px ink rule; the title an INK 16px h3
   (balanced), the body 13.5px/1.55. v4's 1.5mm above the row is its padding. */
html[lang="ar"] .content .cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 5mm;
  margin: 0 0 3.2mm;
  padding-top: 1.5mm;
}
html[lang="ar"] .content .card { border-top: 2px solid var(--v4-ink); padding-top: 2.6mm; }
html[lang="ar"] .content .card > .card__title {
  font: 600 1rem/1.3 var(--v4-sans);
  letter-spacing: -0.015em;
  word-spacing: -0.015em;
  color: var(--v4-ink);
  text-wrap: balance;
  border: 0;
  padding: 0;
  margin: 0 0 1.8mm;
}
html[lang="ar"] .content .card > p { margin: 0; }
@media screen and (max-width: 40rem) {
  html[lang="ar"] .content .cards { grid-template-columns: 1fr; gap: 4mm 0; }
}

/* ---------- the quick reference (v4 p37) --------------------------------------
   The printed heading and its note share ONE row (html.js print-heading-row):
   the heading on the start side, the muted note at the far side, baseline to
   baseline. The table: an ink header band, bold row headers, the chapter
   numbers in gold Archivo 500, a 1px rule under every row and between the
   first three columns — no outer frame, no zebra — and in each «افعل هذا»
   cell a checklist of 9px boxes. */
html[lang="ar"] .content .print-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6mm;
  margin: 0 0 3mm;
}
html[lang="ar"] .content .print-heading-row > h1.print-heading {
  font: 600 26px/1.25 var(--v4-sans);
  letter-spacing: -0.01em;
  word-spacing: -0.01em;
  border: 0;
  padding: 0;
  margin: 0;
}
html[lang="ar"] .content p.heading-note {
  font: 400 0.9rem/1.5 var(--v4-sans);
  color: var(--v4-muted);
  margin: 0 0 1rem;
}
html[lang="ar"] .content .print-heading-row > p.heading-note {
  font: 400 13.5px/1.5 var(--v4-sans);
  white-space: nowrap;
  margin: 0;
}
html[lang="ar"] .content .table-wrap:has(> table.table--reference) {
  border: 0;
  border-radius: 0;
  overflow: visible;
  margin: 0 0 4mm;
}
html[lang="ar"] .content table.table--reference {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
html[lang="ar"] .content table.table--reference thead th {
  font: 600 14px/1.3 var(--v4-sans);
  text-align: start;
  padding: 2.5mm 3mm;
  background: var(--v4-ink);
  color: var(--v4-bg);
  border: 0;
}
html[lang="ar"] .content table.table--reference thead th:nth-child(2) { padding: 2.5mm 2mm; }
html[lang="ar"] .content table.table--reference tbody tr {
  background: none;
  border-bottom: 1px solid var(--v4-rule);
}
html[lang="ar"] .content table.table--reference tbody th {
  font: 600 14px/1.45 var(--v4-sans);
  text-align: start;
  vertical-align: top;
  text-wrap: pretty;
  padding: 2mm 3mm;
  border: 0;
  border-inline-end: 1px solid var(--v4-rule);
}
html[lang="ar"] .content table.table--reference tbody td {
  border: 0;
  padding: 2mm 3mm;
  vertical-align: top;
}
html[lang="ar"] .content table.table--reference tbody td:nth-child(2) {
  font: 500 14px/1.5 Archivo, 'Dalil Sans Arabic', 'IBM Plex Sans Arabic', sans-serif;
  color: var(--v4-title);
  font-variant-numeric: tabular-nums;
  padding: 2mm 2mm;
  border-inline-end: 1px solid var(--v4-rule);
}
/* On a phone the proportional columns leave the chapter column a few pixels
   wide («1 · 2» stacked, its header run into the next): let the table size its
   columns from their content there, the chapter numbers on one line. Print
   keeps v4's fixed widths. */
@media screen and (max-width: 40rem) {
  html[lang="ar"] .content table.table--reference { table-layout: auto; }
  html[lang="ar"] .content table.table--reference thead th:nth-child(2),
  html[lang="ar"] .content table.table--reference tbody td:nth-child(2) { white-space: nowrap; }
  html[lang="ar"] .content .callout--strip { grid-template-columns: 1fr; }
}
html[lang="ar"] .content ul.cell-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8mm;
  font: 400 13.5px/1.45 var(--v4-sans);
}
html[lang="ar"] .content ul.cell-checklist > li {
  position: relative;
  margin: 0;
  padding: 0;
  padding-inline-start: calc(9px + 2.5mm);
  font: inherit;
  text-wrap: pretty;
}
html[lang="ar"] .content ul.cell-checklist > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 6px;
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  border: 1.5px solid var(--v4-ink);
  border-radius: 0;
  background: none;
}

/* ---------- the print values ---------------------------------------------------- */
@media print {
  html[lang="ar"] .content .callout {
    padding: var(--callout-pad-block, 3.4mm) var(--callout-pad-inline, 4.5mm);
    margin: 0 0 var(--callout-after, 3.2mm);
  }
  html[lang="ar"] .content .callout p { font: 400 13.5px/1.55 var(--v4-sans); }
  html[lang="ar"] .content .callout p.callout__label { font: 600 13.5px/1.4 var(--v4-sans); margin: 0 0 2mm; }
  html[lang="ar"] .content .callout--field { padding: 5mm 6mm; margin: 0 0 4mm; }
  html[lang="ar"] .content .callout--field p { font: 500 16px/1.55 var(--v4-sans); }
  html[lang="ar"] .content .callout--strip { padding: 3mm 5mm; margin: 0; }
  html[lang="ar"] .content .callout--strip p.callout__label { font: 600 14px/1.4 var(--v4-sans); margin: 0; }
  html[lang="ar"] .content .callout--strip p { font: 400 13.5px/1.5 var(--v4-sans); }

  html[lang="ar"] .content .practical {
    padding: var(--card-pad-block, 3.4mm) var(--card-pad-inline, 4.5mm);
    margin: 0 0 var(--card-after, 3.2mm);
  }
  html[lang="ar"] .content .practical--badges {
    padding: var(--card-pad-block, 4mm) var(--card-pad-inline, 5mm);
  }
  /* v4's EXACT stack, `Archivo, sans-serif` (C6), as on the part kicker and
     p2's link line: Archivo has no Arabic, so «تطبيق عملي» falls through to the
     SYSTEM sans-serif — V0.98 prints it in Segoe UI Semibold — where
     --v4-latin would catch it in IBM Plex Sans Arabic first (narrower glyphs,
     a deeper box: the 0.52mm the C5 review measured on 14 cards). */
  html[lang="ar"] .content .practical .practical__kicker { font: 600 12px/1.3 Archivo, sans-serif; }
  html[lang="ar"] .content .practical .practical__title { font: 600 18px/1.3 var(--v4-sans); }
  html[lang="ar"] .content .practical > p { font: 400 13.5px/1.55 var(--v4-sans); }
  html[lang="ar"] .content .practical > p.practical__program { font: 400 13.5px/1.5 var(--v4-sans); }
  html[lang="ar"] .content .practical > ol,
  html[lang="ar"] .content .practical > ol > li { font: 400 13.5px/1.55 var(--v4-sans); }

  html[lang="ar"] .content .closer > .closer__title { font: 600 18px/1.3 var(--v4-sans); }
  html[lang="ar"] .content .closer > .checklist,
  html[lang="ar"] .content .closer > .checklist > li { font: 400 13.5px/1.5 var(--v4-sans); }

  html[lang="ar"] .content .card > .card__title { font: 600 16px/1.3 var(--v4-sans); }
  html[lang="ar"] .content .card > p { font: 400 13.5px/1.55 var(--v4-sans); }
}

/* ---------- on the paginated page ----------------------------------------------
   A box that opens a page does not carry the space v4 puts above it (v4 never
   opens a page with one; a reflowed page may). */
html[lang="ar"] .pg__body > .closer:first-child,
html[lang="ar"] .pg__body > .cards:first-child { padding-top: 0; }
/* The strip is pinned to the FOOT of the page body, as v4 pins it
   (margin-top:auto in a flex column — every page body is one since C3). The
   paginator ends each page body above that page's notes (paginate.js
   fitBody), so the band sits over the notes, not on them. */
html[lang="ar"] .content .pg__body > .callout--strip { margin-top: auto; }
/* ...and pinned where v4 pins it: v4's page 37 sets its content box to end
   28mm above the sheet's bottom edge (`padding: 14mm 18mm 28mm 16mm`), and the
   strip, `margin-top:auto`, ends there — 6.2mm clear of that page's notes
   rule. The page that carries the strip takes that bottom padding (a class
   test on the block, never a module id), so the band ends at v4's height
   instead of sitting on the foot rule; the paginator's limit follows the body
   box (paginate.js limitOf), so nothing else on the page can run below it. */
html[lang="ar"] .pg:has(> .pg__body > .callout--strip) { --pg-pad-bottom: 28mm; }
