/* Height-aware immersive fallback and native fullscreen use the same stable reader. */
html:has(.ng-immersive),body.ng-immersive-open{overflow:hidden}
.ng-fullscreen-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.ng-immersive,.ng-reader-v3.ng-immersive{position:fixed!important;inset:0!important;z-index:10000!important;width:100%!important;max-width:none!important;height:100vh;height:100dvh!important;min-height:0!important;max-height:100dvh!important;margin:0!important;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)!important;border-radius:0!important;overflow:auto!important;overscroll-behavior:contain;box-sizing:border-box;background:#2C3A1E;color:#fff}
.ng-immersive[hidden]{display:none!important}.ng-immersive :is(button,input,select){min-height:44px}.ng-immersive :is(.v3-scene,.v3-card,.v3-media,.ng-photo-stage,.photo-wrap){min-height:0!important;min-width:0!important;max-width:100%;box-sizing:border-box}.ng-immersive :is(.v3-scene,#story.v3-scene){flex:1 1 auto!important;min-height:0!important;height:auto!important;position:relative;overflow:hidden}.ng-reader-v3.ng-immersive{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto}
.ng-immersive .v3-reader-header{min-height:60px!important;padding:6px 16px!important;flex-shrink:0}.ng-immersive .v3-reader-brand img{max-width:160px!important;height:38px!important}.ng-immersive .v3-reader-footer{min-height:58px!important;padding:5px 16px!important;flex-shrink:0}.ng-immersive .v3-card{position:relative!important;width:auto!important;max-width:none!important;min-height:0!important;margin:12px!important;padding:16px!important;overflow:auto!important;display:flex;flex-direction:column;max-height:calc(100dvh - 145px)}.ng-immersive .v3-card :is(h2,h3,.current-title,#storyTitle){font-size:clamp(20px,2.6vw,32px)!important;margin-block:5px!important}.ng-immersive .v3-summary{font-size:16px!important;line-height:1.4;flex-shrink:0}.ng-immersive :is(.v3-mode,.v3-mode-tabs){min-height:44px!important}.ng-immersive :is(.reader-transcript,.script-wrap,#script-scroll,#storyScript,.demo-transcript-scroll,#text){min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain;font-size:16px;line-height:1.55}.ng-immersive :is(.v3-audio-row,.capsule-player-controls,.photo-progress){flex-shrink:0;position:sticky;bottom:0;z-index:4}.ng-immersive .v3-media{position:relative!important;height:100%!important}.ng-immersive :is(.ng-photo-stage img,.photo-wrap img,.v3-media img){min-height:0!important;max-height:100%!important;object-fit:contain!important}.ng-immersive .v3-position{flex-shrink:0}.ng-immersive .v3-mode-tabs{flex-shrink:0}.ng-immersive .v3-credits{max-height:3em;overflow:auto;font-size:12px}.ng-immersive>.chapter-side{display:none!important}.ng-fullscreen-tools{display:flex;gap:8px;padding:8px;position:sticky;top:0;z-index:5;background:#2C3A1E;color:#fff}.ng-fullscreen-tools button{min-height:44px;color:inherit;background:#4B5C2E;border:1px solid #E5B22E;border-radius:6px;padding:8px 12px}
@media(min-width:851px){.ng-immersive:not(.ng-common-reader) .v3-scene{display:grid!important;grid-template-columns:minmax(0,1.2fr) minmax(300px,1fr)}.ng-immersive .v3-media{grid-column:1;grid-row:1}.ng-immersive .v3-card{grid-column:2;grid-row:1}.ng-immersive .v3-credits{position:absolute;left:12px;bottom:5px;max-width:48%}}
@media(max-width:850px) and (orientation:portrait){.ng-immersive:not(.ng-common-reader) .v3-scene{display:grid!important;grid-template-rows:minmax(120px,35%) minmax(0,1fr)}.ng-immersive .v3-media{grid-row:1}.ng-immersive .v3-card{grid-row:2;margin:6px!important;padding:10px!important;max-height:none!important}.ng-immersive .v3-card .v3-summary{display:none}.ng-immersive .v3-credits{position:absolute;top:calc(35% - 28px);left:8px;max-width:95%}.ng-immersive .v3-mode-tabs{margin-block:4px!important}.ng-immersive :is(#storyScript,#script-scroll,.script-wrap,.demo-transcript-scroll){max-height:24dvh!important}.ng-immersive .v3-reader-header{padding:4px 8px!important;min-height:52px!important}.ng-immersive .v3-reader-brand img{max-width:100px!important;height:30px!important}.ng-immersive .v3-breadcrumb{min-width:0;overflow:hidden}.ng-immersive .v3-reader-footer{min-height:52px!important}.ng-immersive .v3-guide-name{max-width:28vw;overflow:hidden;text-overflow:ellipsis}}
@media(max-height:500px){.ng-reader-v3.ng-immersive{grid-template-rows:48px minmax(0,1fr) 48px}.ng-immersive:not(.ng-common-reader) .v3-scene{display:grid!important;grid-template-columns:minmax(0,45%) minmax(0,55%);grid-template-rows:minmax(0,1fr)}.ng-immersive .v3-media{grid-column:1;grid-row:1}.ng-immersive .v3-card{grid-column:2;grid-row:1;margin:4px!important;padding:8px!important;max-height:none!important}.ng-immersive .v3-reader-header,.ng-immersive .v3-reader-footer{min-height:44px!important;padding:2px 8px!important}.ng-immersive .v3-summary,.ng-immersive .v3-capsule-number{display:none}.ng-immersive .v3-mode-tabs{margin:2px 0!important}.ng-immersive .v3-mode{font-size:14px!important;padding:3px!important}.ng-immersive :is(#storyScript,#script-scroll,.script-wrap,.demo-transcript-scroll){max-height:25dvh!important}.ng-immersive .v3-credits{position:absolute;bottom:0;left:4px;top:auto;max-width:43%}.ng-immersive .v3-reader-brand img{height:28px!important;max-width:100px!important}}
#main.ng-immersive{display:flex;flex-direction:column;gap:8px;padding:8px!important}#main.ng-immersive :is(figure,img){min-height:0;max-height:35dvh;object-fit:contain}#main.ng-immersive #text{flex:1;min-height:80px}#main.ng-immersive .controls{position:sticky;bottom:0;background:#2C3A1E}main.ng-immersive :is(#hosted-controls){position:sticky;bottom:0;background:#2C3A1E}main.ng-immersive #hosted-text{max-height:35dvh;overflow:auto}
.ng-immersive .v3-reader-header{grid-row:1;position:sticky;top:0;z-index:8}.ng-immersive .v3-scene{grid-row:2}.ng-immersive .v3-reader-footer{grid-row:3;position:sticky;bottom:0;z-index:8}.ng-immersive :is(.v3-mode,.v3-icon-button){min-width:44px!important;min-height:44px!important}
.ng-immersive .v3-profile-choice{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font:16px Arial;margin:2px 0 8px;flex-shrink:0}.ng-immersive .v3-profile-choice select{max-width:100%;min-width:0;font:16px Arial;min-height:44px;background:#4B5C2E;color:#fff;border:1px solid #E5B22E;padding:6px}
@media(max-width:850px){.ng-immersive .v3-reader-header{grid-template-columns:96px minmax(0,1fr)!important;gap:4px!important}.ng-immersive .v3-header-actions{justify-content:flex-end;min-width:0}.ng-immersive .v3-breadcrumb{grid-column:1/-1;grid-row:2;overflow:hidden;min-height:44px}.ng-immersive .v3-guide-name{max-width:55vw}.ng-immersive .v3-reader-header{height:auto!important}}
@media(max-height:500px){.ng-reader-v3.ng-immersive{grid-template-rows:auto minmax(0,1fr) auto}.ng-immersive .v3-profile-choice{margin:0}}
/* Override historical ID-specific placements rather than layering another offset. */
.ng-reader-v3.ng-immersive:not(.ng-common-reader) :is(#story,#demoScene,.v3-scene){inset:auto!important;transform:none!important;align-items:stretch!important;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;height:100%!important}
.ng-reader-v3.ng-immersive :is(#demoMedia,#capsuleMedia,.v3-media){inset:auto!important;transform:none!important;grid-column:1!important;grid-row:1!important;width:100%!important;height:100%!important;align-self:stretch!important;overflow:hidden!important}
.ng-reader-v3.ng-immersive :is(#demoCard,.v3-card){inset:auto!important;transform:none!important;grid-column:2!important;grid-row:1!important;align-self:stretch!important;width:auto!important;height:auto!important;max-height:100%!important}
@media(max-width:850px) and (min-height:501px){.ng-reader-v3.ng-immersive:not(.ng-common-reader) :is(#story,#demoScene,.v3-scene){grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(120px,35%) minmax(0,1fr)!important}.ng-reader-v3.ng-immersive :is(#demoMedia,#capsuleMedia,.v3-media){grid-column:1!important;grid-row:1!important}.ng-reader-v3.ng-immersive :is(#demoCard,.v3-card){grid-column:1!important;grid-row:2!important;margin:6px!important;padding:10px!important}}
@media(max-height:500px){.ng-reader-v3.ng-immersive:not(.ng-common-reader) :is(#story,#demoScene,.v3-scene){grid-template-columns:minmax(0,45%) minmax(0,55%)!important;grid-template-rows:minmax(0,1fr)!important}.ng-reader-v3.ng-immersive :is(#demoMedia,#capsuleMedia,.v3-media){grid-column:1!important;grid-row:1!important}.ng-reader-v3.ng-immersive :is(#demoCard,.v3-card){grid-column:2!important;grid-row:1!important}}
.ng-reader-v3.ng-immersive[data-fullscreen-mode]{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important}
.ng-reader-v3.ng-immersive[data-fullscreen-mode] .v3-card :is(#demoScript,#script-scroll,#storyScript,.script-wrap,.demo-transcript-scroll){flex:1 1 auto!important;min-height:70px!important;max-height:100%!important;overflow:auto!important}
#demoReader.ng-immersive,#readingLayout.ng-immersive,#stage.ng-immersive{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important}
.ng-reader-v3.ng-immersive .v3-position{margin-block:0!important;padding-block:0!important;gap:4px!important}.ng-reader-v3.ng-immersive .v3-capsule-number{margin-block:2px!important}.ng-reader-v3.ng-immersive .v3-segments{margin-block:4px!important}.ng-reader-v3.ng-immersive .v3-card .v3-mode-tabs{margin-block:5px!important}
#readingLayout.ng-immersive #storyTranscript{display:flex!important;flex-direction:column;flex:1 1 0!important;min-height:0!important;max-height:100%!important;overflow:hidden!important;margin:4px 0!important}
#readingLayout.ng-immersive #storyScript{flex:1 1 auto!important;min-height:70px!important;max-height:100%!important;overflow:auto!important;padding:8px!important}
#readingLayout.ng-immersive #storyAudio{flex-shrink:0!important;position:sticky!important;top:0!important;z-index:4;margin:0!important;background:#4B5C2E}
.ng-immersive .capsule-player-controls{margin:0!important;padding:0!important}.ng-immersive .playback-state{margin:4px 0!important;padding:0!important;font-size:14px!important;line-height:1.4!important}
#demoReader.ng-immersive #demoTranscript{flex:1 1 0!important;min-height:70px!important;max-height:100%!important;overflow:auto!important;margin:4px 0!important}#demoReader.ng-immersive #demoTranscript[hidden]{display:none!important}#demoReader.ng-immersive #demoTranscript #demoScript{min-height:70px!important;overflow:auto!important;max-height:100%!important}

/* Historical tourist grids have a sidebar column and details rendering box. */
#readingLayout.ng-reader-v3.ng-immersive{grid-template-columns:minmax(0,1fr)!important}
#readingLayout.ng-reader-v3.ng-immersive #story.v3-scene{width:100%!important;max-width:none!important;min-width:0!important;justify-self:stretch!important}
#readingLayout.ng-reader-v3.ng-immersive .v3-card{justify-self:stretch!important;width:auto!important;min-width:0!important;margin:12px!important;padding:16px!important}
#readingLayout.ng-reader-v3.ng-immersive #storyTranscript{min-height:96px!important}
#readingLayout.ng-reader-v3.ng-immersive #storyScript{height:0;min-height:70px!important;flex:1 1 0!important}
@media(max-height:500px){#readingLayout.ng-reader-v3.ng-immersive .v3-card{margin:4px!important;padding:8px!important}}
#readingLayout.ng-reader-v3.ng-immersive .v3-card>*{order:initial!important;flex-shrink:0}
#readingLayout.ng-reader-v3.ng-immersive .v3-card>.v3-position{order:0!important}
#readingLayout.ng-reader-v3.ng-immersive .v3-card>#storyTitle{order:1!important;font-size:clamp(20px,2vw,28px)!important;margin:4px 0!important}
#readingLayout.ng-reader-v3.ng-immersive .v3-card>.v3-summary{order:2!important;font-size:16px!important;line-height:1.4!important;margin:4px 0!important}
#readingLayout.ng-reader-v3.ng-immersive .v3-card>.v3-mode-tabs{order:3!important}
#readingLayout.ng-reader-v3.ng-immersive .v3-card>#storyAudio{order:4!important;top:auto!important;bottom:auto!important;position:relative!important}
#readingLayout.ng-reader-v3.ng-immersive .v3-card>#storyTranscript{order:5!important;flex-shrink:1!important}
#readingLayout.ng-reader-v3.ng-immersive>#readerDetails{max-height:64px!important;overflow:auto!important;margin:0!important}
#readingLayout.ng-reader-v3.ng-immersive .v3-summary{max-height:3em;overflow:auto}
@media(max-width:850px){#readingLayout.ng-reader-v3.ng-immersive .v3-summary{display:none!important}#readingLayout.ng-reader-v3.ng-immersive .v3-card>.v3-mode-tabs .v3-mode{padding:4px!important;min-height:44px!important}}
@media(max-height:500px){
 #readingLayout.ng-reader-v3.ng-immersive{grid-template-rows:48px minmax(0,1fr) 48px auto!important;gap:0!important}
 #readingLayout.ng-reader-v3.ng-immersive .v3-reader-header{grid-template-columns:100px minmax(0,1fr) auto!important;min-height:44px!important;height:48px!important;padding:0 6px!important}
 #readingLayout.ng-reader-v3.ng-immersive .v3-breadcrumb{grid-column:2!important;grid-row:1!important;min-height:44px!important}
 #readingLayout.ng-reader-v3.ng-immersive .v3-reader-footer{min-height:44px!important;height:48px!important;padding:0 6px!important}
 #readingLayout.ng-reader-v3.ng-immersive .v3-card>.v3-position{display:none!important}
 #readingLayout.ng-reader-v3.ng-immersive .v3-card>#storyTitle{max-height:24px;overflow:auto;font-size:20px!important;line-height:24px!important}
 #readingLayout.ng-reader-v3.ng-immersive .v3-mode{display:flex;flex-direction:row;gap:6px;align-items:center;justify-content:center}
 #readingLayout.ng-reader-v3.ng-immersive .v3-mode svg{width:20px;height:20px}
 #readingLayout.ng-reader-v3.ng-immersive>#readerDetails{max-height:32px!important;font-size:12px}
 #readingLayout.ng-reader-v3.ng-immersive #storyTranscript{min-height:70px!important;margin:0!important}
 #readingLayout.ng-reader-v3.ng-immersive #textSyncStatus{font-size:11px;line-height:13px}
}
/* Historical Saint-Pierre keeps its native audio/text engine in a bounded stage. */
#main.ng-immersive{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto;gap:4px!important;padding:4px!important}
#main.ng-immersive>.intro,#main.ng-immersive>h1,#main.ng-immersive>footer{display:none}
#main.ng-immersive>.stage{min-height:0!important;height:100%;border-radius:0;overflow:hidden}
#main.ng-immersive .picture{min-height:0!important;max-height:100%!important;height:100%!important;overflow:hidden}
#main.ng-immersive .picture img{max-height:100%!important;height:100%!important}
#main.ng-immersive .panel{min-height:0!important;overflow:auto;padding:10px!important}
#main.ng-immersive .panel>.label{display:none}
#main.ng-immersive .panel>h2{order:1;font-size:22px;line-height:1.2;margin:2px 0;max-height:54px;overflow:auto;flex-shrink:0}
#main.ng-immersive .panel>.controls{order:2;margin:4px 0!important;flex-shrink:0}
#main.ng-immersive #seek{order:3;flex-shrink:0}
#main.ng-immersive #text{order:4;flex:1 1 0;min-height:70px!important;max-height:none;height:0;overflow:auto}
#main.ng-immersive #caption{order:5;max-height:2em;overflow:auto;margin:2px 0;font-size:12px}
#main.ng-immersive #status{order:6;font-size:12px;line-height:1.3;margin:2px 0;flex-shrink:0}
#main.ng-immersive #compact{display:none}/* Same reduce action remains in the persistent viewing toolbar. */
#main.ng-immersive .lower{margin:0;min-height:44px;font-size:13px}
@media(max-width:760px) and (min-height:501px){#main.ng-immersive .stage{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(100px,35%) minmax(0,1fr)}}
@media(max-height:500px){#main.ng-immersive .stage{display:grid;grid-template-columns:minmax(0,45%) minmax(0,55%)}#main.ng-immersive .panel{padding:6px!important}#main.ng-immersive .panel>h2{max-height:27px}#main.ng-immersive #caption{display:none}}
#demoReader.ng-immersive:has(#demoTranscript) #demoMedia>.v3-mode-tabs{position:absolute;bottom:4px;left:4px;right:4px;z-index:7;background:#2C3A1EEB;border-radius:8px;margin:0!important;padding:2px}
#demoReader.ng-immersive:has(#demoTranscript) #demoTranscript{padding:0!important;border:0!important}
#demoReader.ng-immersive:has(#demoTranscript) #demoTranscript h3{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#demoReader.ng-immersive:has(#demoTranscript) #demoScript{padding:4px!important}
@media(max-height:500px){#demoReader.ng-immersive:has(#demoTranscript) .v3-position{display:none}#demoReader.ng-immersive:has(#demoTranscript) .v3-card h2{font-size:20px!important;line-height:24px!important;max-height:24px;overflow:auto;margin:0!important}#demoReader.ng-immersive:has(#demoTranscript) #demoTranscript{min-height:70px!important;margin:0!important}}
#stage.ng-immersive .v3-media>.v3-profile-choice{position:absolute;top:4px;left:4px;right:4px;z-index:7;margin:0;background:#2C3A1EEB;padding:4px;border-radius:8px;flex-wrap:nowrap}
#stage.ng-immersive .v3-profile-choice select{flex:1;min-width:0;width:100%;font-size:14px}
#stage.ng-immersive .v3-media>.v3-mode-tabs{position:absolute;bottom:4px;left:4px;right:4px;z-index:7;background:#2C3A1EEB;margin:0!important;border-radius:8px}
#stage.ng-immersive .subtitle-box{flex:1 1 0!important;min-height:70px!important;max-height:100%!important;overflow:auto!important;height:0!important;padding:4px 0!important;margin:0!important;order:3}
#stage.ng-immersive .subtitle-box .v3-sync-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#stage.ng-immersive .v3-audio-row{order:2;position:relative!important;top:auto;bottom:auto;flex-shrink:0}
#stage.ng-immersive .v3-card .current-title{order:1;max-height:3em;overflow:auto;margin:4px 0!important}
#stage.ng-immersive .v3-card .v3-position{order:0}
#stage.ng-immersive .v3-card>#transcript,#stage.ng-immersive .v3-card>#toggle-transcript{order:4}
#stage.ng-immersive .v3-credits{position:absolute!important;left:4px;bottom:60px;max-width:44%;max-height:2.4em;background:#2C3A1EEB;overflow:auto}
@media(max-height:500px){#stage.ng-immersive .v3-position,#stage.ng-immersive .v3-summary{display:none}#stage.ng-immersive .v3-card .current-title{font-size:20px!important;line-height:24px!important;max-height:24px}#stage.ng-immersive .v3-credits{display:none}#stage.ng-immersive .subtitle-text{font-size:16px!important;line-height:1.4!important}}
@media(max-width:850px) and (min-height:501px){#stage.ng-immersive .v3-credits{top:calc(35% - 3em);bottom:auto;max-width:95%;left:4px}}
/* Inert page overlays must not cover the active reader controls. Preferences return with the guide. */
body.ng-immersive-open .ng-audience[inert]{visibility:hidden}

/* Compact controls are placed inside the photograph, never above the reader. */
.ng-fullscreen-photo{position:relative}
.ng-fullscreen-tools{position:absolute!important;inset:10px 10px auto auto!important;display:flex;gap:6px;padding:0!important;margin:0!important;background:transparent!important;z-index:20;width:auto!important}
.ng-fullscreen-tools button{display:inline-flex!important;align-items:center;justify-content:center;position:static!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;margin:0!important;border:1px solid #FFFFFF88!important;border-radius:50%!important;background:#2C3A1EF2!important;color:#FFFFFF!important;box-shadow:0 2px 6px #0005}
.ng-fullscreen-tools button:focus-visible{outline:3px solid #E5B22E;outline-offset:3px}
.ng-v3-photo-tools:empty{display:none}
.ng-immersive .v3-reader-header:has(.v3-breadcrumb>.v3-region){min-height:44px!important}
#main.ng-immersive{grid-template-rows:minmax(0,1fr) auto!important}
#main .lower>span{display:none}
#main .lower{display:flex;justify-content:center;padding:8px 12px;flex-shrink:0;background:#2C3A1E}
#main .lower a,.demo-presentation.narligo-demo-promotion a{display:inline-flex!important;align-items:center;justify-content:center;min-height:44px!important;padding:10px 22px!important;background:#E5B22E!important;color:#2C3A1E!important;border:1px solid #E5B22E!important;border-radius:999px!important;font:700 16px/1.3 Arial!important;text-decoration:none!important;box-shadow:0 2px 6px #0003}
@media(max-width:600px){.demo-presentation.narligo-demo-promotion{justify-content:center!important;padding:8px 12px!important}.demo-presentation.narligo-demo-promotion>span{display:none}}

#main .panel{overflow-x:hidden!important}#main input[type="range"]{min-width:0;max-width:100%;margin-inline:0;box-sizing:border-box}

/* One MP3 clock and a stable DOM; CSS only responds to available height. */
@media(min-width:851px) and (min-height:501px){
 #readingLayout.ng-reader-v3.ng-immersive #story.v3-scene{display:block!important}
 #readingLayout.ng-reader-v3.ng-immersive .v3-media{position:absolute!important;inset:0;height:100%!important;width:100%!important}
 #readingLayout.ng-reader-v3.ng-immersive .v3-card{position:absolute!important;inset:var(--ng-gutter,1rem) var(--ng-gutter,1rem) var(--ng-gutter,1rem) auto!important;width:var(--ng-panel-width,28rem)!important;max-width:44%!important;max-height:none!important;margin:0!important;box-shadow:0 .25rem 1.5rem #0004}
}
.ng-immersive .v3-card{overscroll-behavior:contain}
.ng-immersive .v3-reader-header,.ng-immersive .v3-reader-footer{height:auto!important}
@media(max-width:850px) and (orientation:portrait){
 .ng-reader-v3.ng-immersive:not(.ng-common-reader) .v3-scene{grid-template-rows:minmax(6rem,30%) minmax(0,1fr)!important}
 #readingLayout.ng-reader-v3.ng-immersive .v3-card{margin:.375rem!important;padding:.625rem!important}
 .ng-immersive .v3-credits{top:calc(30% - 1.75rem)}
}
