/* ============ BFSG – Grundstil ============ */
html :focus-visible {
  outline: 4px dashed #000 !important;
  outline-offset: 5px !important;
  border-radius: 5px !important;
  transition: outline-offset 0.1s ease-in-out;
}

:root {
  --BFSG-primary: #2b5d6a;
  --BFSG-ink: #0f172a;
  --BFSG-panel-bg: #ffffff;
  --BFSG-shadow: 0 10px 25px rgba(2, 8, 23, 0.20);
  --BFSG-accent: #00bfa6;        /* Link-Highlight-Farbe */
  --BFSG-border: rgba(15, 23, 42, 0.12);
  --BFSG-radius: 16px;
}

#BFSG-accessibility {
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.BFSG * { box-sizing: border-box; }
.BFSG .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Floating Toggle Button (rechts, unten) */
.BFSG-toggle {
  position: fixed;
  left: 50%;          /* statt right */
  right: auto;
  bottom: max(12px, env(safe-area-inset-bottom, 0px) + 12px);
  transform: translateX(-50%);  /* statt translateY(-50%) */
  width: 52px; height: 52px; border-radius: 999px; border: none;
  color: #fff !important; background: var(--BFSG-primary);
  display: grid; place-items: center; cursor: pointer; z-index: 9998;
  box-shadow: var(--BFSG-shadow);
  z-index: 20001; /* sicher über Content/Panel */
}
.BFSG-toggle:hover { filter: brightness(1.05); }
.BFSG-toggle:focus { outline: 3px solid #b7ecff; outline-offset: 2px; }

/* Basisfarben (anpassbar) */
.BFSG-toggle[data-tooltip] {
  --bfsg-tip-bg: #0f172a;
  --bfsg-tip-color: #ffffff;
}

/* Tooltip-Bubble */
.BFSG-toggle[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) scale(.95);
  background: var(--bfsg-tip-bg);
  color: var(--bfsg-tip-color);
  padding: 8px 10px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--BFSG-shadow);
  opacity: 0;
  transition:
    opacity .16s ease,
    transform .18s cubic-bezier(.2,.9,.2,1.2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
}


/* Anzeigen bei Hover/Focus */
.BFSG-toggle:hover::before,
.BFSG-toggle:focus-visible::before,
.BFSG-toggle:hover::after,
.BFSG-toggle:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Touch: kurzes Anzeigen beim Press */
.BFSG-toggle:active::before,
.BFSG-toggle:active::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Reduced motion respektieren */
@media (prefers-reduced-motion: reduce) {
  .BFSG-toggle[data-tooltip]::before,
  .BFSG-toggle[data-tooltip]::after {
    transition: none;
  }
}


/* Slide-in Panel */
.BFSG-panel {
  position: fixed; inset: 0 0 0 auto; width: min(360px, 94vw); height: 100vh;
  background: var(--BFSG-panel-bg); color: var(--BFSG-ink);
  box-shadow: var(--BFSG-shadow); z-index: 20000; transform: translateX(110%);
  transition: transform .35s ease;
  display: grid; grid-template-rows: auto 1fr;
}
.BFSG-panel.open { transform: translateX(0); }

.BFSG-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--BFSG-primary); color: #fff; }
.BFSG-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.BFSG-close { border: 0; background: rgba(255,255,255,.12); color: #fff; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; }
.BFSG-close:hover { background: rgba(255,255,255,.18); }

.BFSG-content { padding: 16px; overflow: auto; }
.BFSG-section { 
  margin-bottom: 18px; 
  background: none !important;
  border: 0!important;
  border-radius: 0!important;
  padding: 0!important;
  margin: 0!important; 
}
.BFSG-h4 { margin: 0 0 10px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #334155; }
.BFSG-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.BFSG-divider { border: 0; border-top: 1px solid var(--BFSG-border); margin: 14px 0; }
.BFSG-hint { margin-top: 8px; font-size: 12px; color: #64748b; }

.BFSG-btn {
  appearance: none; border: 1px solid var(--BFSG-border); background: #0f172a; color: #fff;
  padding: 10px 14px; border-radius: 12px; cursor: pointer; font-weight: 700; letter-spacing: .2px;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.BFSG-btn:hover { filter: brightness(1.05); }
.BFSG-btn:active { transform: translateY(1px); }
.BFSG-btn-wide { width: 100%; }
.BFSG-btn-reset { background: #ef4444; border-color: #ef4444; }

/* Link-Highlight-Modus */
body.BFSG-highlight a {
  text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 2px;
  background: color-mix(in oklab, var(--BFSG-accent) 20%, white); color: #0b0f12 !important;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--BFSG-accent) 55%, transparent) inset, 0 0 0 2px var(--BFSG-accent);
  border-radius: 6px;
}

/* ===== Invert-Modus – jetzt auf <html> (Fallback: body) ===== */
html.BFSG-invert,
body.BFSG-invert {
  filter: invert(1) hue-rotate(180deg);
}

/* Medien wieder normal darstellen */
html.BFSG-invert img,
html.BFSG-invert video,
html.BFSG-invert iframe,
html.BFSG-invert svg,
html.BFSG-invert picture,
html.BFSG-invert canvas,
body.BFSG-invert img,
body.BFSG-invert video,
body.BFSG-invert iframe,
body.BFSG-invert svg,
body.BFSG-invert picture,
body.BFSG-invert canvas {
  filter: invert(1) hue-rotate(180deg) !important;
}

/* Optional: Widget-UI im Invert-Modus normal lassen */
html.BFSG-invert .BFSG-panel,
html.BFSG-invert .BFSG-toggle {
  filter: invert(1) hue-rotate(180deg) !important;
}

html.BFSG-invert .BFSG-toggle svg {
  filter: invert(0) !important; /*invert(1) hue-rotate(180deg) !important; */
}