.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editorial-theme-switch {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 88px);
  right: 18px;
  z-index: 30;
  width: 56px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}

.editorial-theme-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: left 250ms ease;
}

html.dark .editorial-theme-switch::before {
  left: 30px;
}

.editorial-theme-icon {
  position: absolute;
  top: 8px;
  pointer-events: none;
  font-size: 11px;
  line-height: 1;
  transition: opacity 200ms ease;
}

.editorial-theme-sun {
  left: 8px;
  opacity: 1;
}

.editorial-theme-moon {
  right: 8px;
  opacity: 0.42;
}

html.dark .editorial-theme-sun {
  opacity: 0.42;
}

html.dark .editorial-theme-moon {
  opacity: 1;
}

.editorial-theme-switch:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.editorial-locale-control,
.editorial-menu-button {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(18, 22, 31, 0.92);
  color: var(--ink);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* 🔴 THIS CLASS WAS USED IN MARKUP AND DEFINED NOWHERE.
 * `<span class="sr-only">Language</span>` sits inside the 44x44 locale chip as the select's
 * visible label. With no rule, it computed display:block / position:static / clip:auto and laid
 * out at 72 x 26 INSIDE a 44px box with overflow:hidden — which pushed #editorialLocaleCode to
 * x = -1 and painted the middle of the word "Language" instead: "angua".
 * Standard visually-hidden: off-screen but still in the accessibility tree, because it is the
 * only text label the <select> has. display:none or visibility:hidden would remove it from
 * screen readers too and break 4.1.2. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

label.editorial-locale-control {
  display: grid;
  place-items: center;
  align-content: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

/* ── CANONICAL CHIP PLACEMENT — ONE OWNER, and this file is why ────────────────────────────
 * This is the only stylesheet EVERY editorial page loads, so the chip is pinned here rather
 * than per page. It was previously set in three places — bi-chrome.css for the 8 legal pages,
 * an inline block on /editorial-access/, and nothing at all on /editorial-registration/ — and
 * the three had drifted: measured bottom 70 vs 70 vs shell-default, z-index 7 vs 7 vs auto, and
 * registration rendering system-ui instead of Poppins.
 *
 * The values are HOME's (#langToggle), matched property by property:
 *   44x44 · left 20 (16 at ≤640) · bottom 46 (44 at ≤640) · radius 8 · z-index 999
 *
 * ⚠ INK IS DELIBERATELY NOT HOME'S. Home hardcodes white "EN", which on its light glass measures
 * 1.64:1 — a WCAG 1.4.3 fail. This chip is theme-aware (16.59 light / 17.53 dark) and home was
 * corrected to match THIS. Do not "finish the parity" by copying home's colour. */
/* His call, twice: the chip is NOT across the footer row — it sits ABOVE the footer, in the
   bottom-left text zone. It rides on the footer's MEASURED height (--bi-hdr-h, which the footer
   mirrors) plus 16px, so it stays clear of the links at every width. Rendered in the approved
   mock: chip bottom 807, footer top 823. */
html body .editorial-locale-control {
  position: fixed !important; left: 20px !important;
  bottom: calc(var(--bi-ftr-h, var(--bi-hdr-h, 77px)) + 16px + env(safe-area-inset-bottom)) !important;
  top: auto !important; right: auto !important; z-index: 999;
  display: inline-flex !important; align-items: center; justify-content: center;
}
@media (max-width: 640px) {
  html body .editorial-locale-control {
    left: 16px !important;
    bottom: calc(var(--bi-ftr-h, var(--bi-hdr-h, 68px)) + 12px + env(safe-area-inset-bottom)) !important;
  }
}
/* !important because apple-material.css:1021 sets font-family on EVERY element via
   `html body :where(*:not(...)) { ... !important }` — that is what left registration on
   system-ui while the pages with an explicit override rendered Poppins. */
#editorialLocaleCode {
  font: 700 11px/1 'Poppins', sans-serif !important; letter-spacing: .05em;
}
/* RTL: the chip is position:fixed; left:20px, which does not flip with dir. Measured on a
   simulated /he/about/: header and body flipped correctly, the chip stayed bottom-LEFT. Mirror it. */
html[dir="rtl"] body .editorial-locale-control { left: auto !important; right: 20px !important; }
@media (max-width: 640px) {
  html[dir="rtl"] body .editorial-locale-control { left: auto !important; right: 16px !important; }
}

.editorial-locale-code {
  pointer-events: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.editorial-locale-control select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 44px;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  opacity: 0;
  cursor: pointer;
}

.editorial-menu-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
}

.editorial-menu-button span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.editorial-menu-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.editorial-menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.editorial-menu-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.editorial-locale-control:hover,
.editorial-menu-button:hover {
  border-color: rgba(7, 133, 189, 0.5);
  background: rgba(27, 34, 47, 0.96);
}

.editorial-locale-control:focus-within,
.editorial-menu-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.editorial-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: opacity 220ms ease;
}

.editorial-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.editorial-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 81;
  width: min(320px, 88vw);
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: rgba(13, 17, 25, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -18px 0 55px rgba(0, 0, 0, 0.45);
  transform: translateX(105%);
  transition: transform 230ms ease-out;
}

.editorial-drawer.is-open {
  transform: translateX(0);
}

.editorial-drawer-header {
  min-height: 72px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.editorial-drawer-header img {
  display: block;
  width: auto;
  height: 25px;
}

.editorial-drawer-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.editorial-drawer-close:hover,
.editorial-drawer-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.editorial-drawer nav {
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.editorial-drawer nav a,
.editorial-drawer-external {
  min-height: 48px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  color: rgba(245, 247, 251, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.editorial-drawer nav a:hover,
.editorial-drawer nav a:focus-visible,
.editorial-drawer-external:hover,
.editorial-drawer-external:focus-visible {
  background: rgba(255, 255, 255, 0.07);
}

.editorial-drawer-divider {
  height: 1px;
  margin: 8px 22px;
  background: rgba(255, 255, 255, 0.08);
}

.editorial-drawer-external {
  color: var(--wire-text);
}

.editorial-drawer-footer {
  margin-top: auto;
  padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--quiet);
  text-align: center;
  font-size: 0.68rem;
}

body.editorial-drawer-open {
  overflow: hidden;
}

html.light .editorial-locale-control,
html.light .editorial-menu-button {
  border-color: rgba(29, 65, 91, 0.2);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(29, 65, 91, 0.08);
}

html.light .editorial-locale-control:hover,
html.light .editorial-menu-button:hover {
  border-color: rgba(7, 133, 189, 0.48);
  background: #fff;
}

html.light .editorial-drawer {
  color: var(--ink);
  background: rgba(248, 252, 254, 0.985);
  border-left-color: rgba(29, 65, 91, 0.16);
  box-shadow: -18px 0 55px rgba(29, 65, 91, 0.2);
}

html.light .editorial-drawer-header {
  border-bottom-color: rgba(29, 65, 91, 0.14);
}

html.light .editorial-drawer-close {
  color: var(--ink);
}

html.light .editorial-drawer-close:hover,
html.light .editorial-drawer-close:focus-visible,
html.light .editorial-drawer nav a:hover,
html.light .editorial-drawer nav a:focus-visible,
html.light .editorial-drawer-external:hover,
html.light .editorial-drawer-external:focus-visible {
  background: rgba(7, 133, 189, 0.08);
}

html.light .editorial-drawer nav a {
  color: var(--ink);
}

html.light .editorial-drawer-divider {
  background: rgba(29, 65, 91, 0.14);
}

html.light .editorial-drawer-footer {
  border-top-color: rgba(29, 65, 91, 0.14);
}

@media (max-width: 650px) {
  .site-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .header-actions {
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editorial-menu-button span,
  .editorial-theme-switch,
  .editorial-theme-switch::before,
  .editorial-drawer,
  .editorial-drawer-backdrop {
    transition: none;
  }
}

/* ── SITE FOOTER — SAME HEIGHT AS THE HEADER ──────────────────────────────────────────────
 * His call: "the footer to be the same size of the header", 8 legal links + copyright.
 * (This REPLACES the 12-link version with a destinations row — he reduced the set.)
 *
 * The height is NOT a literal 77px. `--bi-hdr-h` is the header's REAL measured height, written
 * by bi-chrome.js and re-measured on resize, so the footer tracks the header instead of drifting
 * from it the next time the band changes. Fallback 77px covers /latest/, which has no header and
 * therefore never sets the token.
 *
 * One row at desktop; at narrow widths it simply WRAPS and grows taller — his explicit choice
 * over horizontal scrolling, because 8 links need ~660px of text and a 390 viewport offers 342.
 */
/* FIXED, like the header. His words after seeing the in-flow version: "footer is always visible
   to the user, content scrolls under it — I had to scroll all the way down to see it." The header
   is sticky and always on screen; the footer mirrors that. The blur it already carries is exactly
   what makes content scrolling behind it read correctly.
   Links + copyright CENTRED as one row (his tweak, replacing links-left / copyright-right). */
footer.site-footer {
  position: fixed !important; left: 0; right: 0; bottom: 0; z-index: 5;
  min-height: var(--bi-hdr-h, 77px);
  padding: 6px 24px calc(6px + env(safe-area-inset-bottom)) !important;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;       /* his call: everything centred, 3 rows */
  gap: 0;
  box-sizing: border-box;
  font-size: 11px;
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}
/* RESERVE THE SPACE. A fixed footer covers the last content on the page unless <main> leaves
   room for it: without this the final paragraph — and about's own copyright line — sit
   permanently behind the band. Uses the same measured token, so it grows with the footer when
   the links wrap on phones. */
body > main { padding-bottom: calc(var(--bi-ftr-h, var(--bi-hdr-h, 77px)) + 32px + env(safe-area-inset-bottom)) !important; }
@media print { footer.site-footer { position: static !important; } body > main { padding-bottom: 0 !important; } }
/* THE MATERIAL IS THE HEADER'S — same values bi-chrome.css gives `body > header.site-header`,
   mirrored: fill, ink, and the hairline on the opposite edge. Without this the footer was a
   thin dark strip on a dark page that did not read as a footer at all — measured and shown in
   the render he approved from. */
html.dark footer.site-footer {
  background: rgba(28, 28, 30, 0.84) !important;
  color: #f5f5f7 !important;
  border-top: 1px solid rgba(235, 235, 245, 0.18) !important;
}
html.light footer.site-footer {
  background: rgba(255, 255, 255, 0.86) !important;
  color: #1d1d1f !important;
  border-top: 1px solid rgba(60, 60, 67, 0.24) !important;
}
footer.site-footer .copy { font-size: 12px; opacity: .75; }
footer.site-footer .legal-links {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 0 2px; margin: 0 !important;
}
footer.site-footer .copy { margin: 0; }

/* LINKS READ AS LINKS. They computed rgb(81,81,84) grey with text-decoration:none — visually
 * identical to body text, which is why the footer did not register as a footer.
 * `--bi-link` is the page's OWN link colour and `.page a` already uses it, so this matches every
 * other link on the page rather than introducing a new blue.
 *
 * The FALLBACK is load-bearing: /editorial-access/, /editorial-registration/ and /latest/ do not
 * define --bi-link (only the 8 legal pages do), and a bare var() with no fallback is
 * invalid-at-computed-value-time — the whole declaration drops and the links stay grey. That
 * cost 8 of 40 checks the first time.
 *
 * padding gives a >=24px target height (WCAG 2.5.8); at ~15px of text the bare links were short.
 * The 44px row absorbs it, so the footer does not grow past the header. */
/* min-height/display !important for the same reason as .bi-social a below: on access +
   registration, editorial-registration.css:759 forces `.site-footer a{min-height:44px;
   display:inline-flex}` and `.site-footer nav{gap:8px 18px}` — that alone made the footer 87px
   there while the legal pages sat at 77. */
footer.site-footer .legal-links a {
  font-weight: 600; font-size: 11px;              /* 13 -> 12 -> 11: three rows must fit 77px */
  color: var(--bi-link, #0066cc) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 2px 6px;
  margin: 0 !important;                           /* the legal pages' own CSS sets margin:0 10px */
  display: inline-block !important;
  min-height: 0 !important;
  line-height: 1.1;
}
footer.site-footer .legal-links { gap: 0 4px !important; justify-content: center !important; }
/* ROW 2 + ROW 3 — his call: copyright on its OWN line, icons on the line below, all left. */
footer.site-footer .bi-foot-row2 {
  flex-direction: column; align-items: center; justify-content: center;
  gap: 0 !important;
  margin-top: 8px;                                /* his tweak: a line break between links and icons */
}
/* ROW 2 — copyright + the 5 social icons, one line, centred under the links. Same 77px band:
   8+8 padding, ~20px links row, 2px gap, 24px row 2 = 62 < 77. Measured in the approved mock. */
footer.site-footer .bi-foot-row2 { display: flex; }
/* !important: editorial-registration.css sets `.site-footer{font-size:.7rem}` and `.site-footer p`
   rules that out-ranked this on access + registration (measured 12px there vs 10 elsewhere). */
footer.site-footer .copy { font-size: 10px !important; line-height: 1.2; opacity: .75; margin: 0 !important; }
footer.site-footer .bi-social { display: flex; align-items: center; gap: 0 8px; margin-left: 0; }   /* his tweak: doubled — glyph-to-glyph 6px -> 12px */
/* min-height 24 !important: editorial-registration.css:759 sets `.site-footer a{min-height:44px}`
   (loaded by access + registration, not by the legal pages), which beat the 24px here and grew
   the footer to 107px on exactly those two pages. Measured via CSS.getMatchedStylesForNode. */
footer.site-footer .bi-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; min-height: 20px !important; border-radius: 5px; opacity: .9;
}
footer.site-footer .bi-social a:hover, footer.site-footer .bi-social a:focus-visible { opacity: 1; }
footer.site-footer .bi-social img { width: 16px; height: 16px; display: block; }
/* The brand PNGs are used AS-IS in both themes (no filter — an invert turned Facebook brown and
   Pinterest green in the mock). X and TikTok are black glyphs and vanish on the dark band; the
   email never meets this because its footer is always light. Dark only: a light plate behind
   each icon, so brand colours stay true and the black glyphs read. */
/* NO plate on dark — his call ("white areas become black"). Pixel-counted the five PNGs: none
   contain white; the white he saw was the plate showing through Facebook/Pinterest's transparent
   cut-outs. Icons render as-is. X and TikTok (100% black glyphs) are hard to see on the dark band
   — shown to him in MOCK3, his decision, recorded. */
html.dark footer.site-footer .bi-social a { background: transparent; }
@media (max-width: 640px) {
  footer.site-footer .bi-foot-row2 { flex-wrap: wrap; gap: 2px 10px; }
}
html.dark footer.site-footer .legal-links a { color: var(--bi-link, #5bcaff) !important; }
footer.site-footer .legal-links a:hover { text-decoration-thickness: 2px; }
footer.site-footer a:focus-visible {
  outline: 3px solid #0071e3; outline-offset: 2px; border-radius: 4px;
}
html.dark footer.site-footer a:focus-visible { outline-color: #fff; }

@media (max-width: 640px) {
  footer.site-footer { padding: 10px 16px !important; }
  footer.site-footer .legal-links a { padding: 3px 6px; }
}

/* ── LEGAL TRANSLATION NOTICE — non-English terms/privacy/license/dmca only ────────────────
   Injected by i18n_build.py at the top of <main> from the dictionary key <page>.notice. His
   call: AI-translated legal text carries the standard "English version governs" line. Quiet,
   not a banner: it must be read once, not compete with the document. */
.bi-i18n-notice {
  font: 500 12px/1.5 'Poppins', sans-serif;
  margin: 0 0 24px; padding: 10px 14px;
  border-radius: 8px;
  border-inline-start: 3px solid var(--bi-link, #0066cc);
}
html.dark  .bi-i18n-notice { background: rgba(255,255,255,.06); color: rgba(255,255,255,.82); }
html.light .bi-i18n-notice { background: rgba(0,0,0,.04);       color: #3a3a3c; }
