/* Original isolated history explorer; shared library styles remain unchanged. */
body.history-page main{max-width:1280px}
[data-history-explorer]{margin-block:2rem 3rem;min-width:0}
[data-history-explorer] [hidden]{display:none!important}
[data-history-explorer] .history-primer{max-width:72ch}
[data-history-explorer] .history-small{font-size:.9rem;color:var(--muted)}
[data-history-explorer] .history-map-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:20px;align-items:start}
[data-history-explorer] figure{margin:0;min-width:0}
[data-history-explorer] figcaption{font-size:.9rem;margin-block:10px 16px;max-width:75ch}
[data-history-explorer] .history-map-scroll{overflow:auto;max-width:100%;border:1px solid var(--rule);background:var(--surface);border-radius:4px}
[data-history-explorer] .history-map-main{display:block;width:100%;min-width:760px;height:auto}
[data-history-explorer] .history-map-inset{display:block;width:100%;height:auto;border:1px solid var(--rule);background:var(--surface);border-radius:4px}
[data-history-explorer] svg text{font-family:var(--font-body);fill:var(--ink)}
[data-history-explorer] .history-grid{stroke:var(--soft-rule);stroke-width:1;fill:none}
[data-history-explorer] .history-frame{stroke:var(--rule);stroke-width:1.5;fill:none}
[data-history-explorer] .history-grid-label{font-size:20px}
[data-history-explorer] .history-inset-grid-label{font-size:12px}
[data-history-explorer] .history-marker circle{fill:var(--surface);stroke:var(--muted);stroke-width:2}
[data-history-explorer] .history-marker text{font-size:24px;font-weight:700}
[data-history-explorer] .history-marker line{stroke:var(--muted);stroke-width:1.5}
[data-history-explorer] .history-marker.is-related circle{fill:var(--accent);stroke:var(--ink);stroke-width:3}
[data-history-explorer] .history-marker.is-related text{fill:var(--accent)}
[data-history-explorer] .history-marker.is-filtered circle{stroke:var(--ink);stroke-width:5}
[data-history-explorer] .history-inset-marker text{font-size:14px;font-weight:600}
[data-history-explorer] .history-inset-marker circle{r:4}
[data-history-explorer] .history-inset-region{stroke:var(--muted);stroke-width:1.5;stroke-dasharray:5 4;fill:none}
[data-history-explorer] .history-place-controls{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:0;list-style:none}
[data-history-explorer] button,[data-history-explorer] select{font:inherit;min-height:44px;max-width:100%}
[data-history-explorer] button{cursor:pointer;text-align:left;padding:10px 12px;border:1px solid var(--rule);border-radius:4px;background:var(--field);color:var(--ink)}
[data-history-explorer] button:hover{border-color:var(--accent)}
[data-history-explorer] button[aria-pressed=true]{border:2px solid var(--accent);padding:9px 11px;background:var(--quote)}
[data-history-explorer] :focus-visible{outline:3px solid var(--focus);outline-offset:4px}
[data-history-explorer] .history-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
[data-history-explorer] .history-row label{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
[data-history-explorer] select{padding:8px;background:var(--field);color:var(--ink);border:1px solid var(--rule);border-radius:4px}
[data-history-explorer] fieldset{border:1px solid var(--soft-rule);padding:12px 16px;min-width:0}
[data-history-explorer] fieldset label{display:inline-flex;align-items:center;gap:8px;min-height:44px;margin-right:16px}
[data-history-explorer] input[type=checkbox]{width:20px;height:20px;accent-color:var(--accent)}
[data-history-explorer] details{margin-block:14px}
[data-history-explorer] summary{cursor:pointer;padding-block:10px;min-height:44px}
[data-history-explorer] .history-timeline{list-style:none;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
[data-history-explorer] .history-timeline>li{min-width:0;padding:22px;border:1px solid var(--soft-rule);border-radius:4px;background:var(--surface)}
[data-history-explorer] .history-timeline>li.is-selected{border-color:var(--accent);box-shadow:inset 4px 0 var(--accent)}
[data-history-explorer] .history-date{font-size:.9rem;color:var(--muted);margin-top:0}
[data-history-explorer] .history-timeline h3{margin-top:0}
[data-history-explorer] .history-source-list{padding-left:22px}
[data-history-explorer] .history-provenance-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}
[data-history-explorer] .history-provenance-list details{min-width:0;border-bottom:1px solid var(--soft-rule)}
[data-history-explorer] .history-provenance-list p{font-size:.9rem}
@media(max-width:1050px){[data-history-explorer] .history-map-layout{grid-template-columns:minmax(0,1fr)}[data-history-explorer] .history-inset-figure{max-width:320px}}
@media(max-width:700px){body.history-page main{padding-inline:20px}[data-history-explorer] .history-place-controls{grid-template-columns:repeat(2,minmax(0,1fr))}[data-history-explorer] .history-timeline,[data-history-explorer] .history-provenance-list{grid-template-columns:minmax(0,1fr)}[data-history-explorer] .history-timeline>li{padding:18px}}

/* A schematic line: uniform spacing never encodes elapsed time. */
[data-history-explorer] .history-line{list-style:none;padding:0 8px 8px;margin:30px 0 20px;display:grid;grid-template-columns:repeat(var(--history-count,7),minmax(132px,1fr));gap:0;align-items:start;max-width:100%;box-sizing:border-box;overflow-x:auto}
[data-history-explorer] .history-line>li{min-width:0;position:relative;padding:28px 4px 0;margin:0}
[data-history-explorer] .history-line>li::before{content:'';position:absolute;top:10px;left:0;right:0;border-top:2px solid var(--muted)}
[data-history-explorer] .history-line>li::after{content:'';position:absolute;top:3px;left:calc(50% - 8px);width:14px;height:14px;background:var(--surface);border:2px solid var(--muted);border-radius:50%}
[data-history-explorer] .history-line>li.is-selected::after{background:var(--accent);border-color:var(--ink)}
[data-history-explorer] .history-line>li>button{width:100%;padding:10px 8px;text-align:left;overflow-wrap:anywhere;min-height:150px}
[data-history-explorer] .history-line>li.is-selected>button{border:2px solid var(--accent);padding:9px 7px;background:var(--quote)}
[data-history-explorer] .history-line>li.is-place-related>button{outline:2px dashed var(--muted);outline-offset:-6px}
[data-history-explorer] .history-line>li>button:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
[data-history-explorer] .history-line span{display:block}
[data-history-explorer] .history-era,[data-history-explorer] .history-node-kind{font-size:.75rem;color:var(--muted);line-height:1.4}
[data-history-explorer] .history-node-date{font-weight:700;font-size:1rem;margin:6px 0}
[data-history-explorer] .history-node-title{font-size:.95rem;line-height:1.4;margin-bottom:10px}
[data-history-explorer] .history-selected-details{min-width:0;scroll-margin-top:20px}
[data-history-explorer] .history-selected-details .history-timeline{display:block;margin:0}
[data-history-explorer] .history-selected-details .history-timeline>li{padding:24px;border:1px solid var(--accent);box-shadow:inset 4px 0 var(--accent);background:var(--surface)}
[data-history-explorer] .history-detail-links{display:flex;gap:12px 24px;flex-wrap:wrap;font-size:.9rem}
[data-history-explorer] #history-companion-map{margin-top:40px;scroll-margin-top:20px}
@media(max-width:700px){
 [data-history-explorer] .history-line{display:block;margin-top:20px;padding:0;overflow:visible}
 [data-history-explorer] .history-line>li{padding:0 0 22px 30px}
 [data-history-explorer] .history-line>li::before{top:0;bottom:0;left:7px;right:auto;border-top:0;border-left:2px solid var(--muted)}
 [data-history-explorer] .history-line>li::after{top:22px;left:0}
 [data-history-explorer] .history-line>li>button{min-height:44px;padding:12px 16px}
 [data-history-explorer] .history-line>li.is-selected>button{padding:11px 15px}
 [data-history-explorer] .history-selected-details{margin-top:12px}
 [data-history-explorer] .history-selected-details .history-timeline>li{padding:16px}
 [data-history-explorer] .history-node-kind{margin-bottom:0}
}
@media(prefers-reduced-motion:reduce){[data-history-explorer],[data-history-explorer] *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

/* Church-context labels: text and border/symbol patterns never rely on colour alone. */
[data-history-explorer] .history-context-badge{display:inline-block;max-width:100%;box-sizing:border-box;border:1px solid var(--muted);padding:4px 6px;font-size:.78rem;line-height:1.4;color:var(--ink);background:var(--surface);overflow-wrap:anywhere}
[data-history-explorer] .history-context-badge[data-context-group=shared]{border-style:solid}
[data-history-explorer] .history-context-badge[data-context-group=eastern-orthodox]{border-style:double;border-width:3px;padding:2px 4px}
[data-history-explorer] .history-context-badge[data-context-group=roman-catholic]{border-style:dashed}
[data-history-explorer] .history-context-badge[data-context-group=wider]{border-style:dotted;border-width:2px;padding:3px 5px}
[data-history-explorer] .history-line .history-context-symbol{display:inline;font-size:1rem;font-weight:700}
[data-history-explorer] .history-node-context{margin:8px 0 4px}
[data-history-explorer] .history-node-type{font-size:.74rem;line-height:1.4;color:var(--muted)}
[data-history-explorer] .history-context-meta{font-size:.88rem;line-height:1.65}
[data-history-explorer] .history-context-meta .history-context-badge{margin-bottom:8px}
[data-history-explorer] #history-context-controls{margin-top:20px}
[data-history-explorer] #history-context-controls label{display:block;font-weight:600;margin-bottom:6px}
[data-history-explorer] #history-context-comparison{margin:24px 0}
[data-history-explorer] .history-context-lanes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;align-items:start}
[data-history-explorer] .history-context-lane{min-width:0;padding:12px;border:1px solid var(--rule);background:var(--surface)}
[data-history-explorer] .history-context-lane h4{margin:0;font-size:1rem;line-height:1.5}
[data-history-explorer] .history-context-lane ol{list-style:none;margin:0;padding:0;display:grid;gap:8px}
[data-history-explorer] .history-context-lane button{width:100%;font-size:.85rem;line-height:1.5;overflow-wrap:anywhere}
[data-history-explorer] .history-context-lane button[aria-current=step]{border:2px solid var(--accent);background:var(--quote)}
[data-history-explorer] .history-line>li.is-context-highlight>button{box-shadow:inset 0 -5px var(--ink)}
@media(max-width:1050px){[data-history-explorer] .history-context-lanes{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){[data-history-explorer] .history-context-lanes{grid-template-columns:minmax(0,1fr)}[data-history-explorer] .history-context-badge{font-size:.8rem}}

/* Longer context labels retain readable words in contained desktop date cards. */
[data-history-explorer] .history-line{grid-template-columns:repeat(var(--history-count,7),minmax(164px,1fr))}

/* Geographic atlas: parchment and ink keep fixed contrast in either site theme. */
[data-history-explorer] .history-map-main{min-width:900px}
[data-history-explorer] .history-map-layout{grid-template-columns:minmax(0,1fr)}
[data-history-explorer] .history-map-inset{max-width:640px}
[data-history-explorer] .history-inset-figure{max-width:480px}
[data-history-explorer] svg .history-inset-marker text{font-size:28px}
[data-history-explorer] svg .history-marker text{font:600 21px Georgia,serif;fill:#35382f}
[data-history-explorer] svg .history-inset-marker text{font-size:28px}.history-marker circle{fill:#f9f0dc;stroke:#4b4d3e}
[data-history-explorer] svg .history-marker line{stroke:#565b49}
[data-history-explorer] svg .history-marker.is-related circle{fill:#9d583c;stroke:#3a362e}
[data-history-explorer] svg .history-marker.is-related text{fill:#783b29}
[data-history-explorer] svg .history-marker.is-filtered circle{stroke:#382e25;stroke-width:5}
[data-history-explorer] svg .history-inset-marker circle{r:5}
@media(max-width:1200px){[data-history-explorer] .history-map-layout{grid-template-columns:minmax(0,1fr)}[data-history-explorer] .history-inset-figure{max-width:480px}}
@media(max-width:700px){[data-history-explorer] .history-inset-figure{max-width:100%}}

[data-history-explorer] svg text{fill:#35382f;font-family:Georgia,serif}
[data-history-explorer] svg .history-marker.is-related text{fill:#783b29}

/* Formatting pass: compact journey controls, integrated detail and a nearby map. */
body.history-page main>header{padding-block:24px 12px;margin-bottom:0}
body.history-page main>header h1{font-size:clamp(2rem,5vw,3rem);margin-block:8px}
body.history-page main>header .intro{margin-block:8px}
[data-history-explorer]{margin-top:12px}
[data-history-explorer] .history-primer{max-width:none}
[data-history-explorer] .history-primer h2{max-width:none;font-size:clamp(1.35rem,3vw,1.8rem);margin-block:0 10px}
[data-history-explorer] .history-primer p{margin-block:6px 14px;max-width:75ch}
[data-history-explorer] #history-timeline-heading{font-size:1rem;margin-block:12px 4px}
[data-history-explorer] .history-scale-brief,[data-history-explorer] .history-scroll-hint{margin-block:4px;font-size:.875rem}
[data-history-explorer] .history-navigation{display:flex;flex-wrap:wrap;gap:8px;align-items:end;margin-block:12px}
[data-history-explorer] .history-navigation label{display:grid;gap:4px;flex:1 1 180px;max-width:340px}
[data-history-explorer] .history-navigation button{flex:0 1 auto;white-space:normal}
[data-history-explorer] .history-options{display:flex;flex-wrap:wrap;align-items:start;gap:8px 20px}
[data-history-explorer] .history-options>details{flex:1 1 240px;margin:0;padding:8px 12px}
[data-history-explorer] #history-context-controls{flex:1 1 240px;margin:0}
[data-history-explorer] #history-context-controls label{font-size:.9rem;margin:0 0 4px}
[data-history-explorer] #history-context-controls select{width:100%}
[data-history-explorer] #history-context-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
[data-history-explorer] #history-status{font-size:.9rem;line-height:1.5;margin-block:8px}
[data-history-explorer] #history-optional-layers fieldset{padding:4px 0;margin:0;border:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
[data-history-explorer] #history-optional-layers label{display:flex;align-items:center;min-height:44px;margin:0;padding:4px;line-height:1.4;font-size:.95rem}
[data-history-explorer] #history-optional-layers input{flex:0 0 20px;margin:0}
[data-history-explorer] .history-line{margin-block:12px;grid-template-columns:repeat(var(--history-count,7),minmax(210px,1fr))}
[data-history-explorer] .history-line>li>button{min-height:150px;padding:12px}
[data-history-explorer] .history-line>li.is-selected>button{padding:11px}
[data-history-explorer] .history-node-date{margin:0 0 8px}
[data-history-explorer] .history-node-title{font-size:1rem;line-height:1.45;margin-bottom:8px}
[data-history-explorer] .history-node-context{font-size:.875rem;margin:0}
[data-history-explorer] .history-selected-details .history-timeline>li{padding:18px}
[data-history-explorer] .history-selected-details details{padding:10px 12px;margin-block:12px}
[data-history-explorer] .history-selected-details h4{font-size:1rem;margin-block:14px 6px}
[data-history-explorer] .history-selected-details p{margin-block:8px 14px;max-width:75ch}
[data-history-explorer] .history-source-list{padding-left:20px;margin-block:6px 12px}
[data-history-explorer] .history-source-list li{margin-block:8px;line-height:1.6}
[data-history-explorer] .history-full-metadata{font-size:.9rem;color:var(--muted)}
[data-history-explorer] #history-map-disclosure{padding:10px 14px}
[data-history-explorer] #history-companion-map{margin:0;border:0;scroll-margin-top:12px}
[data-history-explorer] #history-map-heading{margin-top:8px}
[data-history-explorer] #history-place-controls .history-row{gap:8px}
[data-history-explorer] #history-place-controls label{display:grid;gap:4px;flex:1 1 200px}
[data-history-explorer] #history-place-controls label select{width:100%}
[data-history-explorer] .history-map-view-tools label{display:grid;gap:4px;max-width:340px}
[data-history-explorer] [data-map-view=overview] .history-map-main{min-width:0;width:100%}
[data-history-explorer] [data-map-view=detail] .history-map-main{min-width:900px}
[data-history-explorer] .history-inset-disclosure{max-width:640px}
[data-history-explorer] .history-context-lanes{display:block}
[data-history-explorer] .history-context-lane{padding:8px 12px;margin-block:8px}
[data-history-explorer] .history-context-lane summary{font-weight:600}
[data-history-explorer] .history-context-lane ol{gap:4px}
[data-history-explorer] .history-context-lane button{font-size:.95rem;padding:8px 10px}
[data-history-explorer] .history-comparison-count{font-weight:400;font-size:.9rem}
[data-history-explorer] .history-comparison-filter{display:grid;gap:4px;max-width:360px}
@media(max-width:700px){
 body.history-page main>header{padding-block:16px 8px}
 [data-history-explorer] .history-options{display:block}
 [data-history-explorer] .history-options>details{margin-bottom:8px}
 [data-history-explorer] #history-optional-layers fieldset{grid-template-columns:minmax(0,1fr)}
 [data-history-explorer] .history-line{display:block;padding:0}
 [data-history-explorer] .history-line>li{padding-left:24px}
 [data-history-explorer] .history-line>li>button{min-height:44px}
 [data-history-explorer] .history-line>li.is-selected>button{border-bottom:0;border-radius:4px 4px 0 0;padding-bottom:8px}
 [data-history-explorer] .history-line>li.is-selected .history-selected-details{margin-top:0}
 [data-history-explorer] .history-selected-details .history-timeline>li{border-top:0;border-radius:0 0 4px 4px;padding:0 12px 12px;box-shadow:none}
 [data-history-explorer] .history-selected-details .history-date,[data-history-explorer] .history-selected-details .history-context-meta{display:none}
 [data-history-explorer] #history-selected-events>li>h3{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 [data-history-explorer] .history-selected-details details{padding:8px;margin-block:10px}
 [data-history-explorer] .history-selected-details #history-map-disclosure{padding:8px}
 [data-history-explorer] .history-navigation{align-items:center}
 [data-history-explorer] .history-navigation label{flex-basis:100%;max-width:none}
 [data-history-explorer] .history-detail-links{font-size:1rem;gap:8px 16px}
 [data-history-explorer] .history-place-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Remove inherited generic article spacing from the journey's control area. */
body.history-page main>header .eyebrow{margin:0 0 6px}
body.history-page main>header .intro{display:none}
[data-history-explorer]{padding-block:8px}
[data-history-explorer]>section[aria-labelledby=history-timeline-heading]{padding-block:0;border:0}
[data-history-explorer] #history-timeline-heading{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
[data-history-explorer] #history-controls{margin-block:8px}
[data-history-explorer] .history-navigation select{margin:0}
[data-history-explorer] .history-navigation button{margin:0}
[data-history-explorer] .history-options>details{flex:0 1 440px}
[data-history-explorer] #history-optional-layers #history-context-controls{margin-top:8px}
[data-history-explorer] .history-selected-details #history-selected-events>li{margin:0}
@media(max-width:700px){
 [data-history-explorer] .history-scroll-hint{display:none}
 [data-history-explorer] .history-primer p{font-size:.95rem;line-height:1.6}
 [data-history-explorer] .history-navigation{gap:8px;margin-block:8px}
 [data-history-explorer] .history-options>details{padding:4px 10px;margin:0}
 [data-history-explorer] .history-options>details>summary{padding-block:4px;min-height:44px;box-sizing:border-box}
}

[data-history-explorer] .history-line>li>button{display:block}

@media(max-width:700px){[data-history-explorer] .history-selected-details #history-selected-events>li{padding-top:1px}}
