:root {
  --grund: #f6f5f1; --flaeche: #ffffff; --linie: #e3e0d8; --text: #1f1e1b; --leise: #6b675e;
  --akzent: #1f6f5c; --akzent-text: #ffffff; --akzent-weich: #e3f1ec;
  --warn: #9a5b00; --warn-weich: #fff3dc; --stopp: #a62b1f; --stopp-weich: #fde8e5; --gut: #1f6f3a;
  --radius: 12px; --schatten: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #151513; --flaeche: #1e1e1b; --linie: #33322d; --text: #ecebe6; --leise: #a19d92;
    --akzent: #4fb596; --akzent-text: #0d1f19; --akzent-weich: #1b2f28;
    --warn: #f0b458; --warn-weich: #33280f; --stopp: #ff8a7a; --stopp-weich: #3a1a16; --gut: #6fd08f;
    --schatten: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--akzent); }
h1 { font-size: 1.45rem; margin: .2rem 0 1rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
small, .leise { color: var(--leise); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5; }
.kopf-innen { max-width: 980px; margin: 0 auto; padding: .6rem 16px; display: flex; align-items: center; gap: .8rem; }
.marke { font-weight: 700; text-decoration: none; color: var(--text); white-space: nowrap; }
.marke span { color: var(--leise); font-weight: 400; }
.kopf form { margin-left: auto; }
nav.haupt { max-width: 980px; margin: 0 auto; padding: 0 16px; display: flex; gap: .2rem; overflow-x: auto;
  scrollbar-width: none; }
nav.haupt a { padding: .55rem .7rem; text-decoration: none; color: var(--leise); border-bottom: 2px solid transparent;
  white-space: nowrap; font-size: .95rem; }
nav.haupt a.aktiv { color: var(--text); border-color: var(--akzent); }
.zahl { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 99px; background: var(--akzent);
  color: var(--akzent-text); font-size: .75rem; text-align: center; margin-left: .2rem; }

main { max-width: 980px; margin: 0 auto; padding: 1rem 16px 4rem; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem;
  box-shadow: var(--schatten); margin-bottom: 1rem; }
.raster { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kachel { display: block; text-decoration: none; color: inherit; }
.kachel .wert { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.kachel.hervor { border-color: var(--akzent); background: var(--akzent-weich); }

.meldung { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; background: var(--akzent-weich); }
.warnung { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: .6rem; background: var(--warn-weich);
  color: var(--text); border-left: 4px solid var(--warn); }
.stopp { background: var(--stopp-weich); border-left: 4px solid var(--stopp); padding: .7rem 1rem;
  border-radius: var(--radius); margin-bottom: 1rem; }
.leer { color: var(--leise); padding: 1rem; border: 1px dashed var(--linie); border-radius: var(--radius); }
.leer strong { color: var(--text); }

.knopf, button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit;
  padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text);
  cursor: pointer; text-decoration: none; min-height: 44px; }
.knopf.haupt, button.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 600; }
button.gefahr { color: var(--stopp); border-color: var(--stopp); }
button.not-aus { background: var(--stopp); border-color: var(--stopp); color: #fff; font-weight: 600; min-height: 36px;
  padding: .3rem .8rem; }
button.not-aus.aus { background: transparent; color: var(--stopp); }
button:disabled { opacity: .6; cursor: wait; }
.knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.knoepfe.klebend { position: sticky; bottom: 0; background: var(--grund); padding: .8rem 0; border-top: 1px solid var(--linie); }

label { display: block; font-weight: 600; margin: .8rem 0 .25rem; }
label.inline { display: inline-flex; gap: .4rem; align-items: center; font-weight: 400; margin: .2rem .9rem .2rem 0; }
input[type=text], input[type=date], input[type=number], select, textarea { width: 100%; font: inherit; color: var(--text);
  padding: .55rem .65rem; border: 1px solid var(--linie); border-radius: 8px; background: var(--grund); }
textarea { min-height: 7rem; resize: vertical; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; accent-color: var(--akzent); }
.hilfe { font-size: .88rem; color: var(--leise); margin: .2rem 0 0; }

.etikett { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .8rem; border: 1px solid var(--linie);
  color: var(--leise); white-space: nowrap; }
.etikett.gut { color: var(--gut); border-color: var(--gut); }
.etikett.warn { color: var(--warn); border-color: var(--warn); }
.etikett.stopp { color: var(--stopp); border-color: var(--stopp); }

.beitrag { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .beitrag { grid-template-columns: 260px 1fr; } }
.medium img, .medium video { width: 100%; border-radius: 10px; border: 1px solid var(--linie); background: #000; }
.plattform-text { border: 1px solid var(--linie); border-radius: 10px; padding: .7rem .8rem; margin-bottom: .6rem;
  background: var(--grund); }
.plattform-text .kopfzeile { display: flex; justify-content: space-between; gap: .5rem; align-items: center;
  margin-bottom: .3rem; flex-wrap: wrap; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.vorher { white-space: pre-wrap; color: var(--leise); text-decoration: line-through; font-size: .92rem; }
.befund { font-size: .92rem; border-left: 3px solid var(--warn); padding-left: .6rem; margin: .3rem 0; }

table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { color: var(--leise); font-weight: 600; font-size: .85rem; }
.tabelle { overflow-x: auto; }
.zeile { display: flex; gap: .6rem; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.zeile form { display: inline; }
.geheimnis { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--grund); border: 1px dashed var(--akzent);
  padding: .8rem; border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.schritte { padding-left: 1.2rem; } .schritte li { margin: .35rem 0; }
footer { max-width: 980px; margin: 0 auto; padding: 0 16px 2rem; color: var(--leise); font-size: .8rem; }
.schmal { max-width: 520px; margin: 3rem auto; }
h2.oben { margin-top: 0; }
label.fett { font-weight: 700; }
.raster.eng { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
textarea.kurz { min-height: 4rem; }
input.kurzfeld { max-width: 280px; }
.abstand { margin-top: .8rem; }
/* Handy: Tabellen als Karten stapeln, Kacheln zweispaltig */
@media (max-width: 640px) {
  .raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster.eng { grid-template-columns: 1fr; }
  .kachel .wert { font-size: 1.6rem; }
  table.stapel, table.stapel tbody, table.stapel tr, table.stapel td { display: block; width: 100%; }
  table.stapel tr { padding: .6rem 0; border-bottom: 1px solid var(--linie); }
  table.stapel td { border: 0; padding: .15rem 0; }
  table.stapel tr.kopfzeile-tabelle { display: none; }
  table.stapel td form, table.stapel td .knopf { display: inline-block; margin: .3rem .3rem 0 0; }
}

/* Schalter statt kleiner Kästchen (besser sichtbar, v. a. im Dunkelmodus) */
input.schalter { appearance: none; -webkit-appearance: none; width: 2.8rem; height: 1.6rem; border-radius: 99px;
  background: var(--linie); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
input.schalter::after { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.2rem; height: 1.2rem;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
input.schalter:checked { background: var(--akzent); }
input.schalter:checked::after { left: 1.4rem; }
input.schalter:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
label.schalter-zeile { gap: .6rem; font-size: 1.05rem; }

/* ---------------------------------------------------------------- Arbeitsplatz-Rahmen mit Seitenleiste */
body.mit-leiste main { max-width: 1040px; margin: 0; padding: 1.2rem 16px 4rem; flex: 1; min-width: 0; }
.rahmen { display: flex; flex-direction: column; }
.leiste { background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.leiste > details > summary { list-style: none; cursor: pointer; padding: .6rem 16px; font-weight: 600; }
.leiste > details > summary::-webkit-details-marker { display: none; }
.leiste > details > summary::before { content: "☰ "; }
.suche { padding: 0 12px .6rem; }
.suche input { width: 100%; font: inherit; padding: .45rem .65rem; border-radius: 8px; border: 1px solid var(--linie);
  background: var(--grund); color: var(--text); }
.gruppen { padding: 0 8px 1rem; }
.gruppe { margin-top: .35rem; }
.gkopf { display: block; padding: .35rem 8px; font-size: .74rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--leise); cursor: pointer; list-style: none; }
.gkopf::-webkit-details-marker { display: none; }
details.gruppe > summary.gkopf::after { content: "▾"; font-size: .9em; padding-right: 6px; }
details.gruppe:not([open]) > summary.gkopf::after { content: "▸"; }
.gkopf a { color: inherit; text-decoration: none; }
.gruppen a { display: flex; justify-content: space-between; align-items: center; padding: .38rem 10px; margin: 1px 0;
  border-radius: 7px; color: var(--text); text-decoration: none; font-size: .93rem; }
.gruppen a.unter { padding-left: 18px; color: var(--leise); }
.gruppen a:hover { background: var(--grund); }
.gruppen a.aktiv, .gruppen a.unter.aktiv { background: var(--akzent); color: var(--akzent-text); font-weight: 600; }
.gkopf a.aktiv { background: none; color: var(--akzent); }
@media (min-width: 900px) {
  .rahmen { flex-direction: row; align-items: flex-start; }
  .leiste { width: 270px; flex: 0 0 270px; border-bottom: 0; border-right: 1px solid var(--linie);
    position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; }
  .leiste > details > summary { display: none; }
  .suche { padding-top: .8rem; }
  body.mit-leiste main { padding: 1.4rem 32px 4rem; }
  .kopf-innen { max-width: none; }
}

/* Dokumente */
.prosa { line-height: 1.65; overflow-wrap: anywhere; }
.prosa h1 { font-size: 1.5rem; } .prosa h2 { font-size: 1.2rem; } .prosa h3 { font-size: 1.05rem; }
.prosa code { background: var(--grund); padding: .1em .35em; border-radius: 4px; }
.prosa pre { background: var(--grund); padding: .8rem; border-radius: 8px; overflow-x: auto; }
.prosa blockquote { border-left: 3px solid var(--akzent); margin: .8rem 0; padding: .2rem 1rem; color: var(--leise); }
.prosa table { display: block; overflow-x: auto; }
.prosa th, .prosa td { border: 1px solid var(--linie); }
textarea.editor { min-height: 60vh; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; line-height: 1.5; }
.karten { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.karte.link { display: block; text-decoration: none; color: inherit; }
.karte.link:hover { border-color: var(--akzent); }
.karte.leer-dok { border-style: dashed; }
.galerie { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.galerie img { width: 100%; border-radius: 8px; border: 1px solid var(--linie); display: block; background: #fff; }
.pfad { font-size: .85rem; color: var(--leise); margin-bottom: .4rem; }
.pfad a { color: var(--leise); }
.gruppen .gkopf a { display: inline; padding: 0; margin: 0; font-size: inherit; color: inherit; background: none; }
.gruppen .gkopf a:hover { text-decoration: underline; background: none; }
.gruppen .gkopf a.aktiv { color: var(--akzent); background: none; }
details.gruppe > summary.gkopf { display: flex; justify-content: space-between; align-items: center; }
