/* ===========================================================================
   Handbuch myContactCenter

   Farben, Schriften und Bausteine folgen ilogixx.de (Theme „ilogixx“) und
   LeadPilot: heller Grund, anthrazitfarbener Seitenkopf, Orange als Akzent.

   Zwei Regeln aus dem Theme gelten auch hier:
   - Orange ist keine Textfarbe auf hellem Grund (2,2 : 1). Für Verweise und
     Textakzente gibt es --accent-text (≈ 5 : 1).
   - Orange steht für „wartend / in Bearbeitung“, Grün für „gelöst / frei“ —
     dieselbe Lesart wie im Echtzeit-Dashboard. Grafiken halten sich daran.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1. Schriften (lokal, SIL Open Font License, Lizenztexte in fonts/LICENSES)
   --------------------------------------------------------------------------- */

@font-face {
  font-family: "Archivo Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/archivo-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------------------
   2. Farben und Maße

   Hell ist die Grundeinstellung. Dunkel greift, wenn das System es verlangt
   und niemand ausdrücklich „Hell“ gewählt hat, oder wenn „Dunkel“ gewählt ist.
   --------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  --paper: #f4f5f5;
  --surface: #ffffff;
  --surface-2: #eceeef;
  --line: #e3e5e6;
  --line-strong: #cfd3d5;
  --ink: #232628;
  --muted: #6b6f72;

  --accent: #ff850c;
  --accent-hover: #ff9d24;
  --accent-ink: #232628;
  --accent-text: #af550c;
  --accent-tint: rgba(255, 133, 12, 0.1);
  --ok: #00796b;
  --ok-bright: #32ac92;
  --ok-tint: rgba(0, 121, 107, 0.08);
  --info: #1b6e9c;
  --info-tint: rgba(27, 110, 156, 0.08);

  --band: #232628;
  --band-2: #2e3234;
  --band-line: #43484b;
  --band-ink: #ffffff;
  --band-muted: #a7adb0;

  --mark: rgba(255, 133, 12, 0.28);
  --shadow: 0 6px 24px rgba(35, 38, 40, 0.08);
  --shadow-strong: 0 18px 60px rgba(35, 38, 40, 0.22);

  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Archivo Variable", "Archivo", "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --topbar-height: 60px;
  --sidebar-width: 290px;
  --radius: 10px;
  --radius-small: 6px;
  --radius-pill: 999px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --paper: #1b1e20;
  --surface: #202426;
  --surface-2: #2a2e31;
  --line: #34393c;
  --line-strong: #4a5054;
  --ink: #eceeef;
  --muted: #a7adb0;

  --accent-text: #ff9d24;
  --accent-tint: rgba(255, 133, 12, 0.12);
  --ok: #32ac92;
  --ok-tint: rgba(50, 172, 146, 0.12);
  --info: #6cb4dc;
  --info-tint: rgba(108, 180, 220, 0.1);

  --band: #16181a;
  --band-2: #202426;
  --band-line: #34393c;

  --mark: rgba(255, 133, 12, 0.35);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  --shadow-strong: 0 18px 60px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --paper: #1b1e20;
    --surface: #202426;
    --surface-2: #2a2e31;
    --line: #34393c;
    --line-strong: #4a5054;
    --ink: #eceeef;
    --muted: #a7adb0;

    --accent-text: #ff9d24;
    --accent-tint: rgba(255, 133, 12, 0.12);
    --ok: #32ac92;
    --ok-tint: rgba(50, 172, 146, 0.12);
    --info: #6cb4dc;
    --info-tint: rgba(108, 180, 220, 0.1);

    --band: #16181a;
    --band-2: #202426;
    --band-line: #34393c;

    --mark: rgba(255, 133, 12, 0.35);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 18px 60px rgba(0, 0, 0, 0.55);
  }
}

/* ---------------------------------------------------------------------------
   3. Grundlagen
   --------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-height) + 1.25rem);
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

/* Lange deutsche Wörter wie „Leistungsüberwachung“ sind in großen Überschriften
   breiter als ein Telefon. Sie werden getrennt, notfalls hart umbrochen. */
h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  letter-spacing: -0.012em;
  text-wrap: balance;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}

a {
  color: var(--accent-text);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

button {
  font: inherit;
  color: inherit;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em 0.7em;
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.eyebrow::before {
  content: "";
  flex: none;
  inline-size: 26px;
  block-size: 1px;
  background: currentColor;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.6rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.icon-button .icon {
  width: 1.3rem;
  height: 1.3rem;
}

/* ---------------------------------------------------------------------------
   4. Kopfzeile
   --------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--topbar-height);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
}

.topbar__menu {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

.brand__mark img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

/* Das Zeichen hat selbst einen anthrazitfarbenen Grund und verschwände sonst
   in der dunklen Kopfzeile. */
:root[data-theme="dark"] .brand__mark img {
  box-shadow: 0 0 0 1px var(--line-strong);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand__mark img {
    box-shadow: 0 0 0 1px var(--line-strong);
  }
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__product {
  font-family: var(--font-head);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand__manual {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: min(420px, 100%);
  margin-left: max(1rem, calc(var(--sidebar-width) - 250px));
  padding: 0.5rem 0.6rem 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.search-trigger:hover {
  border-color: var(--accent);
}

.search-trigger__label {
  flex: 1;
}

.topbar__end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--muted);
}

.lang-switch > .icon {
  margin-right: 0.3rem;
}

.lang-switch__item {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
}

a.lang-switch__item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.lang-switch__item[aria-current] {
  background: var(--ink);
  color: var(--surface);
}

.theme-toggle .icon {
  display: none;
}

:root:not([data-theme]) .theme-toggle__auto,
:root[data-theme="light"] .theme-toggle__light,
:root[data-theme="dark"] .theme-toggle__dark {
  display: block;
}

/* ---------------------------------------------------------------------------
   5. Seitenaufbau und Navigation
   --------------------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-height));
}

.layout__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  align-self: start;
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem 1rem 3rem 1.25rem;
  border-right: 1px solid var(--line);
  background: var(--paper);
  scrollbar-width: thin;
}

.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar__head .eyebrow {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

.sidebar__close {
  display: none;
}

.nav__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__list--0 > .nav__item + .nav__item {
  margin-top: 0.15rem;
}

.nav__list--1,
.nav__list--2,
.nav__list--3 {
  display: none;
  margin: 0.1rem 0 0.4rem 1.05rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--line-strong);
}

.nav__item.is-open > .nav__list {
  display: block;
}

.nav__row {
  display: flex;
  align-items: center;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  padding: 0.38rem 0.6rem;
  border-radius: var(--radius-small);
  color: var(--ink);
  font-size: 0.93rem;
  line-height: 1.35;
  text-decoration: none;
}

.nav__list--0 > .nav__item > .nav__link,
.nav__list--0 > .nav__item > .nav__row > .nav__link {
  font-weight: 600;
}

.nav__link:hover {
  background: var(--surface-2);
}

.nav__link[aria-current="page"] {
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow);
  font-weight: 600;
}

.nav__icon {
  color: var(--muted);
}

.nav__link[aria-current="page"] .nav__icon,
.nav__item.is-open > .nav__row .nav__icon {
  color: var(--accent-text);
}

.nav__expand {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav__expand:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav__expand .icon {
  transition: transform 0.15s ease;
}

.nav__item.is-open > .nav__row .nav__expand .icon {
  transform: rotate(90deg);
}

.backdrop {
  display: none;
}

/* ---------------------------------------------------------------------------
   6. Seitenkopf (dunkles Band) und Inhalt
   --------------------------------------------------------------------------- */

.main {
  flex: 1;
}

.band {
  background: var(--band);
  color: var(--band-ink);
  border-bottom: 1px solid var(--band-line);
}

.band__inner {
  max-width: 1180px;
  padding: clamp(2.25rem, 4.5vw, 3.75rem) clamp(1.25rem, 4vw, 3.5rem) clamp(2rem, 4vw, 3.25rem);
}

.band .eyebrow {
  color: var(--accent);
}

.band h1 {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(2rem, 1.35rem + 2.3vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.022em;
}

.band__lead {
  max-width: 62ch;
  margin: 1.1rem 0 0;
  color: var(--band-muted);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb__sep {
  opacity: 0.55;
}

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  max-width: 1180px;
  padding: clamp(1.75rem, 3.5vw, 3rem) clamp(1.25rem, 4vw, 3.5rem) 2rem;
}

.page--with-toc {
  grid-template-columns: minmax(0, 1fr) 220px;
}

/* ---------------------------------------------------------------------------
   7. Fließtext
   --------------------------------------------------------------------------- */

.prose {
  min-width: 0;
  max-width: 760px;
  font-size: 1.0625rem;
}

.prose > :first-child {
  margin-top: 0;
}

.prose :where(p, ul, ol) {
  margin: 0 0 1.1em;
}

.prose :where(h2) {
  position: relative;
  margin: 2.6rem 0 0.9rem;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 700;
}

.prose :where(h2)::after {
  content: "";
  display: block;
  inline-size: 32px;
  block-size: 2px;
  margin-top: 0.65rem;
  background: var(--accent);
}

.prose :where(h3) {
  position: relative;
  margin: 2rem 0 0.6rem;
  font-size: 1.22rem;
  font-weight: 700;
}

.prose :where(h4) {
  position: relative;
  margin: 1.6rem 0 0.5rem;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0;
}

.prose :where(h2, h3, h4) + p {
  margin-top: 0;
}

.heading-anchor::before {
  content: "#";
}

.heading-anchor {
  margin-left: 0.4rem;
  color: var(--muted);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

:where(h2, h3, h4):hover > .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.prose :where(ul) {
  padding-left: 1.3rem;
}

.prose :where(ol) {
  padding-left: 1.75rem;
}

.prose :where(li) {
  margin-bottom: 0.45em;
  padding-left: 0.25rem;
}

.prose :where(li > ul, li > ol) {
  margin: 0.45em 0 0;
}

.prose :where(ul > li)::marker {
  color: var(--accent);
}

.prose :where(ol > li)::marker {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-weight: 500;
}

.prose :where(strong) {
  font-weight: 600;
}

.prose :where(code) {
  padding: 0.08em 0.38em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.prose :where(pre) {
  margin: 0 0 1.2em;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 0.9rem;
  line-height: 1.55;
}

.prose :where(pre code) {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}

/* Lizenztexte stehen als Codeblock, damit die Typografie ihren Wortlaut nicht
   verändert, brechen aber um wie Fließtext. */
.prose :where(pre code.language-lizenz) {
  font-family: var(--font-body);
  white-space: pre-wrap;
}

.prose :where(hr) {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose :where(blockquote) {
  margin: 0 0 1.2em;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}

.prose a.external::after {
  content: "↗";
  margin-left: 0.15em;
  font-size: 0.85em;
}

/* Tabellen scrollen auf schmalen Bildschirmen in ihrem Rahmen statt die
   ganze Seite zu verbreitern. */
.table-wrap {
  margin: 0 0 1.4em;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--paper);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.prose tr:last-child td {
  border-bottom: 0;
}

/* ---------------------------------------------------------------------------
   8. Hinweiskästen, Abbildungen, Karten
   --------------------------------------------------------------------------- */

.callout {
  margin: 1.5rem 0;
  padding: 0.9rem 1.1rem 0.2rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--callout-color);
  border-radius: var(--radius-small);
  background: var(--callout-tint);
  font-size: 1rem;
}

.callout--note {
  --callout-color: var(--info);
  --callout-tint: var(--info-tint);
}

.callout--tip {
  --callout-color: var(--ok);
  --callout-tint: var(--ok-tint);
}

.callout--warning {
  --callout-color: var(--accent);
  --callout-tint: var(--accent-tint);
}

.callout__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.45rem !important;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--callout-color);
}

.callout--warning .callout__title {
  color: var(--accent-text);
}

.callout__title .icon {
  width: 1.2rem;
  height: 1.2rem;
}

.figure {
  margin: 2rem 0;
  padding: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

/* Auf schmalen Bildschirmen schrumpft eine breite Grafik nicht bis zur
   Unleserlichkeit, sondern lässt sich in ihrem Rahmen seitlich verschieben. */
.figure > :where(svg, img) {
  display: block;
  width: 100%;
  min-width: 500px;
  height: auto;
  margin: 0 auto;
}

.figure > svg.diagram--narrow {
  min-width: 0;
}

.figure figcaption {
  margin-top: 1rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-align: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin: 2rem 0 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card__title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
}

.card__text {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   9. Grafiken

   Grafiken bestehen aus eingebettetem SVG und verwenden diese Klassen statt
   fester Farben — nur so wechseln sie mit dem dunklen Modus.
   --------------------------------------------------------------------------- */

.diagram {
  overflow: visible;
  font-family: var(--font-body);
}

.diagram .d-line {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagram .d-line--accent {
  stroke: var(--accent);
}

.diagram .d-line--ok {
  stroke: var(--ok-bright);
}

.diagram .d-line--dashed {
  stroke-dasharray: 5 6;
}

.diagram .d-arrow {
  fill: var(--line-strong);
}

.diagram .d-arrow--accent {
  fill: var(--accent);
}

.diagram .d-box {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.diagram .d-box--accent {
  stroke: var(--accent);
  stroke-width: 2;
}

.diagram .d-box--ok {
  stroke: var(--ok-bright);
  stroke-width: 2;
}

.diagram .d-box--dark {
  fill: var(--band);
  stroke: var(--band);
}

.diagram .d-box--tint {
  fill: var(--accent-tint);
  stroke: none;
}

.diagram .d-box--soft {
  fill: var(--surface-2);
  stroke: none;
}

.diagram .d-dot {
  fill: var(--muted);
}

.diagram .d-dot--accent {
  fill: var(--accent);
}

.diagram .d-dot--ok {
  fill: var(--ok-bright);
}

.diagram .d-text {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.diagram .d-text--strong {
  font-family: var(--font-head);
  font-weight: 700;
}

.diagram .d-text--invert {
  fill: var(--band-ink);
}

.diagram .d-text--muted {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.diagram .d-text--invert-muted {
  fill: var(--band-muted);
  font-size: 13px;
  font-weight: 400;
}

.diagram .d-label {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.diagram .d-label--accent {
  fill: var(--accent-text);
}

.diagram .d-label--ok {
  fill: var(--ok);
}

/* Nummern, auf die der Text neben einer Grafik verweist. Die Ziffer bleibt in
   beiden Modi dunkel, weil das Orange darunter gleich bleibt. */
.diagram .d-badge {
  fill: var(--accent);
}

.diagram .d-badge-text {
  fill: #232628;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

.diagram .d-icon {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagram .d-icon--invert {
  stroke: var(--band-ink);
}

.diagram .d-icon--accent {
  stroke: var(--accent);
}

/* ---------------------------------------------------------------------------
   10. Inhaltsverzeichnis der Seite, Blättern, Fuß
   --------------------------------------------------------------------------- */

.toc {
  position: sticky;
  top: calc(var(--topbar-height) + 2rem);
  align-self: start;
  max-height: calc(100vh - var(--topbar-height) - 4rem);
  overflow-y: auto;
  font-size: 0.88rem;
  scrollbar-width: thin;
}

.toc__title {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 0.3rem 0 0.3rem 0.9rem;
  border-left: 2px solid transparent;
  color: var(--muted);
  line-height: 1.4;
  text-decoration: none;
}

.toc__item--3 a {
  padding-left: 1.7rem;
  font-size: 0.84rem;
}

.toc a:hover {
  color: var(--ink);
}

.toc a.is-active {
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 500;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: calc(760px + 2 * clamp(1.25rem, 4vw, 3.5rem));
  padding: 1rem clamp(1.25rem, 4vw, 3.5rem) 3rem;
}

.pager__link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.pager__link:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.pager__link--next {
  grid-column: 2;
  text-align: right;
}

.pager__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pager__link--next .pager__label {
  justify-content: flex-end;
}

.pager__title {
  font-family: var(--font-head);
  font-weight: 700;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: auto;
  padding: 1.5rem clamp(1.25rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.footer a {
  color: inherit;
}

.footer a:hover {
  color: var(--accent-text);
}

/* ---------------------------------------------------------------------------
   11. Startseite
   --------------------------------------------------------------------------- */

.band--home .band__inner {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

.band--home h1 {
  max-width: 18ch;
  font-size: clamp(2.4rem, 1.5rem + 3.4vw, 4rem);
}

.home-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(560px, 100%);
  margin-top: 2rem;
  padding: 0.85rem 0.9rem 0.85rem 1.25rem;
  border: 1px solid var(--band-line);
  border-radius: var(--radius-pill);
  background: var(--band-2);
  color: var(--band-muted);
  font-size: 1.02rem;
  text-align: left;
  cursor: pointer;
}

.home-search:hover {
  border-color: var(--accent);
}

.home-search span {
  flex: 1;
}

.home-search kbd {
  border-color: var(--band-line);
  background: var(--band);
  color: var(--band-muted);
}

.home {
  max-width: 1180px;
  padding: clamp(1.75rem, 3.5vw, 3rem) clamp(1.25rem, 4vw, 3.5rem) 3rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.1rem;
  margin-bottom: 3rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.35rem 1.35rem 1.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.tile__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 0.35rem;
  border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent-text);
}

.tile__icon .icon {
  width: 24px;
  height: 24px;
}

.tile__title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
}

.tile__text {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   12. Suche
   --------------------------------------------------------------------------- */

.search {
  width: min(680px, calc(100% - 2rem));
  max-height: min(640px, calc(100vh - 6rem));
  margin: 8vh auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-strong);
}

.search[open] {
  display: flex;
  flex-direction: column;
}

.search::backdrop {
  background: rgba(22, 24, 26, 0.55);
  backdrop-filter: blur(3px);
}

.search__field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.9rem 1.2rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.search__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
}

.search__field input::-webkit-search-cancel-button {
  display: none;
}

.search__close {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.search__status {
  margin: 0;
  padding: 0.7rem 1.2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.search__status:empty {
  display: none;
}

.search__results {
  flex: 1;
  margin: 0;
  padding: 0.6rem;
  overflow-y: auto;
  list-style: none;
}

.search__results:empty {
  display: none;
}

.search__result {
  display: block;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-small);
  color: var(--ink);
  text-decoration: none;
}

.search__result:hover,
.search__result[aria-selected="true"] {
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--accent);
}

.search__chapter {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search__title {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
}

.search__excerpt {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.search__excerpt mark {
  padding: 0 0.1em;
  border-radius: 2px;
  background: var(--mark);
  color: var(--ink);
}

.search__keys {
  margin: 0;
  padding: 0.6rem 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------------
   13. Schmale Bildschirme
   --------------------------------------------------------------------------- */

@media (max-width: 1240px) {
  .page--with-toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 960px) {
  .topbar {
    gap: 0.5rem;
    padding: 0 0.75rem;
  }

  .topbar__menu {
    display: inline-grid;
  }

  .search-trigger {
    width: auto;
    margin-left: auto;
    padding: 0.5rem;
    border-color: transparent;
    background: transparent;
    color: var(--ink);
  }

  .search-trigger .icon {
    width: 1.3rem;
    height: 1.3rem;
  }

  .search-trigger__label,
  .search-trigger kbd {
    display: none;
  }

  .topbar__end {
    margin-left: 0;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: min(340px, 88vw);
    height: 100vh;
    height: 100dvh;
    padding-top: 1rem;
    box-shadow: var(--shadow-strong);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    visibility: hidden;
  }

  .sidebar__close {
    display: inline-grid;
  }

  body.nav-open .sidebar {
    transform: none;
    visibility: visible;
  }

  body.nav-open .backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    background: rgba(22, 24, 26, 0.5);
  }
}

@media (max-width: 560px) {
  .brand__manual {
    display: none;
  }

  .lang-switch > .icon {
    display: none;
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .pager__link--next {
    grid-column: 1;
  }

  .prose {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   14. Druck
   --------------------------------------------------------------------------- */

@media print {
  .topbar,
  .sidebar,
  .toc,
  .pager,
  .search,
  .skip-link,
  .heading-anchor,
  .home-search,
  .backdrop {
    display: none !important;
  }

  .layout {
    display: block;
  }

  body {
    background: #fff;
    color: #000;
  }

  .band {
    background: none;
    color: #000;
    border: 0;
  }

  .band__lead {
    color: #333;
  }

  .page {
    display: block;
    padding-top: 0;
  }

  .prose a {
    color: inherit;
  }

  .figure,
  .callout,
  .table-wrap {
    break-inside: avoid;
  }
}
