/* Who Owns My Domain: "the passport".
   The site is a passport lying open on its own ink blue cover cloth. The cloth leads; every block of
   reading is a printed page laid on it. Page one is the data page (the free check and its machine
   readable lines), page two the visa page (the three flags land as dated stamps). The document then
   continues, every page with its running head, folio and the document number at its foot: pages 3
   and 4 as one spread (who it is for, as tick boxes on ruled lines; the contents page with leaders
   to section numbers), page 5 the sample verdict and its renewal leaves, page 6 the fee page, and
   the back cover. Inner pages carry their title on the sheet and a running index on the cloth.
   Type: Bodoni Moda for headlines only, at 48 px and above, at a low optical size and weight 600 so
   its hairlines stay at least one pixel on a 1x screen; IBM Plex Sans for everything smaller; IBM Plex
   Mono for every numeral that is a value (domains, dates, calendar days, section and fee numbers,
   hashes) and the machine readable zone; Amiri (display) and IBM Plex Sans Arabic (text) for Arabic.
   Only weights that ship are used: Plex Mono 400 and 500, Plex Sans 400 to 600, Amiri 400 and 700.
   Inks: intaglio blue (clear stamps, links), violet postal ink (stamps that need a look, the second
   fee stamp, bullets, the fictional mark) and foil on the cover. All files are served from /fonts/
   (see site/FONTS.md).
   Logical properties only, so the Arabic pages mirror. No rounded corners. */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda/BodoniModa-opsz-wght-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans/IBMPlexSans-Regular-Latin1.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans/IBMPlexSans-Medium-Latin1.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono/IBMPlexMono-Regular-Latin1.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono/IBMPlexMono-Medium-Latin1.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/fonts/plex-sans-arabic/IBMPlexSansArabic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/fonts/plex-sans-arabic/IBMPlexSansArabic-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/fonts/plex-sans-arabic/IBMPlexSansArabic-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("/fonts/amiri/Amiri-Regular-subset.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("/fonts/amiri/Amiri-Bold-subset.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda/BodoniModa-Italic-opsz-wght-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212;
}

/* ---------- tokens ---------- */
:root {
  --cloth: #13203a;          /* cover cloth: the ground of every page */
  --cloth-deep: #0d1729;     /* back cover */
  --cover: #1a2a4b;          /* the front cover board, a shade lighter than the cloth around it */
  --on-cloth: #eef0ea;       /* text on cloth, 14:1 */
  --on-cloth-2: #b8c2d4;     /* secondary text on cloth, 8.9:1 */
  --gilt: #d3b77c;           /* foil: cover, index numbers, 8:1 on cloth */
  --foil: linear-gradient(118deg, #b08c48 0%, #e8d29b 34%, #c19d5a 52%, #f1e1b2 70%, #a9853f 100%);
  --sheet: #eff1ec;          /* a printed page */
  --sheet-2: #e2e7e3;        /* the pages under it */
  --sheet-3: #d3dad6;
  --clear: #fafbf8;          /* the machine readable zone, no underprint */
  --ink: #121d33;            /* text on paper, 15:1 */
  --ink-2: #46516a;          /* secondary text on paper, 7.2:1 */
  --rule: #bcc5cc;
  --blue: #23408c;           /* intaglio blue: links, clear stamps, seen evidence, 8.3:1 */
  --violet: #7a2588;         /* violet postal ink: raised stamps, high severity, confirm evidence, 7.5:1 */
  --stamp-blend: multiply;
  --btn: #121d33;
  --btn-on: #eff1ec;
  --btn-hover: #23408c;
  --focus-cloth: #f2b84b;
  --focus-paper: #a8530a;
  --fee-a: #1b3270;
  --fee-b: #5a1f6c;          /* violet fee stamp, cream text on it 10:1 */
  --shadow: 0 34px 60px -28px rgba(0, 0, 0, 0.7);
  --spine: rgba(18, 29, 51, 0.15);
  --to-end: 90deg;           /* gradients that run toward the end of the line (mirrored in Arabic) */
  --dir: 1;

  --f-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --f-text: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-ar: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Naskh Arabic", serif;
  --f-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --f-ar-display: "Amiri", "Noto Naskh Arabic", serif;

  --wrap: 1360px;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light dark;
}
[dir="rtl"] {
  --to-end: 270deg;
  --dir: -1;
}
/* A document does not invert: in dark mode only the cloth and the chrome darken; the pages stay
   paper, dimmed, with the same ink, so cloth and paper keep their distance. */
@media (prefers-color-scheme: dark) {
  :root {
    --cloth: #0a1323;
    --cloth-deep: #060c18;
    --cover: #14223f;
    --sheet: #d6d9d2;        /* ink #121d33 on it 11:1, ink-2 5.5:1, violet 6:1, blue 6.6:1 */
    --sheet-2: #c8cdc7;
    --sheet-3: #b9c0bb;
    --clear: #e2e5df;
    --rule: #9ea8b0;
    --spine: rgba(18, 29, 51, 0.2);
    --shadow: 0 34px 60px -28px rgba(0, 0, 0, 0.9);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  /* book cloth: a plain weave drawn as a tile (src/img/cloth.svg), 2 to 4 percent of light */
  background: var(--cloth) url("/img/cloth.svg") 0 0 / 48px 48px;
  color: var(--on-cloth);
  font-family: var(--f-text);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
/* Arabic text is set about two pixels larger than Latin, with more leading */
:lang(ar) body, body:lang(ar) { font-family: var(--f-ar); font-size: 18px; line-height: 1.8; }
b, strong, th { font-weight: 600; }   /* Plex Sans ships 400, 500 and 600: no drawn bold */
/* Plex Mono ships 400 and 500 only: a domain, code or date inside bold text is set at 500 */
:is(b, strong, th, h1, h2, h3, h4, button, label, legend, .stamp, .go, .sev-high, .sev-medium, .sp-mark, .cover-doc, .leaf-my) :is(code, kbd, bdi, .dom-split, .s-date) { font-weight: 500; }
[lang="ar"] .alt[lang="en"], .alt[lang="en"] { font-family: var(--f-text); }
.alt[lang="ar"] { font-family: var(--f-ar); letter-spacing: 0; text-transform: none; }
img, svg { max-width: 100%; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus-cloth); outline-offset: 3px; }
.sheet :focus-visible, .page :focus-visible, .bpage :focus-visible, .specimen :focus-visible { outline-color: var(--focus-paper); }
code, pre, kbd { font-family: var(--f-mono); font-size: 0.92em; }
/* Domains: a host name from the build stays on one line; a typed domain (site.js) is set in mono,
   breaks after a dot, never at a hyphen, and inside a label only when the label is wider than the line. */
bdi.dom, .nb { white-space: nowrap; }
bdi.dom { font-family: var(--f-mono); font-size: 0.92em; }
.dom-split { font-family: var(--f-mono); font-weight: 500; font-size: 0.94em; display: inline-block; max-inline-size: 100%; }
.dom-split .lbl { overflow-wrap: anywhere; }
.vh, .badge {
  position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.defs { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }
.wrap { max-inline-size: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: absolute; inset-block-start: -100px; inset-inline-start: 16px; z-index: 10;
  background: var(--sheet); color: var(--ink); padding: 10px 16px; font-weight: 600;
}
.skip:focus { inset-block-start: 12px; }
::selection { background: var(--gilt); color: #121d33; }

/* display serif: only at 48 px and above, low optical size, weight 600 */
.display, .sheet-head h1 {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "opsz" 16;
  font-size: clamp(48px, 5.2vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}
:lang(ar) .display, :lang(ar) .sheet-head h1 {
  font-family: var(--f-ar-display);
  font-weight: 700;
  font-variation-settings: normal;
  line-height: 1.4;
  letter-spacing: 0;
}
.cap {
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 6px; line-height: 1.4;
}
:lang(ar) .cap { font-size: 15px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.cap .alt { margin-inline-start: 0.7em; font-weight: 500; }
.fine { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
:lang(ar) .fine { font-size: 15.5px; line-height: 1.8; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
:lang(ar) .small { font-size: 15.5px; }

/* buttons: square cut ink blocks; the arrow is drawn (src/img/arrow.svg) and turns with the line */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7em;
  min-block-size: 52px; padding: 0 24px; border: 0; border-radius: 0;
  background: var(--btn); color: var(--btn-on);
  font: 600 16px/1 var(--f-text); text-decoration: none; cursor: pointer;
  transition: background-color 0.15s;
}
:lang(ar) button, :lang(ar) .button { font-family: var(--f-ar); font-size: 17px; }
button::after, .button::after, .go::after {
  content: ""; flex: none; inline-size: 22px; block-size: 11px; background: currentColor;
  -webkit-mask: url("/img/arrow.svg") center / contain no-repeat;
  mask: url("/img/arrow.svg") center / contain no-repeat;
  transform: scaleX(var(--dir));
  transition: transform 0.18s;
}
button:hover, .button:hover { background: var(--btn-hover); }
button:hover::after, .button:hover::after, .go:hover::after { transform: translateX(calc(var(--dir) * 4px)) scaleX(var(--dir)); }
button[disabled] { opacity: 0.6; cursor: progress; }
.go { display: inline-flex; align-items: center; gap: 0.6em; font-weight: 600; text-decoration: none; }
.go:hover { text-decoration: underline; }

/* ---------- masthead ---------- */
.top { border-block-end: 3px double rgba(211, 183, 124, 0.55); }
.top-inner { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding-block: 14px; }
.brand {
  display: inline-flex; align-items: center; gap: 12px; margin-inline-end: auto;
  color: var(--on-cloth); text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: 0.01em;
}
.brand-mark { color: var(--gilt); flex: none; inline-size: 30px; block-size: 30px; }
.brand-local { font-family: var(--f-ar); font-weight: 500; color: var(--on-cloth-2); }
.nav { display: flex; gap: 4px 22px; flex-wrap: wrap; }
.nav a { color: var(--on-cloth-2); text-decoration: none; font-size: 15px; padding-block: 4px; border-block-end: 1px solid transparent; }
:lang(ar) .nav a { font-size: 16px; }
.nav a:hover { color: var(--on-cloth); border-block-end-color: var(--on-cloth-2); }
.nav a[aria-current="page"] { color: var(--on-cloth); border-block-end-color: var(--gilt); }
.langs a {
  display: inline-block; padding: 3px 12px; color: var(--on-cloth); text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(184, 194, 212, 0.6); font-size: 15px;
}
.langs a:hover { background: rgba(255, 255, 255, 0.08); }
.langs a[lang="ar"] { font-family: var(--f-ar); }

/* ---------- printed pages ---------- */
.sheet, .page, .bpage, .specimen {
  position: relative;
  background-color: var(--sheet);
  color: var(--ink);
}
/* The pages under a sheet, seen at its foot and its outer edge. They are a little smaller and start
   lower, so nothing shows above the top edge. */
.sheet, .specimen {
  box-shadow:
    calc(var(--dir) * 10px) 10px 0 -6px var(--sheet-2),
    calc(var(--dir) * 18px) 18px 0 -10px var(--sheet-3),
    var(--shadow);
}
.sheet a, .page a, .bpage a, .specimen a { color: var(--blue); }
.sheet a.button, .page a.button, .specimen a.button { color: var(--btn-on); }

/* running head with its guilloche band, and the folio */
.page-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-block-end: 12px; margin-block-end: 26px; position: relative;
}
.page-head::after {
  /* guilloche band under the running head: line work only, nothing printed on it */
  content: ""; position: absolute; inset-inline: 0; inset-block-end: -7px; block-size: 14px;
  background: var(--blue); opacity: 0.55;
  -webkit-mask: url("/img/guilloche.svg") 0 50% / 120px 14px repeat-x;
  mask: url("/img/guilloche.svg") 0 50% / 120px 14px repeat-x;
}
.page-head h2, .run {
  margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink);
}
.run { color: var(--ink-2); font-weight: 500; }
:lang(ar) .page-head h2, :lang(ar) .run { letter-spacing: 0; font-size: 16px; text-transform: none; }
.folio { font-family: var(--f-mono); font-size: 14px; color: var(--ink-2); margin-inline-start: auto; }
/* the document number at the foot of every page, as a passport carries it through every leaf */
.page-foot {
  margin: 36px 0 0; padding-block-start: 10px; border-block-start: 1px solid var(--rule);
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.16em; color: var(--ink-2); text-align: center;
}

/* ---------- the open passport (home) ---------- */
.booklet {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "cover data" "cover visa";
  grid-template-rows: auto 1fr;
  margin-block: clamp(28px, 4vw, 56px) clamp(56px, 7vw, 104px);
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45));
}
/* at full width the cover takes a little more of the spread, so the title sets in fewer lines and
   the cover and the blank pages beside it come out close in height */
@media (min-width: 1360px) {
  .booklet { grid-template-columns: minmax(0, 5.6fr) minmax(0, 6.4fr); }
}
.cover {
  grid-area: cover; display: flex; flex-direction: column;
  background: linear-gradient(calc(var(--to-end) + 180deg), rgba(0, 0, 0, 0.34), transparent 38px), var(--cover) url("/img/cloth.svg") 0 0 / 48px 48px;
  color: var(--on-cloth);
}
/* the cover: title at the head, the crest centred in the field below it, the lead at the foot
   under a foil rule; when the facing pages grow, the field grows and the crest stays centred in it */
.cover-a, .cover-b { padding-inline: clamp(24px, 3.6vw, 56px); }
.cover-a { padding-block: clamp(28px, 3.6vw, 52px) 0; }
.cover-b { padding-block: 0 clamp(28px, 3.6vw, 48px); }
.cover-b .cover-lead { padding-block-start: 18px; border-block-start: 1px solid rgba(211, 183, 124, 0.45); }
.cover-doc {
  color: var(--gilt); font-size: 13px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  margin: 0 0 clamp(26px, 3vw, 40px); padding-block-end: 14px; border-block-end: 1px solid rgba(211, 183, 124, 0.45);
}
:lang(ar) .cover-doc { letter-spacing: 0; font-size: 17px; text-transform: none; }
.cover h1 { color: var(--on-cloth); font-size: clamp(48px, 4.6vw, 70px); font-variation-settings: "opsz" 18; line-height: 1.03; }
:lang(ar) .cover h1 { line-height: 1.38; }
/* the key clause: what the owner holds, in foil */
.cover h1 .key {
  font-style: italic; font-weight: 600; font-variation-settings: "opsz" 18;
  color: var(--gilt);
  background: var(--foil); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding-inline-end: 0.06em;
}
:lang(ar) .cover h1 .key { font-style: normal; font-weight: 700; }
@media (forced-colors: active) {
  .cover h1 .key { background: none; -webkit-text-fill-color: currentColor; }
}
.cover-lead { font-size: 18px; line-height: 1.6; color: var(--on-cloth); max-inline-size: 30em; margin: 0; }
:lang(ar) .cover-lead { font-size: 19px; line-height: 1.85; }
/* the crest: a key inside a guilloche ring, blocked in foil and pressed into the board */
.crest-field {
  flex: 1 0 auto; display: grid; place-items: center; padding-block: clamp(24px, 2.4vw, 34px);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.12));
}
.crest {
  display: block; inline-size: clamp(120px, 10.4vw, 150px); aspect-ratio: 1;
  background: var(--foil);
  -webkit-mask: url("/img/crest.svg") center / contain no-repeat;
  mask: url("/img/crest.svg") center / contain no-repeat;
}
.crest-sm { display: none; }

.page { padding: clamp(22px, 3vw, 40px) clamp(20px, 3.4vw, 48px); }
.booklet .page { background-image: linear-gradient(var(--to-end), var(--spine), rgba(18, 29, 51, 0) 34px); }
.datapage { grid-area: data; display: flex; flex-direction: column; padding-block-end: 0; }
.visapage { grid-area: visa; display: flex; flex-direction: column; border-block-start: 1px dashed var(--rule); padding-block-start: clamp(18px, 2.4vw, 30px); }
/* the visa page fills the page beside the cover; before a check its short blank block sits in the
   middle of the page, and the stamps then take what they need from the top */
.checker-out { flex: 1 0 auto; display: flex; flex-direction: column; }
.visapage .page-head { margin-block-end: 26px; }
.checker-form { margin-block: 26px 0; }
.checker-form label { display: block; }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 14px; align-items: end; margin-block-start: 4px; }
.entry input {
  inline-size: 100%; min-inline-size: 0; border: 0; border-block-end: 2px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink); padding: 10px 2px 8px;
  font: 500 clamp(20px, 2vw, 26px)/1.2 var(--f-mono);
}
.entry input::placeholder, .order-form input::placeholder { color: var(--ink-2); opacity: 1; }
.entry input:focus-visible { outline-offset: 4px; }
.entry button { min-block-size: 56px; }
.field.when { margin-block: 22px 0; }
.field .value {
  margin: 0; min-block-size: 1.6em; font-family: var(--f-mono); font-size: 16px;
  border-block-end: 1px dotted var(--rule);
}
:lang(ar) .field .value { font-family: inherit; font-size: 17px; }
.datapage .fine { max-inline-size: 46em; margin-block: 22px 24px; }

/* machine readable zone: no underprint, OCR style lines fitted to the page width */
.mrz {
  container-type: inline-size;
  margin-inline: calc(-1 * clamp(20px, 3.4vw, 48px));
  margin-block-start: auto;
  padding: 16px clamp(20px, 3.4vw, 48px) 18px;
  background: var(--clear);
  border-block-start: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--f-mono); font-weight: 500;
  direction: ltr; text-align: start; unicode-bidi: isolate;
}
.mrz span { display: block; white-space: pre; line-height: 1.55; font-size: calc(100cqi / 26.8); }
.mrz .td1 { display: none; font-size: calc(100cqi / 18.4); }
@container (max-width: 470px) {
  .mrz .td3 { display: none; }
  .mrz .td1 { display: block; }
}

/* the visa page and its stamps */
.checker-out h3 { font-size: 20px; font-weight: 600; margin: 0 0 8px; line-height: 1.35; }
:lang(ar) .checker-out h3 { font-size: 21px; }
.checker-out h3 .dom-split { display: block; font-size: 1em; }
[dir="rtl"] .checker-out h3 .dom-split { text-align: end; }   /* flush with the Arabic title, on the right */
.flag-text bdi { font-family: var(--f-mono); font-weight: 500; }
.checker-out > p.muted, .checker-out > p.error, .checker-out > p.loading { margin: 0 0 12px; }
.checker-out .error { color: var(--violet); font-weight: 500; }
.stamps { list-style: none; margin: 18px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 26px; }
/* every stamp sits centred in the same box, so the three titles share one line */
.stamps .flag { display: grid; grid-template-rows: 140px auto; row-gap: 12px; align-content: start; }
.stamps .flag > .stamp { align-self: center; justify-self: start; }
.flag-text strong { display: block; font-size: 15.5px; line-height: 1.35; font-weight: 600; margin-block-end: 4px; }
.flag-text p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
:lang(ar) .flag-text strong { font-size: 17px; }
:lang(ar) .flag-text p { font-size: 16.5px; line-height: 1.75; }
.stop { font-size: 16px; padding-block-start: 18px; border-block-start: 1px solid var(--rule); max-inline-size: 48em; }
:lang(ar) .stop { font-size: 17.5px; }
.stop a { font-weight: 600; }

/* before a check: a blank visa page with three faint stamp places, each captioned with its flag */
.waiting { margin-block: auto; padding-block: 4px 18px; }
.waiting-cap { margin: 0 0 20px; font-size: 15px; line-height: 1.5; color: var(--ink-2); max-inline-size: 36em; }
:lang(ar) .waiting-cap { font-size: 16.5px; line-height: 1.75; }
.stamps.is-waiting { margin: 0; gap: 14px 26px; }
.stamps.is-waiting .flag { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
/* a stamp place: the ring of a round stamp, printed faint and dashed, nothing inside */
.blank {
  flex: none; inline-size: 96px; block-size: 96px; border-radius: 50%;
  border: 1.5px dashed rgba(70, 81, 106, 0.5); box-shadow: inset 0 0 0 6px var(--sheet), inset 0 0 0 7px var(--rule);
}
.is-waiting .flag-text strong {
  font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); line-height: 1.45;
}
:lang(ar) .is-waiting .flag-text strong { font-size: 15px; letter-spacing: 0; text-transform: none; }

.stamp {
  --tilt: -5deg;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  color: var(--blue); font-weight: 600; text-transform: uppercase; line-height: 1.15;
  transform: rotate(var(--tilt)); filter: url(#ink); mix-blend-mode: var(--stamp-blend);
}
.stamp-round {
  inline-size: 128px; block-size: 128px; border-radius: 50%;
  border: 3px solid currentColor;
  box-shadow: inset 0 0 0 4px var(--sheet), inset 0 0 0 5.5px currentColor;
}
.stamp-oblong {
  --tilt: 3deg; color: var(--violet);
  min-inline-size: 168px; max-inline-size: 100%; min-block-size: 88px; padding: 8px 14px;
  border: 5px double currentColor;
}
.stamps .flag:nth-child(3) .stamp-oblong { --tilt: -2.5deg; }
.stamps .flag:nth-child(2) .stamp-round { --tilt: 6deg; }
.s-top { font-size: 11px; letter-spacing: 0.14em; }
.s-main { font-size: 17px; letter-spacing: 0.06em; margin-block: 4px; }
.s-date { font-family: var(--f-mono); font-weight: 500; font-size: 11.5px; letter-spacing: 0.08em; }
:lang(ar) .stamp { text-transform: none; }
:lang(ar) .s-top, :lang(ar) .s-main { letter-spacing: 0; }
/* in Arabic the small line of the stamp is cut in Amiri, large enough to survive the ink */
:lang(ar) .s-top { font-family: var(--f-ar-display); font-weight: 700; font-size: 14px; line-height: 1.2; }
:lang(ar) .s-main { font-size: 18px; }
:lang(ar) .s-date { font-family: var(--f-ar); font-size: 12.5px; letter-spacing: 0; }
.stamps.is-landing .stamp { animation: land 0.34s cubic-bezier(0.2, 0.8, 0.3, 1.25) both; }
.stamps.is-landing .flag:nth-child(2) .stamp { animation-delay: 0.28s; }
.stamps.is-landing .flag:nth-child(3) .stamp { animation-delay: 0.56s; }
@keyframes land {
  from { opacity: 0; transform: rotate(var(--tilt)) scale(1.35); }
  60% { opacity: 1; }
  to { opacity: 1; transform: rotate(var(--tilt)) scale(1); }
}

/* ---------- pages 3 and 4: a two page spread ---------- */
.spread {
  /* the contents page folds out wider than the page beside it, so the two pages end together */
  display: grid; grid-template-columns: minmax(0, 4.6fr) minmax(0, 7.4fr);
  margin-block: 0 clamp(56px, 7vw, 104px);
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.42));
}
.bpage {
  display: flex; flex-direction: column;
  padding: clamp(22px, 3vw, 40px) clamp(24px, 3.8vw, 60px) clamp(18px, 2.2vw, 28px);
}
.bpage .page-foot { margin-block-start: auto; }
.bpage > .page-head + * { margin-block-start: 6px; }
/* the spine: each page darkens toward the gutter */
.spread .bpage:first-child { background-image: linear-gradient(calc(var(--to-end) + 180deg), var(--spine), rgba(18, 29, 51, 0) 46px); }
.spread .bpage:last-child { background-image: linear-gradient(var(--to-end), var(--spine), rgba(18, 29, 51, 0) 46px); }
.bpage h2 { color: var(--ink); font-size: clamp(48px, 4.4vw, 64px); }
:lang(ar) .spread { grid-template-columns: minmax(0, 4.3fr) minmax(0, 7.7fr); }

/* page 3: who it is for, as a field of the data page with three tick boxes on ruled lines */
.who-alt { margin: 12px 0 0; }
.who-alt .alt { margin: 0; font-size: 15px; }
.who-alt .alt[lang="ar"] { font-size: 17px; font-weight: 500; }
.ticks { list-style: none; margin: clamp(30px, 3.6vw, 52px) 0 40px; padding: 0; }
.ticks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 20px; margin-block-end: clamp(26px, 3vw, 44px); }
.ticks li::before { content: ""; inline-size: 22px; block-size: 22px; margin-block-start: 12px; box-shadow: inset 0 0 0 1.5px var(--ink); }
.ticks p {
  margin: 0; font-size: clamp(19px, 1.75vw, 24px); line-height: 46px; max-inline-size: 24em;
  /* the writing lines of a form, one under each line of text */
  background-image: repeating-linear-gradient(180deg, transparent 0 45px, var(--rule) 45px 46px);
}
:lang(ar) .ticks p { font-size: clamp(20px, 1.9vw, 25px); line-height: 52px; background-image: repeating-linear-gradient(180deg, transparent 0 51px, var(--rule) 51px 52px); }
:lang(ar) .ticks li::before { margin-block-start: 15px; }

/* page 4: the contents page of the passport, section names with leaders to their numbers */
.toc { list-style: none; margin: clamp(22px, 2.8vw, 34px) 0 40px; padding: 0; }
.toc li {
  display: grid; grid-template-columns: minmax(0, max-content) minmax(28px, 1fr) auto;
  grid-template-areas: "t l n" "d d .";
  column-gap: 12px; padding-block: 9px 13px;
}
.toc li::after { content: ""; grid-area: l; align-self: end; border-block-end: 2px dotted var(--rule); margin-block-end: 7px; }
.toc h3 { grid-area: t; align-self: end; margin: 0; font-size: 19px; line-height: 1.3; font-weight: 600; }
/* section numbers as printed by the same machine as the data page: mono, two digits */
.toc-n {
  grid-area: n; align-self: end; text-align: end;
  font-family: var(--f-mono); font-weight: 500; font-size: 20px; line-height: 1.2; letter-spacing: 0.04em; color: var(--blue);
}
.toc p { grid-area: d; margin: 5px 0 0; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); max-inline-size: 40em; }
:lang(ar) .toc h3 { font-size: 20px; line-height: 1.5; }
:lang(ar) .toc p { font-size: 17px; line-height: 1.75; }

/* ---------- page 5: the specimen ---------- */
.specimen-wrap { margin-block-end: clamp(56px, 7vw, 104px); }
.specimen { padding: clamp(22px, 3vw, 40px) clamp(24px, 4vw, 60px) clamp(18px, 2.2vw, 28px); }
.sp-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: start;
  padding-block-end: 18px; border-block-end: 3px double var(--ink); margin-block: 8px 28px;
}
.sp-head h3 { grid-column: 1; grid-row: 1; margin: 0; font-size: clamp(21px, 2vw, 26px); line-height: 1.3; font-weight: 600; }
.sp-head h3 bdi { font-family: var(--f-mono); font-weight: 500; }
.sp-when { grid-column: 1; margin: 0; font-family: var(--f-mono); font-size: 13.5px; color: var(--ink-2); }
:lang(ar) .sp-when { font-family: inherit; font-size: 15px; }
.sp-mark {
  grid-column: 2; grid-row: 1 / span 2; align-self: center; margin: 0;
  color: var(--violet); border: 3px double currentColor; padding: 6px 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; transform: rotate(-2deg);
}
:lang(ar) .sp-mark { letter-spacing: 0; font-size: 15px; }
.sp-body { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 3.4fr); gap: 32px clamp(28px, 4vw, 64px); }
.sp-cap { font-size: 12.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 10px; }
:lang(ar) .sp-cap { letter-spacing: 0; font-size: 15px; }
.sp-verdict { font-size: 19px; line-height: 1.5; max-inline-size: 36em; margin-block-end: 22px; }
:lang(ar) .sp-verdict { font-size: 20px; line-height: 1.75; }
.sp-verdict bdi, .party .pty bdi, .dir bdi { font-family: var(--f-mono); font-size: 0.9em; }
.sp-foot {
  display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 30px 0 0; padding-block-start: 16px;
  border-block-start: 1px solid var(--rule); font-size: 16px;
}
.sp-foot + .page-foot { margin-block-start: 28px; }

table { border-collapse: collapse; inline-size: 100%; }
.dir th, .dir td { text-align: start; vertical-align: top; padding-block: 13px; padding-inline: 0 14px; }
.dir thead th {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
  border-block-end: 2px solid var(--ink); padding-block: 0 8px;
}
:lang(ar) .dir thead th { letter-spacing: 0; font-size: 14px; }
.dir tbody tr { border-block-end: 1px solid var(--rule); }
.dir .rk { font-family: var(--f-mono); font-weight: 400; color: var(--ink-2); inline-size: 2.4em; font-size: 14px; padding-block-start: 15px; }
.dir tbody th { font-weight: 600; font-size: 16px; }
.party .ctl { display: block; font-size: 15.5px; }
.party .pty { display: block; font-size: 14.5px; color: var(--ink-2); }
:lang(ar) .dir tbody th, :lang(ar) .party .ctl { font-size: 17px; }
.evid { white-space: nowrap; }
.sp-legend { margin: 18px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); max-inline-size: 52em; }
.sp-intro { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
:lang(ar) .sp-legend, :lang(ar) .sp-intro { font-size: 15.5px; line-height: 1.75; }

/* evidence marks: filled, half, open; the word always beside the mark */
.ev { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
:lang(ar) .ev { font-size: 15px; }
.ev::before {
  content: ""; inline-size: 11px; block-size: 11px; border-radius: 50%; flex: none;
  border: 1.5px solid currentColor;
}
.ev-seen { color: var(--blue); }
.ev-seen::before { background: currentColor; }
.ev-inferred { color: var(--ink); }
.ev-inferred::before { background: linear-gradient(var(--to-end), currentColor 50%, transparent 50%); }
.ev-confirm { color: var(--violet); }

/* renewal calendar leaves */
.leaves { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px; }
.leaves .leaf {
  display: flex; flex-direction: column; align-items: center; inline-size: 148px; padding: 0 0 14px;
  background: var(--clear); box-shadow: 0 0 0 1px var(--rule), 3px 4px 0 -1px var(--sheet-3);
  text-align: center; filter: none;
}
.leaf-my {
  align-self: stretch; padding: 16px 8px 7px; background: var(--ink); color: var(--clear);
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  /* two binding holes */
  background-image: radial-gradient(circle at 30% 7px, var(--cloth) 0 3px, transparent 3.5px), radial-gradient(circle at 70% 7px, var(--cloth) 0 3px, transparent 3.5px);
}
:lang(ar) .leaf-my { letter-spacing: 0; font-size: 14px; }
.leaves .leaf.is-soon .leaf-my { background-color: var(--violet); }
/* the day as a dater prints it: mono, two digits */
.leaf-d {
  font-family: var(--f-mono); font-weight: 500; font-size: 54px; line-height: 1; letter-spacing: -0.02em;
  margin-block: 16px 10px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.leaf-what { font-size: 14px; font-weight: 500; line-height: 1.35; padding-inline: 10px; }
:lang(ar) .leaf-what { font-size: 15.5px; line-height: 1.6; }

/* ---------- page 6: the fee page ---------- */
.fees { margin-block-end: clamp(72px, 10vw, 140px); }
.fee-sheet { padding: clamp(22px, 3vw, 40px) clamp(24px, 4vw, 60px) clamp(18px, 2.2vw, 28px); }
.fee-sheet h2 { color: var(--ink); margin-block: 6px 8px; }
.prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(40px, 5vw, 80px); }
.price {
  display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 24px clamp(24px, 2.6vw, 40px); align-items: start;
  padding-block: 32px 8px; position: relative;
}
.price + .price::before {
  /* a perforated tear line between the two fees */
  content: ""; position: absolute; inset-block: 32px 0; inset-inline-start: calc(-1 * clamp(20px, 2.5vw, 40px) - 3px); inline-size: 6px;
  background: radial-gradient(circle, var(--rule) 0 2.2px, transparent 2.6px) 50% 0 / 6px 12px repeat-y;
}
.fee-stamp {
  --r: 6px;
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  block-size: 220px; padding: 24px 14px 22px;
  background-color: var(--fee-a); color: #f3f1ea;
  -webkit-mask:
    radial-gradient(circle var(--r), transparent calc(var(--r) - 0.5px), #000 var(--r)) calc(var(--r) * -1.5) calc(var(--r) * -1.5) / calc(var(--r) * 3) calc(var(--r) * 3) round,
    linear-gradient(#000 0 0) 50% 50% / calc(100% - var(--r) * 3) calc(100% - var(--r) * 3) no-repeat;
  mask:
    radial-gradient(circle var(--r), transparent calc(var(--r) - 0.5px), #000 var(--r)) calc(var(--r) * -1.5) calc(var(--r) * -1.5) / calc(var(--r) * 3) calc(var(--r) * 3) round,
    linear-gradient(#000 0 0) 50% 50% / calc(100% - var(--r) * 3) calc(100% - var(--r) * 3) no-repeat;
}
.price.featured .fee-stamp { background-color: var(--fee-b); }
.fee-stamp::before {
  /* the stamp's frame */
  content: ""; position: absolute; inset: 14px; border: 1px solid rgba(243, 241, 234, 0.55); pointer-events: none;
}
.fee-stamp::after {
  /* line work between the numeral and the currency, clear of both */
  content: ""; position: absolute; inset-inline: 20px; inset-block-end: 50px; block-size: 18px;
  background: rgba(243, 241, 234, 0.42);
  -webkit-mask: url("/img/guilloche.svg") 0 50% / 120px 14px repeat-x;
  mask: url("/img/guilloche.svg") 0 50% / 120px 14px repeat-x;
}
.fee-num {
  position: relative; z-index: 1;
  font-family: var(--f-mono); font-weight: 500; font-size: 84px; line-height: 1; letter-spacing: -0.04em;
}
.fee-cur { position: relative; z-index: 1; font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.3em; padding-inline-start: 0.3em; }
.fee-body h3 { font-size: clamp(22px, 2vw, 27px); line-height: 1.25; margin: 2px 0 6px; font-weight: 600; }
:lang(ar) .fee-body h3 { line-height: 1.5; }
.fee-body .amount { font-family: var(--f-mono); font-size: 17px; font-weight: 500; color: var(--blue); margin: 0 0 2px; }
:lang(ar) .fee-body .amount { font-family: inherit; font-weight: 600; font-size: 18px; }
.fee-body .once { font-size: 14px; color: var(--ink-2); margin-block-end: 16px; }
:lang(ar) .fee-body .once { font-size: 15.5px; }
.fee-body p { max-inline-size: 38em; }
.fee-items { list-style: none; margin: -4px 0 24px; padding: 0; max-inline-size: 38em; }
.fee-items li { position: relative; padding-inline-start: 22px; margin-block-end: 8px; line-height: 1.5; }
.fee-items li::before {
  content: ""; position: absolute; inset-inline-start: 2px; inset-block-start: 0.62em;
  inline-size: 7px; block-size: 7px; background: var(--violet);
}
.price .button { margin-block-start: 6px; }
.fee-sheet .page-foot { margin-block-start: 40px; }

/* ---------- back cover ---------- */
.foot {
  background: var(--cloth-deep); color: var(--on-cloth-2);
  border-block-start: 3px double rgba(211, 183, 124, 0.55);
  padding-block: 44px 56px; font-size: 15px;
}
:lang(ar) .foot { font-size: 16.5px; }
.foot-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 40px; align-items: end; }
.foot-mrz {
  /* 44 characters, sized so the whole line fits the column at any width */
  grid-column: 1 / -1; margin: 0 0 26px; font-family: var(--f-mono); font-weight: 500;
  font-size: min(19px, calc((min(100vw, var(--wrap)) - 2 * var(--gutter) - 4px) / 28.4));
  color: var(--on-cloth-2); white-space: pre;
  letter-spacing: 0.04em; direction: ltr; text-align: start;
}
.foot-disclaimer { grid-column: 1; margin: 0; color: var(--on-cloth); max-inline-size: 40em; }
.foot-contact { grid-column: 1; margin: 0; }
.foot a { color: var(--on-cloth); }
.legal-links { grid-column: 2; grid-row: 2 / span 2; display: flex; gap: 6px 22px; flex-wrap: wrap; }

/* ---------- inner pages: the title on the sheet, a running index beside it ---------- */
.inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: clamp(28px, 4vw, 56px) clamp(64px, 9vw, 128px); }
.inner-sheet { padding: clamp(24px, 3.4vw, 48px) clamp(22px, 5vw, 76px) clamp(30px, 5vw, 68px); min-inline-size: 0; }
.sheet-head { margin-block-end: clamp(28px, 4vw, 44px); padding-block-end: clamp(18px, 2.6vw, 28px); border-block-end: 3px double var(--ink); }
.sheet-head .page-head { margin-block-end: clamp(26px, 3.4vw, 40px); }
.sheet-head h1 { color: var(--ink); font-size: clamp(48px, 4.6vw, 68px); margin-block-end: 18px; }
.sheet-head .lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; max-inline-size: 38em; margin-block-end: 0.8em; }
:lang(ar) .sheet-head .lead { font-size: clamp(19px, 1.7vw, 22px); line-height: 1.8; }
.sheet-head .lead:last-child, .sheet-head .notice:last-child { margin-block-end: 0; }
.sheet-head .small { margin-block-end: 10px; }
.inner-sheet h2 { font-size: clamp(21px, 2vw, 25px); line-height: 1.3; font-weight: 600; margin: 2.1em 0 0.6em; }
:lang(ar) .inner-sheet h2 { font-size: clamp(22px, 2.1vw, 26px); line-height: 1.5; }
.inner-sheet section:first-of-type > h2 { margin-block-start: 0; }
.inner-sheet p, .inner-sheet li { max-inline-size: 40em; }
/* the order form: one application sheet, centred on the cloth */
.inner.inner-single { grid-template-columns: minmax(0, 1fr); }
.inner-single > .sheet { inline-size: 100%; max-inline-size: 920px; justify-self: center; }

/* the running index on the cloth */
.index-list { list-style: none; margin: 0; padding: 0; border-block-start: 3px double rgba(211, 183, 124, 0.55); counter-reset: ix; }
.index-list li { border-block-end: 1px solid rgba(184, 194, 212, 0.2); counter-increment: ix; }
.index-list a { display: flex; gap: 12px; padding-block: 9px; color: var(--on-cloth-2); text-decoration: none; font-size: 15px; line-height: 1.4; }
:lang(ar) .index-list a { font-size: 16.5px; line-height: 1.6; }
.index-list a:hover { color: var(--on-cloth); text-decoration: underline; }
.index.numbered .index-list a::before { content: counter(ix, decimal-leading-zero); flex: none; font-family: var(--f-mono); font-size: 13px; color: var(--gilt); padding-block-start: 1px; }
.side .files + .index { margin-block-start: 26px; }

@media (min-width: 1081px) {
  .inner { grid-template-columns: minmax(200px, 3fr) minmax(0, 9fr); column-gap: clamp(32px, 3.6vw, 56px); align-items: start; }
  .side { position: sticky; inset-block-start: 28px; padding-block-start: 8px; }
}

/* legal pages: numbered conditions */
.legal-body { counter-reset: cond; }
.legal-body h2 { counter-increment: cond; display: flex; gap: 14px; align-items: baseline; padding-block-start: 18px; border-block-start: 1px solid var(--rule); }
.legal-body h2::before {
  content: counter(cond, decimal-leading-zero); font-family: var(--f-mono); font-size: 14px; font-weight: 500; color: var(--ink-2);
  min-inline-size: 2.2em;
}
.legal-body .clause:first-of-type > h2 { border-block-start: 0; padding-block-start: 0; margin-block-start: 0; }
.clause { scroll-margin-block-start: 24px; }
/* a notice is a printed slip: a short guilloche strip at its head and a hairline frame */
.notice {
  position: relative; padding: 28px 18px 14px; background: var(--sheet-2); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.notice::before {
  content: ""; position: absolute; inset-block-start: 9px; inset-inline-start: 18px; inline-size: 103px; block-size: 12px;
  background: var(--blue); opacity: 0.7;
  -webkit-mask: url("/img/guilloche.svg") 0 50% / 103px 12px no-repeat;
  mask: url("/img/guilloche.svg") 0 50% / 103px 12px no-repeat;
}
.plain-list { margin: 0 0 1em; padding-inline-start: 1.2em; }
.plain-list li { margin-block-end: 0.55em; }
.plain-list li::marker { color: var(--violet); }

/* method */
.method-body section + section { margin-block-start: 2.6em; }
.method-body h2 { margin-block-start: 0; }
.method-body .plain-list .small.muted { font-size: 13.5px; }
/* each endpoint stays whole; lines wrap between them */
.method-body code { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.levels { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.levels .ev { font-size: 15.5px; }
pre.code {
  margin: 0; padding: 16px 20px; background: var(--clear); border: 1px solid var(--rule); border-block-start: 3px solid var(--ink);
  overflow-x: auto; line-height: 1.7; font-size: 14px; white-space: pre-wrap;
}
/* a command too long for the line wraps between words, and its next line is indented, so it reads
   as the same command */
pre.code code { white-space: pre-wrap; color: var(--ink); }
pre.code .cmd { display: block; padding-inline-start: 2ch; text-indent: -2ch; overflow-wrap: anywhere; }

/* order: an application form, its fields numbered and captioned in both languages */
.order-form { counter-reset: fieldno; display: grid; gap: 26px; }
.order-form .field { counter-increment: fieldno; display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.order-form label, .order-form legend { font-size: 15px; font-weight: 600; padding: 0; display: flex; align-items: baseline; gap: 4px 10px; }
:lang(ar) .order-form label, :lang(ar) .order-form legend { font-size: 16.5px; }
.order-form .field:not(.plans) > label, .order-form .field > legend { display: grid; grid-template-columns: 26px minmax(0, 1fr); }
.order-form .field > label .alt, .order-form .field > legend .alt { grid-column: 2; justify-self: start; }
.order-form .field:not(.plans) > label::before, .order-form .field > legend::before {
  content: counter(fieldno); display: inline-grid; place-items: center; inline-size: 26px; block-size: 26px;
  font-family: var(--f-mono); font-size: 13px; font-weight: 500; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule);
}
.order-form .alt { font-weight: 400; color: var(--ink-2); font-size: 13.5px; }
:lang(ar) .order-form .alt { font-size: 14px; }
.order-form input[type="text"], .order-form input[type="email"] {
  inline-size: 100%; min-block-size: 52px; padding: 10px 14px; border: 1px solid var(--ink-2); border-radius: 0;
  background: var(--clear); color: var(--ink); font: 400 17px/1.3 var(--f-text);
}
/* typed Arabic (a business name) in the Arabic face, not a fallback */
:lang(ar) .order-form input:not([dir="ltr"]) { font-family: var(--f-ar); font-size: 18px; }
.order-form input[dir="ltr"] { font-family: var(--f-mono); font-size: 16.5px; }
.plans { display: grid; gap: 10px; }
.plans legend { margin-block-end: 8px; }
.plans > label {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 14px; padding: 14px 16px; font-weight: 400;
  box-shadow: inset 0 0 0 1px var(--rule); background: var(--clear); cursor: pointer;
}
.plans > label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink); }
/* Drawn by hand so an unchecked plan is an empty ring in both themes: the
   native control with an accent colour filled it in dark mode. */
.plans input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  inline-size: 18px; block-size: 18px; margin: 0; flex: none;
  border: 1.5px solid var(--ink); border-radius: 50%; background: transparent;
}
.plans input[type="radio"]:checked { background: radial-gradient(circle, var(--ink) 0 4.5px, transparent 5.5px); }
.plans input[type="radio"]:focus-visible { outline: 3px solid var(--focus-paper); outline-offset: 3px; }
@media (forced-colors: active) { .plans input[type="radio"] { appearance: auto; -webkit-appearance: auto; } }
.plans strong { font-weight: 600; }
.plans .muted { font-family: var(--f-mono); font-size: 14.5px; margin-inline-start: 0.6em; white-space: nowrap; }
:lang(ar) .plans .muted { font-family: inherit; font-size: 16px; }
.submit-row { padding-block-start: 6px; }

/* sample page: the full passport */
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 12px; }
.files a {
  display: inline-flex; align-items: center; min-block-size: 44px; padding: 8px 16px;
  box-shadow: inset 0 0 0 1px var(--on-cloth-2); text-decoration: none; color: var(--on-cloth); font-size: 15px;
}
:lang(ar) .files a { font-size: 16px; }
.files a:hover { background: rgba(255, 255, 255, 0.08); }
@media (min-width: 1081px) { .side .files { flex-direction: column; } .side .files a { inline-size: 100%; } }
.sheet-head .notice { max-inline-size: 46em; }
.passport .banner { color: var(--violet); font-weight: 500; border: 3px double currentColor; padding: 10px 14px; max-inline-size: none; }
.passport h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.25; margin: 22px 0 6px; font-weight: 600; }
.passport h2 bdi { font-family: var(--f-mono); font-weight: 500; font-size: 0.86em; }
.passport h3 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
  margin: 2.6em 0 0.9em; padding-block-start: 14px; border-block-start: 3px double var(--ink);
}
:lang(ar) .passport h3 { letter-spacing: 0; font-size: 16px; }
.pp-sec { scroll-margin-block-start: 24px; }
.passport h4 { font-size: 16px; margin: 1.4em 0 0.6em; font-weight: 600; }
.passport .lead { font-size: 19px; line-height: 1.5; }
:lang(ar) .passport .lead { font-size: 20px; line-height: 1.75; }
.passport .items { list-style: none; margin: 0; padding: 0; }
.passport ol.items { counter-reset: it; }
.passport .items > li { padding-block: 14px; border-block-end: 1px solid var(--rule); }
.passport ol.items > li { counter-increment: it; display: grid; grid-template-columns: 2.4em minmax(0, 1fr); column-gap: 8px; }
.passport ol.items > li::before { content: counter(it); grid-row: 1 / span 9; font-family: var(--f-mono); color: var(--ink-2); font-size: 14px; padding-block-start: 2px; }
.passport ol.items > li > * { grid-column: 2; }
.passport .items p { margin: 6px 0 0; }
.passport .items ul { margin: 6px 0 0; padding-inline-start: 1.2em; }
.passport .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-block-start: 6px; font-size: 14px; color: var(--ink-2); }
:lang(ar) .passport .meta { font-size: 15.5px; }
.passport .meta bdi { font-family: var(--f-mono); }
.sev-high { color: var(--violet); font-weight: 600; }
.sev-medium { color: var(--ink); font-weight: 600; }
.passport table th, .passport table td { text-align: start; padding-block: 10px; padding-inline: 0 14px; border-block-end: 1px solid var(--rule); vertical-align: top; font-size: 15px; }
:lang(ar) .passport table th, :lang(ar) .passport table td { font-size: 16px; }
.passport table tbody th { font-weight: 500; }
.passport table thead th { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); border-block-end: 2px solid var(--ink); font-weight: 600; }
:lang(ar) .passport table thead th { letter-spacing: 0; font-size: 14px; }
.passport td bdi, .passport tbody th bdi { font-family: var(--f-mono); font-size: 0.94em; }
/* the fingerprint as a serial number, in groups of four */
.hash { display: block; font-family: var(--f-mono); font-size: 15px; font-weight: 500; color: var(--violet); letter-spacing: 0.05em; line-height: 1.9; margin-block-end: 1em; direction: ltr; text-align: start; }
.hash span { margin-inline-end: 0.7em; }
.passport .stamps { margin-block: 22px; }

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .booklet { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .stamps { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .stamps .flag { grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: none; column-gap: 22px; align-items: center; }
  .stamps .flag > .stamp { justify-self: center; }
  .stamps.is-waiting { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
  .stamps.is-waiting .flag { display: flex; }
  .sp-body { grid-template-columns: minmax(0, 1fr); }
  .prices { grid-template-columns: minmax(0, 1fr); }
  .price + .price::before {
    inset-block: 0 auto; inset-inline: 0; inline-size: auto; block-size: 6px;
    background: radial-gradient(circle, var(--rule) 0 2.2px, transparent 2.6px) 0 50% / 12px 6px repeat-x;
  }
  .price { padding-block: 32px; }
  .side-index { display: none; }
  .side-sample .index { display: none; }
}
@media (max-width: 960px) {
  .spread, :lang(ar) .spread { grid-template-columns: minmax(0, 1fr); row-gap: 28px; filter: none; }
  .spread .bpage { box-shadow: calc(var(--dir) * 10px) 10px 0 -6px var(--sheet-2), var(--shadow); }
  .spread .bpage:first-child, .spread .bpage:last-child { background-image: none; }
}

/* ---------- phone: the booklet closes into a stack ---------- */
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  :lang(ar) body { font-size: 18px; }
  .top-inner { padding-block: 8px; gap: 4px 16px; }
  .brand { font-size: 15px; flex-basis: 100%; }
  /* Arabic header: the Arabic name only, and the language switch on the nav row */
  [lang="ar"] .brand > span[lang="en"] { display: none; }
  [lang="ar"] .brand-local { color: var(--on-cloth); font-weight: 600; font-size: 17px; }
  .nav { order: 3; flex: 1 1 auto; gap: 2px 16px; }
  .nav a { font-size: 14.5px; padding-block: 2px; }
  :lang(ar) .nav a { font-size: 15.5px; }
  .langs { order: 4; }
  .langs a { font-size: 14px; padding: 2px 10px; }
  .booklet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "a" "data" "visa" "b";
    grid-template-rows: none;
    margin-block-start: 8px;
    padding-inline: 0;
  }
  .cover { display: contents; }
  .cover-a, .cover-b { background: var(--cover) url("/img/cloth.svg") 0 0 / 48px 48px; }
  .cover-a { grid-area: a; padding: 12px 18px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
  .cover-b { grid-area: b; padding: 24px 18px 28px; }
  .cover-doc { grid-column: 1; grid-row: 1; margin: 0; padding: 0; border: 0; font-size: 12px; }
  :lang(ar) .cover-doc { font-size: 15px; }
  .crest-sm { display: block; grid-column: 2; grid-row: 1; inline-size: 44px; }
  .crest-field { display: none; }
  .cover-b .cover-lead { padding-block-start: 0; border: 0; }
  .cover h1 { grid-column: 1 / -1; margin-block-start: 10px; font-size: 48px; font-variation-settings: "opsz" 14; line-height: 0.98; letter-spacing: -0.01em; }
  :lang(ar) .cover h1 { font-size: 48px; line-height: 1.32; }
  .cover-lead { font-size: 17px; }
  .page { padding: 14px 18px 0; }
  .visapage { padding-block-end: 18px; }
  .page-head { margin-block-end: 8px; padding-block-end: 4px; }
  .datapage .page-head::after { display: none; }
  .datapage .page-head { border-block-end: 1px solid var(--rule); padding-block-end: 8px; }
  .checker-form { margin-block-start: 14px; }
  .entry input { font-size: 19px; }
  .entry button { padding-inline: 16px; min-block-size: 54px; }
  .mrz { margin-inline: -18px; padding-inline: 18px; }
  .checker-out h3 { font-size: 18px; }
  .checker-out h3 .dom-split { font-size: 17px; }
  .stamps .flag { grid-template-columns: 132px minmax(0, 1fr); column-gap: 14px; align-items: start; }
  .stamp-round { inline-size: 120px; block-size: 120px; }
  .stamp-oblong { min-inline-size: 0; inline-size: 130px; min-block-size: 78px; padding: 6px 4px; }
  .s-main { font-size: 13.5px; letter-spacing: 0.01em; white-space: nowrap; }
  :lang(ar) .s-main { font-size: 15px; }
  .s-top { letter-spacing: 0.08em; }
  .stamp-round .s-main { font-size: 14px; }
  .s-date { font-size: 11px; letter-spacing: 0.04em; }
  .waiting { padding-block: 0 14px; }
  .waiting-cap { margin-block-end: 16px; }
  .stamps.is-waiting { gap: 10px 12px; }
  .stamps.is-waiting .flag { gap: 10px; }
  .blank { inline-size: 64px; block-size: 64px; box-shadow: inset 0 0 0 4px var(--sheet), inset 0 0 0 5px var(--rule); }
  .is-waiting .flag-text strong { font-size: 11.5px; letter-spacing: 0.08em; }
  :lang(ar) .is-waiting .flag-text strong { font-size: 14.5px; letter-spacing: 0; }
  .spread { padding-inline: var(--gutter); }
  .bpage, .specimen, .fee-sheet { padding: 18px 18px 16px; }
  .bpage h2, .fee-sheet h2 { font-size: 48px; }
  .ticks p { font-size: 18px; line-height: 36px; background-image: repeating-linear-gradient(180deg, transparent 0 35px, var(--rule) 35px 36px); }
  .ticks li::before { margin-block-start: 8px; }
  :lang(ar) .ticks p { font-size: 19px; line-height: 42px; background-image: repeating-linear-gradient(180deg, transparent 0 41px, var(--rule) 41px 42px); }
  :lang(ar) .ticks li::before { margin-block-start: 11px; }
  .toc li { column-gap: 8px; }
  .toc h3 { font-size: 17.5px; }
  .toc-n { font-size: 17px; line-height: 1.3; }
  .toc li::after { margin-block-end: 6px; }
  .sp-head { grid-template-columns: minmax(0, 1fr); }
  .sp-mark { grid-column: 1; grid-row: auto; justify-self: start; }
  /* the directory keeps its table semantics (roles in the markup); rows stack */
  .dir thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .dir, .dir tbody { display: block; }
  .dir tr { display: grid; grid-template-columns: 2em minmax(0, 1fr); column-gap: 6px; padding-block: 12px; }
  .dir th, .dir td { padding: 0; }
  .dir .rk { grid-row: 1 / span 3; padding-block-start: 2px; }
  .dir .party { margin-block: 4px; }
  .leaves { gap: 12px; }
  .leaves .leaf { inline-size: calc(50% - 6px); }
  .price { grid-template-columns: minmax(0, 1fr); padding-block: 28px; }
  .fee-stamp { block-size: 176px; inline-size: 156px; padding-block: 18px 16px; }
  .fee-num { font-size: 60px; }
  .fee-stamp::after { inset-block-end: 40px; }
  .foot-inner { grid-template-columns: minmax(0, 1fr); }
  .legal-links { grid-column: 1; grid-row: auto; margin-block-start: 10px; }
  .inner { gap: 22px; }
  .inner-sheet { padding: 18px 18px 26px; }
  .sheet-head h1 { font-size: 48px; }
  .passport ol.items > li { grid-template-columns: 1.8em minmax(0, 1fr); }
  .plans > label { align-items: flex-start; }
  .plans .muted { display: block; margin-inline-start: 0; margin-block-start: 2px; }
  /* sample tables stack: the row's name first, then each value under its column caption */
  .table-wrap { margin-block-end: 0.5em; }
  .passport table.stack, .passport .stack tbody { display: block; }
  .passport .stack thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .passport .stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 6px; padding-block: 12px; border-block-end: 1px solid var(--rule); }
  .passport .stack th[scope="row"] { grid-column: 1 / -1; padding: 0; border: 0; }
  .passport .stack td { padding: 0; border: 0; display: flex; flex-direction: column; gap: 1px; min-inline-size: 0; }
  .passport .stack td::before {
    content: attr(data-label); font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2);
  }
  :lang(ar) .passport .stack td::before { font-size: 13.5px; letter-spacing: 0; text-transform: none; }
  .passport .stack .evid { align-items: flex-end; text-align: end; }
  .passport .stack.checklist tr { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- print: the pages, without the cloth ---------- */
@media print {
  body { background: #fff; color: #000; }
  .top, .foot, .skip, .fees, .side, .crest-field, .sp-foot { display: none; }
  .sheet, .page, .bpage, .cover, .specimen { box-shadow: none; background: #fff; color: #000; }
  .cover h1 .key { background: none; -webkit-text-fill-color: currentColor; color: #000; }
  .booklet, .spread { filter: none; }
}
