:root {
    --primaer: #1f5f8b;
    --primaer-dunkel: #164766;
    --akzent: #e8f1f8;
    --text: #1d2733;
    --text-hell: #5c6b7a;
    --rand: #dbe2e9;
    --hintergrund: #f4f6f8;
    --weiss: #fff;
    --gefahr: #b3261e;
    --erfolg: #1e7a46;
    --hinweis: #8a6d00;
    --radius: 8px;
    --schatten: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--hintergrund);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a { color: var(--primaer); }
a:hover { color: var(--primaer-dunkel); }
h1 { font-size: 1.75rem; margin: 0 0 1rem; line-height: 1.25; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .25rem; }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--rand); margin: 1rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Kopf ---------- */
.kopf { background: var(--primaer); color: var(--weiss); box-shadow: var(--schatten); }
.kopf-innen {
    max-width: 1200px; margin: 0 auto; padding: .75rem 1rem;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}
.logo { color: var(--weiss); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.logo:hover { color: var(--weiss); }
.logo-icon { opacity: .8; }
.navigation { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.navigation a, .link-knopf {
    color: rgba(255, 255, 255, .9); text-decoration: none; padding: .4rem .7rem; border-radius: 6px;
    font-size: .95rem;
}
.navigation a:hover, .navigation a.aktiv, .link-knopf:hover { background: rgba(255, 255, 255, .15); color: var(--weiss); }
.link-knopf { background: none; border: 0; cursor: pointer; font: inherit; font-size: .95rem; }
.menue-schalter, .menue-knopf { display: none; }

@media (max-width: 760px) {
    .menue-knopf { display: block; cursor: pointer; font-size: 1.5rem; padding: 0 .5rem; }
    .navigation { display: none; width: 100%; flex-direction: column; align-items: stretch; }
    .menue-schalter:checked ~ .navigation { display: flex; }
}

/* ---------- Inhalt ---------- */
.inhalt { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.fuss { color: var(--text-hell); font-size: .875rem; border-top: 1px solid var(--rand); background: var(--weiss); }
.fuss-innen { max-width: 1200px; margin: 0 auto; padding: 1rem; }

.karte { background: var(--weiss); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--schatten); }
.abschnitt { margin-top: 2rem; }
.leer { color: var(--text-hell); font-style: italic; }
.zurueck { margin: 0 0 1rem; }
.zurueck a { text-decoration: none; }
.seiten-kopf { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.seiten-kopf h1 { margin: 0; }
.abzeichen { display: inline-block; font-size: .75rem; font-weight: 600; background: var(--akzent); color: var(--primaer-dunkel); border-radius: 999px; padding: .1rem .6rem; vertical-align: middle; }

/* ---------- Meldungen ---------- */
.meldung { border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.meldung ul { margin: .25rem 0 0; padding-left: 1.25rem; }
.meldung-erfolg { background: #e7f5ec; border-color: #b6e0c5; color: var(--erfolg); }
.meldung-fehler { background: #fdecea; border-color: #f5c2bd; color: var(--gefahr); }
.meldung-hinweis { background: #fff8e1; border-color: #f0dc9a; color: var(--hinweis); }

/* ---------- Knöpfe ---------- */
.knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    background: var(--primaer); color: var(--weiss); border: 1px solid var(--primaer);
    border-radius: 6px; padding: .5rem 1rem; font: inherit; font-weight: 600; font-size: .95rem;
    text-decoration: none; cursor: pointer; line-height: 1.2;
}
.knopf:hover { background: var(--primaer-dunkel); color: var(--weiss); }
.knopf-sekundaer { background: var(--weiss); color: var(--primaer); border-color: var(--rand); }
.knopf-sekundaer:hover { background: var(--akzent); color: var(--primaer-dunkel); }
.knopf-gefahr { background: var(--weiss); color: var(--gefahr); border-color: #f0b8b3; }
.knopf-gefahr:hover { background: var(--gefahr); color: var(--weiss); }
.knopf-klein { padding: .3rem .6rem; font-size: .85rem; }
.knopf-breit { width: 100%; }
form.inline { display: inline; }
.aktionen { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

/* ---------- Kalender ---------- */
.kalender-kopf { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.monat-navigation { display: flex; align-items: center; gap: .5rem; }
.monat-navigation h1 { margin: 0 .5rem; min-width: 11ch; text-align: center; }
.kalender-aktionen { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.filter { display: flex; gap: .5rem; flex-wrap: wrap; }
.filter select { min-width: 170px; width: auto; }

.kalender {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--rand); gap: 1px; border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden;
}
.kalender-wochentag { background: var(--akzent); text-align: center; font-weight: 600; font-size: .85rem; padding: .4rem; color: var(--primaer-dunkel); }
.kalender-tag { background: var(--weiss); min-height: 110px; padding: .3rem; display: flex; flex-direction: column; gap: 2px; }
.kalender-tag.wochenende { background: #fbfcfd; }
.kalender-tag.fremder-monat { background: #f7f8fa; }
.kalender-tag.fremder-monat .tag-nummer { color: #a8b3be; }
.tag-nummer { font-size: .85rem; font-weight: 600; align-self: flex-end; width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 50%; }
.kalender-tag.heute .tag-nummer { background: var(--primaer); color: var(--weiss); }
.kalender-eintrag {
    display: block; font-size: .78rem; line-height: 1.3; padding: .15rem .35rem; border-radius: 4px;
    background: var(--akzent); color: var(--primaer-dunkel); text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kalender-eintrag:hover { background: var(--primaer); color: var(--weiss); }
.eintrag-zeit { font-weight: 700; margin-right: .2rem; }
.weitere { font-size: .75rem; color: var(--text-hell); padding-left: .35rem; }

@media (max-width: 760px) {
    .kalender-tag { min-height: 56px; }
    .kalender-eintrag { font-size: 0; height: 6px; padding: 0; background: var(--primaer); }
    .weitere { display: none; }
    .monat-navigation h1 { font-size: 1.3rem; }
}

/* ---------- Karten-Raster ---------- */
.karten-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.veranstaltung-karte { background: var(--weiss); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten); display: flex; flex-direction: column; }
.karte-bild { display: block; aspect-ratio: 450 / 250; background: var(--akzent); }
.karte-bild img { width: 100%; height: 100%; object-fit: cover; }
.karte-text { padding: .9rem 1rem 1rem; }
.karte-text h3 a { color: var(--text); text-decoration: none; }
.karte-text h3 a:hover { color: var(--primaer); }
.karte-datum { font-size: .85rem; color: var(--primaer); font-weight: 600; margin: 0 0 .25rem; }
.karte-meta { font-size: .875rem; color: var(--text-hell); margin: 0; }
.bild-platzhalter { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3rem; font-weight: 700; color: var(--primaer); opacity: .35; }

/* ---------- Detailseiten ---------- */
.detail-kopf { display: grid; grid-template-columns: 450px 1fr; gap: 1.5rem; margin-bottom: 1.5rem; align-items: start; }
.detail-bild { aspect-ratio: 450 / 250; border-radius: var(--radius); overflow: hidden; background: var(--akzent); box-shadow: var(--schatten); }
.detail-bild img { width: 100%; height: 100%; object-fit: cover; }
.bild-platzhalter.gross { font-size: 5rem; }
.eckdaten { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.eckdaten dt { font-weight: 600; color: var(--text-hell); }
.eckdaten dd { margin: 0; }
@media (max-width: 860px) { .detail-kopf { grid-template-columns: 1fr; } }

.richtext { overflow-wrap: anywhere; }
.richtext > :first-child { margin-top: 0; }
.richtext > :last-child { margin-bottom: 0; }
.richtext table { border-collapse: collapse; }
.richtext td, .richtext th { border: 1px solid var(--rand); padding: .35rem .6rem; }
.richtext blockquote { border-left: 4px solid var(--rand); margin-left: 0; padding-left: 1rem; color: var(--text-hell); }

.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.galerie-bild { display: block; background: var(--weiss); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; text-decoration: none; font-size: .8rem; color: var(--text-hell); }
.galerie-bild img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.galerie-bild span { display: block; padding: .35rem .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Formulare ---------- */
.formular .feld { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.formular label { font-weight: 600; font-size: .9rem; }
.feld-gruppe { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 1rem; }
.feld-gruppe .feld-schmal { max-width: 140px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=tel], input[type=search], select, textarea {
    font: inherit; padding: .5rem .65rem; border: 1px solid #c4cdd6; border-radius: 6px; background: var(--weiss); color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 95, 139, .35); border-color: var(--primaer); }
input[type=file] { font-size: .9rem; }
.hilfe { font-size: .825rem; color: var(--text-hell); margin: .2rem 0 0; }
.checkbox { display: flex; align-items: center; gap: .4rem; font-weight: 400 !important; margin-top: .5rem; }

.bild-feld { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.bild-vorschau {
    width: 225px; aspect-ratio: 450 / 250; border: 2px dashed var(--rand); border-radius: 6px; overflow: hidden;
    display: grid; place-items: center; color: var(--text-hell); font-size: .85rem; background: var(--hintergrund); flex-shrink: 0;
}
.bild-vorschau img, .bild-vorschau canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.bild-vorschau:has(canvas) { width: min(100%, 450px); border-style: solid; }
.bild-vorschau canvas.verschiebbar { cursor: grab; touch-action: none; }
.bild-vorschau canvas.verschiebbar:active { cursor: grabbing; }
.bild-anpassung { border: 1px solid var(--rand, #d5dae1); border-radius: 8px; padding: .6rem .9rem .4rem; margin: .7rem 0 .4rem; min-width: 0; }
.bild-anpassung legend { font-weight: 600; padding: 0 .3rem; }
.bild-anpassung .checkbox { align-items: flex-start; }
.bild-anpassung .checkbox span { flex: 1; min-width: 0; }
.bild-zoom { display: flex; align-items: center; gap: .6rem; margin: .3rem 0 .5rem; }
.bild-zoom input[type=range] { flex: 1; min-width: 0; }

.anhang-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.anhang { border: 1px solid var(--rand); border-radius: 6px; overflow: hidden; font-weight: 400 !important; font-size: .8rem; background: var(--weiss); }
.anhang img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.anhang span { display: block; padding: .2rem .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anhang .entfernen { color: var(--gefahr); }
.anhang-pdf { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #fbebeb; color: #b42318;
    font-weight: 700; font-size: 1.1rem; letter-spacing: .05em; }
.dokumente { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.dokument { display: grid; grid-template-columns: 3.2rem 1fr; grid-template-rows: auto auto; column-gap: .75rem; align-items: center;
    padding: .5rem .75rem; background: var(--weiss); border: 1px solid var(--rand); border-radius: var(--radius); text-decoration: none; color: inherit; }
.dokument .anhang-pdf { grid-row: span 2; aspect-ratio: auto; height: 2.6rem; border-radius: 4px; font-size: .8rem; }
.dokument-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.dokument-groesse { font-size: .85rem; color: var(--text-hell); }
.dokument:hover .dokument-name { text-decoration: underline; }

.login-box { max-width: 420px; margin: 2rem auto; }
.zwei-spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.5rem; align-items: start; }

/* ---------- Tabellen ---------- */
.reiter { display: flex; gap: .25rem; border-bottom: 1px solid var(--rand); margin-bottom: 1rem; }
.reiter a { padding: .5rem .9rem; text-decoration: none; color: var(--text-hell); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.reiter a.aktiv { color: var(--primaer); border-bottom-color: var(--primaer); font-weight: 600; }
.tabelle-huelle { overflow-x: auto; background: var(--weiss); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten); }
.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--rand); vertical-align: middle; }
.tabelle th { background: var(--akzent); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--primaer-dunkel); }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tr.inaktiv td { opacity: .55; }
.tabelle .rechts { text-align: right; }
.nowrap { white-space: nowrap; }
.mini-bild { width: 90px; }
.mini-bild img { width: 81px; height: 45px; object-fit: cover; border-radius: 4px; }

/* ---------- Editor ---------- */
.editor { border: 1px solid #c4cdd6; border-radius: 6px; background: var(--weiss); overflow: hidden; }
.editor:focus-within { outline: 2px solid rgba(31, 95, 139, .35); border-color: var(--primaer); }
.editor-leiste {
    display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center;
    padding: .4rem; background: var(--hintergrund); border-bottom: 1px solid var(--rand);
    position: sticky; top: 0; z-index: 1;
}
.editor-gruppe { display: inline-flex; gap: 2px; padding-right: .5rem; border-right: 1px solid var(--rand); }
.editor-gruppe:last-child { border-right: 0; }
.editor-knopf {
    min-width: 32px; height: 32px; padding: 0 .4rem; border: 1px solid transparent; border-radius: 4px;
    background: transparent; color: var(--text); cursor: pointer; font: inherit; font-size: .95rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.editor-knopf:hover:not(:disabled) { background: var(--weiss); border-color: var(--rand); }
.editor-knopf.aktiv { background: var(--akzent); border-color: #b9d2e6; color: var(--primaer-dunkel); }
.editor-knopf:disabled, .editor-format:disabled { opacity: .4; cursor: default; }
.editor-knopf[data-befehl="quelltext"] { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }
.quelltext-modus .editor-knopf[data-befehl="quelltext"] { background: var(--primaer); color: var(--weiss); }
.editor-format { width: auto; padding: .3rem .5rem; font-size: .9rem; height: 32px; }
.editor-flaeche { min-height: 300px; max-height: 70vh; overflow-y: auto; padding: .75rem 1rem; line-height: 1.6; outline: none; }
.editor-flaeche > :first-child { margin-top: 0; }
.editor-flaeche { position: relative; }
.editor.leer .editor-flaeche::before { content: attr(data-platzhalter); color: #98a4b0; pointer-events: none; position: absolute; top: .75rem; left: 1rem; }
.editor-quelltext {
    display: block; width: 100%; min-height: 300px; border: 0 !important; border-radius: 0 !important; outline: none !important;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; padding: .75rem 1rem; resize: vertical;
}

/* ---------- Status ---------- */
.status { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
    border-radius: 999px; padding: .1rem .55rem; vertical-align: middle; border: 1px solid; white-space: nowrap; }
.status-in_planung { background: #fff6e0; color: #8a5a00; border-color: #f0d79a; }
.status-zugesagt { background: #e5f5eb; color: #1e7a46; border-color: #b4dfc4; }
.status-abgesagt { background: #fdecea; color: #b3261e; border-color: #f2bcb7; }
select.status-auswahl { width: auto; font-weight: 600; }
select.status-auswahl.status-in_planung, select.status-auswahl.status-zugesagt, select.status-auswahl.status-abgesagt { border-radius: 6px; text-transform: none; font-size: .85rem; letter-spacing: 0; padding: .3rem .5rem; }
.status-wechsel { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; font-size: .9rem; }
.status-wechsel label { font-weight: 600; color: var(--text-hell); }
.feld-gruppe-titel { grid-template-columns: 1fr 200px; }
@media (max-width: 600px) { .feld-gruppe-titel { grid-template-columns: 1fr; } }

.kalender-eintrag.eintrag-in_planung { background: #fff6e0; color: #6b4600; border-left: 3px solid #e0a82e; }
.kalender-eintrag.eintrag-zugesagt { background: #e5f5eb; color: #17603a; border-left: 3px solid #2e9e5b; }
.kalender-eintrag.eintrag-abgesagt { background: #f6f6f6; color: #8b9198; border-left: 3px solid #d0544b; text-decoration: line-through; }
.kalender-eintrag:hover { background: var(--primaer) !important; color: var(--weiss) !important; }
@media (max-width: 760px) {
    .kalender-eintrag.eintrag-in_planung { background: #e0a82e; }
    .kalender-eintrag.eintrag-zugesagt { background: #2e9e5b; }
    .kalender-eintrag.eintrag-abgesagt { background: #d0544b; }
    .kalender-eintrag { border-left: 0 !important; }
}
.legende { font-size: .85rem; color: var(--text-hell); margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.legende-eintrag { padding: .1rem .5rem; border-radius: 4px; font-size: .78rem; }
.legende-eintrag.eintrag-in_planung { background: #fff6e0; border-left: 3px solid #e0a82e; }
.legende-eintrag.eintrag-zugesagt { background: #e5f5eb; border-left: 3px solid #2e9e5b; }
.legende-eintrag.eintrag-abgesagt { background: #f6f6f6; border-left: 3px solid #d0544b; text-decoration: line-through; }

.karte-abgesagt .karte-bild { filter: grayscale(1); opacity: .6; }
.karte-abgesagt h3 a { text-decoration: line-through; color: var(--text-hell); }
.titel-abgesagt { text-decoration: line-through; color: var(--text-hell); }

/* ---------- Nachrichten ---------- */
.zaehler { display: inline-block; min-width: 1.4em; text-align: center; background: #d0544b; color: #fff;
    font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .05rem .4rem; vertical-align: middle; }
h1 .zaehler { font-size: .8rem; padding: .15rem .6rem; }
.reiter { flex-wrap: wrap; align-items: center; }
.reiter-filter { margin-left: auto; display: flex; gap: .1rem; flex-wrap: wrap; }
.reiter-filter a { font-size: .85rem; padding: .35rem .6rem; }
.nachrichten-liste { display: flex; flex-direction: column; gap: .75rem; }
.nachricht { background: var(--weiss); border: 1px solid var(--rand); border-left: 4px solid var(--rand); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--schatten); }
.nachricht.ungelesen { background: #fbfdff; border-color: #b9d2e6; }
.nachricht-neu { border-left-color: var(--primaer); }
.nachricht-geaendert { border-left-color: #8a96a3; }
.nachricht-status { border-left-color: #e0a82e; }
.nachricht-geloescht { border-left-color: #d0544b; }
.nachricht-kopf { display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; color: var(--text-hell); margin-bottom: .2rem; }
.nachricht-typ { font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.nachricht.ungelesen h3::before { content: ''; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--primaer); margin-right: .45rem; vertical-align: middle; }
.nachricht h3 a { color: var(--text); }
.nachricht-details { font-family: inherit; white-space: pre-wrap; margin: .4rem 0 .5rem; font-size: .9rem; color: var(--text); background: var(--hintergrund); border-radius: 6px; padding: .6rem .8rem; }
.link-knopf-dunkel { background: none; border: 0; padding: 0; color: var(--primaer); cursor: pointer; font: inherit; font-size: .85rem; text-decoration: underline; }

/* ---------- Ansicht-Umschalter ---------- */
.ansicht-umschalter { display: inline-flex; border: 1px solid var(--rand); border-radius: 6px; overflow: hidden; background: var(--weiss); }
.ansicht-umschalter a { padding: .45rem .9rem; text-decoration: none; color: var(--primaer); font-weight: 600; font-size: .9rem; }
.ansicht-umschalter a + a { border-left: 1px solid var(--rand); }
.ansicht-umschalter a.aktiv { background: var(--primaer); color: var(--weiss); }
.ansicht-umschalter a:not(.aktiv):hover { background: var(--akzent); }

/* ---------- Jahresübersicht ---------- */
.jahres-statistik { margin: 0 0 1rem; color: var(--text-hell); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.jahres-statistik strong { color: var(--text); }
.jahres-statistik .legende-eintrag { text-decoration: none; }
.jahres-raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1050px) { .jahres-raster { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .jahres-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } }
@media (max-width: 330px) { .jahres-raster { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
    .monat-navigation { flex-wrap: wrap; }
    .monat-navigation h1 { min-width: 0; }
    .mini-monat { padding: .5rem .45rem .6rem; }
    .mini-tag { font-size: .7rem; }
    .mini-wochentag { font-size: .58rem; }
}
.mini-monat { background: var(--weiss); border: 1px solid var(--rand); border-radius: var(--radius); padding: .7rem .7rem .8rem; box-shadow: var(--schatten); }
.mini-monat.aktueller-monat { border-color: var(--primaer); box-shadow: 0 0 0 1px var(--primaer); }
.mini-monat h2 { font-size: 1rem; margin: 0 0 .45rem; display: flex; justify-content: space-between; align-items: center; }
.mini-monat h2 a { color: var(--text); text-decoration: none; }
.mini-monat h2 a:hover { color: var(--primaer); }
.mini-anzahl { font-size: .72rem; font-weight: 700; background: var(--akzent); color: var(--primaer-dunkel); border-radius: 999px; padding: .05rem .5rem; }
.mini-raster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.mini-wochentag { font-size: .66rem; font-weight: 700; color: var(--text-hell); padding-bottom: .15rem; }
.mini-tag { position: relative; font-size: .78rem; line-height: 1; aspect-ratio: 1; display: grid; place-items: center; border-radius: 4px; color: var(--text); text-decoration: none; }
.mini-tag.wochenende { color: #8995a1; }
.mini-tag.heute { outline: 2px solid var(--primaer); outline-offset: -2px; font-weight: 700; }
.mini-tag.hat-termin { font-weight: 700; }
.mini-tag.tag-zugesagt { background: #2e9e5b; color: #fff; }
.mini-tag.tag-in_planung { background: #f3c55b; color: #4d3400; }
.mini-tag.tag-abgesagt { background: #f4d4d1; color: #a1302a; text-decoration: line-through; }
a.mini-tag:hover { filter: brightness(.9); transform: scale(1.12); z-index: 1; }
.mini-mehrere { position: absolute; top: -4px; right: -4px; background: var(--primaer-dunkel); color: #fff; font-size: .58rem; min-width: 13px; height: 13px; line-height: 13px; border-radius: 999px; padding: 0 2px; text-decoration: none; }

.jahres-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 1rem 1.5rem; align-items: start; }
@media (max-width: 560px) {
    .jahres-liste { grid-template-columns: minmax(0, 1fr); }
    .jahres-tabelle .spalte-verein { display: none; }
    .jahres-tabelle .status { font-size: .6rem; padding: .1rem .35rem; }
    .jahres-tabelle td { padding: .4rem .35rem; font-size: .8rem; }
    .jahres-tabelle .spalte-datum { white-space: normal; min-width: 4.2rem; }
    .jahres-titel { overflow-wrap: anywhere; }
}
.jahres-monat { min-width: 0; }
.jahres-monat h3 { display: flex; gap: .5rem; align-items: center; margin: .25rem 0 .4rem; }
.jahres-tabelle { background: var(--weiss); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; }
.jahres-tabelle td { padding: .45rem .6rem; font-size: .85rem; }
.spalte-datum { font-weight: 600; width: 1%; }
.spalte-zeit, .spalte-ort { display: block; font-weight: 400; font-size: .76rem; color: var(--text-hell); }
.spalte-verein { font-size: .8rem; }
.spalte-verein a { color: var(--text-hell); }
.jahres-titel { font-weight: 600; color: var(--text); }
.zeile-abgesagt .jahres-titel { text-decoration: line-through; color: var(--text-hell); }

/* ---------- Druck ---------- */
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body { background: #fff; font-size: 10pt; }
    .kopf, .fuss, .kalender-aktionen, .nicht-drucken, .meldung, .monat-navigation .knopf { display: none !important; }
    .inhalt { max-width: none; padding: 0; }
    .monat-navigation h1 { margin: 0; }
    .jahres-raster { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .jahres-statistik { margin-bottom: 4px; font-size: 9pt; }
    .mini-monat { box-shadow: none; break-inside: avoid; padding: 4px 6px; }
    .mini-monat.aktueller-monat { box-shadow: none; }
    .mini-monat h2 { font-size: 10pt; margin-bottom: 2px; }
    .mini-wochentag { font-size: 6.5pt; padding: 0; }
    .mini-raster { gap: 1px; }
    .mini-tag { font-size: 7.5pt; aspect-ratio: auto; height: 15px; }
    .mini-mehrere { top: -3px; right: 0; font-size: 5.5pt; min-width: 10px; height: 10px; line-height: 10px; }
    .legende { font-size: 8pt; margin-top: 4px; }
    .mini-tag.tag-zugesagt, .mini-tag.tag-in_planung, .mini-tag.tag-abgesagt, .legende-eintrag, .status { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .jahres-liste-titel { break-before: page; margin-top: 0; }
    .jahres-liste { display: block; }
    .jahres-monat { break-inside: avoid; margin-bottom: 8px; }
    .jahres-tabelle, .tabelle-huelle { box-shadow: none; }
    a { color: inherit; text-decoration: none; }
}

/* ---------- Lokal speichern ---------- */
.sammel-aktion { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.sammel-aktion .checkbox { margin: 0; font-size: .9rem; }
.sammel-aktion .hilfe { margin: 0; }
.spalte-auswahl { width: 32px; text-align: center; }
.spalte-auswahl input { width: 16px; height: 16px; cursor: pointer; }
.knopf:disabled { opacity: .45; cursor: default; }

/* ---------- Webseiten-Veröffentlichung ---------- */
.web { display: inline-block; font-size: .74rem; font-weight: 600; border-radius: 4px; padding: .1rem .45rem; white-space: nowrap; }
.web-ja { background: #e3eefb; color: #164766; border: 1px solid #b9d2e6; }
.web-nein { background: #f3f4f6; color: #6b7480; border: 1px dashed #c9cfd6; }
.web-veraltet { background: #fff3d6; color: #8a5a00; border: 1px solid #f0d79a; }
.web-mini { margin-top: .3rem; }
.web-box { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; padding: .6rem .75rem;
    border: 1px solid var(--rand); border-radius: var(--radius); background: var(--weiss); font-size: .9rem; }
.web-box-titel { font-weight: 700; color: var(--text-hell); }
.zaehler-hinweis { background: #e0a82e; color: #3d2900; }
.web-kacheln { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.web-kachel { flex: 1 1 170px; background: var(--weiss); border: 1px solid var(--rand); border-radius: var(--radius); padding: .75rem 1rem;
    text-decoration: none; color: var(--text-hell); font-size: .85rem; box-shadow: var(--schatten); }
.web-kachel .zahl { display: block; font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.web-kachel.aktiv { border-color: var(--primaer); box-shadow: 0 0 0 1px var(--primaer); }
a.web-kachel:hover { border-color: var(--primaer); color: var(--text); }
.kachel-ja .zahl { color: #1f5f8b; }
.kachel-nein .zahl { color: #8a5a00; }
.kachel-veraltet { background: #fffaf0; }
.kachel-veraltet .zahl { color: #b07600; }
.web-filter { align-items: center; margin-bottom: 1rem; }
.web-filter label { font-size: .85rem; font-weight: 600; color: var(--text-hell); }
.warn-box ul { margin: .4rem 0 0; }
.warn-box li { margin: .2rem 0; }
.zeile-offen td:nth-child(3) a { font-weight: 600; }

/* ---------- Responsive: Tabellen als Karten, Touch-Ziele, Formulare ---------- */
@media (max-width: 900px) {
    .tabelle-huelle:has(.tabelle-karten) { background: none; border: 0; box-shadow: none; overflow: visible; }
    .tabelle-karten, .tabelle-karten tbody, .tabelle-karten tr, .tabelle-karten td { display: block; width: 100%; }
    .tabelle-karten thead { display: none; }
    .tabelle-karten tr {
        position: relative; background: var(--weiss); border: 1px solid var(--rand); border-radius: var(--radius);
        box-shadow: var(--schatten); margin-bottom: .75rem; padding: .75rem .9rem .8rem;
    }
    .tabelle-karten tr.inaktiv { opacity: .7; }
    .tabelle-karten td { border: 0; padding: .2rem 0; text-align: left; }
    .tabelle-karten td[data-label] { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; }
    .tabelle-karten td[data-label]::before { content: attr(data-label); flex: 0 0 6.5rem; font-size: .75rem; font-weight: 700;
        text-transform: uppercase; letter-spacing: .03em; color: var(--text-hell); }
    .tabelle-karten td:empty { display: none; }
    .tabelle-karten .karte-bild-zelle { float: right; width: auto; margin: 0 0 .3rem .6rem; padding: 0; }
    .tabelle-karten .karte-bild-zelle img { width: 90px; height: 50px; }
    .tabelle-karten .karte-titel { font-size: 1.02rem; font-weight: 600; padding-bottom: .4rem; text-align: left; overflow-wrap: anywhere; }
    .tabelle-karten .spalte-auswahl { position: absolute; left: .9rem; top: .9rem; width: auto; padding: 0; }
    .tabelle-karten tr:has(.spalte-auswahl) .karte-titel { padding-left: 1.9rem; }
    .tabelle-karten .karte-aktionen { clear: both; display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-start;
        white-space: normal; border-top: 1px solid var(--rand); margin-top: .5rem; padding-top: .6rem; }
    .tabelle-karten .karte-aktionen form.inline { display: contents; }
    .tabelle-karten .status-wechsel { margin: 0; }
}
@media (min-width: 600px) and (max-width: 900px) {
    /* Tablet: Karten zweispaltig */
    .tabelle-karten tbody { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
    .tabelle-karten tr { margin-bottom: 0; }
}
@media (max-width: 760px) {

    /* Touch-Ziele mindestens 40 px hoch */
    .knopf, .knopf-klein, select, input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=tel], input[type=search] { min-height: 40px; }
    .editor-knopf { min-width: 38px; height: 38px; }
    .navigation a, .navigation .link-knopf { padding: .65rem .7rem; }
    input[type=checkbox] { width: 20px; height: 20px; }

    /* Formulare */
    .feld-gruppe { grid-template-columns: 1fr 1fr; }
    .feld-gruppe-titel { grid-template-columns: 1fr; }
    .feld-gruppe .feld-schmal { max-width: none; }
    .feld-gruppe > .feld, .feld input, .feld select { min-width: 0; }
    input[type=date], input[type=time] { font-size: .95rem; padding-left: .45rem; padding-right: .3rem; }
    .editor-flaeche { min-height: 220px; }
    .formular.karte, .karte { padding: 1rem; }
    .bild-vorschau { width: 100%; max-width: 360px; }
    .aktionen .knopf { flex: 1 1 auto; }

    /* Filterleisten untereinander */
    .web-filter { display: grid; grid-template-columns: 1fr; gap: .3rem; }
    .web-filter select { width: 100%; }
    .filter { width: 100%; }
    .filter select { flex: 1 1 140px; min-width: 0; }
    .kalender-aktionen { width: 100%; }
    .reiter-filter { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .reiter-filter a { white-space: nowrap; }
    .seiten-kopf .knopf { width: 100%; }
    h1 { font-size: 1.5rem; }
}
@media (max-width: 400px) {
    .feld-gruppe { grid-template-columns: 1fr; }
    .feld-gruppe:has(input[type=date]) { grid-template-columns: 1fr 1fr; }
    .tabelle-karten td[data-label]::before { flex-basis: 5.5rem; }
}

/* ---------- Registrierung & Rollen ---------- */
.honigtopf { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.einverstanden { align-items: flex-start; font-size: .88rem; line-height: 1.45; }
.einverstanden input { margin-top: .2rem; flex-shrink: 0; }
.login-registrieren { margin: 1rem 0 .25rem; text-align: center; font-weight: 600; }
.registrierung-danke { text-align: center; }
.registrierungen { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
@media (max-width: 420px) { .registrierungen { grid-template-columns: 1fr; } }
.registrierung-kopf { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: .75rem; }
.registrierung-kopf h2 { margin: 0 0 .2rem; }
.registrierung-bild { width: 135px; height: 75px; object-fit: cover; border-radius: 6px; }
.registrierung-aktionen { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; margin-top: 1rem; border-top: 1px solid var(--rand); padding-top: .9rem; }
.ablehnen summary { list-style: none; }
.ablehnen summary::-webkit-details-marker { display: none; }
.ablehnen[open] { flex-basis: 100%; }
.ablehnen[open] summary { margin-bottom: .6rem; }
.abzeichen.rolle-verwalter { background: #ece6fa; color: #4b2f8f; }
.registrierungen > * { min-width: 0; }
.eckdaten dd { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .eckdaten { grid-template-columns: 1fr; gap: 0; } .eckdaten dd { margin-bottom: .45rem; } }

/* ---------- Bildquelle (eigenes Bild / Vereinsbild / Avatar) ---------- */
.bild-quelle { margin: 0 0 .5rem; font-size: .88rem; font-weight: 600; }
.bild-quelle-eigen { color: var(--erfolg); }
.bild-quelle-verein, .bild-quelle-avatar { color: var(--text-hell); font-weight: 400; }

/* Protokoll */
.filterleiste { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem .75rem; align-items: end; margin-bottom: 1rem; }
.filterleiste .feld { margin: 0; min-width: 0; }
.filterleiste .feld-breit { grid-column: span 2; }
.filterleiste .aktionen { margin: 0; }
.protokoll-details { font-size: .85rem; color: var(--text-hell); max-width: 38rem; overflow-wrap: anywhere; }
.protokoll td { vertical-align: top; }
.protokoll-aktion-geloescht, .protokoll-aktion-abgelehnt { background: #fbebeb; color: #b42318; }
.protokoll-aktion-angelegt, .protokoll-aktion-freigegeben { background: #e5f4e4; color: #1e6b2a; }
.abzeichen-ohne-zugang { background: #f9eeda; color: #8a5a00; margin-top: .2rem; }
.zugang-wahl { border: 0; padding: 0; margin: 0 0 .75rem; min-width: 0; }
.zugang-wahl .checkbox { align-items: flex-start; }
.zugang-wahl .checkbox span { flex: 1; min-width: 0; }
.seitennavigation { display: flex; gap: .75rem; align-items: center; justify-content: center; margin: 1rem 0; }
.meta-info { font-size: .85rem; color: var(--text-hell); margin: .25rem 0 1rem; }
.filterleiste input[type=search] { width: 100%; }
@media (max-width: 600px) {
    .filterleiste { grid-template-columns: 1fr 1fr; }
    .filterleiste .feld-breit, .filterleiste .aktionen { grid-column: 1 / -1; }
}
.hilfe code { overflow-wrap: anywhere; word-break: break-all; }
