/* ================================================================
   Minimal embed shells (tour brand wrap, scan iframe, powered-by bar)
   Loaded only by standalone embed HTML — not part of marketing bundle.
================================================================ */

/* ── /share/tour-wrap/… — iframe row + in-flow footer ───────── */
html.tour-brand-wrap-root,
html.tour-brand-wrap-root body {
  margin: 0;
  height: 100%;
  background: #0a0a0a;
  overflow: hidden;
}

body.tour-brand-wrap {
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  width: 100%;
  margin: 0;
  overflow: hidden;
}

.tour-brand-wrap__frame {
  min-height: 0;
  min-width: 0;
  position: relative;
}

.tour-brand-wrap__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Scan landing page (/scans/:slug — full-viewport, no chrome) ─ */
html.scan-landing-page-root,
html.scan-landing-page-root body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: #000;
  overflow: hidden;
}

.scan-landing-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.scan-landing-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ── Scan landing embed (full-viewport tour only) ────────────── */
html.scan-landing-embed-page,
html.scan-landing-embed-page body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
}

.scan-landing-embed-shell {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.scan-landing-embed-root {
  position: absolute;
  inset: 0;
}

.scan-landing-embed-root iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.scan-landing-sr-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Powered-by footer (tour-wrap iframe) ───────────────────── */
.vab-embed-powered-by {
  /* One semi-transparent gray for label, wordmark, and logo treatment. */
  --vab-embed-pb-fg: rgba(200, 200, 208, 0.62);
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  container-type: inline-size;
  container-name: embed-footer;
  padding: 10px 14px;
  /* Manrope loads when pages include `marketing-manrope-fonts`; fallbacks match Base44. */
  font-family: Manrope, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  color: var(--vab-embed-pb-fg);
  line-height: 1.35;
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  background: rgba(22, 22, 24, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .vab-embed-powered-by {
    background: rgba(28, 28, 30, 0.94);
  }
}

/* ── Proxied /share/tour/… showcase: host + injected footer (script adds html.vab-embed-tour) */
html.vab-embed-tour,
html.vab-embed-tour body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: #0a0a0a;
  /* Removes white sliver when WebGL or tray does not cover full viewport. */
}

html.vab-embed-tour #bottom-ui,
html.vab-embed-tour .bottom-ui {
  background: #0a0a0a !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-sizing: border-box !important;
}

html.vab-embed-tour .overlay-action-bar {
  margin-bottom: 0 !important;
}

/* ── Fix: force bottom-controls to full tray width immediately on first paint.
   Matterport's collapsible-list animates open from 8px → 425px, which causes the
   right-side buttons (fullscreen/VR) to appear mid-tray and then jump right.
   With full width forced, right-side buttons start at the right edge. ── */
html.vab-embed-tour .bottom-ui .bottom-controls {
  width: calc(100% - 40px) !important;
  min-width: calc(100% - 40px) !important;
  box-sizing: border-box !important;
}

/* Quality toggle */
html.vab-embed-tour #vabQualityHost.vab-qb-tray {
  display: flex;
  align-items: center !important;
  align-self: center !important;
  flex-shrink: 0 !important;
  margin-right: 4px !important;
}

html.vab-embed-tour #vabQualityHost.vab-qb-tray {
  background: #0a0a0a !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-sizing: border-box !important;
  padding: 0 2px !important;
}

html.vab-embed-tour #vabQualityHost .vab-qt {
  background: #0a0a0a !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: none !important;
}

html.vab-embed-tour #vabQualityHost .vab-qb {
  color: rgba(255, 255, 255, 0.7) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

html.vab-embed-tour #vabQualityHost .vab-qb.active {
  color: #0a0a0a !important;
  background: rgba(249, 247, 245, 0.95) !important;
  border-color: rgba(249, 247, 245, 0.95) !important;
}

/*
  Injected bar at top of viewport: pointer-events none except brand link so player UI still gets events.
  Pre-play: hidden above fold; post-play: slides in from top.
 */
html.vab-embed-tour {
  --vab-embed-pb-top-safe: max(env(safe-area-inset-top, 0px), 0px);
}

.vab-embed-powered-by.vab-embed-powered-by--tour-injected {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vab-embed-pb-top-safe, 0px);
  bottom: auto;
  box-sizing: border-box;
  z-index: 8000000;
  pointer-events: none;
  /* Bar chrome unchanged; black copy; left cluster + Home on the right (see active padding for safe-area). */
  --vab-embed-pb-fg: #0a0a0a;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  column-gap: 12px;
  row-gap: 6px;
  transition:
    opacity 0.32s ease,
    transform 0.32s ease,
    max-height 0.32s ease,
    padding 0.32s ease,
    border-width 0.32s ease;
}

.vab-tour-site-header.vab-embed-powered-by--tour-injected {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vab-embed-pb-top-safe, 0px);
  bottom: auto;
  z-index: 8000000;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  width: 100%;
  padding: 9px max(14px, env(safe-area-inset-right, 0px)) 9px max(14px, env(safe-area-inset-left, 0px));
  font-family: Manrope, 'Segoe UI', system-ui, sans-serif;
  color: hsl(20, 14%, 8%);
  background: rgba(249, 247, 245, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(22, 18, 12, 0.1);
  box-shadow: 0 8px 22px rgba(22, 18, 12, 0.12);
  pointer-events: none;
  transition:
    opacity 0.32s ease,
    transform 0.32s ease,
    max-height 0.32s ease,
    padding 0.32s ease,
    border-width 0.32s ease;
}

.vab-tour-site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.vab-tour-site-header__brand img {
  display: block;
  width: auto;
  height: 24px;
  object-fit: contain;
  filter: brightness(0);
}

.vab-tour-site-header__wordmark {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.vab-tour-site-header__wordmark strong {
  color: #0a0a0a;
  font-weight: 800;
}

.vab-tour-site-header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.vab-tour-site-header__nav a {
  color: #0a0a0a;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 9px;
  pointer-events: auto;
}

.vab-tour-site-header__nav a:hover,
.vab-tour-site-header__nav a:focus-visible {
  color: #0a0a0a;
  background: rgba(0, 0, 0, 0.1);
  outline: none;
}

.vab-tour-site-header__nav .vab-tour-site-header__cta {
  border: 1.5px solid rgba(22, 18, 12, 0.3);
  background: rgba(22, 18, 12, 0.06);
}

@media (max-width: 430px) {
  .vab-tour-site-header__nav a:not(.vab-tour-site-header__cta) {
    display: none;
  }
}

/* Pre-play: no visible band, no pointer capture. */
html.vab-embed-tour:not(.vab-embed-pb--active) .vab-embed-powered-by--tour-injected {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  pointer-events: none;
}

/* After play: show bar; only the “Powered by” link captures clicks. */
html.vab-embed-tour.vab-embed-pb--active .vab-embed-powered-by--tour-injected {
  opacity: 1;
  visibility: visible;
  transform: none;
  max-height: 120px;
  pointer-events: none;
  padding: 10px max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

html.vab-embed-tour.vab-embed-pb--active .vab-tour-site-header.vab-embed-powered-by--tour-injected {
  min-height: 56px;
  padding: 9px max(14px, env(safe-area-inset-right, 0px)) 9px max(14px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(22, 18, 12, 0.1);
  box-shadow: 0 8px 22px rgba(22, 18, 12, 0.12);
}

html.vab-embed-tour.vab-embed-pb--active body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 7999998;
  pointer-events: none;
  border-left: 1px solid rgba(22, 18, 12, 0.1);
  border-right: 1px solid rgba(22, 18, 12, 0.1);
  box-sizing: border-box;
}

html.vab-embed-tour footer[class^="error-page__footer"],
html.vab-embed-tour footer[class*=" error-page__footer"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
}

html.vab-embed-tour .vab-embed-powered-by--tour-injected .vab-embed-powered-by__brand,
html.vab-embed-tour .vab-embed-powered-by--tour-injected .vab-embed-powered-by__back {
  pointer-events: auto;
}

/* Same-window link to main site; kept visually aligned with the gray bar. */
.vab-embed-powered-by__back {
  align-self: center;
  text-decoration: none;
  color: var(--vab-embed-pb-fg);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  margin: -4px 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}

.vab-embed-powered-by__back:hover,
.vab-embed-powered-by__back:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

/* Tour top bar: black Home pill + dark hover (overrides generic __back:hover above). */
html.vab-embed-tour .vab-embed-powered-by--tour-injected .vab-embed-powered-by__back {
  color: #0a0a0a;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.12);
}
html.vab-embed-tour .vab-embed-powered-by--tour-injected .vab-embed-powered-by__back:hover,
html.vab-embed-tour .vab-embed-powered-by--tour-injected .vab-embed-powered-by__back:focus-visible {
  color: #0a0a0a;
  border-color: rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.28);
  outline: none;
}

.vab-embed-powered-by--tour-injected .vab-embed-powered-by__center {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 14px;
  min-width: 0;
  max-width: 100%;
}
.vab-embed-powered-by--tour-injected .vab-embed-powered-by__back {
  flex: 0 0 auto;
}

/* Monochrome “View As-Built” mark + house mark read as black on the gray bar. */
html.vab-embed-tour .vab-embed-powered-by--tour-injected .vab-embed-powered-by__brand img {
  filter: grayscale(1) brightness(0.28);
  opacity: 1;
}

.vab-embed-powered-by__text {
  white-space: nowrap;
  color: var(--vab-embed-pb-fg);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.vab-embed-powered-by__brand {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: calc(var(--logo-house-h) * 0.88);
  text-decoration: none;
  color: var(--vab-embed-pb-fg);
  overflow: visible;
  max-width: min(100%, 240px);
  padding: 2px 4px;
  box-sizing: border-box;
  --logo-house-h: clamp(11px, min(14px, 10cqw), 14px);
}

.vab-embed-powered-by__brand img {
  display: block;
  height: var(--logo-house-h);
  width: auto;
  max-width: min(44px, 18vw);
  object-fit: contain;
  flex-shrink: 0;
  transform: scale(1.08);
  transform-origin: left center;
  filter: grayscale(1);
  opacity: 0.78;
}

.vab-embed-powered-by__wordmark {
  font-weight: 600;
  font-size: calc(var(--logo-house-h) * 1.06);
  letter-spacing: 0.035em;
  line-height: 1.05;
  white-space: nowrap;
  min-width: 0;
}

.vab-embed-powered-by__wordmark-view,
.vab-embed-powered-by__wordmark-asbuilt {
  color: var(--vab-embed-pb-fg);
  font-weight: 600;
}
