.mod-color-scheme-toggle {
  --toggle-bg: color-mix(in srgb, currentColor 8%, transparent);
  --toggle-bg-hover: color-mix(in srgb, currentColor 15%, transparent);
  --toggle-border: color-mix(in srgb, currentColor 30%, transparent);
  --toggle-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --toggle-size: 2.75rem;
}

.mod-color-scheme-toggle.is-fixed {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 999;
}

.mod-color-scheme-toggle.is-inline {
  display: inline-flex;
}

.mod-color-scheme-toggle__button {
  appearance: none;
  inline-size: var(--toggle-size);
  block-size: var(--toggle-size);
  border-radius: 999px;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--toggle-shadow);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.mod-color-scheme-toggle__button:hover,
.mod-color-scheme-toggle__button:focus-visible {
  background: var(--toggle-bg-hover);
  transform: translateY(-1px);
}

.mod-color-scheme-toggle__button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.mod-color-scheme-toggle__icon {
  font-size: 1.1rem;
  line-height: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

/* Light Mode */
html[data-color-scheme="light"] {
  color-scheme: light;
}

/* Dark Mode */
html[data-color-scheme="dark"] {
  color-scheme: dark;

  --brand-900: #e8eef8;
  --brand-800: #cbd9ef;
  --brand-700: #aac3e6;
  --brand-600: #8fb1df;
  --brand-500: #739fd6;
  --accent-500: #5db7de;
  --accent-400: #86cae9;
  --accent-300: #addcf2;

  --surface-0: #0b1320;
  --surface-1: #111d2e;
  --surface-2: #17263a;
  --surface-3: #203148;

  --text-900: #e4edf9;
  --text-700: #b8c8dd;
  --text-600: #9fb3cd;

  --success: #2ac087;
  --warning: #d8a246;

  --shadow-soft: 0 10px 24px -20px rgba(0, 0, 0, 0.8);
  --shadow-card: 0 16px 34px -26px rgba(0, 0, 0, 0.85);

  /* Toggle Button Anpassung */
  --toggle-bg: rgba(17, 29, 46, 0.94); /* dunkel */
  --toggle-bg-hover: rgba(23, 38, 58, 0.92); /* Hover leicht heller */
  --toggle-border: rgba(93, 183, 222, 0.18);
  --toggle-icon-color: #e4edf9; /* Icon hell */
}

html[data-color-scheme="dark"] .mod-color-scheme-toggle__button {
  background: var(--toggle-bg);
  color: var(--toggle-icon-color);
  border: 1px solid var(--toggle-border);
}

html[data-color-scheme="dark"] .mod-color-scheme-toggle__button:hover,
html[data-color-scheme="dark"] .mod-color-scheme-toggle__button:focus-visible {
  background: var(--toggle-bg-hover);
  color: var(--toggle-icon-color);
}

/* Rest Dark Mode Styles */
html[data-color-scheme="dark"] body.site {
  color: var(--text-900);
  background:
    radial-gradient(circle at 8% -6%, rgba(60, 143, 178, 0.22), transparent 32%),
    radial-gradient(circle at 94% 0%, rgba(42, 124, 167, 0.2), transparent 38%),
    linear-gradient(180deg, #0a121d 0%, #0c1522 52%, #0f1a29 100%);
}

html[data-color-scheme="dark"] a {
  color: var(--accent-400);
}

html[data-color-scheme="dark"] a:hover,
html[data-color-scheme="dark"] a:focus-visible {
  color: var(--accent-300);
  text-decoration-color: var(--accent-400);
}

html[data-color-scheme="dark"] .header {
  background:
    linear-gradient(135deg, rgba(7, 12, 19, 0.97), rgba(13, 25, 41, 0.95) 60%, rgba(27, 89, 124, 0.9));
  border-bottom: 1px solid rgba(173, 220, 242, 0.18);
  box-shadow: 0 14px 40px -24px rgba(0, 0, 0, 0.9);
}

/* Cards, Container, Grid */
html[data-color-scheme="dark"] .grid-child,
html[data-color-scheme="dark"] .card,
html[data-color-scheme="dark"] .moduletable,
html[data-color-scheme="dark"] .container-top-a .grid-child,
html[data-color-scheme="dark"] .container-top-b .grid-child,
html[data-color-scheme="dark"] .container-bottom-a .grid-child,
html[data-color-scheme="dark"] .container-bottom-b .grid-child,
html[data-color-scheme="dark"] .container-sidebar-left .grid-child,
html[data-color-scheme="dark"] .container-sidebar-right .grid-child {
  background: linear-gradient(135deg, rgba(17, 29, 46, 0.94), rgba(23, 38, 58, 0.92));
  border: 1px solid rgba(93, 183, 222, 0.18);
  box-shadow: var(--shadow-soft);
}

html[data-color-scheme="dark"] .grid-child:hover,
html[data-color-scheme="dark"] .card:hover,
html[data-color-scheme="dark"] .moduletable:hover {
  border-color: rgba(134, 202, 233, 0.35);
  box-shadow: 0 12px 32px -22px rgba(0, 0, 0, 0.8);
}

/* Texte, Überschriften, Tabellen, Blockquotes bleiben unverändert */