Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 18885)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 18886)
@@ -901,4 +901,5 @@
             putInt("draw.rawgps.lines", -1);
         }
+        updateMapPaintKnownDefaults();
         if (modifiedDefault) {
             try {
@@ -913,4 +914,40 @@
 
     /**
+     * Update the known defaults for the map paintstyles.
+     * This should be removed sometime after 2024-06-01.
+     */
+    private void updateMapPaintKnownDefaults() {
+        final String url = "url";
+        final String active = "active";
+        final String potlatch2 = "resource://styles/standard/potlatch2.mapcss";
+        final String remotePotlatch2 = "https://josm.openstreetmap.de/josmfile?page=Styles/Potlatch2&zip=1";
+
+        // Remove potlatch2 from the known defaults
+        final List<String> knownDefaults = new ArrayList<>(getList("mappaint.style.known-defaults"));
+        // See #18866: Potlatch 2 internal theme removed in favor of remote theme by Stereo
+        knownDefaults.removeIf(potlatch2::equals);
+
+        // Moved from MapPaintPrefHelper for consistency
+        // XML style is not bundled anymore
+        knownDefaults.removeIf("resource://styles/standard/elemstyles.xml"::equals);
+        putList("mappaint.style.known-defaults", knownDefaults);
+
+        // Replace potlatch2 in the current style entries, but only if it is enabled. Otherwise, remove it.
+        final List<Map<String, String>> styleEntries = new ArrayList<>(getListOfMaps("mappaint.style.entries"));
+        final boolean potlatchEnabled = styleEntries.stream().filter(map -> potlatch2.equals(map.get(url)))
+                .anyMatch(map -> Boolean.parseBoolean(map.get(active)));
+        final boolean remotePotlatch2Present = styleEntries.stream().anyMatch(map -> remotePotlatch2.equals(map.get(url)));
+        // Remove potlatch2 if it is not enabled _or_ the remote potlatch2 version is present
+        styleEntries.removeIf(map -> (!potlatchEnabled || remotePotlatch2Present) && potlatch2.equals(map.get(url)));
+        styleEntries.replaceAll(HashMap::new); // The maps are initially immutable.
+        for (Map<String, String> map : styleEntries) {
+            if (potlatch2.equals(map.get(url))) {
+                map.put(url, remotePotlatch2);
+            }
+        }
+        putListOfMaps("mappaint.style.entries", styleEntries);
+    }
+
+    /**
      * Enables or not the preferences file auto-save mechanism (save each time a setting is changed).
      * This behaviour is enabled by default.
Index: trunk/src/org/openstreetmap/josm/data/preferences/sources/MapPaintPrefHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/preferences/sources/MapPaintPrefHelper.java	(revision 18885)
+++ trunk/src/org/openstreetmap/josm/data/preferences/sources/MapPaintPrefHelper.java	(revision 18886)
@@ -5,6 +5,6 @@
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -73,7 +73,4 @@
         Config.getPref().putList("mappaint.style.known-defaults", new ArrayList<>(knownDefaults));
 
-        // XML style is not bundled anymore
-        list.removeIf(se -> "resource://styles/standard/elemstyles.xml".equals(se.url));
-
         return changed;
     }
@@ -87,12 +84,5 @@
         defJosmMapcss.title = tr("JOSM default (MapCSS)");
         defJosmMapcss.description = tr("Internal style to be used as base for runtime switchable overlay styles");
-        ExtendedSourceEntry defPL2 = new ExtendedSourceEntry(type, "potlatch2.mapcss", "resource://styles/standard/potlatch2.mapcss");
-        defPL2.active = false;
-        defPL2.name = "standard";
-        defPL2.icon = new ImageProvider("dialogs/mappaint", "pl2_small").getResource();
-        defPL2.title = tr("Potlatch 2");
-        defPL2.description = tr("the main Potlatch 2 style");
-
-        return Arrays.asList(defJosmMapcss, defPL2);
+        return Collections.singletonList(defJosmMapcss);
     }
 
