html, body { overflow: hidden; }
#viewer { position: fixed; inset: 0; }

/* Brand overlay */
.brand {
  position: fixed; top: 0; left: 0; z-index: 90;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px 28px;
  pointer-events: none;
  isolation: isolate;
}
/* soft shade behind the logo: fades out to the right and downward, no edge */
.brand::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  top: 0; left: 0; right: -160px; bottom: -70px;
  background: radial-gradient(ellipse 100% 100% at 0 0, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.22) 42%, rgba(0,0,0,0.06) 70%, rgba(0,0,0,0) 100%);
}
.brand img { height: 22px; width: auto; display: block; }
.brand__text { border-left: 1px solid rgba(255,255,255,0.3); padding-left: 14px; line-height: 1.25; }
.brand__title { font-weight: 500; font-size: 15px; }
.brand__client { font-size: 12px; color: rgba(255,255,255,0.7); }
.brand__client:empty { display: none; }
.brand--no-logo .brand__text { border-left: 0; padding-left: 0; }
body.is-embed .brand { padding: 12px 14px 20px; }
body.is-embed .brand img { height: 16px; }
body.is-embed .brand__title { font-size: 13px; }

/* Lock + message screens */
.screen {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 24px;
  background: var(--ink);
}
.lock { width: min(360px, 100%); display: grid; gap: 14px; text-align: left; }
.lock__logo { height: 26px; width: auto; margin-bottom: 18px; }
.lock__title { margin: 0 0 6px; font-weight: 400; font-size: 26px; line-height: 1.2; }
.lock__error { margin: 0; color: var(--danger); font-size: 14px; }

/* Photo Sphere Viewer — quiet, square, on-brand */
.psv-container { font-family: var(--sans); background: var(--ink); }
.psv-navbar { background: rgba(14,14,14,0.72); backdrop-filter: blur(8px); height: 44px; }
.psv-button { border-radius: 0; }
.psv-caption-content { font-family: var(--sans); font-size: 14px; }
/* loader: thin quiet ring instead of the default filled disc */
.psv-loader { color: rgba(255,255,255,0.85); background: transparent; width: 56px; height: 56px; }
.psv-loader-canvas { color: rgba(255,255,255,0.85); }
.psv-loader-text { display: none; }
.psv-tooltip { border-radius: 0; background: rgba(14,14,14,0.92); font-family: var(--sans); }
.psv-tooltip-content { padding: 10px 14px; font-size: 14px; line-height: 1.45; max-width: 320px; }
.psv-tooltip-content h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.psv-tooltip-content p { margin: 0; color: var(--text-muted); white-space: pre-line; }
.psv-tooltip-arrow { color: rgba(14,14,14,0.92); }
.psv-tooltip.hs3-label { background: rgba(14,14,14,0.72); backdrop-filter: blur(6px); }
.psv-tooltip.hs3-label .psv-tooltip-content { padding: 6px 10px; font-size: 13px; letter-spacing: 0.01em; white-space: nowrap; }
.psv-tooltip.hs3-label .psv-tooltip-arrow { color: rgba(14,14,14,0.72); }
.psv-tooltip.hs3-card { background: rgba(14,14,14,0.86); backdrop-filter: blur(8px); }
body.info-open .psv-tooltip.hs3-label { display: none; }
.psv-tooltip.hs3-card .psv-tooltip-arrow { color: rgba(14,14,14,0.86); }
.psv-gallery { background: rgba(14,14,14,0.8); }
.psv-gallery-item-thumb { border-radius: 0; }
.psv-gallery-item--active { outline: 2px solid var(--accent); outline-offset: -2px; }
.psv-gallery-item-title { font-family: var(--sans); }

/* Hotspots */
/* 3D hotspots. Sizes are scene units, not screen pixels: at the default zoom
   1 unit ≈ 0.6 px, and they grow and shrink with zoom like part of the room. */
.hs3 { cursor: pointer; opacity: 0.72; transition: opacity 0.2s ease, transform 0.2s ease; }
.hs3:hover { opacity: 1; transform: scale(1.08); }
.hs3 svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hs3--floor { width: 100px; height: 100px; }
.hs3--wall { width: 62px; height: 62px; }
.hs3--info { width: 48px; height: 48px; }

.hs3-shadow { fill: none; stroke: rgba(0, 0, 0, 0.16); stroke-width: 3; }
.hs3-disc { fill: rgba(255, 255, 255, 0.14); transition: fill 0.2s ease; }
.hs3--wall .hs3-disc, .hs3--info .hs3-disc { fill: rgba(14, 14, 14, 0.28); }
.hs3-ring { fill: none; stroke: rgba(255, 255, 255, 0.92); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.hs3-glyph { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.hs3-glyph--faint { opacity: 0.45; }
.hs3-dot { fill: #fff; }
.hs3:hover .hs3-disc { fill: rgba(255, 255, 255, 0.3); }
.hs3--wall:hover .hs3-disc, .hs3--info:hover .hs3-disc { fill: rgba(14, 14, 14, 0.5); }

/* editor: selected hotspot */
.psv-marker.is-selected .hs3 { opacity: 1; }
.psv-marker.is-selected .hs3-ring { stroke: var(--accent); stroke-width: 4; }
.psv-marker.is-selected .hs3-disc { fill: rgba(246, 133, 31, 0.35); }

/* ---------- shared glass surface (plan, versions, info card) ---------- */
.versions, .plan, .infocard {
  background: rgba(14, 14, 14, 0.62);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  color: var(--text-primary);
  font-family: var(--sans);
}

/* ---------- room versions switcher ---------- */
.versions {
  position: fixed; z-index: 95; top: 18px; left: 50%; transform: translateX(-50%);
  display: flex; padding: 3px; gap: 2px;
}
.versions button {
  height: 32px; padding: 0 14px; border: 0; background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: 13px; letter-spacing: 0.02em; white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.versions button:hover { color: var(--text-primary); }
.versions button.is-on { background: rgba(255, 255, 255, 0.92); color: var(--ink); }
body.is-embed .versions { top: 12px; }

/* ---------- floor plan ---------- */
.plan {
  position: fixed; z-index: 95; left: 16px; bottom: 60px;
  width: min(340px, calc(100vw - 32px));
  display: flex; flex-direction: column;
  transition: width 0.25s ease;
}
.plan--large { width: min(720px, calc(100vw - 32px)); }
.plan__head { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; min-height: 40px; }
.plan__tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.plan__tabs button { height: 28px; padding: 0 10px; border: 0; background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; white-space: nowrap; }
.plan__tabs button.is-on { color: var(--text-primary); box-shadow: inset 0 -1px 0 var(--accent); }
.plan__title { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.plan__icon { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.plan__icon:hover { color: var(--text-primary); }
.plan__icon svg { width: 16px; height: 16px; }
.plan__frame { position: relative; margin: 0 10px 10px; max-height: calc(100vh - 180px); }
.plan__frame img { display: block; width: 100%; height: 100%; object-fit: contain; background: #f4f2ee; opacity: 0.94; }
.plan__spots { position: absolute; inset: 0; }
.spot {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0;
  border: 0; background: transparent; cursor: pointer; display: grid; place-items: center;
}
.spot i {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(14, 14, 14, 0.55); border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, background 0.15s ease;
}
.spot:hover i { transform: scale(1.3); background: var(--accent); }
.spot--here i { width: 12px; height: 12px; background: var(--accent); border-color: #fff; }
.spot__cone { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none; transform-origin: 50% 50%; }
.spot__cone path { fill: rgba(246, 133, 31, 0.32); stroke: rgba(246, 133, 31, 0.7); stroke-width: 1; }
@media (max-width: 600px) {
  .plan, .plan--large { left: 8px; right: 8px; width: auto; bottom: 56px; }
}

/* ---------- info card ---------- */
.infocard {
  position: fixed; z-index: 120; right: 16px; top: 50%; transform: translateY(-50%);
  width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow-y: auto;
  animation: infocard-in 0.22s ease;
}
@keyframes infocard-in { from { opacity: 0; transform: translate(8px, -50%); } }
.infocard__close {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px;
  display: grid; place-items: center; border: 0; cursor: pointer;
  background: rgba(14, 14, 14, 0.55); color: #fff;
}
.infocard__close svg { width: 16px; height: 16px; }
.infocard__media img { display: block; width: 100%; height: auto; }
.infocard__media iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.infocard__body { padding: 18px 20px 22px; display: grid; gap: 10px; }
.infocard__title { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.3; padding-right: 28px; }
.infocard__media:not([hidden]) + .infocard__body .infocard__title { padding-right: 0; }
.infocard__text { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; white-space: pre-line; }
.infocard__link { justify-self: start; margin-top: 4px; }
@media (max-width: 600px) {
  .infocard { left: 8px; right: 8px; width: auto; top: auto; bottom: 56px; transform: none; max-height: 60vh; }
  @keyframes infocard-in { from { opacity: 0; transform: translateY(8px); } }
}
