:root {
  --sidebar-width: 280px;
  --header-height: 52px;
  --content-max: 980px;
  --color-brand: #f3961c;
  --color-brand-hover: #ff812d;
  --color-bg: #0d1117;
  --color-bg-subtle: #161b22;
  --color-bg-muted: #21262d;
  --color-border: #30363d;
  --color-border-strong: #484f58;
  --color-text: #e6edf3;
  --color-text-secondary: #8b949e;
  --color-text-muted: #6e7681;
  --color-link: #58a6ff;
  --color-link-hover: #79b8ff;
  --color-nav-active-bg: rgba(243, 150, 28, 0.1);
  --color-nav-active-border: #f3961c;
  --color-callout-note: #58a6ff;
  --color-callout-warning: #d29922;
  --color-callout-danger: #f85149;
  --color-callout-tip: #3fb950;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.site-header .header-brand-logo,
.site-header .header-brand-logo:link,
.site-header .header-brand-logo:visited,
.site-header .header-brand-logo:hover,
.site-header .header-brand-logo:focus,
.site-header .header-brand-logo:active {
  display: flex;
  line-height: 0;
  text-decoration: none !important;
  border: none !important;
  color: inherit;
}

.site-header .header-brand-logo:hover {
  opacity: 0.85;
}

.site-header .header-brand span {
  color: var(--color-text);
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem 0 1rem;
  z-index: 200;
}

.menu-toggle {
  display: none;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  margin-left: auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex-shrink: 0;
}

.header-brand img {
  height: 24px;
  width: auto;
  flex-shrink: 0;
}

.header-brand span {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* ── Layout ── */
.layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--color-bg-subtle);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.2s ease;
}

.sidebar-inner {
  padding: 1rem 0.75rem 2rem;
}

.nav-label {
  padding: 0.75rem 0.75rem 0.35rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.nav-group {
  padding-top: 0.5rem;
  color: var(--color-text-secondary);
}

.nav-list {
  list-style: none;
  margin: 0 0 0.25rem;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: 0.35rem 0.75rem;
  margin: 1px 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.nav-list a:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-list a.active {
  color: var(--color-text);
  font-weight: 600;
  background: var(--color-nav-active-bg);
  border-left-color: var(--color-nav-active-border);
}

.nav-sub {
  margin: 0 0 0.5rem 0.35rem;
  padding-left: 0.35rem;
  border-left: 1px solid var(--color-border);
}

.nav-sub a {
  font-size: 0.8125rem;
  padding-left: 0.65rem;
}

/* ── Main ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 4rem;
}

.content {
  max-width: var(--content-max);
}

/* Breadcrumb */
.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.doc-breadcrumb a {
  color: var(--color-text-secondary);
}

.doc-breadcrumb a:hover {
  color: var(--color-link);
}

.doc-breadcrumb-sep {
  color: var(--color-border-strong);
  user-select: none;
}

.doc-breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}

/* ── Sections ── */
.section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-header {
  margin-bottom: 1rem;
}

.section-number {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-brand);
  letter-spacing: 0.02em;
}

.section h1,
.section h2 {
  margin: 0 0 0.75rem;
  line-height: 1.25;
  color: var(--color-text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.section h2 {
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.section h3 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

.section > p,
.section > ul,
.section > ol {
  margin: 0 0 1rem;
  color: var(--color-text-secondary);
}

.section p strong,
.section li strong {
  color: var(--color-text);
  font-weight: 600;
}

.section ul,
.section ol {
  padding-left: 1.5rem;
}

.section li {
  margin-bottom: 0.35rem;
}

.section li ul {
  margin-top: 0.35rem;
}

/* Intro */
.section-hero {
  border-bottom: 1px solid var(--color-border);
}

.hero-banner {
  margin-bottom: 1.5rem;
}

.hero-banner .section-number {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.hero-banner h1 {
  border-bottom: none;
  padding-bottom: 0;
  font-size: 2.25rem;
}

.hero-lead {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 42rem;
}

.section-body h3:first-child {
  margin-top: 0;
}

/* Kompatibilität */
.compat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.compat-item {
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

/* Callouts (Microsoft / GitHub style) */
.callout {
  display: flex;
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding: 0.875rem 1rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  border-left-width: 4px;
  border-left-color: var(--color-brand);
}

.callout-title {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  min-width: 4.5rem;
}

.callout p {
  margin: 0 !important;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.callout-warning {
  background: rgba(210, 153, 34, 0.1);
  border-color: rgba(210, 153, 34, 0.35);
  border-left-color: var(--color-callout-warning);
}

.callout-warning .callout-title {
  color: #e3b341;
}

.callout-danger {
  background: rgba(248, 81, 73, 0.1);
  border-color: rgba(248, 81, 73, 0.35);
  border-left-color: var(--color-callout-danger);
}

.callout-danger .callout-title {
  color: #ff7b72;
}

.callout-info {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
  border-left-color: var(--color-callout-note);
}

.callout-info .callout-title {
  color: #79b8ff;
}

/* Steps */
.steps {
  margin: 1rem 0 1.25rem;
  padding-left: 1.5rem;
  color: var(--color-text-secondary);
}

.steps li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.steps li::marker {
  color: var(--color-text);
  font-weight: 600;
}

/* Bilder */
.figure {
  margin: 1.25rem 0;
  text-align: center;
}

.figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 420px;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.figure img:hover {
  opacity: 0.92;
}

.figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

.figure-featured img {
  max-height: 480px;
}

.figure-schaltplan img {
  max-height: none;
  max-width: 100%;
  width: 100%;
}

.screenshot-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin: 1.25rem 0;
  align-items: start;
}

.screenshot-row .figure {
  margin: 0;
}

.screenshot-row .figure img {
  max-height: 280px;
}

/* Bild-Lightbox */
body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.image-lightbox[hidden] {
  display: none !important;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, 0.88);
  cursor: pointer;
}

.image-lightbox-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  pointer-events: none;
}

.image-lightbox-body > * {
  pointer-events: auto;
}

.image-lightbox-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.5rem 1rem;
  -webkit-overflow-scrolling: touch;
  cursor: pointer;
}

.image-lightbox-viewport img {
  display: block;
  flex-shrink: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
}

.image-lightbox-viewport.is-zoomed img {
  cursor: zoom-out;
}

.image-lightbox-caption {
  flex-shrink: 0;
  margin: 0;
  padding: 0.75rem 1.5rem 1.25rem;
  color: #e6edf3;
  font-size: 0.875rem;
  text-align: center;
  cursor: pointer;
}

.image-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Kontakt */
.contact-card {
  margin-top: 0.5rem;
  padding: 1.25rem 1.5rem;
  max-width: 360px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.contact-card p {
  margin: 0 0 0.2rem !important;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.contact-card a {
  color: var(--color-link);
}

.contact-spacer {
  margin-top: 0.85rem !important;
}

.contact-logo {
  margin-bottom: 0.85rem;
}

.contact-logo img {
  height: 26px;
  width: auto;
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(1, 4, 9, 0.65);
  z-index: 90;
}

.sidebar-overlay.visible {
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .site-header {
    padding: 0 1rem;
  }

  .menu-toggle {
    display: block;
  }

  .header-badge {
    display: none;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: 1.5rem 1rem 3rem;
  }

  .content {
    max-width: none;
  }

  .hero-banner h1,
  .section h1 {
    font-size: 1.75rem;
  }

  .section h2 {
    font-size: 1.35rem;
  }
}

.section-legal {
  margin-top: 0;
  padding-top: 0;
}

.section-legal .callout {
  margin-top: 0;
}

.site-footer-inner {
  max-width: 52rem;
  margin: 0 auto;
}

.site-footer-contact p {
  margin: 0 0 0.35rem;
  line-height: 1.5;
}

.site-footer-logo {
  margin-bottom: 0.75rem;
}

.site-footer-logo img {
  height: 26px;
  width: auto;
}

.site-footer-copy {
  margin: 1rem 0 0;
  opacity: 0.85;
}

.site-footer {
  margin-left: var(--sidebar-width);
  padding: 2rem 2rem 2.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--color-text-muted);
}

.site-footer a:hover {
  color: var(--color-link);
}

@media (max-width: 900px) {
  .site-footer {
    margin-left: 0;
    padding-inline: 1rem;
  }
}

@media (max-width: 480px) {
  .callout {
    flex-direction: column;
    gap: 0.35rem;
  }

  .callout-title {
    min-width: 0;
  }
}
