/* Compact, single-scroll profile builder modal refinements */
.profile-modal-overlay {
  top: calc(var(--tutour-header-height, 112px) + 0.25rem) !important;
  height: calc(100dvh - var(--tutour-header-height, 112px) - 0.25rem) !important;
  place-items: start center !important;
  overflow-y: auto !important;
  padding: clamp(0.45rem, 1.5vw, 0.85rem) !important;
}

.profile-builder-form {
  width: min(100%, 46rem) !important;
  max-width: 46rem !important;
  max-height: calc(100dvh - var(--tutour-header-height, 112px) - 1.25rem) !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border-radius: var(--radius-md) !important;
  scrollbar-width: thin;
}

.profile-builder-form > div {
  flex-shrink: 0 !important;
}

.profile-builder-form > div:first-child {
  position: static !important;
  padding: 0.72rem 0.85rem !important;
}

.profile-builder-form > div:first-child h2 {
  font-size: clamp(1rem, 3.4vw, 1.35rem) !important;
  line-height: 1.1 !important;
}

.profile-builder-form > div:first-child p:last-child {
  max-width: 42rem !important;
  font-size: 0.72rem !important;
  line-height: 1.25rem !important;
}

.profile-builder-form > div:nth-child(2) {
  min-height: 0 !important;
  flex: 0 0 auto !important;
  overflow: visible !important;
  padding: 0.72rem 0.85rem !important;
}

.profile-builder-form > div:nth-child(2) .grid.gap-3 {
  gap: 0.55rem !important;
}

.profile-builder-form section,
.profile-builder-form aside {
  padding: 0.72rem !important;
  border-radius: var(--radius-sm) !important;
}

.profile-builder-form label span,
.profile-builder-form .text-xs.font-black {
  font-size: 0.68rem !important;
  line-height: 1rem !important;
}

.profile-builder-form input,
.profile-builder-form select {
  margin-top: 0.28rem !important;
  padding: 0.45rem 0.62rem !important;
  min-height: 2.15rem !important;
  font-size: 0.78rem !important;
  border-radius: 0.7rem !important;
}

.profile-builder-form button[aria-pressed] {
  padding: 0.48rem 0.58rem !important;
  font-size: 0.72rem !important;
}

.profile-builder-form > div:last-child {
  position: static !important;
  padding: 0.65rem 0.85rem !important;
}

.oaxaca-menu-bg > div[role="dialog"][aria-labelledby="profile-title"] {
  top: calc(var(--tutour-header-height, 112px) + 0.25rem) !important;
  bottom: 0 !important;
  height: calc(100dvh - var(--tutour-header-height, 112px) - 0.25rem) !important;
  align-items: start !important;
}

@media (max-width: 640px) {
  .profile-builder-form {
    max-height: calc(100dvh - var(--tutour-header-height, 112px) - 0.9rem) !important;
    width: min(100%, 23rem) !important;
  }

  .profile-builder-form > div:first-child,
  .profile-builder-form > div:nth-child(2),
  .profile-builder-form > div:last-child {
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
  }

  .profile-builder-form section,
  .profile-builder-form aside {
    padding: 0.62rem !important;
  }

  .profile-builder-form .sm\:grid-cols-3,
  .profile-builder-form .sm\:grid-cols-2,
  .profile-builder-form .sm\:grid-cols-4,
  .profile-builder-form .lg\:grid-cols-3 {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
