/*
 * Archivsuche – Weboberfläche
 *
 * Gedeckte Farben, angelehnt an Pergament und Leinenrücken, wie in der
 * Android-App. Die Seite zeigt vor allem viel Text; die Palette bleibt
 * deshalb zurückhaltend, Farbe markiert Herkunft, Status und Aktionen.
 */

:root {
  --tinte: #3a3226;
  --tinte-leise: #564c3e;
  --tinte-blass: #7a6f60;
  --siegel: #8c3b2e;
  --siegel-dunkel: #6f2c21;
  --siegel-hell: #f3d9d1;
  --leinen: #6b705c;
  --leinen-hell: #e3e0ce;
  --blau: #4e6e81;
  --blau-hell: #d3e2eb;
  --gruen: #4d6b3c;
  --gruen-hell: #dde8d2;
  --warn: #9a6a12;
  --warn-hell: #f6e7c6;
  --grund: #faf6ef;
  --flaeche: #fffbf5;
  --flaeche-2: #f4eee2;
  --flaeche-3: #ede5d8;
  --linie: #d5cbb9;
  --linie-stark: #8a8071;
  --schatten: 0 1px 2px rgb(58 50 38 / .06), 0 2px 8px rgb(58 50 38 / .05);
  --radius: 8px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tinte: #eae2d6;
    --tinte-leise: #cfc6b6;
    --tinte-blass: #a59b8b;
    --siegel: #e0a08f;
    --siegel-dunkel: #efb9aa;
    --siegel-hell: #5c2419;
    --leinen: #c3c7b0;
    --leinen-hell: #434636;
    --blau: #a8c6d8;
    --blau-hell: #2f4d5c;
    --gruen: #b5cfa2;
    --gruen-hell: #34452a;
    --warn: #e5c07b;
    --warn-hell: #4a3a17;
    --grund: #1c1a16;
    --flaeche: #25221d;
    --flaeche-2: #2b2822;
    --flaeche-3: #3a352d;
    --linie: #4a443a;
    --linie-stark: #968d7d;
    --schatten: 0 1px 2px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --tinte: #eae2d6;
  --tinte-leise: #cfc6b6;
  --tinte-blass: #a59b8b;
  --siegel: #e0a08f;
  --siegel-dunkel: #efb9aa;
  --siegel-hell: #5c2419;
  --leinen: #c3c7b0;
  --leinen-hell: #434636;
  --blau: #a8c6d8;
  --blau-hell: #2f4d5c;
  --gruen: #b5cfa2;
  --gruen-hell: #34452a;
  --warn: #e5c07b;
  --warn-hell: #4a3a17;
  --grund: #1c1a16;
  --flaeche: #25221d;
  --flaeche-2: #2b2822;
  --flaeche-3: #3a352d;
  --linie: #4a443a;
  --linie-stark: #968d7d;
  --schatten: 0 1px 2px rgb(0 0 0 / .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--grund);
  color: var(--tinte);
  font: 15px/1.5 var(--sans);
}

a { color: var(--siegel); text-underline-offset: 2px; }
a:hover { color: var(--siegel-dunkel); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0; }

img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }

.sprunglink {
  position: absolute; left: -999px; top: 8px;
  background: var(--flaeche); padding: 6px 10px; z-index: 50;
}
.sprunglink:focus { left: 8px; }

/* ------------------------------------------------------------------ Kopf */

.kopf {
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 20;
}
.kopf-innen {
  max-width: 1280px; margin: 0 auto;
  padding: 8px 20px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.wortmarke {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 21px; font-weight: 600;
  color: var(--tinte); text-decoration: none;
}
.wortmarke:hover { color: var(--siegel); }
.navigation { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.navigation a {
  padding: 7px 12px; border-radius: 6px;
  color: var(--tinte-leise); text-decoration: none; font-weight: 500;
  white-space: nowrap;
}
.navigation a:hover { background: var(--flaeche-2); color: var(--tinte); }
.navigation a[aria-current="page"] { background: var(--siegel-hell); color: var(--siegel-dunkel); }
.navigation .zahl {
  display: inline-block; min-width: 18px; margin-left: 5px; padding: 0 5px;
  border-radius: 9px; background: var(--flaeche-3); font-size: 12px; text-align: center;
}
.kopf-aktionen { display: flex; gap: 6px; align-items: center; }
.kontomenue { position: relative; }
.kontomenue > button, .kontomenue-inhalt .knopf { touch-action: manipulation; }
.kontomenue-inhalt {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  display: flex; flex-direction: column; gap: 4px; min-width: 150px;
  padding: 8px; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 8px; box-shadow: 0 4px 16px #0002;
}
.kontomenue-inhalt[hidden] { display: none; }
.kontomenue-inhalt .knopf { justify-content: flex-start; }
.passwort-eingabe { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.passwort-eingabe input { flex: 1; min-width: 0; width: 0; }
.passwort-auge { flex: 0 0 44px; min-height: 44px; padding: 8px; }
.passwort-auge[aria-pressed="true"] { background: var(--siegel-hell); color: var(--siegel); }

/* ------------------------------------------------------------ Seitenrahmen */

.inhalt {
  flex: 1;
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 20px 20px 48px;
}
.inhalt:focus { outline: none; }

.fuss {
  border-top: 1px solid var(--linie);
  color: var(--tinte-blass); font-size: 13px;
  padding: 14px 20px; text-align: center;
}
.fuss p { margin: 4px auto; max-width: 780px; }

.seitenkopf { margin-bottom: 16px; }
.seitenkopf h1 { font-size: 28px; }
.seitenkopf p { margin: 4px 0 0; color: var(--tinte-leise); max-width: 760px; }

/* --------------------------------------------------------------- Bausteine */

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--linie-stark); border-radius: 6px;
  background: var(--flaeche); color: var(--tinte);
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.knopf:hover { background: var(--flaeche-2); color: var(--tinte); }
.knopf:disabled { opacity: .55; cursor: default; }
.knopf.primaer { background: var(--siegel); border-color: var(--siegel); color: #fffbf5; }
.knopf.primaer:hover { background: var(--siegel-dunkel); border-color: var(--siegel-dunkel); }
:root[data-theme="dark"] .knopf.primaer { color: #2a120c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .knopf.primaer { color: #2a120c; } }
.knopf.leise { border-color: transparent; background: transparent; color: var(--tinte-leise); }
.knopf.leise:hover { background: var(--flaeche-2); color: var(--tinte); }
.knopf.klein { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.knopf.symbol { padding: 6px; min-width: 36px; }
.knopf svg { width: 18px; height: 18px; flex: none; }

.feld { display: flex; flex-direction: column; gap: 4px; }
.feld > span { font-size: 13px; font-weight: 500; color: var(--tinte-leise); }
input[type="text"], input[type="search"], input[type="password"], input[type="number"],
input[type="url"], textarea, select {
  font: inherit; color: var(--tinte);
  background: var(--flaeche);
  border: 1px solid var(--linie-stark); border-radius: 6px;
  padding: 7px 10px; min-height: 36px; width: 100%;
}
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--tinte-blass); }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: var(--schatten);
}

.hinweistext { font-size: 13px; color: var(--tinte-blass); margin: 0; }

.schalter { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schalter .bahn {
  flex: none; margin-top: 2px;
  width: 36px; height: 20px; border-radius: 10px;
  background: var(--flaeche-3); border: 1px solid var(--linie-stark);
  position: relative; transition: background .15s;
}
.schalter .bahn::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--linie-stark); transition: transform .15s, background .15s;
}
.schalter input:checked + .bahn { background: var(--siegel); border-color: var(--siegel); }
.schalter input:checked + .bahn::after { transform: translateX(16px); background: var(--flaeche); }
.schalter input:focus-visible + .bahn { outline: 2px solid var(--blau); outline-offset: 2px; }
.schalter .text { display: flex; flex-direction: column; }
.schalter .text small { color: var(--tinte-blass); font-size: 12px; line-height: 1.35; }

.haken { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; padding: 3px 0; }
.haken input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--siegel); flex: none; }
.haken .text { display: flex; flex-direction: column; line-height: 1.35; }
.haken small { color: var(--tinte-blass); font-size: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; min-height: 30px;
  border: 1px solid var(--linie); border-radius: 15px;
  background: var(--flaeche); color: var(--tinte-leise);
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--linie-stark); color: var(--tinte); }
.chip[aria-pressed="true"] { background: var(--tinte); border-color: var(--tinte); color: var(--grund); }
.chip.fehler { border-color: var(--warn); color: var(--warn); }
.chip .punkt { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--linie-stark); }
.chip .punkt.st-laeuft { background: var(--blau); animation: pulsieren 1s infinite ease-in-out; }
.chip .punkt.st-ok { background: var(--gruen); }
.chip .punkt.st-fehler { background: var(--warn); }
.chip .punkt.st-leer { background: var(--linie); }
@keyframes pulsieren { 50% { opacity: .25; } }

.marke {
  display: inline-block; max-width: 100%;
  padding: 2px 8px; border-radius: 4px;
  background: var(--flaeche-3); color: var(--tinte-leise);
  font-size: 12px; font-weight: 500; line-height: 1.5;
}
.marke.digi { background: var(--blau-hell); color: var(--blau); }
.marke.gruen { background: var(--gruen-hell); color: var(--gruen); }

.leer { color: var(--tinte-blass); padding: 28px 8px; text-align: center; }

details.klappe { border-top: 1px solid var(--linie); }
details.klappe > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-weight: 600;
}
details.klappe > summary::-webkit-details-marker { display: none; }
details.klappe > summary::after {
  content: ""; margin-left: auto; width: 8px; height: 8px;
  border-right: 2px solid var(--tinte-blass); border-bottom: 2px solid var(--tinte-blass);
  transform: rotate(45deg); transition: transform .15s;
}
details.klappe[open] > summary::after { transform: rotate(-135deg); }
details.klappe .klappe-inhalt { padding: 0 14px 14px; }

/* ------------------------------------------------------------------ Suche */

.suchmaske {
  display: flex; gap: 8px; margin-bottom: 18px;
}
.suchmaske .suchfeld { position: relative; flex: 1; }
.suchmaske input[type="search"] {
  min-height: 48px; padding: 10px 14px 10px 42px;
  font-size: 17px; border-radius: 8px;
  box-shadow: var(--schatten);
}
.suchmaske .suchfeld svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--tinte-blass); pointer-events: none;
}
.suchmaske .knopf { min-height: 48px; padding: 8px 22px; font-size: 16px; }

.suchraster {
  display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; align-items: start;
}
.seitenleiste { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; padding-bottom: 4px; }
.seitenleiste .karte > h2, .karte > .karten-titel {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 12px 14px 0;
}
.karten-rumpf { padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 10px; }

.favoriten { background: var(--flaeche-2); }

.quellenliste { display: flex; flex-direction: column; }
.quellenliste .quelle { padding: 4px 0; border-bottom: 1px dashed var(--linie); }
.quellenliste .quelle:last-child { border-bottom: 0; }
.quelle-zeile { display: flex; align-items: flex-start; gap: 4px; }
.quelle-zeile .haken { flex: 1; }
.haeuser { padding: 2px 0 6px 24px; }
.schnellwahl { display: flex; gap: 4px; flex-wrap: wrap; }

.haeuser-schalter { cursor: pointer; padding-left: 24px; }
.klappe-inhalt.optionen { display: flex; flex-direction: column; gap: 10px; }
.randnotiz { padding: 0 4px; }
.zwischentitel { margin: 6px 0 0; font-weight: 600; font-size: 13px; }
.einfuehrung { padding: 20px 22px; }
.einfuehrung h2 { font-size: 20px; margin-bottom: 8px; }
.einfuehrung ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

.jahre { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chipreihe { display: flex; gap: 6px; flex-wrap: wrap; }
.optionsgruppe { display: flex; flex-direction: column; gap: 6px; }
.optionsgruppe > span { font-size: 13px; font-weight: 500; color: var(--tinte-leise); }

.ergebnisse { min-width: 0; }
.ergebniskopf { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ergebniszeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ergebniszeile .zaehler { font-weight: 600; }
.ergebniszeile .zaehler small { font-weight: 400; color: var(--tinte-blass); }
.ergebniszeile .rechts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.fortschritt { height: 3px; background: var(--flaeche-3); border-radius: 2px; overflow: hidden; }
.fortschritt > div { height: 100%; background: var(--blau); transition: width .3s; }
/* Füllstand des Fortschrittsbalkens in Prozentstufen – ein style-Attribut
   wäre durch die Content-Security-Policy (style-src 'self') gesperrt. */
.fortschritt > div[data-fuellung="0"]{width:0%} .fortschritt > div[data-fuellung="1"]{width:1%} .fortschritt > div[data-fuellung="2"]{width:2%} .fortschritt > div[data-fuellung="3"]{width:3%} .fortschritt > div[data-fuellung="4"]{width:4%} .fortschritt > div[data-fuellung="5"]{width:5%} .fortschritt > div[data-fuellung="6"]{width:6%} .fortschritt > div[data-fuellung="7"]{width:7%} .fortschritt > div[data-fuellung="8"]{width:8%} .fortschritt > div[data-fuellung="9"]{width:9%}
.fortschritt > div[data-fuellung="10"]{width:10%} .fortschritt > div[data-fuellung="11"]{width:11%} .fortschritt > div[data-fuellung="12"]{width:12%} .fortschritt > div[data-fuellung="13"]{width:13%} .fortschritt > div[data-fuellung="14"]{width:14%} .fortschritt > div[data-fuellung="15"]{width:15%} .fortschritt > div[data-fuellung="16"]{width:16%} .fortschritt > div[data-fuellung="17"]{width:17%} .fortschritt > div[data-fuellung="18"]{width:18%} .fortschritt > div[data-fuellung="19"]{width:19%}
.fortschritt > div[data-fuellung="20"]{width:20%} .fortschritt > div[data-fuellung="21"]{width:21%} .fortschritt > div[data-fuellung="22"]{width:22%} .fortschritt > div[data-fuellung="23"]{width:23%} .fortschritt > div[data-fuellung="24"]{width:24%} .fortschritt > div[data-fuellung="25"]{width:25%} .fortschritt > div[data-fuellung="26"]{width:26%} .fortschritt > div[data-fuellung="27"]{width:27%} .fortschritt > div[data-fuellung="28"]{width:28%} .fortschritt > div[data-fuellung="29"]{width:29%}
.fortschritt > div[data-fuellung="30"]{width:30%} .fortschritt > div[data-fuellung="31"]{width:31%} .fortschritt > div[data-fuellung="32"]{width:32%} .fortschritt > div[data-fuellung="33"]{width:33%} .fortschritt > div[data-fuellung="34"]{width:34%} .fortschritt > div[data-fuellung="35"]{width:35%} .fortschritt > div[data-fuellung="36"]{width:36%} .fortschritt > div[data-fuellung="37"]{width:37%} .fortschritt > div[data-fuellung="38"]{width:38%} .fortschritt > div[data-fuellung="39"]{width:39%}
.fortschritt > div[data-fuellung="40"]{width:40%} .fortschritt > div[data-fuellung="41"]{width:41%} .fortschritt > div[data-fuellung="42"]{width:42%} .fortschritt > div[data-fuellung="43"]{width:43%} .fortschritt > div[data-fuellung="44"]{width:44%} .fortschritt > div[data-fuellung="45"]{width:45%} .fortschritt > div[data-fuellung="46"]{width:46%} .fortschritt > div[data-fuellung="47"]{width:47%} .fortschritt > div[data-fuellung="48"]{width:48%} .fortschritt > div[data-fuellung="49"]{width:49%}
.fortschritt > div[data-fuellung="50"]{width:50%} .fortschritt > div[data-fuellung="51"]{width:51%} .fortschritt > div[data-fuellung="52"]{width:52%} .fortschritt > div[data-fuellung="53"]{width:53%} .fortschritt > div[data-fuellung="54"]{width:54%} .fortschritt > div[data-fuellung="55"]{width:55%} .fortschritt > div[data-fuellung="56"]{width:56%} .fortschritt > div[data-fuellung="57"]{width:57%} .fortschritt > div[data-fuellung="58"]{width:58%} .fortschritt > div[data-fuellung="59"]{width:59%}
.fortschritt > div[data-fuellung="60"]{width:60%} .fortschritt > div[data-fuellung="61"]{width:61%} .fortschritt > div[data-fuellung="62"]{width:62%} .fortschritt > div[data-fuellung="63"]{width:63%} .fortschritt > div[data-fuellung="64"]{width:64%} .fortschritt > div[data-fuellung="65"]{width:65%} .fortschritt > div[data-fuellung="66"]{width:66%} .fortschritt > div[data-fuellung="67"]{width:67%} .fortschritt > div[data-fuellung="68"]{width:68%} .fortschritt > div[data-fuellung="69"]{width:69%}
.fortschritt > div[data-fuellung="70"]{width:70%} .fortschritt > div[data-fuellung="71"]{width:71%} .fortschritt > div[data-fuellung="72"]{width:72%} .fortschritt > div[data-fuellung="73"]{width:73%} .fortschritt > div[data-fuellung="74"]{width:74%} .fortschritt > div[data-fuellung="75"]{width:75%} .fortschritt > div[data-fuellung="76"]{width:76%} .fortschritt > div[data-fuellung="77"]{width:77%} .fortschritt > div[data-fuellung="78"]{width:78%} .fortschritt > div[data-fuellung="79"]{width:79%}
.fortschritt > div[data-fuellung="80"]{width:80%} .fortschritt > div[data-fuellung="81"]{width:81%} .fortschritt > div[data-fuellung="82"]{width:82%} .fortschritt > div[data-fuellung="83"]{width:83%} .fortschritt > div[data-fuellung="84"]{width:84%} .fortschritt > div[data-fuellung="85"]{width:85%} .fortschritt > div[data-fuellung="86"]{width:86%} .fortschritt > div[data-fuellung="87"]{width:87%} .fortschritt > div[data-fuellung="88"]{width:88%} .fortschritt > div[data-fuellung="89"]{width:89%}
.fortschritt > div[data-fuellung="90"]{width:90%} .fortschritt > div[data-fuellung="91"]{width:91%} .fortschritt > div[data-fuellung="92"]{width:92%} .fortschritt > div[data-fuellung="93"]{width:93%} .fortschritt > div[data-fuellung="94"]{width:94%} .fortschritt > div[data-fuellung="95"]{width:95%} .fortschritt > div[data-fuellung="96"]{width:96%} .fortschritt > div[data-fuellung="97"]{width:97%} .fortschritt > div[data-fuellung="98"]{width:98%} .fortschritt > div[data-fuellung="99"]{width:99%}
.fortschritt > div[data-fuellung="100"]{width:100%}

.hinweise { margin-bottom: 12px; }
.hinweise > summary { font-weight: 500; color: var(--warn); }
.hinweiskarte {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding: 10px 14px; border-top: 1px solid var(--linie);
}
.hinweiskarte h3 { font-family: var(--sans); font-size: 14px; }
.hinweiskarte p { margin: 2px 0 0; font-size: 13px; color: var(--tinte-leise); }

.trefferliste { display: flex; flex-direction: column; gap: 10px; }

.treffer { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.treffer-kopf { display: flex; align-items: center; gap: 8px; }
.treffer-kopf .marke { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.treffer-kopf .aktionen { margin-left: auto; display: flex; gap: 2px; }
.treffer-rumpf { display: flex; gap: 14px; align-items: flex-start; }
.treffer .vorschau {
  width: 84px; height: 84px; object-fit: cover; flex: none;
  border-radius: 6px; background: var(--flaeche-3);
}
.treffer h3 { font-size: 17px; overflow-wrap: anywhere; }
.treffer .signatur { font-size: 13px; color: var(--siegel); font-weight: 500; margin: 2px 0 0; overflow-wrap: anywhere; }
.treffer .kontext { font-size: 13px; color: var(--tinte-leise); margin: 0; overflow-wrap: anywhere; }
.treffer .beschreibung { font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.treffer .links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.treffer .links a {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; padding: 2px 10px; border-radius: 13px;
  border: 1px solid var(--linie); text-decoration: none; color: var(--tinte-leise);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.treffer .links a:hover { border-color: var(--siegel); color: var(--siegel); }
.treffer .links svg { width: 13px; height: 13px; flex: none; }
.treffer.gewaehlt { border-color: var(--siegel); box-shadow: 0 0 0 1px var(--siegel); }

.mehr { display: flex; justify-content: center; margin-top: 14px; }

/* Galerieansicht der Digitalisat-Suche */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.kachel { display: flex; flex-direction: column; overflow: hidden; }
.kachel .bild {
  aspect-ratio: 4 / 3; background: var(--flaeche-3);
  display: flex; align-items: center; justify-content: center; color: var(--tinte-blass);
}
.kachel .bild img { width: 100%; height: 100%; object-fit: cover; }
.kachel .bild svg { width: 42px; height: 42px; opacity: .6; }
.kachel .text { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.kachel h3 { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kachel .signatur { font-size: 12px; color: var(--siegel); margin: 0; }
.kachel .marke { font-size: 11px; align-self: flex-start; }
.kachel .fusszeile { margin-top: auto; padding-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }

.modus-digital .seitenkopf h1::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px;
  border-radius: 3px; background: var(--blau); vertical-align: 3px;
}
.modus-digital .suchmaske .knopf.primaer { background: var(--blau); border-color: var(--blau); }

/* ---------------------------------------------------------- Quellen-Seite */

.tabelle-rahmen { overflow-x: auto; }
table.tabelle { border-collapse: collapse; width: 100%; font-size: 14px; }
.tabelle th, .tabelle td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--linie); }
.tabelle th { font-size: 13px; color: var(--tinte-leise); background: var(--flaeche-2); }
.tabelle td small { display: block; color: var(--tinte-blass); margin-top: 3px; }

/* ----------------------------------------------------------------- Dialoge */

dialog {
  border: 1px solid var(--linie); border-radius: 10px;
  background: var(--flaeche); color: var(--tinte);
  padding: 0; width: min(520px, calc(100vw - 32px));
  box-shadow: 0 12px 40px rgb(0 0 0 / .25);
}
dialog::backdrop { background: rgb(28 26 22 / .45); }
.dialog-kopf { padding: 16px 18px 0; }
.dialog-kopf h2 { font-size: 20px; }
.dialog-rumpf { padding: 12px 18px; display: flex; flex-direction: column; gap: 12px; }
.dialog-fuss { padding: 0 18px 16px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.meldungen {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px);
}
.meldung {
  background: var(--tinte); color: var(--grund);
  padding: 10px 16px; border-radius: 8px; box-shadow: var(--schatten);
  animation: einblenden .2s ease-out;
}
.meldung.fehler { background: var(--siegel-dunkel); color: #fffbf5; }
@keyframes einblenden { from { opacity: 0; transform: translateY(8px); } }

/* --------------------------------------------------------------- Schmal */

@media (max-width: 900px) {
  .suchraster { grid-template-columns: minmax(0, 1fr); }
  .seitenleiste { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 560px) {
  .kopf-innen { padding: 8px 16px; gap: 8px; }
  .kopf-aktionen { margin-left: auto; }
  .navigation { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .inhalt { padding: 16px 16px 40px; }
  .suchmaske { flex-direction: column; }
  .treffer .vorschau { width: 64px; height: 64px; }
  .ergebniszeile .rechts { margin-left: 0; }
}

@media print {
  .kopf, .fuss, .seitenleiste, .suchmaske, .meldungen, .treffer .aktionen, .mehr, .hinweise { display: none !important; }
  body { background: #fff; color: #000; }
  .suchraster { display: block; }
  .karte { box-shadow: none; break-inside: avoid; }
}

/* ------------------------------------------------------ Konto und Ablage */

.knopf.gefahr { border-color: var(--siegel); color: var(--siegel); }
.knopf.gefahr:hover { background: var(--siegel); color: #fffbf5; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.abstand { margin-bottom: 14px; }

.formular { display: flex; flex-direction: column; gap: 12px; }
.formtitel { margin: 0; font-weight: 600; }
.formfehler { margin: 0; color: var(--siegel); font-size: 14px; min-height: 1em; }
.formfehler:empty { display: none; }
.hinweis-box { margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--blau-hell); color: var(--tinte); font-size: 14px; }
fieldset.optionsfeld { border: 1px solid var(--linie); border-radius: 6px; padding: 8px 12px 10px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
fieldset.optionsfeld legend { font-size: 13px; font-weight: 500; color: var(--tinte-leise); padding: 0 4px; }
.haken input[type="radio"] { accent-color: var(--siegel); }

.kontoraster { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.abschnitt { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.abschnitt h2 { font-size: 19px; }
.abschnitt.gefahr { border-color: var(--siegel-hell); }

.treffer-kopf input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--siegel); flex: none; }
.treffer .aktionen .knopf.symbol { min-width: 32px; min-height: 32px; padding: 4px; }
.knopf.merken[aria-pressed="true"] { color: var(--siegel); }
.knopf.notizknopf[aria-pressed="true"] { color: var(--blau); }

.auswahlleiste {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 10px;
  background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: var(--radius);
  position: sticky; top: 56px; z-index: 5;
}
.auswahlleiste .haken { padding: 0; }
.auswahl-zahl { font-size: 13px; color: var(--tinte-leise); }
.auswahlleiste .rechts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.archivale-zusatz { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.notiz { display: flex; flex-direction: column; gap: 2px; }
.notiz textarea { min-height: 44px; max-height: 420px; field-sizing: content; background: var(--flaeche-2); border-color: var(--linie); font-size: 14px; }
.notiz textarea:focus { background: var(--flaeche); border-color: var(--linie-stark); }
.notiz-status { font-size: 12px; color: var(--gruen); min-height: 16px; }
.notiz-status.fehler { color: var(--siegel); }
.metazeile { margin: 0; font-size: 12px; color: var(--tinte-blass); }

.werkzeugleiste { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; margin-bottom: 10px; }
.werkzeugleiste input[type="search"] { flex: 1 1 260px; width: auto; }
.werkzeugleiste select { width: auto; flex: 0 1 auto; }
.werkzeugleiste .haken { padding: 0; }

.suchkarten { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.suchkarte { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.suchkarte-kopf { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.suchkarte h2 { font-size: 18px; }
.suchkarte h2 a { color: var(--tinte); text-decoration: none; }
.suchkarte h2 a:hover { color: var(--siegel); text-decoration: underline; }
.suchkarte .knopfreihe { margin-top: 4px; }
.suchnotiz { margin: 0; font-size: 14px; white-space: pre-line; color: var(--tinte-leise); }
.brotkrumen { margin: 0 0 8px; }
.brotkrumen a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.brotkrumen svg { width: 16px; height: 16px; }

@media (max-width: 560px) {
  .auswahlleiste { position: static; }
  .auswahlleiste .rechts { margin-left: 0; }
  .suchkarten, .kontoraster { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------- Export und Teilen */

.linkzeile { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.linkzeile input { flex: 1 1 240px; width: auto; font-family: var(--mono); font-size: 13px; }
.begleittext { padding: 12px 16px; margin-bottom: 14px; border-left: 3px solid var(--siegel); white-space: pre-wrap; }
.begleittext p { margin: 0; }
.geteilte-notiz { margin: 4px 0 0; padding: 6px 10px; background: var(--blau-hell); border-radius: 6px; font-size: 14px; white-space: pre-wrap; }
.freigaben { display: flex; flex-direction: column; }
.freigabe { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--linie); }
.freigabe:first-child { border-top: 0; }
.freigabe h3 { font-family: var(--sans); font-size: 14px; }
.kontoraster .breit { grid-column: 1 / -1; }

/* ------------------------------------------------------------- Menüs */

.menue-anker { position: relative; display: inline-flex; }
.menue {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  min-width: 230px; padding: 4px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .16);
  display: flex; flex-direction: column;
}
.menue button {
  display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 7px 10px; border: 0; border-radius: 5px; background: transparent;
  font: inherit; font-size: 14px; color: var(--tinte); cursor: pointer; white-space: nowrap;
}
.menue button:hover, .menue button:focus-visible { background: var(--flaeche-2); outline: none; }
.menue button.gefahr { color: var(--siegel); }
.menue svg { width: 16px; height: 16px; flex: none; color: var(--tinte-blass); }
dialog.breit { width: min(860px, calc(100vw - 32px)); }
dialog .dialog-rumpf { max-height: calc(100vh - 190px); overflow: auto; }
.meldung-link { color: inherit; font-weight: 600; }

/* ----------------------------------------------------------- Register */

.registerraster { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; align-items: start; }
.registerbaum { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; padding: 10px 8px; }
.registerbaum .baum-kopf { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 8px; }
.registerbaum .baum-kopf h2 { font-family: var(--sans); font-size: 14px; }
.registerbaum ul { list-style: none; margin: 0; padding: 0; }
.registerbaum ul ul { padding-left: 14px; }
.knoten {
  display: flex; align-items: baseline; gap: 6px; width: 100%;
  padding: 5px 8px; border: 1px dashed transparent; border-radius: 6px;
  background: transparent; font: inherit; font-size: 14px; color: var(--tinte); text-align: left; cursor: pointer;
}
.knoten:hover { background: var(--flaeche-2); }
.knoten .nr { color: var(--siegel); font-weight: 600; font-size: 13px; flex: none; }
.knoten .titel { flex: 1; overflow-wrap: anywhere; }
.knoten .zahl { color: var(--tinte-blass); font-size: 12px; flex: none; }
.knoten.eingang { color: var(--warn); font-weight: 500; }
.ziel { border-color: var(--siegel) !important; background: var(--siegel-hell) !important; }
.registerbaum .baum-fuss { border-top: 1px solid var(--linie); margin-top: 8px; padding: 8px 6px 2px; display: flex; flex-direction: column; gap: 6px; }

.registerdokument { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.abschnittskopf {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding: 6px 4px 6px 0; border-bottom: 1px solid var(--linie);
  border-radius: 4px; scroll-margin-top: 80px;
}
.abschnittskopf h2, .abschnittskopf h3, .abschnittskopf h4, .abschnittskopf h5 { flex: 1; min-width: 200px; }
.abschnittskopf .nr { color: var(--siegel); margin-right: 6px; }
.abschnittskopf h2 { font-size: 22px; }
.abschnittskopf h3 { font-size: 19px; }
.abschnittskopf h4 { font-size: 17px; }
.abschnittskopf h5 { font-size: 15px; margin: 0; font-family: var(--serif); }
.abschnittskopf .zahl { color: var(--tinte-blass); font-size: 13px; font-family: var(--sans); font-weight: 400; }
.abschnittskopf .werkzeuge { display: flex; gap: 2px; }
.abschnittskopf .werkzeuge .knopf.symbol { min-width: 30px; min-height: 30px; padding: 4px; }
.abschnitt-beschreibung { margin: 0 0 4px; color: var(--tinte-leise); font-size: 14px; white-space: pre-wrap; }
.abschnitt-leer { margin: 2px 0 6px; font-size: 13px; color: var(--tinte-blass); border: 1px dashed var(--linie); border-radius: 6px; padding: 8px 12px; }
.abschnitt-eingang { background: var(--warn-hell); border-radius: 8px; padding: 4px 12px 12px; }
.abschnitt-eingang .abschnittskopf { border-color: transparent; margin-top: 4px; }

.eintragsliste { display: flex; flex-direction: column; gap: 6px; }
.regeintrag { border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); }
.regeintrag.gewaehlt { border-color: var(--siegel); box-shadow: 0 0 0 1px var(--siegel); }
.regeintrag.zieht { opacity: .45; }
.regeintrag-zeile { display: flex; align-items: flex-start; gap: 8px; padding: 8px 8px 8px 10px; }
.regeintrag-zeile > input[type="checkbox"] { margin: 4px 0 0; width: 16px; height: 16px; accent-color: var(--siegel); flex: none; }
.regeintrag .griff { cursor: grab; color: var(--tinte-blass); flex: none; padding-top: 2px; }
.regeintrag .griff svg { width: 16px; height: 16px; }
.regeintrag .kern { flex: 1; min-width: 0; }
.regeintrag .kern button.titel {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  font: 600 15px/1.35 var(--serif); color: var(--tinte); overflow-wrap: anywhere;
}
.regeintrag .kern button.titel:hover { color: var(--siegel); }
.regeintrag .unterzeile { font-size: 12px; color: var(--tinte-blass); margin: 2px 0 0; overflow-wrap: anywhere; }
.regeintrag .notizvorschau { font-size: 13px; color: var(--tinte-leise); margin: 3px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.regeintrag .werkzeuge { display: flex; gap: 0; align-items: center; flex: none; }
.regeintrag .werkzeuge .knopf.symbol { min-width: 30px; min-height: 30px; padding: 4px; }
.regeintrag .marken { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 2px; }
.regeintrag .marken .marke { font-size: 11px; padding: 0 6px; }
.regeintrag-details { border-top: 1px solid var(--linie); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.regeintrag-details .treffer { box-shadow: none; border: 0; padding: 0; background: transparent; }
.zuordnung { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--blau); }

.vorschlag { border: 1px solid var(--linie); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.vorschlag h3 { font-family: var(--sans); font-size: 15px; }
.vorschlag .gruppen { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.vorschlag .gruppen .haken { padding: 1px 0; }

/* ----------------------------------------------------------- Gesichtet */

.sichtungsform { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; padding: 10px 12px; background: var(--gruen-hell); border-radius: 8px; }
.sichtungsform .breit { grid-column: 1 / -1; }
.sichtungsform textarea { background: var(--flaeche); }
.sichtungsform .zeile { display: flex; gap: 6px; }
.sichtungsform .zeile input { flex: 1; width: auto; }
.status-marken { display: flex; gap: 4px; flex-wrap: wrap; }
.marke.warn { background: var(--warn-hell); color: var(--warn); }
a.marke { text-decoration: none; }

@media (max-width: 900px) {
  .registerraster { grid-template-columns: minmax(0, 1fr); }
  .registerbaum { position: static; max-height: none; }
}
nav.einfuehrung ul { list-style: none; padding-left: 0; gap: 2px; }
nav.einfuehrung li.ebene-2 { padding-left: 18px; }
nav.einfuehrung li.ebene-3 { padding-left: 36px; }
nav.einfuehrung li.ebene-4 { padding-left: 54px; }

/* ------------------------------------------------------- Abschnitt 5 */

.marke.neu { background: var(--siegel); color: #fffbf5; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
:root[data-theme="dark"] .marke.neu { color: #2a120c; }
.gespeichert-hinweis {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: 8px; background: var(--siegel-hell); font-size: 14px;
}
.gespeichert-hinweis svg { width: 16px; height: 16px; color: var(--siegel); flex: none; }
.gespeichert-hinweis .chip { margin-left: auto; }
.beleg { display: flex; flex-direction: column; gap: 4px; }
.beleg textarea { font-family: var(--serif); font-size: 15px; min-height: 60px; }
.beleg .kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dateiwahl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dateiwahl input[type="file"] { font: inherit; font-size: 14px; max-width: 100%; }

/* Quellengruppen in der Seitenleiste */
details.quellengruppe { border-top: 1px solid var(--linie); padding: 4px 0; }
details.quellengruppe:first-of-type { border-top: 0; }
details.quellengruppe > summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-weight: 600; font-size: 14px; }
details.quellengruppe .gruppenzahl { font-weight: 400; color: var(--tinte-blass); font-size: 12px; white-space: nowrap; }
details.quellengruppe .schnellwahl { margin: 0 0 4px; }
.tabelle tr.gruppenkopf th { background: var(--flaeche-3); color: var(--tinte); font-family: var(--serif); font-size: 15px; }
