:root {
  --hg: #f6f5f1; --flaeche: #ffffff; --text: #1f2421; --leise: #5f6762; --linie: #dcdad3;
  --akzent: #2f6b4f; --akzent-text: #ffffff; --akzent-hell: #e3efe8;
  --warnung: #8a5a00; --warnung-hg: #fbf0d9; --fehler: #a3271c; --fehler-hg: #fbe4e1; --info-hg: #e5eef8;
  --radius: 8px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --hg: #151816; --flaeche: #1e2320; --text: #e6e9e7; --leise: #a1aaa5; --linie: #343b37;
    --akzent: #6fbf95; --akzent-text: #0c1a12; --akzent-hell: #233a2d;
    --warnung: #f0c060; --warnung-hg: #3a2f17; --fehler: #ff8a7d; --fehler-hg: #3d1f1b; --info-hg: #1d2b3a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--hg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--akzent); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
main.schmal { max-width: 420px; padding-top: 10vh; }
main.breit { max-width: 1400px; }
.kopf { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.kopf .marke { font-weight: 700; text-decoration: none; color: var(--text); }
.kopf nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.kopf nav a { text-decoration: none; padding: .25rem 0; }
.kopf nav a.aktiv { font-weight: 600; border-bottom: 2px solid var(--akzent); }
form.inline { display: inline; }
button, .knopf { font: inherit; padding: .55rem 1rem; border-radius: var(--radius); border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); cursor: pointer; }
button.primaer { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); font-weight: 600; }
button.link { border: 0; background: none; color: var(--akzent); padding: 0; text-decoration: underline; }
input, select, textarea { font: inherit; width: 100%; padding: .5rem .6rem; border: 1px solid var(--linie); border-radius: 6px; background: var(--hg); color: var(--text); margin-top: .2rem; }
input[type=checkbox] { width: auto; }
label { display: block; margin-bottom: .75rem; font-size: .9rem; color: var(--leise); }
label > input, label > select, label > textarea { color: var(--text); }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
details.karte > summary { cursor: pointer; font-weight: 600; }
.meldung { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: .75rem; background: var(--info-hg); }
.meldung.success { background: var(--akzent-hell); }
.meldung.warning { background: var(--warnung-hg); color: var(--warnung); }
.meldung.error { background: var(--fehler-hg); color: var(--fehler); }
.feldfehler { color: var(--fehler); font-size: .85rem; margin: -.5rem 0 .75rem; }
.klein { font-size: .85rem; color: var(--leise); }
.leer { color: var(--leise); font-style: italic; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kachel { display: flex; flex-direction: column; padding: 1rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.kachel b { font-size: 1.8rem; line-height: 1.1; }
.kachel span { color: var(--leise); font-size: .9rem; }
.kachel.hinweis { border-color: var(--warnung); }
.kachel.fehler { border-color: var(--fehler); }
.suche, .filterzeile { display: flex; gap: .5rem; margin-bottom: .75rem; }
.suche input, .filterzeile input { margin: 0; }
.filterraster { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 .75rem; margin-top: .75rem; }
.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle th, .tabelle td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { font-weight: 600; color: var(--leise); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.tabelle tr:last-child td { border-bottom: 0; }
.status { display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 99px; background: var(--info-hg); white-space: nowrap; }
.s-pruefen { background: var(--warnung-hg); color: var(--warnung); }
.s-erledigt { background: var(--akzent-hell); }
.s-fehler { background: var(--fehler-hg); color: var(--fehler); }
.seiten { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; }
.ablage { display: flex; flex-direction: column; gap: .3rem; align-items: center; justify-content: center; text-align: center; padding: 2rem 1rem; border: 2px dashed var(--linie); border-radius: var(--radius); color: var(--text); cursor: pointer; }
.ablage.drueber { border-color: var(--akzent); background: var(--akzent-hell); }
.ablage input { max-width: 320px; }
.kopfzeile { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.zweispaltig { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; }
.vorschau iframe, .vorschau img { width: 100%; height: 80vh; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; object-fit: contain; }
fieldset.zuordnung { border: 1px solid var(--linie); border-radius: var(--radius); padding: .75rem .75rem 0; margin: 0 0 .75rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 .6rem; }
.loeschen { display: flex; gap: .4rem; align-items: center; }
.knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.daten { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.daten dt { color: var(--leise); }
.daten dd { margin: 0; word-break: break-all; }
pre.volltext { white-space: pre-wrap; font-size: .85rem; max-height: 50vh; overflow: auto; }
.qr { display: block; width: 220px; height: 220px; margin: 1rem auto; background: #fff; padding: 8px; border-radius: var(--radius); }
.schluessel { word-break: break-all; }
@media (max-width: 800px) {
  .zweispaltig { grid-template-columns: 1fr; }
  .vorschau iframe, .vorschau img { height: 60vh; }
  main { padding: .75rem; }
}
