.digital-twin-hero {
  padding: 6rem 0 4.5rem;
}

.digital-twin-hero h1 {
  color: #f1f5f9;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin-bottom: 1rem;
}

.digital-twin-hero p {
  color: #94a3b8;
  margin-inline: auto;
  max-width: 55rem;
  line-height: 1.75;
}

.digital-twin-viewer-section {
  padding: 0 0 5rem;
  background: linear-gradient(180deg, #080c18 0%, #0a0e14 100%);
}

.viewer-container {
  position: relative;
  width: 100%;
  background: #030508;
  border: 1px solid #1e293b;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  box-shadow: 0 22px 50px rgba(2, 8, 23, 0.45);
}

#matterport-iframe {
  width: 100%;
  height: 70vh;
  min-height: 440px;
  display: block;
}

.freq-hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.7rem;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.68) 0%, transparent 100%);
  pointer-events: none;
  z-index: 15;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #05b5d4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hud-phase,
.hud-scan {
  background: rgba(5, 181, 212, 0.12);
  border: 1px solid rgba(5, 181, 212, 0.35);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.hud-narration {
  justify-self: end;
  max-width: 34rem;
  text-align: right;
  color: rgba(224, 224, 224, 0.78);
  font-size: 10px;
  letter-spacing: 0.03em;
  line-height: 1.4;
  text-transform: none;
}

.vignette-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.38) 100%);
  pointer-events: none;
  z-index: 6;
}

.dt-connection {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 16;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #94a3b8;
  background: rgba(8, 12, 24, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 6px 10px;
  letter-spacing: 0.04em;
}

.dt-connection.ok {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
}

.dt-connection.error {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.45);
}

.dt-mob-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  z-index: 20;
}

.dt-mob-banner {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(239, 68, 68, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
}

.dt-mob-countdown {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.82);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.45rem 0.95rem;
}

#dt-mob-countdown {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
}

.dt-mob-clear {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #bbf7d0;
  background: rgba(6, 95, 70, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.55);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
}

.viewer-container.mob-alert {
  border-color: rgba(239, 68, 68, 0.92);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.28), 0 22px 50px rgba(127, 29, 29, 0.36);
  animation: mobPulse 0.95s ease-in-out infinite;
}

.viewer-container.all-clear {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.42), 0 22px 50px rgba(6, 95, 70, 0.35);
}

.dt-control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid #1e293b;
  border-top: 0;
  background: #0a0e14;
}

.dt-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 13px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dt-btn:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.dt-btn:disabled {
  opacity: 0.34;
  cursor: default;
}

.dt-btn-primary {
  color: #05b5d4;
  border-color: rgba(5, 181, 212, 0.55);
}

.dt-btn-primary:not(:disabled):hover {
  background: rgba(5, 181, 212, 0.16);
  border-color: rgba(5, 181, 212, 0.85);
}

.dt-btn-danger {
  color: rgba(239, 68, 68, 0.88);
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(127, 29, 29, 0.2);
}

.dt-btn-danger:disabled {
  color: rgba(148, 163, 184, 0.46);
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.45);
}

.dt-btn-danger:not(:disabled):hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.72);
  color: #fca5a5;
}

.dt-telemetry {
  border: 1px solid #1e293b;
  border-top: 0;
  padding: 14px;
  background: #0d1424;
}

.dt-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.dt-tel-item {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 0.56rem 0.66rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.dt-tel-wide {
  grid-column: span 2;
}

.dt-tel-label {
  font-family: var(--font-label);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #64748b;
}

.dt-tel-value {
  font-family: var(--font-mono);
  color: #06b6d4;
  font-size: 0.86rem;
  font-weight: 600;
}

.dt-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.dt-narration-panel,
.dt-phase-stepper,
.dt-complete {
  border: 1px solid #1e293b;
  background: #0a0f1e;
  border-radius: 10px;
}

.dt-narration-panel {
  padding: 1rem 1.1rem;
}

.dt-narration-panel h3 {
  margin: 0 0 0.55rem;
  color: #f1f5f9;
  font-size: 1.08rem;
}

.dt-narration-panel p {
  margin: 0;
  color: #94a3b8;
  line-height: 1.7;
  font-size: 0.95rem;
}

.dt-phase-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.8rem;
  gap: 0.45rem;
}

.dt-step-line {
  flex: 1;
  height: 1px;
  background: rgba(71, 85, 105, 0.65);
}

.dt-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
  min-width: 3.2rem;
}

.dt-step-index {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.dt-step-label {
  font-family: var(--font-label);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: #64748b;
}

.dt-step.active .dt-step-index {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
  color: #06b6d4;
}

.dt-step.active .dt-step-label {
  color: #06b6d4;
}

.dt-step.completed .dt-step-index {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
}

.dt-step.completed .dt-step-label {
  color: #10b981;
}

.dt-complete {
  margin-top: 12px;
  padding: 0.95rem 1.1rem;
}

.dt-complete-title {
  color: #10b981;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.dt-complete-grid {
  display: grid;
  gap: 6px;
  color: #94a3b8;
  font-size: 0.9rem;
}

@keyframes mobPulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.22), 0 22px 50px rgba(127, 29, 29, 0.32);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.46), 0 22px 50px rgba(239, 68, 68, 0.36);
  }
}

@media (max-width: 1024px) {
  .freq-hud-overlay {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 0.5rem;
  }

  .hud-narration {
    max-width: 100%;
    text-align: left;
  }

  .dt-telemetry-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dt-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  #matterport-iframe {
    height: 62vh;
    min-height: 360px;
  }

  .dt-control-bar {
    gap: 6px;
  }

  .dt-btn {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
  }

  .dt-telemetry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dt-tel-wide {
    grid-column: span 2;
  }

  .dt-phase-stepper {
    overflow-x: auto;
    justify-content: flex-start;
  }
}
