:root {
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-2: #eef2ea;
  --fg: #1d2a1f;
  --muted: #5d6b5f;
  --border: #d9e0d4;
  --accent: #2f6b3a;
  --accent-fg: #ffffff;
  --accent-soft: #e2efe3;
  --danger: #b3261e;
  --warn: #9a6200;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(20 40 20 / 6%), 0 6px 18px rgb(20 40 20 / 6%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121712;
    --surface: #1a211b;
    --surface-2: #222b23;
    --fg: #e6ece5;
    --muted: #9eaa9f;
    --border: #2f3a30;
    --accent: #7cc48a;
    --accent-fg: #0f1a11;
    --accent-soft: #24382a;
    --danger: #f2827a;
    --warn: #e7b35a;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Luftbild der Anlage als zarter, fester Hintergrund am rechten Rand */
body::before {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  top: 0; right: 0; bottom: 0; width: min(620px, 48vw);
  background: url("./img/anlage-hintergrund.jpg") center top / cover no-repeat;
  opacity: .16; filter: saturate(.7);
  -webkit-mask-image: linear-gradient(to left, #000 35%, transparent);
  mask-image: linear-gradient(to left, #000 35%, transparent);
}
@media (prefers-color-scheme: dark) { body::before { opacity: .1; } }
@media (max-width: 760px) {
  body::before { width: 100%; opacity: .08; -webkit-mask-image: none; mask-image: none; }
}
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }

.container { width: min(1100px, 100% - 32px); margin: 0 auto; }
main.container { flex: 1; padding: 24px 0 48px; outline: none; }

.skip-link { position: absolute; left: -999px; top: 8px; }
.skip-link:focus { left: 8px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* ---------- Kopfbereich */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  width: min(1100px, 100% - 32px); margin: 0 auto;
  display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; margin-right: auto; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.nav a {
  position: relative;
  padding: 7px 10px; border-radius: 999px; text-decoration: none; color: var(--fg); font-size: .9rem;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .badge { position: absolute; top: 0; right: -2px; }
.menu-toggle { display: none; }

@media (max-width: 960px) {
  .menu-toggle {
    display: inline-flex; border: 1px solid var(--border); background: var(--surface); color: var(--fg);
    border-radius: 10px; padding: 8px 12px; font: inherit;
  }
  .nav { display: none; width: 100%; padding-bottom: 12px; }
  .nav.open { display: flex; flex-direction: column; align-items: stretch; }
  .nav .badge { position: static; margin-left: 6px; }
}

.banner-strip {
  background: var(--accent); color: var(--accent-fg); text-align: center; padding: 8px 16px; font-weight: 600;
}

/* ---------- Bausteine */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.card.flat { box-shadow: none; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }

.hero {
  position: relative; overflow: hidden; border-radius: var(--radius); margin-bottom: 16px;
  background:
    linear-gradient(100deg, rgb(18 44 24 / 88%) 0%, rgb(18 44 24 / 62%) 45%, rgb(18 44 24 / 15%) 100%),
    url("./img/anlage-luftbild.jpg") center 40% / cover;
  color: #fff; padding: 56px 32px 40px; min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); max-width: 640px; }
.hero p { max-width: 600px; font-size: 1.05rem; white-space: pre-line; opacity: .95; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; letter-spacing: .02em;
  opacity: .9; margin-bottom: 10px;
}
.hero-kicker .icon { width: 18px; height: 18px; }
.hero .row { margin-top: 6px; }
.button.light { background: #fff; border-color: #fff; color: #1f4a29; }
.button.ghost.light { background: transparent; color: #fff; border-color: rgb(255 255 255 / 70%); }

/* ---------- Icons */
.icon {
  width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle;
}
.head-icon {
  flex: none; width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.head-icon .icon { width: 24px; height: 24px; }
.with-icon { display: flex; align-items: center; gap: 8px; }
.with-icon .icon { color: var(--accent); }
.empty .empty-icon { width: 40px; height: 40px; color: var(--accent); opacity: .55; stroke-width: 1.3; margin-bottom: 6px; }
.empty p { margin: 0; }
.avatar .icon { width: 20px; height: 20px; }
.avatar.sm .icon { width: 16px; height: 16px; }

.features { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature { padding: 4px 4px 0; }
.feature .icon { width: 30px; height: 30px; color: var(--accent); stroke-width: 1.4; margin-bottom: 6px; }
.feature h3 { margin-bottom: 4px; }

.split { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.split-img { margin: 0; }
.split-img img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; cursor: zoom-in; }
.split-img figcaption { margin-top: 6px; }
@media (max-width: 640px) {
  .split { grid-template-columns: 1fr; }
  .split-img img { aspect-ratio: 16 / 9; }
}

.gallery-hero { padding: 0; overflow: hidden; }
.gallery-hero img { width: 100%; height: 220px; object-fit: cover; display: block; cursor: zoom-in; }
.gallery-hero figcaption { padding: 8px 16px; }

.login-card { max-width: 860px; margin: 24px auto; padding: 0; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; }
.login-img {
  background:
    linear-gradient(180deg, rgb(18 44 24 / 20%), rgb(18 44 24 / 55%)),
    url("./img/anlage-hochkant.jpg") center / cover;
  min-height: 420px;
}
.login-form { padding: 28px; }
.login-form .head-icon { margin-bottom: 12px; }
@media (max-width: 700px) {
  .login-card { grid-template-columns: 1fr; }
  .login-img { min-height: 140px; }
}

.tile {
  display: block; text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.tile:hover { border-color: var(--accent); }
.tile strong { display: block; font-size: 1.05rem; }
.tile .icon { color: var(--accent); float: right; width: 24px; height: 24px; opacity: .8; }
.tile .num { font-size: 1.6rem; font-weight: 700; color: var(--accent); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.button:hover { filter: brightness(1.08); }
.button.ghost { background: transparent; color: var(--accent); }
.button.small { padding: 5px 10px; font-size: .875rem; }
.button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.button:disabled { opacity: .55; cursor: default; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link-button.danger { color: var(--danger); }

form.form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field label, .field .label { font-weight: 600; font-size: .9rem; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=time],
input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--fg); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: center; }
.error { color: var(--danger); }

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700;
}
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
}
.pill.green { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem;
}
.avatar.lg { width: 88px; height: 88px; font-size: 1.8rem; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button {
  border: 1px solid var(--border); background: var(--surface); color: var(--fg); font: inherit;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.tabs button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ---------- Pinnwand */
.post-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.post-head .meta { line-height: 1.2; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-image { margin-top: 10px; border-radius: 10px; max-height: 520px; width: 100%; object-fit: cover; cursor: zoom-in; }
.post-actions { display: flex; gap: 16px; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.post-actions button { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 0; }
.post-actions button.on { color: var(--accent); font-weight: 600; }
.comments { margin-top: 10px; display: grid; gap: 8px; }
.comment { display: flex; gap: 8px; }
.comment .bubble { background: var(--surface-2); border-radius: 12px; padding: 6px 12px; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { flex: 1; }
.composer textarea { min-height: 70px; }
.preview-img { max-height: 160px; border-radius: 10px; display: block; }

/* ---------- Messenger */
.chat { display: grid; grid-template-columns: 300px 1fr; gap: 0; padding: 0; overflow: hidden; height: min(72vh, 720px); }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
.chat-list .chat-new { padding: 12px; border-bottom: 1px solid var(--border); }
.chat-item {
  display: flex; gap: 10px; align-items: center; padding: 12px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border);
}
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--accent-soft); }
.chat-item .txt { min-width: 0; flex: 1; }
.chat-item .txt span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-title { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; display: flex; gap: 10px; align-items: center; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 75%; align-self: flex-start; }
.msg .bubble { background: var(--surface-2); padding: 8px 12px; border-radius: 14px 14px 14px 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-fg); border-radius: 14px 14px 4px 14px; }
.msg .who { font-size: .75rem; color: var(--muted); margin: 0 6px 2px; }
.msg.mine .who { text-align: right; }
.chat-send { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-send textarea { min-height: 44px; height: 44px; flex: 1; }
.chat-back { display: none; }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 180px); }
  .chat.has-conv .chat-list { display: none; }
  .chat:not(.has-conv) .chat-main { display: none; }
  .chat-list { border-right: 0; }
  .chat-back { display: inline-flex; }
}

/* ---------- Kleinanzeigen & Galerie */
.ad { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ad .thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.ad .thumb .thumb-icon { width: 44px; height: 44px; opacity: .45; stroke-width: 1.2; color: var(--accent); }
.ad .thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.ad .content { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ad .price { font-weight: 700; font-size: 1.1rem; color: var(--accent); }
.ad.done { opacity: .6; }
.ad .desc { white-space: pre-wrap; overflow-wrap: anywhere; }

.photos { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.photo { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.photo .cap {
  position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; font-size: .8rem; color: #fff;
  background: linear-gradient(transparent, rgb(0 0 0 / 70%));
}
.photo .tag { position: absolute; top: 6px; left: 6px; }

.lightbox { border: 0; padding: 12px; border-radius: var(--radius); background: var(--surface); color: var(--fg); max-width: 94vw; }
.lightbox::backdrop { background: rgb(0 0 0 / 80%); }
.lightbox img { max-height: 80vh; max-width: 90vw; display: block; margin: 0 auto 8px; border-radius: 8px; }

/* ---------- Kalender */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: .8rem; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal .day {
  min-height: 86px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; font-size: .8rem;
  background: var(--surface); overflow: hidden;
}
.cal .day.other { opacity: .45; }
.cal .day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal .day .n { font-weight: 700; }
.cal .ev {
  display: block; width: 100%; text-align: left; margin-top: 2px; border: 0; border-radius: 4px; padding: 1px 4px;
  background: var(--accent-soft); color: var(--accent); font: inherit; font-size: .75rem; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal .ev.members { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
@media (max-width: 640px) {
  .cal .day { min-height: 52px; }
  .cal .ev { font-size: 0; height: 6px; padding: 0; }
}
.event-item { display: flex; gap: 14px; align-items: flex-start; }
.event-date {
  flex: none; width: 58px; text-align: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); padding: 6px 0;
  line-height: 1.1;
}
.event-date b { display: block; font-size: 1.4rem; }
.event-date span { font-size: .75rem; text-transform: uppercase; }

/* ---------- Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr.inactive td { opacity: .5; }

.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1rem; background: var(--surface-2);
  padding: 8px 12px; border-radius: 8px; display: inline-block; user-select: all;
}

.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow);
}
.toast.error { background: var(--danger); color: #fff; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); font-size: .875rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0; }

.list { padding-left: 1.2em; margin: 0; }
.list li + li { margin-top: 4px; }
.k { font-weight: 600; }

/* ---------- Mitgliederliste (untereinander) */
.member-list { padding: 8px 20px 12px; }
.member-list h2 { margin: 12px 0 4px; }
.member-list ul { list-style: none; margin: 0; padding: 0; }
.member-row {
  display: grid; grid-template-columns: 52px auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.member-row:first-child { border-top: 0; }
.member-row.inactive { opacity: .55; }
.member-row .parz {
  font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 8px;
  text-align: center; padding: 4px 0; font-variant-numeric: tabular-nums;
}
.member-row .who { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.member-row .who .bio { flex-basis: 100%; overflow-wrap: anywhere; }
.member-row .actions { white-space: nowrap; }
@media (max-width: 560px) {
  .member-row { grid-template-columns: 44px auto 1fr; }
  .member-row .actions { grid-column: 3; white-space: normal; }
}

.positions { list-style: none; margin: 0; padding: 0; }
.positions li {
  display: grid; grid-template-columns: auto minmax(160px, 260px) 1fr auto; gap: 10px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.positions li:first-child { border-top: 0; }
.positions .order { display: flex; gap: 4px; }
@media (max-width: 640px) {
  .positions li { grid-template-columns: auto 1fr; }
  .positions .holders, .positions li > .row { grid-column: 2; }
}

/* ---------- Galerie: Alben und Foto-Ansicht */
.albums { display: grid; gap: 20px 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
/* Album als Ordner: Reiter oben, darin vier Miniaturen */
.folder { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.folder-tab {
  width: 42%; height: 14px; margin-left: 10px; border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--accent) 55%, var(--surface));
}
.folder-body {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-radius: 4px 12px 12px 12px;
  padding: 8px; box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}
.folder:hover .folder-body { border-color: var(--accent); }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.thumbs img, .thumbs .thumb-empty {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 6px; background: var(--surface-2);
}
.thumbs .thumb-empty { opacity: .5; }
.album-info { padding: 8px 4px 0; display: flex; flex-direction: column; gap: 2px; }
.album-info strong { display: flex; align-items: center; gap: 6px; }
.album-info .icon { width: 18px; height: 18px; color: var(--accent); }
.photo { cursor: zoom-in; }
.upload-details { padding: 0; }
.upload-details summary { padding: 14px 20px; cursor: pointer; font-weight: 600; color: var(--accent); }
.upload-details .card { border: 0; box-shadow: none; margin: 0; padding-top: 0; }

.viewer {
  border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--fg);
  width: min(1200px, 96vw); max-height: 92vh; overflow: hidden;
}
.viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.viewer::backdrop { background: rgb(0 0 0 / 82%); }
.viewer-img { position: relative; background: #111; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.viewer-img img { max-width: 100%; max-height: 92vh; display: block; }
.viewer .nav {
  position: absolute; top: 50%; transform: translateY(-50%); border: 0; width: 44px; height: 44px; border-radius: 50%;
  background: rgb(255 255 255 / 85%); color: #1d2a1f; font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.viewer .prev { left: 10px; }
.viewer .next { right: 10px; }
.viewer-side { padding: 16px; overflow-y: auto; max-height: 92vh; display: flex; flex-direction: column; gap: 8px; }
.viewer-side p { margin: 0; }
.viewer-tools { gap: 12px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }
@media (max-width: 800px) {
  .viewer[open] { grid-template-columns: 1fr; overflow-y: auto; }
  .viewer-img img { max-height: 60vh; }
  .viewer-side { max-height: none; }
}

/* ---------- Admin */
.tile.stat .num { font-size: 1.5rem; }
.tile.stat.warn .num { color: var(--danger); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 8px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar span { display: block; width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar small { font-size: .7rem; color: var(--muted); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: 110px 1fr 44px; gap: 8px; align-items: center; font-size: .9rem; }
.hbars b { text-align: right; font-variant-numeric: tabular-nums; }
.hbar { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar span { display: block; height: 100%; background: var(--accent); }
tr.failed td { background: color-mix(in srgb, var(--warn) 7%, transparent); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 10px 0; border-top: 1px solid var(--border); }
ul.plain li:first-child { border-top: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- Dezente Garten-Grafiken */
.garden-strip { display: block; width: 100%; height: 46px; color: var(--accent); opacity: .5; }
.garden-strip path, .garden-strip line, .garden-strip circle { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.site-footer { position: relative; }
.footer-art { width: min(1100px, 100% - 32px); margin: 0 auto; padding-top: 10px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--accent); opacity: .55; margin: 8px 0 16px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid currentColor; opacity: .5; }
.divider .icon { width: 18px; height: 18px; }
.feature { background: color-mix(in srgb, var(--surface) 80%, transparent); border-radius: var(--radius); padding: 14px; }
.feature .icon { width: 34px; height: 34px; }
.card { position: relative; }
.card-art { position: absolute; right: 16px; bottom: 14px; width: 64px; height: 64px; color: var(--accent); opacity: .18; stroke-width: 1.2; pointer-events: none; }
.member-list .list-label {
  list-style: none; padding: 14px 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  border-top: 1px solid var(--border);
}
.member-list .list-label:first-child { border-top: 0; padding-top: 6px; }
.member-list .list-label + .member-row { border-top: 0; }

/* ---------- Downloads */
.downloads { list-style: none; margin: 0; padding: 0; }
.downloads li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.downloads li:first-child { border-top: 0; }
.dl-text { display: flex; flex-direction: column; min-width: 0; }
.file-badge {
  width: 42px; height: 50px; border-radius: 6px 14px 6px 6px; border: 1.5px solid var(--accent); color: var(--accent);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-size: .7rem; font-weight: 800; letter-spacing: .04em;
}

/* ---------- Eigenes Menü (ganz rechts) */
.user-menu { position: relative; margin-left: 6px; }
.user-button {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: .9rem; color: var(--fg); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px 4px 4px;
}
.user-button:hover, .user-button.active { border-color: var(--accent); }
.user-button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.user-button .caret { font-size: .7rem; color: var(--muted); }
.avatar.xs { width: 26px; height: 26px; font-size: .7rem; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / 14%);
  padding: 6px; display: flex; flex-direction: column;
}
.user-dropdown .user-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-dropdown .user-head .pill { align-self: flex-start; margin-top: 2px; }
.user-dropdown a, .user-dropdown .logout {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--fg);
  font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; text-align: left;
}
.user-dropdown a:hover, .user-dropdown .logout:hover { background: var(--surface-2); }
.user-dropdown a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.user-dropdown .icon { width: 18px; height: 18px; color: var(--accent); }
.user-dropdown .logout { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; color: var(--danger); }
.user-dropdown .logout .icon { color: var(--danger); }
@media (max-width: 960px) {
  /* Im aufgeklappten Handy-Menü steht das eigene Menü offen unten in der Liste */
  .user-menu { margin: 6px 0 0; border-top: 1px solid var(--border); padding-top: 6px; }
  .user-button { display: none; }
  .user-dropdown, .user-dropdown[hidden] { display: flex !important; position: static; box-shadow: none; border: 0; padding: 0; min-width: 0; }
}

/* ---------- Hinweise, Fortschritt, Zähler */
.notice { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; border-color: var(--accent); background: var(--accent-soft); }
.notice .icon { width: 28px; height: 28px; color: var(--accent); flex: none; }
.notice .u { text-decoration: underline; }
.meter-photo { max-width: 260px; border-radius: 10px; display: block; cursor: zoom-in; }
.meter-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; }
.progress { height: 12px; background: var(--surface-2); border-radius: 8px; overflow: hidden; margin: 8px 0; }
.progress span { display: block; height: 100%; background: var(--accent); }
textarea.tall { min-height: 260px; font-size: .9rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Menü-Trenner, Fußzeile */
.user-dropdown .menu-sep { display: block; border-top: 1px solid var(--border); margin: 4px 0; }
.footer-links a { color: var(--muted); }

/* ---------- Vereinscloud */
.crumbs { margin: 0 0 12px; font-size: .95rem; overflow-wrap: anywhere; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: grid; grid-template-columns: 1fr 110px 100px auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); }
.files li:first-child { border-top: 0; }
.files .fname { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--fg); min-width: 0; }
.files .fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .fname .icon { color: var(--accent); width: 20px; height: 20px; }
.files .fname:hover span { text-decoration: underline; }
@media (max-width: 640px) {
  .files li { grid-template-columns: 1fr auto; }
  .files li > span:nth-of-type(2) { display: none; }
}
.cloud-hide { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }

/* ---------- Lageplan */
.plan-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.plan { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-width: 640px; margin: 0 auto; user-select: none; }
.plan img { display: block; width: 100%; height: auto; }
.plan.editing { cursor: crosshair; outline: 3px dashed var(--accent); outline-offset: 2px; }
.pin {
  position: absolute; transform: translate(-50%, -50%); min-width: 28px; height: 22px; padding: 0 5px; border-radius: 11px;
  border: 1.5px solid #fff; font: 700 .72rem/1 system-ui, sans-serif; color: #fff; cursor: pointer;
  background: rgb(47 107 58 / 88%); box-shadow: 0 1px 4px rgb(0 0 0 / 45%);
}
.pin.frei { background: #1f9d55; box-shadow: 0 0 0 4px rgb(31 157 85 / 35%), 0 1px 4px rgb(0 0 0 / 45%); }
.pin.reserviert { background: #b7791f; }
.pin.gemeinschaft { background: #4a5568; }
.pin.sel { outline: 3px solid #fff; z-index: 2; transform: translate(-50%, -50%) scale(1.15); }
.pin.demo { position: static; transform: none; display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; cursor: default; }
.legend li { display: flex; align-items: center; padding: 6px 0; }
.plan-side { position: sticky; top: 84px; }
@media (max-width: 860px) { .plan-wrap { grid-template-columns: 1fr; } .plan-side { position: static; } }

/* ---------- Umfragen */
.poll { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); display: grid; gap: 8px; }
.poll > strong { display: flex; gap: 6px; align-items: center; }
.poll > strong .icon { color: var(--accent); width: 18px; height: 18px; }
.poll-opt { display: grid; grid-template-columns: auto minmax(80px, 1fr) minmax(60px, 2fr) 30px; gap: 8px; align-items: center; cursor: pointer; }
.poll-opt:not(:has(.poll-bar)) { grid-template-columns: auto 1fr; }
.poll-opt.mine .poll-label { font-weight: 700; }
.poll-bar { height: 8px; background: var(--surface); border-radius: 5px; overflow: hidden; }
.poll-bar span { display: block; height: 100%; background: var(--accent); }
.poll-opt b { text-align: right; font-variant-numeric: tabular-nums; }
.poll-fields { border: 1px dashed var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.legal p { white-space: normal; }
