:root {
  --bg: #faf8f4;
  --card: #ffffff;
  --ink: #2b2a27;
  --muted: #7a756c;
  --accent: #7a5c2e;
  --accent-soft: #efe7d8;
  --border: #e4ded2;
  --danger: #a03b2e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191816;
    --card: #211f1c;
    --ink: #e8e4dc;
    --muted: #9b958a;
    --accent: #c9a86a;
    --accent-soft: #33302a;
    --border: #383530;
    --danger: #d47a6c;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 Georgia, "Times New Roman", serif;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 1.25rem; }

header { border-bottom: 1px solid var(--border); padding: 0.9rem 0; }
header .wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: bold; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
nav { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; font-family: system-ui, sans-serif; font-size: 0.9rem; }
nav a { color: var(--accent); text-decoration: none; }
nav a:hover { text-decoration: underline; }
.search input { padding: 0.3rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--ink); }

main { padding: 1.5rem 1.25rem 3rem; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.7rem; }
a { color: var(--accent); }
.lede { color: var(--muted); font-style: italic; }
.stats { color: var(--muted); font-family: system-ui, sans-serif; font-size: 0.85rem; }

.columns { display: grid; grid-template-columns: 3fr 2fr; gap: 2rem; }
@media (max-width: 720px) { .columns { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 0 0 1rem;
}
.note-card blockquote {
  margin: 0;
  font-size: 1.08rem;
  font-style: italic;
}
.note-card.quote { border-left: 3px solid var(--accent); }
.note-card p { margin: 0; white-space: pre-line; }
.note-meta {
  margin-top: 0.6rem;
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.note-meta .author { color: var(--ink); }
.note-meta .permalink { margin-left: auto; color: var(--muted); text-decoration: none; }
.note-meta .permalink:hover { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.chip {
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
}
.chip:hover { filter: brightness(0.95); }
.chip-topic {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: calc(0.15rem - 1px) calc(0.6rem - 1px);
}
.chip-topic:hover { filter: none; border-color: var(--accent); color: var(--accent); }

.idea-index { list-style: none; padding: 0; }
.idea-index li { padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.idea-name { font-size: 1.05rem; text-decoration: none; }
.idea-index .count {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.5rem;
}
.idea-index .desc { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.92rem; }

.poll-card h2, .poll-card h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.pollination .body { font-size: 1.05rem; }
.date { color: var(--muted); font-family: system-ui, sans-serif; font-size: 0.8rem; }

.empty { color: var(--muted); font-style: italic; }
.flash {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  margin-bottom: 1rem;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

form.inline { display: inline; }
button, .button {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .button:hover { filter: brightness(1.1); }
button.danger { background: var(--danger); }

.edit-form label, .login-form { display: block; margin-bottom: 0.9rem; font-family: system-ui, sans-serif; font-size: 0.9rem; }
.edit-form input[type=text], .edit-form textarea, .edit-form select, .login-form input,
.big-search input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  margin-top: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.big-search { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.big-search input { margin-top: 0; }
.hint { color: var(--muted); font-weight: normal; }
.login-form { max-width: 320px; }
.login-form button { margin-top: 0.5rem; }

.pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}
ul.plain { list-style: none; padding: 0; }
ul.plain li { padding: 0.3rem 0; }
.admin-actions { margin-top: 1.5rem; display: flex; gap: 0.6rem; }

footer { border-top: 1px solid var(--border); padding: 1rem 0 2rem; color: var(--muted); font-family: system-ui, sans-serif; font-size: 0.85rem; }
