.device-hero-grid {
  align-items: stretch;
}

.preview-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 620px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(141, 227, 255, 0.18);
  background: linear-gradient(180deg, rgba(10, 19, 35, 0.95), rgba(8, 14, 26, 0.94));
  box-shadow: var(--shadow);
}

.preview-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.preview-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(94, 162, 255, 0.16);
  color: #dff1ff;
  font-size: 0.88rem;
  font-weight: 700;
}

.preview-copy {
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-copy code {
  color: var(--text);
}

.preview-frame {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  background: #ffffff;
}

.demo-note {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(141, 227, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #dbe7ff;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.module-card {
  display: block;
  min-height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.module-card:hover,
.module-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(141, 227, 255, 0.28);
}

.module-card .gallery-copy {
  padding: 22px;
}

@media (max-width: 980px) {
  .module-grid {
    grid-template-columns: 1fr 1fr;
  }

  .preview-shell {
    min-height: 560px;
  }
}

@media (max-width: 720px) {
  .module-grid {
    grid-template-columns: 1fr;
  }

  .preview-shell {
    min-height: 460px;
  }

  .preview-frame {
    min-height: 420px;
  }
}
