/* One map treatment for full atlas and profile maps; branch and route colors retain their meaning. */
.newdesign #family-atlas :is(.fa-result strong,.fa-result span,.fa-result small,.fa-card strong,#fa-reader strong,.fa-panel summary){color:#111!important}
body.newdesign{--fa-ink:#111;--fa-paper:#fff;--fa-accent:#111;--pg-green:#111;--pg-pink:#f1b9c3;--pg-paper:#fff}
.newdesign #family-atlas{padding:20px var(--nd-gutter) 12px!important;max-width:none;color:#111;background:#fff;}
.newdesign #family-atlas .fa-title h1{color:#111!important}
.newdesign #family-atlas .fa-title h1 span,.newdesign #fa-person-name{color:#111!important}
.newdesign #family-atlas .fa-panel-head{display:flex;align-items:center;gap:8px;flex-wrap:nowrap!important}.newdesign #family-atlas .fa-panel-head h2{min-width:0;flex:1;overflow-wrap:anywhere}.newdesign #family-atlas #fa-collapse{flex-shrink:0;padding:8px!important;white-space:nowrap}
.newdesign #family-atlas .fa-card{overflow-wrap:anywhere}
.newdesign #family-atlas :is(.fa-panel,.fa-card,.fa-navigation-fast .fa-map-tools,#fa-reader,#ah-panel,#an-panel,#ae-panel){background:#fff!important;color:#111!important;border:1px solid #111!important;border-radius:0!important;box-shadow:0 5px 20px #0002}
.newdesign #family-atlas :is(.fa-panel-head,.fa-reader-heading){background:#a6cde0!important;color:#111!important;border-radius:0!important}
.newdesign #family-atlas :is(button,.fa-focus-actions button,.fa-navigation-fast button),.newdesign .dd-profile-map button{background:#fff!important;color:#111!important;border:1px solid #777!important;border-radius:0!important;min-height:44px;box-shadow:none!important}
.newdesign #family-atlas button:hover,.newdesign .dd-profile-map button:hover{background:#f5efe4!important;border-color:#111!important}
.newdesign #family-atlas :is(button[aria-pressed=true],button[aria-expanded=true],#fa-find-person),.newdesign .dd-profile-map button[aria-pressed=true]{background:#111!important;color:#fff!important;border-color:#111!important}
.newdesign #family-atlas #fa-voyages-toggle[aria-pressed=true]{background:#fac300!important;color:#111!important}
.newdesign #family-atlas :is(input,select){background:#fff!important;color:#111!important;border:1px solid #777!important;border-radius:0!important;min-height:46px;}
.newdesign #family-atlas :is(.fa-results-head,.fa-reader-top,#fa-reader-tabs){background:#f5efe4!important;color:#111!important;border-radius:0!important}
.newdesign #family-atlas :is(.fa-panel a,.fa-card a,#fa-reader a,.fa-footnote,.fa-caption){color:#111!important}
.newdesign #family-atlas :is(.fa-stage,#fa-map){border-radius:0!important}
.newdesign #family-atlas .fa-stage{height:calc(100dvh - 255px)!important;min-height:420px!important;border:1px solid #aaa}
.newdesign .dd-places-map-wrap{border-radius:0!important;border:1px solid #aaa;isolation:isolate}
.newdesign .dd-places-heading h2{color:#111!important}.newdesign .dd-places-records>summary{color:#111!important;}.newdesign .dd-places-list{background:#fff!important;color:#111!important}
.newdesign :is(#family-atlas,.dd-profile-map) .leaflet-container{background:#e7eef0}
.newdesign :is(#family-atlas,.dd-profile-map) .leaflet-popup-content-wrapper{background:#fff;color:#111;border-radius:0;border:1px solid #111;box-shadow:0 4px 16px #0002}
.newdesign :is(#family-atlas,.dd-profile-map) .leaflet-popup-content{margin:18px 22px}
.newdesign :is(#family-atlas,.dd-profile-map) .leaflet-popup-content a{color:#111;text-decoration:underline;text-underline-offset:3px;min-height:44px;display:inline-flex;align-items:center}
.newdesign :is(#family-atlas,.dd-profile-map) .leaflet-bar{border:1px solid #777!important;border-radius:0!important;box-shadow:none!important}
.newdesign :is(#family-atlas,.dd-profile-map) .leaflet-bar a{background:#fff;color:#111;border-radius:0!important;width:44px;height:44px;}
.newdesign #family-atlas .fa-route-tooltip{pointer-events:none!important;background:#fff!important;color:#111!important;border:1px solid #111!important;border-radius:0!important;box-shadow:0 3px 12px #0002}
.newdesign #family-atlas #fa-reader-name{color:#111!important}.newdesign #family-atlas #fa-reader-content{color:#111!important;}
@media(max-width:700px){.newdesign #family-atlas{padding:16px 12px 10px!important}.newdesign #family-atlas .fa-navigation-fast{gap:8px}.newdesign #family-atlas .fa-navigation-fast button{padding:8px!important}.newdesign #family-atlas .fa-panel{max-width:calc(100% - 20px)!important}}


/* Branch fills share the wheel palette; outlines keep pale colors visible on the basemap. */
.newdesign #family-atlas .fa-leaf-marker :is(.fa-pin,.fa-bubble){border:2px solid #111!important;box-shadow:0 0 0 2px #fff!important}
.newdesign #fa-branch-buttons i{width:14px;height:14px;border:1px solid currentColor;border-radius:0}
.newdesign #family-atlas #fa-branch-buttons button[aria-pressed=true]{background:var(--branch-color)!important;color:#111!important}
/* Color identifies tools without changing geographic meanings. */
.newdesign #family-atlas :is(.fa-results-head,.fa-reader-top,#fa-reader-tabs){background:#cac2e7!important}
.newdesign #family-atlas :is(#ah-panel,#an-panel,#ae-panel){border-top:8px solid #b9debf!important}
.newdesign #family-atlas .fa-result:hover{background:#f5efe4!important}
.newdesign #family-atlas #fa-results .fa-result[aria-pressed=true],.newdesign #family-atlas #fa-results .fa-result[aria-pressed=true]:hover{background:#fac300!important;color:#111!important;border-color:#111!important}

.newdesign :is(#ah-reader,#an-reader,#ae-reader){background:#fff!important;color:#111!important;border-radius:0!important;border-top:8px solid #cac2e7!important}
.newdesign :is(#fa-reader,#ah-reader,#an-reader,#ae-reader){box-sizing:border-box;max-width:calc(100% - 24px)!important;max-height:calc(100dvh - 24px)!important;overflow:auto}
.newdesign :is(#ah-reader,#an-reader,#ae-reader) button{min-height:44px;background:#fff;color:#111;border:1px solid #777;border-radius:0}
.newdesign :is(#ah-reader,#an-reader,#ae-reader) a{color:#111;text-underline-offset:3px}
@media(max-width:700px){.newdesign :is(#fa-reader,#ah-reader,#an-reader,#ae-reader){width:calc(100% - 24px)!important;margin:12px auto!important}}
.newdesign #family-atlas :is(#ah-panel,#an-panel,#ae-panel)>button:first-child{background:#b9debf!important;color:#111!important}

/* Keep attribution compact and map instructions visible on small screens. */
.newdesign :is(.dd-profile-map,#family-atlas) .leaflet-control-attribution a{display:inline!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important}
.newdesign .dd-places-note:not([hidden]){display:block!important;margin:16px 0 0;color:#333}.newdesign .dd-places-note[hidden]{display:none!important}
.newdesign .dd-places-interact{bottom:38px!important}

/* Match the wheel: keep branch fills and mark state with outlines. */
.newdesign #family-atlas .fa-leaf-marker .fa-active{outline:3px solid #111!important;outline-offset:4px!important}
.newdesign #family-atlas .fa-person-marker :is(.fa-pin,.fa-bubble){outline:2px solid #9b4564;outline-offset:4px}
.newdesign #family-atlas :is(button,a,input,select,summary,[tabindex]):focus-visible{outline:3px solid #111!important;outline-offset:3px!important}
.newdesign #family-atlas :is(.fa-map-label,.leaflet-tooltip){background:#111!important;color:#fff!important;border:1px solid #fff!important;border-radius:0!important;box-shadow:none!important;pointer-events:none!important}
.newdesign #family-atlas .leaflet-tooltip::before{border-top-color:#111!important;border-bottom-color:#111!important}
.newdesign #family-atlas .fa-route-hit:focus-visible{outline:none!important;stroke:#111!important;stroke-opacity:.35!important;stroke-width:10!important}
.newdesign #family-atlas .fa-journey-stop span{background:#fff!important;color:#111!important;border:2px solid #111!important;border-radius:0!important;box-shadow:0 0 0 2px #fff!important}
.newdesign #family-atlas .fa-travel-symbol span{background:#fff!important;border:2px solid #111!important;border-radius:0!important;box-shadow:none!important}
.newdesign #family-atlas button:disabled{opacity:.45;cursor:default}
@media(prefers-reduced-motion:reduce){.newdesign #family-atlas *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

.nd-map-options[hidden]{display:none!important}
.nd-map-options{grid-column:1/-1;width:100%}
.nd-map-options>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;padding:8px 12px;border:1px solid #111;background:#f5efe4;list-style:none}
.nd-map-options>summary::after{content:'+';margin-left:auto;font-size:20px}
.nd-map-options[open]>summary::after{content:'−'}
.nd-map-options>summary::-webkit-details-marker{display:none}
.nd-map-options[open] :is(.fa-history-actions,.fa-map-tools){margin-top:8px}
@media(max-width:700px){
 .newdesign #family-atlas .fa-title{margin-bottom:8px}
 .newdesign #family-atlas #fa-branch-buttons button[data-branch=unassigned][aria-pressed=true]{color:#fff!important}
 .newdesign #family-atlas #fa-branch-buttons{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px}
 .newdesign #fa-branch-buttons button{min-width:0!important;width:100%!important;white-space:normal;padding:7px!important}

 .newdesign #family-atlas :is(.fa-panel,#fa-reader,#ah-panel,#an-panel,#ae-panel){overscroll-behavior:contain}
 .newdesign #family-atlas :is(.fa-navigation-fast button,.nd-map-options summary){font-size:13px;line-height:1.25}
}

/* Phone panels use the width of the map, leaving its upper area free to pan. */
@media(max-width:700px){
 .newdesign #family-atlas .fa-stage{height:70svh!important;min-height:480px!important}
 .newdesign #family-atlas .fa-panel{left:8px!important;right:8px!important;top:auto!important;bottom:28px!important;width:auto!important;max-width:none!important}
 .newdesign #family-atlas .fa-panel:not(.fa-collapsed){max-height:55%!important}
 .newdesign #family-atlas .fa-panel-head h2{font-size:17px!important;line-height:1.2!important;margin:0!important}
 .newdesign #family-atlas .fa-panel-head{min-height:44px}
 .newdesign #family-atlas .fa-panel #fa-controls{min-height:0;overflow:auto}
 .newdesign #family-atlas .fa-panel :is(input,select){font-size:16px!important;width:100%;min-width:0}
 .newdesign #family-atlas .fa-panel .fa-result{min-width:0}
 .newdesign #family-atlas #fa-reader .fa-reader-top>div{display:flex!important;align-items:center;justify-content:space-between;gap:8px;width:100%}
 .newdesign #family-atlas #fa-reader-full-profile{padding:8px 0;min-height:44px;display:inline-flex;align-items:center}
 .newdesign #family-atlas #fa-reader-close{padding:8px!important;white-space:nowrap}
 .newdesign #family-atlas #fa-reader-life{color:#333!important}
 .newdesign #family-atlas .fa-reader-places small{color:#444!important}
 .newdesign #family-atlas .fa-panel p{line-height:1.45}
 .newdesign #family-atlas .fa-caption{display:none!important}
 .newdesign #family-atlas #fa-branch-buttons button{min-height:44px!important}
}

/* Short landscape screens can scroll the header away and keep the map usable. */
@media(max-width:1000px) and (max-height:500px){
 .newdesign:has(#family-atlas) .nd-header{position:static!important}
 .newdesign #family-atlas{padding:10px 12px!important}
 .newdesign #family-atlas .fa-title{margin-bottom:8px}
 .newdesign #family-atlas .fa-title h1{font-size:26px!important}
 .newdesign #family-atlas .fa-stage{height:90svh!important;min-height:320px!important}
 .newdesign #family-atlas .fa-panel:not(.fa-collapsed){max-height:80%!important}
}
/* Keep historical date controls in the panel flow, clear of the map and other overlays. */
.newdesign #family-atlas #ah-panel #ah-time{position:static!important;inset:auto!important;transform:none!important;box-sizing:border-box;width:100%!important;display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:12px!important;margin:12px 0;background:#f5efe4;border:1px solid #aaa;border-radius:0;box-shadow:none}
.newdesign #ah-panel #ah-time label{white-space:normal;font:inherit;color:#111}
.newdesign #ah-panel #ah-time .ah-slider{min-width:0;width:100%}
.newdesign #ah-panel #ah-all{width:100%;font-size:13px}
/* Gallery provenance remains visible in cards and the enlarged image. */
.newdesign #family-atlas .fa-generated-label{display:block;margin-top:6px;font-size:13px;line-height:1.4;color:#444;font-weight:400}
.newdesign #family-atlas .fa-story-chapters nav a{display:block;padding:10px 0;min-height:44px;border-bottom:1px solid #ccc}
.newdesign #family-atlas .fa-story-notes{border-top:2px solid #111;margin-top:28px;padding-top:16px;overflow-wrap:anywhere}.newdesign #family-atlas .fa-story-notes li{margin-bottom:20px;scroll-margin-top:16px}
