/* ============ 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 * { 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; right: 12px; bottom: 12px; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 999px; border: none;
  color: #fff; background: var(--BFSG-primary);
  display: grid; place-items: center; cursor: pointer; z-index: 9998;
  box-shadow: var(--BFSG-shadow);
}
.BFSG-toggle:hover { filter: brightness(1.05); }
.BFSG-toggle:focus { outline: 3px solid #b7ecff; outline-offset: 2px; }

/* 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; }
.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;
}
