:root {
  --bg: #f4efe4;
  --bg-2: #ebe3d2;
  --card: #fffbf3;
  --ink: #2a2a22;
  --ink-2: #5b5a4c;
  --line: #ddd2bb;
  --green: #2f6b45;
  --green-2: #3f8a5a;
  --green-soft: #e1eedf;
  --amber: #b5741c;
  --amber-soft: #f8ead2;
  --plum: #7b4a8c;
  --plum-soft: #efe3f2;
  --red: #b0412e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 6px 24px rgba(60, 45, 20, .06);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Nunito Sans', system-ui, -apple-system, Segoe UI, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a15; --bg-2: #1f231c; --card: #22271f; --ink: #ece8dc; --ink-2: #a9a693;
    --line: #353b30; --green: #7cc596; --green-2: #95d6ab; --green-soft: #22382a;
    --amber: #e3a650; --amber-soft: #3a2f1e; --plum: #c9a0d8; --plum-soft: #34283a; --red: #ec8a77;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans);
  background-image: radial-gradient(circle at 15% 0%, var(--bg-2) 0, transparent 40%);
}
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
a { color: var(--green); }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; display: grid; }
.usermenu-pop a, .usermenu-pop button { text-align: left; padding: 10px 12px; border-radius: 8px; border: 0; background: none; color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; }
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--bg-2); }

/* Buttons */
.btn { font: 600 .95rem var(--sans); border-radius: 999px; padding: 10px 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #10180f; } }
.btn-primary:hover { background: var(--green-2); }
.btn-concept { background: var(--amber-soft); border-color: transparent; color: var(--ink); }
.btn-icon { padding: 6px 12px; }
.btn-danger { color: var(--red); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; padding: 40px 0 28px; align-items: start; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--green); margin: 0 0 8px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.stats span { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .85rem; color: var(--ink-2); }
.howto { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.howto li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px 56px; position: relative; font-size: .95rem; }
.howto li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--green-soft); color: var(--green); font: 700 1rem var(--serif); display: grid; place-items: center; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; padding-top: 24px; gap: 20px; } }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 24px; }
.idea textarea { width: 100%; font: 1rem/1.5 var(--sans); padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; min-height: 140px; }
.idea textarea:focus, input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.idea-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
#ideaResult { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 16px; }
.working { display: flex; gap: 12px; align-items: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--green-soft); border-top-color: var(--green); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

label { display: grid; gap: 4px; font-weight: 600; margin-bottom: 12px; font-size: .92rem; }
input, textarea, select { font: 1rem var(--sans); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
.form-error { color: var(--red); font-weight: 600; margin: 0 0 10px; }
.auth { max-width: 460px; margin-left: auto; margin-right: auto; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { font: 600 .95rem var(--sans); background: none; border: 0; padding: 10px 14px; color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.active { color: var(--ink); border-bottom-color: var(--green); }
.dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--amber); color: #fff; font-size: .75rem; padding: 0 5px; margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { font: 600 .85rem var(--sans); border: 1px solid var(--line); background: var(--card); color: var(--ink-2); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Proposals */
.proposal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.proposal, .mine { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.proposal header { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.proposal h3 { margin-bottom: 4px; font-size: 1.05rem; }
.proposal p { margin: 0 0 8px; }
.cat { font-size: .78rem; color: var(--ink-2); }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-integriert { background: var(--green-soft); color: var(--green); }
.badge-vermerkt { background: var(--amber-soft); color: var(--amber); }
.badge-offene_frage { background: var(--plum-soft); color: var(--plum); }
.reason { font-size: .88rem; padding: 8px 10px; border-radius: 8px; background: var(--bg); color: var(--ink-2); }
.reason-vermerkt { border-left: 3px solid var(--amber); }
.reason-offene_frage { border-left: 3px solid var(--plum); }
.reason-integriert { border-left: 3px solid var(--green); }
.mine { margin-bottom: 12px; }
.mine blockquote { margin: 0 0 6px; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--ink-2); font-style: italic; }
.ai-reply { background: var(--green-soft); padding: 10px 12px; border-radius: 10px; margin: 8px 0; }
.mini-proposal { padding: 8px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.empty { text-align: center; color: var(--ink-2); padding: 28px 12px; }

/* Voting */
.vote-banner { display: block; margin: 16px 0 0; background: var(--plum-soft); color: var(--ink); padding: 12px 16px; border-radius: 12px; text-decoration: none; border: 1px solid color-mix(in srgb, var(--plum) 30%, transparent); }
.round { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.vote-q { padding: 14px 0; border-top: 1px solid var(--line); }
.vote-q h4 { font-size: 1.05rem; margin-bottom: 4px; }
.vote-opts { display: grid; gap: 8px; margin-top: 10px; }
.vote-opt { position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 10px; text-align: left; font: 600 .95rem var(--sans); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.vote-opt .bar { position: absolute; inset: 0 auto 0 0; background: var(--plum-soft); transition: width .4s; z-index: 0; }
.vote-opt .lbl, .vote-opt .cnt { position: relative; z-index: 1; }
.vote-opt .cnt { color: var(--ink-2); font-weight: 400; font-size: .85rem; white-space: nowrap; }
.vote-opt.chosen { border-color: var(--plum); box-shadow: inset 0 0 0 1px var(--plum); }
.sub { margin-top: 26px; }
.qlist { padding-left: 20px; }
.qlist li { margin-bottom: 8px; }

/* Dialogs */
.dlg { border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); padding: 22px; width: min(480px, calc(100vw - 24px)); box-shadow: var(--shadow); }
.dlg-wide { width: min(820px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
.dlg::backdrop { background: rgba(20, 18, 10, .45); }
.dlg-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; border-bottom: 1px solid var(--line); margin-bottom: 14px; padding-bottom: 10px; position: sticky; top: -22px; background: var(--card); padding-top: 4px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.prose h2 { font-size: 1.35rem; margin-top: 1.2em; }
.prose h3 { font-size: 1.12rem; margin-top: 1.1em; color: var(--green); }
.prose h4 { font-size: 1rem; margin-top: 1em; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose blockquote { border-left: 3px solid var(--line); margin: 8px 0; padding: 4px 12px; color: var(--ink-2); }
.prose code { background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.intro p:first-child { margin-top: 0; }
.history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.history summary { cursor: pointer; font-weight: 600; }
.history ul { padding-left: 18px; font-size: .92rem; }

.foot { padding: 30px 16px 40px; text-align: center; }

/* Admin */
.admin-grid { display: grid; gap: 20px; padding: 24px 0; }
.admin-grid textarea { min-height: 160px; font-family: ui-monospace, Menlo, monospace; font-size: .9rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions .btn { padding: 5px 10px; font-size: .82rem; }
.ann { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; white-space: pre-wrap; background: var(--bg); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; z-index: 100; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto; }
@media (max-width: 420px) { .lbl-long { display: none; } .btn-concept { padding: 8px 12px; } .brand { font-size: 1.1rem; } }
.lbl-short { display: none; } @media (max-width: 420px) { .lbl-short { display: inline; } }

.badge-aufwand { background: var(--bg-2); color: var(--ink-2); font-weight: 600; }
.aufwand-XL { background: var(--amber-soft); color: var(--amber); }
.feasibility summary { cursor: pointer; list-style: none; }
.feasibility summary::-webkit-details-marker { display: none; }
.feasibility summary::before { content: "▸ "; color: var(--green); }
.feasibility[open] summary::before { content: "▾ "; }
.feasibility .prose { margin-top: 12px; font-size: .95rem; }
.prose table { margin: 10px 0; }
.prose td, .prose th { font-size: .9rem; }
.prose .table-scroll table { min-width: 600px; }
