  @import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;500;700&display=swap');
  
    *, *::before, *::after { box-sizing: border-box; }
    body, html { height: 100%; margin: 0; padding: 0; }

    /* ── Karte ── */
    #map {
      position: absolute;
      inset: 0;
      z-index: 0;
    }

    /* ── Flow-Canvas ── */
    #flow-canvas {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 2;
    }

    /* ── Topbar — schwebende Pill ── */
    #topbar {
      position: fixed;
      top: 10px;
      left: 50%;
      transform: translateX(-50%);
      height: auto;
      z-index: 100;
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 8px;
      background: rgba(255,255,255,0.97);
      backdrop-filter: blur(14px);
      border-radius: 40px;
      box-shadow: 0 2px 20px rgba(0,0,0,0.13), 0 0 0 1px rgba(182,14,127,0.08);
      white-space: nowrap;
      max-width: calc(100vw - 24px);
    }
    #topbar-brand {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
      padding: 2px 6px 2px 4px;
      border-right: 1px solid rgba(55,34,129,0.1);
      margin-right: 2px;
    }
    .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
    .brand-text strong { font-size: 12px; color: #372281; font-family: 'League Spartan', sans-serif; }
    .brand-text span   { font-size: 9px; color: #b60e7e; letter-spacing: 0.05em; }
    #geocoder-container {
      flex-shrink: 0;
      width: 200px;
    }
    #topbar-nav {
      display: flex;
      align-items: center;
      gap: 2px;
      flex-shrink: 0;
      padding-left: 4px;
      border-left: 1px solid rgba(55,34,129,0.1);
      margin-left: 2px;
    }
    .nav-btn {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 6px 13px;
      border-radius: 24px;
      border: none;
      background: none;
      color: #372281;
      font-family: 'League Spartan', sans-serif;
      font-size: 12px;
      letter-spacing: 0.05em;
      cursor: pointer;
      transition: all 0.15s;
      white-space: nowrap;
      position: relative;
    }
    .nav-btn:hover { background: rgba(55,34,129,0.07); }
    .nav-btn.active {
      background: #b60e7e;
      color: #fff;
    }
    .nav-btn.active i { color: #fff; }
    .nav-badge {
      position: absolute;
      top: 1px; right: 1px;
      min-width: 17px; height: 17px;
      border-radius: 9px;
      background: #e53935;
      color: #fff;
      font-size: 10px;
      display: flex; align-items: center; justify-content: center;
      font-family: 'League Spartan', sans-serif;
      font-weight: 700;
      padding: 0 4px;
    }

    /* ── Drawer ── */
    #layer-drawer {
      position: fixed;
      top: 70px;
      left: 12px;
      bottom: 16px;
      width: 290px;
      z-index: 90;
      background: rgba(255,255,255,0.97);
      backdrop-filter: blur(14px);
      border-radius: 20px;
      box-shadow: 0 4px 32px rgba(0,0,0,0.15), 0 0 0 1px rgba(182,14,127,0.08);
      display: flex;
      flex-direction: column;
      transform: translateX(calc(-100% - 16px));
      transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
      overflow: hidden;
    }
    #layer-drawer.open { transform: translateX(0); }
    /* Scrollbarer Mittelteil zwischen Header und Footer */
    #drawer-scroll {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      /* Scrollbar bleibt innerhalb der abgerundeten Box */
      border-radius: 0 0 4px 4px;
    }
    #drawer-scroll::-webkit-scrollbar { width: 4px; }
    #drawer-scroll::-webkit-scrollbar-thumb { background: rgba(182,14,127,0.25); border-radius: 2px; }
    #drawer-scroll::-webkit-scrollbar-track { background: transparent; }
    #drawer-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px 10px;
      font-family: 'League Spartan', sans-serif;
      font-size: 13px;
      font-weight: 700;
      color: #372281;
      letter-spacing: 0.08em;
      border-bottom: 1px solid rgba(182,14,127,0.12);
      flex-shrink: 0;
    }
    #drawer-close {
      background: none; border: none;
      color: #aaa; cursor: pointer; font-size: 16px;
      padding: 4px; border-radius: 4px;
      transition: color 0.15s;
    }
    #drawer-close:hover { color: #b60e7e; }
    .drawer-section {
      padding: 12px 14px;
      border-bottom: 1px solid rgba(55,34,129,0.06);
      overflow: hidden;
    }
    .drawer-section-title {
      font-family: 'League Spartan', sans-serif;
      font-size: 9px;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: #b60e7e;
      font-weight: 700;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* ── Toggle Switch ── */
    .toggle-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 7px 0;
      cursor: pointer;
      border-bottom: 1px solid rgba(55,34,129,0.05);
    }
    .toggle-row:last-child { border-bottom: none; }
    .toggle-info { flex: 1; min-width: 0; }
    .toggle-title {
      display: block;
      font-family: 'League Spartan', sans-serif;
      font-size: 13px;
      color: #372281;
    }
    .toggle-sub {
      display: block;
      font-size: 10px;
      color: #b60e7e;
      margin-top: 1px;
    }
    .toggle-wrap { position: relative; flex-shrink: 0; }
    .toggle-wrap input[type=checkbox] {
      opacity: 0; position: absolute; width: 0; height: 0;
    }
    .toggle-switch {
      display: block;
      width: 44px; height: 24px;
      border-radius: 12px;
      background: #ddd;
      cursor: pointer;
      transition: background 0.2s;
      position: relative;
    }
    .toggle-switch::after {
      content: '';
      position: absolute;
      width: 20px; height: 20px;
      border-radius: 50%;
      background: #fff;
      top: 2px; left: 2px;
      transition: left 0.2s;
      box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    }
    .toggle-wrap input:checked + .toggle-switch { background: #b60e7e; }
    .toggle-wrap input:checked + .toggle-switch::after { left: 22px; }
    .drawer-sublabel {
      display: block;
      font-size: 9px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: #b60e7e;
      margin-bottom: 4px;
    }

    /* ── Kartenstil Grid im Drawer ── */
    .style-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }
    .style-card {
      padding: 8px 6px;
      border-radius: 8px;
      border: 1px solid rgba(55,34,129,0.15);
      background: rgba(55,34,129,0.03);
      color: #372281;
      font-family: 'League Spartan', sans-serif;
      font-size: 11px;
      cursor: pointer;
      transition: all 0.15s;
      text-align: center;
    }
    .style-card:hover  { background: rgba(55,34,129,0.08); }
    .style-card.active { background: #372281; color: #fff; border-color: #372281; }

    /* ── Animationseinstellungen im Drawer ── */
    .drawer-ctrl-inner { margin-top: 4px; }

    /* ── Drawer Footer ── */
    #drawer-footer {
      margin-top: auto;
      padding: 14px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-top: 1px solid rgba(55,34,129,0.08);
      flex-shrink: 0;
    }

    /* Mapbox Controls rechts unten mit etwas Abstand */
    .mapboxgl-ctrl-bottom-right {
      bottom: 8px !important;
      right: 10px !important;
    }

    /* ── Kompakte Legende ── */
    /* Legenden-Stapel: hält die Fachlayer-Legende und die Starkregen-Legende
       untereinander. Fixiert ist nur der Stapel — die einzelnen Legenden
       schalten sich per display ein/aus und rücken dadurch von selbst nach,
       statt sich bei festen Abständen zu überlagern. */
    #legend-stack {
      position: fixed;
      bottom: 130px;
      right: 14px;
      z-index: 20;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 8px;
      pointer-events: none;
    }
    #legend-stack > * { pointer-events: auto; }

    #legend-compact {
      display: none;
      background: rgba(255,255,255,0.94);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(182,14,127,0.2);
      border-radius: 10px;
      padding: 10px 14px;
      font-family: 'League Spartan', sans-serif;
      min-width: 190px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    .lc-title {
      font-size: 9px;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: #b60e7e;
      font-weight: 700;
      margin-bottom: 6px;
    }
    .lc-grad {
      height: 9px;
      border-radius: 4px;
      background: linear-gradient(to right, #C7E2FA, #90C5F6, #59A9F2, #0070C0, #007094, #073763);
      margin-bottom: 5px;
    }
    .lc-labels {
      display: flex;
      justify-content: space-between;
      font-size: 9px;
      color: #888;
    }
    #legend-compact-flow {
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid rgba(182,14,127,0.25);
    }
    .lc-flow-grad {
      background: linear-gradient(to right, #FFE500, #FFA500, #FF4500, #CC0000, #600000);
    }

    .slider-row {
      display: flex;
      align-items: center;
      margin: 5px 0;
      gap: 8px;
    }
    .slider-row label {
      font-size: 9px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #b60e7e;
      min-width: 58px;
      flex-shrink: 0;
      white-space: nowrap;
    }
    .slider-row label span { color: #372281; font-weight: 700; margin-left: 3px; }
    .slider-row input[type=range] { flex: 1; min-width: 0; accent-color: #372281; }
    .slider-hint {
      display: flex;
      justify-content: space-between;
      font-size: 7.5px;
      color: #bbb;
      margin: -4px 0 4px 80px;
    }
    .slider-wrap { display: contents; }
    input[type=range] { accent-color: #372281; }

    /* Alte Legenden-Klassen (nicht mehr gebraucht, trotzdem schaden sie nicht) */
    .legend-panel, #legend-flow, #legend-ws { display: none; }

    /* ── Searchbox (in der Pill) ── */
    #geocoder-container { position: static; }
    .mapboxgl-ctrl-geocoder {
      width: 200px !important;
      max-width: 200px !important;
      min-width: 0 !important;
      font-family: 'League Spartan', sans-serif !important;
      border-radius: 24px !important;
      border: 1px solid rgba(55,34,129,0.15) !important;
      box-shadow: none !important;
      background: rgba(55,34,129,0.04) !important;
    }
    .mapboxgl-ctrl-geocoder--input {
      padding-left: 36px !important;
      height: 36px !important;
    }
    .mapboxgl-ctrl-geocoder--input {
      font-family: 'League Spartan', sans-serif !important;
      color: #372281 !important;
    }
    .mapboxgl-ctrl-geocoder--input::placeholder { color: #b60e7e99 !important; }
    .mapboxgl-ctrl-geocoder--icon { fill: #b60e7e !important; }
    .mapboxgl-ctrl-geocoder--button { background: none !important; }

    /* ── Hover-Popup (Ampel) ── */
    .ws-popup {
      position: absolute;
      z-index: 50;
      pointer-events: none;
      display: flex;
      align-items: center;
      gap: 8px;
      background: rgba(255,255,255,0.93);
      backdrop-filter: blur(6px);
      border-radius: 20px;
      padding: 6px 12px 6px 8px;
      font-family: 'League Spartan', sans-serif;
      box-shadow: 0 2px 10px rgba(0,0,0,0.15);
      transform: translate(14px, -50%);
      transition: opacity 0.15s;
      white-space: nowrap;
    }
    .ws-popup.hidden { opacity: 0; }
    .ws-ampel-dot {
      width: 14px; height: 14px;
      border-radius: 50%;
      flex-shrink: 0;
      box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
    }
    .ws-ampel-dot.gelb   { background: #F5C400; }
    .ws-ampel-dot.orange { background: #FF7800; }
    .ws-ampel-dot.rot    { background: #CC2200; }
    .ws-ampel-label {
      font-size: 12px;
      font-weight: 700;
      color: #333;
    }
    /* Fachlayer-Variante des Hover-Popups (netzdaten.js).
       .ws-popup steht auf white-space:nowrap — für Freitextfelder (z. B. den
       Meldungstext der Einsätze, bis ~250 Zeichen) hier wieder aufheben und
       die Breite deckeln, sonst zieht das Popup über den halben Bildschirm. */
    #ws-popup-body {
      min-width: 0;
      max-width: 280px;
      white-space: normal;
    }
    #ws-popup-title {
      font-size: 12px;
      font-weight: 700;
      color: #372281;
      margin-bottom: 2px;
    }
    .ws-popup-row {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 14px;
      font-size: 11px;
      color: #555;
      line-height: 1.45;
    }
    .ws-popup-row > span:first-child { flex: 0 0 auto; }
    .ws-popup-row .ws-popup-val {
      font-weight: 600;
      color: #222;
      text-align: right;
      overflow-wrap: anywhere;
    }

    /* ── Fachlayer-Legende (netzdaten.js, gespeist aus layers.json) ── */
    #netz-legend {
      display: none;
      background: rgba(255,255,255,0.94);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(55,34,129,0.2);
      border-radius: 10px;
      padding: 9px 13px 10px;
      font-family: 'League Spartan', sans-serif;
      min-width: 190px;
      max-width: 240px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    #netz-legend.sichtbar { display: block; }
    .nl-block + .nl-block {
      margin-top: 8px;
      padding-top: 7px;
      border-top: 1px solid rgba(55,34,129,0.12);
    }
    .nl-title {
      font-size: 9px;
      letter-spacing: 0.11em;
      text-transform: uppercase;
      color: #b60e7e;
      font-weight: 700;
      margin-bottom: 5px;
    }
    .nl-row {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 11px;
      color: #444;
      line-height: 1.6;
    }
    .nl-swatch {
      width: 13px; height: 13px;
      border-radius: 3px;
      flex-shrink: 0;
      border: 1px solid rgba(0,0,0,0.28);
    }
    .nl-swatch.punkt { border-radius: 50%; }
    .nl-row .nl-label { flex: 1; min-width: 0; }
    .nl-hinweis {
      margin-top: 5px;
      font-size: 10px;
      color: #b60e7e;
      font-style: italic;
    }
    @media (max-width: 640px) {
      #netz-legend { display: none !important; }
    }
    body.wb-mode #netz-legend { display: none !important; }

    /* ── Filter-Bedienelement im Drawer (netzdaten.js, "filterUi") ── */
    .filter-ui {
      margin: -2px 0 8px;
      padding: 7px 10px 8px;
      background: rgba(55,34,129,0.04);
      border-radius: 8px;
    }
    .filter-ui-kopf {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 8px;
      font-size: 10px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #8b86a8;
      margin-bottom: 5px;
    }
    .filter-ui-kopf .filter-ui-wert {
      text-transform: none;
      letter-spacing: 0;
      font-size: 11px;
      font-weight: 700;
      color: #b60e7e;
      white-space: nowrap;
    }
    .filter-ui input[type=range] {
      width: 100%;
      accent-color: #b60e7e;
      margin: 0;
    }
    /* ── Abdunkelung ── */
    #dim-overlay {
      position: absolute;
      inset: 0;
      z-index: 1;
      background: rgba(0,0,0,0);
      pointer-events: none;
      transition: background 0.4s ease;
    }
    #dim-overlay.active {
      background: rgba(0,0,0,0.55);
    }

    /* ── Draw Canvas ── */
    #draw-canvas {
      position: absolute;
      inset: 0;
      z-index: 5;
      pointer-events: none;
    }
    #draw-canvas.active { pointer-events: all; cursor: crosshair; }

    /* ── Druckvorschau-Canvas ── */
    #print-preview-canvas {
      position: absolute;
      inset: 0;
      z-index: 3;
      pointer-events: none;
      display: none;
    }

    /* ── Zeichentoolbar ── */
    #draw-toolbar {
      position: absolute;
      z-index: 30;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(255,255,255,0.97);
      backdrop-filter: blur(12px);
      border: 1px solid rgba(182,14,127,0.4);
      border-radius: 12px;
      padding: 10px 12px;
      font-family: 'League Spartan', sans-serif;
      display: none;
      flex-direction: column;
      gap: 8px;
      width: 252px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    }
    #draw-toolbar.visible { display: flex; }
    #draw-toolbar-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 10px;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: #b60e7e;
      font-weight: 700;
      padding-bottom: 6px;
      border-bottom: 1px solid rgba(182,14,127,0.2);
      cursor: move;
      user-select: none;
    }
    .draw-hdr-btn {
      background: none; border: none; color: #888;
      cursor: pointer; padding: 1px 5px; border-radius: 4px;
      font-size: 14px; transition: color 0.15s, background 0.15s;
    }
    .draw-hdr-btn:hover { color: #b60e7e; background: rgba(182,14,127,0.08); }
    #draw-tools { display: flex; gap: 4px; }
    .draw-tool-btn {
      flex: 1;
      background: none;
      border: 1px solid rgba(182,14,127,0.2);
      border-radius: 7px;
      color: #372281;
      cursor: pointer;
      padding: 7px 0;
      font-size: 15px;
      transition: all 0.15s;
      display: flex; align-items: center; justify-content: center;
    }
    .draw-tool-btn:hover { background: rgba(182,14,127,0.08); color: #b60e7e; }
    .draw-tool-btn.active { background: #372281; color: #fff; border-color: #372281; }
    .draw-width-wrap {
      display: flex; align-items: center; gap: 8px;
    }
    .draw-width-wrap label {
      font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
      color: #b60e7e; white-space: nowrap;
    }
    #draw-width-slider { flex: 1; accent-color: #372281; }
    #draw-colors { display: flex; gap: 5px; flex-wrap: nowrap; }
    .draw-color-btn {
      width: 26px; height: 26px;
      border-radius: 7px;
      border: 2px solid rgba(0,0,0,0.08);
      cursor: pointer;
      transition: transform 0.12s, border-color 0.12s;
    }
    .draw-color-btn:hover { transform: scale(1.15); }
    .draw-color-btn.active { border-color: #372281; box-shadow: 0 0 0 2px #37228177; }

    /* Hotspot-Button ist jetzt Teil der Topbar-Nav */
    #btn-hotspots { background: none; border: 1px solid transparent; }
    #btn-hotspots.active { background: rgba(229,57,53,0.1); border-color: rgba(229,57,53,0.4); color: #e53935; }

    /* ── Hotspot-Marker ── */
    @keyframes hs-ring {
      0%   { transform: scale(0.35); opacity: 1; }
      100% { transform: scale(3.2);  opacity: 0; }
    }
    @keyframes hs-dot {
      0%, 100% { transform: scale(1); }
      50%      { transform: scale(1.25); }
    }
    .hotspot-marker { position: relative; width: 14px; height: 14px; }
    .hotspot-dot {
      position: absolute; inset: 0; background: #e53935;
      border-radius: 50%; border: 2.5px solid #fff;
      box-shadow: 0 0 8px rgba(229,57,53,0.9);
      animation: hs-dot 1.6s ease-in-out infinite;
      z-index: 2;
    }
    .hotspot-ring {
      position: absolute; inset: 0; background: rgba(229,57,53,0.55);
      border-radius: 50%;
      animation: hs-ring 1.6s ease-out infinite;
      z-index: 1;
    }
    .hotspot-ring2 {
      position: absolute; inset: 0; background: rgba(229,57,53,0.35);
      border-radius: 50%;
      animation: hs-ring 1.6s ease-out 0.55s infinite;
      z-index: 1;
    }
    .hotspot-label {
      position: absolute;
      top: -22px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(229,57,53,0.92);
      color: #fff;
      font-size: 9px;
      font-family: 'League Spartan', sans-serif;
      letter-spacing: 0.08em;
      padding: 2px 6px;
      border-radius: 4px;
      white-space: nowrap;
      pointer-events: none;
      z-index: 3;
    }

    /* ── Messpanel ── */
    #measure-panel {
      position: fixed; z-index: 95;
      top: 70px; right: 14px;
      background: rgba(255,255,255,0.97); backdrop-filter: blur(12px);
      border: 1px solid rgba(182,14,127,0.3); border-radius: 16px;
      padding: 14px 16px; font-family: 'League Spartan', sans-serif;
      display: none; flex-direction: column; gap: 10px; width: 230px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    }
    #measure-panel.visible { display: flex; }
    #measure-panel-header {
      display: flex; align-items: center; justify-content: space-between;
      font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
      color: #b60e7e; font-weight: 700;
      padding-bottom: 8px; border-bottom: 1px solid rgba(182,14,127,0.15);
      cursor: grab; user-select: none;
    }
    #measure-panel-header:active { cursor: grabbing; }
    #measure-hint {
      font-size: 10px; color: #666; line-height: 1.5;
      background: rgba(55,34,129,0.04); border-radius: 8px;
      padding: 7px 10px;
    }
    .measure-result-row {
      display: flex; align-items: center; gap: 8px;
      font-size: 11px;
    }
    .measure-result-row span:first-child { color: #555; flex: 1; }
    .measure-result-val {
      font-size: 16px; font-weight: 700; color: #372281;
      min-width: 60px; text-align: right;
    }
    .measure-copy-btn {
      background: none; border: none; cursor: pointer;
      color: #b60e7e; padding: 2px 4px; border-radius: 4px;
      font-size: 14px; transition: background 0.15s;
    }
    .measure-copy-btn:hover { background: rgba(182,14,127,0.1); }
    #measure-lineal-row {
      display: flex; align-items: center; justify-content: space-between;
      padding-top: 6px; border-top: 1px solid rgba(55,34,129,0.08);
      font-size: 11px; color: #444;
    }
    #btn-measure-clear {
      background: none; border: 1px solid rgba(182,14,127,0.3);
      color: #b60e7e; border-radius: 8px; padding: 5px 10px;
      font-size: 10px; font-family: 'League Spartan', sans-serif;
      letter-spacing: 0.08em; cursor: pointer; width: 100%;
      transition: all 0.15s;
    }
    #btn-measure-clear:hover { background: rgba(182,14,127,0.08); }
    /* Entfernungs-Labels auf der Karte */
    .measure-label {
      background: rgba(255,255,255,0.92);
      border: 1px solid rgba(182,14,127,0.4);
      border-radius: 10px;
      padding: 2px 8px;
      font-family: 'League Spartan', sans-serif;
      font-size: 11px; font-weight: 700;
      color: #372281;
      white-space: nowrap;
      pointer-events: none;
      box-shadow: 0 1px 6px rgba(0,0,0,0.12);
    }
    .measure-label.total {
      background: #372281; color: #fff;
      border-color: #372281;
    }
    .measure-label.area {
      background: rgba(182,14,127,0.88); color: #fff;
      border-color: #b60e7e;
      font-size: 13px; padding: 4px 12px;
      box-shadow: 0 2px 10px rgba(182,14,127,0.35);
    }
    /* ── Druckpanel ── */
    #print-toolbar {
      position: absolute; z-index: 30; top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(255,255,255,0.97); backdrop-filter: blur(12px);
      border: 1px solid rgba(182,14,127,0.4); border-radius: 12px;
      padding: 12px 14px; font-family: 'League Spartan', sans-serif;
      display: none; flex-direction: column; gap: 10px; width: 264px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    }
    #print-toolbar.visible { display: flex; }
    #print-toolbar-header {
      display: flex; align-items: center; justify-content: space-between;
      font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
      color: #b60e7e; font-weight: 700;
      padding-bottom: 6px; border-bottom: 1px solid rgba(182,14,127,0.2);
      cursor: move; user-select: none;
    }
    .print-row { display: flex; flex-direction: column; gap: 3px; }
    .print-row label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: #b60e7e; }
    .print-row select, .print-row input[type=text] {
      font-family: 'League Spartan', sans-serif; font-size: 12px; color: #372281;
      border: 1px solid rgba(182,14,127,0.3); border-radius: 6px;
      padding: 5px 8px; background: rgba(255,255,255,0.9); outline: none; width: 100%;
    }
    .print-row select:focus, .print-row input:focus { border-color: #b60e7e; }
    .print-orient-btns { display: flex; gap: 4px; }
    .print-orient-btn {
      flex: 1; padding: 5px 0; border-radius: 6px;
      border: 1px solid rgba(182,14,127,0.3);
      background: none; color: #372281;
      font-family: 'League Spartan', sans-serif; font-size: 11px;
      cursor: pointer; transition: all 0.15s; text-align: center;
    }
    .print-orient-btn.active { background: #372281; color: #fff; border-color: #372281; }
    .print-orient-btn:hover:not(.active) { background: rgba(55,34,129,0.08); }
    #btn-print-go {
      background: rgba(182,14,127,0.85); border: none; border-radius: 8px;
      color: #fff; font-family: 'League Spartan', sans-serif;
      font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
      padding: 9px; cursor: pointer; transition: background 0.2s; width: 100%;
    }
    #btn-print-go:hover:not(:disabled) { background: #372281; }
    #btn-print-go:disabled { background: #ccc; cursor: not-allowed; }
    #print-progress {
      font-size: 10px; color: #b60e7e; text-align: center;
      letter-spacing: 0.1em; display: none;
    }

    /* ── Status ── */
    #status {
      position: fixed;
      z-index: 20;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(255,255,255,0.95);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(182,14,127,0.2);
      border-radius: 20px;
      padding: 7px 18px;
      font-size: 12px;
      font-weight: 600;
      color: #b60e7e;
      letter-spacing: 0.1em;
      font-family: 'League Spartan', sans-serif;
      white-space: nowrap;
      pointer-events: none;
      box-shadow: 0 2px 12px rgba(182,14,127,0.12);
    }

    /* ════ RESPONSIVE ════ */
    @media (max-width: 768px) {
      .brand-text { display: none; }
      #topbar-brand { border-right: none; padding-right: 2px; }
      #topbar-brand img { height: 26px; }
      .nav-btn span:not(.nav-badge) { display: none; }
      .nav-btn { padding: 6px 9px; }
      #geocoder-container { width: 140px; }
      .mapboxgl-ctrl-geocoder { width: 140px !important; max-width: 140px !important; }
    }
    @media (max-width: 480px) {
      #geocoder-container { display: none; }
      #topbar { gap: 4px; padding: 5px 6px; }
      #draw-toolbar, #print-toolbar {
        width: calc(100vw - 28px);
        max-width: 300px;
      }
      #layer-drawer { width: 100%; }
      #legend-compact { display: none; }
    }

    /* ── Zeitreihen-Panel (bottom center) ── */
    #zeitreihe-panel {
      position: fixed;
      bottom: 38px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 200;
      background: rgba(255,255,255,0.97);
      backdrop-filter: blur(12px);
      border-radius: 14px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.18);
      border: 1px solid rgba(55,34,129,0.15);
      padding: 10px 16px 12px;
      min-width: 360px;
      max-width: min(600px, 92vw);
      font-family: 'League Spartan', sans-serif;
      user-select: none;
    }
    #zr-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    #zr-title {
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.18em;
      color: #372281;
      text-transform: uppercase;
    }
    #zr-time-display {
      font-size: 18px;
      font-weight: 700;
      color: #372281;
      text-align: center;
      margin-bottom: 10px;
      letter-spacing: 0.04em;
    }
    #zr-controls {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    #zr-play-btn {
      flex-shrink: 0;
      width: 34px;
      height: 34px;
      border: none;
      border-radius: 50%;
      background: #372281;
      color: #fff;
      font-size: 14px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.15s;
    }
    #zr-play-btn:hover { background: #b60e7e; }
    #zr-play-btn.playing { background: #b60e7e; }
    #zr-slider-wrap { flex: 1; }
    #zr-slider { width: 100%; accent-color: #372281; cursor: pointer; }
    #zr-end-label {
      font-size: 10px;
      color: #888;
      flex-shrink: 0;
      white-space: nowrap;
    }
    .zr-close-btn {
      background: none;
      border: none;
      color: #aaa;
      font-size: 16px;
      cursor: pointer;
      padding: 0 2px;
      line-height: 1;
    }
    .zr-close-btn:hover { color: #372281; }
    #zr-speed-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      margin-top: 8px;
    }
    .zr-speed-btn {
      border: 1px solid rgba(55,34,129,0.25);
      background: none;
      color: #372281;
      border-radius: 5px;
      padding: 2px 8px;
      font-size: 10px;
      font-family: 'League Spartan', sans-serif;
      cursor: pointer;
    }
    .zr-speed-btn.active { background: #372281; color: #fff; border-color: #372281; }
    .zr-speed-btn:hover { background: rgba(55,34,129,0.12); }
    .zr-speed-btn.active:hover { background: #b60e7e; border-color: #b60e7e; }
    /* Szenario-Umschalter: Raster statt einzeiliger Flex-Reihe. Mit vier und
       mehr Ereignissen (hq115 / HQ200 / T100 / T30 …) lief die Reihe aus dem
       Drawer. auto-fill legt so viele gleich breite Knöpfe nebeneinander wie
       Platz ist und bricht den Rest in die nächste Zeile — bei zwei oder drei
       Szenarien sieht es aus wie vorher. */
    #zr-scenario-row {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
      gap: 6px;
      margin-top: 10px;
      justify-content: stretch;
    }
    #zr-scenario-row .zr-ereignis-label {
      grid-column: 1 / -1;
      font-size: 10px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #8b86a8;
      margin-bottom: 1px;
    }
    #zr-scenario-row .zr-speed-btn {
      padding: 6px 8px;
      font-size: 12px;
      font-weight: 700;
      border-radius: 7px;
      letter-spacing: 0.01em;
      border-width: 1.5px;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ── Kuchendiagramm ── */
    #st-pie-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      margin-top: 4px;
    }
    #st-pie-canvas {
      width: 180px;
      height: 180px;
      cursor: pointer;
    }
    #st-pie-legend {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .st-pie-leg-row {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: #333;
      cursor: pointer;
      padding: 2px 4px;
      border-radius: 5px;
      transition: background .1s;
    }
    .st-pie-leg-row:hover { background: #f4f4ff; }
    .st-pie-leg-row.dimmed { opacity: 0.35; }
    .st-pie-swatch {
      width: 12px;
      height: 12px;
      border-radius: 3px;
      flex-shrink: 0;
    }
    .st-pie-leg-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .st-pie-leg-pct { color: #888; font-weight: 700; flex-shrink: 0; }
    #st-pie-tooltip {
      position: fixed;
      background: rgba(30,20,60,0.9);
      color: #fff;
      padding: 5px 10px;
      border-radius: 8px;
      font-size: 11px;
      pointer-events: none;
      display: none;
      z-index: 200;
      white-space: nowrap;
      box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

    /* ══════════════════════════════════════════════════════════════
       STYLE-TOOLBOX
    ══════════════════════════════════════════════════════════════ */
    #style-toolbox {
      position: fixed;
      top: 70px;
      right: 12px;
      bottom: 16px;
      width: 310px;
      /* über der jetzt auch am Desktop dauerhaft sichtbaren mobilen
         Icon-Leiste (#mobile-rail, z-index:280, mobile-ui.js) —
         beim Öffnen soll die Toolbox die Leiste überdecken, nicht
         umgekehrt */
      z-index: 290;
      background: rgba(255,255,255,0.97);
      backdrop-filter: blur(14px);
      border-radius: 20px;
      box-shadow: 0 4px 32px rgba(0,0,0,0.15), 0 0 0 1px rgba(55,34,129,0.1);
      display: flex;
      flex-direction: column;
      transform: translateX(calc(100% + 20px));
      transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
      overflow: hidden;
    }
    #style-toolbox.open { transform: translateX(0); }

    #st-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px 10px;
      border-bottom: 1px solid rgba(55,34,129,0.1);
      flex-shrink: 0;
    }
    #st-header span { font-size: 13px; font-weight: 700; color: #372281; letter-spacing: .02em; }
    #st-close { background: none; border: none; color: #aaa; font-size: 16px; cursor: pointer; padding: 2px 4px; }
    #st-close:hover { color: #372281; }

    /* Layer-Selektor */
    #st-layer-row {
      padding: 10px 14px 8px;
      border-bottom: 1px solid rgba(55,34,129,0.07);
      flex-shrink: 0;
    }
    #st-layer-row label { font-size: 10px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 4px; }
    #st-layer-select {
      width: 100%;
      padding: 6px 10px;
      border: 1px solid rgba(55,34,129,0.2);
      border-radius: 8px;
      font-size: 12px;
      color: #372281;
      font-family: 'League Spartan', sans-serif;
      background: #f8f7fe;
      cursor: pointer;
    }
    #st-layer-select:focus { outline: 2px solid #372281; outline-offset: 1px; }

    /* Tabs */
    #st-tabs {
      display: flex;
      padding: 0 14px;
      gap: 2px;
      border-bottom: 1px solid rgba(55,34,129,0.1);
      flex-shrink: 0;
    }
    .st-tab {
      flex: 1;
      padding: 8px 4px;
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      font-size: 11px;
      font-weight: 600;
      color: #aaa;
      cursor: pointer;
      font-family: 'League Spartan', sans-serif;
      transition: color .15s, border-color .15s;
    }
    .st-tab:hover { color: #372281; }
    .st-tab.active { color: #372281; border-bottom-color: #372281; }

    /* Scroll-Bereich */
    #st-scroll {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 12px 14px;
    }
    #st-scroll::-webkit-scrollbar { width: 4px; }
    #st-scroll::-webkit-scrollbar-thumb { background: rgba(55,34,129,0.2); border-radius: 4px; }

    /* Panes */
    .st-pane { display: none; }
    .st-pane.active { display: block; }

    /* Sections */
    .st-section { margin-bottom: 14px; }
    .st-label {
      font-size: 10px;
      font-weight: 700;
      color: #888;
      text-transform: uppercase;
      letter-spacing: .06em;
      margin-bottom: 5px;
      display: block;
    }
    .st-select {
      width: 100%;
      padding: 6px 8px;
      border: 1px solid rgba(55,34,129,0.2);
      border-radius: 8px;
      font-size: 12px;
      color: #333;
      font-family: 'League Spartan', sans-serif;
      background: #fafafa;
      cursor: pointer;
    }
    .st-input {
      width: 100%;
      padding: 6px 8px;
      border: 1px solid rgba(55,34,129,0.2);
      border-radius: 8px;
      font-size: 12px;
      font-family: 'League Spartan', sans-serif;
    }
    .st-slider-row { margin-bottom: 8px; }
    .st-slider-row label {
      display: flex;
      justify-content: space-between;
      font-size: 11px;
      color: #555;
      margin-bottom: 3px;
    }
    .st-slider-row label span { font-weight: 700; color: #372281; }
    .st-slider { width: 100%; accent-color: #372281; cursor: pointer; }

    /* Farb-Typ Toggle */
    .st-type-row {
      display: flex;
      gap: 4px;
      margin-bottom: 10px;
    }
    .st-type-btn {
      flex: 1;
      padding: 5px 4px;
      font-size: 10px;
      font-weight: 700;
      border: 1px solid rgba(55,34,129,0.2);
      border-radius: 7px;
      background: #f4f4ff;
      color: #372281;
      cursor: pointer;
      font-family: 'League Spartan', sans-serif;
      transition: background .15s, border-color .15s;
    }
    .st-type-btn.active { background: #372281; color: #fff; border-color: #372281; }
    .st-type-btn:hover:not(.active) { background: #e8e6f5; }

    /* Farbpaletten-Grid */
    .st-ramp-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px;
      margin-top: 6px;
    }
    .st-ramp-item {
      border-radius: 7px;
      border: 2px solid transparent;
      cursor: pointer;
      overflow: hidden;
      transition: border-color .15s;
    }
    .st-ramp-item.selected { border-color: #372281; }
    .st-ramp-item:hover { border-color: rgba(55,34,129,0.4); }
    .st-ramp-bar {
      height: 16px;
      width: 100%;
      border-radius: 5px 5px 0 0;
    }
    .st-ramp-name {
      font-size: 9px;
      text-align: center;
      padding: 2px;
      color: #555;
      font-weight: 600;
      background: #f5f5f5;
      border-radius: 0 0 5px 5px;
    }

    /* Kategorisch-Chips */
    .st-cat-list {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-top: 4px;
      max-height: 120px;
      overflow-y: auto;
    }
    .st-cat-chip {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 2px 6px;
      border-radius: 20px;
      font-size: 10px;
      background: #f0f0f0;
      color: #333;
    }
    .st-cat-swatch {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    /* Apply-Button */
    .st-apply-btn {
      width: 100%;
      padding: 9px;
      background: #372281;
      color: #fff;
      border: none;
      border-radius: 10px;
      font-size: 12px;
      font-weight: 700;
      font-family: 'League Spartan', sans-serif;
      cursor: pointer;
      margin-top: 10px;
      transition: background .15s;
    }
    .st-apply-btn:hover { background: #4a30a0; }
    .st-apply-btn.secondary {
      background: none;
      border: 1px solid rgba(55,34,129,0.3);
      color: #372281;
      margin-top: 4px;
    }
    .st-apply-btn.secondary:hover { background: #f0eef8; }
    .st-apply-btn.danger { background: #c62828; }
    .st-apply-btn.danger:hover { background: #e53935; }

    /* Statistik-Karten */
    .st-stat-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px;
      margin-bottom: 10px;
    }
    .st-stat-card {
      background: #f4f4ff;
      border-radius: 9px;
      padding: 7px 8px;
    }
    .st-stat-card .val { font-size: 16px; font-weight: 700; color: #372281; }
    .st-stat-card .lbl { font-size: 9px; color: #888; text-transform: uppercase; letter-spacing: .05em; }

    /* Histogramm-Canvas */
    #st-histogram { width: 100%; height: 70px; border-radius: 8px; background: #f8f7fe; display: block; }

    /* Top-Values-Liste */
    .st-topval-row {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 4px;
      font-size: 11px;
    }
    .st-topval-bar { height: 8px; border-radius: 4px; background: #372281; min-width: 2px; }
    .st-topval-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; }
    .st-topval-cnt { color: #888; font-weight: 600; flex-shrink: 0; }

    /* Farb-Picker Zeile */
    .st-color-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 6px;
    }
    .st-color-picker {
      width: 36px;
      height: 28px;
      border: 1px solid rgba(55,34,129,0.2);
      border-radius: 7px;
      padding: 1px;
      cursor: pointer;
    }
    .st-divider {
      border: none;
      border-top: 1px solid rgba(55,34,129,0.08);
      margin: 10px 0;
    }

    /* Zoom-to-Layer Button */
    #st-zoom-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      width: 100%;
      padding: 7px 10px;
      background: #f4f4ff;
      border: 1px solid rgba(55,34,129,0.15);
      border-radius: 9px;
      font-size: 11px;
      color: #372281;
      cursor: pointer;
      font-family: 'League Spartan', sans-serif;
      font-weight: 600;
      margin-bottom: 8px;
    }
    #st-zoom-btn:hover { background: #e8e6f5; }

/* ════════════════════════════════════════════════════════════════
   WASSERBILANZ-MODUL
   ════════════════════════════════════════════════════════════════ */
#mode-switcher {
  display: none; align-items: center; gap: 2px;
  padding: 0 8px; border-right: 1px solid rgba(55,34,129,0.1); flex-shrink: 0;
}
#mode-switcher.visible { display: flex; }
.mode-btn {
  font-family: 'League Spartan', sans-serif; font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: #888;
  border: none; background: transparent; border-radius: 20px;
  padding: 4px 10px; cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.mode-btn.active { background: #372281; color: #fff; }
.mode-btn:hover:not(.active) { color: #b60e7e; background: rgba(182,14,127,0.06); }

body.wb-mode #anim-settings-section { display: none !important; }
body.wb-mode #zeitreihe-section     { display: none !important; }
body.wb-mode #zeitreihe-panel       { display: none !important; }
body.wb-mode #flow-anim-section     { display: none !important; }
body.wb-mode #flow-canvas           { display: none; }
body.wb-mode #legend-compact        { display: none !important; }
body:not(.wb-mode) #wb-section      { display: none !important; }
body:not(.wb-mode) #wb-legend       { display: none !important; }
body:not(.wb-mode) #wb-detail-panel { display: none !important; }

.wb-comp-btns { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.wb-comp-btn {
  font-family: 'League Spartan', sans-serif; font-size: 11px; letter-spacing: 0.06em;
  color: #372281; background: rgba(55,34,129,0.04); border: 1px solid transparent;
  border-radius: 6px; padding: 6px 10px; cursor: pointer; transition: all 0.15s;
  text-align: left; display: flex; align-items: center; gap: 8px;
}
.wb-comp-btn .wb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wb-comp-btn:hover  { border-color: rgba(182,14,127,0.3); color: #b60e7e; }
.wb-comp-btn.active { background: rgba(182,14,127,0.1); border-color: rgba(182,14,127,0.5); color: #b60e7e; font-weight: 600; }

#wb-legend {
  position: fixed; bottom: 130px; right: 14px; z-index: 20;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
  border: 1px solid rgba(182,14,127,0.2); border-radius: 8px;
  padding: 8px 12px; font-family: 'League Spartan', sans-serif;
  min-width: 160px; pointer-events: none;
}
#wb-legend-title  { font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: #b60e7e; margin-bottom: 6px; }
#wb-legend-grad   { height: 7px; border-radius: 4px; margin-bottom: 4px; }
#wb-legend-labels { display: flex; justify-content: space-between; font-size: 10px; color: #888; }

#wb-detail-panel {
  position: fixed; z-index: 30; top: 65px; left: 300px; width: 275px;
  background: rgba(255,255,255,0.97); backdrop-filter: blur(16px);
  border: 1px solid rgba(182,14,127,0.25); border-radius: 12px;
  padding: 14px; font-family: 'League Spartan', sans-serif;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12); display: none;
}
.wb-panel-header  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.wb-panel-title   { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #b60e7e; font-weight: 700; line-height: 1.4; flex: 1; }
.wb-panel-close   { background: none; border: none; color: #aaa; font-size: 14px; cursor: pointer; padding: 0; flex-shrink: 0; }
.wb-panel-close:hover { color: #b60e7e; }
.wb-panel-row     { display: flex; align-items: center; padding: 4px 6px; border-radius: 5px; margin-bottom: 3px; font-size: 12px; color: #372281; }
.wb-panel-row.active-comp { background: rgba(182,14,127,0.07); }
.wb-panel-row .wb-pr-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-right: 7px; }
.wb-panel-row .wb-comp-name { flex: 1; }
.wb-panel-row .wb-bar-wrap  { flex: 1; height: 4px; background: rgba(182,14,127,0.08); border-radius: 2px; margin: 0 8px; overflow: hidden; }
.wb-panel-row .wb-bar       { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.wb-panel-row .wb-comp-val  { font-weight: 700; min-width: 38px; text-align: right; font-size: 11px; }
.wb-chart-wrap  { margin-top: 10px; border-top: 1px solid rgba(182,14,127,0.1); padding-top: 10px; }
.wb-chart-title { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: #b60e7e; margin-bottom: 6px; }
#wb-detail-chart  { width: 100% !important; height: 110px !important; }
.wb-panel-flaeche { font-size: 10px; color: rgba(55,34,129,0.4); margin-top: 6px; border-top: 1px solid rgba(182,14,127,0.08); padding-top: 5px; }

#wb-hover-tooltip {
  display: none; position: fixed; z-index: 25; pointer-events: none;
  background: rgba(255,255,255,0.97); border: 1px solid rgba(182,14,127,0.3);
  border-radius: 6px; padding: 5px 10px; font-family: 'League Spartan', sans-serif;
  font-size: 11px; color: #372281; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ── Boot-Loader ── */
#boot-loader {
  position: fixed; inset: 0; z-index: 99999;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  /* Der Ladehinweis darf die Karte nicht sperren — sonst bleibt sie bis zum
     Ende des Ladens (bzw. bis zum 30-s-Notausstieg) unbedienbar. Die Box
     enthält keine Bedienelemente, daher kostet das keine Funktion. */
  pointer-events: none;
}
#boot-loader.boot-loader-hide { opacity: 0; visibility: hidden; pointer-events: none; }
#boot-loader-box {
  width: 340px; padding: 28px 28px 22px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 18px; border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 12px 40px rgba(55,34,129,0.2), 0 2px 10px rgba(55,34,129,0.08);
}
#boot-loader-title {
  font-family: 'League Spartan', sans-serif;
  font-size: 17px; font-weight: 700; color: #372281;
  letter-spacing: 0.02em; margin-bottom: 20px; text-align: center;
}
#boot-loader-track {
  width: 100%; height: 5px; border-radius: 5px;
  background: rgba(182,14,127,0.14); overflow: hidden; margin-bottom: 10px;
}
#boot-loader-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #b60e7e, #372281);
  border-radius: 5px; transition: width 0.25s ease;
}
#boot-loader-msg {
  font-family: 'League Spartan', sans-serif;
  font-size: 10px; font-weight: 600; color: #b60e7e;
  letter-spacing: 0.08em; text-transform: uppercase; text-align: center;
}
#boot-loader-pct {
  font-family: 'League Spartan', sans-serif;
  font-size: 10px; color: #372281; opacity: 0.5; margin-top: 3px; text-align: center;
}
/* ── WB-Lade-Overlay ── */
#wb-load-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease;
}
#wb-load-overlay[hidden] { display: none; }
#wb-load-box {
  width: 320px; padding: 24px 24px 18px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 18px; border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 12px 40px rgba(55,34,129,0.2), 0 2px 10px rgba(55,34,129,0.08);
}
#wb-load-title {
  font-family: 'League Spartan', sans-serif;
  font-size: 15px; font-weight: 700; color: #372281;
  letter-spacing: 0.02em; margin-bottom: 16px; text-align: center;
}
#wb-load-track {
  width: 100%; height: 5px; border-radius: 5px;
  background: rgba(182,14,127,0.14); overflow: hidden; margin-bottom: 10px;
}
#wb-load-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #b60e7e 0%, #372281 50%, #b60e7e 100%);
  background-size: 200% 100%;
  border-radius: 5px;
  animation: wb-load-shimmer 1.6s linear infinite;
}
@keyframes wb-load-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
#wb-load-msg {
  font-family: 'League Spartan', sans-serif;
  font-size: 10px; font-weight: 600; color: #b60e7e;
  letter-spacing: 0.08em; text-transform: uppercase; text-align: center;
}
#wb-load-pct {
  font-family: 'League Spartan', sans-serif;
  font-size: 10px; color: #372281; opacity: 0.5; margin-top: 3px; text-align: center;
}
@media (prefers-color-scheme: dark) {
  #wb-load-box {
    background: rgba(30,24,60,0.9);
    border-color: rgba(255,255,255,0.1);
  }
  #wb-load-title { color: #c8bfff; }
  #wb-load-pct   { color: #c8bfff; }
}

    /* ── Update-Banner / Debug-Log (Feld-Diagnose) ── */
    #app-update-banner {
      position: fixed; z-index: 310; top: 10px; left: 50%;
      transform: translateX(-50%); display: none;
      align-items: center; gap: 10px; padding: 9px 14px;
      background: #b60e7e; color: #fff; border-radius: 24px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.3);
      font-family: 'League Spartan', sans-serif; font-size: 13px;
      max-width: calc(100vw - 24px);
    }
    #app-update-banner button {
      border: none; border-radius: 16px; padding: 5px 12px;
      background: #fff; color: #b60e7e; font-family: 'League Spartan', sans-serif;
      font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
    }
    #debug-log-panel {
      position: fixed; z-index: 320; left: 8px; right: 8px; bottom: 40px;
      max-height: 65vh; display: none; flex-direction: column;
      background: rgba(20,16,35,0.96); color: #d7d3ea; border-radius: 14px;
      box-shadow: 0 8px 30px rgba(0,0,0,0.4); overflow: hidden;
      font-family: 'League Spartan', sans-serif;
    }
    #debug-log-hdr {
      display: flex; align-items: center; gap: 8px; padding: 9px 12px;
      background: rgba(182,14,127,0.25); font-size: 12px; font-weight: 700;
      color: #fff;
    }
    #debug-log-hdr button {
      border: none; border-radius: 12px; padding: 4px 10px; font-size: 11px;
      background: rgba(255,255,255,0.15); color: #fff; cursor: pointer;
      font-family: 'League Spartan', sans-serif;
    }
    #debug-log-hdr span { margin-left: auto; }
    #debug-log-body {
      overflow-y: auto; padding: 8px 12px; font-size: 11px;
      font-family: 'SF Mono', Consolas, monospace; white-space: pre-wrap;
      word-break: break-word;
    }
    .dbg-zeile { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .dbg-warn { color: #e0a800; }
    .dbg-error { color: #e05252; }
