/* The roof being measured (try/measure.js). It draws over satellite imagery, so it keeps one dark palette.
   Adapted from Artemis's auto-design stream stage. */
.rm-stage {
  --rm-accent: #cbc4fc;
  --rm-accent-rgb: 203 196 252;
  --rm-glass: 8 13 26;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  overflow: hidden;
  background: #0a0f1c;
  color: #fff;
  font-family: var(--sans);
}
.rm-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rm-grid-line { fill: none; stroke: rgb(140 170 220 / 0.09); stroke-width: 1; }
.rm-camera { transform-origin: 0 0; transition-property: transform; transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }

.rm-pulse {
  fill: none; stroke: rgb(var(--rm-accent-rgb)); stroke-width: 1.6; vector-effect: non-scaling-stroke;
  transform-box: fill-box; transform-origin: center; animation: rm-pulse 1800ms linear infinite;
}
.rm-pin { fill: var(--rm-accent); stroke: #fff; stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: rm-pop 500ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.rm-reveal { transform-box: fill-box; transform-origin: center; animation: rm-reveal 1100ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.rm-dissolve { opacity: 0; transition: opacity 320ms ease-in-out; }
.rm-scan { animation: rm-scan 2600ms ease-in-out infinite alternate; }
.rm-scan-edge { stop-color: rgb(var(--rm-glass) / 0); }
.rm-scan-middle { stop-color: rgb(var(--rm-accent-rgb) / 0.45); }
.rm-scan-line { fill: #fff; opacity: 0.95; }

.rm-dim { fill: rgb(7 11 22 / 0.58); animation: rm-enter 900ms ease-out both; }
.rm-outline {
  fill: none; stroke: #fff1be; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1;
  animation: rm-draw 1400ms cubic-bezier(0.45, 0, 0.55, 1) both;
}
.rm-plane { fill: rgb(var(--rm-accent-rgb) / 0.28); stroke: rgb(255 255 255 / 0.92); stroke-linejoin: round; animation: rm-enter 600ms ease-out both; }
.rm-trees { transition: opacity 800ms ease-out; }
.rm-trees[data-faded="true"] { opacity: 0; }
.rm-trees circle { fill: rgb(131 219 195 / 0.13); stroke: #c1f6d9; animation: rm-enter 500ms ease-out both; }
.rm-obstacle { fill: rgb(252 171 133 / 0.18); stroke: #ffcaac; stroke-linejoin: round; animation: rm-enter 500ms ease-out both; }
.rm-wall { fill: #514d44; stroke: #685e50; stroke-width: 0.8; }
.rm-tilted-face { fill: rgb(255 241 205 / 0.12); stroke: #fff6d8; stroke-linejoin: round; }
.rm-downhill { fill: none; stroke: #fff5d1; stroke-linecap: round; stroke-linejoin: round; }
.rm-labels > g { animation: rm-enter 400ms ease-out 800ms both; }
.rm-labels rect { fill: rgb(var(--rm-glass) / 0.82); }
.rm-labels text { fill: #fff; font-weight: 600; text-anchor: middle; }

.rm-chip {
  position: absolute; top: 12px; right: 12px; max-width: calc(100% - 24px); padding: 6px 11px; overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.14); border-radius: 999px; background: rgb(var(--rm-glass) / 0.72);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; animation: rm-chip-in 450ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.rm-caption-bar {
  position: absolute; right: 12px; bottom: 12px; left: 12px; display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 11px 14px; border: 1px solid rgb(255 255 255 / 0.12); border-radius: 12px; background: rgb(var(--rm-glass) / 0.74);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.rm-steps { position: absolute; top: -1px; right: 14px; left: 14px; display: flex; gap: 4px; }
.rm-steps i { flex: 1; height: 3px; border-radius: 4px; background: rgb(255 255 255 / 0.2); transition: background 350ms; }
.rm-steps i[data-done="true"] { background: var(--rm-accent); }
.rm-steps i[data-active="true"] { animation: rm-step 1300ms ease-in-out infinite; }
.rm-spinner {
  flex: none; width: 20px; height: 20px; border: 2.2px solid rgb(255 255 255 / 0.2); border-top-color: var(--rm-accent);
  border-radius: 50%; animation: rm-spin 900ms linear infinite;
}
.rm-spinner[data-done="true"] { border-color: var(--rm-accent); background: radial-gradient(circle, var(--rm-accent) 0 38%, transparent 42%); animation: none; }
.rm-stage.is-failed .rm-spinner { border-color: #ffcaac; animation: none; }
.rm-caption-text { flex: 1; min-width: 0; }
.rm-caption { overflow: hidden; font-size: 15px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.rm-caption span { display: inline-block; margin-right: 0.28em; opacity: 0.45; animation: rm-word 1500ms ease-in-out infinite; }
.rm-stage.is-failed .rm-caption span { opacity: 1; animation: none; }
.rm-chip, .rm-caption-bar { transition: opacity 300ms ease; }
.rm-stage.is-leaving .rm-chip, .rm-stage.is-leaving .rm-caption-bar { opacity: 0; }
.rm-sub { min-height: 16px; overflow: hidden; color: rgb(255 255 255 / 0.66); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; }
.rm-clock { min-width: 44px; color: rgb(255 255 255 / 0.7); font-size: 12.5px; font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }

@keyframes rm-pulse { from { opacity: 0.42; transform: scale(1); } to { opacity: 0; transform: scale(15); } }
@keyframes rm-pop { from { transform: scale(0); } }
@keyframes rm-reveal { from { opacity: 0; transform: scale(1.08); } }
@keyframes rm-scan { from { transform: translateY(var(--rm-scan-from, 120px)); } to { transform: translateY(var(--rm-scan-to, 360px)); } }
@keyframes rm-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes rm-enter { from { opacity: 0; } }
@keyframes rm-chip-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes rm-step { 50% { background: rgb(var(--rm-accent-rgb) / 0.75); } }
@keyframes rm-spin { to { transform: rotate(360deg); } }
@keyframes rm-word { 0%, 100% { opacity: 0.45; } 30% { opacity: 1; } }

/* a narrow stage (the sign-up's side panel, a phone): a tighter caption bar */
@container (max-width: 380px) {
  .rm-chip { top: 8px; right: 8px; font-size: 11px; }
  .rm-caption-bar { right: 8px; bottom: 8px; left: 8px; gap: 10px; padding: 9px 11px; border-radius: 9px; }
  .rm-caption { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .rm-stage *, .rm-stage .rm-steps i[data-active="true"], .rm-stage .rm-caption span { animation: none; transition: none; }
  .rm-stage .rm-caption span { opacity: 1; }
  .rm-stage .rm-scan { display: none; }
}
