/* Scanning service only: the viewer itself is loaded on demand. */
.aed-svc-tour-example {
	display: grid;
	grid-template-columns: minmax(0,1fr) minmax(0,1.1fr);
	column-gap: clamp(28px,4vw,48px);
	row-gap: 16px;
	margin-top: 28px;
	padding-top: 28px;
	border-top: 1px solid var(--svc-line);
}
.aed-svc-tour-heading { grid-column: 2; grid-row: 1; align-self: end; min-width: 0; }
.aed-services .aed-svc-tour-heading h3 { font-size: clamp(1.3rem,2vw,1.65rem); max-width: 34ch; text-wrap: balance; }
.aed-services .aed-svc-tour-heading .aed-svc-eyebrow { margin-bottom: 12px; }
.aed-svc-tour-image { position: relative; grid-column: 1; grid-row: 1 / span 2; align-self: center; min-width: 0; overflow: hidden; border: 1px solid var(--svc-art-border-mid); border-radius: 4px 24px 4px 4px; box-shadow: var(--svc-art-shadow); }
.aed-svc-tour-image img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; }
.aed-services .aed-tour-preview-open { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end; width: 100%; height: 100%; margin: 0; padding: 16px; border: 0; border-radius: inherit; background: transparent; color: #fff; font: 600 .8rem/1.4 var(--font-sans); cursor: pointer; }
.aed-tour-preview-cue { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 10px 13px; border: 1px solid rgba(255,255,255,.55); border-radius: 24px; background: rgba(18,36,42,.9); box-shadow: 0 3px 12px rgba(0,0,0,.12); pointer-events: none; }
.aed-tour-preview-cue > span { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .2s ease, margin .2s ease, opacity .2s ease; }
.aed-tour-preview-open:is(:hover, :focus-visible) .aed-tour-preview-cue > span { max-width: 18rem; margin-left: 9px; opacity: 1; }
.aed-services .aed-tour-preview-open:focus-visible { outline: 3px solid #fff; outline-offset: -3px; box-shadow: inset 0 0 0 6px #17384e; }
@media (hover: none) { .aed-tour-preview-cue > span { max-width: 18rem; margin-left: 9px; opacity: 1; } }
.aed-svc-tour-copy { grid-column: 2; grid-row: 2; min-width: 0; }
.aed-svc-tour-example > .aed-tour { grid-column: 1 / -1; min-width: 0; }
.aed-services .aed-svc-tour-copy > p:first-child { margin: 0; }
.aed-services .aed-svc-tour-note { margin-top: 14px; font-size: .8rem; line-height: 1.65; }
.aed-services .aed-svc-tour-benefits { padding: 0 0 0 1.15em; margin: 18px 0; color: var(--svc-muted); font-size: .91rem; line-height: 1.65; }
.aed-svc-tour-benefits li + li { margin-top: 6px; }
.aed-svc-tour-benefits li::marker { color: var(--svc-accent); }
.aed-services .aed-tour-open { margin-top: 2px; cursor: pointer; font-family: inherit; }
.aed-svc-tour-invitation-copy { min-width: 0; }
@media (min-width: 921px) {
	.aed-svc-tour-invitation .aed-tour-open { margin-inline-start: clamp(16px, 2vw, 28px); max-width: calc(100% - 28px); }
}
/* Centre the headset in the spare space, including sufficiently wide stacked layouts. */
@media (min-width: 1200px), (min-width: 600px) and (max-width: 920px) {
	.aed-svc-tour-invitation { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: center; column-gap: 24px; }
	.aed-svc-tour-invitation::after {
		content: "";
		display: block;
		width: clamp(150px, 12vw, 190px);
		max-width: 100%;
		justify-self: center;
		aspect-ratio: 16 / 11;
		background: url('../images/decor/tour-headset-light.svg') center / contain no-repeat;
		pointer-events: none;
	}
	html[data-theme="dark"] .aed-svc-tour-invitation::after { background-image: url('../images/decor/tour-headset-dark.svg'); }
}
.aed-services .aed-tour [hidden], .aed-services .aed-tour-open[hidden], .aed-services .aed-tour-preview-open[hidden] { display: none !important; }
.aed-tour-panel {
	/* Reserve room for the header/navigation; short windows may scroll internally. */
	position: fixed; inset: 0; width: min(1100px, calc(100% - 48px)); max-width: none;
	width: min(1100px, calc(100% - 48px), max(760px, calc((100dvh - 320px) * 1.77778)));
	max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
	margin: auto; padding: 0; box-sizing: border-box;
	border: 1px solid var(--svc-art-border-mid); border-radius: 8px 24px 8px 8px;
	color: var(--color-text, #1e292b); background: var(--svc-card);
	box-shadow: 0 28px 90px rgba(0,0,0,.3); overflow: hidden; overscroll-behavior: contain;
}
html[data-theme="dark"] .aed-tour-panel { color: #edf0e9; }
.aed-tour-panel[open] { display: flex; flex-direction: column; }
.aed-tour-panel:not([open]) { display: none; }
.aed-tour-panel::backdrop { background: rgba(12,23,27,.72); }
.aed-tour-surface { display: flex; flex: 1; flex-direction: column; min-height: 0; background: var(--svc-card); }
.aed-tour-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--svc-accent) var(--svc-card); }
/* Lock the background without losing the visitor's reading position, including on iOS. */
html.aed-tour-modal-open { overflow: hidden; }
html.aed-tour-modal-open body {
	position: fixed; top: var(--aed-tour-page-top); left: var(--aed-tour-page-left);
	right: var(--aed-tour-page-gutter); width: auto; overflow: hidden;
}
/* The dialog stays modal while fading out; no page expansion or automatic scrolling. */
@keyframes aedTourPanelOpen {
	from { opacity: 0; transform: translateY(12px) scale(.985); }
	to { opacity: 1; transform: none; }
}
@keyframes aedTourPanelClose {
	from { opacity: 1; transform: none; }
	to { opacity: 0; transform: translateY(8px) scale(.99); }
}
@keyframes aedTourBackdropOpen { from { opacity: 0; } to { opacity: 1; } }
@keyframes aedTourBackdropClose { from { opacity: 1; } to { opacity: 0; } }
@media screen and (prefers-reduced-motion: no-preference) {
	.aed-tour-panel.is-opening { animation: aedTourPanelOpen 240ms cubic-bezier(.22,.61,.36,1) both; }
	.aed-tour-panel.is-closing { animation: aedTourPanelClose 180ms ease-in both; pointer-events: none; }
	.aed-tour-panel.is-opening::backdrop { animation: aedTourBackdropOpen 240ms ease-out both; }
	.aed-tour-panel.is-closing::backdrop { animation: aedTourBackdropClose 180ms ease-in both; }
}
.aed-tour-heading-row { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--svc-line); background: var(--svc-card); }
.aed-services .aed-tour-heading-row h4 { font: 600 1.15rem/1.4 var(--font-sans); letter-spacing: -.02em; }
.aed-services .aed-tour-heading-row p { font-size: .78rem; line-height: 1.6; margin-top: 5px; }
.aed-services .aed-tour-control { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 44px; min-height: 44px; max-width: 100%; padding: 9px 13px; border: 1px solid var(--svc-line); border-radius: 4px 10px 4px 10px; color: inherit; background: var(--svc-card); font: 550 .82rem/1.4 var(--font-sans); cursor: pointer; box-shadow: none; text-align: center; transition: border-color .18s, background .18s; }
.aed-tour-control i { font-size: .85em; }
.aed-services .aed-tour-control:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--svc-accent); background: var(--svc-art-center); }
.aed-services .aed-tour-control:disabled { opacity: .5; cursor: default; }
.aed-services .aed-tour-control[aria-disabled="true"]:not(:disabled) { cursor: progress; }
.aed-services .aed-tour-control[aria-current="location"] { border-color: var(--svc-accent); background: var(--svc-tint); box-shadow: inset 0 -3px var(--svc-accent); font-weight: 700; }
.aed-tour-heading-row > button { flex-shrink: 0; }
.aed-tour-stage { position: relative; margin-inline: auto; background: #272d2c; }
.aed-services .aed-tour-view { width: 100%; height: auto; aspect-ratio: 16 / 9; background: #272d2c; }
/* Unlike overflow:hidden, clip cannot scroll the canvas to an offscreen marker. */
.aed-services .aed-tour-view { overflow: clip; }
.aed-services .aed-tour-view:focus-visible { outline: 3px solid var(--svc-accent); outline-offset: -5px; }
.aed-tour-controls { position: absolute; inset: auto 16px 16px; z-index: 3; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; pointer-events: none; }
.aed-tour-controls > div { pointer-events: auto; }
.aed-tour-look-controls { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 3px; }
.aed-tour-look-controls [data-tour-look="up"] { grid-area: 1 / 2; }
.aed-tour-look-controls [data-tour-look="left"] { grid-area: 2 / 1; }
.aed-tour-look-controls [data-tour-reset] { grid-area: 2 / 2; }
.aed-tour-look-controls [data-tour-look="right"] { grid-area: 2 / 3; }
.aed-tour-look-controls [data-tour-look="down"] { grid-area: 3 / 2; }
.aed-tour-view-controls { display: flex; gap: 6px; }
.aed-services .aed-tour-controls .aed-tour-control { width: 44px; height: 44px; padding: 9px; color: #f9f7f2; background: rgba(22,31,32,.88); border-color: rgba(255,255,255,.55); border-radius: 7px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.aed-services .aed-tour-controls .aed-tour-control:hover:not([aria-disabled="true"]) { background: #223334; border-color: #d6ab85; }
.aed-services .aed-tour-controls .aed-tour-control:active:not([aria-disabled="true"]) { box-shadow: inset 0 0 0 2px currentColor; }
.aed-tour-navigation { container-type: inline-size; display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: center; gap: 18px; padding: 12px 20px; border-top: 1px solid var(--svc-line); }
.aed-tour-map { display: block; width: 72px; height: 108px; background: var(--svc-art); border: 1px solid var(--svc-line); border-radius: 3px; padding: 4px; }
.aed-tour-map-floor { fill: var(--svc-card); }
.aed-tour-map-wall { fill: var(--svc-muted); }
.aed-tour-map-glazing { fill: none; stroke: var(--svc-accent); stroke-width: 6; }
.aed-tour-map circle { fill: var(--svc-card); stroke: var(--svc-muted); stroke-width: 7; }
.aed-tour-map text { fill: currentColor; font: 600 36px var(--font-sans); }
.aed-tour-map .is-current circle { fill: var(--svc-accent); stroke: var(--svc-accent); stroke-width: 16; }
.aed-tour-map .is-current text { fill: #fff; }
html[data-theme="dark"] .aed-tour-map .is-current text { fill: #151c1d; }
.aed-tour-room-details { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px 16px; }
.aed-services .aed-tour-nav-label { grid-column: 1 / -1; margin: 0; color: var(--svc-accent); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; }
.aed-tour-rooms { display: flex; flex-wrap: wrap; gap: 6px; }
.aed-tour-number { font-size: .72rem; opacity: .7; font-variant-numeric: tabular-nums; }
.aed-services .aed-tour-room-details > p[data-tour-description] { grid-column: 1 / -1; margin: 0; max-width: 88ch; font-size: .84rem; line-height: 1.6; }
.aed-tour-steps { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 8px; }
.aed-services .aed-tour-steps .aed-tour-control { padding-inline: 10px; background: transparent; border-color: transparent; }
.aed-services .aed-tour-steps .aed-tour-control:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--svc-line); background: var(--svc-tint); }
.aed-tour-steps > span { color: var(--svc-muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
/* Respond to the height-limited modal's own width, not just the browser width. */
@container (max-width: 800px) {
	.aed-tour-rooms { grid-column: 1 / -1; }
	.aed-services .aed-tour-room-details > p[data-tour-description] { grid-column: 1; grid-row: 3; }
	.aed-tour-steps { grid-row: 3; }
}
.aed-services .aed-tour-help { margin: 0; padding: 0 20px; border-top: 1px solid var(--svc-line); font-size: .8rem; line-height: 1.65; background: var(--svc-art); }
.aed-tour-help > summary { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 0; color: inherit; cursor: pointer; font-weight: 600; list-style: none; }
.aed-tour-help > summary::-webkit-details-marker { display: none; }
.aed-tour-help > summary > i:last-child { margin-left: auto; font-size: .75em; transition: transform .18s ease; }
.aed-tour-help[open] > summary > i:last-child { transform: rotate(180deg); }
.aed-services .aed-tour-help > p { margin: 0; padding: 0 0 14px; max-width: 100ch; font-size: inherit; line-height: inherit; }
/* Live announcements stay available without repeating the visible description. */
.aed-tour-status, .aed-tour:not(.has-error) > .aed-tour-error { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.aed-tour.has-error > .aed-tour-error { padding: 16px 20px; margin-top: 22px; border-left: 3px solid var(--svc-accent); background: var(--svc-art); font-size: .9rem; }
/* Page anchor offsets are inappropriate inside the independently scrolling dialog. */
.aed-services .aed-tour-panel :is(button, summary, [tabindex]) { scroll-margin-block: 12px; }
.aed-services .aed-tour button:focus-visible, .aed-services .aed-tour-help > summary:focus-visible, .aed-services .aed-tour-open:focus-visible { outline: 3px solid var(--svc-accent); outline-offset: 4px; }
.aed-services .aed-tour-controls button:focus-visible, .aed-services .aed-tour-hotspot-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #17384e; }
.aed-services .aed-tour-hotspot { width: 0; height: 0; }
.aed-services .aed-tour-hotspot-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 13px 8px 9px; border: 1px solid rgba(255,255,255,.9); border-radius: 24px; color: #183333; background: rgba(255,252,246,.96); box-shadow: 0 3px 16px rgba(0,0,0,.18); font: 600 .78rem/1.4 var(--font-sans); white-space: nowrap; cursor: pointer; transform: translate(-50%,-50%); }
.aed-tour-hotspot-button > span:first-child { display: inline-grid; place-items: center; width: 25px; height: 25px; color: #fff; background: #244b4a; border-radius: 50%; font-size: 1rem; }
.aed-services .aed-tour-hotspot-button:hover { background: #fff; border-color: #244b4a; }
.aed-tour-view .pnlm-panorama-info, .aed-tour-view .pnlm-about-msg, .aed-tour-view .pnlm-error-msg { display: none; }
.aed-tour-surface:fullscreen { width: 100%; height: 100vh; height: 100dvh; max-height: none; color: var(--color-text, #1e292b); }
html[data-theme="dark"] .aed-tour-surface:fullscreen { color: #edf0e9; }
.aed-tour-surface:fullscreen .aed-tour-body { flex: 1; background: var(--svc-art); }
.aed-tour-surface:fullscreen :is(.aed-tour-stage, .aed-tour-navigation, .aed-tour-help) { width: min(100%, max(640px, calc((100dvh - 280px) * 1.77778))); margin-inline: auto; }
.aed-tour-surface:fullscreen .aed-tour-navigation { background: var(--svc-card); }
@media (max-width: 920px) {
	/* Native reading order: heading, preview image, explanation, then the optional viewer. */
	.aed-svc-tour-example { grid-template-columns: minmax(0,1fr); gap: 20px; }
	.aed-svc-tour-example > :is(.aed-svc-tour-heading, .aed-svc-tour-image, .aed-svc-tour-copy, .aed-tour) { grid-column: auto; grid-row: auto; }
	.aed-svc-tour-image { width: 100%; max-width: 640px; justify-self: center; }
	.aed-services .aed-svc-tour-heading { text-align: center; }
	.aed-services .aed-svc-tour-heading h3 { max-width: 34ch; margin-inline: auto; }
	.aed-tour-panel { width: 100%; height: 100vh; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
	.aed-tour-surface { height: 100%; }
	.aed-tour-body { flex: 1; padding-bottom: env(safe-area-inset-bottom); }
	.aed-tour-heading-row { padding-top: max(16px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}
@media (max-width: 640px) {
	.aed-tour-heading-row { gap: 12px; padding-bottom: 16px; align-items: flex-start; }
	.aed-tour-heading-row > button { width: 44px; padding: 10px; }
	.aed-tour-heading-row > button > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
	.aed-services .aed-tour-view { height: clamp(240px, 43vh, 420px); height: clamp(240px, 43dvh, 420px); aspect-ratio: auto; }
	.aed-tour-navigation { grid-template-columns: 80px minmax(0,1fr); align-items: start; gap: 14px; padding: 18px 16px; }
	.aed-tour-map { width: 80px; height: 120px; padding: 4px; }
	.aed-tour-rooms { gap: 6px; }
	.aed-tour-rooms .aed-tour-control { width: 100%; justify-content: flex-start; text-align: left; }
	.aed-tour-room-details { display: contents; }
	.aed-services .aed-tour-nav-label { grid-column: 1 / -1; grid-row: 1; margin: 0; }
	.aed-tour-map { grid-row: 2; }
	.aed-tour-rooms { grid-column: 2; grid-row: 2; }
	.aed-services .aed-tour-room-details > p[data-tour-description] { grid-column: 1 / -1; grid-row: auto; margin: 0; }
	.aed-tour-steps { grid-column: 1 / -1; grid-row: auto; justify-content: center; margin-top: 0; }
	.aed-services .aed-tour-help { padding-inline: 16px; }
}
/* Keep controls below the image on tablets, phones and short landscape windows. */
@media (max-width: 920px), (max-height: 520px) {
	.aed-tour-controls { position: static; justify-content: center; align-items: center; gap: clamp(24px, 6vw, 48px); padding: 10px 12px; background: var(--svc-art); border-top: 1px solid var(--svc-line); }
	.aed-tour-view-controls { display: grid; grid-template-columns: repeat(2,44px); gap: 6px; }
	.aed-tour-view-controls [data-tour-fullscreen] { grid-column: 1 / -1; justify-self: center; }
	.aed-services .aed-tour-controls .aed-tour-control { color: inherit; background: var(--svc-card); border-color: var(--svc-line); box-shadow: none; }
	.aed-services .aed-tour-controls .aed-tour-control:hover:not([aria-disabled="true"]) { background: var(--svc-art-center); border-color: var(--svc-accent); }
	.aed-services .aed-tour-controls button:focus-visible { outline-color: var(--svc-accent); outline-offset: 2px; box-shadow: none; }
	.aed-tour-surface:fullscreen .aed-tour-stage { width: 100%; }
}
@media (max-height: 520px) and (min-width: 641px) {
	/* Use the side space for controls so looking around never hides the image. */
	.aed-tour-stage, .aed-tour-surface:fullscreen .aed-tour-stage { width: 100%; background: var(--svc-card); }
	.aed-services .aed-tour-view { width: min(calc(100% - 310px), calc((100dvh - 100px) * 1.77778)); height: auto; aspect-ratio: 16 / 9; margin-inline: auto; }
	.aed-tour-controls { position: absolute; inset: 0 10px; justify-content: space-between; align-items: center; padding: 0; border: 0; background: transparent; }
}
@media (max-width: 520px) {
	.aed-services .aed-tour-open { display: flex; width: 100%; max-width: 400px; margin-inline: auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .aed-services .aed-tour button, .aed-services .aed-tour-open, .aed-tour-preview-cue > span, .aed-tour-help > summary > i { transition: none; } }
@media (forced-colors: active) {
	.aed-tour-preview-cue { color: ButtonText; background: ButtonFace; border-color: ButtonText; }
	.aed-services .aed-tour-preview-open:focus-visible { outline-color: Highlight; box-shadow: none; }
	.aed-svc-tour-invitation::after { display: none; }
	.aed-svc-tour-invitation { grid-template-columns: minmax(0, 1fr); }
	.aed-tour-panel, .aed-tour-control, .aed-tour-map, .aed-tour-hotspot-button { border-color: CanvasText !important; }
	.aed-services .aed-tour-controls .aed-tour-control { color: ButtonText; background: ButtonFace; border-color: ButtonText !important; }
	.aed-tour-map .is-current circle { fill: Highlight; stroke: Highlight; }
	.aed-tour-map .is-current text { fill: HighlightText; }
	.aed-services .aed-tour-control[aria-current] { outline: 2px solid Highlight; }
}
@media print {
	.aed-tour, .aed-tour-open, .aed-tour-preview-open, .aed-svc-tour-invitation::after { display: none !important; }
	.aed-svc-tour-invitation { display: block; }
}
