:root {
  --bg: #fbfaf7;
  --fg: #1f1d1a;
  --muted: #6b665e;
  --accent: #8a3b12;
  --border: #e4dfd6;
  --notice: #fff4d6;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1917;
    --fg: #ece8e1;
    --muted: #a39d93;
    --accent: #e08a5a;
    --border: #35322d;
    --notice: #3a3220;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); }
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem; flex: 1; }

.site-header, .site-footer {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
}
.site-footer { border-top: 1px solid var(--border); border-bottom: 0; justify-content: center; font-size: .9rem; }
.site-header nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--fg); }

.muted { color: var(--muted); }
.notice { background: var(--notice); padding: .75rem 1rem; border-radius: 6px; }
.messages { list-style: none; padding: 0; }
.messages li { background: var(--notice); padding: .5rem 1rem; border-radius: 6px; margin-bottom: .5rem; }

.button, button {
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: .45rem .9rem; font: inherit; cursor: pointer; text-decoration: none;
}
button.link { background: none; color: var(--accent); padding: 0; text-decoration: underline; }
form.inline { display: inline; }

input, textarea, select {
  font: inherit; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: inherit; max-width: 100%;
}

h1 { line-height: 1.2; }
.lead { font-size: 1.15rem; margin-top: -.5rem; }
.grow { flex: 1; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.searchbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.searchbar input[type=search] { flex: 1; min-width: 12rem; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

.badge {
  display: inline-block; font-size: .78rem; padding: .05rem .5rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}
.badge.accent { border-color: var(--accent); color: var(--accent); }

.book-list, .plain-list { list-style: none; padding: 0; margin: 0; }
.book-list > li { border-bottom: 1px solid var(--border); padding: .6rem 0; }
.book-row { display: flex; gap: .9rem; align-items: center; }
.cover { width: 48px; height: 72px; object-fit: cover; border-radius: 3px; background: var(--border); flex: none; }
.cover-empty { display: block; }
.cover-lg { width: 160px; border-radius: 4px; }
.book-detail { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 1rem; padding: 0; list-style: none; }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.card h2, .card h3 { margin-top: 0; font-size: 1.1rem; }
.section { margin: 2rem 0; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap { overflow-x: auto; }

.stack { display: flex; flex-direction: column; gap: 1rem; max-width: 640px; }
.field { display: flex; flex-direction: column; gap: .25rem; }
.field-check { flex-direction: row; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.field ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.error, .errors { color: #b3261e; }
.has-error input, .has-error select, .has-error textarea { border-color: #b3261e; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.danger { background: #b3261e; }

.pagination { display: flex; gap: 1rem; margin-top: 1rem; }
.tabs { display: flex; gap: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .4rem 0; text-decoration: none; }
.tabs a.active { border-bottom: 2px solid var(--accent); font-weight: 600; }

.stages { list-style: none; padding: 0; margin: 0; counter-reset: stage; }
.stage { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.stage.is-read strong { color: var(--accent); }
.triggers { margin: .5rem 0; }
.triggers summary { cursor: pointer; color: var(--muted); }
.discovery { display: flex; flex-direction: column; gap: .75rem; margin: 1rem 0; }
.discovery input[type=search] { width: 100%; }
.filter-panel summary { cursor: pointer; color: var(--accent); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; align-items: end; margin-top: .75rem; }
.filters .field-wide { grid-column: 1 / -1; }
.genres { border: 1px solid var(--border); border-radius: 6px; }
.genres ul, .genres div { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.messages-list { display: flex; flex-direction: column; gap: .75rem; margin: 1rem 0; }
.msg { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; }
.msg header { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.msg-text { margin: .3rem 0; overflow-wrap: anywhere; }
.msg-placeholder { opacity: .7; }
.msg-actions { display: flex; gap: .8rem; font-size: .85rem; }
.msg-actions button.link { color: var(--muted); }
.msg-actions .danger-link { color: #b3261e; }
.reply-quote { margin: .2rem 0; padding-left: .6rem; border-left: 3px solid var(--border); color: var(--muted); font-size: .9rem; }
.chat-form { display: flex; flex-direction: column; gap: .5rem; position: sticky; bottom: 0; background: var(--bg); padding: .5rem 0; }
.chat-form textarea { width: 100%; }
.reply-hint { font-size: .9rem; color: var(--muted); }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex;
  align-items: center; justify-content: center; background: var(--border); color: var(--muted); font-weight: 600; vertical-align: middle; }
.avatar-lg { width: 96px; height: 96px; font-size: 2rem; }
.profile-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.profile-head h1 { margin: 0; }
.person { display: inline-flex; gap: .4rem; align-items: center; text-decoration: none; }

.bell { text-decoration: none; position: relative; }
.bell .count { background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .35rem; margin-left: .15rem; }
li.unread a { font-weight: 600; }

.rating { margin: .75rem 0; display: flex; flex-direction: column; gap: .3rem; }
button.score { min-width: 2.2rem; padding: .3rem .5rem; }

.map-panel { margin: 1rem 0; }
.map-panel summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.map-tools { margin: .75rem 0; }
#map { height: 420px; border-radius: 8px; border: 1px solid var(--border); }
.map-list li { padding: .3rem 0; border-bottom: 1px solid var(--border); font-size: .92rem; }

.report { margin-top: 2rem; font-size: .9rem; }
.report summary { cursor: pointer; color: var(--muted); }

.danger-link { color: #b3261e; }

/* Honeypot-Feld der Registrierung: für Menschen unsichtbar */
input[name="website"], label[for="id_website"] { position: absolute; left: -10000px; }
