/* Trust Bridge Global — online edition */

.page-edition {
  --plex: "IBM Plex Mono", ui-monospace, monospace;
  --mono: var(--plex);
  --accent: #a8864a;
  --edge: rgba(135, 105, 42, .42);
  --grid: rgba(184, 149, 90, .16);
  --guide: rgba(168, 134, 74, .55);
  --pad: clamp(20px, 3.4vw, 44px);
}
[data-theme="dark"] .page-edition {
  --accent: #d6bc83;
  --edge: rgba(214, 188, 131, .38);
  --grid: rgba(214, 188, 131, .085);
  --guide: rgba(214, 188, 131, .42);
}
html:has(.page-edition) { scroll-padding-top: 72px; }
/* Plex Mono has no Arabic, and its wide spaces break up Arabic words, so Arabic labels use Tajawal and only codes stay in Plex. */
html[lang="ar"] .page-edition { --mono: "Tajawal", sans-serif; }
html[lang="ar"] :is(.mast-read, .book-count, .pg-no, .ix-cell i, [data-ix-code], .proc-n, .row-spec .mono-label, .colo-pdf .card-bar, .mast-foot [dir="ltr"], .pg-meta [dir="ltr"]) { font-family: var(--plex); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ed-frame { max-width: 1240px; margin-inline: auto; border-inline: 1px solid var(--line); }
.grid-bg {
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 14px 14px;
  background-position: -1px -1px;
}
.mono-label { font: 500 .75rem/1.45 var(--mono); color: var(--accent); letter-spacing: .01em; }
html[lang="ar"] .mono-label { font-size: .875rem; }
.ed-link { display: inline-flex; gap: 6px; font: 500 .8125rem/1.4 var(--mono); color: var(--ink); border-bottom: 1px solid var(--edge); padding-bottom: 2px; }
html[lang="ar"] .ed-link { font-size: .9375rem; }
.ed-link:hover { border-color: var(--ink); }

/* Outlined display type with an offset shadow, as on a proof */
/* The outline is built from hairline shadows rather than a stroke, so overlapping contours inside the font stay hidden. */
.outline, .ch-title .ch-n, .ch-title .ch-t {
  --o: 1.3px;
  color: var(--bg);
  text-shadow:
    var(--o) 0 0 var(--ink), calc(var(--o) * -1) 0 0 var(--ink), 0 var(--o) 0 var(--ink), 0 calc(var(--o) * -1) 0 var(--ink),
    calc(var(--o) * .7) calc(var(--o) * .7) 0 var(--ink), calc(var(--o) * -.7) calc(var(--o) * -.7) 0 var(--ink),
    calc(var(--o) * .7) calc(var(--o) * -.7) 0 var(--ink), calc(var(--o) * -.7) calc(var(--o) * .7) 0 var(--ink),
    .045em .045em 0 var(--gold);
}

/* Metric guides laid over a line of display type; --b is the baseline measured from the top of the box */
.g { position: absolute; inset-inline: calc(var(--pad) * -1); height: 0; border-top: 1px dashed var(--guide); pointer-events: none; }
.g::before, .g::after { content: attr(data-v); position: absolute; top: -15px; font: 500 10px/1 var(--plex); color: var(--accent); letter-spacing: 0; -webkit-text-stroke: 0; text-shadow: none; }
.g::before { inset-inline-start: 8px; }
.g::after { inset-inline-end: 8px; }
.g-base { top: var(--b); }
.g-x { top: calc(var(--b) - var(--xh)); }
.g-cap { top: calc(var(--b) - var(--ch)); }
:root { --xh: .54em; --ch: .72em; }
html[lang="ar"] { --xh: .444em; --ch: .645em; }

/* ---------- Header ---------- */

.ed-hdr { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.ed-hdr-in { display: flex; align-items: center; gap: 22px; height: 56px; padding-inline: 20px; }
.ed-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .9375rem; white-space: nowrap; }
.ed-logo .mark { width: 19px; height: 22px; }
.ed-tag { font: 500 .75rem/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
html[lang="ar"] .ed-tag { font-size: .875rem; }
.ed-toc { margin-inline-start: auto; }
.ed-toc ol { display: flex; gap: 2px; }
.ed-toc a { display: block; padding: 6px 9px; border-radius: 3px; font: 500 .75rem/1 var(--mono); color: var(--ink-2); white-space: nowrap; }
html[lang="ar"] .ed-toc a { font-size: .875rem; }
.ed-toc a span { color: var(--accent); margin-inline-end: 6px; }
.ed-toc a:hover, .ed-toc a.is-current { background: var(--bg-2); color: var(--ink); }
.ed-actions { display: flex; align-items: center; gap: 18px; font: 500 .8125rem/1 var(--mono); white-space: nowrap; }
html[lang="ar"] .ed-actions { font-size: .9375rem; }
.ed-actions a:hover { color: var(--accent); }
.ed-actions .icon-btn { width: 34px; height: 34px; }

/* ---------- Masthead ---------- */

.mast {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "mark words" "ctl note" "foot foot";
  gap: 8px clamp(24px, 4vw, 56px);
  padding: 40px var(--pad) 22px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.mast-mark { grid-area: mark; position: relative; }
.spec-mark { display: block; width: 100%; height: auto; overflow: visible; }
.sm-guides line { stroke: var(--guide); stroke-width: .5; stroke-dasharray: 2 2; }
.sm-guides text { font: 500 6.2px var(--plex); fill: var(--accent); }
#dots circle { fill: var(--gold); }
.sm-shadow path { fill: url(#dots); }
.sm-frame path, .sm-gold path { fill: var(--bg); stroke: var(--ink); stroke-width: .7; stroke-linejoin: miter; transition: fill .35s, stroke .35s; }
.sm-gold path { stroke: var(--accent); }
.pt { fill: var(--ink); cursor: crosshair; transition: transform .15s; transform-box: fill-box; transform-origin: center; }
.pt-g { fill: var(--bg); stroke: var(--accent); stroke-width: 1.1; }
.pt:hover, .pt.is-on { transform: scale(1.8); }
.pt-g:hover, .pt-g.is-on { fill: var(--accent); }
[data-mode="fill"] .sm-frame path { fill: var(--ink); }
[data-mode="fill"] .sm-gold path { fill: var(--gold); stroke: var(--gold); }
[data-mode="fill"] .sm-points { opacity: .35; }
.mast-read { position: absolute; inset-inline-start: 6%; bottom: 3%; padding: 5px 9px; background: var(--bg); border: 1px solid var(--edge); font: 500 .75rem/1 var(--mono); color: var(--ink-2); }
.mast-read span { color: var(--accent); }

.mast-words { grid-area: words; align-self: center; display: flex; flex-direction: column; font-size: clamp(54px, 9.6vw, 142px); font-weight: 700; line-height: 1; letter-spacing: -.045em; margin: 0; }
html[lang="ar"] .mast-words { font-size: clamp(54px, 9.2vw, 136px); letter-spacing: 0; line-height: 1.2; }
.wl { position: relative; display: block; padding-block: .05em; --b: .922em; }
html[lang="ar"] .wl { --b: .784em; }
.wl .g { inset-inline: -30px calc(var(--pad) * -1); }
.mast-note { grid-area: note; justify-self: end; align-self: start; max-width: 300px; margin-top: -8px; padding: 12px 16px; background: var(--bg); border: 1px solid var(--edge); box-shadow: 5px 5px 0 var(--gold); font: 500 1rem/1.45 var(--mono); }
html[lang="ar"] .mast-note { font: 700 1.25rem/1.5 var(--font); }
.mast-badge { position: absolute; top: 20px; inset-inline-end: var(--pad); padding: 7px 12px; background: var(--bg); border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 500 .8125rem/1 var(--mono); }
html[lang="ar"] .mast-badge { font-size: .9375rem; }
.mast-ctl { grid-area: ctl; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mast-ctl p { font-size: .8125rem; color: var(--ink-3); }
.mast-foot { grid-area: foot; display: flex; justify-content: space-between; gap: 16px; padding-top: 18px; margin-top: 16px; border-top: 1px dashed var(--guide); font: 500 .75rem/1.4 var(--mono); color: var(--accent); }
html[lang="ar"] .mast-foot { font-size: .875rem; }

/* Segmented switch */
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; }
.seg button { padding: 4px 10px; border: 0; border-radius: 3px; background: transparent; font: 500 .71875rem/1.3 var(--mono); color: var(--ink-3); cursor: pointer; white-space: nowrap; }
html[lang="ar"] .seg button { font-size: .8125rem; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .06); }

/* ---------- Book ---------- */

.ed-book { padding: 56px var(--pad) 36px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.book { max-width: 1080px; margin-inline: auto; perspective: 2600px; }
.book-stage { position: relative; aspect-ratio: 420 / 297; filter: drop-shadow(0 22px 34px rgba(0, 0, 0, .28)); }
.book-stage::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 40px); width: 80px; z-index: 4; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .22) 46%, rgba(255, 255, 255, .08) 50%, rgba(0, 0, 0, .2) 54%, transparent); }
.book.is-single .book-stage { aspect-ratio: 210 / 297; max-width: 460px; margin-inline: auto; }
.book.is-single .book-stage::after { display: none; }

.pg { position: absolute; top: 0; bottom: 0; width: 50%; inset-inline-start: 0; visibility: hidden; overflow: hidden; container-type: inline-size; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }
.pg.is-a, .pg.is-b { visibility: visible; }
.pg.is-b { inset-inline-start: 50%; }
.book.is-single .pg { width: 100%; }
.book.is-single .pg.is-b { visibility: hidden; }
.pg > * { position: relative; z-index: 1; margin-inline: 8cqw; }
.pg-run { position: absolute; top: 5.5cqw; inset-inline: 8cqw; margin: 0; display: flex; justify-content: space-between; gap: 4cqw; padding-bottom: 1.6cqw; border-bottom: 1px solid currentColor; font: 500 max(9px, 1.9cqw)/1.2 var(--mono); opacity: .7; }
html[lang="ar"] .pg-run { font-size: max(10px, 2.2cqw); }
.pg-no { position: absolute; bottom: 5cqw; inset-inline-end: 8cqw; margin: 0; font: 600 max(9px, 2cqw)/1 var(--mono); opacity: .75; }

.pg-photo { background: #0b0b0c; color: #f2efe8; }
.pg-photo::before { content: ""; position: absolute; inset: 0; background: var(--img) center / cover no-repeat; filter: grayscale(1) sepia(.45) brightness(.62) contrast(1.12); }
.pg-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 12, .55), rgba(11, 11, 12, .08) 38%, rgba(11, 11, 12, .2) 60%, rgba(11, 11, 12, .9)); }
.pg-cover::before { width: 200%; inset-inline-start: 0; }
.pg-cover.pg-b::before { inset-inline-start: -100%; }
.pg-cover::after { background: linear-gradient(180deg, rgba(11, 11, 12, .5), rgba(11, 11, 12, .15) 30%, rgba(11, 11, 12, .35) 62%, rgba(11, 11, 12, .92)); }

.pg-logo { display: flex; align-items: center; gap: 2.4cqw; margin-top: 7cqw; font-weight: 700; font-size: max(11px, 2.9cqw); line-height: 1.15; }
.pg-logo .mark { width: 6cqw; height: 6.9cqw; color: #f2efe8; }
.pg-logo small { display: block; font-weight: 500; font-size: .74em; opacity: .7; }
.pg-giant { position: absolute; top: 34%; inset-inline: 8cqw; margin: 0; font-size: 15.5cqw; line-height: .98; font-weight: 700; letter-spacing: -.045em; color: var(--gold); }
html[lang="ar"] .pg-giant { font-size: 17cqw; letter-spacing: 0; line-height: 1.25; }
.pg-lede { margin-top: auto; margin-bottom: 15cqw; font-size: max(11px, 2.7cqw); line-height: 1.55; color: rgba(242, 239, 232, .85); }
html[lang="ar"] .pg-lede { font-size: max(12px, 3cqw); line-height: 1.8; font-weight: 500; color: #f2efe8; }
.pg-meta { position: absolute; bottom: 5cqw; inset-inline: 8cqw; margin: 0; display: flex; justify-content: space-between; gap: 3cqw; font: 500 max(9px, 1.9cqw)/1.3 var(--mono); color: var(--gold); }
html[lang="ar"] .pg-meta { font-size: max(10px, 2.2cqw); }
.pg-cover.pg-a .pg-meta span + span { display: none; }

.pg-num { margin-top: 22cqw; font-size: 44cqw; line-height: 1; font-weight: 700; letter-spacing: -.05em; }
.outline-light { color: transparent; -webkit-text-stroke: 1.5px #f2efe8; text-shadow: none; }
.pg-name { margin-top: auto; margin-bottom: 13cqw; font-size: 7.4cqw; line-height: 1.08; letter-spacing: -.025em; font-weight: 700; color: #f2efe8; }
html[lang="ar"] .pg-name { letter-spacing: 0; line-height: 1.4; }

.pg-paper .pg-title { margin-top: 17cqw; font-size: 5.6cqw; line-height: 1.15; letter-spacing: -.02em; font-weight: 600; }
html[lang="ar"] .pg-title { font-size: 5.6cqw; line-height: 1.5; letter-spacing: 0; font-weight: 700; }
.pg-intro { margin-top: 3.4cqw; font-size: max(11px, 2.65cqw); line-height: 1.55; color: var(--ink-2); }
html[lang="ar"] .pg-intro { font-size: max(12px, 2.9cqw); line-height: 1.8; }
.pg-hls { display: grid; grid-template-columns: 1fr 1fr; gap: 3.4cqw 5cqw; margin-top: 6cqw; }
.pg-hls div { padding-top: 2cqw; border-top: 2px solid var(--gold); }
.pg-hls dt { font-size: max(10.5px, 2.35cqw); font-weight: 700; line-height: 1.3; }
.pg-hls dd { margin-top: .8cqw; font-size: max(10px, 2.05cqw); line-height: 1.45; color: var(--ink-2); }
html[lang="ar"] .pg-hls dt { font-size: max(11px, 2.6cqw); }
html[lang="ar"] .pg-hls dd { font-size: max(10.5px, 2.35cqw); line-height: 1.6; }
.pg-link { align-self: flex-start; margin-top: 5cqw; font: 500 max(10px, 2.1cqw)/1.3 var(--mono); border-bottom: 1px solid var(--edge); }

.pg-dark { background: #141414; color: #f2efe8; }
.pg-facets { position: absolute; inset: 0; margin: 0; background: url("../img/facets.svg") no-repeat 40% 120% / 150% auto; opacity: .5; z-index: 0; }
.pg-dark > .mark { width: 13cqw; height: 15cqw; margin-top: 18cqw; color: #f2efe8; }
.pg-dark .pg-title { margin-top: 7cqw; font-size: 9cqw; line-height: 1.05; letter-spacing: -.03em; font-weight: 700; }
.pg-dark .pg-intro { color: rgba(242, 239, 232, .75); max-width: 70cqw; }
.pg-contact { margin-top: 17cqw; display: grid; gap: 3.2cqw; }
.pg-contact div { display: grid; grid-template-columns: 30cqw 1fr; gap: 3cqw; padding-bottom: 3.2cqw; border-bottom: 1px solid var(--line); }
.pg-contact dt { font: 500 max(9.5px, 1.95cqw)/1.5 var(--mono); color: var(--accent); }
.pg-contact dd { font-size: max(11px, 2.5cqw); line-height: 1.5; }
html[lang="ar"] .pg-contact dt { font-size: max(10.5px, 2.3cqw); }
.pg-dl { display: flex; flex-wrap: wrap; gap: 2.4cqw; margin-top: 6cqw; }
.pg-dl a { padding: 1.6cqw 2.6cqw; border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--gold); font: 500 max(10px, 2.1cqw)/1.2 var(--mono); }
.pg-dl a[lang="ar"] { font-family: var(--font); font-weight: 700; }

.leaf { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 6; transform-style: preserve-3d; pointer-events: none; }
.book.is-single .leaf { width: 100%; }
.leaf-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.leaf-back { transform: rotateY(180deg); }
.leaf .pg { inset: 0; width: 100%; visibility: visible; }
.leaf-face::after { content: ""; position: absolute; inset: 0; z-index: 3; background: linear-gradient(90deg, rgba(0, 0, 0, .28), transparent 40%); opacity: 0; animation: leaf-shade var(--turn) ease-in-out; }
@keyframes leaf-shade { 50% { opacity: 1; } }

.book-bar { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; max-width: 1080px; margin: 28px auto 0; }
.book-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--ink); background: var(--bg); box-shadow: 3px 3px 0 var(--gold); cursor: pointer; }
.book-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--gold); }
.book-btn:disabled { opacity: .35; cursor: default; }
[data-book-prev] .i-arrow { transform: scaleX(-1); }
[dir="rtl"] [data-book-prev] .i-arrow { transform: none; }
.book-count { min-width: 84px; text-align: center; font: 600 .875rem/1 var(--mono); }
.book-hint { flex-basis: 100%; text-align: center; font-size: .8125rem; color: var(--ink-3); }

/* ---------- Cards (colophon) ---------- */

.card {
  position: relative; width: auto;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--edge);
  box-shadow: 5px 5px 0 var(--gold);
  font: 400 .78125rem/1.5 var(--mono);
  transition: box-shadow .15s;
}
html[lang="ar"] .card { font-size: .875rem; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px 6px 11px; border-bottom: 1px solid var(--edge); font-weight: 500; }
[dir="rtl"] .card-bar { padding: 6px 11px 6px 8px; }
.card-body { display: block; padding: 10px 12px 12px; }
.card-note { font-size: .8125rem; line-height: 1.55; }
html[lang="ar"] .card-note { font: 500 1rem/1.75 var(--font); }

/* ---------- Chapters ---------- */

.ch-head { border-bottom: 1px solid var(--line); }
.ch-grid { height: 56px; }
.ch-title {
  position: relative; display: flex; align-items: baseline; gap: .32em;
  margin: 0; padding: .08em var(--pad) .17em;
  border-block: 1px solid var(--line);
  font-size: clamp(64px, 12.4vw, 176px); line-height: 1; font-weight: 700; letter-spacing: -.045em;
  --b: .967em; overflow: hidden;
}
html[lang="ar"] .ch-title { letter-spacing: 0; line-height: 1.25; --b: .849em; font-size: clamp(56px, 10.4vw, 150px); }
.ch-n { padding-inline-end: .3em; border-inline-end: 1px solid var(--line); }
.ch-t { white-space: nowrap; }
.ch-body { padding: 56px var(--pad) 88px; }
.ch-lede { max-width: 640px; margin-bottom: 36px; font-size: 1.125rem; color: var(--ink-2); }

.lead { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.lead-side { display: grid; align-content: start; gap: 14px; }
.lead-name { font-size: 1.375rem; font-weight: 700; line-height: 1.25; }
.lead-side p:not(.mono-label) { font-size: .9375rem; color: var(--ink-2); }
.lead-spec { font-size: clamp(30px, 3.9vw, 54px); line-height: 1.1; letter-spacing: -.025em; font-weight: 500; }
html[lang="ar"] .lead-spec { line-height: 1.5; letter-spacing: 0; font-weight: 500; }

.hl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.hl div { padding: 26px 22px 28px; }
.hl div:first-child { padding-inline-start: 0; }
.hl div + div { border-inline-start: 1px solid var(--line); }
.hl dt { display: grid; gap: 10px; font-size: 1rem; font-weight: 700; line-height: 1.3; }
.hl dd { margin-top: 8px; font-size: .875rem; line-height: 1.55; color: var(--ink-2); }

.row { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); padding: 40px 0; border-bottom: 1px solid var(--line); }
.row-side .seg { margin-bottom: 18px; }
.row-side h3 { font-size: 1.0625rem; font-weight: 700; line-height: 1.35; margin-bottom: 10px; }
.row-side p { font-size: .9375rem; color: var(--ink-2); }
.row-spec .mono-label { margin-bottom: 14px; }
.spec-names li { font-size: clamp(24px, 2.7vw, 37px); line-height: 1.22; letter-spacing: -.02em; }
html[lang="ar"] .spec-names li { line-height: 1.6; letter-spacing: 0; }
.spec-detail div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; padding: 12px 0; border-top: 1px dashed var(--line-2); }
.spec-detail div:first-child { border-top: 0; padding-top: 0; }
.spec-detail dt { font-size: .9375rem; font-weight: 700; line-height: 1.4; }
.spec-detail dd { font-size: .875rem; color: var(--ink-2); }
.row[data-view="names"] .spec-detail, .row[data-view="detail"] .spec-names { display: none; }
.row[data-view="detail"] .spec-detail { animation: rise .35s ease-out; }
.row[data-view="names"] .spec-names { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.rows:not(.is-open) .row-extra { display: none; }
.more-btn { margin-top: 28px; padding: 10px 16px; border: 1px solid var(--ink); background: var(--bg); box-shadow: 3px 3px 0 var(--gold); font: 500 .8125rem/1 var(--mono); cursor: pointer; }
html[lang="ar"] .more-btn { font-size: .9375rem; }

.proc { margin-top: 72px; }
.proc > .mono-label, .stds > .mono-label { margin-bottom: 20px; }
.proc ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 20px; }
.proc-n { display: block; font: 600 .8125rem/1 var(--mono); color: var(--accent); }
.proc-bar { display: block; height: 11px; margin: 12px 0 16px;
  background: linear-gradient(90deg, var(--ink) var(--fill), color-mix(in srgb, var(--ink) 12%, transparent) var(--fill));
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px); mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px); }
[dir="rtl"] .proc-bar { transform: scaleX(-1); }
.proc li:nth-child(1) { --fill: 20%; } .proc li:nth-child(2) { --fill: 40%; } .proc li:nth-child(3) { --fill: 60%; }
.proc li:nth-child(4) { --fill: 80%; } .proc li:nth-child(5) { --fill: 100%; }
.proc h4 { font-size: .9375rem; font-weight: 700; line-height: 1.35; margin-bottom: 6px; }
.proc p { font-size: .84375rem; line-height: 1.55; color: var(--ink-2); }
html[lang="ar"] .proc p { font-size: .9375rem; line-height: 1.7; }
.stds { margin-top: 56px; }
.stds ul { display: flex; flex-wrap: wrap; gap: 8px; }
.stds li { padding: 5px 10px; border: 1px solid var(--edge); font: 500 .75rem/1.3 var(--mono); }
html[lang="ar"] .stds li { font-size: .875rem; }

/* ---------- Index ---------- */

.ix { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); border: 1px solid var(--line); }
.ix-view { display: flex; flex-direction: column; border-inline-end: 1px solid var(--line); }
.ix-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.ix-list .ix-bar { position: sticky; top: 56px; z-index: 2; background: var(--bg); flex-wrap: wrap; }
.ix-stage { position: relative; height: 340px; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.ix-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; filter: grayscale(1) contrast(1.1); transition: opacity .3s; }
.ix-stage::before, .ix-stage::after { content: ""; position: absolute; inset-inline: 0; z-index: 1; border-top: 1px dashed var(--guide); }
.ix-stage::before { top: 24%; }
.ix-stage::after { top: 78%; }
.ix-sym { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font: 700 clamp(140px, 17vw, 230px)/1 var(--font); letter-spacing: -.05em; color: var(--ink); font-family: "Manrope", sans-serif; }
[data-mode="outline"] .ix-sym { --o: 1.5px; color: var(--bg-2);
  text-shadow: var(--o) 0 0 var(--ink), calc(var(--o) * -1) 0 0 var(--ink), 0 var(--o) 0 var(--ink), 0 calc(var(--o) * -1) 0 var(--ink),
    calc(var(--o) * .7) calc(var(--o) * .7) 0 var(--ink), calc(var(--o) * -.7) calc(var(--o) * -.7) 0 var(--ink),
    calc(var(--o) * .7) calc(var(--o) * -.7) 0 var(--ink), calc(var(--o) * -.7) calc(var(--o) * .7) 0 var(--ink), .04em .04em 0 var(--gold); }
.ix-sym.is-swap { animation: rise .3s ease-out; }
.ix-info { padding: 22px 24px 26px; display: grid; gap: 12px; align-content: start; }
.ix-info h3 { font-size: 1.375rem; font-weight: 700; line-height: 1.3; }
.ix-info > p { font-size: .9375rem; color: var(--ink-2); }
.ix-info dl { display: grid; gap: 0; }
.ix-info dl div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); gap: 14px; padding: 8px 0; border-top: 1px dashed var(--line-2); }
.ix-info dt { font: 500 .75rem/1.6 var(--mono); color: var(--accent); }
html[lang="ar"] .ix-info dt { font-size: .875rem; }
.ix-info dd { font-size: .875rem; line-height: 1.55; }
.ix-info .ed-link { justify-self: start; margin-top: 6px; }
.ix-list { overflow: clip; }
.ix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); margin-inline-end: -1px; }
.ix-cell { display: flex; flex-direction: column; gap: 4px; min-height: 118px; padding: 9px 10px 11px; background: var(--bg); border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.ix-cell:hover { background: var(--bg-2); }
.ix-cell[aria-selected="true"] { background: var(--bg-2); box-shadow: inset 0 0 0 1.5px var(--ink); }
.ix-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.ix-cell[hidden] { display: none; }
.ix-cell { position: relative; }
.ix-thumb { position: absolute; top: 9px; right: 10px; width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--line); filter: grayscale(1) contrast(1.05); opacity: .7; transition: filter .25s, opacity .25s; }
.ix-cell:hover .ix-thumb, .ix-cell[aria-selected="true"] .ix-thumb { filter: none; opacity: 1; }
.ix-cell i { font: 500 .65625rem/1 var(--mono); font-style: normal; color: var(--ink-3); text-align: start; }
.ix-cell b { font-size: 2.125rem; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; font-family: "Manrope", sans-serif; text-align: start; }
.ix-cell span { margin-top: auto; font-size: .71875rem; line-height: 1.3; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[lang="ar"] .ix-cell span { font-size: .8125rem; line-height: 1.45; }

/* ---------- Composer ---------- */

.cmp { display: grid; grid-template-columns: minmax(0, 1fr) 340px; border: 1px solid var(--line); }
.cmp-draft { display: flex; flex-direction: column; gap: 22px; padding: 30px clamp(20px, 3.4vw, 44px) 32px; }
.cmp-text { flex: 1; min-height: 11em; font-size: clamp(21px, 2.15vw, 30px); line-height: 1.42; letter-spacing: -.012em; }
html[lang="ar"] .cmp-text { line-height: 1.8; letter-spacing: 0; }
.cmp-text p + p { margin-top: .7em; }
.cmp-text .v { border-bottom: 2px solid var(--gold); transition: background .4s; }
.cmp-text .v.is-new { background: color-mix(in srgb, var(--gold) 30%, transparent); }
.cmp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cmp-copy { padding: 0; border: 0; background: none; font: 500 .8125rem/1 var(--mono); border-bottom: 1px solid var(--edge); padding-bottom: 3px; cursor: pointer; }
html[lang="ar"] .cmp-copy { font-size: .9375rem; }
.cmp-panel { padding: 16px; background: var(--bg-2); border-inline-start: 1px solid var(--line); }
.cmp-group + .cmp-group { margin-top: 22px; }
.cmp-h { margin-bottom: 10px; font: 600 .75rem/1 var(--mono); color: var(--ink); }
html[lang="ar"] .cmp-h { font-size: .875rem; }
.cmp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cmp-presets button { padding: 8px 6px; border: 1px solid var(--line-2); background: var(--bg); font: 500 .75rem/1.3 var(--mono); color: var(--ink-2); cursor: pointer; }
html[lang="ar"] .cmp-presets button { font: 500 .875rem/1.4 var(--font); }
.cmp-presets button:hover { color: var(--ink); border-color: var(--ink-3); }
.cmp-presets button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); box-shadow: 2px 2px 0 var(--gold); }
.cmp-field { display: grid; gap: 6px; margin-bottom: 14px; font: 500 .71875rem/1.3 var(--mono); color: var(--ink-2); }
html[lang="ar"] .cmp-field { font-size: .8125rem; }
.cmp-field select { width: 100%; height: 40px; padding-inline: 12px 36px; border: 1px solid var(--line-2); border-radius: 0; background: var(--bg); font: 500 .875rem/1 var(--font); color: var(--ink); }
.cmp-range { grid-template-columns: 1fr auto; }
.cmp-range input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.cmp-range output { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cmp-field .seg { justify-self: start; }

/* ---------- Colophon ---------- */

.colo { display: grid; grid-template-columns: 1.3fr 1fr; align-items: start; gap: 32px; padding: 64px var(--pad); }
.colo .card-body { display: grid; gap: 14px; }
.colo-dl { display: grid; gap: 24px; }
.colo-pdf { display: block; }
.colo-pdf .card-body { display: grid; gap: 6px; }
.colo-pdf b { font-size: 1.0625rem; font-family: var(--font); }
.colo-pdf:hover { box-shadow: 8px 8px 0 var(--gold); }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .ed-tag { display: none; }
  .ed-toc a { font-size: 0; padding: 6px 7px; }
  .ed-toc a span { font-size: .75rem; margin: 0; }
}
@media (max-width: 980px) {
  .ix, .cmp { grid-template-columns: 1fr; }
  .ix-view { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .cmp-panel { border-inline-start: 0; border-top: 1px solid var(--line); }
  .hl { grid-template-columns: 1fr 1fr; }
  .hl div:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .hl div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .proc ol { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .ix-list .ix-bar { position: static; }
}
@media (max-width: 820px) {
  .ed-toc { display: none; }
  .ed-actions { margin-inline-start: auto; gap: 14px; }
  .mast { grid-template-columns: 1fr; grid-template-areas: "words" "mark" "ctl" "note" "foot"; padding-top: 64px; }
  .mast-mark { max-width: 420px; }
  .mast-note { justify-self: start; margin-top: 8px; }
  .lead, .row { grid-template-columns: 1fr; gap: 20px; }
  .colo { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ed-logo span { display: none; }
  .g::before, .g::after { display: none; }
  .hl { grid-template-columns: 1fr; }
  .hl div { padding-inline: 0 !important; border-inline-start: 0 !important; }
  .hl div + div { border-top: 1px solid var(--line); }
  .proc ol { grid-template-columns: 1fr; }
  .spec-detail div, .ix-info dl div { grid-template-columns: 1fr; gap: 4px; }
  .ix-grid { grid-template-columns: repeat(3, 1fr); }
  .ix-stage { height: 240px; }
  .mast-foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .row .spec-names, .row .spec-detail, .ix-sym.is-swap { transition: none; animation: none; }
}
