/* The gallery is a full-page surface, not a child of the 3-column builder. */
.builder-v2:has(.b2-template-page) {
  display: block;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: radial-gradient(circle at 84% 12%, #c6edff, transparent 28%), linear-gradient(135deg, #e0e7ff, #eee8ff);
}

.builder-v2:has(.b2-template-page) .b2-template-page {
  width: min(1180px, 100%);
  min-height: max-content;
  padding: 38px 32px 60px;
}

.b2-template-layout { grid-template-columns: 195px minmax(0, 1fr); }
.b2-template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: 28px; }
.b2-template-card { width: auto; min-width: 0; }
.b2-template-card { cursor: pointer; }
.b2-template-card:focus-within, .b2-template-card:hover { box-shadow: 0 14px 30px rgba(86, 102, 165, .19); }

@media (max-width: 820px) {
  .builder-v2:has(.b2-template-page) .b2-template-page { padding: 24px 16px 48px; }
  .b2-template-layout { grid-template-columns: 1fr; }
}

@supports not selector(:has(*)) {
  .builder-v2 { min-height: 0; overflow: auto; }
}
