/* =========================================================
   pollypen.de – Gestaltung (hell und dunkel automatisch)
   ========================================================= */

@font-face {
    font-family: "Lora";
    src: url("schrift/lora-bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #faf7f2;
    --flaeche: #ffffff;
    --text: #1f1b1a;
    --leise: #6b625e;
    --linie: #e7e0d8;
    --akzent: #9b1c2c;
    --akzent-hell: #f3e3e1;
    --akzent-text: #ffffff;
    --gefahr: #b42318;
    --ok: #1d6b3a;
    --ok-hell: #e3f2e8;
    --schatten: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
    --rund: 14px;
    --breite: 1080px;
    --serif: "Lora", Georgia, "Times New Roman", serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16141a;
        --flaeche: #211e25;
        --text: #f1ece8;
        --leise: #a59d99;
        --linie: #36313b;
        --akzent: #e06b75;
        --akzent-hell: #3a2228;
        --akzent-text: #1a0d10;
        --gefahr: #ff8a80;
        --ok: #7fd6a0;
        --ok-hell: #1c3326;
        --schatten: none;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.65 var(--sans);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a { color: var(--akzent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }

.springen { position: absolute; left: -9999px; top: 0; background: var(--flaeche); padding: 8px 14px; z-index: 50; }
.springen:focus { left: 8px; top: 8px; }

/* ---------- Kopf und Menü ---------- */
.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.kopf-innen {
    max-width: var(--breite); margin: 0 auto; padding: 12px 24px;
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.logo-link { display: block; color: var(--text); line-height: 0; }
.logo { height: 84px; width: auto; color: var(--text); display: block; }
.menue { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.menue a {
    color: var(--text); text-decoration: none; font-weight: 500; font-size: 16px;
    padding: 8px 14px; border-radius: 999px;
}
.menue a:hover { background: var(--akzent-hell); }
.menue a.aktiv { background: var(--akzent-hell); color: var(--akzent); }
.menue-knopf {
    display: none; margin-left: auto; font: inherit; font-weight: 600; font-size: 15px;
    color: var(--text); background: transparent; border: 1px solid var(--linie);
    border-radius: 10px; padding: 8px 14px; cursor: pointer;
}

@media (max-width: 760px) {
    .kopf-innen { padding: 10px 16px; gap: 12px; }
    .logo { height: 56px; }
    .menue-knopf { display: block; }
    .menue { display: none; width: 100%; flex-direction: column; gap: 2px; margin: 4px 0 6px; }
    .menue.offen { display: flex; }
    .menue a { padding: 12px 14px; border-radius: 10px; font-size: 17px; }
}

/* Menüpunkt „Verwaltung“ / „Mein Konto“ */
.verw { position: relative; margin-left: auto; padding-left: 8px; }
.verw-box.links { right: auto; left: 0; }
.verw > summary {
    list-style: none; cursor: pointer; font-weight: 600; font-size: 16px; line-height: 1.2;
    padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--akzent); color: var(--akzent); white-space: nowrap;
}
.verw > summary::-webkit-details-marker { display: none; }
.verw > summary:hover, .verw > summary.aktiv { background: var(--akzent-hell); }
.verw[open] > summary { background: var(--akzent); color: #fff; }
.verw-box {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 280px; z-index: 30;
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 8px; display: grid;
}
.menue .verw-box a, .verw-box button {
    display: block; text-align: left; padding: 9px 12px; border-radius: 10px; color: var(--text);
    text-decoration: none; font: inherit; font-weight: 500; font-size: 16px; background: none; border: 0; cursor: pointer; width: 100%;
}
.menue .verw-box a:hover, .verw-box button:hover { background: var(--akzent-hell); }
.menue .verw-box a.aktiv { background: var(--akzent-hell); color: var(--akzent); }
.verw-box form { margin: 0; }
.verw-titel { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); padding: 10px 12px 4px; }
.verw-box hr { border: 0; border-top: 1px solid var(--linie); margin: 6px 4px; }
@media (max-width: 760px) {
    .verw { margin: 8px 0 0; border-top: 1px solid var(--linie); padding: 4px 0 0; }
    .verw > summary { border: 0; border-radius: 10px; color: var(--leise); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; background: none; }
    .verw[open] > summary, .verw > summary.aktiv { background: none; color: var(--leise); }
    .verw-box { position: static; box-shadow: none; border: 0; padding: 0; min-width: 0; background: none; }
    .menue .verw-box a, .verw-box button { padding: 12px 14px; font-size: 17px; }
}
/* Hinweisleiste „Anzeigen als“ */
.ansicht-leiste {
    background: #e9b949; color: #222; display: flex; gap: 8px 16px; align-items: center; justify-content: center;
    flex-wrap: wrap; padding: 8px 16px; font-size: 15px; text-align: center;
}
.ansicht-leiste form { margin: 0; }
.ansicht-leiste .knopf.mini { background: #222; border-color: #222; color: #fff; }

/* ---------- Inhalt ---------- */
.haupt { flex: 1; width: 100%; max-width: var(--breite); margin: 0 auto; padding: 40px 24px 56px; }
@media (max-width: 760px) { .haupt { padding: 24px 16px 40px; } }

.text { max-width: 820px; overflow-wrap: break-word; }
.text.breit { max-width: none; }
.text.schmal { max-width: 460px; }
.text h1, .text h2, .text h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.text h1 { font-size: clamp(30px, 5vw, 42px); margin: 0 0 .4em; }
.text h2 { font-size: clamp(22px, 3.2vw, 28px); margin: 1.4em 0 .4em; }
.text h3 { font-size: 21px; margin: 1.3em 0 .3em; }
.text h1 + h2 { margin-top: 0; font-family: var(--sans); font-weight: 400; font-size: 20px; color: var(--leise); letter-spacing: 0; }
.text p, .text ul, .text ol { margin: 0 0 1em; }
.text img { border-radius: 10px; display: inline-block; vertical-align: middle; }
.text > img, .text p > img:only-child, .text div > img:only-child { display: block; margin: 1em 0; }
.text blockquote { margin: 1em 0; padding: .2em 0 .2em 1em; border-left: 3px solid var(--akzent); color: var(--leise); }
.text hr { border: 0; border-top: 1px solid var(--linie); margin: 2em 0; }

/* Tabellen (z. B. Besetzungslisten) – auf dem Handy seitlich verschiebbar */
.text table { border-collapse: collapse; margin: 1em 0; display: block; max-width: 100%; overflow-x: auto; }
.text td, .text th { padding: 6px 14px 6px 0; vertical-align: top; text-align: left; border-bottom: 1px solid var(--linie); }

.kruemel { font-size: 14px; color: var(--leise); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.kruemel a { color: var(--leise); }

/* ---------- Kacheln (Startseite, Übersicht) ---------- */
.kacheln { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.kachel {
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund);
    padding: 20px; text-decoration: none; color: var(--text); box-shadow: var(--schatten);
    transition: border-color .15s, transform .15s;
}
.kachel:hover { border-color: var(--akzent); transform: translateY(-2px); }
.kachel b { display: block; font-size: 18px; margin-bottom: 4px; }
.kachel span { color: var(--leise); font-size: 15px; }
@media (max-width: 760px) { .kacheln { grid-template-columns: 1fr; } }
@media (min-width: 761px) and (max-width: 980px) { .kacheln { grid-template-columns: repeat(2, 1fr); } }

/* Startseite: großes Bild */
.typ-start .text { max-width: none; }
.typ-start .text img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--rund); }

/* ---------- Chronik-Karten ---------- */
.karten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 12px; }
@media (max-width: 980px) { .karten { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .karten { grid-template-columns: 1fr; } }
.karte {
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund);
    overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--schatten);
}
.karte-bild { display: block; aspect-ratio: 3 / 2; background: linear-gradient(135deg, #6b2330, #2a0d12); overflow: hidden; }
.karte-bild img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.karte:hover .karte-bild img { transform: scale(1.03); }
.ohne-bild { display: block; width: 100%; height: 100%; }
.karte-text { padding: 14px 16px 16px; }
.jahr { color: var(--akzent); font-weight: 700; font-size: 14px; letter-spacing: .06em; }
.karte h2 { font-size: 18px; line-height: 1.3; margin: 2px 0 4px; font-family: var(--sans); font-weight: 700; }
.karte h2 a { color: var(--text); text-decoration: none; }
.karte h2 a:hover { color: var(--akzent); }
.karte p { color: var(--leise); font-size: 14px; margin: 0; }
.chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chips a {
    font-size: 13px; border: 1px solid var(--linie); border-radius: 999px; padding: 3px 12px;
    color: var(--leise); text-decoration: none;
}
.chips a:hover { border-color: var(--akzent); color: var(--akzent); }

/* ---------- Galerie ---------- */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 1em 0; }
@media (max-width: 600px) { .galerie { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.galerie figure { margin: 0; }
.galerie a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: var(--linie); }
.galerie img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; display: block; margin: 0; transition: transform .3s; }
.galerie a:hover img { transform: scale(1.04); }
.galerie figcaption { font-size: 14px; color: var(--leise); margin-top: 6px; line-height: 1.4; }

/* Großansicht */
.grossbild {
    position: fixed; inset: 0; background: rgba(10, 8, 10, .94); z-index: 100;
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px;
}
.grossbild[hidden] { display: none; }
.grossbild img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 6px; object-fit: contain; }
.grossbild p { color: #eee; text-align: center; max-width: 760px; margin: 12px 0 0; font-size: 15px; min-height: 1.4em; }
.grossbild button {
    position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0;
    width: 48px; height: 48px; border-radius: 50%; font-size: 24px; cursor: pointer; line-height: 1;
}
.grossbild button:hover { background: rgba(255, 255, 255, .25); }
.grossbild .zu { top: 14px; right: 14px; }
.grossbild .zurueck { left: 14px; top: 50%; transform: translateY(-50%); }
.grossbild .weiter { right: 14px; top: 50%; transform: translateY(-50%); }
.grossbild .zaehler { position: absolute; top: 22px; left: 20px; color: #bbb; font-size: 14px; }

/* ---------- Formulare und Knöpfe ---------- */
.formular { display: grid; gap: 14px; max-width: 560px; margin: 1em 0 1.5em; }
.formular.kompakt { max-width: none; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.formular label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.formular label.haken { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.formular label.haken input { width: 20px; height: 20px; accent-color: var(--akzent); }
input, select, textarea {
    font: inherit; color: var(--text); background: var(--flaeche);
    border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input[type="file"] { padding: 8px; }
input:focus, select:focus, textarea:focus { border-color: var(--akzent); outline: 2px solid var(--akzent-hell); }
textarea { resize: vertical; }
.versteckt { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
    background: var(--akzent); color: var(--akzent-text); border: 1px solid var(--akzent);
    border-radius: 999px; padding: 10px 20px; justify-self: start;
}
.knopf:hover { filter: brightness(1.08); }
.knopf.zweit { background: transparent; color: var(--akzent); }
.knopf.gefahr { background: var(--gefahr); border-color: var(--gefahr); color: #fff; }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.link-knopf { font: inherit; background: none; border: 0; color: var(--leise); text-decoration: underline; cursor: pointer; padding: 0; }
form.inline { display: inline; }

.meldung { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; background: var(--ok-hell); color: var(--ok); border: 1px solid currentColor; font-weight: 500; }
.meldung.fehler { background: var(--akzent-hell); color: var(--gefahr); }
.meldung.hinweis { background: var(--flaeche); color: var(--text); border-color: var(--linie); }
.klein { font-size: 14px; color: var(--leise); }
.leise { color: var(--leise); font-weight: 400; font-size: 14px; }
.leer { color: var(--leise); }

/* ---------- Leiste "Bearbeiten" unter jeder Seite ---------- */
.bearbeiten-leiste {
    margin-top: 40px; padding-top: 18px; border-top: 1px dashed var(--linie);
    display: flex; gap: 10px; flex-wrap: wrap;
}

/* ---------- Editor ---------- */
.editor { border: 1px solid var(--linie); border-radius: var(--rund); background: var(--flaeche); overflow: hidden; }
.werkzeuge {
    display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--linie);
    position: sticky; top: 0; background: var(--flaeche); z-index: 5;
}
.werkzeuge button {
    font: inherit; font-size: 14px; color: var(--text); background: var(--bg);
    border: 1px solid var(--linie); border-radius: 8px; padding: 6px 10px; cursor: pointer; min-width: 38px;
}
.werkzeuge button:hover, .werkzeuge button.an { border-color: var(--akzent); color: var(--akzent); }
.editor-flaeche { min-height: 360px; padding: 18px 20px; outline: none; max-width: none; }
.editor-flaeche:focus { box-shadow: inset 0 0 0 2px var(--akzent-hell); }
.editor-flaeche img { cursor: pointer; }
.editor-flaeche img.gewaehlt { outline: 3px solid var(--akzent); }
.editor-quelle { width: 100%; min-height: 360px; border: 0; border-radius: 0; font: 14px/1.5 ui-monospace, Consolas, monospace; padding: 18px; }
.editor .hinweis-zeile { font-size: 13px; color: var(--leise); padding: 6px 12px; border-top: 1px solid var(--linie); }
details.einstellungen { border: 1px solid var(--linie); border-radius: var(--rund); padding: 12px 16px; background: var(--flaeche); }
details.einstellungen summary { cursor: pointer; font-weight: 600; }
details.einstellungen[open] summary { margin-bottom: 12px; }
details.einstellungen label { margin-bottom: 12px; }
.formular.bearbeiten { max-width: none; }
.formular.loeschen { margin-top: 40px; padding-top: 10px; border-top: 1px dashed var(--linie); }

/* ---------- Verwaltung ---------- */
.baum { list-style: none; padding: 0; margin: 0; border: 1px solid var(--linie); border-radius: var(--rund); background: var(--flaeche); overflow: hidden; }
.baum li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.baum li:last-child { border-bottom: 0; }
.baum li.tiefe-1 { padding-left: 36px; }
.baum li.tiefe-2 { padding-left: 60px; }
.baum li.tiefe-3, .baum li.tiefe-4, .baum li.tiefe-5 { padding-left: 84px; }
.baum li.tiefe-1 .baum-titel::before, .baum li.tiefe-2 .baum-titel::before, .baum li.tiefe-3 .baum-titel::before { content: "└ "; color: var(--leise); }
.baum-titel { flex: 1; min-width: 180px; }
.baum-knoepfe { display: flex; gap: 8px; align-items: center; }
.baum-knoepfe form { display: flex; gap: 4px; }
.baum-knoepfe button { font: inherit; background: var(--bg); color: var(--text); border: 1px solid var(--linie); border-radius: 8px; width: 34px; height: 30px; cursor: pointer; }
.baum-knoepfe button:hover { border-color: var(--akzent); }
.marke { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 9px; margin-left: 8px; background: var(--akzent-hell); color: var(--akzent); vertical-align: middle; }
.marke.intern { background: var(--bg); color: var(--leise); border: 1px solid var(--linie); }
.marke.gefahr { background: var(--gefahr); color: #fff; }
.marke.leise { background: transparent; color: var(--leise); border: 1px dashed var(--linie); }

.loeschen-klein { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.loeschen-klein label { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.loeschen-klein input { width: auto; }

.kasten { border: 1px solid var(--linie); border-radius: var(--rund); background: var(--flaeche); padding: 4px 20px 16px; margin: 0 0 20px; }
.sicherungen { list-style: none; padding: 0; }
.sicherungen li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.sicherungen li span { word-break: break-all; }
dl.angaben { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; }
dl.angaben dt { color: var(--leise); }
dl.angaben dd { margin: 0; font-weight: 600; }
ol.schritte { padding-left: 1.3em; }
ol.schritte li { margin-bottom: 24px; }
ol.schritte li.erledigt h2 { color: var(--ok); }

/* ---------- Fuß ---------- */
.fuss { border-top: 1px solid var(--linie); color: var(--leise); font-size: 14px; background: var(--bg); }
.fuss-innen { max-width: var(--breite); margin: 0 auto; padding: 20px 24px; display: flex; gap: 12px 22px; flex-wrap: wrap; align-items: center; }
.fuss nav, .fuss-konto { display: flex; gap: 12px 22px; flex-wrap: wrap; align-items: center; }
.fuss-konto { margin-left: auto; }
.fuss a { color: var(--leise); }
@media (max-width: 760px) { .fuss-innen { padding: 18px 16px; } .fuss-konto { margin-left: 0; } }

@media print {
    .kopf, .fuss, .bearbeiten-leiste, .menue-knopf, .ansicht-leiste { display: none; }
    body { background: #fff; color: #000; }
}

/* =========================================================
   Bilder verwalten und Bildauswahl im Editor (ab 1.1.0)
   ========================================================= */
.pfad { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 15px; color: var(--leise); margin-bottom: 12px; }
.pfad a { color: var(--akzent); }
.werkzeugleiste { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0 16px; }
.werkzeugleiste form { margin: 0; }
.werkzeugleiste label.knopf { cursor: pointer; }
.werkzeugleiste label.aus { opacity: .45; pointer-events: none; }
.knopf.mini { font-size: 14px; padding: 6px 14px; color: var(--akzent-text); }
.knopf.mini.gefahr { color: #fff; }
details.ordner-neu { position: relative; }
details.ordner-neu summary { list-style: none; }
details.ordner-neu summary::-webkit-details-marker { display: none; }
details.ordner-neu[open] .inline-form {
    position: absolute; top: 48px; left: 0; z-index: 10; display: flex; gap: 8px; width: 320px; max-width: 86vw;
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.ablage {
    border: 2px dashed var(--linie); border-radius: var(--rund); padding: 18px; text-align: center;
    color: var(--leise); margin-bottom: 20px; transition: border-color .15s, background .15s;
}
.ablage.drueber { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent); }
.ablage .fortschritt { margin-top: 8px; font-weight: 600; color: var(--text); }
.ordnerliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 22px; }
.ordnerliste a {
    display: flex; align-items: center; gap: 10px; background: var(--flaeche); border: 1px solid var(--linie);
    border-radius: 12px; padding: 10px 12px; color: var(--text); text-decoration: none; font-weight: 600; min-width: 0;
}
.ordnerliste a:hover { border-color: var(--akzent); }
.ordnerliste a span:last-child { font-weight: 400; color: var(--leise); font-size: 13px; margin-left: auto; text-align: right; line-height: 1.3; }
.ordnerliste .ico { font-size: 22px; line-height: 1; }
.bildraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
@media (max-width: 600px) { .bildraster { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.bildkarte { min-width: 0;
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; position: relative;
    font: inherit; color: var(--text); text-align: left; padding: 0; display: block; width: 100%;
}
.bk-bild, button.bildkarte img { display: block; }
.bildkarte img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 11px 11px 0 0; margin: 0; }
.bk-text { display: block; overflow: hidden; padding: 8px 10px; font-size: 13px; line-height: 1.4; }
.bk-text b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-text .leise { font-size: 12px; display: block; }
.bk-text .benutzt {
    display: inline-block; margin: 4px 4px 0 0; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px;
    background: var(--akzent-hell); color: var(--akzent); text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bk-menue { position: absolute; top: 6px; right: 6px; }
.bk-menue summary {
    list-style: none; cursor: pointer; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 999px;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.bk-menue summary::-webkit-details-marker { display: none; }
.bk-menue .menuebox {
    position: absolute; top: 38px; right: 0; z-index: 20; width: 250px; max-width: 80vw; display: grid; gap: 10px;
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); padding: 12px;
}
.bildraster .bildkarte:nth-child(2n) .menuebox { right: 0; }
@media (max-width: 600px) { .bildraster .bildkarte:nth-child(2n+1) .bk-menue .menuebox { right: auto; left: -130px; } }
.menuebox form { display: grid; gap: 6px; margin: 0; }
.menuebox label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.menuebox label.haken { display: flex; gap: 6px; font-weight: 400; align-items: flex-start; }
.menuebox label.haken input { width: auto; margin-top: 3px; }
.menuebox input, .menuebox select { padding: 6px 8px; font-size: 14px; }
.menuebox > a { font-size: 14px; }
.menuebox .gefahr-zone { border-top: 1px solid var(--linie); padding-top: 8px; }

/* Bildauswahl im Editor */
.auswahl-hg { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.auswahl-hg[hidden] { display: none; }
.auswahl {
    background: var(--bg); color: var(--text); border-radius: 16px; width: 100%; max-width: 920px; max-height: 92vh;
    display: flex; flex-direction: column; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.auswahl h2 { font-family: var(--serif); margin: 0 0 8px; font-size: 24px; }
.auswahl-mitte { overflow-y: auto; flex: 1; min-height: 120px; padding: 3px; -webkit-overflow-scrolling: touch; }
.auswahl .bildraster { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.auswahl .ordnerliste { margin-bottom: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.auswahl .ordnerliste a { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 0; align-items: center; padding: 8px 10px; }
.auswahl .ordnerliste a span:last-child { grid-column: 2; margin-left: 0; text-align: left; font-size: 12px; }
.auswahl button.bildkarte { cursor: pointer; }
.auswahl button.bildkarte.gewaehlt { outline: 3px solid var(--akzent); outline-offset: 1px; }
.auswahl button.bildkarte.gewaehlt::after {
    content: "✓"; position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
    background: var(--akzent); color: var(--akzent-text); display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.auswahl .unten { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; border-top: 1px solid var(--linie); padding-top: 14px; }
@media (max-width: 600px) {
    .auswahl { padding: 14px; max-height: 96vh; }
    .auswahl .bildraster { grid-template-columns: repeat(2, 1fr); }
    .auswahl .unten .knopf { flex: 1 1 100%; }
}

/* =========================================================
   Weiterleitungen importieren (ab 1.2.0)
   ========================================================= */
.schritte-kopf { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.schritte-kopf span { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 4px 12px; border: 1px solid var(--linie); color: var(--leise); }
.schritte-kopf span.an { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.zwei { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .zwei { grid-template-columns: 1fr; } }
.formular.breit-form { max-width: none; margin-top: 0; }
textarea.liste { font: 14px/1.5 ui-monospace, Consolas, monospace; min-height: 240px; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.datei-wahl input { width: auto; }
.zusammen { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.st { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.st.neu { background: var(--ok-hell); color: var(--ok); }
.st.gleich { background: var(--bg); color: var(--leise); border: 1px solid var(--linie); }
.st.anders { background: #fff3d6; color: #8a5a00; }
.st.fehler { background: var(--akzent-hell); color: var(--gefahr); }
@media (prefers-color-scheme: dark) { .st.anders { background: #3a2f12; color: #f5c66a; } }
.tabelle-rahmen { border: 1px solid var(--linie); border-radius: var(--rund); background: var(--flaeche); overflow: hidden; }
.text table.tabelle-wl { display: table; width: 100%; margin: 0; font-size: 14px; }
.tabelle-wl th, .tabelle-wl td { padding: 9px 12px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.tabelle-wl tr:last-child td { border-bottom: 0; }
.tabelle-wl th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); }
.tabelle-wl td.wahl { width: 36px; }
.tabelle-wl td.wahl input { width: 20px; height: 20px; accent-color: var(--akzent); }
.tabelle-wl td.ziele { word-break: break-all; }
@media (max-width: 680px) {
    .tabelle-wl thead { display: none; }
    .tabelle-wl, .tabelle-wl tbody, .tabelle-wl tr, .tabelle-wl td { display: block; width: 100%; }
    .text table.tabelle-wl { display: block; }
    .tabelle-wl tr { position: relative; padding: 10px 12px 10px 46px; border-bottom: 1px solid var(--linie); }
    .tabelle-wl tr:last-child { border-bottom: 0; }
    .tabelle-wl td { border: 0; padding: 2px 0; }
    .tabelle-wl td.wahl { position: absolute; left: 12px; top: 12px; width: auto; }
}
.nur-im-kas { margin: 0 0 16px; }
.nur-im-kas summary { cursor: pointer; color: var(--leise); font-size: 14px; }
.wl-stand:empty { display: none; }
.wl-stand { margin-top: 14px; }
.weitere-ziele summary { cursor: pointer; color: var(--akzent); font-size: 13px; }

/* ---------- E-Mail-Weiterleitungen ---------- */
.email-kopf { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; margin: 8px 0 16px; }
.email-suche { flex: 1 1 220px; min-width: 0; }
.email-neu { flex: 0 0 auto; }
.email-neu > summary { list-style: none; }
.email-neu > summary::-webkit-details-marker { display: none; }
.email-neu[open] { flex: 1 1 100%; order: 3; border: 1px solid var(--linie); border-radius: var(--rund); background: var(--flaeche); padding: 14px; }
.email-neu[open] > summary { margin-bottom: 12px; }
.text table.tabelle-email { display: table; width: 100%; margin: 0; border-collapse: collapse; overflow: visible; }
.tabelle-email th, .tabelle-email td { padding: 9px 12px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.tabelle-email th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); font-weight: 600; }
.tabelle-email tbody tr:last-of-type td { border-bottom: 0; }
.tabelle-email td.email-adr { font-weight: 700; overflow-wrap: anywhere; width: 30%; }
.tabelle-email td { vertical-align: middle; }
.tabelle-email td.email-adr .leise { font-size: 14px; font-weight: 400; }
.tabelle-email td.email-ziel { font-size: 15px; overflow-wrap: anywhere; }
.tabelle-email td.aktionen { text-align: right; white-space: nowrap; width: 1%; }
.tabelle-email .knopf.mini.zweit { color: var(--akzent); background: transparent; }
.tabelle-email tr.offen td { background: var(--akzent-hell); border-bottom: 0; }
.tabelle-email tr.email-bearbeiten td { background: var(--akzent-hell); padding: 0 0 4px; }
.tabelle-email tr[hidden] { display: none !important; }
@media (max-width: 700px) {
    .tabelle-email thead { display: none; }
    .text table.tabelle-email, .tabelle-email tbody, .tabelle-email tr, .tabelle-email td { display: block; width: auto; }
    .tabelle-email tr.email-z { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--linie); padding: 10px 12px; gap: 2px 10px; }
    .tabelle-email tr.email-z td { border: 0; padding: 0; background: none; }
    .tabelle-email td.email-adr { grid-column: 1; width: auto; }
    .tabelle-email td.email-ziel { grid-column: 1; font-size: 14px; color: var(--leise); }
    .tabelle-email td.aktionen { grid-column: 2; grid-row: 1 / 3; align-self: center; width: auto; }
    .tabelle-email tr.email-z.offen { background: var(--akzent-hell); border-bottom: 0; }
    .tabelle-email tr.email-bearbeiten { border-bottom: 1px solid var(--linie); background: var(--akzent-hell); }
    .tabelle-email tr.email-bearbeiten td { border: 0; }
}
.email-form { display: grid; gap: 6px; padding: 14px 14px 4px; }
.email-form label { font-weight: 600; font-size: 15px; margin-top: 6px; }
.email-adr-feld { display: flex; align-items: center; gap: 6px; }
.email-adr-feld input { flex: 1; min-width: 0; }
.email-adr-feld span { white-space: nowrap; }
.email-neu .email-form { padding: 0; }
.email-form .knopfreihe { margin-top: 8px; }
.email-loeschen { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; justify-content: flex-end; padding: 4px 14px 14px; }
.email-loeschen label.haken { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.email-loeschen input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gefahr); }

/* ---------- Benutzer-Tabelle ---------- */
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text table.tabelle-benutzer { display: table; width: 100%; margin: 0; border-collapse: collapse; overflow: visible; }
.tabelle-benutzer .marke.leise { white-space: nowrap; }
.tabelle-benutzer th, .tabelle-benutzer td { padding: 10px 12px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: middle; }
.tabelle-benutzer th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); font-weight: 600; }
.tabelle-benutzer tbody tr:last-child td { border-bottom: 0; }
.tabelle-benutzer .marke { margin: 2px 6px 2px 0; }
.tabelle-benutzer .b-mail { display: block; font-size: 13px; overflow-wrap: anywhere; }
.tabelle-benutzer tr.inaktiv b { color: var(--leise); }
.tabelle-benutzer tr.offen td { background: var(--akzent-hell); border-bottom: 0; }
.tabelle-benutzer td.aktionen { text-align: right; white-space: nowrap; }
.tabelle-benutzer td.aktionen form { display: inline; margin: 0; }
.tabelle-benutzer td.aktionen .knopf { margin-left: 6px; }
.tabelle-benutzer .knopf.mini.zweit { color: var(--akzent); background: transparent; }
.tabelle-benutzer tr.b-bearbeiten td { background: var(--akzent-hell); padding: 10px 16px 16px; }
.tabelle-benutzer tr.b-bearbeiten .formular { margin: 0 0 12px; }
.marke.rolle-mitglied { background: transparent; color: var(--leise); border: 1px solid var(--linie); }
@media (max-width: 900px) {
    .tabelle-benutzer thead { display: none; }
    .text table.tabelle-benutzer, .tabelle-benutzer tbody, .tabelle-benutzer tr, .tabelle-benutzer td { display: block; width: 100%; }
    .tabelle-benutzer tr { border-bottom: 1px solid var(--linie); padding: 10px 14px; }
    .tabelle-benutzer tbody tr:last-child { border-bottom: 0; }
    .tabelle-benutzer td { border: 0; padding: 2px 0; }
    .tabelle-benutzer td[data-titel="Rolle"], .tabelle-benutzer td[data-titel="Status"], .tabelle-benutzer td[data-titel="Zuletzt"] { display: inline-block; width: auto; margin-right: 8px; font-size: 14px; }
    .tabelle-benutzer td[data-titel="Zuletzt"]::before { content: "zuletzt "; color: var(--leise); }
    .tabelle-benutzer td.aktionen { text-align: left; padding-top: 8px; white-space: normal; }
    .tabelle-benutzer td.aktionen .knopf { margin: 0 6px 0 0; }
    .tabelle-benutzer tr.offen { background: var(--akzent-hell); border-bottom: 0; }
    .tabelle-benutzer tr.offen td { background: none; }
    .tabelle-benutzer tr.b-bearbeiten { background: var(--akzent-hell); padding-top: 6px; }
    .tabelle-benutzer tr.b-bearbeiten td { padding: 0; background: none; }
}

/* ---------- Update einspielen: Fortschritt ---------- */
.update-stand .balken { height: 10px; border-radius: 999px; background: var(--linie); overflow: hidden; }
.update-stand .balken span { display: block; height: 100%; width: 0; background: var(--akzent); transition: width .2s; }
.update-stand .update-text { margin: 8px 0 0; font-weight: 600; }
.update-warten { margin-top: 14px; }

/* ---------- Mitgliederliste ---------- */
.mitglieder { margin-top: 0; }
.text table.tabelle-mitglieder { display: table; width: 100%; margin: 0; border-collapse: collapse; overflow: visible; font-size: 15px; }
.tabelle-mitglieder th, .tabelle-mitglieder td { padding: 8px 10px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: middle; }
.tabelle-mitglieder th { padding: 0; }
.tabelle-mitglieder th button {
    display: flex; align-items: center; gap: 4px; width: 100%; padding: 10px; background: none; border: 0; cursor: pointer;
    font: inherit; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); text-align: left; white-space: nowrap;
}
.tabelle-mitglieder th button:hover { color: var(--akzent); }
.tabelle-mitglieder th .pfeil::after { content: "↕"; opacity: .35; }
.tabelle-mitglieder th[aria-sort="ascending"] button, .tabelle-mitglieder th[aria-sort="descending"] button { color: var(--akzent); }
.tabelle-mitglieder th[aria-sort="ascending"] .pfeil::after { content: "▲"; opacity: 1; font-size: 10px; }
.tabelle-mitglieder th[aria-sort="descending"] .pfeil::after { content: "▼"; opacity: 1; font-size: 10px; }
.tabelle-mitglieder tbody tr:last-of-type td { border-bottom: 0; }
.tabelle-mitglieder td.m-mail { overflow-wrap: anywhere; }
.tabelle-mitglieder td.m-karte { display: none; }
.tabelle-mitglieder td.aktionen { text-align: right; white-space: nowrap; width: 1%; }
.tabelle-mitglieder .knopf.mini.zweit { color: var(--akzent); background: transparent; }
.tabelle-mitglieder tr.offen td { background: var(--akzent-hell); border-bottom: 0; }
.tabelle-mitglieder tr.liste-bearbeiten td { background: var(--akzent-hell); padding: 8px 12px 4px; }
.tabelle-mitglieder tr[hidden] { display: none !important; }
.mitglied-form { margin: 0 0 8px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.email-neu .mitglied-form { margin: 0; }
.mitglieder-uebernahme { margin-top: 0; }
@media (max-width: 900px) {
    .tabelle-mitglieder thead { display: block; }
    .tabelle-mitglieder thead tr { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--linie); }
    .tabelle-mitglieder thead th { border: 0; }
    .tabelle-mitglieder th button { padding: 4px 8px; border: 1px solid var(--linie); border-radius: 999px; }
    .tabelle-mitglieder thead th:last-child:not(:has(button)) { display: none; }
    .text table.tabelle-mitglieder, .tabelle-mitglieder tbody { display: block; }
    .tabelle-mitglieder tr.liste-z { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; padding: 10px 12px; border-bottom: 1px solid var(--linie); }
    .tabelle-mitglieder tr.liste-z td { display: none; border: 0; padding: 0; background: none; }
    .tabelle-mitglieder tr.liste-z td.m-name { display: block; grid-column: 1; font-size: 16px; }
    .tabelle-mitglieder tr.liste-z td.m-karte { display: block; grid-column: 1; font-size: 14px; color: var(--leise); line-height: 1.5; overflow-wrap: anywhere; }
    .tabelle-mitglieder tr.liste-z td.aktionen { display: block; grid-column: 2; grid-row: 1 / span 2; align-self: center; width: auto; }
    .tabelle-mitglieder tr.liste-z.offen { background: var(--akzent-hell); border-bottom: 0; }
    .tabelle-mitglieder tr.liste-bearbeiten { display: block; border-bottom: 1px solid var(--linie); background: var(--akzent-hell); }
    .tabelle-mitglieder tr.liste-bearbeiten td { display: block; border: 0; }
}
