<svg xmlns="http://www.w3.org/2000/svg" width="540" height="285" viewBox="0 0 540 285">
  <rect width="540" height="285" fill="#0f172a"/>
  <text x="270" y="18" font-family="sans-serif" font-size="10" font-weight="bold" fill="#e2e8f0" text-anchor="middle">Verkabelungsdiagramm</text>

  <!-- 230V Netz -->
  <rect x="10" y="88" width="55" height="90" fill="#1e293b" stroke="#475569" stroke-width="1.5" rx="4"/>
  <text x="37" y="105" font-family="sans-serif" font-size="9" font-weight="bold" fill="#e2e8f0" text-anchor="middle">230V</text>
  <text x="37" y="116" font-family="sans-serif" font-size="7.5" fill="#94a3b8" text-anchor="middle">Netz</text>
  <circle cx="65" cy="118" r="3" fill="#c07040"/>
  <text x="62" y="115" font-family="sans-serif" font-size="8" fill="#c07040" text-anchor="end">L</text>
  <circle cx="65" cy="152" r="3" fill="#3b82f6"/>
  <text x="62" y="149" font-family="sans-serif" font-size="8" fill="#3b82f6" text-anchor="end">N</text>

  <!-- Shelly Dimmer -->
  <rect x="120" y="48" width="100" height="215" fill="#1e293b" stroke="#475569" stroke-width="1.5" rx="4"/>
  <text x="170" y="65" font-family="sans-serif" font-size="9" font-weight="bold" fill="#e2e8f0" text-anchor="middle">Shelly Dimmer</text>
  <text x="170" y="76" font-family="sans-serif" font-size="7" fill="#94a3b8" text-anchor="middle">0/1-10V PM Gen3</text>
  <circle cx="120" cy="115" r="3" fill="#c07040"/>
  <text x="128" y="118" font-family="sans-serif" font-size="8" fill="#c07040">L</text>
  <circle cx="120" cy="150" r="3" fill="#3b82f6"/>
  <text x="128" y="153" font-family="sans-serif" font-size="8" fill="#3b82f6">N</text>
  <circle cx="220" cy="140" r="3" fill="#92400e"/>
  <text x="212" y="143" font-family="sans-serif" font-size="8" fill="#92400e" text-anchor="end">O</text>
  <circle cx="220" cy="188" r="3" fill="#f97316"/>
  <text x="212" y="191" font-family="sans-serif" font-size="8" fill="#f97316" text-anchor="end">+</text>
  <circle cx="220" cy="226" r="3" fill="#64748b"/>
  <text x="212" y="229" font-family="sans-serif" font-size="8" fill="#64748b" text-anchor="end">−</text>

  <!-- Trafo -->
  <rect x="278" y="82" width="78" height="90" fill="#1e293b" stroke="#475569" stroke-width="1.5" rx="4"/>
  <text x="317" y="99" font-family="sans-serif" font-size="9" font-weight="bold" fill="#e2e8f0" text-anchor="middle">Trafo</text>
  <text x="317" y="110" font-family="sans-serif" font-size="7" fill="#94a3b8" text-anchor="middle">230V → 12V DC</text>
  <circle cx="278" cy="122" r="3" fill="#92400e"/>
  <text x="286" y="125" font-family="sans-serif" font-size="8" fill="#92400e">L</text>
  <circle cx="278" cy="150" r="3" fill="#3b82f6"/>
  <text x="286" y="153" font-family="sans-serif" font-size="8" fill="#3b82f6">N</text>
  <circle cx="356" cy="122" r="3" fill="#ef4444"/>
  <text x="348" y="125" font-family="sans-serif" font-size="8" fill="#ef4444" text-anchor="end">+</text>
  <circle cx="356" cy="150" r="3" fill="#64748b"/>
  <text x="348" y="153" font-family="sans-serif" font-size="8" fill="#64748b" text-anchor="end">−</text>

  <!-- Lüfter -->
  <rect x="415" y="100" width="110" height="100" fill="#1e293b" stroke="#475569" stroke-width="1.5" rx="4"/>
  <text x="470" y="117" font-family="sans-serif" font-size="9" font-weight="bold" fill="#e2e8f0" text-anchor="middle">Lüfter</text>
  <text x="470" y="128" font-family="sans-serif" font-size="7" fill="#94a3b8" text-anchor="middle">HRV126-43</text>
  <circle cx="415" cy="142" r="3" fill="#ef4444"/>
  <text x="423" y="145" font-family="sans-serif" font-size="8" fill="#ef4444">+</text>
  <circle cx="415" cy="163" r="3" fill="#f97316"/>
  <text x="423" y="166" font-family="sans-serif" font-size="8" fill="#f97316">PWM</text>
  <circle cx="415" cy="185" r="3" fill="#64748b"/>
  <text x="423" y="188" font-family="sans-serif" font-size="8" fill="#64748b">−</text>

  <!-- Wago1 junction (N) -->
  <circle cx="93" cy="150" r="5" fill="#1e3a5c" stroke="#3b82f6" stroke-width="1.5"/>
  <text x="93" y="139" font-family="sans-serif" font-size="7" fill="#3b82f6" text-anchor="middle">W1</text>

  <!-- WIRES -->

  <!-- 230V L → Shelly L -->
  <line x1="65" y1="118" x2="120" y2="115" stroke="#c07040" stroke-width="2"/>

  <!-- 230V N → Wago1 → Shelly N -->
  <line x1="65" y1="152" x2="88" y2="150" stroke="#3b82f6" stroke-width="2"/>
  <line x1="98" y1="150" x2="120" y2="150" stroke="#3b82f6" stroke-width="2"/>

  <!-- Wago1 → Trafo N (routed above, dashed) -->
  <polyline points="93,145 93,36 263,36 263,150 278,150" fill="none" stroke="#3b82f6" stroke-width="2" stroke-dasharray="5,2"/>

  <!-- Shelly O → Trafo L (switched live) -->
  <polyline points="220,140 255,140 255,122 278,122" fill="none" stroke="#92400e" stroke-width="2"/>

  <!-- Trafo + → Fan + -->
  <polyline points="356,122 395,122 395,142 415,142" fill="none" stroke="#ef4444" stroke-width="2"/>

  <!-- Shelly + → Fan PWM (routes below Trafo, accepts visual cross with 12V-) -->
  <polyline points="220,188 390,188 390,163 415,163" fill="none" stroke="#f97316" stroke-width="2"/>

  <!-- 12V − bus: Shelly−, Trafo−, Fan− all drop to y=252 bus -->
  <polyline points="220,226 220,252" fill="none" stroke="#64748b" stroke-width="2"/>
  <polyline points="356,150 356,252" fill="none" stroke="#64748b" stroke-width="2"/>
  <polyline points="415,185 408,185 408,252" fill="none" stroke="#64748b" stroke-width="2"/>
  <line x1="220" y1="252" x2="408" y2="252" stroke="#64748b" stroke-width="2"/>
  <circle cx="220" cy="252" r="3.5" fill="#64748b"/>
  <circle cx="356" cy="252" r="3.5" fill="#64748b"/>
  <circle cx="408" cy="252" r="3.5" fill="#64748b"/>
  <text x="310" y="265" font-family="sans-serif" font-size="7.5" fill="#64748b" text-anchor="middle">Wago 2 (12V −)</text>

  <!-- Legend -->
  <line x1="12" y1="278" x2="32" y2="278" stroke="#c07040" stroke-width="2"/>
  <text x="35" y="281" font-family="sans-serif" font-size="7" fill="#94a3b8">230V L</text>
  <line x1="72" y1="278" x2="92" y2="278" stroke="#3b82f6" stroke-width="2"/>
  <text x="95" y="281" font-family="sans-serif" font-size="7" fill="#94a3b8">230V N</text>
  <line x1="130" y1="278" x2="150" y2="278" stroke="#92400e" stroke-width="2"/>
  <text x="153" y="281" font-family="sans-serif" font-size="7" fill="#94a3b8">Gesch. L</text>
  <line x1="193" y1="278" x2="213" y2="278" stroke="#ef4444" stroke-width="2"/>
  <text x="216" y="281" font-family="sans-serif" font-size="7" fill="#94a3b8">12V+</text>
  <line x1="245" y1="278" x2="265" y2="278" stroke="#f97316" stroke-width="2"/>
  <text x="268" y="281" font-family="sans-serif" font-size="7" fill="#94a3b8">PWM</text>
  <line x1="298" y1="278" x2="318" y2="278" stroke="#64748b" stroke-width="2"/>
  <text x="321" y="281" font-family="sans-serif" font-size="7" fill="#94a3b8">12V−</text>
  <line x1="348" y1="278" x2="368" y2="278" stroke="#3b82f6" stroke-width="2" stroke-dasharray="4,2"/>
  <text x="371" y="281" font-family="sans-serif" font-size="7" fill="#94a3b8">N (Wago)</text>
</svg>
