/* In-app Street View overlay — Google-like immersive shell. */
.sv-overlay {
  position: fixed;
  inset: 0;
  z-index: 4200;
  display: flex;
  flex-direction: column;
  background: #0b0d10;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.sv-overlay:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sv-overlay[hidden] {
  display: none !important;
}

.sv-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.28));
  z-index: 2;
}

.sv-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sv-meta {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.85;
}

.sv-tool-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
}

.sv-tool-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.sv-stage {
  flex: 1;
  position: relative;
  min-height: 0;
  background: #111;
}

.sv-stage-inner,
.sv-iframe,
.sv-canvas-host,
#svPannellum {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sv-still {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: #0b0d10;
}

.sv-still.is-dragging {
  cursor: grabbing;
}

.sv-still img {
  max-width: none;
  height: 100%;
  width: auto;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.sv-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at center, rgba(26, 115, 232, 0.18), transparent 55%),
    #111;
  color: #e8eaed;
  z-index: 2;
}

.sv-empty[hidden] {
  display: none !important;
}

.sv-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(420px, 92vw);
  padding: 28px 24px;
  border-radius: 16px;
  background: rgba(32, 33, 36, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.sv-empty-card strong,
#svEmptyTitle {
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
}

.sv-empty-card span,
#svEmptyDetail {
  opacity: 0.88;
  font-size: 0.92rem;
  line-height: 1.5;
}

.sv-empty-close {
  margin-top: 6px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sv-empty-close:hover {
  background: #1765cc;
}

.sv-empty-close:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 3px;
}

.sv-filmstrip {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sv-film-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #2a2d31;
  padding: 0;
  cursor: pointer;
}

.sv-film-thumb.is-active {
  border-color: #1a73e8;
}

.sv-film-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/*
 * Pegman lives inside #mapControlsBr (flex column) so it stacks cleanly
 * above Locate / 3D / zoom — never as a free-floating overlap on top of them.
 */
.sv-pegman,
html.consumer-ui .map-controls-br > .sv-pegman {
  position: relative;
  inset: auto;
  right: auto;
  bottom: auto;
  z-index: 1;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  margin: 0;
  border-radius: 50%;
  border: 1px solid rgba(60, 64, 67, 0.16);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: grab;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
  color: #1a73e8;
  pointer-events: auto;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}

.sv-pegman:active,
.sv-pegman.is-dragging {
  cursor: grabbing;
  transform: scale(1.06);
}

.sv-pegman[aria-pressed='true'] {
  background: #e8f0fe;
  color: #174ea6;
  border-color: #aecbfa;
}

/* Drop hint is pick-mode only — never a permanent Explore chrome toast. */
.sv-coverage-hint {
  position: absolute;
  left: 50%;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 96px);
  transform: translateX(-50%) translateY(6px);
  z-index: 94;
  background: rgba(32, 33, 36, 0.88);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  max-width: min(92vw, 420px);
  text-align: center;
}

.sv-coverage-hint[hidden] {
  display: none !important;
}

.sv-coverage-hint.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

html.sv-active .live-nav-hud,
html.sv-active .side-panel-stack {
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 900px) {
  .sv-pegman,
  html.consumer-ui .map-controls-br > .sv-pegman {
    width: var(--m-ctrl, 48px);
    height: var(--m-ctrl, 48px);
    min-width: var(--m-ctrl, 48px);
    min-height: var(--m-ctrl, 48px);
    border-radius: 50%;
    box-shadow: var(--m-shadow-float, 0 2px 8px rgba(60, 64, 67, 0.28));
    font-size: 1.35rem;
  }

  .sv-coverage-hint {
    /* Clear bottom nav + dirs + locate + pegman column. */
    bottom: calc(
      var(--af-bottom-chrome, 72px)
      + 12px
      + var(--af-sheet-clearance, 0px)
      + var(--m-dirs-fab, 48px)
      + 10px
      + var(--m-ctrl, 48px)
      + 10px
      + var(--m-ctrl, 48px)
      + 14px
    );
  }
}
