:root {
  --bg: #f6f3ee; --card: #fff; --ink: #1d2a30; --muted: #5d6b72; --line: #e3ddd3;
  --accent: #1f5f7a; --accent-ink: #fff; --warn: #b8860b; --alarm: #b3261e; --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12181b; --card: #1b2327; --ink: #e8ecee; --muted: #9aa8af; --line: #2c373c; --accent: #5fb0cf; --accent-ink: #0d1316; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1600px; margin: 0 auto; padding-inline: 20px; }
@media (max-width: 760px) { .wrap { padding-inline: 12px; } }

.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; gap: 12px; align-items: center; padding-block: 10px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.search { flex: 1 1 180px; }
.search input { width: 100%; }
.me { display: flex; gap: 12px; align-items: center; }
.lang { font-weight: 600; font-size: .85rem; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
textarea { resize: vertical; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 600; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

main { padding-block: 20px 40px; }
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } .rubrics { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; } .rubrics a { white-space: nowrap; } .rubrics .hint { display: none; } }
.rubrics { display: flex; flex-direction: column; gap: 2px; align-self: start; position: sticky; top: 70px; }
.rubrics a { padding: 7px 10px; border-radius: 8px; color: var(--ink); }
.rubrics a.active, .rubrics a:hover { background: var(--card); text-decoration: none; }

.hero { background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.hero h1 { margin: 0 0 6px; font-size: 1.4rem; }
.hero .btn { background: var(--accent-ink); color: var(--accent); }
.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.feed-head h1 { font-size: 1.3rem; margin: 0; }
.lead { color: var(--muted); }
.narrow { max-width: 680px; margin-inline: auto; }

.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-block: 12px; }
.card h2 { font-size: 1.1rem; margin: 4px 0; }
.card h2 a { color: var(--ink); }
.card.held, .comment.held { border-style: dashed; opacity: .8; }
.card.alarm { border-color: var(--alarm); }
.meta { color: var(--muted); font-size: .85rem; }
.meta .rubric { color: var(--muted); font-weight: 600; }
.excerpt { margin: 4px 0 8px; color: var(--ink); white-space: pre-line; max-width: 80ch; }
pre.excerpt { white-space: pre-wrap; font: inherit; }
.foot-row { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.lang-tag, .badge { font-size: .75rem; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.badge.warn { border-color: var(--warn); color: var(--warn); }
.empty, .hint { color: var(--muted); }

.post h1 { margin: 6px 0 10px; font-size: 1.5rem; }
.body p { margin: 0 0 .8em; overflow-wrap: anywhere; max-width: 80ch; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.reactions form { margin: 0; }
.react { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; cursor: pointer; }
.react.on { border-color: var(--accent); }
.comments h2 { font-size: 1.1rem; }
.comment { border-left: 3px solid var(--line); padding: 6px 12px; margin-block: 10px; }
details.report { margin-top: 6px; font-size: .85rem; color: var(--muted); }
details.report summary { cursor: pointer; }
details.report form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
details.report select, details.report input { width: auto; flex: 1 1 160px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.stack label.check { flex-direction: row; gap: 8px; font-weight: 400; align-items: flex-start; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row form { margin: 0; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; background: #e3f1e6; color: #1d4d2a; }
.flash.info { background: #e6eef6; color: #1f3d5a; }
.flash.error { background: #f8e3e1; color: #6b1a14; }
.pager { display: flex; justify-content: space-between; margin-top: 16px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
td, th { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.prose h1 { font-size: 1.4rem; }
.foot { color: var(--muted); font-size: .85rem; padding-block: 20px 40px; text-align: center; }

/* Familien-Karte & Kontakte */
.map { height: max(480px, calc(100vh - 240px)); border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.map.small { height: 360px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .map-layout { grid-template-columns: 1fr; } .map { height: 420px; } }
.map-panel { margin: 0; max-height: max(480px, calc(100vh - 240px)); overflow-y: auto; }
.map-panel h2 { font-size: 1.05rem; margin-top: 0; }
.map-hero { padding: 0; overflow: hidden; }
.map-hero .map.hero-map { height: clamp(380px, 58vh, 640px); border: 0; border-radius: 0; }
.map-hero-text { display: flex; gap: 12px 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; }
.map-hero-text h2 { margin: 0 0 4px; font-size: 1.2rem; }
.map-hero-text p { margin: 0; }
.map-hero-text .lead { color: var(--ink); font-weight: 600; }
.map-hero-text > div { flex: 1 1 420px; }
@media (max-width: 760px) { .map-hero .map.hero-map { height: 340px; } }
.family-card, .contact-row { display: block; color: var(--ink); }
.family-card:hover, .contact-row:hover { text-decoration: none; border-color: var(--accent); }
.contact-row { display: flex; justify-content: space-between; gap: 8px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; gap: 12px; }
fieldset legend { font-weight: 600; padding-inline: 4px; }
input[type=date] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); width: auto; }
.msg { border-left: 3px solid var(--line); padding: 6px 12px; margin-block: 10px; }
.msg.mine { border-left-color: var(--accent); }
.msg.first { background: var(--bg); border-radius: 0 8px 8px 0; }
.nav-badge { background: var(--alarm); color: #fff; border-radius: 10px; padding: 0 6px; font-size: .75rem; margin-left: 2px; }
