/* site-repairs.css: single repairs from the assessment of 18 Nov 2026 (ASSESS40, items 2 and 10).
   Loaded on every page after site-improve.css. Sections 1 to 4 make text readable as painted and change no size,
   no position and no word. Section 5 puts the search box of two pages back where every other page has it.
   Section 6 makes the Light/Dark button smaller on phones. Section 7 makes one page follow the site's Light/Dark
   button when the device itself is set to dark. Section 8 makes two kinds of caption in the chapters of the book
   readable in the dark theme. Section 9 does the same for the flag sign in the register of searches, in both themes.
   Section 10 keeps the heading row of a boxed table of that page from covering the table's first row.
   Sections 11 to 15 keep three pages, one row of boxes and one kind of link from pushing the page sideways.
   Section 16 gives the heading row of a free table of the register of searches the room the menu bar takes from it.
   Section 17 lets the link of the home page's line on this day in history wrap on a phone.
   Sections 18 and 19 keep seven pages from reaching past the right edge on phones narrower than 360px.
   Sections 20 to 27 are about the keyboard focus: 20 to 26 make its ring seen where it was not or was too pale,
   and 27 keeps a stop of the Tab key from lying under a bar that stays in the window.
   Sections 28 and 29 give the key of a map the ground it stands on instead of white, in the light theme.
   Section 30 lets a reader on a phone reach the first cards of a row of children on a family page.
   Section 31 adds to section 27: a stop keeps clear of the lower edge of the window too.
   Every rule names the place it repairs. Where a class is used on many pages and is readable on most of them,
   the rule is tied to the page by the address in the page's own <link rel="canonical"> (a folder's first page is named there as /folder/ or
   as /folder/index.html, so both are matched).
   The rules end in :not(#_) and !important, because the rules they correct are spread over dark-mode.css,
   site-improve.css and the pages' own styles, many of them with !important. */

/* ---- 1. Small labels on a colored ground --------------------------------------------------------------------- */
/* St. Louis addresses: "Confirmed", "Very probable" (white or cream on a light green) */
html:has(link[rel="canonical"][href$="/charles_america/st-louis-residences.html"]) .pill.high:not(#_) { background: #3d6b30 !important; color: #fff !important; }
/* master register of searches: "in progress", "partial", "not applicable", and in the dark theme "negative" */
html:has(link[rel="canonical"][href$="/search-coverage-master.html"]) .status-pill.partial:not(#_) { background: #3d6b30 !important; color: #fff !important; }
html:has(link[rel="canonical"][href$="/search-coverage-master.html"]) .status-pill[style*="#888"]:not(#_) { background: #636363 !important; color: #fff !important; }
html.theme-dark:has(link[rel="canonical"][href$="/search-coverage-master.html"]) .status-pill.neg:not(#_) { background: #a83a3a !important; color: #fff !important; }
/* open questions: light theme, two labels that had white letters and no ground */
html:not(.theme-dark):has(link[rel="canonical"][href$="/open-questions.html"]) .oq-pill.resolved:not(#_) { background: #3d6b30 !important; color: #fff !important; }
html:not(.theme-dark):has(link[rel="canonical"][href$="/open-questions.html"]) .oq-pill[style*="--status-working"]:not(#_) { background: #6b5326 !important; color: #fff !important; }
/* open questions: dark theme, cream letters on light orange, blue, brown and olive */
html.theme-dark:has(link[rel="canonical"][href$="/open-questions.html"]) .oq-pill.open:not(#_) { background: #94530f !important; color: #fff !important; }
html.theme-dark:has(link[rel="canonical"][href$="/open-questions.html"]) .oq-pill[style*="--status-confirmed"]:not(#_) { background: #3a5fa6 !important; color: #fff !important; }
html.theme-dark:has(link[rel="canonical"][href$="/open-questions.html"]) .oq-pill.priority:not(#_) { background: #7a5438 !important; color: #fff !important; }
html.theme-dark:has(link[rel="canonical"][href$="/open-questions.html"]) .oq-pill.embargoed:not(#_) { background: #6b5326 !important; color: #fff !important; }
/* white letters on orange, both themes */
html:has(link[rel="canonical"][href$="/immigration/sources-and-name-variants.html"]) td > .badge.open:not(#_),
html :is(h2, .tc-name) > .town-pill.charles:not(#_) { background: #94530f !important; color: #fff !important; }
/* white letters on orange, one theme only */
html:not(.theme-dark):has(link[rel="canonical"][href$="/immigration/bremen-reconstruction.html"]) td > .badge.partial:not(#_),
html.theme-dark:has(link[rel="canonical"][href$="/family_pages/fam-naming.html"]) .meta-row > .badge.open:not(#_),
html.theme-dark:has(link[rel="canonical"]:is([href$="/candidates/"], [href$="/candidates/index.html"])) td > .pill.open:not(#_),
html.theme-dark:has(link[rel="canonical"][href$="/vanished-karls.html"]) td > .pill.open:not(#_),
html.theme-dark:has(link[rel="canonical"][href$="/germany/parish-map.html"]) h3.parish-h > .pill.open:not(#_),
html.theme-dark:has(link[rel="canonical"][href$="/germany/parish-map.html"]) .status-summary .ss-pill.charles:not(#_),
html.theme-dark:has(link[rel="canonical"][href$="/family_pages/fam-quentin.html"]) .badge.open:not(#_) { background: #94530f !important; color: #fff !important; }
html:not(.theme-dark) .rl-card > .verdict.verdict-disputed:not(#_) { background: #a3552b !important; color: #fff !important; }
/* white letters on a light blue */
html:has(link[rel="canonical"][href$="/germany/parish-map.html"]) .status-summary .ss-pill.open:not(#_),
html.theme-dark:has(link[rel="canonical"]:is([href$="/immigration/"], [href$="/immigration/index.html"])) .im-cost-bar-segment.steerage:not(#_) { background: #3a5fa6 !important; color: #fff !important; }
/* dark letters on deep gold become white (light theme) */
html:not(.theme-dark):has(link[rel="canonical"][href$="/family_pages/fam-naming.html"]) :is(.badge.open, .card-pill.open):not(#_),
html:not(.theme-dark):has(link[rel="canonical"][href$="/family_pages/fam-quentin.html"]) .badge.open:not(#_) { color: #fff !important; }
/* white or cream letters on pale gold or cream become dark */
html .pl-status > .vd.vd-charles:not(#_) { color: #1b1408 !important; }
html:not(.theme-dark):has(link[rel="canonical"][href$="/germany/parish-map.html"]) h3.parish-h > .pill.charles:not(#_) { color: #1b1408 !important; }
html.theme-dark:has(link[rel="canonical"][href$="/birthdate-records.html"]) .pill.low[style*="--brand"]:not(#_) { color: #1b1408 !important; }
html.theme-dark:has(link[rel="canonical"][href$="/vanished-karls.html"]) .pill.open2:not(#_),
html.theme-dark .glance > .ttl > .pill.open2:not(#_) { color: #1b1408 !important; }
html:not(.theme-dark):has(link[rel="canonical"][href$="/people/frederick-charles-johnson.html"]) .conf-pill[style="background:#f6ebd2;"]:not(#_) { color: #7a3a08 !important; }
/* a label that had white letters and no ground (light theme) */
html:not(.theme-dark):has(link[rel="canonical"][href$="/children/louise.html"]) span[class="conf-pill"]:not([style]):not(#_) { background: #3d6b30 !important; color: #fff !important; }
/* the boys who vanished from the records, dark theme: the page's own white letters come back in place of the cream of the body text */
html.theme-dark:has(link[rel="canonical"][href$="/vanished-karls.html"]) :is(.pill.elim, .pill.traced, .pill.reopen):not(#_) { color: #fff !important; }

/* ---- 2. Dark theme: boxes that stayed light, with the light letters of the dark theme on them ------------- */
html.theme-dark .callout[style*="background:#e0e6ee"]:not(#_) { background: #1c2a3f !important; border-left-color: #8fb0ea !important; }
html.theme-dark p.study-note:not(#_) { background: #1c2a3f !important; }
html.theme-dark .rl-figure figcaption :is(em, strong):not(#_),
html.theme-dark #charles .ca-img-gallery figure figcaption em:not(#_) { color: #2c2620 !important; }
html.theme-dark #charles .ca-img-gallery figure figcaption a:not(#_) { color: #24497a !important; }
html.theme-dark .vz-section figure > p[style*="--text-muted"]:not(#_) { color: #5a4d3a !important; }

/* ---- 3. Dark theme: dark letters left on a dark ground ----------------------------------------------------- */
html.theme-dark:has(link[rel="canonical"][href$="/charles_america/st-louis-residences.html"]) [style*="color:#a04020"]:not(.small):not(#_) { color: #f0a890 !important; }
html.theme-dark:has(link[rel="canonical"][href$="/charles_america/st-louis-residences.html"]) span[style*="color:#3a6a2a"]:not(#_) { color: #a8d49a !important; }
html.theme-dark #negative-results > p[style*="color:#5a4d3a"]:not(#_) { color: #d9ccb0 !important; }
html.theme-dark .parish-card.eliminated > div[style*="color:#7a5a12"][style*="background:transparent"]:not(#_) { color: #e2c36b !important; }
html.theme-dark table td[style*="color:#3a2f1e"]:not(#_) { color: #e8dfc8 !important; }
html.theme-dark :is([style*="color:#b07d1a"], [style*="color:#a8741a"]):not(#_) { color: #e2b756 !important; }
html.theme-dark .card-grid > .card > h2[style*="color:#4a6a8a"]:not(#_) { color: #a9c1ee !important; }
html.theme-dark .summary-card .label:not(#_) { color: #a9c1ee !important; }
html.theme-dark .im-img-gallery figure figcaption strong:not(#_) { color: #a9c1ee !important; }
html.theme-dark a.full-link:not(#_) { background: linear-gradient(135deg, #2c4a7c, #3a5f9c) !important; }
html.theme-dark a.full-link :is(strong, .fl-sub):not(#_) { color: #fff !important; }
html.theme-dark #charles .dd-group-head .dd-count:not(#_) { color: #e2c36b !important; }
html.theme-dark #civilwar details.mo-history-images > summary:not(#_) { color: #e6c9a8 !important; }
html.theme-dark #source-index .g-ps:not(#_) { color: #e2b756 !important; }
html.theme-dark #source-index .g-op:not(#_) { color: #c9c9c9 !important; }
html.theme-dark #people h4.open-ids-head:not(#_) { color: #e3b089 !important; }
html.theme-dark #people .ppl-map-legend h4:not(#_) { color: #d9c39a !important; }
/* inside folded sections: colors typed into the page, and one heading of the list of changes */
html.theme-dark:has(link[rel="canonical"][href$="/family_pages/fam-grandjot.html"]) :is(p, summary)[style*="color: #5a4828"]:not(#_),
html.theme-dark:has(link[rel="canonical"][href$="/family_pages/fam-grandjot.html"]) summary[style*="color:#5a4828"]:not(#_),
html.theme-dark:has(link[rel="canonical"][href$="/family_pages/fam-herwig.html"]) h5[style*="color: #5a4828"]:not(#_) { color: #d9ccb0 !important; }
html.theme-dark:has(link[rel="canonical"][href$="/family_pages/fam-herwig.html"]) p[style*="color: #2c2620"]:not(#_) { color: #e8dfc8 !important; }
html.theme-dark:has(link[rel="canonical"][href$="/family_pages/fam-quentin.html"]) h3[style="color:#2a4a8a;"]:not(#_) { color: #a9c1ee !important; }
html.theme-dark:has(link[rel="canonical"][href$="/family_pages/fam-quentin.html"]) h3[style="color:#7a5410;"]:not(#_) { color: #e2c36b !important; }
html.theme-dark #site-updates > .month-section > h3:not(#_) { color: #f0d9a0 !important; }
html.theme-dark:has(link[rel="canonical"]:is([href$="/germany/"], [href$="/germany/index.html"])) figure.figure-embed.zoomable > figcaption:not(#_) { color: #e8dfc8 !important; }
html.theme-dark:has(link[rel="canonical"]:is([href$="/germany/"], [href$="/germany/index.html"])) figure.figure-embed.zoomable > figcaption a:not(#_) { color: #e8cd8a !important; }

/* ---- 4. Light theme ------------------------------------------------------------------------------------------ */
/* immigration/koster-letters-pages.html keeps its dark ground in both themes */
html:not(.theme-dark) :is(.kp-text h4, .kp-legend h2):not(#_) { color: #e8dfc8 !important; }
html:not(.theme-dark) .kp-meta a:not(#_) { color: #d8b366 !important; }
/* links drawn as navy buttons kept the navy of a text link */
html:not(.theme-dark) :is(.resource-card, .brv-controls, .embed-controls, .embed-fallback, .puzzle-convergence > p) > a:not(#_) { color: #f0d9a0 !important; }
/* town pages: colored labels */
html:not(.theme-dark) .resource-card .source-label.archion:not(#_), html:not(.theme-dark) .archion-path strong:not(#_) { color: #33569c !important; }
html:not(.theme-dark) .resource-card .source-label.immigration:not(#_) { color: #8a4e10 !important; }
/* gold or gray letters on cream */
html:not(.theme-dark):has(link[rel="canonical"][href$="/germany/konze-pronunciation-research-log.html"]) :is(.ipa, button.ab2):not(#_) { color: #7a5510 !important; }
html:not(.theme-dark) .page-card .text-col .ptype:not(#_) { color: #6f5f43 !important; }
html:not(.theme-dark) table.sr-table .kin-none:not(#_) { color: #7d593c !important; }
html:not(.theme-dark) table.sr-table .kin-aff:not(#_) { color: #7a5a12 !important; }
html:not(.theme-dark) :is([style*="color:#a8741a"], [style*="color:#b07d1a"]):not(#_) { color: #7a5510 !important; }
html:not(.theme-dark) .fs-add:not(#_) { color: #7a5318 !important; }
html:not(.theme-dark) :is(#foundation, #archive, #immigration) > p.small:not([style*="color"]):not(#_),
html:not(.theme-dark) #foundation > p.small > em:not(#_) { color: #6b6152 !important; }
html:not(.theme-dark) .ft-female .ft-pid:not(#_) { color: #7a5a1e !important; }
html:not(.theme-dark) #charles p.mt-tight > a:not(#_) { color: #76500f !important; }
/* a note on a navy ground */
html:not(.theme-dark) .embed-wrap > p.embed-held:not(#_) { color: #f1eadb !important; }

/* ---- 5. search-coverage-master.html and search-coverage.html: their own style docks the search box at the left, over the site name ---- */
@media (min-width: 769px) {
  html:has(link[rel="canonical"]:is([href$="/search-coverage-master.html"], [href$="/search-coverage.html"])) .cknz-q:not(#_) { left: auto !important; right: 1rem !important; top: 0.52rem !important; z-index: 1120 !important; max-width: 250px !important; }
}
@media (min-width: 641px) and (max-width: 768px) {
  html:has(link[rel="canonical"]:is([href$="/search-coverage-master.html"], [href$="/search-coverage.html"])) .cknz-q:not(#_) { left: auto !important; right: 6px !important; top: 3px !important; z-index: 1120 !important; max-width: none !important; }
}

/* ---- 6. phones: the Light/Dark button as a round sign of 44px, so that it covers half as much of the text ---- */
@media (max-width: 768px) {
  html .theme-toggle-fab:not(#_) { width: 44px; height: 44px; padding: 0; gap: 0; justify-content: center; border-radius: 50%; }
  html .theme-toggle-fab .ttf-badge:not(#_) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---- 7. children/helen-fletcher-adoption.html: the page takes its own six colors from the device's dark setting and
   not from the site's Light/Dark button. A reader whose device is set to dark and who chose Light on the site got the
   page's dark ground under the site's dark headings and links. With Light chosen the page's light colors hold. ---- */
@media (prefers-color-scheme: dark) {
  html.theme-light:has(link[rel="canonical"][href$="/children/helen-fletcher-adoption.html"]):not(#_) { --bg: #fbfaf7; --fg: #1d1d1b; --mut: #5d5a54; --rule: #d8d3c8; --acc: #7a3b12; --tab: #f1ede4; }
}

/* ---- 8. The chapters of the book (read/), dark theme: two kinds of caption ---- */
/* A figure with a chart drawn as SVG keeps its paper ground in the dark theme (dark-mode.css gives it #fffdf6, so that
   the chart itself stays readable). site-improve.css gives every caption of a chapter the light brown of the dark theme,
   which cannot be read on that paper (1.9 to 1, the bold title 1.3 to 1). On such a figure the caption gets the colors
   it has in the light theme. The figure is named here exactly as dark-mode.css names it. */
html.theme-dark .bk-wrap figure:is(:has(> img[src*=".svg"]:not([class*="-dark"])), :has(object[type="image/svg+xml"])) > figcaption:not(#_),
html.theme-dark .bk-wrap figure:is(:has(> img[src*=".svg"]:not([class*="-dark"])), :has(object[type="image/svg+xml"])) > figcaption :is(b, strong, em, i):not(#_) { color: #4b3f2e !important; }
html.theme-dark .bk-wrap figure:is(:has(> img[src*=".svg"]:not([class*="-dark"])), :has(object[type="image/svg+xml"])) > figcaption .credit:not(#_),
html.theme-dark .bk-wrap figure:is(:has(> img[src*=".svg"]:not([class*="-dark"])), :has(object[type="image/svg+xml"])) > figcaption .credit :is(b, strong, em, i):not(#_) { color: #6a5a42 !important; }
html.theme-dark .bk-wrap figure:is(:has(> img[src*=".svg"]:not([class*="-dark"])), :has(object[type="image/svg+xml"])) > figcaption a:not(#_) { color: #24497a !important; }
/* "The picture is in the book; it is not shown on the website.": the chapter page's own style gives the line the brown
   of the light theme, also on the dark ground (2 to 1). It gets the color the credit line beside it has in the dark theme. */
html.theme-dark .bk-wrap .fig-offline-note:not(#_) { color: #c8b896 !important; }

/* ---- 9. search-coverage.html: the flag sign before an open lead. The page's own style gives it one brown (#906747)
   in both themes: 4.4 to 1 on the cream of a table row, 2.9 to 1 on the navy of the dark theme. ---- */
html:not(.theme-dark):has(link[rel="canonical"][href$="/search-coverage.html"]) .flag:not(#_) { color: #7a5438 !important; }
html.theme-dark:has(link[rel="canonical"][href$="/search-coverage.html"]) .flag:not(#_) { color: #d8b366 !important; }

/* ---- 10. search-coverage.html: the heading row of a table that scrolls in a box. The page's own style gives the
   heading row `position: sticky; top: 3rem`, so that it stops under the menu bar while the page scrolls. Where the
   table scrolls in a box of its own, the 3rem are counted from the top of that box: the heading row stands 48px
   lower and covers the first lines of the first row. With `top: 0` it stands in its place. There are three such
   boxes: .table-scroll of the menu script, .nr-table-wrap of the page, and, at 720px and under, the table itself
   (theme.css, phone-width clean-up; site-improve.css, 18.2, at 700px). A table that stands free on a wider screen
   keeps the page's 3rem. ---- */
html:has(link[rel="canonical"][href$="/search-coverage.html"]) :is(.table-scroll, .nr-table-wrap) > table.bd thead th:not(#_) { top: 0 !important; }
@media (max-width: 720px) {
  html:has(link[rel="canonical"][href$="/search-coverage.html"]) table.bd thead th:not(#_) { top: 0 !important; }
}

/* ---- 11. germany/konze-pronunciation-research-log.html: the line under a row of sound buttons. The page's own style
   lays the line out as a flex row, so every run of words between two tags becomes a box of its own that cannot
   break; on a phone the boxes reach past the screen (31px at 390px, 61px at 360px). As a plain block the line
   wraps like any sentence. ---- */
html:has(link[rel="canonical"][href$="/germany/konze-pronunciation-research-log.html"]) .audio-intro:not(#_) { display: block !important; }

/* ---- 12. family_pages/fam-other-jewish.html: one FamilySearch link holds a name and, in the same link, a note in
   brackets of more than 200 letters. A link of that kind may not wrap, so with the research log open the page
   slides sideways at every width (387px at 1280px). A link with a note in it may wrap. ---- */
html:has(link[rel="canonical"][href$="/family_pages/fam-other-jewish.html"]) a.fsn:has(em):not(#_) { white-space: normal !important; }

/* ---- 13. names-database.html: the list of towns in the row of filters is as wide as its longest entry (about 890px)
   and pushes the page sideways under about 900px. The list and the box around it are never wider than the row. ---- */
html:has(link[rel="canonical"][href$="/names-database.html"]) .controls > div:not(#_) { max-width: 100% !important; min-width: 0 !important; }
html:has(link[rel="canonical"][href$="/names-database.html"]) .controls select:not(#_) { max-width: 100% !important; }

/* ---- 14. Four pages on the emigration: boxes side by side (.grid-2) are never narrower than 360px by the pages' own
   style, which is wider than the column of a phone of 360px (the page slides by 16px). The least width becomes
   360px or the width of the row, whichever is less; where the row has 360px or more nothing changes. ---- */
html:has(link[rel="canonical"]:is([href$="/immigration/adjacent-emigrations.html"], [href$="/immigration/bremen-reconstruction.html"], [href$="/immigration/koster-letters.html"], [href$="/immigration/sources-and-name-variants.html"])) .grid-2:not(#_) { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)) !important; }

/* ---- 15. A street address that links to a map (a.map-link, theme.css) may not wrap. On a phone a long address is
   wider than its line and pushes the page sideways (civilwar/new-madrid.html at 360px). At 480px and under an
   address may wrap. ---- */
@media (max-width: 480px) {
  html a.map-link:not(#_) { white-space: normal !important; }
}

/* ---- 16. search-coverage.html: the heading row of a table that stands free (not in a box of its own). The page's
   own style stops the row 3rem (48px) under the top of the window, "flush under the nav, no gap". The menu bar is
   52 to 56px high at these widths, so the top 4 to 8px of the row lie under the bar and its words stand against
   the bar's edge. The row gets 0.5rem more room above its words (the page gives 0.55rem), so the part under the bar
   is empty room and there is still no gap. Under 769px the bar is 47 to 49px high and nothing is changed; the
   boxed tables of section 10 are not touched. ---- */
@media (min-width: 769px) {
  html:has(link[rel="canonical"][href$="/search-coverage.html"]) table.bd:not(:is(.table-scroll, .nr-table-wrap) > table) thead th:not(#_) { padding-top: 1.05rem !important; }
}

/* ---- 17. The home page: the line "This day in ..." ends in a link that may not wrap (white-space: nowrap in the
   link's own style attribute). On a phone of 360px, in the web font, the link is wider than what is left of the
   line and pushes the page sideways by 20px. At 480px and under the link may wrap. ---- */
@media (max-width: 480px) {
  html body.home a#otd-link:not(#_) { white-space: normal !important; }
}

/* ---- 18. Phones narrower than 360px (320px is the narrowest in use). Six pages set boxes side by side in a grid
   whose columns are never narrower than 300, 320 or 340px by the pages' own style. That is more than the row has
   on such a phone, so the boxes reach past the right edge by 16 to 36px (at 320px; one of the six only with its
   folds open). Under 360px each of these grids has room for one column only, so it gets one column as wide as
   the row. From 360px up nothing changes. ---- */
@media (max-width: 359px) {
  html:has(link[rel="canonical"][href$="/charles-in-america.html"]) .ca-tile-grid:not(#_),
  html:has(link[rel="canonical"]:is([href$="/civilwar/"], [href$="/civilwar/index.html"])) .cw-tile-grid:not(#_),
  html:has(link[rel="canonical"]:is([href$="/immigration/"], [href$="/immigration/index.html"])) :is(.im-tile-grid, .grid-2):not(#_),
  html:has(link[rel="canonical"][href$="/search-coverage.html"]) .keys:not(#_),
  html:has(link[rel="canonical"]:is([href$="/sources/"], [href$="/sources/index.html"])) .source-list:not(#_),
  html:has(link[rel="canonical"][href$="/family_pages/fam-herwig.html"]) .chart-gallery:not(#_) { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ---- 19. civilwar/compiled_service_record_transcription.html: a web address in a card's list of facts cannot
   break, and at 320px it is 3px wider than the card. Under 360px such an entry may break anywhere. ---- */
@media (max-width: 359px) {
  html:has(link[rel="canonical"][href$="/civilwar/compiled_service_record_transcription.html"]) .page-card dd:not(#_) { overflow-wrap: anywhere !important; }
}

/* ---- 20. Keyboard focus: a link that holds nothing but a picture. Where the picture is set as a block, the
   link is an inline box around a block and Chrome draws no ring for it: with the focus on the link no point of
   the page changes (about 100 such links on 17 pages, measured in pictures). The picture takes the ring its link
   has on that page and in that theme, through a picture element where there is one. Four kinds of figure whose
   link shows its ring already, because the picture stands in the line there (figure.baptism-thumb, figure.pg,
   figure.dfg-view and figure.callout), are left as they are. ---- */
:is(figure:not(.baptism-thumb, .pg, .dfg-view, .callout), .kp-img, .ht-map, .card, .embed-wrap) > a:focus-visible > :is(img, picture):only-child:not(#_),
:is(figure:not(.baptism-thumb, .pg, .dfg-view, .callout), .kp-img, .ht-map, .card, .embed-wrap) > a:focus-visible > picture:only-child > img:not(#_) { outline: inherit !important; outline-offset: inherit !important; box-shadow: inherit !important; }

/* ---- 21. Keyboard focus: a ring that the box around its element cuts off. The heading of a fold, a person in a
   family card and the boxed tables of the register of searches fill a box that lets nothing reach past its edge
   (overflow: hidden or auto), and the ring is drawn 2 to 3px outside the element, so it is cut off on three or
   four sides. Here the ring is drawn 3px inside the element, on the element's own ground. The fold of
   since-printed.html is such a box at 760px and under only. ---- */
:is(details.research-log, details.page-block) > summary:focus-visible:not(#_),
.ft-couple-card a.ft-person:focus-visible:not(#_),
:is(.scm-wrap, .nr-table-wrap) > :is(.table-scroll, table):focus-visible:not(#_) { outline-offset: -3px !important; }
@media (max-width: 760px) {
  html:has(link[rel="canonical"][href$="/since-printed.html"]) details.spx-fold > summary:focus-visible:not(#_) { outline-offset: -3px !important; }
}

/* ---- 22. Keyboard focus: buttons that stand side by side in one rounded frame (the zoom buttons of a record
   picture, the two orders of the walk through St. Louis, the two languages of the German start page). The frame
   cuts the ring off, and the pressed button has the color of the ring as its ground. The ring is drawn 3px
   inside the button in the color of the button's own words, which the page sets against that ground. ---- */
:is(.zoom-group, .brv-zoom-group, .wlk-order) > button:focus-visible:not(#_),
.lang-toggle-fab > a.lt-seg:focus-visible:not(#_) { outline-color: currentColor !important; outline-offset: -3px !important; }

/* ---- 23. Keyboard focus on the pages without the class cine-typography on body (the home page, the reference
   pages of the book and others). cinematic.css draws the ring of the search field inside the field and, in the
   light theme, the ring of the Light/Dark button inside the button, both in bronze on the element's own cream.
   Those rules begin with body.cine-typography, so on these pages the search field shows no ring at all (its own
   style says outline: none), the Light/Dark button shows a gilt ring that is 1.6:1 where the button floats over
   cream, and in the light theme the round search button of a phone shows a navy ring on the navy menu bar. The
   field and the Light/Dark button get the ring cinematic.css gives them elsewhere; the round search button gets
   a ring inside it in the color of its own sign. ---- */
body:not(.cine-typography) .cknz-q input:focus-visible:not(#_) { outline: 2px solid #8a6420 !important; outline-offset: -4px !important; }
html:not(.theme-dark) body:not(.cine-typography) .theme-toggle-fab:focus-visible:not(#_) { outline: 2px solid #8a6420 !important; outline-offset: -5px !important; }
html:not(.theme-dark) body:not(.cine-typography) .cknz-q .cknz-toggle:focus-visible:not(#_) { outline: 2px solid currentColor !important; outline-offset: -4px !important; }

/* ---- 24. Keyboard focus on read/index.html, light theme: the rows of chapters and the round links under them
   stand on cream, and read-index.css gives them the pale gilt ring of the page's dark title band (1.8:1 on
   cream). There the ring is the navy of site-improve.css. The title band and the dark row of pills keep theirs. ---- */
html:not(.theme-dark):has(link[rel="canonical"]:is([href$="/read/"], [href$="/read/index.html"])) :is(.rx-row, .rx-ref) a:focus-visible:not(#_) { outline-color: #1c2a3f !important; }

/* ---- 25. Keyboard focus in the dark theme, on boxes that stay light there: the panel of the two drawings, the
   cream figures and the drawings of visualize.html, the cream figure of a research log (.rl-figure) and the
   cream figures of the picture rows of charles-in-america.html (the two kinds readable.css names for their
   captions). The gilt ring of the dark theme is 1.5:1 on cream. Inside these boxes the ring is the bronze of
   the light theme. ---- */
html.theme-dark:has(link[rel="canonical"][href$="/visualize.html"]) :is(#name-trail .nt-body, .vz-section figure, svg) :focus-visible:not(#_),
html.theme-dark :is(.rl-figure, #charles .ca-img-gallery figure) :focus-visible:not(#_) { outline-color: #8a6420 !important; }

/* ---- 26. Keyboard focus on visualize.html at 600px and under: the drawing of the life line is shown at about a
   third of its size, and the ring of a link in it shrinks with it to a hairline. There the ring is three times
   as wide in the drawing's own measure, about 2px on the screen. ---- */
@media (max-width: 600px) {
  html:has(link[rel="canonical"][href$="/visualize.html"]) .vz-section figure svg a:focus-visible:not(#_) { outline-width: 6px !important; }
}

/* ---- 27. Keyboard focus: a stop under the menu bar. The bar stays at the top of the window, and a reader who
   walks back through a page with Shift and Tab finds links whose ring lies under it; on the walk through
   St. Louis the bar of the two step buttons at the bottom covers stops on the way down too. Every element that
   takes the focus keeps the distance from the top edge that site-improve.css gives a place a link jumps to
   (4.6rem, more where a row of pills stays under the bar), so the window moves until the stop is clear of the
   bar. :where() gives the rule no weight, so a place that has its own distance keeps it. No size and no
   position on the page changes. ---- */
:where(a[href], button, summary, input, select, textarea, [tabindex]) { scroll-margin-top: 4.6rem; }
body:has(nav.stx-pills) :where(a[href], button, summary, input, select, textarea, [tabindex]) { scroll-margin-top: calc(var(--stx-navh, 3.5rem) + 4.4rem); }
body:has(nav.rx-pills) :where(a[href], button, summary, input, select, textarea, [tabindex]) { scroll-margin-top: calc(var(--rx-navh, 3.5rem) + 4.4rem); }
.wlk-main :where(a[href], button, summary, input, select, textarea, [tabindex]) { scroll-margin-bottom: 5rem; }

/* ---- 28. The drawn maps of the book (the pictures map01 to map18), light theme. They are drawn for white paper:
   the key boxes and the edge of the picture are pure white, and on the cream page of the site they stand out as
   white patches. Every point of the picture that is lighter than the ground behind it takes that ground: the
   white of the keys and of the edge becomes the page's own cream, on any page. Nothing in the picture gets
   darker, the picture file is not changed, and on white paper (print) nothing changes. The enlarged view of a
   picture is not touched: there the picture stands alone on a dark stage. The map of the walk through
   St. Louis stands in a frame that stays cream in the dark theme, so there the rule holds in both themes;
   every other picture is dimmed by the dark theme and stays as it is. ---- */
html:not(.theme-dark) figure img:is([src*="/map0"], [src*="/map1"]),
.wlk-map img:is([src*="/map0"], [src*="/map1"]) { mix-blend-mode: darken; }

/* ---- 29. The key boxes of the maps a reader can move (Charles in America, the three St. Louis maps, Civil War,
   Germany, the parish map, Immigration, the pension witnesses), light theme. Their ground is the near white of
   the site's cards (#fffaf0), where it is not see-through. They get the page's own ground (the site's --m-page). The
   dark theme has its own dark keys and stays as it is. ---- */
html:not(.theme-dark) :is(.ca-map-legend, .cw-map-legend, .ge-map-legend, .im-map-legend, .ppl-map-legend, .map-legend, aside.legend-overlay):not(#_) { background: var(--m-page, #f6f1e7) !important; }

/* ---- 30. A row of children on a family page (.ft-children-row) that is wider than its box. The family box
   (.family-tree) centers what it holds, so a row that does not fit runs past the left edge as far as past the
   right, and no scrolling reaches the cards at its left end: on a phone the first child of a row of five is cut
   off or out of sight, and at 768px the first of seven. The box now lays its parts in one column that is as
   wide as the box or, when a row is wider, as wide as that row. What fits stands where it stood. What does not
   fit starts at the left edge and is reached by scrolling the box sideways, as the box already allows. The card
   of the parents stays in view while the row moves under it. A browser that knows scroll-initial-target opens
   the box at its middle, as it looked before; the others open it at its left end. The site sets no
   scroll-snap-type, so nothing snaps. ---- */
.family-tree:not(#_) { display: grid; grid-template-columns: minmax(min-content, 1fr); justify-items: center; }
.family-tree .ft-couple-card:not(#_) { position: sticky; left: 0; right: 0; }
.family-tree > :first-child:not(#_) { scroll-initial-target: nearest; scroll-snap-align: center; }

/* ---- 31. Keyboard focus, two things section 27 left open. First: section 27 keeps a stop clear of the menu bar
   at the top. With that distance a stop that comes into the window from below comes to rest at the window's
   lower edge, where the round Light/Dark button floats; on a phone 3 of 8,207 stops on the way down lay under
   that button, and none did before section 27. Every element that takes the focus now keeps the same distance
   from the lower edge. Second: four kinds of button reset all their styles in their own sheet (all: unset): the
   grade words in the chapters and the close button of their box (grade-key.css), and the two kinds of button
   of read-it-yourself.html (read-it.css). That drops the distance of section 27 too, because :where() has no
   weight, and a grade word could lie under the menu bar on the way up. They get both distances by name. ---- */
:where(a[href], button, summary, input, select, textarea, [tabindex]) { scroll-margin-bottom: 4.6rem; }
:is(button.gk-mark, button.gk-close, .rix-step, .rix-pick):not(#_) { scroll-margin-top: 4.6rem; scroll-margin-bottom: 4.6rem; }
body:has(nav.stx-pills) :is(button.gk-mark, button.gk-close, .rix-step, .rix-pick):not(#_) { scroll-margin-top: calc(var(--stx-navh, 3.5rem) + 4.4rem); }
body:has(nav.rx-pills) :is(button.gk-mark, button.gk-close, .rix-step, .rix-pick):not(#_) { scroll-margin-top: calc(var(--rx-navh, 3.5rem) + 4.4rem); }
