:is(.home, .directory) .welcome-search {
    background: #fffdf7;
    border: 1px solid var(--line);
    border-top: 3px solid var(--green);
    padding: clamp(.85rem, 2vw, 1.35rem);
}
:is(.home, .directory) .welcome-search h2 { margin: 0 0 .7rem; font-size: 1.65rem; }
:is(.home, .directory) #searchform {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr);
    align-items: center;
    gap: .5rem .65rem;
    font-size: .88rem;
}
:is(.home, .directory) #searchform label[for="q_name"] { grid-column: 1; }
:is(.home, .directory) #q_name { grid-column: 2 / -1; }
:is(.home, .directory) #searchform label[for="q_variants"] { grid-column: 1 / -1; }
:is(.home, .directory) #searchform input[type="search"], :is(.home, .directory) #searchform button {
    font: inherit;
    min-width: 0;
    min-height: 2.6rem;
    border: 1px solid var(--green);
    padding: .4rem .65rem;
    background: #fffef9;
    color: var(--green);
}
:is(.home, .directory) #searchform button { grid-column: span 2; cursor: pointer; }
:is(.home, .directory) #searchform button[type="submit"] { background: var(--green); color: white; }
:is(.home, .directory) .welcome-search :is(#found, #search-status):empty { display: none; }
.hero > * { min-width: 0; }
.archive-lookup { border-top: 1px solid var(--line); padding: 1.4rem 0 1.8rem; }
.source-reading { max-width: none; }
.source-reading table { font-size: .94em; overflow-wrap: normal; }
.source-reading [id]:target { background: #f1e4c5; outline: 2px solid #805019; }
.source-scroll { overflow-x: auto; }
.source-scroll:focus-visible { outline: 2px solid #805019; outline-offset: 3px; }
.source-scroll table { display: table; min-width: 21rem; }
.source-scroll :is(td, th):first-child { min-width: 3rem; }
.source-scroll :is(td, th):nth-child(2) { min-width: 5.25rem; }
.source-scroll td:last-child { overflow-wrap: anywhere; }
.source-scroll li { margin: .3em 0; }
.source-scroll ol { padding-inline-start: 1.35em; }

:is(.home, .directory) #found {
    display: grid;
    gap: .65rem;
    list-style: none;
    margin: .8rem 0 0;
    padding: 0;
}
:is(.home, .directory) #found .person-result {
    display: grid;
    gap: .3rem;
    margin: 0;
    padding: .75rem .85rem;
    border: 1px solid var(--line);
    background: var(--paper, #fffef9);
    overflow-wrap: anywhere;
}
:is(.home, .directory) #found .result-name {
    justify-self: start;
    font: 600 1.15rem/1.25 var(--serif);
    text-underline-offset: .18em;
}
:is(.home, .directory) #found .result-dates {
    display: block;
    font-size: .85rem;
    color: var(--ink);
}
:is(.home, .directory) #found .result-match {
    justify-self: start;
    padding: .15rem .45rem;
    color: var(--green);
    background: #ebefe5;
    font-size: .75rem;
}
:is(.home, .directory) #search-status {
    margin: .9rem 0 .3rem;
    font-weight: 600;
    scroll-margin-block: 1rem;
}
:is(.home, .directory) #found .result-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    margin: .2rem 0 0;
}
:is(.home, .directory) #found .result-pagination button {
    min-height: 44px;
    padding: .35rem .8rem;
    font: inherit;
    color: var(--green);
    background: #fffef9;
    border: 1px solid var(--green);
    cursor: pointer;
}
:is(.home, .directory) #found .result-pagination button:hover { background: #ebefe5; }
:is(.home, .directory) .welcome-search :focus-visible,
:is(.home, .directory) #search-status:focus {
    outline: 2px solid #805019;
    outline-offset: 3px;
}
@media (max-width: 400px) {
    :is(.home, .directory) #searchform { grid-template-columns: max-content minmax(0, 1fr); }
    :is(.home, .directory) #searchform button { grid-column: 1 / -1; }
}

.home .hero:has(#found .person-result) > figure { align-self: start; }

.directory-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    gap: 1rem;
}

.directory-shortcuts, .list-alphabet, .list-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
.directory-shortcuts {
    margin-block: 1rem;
    gap: .5rem .85rem;
}
.directory-shortcuts a {
    padding: .4rem .6rem;
    border: 1px solid var(--line);
    background: #fffdf7;
}
.list-alphabet a, .list-filter :is(input, button) {
    border: 1px solid var(--green);
    background: #fffdf7;
    color: var(--green);
    font: inherit;
    padding: .55rem .75rem;
    min-height: 44px;
}
.list-alphabet a { min-width: 44px; text-align: center; }
.list-filter input { max-width: 100%; }
.list-filter button { cursor: pointer; }
.directory-results { padding: 0; list-style: none; }
.directory-results > li { min-width: 0; padding: 1rem; border: 1px solid var(--line); background: #fffdf7; overflow-wrap: anywhere; }
.directory-results .result-name { font-weight: 700; }
.directory :target, .reading :target { scroll-margin-block-start: 5rem; }
.directory .list-entry:target, .reading :target { background-color: #f1e4c5; }

.directory-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(.55rem, 2vw, 1rem);
    margin-block: .3rem 2.5rem;
}
.directory-cards .card {
    border-top: 3px solid var(--green);
    color: var(--green);
}
.directory-cards .card-text { grid-auto-rows: min-content; align-content: start; }
.directory-cards strong { font: 500 clamp(1.08rem, 2.2vw, 1.6rem)/1.15 var(--serif); margin: 0; }
.directory-cards small { font: .88rem/1.45 var(--sans); letter-spacing: 0; text-transform: none; }
.directory-cards .card:last-child { grid-column: 1 / -1; }
@media (max-width: 36rem) {
    .directory-cards { grid-template-columns: 1fr; }
}
.directory :is(h1, h2, h3), .reading .ofb-compact { font-family: var(--sans); }
.directory h1 { font-size: clamp(1.75rem, 5vw, 3.5rem); }
.directory-search { max-width: 52rem; margin-block: 1.25rem; }
.directory-search summary { cursor: pointer; color: var(--green); font-weight: 650; }
.directory-search .welcome-search { margin-top: .65rem; }
.directory-search #person-search-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.directory-tools {
    border-block: 1px solid var(--line);
    background: #eeeee4;
    padding: clamp(.65rem, 2vw, 1.25rem);
}
.list-filter label { font-weight: 650; }
.list-filter input { flex: 1 1 12rem; min-width: 0; max-width: 28rem; }
.list-alphabet { margin-top: 1rem; }
.list-alphabet a { display: grid; place-items: center; padding: .2rem; font-weight: 650; text-decoration: none; }
.list-alphabet a:hover { background: var(--green); color: white; }
.list-alphabet .letter-unavailable {
    display: grid;
    place-items: center;
    min-inline-size: 44px;
    min-block-size: 44px;
    border: 1px solid var(--line);
    color: var(--quiet);
}
#list-status:empty { display: none; }
.directory .letter-section {
    margin-top: 1.4rem;
    border: 1px solid var(--line);
    background: #fffdf7;
}
.directory .letter-heading {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .3rem .75rem;
    background: #e5eadf;
    border-bottom: 1px solid var(--line);
}
.directory .letter-heading h2 {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: normal;
}
.directory .back-top {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    font: .78rem var(--sans);
}
.directory-register {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 1px;
    margin: 0;
    padding: 0;
    background: var(--line);
    list-style: none;
}
.directory-register .list-entry { min-width: 0; background: #fffdf7; }
.directory-register .list-entry[hidden] { display: none; }
.directory-register a {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: .15rem .6rem;
    padding: .55rem .7rem;
    min-height: 44px;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.directory-register a:hover { background: #eef0e6; }
.directory-register a:hover span { text-decoration: underline; }
.directory-register small { color: var(--green); background: #e5eadf; padding-inline: .35rem; }
.directory-totals { display: inline-block; margin: 0; padding: .5rem .8rem; background: #e5eadf; }
.directory-results .person-events { margin-top: .55rem; padding-inline-start: 1.25rem; }
@media (max-width: 420px) {
    .directory .list-alphabet { gap: .38rem; }
    .list-filter label { flex-basis: 100%; }
    .list-filter input { flex-basis: 8rem; }
}

.ofb-table-scroll { max-inline-size: 100%; overflow-x: auto; }
.reading .ofb-compact {
    display: table;
    inline-size: 100%;
    min-inline-size: 19rem;
    max-inline-size: none;
    overflow: visible;
    overflow-wrap: normal;
}
.ofb-compact :is(th, td):first-child { min-inline-size: 7rem; }
.ofb-compact :is(th, td):last-child { white-space: nowrap; }
@media (max-width: 36rem) {
    .reading-head:has(+ .reading .ofb-compact) h1 {
        font-size: clamp(1.85rem, 8vw, 2.5rem);
        hyphens: auto;
    }
    .reading .ofb-compact :is(th, td) { padding: .45rem .35rem; }
}

.directory-results :is(pre, table) { max-width: 100%; }
.directory-results pre { white-space: pre-wrap; }
.directory-results table { display: block; overflow-x: auto; }
@media (max-width: 420px) {
    .directory-results .genea-event-tooltip { max-width: min(12rem, 65vw); }
}

.detail .reading-head:has(+ .reading .source-table-scroll) {
    padding-block: .6rem 1rem;
}
.detail .reading-head:has(+ .reading .source-table-scroll) h1 {
    max-width: 40ch;
    font-size: clamp(1.65rem, 4.2vw, 3rem);
    letter-spacing: -.025em;
    hyphens: auto;
}
.reading:has(.source-table-scroll) {
    max-width: none;
    padding-top: .5rem;
}
.reading .book-details, .reading .source-intro {
    max-width: 77ch;
}
.reading .book-details {
    margin-block: 0 1.15rem;
    padding: .65rem 1rem;
    border-inline-start: 2px solid #8a9885;
    background: #eeeee4;
    line-height: 1.4;
}
.book-details p { margin: .2em 0; }
.book-details .book-title { font-weight: 700; }

.source-table-scroll {
    max-inline-size: 100%;
    margin-block: .8rem 1.25rem;
    overflow-x: auto;
}
.source-table-scroll:focus-visible, .ofb-table-scroll:focus-visible {
    outline: 2px solid #805019;
    outline-offset: 3px;
}
.reading .source-table-scroll table {
    display: table;
    max-width: none;
    overflow: visible;
    font-size: .94em;
    line-height: 1.45;
    overflow-wrap: normal;
}
.source-table-scroll .historical-source-table { min-inline-size: 29rem; }
.source-table-scroll .marriage-register { min-inline-size: 40rem; }
.source-table-scroll :is(th, td) {
    padding: .4em .55em;
    vertical-align: top;
    hyphens: none;
}
.source-table-scroll th {
    color: var(--green);
    background: #e5eadf;
    text-align: start;
}
.source-table-scroll :is(th, td):first-child { min-inline-size: 7rem; }
.source-table-scroll .muster-roll :is(th, td):first-child { min-inline-size: 12rem; }
.source-table-scroll .right,
.source-table-scroll .marriage-register :is(th, td):nth-child(2),
.source-table-scroll .short-value {
    white-space: nowrap;
}
.source-table-scroll .right {
    text-align: end;
    font-variant-numeric: tabular-nums;
}
.reading .editorial-notes {
    margin-block-start: 1.65rem;
    border-block-start: 1px solid var(--line);
}
.reading .editorial-notes h2 { font-size: 1.2em; }
