/* Shared, unobtrusive controls for the interactive 3D and camera views. */
.scene-summary{pointer-events:auto;z-index:7;padding:0 6px;gap:2px}
.scene-summary button{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 12px;font:inherit;color:inherit;background:none;border:0}
.scene-summary button:hover{color:var(--app-accent)}
.scene-summary i{width:18px;height:18px}.scene-summary .summary-dot{margin:0 3px}
.scene-summary button:focus-visible{outline:2px solid var(--app-accent);outline-offset:-3px;border-radius:20px}
.viewer-bottom{width:min(520px,calc(100% - 24px));bottom:max(14px,env(safe-area-inset-bottom));pointer-events:none}
.viewer-bottom>*{pointer-events:auto}
body[data-app=viewer] .viewer-bottom .gesture-guide{display:none}
body[data-app=viewer] .control-dock{display:flex;align-items:center;justify-content:center;gap:8px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
body[data-app=viewer] .control-dock button{position:relative;isolation:isolate;width:44px;min-height:44px;padding:8px;border:0;border-radius:0;background:none;color:#fff;opacity:.62;transition:opacity .2s}
body[data-app=viewer] .control-dock button:before{content:'';position:absolute;z-index:-1;inset:-8px -12px;background:radial-gradient(ellipse,#0005,transparent 72%);pointer-events:none}
body[data-app=viewer] .control-dock button:is(:active,:focus-visible,[aria-expanded=true]){opacity:1;background:none;color:white}
.control-dock button>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.quality-choice{display:flex;align-items:center;gap:8px;flex-shrink:0}
.quality-choice button{font-size:12px;font-weight:600;letter-spacing:.08em;min-width:44px;min-height:44px;position:relative}
.quality-choice button[aria-pressed=true]:after{content:'';position:absolute;height:1px;width:16px;left:50%;bottom:6px;transform:translateX(-50%);background:currentColor}
body[data-app=viewer] .control-dock .quality-choice button[aria-pressed=true]{opacity:.95}
.ar-timeline{height:101px;opacity:.38;transition:opacity .8s ease-out;isolation:isolate;margin-top:0;color:white}
.ar-timeline.is-active{opacity:1;transition:opacity 2s ease-in}
.ar-timeline:before{content:'';position:absolute;inset:5px -25px -8px;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at 50% 68%,#0005 0%,#0002 32%,transparent 72%)}
.ar-arc{height:60px;width:100%;filter:drop-shadow(0 0 2px #fff6) drop-shadow(0 1px 2px #0009)}
#arArcMarker,#viewerArcMarker{transition:none;filter:drop-shadow(0 0 3px #fff8)}
#arEpoch,#viewerEpoch{position:absolute;inset:0 0 auto;width:100%;height:60px;min-height:60px;margin:0;padding:0;opacity:0;cursor:ew-resize;touch-action:none;pointer-events:auto}
#arYear,#viewerYear{display:block;text-align:center;letter-spacing:.045em;color:white;text-shadow:0 1px 6px #0009;pointer-events:none}
#arYear,#viewerYear{font-size:23px;font-weight:400;line-height:29px}
.era-caption{margin:2px 0 0;text-align:center;font-size:11px;line-height:15px;font-weight:400;color:white;text-shadow:0 1px 5px #000b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.ar-timeline:has(input:focus-visible){opacity:1;outline:1px solid #ffffff85;outline-offset:3px;border-radius:12px}
#arHud .ar-bottom{width:min(440px,calc(100% - 20px));gap:0;bottom:max(12px,env(safe-area-inset-bottom))}
#arHud .ar-tools{width:100%;align-items:center;justify-content:center;gap:8px}
#arHud .ar-tool-group{gap:8px}#arHud .ar-tool-group button{width:44px;height:44px}
#arHud #arSizeValue{min-width:36px;font-size:12px}
#arHud .quality-choice button{padding:0;color:#ffffff73;width:44px;height:44px}
#arHud .quality-choice button[aria-pressed=true]{color:#ffffffe6}
#arHud .ar-light{pointer-events:auto;display:flex;gap:7px;align-items:center;justify-content:center;min-width:82px;min-height:48px;padding:0 8px;font-size:12px}
#arHud .ar-top{align-items:flex-start}
#arHud .ar-coach{top:78px;background:transparent;border:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;color:#fff}
body.ar-active #viewerTimeline{display:none}
.ar-entry .ar-steps{gap:18px;padding-top:22px;margin-top:24px}
.ar-steps .step-symbol{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;max-width:126px;gap:8px;color:var(--app-accent)}
.ar-steps .step-symbol b{font-size:28px;line-height:1.1;letter-spacing:-.03em;font-weight:500;margin:0;color:inherit;font-variant-numeric:tabular-nums}
.ar-steps .step-symbol i{width:27px;height:27px;display:block;flex-shrink:0}
.ar-steps .step-symbol svg{width:100%;height:100%;stroke-width:1.4}
.ar-steps strong{display:block;font-size:13px;line-height:1.35;font-weight:600;margin-bottom:5px;color:var(--app-ink)}
.ar-steps li>span{display:block;font-size:12px;line-height:1.5;color:var(--app-muted);text-wrap:pretty}
body[data-app=viewer] #arSystemLink{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 4px;margin:10px 0 0;background:none;border:0;box-shadow:none;font-size:12px;line-height:1.5;font-weight:400;color:var(--app-muted);text-decoration:underline;text-underline-offset:4px}
#arSystemLink[hidden]{display:none!important}
body[data-app=viewer] .ar-entry:has(#arDesktop[hidden]) .ar-steps{display:grid}
.control-panel{bottom:calc(180px + env(safe-area-inset-bottom));max-height:calc(100dvh - 290px)}
@media(max-width:380px){#arHud .ar-tools{gap:4px}#arHud .ar-tool-group{gap:4px}#arHud .quality-choice{gap:4px}.ar-entry-content{padding-left:18px;padding-right:18px}.ar-entry .ar-steps{gap:12px}.ar-steps .step-symbol b{font-size:25px}.ar-steps .step-symbol i{width:24px;height:24px}}
@media(min-width:800px){.scene-summary{top:28px}.viewer-bottom{bottom:18px}.control-panel{bottom:185px}.ar-timeline{height:109px}.ar-arc{height:64px}#arEpoch,#viewerEpoch{height:64px}#arHud .ar-bottom{width:500px}}
@media(orientation:landscape) and (max-height:600px){.viewer-bottom,#arHud .ar-bottom{left:50%;right:auto;transform:translateX(-50%);width:min(710px,calc(100% - 40px));display:flex;align-items:flex-end;gap:16px;bottom:max(8px,env(safe-area-inset-bottom))}.viewer-bottom .control-dock,#arHud .ar-tools{width:auto;flex-shrink:0}.ar-timeline{min-width:260px;flex:1;height:90px}.ar-arc{height:52px}#arEpoch,#viewerEpoch{height:52px}.era-caption{font-size:10px}#arYear,#viewerYear{font-size:20px;line-height:24px}.control-panel{bottom:108px;max-height:calc(100dvh - 190px)}#arHud .ar-coach{top:62px}.scene-summary{top:10px}}
@media(prefers-reduced-motion:reduce){.ar-timeline,.ar-timeline.is-active{transition:none}}

/* The SVG and hit area share the same aspect ratio, so touch follows every node. */
.ar-timeline{height:auto;padding-bottom:2px}
.ar-arc{height:auto;aspect-ratio:6}
#arEpoch,#viewerEpoch{height:auto;min-height:44px;aspect-ratio:6}
@media(orientation:landscape) and (max-height:600px){.ar-timeline{height:auto;max-width:330px}}
/* Reference direction: an arch above the scene, with the selected year on it. */
#viewerTimeline,#arTimeline{position:fixed;z-index:6;top:14%;left:50%;width:min(860px,calc(100% - 32px));height:auto;max-width:none;transform:translateX(-50%);margin:0;padding:0;pointer-events:none}
#arTimeline{z-index:42}
#viewerTimeline .ar-arc,#arTimeline .ar-arc{aspect-ratio:360/112;height:auto;pointer-events:none;overflow:visible}
.ar-timeline .arc-hit{pointer-events:stroke;cursor:ew-resize;touch-action:none}
.arc-current-year{font-family:inherit;font-size:20px;font-weight:300;letter-spacing:.025em;filter:drop-shadow(0 1px 3px #000b)}
#arArcMarker,#viewerArcMarker{filter:drop-shadow(0 0 2px #fff6)}
#arEpoch,#viewerEpoch{inset:0 auto auto 50%;width:1px;height:1px;min-height:0;aspect-ratio:auto;pointer-events:none}
#arYear,#viewerYear,.era-caption{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.ar-timeline:before{display:none}
.ar-timeline:has(input:focus-visible){outline:none}
.ar-timeline:has(input:focus-visible) .ar-arc{filter:drop-shadow(0 0 3px #fff9) drop-shadow(0 1px 3px #0009)}
.focus-mode>#viewerTimeline{opacity:0;visibility:hidden}
.control-panel{bottom:calc(82px + env(safe-area-inset-bottom));max-height:calc(100dvh - 190px)}
@media(max-width:600px){#viewerTimeline,#arTimeline{top:27%;width:calc(100% - 28px)}.arc-current-year{font-size:24px}}
@media(orientation:landscape) and (max-height:600px){#viewerTimeline,#arTimeline{top:24%;width:min(510px,calc(100% - 70px))}.control-panel{bottom:80px;max-height:calc(100dvh - 150px)}}

/* The same timeline can sit above or below the scene. Labels stay above it. */
#viewerTimeline,#arTimeline{top:auto;bottom:calc(76px + env(safe-area-inset-bottom));width:min(760px,calc(100% - 28px));user-select:none;-webkit-user-select:none}
#viewerTimeline .ar-arc,#arTimeline .ar-arc{aspect-ratio:360/116}
body[data-timeline-position=top] #viewerTimeline,body[data-timeline-position=top] #arTimeline{top:14%;bottom:auto}
.ar-timeline.is-active{transition:opacity 2s ease-in}
.ar-timeline.is-hovered,.ar-timeline:has(.timeline-position:hover){opacity:1;transition:none}
.arc-years text{fill:white;font-family:inherit;font-size:11.5px;font-weight:400;opacity:.85;filter:drop-shadow(0 1px 2px #000a);pointer-events:all;cursor:ew-resize;touch-action:none}
.arc-years .arc-end-year{font-size:10.5px}
.arc-years .is-current,.arc-years .is-hovered{opacity:1;font-weight:650}
.ar-timeline .timeline-position,#arHud .timeline-position{position:absolute;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;width:52px;height:48px;min-height:44px;padding:0;border:0;border-radius:0;box-shadow:none;background:radial-gradient(ellipse,#0004,transparent 72%);color:#fff;font:inherit;opacity:.85;pointer-events:auto;cursor:pointer;touch-action:manipulation}
.timeline-position svg{width:22px;height:22px}.timeline-position span{font-size:10px;font-weight:400}
.timeline-position:focus-visible{outline:1px solid white;outline-offset:2px}
body[data-timeline-position=top] .ar-timeline .timeline-position,body[data-timeline-position=top] #arHud .timeline-position{bottom:-30px}
#arHud .timeline-position::before{display:none}
.ar-timeline .timeline-position:hover,.ar-timeline .timeline-position:active{opacity:1}
body[data-app=viewer] .quality-choice button{white-space:nowrap;word-break:normal;letter-spacing:0;padding-left:4px;padding-right:4px}
@media(max-width:600px){body[data-timeline-position=top] #viewerTimeline,body[data-timeline-position=top] #arTimeline{top:25%}}
@media(orientation:landscape) and (max-height:600px){#viewerTimeline,#arTimeline{bottom:58px;width:min(510px,calc(100% - 70px))}body[data-timeline-position=top] #viewerTimeline,body[data-timeline-position=top] #arTimeline{top:15%;bottom:auto}.timeline-position span{display:none}.ar-timeline .timeline-position{right:-36px;bottom:-2px}}
@media(prefers-reduced-motion:reduce){.ar-timeline,.ar-timeline.is-active{transition:none}}

/* Controls exist only after a visible model; no layout or giant default SVG while loading. */
#viewerTimeline:not(.is-presented),#arTimeline:not(.is-presented){visibility:hidden;opacity:0;pointer-events:none}
#viewerTimeline:not(.is-presented) *,#arTimeline:not(.is-presented) *{pointer-events:none!important}
.ar-timeline.is-presented{animation:timeline-arrive 1s ease-out}
@keyframes timeline-arrive{from{opacity:0}to{opacity:.38}}
#arHud .timeline-position,.ar-timeline .timeline-position{width:44px;height:44px;min-height:44px}
#arHud .timeline-position svg,.ar-timeline .timeline-position svg{display:block;width:22px;height:22px;max-width:22px;max-height:22px;flex:none}
body:not(.ar-active) #world canvas{opacity:var(--model-reveal,0)}
body.ar-active #world canvas{opacity:1}
@media(prefers-reduced-motion:reduce){.ar-timeline.is-presented{animation:none}}

/* The two launch routes have equal size, contrast and description space. */
.ar-mode-choices{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:22px}
.ar-mode-choice{position:relative;display:flex;flex-direction:column;align-items:flex-start;padding:18px 16px;border:1px solid var(--app-line);border-radius:14px;background:var(--app-panel)}
.ar-mode-choice>i{display:block;width:26px;height:26px;color:var(--app-accent);margin-bottom:10px}
.ar-mode-choice>i svg{width:26px;height:26px}
body[data-app=viewer] .ar-mode-choice :is(#arStart,#arSystemLink){display:flex;align-items:center;min-height:48px;width:100%;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:var(--app-ink);font-family:inherit;font-size:15px;font-weight:600;line-height:1.4;text-decoration:none;text-align:left;cursor:pointer}
body[data-app=viewer] .ar-mode-choice :is(#arStart,#arSystemLink):hover{color:var(--app-accent)}
body[data-app=viewer] .ar-mode-choice :is(#arStart,#arSystemLink):focus-visible{outline:2px solid var(--app-accent);outline-offset:5px}
.ar-entry .ar-mode-choice p{font-size:12px;line-height:1.6;color:var(--app-muted);margin:8px 0 0}
.ar-entry .ar-entry-visual{max-height:210px;width:100%}
/* Each control owns its hit area; never stretch it over neighbouring options. */
.ar-mode-choice :is(button,a)::after{content:none;pointer-events:none}
body[data-app=viewer] .ar-mode-choice #arSystemLink{justify-content:flex-start}
.ar-entry .ar-entry-content{padding-top:24px}
.ar-entry .ar-steps{padding-top:18px;margin-top:20px}
@media(max-width:700px){.ar-entry .ar-entry-visual{max-height:150px;aspect-ratio:2.4}.ar-mode-choices{gap:10px;margin-top:16px}.ar-mode-choice{padding:12px 10px}.ar-entry .ar-mode-choice p{font-size:11px}.ar-entry .ar-entry-content{padding-top:18px}.ar-entry .ar-mode-choice :is(#arStart,#arSystemLink){font-size:14px}.ar-entry .ar-overline{display:none}.ar-entry h2{font-size:26px}.ar-steps li>span{font-size:11px}}
/* One header row at every viewport size. */
body[data-app=viewer] .viewer-header{display:flex;align-items:center;flex-wrap:nowrap;gap:8px;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right))}
body[data-app=viewer] .viewer-header>*{flex-shrink:0}
body[data-app=viewer] .viewer-header .brand{flex:1 1 auto;min-width:0;max-width:220px;margin-right:auto;padding:10px 12px;height:46px;display:flex;justify-content:center;overflow:hidden}
body[data-app=viewer] .viewer-header .brand small{display:none}
body[data-app=viewer] .viewer-header .viewer-neovex{gap:8px;min-width:0;font-size:13px;letter-spacing:.08em}
body[data-app=viewer] .viewer-header .neovex-logo{width:min(130px,100%);min-width:0;height:auto;flex:0 1 auto}
body[data-app=viewer] .viewer-header .scene-summary{position:static;transform:none;min-height:46px;height:46px;padding:0;border-radius:24px;font-size:12px}
body[data-app=viewer] .viewer-header .scene-summary button{height:44px;padding:0 12px;gap:6px}
body[data-app=viewer] .viewer-header .ar-open{min-height:46px;white-space:nowrap;font-size:13px;padding:0 14px}
body[data-app=viewer] .viewer-header :is(.catalog-back,.help-button){width:44px;height:46px}
body[data-app=viewer] #restoreUI{width:48px;min-height:48px;padding:0;display:grid;place-items:center;opacity:.5;background:none;border:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;color:white;filter:drop-shadow(0 1px 3px #0008);transition:opacity .16s}
body[data-app=viewer] #restoreUI:hover,body[data-app=viewer] #restoreUI:focus-visible{opacity:1}
body[data-app=viewer] #restoreUI[hidden]{display:none}
@media(max-width:600px){body[data-app=viewer] .viewer-header{gap:6px}body[data-app=viewer] .viewer-header .scene-summary span{display:none}body[data-app=viewer] .viewer-header .scene-summary button{width:44px;padding:0;justify-content:center}body[data-app=viewer] .viewer-header .brand{padding:8px 10px}body[data-app=viewer] .viewer-header .ar-open{gap:4px;padding:0 10px}body[data-app=viewer] .viewer-header .ar-open i{width:19px}}
@media(max-width:360px){body[data-app=viewer] .viewer-header{gap:4px;left:8px;right:8px}body[data-app=viewer] .viewer-header .viewer-neovex>span{display:none}body[data-app=viewer] .viewer-header .brand{padding:8px}}
.ar-timeline{opacity:.55}.arc-years text{opacity:1;transition:fill .16s,transform .18s ease-out}
.ar-timeline.is-active,.ar-timeline.is-hovered{opacity:1;transition:opacity .18s ease-out}
.arc-years text.is-emphasized{fill:#363c40;filter:drop-shadow(0 1px 2px #fff9)}
@keyframes timeline-arrive{from{opacity:0}to{opacity:.55}}

@media(prefers-reduced-motion:reduce){.arc-years text,.ar-timeline.is-active,.ar-timeline.is-hovered{transition:none}}
