.nano-connection-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.18) 0%,
    rgba(0, 0, 0, 0.5) 42%,
    rgba(0, 0, 0, 0.78) 100%
  );
  pointer-events: none;
}

.nano-connection-overlay[hidden] {
  display: none;
}

.nano-connection-shell {
  display: grid;
  gap: 1.25rem;
  width: min(100%, 34rem);
  text-align: center;
  pointer-events: auto;
}

.nano-connection-orb {
  position: relative;
  width: clamp(4.5rem, 14vw, 6.5rem);
  height: clamp(4.5rem, 14vw, 6.5rem);
  margin: 0 auto;
}

.nano-connection-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(57, 255, 20, 0.05),
    rgba(57, 255, 20, 0.85),
    rgba(181, 255, 208, 0.35),
    rgba(57, 255, 20, 0.05)
  );
  animation: nano-connection-ring-spin 2.8s linear infinite;
  mask: radial-gradient(circle, transparent 62%, #000 63%);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%);
}

.nano-connection-orb-core {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(181, 255, 208, 0.95), rgba(57, 255, 20, 0.35));
  box-shadow: 0 0 28px rgba(57, 255, 20, 0.35);
  animation: nano-connection-core-pulse 2.2s ease-in-out infinite;
}

body.nano-connection-mode--rebooting .nano-connection-orb-ring {
  background: conic-gradient(
    from 0deg,
    rgba(255, 196, 92, 0.08),
    rgba(255, 196, 92, 0.9),
    rgba(120, 220, 255, 0.45),
    rgba(255, 196, 92, 0.08)
  );
}

body.nano-connection-mode--rebooting .nano-connection-orb-core {
  background: radial-gradient(circle at 35% 35%, rgba(255, 220, 140, 0.95), rgba(255, 160, 60, 0.35));
  box-shadow: 0 0 32px rgba(255, 180, 70, 0.35);
}

.nano-connection-copy {
  display: grid;
  gap: 0.75rem;
}

.nano-connection-headline {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  font-weight: 700;
  color: var(--accent-strong, #b5ffd0);
  letter-spacing: 0.02em;
  text-shadow: 0 0 24px rgba(57, 255, 20, 0.35);
}

body.nano-connection-mode--rebooting .nano-connection-headline {
  color: #ffd98a;
  text-shadow: 0 0 24px rgba(255, 180, 70, 0.35);
}

.nano-connection-detail {
  margin: 0;
  min-height: 2.4rem;
  font-size: clamp(0.92rem, 2.4vw, 1rem);
  line-height: 1.45;
  color: rgba(240, 255, 244, 0.84);
  transition:
    opacity 900ms ease-in-out,
    transform 900ms ease-in-out;
}

.nano-connection-detail.is-fading {
  opacity: 0;
  transform: translateY(6px);
}

@keyframes nano-connection-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes nano-connection-core-pulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.82;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

body.nano-connection-active .view-modal {
  z-index: 1050;
}

@media (max-width: 640px) {
  .nano-connection-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0 1.25rem 3.25rem;
  }

  .nano-connection-shell {
    width: 100%;
    max-width: 32rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .nano-connection-shell {
    width: min(100%, 36rem);
  }
}

@media (min-width: 1025px) {
  .nano-connection-shell {
    width: min(100%, 40rem);
    gap: 1.5rem;
  }
}
