/* Canvas, part labels and projected in-car navigation. */
.scene-preview { position: absolute; inset: 0; overflow: hidden; background: #101315; }
#scene, #garage-poster { display: block; width: 100%; height: 100%; }
#scene { opacity: 0; touch-action: pan-y; }
#garage-poster { position: absolute; inset: 0; z-index: 1; object-fit: cover; pointer-events: none; }
.scene-ready #scene { opacity: 1; }
.scene-ready #garage-poster { opacity: 0; visibility: hidden; transition: opacity 260ms ease-out, visibility 0s 260ms; }
@media (prefers-reduced-motion: reduce) { .scene-ready #garage-poster { transition: none; } }
/* The car's screen is drawn once in WebGL. Only its touch targets are projected. */
#car-navigation {
  position: absolute; inset: 0 auto auto 0; z-index: 7; width: 960px; height: 540px;
  transform-origin: 0 0; pointer-events: none;
}
#car-navigation[hidden] { display: none; }
#car-navigation > * {
  position: absolute; display: block; pointer-events: auto;
  background: transparent; border: 0; padding: 0; margin: 0;
}
#car-navigation > :focus-visible { outline: 4px solid #fff; outline-offset: -6px; }
.gps-back { top: 0; right: 0; width: 22%; height: 12%; }
.gps-directions { left: 0; top: 0; width: 53.125%; bottom: 0; }
.gps-call { left: 53.125%; top: 62%; right: 0; bottom: 14%; }
.gps-quote { left: 53.125%; top: 86%; right: 0; bottom: 0; }
/* Existing part-label styling and timing retained without alteration. */
#part-labels {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  z-index: 6;
}
#part-labels span {
  position: absolute;
  display: block;
  width: max-content;
  max-width: 170px;
  white-space: normal;
  font: 500 12px/1.3 var(--font-body);
  color: #f1f3f1;
  background: rgba(10, 17, 21, 0.86);
  border: 1px solid rgba(220, 232, 234, 0.2);
  border-radius: 5px;
  padding: 6px 9px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transition: opacity 180ms linear;
}
#part-labels span.is-visible {
  opacity: 1;
}
/* The existing capture mode needs a non-grid stage on mobile. */
body.poster-capture {
  overflow: hidden;
}
.poster-capture > :not(#film),
.poster-capture .stage > :not(.scene-preview),
.poster-capture .scene-preview > :not(#scene) {
  display: none !important;
}
.poster-capture #film .stage {
  display: block;
  height: 100svh;
  min-height: 0;
  padding: 0 !important;
}
.poster-capture #film .scene-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}
.poster-capture #scene {
  opacity: 1 !important;
}
@media (max-width: 700px) {
  #part-labels span {
    font-size: 11px;
    max-width: 135px;
    padding: 5px 7px;
  }
}

.service-views, #alignment-status {
  position: absolute; z-index: 7; right: clamp(10px, 2vw, 26px);
  color: #f5f7f6; background: rgba(12, 19, 23, .92);
  border: 1px solid rgba(211, 225, 227, .32);
  font: 600 .8125rem/1.2 "Segoe UI", sans-serif;
}
.service-views { top: 12px; display: inline-flex; padding: 2px; border-radius: 6px; }
.service-views button {
  appearance: none; border: 0; border-radius: 3px; padding: 0 12px;
  min-height: 40px; font: inherit; background: transparent; color: inherit; cursor: pointer;
}
.service-views button[aria-pressed="true"] { color: #172125; background: #e4ebe8; }
.service-views button:focus-visible { outline: 2px solid white; outline-offset: 2px; }
#alignment-status { bottom: 12px; margin: 0; padding: 7px 12px; border-radius: 3px; font-weight: 500; }
#alignment-status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #ffb84f; }
#alignment-status[data-complete="true"]::before { background: #7ad7be; }
.service-views[hidden], #alignment-status[hidden], #part-labels span[hidden] { display: none; }
@media (max-width: 900px) {
  .service-views { top: 7px; right: 8px; padding: 1px; }
  .service-views button { position: relative; min-height: 26px; padding: 2px 8px; }
  /* Keep each shot easy to tap without covering more of the car. */
  .service-views button::after { content: ""; position: absolute; inset: -9px 0; }
}
@media (max-width: 700px) {
  #alignment-status { bottom: 6px; right: 8px; font-size: .75rem; }
}
#part-labels span::before, #part-labels span::after { content: ""; position: absolute; pointer-events: none; }
#part-labels span::before {
  left: var(--edge-x); top: var(--edge-y); width: var(--leader); height: 1px;
  background: rgba(235, 241, 238, .72); transform-origin: left; transform: rotate(var(--angle));
}
#part-labels span::after {
  left: var(--anchor-x); top: var(--anchor-y); width: 4px; height: 4px;
  transform: translate(-50%, -50%); border-radius: 50%; background: #e7efeb; box-shadow: 0 0 0 1px #172126;
}
