.query-pair {
    --route-ink: #376357;
    --route-wash: #eaf0e7;
    margin: 1rem 0;
    scroll-margin-top: 85px;
}
[data-theme="dark"] .query-pair { --route-ink: #accdbb; --route-wash: #262f27; }
.query-pair > summary { cursor: pointer; font-weight: 600; }
.query-pair fieldset { border: 0; margin: .7rem 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .38rem; }
.query-pair legend, .map-heading, .query-pair details summary { color: var(--text-muted); font: .74rem/1.5 var(--mono-font); }
.query-pair legend { margin-bottom: .3rem; padding: 0; }
.query-pair label { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; padding: .26rem .58rem; border: 1px solid var(--border); border-radius: 3px; font: .79rem/1.5 var(--mono-font); }
.query-pair input { margin: 0; accent-color: var(--route-ink); }
.query-pair label:has(:checked) { color: var(--route-ink); border-color: currentColor; background: var(--route-wash); }
.query-pair label:has(:focus-visible) { outline: 2px solid var(--route-ink); outline-offset: 2px; }
.query-map { display: grid; grid-template-columns: min(48%, 14rem) minmax(30px, .35fr) minmax(0, 1.3fr); grid-template-rows: auto repeat(2, minmax(3.55rem, 1fr)); max-width: 36rem; }
.map-heading { grid-column: 1; grid-row: 1; padding-bottom: .45rem; }
.map-heading.map-right { grid-column: 3; }
.search-term { grid-column: 1; align-self: center; font: .84rem/1.45 var(--mono-font); padding-right: .45rem; }
.search-term.first { grid-row: 2; }
.search-term.second { grid-row: 3; display: grid; align-items: center; }
.search-term.second > span, .map-reading > p { grid-area: 1 / 1; }
.query-lines { grid-column: 2; grid-row: 2 / 4; width: 100%; height: 100%; overflow: visible; }
.query-lines path { stroke: var(--route-ink); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.map-page { min-width: 0; grid-column: 3; align-self: center; padding: .35rem 0 .35rem .7rem; border-left: 2px solid var(--route-ink); }
.map-page strong, .map-page span { display: block; }
.map-page strong { font: 600 .98rem/1.35 var(--display-font); }
.map-page span { color: var(--text-muted); font-size: .81rem; line-height: 1.4; }
.base-page { grid-row: 2; position: relative; top: 50%; }
.second-page { grid-row: 3; }
/* Size the grid for both choices so the disclosure stays put when the route changes. */
.query-pair .split-only, .query-pair:has(input[value="split"]:checked) .shared-only { visibility: hidden; }
.query-pair:has(input[value="split"]:checked) .split-only { visibility: visible; }
.query-pair:has(input[value="split"]:checked) .base-page { top: 0; }
.map-reading { display: grid; align-items: start; margin-top: .7rem; max-width: 61ch; }
.query-pair .map-reading p { margin: 0; font-size: .94rem; line-height: 1.55; }
.query-pair details { margin-top: .6rem; }
.query-pair summary { width: fit-content; cursor: pointer; }
.query-pair details p { margin-top: .35rem; color: var(--text-muted); font-size: .84rem; line-height: 1.5; }
@media (prefers-reduced-motion: no-preference) {
    .query-pair:has(input[value="shared"]:checked) .query-lines .shared-only,
    .query-pair:has(input[value="split"]:checked) .query-lines .split-only { animation: route-in .28s ease-out both; }
    @keyframes route-in { from { opacity: .2; } to { opacity: 1; } }
}
@media (max-width: 440px) {
    .query-map { grid-template-columns: minmax(0, .9fr) 1.65rem minmax(0, 1.15fr); grid-template-rows: auto repeat(2, minmax(4.7rem, 1fr)); }
    .query-pair label { font-size: .72rem; min-height: 36px; }
}
