:root {
  --primary: #1f6f5c;
  --primary-dark: #17574a;
  --primary-soft: #e3f1ec;
  --accent: #f2b632;
  --bg: #f5f6f3;
  --surface: #ffffff;
  --text: #1f2a28;
  --muted: #66736f;
  --border: #dfe4e1;
  --danger: #b4372f;
  --danger-soft: #fbe9e7;
  --success: #2e7d32;
  --success-soft: #e6f4e7;
  --warning-soft: #fff5d6;
  --info-soft: #e7f0fb;
  --on-primary: #ffffff;
  --brand: #1f6f5c;
  --on-brand: #ffffff;
  --on-accent: #17574a;
  --input-bg: #ffffff;
  --input-border: #c9d1cd;
  --table-head: #fafbfa;
  --row-hover: #f8faf9;
  --row-highlight: #fffaea;
  --gold-bg: #fdf0c8;
  --gold-text: #6b4d00;
  --red-bg: #fde2e1;
  --red-text: #8b1e17;
  --alert-success-border: #c4e3c6;
  --alert-error-border: #f1c4bf;
  --alert-info-border: #c9dcf3;
  --alert-warning-border: #f2df9c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 40, 35, .06), 0 2px 8px rgba(20, 40, 35, .04);
  --sidebar: 236px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- Dunkles Design: explizit gewählt oder automatisch nach Geräteeinstellung ---- */
:root[data-theme="dunkel"] {
  --primary: #4fb79c; --primary-dark: #7fd3bc; --primary-soft: #1d3a33; --accent: #f2b632;
  --bg: #121715; --surface: #1b2220; --text: #e3ebe8; --muted: #9aa8a3; --border: #2e3936;
  --danger: #ef7d73; --danger-soft: #3a1f1d; --success: #6fcf76; --success-soft: #1c3320;
  --warning-soft: #3a3118; --info-soft: #1b2a3b; --on-primary: #0f1513;
  --input-bg: #141a18; --input-border: #3a4643; --table-head: #1f2826; --row-hover: #222c29; --row-highlight: #33301c;
  --gold-bg: #3f3415; --gold-text: #f4d27a; --red-bg: #43211e; --red-text: #f3a39b;
  --alert-success-border: #2e5133; --alert-error-border: #5e2f2a; --alert-info-border: #2c4561; --alert-warning-border: #5b4b20;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    --primary: #4fb79c; --primary-dark: #7fd3bc; --primary-soft: #1d3a33; --accent: #f2b632;
    --bg: #121715; --surface: #1b2220; --text: #e3ebe8; --muted: #9aa8a3; --border: #2e3936;
    --danger: #ef7d73; --danger-soft: #3a1f1d; --success: #6fcf76; --success-soft: #1c3320;
    --warning-soft: #3a3118; --info-soft: #1b2a3b; --on-primary: #0f1513;
    --input-bg: #141a18; --input-border: #3a4643; --table-head: #1f2826; --row-hover: #222c29; --row-highlight: #33301c;
    --gold-bg: #3f3415; --gold-text: #f4d27a; --red-bg: #43211e; --red-text: #f3a39b;
    --alert-success-border: #2e5133; --alert-error-border: #5e2f2a; --alert-info-border: #2c4561; --alert-warning-border: #5b4b20;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="hell"] { color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); line-height: 1.5; font-size: 15px; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
code { background: var(--primary-soft); padding: .1em .35em; border-radius: 4px; font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ---- Layout ---- */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; gap: 1rem; padding: 0 1rem; z-index: 20; }
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 600; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: .85rem; flex-shrink: 0; }
.topbar-user { margin-left: auto; display: flex; gap: .6rem; align-items: center; font-size: .9rem; }
.burger { display: none; cursor: pointer; font-size: 1.4rem; }
.sidebar { position: fixed; top: 56px; bottom: 0; left: 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 1rem .6rem; z-index: 10; }
.sidebar a, .sidebar .link { display: block; padding: .45rem .75rem; border-radius: 7px; color: var(--text); text-decoration: none; }
.sidebar a:hover, .sidebar .link:hover { background: var(--bg); }
.sidebar a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.nav-group { padding-bottom: .75rem; margin-bottom: .75rem; border-bottom: 1px solid var(--border); }
.nav-group:last-child { border-bottom: 0; }
.nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .2rem .75rem .35rem; }
.logout { margin: 0; }
.link { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; text-align: left; color: var(--danger) !important; }
.content { flex: 1; padding: 1.5rem; width: 100%; max-width: 1200px; }
body.app .content { margin: 56px 0 0 var(--sidebar); width: auto; max-width: 1200px; }
body.app .site-footer { margin-left: var(--sidebar); }
body.public .content { margin: 0 auto; }
.public-header { background: var(--brand); color: var(--on-brand); padding: .8rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.public-header nav { display: flex; align-items: center; gap: 1rem; }
.public-header nav a { color: var(--on-brand); text-decoration: none; }
.public-header .btn { background: var(--accent); color: var(--on-accent); }
.site-footer { padding: 1rem 1.5rem; color: var(--muted); font-size: .85rem; display: flex; gap: 1.25rem; flex-wrap: wrap; border-top: 1px solid var(--border); }
.site-footer a { color: var(--muted); }
.site-footer .version { margin-left: auto; }
.logo-img { height: 36px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.color-row label { flex: 0 0 auto; }
input[type=color] { width: 64px; height: 40px; padding: 2px; cursor: pointer; }
.presets { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.preset { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; }
.preset-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: inline-block; }
.logo-preview { max-height: 80px; max-width: 260px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px; }
.design-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.design-preview .dp-head { padding: .7rem 1rem; font-weight: 600; display: flex; gap: .6rem; align-items: center; }
.design-preview .dp-body { padding: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; background: var(--surface); }
.mail-preview { border: 1px solid var(--border); border-radius: 8px; background: var(--bg); padding: 1rem; }
.var-list { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; font-size: .85rem; margin: 0; }
.var-list dt code { cursor: copy; }
.var-list dd { margin: 0; color: var(--muted); }
.progress-line { height: 10px; width: 100%; }

/* ---- Bausteine ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.narrow { max-width: 440px; margin: 2rem auto; }
.narrow-lg { max-width: 760px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.08rem; color: var(--muted); margin-top: 0; }
.pre { white-space: pre-line; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero h1 { font-size: 2rem; }
.hero .lead { max-width: 640px; margin: 0 auto 1.5rem; }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; border-radius: 8px; border: 1px solid transparent; background: var(--primary); color: var(--on-primary); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--primary-dark); border-color: var(--border); }
.btn-secondary:hover { background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--primary-dark); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { filter: brightness(.9); }
.btn-danger { color: var(--on-primary); }
.btn-small { padding: .3rem .6rem; font-size: .85rem; }
.btn-large { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
form.inline { display: inline; }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert-success { background: var(--success-soft); border-color: var(--alert-success-border); }
.alert-error { background: var(--danger-soft); border-color: var(--alert-error-border); }
.alert-info { background: var(--info-soft); border-color: var(--alert-info-border); }
.alert-warning { background: var(--warning-soft); border-color: var(--alert-warning-border); }
.credentials dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: .6rem 0 0; }
.credentials dd { margin: 0; }
.credentials .pw { font-size: 1.1rem; letter-spacing: .05em; }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: .78rem; font-weight: 600; vertical-align: middle; }
.badge-gold { background: var(--gold-bg); color: var(--gold-text); font-size: .9rem; }
.badge-ok { background: var(--success-soft); color: var(--success); }
.mail-versendet { background: var(--success-soft); color: var(--success); }
.mail-fehlgeschlagen { background: var(--danger-soft); color: var(--danger); }
.mail-nicht-versendet { background: var(--warning-soft); color: var(--gold-text); }
.role-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.role-admin { background: var(--red-bg); color: var(--red-text); }
.role-vorstand { background: var(--gold-bg); color: var(--gold-text); }
.role-mitglied { background: var(--primary-soft); color: var(--primary-dark); }
.topbar .role-badge { background: color-mix(in srgb, var(--on-brand) 18%, transparent); color: var(--on-brand); }
.status { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; vertical-align: middle; }
.status-aktiv { background: var(--success-soft); color: var(--success); }
.status-passiv { background: var(--warning-soft); color: var(--gold-text); }
.status-ausgetreten { background: var(--bg); color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); display: flex; flex-direction: column; }
a.stat:hover { border-color: var(--primary); }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-alert .stat-value { color: var(--danger); }

.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.tabs a { padding: .5rem 1rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--primary-dark); border-color: var(--primary); font-weight: 600; }

/* ---- Tabellen ---- */
.table-wrap { overflow-x: auto; padding: 0; }
.table-wrap > h2 { padding: 1.25rem 1.25rem 0; }
.table-wrap .form-actions { padding: 0 1.25rem 1.25rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--table-head); }
.table th.right, .table td.right { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--row-hover); }
.table tr.inactive td { opacity: .55; }
.table tr.highlight td { background: var(--row-highlight); }
.card > .table { margin-top: .5rem; }
.w-50 { width: 50%; }
progress.bar { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 5px; background: var(--bg); overflow: hidden; }
progress.bar::-webkit-progress-bar { background: var(--bg); border-radius: 5px; }
progress.bar::-webkit-progress-value { background: var(--primary); border-radius: 5px; }
progress.bar::-moz-progress-bar { background: var(--primary); border-radius: 5px; }

/* ---- Formulare ---- */
.form label, .filters label, .inline-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; font-weight: 500; margin-bottom: .8rem; flex: 1; min-width: 0; }
.form label.check, label.check { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 400; font-size: .92rem; }
label.check input { margin-top: .2rem; }
input, select, textarea { font: inherit; font-size: .95rem; padding: .5rem .65rem; border: 1px solid var(--input-border); border-radius: 7px; background: var(--input-bg); color: var(--text); width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea { resize: vertical; }
fieldset { margin: 0 0 1rem; }
fieldset.card { border: 1px solid var(--border); }
legend { font-weight: 700; font-size: 1.05rem; padding: 0 .35rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; }
.row > label { flex: 1 1 160px; }
.row > .w-25 { flex: 0 1 130px; }
.row > .w-33 { flex: 0 1 220px; }
.w-auto { width: auto; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .8rem; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { width: auto; }
.filters label.check { margin: 0; flex: 0 0 auto; }
.inline-form { align-items: flex-end; }
.inline-form .btn { margin-bottom: .8rem; }
.inline-form.compact { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-form.compact select { width: auto; padding: .3rem .5rem; }
.inline-form.compact label, .inline-form.compact .btn { margin: 0; flex: 0 0 auto; }
.choice-list { display: grid; gap: .5rem; margin-bottom: 1rem; }
.form label.choice, label.choice { flex-direction: row; align-items: flex-start; gap: .65rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 400; margin-bottom: .5rem; }
label.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
label.choice input { margin-top: .25rem; }
.mandate { background: var(--bg); border-radius: 8px; padding: .9rem 1rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Listen & Termine ---- */
dl.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: .4rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .88rem; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.roles-legend { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0; }
.roles-legend dd { margin: 0; color: var(--muted); font-size: .9rem; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--border); }
ul.plain li:last-child { border: 0; }
.event-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.event-list li { display: flex; gap: .75rem; align-items: center; }
.date-chip { background: var(--primary-soft); color: var(--primary-dark); border-radius: 8px; padding: .3rem .5rem; font-weight: 700; font-size: .85rem; min-width: 56px; text-align: center; }
.date-chip.big { font-size: 1.15rem; padding: .6rem .7rem; min-width: 76px; display: flex; flex-direction: column; }
.date-chip small { font-weight: 500; font-size: .75rem; }
.card.event { display: flex; gap: 1rem; align-items: flex-start; }
.event-body { flex: 1; min-width: 0; }
.event-body h2 { margin-bottom: .2rem; }
.event-body p { margin: .2rem 0; }
.event-actions { display: flex; gap: .25rem; }
.news-teaser { border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin-bottom: .75rem; }
.news-teaser:last-child { border: 0; margin-bottom: 0; }
.news-teaser h3 { margin: 0; }
.news-teaser p { margin: .2rem 0; }
.prose { max-width: 780px; }

/* ---- Profilbild, Mitgliederbereich ---- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.avatar-sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar-md { width: 44px; height: 44px; font-size: .95rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar-xl { width: 112px; height: 112px; font-size: 2.2rem; }
.topbar .avatar-initials { background: var(--accent); color: var(--on-accent); }
.topbar-profile { display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; }
.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 0; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; }
.avatar-edit { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.avatar-edit > div { flex: 1; min-width: 200px; }
.name-cell { display: flex; align-items: center; gap: .6rem; }
.name-cell p { margin: 0; }
.theme-choice { display: grid; gap: .5rem; margin-bottom: 1rem; }
.theme-swatch { width: 38px; height: 26px; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0; }
.theme-hell .theme-swatch { background: linear-gradient(135deg, #ffffff 50%, #e3f1ec 50%); }
.theme-dunkel .theme-swatch { background: linear-gradient(135deg, #1b2220 50%, #1d3a33 50%); }
.theme-auto .theme-swatch { background: linear-gradient(135deg, #ffffff 50%, #1b2220 50%); }
details.mandate { margin: .5rem 0 .8rem; }
details summary { cursor: pointer; }
.highlight-box { background: var(--warning-soft); padding: .5rem; border-radius: 6px; }
.signature-box { border: 1px dashed var(--border); border-radius: 8px; padding: .8rem; margin-bottom: .8rem; display: grid; gap: .5rem; }
.signature-img { max-width: 260px; max-height: 90px; background: #fff; border-radius: 4px; padding: 4px; }
.inline-details { display: inline-block; position: relative; }
.inline-details summary { list-style: none; display: inline-flex; }
.inline-details summary::-webkit-details-marker { display: none; }
.popover { position: absolute; right: 0; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .75rem; box-shadow: var(--shadow); width: 260px; text-align: left; }
ul.changes { margin: .3rem 0 0; padding-left: 1.1rem; }
ul.changes del { color: var(--danger); }
ul.changes ins { color: var(--success); text-decoration: none; font-weight: 600; }
.mail-body { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; }

/* ---- Import ---- */
.popover.menu { display: grid; gap: .1rem; width: 270px; }
.popover.menu a { padding: .45rem .5rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.popover.menu a:hover { background: var(--primary-soft); }
.badge.import-neu { background: var(--success-soft); color: var(--success); }
.badge.import-aenderung { background: var(--info-soft); color: var(--primary-dark); }
.badge.import-fehler { background: var(--danger-soft); color: var(--danger); }
.table tr.import-error td { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }

/* ---- Neuigkeiten ---- */
.cat-1 { --cat: #2388c2; } .cat-2 { --cat: #2e9d4a; } .cat-3 { --cat: #e0841a; }
.cat-4 { --cat: #d6303a; } .cat-5 { --cat: #7a4fc4; } .cat-6 { --cat: #0f8f8a; } .cat-0 { --cat: var(--primary); }
.cat-badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  color: var(--cat); background: color-mix(in srgb, var(--cat) 14%, var(--surface)); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: .88rem; background: var(--surface); }
.chip:hover { border-color: var(--cat, var(--primary)); }
.chip[class*="cat-"]:not(.active) { border-color: color-mix(in srgb, var(--cat) 35%, var(--border)); color: color-mix(in srgb, var(--cat) 70%, var(--text)); }
.chip[class*="cat-"]:not(.active) { border-color: color-mix(in srgb, var(--cat) 35%, var(--border)); color: color-mix(in srgb, var(--cat) 70%, var(--text)); }
.chip.active { background: var(--cat, var(--primary)); border-color: var(--cat, var(--primary)); color: #fff; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem; }
.news-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.news-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(20, 40, 35, .12); }
.news-card.pinned { border-color: var(--accent); }
.news-card.draft { opacity: .75; border-style: dashed; }
.news-card-media { display: block; aspect-ratio: 16 / 9; background: var(--primary-soft); overflow: hidden; }
.news-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card-media.no-image { display: grid; place-items: center; background: linear-gradient(135deg, var(--cat), color-mix(in srgb, var(--cat) 55%, #000)); text-decoration: none; }
.news-card-initial { font-size: 3rem; font-weight: 800; color: rgba(255, 255, 255, .85); }
.news-card-body { padding: 1rem 1.15rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.news-card-body h2 { margin: .2rem 0 0; font-size: 1.12rem; line-height: 1.3; }
.news-card-body h2 a { color: var(--text); text-decoration: none; }
.news-card-body h2 a:hover { color: var(--primary); }
.news-teaser-text { margin: 0; color: var(--muted); font-size: .93rem; flex: 1; }
.news-card-body p.small { margin: 0; }
.news-meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.badge-draft { background: var(--warning-soft); color: var(--gold-text); }
@media (min-width: 900px) {
  .news-card.featured { grid-column: 1 / -1; flex-direction: row; }
  .news-card.featured .news-card-media { flex: 0 0 55%; aspect-ratio: auto; min-height: 280px; }
  .news-card.featured .news-card-body { padding: 1.6rem; justify-content: center; }
  .news-card.featured h2 { font-size: 1.6rem; }
  .news-card.featured .news-teaser-text { flex: 0; font-size: 1.02rem; }
}
.news-article { max-width: 780px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem 2rem 2rem; box-shadow: var(--shadow); }
.news-article h1 { font-size: 2rem; margin: .5rem 0 .8rem; }
.news-cover { width: calc(100% + 4rem); margin: -.5rem -2rem 1.2rem; max-height: 420px; object-fit: cover; display: block; }
.news-byline { display: flex; align-items: center; gap: .7rem; padding-bottom: 1rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
.news-byline .actions { margin-left: auto; }
.news-lead { font-size: 1.15rem; color: var(--muted); line-height: 1.55; }
.news-more { max-width: 780px; margin: 1.5rem auto 0; }
.news-grid.compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.news-mini { display: flex; gap: .7rem; align-items: center; padding: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.news-mini img, .news-mini-ph { width: 64px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.news-mini-ph { background: var(--cat); }
.news-teaser-link { display: flex; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.news-teaser-link:last-child { border-bottom: 0; }
.news-teaser-link img { width: 92px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.news-teaser-link:hover strong { color: var(--primary); }

/* Öffentliche Neuigkeiten */
.badge-public { background: var(--info-soft); color: var(--primary-dark); text-decoration: none; }
.public-check { background: var(--info-soft); padding: .5rem .6rem; border-radius: 8px; }
.home-news { margin: 0 0 2rem; }
.home-news h2 { margin: 0; }
.news-card-body h3 { margin: .2rem 0 0; font-size: 1.08rem; line-height: 1.3; }
.news-card-body h3 a { color: var(--text); text-decoration: none; }
.news-card-body h3 a:hover { color: var(--primary); }
.news-byline .logo-img { height: 40px; }

/* Inhalt (Editor und Darstellung) */
.news-content { font-size: 1.04rem; line-height: 1.7; overflow-wrap: anywhere; }
.news-content > :first-child { margin-top: 0; }
.news-content h1, .news-content h2 { font-size: 1.45rem; margin: 1.6rem 0 .6rem; }
.news-content h3 { font-size: 1.2rem; margin: 1.3rem 0 .5rem; }
.news-content p { margin: 0 0 1rem; }
.news-content img { max-width: 100%; height: auto; border-radius: 10px; }
.news-content blockquote { margin: 1.2rem 0; padding: .6rem 1.1rem; border-left: 4px solid var(--accent); background: var(--primary-soft); border-radius: 0 10px 10px 0; font-style: italic; }
.news-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.news-content th, .news-content td { border: 1px solid var(--border); padding: .5rem .7rem; text-align: left; }
.news-content th { background: var(--primary-soft); }
.news-content iframe, .news-content .ql-video { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; display: block; margin: 1rem 0; }
.news-content .ql-align-center { text-align: center; } .news-content .ql-align-right { text-align: right; } .news-content .ql-align-justify { text-align: justify; }
.news-content li[data-list="bullet"] { list-style-type: disc; } .news-content li[data-list="ordered"] { list-style-type: decimal; }
.news-content .ql-ui { display: none; }
.news-box { padding: 1rem 1.2rem; border-radius: 12px; margin: 1.2rem 0; border-left: 5px solid var(--primary); background: var(--primary-soft); }
.news-box > :last-child { margin-bottom: 0; } .news-box h3 { margin-top: 0; }
.news-box.success { border-color: var(--success); background: var(--success-soft); }
.news-box.warning { border-color: var(--accent); background: var(--warning-soft); }
.news-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; margin: 1rem 0; }
.news-button { display: inline-block; padding: .65rem 1.3rem; border-radius: 999px; background: var(--primary); color: var(--on-primary) !important; text-decoration: none; font-weight: 600; }
.news-button:hover { filter: brightness(1.08); }
.news-figure { margin: 1.2rem 0; } .news-figure img { width: 100%; }
.news-figure figcaption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: .4rem; }
.news-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin: 1.2rem 0; }
.news-facts > div { background: var(--primary-soft); border-radius: 12px; padding: 1rem; text-align: center; }
.news-facts strong { display: block; font-size: 1.7rem; color: var(--primary); }
.news-facts span { color: var(--muted); font-size: .9rem; }
.news-video iframe { width: 100%; aspect-ratio: 16 / 9; }

/* Editor */
.news-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.input-large { font-size: 1.2rem !important; font-weight: 600; }
.editor-tabs { margin: .8rem 0 0; }
.tab-btn { background: none; border: 0; border-bottom: 2px solid transparent; padding: .5rem 1rem; font: inherit; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tab-btn.active { color: var(--primary-dark); border-color: var(--primary); font-weight: 600; }
#quill-editor { min-height: 360px; background: var(--input-bg); }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--input-border) !important; }
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; background: var(--table-head); }
.ql-container.ql-snow { border-radius: 0 0 8px 8px; font-family: inherit; font-size: 1rem; }
.ql-editor { min-height: 360px; color: var(--text); }
.ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.ql-snow .ql-stroke { stroke: var(--text); } .ql-snow .ql-fill { fill: var(--text); } .ql-snow .ql-picker { color: var(--text); }
.ql-snow .ql-picker-options, .ql-snow .ql-tooltip { background: var(--surface); color: var(--text); border-color: var(--border); }
.ql-snow .ql-tooltip input[type=text] { background: var(--input-bg); color: var(--text); border-color: var(--input-border); }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.5; tab-size: 2; min-height: 380px; }
.snippet-bar { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .6rem 0; }
.file-btn { cursor: pointer; }
.preview-box { border: 1px dashed var(--border); border-radius: 10px; padding: 1.2rem; min-height: 200px; }
.cover-preview { width: 100%; border-radius: 8px; margin-bottom: .5rem; }
@media (max-width: 900px) {
  .news-form-grid { grid-template-columns: 1fr; }
  .news-article { padding: 1rem 1.1rem 1.5rem; }
  .news-cover { width: calc(100% + 2.2rem); margin: -.5rem -1.1rem 1rem; }
  .news-article h1 { font-size: 1.5rem; }
}

/* ---- Responsiv ---- */
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .burger { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  body.app .content, body.app .site-footer { margin-left: 0; }
  .content { padding: 1rem; }
}
@media (max-width: 600px) {
  .hide-sm { display: none; }
  h1 { font-size: 1.35rem; }
  .card.event { flex-direction: column; }
  dl.kv { grid-template-columns: 1fr; gap: 0 1rem; }
  dl.kv dd { margin-bottom: .4rem; }
}

/* ---- Druck (z. B. Geburtstags- und Jubiläumslisten) ---- */
@media print {
  .topbar, .sidebar, .site-footer, .actions, .no-print, .tabs, .public-header, .btn, .alert { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  body.app .content { margin: 0; padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .hide-sm { display: table-cell !important; }
  a { color: inherit; text-decoration: none; }
}
