/* Weboberflaeche — schlicht, ruhig, gut lesbar.
   Keine externen Schriften, keine externen Stile: die Oberflaeche muss offline
   funktionieren. Alle Groessen in rem, damit 150 % Zoom sauber traegt. */

:root {
  --papier: #fbfaf8;
  --karte: #ffffff;
  --linie: #d9d5cd;
  --text: #22201d;
  --gedaempft: #5f5a52;
  --akzent: #2f5d8a;
  --akzent-hell: #eaf1f8;
  --warnung: #8a4b1f;
  --warnung-hell: #fdf1e6;
  --fehler: #8f2f2f;
  --fehler-hell: #fbeaea;
  --gut: #2c6b3f;
  --gut-hell: #e8f3ec;
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

a { color: var(--akzent); }
a:hover { text-decoration: none; }

/* ------------------------------------------------------------- Kopf */

header.kopf {
  background: var(--karte);
  border-bottom: 1px solid var(--linie);
  padding: 0.9rem 1.4rem 0;
}

header.kopf h1 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

header.kopf h1 span { color: var(--gedaempft); font-weight: 400; }

nav.hauptmenue { display: flex; flex-wrap: wrap; gap: 0.15rem; }

nav.hauptmenue a {
  display: block;
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0.35rem 0.35rem 0 0;
  color: var(--gedaempft);
  text-decoration: none;
  font-size: 0.97rem;
}

nav.hauptmenue a:hover { background: var(--akzent-hell); color: var(--akzent); }

nav.hauptmenue a.aktiv {
  background: var(--papier);
  border-color: var(--linie);
  color: var(--text);
  font-weight: 600;
  margin-bottom: -1px;
}

main { padding: 1.4rem; max-width: 78rem; }

h2 { font-size: 1.35rem; margin: 0 0 0.3rem; font-weight: 600; }
h3 { font-size: 1.08rem; margin: 1.6rem 0 0.5rem; font-weight: 600; }
p.erklaerung { color: var(--gedaempft); margin: 0 0 1.2rem; max-width: 52rem; }

/* ---------------------------------------------------------- Bausteine */

.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 0.4rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.1rem;
}

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

.reihe { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: flex-start; }
.reihe > .karte { flex: 1 1 20rem; }

.kennzahlen { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.kennzahl {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 0.4rem;
  padding: 0.7rem 1rem;
  min-width: 8.5rem;
}
.kennzahl .zahl { display: block; font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.kennzahl .was { color: var(--gedaempft); font-size: 0.9rem; }

.meldung, .fehlermeldung {
  border-radius: 0.4rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.1rem;
  border: 1px solid;
}
.meldung { background: var(--gut-hell); border-color: var(--gut); color: var(--gut); }
.fehlermeldung { background: var(--fehler-hell); border-color: var(--fehler); color: var(--fehler); }
.hinweis {
  background: var(--warnung-hell); border: 1px solid var(--warnung);
  color: var(--warnung); border-radius: 0.4rem; padding: 0.75rem 1rem;
  margin-bottom: 1.1rem;
}

/* -------------------------------------------------------------- Tabellen */

.tabellenrahmen { overflow-x: auto; }

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--karte);
  font-size: 0.95rem;
}

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

thead th {
  background: #f2efe9;
  border-bottom: 2px solid var(--linie);
  white-space: nowrap;
  font-weight: 600;
}

thead th a { color: var(--text); text-decoration: none; display: block; }
thead th a:hover { color: var(--akzent); }
thead th a .pfeil { color: var(--akzent); }

tbody tr:hover { background: #faf8f4; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- Stufen */

.stufe {
  display: inline-block; min-width: 1.5rem; text-align: center;
  padding: 0.05rem 0.4rem; border-radius: 0.25rem;
  font-weight: 600; font-size: 0.9rem; border: 1px solid;
}
.stufe-A { background: #c6efce; border-color: #7fbf90; color: #1d4f2c; }
.stufe-B { background: #e2efda; border-color: #a8c9a0; color: #35502f; }
.stufe-C { background: #ffeb9c; border-color: #d9bf5e; color: #6a5410; }
.stufe-D { background: #f8cbad; border-color: #d99b6e; color: #7a3f16; }
.stufe-X { background: #ffc7ce; border-color: #d98b95; color: #7c2029; }

.marke {
  display: inline-block; padding: 0.05rem 0.45rem; border-radius: 0.25rem;
  background: #eeeae3; border: 1px solid var(--linie); font-size: 0.85rem;
  color: var(--gedaempft);
}

.balken {
  background: #eeeae3; border-radius: 0.25rem; height: 0.85rem;
  overflow: hidden; min-width: 6rem;
}
.balken > div { background: var(--akzent); height: 100%; }

/* -------------------------------------------------------------- Herkunft */

.herkunft {
  color: var(--gedaempft); font-size: 0.88rem; line-height: 1.4;
  margin-top: 0.15rem;
}
.herkunft a { color: var(--akzent); }
blockquote.fundstelle {
  margin: 0.3rem 0 0; padding: 0.35rem 0.7rem;
  border-left: 3px solid var(--linie); color: var(--gedaempft);
  font-size: 0.88rem; background: #faf8f4;
}

/* -------------------------------------------------------------- Formulare */

form.block { margin: 0; }
fieldset {
  border: 1px solid var(--linie); border-radius: 0.4rem;
  padding: 0.8rem 1rem 1rem; margin: 0 0 1.1rem;
}
legend { font-weight: 600; padding: 0 0.4rem; }

label { display: block; margin: 0.6rem 0 0.15rem; font-weight: 600; font-size: 0.95rem; }
label .beiwerk { font-weight: 400; color: var(--gedaempft); }

input[type=text], input[type=url], input[type=number], select, textarea {
  width: 100%; max-width: 42rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--linie); border-radius: 0.3rem;
  background: #fff; color: var(--text);
  font: inherit; font-size: 0.97rem;
}
textarea { min-height: 4.5rem; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--akzent); outline-offset: 1px; border-color: var(--akzent);
}

.feldreihe { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.feldreihe > div { flex: 1 1 14rem; }

button, .schaltflaeche {
  font: inherit; font-size: 0.97rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--akzent); border-radius: 0.3rem;
  background: var(--akzent); color: #fff; cursor: pointer;
  text-decoration: none; display: inline-block;
}
button:hover, .schaltflaeche:hover { background: #24486b; }
button.leise, .schaltflaeche.leise {
  background: #fff; color: var(--akzent);
}
button.leise:hover, .schaltflaeche.leise:hover { background: var(--akzent-hell); }
button.gefahr { background: #fff; color: var(--fehler); border-color: var(--fehler); }
button.gefahr:hover { background: var(--fehler-hell); }
.schaltflaechen { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

.filterleiste {
  display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: flex-end;
  margin-bottom: 1rem;
}
.filterleiste label { margin-top: 0; }
.filterleiste > div { flex: 0 1 12rem; }
.filterleiste input, .filterleiste select { max-width: none; }

.blaettern { display: flex; gap: 0.6rem; align-items: center; margin-top: 1rem; }

/* --------------------------------------------------------- Spaltenliste */

table.spaltenliste td { vertical-align: middle; }
tr.spaltenzeile { cursor: grab; }
tr.spaltenzeile.gezogen { opacity: 0.4; }
tr.spaltenzeile.ziel td { border-top: 3px solid var(--akzent); }
.griff { color: var(--gedaempft); cursor: grab; user-select: none; font-size: 1.1rem; }
input.position { width: 4.5rem; }
input.ueberschrift { width: 100%; max-width: none; }
code.feld { font-family: Consolas, "Courier New", monospace; font-size: 0.88rem;
            color: var(--gedaempft); }

/* -------------------------------------------------------------- Belegsicht */

.belegkopf {
  background: #fffbe6; border-bottom: 2px solid #d9bf5e;
  padding: 0.7rem 1.2rem; font-size: 0.93rem;
}
.belegkopf a { margin-right: 1rem; }
mark.fund { background: #ffe680; padding: 0.05rem 0.15rem; outline: 2px solid #d9a400; }

footer.fuss {
  color: var(--gedaempft); font-size: 0.88rem;
  padding: 1.5rem 1.4rem 2.5rem; max-width: 78rem;
}

/* --------------------------------------------------------------- Hilfe-Links */

a.hilfe-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.88rem; color: var(--akzent); text-decoration: none;
  padding: 0.05rem 0.1rem;
}
a.hilfe-link::before { content: "?"; display: inline-flex; align-items: center;
  justify-content: center; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 1px solid var(--akzent); font-size: 0.75rem; font-weight: 700; }
a.hilfe-link:hover { text-decoration: underline; }

/* ------------------------------------------------------------ Dokumentation */

.dokument-liste { margin-bottom: 0.5rem; }
a.dokument-kachel {
  text-decoration: none; color: inherit; display: block;
}
a.dokument-kachel:hover { border-color: var(--akzent); background: var(--akzent-hell); }
a.dokument-kachel h3 { margin-top: 0; color: var(--akzent); }
a.dokument-kachel p { margin-bottom: 0; }

nav.dokument-reiter {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--linie); padding-bottom: 0.6rem;
}
nav.dokument-reiter a {
  padding: 0.3rem 0.7rem; border-radius: 0.3rem; text-decoration: none;
  color: var(--gedaempft); font-size: 0.92rem;
}
nav.dokument-reiter a:hover { background: var(--akzent-hell); color: var(--akzent); }
nav.dokument-reiter a.aktiv { background: var(--akzent); color: #fff; }

.dokument-rahmen { display: flex; gap: 1.6rem; align-items: flex-start; }

.dokument-tocbox {
  flex: 0 0 15rem; position: sticky; top: 1rem;
  background: var(--karte); border: 1px solid var(--linie); border-radius: 0.4rem;
  padding: 0.8rem 0.9rem; max-height: calc(100vh - 2rem); overflow-y: auto;
}
.dokument-toc-titel { font-weight: 600; font-size: 0.85rem; color: var(--gedaempft);
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.4rem; }
ul.inhaltsverzeichnis { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
ul.inhaltsverzeichnis li { margin: 0.15rem 0; }
ul.inhaltsverzeichnis li.stufe-3 { padding-left: 0.9rem; font-size: 0.87rem; }
ul.inhaltsverzeichnis a { color: var(--text); text-decoration: none; }
ul.inhaltsverzeichnis a:hover { color: var(--akzent); text-decoration: underline; }

.dokument-inhalt { flex: 1 1 auto; min-width: 0; max-width: 46rem; }
.dokument-inhalt h1 {
  font-size: 1.55rem; margin: 0 0 1rem; padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--linie);
}
.dokument-inhalt h2 {
  font-size: 1.2rem; margin: 2rem 0 0.6rem; padding-top: 1rem;
  border-top: 1px solid var(--linie);
}
.dokument-inhalt h1 + h2, .dokument-inhalt > h2:first-of-type { border-top: none; padding-top: 0; }
.dokument-inhalt h3 { font-size: 1.05rem; margin: 1.3rem 0 0.4rem; }
.dokument-inhalt h4 { font-size: 0.98rem; margin: 1.1rem 0 0.3rem; font-weight: 600; }
.dokument-inhalt p { margin: 0 0 0.9rem; max-width: 42rem; }
.dokument-inhalt ul, .dokument-inhalt ol { margin: 0 0 0.9rem; padding-left: 1.4rem; }
.dokument-inhalt li { margin: 0.2rem 0; }
.dokument-inhalt li.aufgabe { list-style: none; margin-left: -1.4rem; }
.dokument-inhalt li.aufgabe input { margin-right: 0.4rem; }
.dokument-inhalt blockquote {
  margin: 0 0 0.9rem; padding: 0.6rem 1rem; border-left: 3px solid var(--akzent);
  background: var(--akzent-hell); color: var(--text);
}
.dokument-inhalt pre {
  background: #2b2823; color: #f2efe9; border-radius: 0.4rem;
  padding: 0.8rem 1rem; overflow-x: auto; margin: 0 0 0.9rem; font-size: 0.88rem;
  line-height: 1.5;
}
.dokument-inhalt pre code { background: none; color: inherit; padding: 0; }
.dokument-inhalt code {
  background: #eeeae3; border-radius: 0.25rem; padding: 0.05rem 0.35rem;
  font-family: Consolas, "Courier New", monospace; font-size: 0.88rem;
}
.dokument-inhalt table { margin: 0 0 0.9rem; }
.dokument-inhalt hr { border: none; border-top: 1px solid var(--linie); margin: 1.6rem 0; }
.dokument-inhalt a { word-break: break-word; }

@media (max-width: 60rem) {
  .dokument-rahmen { flex-direction: column; }
  .dokument-tocbox { position: static; flex: 1 1 auto; width: 100%; max-height: none; }
}

@media (max-width: 45rem) {
  main { padding: 1rem 0.8rem; }
  header.kopf { padding: 0.8rem 0.8rem 0; }
  .kennzahl { min-width: 7rem; }
}
