/* Diskussionsboard – handgeschriebenes CSS, hell und dunkel. */
:root {
  --bg: #f6f4ef; --card: #ffffff; --ink: #1c1917; --muted: #6b645c; --line: #ddd8ce; --accent: #b91c1c; --accent-ink: #fff;
  --soft: #efece5; --human: #334155; --err: #b91c1c; --ok: #15803d; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 14px rgb(0 0 0 / .05);
  --radius: 10px; color-scheme: light dark;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151312; --card: #1f1c1a; --ink: #ece8e1; --muted: #a39b90; --line: #3a3531; --accent: #ef4444; --accent-ink: #1a0606;
    --soft: #292522; --human: #94a3b8; --err: #f87171; --ok: #4ade80; --shadow: 0 1px 2px rgb(0 0 0 / .4); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .6rem; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 1.8rem 0 .5rem; }
p { margin: 0 0 .8rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: .9rem; }
.err { color: var(--err); font-size: .9rem; }
.lead { color: var(--muted); max-width: 62ch; }

/* Kopf und Fuß */
#nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem max(1rem, calc((100vw - 1100px) / 2)); border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
#nav .brand { font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
#nav .bear { color: var(--accent); }
#nav nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
#nav nav a { color: var(--muted); text-decoration: none; padding: .3rem .6rem; border-radius: 6px; font-size: .93rem; }
#nav nav a:hover { background: var(--soft); color: var(--ink); }
#nav nav a.on { color: var(--ink); background: var(--soft); font-weight: 600; }
.langbtn { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 6px; padding: .2rem .5rem; cursor: pointer; font: inherit; font-size: .8rem; }
#app { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
#foot { text-align: center; padding: 1rem; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); }
#foot a { color: var(--muted); }

/* Bausteine */
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: .4rem; }
.spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: .5rem .9rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--err); }
.btn.small { padding: .25rem .6rem; font-size: .85rem; font-weight: 500; }
.btn.active { background: var(--soft); border-color: var(--muted); }
.btn.disabled, .btn:disabled { opacity: .45; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: .85rem; text-decoration: underline; text-align: left; }
.icon { background: none; border: 0; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 .3rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; }
textarea { resize: vertical; min-height: 3.2rem; }
select { cursor: pointer; }
.field { display: grid; gap: .25rem; margin-bottom: .8rem; }
.field .lbl { font-size: .85rem; font-weight: 600; }
.field small { color: var(--muted); font-size: .8rem; }
.check { display: flex; gap: .5rem; align-items: flex-start; margin: .2rem 0 .8rem; font-size: .93rem; cursor: pointer; }
.check input { margin-top: .3rem; }
.form { max-width: 760px; }
.form .tiles { max-width: none; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.hero { padding: 1rem 0 .5rem; }
.privacy-note { margin-top: 1.2rem; font-size: .88rem; color: var(--muted); border-left: 3px solid var(--ok); padding-left: .8rem; max-width: 70ch; }
.list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; color: var(--ink); text-decoration: none; }
a.list-row:hover { border-color: var(--muted); }
.prose { max-width: 68ch; }
code { background: var(--soft); border-radius: 4px; padding: .05em .3em; font-size: .9em; }

/* Teilnehmerkacheln */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin: 1rem 0 1.4rem; align-items: start; }
.tile { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--line)); border-radius: var(--radius); padding: .9rem; box-shadow: var(--shadow); }
.tile:not(.done) { border-style: dashed; border-top-style: solid; }
.tile-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.tile-head .name { font-weight: 700; }
.tile.add { display: grid; place-items: center; gap: .3rem; min-height: 180px; border: 2px dashed var(--line); border-radius: var(--radius); background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; box-shadow: none; }
.tile.add:hover { border-color: var(--accent); color: var(--accent); }
.tile.add .plus { font-size: 2.2rem; line-height: 1; }
.keyform { background: var(--soft); border-radius: 8px; padding: .7rem; margin-bottom: .8rem; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--c, var(--muted)); flex: none; display: inline-block; }
.dot.pulse { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } }

/* Diskussion */
.thread { max-width: 860px; margin: 0 auto; }
.thread-head .controls { margin: .2rem 0 1rem; }
.thread-head select { width: auto; padding: .3rem .5rem; font-size: .9rem; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.chip { display: grid; grid-template-columns: auto 1fr; column-gap: .45rem; align-items: center; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem .35rem .65rem; font: inherit; color: var(--ink); cursor: pointer; min-width: 9rem; }
.chip.human { cursor: default; min-width: 0; }
.chip-name { font-weight: 600; font-size: .9rem; }
.chip-meta { grid-column: 2; font-size: .72rem; color: var(--muted); }
.chip .bar { grid-column: 1 / -1; height: 3px; background: var(--soft); border-radius: 2px; overflow: hidden; margin-top: .15rem; }
.chip .bar span { display: block; height: 100%; background: var(--c); }
.chip.busy { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); }
.chip.next { border-style: dashed; border-color: var(--c); }
.chip.out, .chip.muted-chip { opacity: .5; }
.entries { display: grid; gap: .9rem; }
.entry { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--line)); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); }
.entry.human { background: var(--soft); }
.entry.live { margin-top: .9rem; border-style: dashed; border-left-style: solid; }
.entry header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; font-size: .9rem; }
.entry header time, .entry .usage { color: var(--muted); font-size: .78rem; }
.entry header .link { opacity: 0; font-size: .78rem; }
.entry:hover header .link, .entry header .link:focus-visible { opacity: 1; }
@media (hover: none) { .entry header .link { opacity: 1; } }
.entry .sources, .entry .hint { margin-top: .5rem; font-size: .8rem; color: var(--muted); }
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md h2, .md h3, .md h4, .md h5, .md h6 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
.entry.opening .md h2:first-child { font-size: 1.3rem; }
.md ul, .md ol { padding-left: 1.4rem; margin: 0 0 .8rem; }
.md blockquote { margin: 0 0 .8rem; padding-left: .8rem; border-left: 3px solid var(--line); color: var(--muted); }
.md pre { background: var(--soft); border-radius: 8px; padding: .7rem; overflow-x: auto; font-size: .88rem; }
.md pre code { background: none; padding: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.tablewrap { overflow-x: auto; margin-bottom: .8rem; }
.md table { border-collapse: collapse; font-size: .9rem; }
.md th, .md td { border: 1px solid var(--line); padding: .3rem .6rem; text-align: left; vertical-align: top; }
.tag { font-weight: 600; color: var(--accent); white-space: nowrap; }
.line { display: flex; gap: .5rem; align-items: baseline; font-size: .85rem; color: var(--muted); padding: 0 1rem; }
.line .dot { align-self: center; width: .5rem; height: .5rem; }
.line.note { font-style: italic; display: block; }
.line.error { color: var(--err); display: block; overflow-wrap: anywhere; }
.compaction { border: 1px dashed var(--line); border-radius: var(--radius); padding: .5rem 1rem; font-size: .88rem; color: var(--muted); }
.compaction summary { cursor: pointer; }
.compaction .md { margin-top: .6rem; color: var(--ink); }
.status { margin: 1rem 0 0; padding: .5rem .9rem; background: var(--soft); border-radius: 8px; font-size: .9rem; }
.composer { margin-top: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; position: sticky; bottom: .5rem; box-shadow: var(--shadow); }
.composer.waiting { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.your-turn { font-weight: 700; color: var(--accent); margin-bottom: .4rem; }
.tagrow { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin: .4rem 0 .6rem; }
.tagbtn { border: 1px solid var(--line); background: var(--soft); color: var(--ink); border-radius: 999px; padding: .1rem .6rem; font: inherit; font-size: .8rem; cursor: pointer; }
.tagbtn:hover { border-color: var(--accent); color: var(--accent); }

/* Dialog und Hinweis */
.modal { border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); padding: 1.3rem; width: min(520px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.modal::backdrop { background: rgb(0 0 0 / .45); }
.modal h2 { margin: 0 0 .8rem; }
.modal .actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; font-size: .9rem; z-index: 50; max-width: calc(100vw - 2rem); }
.toast.err { background: var(--err); color: #fff; }
@media (max-width: 560px) { h1 { font-size: 1.4rem; } .composer { position: static; } #nav { gap: .4rem; } }
